Re: A83: Calculating this formula...


[Prev][Next][Index][Thread]

Re: A83: Calculating this formula...




You obviously haven't even tried to do this yourself, which is
thoroughly annoying. Nevertheless I still did this for you. Btw, be sure
that you give me credit for this... and I no way gurantee it'll work
since some of these operations may destroy some of the ops that I
preserve values through. If so, your problem... and your welcome

   ld a,A

   call _setxxop1   ;op2 = A
   call _op1toop4   ;op4 = A
   call _fpsquare   ;op1 = op1 ^ 2
   call _div2       ;op1 = op1 / 2
   call _op1toop3   ;op3 = A^2/2

   call _random     ;op1 = rand
   call _op2set5    ;op2 = 5
   rst 28h          ;op1 = rand * 5
   call _op4toop2   ;op2 = A
   rst 28h          ;op1 = rand * 5 * A

   call _op2exop3   ;op2 = A^2
   rst 30h          ;op1 = (A^2/2) + (rand * 5 * A)

   call _op1exop4   ;op4 = (A^2/2) + (rand * 5 * A) | op1 = A
   call _op2set2    ;op2 = 2
   rst 28h          ;op1 = A * 2
   
   call _op4toop2   ;op2 = (A^2/2) + (rand * 5 * A)
   rst 30h          ;op1 = (A^2/2) + (rand * 5 * A) + (A*2)

   call _op2set3    ;op2 = 3
   rst 30h          ;op1 = (A^2/2) + (rand * 5 * A) + (A*2) + 3

   call _convop1    ;de = op1

D Weiss wrote:
> 
> What is the smallest way to evaluate this TI83 formula:
> 
> (A^2/2) + (rand*5*A) + (2*A) + 3
> 
> (put the answer in de)
> 
> (A is register A)
> ________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

-- 
Scott "_Wrath_" Dial
wrath@calc.org
ICQ#3608935
Member of TCPA - tcpa.calc.org
_____________________________________________
NetZero - Defenders of the Free World
Click here for FREE Internet Access and Email
http://www.netzero.net/download/index.html



Follow-Ups: References: