Jump to content
IGNORED

Assembly Language Instruction


9640News

Recommended Posts

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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?  

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...