Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
A BB
CCC
DDDD
...
ZZZZZZZZZZZZZZZZZZZZZZZZZZ

im using the cmd debug program, and im fairly new on this

heres what i have done so far:
-a 100
0B23:0100 mov cx,001a
0B23:0103 mov ah,02
0B23:0105 mov dl,30
0B23:0107 int 21
0B23:0109 mov bl,dl
0B23:010B mov dl,0a
0B23:010D int 21
0B23:010F mov dl,bl
0B23:0111 inc dl
0B23:0113 loop 107
0B23:0115 int 20

the output for this is
A
_B
__C
___D
....
_________________________Z


[edit]SHOUTING removed - OriginalGriff[/edit]
Posted
Updated 24-Jan-14 22:14pm
v2
Comments
OriginalGriff 25-Jan-14 4:14am    
DON'T SHOUT. Using all capitals is considered shouting on the internet, and rude (using all lower case is considered childish). Use proper capitalisation if you want to be taken seriously.
Member 10548351 25-Jan-14 4:51am    
sorry about that
Richard MacCutchan 25-Jan-14 4:26am    
You need to check if the last output character was Z, and if so, rewrite that instead of the underscores.
Member 10548351 25-Jan-14 4:54am    
those underscores are suppose to be spaces, i tried putting spaces but when i checked preview it aligned it vertically
anyway i want to fill those spaces with the corresponding letters
just not sure what to do or how to do it
Richard MacCutchan 25-Jan-14 7:07am    
See my solution.

1 solution

You need to think about this in logical terms, rather than in assembler terms. Each letter should be repeated according to its position in the alphabet. So the program should be something like:
Set letter := 'A'
Set count := 1
Loop:
    Set repeat := 0
    Print:
        Display letter
        Set repeat := repeat + 1
        If repeat .LT. count Goto Print
    Display NEWLINE and RETURN
    If letter .EQ. 'Z' Goto Exit
    Set letter := letter + 1
    Set count := count + 1
    Goto Loop
Exit:
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900