a. [1 mark] .data ?num1 WORD 1234h .code mov ax, ?num1 add ax, bx What is wrong with above programme? b. [2 marks] Write assembly language code to declare a variable that duplicates the value "STACK" 5 times. c. [4 marks] Use the following data definitions to answer i - iv val1 BYTE 20h val2 WORD 3000h val3 DWORD OFFFFh i. Write an instruction to negate val2 ii. Write an instruction that increments val1 iii. Write an instruction that subtracts val3 from eax iv. Write an instruction that subtracts 2FFFh from val2 d. [5 marks] Translate the following expression into assembly language. Do not allow a, b, c or d to be modified. (All values are signed double words) d = b + (c + a) e. [2 marks] array1 BYTE 3, 10, 10h, 01001011b array2 WORD 2 DUP (3 DUP (?)) i. Write assembly language code to compute the number of elements in array2. ii. How many elements are in array2?
Added by Michele H.
Close
Step 1
The first line declares a variable named "num1" and assigns it the value 1234h. Show more…
Show all steps
Your feedback will help us improve your experience
Shashank Pandey and 74 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Where indicated, write down the values of the Carry, Sign, Zero, and Overflow flags after each instruction is executed. Verify your solution by running the program using the 8086 emulator. You must include the screenshot of your program to receive credit.
Shaiju T.
Viva Questions: 1. Why subtract with carry instruction is used in the loop? 2. What is the purpose served by BX register? 3. Why subtraction is done with AL register why not with AX ? 4. What is the other instruction which can be used instead of MOV DI, offset N2 ?
Adi S.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Watch the video solution with this free unlock.
EMAIL
PASSWORD