汇编语言: 输入一个数字,显示出其月份英文单词的前三个字母

例如输入1 显示JAN

Code Segment
Assume CS:Code,DS:Code

EnterCRLF Proc Near
mov dl,0dh
mov ah,2
int 21h
mov dl,0ah
int 21h
ret
EnterCRLF EndP

Prompt_Mon DB 'month?:$'
MONTAB DB 'JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG','SEP','OCT','NOV','DEC'
Input_Num DB 3,0,3 dup(?)

Start: push cs
pop ds

Get_Number: LEA DX,Prompt_Mon
MOV AH,9
INT 21H
call EnterCRLF
lea dx,Input_Num
push dx
pop si
inc si
mov ah,0ah
int 21h
lodsb
test al,0fh
jz Exit_Proc
cmp al,1
ja Two_Chr
lodsb
and al,0fh
xor ah,ah
jmp Seach_Mon
Two_Chr: lodsw
and ax,0f0fh
xchg ah,bh
xor ah,ah
mov bl,10
mul bl
add al,bh
cmp al,1
jb Get_Number
cmp al,12
ja Get_Number
Seach_Mon: dec al
mov bl,3
mul bl
lea si,MONTAB
add si,ax
call EnterCRLF
mov cx,3
Output_Mon: lodsb
xchg dl,al
mov ah,2
int 21h
loop Output_Mon
call EnterCRLF
JMP Get_Number

Exit_Proc: mov ah,4ch ;结束程序
int 21h

Code ENDS
END Start ;编译到此结束
温馨提示:答案为网友推荐,仅供参考
第1个回答  2009-06-26
=TEXT(A1*28,"mmm")
其中A1是你准备显示英语的单元格