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 to a constant called first 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 var from var then places the result in answer. Declare all three variables in the data segment as words. Initialise var as H and var as H
Save the source file as direct.s
Register Indirect Addressing
Declare an array that contains the numbers: 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 tols
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. Eg do not change the contents of the SI register.
Save the source file as indexed.s
Based Relative Addressing
Copy the top 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 dxH
push dx
mov dx OABCDH
push dx
Save the source file as based.s
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
