Sun, 11 September 2016, 18:33

A student writes, as shown below.  Initially I was not going to send
this to all of you because it is so fundamental to EE306 that I thought
you all knew it.  Just to be sure, I decided to send it to you.

> Hi Dr. Patt,
> I had a confusion regarding pseudo ops.  In the lab assignment
> I see that binary is generated even for .FILL.
> For example:- .FILL x4096    --> x4096
> But if we do such one to one conversion, the resultant binary
> may match with some other instruction. How will the simulator
> understand that is it a .FILL or some other command?
> Having said that, can u tell that if we need to generate binary
> for .FILL?
> Thanks
> <<name withheld to protect the student who missed the most
> fundamental of principles about the von Neumann machine.

The short answer is the 16 bits could be data or an instruction and
the computer would not know (or care) which.  For example, .FILL x1283
and ADD R1,R2,R3 will both result in x1283 being put into the
corresponding memory location.  ADD R1,R2,R3 is 0001 001 010 0 00 011,
which is x1283.

Yes, you need to generate binary for .FILL pseudo-ops.

Suppose x1283 is in location x4000.  If the PC contains x4000, x1283
will be treated as an ADD instruction.  Suppose PC contains the
address of the instruction LDW R1,R2,x0000, and R2 contains x4000.
Then x1283 will be treated like a piece of data that gets loaded into

This is a very fundamental concept of von Neumann machines, and
something you should have learned in EE306.  Did you take EE306?

Good luck finishing the program tonight.

Yale Patt