Re: LZ: int function in assembly
[Prev][Next][Index][Thread]
Will Stokes (3D Diamond productions / Global Games) wrote:
>
> How do I take the integer value of a number in assembler? I.E., 6.23423->6
What kind of numbers are you using ? Fixpoint or Floating point ?
If you are using the same kind of fixpoiont numbers which is used
in my rutines, you can get the int part of the fixpoint number in
bc in to a with the following instruction.
ld a,b
If you are using another format you might have to shift the number a
couple of times.
If you are using floating point numbers it is a bit harder and how you
do it depends on the format. Try looking at therutine in the rom if
you are using floating point.
<pre>
--
_______________________________________
Dines Justesen
Email: dines@post1.com or
c958362@student.dtu.dk
WWW : http://www.gbar.dtu.dk/~c958362/
_______________________________________
</pre>
References: