scottpiersall / sicvm Goto Github PK
View Code? Open in Web Editor NEWA SIC Virtual Machine, Emulator Assembler, loader, and Linker
A SIC Virtual Machine, Emulator Assembler, loader, and Linker
Create a new button in the memory table which displays the table in decimal.
Place it alongside the hex and binary buttons.
I loaded my .obj file and it won't let me step through my program. I think it went straight to the end of my program because my program counter is at 26 and there are other values in my registers. I tried to set the value of the program counter using Machine
then Set program counter to ,but it did not do anything.
Make the binary memory view button work
Instructions I have encountered that do not handle bytes:
WD
COMP
ADD
Basically anything a byte touches, breaks.
Only time it seems to work is for bytes in sets of 3
Disclaimer: enhancement, not bug
The run button appears to occupy the entirety of the program's processing, leading to crashes if anything loops, and long periods of time where the application window is unusable.
If multithreading is possible, maybe it would be doable to keep the window functioning properly while the code is running.
Other useful features that could go along with this would be a visual indicator showing that the code is in the process of running, and/or a stop button.
For things that are constant in the CPU, such as CC max (binary 11) we can use constant literals to make code easier to digest for new contributors.
Example:
// definition
public const byte CC_Max = 0b11 << 6;
// OR
public const byte CC_Max = 0b11000000;
//
// later in the code
//
case 0x30: // JEQ
if ((SW & CC_Max) == 0)
{
PC = TA;
}
else { this.PC += 3; }
break;
Alternatively, we can consider making them static and initializing them using their actual values, e.g.
public static byte CC_Max = 0b11;
and later either translate them as needed or simply doing the conversion during the declaration, not sure, we can get creative.
If you try to use resb, resw, word, or byte anywhere that the program counter reaches, it leads to unintentional behavior and sometimes stalls the machine.
My guess as to why this happens is it tries to run the contents of the reserved memory as if they were opcodes, when it should instead get skipped over.
For now, this is avoidable by placing all reserved memory in places that are bypassed with J, JGT, JEQ, or JLT.
JEQ does not jump on CC is equal to.
JEQ jumps when CC is 10 | 01, making the only case where it doesn't jump, when cc = 0.
Currently you can only see the next instruction on the panel on the top right. It would be extremely useful to know what instruction we are currently on.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.