samishal Posted December 25, 2011 Share Posted December 25, 2011 Dear all, First off, Merry Christmas, I hope you all eat as much food as you can and sleep for the rest of the day, I know I will Anyway, I have madea little helloworld program however it will not assemble and obviously wont run, I have been using the classic99 emualtor for this and after I can get one or two programs to work on there I'll move onto my real iron system lol. Here is the program : REF VMBW MYREG BSS >20 ADDR1 TEXT 'HELLO WORLD' BEGIN LWPI MYREG LI R0,102 LI R1,ADDR1 LI R2,12 BLWP @VMBW JMP $ Also, is it possible to write a program in a text editor and save to to the right folder and then assemble it in the classic99 program or must it always be typed through the program? Samishal Merry Xmas!!! Quote Link to comment https://forums.atariage.com/topic/191877-problems-creating-my-first-asm-program/ Share on other sites More sharing options...
marc.hull Posted December 25, 2011 Share Posted December 25, 2011 Dear all, First off, Merry Christmas, I hope you all eat as much food as you can and sleep for the rest of the day, I know I will Anyway, I have madea little helloworld program however it will not assemble and obviously wont run, I have been using the classic99 emualtor for this and after I can get one or two programs to work on there I'll move onto my real iron system lol. Here is the program : Add this... DEF BEGIN as the first instruction and END BEGIN as the last REF VMBW MYREG BSS >20 ADDR1 TEXT 'HELLO WORLD' BEGIN LWPI MYREG LI R0,102 LI R1,ADDR1 LI R2,12 BLWP @VMBW JMP $ Also, is it possible to write a program in a text editor and save to to the right folder and then assemble it in the classic99 program or must it always be typed through the program? Samishal Merry Xmas!!! Quote Link to comment https://forums.atariage.com/topic/191877-problems-creating-my-first-asm-program/#findComment-2431350 Share on other sites More sharing options...
samishal Posted December 25, 2011 Author Share Posted December 25, 2011 I have added the DEF BEGIN and END BEGIN lines to the program however I am still encountering the "Invalid Register error" that I encountered before... Quote Link to comment https://forums.atariage.com/topic/191877-problems-creating-my-first-asm-program/#findComment-2431354 Share on other sites More sharing options...
moulinaie Posted December 25, 2011 Share Posted December 25, 2011 Hi, Try to remove the letter "r" before every register reference. LI 0,102 etc... Guillaume. Quote Link to comment https://forums.atariage.com/topic/191877-problems-creating-my-first-asm-program/#findComment-2431360 Share on other sites More sharing options...
marc.hull Posted December 25, 2011 Share Posted December 25, 2011 Are you using register zero or register ohhh... Quote Link to comment https://forums.atariage.com/topic/191877-problems-creating-my-first-asm-program/#findComment-2431362 Share on other sites More sharing options...
samishal Posted December 25, 2011 Author Share Posted December 25, 2011 I removed the 'r' from the register calls, is that just for the emualtor that I have to remove the r's or is it for the real thing as well?? Also after assembling the program how do I run it? Samishal Quote Link to comment https://forums.atariage.com/topic/191877-problems-creating-my-first-asm-program/#findComment-2431420 Share on other sites More sharing options...
moulinaie Posted December 25, 2011 Share Posted December 25, 2011 I removed the 'r' from the register calls, is that just for the emualtor that I have to remove the r's or is it for the real thing as well?? Also after assembling the program how do I run it? Samishal For the real thing as well! But there is an option that I forgot when running the assembler (letter L ??) to make it accept R7 instead of 7. Tu run it then, just select "RUN" in the menu and type BEGIN as program name (if you have inserted DEF BEGIN) Guillaume. Quote Link to comment https://forums.atariage.com/topic/191877-problems-creating-my-first-asm-program/#findComment-2431422 Share on other sites More sharing options...
moulinaie Posted December 25, 2011 Share Posted December 25, 2011 I removed the 'r' from the register calls, is that just for the emualtor that I have to remove the r's or is it for the real thing as well?? Also after assembling the program how do I run it? Samishal When assembling, on the line "OPTIONS?", just answer R and you'll be able to use R0 - R15 instead of 0 - 15. (E/A manuel, page 34) Guillaume. 1 Quote Link to comment https://forums.atariage.com/topic/191877-problems-creating-my-first-asm-program/#findComment-2431424 Share on other sites More sharing options...
Tursi Posted December 29, 2011 Share Posted December 29, 2011 Looks like you are getting good help here, but I wanted to note that I did post a step-by-step assembly 'hello world' using Classic99. It's lost somewhere here on the forum but I can relink it here: http://harmlesslion.com/gtwo/v/Projects/tiea/01_G.png.html Make sure to view the full size images, and there is step-by-step with screenshots. A gallery probably isn't the best interface for that, but maybe it's useful. That covers typing it in through the E/A. You /can/ use windows text files, if you like. By default, to make Classic99 understand that it is a text file, it must have a .TXT or .OBJ extension -- in your case .TXT makes more sense. You must also use the extension on the TI side. So, for instance, if you save your file as C:\Classic99\DSK1\SOURCE.TXT, then when you load the assembler, your source filename is DSK1.SOURCE.TXT (and the rest as normal). Quote Link to comment https://forums.atariage.com/topic/191877-problems-creating-my-first-asm-program/#findComment-2433691 Share on other sites More sharing options...
apersson850 Posted March 3, 2012 Share Posted March 3, 2012 Insert the command EVEN after the text definition. Your text is 11 bytes, and instructions must start at even addresses. Quote Link to comment https://forums.atariage.com/topic/191877-problems-creating-my-first-asm-program/#findComment-2477543 Share on other sites More sharing options...
+Lee Stewart Posted May 18, 2012 Share Posted May 18, 2012 Insert the command EVEN after the text definition. Your text is 11 bytes, and instructions must start at even addresses. Inserting EVEN after BYTE and TEXT directives is probably a good habit, but machine instructions (this case) or DATA directives immediately following BYTE and TEXT directives are always started on even addresses. ...lee Quote Link to comment https://forums.atariage.com/topic/191877-problems-creating-my-first-asm-program/#findComment-2524673 Share on other sites More sharing options...
matthew180 Posted May 18, 2012 Share Posted May 18, 2012 Depends on the assembler. Win994a has certain instances where it gets it wrong. I can't remember the specifics right off my head, but it is documented in this forum (we have discussed this before and I know I posted at least one example somewhere). Quote Link to comment https://forums.atariage.com/topic/191877-problems-creating-my-first-asm-program/#findComment-2524727 Share on other sites More sharing options...
+Lee Stewart Posted May 18, 2012 Share Posted May 18, 2012 Depends on the assembler. Win994a has certain instances where it gets it wrong. I can't remember the specifics right off my head, but it is documented in this forum (we have discussed this before and I know I posted at least one example somewhere). I do wish things were easier to find. When I am starting from scratch, it often takes a discouragingly long time to get the information I am looking for even when I am reasonably sure it is there. Thanks for the information, especially since I am thinking of soon embarking upon a rather ambitious assembly project. ...lee Quote Link to comment https://forums.atariage.com/topic/191877-problems-creating-my-first-asm-program/#findComment-2524829 Share on other sites More sharing options...
matthew180 Posted May 18, 2012 Share Posted May 18, 2012 (edited) Let me see if I can find it. The "assembly my way" thread I stared would be my first guess. Here, starting about post #36: http://www.atariage.com/forums/topic/159642-assembly-guidance/page__st__25#entry1970943 I agree with you about finding stuff. I like a forum format for allowing a topic to be discussed without noise from other topics, but it lacks an index. Hmm, the "next big thing" in form frameworks, auto indexes and auto topic summarizing. You heard it here first. :-) Edited May 18, 2012 by matthew180 Quote Link to comment https://forums.atariage.com/topic/191877-problems-creating-my-first-asm-program/#findComment-2524835 Share on other sites More sharing options...
lucien2 Posted May 19, 2012 Share Posted May 19, 2012 http://www.atariage.com/forums/topic/159642-assembly-guidance/page__st__25#entry1970943 Here is your exemple with the GNU assembler. It does not automatically add EVEN directives. But it's open source, you could add your GPU instructions. GAS LISTING test.asm page 1 1 DEF MAIN 2 0000 01 VAR1 BYTE 1 3 4 MAIN 5 TEST EQU ND-ST 6 0001 0200 000B LI r0,TEST 7 0005 1000 JMP $ 8 9 0007 4845 4C4C ST TEXT 'HELLO WORLD' 9 4F20 574F 9 524C 44 10 ND END GAS LISTING test.asm page 2 DEFINED SYMBOLS test.asm:4 .text:00000001 MAIN test.asm:2 .text:00000000 VAR1 test.asm:4 *ABS*:0000000b TEST test.asm:10 .text:00000012 ND test.asm:9 .text:00000007 ST NO UNDEFINED SYMBOLS Quote Link to comment https://forums.atariage.com/topic/191877-problems-creating-my-first-asm-program/#findComment-2525134 Share on other sites More sharing options...
Willsy Posted May 19, 2012 Share Posted May 19, 2012 Okay, I'll bite! :-) what's the project? Quote Link to comment https://forums.atariage.com/topic/191877-problems-creating-my-first-asm-program/#findComment-2525145 Share on other sites More sharing options...
+retroclouds Posted May 19, 2012 Share Posted May 19, 2012 Hmm... got a feeling it'll have something to do with Forth and Assembler? Quote Link to comment https://forums.atariage.com/topic/191877-problems-creating-my-first-asm-program/#findComment-2525170 Share on other sites More sharing options...
+Lee Stewart Posted May 19, 2012 Share Posted May 19, 2012 Let me see if I can find it. The "assembly my way" thread I stared would be my first guess. Here, starting about post #36: http://www.atariage....25#entry1970943 I agree with you about finding stuff. I like a forum format for allowing a topic to be discussed without noise from other topics, but it lacks an index. Hmm, the "next big thing" in form frameworks, auto indexes and auto topic summarizing. You heard it here first. :-) Thanks! I had not thought about the byte-counting consequences of TI E/A's forcing the even-byte boundary on machine instructions and DATA directives and I certainly was unaware of the mistaken alignment of those by other assemblers. ...lee Quote Link to comment https://forums.atariage.com/topic/191877-problems-creating-my-first-asm-program/#findComment-2525188 Share on other sites More sharing options...
+Lee Stewart Posted May 19, 2012 Share Posted May 19, 2012 Okay, I'll bite! :-) what's the project? The project is hoisting TI Forth into cartridge ROM to be functionally equivalent to the current version. That is actually down the road from (1) annotating the assembly source for TI Forth and (2) detailing how to produce a working system from that source, which, of course, are necessary excercises to enable me to even think about the project. If I manage to complete all this, I might then attempt a version upgrade to use normal file I/O for Forth screens/blocks and use sector I/O only for reading to convert current TI Forth screens. Ambitious, I know---but, so far, I am having fun! ...lee Quote Link to comment https://forums.atariage.com/topic/191877-problems-creating-my-first-asm-program/#findComment-2525192 Share on other sites More sharing options...
+Lee Stewart Posted May 19, 2012 Share Posted May 19, 2012 Hmm... got a feeling it'll have something to do with Forth and Assembler? Well, duh! I wonder what gave you that idea? ...lee Quote Link to comment https://forums.atariage.com/topic/191877-problems-creating-my-first-asm-program/#findComment-2525194 Share on other sites More sharing options...
Willsy Posted May 19, 2012 Share Posted May 19, 2012 Ah! Okay that sounds pretty interesting. Well, when you get around to putting it in a ROM let me know. I have some tools that can make it easier for you and I can give you some advice re ASM994A - I have used it for Turboforth since day 1 with no issues at all. There's a bit of a Forth renaissance at the moment in our little 4A world. All good! Mark Quote Link to comment https://forums.atariage.com/topic/191877-problems-creating-my-first-asm-program/#findComment-2525317 Share on other sites More sharing options...
matthew180 Posted May 20, 2012 Share Posted May 20, 2012 Thanks! I had not thought about the byte-counting consequences of TI E/A's forcing the even-byte boundary on machine instructions and DATA directives and I certainly was unaware of the mistaken alignment of those by other assemblers. ...lee Machine instructions and word-based (16-bit) instructions (i.e. anything that is *not* one of the 8 byte instructions) will always address memory at even addresses because the 9900 only has a 15-bit address bus. If the assembler messes up and writes the object file with instructions at an odd address, your program will crash in a hurry. IMO, the only time an assembler should force EVEN alignment is when it encounters a machine instruction, otherwise leave it up to the programmer to use BYTE, TEXT, DATA, and EVEN to control where the data goes. Quote Link to comment https://forums.atariage.com/topic/191877-problems-creating-my-first-asm-program/#findComment-2525453 Share on other sites More sharing options...
+Lee Stewart Posted May 20, 2012 Share Posted May 20, 2012 Ah! Okay that sounds pretty interesting. Well, when you get around to putting it in a ROM let me know. I have some tools that can make it easier for you and I can give you some advice re ASM994A - I have used it for Turboforth since day 1 with no issues at all. There's a bit of a Forth renaissance at the moment in our little 4A world. All good! Mark Thanks! I certainly knew I could count on you, as well as Matthew and Retroclouds! ...lee Quote Link to comment https://forums.atariage.com/topic/191877-problems-creating-my-first-asm-program/#findComment-2525589 Share on other sites More sharing options...
apersson850 Posted May 21, 2012 Share Posted May 21, 2012 You're right about the EVEN directive being redundant in many cases with TI's assembler software. It's only if you do something like this EVEN BYTE 1 XYZZY DATA 112 Then the label XYZZY will not have the value of the address of the DATA (112), but one byte less. Quote Link to comment https://forums.atariage.com/topic/191877-problems-creating-my-first-asm-program/#findComment-2526573 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.