A86: Re: mod(


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

A86: Re: mod(




The command "mod(" performs a modulus on two numbers, the same as the MOD
command in BASIC or the % operator in C/C++.  m modulus n will return the
remainder of m divided by n.  The _FPDIV rom call will divide OP1 by OP2 and
return the quotient in OP1 and the remainder in OP2:

   call _op1set4    ; OP1 = 4
   call _op2set3    ; OP2 = 3
   call _FPDIV      ; OP1 / OP2 = 4 / 3
   call _disp_op1   ; disp OP1 = 1.333333333333
   call _op2toop1   ; OP2 -> OP1
   jp _disp_op1     ; disp/return OP2 = 3 (remainder)

--
David Phillips <david@acz.org>
http://www.acz.org/

----- Original Message -----
From: <Jeanne9005@aol.com>
To: <assembly-86@lists.ticalc.org>
Sent: Sunday, January 17, 1999 4:34 PM
Subject: A86: mod(


>
>I got an answer to how to do a mod( of two numbers, but then I was told not
tp
>use it.  How do I perform a mod( ?
>
>Glen Solsberry
>ZAPO
>
>