Re: A86: Newbie Loop Question


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

Re: A86: Newbie Loop Question




You need a "ret" statement to end the program.  ".end" ends the code,
but "ret" ends the program.  So...

.org _asm_exec_ram

        call _clrLCD
        ld hl, $FC00
        ld a, %10101010
        ld b, 5
loop:   ld (hl), a
        inc l
        xor %11111111
        djnz loop
	ret

.end
.end

That ought to work.

		-Rick

		http://www.angelfire.com/ga/ti86

Dave VanEe wrote:
> 
> Hello,
> I'm new to asm and I can't get this program to 'work'. All it's supposed to
> do is draw 5 lines of 8 pixels each (xor'd each time)...It does that, but
> then the program just keeps running...please help.
> 
> Program:
> 
> #include "asm86.h"
> #include "ti86asm.inc"
> 
> .org _asm_exec_ram
> 
>         call _clrLCD
>         ld hl, $FC00
>         ld a, %10101010
>         ld b, 5
> loop:   ld (hl), a
>         inc l
>         xor %11111111
>         djnz loop
> 
> .end
> .end
> 
> Thanx,
> Dave VanEe


References: