CPUEmulator

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

CPUEmulator

paul23
When I try to run the CPUEmulator I get the error message 'Illegal character'. Even the simplest program with one command '@0' I get the error message. I tried indenting 0-10 spaces, and I tried the binary version of the command '0000000000000000' and I still get the error message. To run the emulator I'm using a MacBook and I type the command 'CPUEmulator.sh' into the terminal. I'm using TextEdit with Plain Text format. I named the file 'test.hack'. What am I doing wrong?
Reply | Threaded
Open this post in threaded view
|

Re: CPUEmulator

rleininger
A file containing assembly language statements must have the file extension .asm.  A file containing Hack machine language codes must have the extension .hack.  If you load a file containing assembly language instructions, but having the extension .hack, you will get the error you described.  A .hack file may contain only 16-character strings of zeros and ones.  I think each line must be left justified.

I was able to reproduce your errors by incorrect file extension use.
Reply | Threaded
Open this post in threaded view
|

Re: CPUEmulator

paul23
I tried the file name 'test.asm' and got the error message 'test.asm does not exist'.
Can I send a copy of the file?
Reply | Threaded
Open this post in threaded view
|

Re: CPUEmulator

paul23
Thanks!!! It actually worked!
Reply | Threaded
Open this post in threaded view
|

Re: CPUEmulator

paul23
Thank you.
I got 'test.hack' to work right (using 16-character strings of zeros and ones).

But I'm still having trouble with 'test.asm'.
When I tried the file name 'test.asm' (using assembly language statements) I got the error message
'test.asm does not exist'.
Reply | Threaded
Open this post in threaded view
|

Re: CPUEmulator

paul23
I got test.asm to work too!

Thanks for you help!