![]() The difference is in the -clib=sdcc_iy case, the library is allowed to use the IY register, which is a problem for the zx target if the rom interrupt routine is active. clib=sdcc_iy is always preferred since it will lead to smaller code. You'll note -clib=sdcc_iy instead of -clib=sdcc_ix in the compile line. Printf("lldiv: quotient = %s, remainder = %s\n", buffer_0, buffer_1) The final test program I was using was this, which mixes floats in along with some long long printf and scanf conversions:Ĭode: Select all // zcc zx -vn -SO3 -startup=4 -clib=sdcc_iy -max-allocs-per-node200000 test.c -o test -list -opt-code-size The output binary in this case will be "test_CODE.bin" which you can run by entering "CLEAR 32768", load the binary to 32768, then "RAND USR 32768". The output filename "test" will be the root name used for all the output binaries generated by a compile. Zcc zx -vn -SO3 -startup=4 -clib=sdcc_ix -reserve-regs-iy -max-allocs-per-node200000 test.c -o test -list -opt-code-size The windows and mac packages include the sdcc binaries but for other platforms, the sdcc binaries have to be built separately.įor programs containing 64-bit integers, using the -opt-code-size flag will significantly reduce code size, the compiler generated portion by about 50% in fact. Zcc zx -vn -SO3 -startup=4 -clib=sdcc_ix -reserve-regs-iy -max-allocs-per-node200000 test.c -o test.exe -list When I compiled your example above in this thread, the compilation fails with ![]() So I downloaded the latest nighty build (this one, all is fine). Joaopa wrote:I wanted to give a try to the 64-bit long support. When sdcc fixes the aforementioned bug, I'll be updating that zip with a new build. Everything else in the nightly will be up to date but the binary is less frequently updated. If you're on windows, after the nightly build is installed, be sure to update your zsdcc executable in z88dk/bin from. "in_pause(200) " is inserted into the code to eliminate the bug in this program. I did come across a bug in sdcc which will hopefully be fixed soon: Because there is no scanf %lld yet, the 64-bit numbers are scanned in two 32-bit halves in hexadecimal. You'll note that lltoa() is used to generate a base 10 string from the longlong since there is no printf %lld yet. Printf("lldiv: quotient = %s, remainder = %s\n\n", buffer_0, buffer_1) Code: Select all // zcc zx -vn -SO3 -startup=4 -clib=sdcc_ix -reserve-regs-iy -max-allocs-per-node200000 lg.c -o lg -list
0 Comments
Leave a Reply. |