Some of you out there in the #nesdev channel may already know about this, but under the sage advice of Memblers, I have decided to post it here. (The old link at the geocities page no longer works for obvious reasons.)
http://www.romhacking.net/docs/344/
As-is, it will work with x816 without any modifications. I have gotten it to work with cc65's assembler, ca65. However, you need to make some modifications to make it work properly.
First, you gotta change all the ".dw" to ".word", and ".db" to ".byte". Then you gotta make a small modification to the directives portion of the file.
Once you assemble the file, you will end up with an object file. In order to get the binary out of it, you need to run ld65. However, ld65 requires a config file to link to the object file properly. So create a text file with any name and put this in it:
Then run the linker and you should end up with the appropriate binary. If you want to, you can change the name of the filename in the "file" portion of the MEMORY config section, but the rest of it must be left as-is.
I hope this has been helpful.
http://www.romhacking.net/docs/344/
As-is, it will work with x816 without any modifications. I have gotten it to work with cc65's assembler, ca65. However, you need to make some modifications to make it work properly.
First, you gotta change all the ".dw" to ".word", and ".db" to ".byte". Then you gotta make a small modification to the directives portion of the file.
Code:
;-------------------------------------------------------------------------------------
;DIRECTIVES
; .index 8 <-- either remove these two or comment them out
; .mem 8
.p02 <-- you need to add this directive
.org $8000
;-------------------------------------------------------------------------------------
;DIRECTIVES
; .index 8 <-- either remove these two or comment them out
; .mem 8
.p02 <-- you need to add this directive
.org $8000
;-------------------------------------------------------------------------------------
Once you assemble the file, you will end up with an object file. In order to get the binary out of it, you need to run ld65. However, ld65 requires a config file to link to the object file properly. So create a text file with any name and put this in it:
Code:
MEMORY {
ROM0: start = $8000, size = $8000, file = "smbdis.bin" ;
}
SEGMENTS {
CODE: load = ROM0, type = ro;
}
ROM0: start = $8000, size = $8000, file = "smbdis.bin" ;
}
SEGMENTS {
CODE: load = ROM0, type = ro;
}
Then run the linker and you should end up with the appropriate binary. If you want to, you can change the name of the filename in the "file" portion of the MEMORY config section, but the rest of it must be left as-is.
I hope this has been helpful.