I found the part in the ABI and may need to ask questions later to lazycow to understand how it works if I want to get far pointer working again. For now it's not a big issue but will figure out later. As for data, usually in a nes game with a lot of data, music etc, you need to change many time the banks during one frame because of lack of space so this is usually done in asm before accessing the data.
No problem then. It may or not be useful, it just while debugging code, having the C code and seeing the asm result what interesting to see if the method was a bottle neck or not but I guess the asm file created with vbcc should be understandable enough.vbc wrote: ↑Thu Jul 16, 2020 10:12 amNo, vbcc generates code only after it has parsed the source and it does not keep the source code in memory. It does keep references to files and line-numbers to be able to generate source-level debug information, but this is not yet available for 6502. I could add a debug option that generates file name and line number as comments in the assembly code, but I am not sure that is too helpful.
Here's an example:
Code: Select all
src/main.o: src/main.c src/test//test.h
For now I may not need it after all since when you remove the data segment, you see which one requires it with the error messages. After I removed the usage of all lib function, the errors stopped. If I have question, I will let you know.
Thank you again for the information, I will continue my sample and may have some question later.
I have a question regarding the zpage directive since of the way I see it used in the startup files. The way I understand from the doc is that it declare a symbol as zero page. What I want to know is:
- It only needs to be done once, right? It seems to be used like a way to "import" it in file in current startup code, every time it is used
- in startup, there is a special section called zpage without "", which seems to be a system one. Doesn't the compiler automatically promote those symbols to zpage?
Another thing, there is "ezp" but I'm not sure what it is. If it's like EQU, usually it's only a literal value/string which means it shouldn't need to know if zero page related but I think it's more something like "reserve", to declare a symbol that is right a way in zero page without the need to use zpage after. Which one is the actual usage?
I'm debugging my converted code and I think I found a bug with a new feature in 6502 in vasm. If you use the option "-dotdir", it works but not for zpage and you have to define it without the dot. If not:
Code: Select all
error 2 in line 12 of "libs/vbcc/vbcc_zpage.s": unknown mnemonic <.zpage> included from line 5 of "src/crt0/startup.s"