section 7 - Index of

section 7 - Index of section 7 - Index of

11.07.2015 Views

BSET Bit Test and Set BSElOperation:Assembler Syntax:D[n] ~ C; BSET #n,X:ea1 ~ D[n]D[n] ~ C; BSET #n,X:aa1 ~ D[n]D[n] ~ C; BSET #n,X:pp1 ~ D[n]D[n] ~ C; BSET #n,Y:ea1 ~ D[n]D[n] ~ C; BSET #n,Y:aa1 ~ D[n]D[n] ~ C; BSET #n,Y:pp1 ~ D[n]D[n] ~ C; BSET #n,D1 ~ D[n]Description: Test the nth bit of the destination operand 0, set 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-andsetcapability which is useful for synchronizing multiple processors using a shared memory.This instruction can use all memory alterable addressing modes.Example:BSET #$0,X:«$FFE5 ;test and clear bit 14 in liD Port B Data Reg.X:$FFE5 1 '--____Before Execution$ 0_00_0_0 o __ -.l X:$FFE5 1L--__After Execution--'-$°_°°_°°_1__--'SRI '--____ $0_3_00 __-.l SRI'--____ ~$_03_0_0 __ ~

BSET Bit Test and Set BSETExplanation of Example: Prior to execution, the 24-bit X location X:$FFE5 (liD port Cdata register) contains the value $000000. The execution of the BSET #$0,X:«$FFE5instruction tests the state of the oth bit in X:$FFE5, sets the carry bit C accordingly, andthen sets the Oth bit in X:$FFE5.Condition Codes:I"F I OM I T I" I SI I SO I 1115 14 13 12 11 10 9 8 7 6 5 4 3 2I 10 I s I l... MR • C CCR1 0CCR Condition Codes:For destination operand SR:C- Set if bit 0 is specified. Not affected otherwise.V - Set if bit 1 is specified. Not affected otherwise.Z - Set if bit 2 Is specified. Not affected otherwise.N - Set if bit 3 is specified. Not affected otherwise.U - Set if bit 4 is specified. Not affected otherwise.E - Set if bit 5 Is specified. Not affected otherwise.L - Set if bit 6 is specified. Not affected otherwise.S - Set If bit 7 Is specified. Not affected othelWise.For destination operand A or B:S -Computed according to the definition. See Notes on page A-63.L - Set if data limiting has occurred. See Notes on page A-63.E - Not affectedU - Not affectedN - Not affectedZ - Not affectedV - Not affectedC - Set if bit tested Is set. Cleared othelWise.

BSET Bit Test and Set BSElOperation:Assembler Syntax:D[n] ~ C; BSET #n,X:ea1 ~ D[n]D[n] ~ C; BSET #n,X:aa1 ~ D[n]D[n] ~ C; BSET #n,X:pp1 ~ D[n]D[n] ~ C; BSET #n,Y:ea1 ~ D[n]D[n] ~ C; BSET #n,Y:aa1 ~ D[n]D[n] ~ C; BSET #n,Y:pp1 ~ D[n]D[n] ~ C; BSET #n,D1 ~ D[n]Description: Test the nth bit <strong>of</strong> the destination operand 0, set it, and store the result inthe destination location. The state <strong>of</strong> the nth bit is stored in the carry bit C <strong>of</strong> 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-andsetcapability which is useful for synchronizing multiple processors using a shared memory.This instruction can use all memory alterable addressing modes.Example:BSET #$0,X:«$FFE5 ;test and clear bit 14 in liD Port B Data Reg.X:$FFE5 1 '--____Before Execution$ 0_00_0_0 o __ -.l X:$FFE5 1L--__After Execution--'-$°_°°_°°_1__--'SRI '--____ $0_3_00 __-.l SRI'--____ ~$_03_0_0 __ ~

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

Saved successfully!

Ooh no, something went wrong!