汇编的宏问题,请大家帮个忙!
我利用宏编了一个指令CLRB
该宏是用空格将字符区的替换掉!
可是我在调用时出现了错误!提示我:
这条指令clrb ary,count 上有个错误:EXTRA CHARACTERS ON LINE
程序如下,请问怎么改正!
;This is a Macro program for use blank
;**********************************************************
clrb macro addr,len ;define a macro
mov ax,' ' ;blank
mov ax,&len ;get the times of loop
div ax,2
mov ah,0
mov cx,ax
lea bx,&addr ;get the first address of string
next:
mov bx,ax ;replace char with blank
add bx,2
loop next
endm
;**********************************************************
;This is a main program for repalce string
.386
data segment
ary db "String is null"
count dw 12
data ends
code segment
assume cs:code,ds:data
main proc far
mov ax,data
mov ds,ax
clrb ary,count
mov dl,ary[4]
mov ah,2
int 21h
mov ah,4ch
int 21h
main endp
code ends
end main