Anyone know how to convert this C code into assembly ??
I have used intermediate files to see how it assembles ...
C Instruction to convert to assembly
Code: Select all
#define HARDWARE_IO (*(unsigned short *)(0xFFFFE2FA))
HARDWARE_IO |= 0x0001;
Code: Select all
move.l #-7430,%d0
move.l #-7430,%d1
move.l %d1,%a0
move.w (%a0),%d1
or.w #1,%d1
move.l %d0,%a0
move.w %d1,(%a0)
Code: Select all
#define HARDWARE_IO (*(unsigned short *)(0xFFFFE2FA))
HARDWARE_IO &= 0xFFFE;
Code: Select all
move.l #-7430,%d0
move.l #-7430,%d1
move.l %d1,%a0
move.w (%a0),%d1
and.w #-2,%d1
move.l %d0,%a0
move.w %d1,(%a0)
equates too. Normally I can figure this out, for some reason I cannot with this one!-7430
This is where http://www.godbolt.org would be extremely handy if it did m68k, unfortunately it takes Linux to do the testing, I don't run Linux or I would add it, it is supposed to be easy to add by using another GNU implementation as a template.
An awesome task for a Linux user looking to help the community ...
To read the Howto on installing a new compiler, Select menu Other, then Wiki, and on the right sidebar of the Wiki, Select How to install a compiler.
Want to do it and need help, ask, I'll do whatever I can to help!
-Enjoy