Jump to content
IGNORED

First steps in TI9900 assembly language with prior knowledge of 6502


Dexter

Recommended Posts

Apart from the hardware structure of the TI, I’m trying to learn my first steps in assembly for the TI9900. I’m familiar with the 6502, 6510 and 65816 assembly language, although that gives me an advantage, it’s pretty different.

 

I’m using these documents:

· Mini Memory manual

· Editor / Assembler manual

· Introduction to Assembly Language - Molesworth

· Beginner's Guide to Assembly Language - Lottrup

Any other must read’s?

I’ve just started though. Too much information at once. :-D

 

However, I’d like to install and use a cross assembler, and use the result file on Classic99 and on the real beauty through CFHDXS1.

 

Of course I found the “TI-99/4A development resources” http://atariage.com/forums/topic/153704-ti-994a-development-resources/

And the “Development resources” http://www.ninerpedia.org/index.php/Development_resources

BTW. a marvelous overview.

 

Which cross assembler is the most used and should I use?

 

 

Link to comment
Share on other sites

I use Notepad++ to write the code, and WinAsm99 from the Win994a package to assemble. I cannot say anything about cross-compilers as I have not touched one, though I probably should.

 

I use the same technique. I completed TurboForth (which is quite a large assembler project) using that arrangement. WinAsm99 can produce an object file (normal or compressed) which is directly loadable from Editor Assembler. I configure the assembler to drop the object file (which is the output of the assembler) directly into the DSK1 folder of Classic99 and boom - you can load the just assembled code immediately and test. I'll never use TI's assembler again!

Link to comment
Share on other sites

My favorite text editor is TextPad, something similar to Notepad++ I guess.

https://www.textpad.com/download/textpad45.html

 

I’ve installed Win994a V3010. I suppose the .OBJ files can be run by E/A option 3. The .BIN file can only be created by supplying a start address? Oh well, I’ll try it out soon.

 

 

Assembling with the E/A cartridge, requires the two disks, I found them here:

ftp://ftp.whtech.com/emulators/pc99/pc99%20dsk%20collection/TISoftwareLibrary/Editor-Assember/

But this is just for finding out how it works and looks like. :)

 

 

I configure the assembler to drop the object file (which is the output of the assembler) directly into the DSK1 folder of Classic99 and boom - you can load the just assembled code immediately and test.

That’s basically what I’m looking for.

Link to comment
Share on other sites

Assembling with the E/A cartridge, requires the two disks, I found them here:

ftp://ftp.whtech.com/emulators/pc99/pc99%20dsk%20collection/TISoftwareLibrary/Editor-Assember/

But this is just for finding out how it works and looks like. :)

 

You only need disk 1 for editing and assembling. There are still a few people who like the old Editor/Assembler, but I find the programming flow Mark described much smoother. ;) Editor doesn't really matter - if you have one you like, use it. (I use Notepad2 ;) ).

 

I did do a step-by-step "hello world" with Editor Assembler, you can browse it here:

http://harmlesslion.com/gtwo/v/Projects/tiea/01_G.png.html

 

Start there, you will see a short instruction note at the top of each page, and you can use the 'next' link to go to the next step. ;) It assumes you're using Classic99 but most of the steps will be the same anywhere.

Link to comment
Share on other sites

 

You only need disk 1 for editing and assembling. There are still a few people who like the old Editor/Assembler, but I find the programming flow Mark described much smoother. ;) Editor doesn't really matter - if you have one you like, use it. (I use Notepad2 ;) ).

 

I did do a step-by-step "hello world" with Editor Assembler, you can browse it here:

http://harmlesslion.com/gtwo/v/Projects/tiea/01_G.png.html

 

Start there, you will see a short instruction note at the top of each page, and you can use the 'next' link to go to the next step. ;) It assumes you're using Classic99 but most of the steps will be the same anywhere.

Thanks Tursi!

I'll check it out.

 

I was just reading retroclouds's SPECTRA documentation, and Matthew's http://atariage.com/forums/topic/162941-assembly-on-the-994a/

Days need 36 hours! :)

Link to comment
Share on other sites

Thanks Tursi!

I'll check it out.

 

I was just reading retroclouds's SPECTRA documentation, and Matthew's http://atariage.com/forums/topic/162941-assembly-on-the-994a/

Days need 36 hours! :)

 

Agreed on the hours bit. Partly why I signed up to be sent to Mars (the other part was popular request.) Anyway, Spectra2 is a great resource. I am writing my first assembly game using it and I think you will find it a useful tool, too.

Link to comment
Share on other sites

 

Agreed on the hours bit. Partly why I signed up to be sent to Mars (the other part was popular request.) Anyway, Spectra2 is a great resource. I am writing my first assembly game using it and I think you will find it a useful tool, too.

 

Where can we send our donations to send you to Mars? ;)

Link to comment
Share on other sites

Agreed on the hours bit. Partly why I signed up to be sent to Mars (the other part was popular request.)

Nah, shipping costs from stuff we order on eBay would be too high.

 

 

Anyway, Spectra2 is a great resource. I am writing my first assembly game using it and I think you will find it a useful tool, too.

Especially the VDP routines I'm interested in. My homebrew computer has no operating system, but will have a F18A. I hope I can achieve to port at least some of those routines to it.

 

What strikes me very pleasantly, is that the TI9900 works with 16 bit. So I don't have that stupid 256 boundry anymore like on the 6510.

 

@Tursi

