Jump to content
IGNORED

Learning Assembly


CamTheBridge

Recommended Posts

Hey all,

 

Not sure if you remember me, but I used to be on the threads here a bunch 2 years ago. From what I understand I'm quite a bit younger than most of you (early 20's) and life kind of got in the way (finishing college finding a job etc.) so I didn't have time to play around with old computers and such recently. However I am feeling incredibly ambitious now that I have some more time and I was wondering how you all would recommend learning assembly? I played around a lot with extended BASIC and I really want to have full reign now. Are there any specific books you recommend? I have the editor assembler/nano PEB and voice synthesizer. Another question I have is: If you are programming in assembly, can you access the speech synthesis without any extra disks or carts? Or do you need a program (or perhaps to create a program) that can synthesize speech?

 

Thanks so much all!

  • Like 2
Link to comment
Share on other sites

8 minutes ago, CamTheBridge said:

If you are programming in assembly, can you access the speech synthesis without any extra disks or carts?

Not required... If you have another way to start your program. Not sure, but I imagine you might get away with pulling the E/A cart out once running. Text to speech is a little trickier.:D

Link to comment
Share on other sites

A good book to get started is at https://www.ebay.com/itm/TI-99-4A-99-4-Book-INTRO-TO-ASSEMBLY-LANGUAGE-FOR-THE-TI-HOME-COMPUTER-New/372757407012?hash=item56ca12a524:g:1GwAAOxyV85RzfSG 

 

There should be scanned copied of the book somewhere, just not sure where the link is.  That is the best reference to get some basics down.

 

There is another book by Morley I use frequently when looking for details on some of the instruction codes.  I just don't have a link for it to point you towards it at the moment, perhaps someone else does.


That first link will definitely get you with some of the basics on setting some code up.  From there, I think you may be able to learn quite a bit from other people's source code, especially code that is commented well that explains why things are being done as they are.  There is plenty of source code up on ftp.whtech.com and people frequently borrow pieces of code for their own application, so no harm, no foul.

 

Beery

 

 

  • Like 2
Link to comment
Share on other sites

12 minutes ago, BeeryMiller said:

A good book to get started is at https://www.ebay.com/itm/TI-99-4A-99-4-Book-INTRO-TO-ASSEMBLY-LANGUAGE-FOR-THE-TI-HOME-COMPUTER-New/372757407012?hash=item56ca12a524:g:1GwAAOxyV85RzfSG 

 

There should be scanned copied of the book somewhere, just not sure where the link is.  That is the best reference to get some basics down.

 

There is another book by Morley I use frequently when looking for details on some of the instruction codes.  I just don't have a link for it to point you towards it at the moment, perhaps someone else does.


That first link will definitely get you with some of the basics on setting some code up.  From there, I think you may be able to learn quite a bit from other people's source code, especially code that is commented well that explains why things are being done as they are.  There is plenty of source code up on ftp.whtech.com and people frequently borrow pieces of code for their own application, so no harm, no foul.

 

Beery

 

 

Thanks, this is super duper helpful. I think the commented source code will be especially helpful for me!

  • Like 1
Link to comment
Share on other sites

21 minutes ago, HOME AUTOMATION said:

Not required... If you have another way to start your program. Not sure, but I imagine you might get away with pulling the E/A cart out once running. Text to speech is a little trickier.:D

Good to know. I'll probably make a separate post when I actually get that far. I know Parsec has speech in it, so I assume it must be possible to do since that game just runs from a cart

Link to comment
Share on other sites

Getting started depends on where you are coming from.  If you need to also learn all the assembly prerequisites at the same time, i.e. binary, hex, understanding memory, I/O vs memory-map, addressing modes, etc. then the approach will certainly be different.  All CPUs and computers work pretty much the same way, so a lot of concepts will apply no matter where you learn them or what system you are working on.  After that, you have the specifics of the CPU and architecture of the computer you have chosen.

 

