06-18-2010, 03:18 PM
britlion Wrote:Instead of poking to bytes:
POKE uinteger @datastore, data
datastore:
asm
defb 0,0
...
...
...
LD HL, (DATASTORE)
I got it to do self modifying code so that it poked it to the line that has:
LD HL, NNNN
It saves storage bytes, actually - and LD HL, NN is 10 T states. LD HL,(NN) is 16.
I do that in my Z80 programs. Why have a separate zone for values, if I can store them right into the instructions? Faster and more compact. Maybe the legibility suffers a bit, but it's worthwhile, especially for huge and complex programs where speed and memory are critical.
Marcos Cruz
http://programandala.net
http://programandala.net