Problem – Write a program to add the content of memory location 2000 : 0500 with content of memory location 3000 : 0600 and store result into 5000 : 0700 memory location.
- Move 2000 into CX register
- Move CX into DS segment (now we are in 2000 data segment)
- Move value of 500 into AX register
- Move 3000 into CX register
- Move CX into DS segment (now we are in 3000 data segment)
- Add value of AX(accumulator) with value at memory 600
- Move 5000 into CX register
- Move CX into ES segment (now we are in 5000 extra segment)
- Move the content of AX into 700 memory location
|1000||MOV||CX, 2000||[CX] <- 2000|
|1004||MOV||DS, CX||[DS] <- [CX]|
|1006||MOV||AX, ||[AX] <- |
|100A||MOV||CX, 3000||[CX] <- 3000|
|100E||MOV||DS, CX||[DS] <- [CX]|
|1010||ADD||AX, ||[AX] <- [AX] + |
|1014||MOV||CX, 5000||[CX] <- 5000|
|1018||MOV||ES, CX||[ES] <- [CX]|
|101A||MOV||, AX|| <- [AX] RESULT|
Registers used AX, CX for general purpose.
Segments used DS, ES for changing the segments.
MOV is used to transfer the data
ADD is used for addition
HLT is used to halt the program
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.
- 8086 program to determine modulus of first array elements corresponding to another array elements
- 8086 program to add two 16-bit numbers with or without carry
- 8086 program to add two 8 bit BCD numbers
- 8086 program to add two 16 bit BCD numbers with carry
- 8086 program to sort an integer array in ascending order
- 8086 program to divide a 16 bit number by an 8 bit number
- 8086 program to subtract two 16-bit numbers with or without borrow
- 8086 program to multiply two 16-bit numbers
- 8086 program to determine largest number in an array of n numbers
- 8086 program to convert an 8 bit BCD number into hexadecimal number
- 8086 program to find the factorial of a number
- 8086 program to find Square Root of a number
- 8086 program to find the min value in a given array
- 8086 program to convert binary to Grey code
- 8086 program to convert 8 bit ASCII to BCD number
- 8086 program to find sum of odd numbers in a given series
- 8086 program to transfer a block of bytes by using string instruction
- 8086 program to transfer a block of 4 bytes by using string instructions
- 8086 program for selection sort
- 8086 program to find average of n numbers
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.