Willsy Posted December 17, 2015 Share Posted December 17, 2015 (edited) One for the guru's: What is the condition of the EQ bit after executing this: LI R0,>0011 LI R1,>2233 MOVB R0,R1 Subtle eh? The byte moved into R1 is 0, so R1 contains >0033. Now the question: Since this is a BYTE operation, and we moved a 0 to the destination, does the EQ bit go on, or does the CPU check all 16 bits of R1 for 0 and set the EQ bit accordingly? As usual, the Editor Assembler manual is absolutely pathetic on this point. Edited December 17, 2015 by Willsy Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted December 18, 2015 Share Posted December 18, 2015 In the absence of more explicit information to the contrary, I would expect the comparison to be a byte comparison just as is CB, which is adequately explained. If it were not so, the GPL interpreter would likely be much bigger than it is, with its byte operations and all! I checked it with the Forth Assembler on Classic99 and the real iron. Both give the expected result, viz., if a 0 byte is copied, EQ is set to 1, otherwise to 0. Here is the code I used, which requires on the stack the number to be loaded in R0: HEX ASM: XXX *SP R0 MOV, ( move number on stack to R0) *SP CLR, ( reset number on stack to 0) R1 2233 LI, ( load 2233h in R1) R0 R1 MOVB, ( copy MSB of R0 to MSB of R1) EQ IF, ( if result is 0 [EQ=1]...) *SP INC, ( ...set number on stack to 1) THEN, ;ASM Running with 0011h on the stack (computer responses are underlined): 0011 XXX . 1 ok:0 and with FFFFh: FFFF XXX . 0 ok:0 ...lee Quote Link to comment Share on other sites More sharing options...
+InsaneMultitasker Posted December 18, 2015 Share Posted December 18, 2015 As usual, the Editor Assembler manual is absolutely pathetic on this point. EQ will be set. Toss a JEQ or JNE into your code and give it a whirl. 1 Quote Link to comment Share on other sites More sharing options...
Willsy Posted December 18, 2015 Author Share Posted December 18, 2015 Thanks guys. Quote Link to comment Share on other sites More sharing options...
matthew180 Posted December 19, 2015 Share Posted December 19, 2015 The source byte is compared to zero during the operation, so EQ will be set (as InsaneMultitasker mentioned). The 9990 datasheet indicates this but not very clearly. I have another book that TI published on the 9990 architecture (http://www.amazon.com/Microprocessors-Microcomputers-System-Instruments-electronics/dp/007063758X/) that describes each instruction in much better detail. It was probably the reference from which the E/A manual was written. I also tested this extensively during the F18A GPU development. 1 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.