'MPASM accessing middle bytes...'
In MPASM, I can declare a constant value of two byte
and access the high and low bytes using 'HIGH' and 'LOW'.
MyConst equ h'ABCD'
movlw high(MyConst) ; will move $AB into w
If I declare a constant with more than 2 bytes, is it possible
to access the middle bytes?
MyConst equ h'01020304'
movlw ???? (MyConst) ;how do I access the 3rd byte???
Mayes uk <d-m-g.demon.co.uk> wrote: mike
> If I declare a constant with more than 2 bytes, is it possible
> to access the middle bytes?
> MyConst equ h'01020304'
> movlw ???? (MyConst) ;how do I access the 3rd byte???
MOVLW ((MYCONST) >> 8) & 0xFF
It's probably easiest if you use parameterized #DEFINEs to define
the shift-and-AND operations for each byte-position... Then you can
By the way, it's best to use shift-and-AND macros instead of LOW and
HIGH... In at least some versions of M
More... (looser matching)
- Last day of these posts
- In 1997
, 1998 only
- New search...