A86: I need help...


[Prev][Next][Index][Thread]

A86: I need help...




I am an absolute newbie asm programmer in every way, and I have written a
simple program so I can try to understand loops...  It's supposed to display
string: five times, but it doesn't really work...  Could someone offer any
advice?  Thanks




#include "ti86asm.inc"
#include "asm86.h"

.org _asm_exec_ram

 nop
 jp ProgStart
 .dw 0
 .dw ShellTitle

ShellTitle:
 .db "Chris Remo's Program",0

ProgStart:

_homeup EQU 4A95h       ; 0 to curCol and 0 to curRow

 call _clrLCD       ; clears screen

 call _homeup       ; 0 to curCol and 0 to curRow
 ld b,5         ; puts 5 in b register
 ld a,0
subby_loop:         ; my awesome loop
 dec b         ; decrements b
 inc a         ; increments a
 ld (_curRow),a       ; loads value of b into curRow
 ld (_curCol),0       ; loads value of b into curCol
 ld hl,string       ; puts string in hl
 call _puts        ; displays string
 call _getkey
 jr nz,subby_loop      ; continued until b is zero
 ret          ; return to shell or homescreen
 ret

string:
 .db "SHOULD show 5 times",0    ; creates string, terminated with 0



.end





Follow-Ups: