Assembly Language Assembunny Opcodes Problem

Description

5 attachmentsSlide 1 of 5attachment_1attachment_1attachment_2attachment_2attachment_3attachment_3attachment_4attachment_4attachment_5attachment_5

Unformatted Attachment Preview

Before: [2, 1, 1, 0]
56200
After: [2, 0, 1, 0]
Before: [3, 0, 3, 3]
d6264
After: [3, 1, 3, 3]
Before: [2, 2, 1, 2]
76301
After: [2, 2, 0, 2]
Before: [1, 1, 2, 1]
b6364
After: [1, 1, 0, 1]
Before: [3, 0, 3, 3]
a6301
After: [3, 0, 1, 3]
Before: [0, 2, 2, 2]
66361
After: [0, 2, 0, 2]
Before: [3, 2, 2, 0]
96201
After: [3, 3, 2, 0]
Before: [1, 1, 3, 3]
d6102
After: [2, 1, 3, 3]
Before: [2, 1, 2, 2]
56100
After: [0, 1, 2, 2]
Before: [1, 3, 2, 1]
26164
After: [2, 3, 2, 1]
Before: [2, 3, 1, 1]
26362
After: [2, 3, 4, 1]
Before: [1, 3, 2, 0]
06163
After: [3, 3, 2, 0]
Before: [1, 3, 2, 3]
36200
After: [1, 3, 2, 3]
Before: [2, 1, 3, 1]
26163
After: [5, 1, 3, 1]
Before: [0, 1, 3, 3]
d6404
After: [0, 1, 3, 4]
Before: [1, 4, 2, 3]
06462
After: [1, 4, 2, 7]
Before: [3, 1, 1, 1]
f6161
After: [9, 1, 1, 1]
Before: [3, 2, 3, 3]
e6302
After: [3, 2, 6, 3]
Before: [1, 2, 3, 2]
76332
After: [1, 2, 2, 2]
Before: [1, 1, 2, 3]
36405
After: [1, 1, 2, 7]
Before: [2, 1, 2, 3]
56101
After: [1, 1, 2, 3]
Before: [0, 1, 2, 3]
36365
After: [0, 1, 3, 3]
Before: [2, 1, 2, 2]
e6201
After: [2, 1, 2, 2]
Before: [2, 3, 3, 2]
e6404
After: [2, 3, 3, 8]
Before: [2, 1, 0, 2]
56200
After: [2, 0, 0, 2]
Before: [0, 1, 3, 1]
f6263
After: [0, 3, 3, 1]
Before: [6, 0, 6, 1]
b6163
After: [6, 0, 6, 1]
Before: [2, 2, 3, 2]
a6302
After: [2, 2, 2, 2]
Before: [0, 2, 2, 0]
96403
After: [0, 2, 2, 3]
Before: [2, 5, 2, 1]
66162
After: [5, 5, 2, 1]
Before: [3, 2, 0, 3]
e6102
After: [6, 2, 0, 3]
Before: [2, 3, 6, 0]
06361
After: [2, 3, 6, 0]
Before: [3, 1, 3, 1]
96204
After: [3, 5, 3, 1]
Before: [1, 1, 1, 2]
f6261
After: [1, 1, 1, 2]
Before: [2, 3, 0, 2]
36404
After: [2, 3, 0, 6]
Before: [3, 1, 2, 1]
a610d
After: [1, 1, 2, 1]
Before: [1, 1, 2, 2]
b6362
After: [1, 1, 0, 2]
Before: [0, 2, 1, 1]
26162
After: [2, 2, 1, 1]
Before: [3, 2, 1, 1]
76168
After: [2, 2, 1, 1]
Before: [2, 2, 3, 4]
66264
After: [2, 4, 3, 4]
— Assignment 2: Assembunny Opcodes –Looking further, you find another page in the manual. According to the manual, the device has
four registers (labeled a through d) that can be manipulated by instructions containing one of 16
opcodes.
Every instruction consists of four values: a 4 bit opcode, one 8 bit output in ASCII (called x), and
an 8 bit input which is either ASCII or hex (called y). The opcode specifies the behavior of the
instruction and how the inputs are interpreted. The output, x, is always treated as a register.
In the opcode descriptions below, if something says “value y”, it means to take the number given
as y literally. (This is also called an “immediate” value.) If something says “register y”, it means
to use the number given as y to read from (or write to) the register with that letter. So, if the
opcode add adds register x and value y, storing the result in register x, and the instruction add a
7 is encountered, it would add 7 to the value contained by register a and store the sum in register
a, never modifying registers b, c, or d in the process.
Many opcodes are similar except for how they interpret their arguments. The opcodes fall into
seven general categories:
add x,y:

