Jump to content
IGNORED

Assembly on the 99/4A


matthew180

Recommended Posts

On 4/7/2024 at 1:37 PM, apersson850 said:

There's not much to learn by testing status bits after doing a CLR, regardless of whether it is possible or not. You already know that the result it pretty close to zero.

 

 

😄

On 4/7/2024 at 1:37 PM, apersson850 said:

A method you haven't mentioned yet is taking advantage of the peculiar design of the TMS 9900. If you want to access R7 byte by byte you can simply do

MOVB R7,somewhere

MOVB @MYREGS+15,somewhere+1

 

In the case you don't know what registers you are running with you can do this

MOVB R7,somewhere

STWP R4

MOVB @15(R4),somewhere+1

 

The result at somewhere is the same as after

MOVB R7,somewhere

SWPB R7

MOVB R7,somewhere+1

 

The first two have the possible advantage that the content of R7 is not disturbed.

You can find more details on this subject in the first page of posts in this thread.

 

Quote

The symbolic address only adds 8 clocks and 1 memory access to the MOVB instruction. The SWPB itself is 10 clocks and 3 memory accesses x2 because you would have them back to back around the MOVB. Also, you save 4 bytes by not having SWPB, but the symbolic address takes 2 bytes, but you are still ahead 2 bytes of memory, 14 clock cycles, and 5 memory accesses.

 

Matthew

HH

  • Like 1
Link to comment
Share on other sites

On 4/7/2024 at 2:37 PM, apersson850 said:

There's not much to learn by testing status bits after doing a CLR, regardless of whether it is possible or not. You already know that the result it pretty close to zero.

In disassembly of some TI code , I found this:  
 

BL @SUBR

CLR R7

JEQ L2

...

 

I was confused, but I looked up CLR and saw it does not change the status register. 
 

Apparently R7 is used by SUBR, but this code wants R7 to be 0  before L2. 
 

Link to comment
Share on other sites

12 hours ago, FarmerPotato said:

In disassembly of some TI code , I found this:  
 

BL @SUBR

CLR R7

JEQ L2

...

 

I was confused, but I looked up CLR and saw it does not change the status register. 
 

Apparently R7 is used by SUBR, but this code wants R7 to be 0  before L2. 
 

Ya that was an insight that simplified my coding of Forth conditionals.  ( = < > 0= etc.) 

Since CLR and SETO don't play with status you can compare a register, then clear it or set it to -1 as a default result.

Then you can change the register based on the previous comparison instruction. 

It's almost like the 9900 designers knew how to write an instruction set. :) 

 

