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
Syntax: RLC Byte: 1byte Addressing Mode: Implicit Addressing Working: 1. This is one byte instruction. 2. Microproccessor will allocate one byte for opcode RLC and operand is Accumulator i.e. operand will not need memory allocation during execution. 3. Thi s instruction rotates content of Accumulator one bit position towards left. i.e. The bit A7 is stored in bit position A0 as well as in carry flag. 4. C flag will get affected. Example: RLC where [A]= 21H After execution of RLC [A] =42H A= 21 = 0010 0001 Cy <- A7<-A6<-A5<-A4<-A3<-A2<-A1<-A0 |___->__________________________->_| 0 0 1 0...
Comments
Post a Comment