-
-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.data section broken when used for code #228
Comments
Hello, Is it correct ? |
YES, that's exactly it! The ASCII representation of the assembly instructions is what is put into the ROM rather than the actual machine byte code instructions. That text above was direct copy-pasted from RAM after execution initialized that section and copied its contents from ROM to RAM as seen here: |
For reference, to repro this: I took the Hello World example, and just added this to the top:
And then called the |
That's really fantastic! I test it now :D ! |
I'll preface this by saying, yes, I'm doing something highly non-standard in the SNES area. I'm working with some highly specialized custom hardware, and this is a technique common on microcontrollers.
I need to be able to run a chunk of code from RAM instead of ROM because at a certain point in time, the ROM becomes unavailable.
A very basic example looks like as follows:
Now, TCC understands this properly, and knows to load this chunk of data from ROM to RAM on code initialization, the same as it would for predefined string variables.
The problem is, is that it looks like the linker gets highly confused by this.
The actual contents put into the ROM and then copied into RAM is literally the ASM text, rather than the assembled text into machine code as follows. This is literally the contents in RAM after initialization at location $7F0022.
I think it goes without saying... this should be machine code here, not ASM text!
The text was updated successfully, but these errors were encountered: