我在彙編語言
試圖實現STRCPY
我彙編「TASM」初學者返回一個「非法內存引用」錯誤..並試圖讀取有關錯誤,但無法找到任何東西。非法內存參考
這裏是ma代碼。
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]
但沒有奏效
哎喲..忘了[硅]和[二]是存儲位置..:■謝謝:) – geekybedouin 2013-03-12 18:03:36