For the 99/4A, working in an emulator will make your experience much more pleasant, IMO.  Real hardware is good for testing and running your software, play games and *using* software, showing off to your friends and family, and for a trip down memory lane to experience editing and assembling like we used to do it (but only for 5 minutes ;-) ).  But of learning and development, emulation all the way.  An emulator also gives you the benefit of a level of debugging that you simply cannot get on real hardware.  My go-to development emulators are Classic99 and JS99er coupled with the XDT99 compiler tools (see the Development Resources thread in the forum).

 

It really helps to have a bunch of small programs you want to write, which will help guide your learning.  Keep in mind that you don't have to understand everything when you are starting off, and you probably won't.  Understanding comes over time, but it is very important to be able to write working code from day-1 to keep up your enthusiasm and motivation.  Simple programs are things like clearing the screen, some basic character animation like moving something across the screen, etc.  Leave things like speech synthesis until later, since in assembly it takes a lot of code and data to get this working, and it is easy to get very lost (IMO).  Even doing sound can be somewhat of a more complex topic when getting started because it relies on changing data at a "human" pace rather than as-fast-as the computer can execute instructions.  This means you need to have a concept of timing, which on the 99/4A there are multiple options, each with benefits and trade-offs (like most things).

 

The E/A Manual is a decent reference that coves a lot of material in a non-beginner kind of way, however to its credit is does clearly state:

 

"This manual assumes that you already know a programming language, preferably an assembly language.  If you do not, there are many fine books available which teach the basics of assembly language use.  After you know these basics, this manual gives the details of TMS9900 assembly language and its application to the TI Home Computer."

 

I agree with that statement 100%.  When I started learning assembly as a teen in '83, the E/A manual was all I had at first and there was much frustration, hair-pulling, and probably even some tears of anger.  It was not until I found the book "COMPUTE!'s beginner's guide to assembly language on the TI-99/4A" by Peter Lottrup that I was able to actually start writing my own programs and get an understanding of how the computer worked and what was going on.  However, even though Lottrup's book opened the door to assembly for me, it does stay at a higher level of assembly on the 99/4A (which can be great for getting started).

 

However, even more important than books, I would say this forum and code-reading are the best resources for learning and answers.  Having an understanding of what a compiler, assembler, and linker do will also help greatly.  Beyond that, get comfortable with hex and binary, and start writing "clear screen" followed by "move @". ?

 

Ask questions and put in the effort to try and find answers on your own.  Most importantly though, have fun, enjoy the journey, and allow yourself the time to learn; because it will take time.

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

The value of my input here will really hinge on your current level of knowledge so take it under advisement for later if your are brand new to Assembly Language.

 

One of the cute tricks in the Forth systems around here is the Forth Assembler, which is designed for writing short routines. (versus entire programs)

The syntax is reversed from conventional but if you really wanted to test an idea quickly it's pretty cool.

The process is:

  1. Compile the Assembler into the Forth system using the system's command for that job.
  2. Write up your little routine in your favourite PC editor
  3. Paste the Forth assembler source code into Classic99
  4. Test your routine like it was a BASIC command; just type the name

Now... it might lock up the computer if you do something wrong, but that's why Assembly language programmers tend to be VERY brave people. :)

 

Welcome to the fraternity.

 

0xBF

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

Forth...mmmmmmmmm

<Sniff> how sweet it is.. and we have some of the brightest forth folks around! God bless our forth people!!

I actually got some good experience in forth over a couple years, then I found a project that needed to access the supercart and I couldn't do that with the forth system I was using at the time, so I'm back in assembly again, but this time it looks like I'm learning quite a bit and I'm now thankful I switched back to assy BUT forth us my home away from home language. 

Edited by GDMike
  • Like 1
Link to comment
Share on other sites

2 hours ago, GDMike said:

Forth...mmmmmmmmm

<Sniff> how sweet it is.. and we have some of the brightest forth folks around! God bless our forth people!!

I actually got some good experience in forth over a couple years, then I found a project that needed to access the supercart and I couldn't do that with the forth system I was using at the time, so I'm back in assembly again, but this time it looks like I'm learning quite a bit and I'm now thankful I switched back to assy BUT forth us my home away from home language. 

Want a Forth kernel compiled at >6000 :)

Since you are using RAM CAMEL99 Forth fits in the space just fine.  Let me know if you want to try it.  I have been thinking about doing it for myself...

 

All I have to change is the origin line in the cross-compiled source code.  (I think)   :)


CROSS-ASSEMBLING
              START.                \ sets a timer
              NEW.                  \ init target memory segment to FFFF
              ABSOLUTE 6000 ORIGIN. \ we must set the origin before TI-99.EA5 directive

 

 

  • Like 2
Link to comment
Share on other sites

On 12/17/2019 at 2:03 PM, HOME AUTOMATION said:

Huh, I didn't know Archive had that! I guess I can take down my copies then (nobody, including me, ever remembers it's there anyway ;) )

 

  • Like 2
Link to comment
Share on other sites

Please do keep the books up, Tursi. The archive from you and from HexBus are the only places a lot of these books are posted online--and I jump to both sources pretty regularly. . .and send people to them as well when they are looking, as they are the most comprehensive archives of TI-99 books in existence.

  • Like 3
Link to comment
Share on other sites

  • 1 month later...

Old topic, but I would like to add, there is learning assembler, and then there is writing assembly code that is easy to maintain and for others to understand.

My money for people that wrote easy to understand and maintain code was Edgar Dohmann who wrote a series of assembler articles for International 99er and Ken Culp who wrote the book Simplified Assembler.

  • Like 1
Link to comment
Share on other sites

OK, I have a question with something that is stumbling me.

 

I'm working with modifying the AfterHours BBS source code to use the TIPI.

 

The program is sitting back waiting for a caller or sysop to login to the system.  There is a loop running looking for either TIPI connection, or KSCAN keyboard response.

 

As a Sysop, if I login, everything works fine.  Keyboard input, and the interrupt driven clock routine starts updating time on the screen and time connected.  If no keyboard response occurs after a period of time, it kicks me off.

 

Now, if I connect via another computer, I connect and it is a normal BBS session.  I am running through the very same code.  Both keyboard and TIPI branch to the same routine when logging in.

 

For some reason, the interrupt code displaying the time, and the time connected, is not running when accessing through the TIPI.  Thus, it does not know when to drop an inactive connection.  Also, I lose use of the Sysop's keyboard when accessing through the TIPI, but that returns after a Logoff.

 

I believe the interrupt code and keyboard issue is related, but my searching through the code does not leave an obvious answer. 

 

Is there something that may be a bit more obvious to the 4A programmers I am overlooking?

 

Beery

 

 

 

 

 

Link to comment
Share on other sites

I assume you have a LIMI 2, LIMI 0 near the keyboard loop?

 

For debugging, how about in your keyboard loop:

 

on the screen:

display the current value of the user ISR pointer >83C4. Is this being cleared?

display the current value of the interrupt mask (1 digit). 

display how many times it was executed (add a counter)

 

 

Link to comment
Share on other sites

I tried setting some code up to display the current value of the ISR pointer last night.  Need to do a bit more work to get that code to display properly as the PRTHEX routine needs to be modified to a BLWP from a BL call.

 

What would I reference as the value for the interrupt mask to be displayed?  Can't say I have ever done that before.

 

As far as the LIMI 2 and LIMI 0, I have LIMI 0 going into the keyboard loop and LIMI 2 coming out of the loop and I have even went so far to comment out the LIMI 0 calls from several places to no avail thinking there was an extraneous LIMI 0 call someplace disabling interrupts.

 

My coding is being done on the Geneve with the Geneve's keyscan BL >000E call.   Thus far, what I have experienced on the Geneve has been duplicated on the real iron with the TIPI on the TI-99/4A.

 

Beery

 

 

 

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