Page 1 of 1

why does ti contain op1set1, 2, 3 and 4

Posted: Fri 25 Feb, 2011 3:58 am
by puromtec
I am really just curious, why does ti offer op1set1/2/3/4. I understand that op1set1 will help setup the exponent and real flag in floating point to make creating floating point values a little easier. But, why also have 2 3 and 4, as well as system routines? Just seems odd.

Re: why does ti contain op1set1, 2, 3 and 4

Posted: Fri 25 Feb, 2011 4:22 am
by Xeda
It's because it was easy, that's all. The code might have been something like:

Code: Select all

Op1Set0:
      xor a
      jr SetXXOP1
OP1Set1:
      ld a,1
      jr SetXXOP1
OP1Set2:
      ld a,2
      jr SetXXOP1
OP1Set3:
      ld a,3
      jr SetXXOP1
OP1Set4:
      ld a,4
SetXXOP1:
      <<code for bcall(_SetXXOP1)>>
I do that, too when I only need to add a few bytes to create something else useful. For example, in BatLib I have a call that multiplies DE by BC, so I added an ex de,hl to make another call called Mult_HL_by_BC :D

I have not checked those bcalls, but I have looked at the calls like OP1ToOP2 and that is how they work, so I imagine that is how the OP1Setx calls work.