4/5/2024 0 Comments Micro c compiler 8080![]() So what are the reasons C fits badly?Īrray indexing is inefficient since there's no reasonable base + offset addressing mode that can use a variable offset, which means the compiler needs to generate code to do the address calculation. Z80 has these index registers and a much roomier stack. The stack's limited to 256 bytes and the 6502 has rather limited stack addressing modes as compared to the PDP-11, so cc65 uses a second stack, implemented in software, to pass parameters IIRC.įrom what I understand of the Z80 these two examples do not apply. So something like strcmp or strlen might need to actually do a 16-bit add per character.Ī stack is an ideal data structure for passing function parameters. The 6502 is pretty quick at indexing arrays, but unfortunately only if the index is one byte wide. ![]() Here are some examples that shows why C fits 6502 badly:Īn array in C is indexed by an integer type. I am getting the impression that it is hard to compile C to Z80 and end up with well-optimised code. Native C compiler for Sinclair ZX Spectrum How much benefit should be expected on a more advanced compiler for z80/r800 based computers? When reading some other questions about compiling C for the Z80,
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |