Page 3 of 3

New BASIC command/token in ROM

Posted: Tue Oct 27, 2020 4:51 pm
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 



New BASIC command/token in ROM

Posted: Tue Oct 27, 2020 5:51 pm
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.


New BASIC command/token in ROM

Posted: Tue Oct 27, 2020 10:09 pm
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.


New BASIC command/token in ROM

Posted: Tue Oct 27, 2020 11:15 pm
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)


New BASIC command/token in ROM

Posted: Wed Oct 28, 2020 6:45 am
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.