|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
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
mov cx,3
s: push cx
mov cx,16
call s2
loop s
s2: mov al,ds:[bx]
mov es:[si],al
inc bx
inc si
mov dx,ds:[di]
mov es:[si],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 dinefindassume 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:[si]
mov es:[di],al
inc si
add di,2
loop s1
mov di,1
pop bx
mov al,ds:[bx+10h]
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
本帖最后由 myunco 于 2021-5-13 13:28 编辑
都报错到第13行了,你就不仔细看看吗··· mov ax ,data
你的逗号呢
附上我的实验9代码供参考:
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,[si]
mov es:[bx],ax
mov ah,24h ;00100100
mov al,[si]
mov es:[bx].0A0h,ax
mov ah,71h ;01110001
mov al,[si]
mov es:[bx].0A0h.0A0h,ax
inc si
add bx,2
loop lp
mov ax,4c00h
int 21h
codesg ends
end start
|
-
|