Set X / Y reg with BASIC?

Everything related to BASIC version 1.x (Oric 1 and Atmos) or HYPERBASIC (Telestrat).
Don't hesitate to give your small program samples, technical insights, or questions...
User avatar
Wing Commander
Posts: 1695
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria

Set X / Y reg with BASIC?

Post by ibisum »

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 .. ?

Code: Select all

10 FOR I=#400TO#407
30 DOKE#2F5,#400 
40 DATA#A2,#0,#A0,#0,#20,#6C,#FA,#60 50 FORI=#C000TO#FFFF­14
55 X=I­(INT(I/256)+256)
60 POKE#401,X:POKE#403,INT(1/256) 70 PRINTI,HEX$(I)
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 ..