Last active
December 26, 2015 00:09
-
-
Save mntmn/7061657 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ds test | |
mov r8,r14 ; back up link-address in r8 | |
mov r2,#0 ; r2 = 0 | |
loopa: | |
mov r1,#99 | |
lsl r1,r1,#4 ; r1 = 100<<4 = 1600 (40x40 zeichen display) | |
loopb: | |
lsl r0,r2,#0 ; r0 = r2 | |
sym display ; r7 = display address | |
add r7,r7,r1 ; add offset in r1 to display address | |
strb r0,[r7,#0] ; output r0 to display | |
add r2,r2,#1 ; r2++ | |
sub r1,r1,#1 ; r1-- | |
cmp r1,#0 ; if r1 != 0 | |
bne loopb ; goto loopb | |
mov r11,r2 ; backup r2 in r11 (gets clobbered) | |
sym readKey ; load readKey function pointer in r7 | |
call ; macro to call r7 and return | |
cmp r0,#32 ; key is in r0, is it space (32)? | |
mov r2,r11 ; [restore r2] | |
bne loopa ; no, go to loopa | |
bx r8 ; return from program |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment