Dexter Posted March 30, 2015 Share Posted March 30, 2015 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. 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? Quote Link to comment Share on other sites More sharing options...
+OLD CS1 Posted March 30, 2015 Share Posted March 30, 2015 I started with 6502 (6510) and moved to 9900 with just the MiniMemory manual and the Line-by-Line Assembler. Look in the Development Resources sticky under the development sub-forum for some excellent references and tutorials. Quote Link to comment Share on other sites More sharing options...
Dexter Posted March 30, 2015 Author Share Posted March 30, 2015 What are you using presently? Quote Link to comment Share on other sites More sharing options...
+OLD CS1 Posted March 30, 2015 Share Posted March 30, 2015 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. 1 Quote Link to comment Share on other sites More sharing options...
Tursi Posted March 31, 2015 Share Posted March 31, 2015 I recommend the same as OLD CS1 on both steps, although for functions associated with libti99 I've also used the gcc assembler, which has slightly different syntax. It works a little better IMO, but WinAsm99 is just too convenient. Quote Link to comment Share on other sites More sharing options...
Opry99er Posted March 31, 2015 Share Posted March 31, 2015 I assemble in Classic99. It allows .txt extensions. I can't speak to Win99/4a, as I have not tried it out. Remember to select "R" when it asks for Options. Quote Link to comment Share on other sites More sharing options...
Willsy Posted March 31, 2015 Share Posted March 31, 2015 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! Quote Link to comment Share on other sites More sharing options...
Dexter Posted March 31, 2015 Author Share Posted March 31, 2015 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. Quote Link to comment Share on other sites More sharing options...
Tursi Posted March 31, 2015 Share Posted March 31, 2015 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. Quote Link to comment Share on other sites More sharing options...
Dexter Posted March 31, 2015 Author Share Posted March 31, 2015 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! Quote Link to comment Share on other sites More sharing options...
+OLD CS1 Posted March 31, 2015 Share Posted March 31, 2015 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. Quote Link to comment Share on other sites More sharing options...
Gazoo Posted March 31, 2015 Share Posted March 31, 2015 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? Quote Link to comment Share on other sites More sharing options...
+OLD CS1 Posted April 1, 2015 Share Posted April 1, 2015 Where can we send our donations to send you to Mars? To the bartender next Faire 1 Quote Link to comment Share on other sites More sharing options...
Gazoo Posted April 1, 2015 Share Posted April 1, 2015 To the bartender next Faire Holy Interplanetary Travel, Batman! Quote Link to comment Share on other sites More sharing options...
Dexter Posted April 1, 2015 Author Share Posted April 1, 2015 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. 2 Quote Link to comment Share on other sites More sharing options...
Opry99er Posted April 1, 2015 Share Posted April 1, 2015 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 1 Quote Link to comment Share on other sites More sharing options...
Tursi Posted April 2, 2015 Share Posted April 2, 2015 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. Quote Link to comment Share on other sites More sharing options...
Willsy Posted April 2, 2015 Share Posted April 2, 2015 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! Quote Link to comment Share on other sites More sharing options...
Dexter Posted April 2, 2015 Author Share Posted April 2, 2015 (edited) 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. 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 April 2, 2015 by Dexter Quote Link to comment Share on other sites More sharing options...
+mizapf Posted April 2, 2015 Share Posted April 2, 2015 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) Quote Link to comment Share on other sites More sharing options...
Tursi Posted April 2, 2015 Share Posted April 2, 2015 On the plus side, the -128 to 127 is in words, instead of bytes. 1 Quote Link to comment Share on other sites More sharing options...
Willsy Posted April 2, 2015 Share Posted April 2, 2015 On the plus side, the -128 to 127 is in words, instead of bytes. Yes, that's right - so to be clear (for our 8 bit friends ) that's a jump limit of 256 *bytes*, not 127/128 bytes. Nice. Quote Link to comment Share on other sites More sharing options...
Dexter Posted April 2, 2015 Author Share Posted April 2, 2015 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? Quote Link to comment Share on other sites More sharing options...
+mizapf Posted April 2, 2015 Share Posted April 2, 2015 (edited) 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 April 2, 2015 by mizapf Quote Link to comment Share on other sites More sharing options...
Dexter Posted April 2, 2015 Author Share Posted April 2, 2015 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? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.