; Description: Program to input a character and then output it to the screen
; Registers used: ax, dx
.model small
.stack 100h
.data
.code
mov ah, 02h ; DOS function call 2, character output
mov dl, 41h ; the character 041h (i.e.'A')
mov cx, 26 ; start the counter at 26 in cx
again: int 21h ; print character
inc dl ; the next character into dl
loop again ; subtract 1 from cx, if not zero jump back to again
finish: mov ax, 4C00h ; Terminate program
int 21h ; correctly
end
The above loops from capital A to Z and prints out all charaters.What I'm wondering is could the above loop be used to print out A-Z and its corresponding ASCII value (e.g)
A 65
B 66
C 67
I'm guessing I'll need a unconditional loop,and some sort of comparison check...anyones input as to how I would go about coding this would be very much appreciated.Thanks.