Question

Write a 32-bit x86 assembly program that performs the following operations: Part 1: Swaps content of EBX as follows: Requirement: Store 'A' in EBX LSB or BL, store 'B' in BH, and then swap BL and BH. You will have to use a temporary storage, you can use EAX (use AL) or any storage you may define. For example: Content of EBX at init: 00000000, then after storing A and B: EBX = 00004241; 4241-ASCII codes in Hex After swapping: EBX - 00004142 which is BA Part 2: Create 2 Arrays, Array1 and Array2 -Initialize Array1 as: 1, 2, 3, 4, and Array_2 to 0,0,0,0 (must use the DUP instruction) Requirement: Copy content of Array 1 to array 2 in a reverse order. i,e: For example: Array1 = 1, 2, 3, 4 After program run: Array2 = 4, 3, 2, 1, Array_1 is unchanged, content are taken from array1 to array 2

          Write a 32-bit x86 assembly program that performs the following operations:
Part 1: Swaps content of EBX as follows:
Requirement: Store 'A' in EBX LSB or BL, store 'B' in BH, and then swap BL and BH. You will have to use a temporary storage, you can use EAX (use AL) or any storage you may define.
For example: Content of EBX at init: 00000000, then after storing A and B: EBX = 00004241; 4241-ASCII codes in Hex
After swapping: EBX - 00004142 which is BA
Part 2: Create 2 Arrays, Array1 and Array2
-Initialize Array1 as: 1, 2, 3, 4, and Array_2 to 0,0,0,0 (must use the DUP instruction)
Requirement: Copy content of Array 1 to array 2 in a reverse order. i,e:
For example: Array1 = 1, 2, 3, 4 After program run: Array2 = 4, 3, 2, 1, Array_1 is unchanged, content are taken from array1 to array 2
        
Show more…
Write a 32-bit x86 assembly program that performs the following operations:
Part 1: Swaps content of EBX as follows:
Requirement: Store 'A' in EBX LSB or BL, store 'B' in BH, and then swap BL and BH. You will have to use a temporary storage, you can use EAX (use AL) or any storage you may define.
For example: Content of EBX at init: 00000000, then after storing A and B: EBX = 00004241; 4241-ASCII codes in Hex
After swapping: EBX - 00004142 which is BA
Part 2: Create 2 Arrays, Array1 and Array2
-Initialize Array1 as: 1, 2, 3, 4, and Array2 to 0,0,0,0 (must use the DUP instruction)
Requirement: Copy content of Array 1 to array 2 in a reverse order. i,e:
For example: Array1 = 1, 2, 3, 4 After program run: Array2 = 4, 3, 2, 1, Array1 is unchanged, content are taken from array1 to array 2

Added by Ricardo T.

Close

Computer Science and Information Technology
Computer Science and Information Technology
Trishna Knowledge Systems 2018 Edition
AceChat toggle button
Close icon
Ace pointing down

Please give Ace some feedback

Your feedback will help us improve your experience

Thumb up icon Thumb down icon
Thanks for your feedback!
Profile picture
PLEASE WRITE THIS IN C++WITH CODE SHOWING IT WORKS Write a 32-bit x86 assembly program that performs the following operations: Part 1: Swaps content of EBX as follows: For example: Content of EBX at init: 00000000, then after storing A and B: EBX=00004241;4241=ASCII codes in Hex After swapping: EBx=00004142 which is BA Part 2: Create 2 Arrays, Array1 and Array2 -Initialize Array1 as: 1, 2, 3, 4, and Array_2 to 0,0,0,0 (must use the DUP instruction) Requirement: Copy content of Array 1 to array 2 in a reverse order, i,e: For example: Array1 = 1, 2, 3, 4 After program run: Array2 = 4, 3, 2, 1, Array_1 is unchanged, content are taken from array1 to array 2 OP Write a 32-bit x86 assembly program that performs the following operations: Part 1: Swaps content of EBX as follows: Requirement: Store 'A' in EBX LSB or BL, store B' in BH, and then swap BL and BH. You will have to use a temporary storage, you can use EAX (use AL) or any storage you may define. For example: Content of EBX at init: 00000000, then after storing A and B: EBX =00004241 : 4241=ASCII codes in Hex After swapping: EBX = 00004142which is BA Part 2: Create 2 Arrays, Array1 and Array2 -Initialize Array1 as: 1, 2, 3, 4, and Array_2 to 0,0,0,0 (must use the DUP instruction) Requirement: Copy content of Array 1 to array 2 in a reverse order, i,e: For example: Array1 = 1, 2, 3, 4After program run: Array2 = 4, 3, 2, 1, Array _1 is unchanged, content are taken from array1 to array 2
Close icon
Play audio
Feedback
Powered by NumerAI
Jennifer Stoner Danielle Fairburn
Ivan Kochetkov verified

Akash M and 56 other subject AP CS educators are ready to help you.

Ask a new question

*

Labs

-

Want to see this concept in action?

NEW

Explore this concept interactively to see how it behaves as you change inputs.

View Labs

*

Key Concepts

