Separating decimal value to least & most significant byte

183 Views Asked by At

I'm working on some 65802 code (don't ask :P) and I need to separate a 16-bit value into two 8-bit bytes to store it in memory. How would I go about this?

EDIT:

Also, how would I take two similar bytes and combine them into one 16-bit value?

EDIT:

To clarify, many of the solutions available on the internet are not possible with the programming language I'm using (a version of MS-BASIC). I can't take modulo, and I can't left or rightshift. I've figured out that I can put the two bytes together by multiplying the high byte by 256 and adding it to the low byte, but how would I reverse the process?

0

There are 0 best solutions below