previous page - PiLAR index - next page

PiLAR official logo
PiLAR is a 16-bit stack-based task-oriented microprocessor. Click here for the main documentation page.

Programming reference - source assembler format.

There are 255 single-byte instruction codes, and a single-byte prefix for extended instruction codes. The latter are currently not defined and any use will generate an invalid instruction exception.

Common abbreviations:

Extra abbreviations to know what happens on the top of the stack (note: the top of the stack, not the stack context):

The instruction byte codes are defined as follows (check for microprocessor details page for details): instruction, format parameters, stack usage:

  1. NOP
  2. PUSH 1 A +(u)byte
  3. PUSH 2 A +(u)word
  4. PUSH 4 A +(u)long
  5. PUSH 1 AA +(u)byte
  6. PUSH 2 AA +(u)word
  7. PUSH 4 AA +(u)long
  8. PUSH 1 R +(u)byte
  9. PUSH 2 R +(u)word
  10. PUSH 4 R +(u)long
  11. PUSH 1 RR +(u)byte
  12. PUSH 2 RR +(u)word
  13. PUSH 4 RR +(u)long
  14. POP 1 A -(u)byte
  15. POP 2 A -(u)word
  16. POP 4 A -(u)long
  17. POP 1 AA -(u)byte
  18. POP 2 AA -(u)word
  19. POP 4 AA -(u)long
  20. POP 1 R -(u)byte
  21. POP 2 R -(u)word
  22. POP 4 R -(u)long
  23. POP 1 RR -(u)byte
  24. POP 2 RR -(u)word
  25. POP 4 RR -(u)long
  26. PUSHREF 1 -uword +(u)byte
  27. PUSHREF 2 -uword +(u)word
  28. PUSHREF 4 -uword +(u)long
  29. POPREF 1 -uword -(u)byte
  30. POPREF 2 -uword -(u)word
  31. POPREF 4 -uword -(u)long
  32. FETCH 1 -uword -word +(u)byte
  33. FETCH 2 -uword -word +(u)word
  34. FETCH 4 -uword -word +(u)long
  35. PLACE 1 -uword -word -(u)byte
  36. PLACE 2 -uword -word -(u)word
  37. PLACE 4 -uword -word -(u)long
  38. DUPLICATE 1 +(u)byte
  39. DUPLICATE 2 +(u)word
  40. DUPLICATE 4 +(u)long
  41. SWAP 1 -(u)byte -(u)byte +(u)byte +(u)byte
  42. SWAP 2 -(u)word -(u)word +(u)word +(u)word
  43. SWAP 4 -(u)long -(u)long +(u)long +(u)long
  44. ADDRESS R +uword
  45. ADDRESS RR +uword
  46. IMMEDIATE 1 N +(u)byte
  47. IMMEDIATE 2 NN +(u)word
  48. IMMEDIATE ZERO +word
  49. IMMEDIATE ONE +word
  50. IMMEDIATE TWO +word
  51. IMMEDIATE SIGN +word
  52. IMMEDIATE FOUR +word
  53. IMMEXPAND N +word
  54. INC 1 *byte
  55. INC 2 *word
  56. INC 4 *long
  57. DEC 1 *byte
  58. DEC 2 *word
  59. DEC 4 *long
  60. INCREMENT 1 AA -
  61. INCREMENT 2 AA -
  62. INCREMENT 4 AA -
  63. DECREMENT 1 AA -
  64. DECREMENT 2 AA -
  65. DECREMENT 4 AA -
  66. INCREMENT 1 R -
  67. INCREMENT 2 R -
  68. INCREMENT 4 R -
  69. DECREMENT 1 R -
  70. DECREMENT 2 R -
  71. DECREMENT 4 R -
  72. BOOLEATE 1 -(u)byte +ubyte
  73. BOOLEATE 2 -(u)word +ubyte
  74. BOOLEATE 4 -(u)long +ubyte
  75. NEGATE 1 -(u)byte +ubyte
  76. NEGATE 2 -(u)word +uword
  77. NEGATE 4 -(u)long +ulong
  78. NOT byte -byte +byte
  79. NOT word -word +word
  80. NOT long -long +long
  81. CONVERT byte TO word -byte +word
  82. CONVERT byte TO uword -byte +uword
  83. CONVERT byte TO long -byte +long
  84. CONVERT byte TO ulong -byte +ulong
  85. CONVERT word TO byte -word +byte
  86. CONVERT word TO long -word +long
  87. CONVERT word TO ulong -word +ulong
  88. CONVERT long TO byte -long +byte
  89. CONVERT long TO word -long +word
  90. ADD 1 -byte -byte +byte
  91. ADD 2 -word -word +word
  92. ADD 4 -long -long +long
  93. SUB 1 -byte -byte +byte
  94. SUB 2 -word -word +word
  95. SUB 4 -long -long +long
  96. AND 1 -byte -byte +byte
  97. AND 2 -word -word +word
  98. AND 4 -long -long +long
  99. OR 1 -byte -byte +byte
  100. OR 2 -word -word +word
  101. OR 4 -long -long +long
  102. XOR 1 -byte -byte +byte
  103. XOR 2 -word -word +word
  104. XOR 4 -long -long +long
  105. MUL byte -byte -byte +word
  106. MUL ubyte -ubyte -ubyte +uword
  107. MUL word -word -word +long
  108. MUL uword -uword -uword +ulong
  109. MUL long -long -long +long
  110. MUL ulong -ulong -ulong +ulong
  111. DIV byte -byte -byte +byte
  112. DIV ubyte -ubyte -ubyte +ubyte
  113. DIV word -word -word +word
  114. DIV uword -uword -uword +uword
  115. DIV long -long -long +long
  116. DIV ulong -ulong -ulong +ulong
  117. MOD byte -byte -byte +byte
  118. MOD ubyte -ubyte -ubyte +ubyte
  119. MOD word -word -word +word
  120. MOD uword -uword -uword +uword
  121. MOD long -long -long +long
  122. MOD ulong -ulong -ulong +ulong
  123. MIN byte -byte
  124. MIN ubyte -ubyte
  125. MIN word -word
  126. MIN uword -uword
  127. MIN long -long
  128. MIN ulong -ulong
  129. MAX byte -byte
  130. MAX ubyte -ubyte
  131. MAX word -word
  132. MAX uword -uword
  133. MAX long -long
  134. MAX ulong -ulong
  135. LOGICAL AND 1 -ubyte -ubyte +ubyte
  136. LOGICAL AND 2 -uword -uword +ubyte
  137. LOGICAL AND 4 -ulong -ulong +ubyte
  138. LOGICAL OR 1 -ubyte -ubyte +ubyte
  139. LOGICAL OR 2 -uword -uword +ubyte
  140. LOGICAL OR 4 -ulong -ulong +ubyte
  141. TEST EQ 1 -ubyte -ubyte +ubyte
  142. TEST EQ 2 -uword -uword +ubyte
  143. TEST EQ 4 -ulong -ulong +ubyte
  144. TEST NE 1 -ubyte -ubyte +ubyte
  145. TEST NE 2 -uword -uword +ubyte
  146. TEST NE 4 -ulong -ulong +ubyte
  147. TEST GT byte -byte -byte +ubyte
  148. TEST GT ubyte -ubyte -ubyte +ubyte
  149. TEST GT word -word -word +ubyte
  150. TEST GT uword -uword -uword +ubyte
  151. TEST GT long -long -long +ubyte
  152. TEST GT ulong -ulong -ulong +ubyte
  153. TEST LT byte -byte -byte +ubyte
  154. TEST LT ubyte -ubyte -ubyte +ubyte
  155. TEST LT word -word -word +ubyte
  156. TEST LT uword -uword -uword +ubyte
  157. TEST LT long -long -long +ubyte
  158. TEST LT ulong -ulong -ulong +ubyte
  159. TEST GE byte -byte -byte +ubyte
  160. TEST GE ubyte -ubyte -ubyte +ubyte
  161. TEST GE word -word -word +ubyte
  162. TEST GE uword -uword -uword +ubyte
  163. TEST GE long -long -long +ubyte
  164. TEST GE ulong -ulong -ulong +ubyte
  165. TEST LE byte -byte -byte +ubyte
  166. TEST LE ubyte -ubyte -ubyte +ubyte
  167. TEST LE word -word -word +ubyte
  168. TEST LE uword -uword -uword +ubyte
  169. TEST LE long -long -long +ubyte
  170. TEST LE ulong -ulong -ulong +ubyte
  171. BIT SET 1 -ubyte -ubyte +ubyte
  172. BIT SET 2 -uword -ubyte +uword
  173. BIT SET 4 -ulong -ubyte +ulong
  174. BIT RESET 1 -ubyte -ubyte +ubyte
  175. BIT RESET 2 -uword -ubyte +uword
  176. BIT RESET 4 -ulong -ubyte +ulong
  177. BIT CHANGE 1 -ubyte -ubyte +ubyte
  178. BIT CHANGE 2 -uword -ubyte +uword
  179. BIT CHANGE 4 -ulong -ubyte +ulong
  180. BIT TEST 1 -ubyte -ubyte +ubyte
  181. BIT TEST 2 -uword -ubyte +ubyte
  182. BIT TEST 4 -ulong -ubyte +ubyte
  183. SHIFT LEFT 1 -ubyte -ubyte +ubyte
  184. SHIFT LEFT 2 -uword -ubyte +uword
  185. SHIFT LEFT 4 -ulong -ubyte +ulong
  186. SHIFT RIGHT 1 -ubyte -ubyte +ubyte
  187. SHIFT RIGHT 2 -uword -ubyte +uword
  188. SHIFT RIGHT 4 -ulong -ubyte +ulong
  189. ROTATE LEFT 1 -ubyte -ubyte +ubyte
  190. ROTATE LEFT 2 -uword -ubyte +uword
  191. ROTATE LEFT 4 -ulong -ubyte +ulong
  192. ROTATE RIGHT 1 -ubyte -ubyte +ubyte
  193. ROTATE RIGHT 2 -uword -ubyte +uword
  194. ROTATE RIGHT 4 -ulong -ubyte +ulong
  195. COPY BLOCK -uword -uword -uword (+uword +uword +uword)
  196. COPY STRING -uword -uword -uword (+uword +uword +uword)
  197. COMPARE BLOCK -uword -uword -uword (+uword +uword +uword) +byte
  198. COMPARE STRING -uword -uword -uword (+uword +uword +uword) +byte
  199. BRANCH R -
  200. BRANCH IFTRUE R -ubyte
  201. BRANCH IFFALSE R -ubyte
  202. JUMP RR -
  203. JUMP IFTRUE RR -ubyte
  204. JUMP IFFALSE RR -ubyte
  205. COND BRANCH 1 R (-(u)byte)
  206. COND BRANCH 2 R (-(u)word)
  207. COND BRANCH 4 R (-(u)long)
  208. COND JUMP 1 RR (-(u)byte)
  209. COND JUMP 2 RR (-(u)word)
  210. COND JUMP 4 RR (-(u)long)
  211. GOTO -uword
  212. GOTO IFTRUE -uword -ubyte
  213. GOTO IFFALSE -uword -ubyte
  214. CALLREF -uword +context
  215. CALLREF 1 -uword +ubyte +uword +context
  216. CALLREF 2 -uword +uword +uword +context
  217. CALLREF 4 -uword +ulong +uword +context
  218. CALL RR +context
  219. CALL 1 RR +ubyte +ubyte +context
  220. CALL 2 RR +ubyte +uword +context
  221. CALL 4 RR +ubyte +ulong +context
  222. RETURN N -uword -context
  223. RETURN 1 N -uword -context
  224. RETURN 2 N -uword -context
  225. RETURN 4 N -uword -context
  226. ALLOCATE N +extracontext
  227. ALLOCATE NN +extracontext
  228. SYSCALL
  229. SYSCALL 1
  230. SYSCALL 2
  231. SYSCALL 4
  232. SCHEDULE
  233. SEMAPHORE NN
  234. REQUEST NN
  235. PEEK 1
  236. PEEK 2
  237. PEEK 4
  238. POKE 1
  239. POKE 2
  240. POKE 4
  241. SPECIAL

Toulouse (France), train station

previous page - PiLAR index - home page - send e-mail - next page