New BASIC command/token in ROM

All aspects of programming on the Commander X16.
Greg King
Posts: 162
Joined: Wed Jul 08, 2020 1:14 pm

New BASIC command/token in ROM

Post by Greg King »



On 10/24/2020 at 6:48 AM, desertfish said:




Also, I would have expected that using ".import byte_to_hex_ascii "  would enable you to use the symbol rather than the absolute address; but, that doesn't work.   I'm not familiar enough with the tool chain to come up with a possible solution for that.  Is there someone else that can?  I think that referring to the absolute address of the function is quite brittle.



Every ".import name" must be matched by a ".export name".  In this case, "monitor.s" should contain
.export byte_to_hex_ascii 


User avatar
JimmyDansbo
Posts: 476
Joined: Sun Apr 26, 2020 8:10 pm
Location: Denmark
Contact:

New BASIC command/token in ROM

Post by JimmyDansbo »


I believe I tried that without luck...

... Just tried it again, still no luck.

in monitor.s: .export byte_to_hex_ascii

in x16additions.s: .import byte_to_hex_ascii

... Still it does not recognize the name.

Visit my Github repo
or my personal site with CX16/C64/6502 related information.
Feel free to contact me regarding any of my projects or even about meeting up somewhere near Denmark
Greg King
Posts: 162
Joined: Wed Jul 08, 2020 1:14 pm

New BASIC command/token in ROM

Post by Greg King »


I looked at the makefile.  Unfortunately, the ROM banks are built separately, nowadays.  They can't know about each other's labels.

Jump-tables in unchangable locations would need to be used to share subroutines, reliably, from other functional modules.

User avatar
desertfish
Posts: 1123
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

New BASIC command/token in ROM

Post by desertfish »


Sounds to me as if copy-pasting that particular routine from the monitor is the way to go....    (personally I would prefer that over a suddenly crashing ROM because the monitor was modified and the routine is no longer on the hardcoded address)

User avatar
JimmyDansbo
Posts: 476
Joined: Sun Apr 26, 2020 8:10 pm
Location: Denmark
Contact:

New BASIC command/token in ROM

Post by JimmyDansbo »



7 hours ago, desertfish said:




Sounds to me as if copy-pasting that particular routine from the monitor is the way to go....



I agree. Now that some space has been freed, I will look into getting the byte_to_hex_ascii function back into the BASIC rom and I will tidy up the HEX$ and BIN$ functions as I had to jump through quite a lot of hoops to make the fit before.

Visit my Github repo
or my personal site with CX16/C64/6502 related information.
Feel free to contact me regarding any of my projects or even about meeting up somewhere near Denmark
Post Reply