A86: Looping


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

A86: Looping



OK, you've heard a lot from me, none of which had much to do with Assembly.
So here's my first question, and thank goodness it should be an easy one.
Here's the program I wrote:

;~~~Beginning~~~
#include "asm86.h"
#include "ti86asm.inc"
.org _asm_exec_ram

	call _clrLCD
	ld hl,$0000
	ld (_curRow),hl
	ld hl,hello
	call _puts
	ld b,100

	ret

hello:
	.db "TI-86 ASM is HARD    "
	.db "It makes no sense    "
	.db "sometimes, but it    "
	.db "is more powerful than"
	.db "easy-schmeezy BASIC. "
	.db "This program is     ",0


Loop:
	call _clrLCD
	call hello
	djnz Loop


.end
;~~~End~~~

(Note: The comments beginning and end were added for the purpose of the
message, and are not in the program)

Anyway, the display works right. My problem is the delay loop. Either it's so
fast that I can't recognize it (I had it up to 255 at one point) or
something's not right. Hey, I'm used to basic where I did:

25->lp
Lbl Loop
lp-1->lp
If lp>0:Goto Loop

Is it just that the loop is unrecognizable? If so, how would I make it
longer?
Also, better yet, how would I get input? For example, do something like this:

Lbl pause
Getkey->x
If x=0:Goto pause

Also, if there is a command like getky, does it return the same numbers as
the ones that the BASIC getkey get?

Thanks for your help!

KUPO


Follow-Ups: