Re: unsigned to float

From: silverdr_at_wfmh.org.pl
Date: Tue, 15 Oct 2019 11:04:39 +0200
Message-Id: <993206A4-DCB0-4A8A-B1E8-7096299B8EA3_at_wfmh.org.pl>
> On 2019-10-14, at 21:46, Spiro Trikaliotis <ml-cbmhackers_at_trikaliotis.net> wrote:
> 
> 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

Ha! That looks good. Not a single JSR but probably as close to it as it gets. And Carry means "+" here. Makes sense. Thanks, Spiro.

> 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.

I have a copy of this book somewhere, and now, when you wrote about it, I recall that big part of it was actually about FP calculations, which I didn't need back then. 

-- 
SD! 
Received on 2020-05-29 23:08:56

Archive generated by hypermail 2.3.0.