Vous êtes sur la page 1sur 11

1

SNo Mnemonics Syntax


1 2 3 4 5 6 7 8 9 10 MOV A, B MOV B, A MOV B,C MOV D,C MVI A, 27 MVI B,35 MVI C, FF MOV A, M MOV M, A MVI M, 52

Purpose
Copy the value of Reg. B into Reg. A, value of 2nd Reg. is copied into 1st Reg. Copy the value of Reg. A into Reg. B Copy the value of Reg. C into Reg. B Copy the value of Reg. C into Reg. D Copy the given hexadecimal data value 27 into Reg. A (Accumulator) Copy the given hexadecimal data value 35 into Reg. B Copy the given hexadecimal data value FF into Reg. C Copy the data, stored at memory location, whose address is stored in Memory Pointer (H-L pair) into Accumulator. Copy the data value from Accumulator to memory location, whose address is stored in Memory Pointer (H-L pair). Copy the given data value 52 into the memory location, whose address is stored in Memory Pointer (H-L pair).
2

SNo Mnemonics Syntax


11 LXI H, 8851

Purpose
Load H-L pair with addr/data (8851) given in instruction. Reg. H will store 88 and Reg. L will store 51. Load D-E pair with addr/data (8813) given in instruction. Reg. D will store 88 and Reg. E will store 13. Load Accumulator Direct, it loads Accumulator from the value stored at given memory address(8856). Store Accumulator Direct, it stores the value/data of Accumulator into memory location whose address(8856) is given in instruction. Add the data value of Acc. with the value of Reg. B, Result will updated in Acc. Add the data value of Acc. with the value of Reg. C, Result will updated in Acc. Add the data value of Acc. with the value of Reg. Acc. itself, doubles the value of Acc. Add data value of memory location, whose address is stored in Memory Pointer (HL pair) with the value of Acc., Result will updated in Acc. Add immediate given data value 37 with the data in Acc., Result will updated in Acc. Subtract the value of Reg. B from the data in Acc., Result will updated in Acc. 3

12
13 14 15 16 17 18 19 20

LXI D, 8813
LDA 8856 STA 8872 ADD B ADD C ADD A ADD M ADI 37 SUB B

SNo
21 22 23 24 25 26 27 28 29 30 31 32 33

Mnemonics Syntax
SUB C SUB M SUI 23 INR B INR C INR M INX H INX D DCR B DCR C DCR M DCX H DCX D

Purpose
Subtract the value of Reg. C from the data in Acc., Result will updated in Acc. Subtract the data stored at memory location whose address is stored in H-L pair, from Acc., Result will updated in Acc. Subtract immediate given data 23 from Acc., Result will updated in Acc. Increment the contents of Reg. B by 1. ( B = B + 1 ) Increment the contents of Reg. B by 1. ( C = C + 1 ) Increment the contents of memory location whose address is stored in H-L pair by 1. ( M = M + 1 ) Increment the value of H-L pair by 1. ( [H-L] = [H-L] + 1 ) Increment the value of D-E pair by 1. ( [D-E] = [D-E] + 1 ) Decrement the contents of Reg. B by 1. ( B = B - 1 ) Decrement the contents of Reg. C by 1. ( C = C - 1 ) Decrement the contents of memory location whose address is stored in H-L pair by 1. ( M = M - 1 ) Decrement the value of H-L pair by 1. ( [H-L] = [H-L] + 1 ) 4 Decrement the value of D-E pair by 1. ( [D-E] = [D-E] + 1 )

SNo Mnemonics Syntax


34 35 36 37 38 39 40 ANA B ANA C ANA M ANI 25 ORA B ORA D ORA M

