Assembly language coding problems .

Click For Summary
The discussion revolves around coding problems related to the IAS assembly language. An electrical engineering student seeks clarification on the machine code instruction for loading the contents of memory address 2, proposing the binary code 00001001. Participants clarify that machine code and assembly language are distinct, with machine code being a binary representation and assembly using mnemonics like LOAD. The correct machine code should consist of 20 bits, combining the opcode and the memory address, and one participant suggests that the instruction may need to load into the accumulator instead. The conversation emphasizes the importance of understanding the structure of IAS instructions and the distinction between machine and assembly languages.
bengaltiger14
Messages
135
Reaction score
0
Assembly language coding problems...

Homework Statement



I am an electrical engineering student and have some HW problems. On the IAS system, what would machine code instruction look like to load the contents of memory address 2??

I came up with 00001001. Does this look correct?? Also, symbolic respresentation would be: LOAD MQ, M(0010)


Homework Equations





The Attempt at a Solution

 
Physics news on Phys.org
So for those of us who don't understand what you are asking about, but are willing to help, could you please tell us what IAS is? I've coded a lot of assembly, but I'm unfamiliar with the term IAS. But it could be some new standard that I'm not familiar with yet.

And the title of your thread says "Assembly language" but you appear to be asking about a machine language byte. Those are not the same, correct?
 


I must be using the same textbook; I am also unsure of this one. berkeman - IAS is a kind of computer that was completed in 1952 and is the prototype of all subsequent general purpose computers. It had a total of 21 instructions and 1000 words of 40 bits each for memory. Each word has a left and right instruction, 20 bits each, first 8 bits are the opcode (tells it to ADD, STOR, SUB, MUL, LOAD, etc) and last 12 bits are the address.

For the above question I came up with 000010010000000010 or LOAD reg(1), mem(2). According to the IAS instruction chart provided in the book, 00001001 is the opcode for "LOAD MQ,M(X) (transfer contents of memory location X to register MQ)". and the remaining 12 bits I assume should say "2" because that's what memory location we want?

Also, just for clarification, "machine code" refers to ones and zeros, and "Assembly Language" is using instructions like LOAD, ADD, etc?
 


annika2450 said:
I must be using the same textbook; I am also unsure of this one. berkeman - IAS is a kind of computer that was completed in 1952 and is the prototype of all subsequent general purpose computers. It had a total of 21 instructions and 1000 words of 40 bits each for memory. Each word has a left and right instruction, 20 bits each, first 8 bits are the opcode (tells it to ADD, STOR, SUB, MUL, LOAD, etc) and last 12 bits are the address.

For the above question I came up with 000010010000000010 or LOAD reg(1), mem(2). According to the IAS instruction chart provided in the book, 00001001 is the opcode for "LOAD MQ,M(X) (transfer contents of memory location X to register MQ)". and the remaining 12 bits I assume should say "2" because that's what memory location we want?
You're missing a few bits. You have only 18, not 20, bits. It helps to group them in 4s to make it easier to read and count, e.g. 0000 1001 0000 0000 0010.

It's also possible that the question is referring to load the contents at location 2 into the accumulator: LOAD M(2).
Also, just for clarification, "machine code" refers to ones and zeros, and "Assembly Language" is using instructions like LOAD, ADD, etc?
Yeah.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 122 ·
5
Replies
122
Views
16K
  • · Replies 2 ·
Replies
2
Views
15K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 12 ·
Replies
12
Views
5K
Replies
5
Views
11K
  • · Replies 6 ·
Replies
6
Views
6K
Replies
8
Views
3K
Replies
6
Views
3K