Advertisement
Guest User

new

a guest
May 19th, 2023
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.00 KB | None | 0 0
  1. MIKRO-UN INSTRUCTION MANUAL
  2.  
  3. Thank you for taking the time to use the
  4. Mikro-Un virtual computer. To compensate
  5. for the large instruction set and massive
  6. memory size, I have compiled more
  7. detailed information on the computer.
  8.  
  9. The info that comes prepackaged in Mikro-Un is the following:
  10.  
  11. "
  12. The computer has a built in assembler with its own assembly
  13. code. Below is a list of all 35 avalible commands (AAAA = Address, VV = Value):
  14.  
  15. LDAA AAAA | LoaD A w/ Address
  16. LDAV VV | LoaD A w/ Value
  17. STOA AAAA | STore A in Address
  18. LDBA AAAA | LoaD B w/ Address
  19. LDBV VV | LoaD B w/ Value
  20. STOB AAAA | STore B in address
  21. INCA/B | INcrement A/B
  22. DECA/B | DEcrement A/B
  23. ADDI | A+B
  24. SUB1 | A-B
  25. SUB2 | B-A
  26. MULT | A×B
  27. DIV1 | A÷B - Floor Divide
  28. DIV2 | B÷A - Floor Divide
  29. MOD1 | A%B
  30. MOD2 | B%A
  31. EXP1 | A^B
  32. EXP2 | B^A
  33. SQRT | Square Root of A, rounded as integer
  34. BRAN AAAA | BRanch Always
  35. BREQ AAAA | Branch if A == B
  36. BRNE AAAA | Branch if A != B
  37. BRLT AAAA | Branch if A < B
  38. BRGT AAAA | Branch if A > B
  39. BRZE AAAA | Branch if A == 0
  40. BRNZ AAAA | Branch if A != 0
  41. INPA/B | Numerical INPut A/B
  42. NUOA/B | NUmerical Output A/B
  43. ASOA/B | ASCii Output A/B
  44. SWAP | SWAP A and B (a=b and b=a)
  45.  
  46. For arithmetic, the result is stored in A. There's a random
  47. integer in 0xffff that changes value every instruction cycle
  48. too. The assembler commands outside of programming are:
  49.  
  50. reset | Reset all of RAM to 0x0
  51. run | Run current program, starts from address 0x0
  52. program | Actually begin to program something
  53. ram | Displays all 65536 bytes of RAM and both registers
  54. mem | Displays free memory space
  55. back | Exits program mode
  56. "
  57.  
  58. The programming instructions will only count if written in full caps, along with
  59. the address and value that comes after.
  60.  
  61. 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.
  62.  
  63. 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.
  64.  
  65. 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.
  66.  
  67. 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.
  68.  
  69. Here's an example of a program:
  70.  
  71. 0x0 | INPA
  72. 0x1 | INPB
  73. 0x2 | ADDI
  74. 0x3 | NUOA
  75.  
  76. 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