Question: Register addressing Write a program register.s that adds register AH to register AL , only use the values that are currently in these registers. Save

Register addressing
Write a program register.s that adds register AH to register AL , only use the values that are currently in these registers.
Save the source file as reg.s
Immediate Addressing
Write a program immediate.s that adds the number 5 to a constant called first1. Note that this arithmetic must take place in a register.
Save the source file as imm.s
Direct Addressing
Write a program direct.s that subtracts var2 from var1, then places the result in answer. Declare all three variables in the data segment as words. Initialise var1 as 3231 H and var2 as 2217 H .
Save the source file as direct.s
Register Indirect Addressing
Declare an array that contains the numbers: \(1,2,3,4\)(byte size). Use BX to point to the first array element initially. Subtract the second array element from the first, and store the result in the fourth element. Use the INC and DEC commands to change the array element that is pointed to.ls
Save the source file as indirect.s
Indexed Relative Addressing
Repeat the previous problem, but use SI to point to the first array element. Use indexed addressing with a displacement value to access other array elements. E.g. do not change the contents of the SI register.
Save the source file as indexed.s
Based Relative Addressing
Copy the top 2 words from the stack into registers \( A X \) and \( C X \) respectively. Do this without changing the stack pointer do not use POP instructions! Use BP as the base register. How will your program know what value to place in BP?
To ensure that the stack contains some known values, place the following code at the beginning of your program:
```
mov dx,1234H
push dx
mov dx, OABCDH
push dx
```
Save the source file as based.s
Register addressing Write a program register.s

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!