Syntax: SUI 8-bit Where 8-bit is an immediate data operand. Byte: 2byte Addressing Mode: Immediate Addressing Working: 1. 2. 3. 4. Flag Example: SUI 11H where [A]= 22H After execution of SUI 11H [A] = 11H Program: write an ALP for 8bit subtraction of value present in Register A that is 44H with an immediate value 30H. Store result at memory location 5000H. Label Mnemonics Comments Start: SUI 30H STA 5000H Stop: HLT Output: [5000H]= 14H
Syntax: CMC Byte: 1byte Addressing Mode: Implied Addressing Flag: Carry Working: 1. Microprocessor will allocate one byte for opcode for execution. 2. During the execution of the instruction microprocessor will complement or perform 1's complement on content of Carry flag. Example: CMC where [Cy] = set = 1 After execution of CMC [Cy] = 0
Syntax: ADD 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. 3. 4. Flag Example: ADD B where [B] = 22H and [A]= 11H After execution of ADD B [A] = 33H [B] = 22H Program: write an ALP for 8bit addition of values present in Registers A and B where A carries 44H and B carries 30H. Store result at memory location 5000H. Label Mnemonics Comments Start: ADD B STA 5000H Stop: HLT Output: [5000H]= 74H LXI H, 4000H ; 4000= 50h MOV A,M ; a = 50h INX H ; 4001h where 4001= 90h MOV B, M ; b= 90h ADD B ; a = a+b ... A = 50+90= E0h INX H ; 4002h MOV M,A ; 4002h = E0h HLT
Comments
Post a Comment