Page 1 of 1

basic bank 1,2,3 with inline-asm not funktion.

Posted: Wed Apr 10, 2024 7:41 pm
by funkheld
hello, day.
I have 3 inline ASM that work.
In bank 1, bank 2, bank 3 the inline ASM is loaded from address Sa000.
this 3 inline is ok.

poke 0,3
sys $a000 is ok

These no longer work after the first call. no reaction.
poke 0,1
sys $a000 not ok

poke 0,2
sys $a000 not ok.

-------------------------------
POKE 0,1
RESTORE MATH
READ Z
FOR P = 0 TO Z-1
READ A
POKE $a000+P,A
NEXT

POKE 0,2
RESTORE SCHLEIFE
READ Z
FOR P = 0 TO Z-1
READ A
POKE $a000+P,A
NEXT

POKE 0,3
RESTORE SCHLEIFE1
READ Z
FOR P = 0 TO Z-1
READ A
POKE $a000+P,A
NEXT

MATH:
DATA 73
DATA $A9, $04, $85, $01, $A9, $44, $A0, $A0, $20, $63
DATA $FE, $A9, $3A, $A0, $A0, $20, $24, $FE, $A9, $3F
DATA $A0, $A0, $20, $5A, $FE, $20, $21, $FE, $A9, $3F
DATA $A0, $A0, $20, $5A, $FE, $20, $21, $FE, $20, $06
DATA $FE, $85, $02, $84, $03, $A0, $00, $B1, $02, $F0
DATA $06, $20, $D2, $FF, $C8, $D0, $F6, $60, $84, $1C
DATA $F5, $C2, $8F, $83, $20, $00, $00, $00, $82, $00
DATA $00, $00, $00,

SCHLEIFE:
DATA 31
DATA $A9, $00, $8D, $20, $9F, $A9, $00, $8D, $21, $9F
DATA $A9, $10, $8D, $22, $9F, $A2, $00, $A0, $00, $A9
DATA $2D, $8D, $23, $9F, $C8, $D0, $F8, $E8, $D0, $F3
DATA $60,

SCHLEIFE1:
DATA 34
DATA $A9, $00, $8D, $20, $9F, $A9, $00, $8D, $21, $9F
DATA $A9, $10, $8D, $22, $9F, $A9, $9A, $A2, $00, $A0
DATA $96, $8D, $23, $9F, $8D, $23, $9F, $88, $D0, $F7
DATA $CA, $D0, $F2, $60,
-----------------------------


this is ok with : sys $a000 , sys $a000+100 , sys $a000+200
----------------------------------
POKE 0,1
RESTORE MATH
READ Z
FOR P = 0 TO Z-1
READ A
POKE $a000+P,A
NEXT

RESTORE SCHLEIFE
READ Z
FOR P = 0 TO Z-1
READ A
POKE $a000+100+P,A
NEXT

RESTORE SCHLEIFE1
READ Z
FOR P = 0 TO Z-1
READ A
POKE $a000+200+P,A
NEXT

DATA......
-----------------------------------

then poke 0,6
poke $a000,123

poke 0,1
sys $a000 , sys $a000+100 , sys $a000+200 not ok.

Re: basic bank 1,2,3 with inline-asm not funktion.

Posted: Wed Apr 10, 2024 8:24 pm
by TomXP411
Do not POKE 0 or POKE 1 in BASIC. Use the BANK command.

BASIC switches banks for its own purposes, so you have to use BANK to select the bank that gets used for POKE, PEEK, SYS, USR, and WAIT. (I think that's all... but someone will tell me if I missed one.)

Re: basic bank 1,2,3 with inline-asm not funktion.

Posted: Wed Apr 10, 2024 10:10 pm
by funkheld
thanks for the tip.

now works great with the inline asm in basic.

greeting

Re: basic bank 1,2,3 with inline-asm not funktion.

Posted: Thu Apr 11, 2024 5:55 am
by TomXP411
funkheld wrote: Wed Apr 10, 2024 10:10 pm thanks for the tip.

now works great with the inline asm in basic.

greeting
Great! =)

This is why I love 8-bit computers... you don't get to do this kind of hardware-level stuff on a PC.