This must be really Obvious!!!!! But it is NOT computing between the ears. (or on paper).
Problem: why do you add 256 to the low byte decimal before multiplying by the high order decimal?
using a hex calculator there is no need for any additon.
and it is not that i can't get the right values to poke in, or peek at...........[here is where we loose everyone]....because i can.
It is that i just wish to use the simple calculator, manually. and follow the process. make sense ?
Okay. Why do you add 256 (ZX81 Basic add 256)?
PEEK & POKE math (?? +256 ??)
Re: PEEK & POKE math (?? +256 ??)
We are not adding 256 to the low byte... when we do something like
To display the current value of ramtop you have to remeber the order of processing.
the computer will do both PEEKS then it will multiple the second PEEK [highbyte] value by 256 and finally add on the first PEEK [lowbyte] value.
hth Andy
Code: Select all
PRINT PEEK 16388 + 256 * PEEK 16389
the computer will do both PEEKS then it will multiple the second PEEK [highbyte] value by 256 and finally add on the first PEEK [lowbyte] value.
hth Andy
what's that Smell.... smells like fresh flux and solder fumes...
Re: PEEK & POKE math (?? +256 ??)
thanks, Andy.Andy Rea wrote: ↑Mon Jan 15, 2018 6:12 pm We are not adding 256 to the low byte... when we do something likeTo display the current value of ramtop you have to remeber the order of processing.Code: Select all
PRINT PEEK 16388 + 256 * PEEK 16389
the computer will do both PEEKS then it will multiple the second PEEK [highbyte] value by 256 and finally add on the first PEEK [lowbyte] value.
hth Andy