• Please review our updated Terms and Rules here

Fun with TI-74s

JGardner

Experienced Member
Joined
Jun 14, 2009
Messages
200
A Use for DATA statements not found by RTFM...



BASIC is handy, and believe it or not, many of the I2C & SPI peripherals out there

these days can be interfaced to the '74 with PEEKS & POKES alone - This is usually

so slow that you'll quickly see the point of assembly language subroutines.

RS-232 can also be "bit-banged" with assembler - 19.2K is achievable.


Reserving memory with GETMEM, POKE-ing in an asm routine, & EXEC-ing it is pretty

straightforward - The CC40 User Manual has an example in the appendix. If you are,

say, interrogating a sensor, you also need a way to pass the data back to BASIC.



There is a formal mechanism for "parameter passing", of course, but if your asm

routine just passes data to your BASIC pgm, an easy hack is:


Make "100 DATA ##########" the first line in your BASIC program - This reserves

a 10-byte buffer (in this case) at a known location in memory, 0x3FF5 - 0x3FEC;

BASIC pgms run backwards in memory - From high address to low address.That high

address is normally 0x3FFF, 0x5FFF, or 0xBFFF.


If an 8K RAM cartridge is appended, the buffer address is 0x5FF5 - 0x5FEC. If a

32K RAM cartridge is appended, 0xBFF5 - 0xBFEC.


Your asm routine simply writes data to the buffer and returns. BASIC then READs

the DATA statement into a string and PRINT's it, or processes it further with SEG$,

ASC, VAL, and so on, depending on what you're up to.



Note that about half the possible chars (0 - 255) are non-printing characters;

the DATA statement may look a little strange after your asm routine writes raw

data to it, but BASIC's string functions process non-printing & printing chars

alike.



This might be all you need to add a Real-Time Clock, Temp sensor, Accelerometer,

or GPS to your '74...



Have fun! :)
 
... I need to do more with my CC-40. I have some TI-74s in a box somewhere.


This should work with CC40s too - The buffer addresses are the only difference,

AFAIK. I'll try it when I get home.


Not the only trick you can play on DATA statements - For instance, you can embed

executable code in them, and EXEC the code in place, skipping the business of GETMEM,

reading the code into reserved memory, etc ... :) ... Works fine for short routines.


Jack
 
I'm all for beer halls. :) Mainly what I'm up to, though, is furthering the interest

of the many who will have a TI-74 pass through their hands at some point. That in-

terest will be encouraged by my small efforts, easily found courtesy VCF, I hope.

There are a <lot> of calculators out there, and I can't see the slightest harm in en-

couraging those interested in learning to program them.
 
Re my last post - The post I replied to has been removed, apparently...

Nacht und Nebel, perhaps... :)
 
No problem, Jim! I saw the missing post too. Many thanks for all you do to keep these devices current!
 
Hey, JGardner - do you know if there was any difference between the TI-74 and the TI-74s with regards to CALL ADDMEM? I remember reading somewhere that the TI-74S allowed 16K to be added with CALL ADDMEM whereas the 74 was just 8K. I can't find it anywhere on the web for the life of me, though.
 
Hi Jon. In the 74 ADDMEM will add 8K to SYSRAM, assuming its available.

In the 74S ADDMEM will append up to 32K to SYSRAM. HTH. Jack
 
Hi Jon. In the 74 ADDMEM will add 8K to SYSRAM, assuming its available.

In the 74S ADDMEM will append up to 32K to SYSRAM. HTH. Jack

So, there are really two different BIOS Versions then. I wonder if the CPU ROM is different between the two or the 32K BIOS ROM. Do you have both dumped to compare?
 
Hi Jon,

The 74 & 74S ROMs are slightly different. Bug fixes mostly; the most

significant one I know about is a bug in one of the trig identity functions.

ADDMEM also behaves differently, as noted...

The 74's calculator alter ego does'nt get a lot of love, but if you compare

the displays of a 74 & a 74S in CALC mode, you'll see the difference.

Why they did this I don't know...
 
Hi Jon,

The 74 & 74S ROMs are slightly different. Bug fixes mostly; the most

significant one I know about is a bug in one of the trig identity functions.

ADDMEM also behaves differently, as noted...

The 74's calculator alter ego does'nt get a lot of love, but if you compare

the displays of a 74 & a 74S in CALC mode, you'll see the difference.

Why they did this I don't know...

Do you happen to have both of them dumped? I don't have the capability since I don't have a PCIF cable :)

How about the CPU ROM as well?

Thanks!!
 
Back
Top