Jason
Member
Registered: 5th Aug 03
Location: Northern Ireland
User status: Offline
|
any1 know why this doesnt work?
Portfolio Question 2
Write an assembly language program which reads an integer between 1 and 9
from the keyboard and displays that number of consecutive uppercase letters commencing from 'A' all on one new line. If a character outside that range is entered, the program should respond by outputting the character ‘X’ on the same line.
e.g. input : 5 gives the output 5
ABCDE
input : F gives the output FX
.model small
.stack 100h
.data
.code
mov ah, 1
int 21h
mov cl , al
cmp cl , 'A'
jge output
mov bl ,'A'
mov ah , 2
mov dl , 13
int 21h
mov dl , 10
int 21h
again: mov dl , bl
int 21h
inc bl
dec cl
cmp cl , '0'
jg again
jmp finish
output: mov ah,2
mov dl ,'X'
int 21h
finish:mov ah,4ch
int 21h
END
i know the above bit isnt commented out..
|