Gallefray

HackyVM - Addition

Mar 28th, 2014
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. Assume we have a memory map like:
  2. > 001
  3. (Which would be reserved with `alloc 3` and then written to like `write 0b1, 2` to make it look like that)
  4. The way hacky VM will handle addition goes like:
  5. Given an input of
  6. > `add 2, 2`
  7. (these are offsets in the memory map)
  8. the memory map now looks like:
  9. > 010
  10. This opens up some interesting functionality, as you'll see.
  11.  
  12. Given a memory map that looks like
  13. > 0000111
  14. and the instruction
  15. > `add 6, 6`
  16. the memory map will now look like:
  17. > 0001110
Add Comment
Please, Sign In to add comment