Something like: ( Apology in advance. I don't use normal Assemblers often) 

ZEROEQ     CI   R4,0   * 0=  compare top of stack cache to zero
           CLR  R4 
           JNE  $1
           SETO R4 
$1         NEXT        * return to Forth

 

However even though it's only four instructions you can see why a native code compiler would be more efficient on 9900. 

In MACHFORTH or ASMForth this is only two instructions, compare to zero and the jump.  

  • Like 3
Link to comment
Share on other sites

2 hours ago, dhe said:

DATA >004A — Load Lower-Case Character Set (TI-99/4A only)

Who says programmers aren't wild and crazy guys with a sense of humor?

How funny! I never noticed that before. Looking at the code it is obvious it was done on purpose. It falls right in the middle of some DATA bytes.

  • Like 2
Link to comment
Share on other sites

Quote

0016 : BR GROM@>0393 Load standard character set
0018 : BR GROM@>039B Load small capital letters
004A : BR GROM@>03BF Load lower case set

Also. The lower case set (004A) has 7 bytes allocated per character, but it could have done with only 6 bytes. I think the lower case set (004A) was designed to be true lower case, but at the last moment someone at TI wanted tiny capital letters (otherwise it was going to look too professional). Doh.

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

2 hours ago, sometimes99er said:

Also. The lower case set (004A) has 7 bytes allocated per character, but it could have done with only 6 bytes. I think the lower case set (004A) was designed to be true lower case, but at the last moment someone at TI wanted tiny capital letters (otherwise it was going to look too professional). Doh.

That's possible, especially given in the /4 it IS only 6 bytes per character! :)

 

  • Like 3
Link to comment
Share on other sites

2 hours ago, sometimes99er said:

...at the last moment someone at TI wanted tiny capital letters (otherwise it was going to look too professional).

I assume you're joking. It's very easy to figure out where the idea with larger and smaller capital letters came from.

  • Confused 1
Link to comment
Share on other sites

Turns out there is a style of fonts called "Small Caps"

https://www.fontsc.com/font/tag/small-caps

I have a book about the interurban railroad running from Ithaca to Auburn that uses a small caps font. That is the only time I have other seen that, other than on the TI99/4a.

Actually, it seems odd to have to learn the alphabet twice, once for upper case, and once for lower case.

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

20 minutes ago, senior_falcon said:

Turns out there is a style of fonts called "Small Caps"

https://www.fontsc.com/font/tag/small-caps

I have a book about the interurban railroad running from Ithaca to Auburn that uses a small caps font. That is the only time I have other seen that, other than on the TI99/4a.

Actually, it seems odd to have to learn the alphabet twice, once for upper case, and once for lower case.

Could be worse. Japanese students have four alphabets to learn.  Hiragana, katakana, Kanji (sub-set Chinese characters) and "romanji".  (our alphabet) 

I have read it can take up to twelve years of school for full fluency.  

  • Like 2
Link to comment
Share on other sites

In case anyone didn't get where they got the idea with small capital letters from:

 

File:TexasInstruments-Logo.svg

 

I've used a character set with true lower case letters, descenders included, for years, and it works fine. Much better than the original. It's only if a "g" happens to be right above an "A" or similar that they touch. Happens rarely enough for the advantages to be more important.

  • Like 3
Link to comment
Share on other sites

The use of small caps for lowercase has been around for a long time. One of my favorite such fonts is Copperplate Gothic, which was developed in 1901.

 

Small caps has many other uses than replacement of lowercase—see this interesting Wikipedia article on small caps. Small caps use apparently dates back to, at least, the 15th century.

 

...lee

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

While re-re-reading the E/A manual, I was noticing this section on the Debugger, descended from TIBUG, and came upon this paragraph.

 

Causes the present VDP Read Data address to be displayed. The address can be altered by typing a
new address and pressing ENTER. This procedure allows you to use the commands that access VDP
to be used in the VDP library memory areas or any other VDP address space. The read and write
addresses are >1000 apart. The default address is >8800. Note: At present, no alternate VDP memory
spaces exist.

 

I can see alternate read/write address writing to a different bank of 16K VDP memory. I don't see a path forward in getting the VDP to change to another bank. I also, don't know what a VDP Library Memory is.  Can anyone fill out what TI was thinking about doing?

  • Thanks 1
Link to comment
Share on other sites

15 hours ago, apersson850 said:

In case anyone didn't get where they got the idea with small capital letters from:

 

File:TexasInstruments-Logo.svg

 

I've used a character set with true lower case letters, descenders included, for years, and it works fine. Much better than the original. It's only if a "g" happens to be right above an "A" or similar that they touch. Happens rarely enough for the advantages to be more important.

Interesting theory, but I bet that the answer is the small caps in the 9918 manual.  Whoever put that together and why. 
 

By the way, that logo is the 90s version. (The red TIBUG and black letters gives it away.) 
 

Texas Instruments logos in 1966-1980 could have either  all caps  or small caps with very wide spacing.  Sans-serif in some cases. The small caps rule after that. 

 

It's fun to look at how the serifs evolved. The kerning changes.  While the T still overhangs the E, it used to be tighter.  In the past there are ligatures like AS and STR. Notably, the S changed. 
 

 

  • Like 1
Link to comment
Share on other sites

1 hour ago, dhe said:

While re-re-reading the E/A manual, I was noticing this section on the Debugger, descended from TIBUG, and came upon this paragraph.

 

Causes the present VDP Read Data address to be displayed. The address can be altered by typing a
new address and pressing ENTER. This procedure allows you to use the commands that access VDP
to be used in the VDP library memory areas or any other VDP address space. The read and write
addresses are >1000 apart. The default address is >8800. Note: At present, no alternate VDP memory
spaces exist.

 

I can see alternate read/write address writing to a different bank of 16K VDP memory. I don't see a path forward in getting the VDP to change to another bank. I also, don't know what a VDP Library Memory is.  Can anyone fill out what TI was thinking about doing?

I always wanted to make a mod and try, but there was an idea once to have multiple vdp processors, the tms9918a can infact have the video out go into the video in. So you have two vdp chips each with their own 16k and when you use the transparent color on the master chip those pixels display the data from the secondary vdp processor.

 

I will see if I can upload the datasheet design spec later on this weekend in a new thread for this application of multiple screens, useful to expand the depth and graphics like for multi layer sprites, but it was never done to my knowledge just drafted out on paper as a design idea.

Edited by Gary from OPA
  • Like 2
Link to comment
Share on other sites

7 hours ago, SteveB said:

I always liked the Atari XL font. It worked well on a TV with 40 chars per line

Atari Fonts – Atari 8Bit

 

That is font 11 in XB 2.9 G.E.M. Font 3 is a similar bold font that I like better.

The capital letters are 6 pixels wide, so unfortunately this would not work on a TI99 in 40 column text mode.

  • Like 3
Link to comment
Share on other sites

8 hours ago, FarmerPotato said:

Interesting theory, but I bet that the answer is the small caps in the 9918 manual.  Whoever put that together and why. 

I'm talking about the reason for why they used that font also in the TMS 9918A manual. The origin of it. And that's pretty clear. They didn't know any better since they already had it in their logotype.

 

The logotype has changed, but seems to have been all caps all the time.

Texas Instruments Logo history

Edited by apersson850
Link to comment
Share on other sites

There was some old discussion about this font stuff before:

Also the official reason why small caps exist at least in the typeface world is shown below in this screenshot:Screenshot_20240426-052811.thumb.png.2fb5e3cb47c66b9a3d4ce4b8adec160d.png

As for why TI uses small caps, I think it's mainly from their earlier days of being a calculator company before they got into computers, and small caps is used very often in displaying math formulas and looks better when screens were originally just one line led displays also.

  • Like 1
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...