帮忙看看这段汇编代码。。老编译不过去。。愁四
代码; 这个很郁闷。。不知道哪错了
assume cs:code
a segment
db 1,2,3,4,5,6,7,8
a ends
b segment
db 1,2,3,4,5,6,7,8
b ends
c segment
db 0,0,0,0,0,0,0,0
c ends
code segment
start:mov ax,a
mov ds,ax
mov ax,b
mov es,ax
mov ax,c
mov ss,ax
mov cx,8
mov bx,0
s:mov al,[bx]
add al,es:[bx]
mov ss:[bx],al
inc bx
loop s
mov 4c00h
int 21h
code ends
end start
编译提示;
Microsoft (R) Macro Assembler Version 5.00
Copyright (C) Microsoft Corp 1981-1985, 1987. All rights reserved.
l:\4.txt(26): error A2056: Immediate mode illegal
50584 + 414504 Bytes symbol space free
0 Warning Errors
1 Severe Errors
C:\DOCUME~1\ADMINI~1>
[解决办法]
c在asm中是key word,所以要改名!!!,另外你mov 4c00h一句没写全:
mov ax,4c00h
assume cs:codea segment db 1,2,3,4,5,6,7,8a endsb segment db 1,2,3,4,5,6,7,8b endsc00 segment db 0,0,0,0,0,0,0,0c00 endscode segmentstart:mov ax,a mov ds,ax mov ax,b mov es,ax mov ax,c00 mov ss,ax mov ax,0 mov bx,0 mov cx,8 s:mov al,ds:[bx] add al,es:[bx] mov ss:[bx],al inc bx loop s mov ax,4c00h int 21hcode endsend start