Set X / Y reg with BASIC?
Posted: Mon Feb 05, 2024 2:28 pm
Is there a way to set the X and Y regs from within BASIC? I've got this mini-assembly routine that'll do it (from Personal Computer News #81, "Plenty of Sound on Oric and Atmos"), but I'm wondering if there is some way to do it that would be compliant with the 10-LINE BASIC PROGRAMMING Competition this year .. ?
EDIT: digging a bit deeper, it seems that the routine at $FA86 is basically just set up to transfer the address from X/Y regs to $14/$15 in the Zero Page, which is then accessed by $F590 routine to do the transfer to the 8192 .. okay, will try this out ..
Code: Select all
10 FOR I=#400TO#407
20 READD:POKEI,D:NEXT
30 DOKE#2F5,#400
40 DATA#A2,#0,#A0,#0,#20,#6C,#FA,#60 50 FORI=#C000TO#FFFF14
55 X=I(INT(I/256)+256)
60 POKE#401,X:POKE#403,INT(1/256) 70 PRINTI,HEX$(I)
...