Page 1 of 1

I would like to exchange data with the bank, please.

Posted: Tue Apr 02, 2024 7:07 am
by funkheld
Hi good afternoon.
I would like to exchange data with the bank, please.

set bank:
poke (0,8) = do I have bank 8 for my data with the address $a000 , 8kb ?

...poke($a000,123)....poke($a001,124).......

poke(0,9) = fill bank 9 with data ....poke($a000)....

poke(0,8)....peek($a000).....peek($a001)....my old bank data has been preserved?

Which bank can I still use?

Thanks.
greeting

Re: I would like to exchange data with the bank, please.

Posted: Tue Apr 02, 2024 1:42 pm
by unartic
You can use any of the banks from #1 (#0 is reserved for other stuff).

A 512kb system (which is the default) has 64 banks, so #63 is the last bank you can use.

See https://github.com/X16Community/x16-doc ... y%20Map.md for more information.

Re: I would like to exchange data with the bank, please.

Posted: Tue Apr 02, 2024 1:58 pm
by ahenry3068
You can use $BF00-BFFF ONLY in Bank 0 for interprocess communication. This area is reserved for this purpose. The rest of Bank 0 should be considered off limits.

Re: I would like to exchange data with the bank, please.

Posted: Tue Apr 02, 2024 3:12 pm
by funkheld
Thanks for the info.

Can I do it as I described above: fill the benches and collect them with poke/peeke etc?

what kind of bank 0/1 is this on vpoke/vpeek?

Thanks.
greeting

Re: I would like to exchange data with the bank, please.

Posted: Tue Apr 02, 2024 3:25 pm
by funkheld
Hmm... a misconception on my part.

actually should:
123
124
come out?

Thanks.
greeting

Re: I would like to exchange data with the bank, please.

Posted: Tue Apr 02, 2024 3:48 pm
by TomXP411
In BASIC, do not use POKE 0 or POKE 1 to set the bank. Instead, use the BANK command.

https://github.com/X16Community/x16-doc ... IC.md#bank

Since the KERNAL uses bank 0 for its own purposes, you can't count on the bank staying set between statements in BASIC, hence the BANK command, which sets the bank used by the next POKE, PEEK, SYS, or USR statement.

Re: I would like to exchange data with the bank, please.

Posted: Tue Apr 02, 2024 4:32 pm
by ahenry3068
At least he's poking 0. I made kind of the same mistake but I was trying to read the ROM font. POKE 1, 6 put me straight to the monitor. ;).

Re: I would like to exchange data with the bank, please.

Posted: Tue Apr 02, 2024 4:33 pm
by funkheld
hello , thanks.

madpascal is ok.

Code: Select all

uses x16_vera, x16, crt;

var 
x: byte;

begin
        Poke(0,8);
	Poke($a010,77);
	
	Poke(0,9);
	Poke($a010,88);
	
	writeln('');
	
	Poke(0,8);
	x:=Peek($a010);
	writeln(x);
	
	Poke(0,9);
	x:=Peek($a010);
        writeln(x);
end.