News:

Function Finder  Find all the functions within source code files

Main Menu

PeekBankWord back to front?

Started by RetroBasic, July 26, 2019, 03:55:51 PM

Previous topic - Next topic

RetroBasic

If i poke 2 bytes into consecutive positions and then try to read them back as a word:

  PokeBankByte 1, 0, 33  ; $21
  PokeBankByte 1, 1, 44  ; $2C
 
  Print "byte at pos 0 is " + HEX$(PeekBankByte(1, 0))
  Print "byte at pos 1 is " + HEX$(PeekBankByte(1, 1))
  Print "word at pos 0 is " + HEX$(PeekBankWord(1, 0))

I get:

 byte at pos 0 is $00000021
 byte at pos 1 is $0000002C
 word at pos 0 is $00002C21

But shouldn't this be:

 byte at pos 0 is $00000021
 byte at pos 1 is $0000002C
 word at pos 0 is $0000212C




kevin

#1
  Nah,  this is due to Endianness