corsasport.co.uk
 

Corsa Sport » Message Board » General Chat » assembly again... » Post Reply

Post Reply
Who Can Post? All users can post new topics and all users can reply.
Icon:
Formatting Mode:
Normal
Advanced
Help

Insert Bold text Insert Italicized text Insert Underlined text Insert Centered text Insert a Hyperlink Insert Email Hyperlink Insert an Image Insert Code Formatted text Insert Quoted text
Message:
HTML is Off
Smilies are On
BB Code is On
[img] Code is On
Post Options: Disable smileys?
Turn BBCode off?
Receive email notification of new replies?

Jason

posted on 21st Nov 03 at 11:03

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..:look: