Jump to content
IGNORED

The TMS9900 Cheat-Sheet


SteveB

Recommended Posts

Hi 99ers,

 

it has been sitting on my desk for a year now, so it is finally time to share it: The TMS9900 Cheat-Sheet. When I started assembly language programming on the TI I kept looking up mnemonics and their addressing types all the time. I wished for a one-pager, like the quick reference card I loved in the eighties for TI BASIC and Extended BASIC. I couldn't find one, the E/A quick reference card wasn't half as helpful as their BASIC counterparts. So I started to build my own and used it a lot since then. 

 

 

Special thanks to @Lee Stewart for hints and proofreading.

 

Please let me know here if you have any corrections, suggestions for improvement or ideas for this half empty second page.

 

Steve

 

  • Like 11
  • Thanks 13
Link to comment
Share on other sites

Looks good. It would be nice to have one as on cardboard that folds and expands like the TI XB one and others that TI made. You did a good job so far with it. Since I do alot of GPL work as well, I would add some of that onto it.

Also having some of changes for the 9995 would be handy (for geneve usage), plus the 99105. Maybe also some DSR stuff for file operations, and more info on >8300 ram usage.

  • Like 3
Link to comment
Share on other sites

29 minutes ago, Gary from OPA said:

Looks good. It would be nice to have one as on cardboard that folds and expands like the TI XB one and others that TI made. You did a good job so far with it. Since I do alot of GPL work as well, I would add some of that onto it.

Also having some of changes for the 9995 would be handy (for geneve usage), plus the 99105. Maybe also some DSR stuff for file operations, and more info on >8300 ram usage.

The 9905 and 99105 might be too specific, but what would you like to see from the ScratchPad RAM? I couldn't decide on what to include from Thierry's PADRAM page and what to drop. I have no clue on GPL, but would be open to submissions to include.

Link to comment
Share on other sites

6 hours ago, SteveB said:

The 9905 and 99105 might be too specific, but what would you like to see from the ScratchPad RAM? I couldn't decide on what to include from Thierry's PADRAM page and what to drop. I have no clue on GPL, but would be open to submissions to include.

Hmm, for PADRAM, the ones used most often is:

 

PAB DSR Usage >834A-8354

Highest free VDP >8370

Keyboard/Joystick stuff >8374 to 8377

ISR Disabling flags >83C2

Screen timeout >83D6

Copy of VDP R1 >83D4

 

Of course all the rest is handy, but for quick reference those are worthwhile to know as you see them more often then other ones.

 

Personally, I still think a multi-panel format that can be printed out on thick card stock and folded in the style of the original reference cards would be the best, like 4 or 6 panels on each side. Divided into sections like you have it now. But your 1-pager is good as well. Keep up the good work. :)

  • Like 2
Link to comment
Share on other sites

Nice compilation! But I'm a bit uncertain about for whom is this intended, really?

If it's for the beginner, or even the reasonably well-versed I'd say there are a few things to get rid of:

  • Instruction format code.
  • Instruction format information.
  • Instruction timing.

The normal programmer has no use for this.

The only thing a normal programmer needs to know about timing is that the fewer the instructions, the better. It's only if you are doing very time critical things you need this information.

Instruction formats are only interesting if you are going to write a disassembler. For sure I've done one, but that was when it didn't exist.

 

Perhaps these too:

  • Status flags affected by instructions.

Almost all of them are obvious, except that MPY doesn't set Equal bit if result is zero and that CLR and SETO doesn't change any bits at all.

 

These things, on the other hand, should be added:

  • How does the transfer vector work for BLWP.
  • Which registers are used for BLWP and RTWP and for what.
  • The graphical description of the addressing modes, found for example in section 3.2 in the TMS 9900 family data book, are quite informative, especially for a newbie.
  • In which order bits are transferred to/from the destination/source for LDCR/STCR. Also, it's misleading to use the *R12 notation there, as this is an IO area base address, not an address to a memory word.
  • That a bit tested with TB sets the equal to zero status bit true when the tested bit is not zero.

LI, AI, ANDI, ORI and LWPI work with immediate values (not immediately), that is values stored inline with the code, not in some register or other data. This tengs to confuse assembly language beginners.

 

 

Edited by apersson850
Link to comment
Share on other sites

13 hours ago, apersson850 said:

But I'm a bit uncertain about for whom is this intended, really?

It was intended for me, myself and I. It was not meant to serve anyone else when I started, but I gladly share it and enjoy, if it is helpful to someone else and when I can make it even more helpful with your input.

 

I won't throw away work already done, but consider your additions. Thank you!

 

Steve

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

With today's electronic editing, it's very easy to start with an edition that has "too much" information and create a new one, with an adapted set. Nothing says you can't have two sheets, where one of them is more aimed for the "normal" programmer, who has no need for timing information, for example. He just wants his programs to work.

Link to comment
Share on other sites

