Memory Banking Question

All aspects of programming on the Commander X16.
funkheld
Posts: 322
Joined: Mon Feb 26, 2024 11:11 am

Re: Memory Banking Question

Post by funkheld »

Are all sys commands in there from basic for asm with jsr... in the x16 doc ?
-------
lda #4
sta $01 ; rom bank 4 (BASIC)
------
thanks
Attachments
rom.jpg
rom.jpg (29.69 KiB) Viewed 2771 times
TomXP411
Posts: 1785
Joined: Tue May 19, 2020 8:49 pm

Re: Memory Banking Question

Post by TomXP411 »

funkheld wrote: Tue Apr 09, 2024 6:39 pm How many Rom an benches are there in the x16?
What are they called please?
Where can you find the sys commands for the rom commands?

Thanks.
Those are not published APIs, so the address for those can change between builds.

If you want to inspect the code to see how it works, you can check out the ROM source code on the Github Repo. Otherwise, we're not going to publish the addresses for the BASIC ROM routines, because they are not fixed and will change from one release to the next.
hstubbs3
Posts: 72
Joined: Thu Oct 26, 2023 12:14 pm

Re: Memory Banking Question

Post by hstubbs3 »

It doesn't list the addresses to JSR to for the BASIC commands ..

poking around the ROM repo, I think I understand why that is ...

https://github.com/X16Community/x16-rom ... ic/basic.s

https://github.com/X16Community/x16-rom ... c/tokens.s


The way the ROM is currently assembled, the addition or removal of any BASIC keyword would result in the table addresses changing..

Changes to the functions themselves would shift the final address of the subroutine.


BASIC does not provide an API in the way that the KERNAL does.

consider this -
https://github.com/X16Community/x16-rom ... /vectors.s

No matter what may change about the underlying implementation or if new Kernal functions are added later,
.segment "JMPTBL" will always provide good location to some KERNAL function...

. . . .

If there is some BASIC function you want to call from ASM, you would need to do it some other way - possibly could incorporate the code from the ROM repo for that bit of BASIC, otherwise would need some way to ensure that your program is calling into the correct location in the BASIC bank
hstubbs3
Posts: 72
Joined: Thu Oct 26, 2023 12:14 pm

Re: Memory Banking Question

Post by hstubbs3 »

TomXP411 wrote: Tue Apr 09, 2024 11:17 pm
funkheld wrote: Tue Apr 09, 2024 6:39 pm How many Rom an benches are there in the x16?
What are they called please?
Where can you find the sys commands for the rom commands?

Thanks.
Those are not published APIs, so the address for those can change between builds.

If you want to inspect the code to see how it works, you can check out the ROM source code on the Github Repo. Otherwise, we're not going to publish the addresses for the BASIC ROM routines, because they are not fixed and will change from one release to the next.
the timing man... hehe
funkheld
Posts: 322
Joined: Mon Feb 26, 2024 11:11 am

Re: Memory Banking Question

Post by funkheld »

hello, thanks for the information about the basic.
this vector table is great.

demo:
jmp GRAPH_draw_rect ; $FF2F: void GRAPH_draw_rect(word x, word y, word width, word height, word corner_radius, bool fill);

what is this please :bool fill is this 0 or 1?
What kind of data must be entered?

greeting
mortarm
Posts: 302
Joined: Tue May 16, 2023 6:21 pm

Re: Memory Banking Question

Post by mortarm »

Important: The layout of the banks is not yet final.
Any idea when it will be?
TomXP411
Posts: 1785
Joined: Tue May 19, 2020 8:49 pm

Re: Memory Banking Question

Post by TomXP411 »

mortarm wrote: Wed Apr 10, 2024 2:48 pm
Important: The layout of the banks is not yet final.
Any idea when it will be?
Probably not for a long time - at least until the Gen-2 systems are being sold.

You're probably not going to see a major reshuffling of banks at this point; instead, it's more likely we'll see new functions and utility programs added to banks 16+. The terminal program, for example, will probably live in 16, we'll see an assembler and a couple of compilers up there, as well.
funkheld
Posts: 322
Joined: Mon Feb 26, 2024 11:11 am

Re: Memory Banking Question

Post by funkheld »

An assembler that produces the ASM code as inline for the basic could perhaps be developed now.
This wonderful BASLOAD also worked out beautifully.
a basic compiler could give priority to the asm inline.

greeting
DragWx
Posts: 345
Joined: Tue Mar 07, 2023 9:07 pm

Re: Memory Banking Question

Post by DragWx »

TomXP411 wrote: Wed Apr 10, 2024 4:15 pm You're probably not going to see a major reshuffling of banks at this point; instead, it's more likely we'll see new functions and utility programs added to banks 16+. The terminal program, for example, will probably live in 16, we'll see an assembler and a couple of compilers up there, as well.
👏 MAGIC 👏 DESK! 👏 MAGIC 👏 DESK!

(kidding :P)
Post Reply