实验九代码,向大佬求解代码问题在哪
assume cs:code,ds:data,ss:stackdata 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
mov cx,3
s: push cx
mov cx,16
call s2
loop s
s2: mov al,ds:
mov es:,al
inc bx
inc si
mov dx,ds:
mov es:,dx
call s3
ret
s3: pop cx
inc di
mov si,0
mov bx,0
mov dx,0
ret
mov ax,4c00h
int 21h
code ends
end start
报错如下
用小甲鱼视屏里的代码执行到push cx时也会报错:instruction or directive
和53行报错:symbol no dinefind
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 ;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:
mov es:,al
inc si
add di,2
loop s1
mov di,1
pop bx
mov al,ds:
inc bx
mov cx,10h
s2: mov es:,al
add di,2
loop s2
pop ax
add ax,0ah
pop cx
loop s3
mov ax,4c00h
int 21h
code ends
end start 截图的报错是上面我自己代码哪里的报错
本帖最后由 myunco 于 2021-5-13 13:28 编辑
都报错到第13行了,你就不仔细看看吗···
start: mov ax data
mov ax,data
你的逗号呢
附上我的实验9代码供参考:
https://z3.ax1x.com/2021/05/13/gBmNE8.png
assume cs:codesg
data segment
db 'welcome to masm!'
data ends
codesg segment
start:
mov ax,data
mov ds,ax
mov ax,0b800h
mov es,ax
mov si,0
mov bx,720h
mov cx,16
lp:
mov ah,2h ;00000010
mov al,
mov es:,ax
mov ah,24h ;00100100
mov al,
mov es:.0A0h,ax
mov ah,71h ;01110001
mov al,
mov es:.0A0h.0A0h,ax
inc si
add bx,2
loop lp
mov ax,4c00h
int 21h
codesg ends
end start
页:
[1]