-
Key Concept
Premium Feature
Explore the core concept behind this problem.
Play button
Key Concept
Premium Feature
Explore the core concept behind this problem.
Your browser does not support the video tag.

*

Recommended Videos

-
for-this-programming-assignment-you-should-only-use-these-instructions-1-mov-regularstandard-move-2-add-3-sub-operands-for-instructions-should-be-registers-or-memory-locations-an-exception-i-64672

For this programming assignment, you should ONLY use these instructions: 1) mov (regular/standard move) 2) add 3) sub Operands for instructions should be registers or memory locations. An exception is that you can use the immediate values 0, 1, -1, 0Fh, or 0FFh where it would make sense. For phase 2, you need to store the contents of var1, var2, var3, and var4 altogether in register eax. More specifically, var1 will be stored in the highest byte of eax, var2 will be stored in the second highest byte, var3 will be stored in the second lowest byte, and var4 will be stored in the lowest byte. HINT: Think about how add instructions could be used to achieve shifting. For example, suppose we have the following 8-bit binary number: 00000011 After shifting this binary number two times to the left, we have: 00001100 PHASE 3: 1) Subtract the number from 15 2) Add 1 For example, the 'D' (44h) is stored in the highest byte of eax, so the two's complement of 44h will be stored in the highest byte of ebx. The two's complement of 44h is: 1) 15 - 4 = B (11) and 15 - 4 = B (11) So we get BBh after step 1 After phase 3 is completed, register ebx should look like this: Phase 3 is approximately twenty-one (21) instructions PROGRAM FINAL OUTPUTS To recap, this is what you should have after the entire program is finished:

Akash M.

the-above-image-contains-a-series-of-assembly-instructions-a-list-of-registers-and-their-values-and-a-small-memory-snapshot-for-each-assembly-instruction-1-7-record-any-changes-that-will-occ-56741

The above image contains a series of assembly instructions, a list of registers and their values, and a small memory snapshot. For each assembly instruction (1-7), record any changes that will occur to memory or to a register value when the instruction is invoked. The instructions are performed on a little-endian system. For example, with this instruction: mov eax,0ah The answer should be: The eax register would change from 0xFFCC5665 to 0x0000000a. Note that the instructions are cumulative, so that changes to a register or updates made to data in a memory location persist across subsequent instructions. Make sure you state the values before and after the instruction for each part. Be clear when specifying values in either hexadecimal or as bytes in memory by making sure to take the endianness of the value into consideration.

Akash M.

assume-you-are-given-an-array-of-four-16-bit-numbers-stored-in-memory-with-a-starting-address-x3110-using-pc-relative-addressing-write-an-lc-3-machine-language-program-that-will-copy-the-sam-28813

Assume you are given an array of four 16-bit numbers stored in memory with a starting address x3110. Using PC-relative addressing, write an LC-3 machine language program that will copy the same four 16-bit numbers in reverse order, starting at memory address x3120. For example, if the following are the four 16-bit values stored in x3110, x3110 12 x3111 23 x3112 34 x3113 45 then the result of your program execution should write the following starting at memory address x3120: x3120 45 x3121 34 x3122 23 x3123 12 Load your program starting at address x3100. You will need to demonstrate the correct execution of your program by using the LC-3 Simulator.

Akash M.


*

Recommended Textbooks

-
Computer Science and Information Technology

Computer Science and Information Technology

Trishna Knowledge Systems 2018 Edition
achievement 1,095 solutions
Introduction to Programming Using Python

Introduction to Programming Using Python

Y. Daniel Liang 1st Edition
achievement 1,843 solutions
Computer Science - An Overview

Computer Science - An Overview

Glenn Brookshear, Dennis Brylow 12th Edition
achievement 1,659 solutions

*

Transcript

-
00:01 Hello, here we are with the answers to the given question.
00:03 Let's start the discussion to deal with the answers.
00:08 In the given scenario, it is considered a particular kind of program and this program will be having making use of three instructions and the kind of commands that it will be using would be taking into consideration four variables and it is being made in three phases.
00:40 So let's have a look on to these right now.
00:43 Coming to the three instructions that we use, it involves move, add and sub.
00:59 These are the three instructions.
01:03 Taking you to the next case that is the variables.
01:09 The number of variables used here are four...
Need help? Use Ace
Ace is your personal tutor. It breaks down any question with clear steps so you can learn.
Start Using Ace
Ace is your personal tutor for learning
Step-by-step explanations
Instant summaries
Summarize YouTube videos
Understand textbook images or PDFs
Study tools like quizzes and flashcards
Listen to your notes as a podcast
Continue solving this problem
Create a free account to:
  • View full step-by-step solution
  • Ask follow-up questions with Ace AI
  • Save progress and study later
Continue Free
Numerade

Get step-by-step video solution
from top educators

Continue with Clever
or



By creating an account, you agree to the Terms of Service and Privacy Policy
Already have an account? Log In

A free answer
just for you

Watch the video solution with this free unlock.

Numerade

Log in to watch this video
...and 100,000,000 more!


EMAIL

PASSWORD

OR
Continue with Clever