Syntax: XRA R Where R can be any of the general purpose registers (A,B,C,D,E,H and L) Byte: 1byte Addressing Mode: Register Addressing Working: 1.This is 1 byte instruction. 2. Microprocessor will allocate first byte for opcode during execution. 3. During execution of this instruction, microprocessor will perform Logical XORing operation between content of Accumulator and operand register. 4. S, Z and P are modified . Cy and Ac are reset . Example: XRA B where [B] = 52H and [A]= 11H After execution of XRA B [A] = 43H [B] = 22H A= 11 = 0001 0001 B= 52 = 0101 0010 A=43 0100 0011 FLAG = 00 0 0 0 0 0 0 = 0 0H
Syntax: SBI 8bit Where 8-bit is an immediate data operand. Byte: 2byte Addressing Mode: Immediate Addressing Working: 1. 2. A= A- 8bit -b 3. 4. Flag Example: SBI 10H where [A]= 22H and [c flag]= 1 After execution of SBI 10H [A] = 11H // A= A-8bit-b => 22-10-1 =11H Program: write an ALP for subtraction of 30H value from Registers A Where A carries 44H and Cy flag carries borrow value 1. Store result at memory location 5000H. Label Mnemonics Comments Start: SBI 30H ; a= a-8bit- cy... ; A= 44- 30 -1 = 13h STA 5000H Stop: HLT Output: [5000H]= 13H
Comments
Post a Comment