From d3a0cc3a8ba6dfeb64d3faeffdeb6845b60e5840 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Sat, 20 Jan 2018 15:41:49 +0100 Subject: rearranged the dir for github - removed tools and pdfs - rearranged the projects dirs - added md files - other minor changes --- projects/12/MemoryTest/Memory.vm | 258 --------------------------------------- 1 file changed, 258 deletions(-) delete mode 100644 projects/12/MemoryTest/Memory.vm (limited to 'projects/12/MemoryTest/Memory.vm') diff --git a/projects/12/MemoryTest/Memory.vm b/projects/12/MemoryTest/Memory.vm deleted file mode 100644 index 0570b46..0000000 --- a/projects/12/MemoryTest/Memory.vm +++ /dev/null @@ -1,258 +0,0 @@ -function Memory.init 0 -push constant 0 -pop static 0 -push constant 2048 -pop static 1 -push constant 0 -push static 1 -add -push constant 1 -neg -pop temp 0 -pop pointer 1 -push temp 0 -pop that 0 -push constant 1 -push static 1 -add -push constant 14334 -pop temp 0 -pop pointer 1 -push temp 0 -pop that 0 -push constant 0 -pop static 2 -push constant 0 -return -function Memory.peek 0 -push argument 0 -push static 0 -add -pop pointer 1 -push that 0 -return -function Memory.poke 0 -push argument 0 -push static 0 -add -push argument 1 -pop temp 0 -pop pointer 1 -push temp 0 -pop that 0 -push constant 0 -return -function Memory.alloc 3 -push constant 0 -pop local 0 -push argument 0 -push constant 2 -add -pop local 1 -label WHILE_EXP0 -push local 0 -push constant 1 -neg -gt -push local 0 -push constant 1 -add -push static 1 -add -pop pointer 1 -push that 0 -push local 1 -lt -and -not -if-goto WHILE_END0 -push local 0 -push static 1 -add -pop pointer 1 -push that 0 -pop local 0 -goto WHILE_EXP0 -label WHILE_END0 -push local 0 -push constant 1 -neg -eq -if-goto IF_TRUE0 -goto IF_FALSE0 -label IF_TRUE0 -push constant 34 -call String.new 1 -push constant 73 -call String.appendChar 2 -push constant 110 -call String.appendChar 2 -push constant 115 -call String.appendChar 2 -push constant 117 -call String.appendChar 2 -push constant 102 -call String.appendChar 2 -push constant 102 -call String.appendChar 2 -push constant 105 -call String.appendChar 2 -push constant 99 -call String.appendChar 2 -push constant 105 -call String.appendChar 2 -push constant 101 -call String.appendChar 2 -push constant 110 -call String.appendChar 2 -push constant 116 -call String.appendChar 2 -push constant 32 -call String.appendChar 2 -push constant 115 -call String.appendChar 2 -push constant 112 -call String.appendChar 2 -push constant 97 -call String.appendChar 2 -push constant 99 -call String.appendChar 2 -push constant 101 -call String.appendChar 2 -push constant 32 -call String.appendChar 2 -push constant 102 -call String.appendChar 2 -push constant 111 -call String.appendChar 2 -push constant 114 -call String.appendChar 2 -push constant 32 -call String.appendChar 2 -push constant 97 -call String.appendChar 2 -push constant 108 -call String.appendChar 2 -push constant 108 -call String.appendChar 2 -push constant 111 -call String.appendChar 2 -push constant 99 -call String.appendChar 2 -push constant 97 -call String.appendChar 2 -push constant 116 -call String.appendChar 2 -push constant 105 -call String.appendChar 2 -push constant 111 -call String.appendChar 2 -push constant 110 -call String.appendChar 2 -push constant 33 -call String.appendChar 2 -call String.println 1 -pop temp 0 -push constant 1 -call Sys.error 1 -pop temp 0 -push constant 1 -neg -return -goto IF_END0 -label IF_FALSE0 -push local 0 -push constant 1 -add -push static 1 -add -push local 0 -push constant 1 -add -push static 1 -add -pop pointer 1 -push that 0 -push local 1 -sub -pop temp 0 -pop pointer 1 -push temp 0 -pop that 0 -push local 0 -push local 0 -push constant 1 -add -push static 1 -add -pop pointer 1 -push that 0 -add -push constant 2 -add -pop local 2 -push local 2 -push static 1 -add -push local 0 -push static 1 -add -pop pointer 1 -push that 0 -pop temp 0 -pop pointer 1 -push temp 0 -pop that 0 -push local 0 -push static 1 -add -push local 2 -pop temp 0 -pop pointer 1 -push temp 0 -pop that 0 -push local 2 -push constant 1 -add -push static 1 -add -push argument 0 -pop temp 0 -pop pointer 1 -push temp 0 -pop that 0 -push static 1 -push local 2 -add -push constant 2 -add -return -label IF_END0 -function Memory.deAlloc 1 -push argument 0 -push static 1 -sub -push constant 2 -sub -pop local 0 -push local 0 -push static 1 -add -push constant 1 -neg -pop temp 0 -pop pointer 1 -push temp 0 -pop that 0 -push static 2 -push static 1 -add -push local 0 -pop temp 0 -pop pointer 1 -push temp 0 -pop that 0 -push local 0 -pop static 2 -push constant 0 -return -- cgit v1.2.3