I'm just playing with my MC 68HC11; in C i can perform a simple byte swap by doing something like this:
swapped = ((num>>24)&0xff) | // move byte 3 to byte 0
((num<<8)&0xff0000) | // move byte 1 to byte 2
((num>>8)&0xff00) | // move byte 2 to byte 1
((num<<24)&0xff000000); // byte 0 to byte 3
But now i want to achieve something a little harder using assembly code:
I created an ARRAY and added some values (using little endian logic). I want to read that ARRAY and swap all the values into big endian logic and store them inside "BIGENDIAN". I was thinking something like this:
RWM EQU $0
ROM EQU $C000
RESET EQU $FFFE
ORG RWM
BIGENDIAN RMB 16
ORG ROM
Main:
END BRA END
ARRAY DW $0124,$FEEB,$0011,$0070,$ABEF,$074B,$8004,$8080
ORG RESET
DW Main
I tried but it did not work properly.