Re: A83: Why wont this work!


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

Re: A83: Why wont this work!




Due to the z80 register (etc.) restrictions you cannot:
 * OUT to a given port from anything other than the accumulator. (However, if
the port address is in c, it'll be fine.)
 * Load an indirect address with an immediate value. Put the value in a and ld
(CURROW),a.
(I know this suxx, but we've just got to live with it)

Linus

On 16-Apr-98, Phelan Wolf wrote:

>Whenever I try to compile this code it says that currow, curcol and
>LCDINSTPORT are
>invalid arguments!!!

>-Phelan 'Amen' Wolf

>SOURCE:

>.NOLIST
>#define end .end
>#define equ .equ
>#define EQU .equ
>#include "ti83asm.inc"
>.LIST
>.org 9327h
> call 4755h
> ld b,0
>LOOP:
>        ld (CURCOL),02h
>        ld (CURROW),01h
>        set 3, (iy+5)
> ld hl,title_one
> call 470Dh
>        res 3, (iy+5)
> call 4CFEh
> cp 03h
> jp z,UP_CONTRAST
> cp 04h
> jp z,DOWN_CONTRAST
> cp 64d
> jp z,QUIT
> jp LOOP
>SET_CONTRAST:
> out (LCDINSTPORT),b    ;sets the contrast at b
> jp LOOP
>UP_CONTRAST:
> ld a,b
> cp 88
> jp z,LOOP
> inc b
> inc b
> call 4755h
> jp SET_CONTRAST
>DOWN_CONTRAST:
> ld a,b
> cp 1
> jp z,LOOP
> dec b
> dec b
> call 4755h
> jp SET_CONTRAST
>QUIT:
> call 4755h
> ret
>title_one:
> .db "Set Contrast",0
>.end
>END







References: