Page 2 of 3

New BASIC command/token in ROM

Posted: Sat Oct 24, 2020 10:48 am
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

 


New BASIC command/token in ROM

Posted: Sat Oct 24, 2020 10:53 am
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 ?


New BASIC command/token in ROM

Posted: Sat Oct 24, 2020 11:51 am
by desertfish

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


New BASIC command/token in ROM

Posted: Sat Oct 24, 2020 11:53 am
by JimmyDansbo

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


New BASIC command/token in ROM

Posted: Sat Oct 24, 2020 11:59 am
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...


New BASIC command/token in ROM

Posted: Sun Oct 25, 2020 8:19 am
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 ?


New BASIC command/token in ROM

Posted: Sun Oct 25, 2020 2:21 pm
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?


New BASIC command/token in ROM

Posted: Mon Oct 26, 2020 12:00 pm
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.....


New BASIC command/token in ROM

Posted: Mon Oct 26, 2020 5:41 pm
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 


New BASIC command/token in ROM

Posted: Tue Oct 27, 2020 9:43 am
by desertfish

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