Fun with tweaking BASIC continues: returning numbers

Juan Castro via Coco <coco-uNHYcr1XS/wmlAP/[email protected]>
Newsgroups gmane.comp.hardware.tandy.coco
Message-ID <CAGhS81GYesQQ7piLnnop2K_+C-BdAnaA1PnUmbL1oWst96AqLQ@mail.gmail.com>
I've finally fixed something in my HDB-DOS/16 I've been struggling with for
months: my extension of TIMER (TIMERL) now can use a full 32-bit unsigned
integer as a timer value, which means you now can keep track of time for 2
years, 98 days, and a half. (At 60 Hz.) By the way, is there anything about
RTC expansions back in the day, and how did they integrate with ECB?

In the process, I concocted a souped-up GIVABF that can return you a 32-bit
positive number (0 to four billion and something); you provide the MSW in D
and the LSW in X:

GIVABXF         CLR     VALTYP          RETURN 32-BIT VALUE IN D:X AS UINT32
                STD     FPA0
                STX     FPA0+2
                LDB     #$A0
                STB     FP0EXP
                CLRA
                STA     FPSBYT
                STA     FP0SGN
                JMP     LBA1C

Also, in the process I saw that GIVABF assumes D is a signed integer, but
good old TIMER returns positive values between 32K and 64K with no issue.
What it uses is this:

                STX     FPA0+2
                JMP     L880E

That code is at $896B in ECB. No label there, but you might as well call it
GIVXF, use it, and be happy.

You can get the goodies in the link below as per usual:

https://www.dropbox.com/scl/fo/9p5ydq5hqgp4b1fbqyyif/AKnngotPgk1PLUm6kw0nn5U?rlkey=exgpq1wksaevs8rn2diqaz1ha&st=md7fjifd

Juan Castro
Enviado do meu Olivetti Programma 101
http://retropolis.com.br

-- 
Coco mailing list
Coco-uNHYcr1XS/wmlAP/[email protected]
https://pairlist5.pair.net/mailman/listinfo/coco
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.