xor wrote
"In line 1, unexpected end of line"
What is this about if first line in asm should be like @256 to bootstrap the hardware? Which could be the possible mistakes?
You don't need to add any bootstrap code for StackTest.
The error message that you are getting happens if CPUEmulator encounters an incomplete instruction like
D=
or
@
It gets to the end of the line while it is looking for the next part of the instruction.
Warning: for the "@" command missing its argument, or a "(" command missing its label or ")", the line number appears always to be reported as "line 1" regardless of where the error actually occurred.
P.S.: maybe I've found the mistake, but I don't know the cause. Practically in my fprintf i've putted the following asm line code: M=D-M but after the translation in the asm file appears M=M-D. How is that possible?
I don't see this happening with M=M-D / M=D-M. It does happen with M=M+D / M=D+M.
M=M-D and M=D-M generate different machine instructions, but M=M+D and M=D+M generate the same machine instruction.
When CPUEmulator loads ASM code it translates the ASM to machine instructions and loads them into the ROM. When it displays the code in the ROM panel, it disassembles the machine instructions. Therefore it cannot know if the original ASM had "M+D" or "M-D". It always displays "D+M" which is how the instruction is documented in the book.
--Mark