Re: unsigned to float

From: Spiro Trikaliotis <ml-cbmhackers_at_trikaliotis.net>
Date: Mon, 14 Oct 2019 21:46:45 +0200
Message-ID: <20191014194645.GA7345_at_hermes.local.trikaliotis.net>
Hello Patryk,

* On Mon, Oct 14, 2019 at 07:05:38PM +0200 silverdr_at_wfmh.org.pl wrote:
> I need to do some FP calculations (one division, several
> multiplications) and wanted to use available BASIC routines. There's
> for example the GIVAYF routine that converts from 16 bit ints into FAC
> float format. Things work fine as long as I have "signed" ints on the
> input. What I need is "unsigned" so that I could use the whole 16 bit
> range. Suggestions appreciated.

tested many, many years ago, and I think it actually worked (addresses
of a C64):

        LDY #low
        LDA #high
        STY $63
        STA $62
        LDX #$90
        SEC
        JSR $BC49

Taken From:
Lothar English, Das Maschinensprache Buch für Fortgeschrittene zum
Commodore 64, Data Becker 1984, p. 23.

There are also examples for converting 1, 2, 3 or 4 byte values signed
or unsigned to FP.

Regards,
Spiro.

-- 
Spiro R. Trikaliotis
http://www.trikaliotis.net/
Received on 2020-05-29 23:07:52

Archive generated by hypermail 2.3.0.