Code:
mem_start = 1000h
mem_end = 1060h
for i = 1 to 60
if i < 10 then OWOUT DQ, 1, [$CC, $F0, $0i, $10] ' I get an error trying to compile for $i
if i >= 10 then OWOUT DQ, 1, [$CC, $F0, $i, $10] ' I get an error trying to compile for $i
nexti
Scott, as noted before, just use i, but given that, the code doesn't make sense. First, add a space between next and i in the nexti line (maybe just a type-o for this post). Second, except for the < and the >= in the IF statements, I don't see a difference in the execution of the IF's. Also, 60h is 96 decimal. Another change should be to start the i FOR NEXT loop with zero (0) and count to 96 for 60h being within memory sace (95 if this the begining of some other memory space (60h) - which would be normal as new areas in memory almost never start with a "1")
I think what you want is this code. It will cycle through the i byte of the address, but I'm unclear about the byte order or the extent of your data addresses involved with this particular loop:
Code:
for i = 0 to 95 'Use 96 IF 60h IS part of the memory range, but I doubt it.
OWOUT DQ, 1, [$CC, $F0, i, $10]
next i
It might be a good time to read up on hex-decimal-binary relationships (general, not just PBP docs). The caluclator found in Windows Accessories can be your friend (set to scientific mode).
Bookmarks