Add Register stores into register x the result of adding register x and register y.

Add Immediate stores into register x the result of adding register x and value y.
imul x,y:

Signed Multiply Register stores into register x the result of multiplying register x and
register y.

Signed Multiply Immediate stores into register x the result of multiplying register x and
value y.
and x,y:

Bitwise AND Register stores into register x the result of the bitwise AND of register x
and register y.

Bitwise AND Immediate stores into register x the result of the bitwise AND of register x
and value y.
or x,y:

Bitwise OR Register stores into register x the result of the bitwise OR of register x and
register y.

Bitwise OR Immediate stores into register x the result of the bitwise OR of register x and
value y.
mov x,y:

Move Register copies the contents of register y into register x.

Move Immediate stores value y into register x.
Unfortunately, while the manual gives the name of each opcode, it doesn’t seem to indicate the
number. However, you find some print outs of example operations so you can see the contents of
the registers before and after instructions are executed to try to work them out. Each opcode has
a number from 0 through 15, but the manual doesn’t say which is which. For example, suppose
you capture the following sample:
a b c d
Before: [3, 2, 1, 1]
96202
After: [3, 4, 1, 1]
This sample shows the effect of the instruction 96301 on the registers. Before the instruction is
executed, register a has value 3, register b has value 2, and registers c and d have value 1. After
the instruction is executed, register b’s value becomes 4.
The instruction itself, 96301, means that opcode 9 was executed with x=b, and y=2. Opcode 9
could be any of the 16 opcodes listed above, but only two of them behave in a way that would
cause the result shown in the sample:

Opcode 9 could be Add Immediate: register b (which has a value of 2) plus value 2
produces 4, which matches the value stored in the output register, register b.

Opcode 9 could be Signed Multiply Immediate: register b (which has a value of 2) times
value 2 produces 4, which matches the value stored in the output register, register b.
None of the other opcodes produce the result captured in the sample. Because of this, in the
sample above 9 is either Add Immediate or Signed Multiple Immediate.
You collect many of these samples from around the warehouse.
Using the samples you collected (a2_input.txt), work out the number of each opcode and submit
the opcodes (in Octal) with their commands. Bonus points if you correctly identify the inc and
dec commands from last week.
Problem adapted from Advent of Code 2018 Day 16.
Please match the instruction with its opcode (in octal).
Group of answer choices
Add Register [ Choose ]
Add Immediate [ Choose ]
Signed Multiply Register[ Choose = ]
Signed Multiply Immediate[ Choose ]
Bitwise AND Register [ Choose ]
Bitwise AND Immediate [ Choose ]
Bitwise OR Register[ Choose ]
Bitwise OR Immediate [ Choose ]
Move Register[ Choose ]
Move Immediate[ Choose ]
Please match the instruction with its opcode (in octal).
Group of answer choices
Add Register [ Choose ]
Add Immediate [ Choose ]
Signed Multiply Register[ Choose = ]
Signed Multiply Immediate[ Choose ]
Bitwise AND Register [ Choose ]
Bitwise AND Immediate [ Choose ]
Bitwise OR Register[ Choose ]
Bitwise OR Immediate [ Choose ]
Move Register[ Choose ]
Move Immediate[ Choose ]
#
What is the code for inc?
#
What is the code for dec?

Purchase answer to see full
attachment

User generated content is uploaded by users for the purposes of learning and should be used following Studypool’s honor code & terms of service.

Reviews, comments, and love from our customers and community:

Article Writing

Keep doing what you do, I am really impressed by the work done.

Alexender

Researcher

PowerPoint Presentation

I am speechless…WoW! Thank you so much!

Stacy V.

Part-time student

Dissertation & Thesis

This was a very well-written paper. Great work fast.

M.H.H. Tony

Student

Annotated Bibliography

I love working with this company. You always go above and beyond and exceed my expectations every time.

Francisca N.

Student

Book Report / Review

I received my order wayyyyyyy sooner than I expected. Couldn’t ask for more.

Mary J.

Student

Essay (Any Type)

On time, perfect paper

Prof. Kate (Ph.D)

Student

Case Study

Awesome! Great papers, and early!

Kaylin Green

Student

Proofreading & Editing

Thank you Dr. Rebecca for editing my essays! She completed my task literally in 3 hours. For sure will work with her again, she is great and follows all instructions

Rebecca L.

Researcher

Critical Thinking / Review

Extremely thorough summary, understanding and examples found for social science readings, with edits made as needed and on time. Transparent

Arnold W.

Customer

Coursework

Perfect!

Joshua W.

Student

Leave a Reply

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

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>