汇编总是提醒:error a2008::in instruction
assumecs:code,ds:data,ss:stackdatasegmentdb'welcometomasm!'db02h,24h,71hdataendsstack...
assume cs:code,ds:data,ss:stack
data segment
db 'welcome to masm!'
db02h,24h,71h
data ends
stack segment
dw 8 dup(0)
stack ends
code segment
start:mov ax,data
mov ds,ax
mov ax,stack
mov ss,ax
mov sp,10h
xor bx,bx
mov ax,0b872h
mov cx,3
s3:push cx
push ax
push bx
mov es,ax
mov si,0
mov di,0
mov cx,10h
s1:mov al,ds:[si]
mov es:[di],al
inc si
add di,2
loop s1
mov di,1
pop bx
mov al,ds:10h[bx]
inc bx
mov cx,10h
s2:mov es:[di],al
add di,2
loop s2
pop ax
add ax,0ah
pop cx
loop s3
mov 4c00h
int 21h
code ends
end start 展开
data segment
db 'welcome to masm!'
db02h,24h,71h
data ends
stack segment
dw 8 dup(0)
stack ends
code segment
start:mov ax,data
mov ds,ax
mov ax,stack
mov ss,ax
mov sp,10h
xor bx,bx
mov ax,0b872h
mov cx,3
s3:push cx
push ax
push bx
mov es,ax
mov si,0
mov di,0
mov cx,10h
s1:mov al,ds:[si]
mov es:[di],al
inc si
add di,2
loop s1
mov di,1
pop bx
mov al,ds:10h[bx]
inc bx
mov cx,10h
s2:mov es:[di],al
add di,2
loop s2
pop ax
add ax,0ah
pop cx
loop s3
mov 4c00h
int 21h
code ends
end start 展开
2个回答
展开全部
两处错误已经消除,正确程序如下:
assume cs:code,ds:data,ss:stack
data segment
db 'welcome to masm!'
db 02h,24h,71h
data ends
stack segment
dw 8 dup(0)
stack ends
code segment
start:mov ax,data
mov ds,ax
mov ax,stack
mov ss,ax
mov sp,10h
xor bx,bx
mov ax,0b872h
mov cx,3
s3:push cx
push ax
push bx
mov es,ax
mov si,0
mov di,0
mov cx,10h
s1:mov al,ds:[si]
mov es:[di],al
inc si
add di,2
loop s1
mov di,1
pop bx
mov al,ds:10h[bx]
inc bx
mov cx,10h
s2:mov es:[di],al
add di,2
loop s2
pop ax
add ax,0ah
pop cx
loop s3
mov ax, 4c00h
int 21h
code ends
end start
本程序,显示三行彩色文字。
assume cs:code,ds:data,ss:stack
data segment
db 'welcome to masm!'
db 02h,24h,71h
data ends
stack segment
dw 8 dup(0)
stack ends
code segment
start:mov ax,data
mov ds,ax
mov ax,stack
mov ss,ax
mov sp,10h
xor bx,bx
mov ax,0b872h
mov cx,3
s3:push cx
push ax
push bx
mov es,ax
mov si,0
mov di,0
mov cx,10h
s1:mov al,ds:[si]
mov es:[di],al
inc si
add di,2
loop s1
mov di,1
pop bx
mov al,ds:10h[bx]
inc bx
mov cx,10h
s2:mov es:[di],al
add di,2
loop s2
pop ax
add ax,0ah
pop cx
loop s3
mov ax, 4c00h
int 21h
code ends
end start
本程序,显示三行彩色文字。
更多追问追答
追问
我只找到了mov ax,4c00h这个错误,请问还有一个错误在什么地方呢?
追答
data segment
db 'welcome to masm!'
db02h,24h,71h ;DB 和 20H,之间,应该有空格。
data ends
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询