A83: Re: Re: Re: call question


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

A83: Re: Re: Re: call question




Sorry, I didn't know about _ipoint.  But it is quicker AND faster to load
the coords into BC with a 16-bit move:

ld bc,(10 << 8)+10    ;           10 t-states, 3 bytes

ld b,10               ; 7t, 2b
ld c,10               ; 7t, 2b == 14 t-states, 4 bytes

The << is an assembler directive that means to shift left (the same as in
C).  This is the same as multiplying your number by 256.  Or, you could
figure out the two numbers in hex and just write them side-by-side:

ld bc,(10 * 256)+10

--or--

ld bc,$0a0a

-----Original Message-----
From: James Matthews <matthews@tkb.att.ne.jp>
To: assembly-83@lists.ticalc.org <assembly-83@lists.ticalc.org>
Date: Saturday, October 24, 1998 11:16 PM
Subject: A83: Re: Re: call question


>
>If speed is not of the UTMOST importance:
>
>ld b,10
>ld c,10 ; Testing for (10,10)
>ld d,3
>call _ipoint
>jr z,on
>jr off
>
>Later,
>
>James Matthews (matthews@tkb.att.ne.jp)
>
>ICQ: 7413754
>http://home.att.ne.jp/gold/tomcat21/index.html
>http://library.advanced.org/18242/
>
>----------
>> From: David Phillips <electrum@tfs.net>
>> To: assembly-83@lists.ticalc.org
>> Subject: A83: Re: call question
>> Date: Sunday, October 25, 1998 7:14 AM
>>
>>
>> You call your FindPixel function, then check to see if it is on or off:
>>
>> FindPixel:
>> ; IN: B,C = X,Y
>> ; OUT: HL = pointer to pixel in video buffer, A = mask
>> ...
>>
>> ld bc,(37 << 8)+25        ; check pixel at (37, 25)
>> call FindPixel            ; get address/mask
>> and (hl)                  ; test pixel
>> jr z,pixel_is_off         ; if zero, pixel is off
>> pixel_is_on:              ; if not, it is on
>>
>>
>> -----Original Message-----
>> From: Heydude27@aol.com <Heydude27@aol.com>
>> To: assembly-83@lists.ticalc.org <assembly-83@lists.ticalc.org>
>> Date: Saturday, October 24, 1998 11:23 AM
>> Subject: A83: call question
>>
>>
>> >
>> >Does anyone know how to detect if a pixel is on or off, and how to use
it.
>> >Thanks
>>