Page 2 of 2

Re: Memory Banking Question

Posted: Tue Apr 09, 2024 8:32 pm
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

Re: Memory Banking Question

Posted: Tue Apr 09, 2024 11:17 pm
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.

Re: Memory Banking Question

Posted: Tue Apr 09, 2024 11:21 pm
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

Re: Memory Banking Question

Posted: Tue Apr 09, 2024 11:21 pm
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

Re: Memory Banking Question

Posted: Wed Apr 10, 2024 7:46 am
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

Re: Memory Banking Question

Posted: Wed Apr 10, 2024 2:48 pm
by mortarm
Important: The layout of the banks is not yet final.
Any idea when it will be?

Re: Memory Banking Question

Posted: Wed Apr 10, 2024 4:15 pm
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.

Re: Memory Banking Question

Posted: Wed Apr 10, 2024 5:47 pm
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

Re: Memory Banking Question

Posted: Wed Apr 10, 2024 6:11 pm
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)