[A83] Re: dested register


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

[A83] Re: dested register



You can't load B into HL or HL into B. Unless you were meaning to load the 
value at address (HL) into B, you have to load b into h and 0 into l, and 
vice versa. But I didn't look into your code in that much detail, so that's 
what I just spotted.


««««««««»»»»»»»»
Colin Hart
Xempest@aol.com
««««««««»»»»»»»»


> 
> 
> Well, since the value for the register B is dested.. i thought maybe I 
> could push it before I make a rom call and pop it before the _ipoint makes 
> the pixel.
> 
> However, I get errors like:
> C:\DEV_PACK>asm pixel
> ----- Assembling pixel for the TI-83 Plus...
> TASM Z80 Assembler.       Version 3.0.1  June, 1994.
>   Copyright (C) 1985-1994 by Speech Technology Incorporated
> tasm: pass 1 complete.
> temp.z80 line 0023: Label not found: (b)
> temp.z80 line 0023: Unused data in MS byte of argument. (2)
> temp.z80 line 0044: Label not found: (hl)
> temp.z80 line 0044: Unused data in MS byte of argument. (200)
> temp.z80 line 0047: Label not found: (b)
> temp.z80 line 0047: Unused data in MS byte of argument. (2)
> temp.z80 line 0053: Label not found: (hl)
> temp.z80 line 0053: Unused data in MS byte of argument. (200)
> temp.z80 line 0056: Label not found: (b)
> temp.z80 line 0056: Unused data in MS byte of argument. (2)
> temp.z80 line 0072: Label not found: (hl)
> temp.z80 line 0072: Unused data in MS byte of argument. (200)
> tasm: pass 2 complete.
> tasm: Number of errors = 12
> ----- There were errors.
> 
> C:\DEV_PACK>
> 
> 
> I dont think 'B' nor 'HL' are lables... so that must not be how you load 
> them... any suggestions?
> HERE IS THE CODE:
> 
> 
> .nolist
>          #include "ion.inc"
>          #DEFINE kLeft       02h
>          #DEFINE kRight      01h
>          #DEFINE kUp         03h
>          #DEFINE kDown       04h     ;All these guys are hex code
>          #DEFINE kEnter      05h     ;for keys on the Ti-keyboard.
>          #DEFINE kClear      09h
> .list
> #ifdef TI83P
>          .org    progstart-2
>          .db     $BB,$6D
> #else
>          .org    progstart
> #endif
>          ret
>          jr      nc,begin
>          .db     "Pixel Mover",0
> begin:
>          bcall(_clrLCDFull)      ;Clear the screen.
>          ld b,47
>          ld hl,b
>          push hl
>          ld c,47
>          ld d,1                  ;Set D to 1.
>          bcall(_IPoint)
> GetKey:
>          bcall(_getKey)          ;Asked for a key.
>          cp kLeft                ;Compare key with code for left.
>          jp z,Left               ;If equals 0, go to left.
>          cp kRight
>          jp z,Right
>          cp kUp
>          jp z,Up
>          cp kDown
>          jp z,Down
>          cp kClear
>          jp z,Quit
>          jp GetKey
> Left:
>          ld d,0                  ;Set D to 0.
>          pop hl
>          ld b,hl
>          bcall(_IPoint)
>          dec b
>          ld hl,b
>          push hl                 ;Decrement B
>          jp Draw
> Right:
>          ld d,0
>          pop hl
>          ld b,hl
>          bcall(_IPoint)
>          inc b
>          ld hl,b
>          push hl
>          jp Draw
> Up:
>          ld d,0
>          bcall(_IPoint)
>          inc c
>          jp Draw
> Down:
>          ld d,0
>          bcall(_IPoint)
>          dec c
>          jp Draw
> Draw:
>          ld d,1
>          pop hl
>          ld b,hl
>          bcall(_IPoint)
>          push hl
>          jp GetKey               ;Repeat
> Quit:
>          ret                     ;Return to OS.
> .end
> END
> 




Follow-Ups: