<commit_before># VonNeumannVM
A simple Von Neumann Virtual Machine in C++ for my Computer Architecture Course at UOI.

### Authors & Contributors

 - [<NAME>][1]

### Usage
In order to load an assembly file into the VM, simply launch it by specifying the input file as the first parameter.

    VonNeumannVM code.asm
    
After the VM is running, you have several options:

 1. View the data at a specific address in memory. To do that, simply type the decimal representation of the address you wish to view in the console, and press enter.
 2. Modify data at a specific address in memory. To do that, simply type the address you wish to modify and the data you wish to set in the following format `addr = data`, and press enter. For example: `100 = 123`. This will set the data at index `100` to `123`.
 3. Continue to the next tick. To do that, simply press enter.
 

### Notes

 - This VM has only been tested on Windows using the msvc110 compiler.<commit_msg>Better documentation in Readme.<commit_after># VonNeumannVM
A simple Von Neumann Virtual Machine in C++ for my Computer Architecture Course at UOI.

### Authors & Contributors

 - [<NAME>][1]

### Usage
In order to load an assembly file into the VM, simply launch it by specifying the input file as the first parameter.

    VonNeumannVM code.asm
    
After the VM is running, you have several options:

 - View the data at a specific address in memory. To do that, simply type the decimal representation of the address you wish to view in the console, and press enter.
 - Modify data at a specific address in memory. To do that, simply type the address you wish to modify and the data you wish to set in the following format `addr = data`, and press enter. For example: `100 = 123`. This will set the data at index `100` to `123`.
 - Continue to the next tick. To do that, simply press enter.
 
### Supported Operations

 - `load [addr]` - Load data from `[addr]` to the AC.
 - `store [addr]` - Store data from AC to `[addr]`.
 - `add [addr]` - Load data from `[addr]` to the DR, add data to AC, and write result to AC. 
 - `and [addr]` - Load data from `[addr]` to the DR, AND data with AC, and write result to AC. 
 - `jump [addr]` - Sets the PC to `[addr]`.
 - `jumpz [addr]` - If the data in the AC is Zero, sets the PC to `[addr]`.
 - `comp` - Complements the data in the AC.
 - `rshift` - Right shifts the data in the AC by 1.

### Glossary

 - `AC` - Accumulator
 - `ALU` - Arithmetic Logic Unit
 - `AR` - Address Register
 - `CPU` - Central Processing Unit
 - `DR` - Data Register
 - `IR` - Instruction Register
 - `PC` - Program Counter
 - `MEM` - Main Memory
 - `MX` - Multiplexer

### Example Program

    load 100h
    add 101h
    store 102h
    
This little program will load the data from address 0x0100 of the Main Memory to the Accumulator, it will add to it the data on address 0x0101, and then save the result to address 0x0102. 
 
### Notes

 - This VM has only been tested on Windows using the msvc110 compiler.
{'fraction_non_alphanumeric': 0.08210947930574099, 'fraction_numerical': 0.020026702269692925, 'mean_word_length': 3.239038189533239, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '276593', 'n_tokens_mistral': 919, 'n_tokens_neox': 829, 'n_words': 484}