CSC3210 – 11/03/21 11:59 PM Solved

$ 29.99
Category:

Description

Objective: Learn memory organization/layout, data transfer concepts and instructions, direct memory access, memory allocation.

Requirements:
1. (5 points) Write an assembly program to compute the following expressions

– Create a DWORD array named β€˜z’ of size 3 using DUP operator. Leave the array β€˜z’ uninitialized. You can denote the items in the array as [𝑧!, 𝑧”, 𝑧#], where 𝑧! is the first item, 𝑧” is the second item,
𝑧# is the third item
– Update each array item using the following expressions.

𝑧! = π‘₯ + 130
𝑧” = 𝑦 + π‘₯ βˆ’ 𝑧!
𝑧# = π‘Ÿ + π‘₯ βˆ’ 13

– Where x, y, r are 16-bit integer memory variables.
– x = 10, y = 15, r = 4
– Use mov, movzx, movsx, add, sub instructions only.
– (hint: Do not alter the value of x, y and r during the computation. Transfer them to appropriate registers to do computation)
– At the end, open memory window to see the variable z stored in memory (little endian format). – If you code correctly, 𝑧! = 140 in decimal, 𝑧” = βˆ’115 in decimal, 𝑧# = 1 in decimal
– Use the debugger to verify your answer.
o Submit the following:
Β§ Rename the asm file using your last name as Lastname1.asm
Β§ Screenshot of the code and memory window showing the content of the variable z (little endian format).

2. (5 points) Use a loop instruction with indirect addressing to solve the problem.
– Do not copy the elements to any other array.
– Use the LOOP and XCHG instruction.
– The input array, inputStr contains elements: β€œA”, β€œB”, β€œC”, β€œD”, β€œE”, β€œF”, β€œG”, β€œH”.
– The array’s elements after running the program should look like: β€œH”, β€œG”, β€œF”, β€œE”, β€œD”, β€œC”, β€œB”, β€œA”.
o Submit the following:
Β§ Rename the asm file using your last name as Lastname2.asm
Β§ Screenshot of the code and memory window showing the content of the variable inputStr.

3. (5 points) Write an assembly program that does the following:
– Define the following value 0506030704080102h in the .data segment using the 64-bit unsigned identifier named qVal.
– You can subdivide the qVal value into 4 words – 0506, 0307, 4080, 0102 – Extract these words from qVal using PTR operator.
– Find the sum of the words. The sum should be D17h.
– Store the result in any 16-bit register.
– The direction of adding two words goes from left to right.
o Submit the following:
Β§ Rename the asm file using your last name as Lastname3.asm
Β§ Screenshot of the code and memory window showing the result in a 16-bit register.

Note:
Β§ Comment header for .ASM files:
Student: Full name
Class: CSC3210
Assignment#: 3
Description: This program ………….
Β§ Follow the program standards as presented in your book. Pay more attention to code comments and consistent indentation.
Β§ Create a new project for every question. Do not use one project with multiple .asm files.

Reviews

There are no reviews yet.

Be the first to review “CSC3210 – 11/03/21 11:59 PM Solved”

Your email address will not be published. Required fields are marked *