+9640News Posted June 20, 2019 Share Posted June 20, 2019 OK, I was using an assembly language instruction I have never used in the past. I am obviously using it incorrectly as I am not getting expected results. Please advise what I might do to correct. Thanks. P.S., I ended up using the MOV instruction which used another word of instruction that solved the issue, but I would still like to understand where I am making my mistake. START SETO @TOGGLE ABS @TOGGLE JNE SEC1 SEC2 BLWP @THERE JMP END SEC1 BLWP @HERE END BLWP @>0000 TOGGLE DATA 0 I thought my code should JMP to SEC1, however it appears the EQ bit is not set and goes to SEC2. Is there something I am overlooking with the use of the SETO command to set it to >FFFF I am overlooking? Thanks for the feedback. Beery Quote Link to comment Share on other sites More sharing options...
+adamantyr Posted June 20, 2019 Share Posted June 20, 2019 I just tested this in Classic99 and it worked as expected. ABS on a value of -1 converts it to 1, which fails to set the equality bit, as it's not equal to zero. 1 Quote Link to comment Share on other sites More sharing options...
+TheBF Posted June 20, 2019 Share Posted June 20, 2019 I thought it might be better to do START CLR @TOGGLE INC @TOGGLE ETC.... Quote Link to comment Share on other sites More sharing options...
+9640News Posted June 20, 2019 Author Share Posted June 20, 2019 Hmmm, will need to check my code again. Something wasn't adding up, somewhere. My code is a bit more complicated than that example, so something else must be happening after I go through all the program initialization. Beery Quote Link to comment Share on other sites More sharing options...
+FarmerPotato Posted June 20, 2019 Share Posted June 20, 2019 9900 Family Systems Design p 8-132 says Single Operand Instructions that compare results to zero are: INV, NEG, INC, INCT, DEC, DECT These do NOT compare results to zero: B, BL, BLWP, CLR, SETO, ABS, SWPB, X So, either SETO or ABS leave the jump undetermined. 1 Quote Link to comment Share on other sites More sharing options...
+adamantyr Posted June 20, 2019 Share Posted June 20, 2019 13 minutes ago, FarmerPotato said: 9900 Family Systems Design p 8-132 says Single Operand Instructions that compare results to zero are: INV, NEG, INC, INCT, DEC, DECT These do NOT compare results to zero: B, BL, BLWP, CLR, SETO, ABS, SWPB, X So, either SETO or ABS leave the jump undetermined. That's interesting because both the TI Tech Pages and Classic99 contradict that. Quote Link to comment Share on other sites More sharing options...
+TheBF Posted June 21, 2019 Share Posted June 21, 2019 Page 41 of the E/A manual is my goto when I am confused. Well actually I used to be confused, but now I am not too sure. ? 0xBF Quote Link to comment Share on other sites More sharing options...
+FarmerPotato Posted June 21, 2019 Share Posted June 21, 2019 2 minutes ago, TheBF said: Page 41 of the E/A manual is my goto when I am confused. Well actually I used to be confused, but now I am not too sure. ? 0xBF Aha, there is a footnote to ABS. "Operand is compared to zero for status bit." Not the result. So, the status tells you about prior to ABS. I would expect ABS R1 JLT HERE to jump if the sign had been -1 before ABS. I've never known or knowingly relied on this. 1 Quote Link to comment Share on other sites More sharing options...
+mizapf Posted June 22, 2019 Share Posted June 22, 2019 Actually, there is an error in the Editor/Assembler manual concerning the ABS command. It says that the Carry bit is unaffected, but I just tested it on my Geneve (TMS9995), and the Carry bit is always reset. * * LAECOPX * FFFE 10000*** * FFFF 10000*** * 0000 00100*** * 0001 11000*** * 0002 11000*** * 7FFE 11000*** * 7FFF 11000*** * 8000 10001*** * 8001 10000*** I'm glad to say that I did it right with ABS in MAME (had to make sure first). This can be the cause of such extremely rare bugs that stay unnoticed for years. Quote Link to comment Share on other sites More sharing options...
+TheBF Posted June 22, 2019 Share Posted June 22, 2019 46 minutes ago, mizapf said: Actually, there is an error in the Editor/Assembler manual concerning the ABS command. It says that the Carry bit is unaffected, but I just tested it on my Geneve (TMS9995), and the Carry bit is always reset. * * LAECOPX * FFFE 10000*** * FFFF 10000*** * 0000 00100*** * 0001 11000*** * 0002 11000*** * 7FFE 11000*** * 7FFF 11000*** * 8000 10001*** * 8001 10000*** I'm glad to say that I did it right with ABS in MAME (had to make sure first). This can be the cause of such extremely rare bugs that stay unnoticed for years. So the table on page 41 is correct for ABS right? Quote Link to comment Share on other sites More sharing options...
+mizapf Posted June 22, 2019 Share Posted June 22, 2019 Yes, and the corresponding information in the 9900 and 9995 specs. BTW, this was one of the rare occasions where I used the LST command of the 9995 (to preload the status flags). 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.