For what it's worth, the only times I venture into the world of assembly is when I need to write highly optimized or time sensitive code, otherwise C would do just fine. So this is incredibly useful to me personally.

  • Like 5
  • Thanks 1
Link to comment
Share on other sites

I've used assembly mainly to do things that can't be done at all from the higher level (frequently Pascal in my case, sometimes Extended BASIC), or took too long. But in the latter case, frequently even a not very optimized assembly support routine is much faster than doing it in higher level.

Which reminds me about that perhaps I should design such a sheet for assembly in the p-system's world. I don't think any such sheet exists today.

The TMS 9900 instructions are the same, of course, but system related addresses, assembler directives and linking procedures are different.

  • Like 4
Link to comment
Share on other sites

I really like the way your Page 1 covers most of the 9900.  

 

Couple of minor points:

The "not used" bits - for example in AI or RTWP - they should always be 0s.   I don't know if the 9900 ignores those bits, or skips the invalid instruction.  The TMS9995 (and later) throws a Level 2 interrupt if they are not 0.  

I expect the Editor/Assembler leaves these bits at 0.   

 

 

With the unused bit in the Immediate opcodes, TI could have made 8 more Format 8 Immediate instructions, but never took advantage of that prime real estate.   Some ideas would be XORI, SOCI, SZCI ... alas.

 

  • Like 3
Link to comment
Share on other sites

4 hours ago, Eric Lafortune said:

Very useful!

 

Possible typo: "LIMI cnt: Load int. level: 0,1 enable; 2-15 dis." -> isn't it the other way around?

You are right! I will work all corrections into the Version 1.1 and release it end of January.  Thank you!

 

image.thumb.png.d94749907efe9d4c0c4dd32cb8493289.png

  • Like 2
Link to comment
Share on other sites

Hi

 

I love the cheat sheet. Thanks.

 

A few small imperfections... The word immediate is misspelled in four places though not in others. We can't have that in this important document 😄

 

On the second page, in the comments field for Variables and Constants used, fourth and seventh line. Also twice in the Instruction Format, line eight.

 

One thing I have added in the comments field for my copy, is the call color codes for extended basic character groups, starting with call color code 0 covering characters 30-31, etc. It is outside the MC scope of this sheet, but useful to me.

 

 

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

  • 2 weeks later...

As promised, here is a revised version of the TMS9900 Cheat-Sheet.

  • Corrected LIMI line and some typos
  • Noted that unused bits in instructions should be zero 
  • "immediate" should come with a warning sign for foreign speakers
  • Added VDP Memory layout for BASIC, XB, XB256 Screen2, EA and MiniMem
  • Added some more PADRAM addresses
  • Added register usage for BLWP, RTWP, BL and XOP

Thank you for all the corrections and suggestions so far and let me know if you have more.

 

Enjoy!

 

TMS9900 Cheat Sheet V1.1 (US-Letter).pdf

TMS9900 Cheat Sheet V1.1 (A4).pdf

 

PS: The color groups are indirectly, partially included in the ASCII-Table. The vertical line after x7 seperates the groups per line, so 2x is group 1 and 2, 3x is 3 and 4 and so on.

 

 

  • Like 7
  • Thanks 4
Link to comment
Share on other sites

The sprite tables do have a place in VDP memory in TI BASIC, they are just not completely usable or accessible without cartridges like MiniMemory or Editor/Assembler.  You can control sprites using CALL POKEV.  I figure, if you are going to show the TI BASIC VDP layout, which is inaccessible in bare console BASIC, you might as well show the over-lapping sprite tables, too.

  • Like 1
Link to comment
Share on other sites

  • 1 month later...
On 1/30/2024 at 7:44 AM, SteveB said:

Thank you for all the corrections and suggestions so far and let me know if you have more.

I really like what you have done, maybe a whole section on the CRU bits used by the TI and addressing with the CRU instructions. It is something I have been planning to address (pun) for a while, it will save having to look up a number of different lists and files, Regards Arto.

  • Thanks 1
Link to comment
Share on other sites

9 hours ago, Artoj said:

I really like what you have done, maybe a whole section on the CRU bits used by the TI and addressing with the CRU instructions. It is something I have been planning to address (pun) for a while, it will save having to look up a number of different lists and files, Regards Arto.

Thank you. As CRU hasn't been in my projects yet, I would need some specific suggestion for such a section to be useful.

  • Like 1
Link to comment
Share on other sites

The bits for the 9901 at 0000.

keyboard, joystick, interrupts 1 and 2. Setting the 9901 to Timer mode. 
 

RS232 Bits, by usual name for 9902, at 1340/1380. Parallel at 1300. This is tricky but perhaps someone can ( @TheBF!) can highlight the important ones. 
 

Format for tables of CRU:

By base and bit offset ( the address would go up by 2s where offset goes by 1s)

Base 1340 ie LI R12,>1340

 

Bit offset N for

SBO N

SBZ N

 

 

Base 1340

Addr Offset

1340. 0 

1342. 1

1344. 2

etc


 

 

Edited by FarmerPotato
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...