Purpose
Logical AND the value of Reg. B with Acc., Result will be updated in Acc. Logical AND the value of Reg. C with Acc., Result will be updated in Acc. Logical AND the value stored at memory location whose address is stored in H-L pair with Acc., Result will be updated in Acc. Logical AND immediate data given 25 with Acc., Result will be updated in Acc. Logical OR the value of Reg. B with Acc., Result will be updated in Acc. Logical OR the value of Reg. D with Acc., Result will be updated in Acc. Logical OR the value stored at memory location whose address is stored in H-L pair with Acc., Result will be updated in Acc. Logical OR immediate data given 17 with Acc., Result will be updated in Acc. Logical X-OR the value of Reg. B with Acc., Result will be updated in Acc. Logical X-OR the value of Reg. C with Acc., Result will be updated in Acc. Logical X-OR the value stored at memory location whose address is stored in H-L pair with Acc., Result will be updated in Acc. Logical X-OR immediate data given 36 with Acc., Result will be updated in 5 Acc.
Complement Accumulator, performs on Acc. Data and finds 1s Complement of

41
42 43 44 45
46

ORI 17
XRA B XRA C XRA M XRI 36
CMA

Format of Assembly Language Program


Memory Address Op - Code Mnemonics Remarks/Purpose

1. Assembly Language program to Add two 8-bit numbers.


Memory OpAddress code
8801 8802 8803 8804 8805
8806 8807 8808 8809

Mnemonics
MVI A, 04
MVI B, 03 ADD B STA 8810

Remarks
Move 1st 8-bit immediate data in Accumulator i.e. 04
Move 2nd immediate data in Reg. B i.e. 03 Add Acc. data with data in Reg. B and result stored in Acc. i.e. Acc = Acc + B Store Acc. data (result) at memory location 8810

3E 04 06 03 80
32 10 88 76

HLT

End of the program (Halt)

1ST Data is in Acc. 04 2ND Data is in Reg. B 03 Result : Check the result at memory location 8810 ---- 07

2. Assembly Language program to Subtract two 8-bit numbers.


Memory OpAddress code
8801 8802 8803 8804 8805
8806 8807 8808 8809

Mnemonics
MVI A, 09
MVI B, 04 SUB B STA 8810

Remarks
Move 1st 8-bit immediate data in Accumulator i.e. 09
Move 2nd immediate data in Reg. B i.e. 04 Subtract the data of Reg. B from the data in Acc. and result stored in Acc. i.e. Acc = Acc B Store Acc. data (result) at memory location 8810

3E 04 06 03 90
32 10 88 76

HLT

End of the program (Halt)

1ST Data is in Acc. 09 2ND Data is in Reg. B 04 Result : Check the result at memory location 8810 ---- 05

3. Assembly Language program to move 8-bit data from Reg. B to Reg. C.


Memory OpAddress code
8801 8802 8803 8804 06 05 48 76

Mnemonics
MVI B, 05 MOV C, B HLT

Remarks
Move immediate 8-bit data in Reg. B i.e. 05 Move the data from Reg. B to Reg. C i.e. 05 will be copied into Reg. C End of the program (Halt)

Data is stored in Reg. B 05 Result : Data is copied from Reg. B to Reg. C i.e. Reg. C = 05

4. Assembly Language program to load Acc. from memory location 8807.


Memory OpAddress code
8801 8802 8803 8804 3A 07 88 76

Mnemonics
LDA 8807

Remarks
Load Acc. from given memory location 8807 i.e. data stored at 8807 will be copied directly into Acc.

HLT

End of the program (Halt)

Store data at memory location 8807 i.e. Data is 25 Result : Data 25 will be directly copied from memory location 8807 to Acc.
10

5. Assembly Language program to store the data from Acc. to memory location 8809.
Memory OpAddress code
8801 8802 8803 8804 8805 8804 3E 53 32 09 88 76

Mnemonics
MVI A, 53 STA 8809

Remarks
Move immediate data 53 into Acc.

HLT

End of the program (Halt)

Collect data in Acc. i.e. 53 Result : Store data from Acc. to memory location 8809 and check location 8809.
11

Vous aimerez peut-être aussi