Value of "a" in C-instruction

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Value of "a" in C-instruction

steven
The book mentions (p. 109) a value named "a" that is a bit in a C-instruction.

A chart is given that is based on the value of "a" being either a 1 or a 0.

The same chart appears in chapter 4 as well as a description of the instruction.

Would you please provide some info as to how it can be determined?
Reply | Threaded
Open this post in threaded view
|

Re: Value of "a" in C-instruction

culchie
The full format of a C-instruction in assembly language is :
dest=comp;jump
Sometimes there might be no destination and the instruction would be comp;jump
or there might be no jump and the instruction would be dest=comp
finally there might be no destination or jump and the instruction would be  comp

In all cases it is the contents of the comp section, alone, that determines whether the "a" bit is 0 or 1

If there is an M in the comp section the "a" bit should be a 1, otherwise it is 0

So for M=D+A , M=D-1 , D=!D , D;JMP and D-1 the bit would be a 0,


but  for

M=D+M 
A=D+M 
M;JMP 
M-1
the bit should be a 1