搜索
您的当前位置:首页实训汇编语言设计——输入1-12,显示月份缩写

实训汇编语言设计——输入1-12,显示月份缩写

来源:世旅网
实训汇编语⾔设计——输⼊1-12,显⽰⽉份缩写

输⼊1-12 ,显⽰⽉份缩写

title home

datasg segment three db 3

monin db 3,4 dup(?) alfmon db '','$'

montab db 'JNA','FEB','MAR','APR','MAY','JUN' db 'JUL','AUG','SEP','OCT','NOV','DEC'datasg ends

codesg segment para'code'

assume cs:codesg,ds:datasg,es:datasgmain proc far push ds sub ax,ax push ax

mov ax,datasg mov ds,ax mov es,ax l1:mov ah,0aH int 21h cmp dl,3 jz exit

call input call locate call display mov ah,2

mov dl,0ah ;实现回车换⾏ int 21h mov dl,0dh int 21h jmp l1exit:retmain endp input proc near push dx mov ah,0ah lea dx,monin int 21h

mov ah,monin+2 mov al,monin+3 xor ax,3030h cmp ah,00 jz return sub ah,ah add al,10 return: pop dx ret

input endp

locate proc near push si push di push cx

lea si,montab dec al mul three add si,ax mov cx,03 cld

lea di,alfmon rep movsb pop cx

pop di pop si ret

locate endpdisplay proc near push dx

lea dx,alfmon mov ah,09 int 21h pop dx ret

display endp

codesg ends

end main

因篇幅问题不能全部显示,请点此查看更多更全内容

Top