Enter 1-12 to display the abbreviated month
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', 'sept', 'oct', 'nov', 'dec'
Datasg ends
Codesg segment para 'code'
Assume Cs: codesg, DS: datasg, ES: datasg
Main proc far
PUSH DS
Sub ax, ax
PUSH AX
MoV ax, datasg
MoV ds, ax
MoV es, ax
L1: mov ah, 0ah
Int 21 h
Cmp dl, 3
JZ exit
Call Input
Call locate
Call display
MoV ah, 2
MoV DL, 0ah; implements carriage return and line feed
Int 21 h
MoV DL, 0dh
Int 21 h
JMP L1
Exit: Ret
Main endp
Input proc near
Push DX
MoV ah, 0ah
Lea dx, Monin
Int 21 h
MoV ah, Monin + 2
MoV Al, Monin + 3
XOR ax, 3030 H
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 endp
Display proc near
Push DX
Lea dx, alfmon
MoV ah, 09
Int 21 h
Pop DX
RET
Display endp
Codesg ends
End main