下面是代码 ,我只写了输出第一行的内容:
assume cs:code,ds:data
data segment
db 'welcome to masm!'
data ends
code segment
start: mov ax,code
mov cs,ax ---这里提示有错
mov ax,data
mov ds,ax
mov si,0
mov ax,b800h ---这里提示有错!
mov es,ax
mov di,0
mov cx,10h
s: mov al,ds:[si].0
mov es:[di].0,al
mov al,02h
mov es:[di].1,al
add si,2
add di,2
loop s
mov ax,4c00h
int 21h
code ends
end start
下面是编译的结果:
G:\try>masm 2.asm
Microsoft (R) Macro Assembler Version 5.00
Copyright (C) Microsoft Corp 1981-1985, 1987. All rights reserved.
Object filename [2.OBJ]:
Source listing [NUL.LST]:
Cross-reference [NUL.CRF]:
2.asm(8): error A2059: Illegal use of CS register
2.asm(14): error A2009: Symbol not defined: B800H
50166 + 449866 Bytes symbol space free
0 Warning Errors
2 Severe Errors
G:\try>
谢谢! |