+Lee Stewart Posted December 1, 2013 Author Share Posted December 1, 2013 How's this? fbForth100_Manual_AppendixE_a.pdf ...lee Quote Link to comment Share on other sites More sharing options...
Willsy Posted December 1, 2013 Share Posted December 1, 2013 Looks good, though the first paragraph advert the E1 heading is confusing to me. It appears to contradict the heading. Might just be me! Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted December 1, 2013 Author Share Posted December 1, 2013 At long last! —Here's the first draft of the fbForth 1.0 Manual without Appendix N "TMS9900 Assembly Source Code for fbForth": fbForth_Manual_draft01.pdf ...lee 1 Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted December 1, 2013 Author Share Posted December 1, 2013 Looks good, though the first paragraph advert the E1 heading is confusing to me. It appears to contradict the heading. Might just be me! Thanks, I'll have a look. ...lee Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted December 1, 2013 Author Share Posted December 1, 2013 (edited) Looks good, though the first paragraph advert the E1 heading is confusing to me. It appears to contradict the heading. Might just be me! How's this?: Descriptions of words appearing in the comments here that are part of fbForth may be found in Appendix D The fbForth Glossary. ...lee Edited December 1, 2013 by Lee Stewart Quote Link to comment Share on other sites More sharing options...
Willsy Posted December 2, 2013 Share Posted December 2, 2013 Yep. Better! Quote Link to comment Share on other sites More sharing options...
+Vorticon Posted December 2, 2013 Share Posted December 2, 2013 At long last! —Here's the first draft of the fbForth 1.0 Manual without Appendix N "TMS9900 Assembly Source Code for fbForth": fbForth_Manual_draft01.pdf ...lee Lee, you're the man! Or as Willsy would say, you've basted my flabber (I think...) Quote Link to comment Share on other sites More sharing options...
Willsy Posted December 2, 2013 Share Posted December 2, 2013 My flabber is well and truly gasted :-) Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted December 2, 2013 Author Share Posted December 2, 2013 My flabber is well and truly gasted :-) "Flabbergasted"—a truly wonderful word—even better when separated in such a manner! —I'm astonished! ...lee Quote Link to comment Share on other sites More sharing options...
Willsy Posted December 2, 2013 Share Posted December 2, 2013 "I'm astonished! In fact, you might even go as far as to say "I'm flabbergasted!" Okay folks, challenge for the week: You MUST use flabbergasted in at least one conversation per day for this week. Game on! Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted December 2, 2013 Author Share Posted December 2, 2013 (edited) In fact, you might even go as far as to say "I'm flabbergasted!" Okay folks, challenge for the week: You MUST use flabbergasted in at least one conversation per day for this week. Game on! What can I say?—I'm nonplussed! ...lee Edited December 2, 2013 by Lee Stewart Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted December 3, 2013 Author Share Posted December 3, 2013 I know everyone's just waiting for this with bated breath <not>, so I will post Appendix N "TMS9900 Assembly Source Code for fbForth" later this afternoon. I will make another proof-reading pass through the entire fbForth 1.0 manual, take into consideration any suggestions posted here and then post the complete manual. This will not take me more than a few days, so hurry up with your suggestions! ...lee Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted December 4, 2013 Author Share Posted December 4, 2013 OK...not exactly this afternoon; but, it's still the same day! And, here's Appendix N "TMS9900 Assembly Source Code for fbForth" for your delectation if not flabbergastery—OK, I made that up—but, there it is— fbForth100_Manual_AppendixN.pdf ...lee Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted December 5, 2013 Author Share Posted December 5, 2013 While proofing the entire fbForth 1.0 manual, I realized that the Forth words listed in each section of Chapter 2 "Getting Started" are not in alphabetical order. The original TI Forth manual had them unsorted, as well. I believe they were loosely in a usage order; but, the lists are so short that it probably doesn't matter. Considering that the word lists at the beginning of each chapter are in column-primary alphabetical order (actually ASCII order), I wonder whether I should sort the lists in Chapter 2 just for aesthetics. Any opinions either way? ...lee Quote Link to comment Share on other sites More sharing options...
Willsy Posted December 5, 2013 Share Posted December 5, 2013 It probably doesn't matter - however, if it were me, I just know it would niggle away at me until I changed it. It sounds like it's niggling away at you too. Is "niggle" in the American lexicon? Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted December 5, 2013 Author Share Posted December 5, 2013 It probably doesn't matter - however, if it were me, I just know it would niggle away at me until I changed it. It sounds like it's niggling away at you too. Yeah—you're right—I think I will. Is "niggle" in the American lexicon? Certainly! ...lee Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted December 5, 2013 Author Share Posted December 5, 2013 (edited) While attempting to flesh out the explanation of XMLLNK in Chapter 5 of the fbForth 1.0 manual, it occurred to me that the explanation in the E/A manual, page 258 that follows is not precisely accurate: * You may also use the XMLLNK utility to branch to an address and start executing there. In this case, the DATA instruction is the address to which you wish to branch. The first bit of the word must be on, so the address may be from >8000 through >FFFF. * An address of exactly 8000h, though not at all likely, would get past the test in line 8 below (code from fbForth ALC source that duplicates the corresponding E/A utility): * * LINK TO SYSTEM XML UTILITIES * XMLENT MOV *R14+,@GPLWS+2 Get argument LWPI GPLWS Select GPL workspace MOV R11,@UTILWS+22 Save GPL return address MOV R1,R2 Make a copy of argument CI R1,>8000 Direct address in ALC? JH XML30 We have the address SRL R1,12 SLA R1,1 SLA R2,4 SRL R2,11 A @XMLTAB(R1),R2 MOV *R2,R2 XML30 BL *R2 LWPI UTILWS GET BACK TO RIGHT WS MOV R11,@GPLWS+22 Restore GPL return address RTWP * The result of such code would be an attempt to execute code at the address pointed to by 6030h! The test should be JHE XML30 or line 7 should be CI R1,>7FFF. Does anyone think it's worth changing? @Willsy? @jacquesg? @Tursi? @InsaneMultitasker? @matthew180? @Vorticon? ? @senior_falcon? @apersson850? @Stuart? @acadiel? @arcadeshopper? @OLD CS1? @mizapf? @TheMole? ...lee Edited December 5, 2013 by Lee Stewart Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted December 5, 2013 Share Posted December 5, 2013 Even though it specifically states you should have familiarity I'm using this manual to learn about Forth from scratch. This work is appreciated by more than regular TI users 1 Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted December 5, 2013 Author Share Posted December 5, 2013 Even though it specifically states you should have familiarity I'm using this manual to learn about Forth from scratch. This work is appreciated by more than regular TI users Thank you, Sir! Please, let me know of any suggestions you may have to make it better. ...lee 1 Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted December 10, 2013 Author Share Posted December 10, 2013 I'm working on Chapter 9 "The fbForth 9900 Assembler" and it occurred to me that I should add to the Assembler the aliases corresponding to fbForth's THEN (for ENDIF ) and END (for UNTIL ), namely, THEN, (for ENDIF, ) and END, (for UNTIL, ). Because they are all immediate words, I think the following should work. @Willsy? Other Forthers? * : THEN, [COMPILE] ENDIF, ; IMMEDIATE : END, [COMPILE] UNTIL, ; IMMEDIATE * or is the IMMEDIATE not necessary?—the originals have it. ...lee Quote Link to comment Share on other sites More sharing options...
Willsy Posted December 10, 2013 Share Posted December 10, 2013 (edited) They certainly do need to be immediate. The names of the words end in a comma, which, by convention, means they "do something" (in practice, they lay down some machine code) as they are encountered. So yep, they need to be immediate. I do wonder if they are necessary though. END, as a synonym for UNTIL, doesn't work in my book! UNTIL, (to me) is clear. END, seems much more ambiguous. You might get more mileage out of adding SYNONYM to the kernal, if you can squeeze it in. Then users could define it themselves with: SYNONYM THEN, ENDIF, etc. TF has SYNONYM, but it's not in the kernal. It's defined thusly; probably only minor mods required for fbForth: --BLOCK-00046--------- : SYNONYM CREATE BL WORD FIND DUP IF SWAP , IMMEDIATE 1+ IF DOES> @ EXECUTE ELSE DOES> STATE @ IF @ , ELSE @ EXECUTE THEN THEN ELSE TRUE ABORT" Word not found" THEN ; The above code can cope with synonyms of immediate words. Note that all synonyms themselves are immediate. I think the only changes required for fbForth would be at the top of the code, around FIND. Here's how mine works: CREATE \ create the synonym BL WORD FIND DUP IF \ find the target word in the dictionarySWAP , \ compile the CFA of the target word into the synonyms' PFA IMMEDIATE \ make the newly created synonym immediate 1+ IF \ check to see if the target word was an immediate wordFIND probably has a different stack effect in TF to fbF. Here's TF's definition for FIND. Enjoy Edited December 10, 2013 by Willsy Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted December 10, 2013 Author Share Posted December 10, 2013 (edited) @Willsy... Much food for thought—thanks! I agree with you about END ; but, I need to keep it for compatibility with TI Forth. However, END, was never part of TI Forth's TMS9900 Assembler, so the only word I should consider for synonym status is THEN, . I don't know that I will implement SYNONYM ; but, I certainly will attempt to understand your definition with my old brain. In perusing the Forth standards documents from Forth-79 to ANSI-draft Forth 2012 RC1), the first (and only) time SYNONYM appears is in the 2012 draft. The one troubling comment is "An ambiguous conditions [sic] exists if oldname can not be found or IMMEDIATE is applied to newname." What I may do is to wait until I try to hoist fbForth into cartridge space and, if I put the Assembler there (the 64KB Guidry cartridge board makes that possible ), THEN, will simply branch to the execution code for ENDIF, and it will be as if ENDIF, had been the word entered, i.e., no return to the code for THEN, . Of course, I could just repeat the definition for ENDIF, with all that extra room. ...lee Edited December 10, 2013 by Lee Stewart Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted December 11, 2013 Author Share Posted December 11, 2013 (edited) ... TF has SYNONYM, but it's not in the kernal. It's defined thusly; probably only minor mods required for fbForth: --BLOCK-00046--------- : SYNONYM CREATE BL WORD FIND DUP IF SWAP , IMMEDIATE 1+ IF DOES> @ EXECUTE ELSE DOES> STATE @ IF @ , ELSE @ EXECUTE THEN THEN ELSE TRUE ABORT" Word not found" THEN ; ... Here it is in fbForth: * HEX : SYNONYM <BUILDS -FIND IF SWAP CFA , IMMEDIATE 40 AND IF DOES> @ EXECUTE ELSE DOES> STATE @ IF @ , ELSE @ EXECUTE THEN THEN ELSE ." Word not found" ABORT THEN ; * How it works in fbForth: <BUILDS { create the synonym } -FIND IF { find the target word in dictionary; not found leaves only false; found leaves PFA, length-byte and true } SWAP CFA , { compile the CFA of the target word into the synonym's PFA } IMMEDIATE { make the newly created synonym immediate } 40 AND IF { check to see if the target word was an immediate word } { 40h is the value of a set precedence bit (if set, the word is immediate) and is part of the length-byte } ... ." Word not found" ABORT { there is no ABORT" in fbForth; ABORT is the same in both fbF and TF } ...lee Edited December 11, 2013 by Lee Stewart Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted December 11, 2013 Author Share Posted December 11, 2013 There's a problem with both TurboForth's and fbForth's definitions of SYNONYM , viz., the synonym gets created even when the "not found" exit is taken! I have been unsuccessful so far in figuring out how to avoid that. ...lee Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted December 11, 2013 Author Share Posted December 11, 2013 OK—this works: * HEX : SYNONYM ( fbForth) <BUILDS -FIND IF SWAP CFA , IMMEDIATE 40 AND IF DOES> @ EXECUTE ELSE DOES> STATE @ IF @ , ELSE @ EXECUTE THEN THEN ELSE ." Word not found" LATEST 2- DUP @ CURRENT @ ! DP ! ABORT THEN ; * It appears to do what I intend; but, it should probably be tested a bit more. Here's what the additional code in lines 15 and 16 does: LATEST { gets the NFA (name field address) of the last defined word } 2- DUP { backs up 2 bytes to the LFA (label field address—points to previous word's NFA) and duplicates it } @ { gets the NFA of the previous latest word in the current vocabulary } CURRENT @ { gets the current vocabulary's pointer to the latest word } ! { stores the previous latest word's NFA in the current vocabulary's latest-word pointer } DP ! { stores the LFA of the failed word (the old HERE ) in the dictionary pointer to become the new HERE } ...lee 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.