DSEG SEGMENT 'DATA'
; add your data here!
buffer label byte
max db 81
act db 0
char db 81 dup(0)
;
letter db 'letter:',?,?,13,10,'$'
digit db 'digit:',?,?,13,10,'$'
other db 'other:',?,?,13,10,'$'
DSEG ENDS
SSEG SEGMENT STACK 'STACK'
db 256 DUP(0)
SSEG ENDS
CSEG SEGMENT 'CODE'
START PROC FAR
; set segment registers:
MOV AX, DSEG
MOV DS, AX
MOV ES, AX
; add your code here
lea dx,buffer
mov ah,0ah
int 21h
mov cl,act
mov si,00h
mov bh,00h
mov bl,00h
mov dl,00h
again: cmp cl,0
jz next
mov al,char[si]
cmp al,7ah
jg othe
cmp al,60h
jg lette
cmp al,5ah
jg othe
cmp al,40h
jg lette
cmp al,39h
jg othe
cmp al,2fh
jg digi
othe: mov al,1
add al,dl
daa
mov dl,al
jmp short repeat
lette: mov al,1
add al,bh
daa
mov bh,al
jmp short repeat
digi: mov al,1
add al,bl
daa
mov bl,al
repeat:inc si
dec cl
jmp short again
next: mov cl,4
mov al,bh
and al,0fh
add al,30h
mov letter+8,al
mov al,bh
rol al,cl
and al,0fh
add al,30h
mov letter+7,al
mov al,bl
and al,0fh
add al,30h
mov digit+7,al
mov al,bl
rol al,cl
and al,0fh
add al,30h
mov digit+6,al
mov al,dl
and al,0fh
add al,30h
mov other+7,al
mov al,dl
rol al,cl
and al,0fh
add al,30h
mov other+6,al
;
mov dl,0dh
mov ah,02h
int 21h
mov dl,0ah
mov ah,02h
int 21h
lea dx,letter
mov ah,09h
int 21h
lea dx,digit
mov ah,09h
int 21h
lea dx,other
mov ah,09h
int 21h
MOV AX, 4C00h ; exit to operating system.
INT 21h
START ENDP
CSEG ENDS
END START ; set entry point.