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
Syntax: LXI Rhp,16-bit Where Rhp is Higher Order Register of the pair. (I.e. BC, DE, HL) Byte: 3byte Addressing Mode: Immediate Addressing Working: For execution of LXI Instruction, microprocessor will allocate first byte for opcode, second byte for lower order address/data and third byte for higher order address/data. Example: LXI H,2200H After execution of LXI H,2200H [L] = 00H [H] = 22H
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
Comments
Post a Comment