-
Notifications
You must be signed in to change notification settings - Fork 0
LMC Errors
In the LMC interpreter, there are several error codes that are largely unexplained to the end user. This page is an extended description of these errors, and how to solve problems you may be having with them. If you're looking for errors upon compiling an Assembly script, please refer to the "LMSC Errors" page, found here.
If you receive this error, you've likely configured your command line parameters incorrectly. This can be caused by:
- Having the input ".lms" file as the wrong argument. (Needs to be ARG1)
- Not providing an input argument (x.lms)
- Not having the specified file in your current directory/invalid filepath. When attempting to correct these, if all attempts fail, then you can modify the "lmc.js" file in the uncompiled source version to have line 16 as:
if (false) {
and then change the variable filename to the location of your file.
If this still has no solution, feel free to contact me at @c272, or create a GitHub issue with a full dump of your file and command directory.
The LittleManComputer.js interpreter only takes Assembly files compiled in the included LittleManScript Compiler (Included in source as compiler.js, or lmsc.js in newer versions). If your file was compiled with an older version of LMSC, or was not compiled at all, your file might not be compatible with jLMC and will need to be recompiled using that version's compiler. This can be done by providing the LMSC with a command line argument to a .txt file containing your Assembly script:
node lmsc.js script.txt
If you are still having issues after this, here is a list of problems that can lead to this error:
- Invalid file headers in the .LMS file (Recompile)
- Changing the file extension of the .LMS file
- Using a raw .TXT Assembly script
- Providing a file with more than one full stop in the name ("file.file.lms")
If this still has no solution, feel free to contact me at @c272, or create a GitHub issue with a full dump of your file and command directory.
This will not be provided as a code in the program, rather just an instant crash of the console window. If you're having this error, there could be a few root causes of the problem, namely:
- Not providing
nodeas an argument in the uncompiled version (script.jsinstead ofnode script.js) - Having a version of NodeJS below 6.0
- Your NodeJS installation being corrupt/incomplete/missing "fs"
Attempting to use "node lmc.js ___.lms" may fix the error, however this is extremely difficult to solve.
If this still has no solution, feel free to contact me at @c272, or create a GitHub issue with a full dump of your file and command directory.
If you've manually edited a compiled LMSC file, then this is likely a result of that. Reverting the file back to it's previous state will work most of the time. If this provides no solution, contact me at @c272 for support, or create a GitHub issue with a full dump of your file and command directory.
This means that one of the memory addresses stated in the .LMC file are out of range for the compiler, meaning either below zero or above 99. This will nearly always be due to manual editing of the file. Reverting the file back to it's previous state will work most of the time. If this provides no solution, contact me at @c272 for support, or create a GitHub issue with a full dump of your file and command directory.
The operation codes stated in .LMC files always have to be three characters long. If they aren't this error will be thrown at runtime, or at compile. This will never be implemented by the editor, and will always be due to user editing of the file. Because of this, the only solution is to revert the file back to a working state. If this provides no solution, contact me at @c272 for support, or create a GitHub issue with a full dump of your file and command directory.
When this error is thrown, go into the .LMC file and search for the address shown on screen. The opcode to the right of the address is invalid, and either needs to be changed or moved. This is most common when people place bits of data before the halt command, causing the interpreter to try and run the data slot as actual code. Place data after the halt to fix the issue, or get a valid opcode. If this provides no solution, contact me at @c272 for support, or create a GitHub issue with a full dump of your file and command directory.
This only ever occurs when the result of two numbers being added in the accumulator creates a value which is over 999. This cannot be stored in a data slot or in the accumulator, and would cause a buffer overflow in the real LMC. You can fix this by decreasing the values of the numbers being added. If this provides no solution, contact me at @c272 for support, or create a GitHub issue with a full dump of your file and command directory.
If you're trying to use the latest version of the compiler with an older interpreter, this error will be thrown, to avoid compatibility issues between different versions of files and their syntax. To fix this, you must recompile your file with an older compiler, or download the newest version of the interpreter.
Based off the work of Peter Higginson, at the UAC.