Oops, good point! Apparently I missed correctly declaring the zero page registers in the bbc startup code. I will have to fix that. Code generated by vbcc (and assembly code written more carefully) will not have this problem.sweh wrote: ↑Thu May 13, 2021 1:07 am Out of curiosity I did a quick "hello world" test to see how it works.
What I found a little odd is that you're using zero page addresses, but using long address mode
egInstead of "8D 20 00" the sequence "85 20" would save a byte and be quicker.Code: Select all
1904 A9 00 LDA #0 1906 8D 20 00 STA &0020
Well, the vbcc documentation (in C Library => 6502/BBC) mentions "With the default configuration, after exiting the C program, the code will wait for pressing return before returning to basic (does not yet work correctly)."Also, is the code meant to return back to BASIC, or is it designed to hang after running?
I have never owned a bbc and so far spent barely more than one day creating the bbc target for vbcc (including finding information and setting up an emulator) - which IMHO speaks for the clean design of that machine. So, I could use some feedback on what is typically useful here. Btw. the vbcc6502 archive contains in libsrc/6502-bbc the source for the startup code as well as all the bbc-specific library code.