Thursday, September 11, 2008

Getting all letter A's in user input (assembly programming a86)

These lines of codes primarily get all letter A's found in the user input. Developed in A86.

;--------start of code

lea dx,input
int 21h

lea di,acl
lea si,aaax
mov cl,[di]

check:

mov al,[di]
cmp al,'a'
je storeA
inc di,1
dec cl,1
cmp cl,0
je exit
jmp check

storeA:

mov [si],al
inc si,1
dec cl,1
cmp cl,0

je exit

inc di,1
jmp check

exit:

mov ah,02
mov dl,0dh
int 21h
mov dl,0ah
int 21h

mov ah,09
lea dx,aaax
int 21h
int 20h

input label byte
m db 255
acl db ?
string db 255 dup('$')

aaax db 255 dup('$')

;---------- end of code

Hope this could help you or somehow give you ideas on assembly programming in a86.

0 comments: