Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MIKRO-UN INSTRUCTION MANUAL
- Thank you for taking the time to use the
- Mikro-Un virtual computer. To compensate
- for the large instruction set and massive
- memory size, I have compiled more
- detailed information on the computer.
- The info that comes prepackaged in Mikro-Un is the following:
- "
- The computer has a built in assembler with its own assembly
- code. Below is a list of all 35 avalible commands (AAAA = Address, VV = Value):
- LDAA AAAA | LoaD A w/ Address
- LDAV VV | LoaD A w/ Value
- STOA AAAA | STore A in Address
- LDBA AAAA | LoaD B w/ Address
- LDBV VV | LoaD B w/ Value
- STOB AAAA | STore B in address
- INCA/B | INcrement A/B
- DECA/B | DEcrement A/B
- ADDI | A+B
- SUB1 | A-B
- SUB2 | B-A
- MULT | A×B
- DIV1 | A÷B - Floor Divide
- DIV2 | B÷A - Floor Divide
- MOD1 | A%B
- MOD2 | B%A
- EXP1 | A^B
- EXP2 | B^A
- SQRT | Square Root of A, rounded as integer
- BRAN AAAA | BRanch Always
- BREQ AAAA | Branch if A == B
- BRNE AAAA | Branch if A != B
- BRLT AAAA | Branch if A < B
- BRGT AAAA | Branch if A > B
- BRZE AAAA | Branch if A == 0
- BRNZ AAAA | Branch if A != 0
- INPA/B | Numerical INPut A/B
- NUOA/B | NUmerical Output A/B
- ASOA/B | ASCii Output A/B
- SWAP | SWAP A and B (a=b and b=a)
- For arithmetic, the result is stored in A. There's a random
- integer in 0xffff that changes value every instruction cycle
- too. The assembler commands outside of programming are:
- reset | Reset all of RAM to 0x0
- run | Run current program, starts from address 0x0
- program | Actually begin to program something
- ram | Displays all 65536 bytes of RAM and both registers
- mem | Displays free memory space
- back | Exits program mode
- "
- The programming instructions will only count if written in full caps, along with
- the address and value that comes after.
- The instructions also have different sizes in memory, with single, no-argument functions taking a mere byte of space, functions with a value argument taking two bytes, and functions with an address argument taking up three. The computer executes the program in the sequence of bytes from 0x0000, until the program counter reaches a 0x00 value. Programs are also stored in the same space as the variables, which means you could write self-modifying code is that's really your thing.
- On boot-up, you are presented with a small title, and an option for help, which displays brief notes of the commands, along with some OS commands too. These OS commands are the main way around the system.
- Mikro-Un's branching commands might be less obvious as compared to the arithmetic and I/O commands. The branching commands check for a given statement (preloaded for the command, so no need to add your own), then jump to the specified address.
- Do be careful when creating an infinite program, as the computer will need a hard reset (shutting down, then powering on) to stop it, which does reset all of the RAM.
- Here's an example of a program:
- 0x0 | INPA
- 0x1 | INPB
- 0x2 | ADDI
- 0x3 | NUOA
- This program will simply show the sum of 2 numbers that were inputted by the user. But be careful when you have numbers over 255, they will be set to 0 because overflow was detected.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement