aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/libLSL
diff options
context:
space:
mode:
authorAdam Frisby2007-05-03 04:34:18 +0000
committerAdam Frisby2007-05-03 04:34:18 +0000
commit57dc34b23fcc2eee74ea137d0609fc755176725c (patch)
treefefd06bea304d0dc7f234bb84d191be89927523b /libraries/libLSL
parentShellin' out a framework (diff)
downloadopensim-SC_OLD-57dc34b23fcc2eee74ea137d0609fc755176725c.zip
opensim-SC_OLD-57dc34b23fcc2eee74ea137d0609fc755176725c.tar.gz
opensim-SC_OLD-57dc34b23fcc2eee74ea137d0609fc755176725c.tar.bz2
opensim-SC_OLD-57dc34b23fcc2eee74ea137d0609fc755176725c.tar.xz
* Added NOOP, POP, POPV, POPQ, DUP, DUPV, DUPQ instructions.
* Placeholders for POPS, POPL, POPIP, POPBP, POPSP, POPSLR, DUPS, DUPL
Diffstat (limited to 'libraries/libLSL')
-rw-r--r--libraries/libLSL/lslByteCode.cs90
1 files changed, 90 insertions, 0 deletions
diff --git a/libraries/libLSL/lslByteCode.cs b/libraries/libLSL/lslByteCode.cs
index eb98773..1b37f49 100644
--- a/libraries/libLSL/lslByteCode.cs
+++ b/libraries/libLSL/lslByteCode.cs
@@ -13,27 +13,117 @@ namespace libLSL
13 byte ins = nextInstruction(); 13 byte ins = nextInstruction();
14 lslOpcodes code = (lslOpcodes)ins; 14 lslOpcodes code = (lslOpcodes)ins;
15 15
16 Object arg1;
17 Object arg2;
18
16 switch (code) 19 switch (code)
17 { 20 {
18 case lslOpcodes.OP_NOOP: 21 case lslOpcodes.OP_NOOP:
19 break; 22 break;
23
20 case lslOpcodes.OP_POP: 24 case lslOpcodes.OP_POP:
21 popBytes(4); 25 popBytes(4);
22 break; 26 break;
23 27
28 case lslOpcodes.OP_POPS:
29 case lslOpcodes.OP_POPL:
30 // Do Stuff
31 break;
32
33 case lslOpcodes.OP_POPV:
34 popBytes(12);
35 break;
36 case lslOpcodes.OP_POPQ:
37 popBytes(16);
38 break;
39
40 case lslOpcodes.OP_POPARG:
41 popBytes((Int32)arg1);
42 break;
43
44 case lslOpcodes.OP_POPIP:
45 // Do Stuff
46 break;
47
48 case lslOpcodes.OP_POPBP:
49 // Do Stuff
50 break;
51
52 case lslOpcodes.OP_POPSP:
53 // Do Stuff
54 break;
55
56 case lslOpcodes.OP_POPSLR:
57 // Do Stuff
58 break;
59
60 case lslOpcodes.OP_DUP:
61 pushBytes(getBytes(4));
62 break;
63
64 case lslOpcodes.OP_DUPS:
65 case lslOpcodes.OP_DUPL:
66 // Do Stuff
67 break;
68
69 case lslOpcodes.OP_DUPV:
70 pushBytes(getBytes(12));
71 break;
72
73 case lslOpcodes.OP_DUPQ:
74 pushBytes(getBytes(16));
75 break;
76
24 default: 77 default:
25 break; 78 break;
26 } 79 }
27 } 80 }
28 81
82 /// <summary>
83 /// Advance the instruction pointer, pull the current instruction
84 /// </summary>
85 /// <returns></returns>
29 byte nextInstruction() 86 byte nextInstruction()
30 { 87 {
31 return 0; 88 return 0;
32 } 89 }
33 90
91 /// <summary>
92 /// Removes bytes from the stack
93 /// </summary>
94 /// <param name="num">Number of bytes</param>
34 void popBytes(int num) 95 void popBytes(int num)
35 { 96 {
36 97
37 } 98 }
99
100 /// <summary>
101 /// Pushes Bytes to the stack
102 /// </summary>
103 /// <param name="bytes">Ze bytes!</param>
104 void pushBytes(byte[] bytes)
105 {
106
107 }
108
109 /// <summary>
110 /// Get Bytes from the stack
111 /// </summary>
112 /// <param name="num">Number of bytes</param>
113 /// <returns>Ze bytes!</returns>
114 byte[] getBytes(int num)
115 {
116
117 }
118
119 /// <summary>
120 /// Saves bytes to the local frame
121 /// </summary>
122 /// <param name="bytes">Ze bytes!</param>
123 /// <param name="index">Index in local frame</param>
124 void storeBytes(byte[] bytes, int index)
125 {
126
127 }
38 } 128 }
39} 129}