hth313 / Calypsi-tool-chains

Overview of the Calypsi tool chain and open source support packages
16 stars 0 forks source link

The '%' (mod) operator causes programs to lock up #17

Open rebeccabuckingham opened 1 year ago

rebeccabuckingham commented 1 year ago

Have noticed that when I use the '%' operator, that my program crashes. I've reproduced this in a small test:

printf("before trying mod\n");

int a = 10;

printf("after assigning a, before b\n");

int b = a % 9;

// this line never gets printed printf("b is now %d\n", b);

hth313 commented 1 year ago

There are tests in place that exercises operators so it is likely something else. Do you have ability to use the supplied debugger? You need to enable debug information with the -g (or --debug ) flag and it makes it possible to test algorithmic stuff. If you have suitable hardware, you may be able to port the remote debugger agent which allows you to also test behavior on hardware.

If this does not help, make a small example project and send it to me, I can try it in the debugger (`db65816).