The step-by-step "hello world" worked nicely, except for that the program does not show the message "HELLO WORLD". I also tried it with the Win994a assembler, which showed the same result.

I'm not there yet to determine why it doesn't work, but it will come eventually. :)

  • Like 2
Link to comment
Share on other sites

I'm not sure how I did it, because the screenshots there are real, but there's a typo in the text file. The screenshot is correct!

 

The error is here:

 

 

* CLEAR THE SCREEN
START   CLR R0          * ADDRESS 0
        LI R0,>2000     * 'SPACE' IN HIGH BYTE

 

For VSBW, the VDP address goes in R0, and the byte to write in the MSB of R1. But I put "R0" for both, which basically puts the screen clear into a non-infinite-but-definitely-destructive clear loop across the system. ;) That second line needs to be "LI R1,>2000".

 

Sorry about that, I had put up the tutorial for some specific reason back in the day but either the target didn't use the text file or I forgot to fix it. ;) It's fixed now.

Link to comment
Share on other sites

 

What strikes me very pleasantly, is that the TI9900 works with 16 bit. So I don't have that stupid 256 boundry anymore like on the 6510.

Yeah! It's a real luxury, eh?! Once I learned TMS9900 I couldn't look at Z80 ever again!

Link to comment
Share on other sites

Could you post your source code please? Also your step-by-step assembler actions?

 

Probably something reeeeally simple. :)

 

Welcome to the 9900, bud. Great to have experienced programmers from ither environments working with our little computer

Apparently it was just the difference between a “0” and a “1”. :)

Well, don’t get your hopes too high, I’m probably more into hardware, hence I like assembler more than C. Even with AVR’s I like Assembler more. But programming some (simple) games for the 99 and my own computer, since they share the same VDP, would be a nice goal. For me it’s mostly digging in, till I know enough to get the job done.

 

But of cource thanks for the welcome!

 

I'm not sure how I did it, because the screenshots there are real, but there's a typo in the text file. The screenshot is correct!

 

The error is here:

* CLEAR THE SCREEN
START   CLR R0          * ADDRESS 0
        LI R0,>2000     * 'SPACE' IN HIGH BYTE

For VSBW, the VDP address goes in R0, and the byte to write in the MSB of R1. But I put "R0" for both, which basically puts the screen clear into a non-infinite-but-definitely-destructive clear loop across the system. ;) That second line needs to be "LI R1,>2000".

 

Sorry about that, I had put up the tutorial for some specific reason back in the day but either the target didn't use the text file or I forgot to fix it. ;) It's fixed now.

No problem at all, it worked flawlessly now, both with E/A and with WinAsm99. I think I mostly understand the “simple” program, and what went wrong. :thumbsup:

 

Yeah! It's a real luxury, eh?! Once I learned TMS9900 I couldn't look at Z80 ever again!

Hmm, I thought to get rid of the relative branch limit of -128 to 127. Oh well, we can’t have it all. :) Perhaps it will be not that bad, have to look at more code to understand...

Edited by Dexter
Link to comment
Share on other sites

Hmm, I thought to get rid of the relative branch limit of -128 to 127. Oh well, we can’t have it all. :) Perhaps it will be not that bad, have to look at more code to understand...

 

I never really suffered from that. Most of the relative jumps are comparably local (loops etc.) anyway, and when you need a longer jump you can always use the inverse jump condition and a following B (i.e. instead of JEQ xxx you do a JNE $+6 \n B @xxx)

Link to comment
Share on other sites

 

I never really suffered from that. Most of the relative jumps are comparably local (loops etc.) anyway, and when you need a longer jump you can always use the inverse jump condition and a following B (i.e. instead of JEQ xxx you do a JNE $+6 \n B @xxx)

It actually forced me to study some more until I understood what you’re saying, as I didn’t know what you meant by B @xxxx. But yeah, that’s a workaround, pretty much the same as doing long branches on the 6502. Nicest way is to do it with macros, instead of bne, lbne for (long branch if not equal zero). I know of a CPU that can do relative branches through the entire address range, that’s a very nice feature.

 

 

On the plus side, the -128 to 127 is in words, instead of bytes. ;)

Yup, that’s definitely a longer jump. ;)

 

That rises the following question:

 

scratch pad is at >8300, is 128 x 16-bit SRAM

system I/O is at ?>0000?, is 4KiB x 16-bit PROM

 

Are those the only true 16-bit memories in the 4A?

Link to comment
Share on other sites

scratch pad is at >8300, is 128 x 16-bit SRAM

system I/O is at ?>0000?, is 4KiB x 16-bit PROM

 

Are those the only true 16-bit memories in the 4A?

 

Yes, if "true" means being connected by 16 data lines. From a programmer's viewpoint this is actually irrelevant, because memory access always involves 16 bit, either by a single access (16 bit on scratch pad or system rom), or by two consecutive accesses (remaining addresses). The difference is, of course, performance.

 

As an interesting detail, while I created slides for my lectures, I added some details on the x86 family, starting with the 8088. This processor was a 16 bit processor with an 8 bit data bus. Sounds familiar, doesn't it?

Edited by mizapf
Link to comment
Share on other sites

 

The difference is, of course, performance.

Yes indeed, as I'm also studying matthew's thread , I was refering to performance.

 

 

As an interesting detail, while I created slides for my lectures, I added some details on the x86 family, starting with the 8088. This processor was a 16 bit processor with an 8 bit data bus. Sounds familiar, doesn't it?

Yes, 65816. :)

lectures? could you elaborate?

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