-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstructions.txt
84 lines (70 loc) · 4.47 KB
/
instructions.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
###########################################################
************** List of Instructions for PISS **************
###########################################################
pop8 Pops 1 byte from top of stack
pop32 Pops 4 bytes from top of stack
pop64 Pops 8 bytes from top of stack
ipush(int) Push 4 bytes int to top of stack
iadd Pops two and pushes their sum
isub Pops two and pushes their difference
imult Pops two and pushes their multiple
idiv Pops two and pushes their divisor
imod Pops two and pushes their modulo
iprint Print top of stack
fpush(float) Push 4 bytes float to top of stack
fadd Pops two and pushes their sum
fsub Pops two and pushes their difference
fmult Pops two and pushes their multiple
fdiv Pops two and pushes their divisor
fprint Print top of stack
cpush(char) Push 1 byte char to top of stack
cadd Pops two and pushes their sum
csub Pops two and pushes their difference
cmult Pops two and pushes their multiple
cdiv Pops two and pushes their divisor
cmod Pops two and pushes their modulo
cprint Print top of stack as ASCII char
ciprint Print top of stack as 8-bit integer
ppush(ident) Push address of datasection onto stack
pload(i) Loads address of local to top of stack
pderef8 Dereference 1 byte pointer and push to top of stack
pderef32 Dereference 4 byte pointer and push to top of stack
pderef64 Dereference 8 byte pointer and push to top of stack
pderef(n) Dereference n byte pointer and push to top of stack
pset8 Dereference and set 1 byte using the address at top of stack
pset32 Dereference and set 4 byte using the address at top of stack
pset64 Dereference and set 8 byte using the address at top of stack
pset(n) Dereference and set n byte using the address at top of stack
jump(label) Jumps to address in memory
jumpcmp(label) Jumps if top of stack is non-zero
jumpproc(label, nargs) Enters procedure with new stackframe, pushing the call
location onto return stack and initializing with n bytes on top of stack
clt Compares top two values and pushes non-zero if first is less than,
and zero otherwise
cle Compares top two values and pushes non-zero if first is less than
or equal, and zero otherwise
ceq Compares top two values and pushes non-zero if first is equal,
and zero otherwise
cgt Compares top two values and pushes non-zero if first is greater than,
and zero otherwise
cge Compares top two values and pushes non-zero if first is greater than
or equal, and zero otherwise
dupe8 Duplicates 8 byte element at top of stack
dupe32 Duplicates 32 byte element at top of stack
dupe64 Duplicates 64 byte element at top of stack
swap8 Swap top two 8 byte elements
swap32 Swap top two 32 byte elements
swap64 Swap top two 64 byte elements
copy8(n) Copies n 8 byte elements from top of stack
copy32(n) Copies n 32 byte elements from top of stack
copy64(n) Copies n 64 byte elements from top of stack
ret resume execution
ret8(i) Push 1 byte at index onto return stack and resuming execution
ret32(i) Push 4 bytes at index onto return stack and resuming execution
ret64(i) Push 8 bytes at index onto return stack and resuming execution
store8(i) Store 1 byte object to stack frame
store32(i) Store 4 byte object to stack frame
store64(i) Store 8 byte object to stack frame
load8(i) Load 1 byte object to top of stack
load32(i) Load 4 byte object to top of stack
load64(i) Load 8 byte object to top of stack