我是一名
尝试实现 STRCPY的汇编语言初学者,
我的汇编程序“TASM”返回“非法内存引用”错误.. 并尝试阅读有关该错误的信息,但找不到任何内容。
这是代码。
include inout.asm
.Model Small,c
.486
.STACK 200h
.DATA
Arr1 DB "ABCD$"
Arr2 DB "EFGHIJ$"
.CODE
StART: MOV AX, @DATA
MOV DS, AX
LEA Si,Arr1
LEA Di,Arr2
again: cmp Byte PTR [Si], "$"
JNE Ite ; Iterate
JMP Done
Ite: MOV Byte PTR[ Di ],[Si] ; Error Here
Inc Si ; One Byte though
Inc Di ; One Byte though
JMP again
Done: MOV Byte PTR [Di], "$"
call puts, offset Arr2
Call puts, offset Arr1
MOV AH,04CH
MOV AL,0
INT 21h
END START
这就是汇编程序所说的..
C:\TASM\BIN>tasm /zi /z third
Turbo Assembler Version 3.1 Copyright (c) 1988, 1992 Borland International
Assembling file: third.ASM
Ite: MOV Byte PTR[ Di ],[Si] ; Error Here
**Error** third.ASM(18) Illegal memory reference
Error messages: 1
Warning messages: None
Passes: 1
Remaining memory: 415k
顺便说一句我试过
MOV Byte PTR[DI],BYTE PT[SI]
但没有用