section 7 - Index of

section 7 - Index of section 7 - Index of

11.07.2015 Views

BCLR Bit Test and Clear BCLROperation:Assembler Syntax:O[n] -+ C; BelR #n,X:ea0-+ O[n]O[n] -+ C; BelR #n,X:aa0-+ O[n]D[n] -+ C; BClR #n,X:pp0-+ D[n]O[n] -+ C; BelR #n,Y:ea0-+ D[n]D[n] -+ C; BelR #n,Y:aa0-+ D[n]D[n] -+ C; BelR #n,Y:pp0-+ D[n]D[n] -+ C; BelR #n,D0-+ D[n]Description: Test the nth bit of the destination operand 0, clear it and store the result inthe destination location. The state of the nth bit is stored in the carry bit C of the conditioncode register. The bit to be tested is selected by an immediate bit number from 0-23.This instruction performs a read-modify-write operation on the destination location usingtwo destination accesses before releasing the bus. This instruction provides a test-andclearcapability which is useful for synchronizing multiple processors using a sharedmemory. This instruction can use all memory alterable addressing modes.Example:BClR #$E,X:«$FFE4 ;test and clear bit 14 in I/O Port B Data Reg.X:$FFE4

BCLR Bit Test and Clear BCLRExplanation of Example: Prior to execution, the 24-bit X location X:$FFE4 (110 port Bdata register) contains the value $FFFFFF. The execution of the BCLR #$E,X:«$FFE4instruction tests the state of the 14th bit in X:$FFE4, sets the carry bit C accordingly, andthen clears the 14th bit in X:$FFE4.Condition Codes:I: I DM I T I ** JR S1 I so I 11 I : I ..."15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0I LIE I U clR N I z I v I : 1CCR Condition Codes:For destination operand SR:C - Cleared if bit 0 is specified. Not affected otherwise.V - Cleared if bit 1 is specified. Not affected otherwise.Z - Cleared if bit 2 is specified. Not affected. otherwise.N - Cleared if bit 3 is specified. Not affected otherwise.U - Cleared if bit 4 is specified. Not affected otherwise.E - Cleared if bit 5 is specified. Not affected otherwise.L - Cleared if bit 6 is specified. Not affected otherwise.S - Cleared if bit 7 is specified. Not affected otherwise.For destination operand A or B:S -Computed according to the definition. See Notes on page A-55.L - Set if data limiting has occurred. See Notes on page A-55.E - Not affectedU - Not affectedN - Not affectedZ - Not affectedV - Not affectedC - Set if bit tested is set. Cleared otherwise.

BCLR Bit Test and Clear BCLRExplanation <strong>of</strong> Example: Prior to execution, the 24-bit X location X:$FFE4 (110 port Bdata register) contains the value $FFFFFF. The execution <strong>of</strong> the BCLR #$E,X:«$FFE4instruction tests the state <strong>of</strong> the 14th bit in X:$FFE4, sets the carry bit C accordingly, andthen clears the 14th bit in X:$FFE4.Condition Codes:I: I DM I T I ** JR S1 I so I 11 I : I ..."15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0I LIE I U clR N I z I v I : 1CCR Condition Codes:For destination operand SR:C - Cleared if bit 0 is specified. Not affected otherwise.V - Cleared if bit 1 is specified. Not affected otherwise.Z - Cleared if bit 2 is specified. Not affected. otherwise.N - Cleared if bit 3 is specified. Not affected otherwise.U - Cleared if bit 4 is specified. Not affected otherwise.E - Cleared if bit 5 is specified. Not affected otherwise.L - Cleared if bit 6 is specified. Not affected otherwise.S - Cleared if bit 7 is specified. Not affected otherwise.For destination operand A or B:S -Computed according to the definition. See Notes on page A-55.L - Set if data limiting has occurred. See Notes on page A-55.E - Not affectedU - Not affectedN - Not affectedZ - Not affectedV - Not affectedC - Set if bit tested is set. Cleared otherwise.

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

Saved successfully!

Ooh no, something went wrong!