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
Syntax: LDA 16-bit Where 16-bit is for memory location. Byte: 3byte Addressing Mode: Direct Addressing Working: for execution of this instruction, microprocessor will allocate first byte for opcode, second byte for lower order address and third byte for higher order. Example: LDA 4000H where [4000H] = A0 H After execution of LDA 4000H [A]= A0 H
EXAMPLES: CMP M ......... Register Indirect Addressing MOV A, M MOV M, A ANA M ORA M XRA M SUB M ADD M ADC M SBB M LXI H 3000H ; HL = 3000H MOV A,M ; M = 10H ; M -> A INX H ; HL = 3001H CMP M ; M = 11H, IF [A] ? [M] ----- ----- [3000H] = 10 [3001H] = 11
Comments
Post a Comment