Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: Vijfhoek on October 20, 2012, 09:28:26 am

Title: Accessing registers
Post by: Vijfhoek on October 20, 2012, 09:28:26 am
Hello World,

I've been messing around with Axe for like a week now, and I am just getting into subroutines. So, I read that parameters get stored in r1 through r16. I have no idea how to access those though. I tried to find an answer on both Google and by using the search function of this site, without any outcome. Of course I can store the values in A through Z prior to calling the subroutine, but don't those use RAM memory?

I hope someone can help me out.
Title: Re: Accessing registers
Post by: Hayleia on October 20, 2012, 09:34:41 am
Press Vars, Left, 3 to access r1 to r6 ;)

Of course I can store the values in A through Z prior to calling the subroutine, but don't those use RAM memory?
What do you mean by use RAM memory ? Every variable uses 2 bytes of RAM memory, and r1 to r6 are variables too :)

Also, welcome to the forums, feel free to introduce yourself (http://www.omnimaga.org/index.php?board=10.0) :)
Title: Re: Accessing registers
Post by: Vijfhoek on October 20, 2012, 09:36:11 am
Aren't registers part of the Z80 itself?

But, thanks for your answer :)
Title: Re: Re: Accessing registers
Post by: Juju on October 20, 2012, 09:57:53 am
Some processors indeed have r1 to r16 registers in asm, but those doesn't exist in z80. r1 to r6 in Axe are pretty much unrelated and are simple variables like A to Z, used to pass parameters to subroutines.
Title: Re: Accessing registers
Post by: TIfanx1999 on October 20, 2012, 12:30:30 pm
^What he said. You cannot even access registers directly in axe (although many routines use them). The "r" tokens are used in BASIC for graphing.
Title: Re: Accessing registers
Post by: Hayleia on October 20, 2012, 02:54:34 pm
You cannot even access registers directly in axe
Since the Asm() command allows you to use native hex code, you can do everything you want in Axe :P