datasg segment para 'data'
three db 3
mess db 'mouth?',13,10,'$'
monin label byte
max db 3
act db ?
mon db 3 dup(?)
alfmon db '???',13,10,'$'
montab db 'jan','fer','mar','apr','may','jun','jul','aug','sep','oct','nov','dec'
datasg ends
codesg segment para 'code'
main proc far
assume cs:codesg,ds:datasg,es:datasg
push ds
sub ax,ax
push ax
mov ax,datasg
mov ds,ax
mov es,ax
start:
lea dx,mess
mov ah,09
int 21h
lea dx,monin
mov ah,0ah
int 21h
mov dl,10
mov ah,02
int 21h
mov dl,10
cmp act,0
je exit
mov ah,30h
cmp act,2
je two
mov al,mon
jmp conv
two:
mov al,mon+1
mov ah,mon
conv:
xor ax,3030h
cmp ah,0
jz loc
sub ah,ah
add al,10
loc:
lea si,montab
dec al
mul three
add si,ax
mov cx,03
cld
lea di,alfmon
rep movsb
lea dx,alfmon
mov ah,09
int 21h
jmp start
exit: ret
main endp
codesg ends
end main