corsasport.co.uk
 

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


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author assembly again...
Jason
Member

Registered: 5th Aug 03
Location: Northern Ireland
User status: Offline
21st Nov 03 at 11:03   View User's Profile U2U Member Reply With Quote

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

 
New Topic

New Poll

Corsa Sport » Message Board » General Chat » assembly again... 23 database queries in 0.0060220 seconds