Syntax: XRI 8-bit Where 8- bit is an immediate operand data. Byte: 2byte Addressing Mode: Immediate Addressing Working: 1.This is 2 byte instruction. 2. Microprocessor will allocate first byte for opcode and second byte for immediate data. 3. During execution of this instruction, microprocessor will perform Logical XORing operation between content of Accumulator and Immediate data. 4. S, Z and P are modified . Cy and Ac are reset . Example: XRI 22H where [A]= 11H After execution of XRI 22H [A] = 33H A= 11 = 0001 0001 = 22 = 0010 0010 A=33= 0011 0011 FLAG= 00 0 0 0 1 0 0 = 04H
Syntax: SBB R Where R can be any of the general purpose registers (A,B,C,D,E,H andL) Byte: 1byte Addressing Mode: Register Addressing Working: 1. 2. A= A- R-b 3. 4. Flag Example: SBB D where [D] = 10H , [A]= 22H and [c flag]= 1 After execution of SBB B [A] = 11H [D] = 10H // A= A-R-b => 22-10-1 =11H Program: write an ALP for subtraction of values present in Registers A ,B and C. Where A carries 44H and B carries 30H and C carries 10H. Store result at memory location 5000H. Label Mnemonics Comments Start: SUB B ; a=a - b// 44-30= 14h SBB C ; a= a - c - cy... A= 14-10-0 = 4h STA 5000H Stop: HLT Output: [5000H]= 04H
One Byte Instructions needs only one Byte of memory for execution. Here, in these instructions, general purpose registers are used as operands i.e. Source Register Rs and Destination Register Rd. Example: MOV , LDAX , STAX , XCHG
Comments
Post a Comment