Register to reply

Machine Language Instructions

by csgirl504
Tags: instructions, language, machine
Share this thread:
csgirl504
#1
Oct31-11, 11:49 PM
P: 19
1. The problem statement, all variables and given/known data

(the language is Pep/8)

Given the following state of memory (in hexadecimal) match the problem to the solution shown:

0001 A2
0002 11
0003 00
0004 FF

What are the contents of the A register after the execution of this instruction?

C1 00 01

I know that the answer is A2 11

But I have NO idea how to get there. I tried reading the book, but none of it makes sense. My teacher gave the answer to this, but she never explained how to get it.

I know to write out C1 00 01 as

1100 0001 0000 0000 0000 0001

But I have absolutely no clue how you get A2 11 from that.

Please explain! I am so confused.
Phys.Org News Partner Science news on Phys.org
Experts defend operational earthquake forecasting, counter critiques
EU urged to convert TV frequencies to mobile broadband
Sierra Nevada freshwater runoff could drop 26 percent by 2100
Mark44
#2
Nov1-11, 12:23 AM
Mentor
P: 21,311
Quote Quote by csgirl504 View Post
1. The problem statement, all variables and given/known data

Given the following state of memory (in hexadecimal) match the problem to the solution shown:

0001 A2
0002 11
0003 00
0004 FF

What are the contents of the A register after the execution of this instruction?

C1 00 01

I know that the answer is A2 11
But we have no way of knowing this, since you haven't given us all the information that was presented to you.

What I see looks like it might be the contents of memory locations 1 through 4, following my a machine language instruction. I'm guessing that C1 is an op code for something, and the operands are memory locations 1 and 2.

If you want us to help you decipher this, you need to give us all of the information of this problem, otherwise we're just as lost as you are.
Quote Quote by csgirl504 View Post

But I have NO idea how to get there. I tried reading the book, but none of it makes sense. My teacher gave the answer to this, but she never explained how to get it.

I know to write out C1 00 01 as

1100 0001 0000 0000 0000 0001

But I have absolutely no clue how you get A2 11 from that.

Please explain! I am so confused.
csgirl504
#3
Nov1-11, 12:37 AM
P: 19
Sorry,

I forgot to say that the language is Pep/8 (virtual computer). Not sure if that tells you anything, but that is the whole problem.

I am given 5 answer choices:

a. A2 11
b. A2 12
c. 00 02
d. 11 00
e. 00 FF

And I know the answer is A. That's all the information I have. The problem comes from my textbook, at the end of a chapter on Machine Language, specifically focusing on Pep/8.

csgirl504
#4
Nov1-11, 01:04 AM
P: 19
Machine Language Instructions

Sorry for the confusion! I think I figured it out. I'm not sure why I was having so much difficulty.
Mark44
#5
Nov1-11, 09:31 AM
Mentor
P: 21,311
Quote Quote by csgirl504 View Post
Sorry,

I forgot to say that the language is Pep/8 (virtual computer). Not sure if that tells you anything, but that is the whole problem.

I am given 5 answer choices:

a. A2 11
b. A2 12
c. 00 02
d. 11 00
e. 00 FF

And I know the answer is A. That's all the information I have. The problem comes from my textbook, at the end of a chapter on Machine Language, specifically focusing on Pep/8.
I know that you have already figured this out, but for future reference, if you have any other questions involving this language, be sure to include information about the op codes. For this problem, there must be some information in the same chapter or in the appendix, explaining what op codes such as C1 mean.


Register to reply

Related Discussions
Machine language program is the fastest? Programming & Computer Science 14
Help with converting machine language instruction into MIPS assembly instruction Programming & Computer Science 9
How many instructions are there ? Computing & Technology 83