The enum trick (or hack) is used to attach a name to a value, which can be checked by the compiler
enum {size_reg = 16, size_mem = 256};
int main()
{
int regs[size_reg],...
Type: Posts; User: grumpy
The enum trick (or hack) is used to attach a name to a value, which can be checked by the compiler
enum {size_reg = 16, size_mem = 256};
int main()
{
int regs[size_reg],...
Oh, okay. That's because size_reg is a variable (and your arrays are therefore VLAs). Try making the sizes visible to the compiler at compile time (e.g. #define size_mem 256 or [slightly more...
That's one way.
All of the bit fiddling techniques in main(), and the magic hex values, mean that your code is assuming a particular endianness on your target machine. If your target machine is a different...