帮忙看看这个程序吧。
时间:2011-11-27
来源:互联网
dos21 macro A
mov dx,offset A
mov ah,9
int 21h
endm
compare macro X
cmp al,X
endm
data segment
choice db 'input the chioce:','$'
choice1 db '1.hex transfer binanry','$'
choice2 db '2.hex transfer octal','$'
choice3 db '3.hex transfer decimal','$'
buffer1 db 'input the hex number:' ,'$'
buffer2 db 'the binanry number is:','$'
buffer3 db 'the octal number is:','$'
buffer4 db 'the decimal number is:','$'
data ends
program segment
main proc far
assume cs:program,ds:data
start:
push ds
sub ax,ax
push ax
mov ax,data
mov ds,ax
call in_put call crlf
dos21 macro choice
call crlf
dos21 macro choice1
call crlf
dos21 macro choice2
call crlf
dos21 macro choice3
call crlf
mov ah,1
int 21h
compare macro 1
jz disp1
compare macro 2
jz disp2
compare macro 3
jz disp3
disp1: call display1
jmp exit
disp2: call display2
jmp exit
disp3: call display3
jmp exit
call crlf
exit: ret
main endp
in_put proc near dos21 macro buffer1
mov bx,0
new_char:mov ah,1
int 21h
cmp al,30h
jl exit1
sub al,30h
cmp al,10
jl add_to
sub al,7h
cmp al,10
jl exit1
cmp al,15
jg exit1
add_to: mov cl,4
shl bx,cl
mov ah,0
add bx,ax
jmp new_char
exit1: ret
in_put endp
crlf proc near
mov dl,0ah
mov ah,2
int 21h
mov dl,0dh
mov ah,2
int 21h
ret
crlf endp
display1 proc near
mov cx,16
dos21 macro buffer2
rotate: shl bx,1
jc next
mov dl,30h
mov ah,2
int 21h
next: mov dl,31h
mov ah,2
int 21h
loop rotate
ret
display1 endp
display2 proc near
mov cx,100000o
call trans
mov cx,10000o
call trans
mov cx,1000o
call trans
mov cx,100o
call trans
mov cx,10o
call trans
mov cx,1o
add bl,30h
mov dl,bl
mov ah,2
int 21h
exit2: ret
display2 endp
trans proc near
mov ax,bx
mov dx,0
div cx
mov bx,dx
add al,30h
mov dl,al
mov ah,2
int 21h
ret
trans endp
display3 proc near
mov cx,100000
call trans
mov cx,10000
call trans
mov cx,1000
call trans
mov cx,100
call trans
mov cx,10
call trans
mov cx,1
add bl,30h
mov dl,bl
mov ah,2
int 21h
exit3: ret
display3 endp
trans proc near
mov ax,bx
mov dx,0
div cx
mov bx,dx
add al,30h
mov dl,al
mov ah,2
int 21h
ret
trans endp
program ends
end start
编译结果显示in_put not defined,还有crlf not defined,我明明定义了啊~~~
mov dx,offset A
mov ah,9
int 21h
endm
compare macro X
cmp al,X
endm
data segment
choice db 'input the chioce:','$'
choice1 db '1.hex transfer binanry','$'
choice2 db '2.hex transfer octal','$'
choice3 db '3.hex transfer decimal','$'
buffer1 db 'input the hex number:' ,'$'
buffer2 db 'the binanry number is:','$'
buffer3 db 'the octal number is:','$'
buffer4 db 'the decimal number is:','$'
data ends
program segment
main proc far
assume cs:program,ds:data
start:
push ds
sub ax,ax
push ax
mov ax,data
mov ds,ax
call in_put call crlf
dos21 macro choice
call crlf
dos21 macro choice1
call crlf
dos21 macro choice2
call crlf
dos21 macro choice3
call crlf
mov ah,1
int 21h
compare macro 1
jz disp1
compare macro 2
jz disp2
compare macro 3
jz disp3
disp1: call display1
jmp exit
disp2: call display2
jmp exit
disp3: call display3
jmp exit
call crlf
exit: ret
main endp
in_put proc near dos21 macro buffer1
mov bx,0
new_char:mov ah,1
int 21h
cmp al,30h
jl exit1
sub al,30h
cmp al,10
jl add_to
sub al,7h
cmp al,10
jl exit1
cmp al,15
jg exit1
add_to: mov cl,4
shl bx,cl
mov ah,0
add bx,ax
jmp new_char
exit1: ret
in_put endp
crlf proc near
mov dl,0ah
mov ah,2
int 21h
mov dl,0dh
mov ah,2
int 21h
ret
crlf endp
display1 proc near
mov cx,16
dos21 macro buffer2
rotate: shl bx,1
jc next
mov dl,30h
mov ah,2
int 21h
next: mov dl,31h
mov ah,2
int 21h
loop rotate
ret
display1 endp
display2 proc near
mov cx,100000o
call trans
mov cx,10000o
call trans
mov cx,1000o
call trans
mov cx,100o
call trans
mov cx,10o
call trans
mov cx,1o
add bl,30h
mov dl,bl
mov ah,2
int 21h
exit2: ret
display2 endp
trans proc near
mov ax,bx
mov dx,0
div cx
mov bx,dx
add al,30h
mov dl,al
mov ah,2
int 21h
ret
trans endp
display3 proc near
mov cx,100000
call trans
mov cx,10000
call trans
mov cx,1000
call trans
mov cx,100
call trans
mov cx,10
call trans
mov cx,1
add bl,30h
mov dl,bl
mov ah,2
int 21h
exit3: ret
display3 endp
trans proc near
mov ax,bx
mov dx,0
div cx
mov bx,dx
add al,30h
mov dl,al
mov ah,2
int 21h
ret
trans endp
program ends
end start
编译结果显示in_put not defined,还有crlf not defined,我明明定义了啊~~~
作者: qijizhen 发布时间: 2011-11-27
把那个函数写在start:后边。
这种错误类似于C语言中,只写了函数定义,却没有写函数声名。
这种错误类似于C语言中,只写了函数定义,却没有写函数声名。
作者: gaoyue_qq_1664507529 发布时间: 2011-11-27
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28