11.07.2015 Views

section 7 - Index of

section 7 - Index of

section 7 - Index of

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

BCHG Bit Test and Change BCHGOperation:Assembler Syntax:QI!:!] ~ C; BCHG #n,X:eaO[n] ~ O[n]QI!:!] ~ C; BCHG #n,X:aaO[n] ~ O[n]QI!:!] ~ C; BCHG #n,X:ppO[n] ~ O[n]QI!:!] ~ C; BCHG #n,Y:eaO[n] ~ O[n]QI!:!] ~ C; BCHG #n,Y:aaO[n] ~ O[n]QI!:!] ~ C; BCHG #n,Y:ppO[n] ~ O[n]QI!:!] ~ C; BCHG #n,OO[n] ~ O[n]Description: Test the nth bit <strong>of</strong> the destination operand 0, complement it, and store theresult in the destination location. The state <strong>of</strong> the nth bit is stored in the carry bit C <strong>of</strong> thecondition code register. The bit to be tested is selected by an immediate bit number from0-23. This instruction performs a read-modify-write operation on the destination locationusing two destination accesses before releasing the bus. This instruction provides a testand-changecapability which is useful for synchronizing multiple processors using ashared memory. This instruction can use all memory alterable addressing modes.Example:BCHG #$7,X:«$FFE2 ;test and change bit 7 in I/O Port BOORBefore ExecutionX:$FFE2 1'-___ ----:$'-00_0_00_0_----1SRI L-_____ $_0_3o_0_------'After ExecutionX;$FFE2 ,-I____$0_0_00_80 __--'SRI'--_______ $_03_00 ____ --'

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

Saved successfully!

Ooh no, something went wrong!