Syntax: ANI 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 ANDing operation between content of Accumulator and Immediate data. 4. S, Z and P are modified . Cy is reset(Cy=0) and Ac is set (Ac=1) . Example: ANI 22H where [A]= 11H After execution of ANI 22H [A] = 00H A= 11 = 0001 0001 = 22 = 0010 0010 A=00 0000 0000 FLAG= 01 0 1 0 0 0 0 = 50H
Instructions of 8085 can be classified on three basis: First Classification on basis of their byte length i.e. size of instruction. 1. 1-byte instructions 2. 2-byte instructions 3. 3-byte instructions Second Classification on basis of their addressing modes i.e. kinds of approaches to fetch and execute. 1. Register Addressing 2. Immediate Addressing 3. Direct Addressing 4. Register Indirect Addressing 5. Implicit Addressing There are five sets of instructions for 8085mp Programming: 1. Data Transfer group 2. Arithmetic group 3. Logical group 4. Branching group 5. Machine Control group
Syntax: SUB 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: SUB B where [B] = 11H and [A]= 22H After execution of SUB B [A] = 11H [B] = 22H Program: write an ALP for 8bit subtraction 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: SUB B STA 5000H Stop: HLT Output: [5000H]= 14H LXI H, 4000H ; 4000= 90h MOV A,M ; a = 90h INX H ; 4001h where 4001= 40h MOV B, M ; b= 4 0h SUB B ; a = a - b ... A = 90 - 40= 50h INX H ; 4002h MOV M,A ; 4002h = 50h HLT
Comments
Post a Comment