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

Re: Fun with XDRAW



In article <2750ac20.7def23e3@usw-ex0102-009.remarq.com>, jh82 
<webmasterNOweSPAM@jh82.i-p.com.invalid> wrote:

> How do I point to the address: 24567?

divide the address by 256, put the result in 233 and the remainder in 
232:

D = INT(24567/256): R = 24567-256*INT(R)
POKE 232,R : POKE 233,D

or (a bit shorter and faster)

POKE 232,24567/256: POKE 233,24567-PEEK(232)*256.

When you use hex addresses, it's easier to follow.
24567 is hex $5FF7. This is a 16-bit number, so you need two 8-bit 
memory locations to hold it. So put the low byte ($F7) into $E8 and the 
high byte ($5F) into $E9.

-- 
Groetjes, Pim

Same excuse every time