Shaqywacky wrote
I created the whole circuit in a different program than the one with the book and I was testing an assembler I created and I noticed that If I try to put in negative numbers I don't get what I expect. This is because the 16th(MSB) is used to signify A or C-instructions. Thus for A instructions it must be 0, which obviously will never allow negative numbers.
Did I just miss the part where the book said the ALU(and registers) were 15 bit?
Thank you.
The ALU and registers are 16-bit, and the MSB is the sign bit. The A instructions only allow positive numbers. To load a negative number into the A- or D-register you need to use
@1234
A=-A or D=-A
Your assembler should reject negative numbers on A commands.
Note that the C-instructions can load -1 directly as in
D=-1
Also note that the convention in the book is to number the bits 0 through 15 starting with the LSB = bit 0.
--Mark