Hi there,
I am stuck on a really simple operation.
I have a value X
I need to to split it into two byte for saving into memory locations.
===================
X As Word
Low_byte, High_byte As Byte
X= %1111001101110101 // for example
Low_byte= X AND 255. // It works I get the lower byte of X
High_byte = ??? // I am stuck here
===================================
The AND operation will not work with the high byte because X is 16-bit
while Low_byte is 8-bit. AND operation will check only the lower byte of X.
If I make High_byte into a Word, it will work! But then I will end-up
with a 16-bit value. Not suitable for a memory location.
Any help? Please!
Regards.
Francesco C.
How to split a Word into two-8bit Bytes.
Moderators: David Barker, Jerry Messina
-
- Posts: 41
- Joined: Thu Feb 26, 2009 6:54 pm
- Location: UK
-
- Posts: 41
- Joined: Thu Feb 26, 2009 6:54 pm
- Location: UK