section 7 - Index of

section 7 - Index of section 7 - Index of

11.07.2015 Views

8TST Bit Test 8TSTOperation:Assembler Syntax:D[n] -+ C; BTST #n,X:eaD[n] -+ C; BTST #n,X:aaD[n] -+ C; BTST #n,X:ppD[n] -+ C; BTST #n,Y:eaD[n] -+ C; BTST #n,Y:aaD[n] -+ C; BTST #n,Y:ppD[n] -+ C; BTST #n,DDescription: Test the nth bit of the destination operand D. The state of the nth bit isstored in the carry bit C of the condition code register. The bit to be tested is selected byan immediate bit number from 0-23. This instruction is useful for performing serial to parallelconversion when used with the appropriate rotate instructions. This instruction canuse all memory alterable addressing modes.Example:BTSTROL#$O,X:«$FFEEA;read SSI serial input flag IF1 into C bit;rotate carry bit C into LSB of A 1X:$FFEE 1-1Before Execution___-'-$o_o_oo_o2__---'After ExecutionX:$FFEE 1'--___ $_00_00_02 __--'SR~I ___ ~$_03_00 ____ ---'SRI'--___ ~$_03_01 ____ --'Explanation of Example: Prior to execution, the 24-bit X location X:$FFEE (1/0 SSI statusregister) contains the value $000002. The execution of the BTST #$1,X:«$FFEEinstruction tests the state of the 1 st bit (serial input flag IF1) in X:$FFEE and sets thecarry bit C accordingly. This instruction sequence illustrates serial to parallel conversionusing the carry bit C and the 24-bit A1 register.

BTSTBit TestBTSTCondition Codes:115 14 13 12 11 10 9 8 7 6 5 4 3LF I OM I T I ** I 61 I 60 I 11~ MR ....I lois I L I E I u I N ICCR Condition Codes:For destination operand A or B:C - Set If bit tested Is set. Cleared otherwise.V - Not affectedZ - Not affectedN - Not affectedU - Not affectedE - Not affectedL - Set If data limiting has occurred. See Notes on page A-69.S - Computed according to the definition. See Notes on page A-69.For other destination operands:C - Set H bit tested is set. Cleared otherwise.V - Not affectedZ - Not affectedN - Not affectedU - Not affectedE - Not affectedL - Not affectedS - Not affectedMR Status bits are not affected.CCR2z I v0I :1SP -Stack Pointer:For destination operand SSH: SP - Decrement by 1 .For other destination operands: Not affected

BTSTBit TestBTSTCondition Codes:115 14 13 12 11 10 9 8 7 6 5 4 3LF I OM I T I ** I 61 I 60 I 11~ MR ....I lois I L I E I u I N ICCR Condition Codes:For destination operand A or B:C - Set If bit tested Is set. Cleared otherwise.V - Not affectedZ - Not affectedN - Not affectedU - Not affectedE - Not affectedL - Set If data limiting has occurred. See Notes on page A-69.S - Computed according to the definition. See Notes on page A-69.For other destination operands:C - Set H bit tested is set. Cleared otherwise.V - Not affectedZ - Not affectedN - Not affectedU - Not affectedE - Not affectedL - Not affectedS - Not affectedMR Status bits are not affected.CCR2z I v0I :1SP -Stack Pointer:For destination operand SSH: SP - Decrement by 1 .For other destination operands: Not affected

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!