New BASIC command/token in ROM

All aspects of programming on the Commander X16.
User avatar
desertfish
Posts: 1123
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

New BASIC command/token in ROM

Post by desertfish »


Hmm, was it because of the ROM size limitation that the 16-bit support had to be dropped? Very unfortunate....

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 this.  Is there someone else that can?    I think referring to the absolute address of the function is quite brittle

 

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 »



2 minutes ago, desertfish said:




Hmm, was it because of the ROM size limitation that the 16-bit support had to be dropped?



Yes, I think there might be a single byte available after these functions have been added as they are now.

Also, I think that the functions will mostly be used to show output of peeks and vpeeks which are only a single byte anyway ?


3 minutes ago, desertfish said:




I think referring to the absolute address of the function is quite brittle



I totally agree, but I don't know how to be able to use the name either. I am thinking that ROM maintainer will let us know if I do a pull request ?

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
User avatar
desertfish
Posts: 1123
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

New BASIC command/token in ROM

Post by desertfish »


I hope so, may be wise to mention this issue in the PR ?     Anyway it's great we got something working  ?

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 »


Yes indeed. How did you figure out that it was necessary to do pla twice before jmp'ing to strlit ?

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
User avatar
desertfish
Posts: 1123
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

New BASIC command/token in ROM

Post by desertfish »


I looked at the disassembly for several other tokens and kinda played with it,  i started by just copying the code from STR$ and went from there I believe.   I don't understand basic's execution loop and things I just copied stuff from elsewhere until it worked...

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 »


Argh, I just tried compiling the new ROM with the PRERELEASE_VERSION set and then it is too large to fit in the 16KB ROM page ?

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
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 managed to free up some space in the BASIC ROM page.

https://github.com/JimmyDansbo/x16-rom/commit/a0470c136811ef56c6f3d5131bc9ffa1d254f9b6

@desertfish do you think we should try and go for handling word values as well as byte values?

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
User avatar
desertfish
Posts: 1123
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

New BASIC command/token in ROM

Post by desertfish »


I would like to see support for word values, to mirror the ability of the '$' and '%' prefixes to deal with words.  However your argument about the actual real world usage of HEX$ and BIN$ are relevant too.   I mostly need the full 16 bits when in an assembly environment, and we have the monitor for that.....

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 »


Now that space is freed in the BASIC ROM page, I think it will actually be possible have the functions handle word values as well.

Do you think it would be sufficient that HEX$ outputs a 4 byte string if the value is larger than 255 otherwise a 2 byte string?

Or should it be something that you specify when calling i.e. something like HEX$(42, 1) returns 2A and HEX$(42, 2) returns 002A 

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
User avatar
desertfish
Posts: 1123
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

New BASIC command/token in ROM

Post by desertfish »


For me it's perfectly fine if HEX$(255) -> FF   and HEX$(65535) -> FFFF

 

Post Reply