Machine Language Instructions

In summary, the conversation was about a problem involving a virtual computer called Pep/8 and the contents of the A register after the execution of an instruction. The given information included a state of memory in hexadecimal form and an instruction in the form of C1 00 01. The answer was A2 11, but the conversation did not provide enough information to determine how to get to that answer. The conversation ended with the suggestion to include op code information for future questions involving this language.
  • #1
csgirl504
18
0

Homework Statement



(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.
 
Last edited:
Physics news on Phys.org
  • #2
csgirl504 said:

Homework Statement



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.
csgirl504 said:
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.
 
  • #3
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.
 
  • #4
Sorry for the confusion! I think I figured it out. I'm not sure why I was having so much difficulty.
 
  • #5
csgirl504 said:
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.
 

1. What is machine language?

Machine language is the lowest-level programming language used by computers. It consists of binary code, which is a series of 0s and 1s that the computer can understand and execute.

2. How are machine language instructions represented?

Machine language instructions are represented in binary code, which is a series of 0s and 1s. Each instruction is made up of a specific pattern of bits that the computer interprets as a command.

3. What is the difference between machine language and assembly language?

Machine language is the binary code that directly communicates with the computer's hardware, while assembly language is a human-readable version of machine language that uses symbolic names instead of binary code. Assembly language is then translated into machine language by an assembler.

4. How do machine language instructions differ from high-level programming languages?

Machine language is the most basic form of programming and is specific to the computer's hardware, while high-level programming languages are more human-readable and require a compiler or interpreter to translate the code into machine language. High-level languages also offer more advanced features such as variables, loops, and functions.

5. Can machine language instructions be written by hand?

Technically, yes, machine language instructions can be written by hand using binary code. However, this is a very time-consuming and error-prone process, which is why high-level programming languages were developed to make programming more efficient and less prone to errors.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
977
  • Engineering and Comp Sci Homework Help
Replies
2
Views
13K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
10K
Back
Top