8-appendix.tex 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. \subsection{Processor instruction set tables}\label{subsec:instruction_sets}
  2. \arrayrulecolor{black}
  3. \begin{longtable}[h!]{| l | p{.70\textwidth} | c |}
  4. \caption{Instruction set for RISC processor. * Required immediate size in bytes}
  5. \label{tab:risc_instructions}\\
  6. \hline
  7. \rowcolor[rgb]{0.82,0.82,0.82}
  8. Instr. & Description & I-size *\\\hline
  9. \endhead
  10. \arrayrulecolor{black}\hline
  11. \endfoot
  12. \multicolumn{3}{|c|}{
  13. \cellcolor[rgb]{0.7,0.7,1}\textit{2 register instructions}} \\\hline
  14. \arrayrulecolor[rgb]{0.82,0.82,0.82}
  15. MOVE & Copy value from one register to other & 0 \\\hline
  16. ADD & Arithmetical addition & 0 \\
  17. SUB & Arithmetical subtraction & 0 \\
  18. AND & Logical AND & 0 \\
  19. OR & Logical OR & 0 \\
  20. XOR & Logical XOR & 0 \\
  21. MUL & Arithmetical multiplication & 0 \\
  22. DIV & Arithmetical division (inc. modulus) & 0 \\
  23. \arrayrulecolor{black}\hline
  24. \multicolumn{3}{|c|}{
  25. \cellcolor[rgb]{0.7,0.7,1}\textit{1 register instructions}} \\
  26. \hline\arrayrulecolor[rgb]{0.82,0.82,0.82}
  27. COPY0 & Copy intimidate to a register 0 & 1 \\
  28. COPY1 & Copy intimidate to a register 1 & 1 \\
  29. COPY2 & Copy intimidate to a register 2 & 1 \\
  30. COPY3 & Copy intimidate to a register 3 & 1 \\\hline
  31. ADDC & Arithmetical addition with carry bit& 0 \\
  32. ADDI & Arithmetical addition with immediate & 1 \\
  33. SUBC & Arithmetical subtraction with carry bit & 0 \\
  34. SUBI & Arithmetical subtraction with immediate & 1 \\\hline
  35. ANDI & Logical AND with immediate & 1 \\
  36. ORI & Logical OR with immediate & 1 \\
  37. XORI & Logical XOR with immediate & 1 \\\hline
  38. CI0 & Replace intimidate value byte 0 for next instruction & 1 \\
  39. CI1 & Replace intimidate value byte 1 for next instruction & 1 \\
  40. CI2 & Replace intimidate value byte 2 for next instruction & 1 \\\hline
  41. SLL & Shift left logical & 1 \\
  42. SRL & Shift right logical & 1 \\
  43. SRA & Shift right arithmetical & 1 \\\hline
  44. LWHI & Load word (high byte) & 3 \\
  45. SWHI & Store word (high byte, reg. only) & 0 \\
  46. LWLO & Load word (low byte) & 3 \\
  47. SWLO & Store word (low byte, stores high byte reg.) & 3 \\\hline
  48. INC & Increase by 1 & 0 \\
  49. DEC & Decrease by 1 & 0 \\
  50. GETAH& Get ALU high byte reg. (only for MUL \& DIV \& ROL \& ROR) & 0 \\
  51. GETIF& Get interrupt flags & 0 \\\hline
  52. PUSH & Push to stack & 0 \\
  53. POP & Pop from stack & 0 \\
  54. COM & Send/Receive to/from com. block & 1 \\\hline
  55. BEQ & Branch on equal & 3 \\
  56. BGT & Branch on greater than & 3 \\
  57. BGE & Branch on greater equal than & 3 \\
  58. BZ & Branch on zero & 2 \\
  59. \arrayrulecolor{black}\hline
  60. \multicolumn{3}{|c|}{
  61. \cellcolor[rgb]{0.7,0.7,1}\textit{0 register instructions}
  62. } \\
  63. \hline\arrayrulecolor[rgb]{0.82,0.82,0.82}
  64. CALL & Call function, put return to stack & 2 \\
  65. RET & Return from function & 0 \\
  66. JUMP & Jump to address & 2 \\
  67. RETI & Return from interrupt & 0 \\
  68. INTRE& Set interrupt entry pointer & 2 \\\hline
  69. \end{longtable}
  70. \arrayrulecolor{black}
  71. \begin{longtable}[h!]{| l | p{0.8\textwidth} |}
  72. \caption{Instructions for OISC processor.}
  73. \label{tab:oisc_instructions}\\
  74. \hline
  75. \rowcolor[rgb]{0.82,0.82,0.82}
  76. Name & Description \\\hline
  77. \endhead
  78. \arrayrulecolor{black}\hline
  79. \endfoot
  80. \multicolumn{2}{|c|}{
  81. \cellcolor[rgb]{0.7,0.7,1}\textit{Destination Addresses}} \\\hline
  82. \arrayrulecolor[rgb]{0.82,0.82,0.82}
  83. ACC0 & Set ALU source A accumulator \\
  84. ACC1 & Set ALU source B accumulator \\\hline
  85. BR0 & Set Branch pointer register (low byte) \\
  86. BR1 & Set Branch pointer register (high byte) \\
  87. BRZ & If source value is 0, set program counter to branch pointer \\\hline
  88. STACK& Push value to stack \\
  89. MEM0 & Set Memory pointer register (low byte) \\
  90. MEM1 & Set Memory pointer register (middle byte) \\
  91. MEM2 & Set Memory pointer register (high byte) \\
  92. MEMHI& Save high byte to memory at memory pointer \\
  93. MEMLO& Save low byte to memory at memory pointer \\\hline
  94. COMA & Set communication block address register \\
  95. COMD & Send value to communication block \\\hline
  96. REG0 & Set general purpose register 0 \\
  97. REG1 & set general purpose register 1 \\
  98. \arrayrulecolor{black}\hline
  99. \multicolumn{2}{|c|}{
  100. \cellcolor[rgb]{0.7,0.7,1}\textit{Source Addresses}} \\\hline
  101. \arrayrulecolor[rgb]{0.82,0.82,0.82}
  102. NULL & Get constant 0 \\
  103. ALU0 & Get value at ALU source A accumulator \\
  104. ALU1 & Get value at ALU source B accumulator \\\hline
  105. ADD & Get Arithmetical addition of ALU sources \\
  106. ADDC & Get Arithmetical addition carry \\
  107. ADC & Get Arithmetical addition of ALU sources and carry \\\hline
  108. SUB & Get Arithmetical subtraction of ALU sources \\
  109. SUBC & Get Arithmetical subtraction carry \\
  110. SBC & Get Arithmetical subtraction of ALU sources and carry \\\hline
  111. AND & Get Logical AND of ALU sources \\
  112. OR & Get Logical OR of ALU sources \\
  113. XOR & Get Logical XOR of ALU sources \\\hline
  114. SLL & Get ALU source A shifted left by source B \\
  115. SRL & Get ALU source A shifted right by source B \\
  116. ROL & Get rolled off value from previous SLL instance \\
  117. ROR & Get rolled off value from previous SRL instance \\\hline
  118. MULLO& Get Arithmetical multiplication of ALU sources (low byte) \\
  119. MULHI& Get Arithmetical multiplication of ALU sources (high byte) \\
  120. DIV & Get Arithmetical division of ALU sources \\
  121. MOD & Get Arithmetical modulus of ALU sources \\\hline
  122. EQ & Check if ALU source A is equal to source B \\
  123. GT & Check if ALU source A is greater than source B \\
  124. GE & Check if ALU source A is greater or equal to source B \\
  125. NE & Check if ALU source A is not equal to source B \\
  126. LT & Check if ALU source A is less than source B \\
  127. LE & Check if ALU source A is less or equal to to source B \\\hline
  128. BR0 & Get Branch pointer register value (low byte) \\
  129. BR1 & Get Branch pointer register value (high byte) \\
  130. PC0 & Get Program counter value (low byte) \\
  131. PC1 & Get Program counter value (high byte) \\\hline
  132. MEM0 & Get Memory pointer register value (low byte) \\
  133. MEM1 & Get Memory pointer register value (middle byte) \\
  134. MEM2 & Get Memory pointer register value (high byte) \\
  135. MEMHI& Load high byte from memory at memory pointer \\
  136. MEMLO& Load low byte from memory at memory pointer \\\hline
  137. STACK& Pop value from stack \\
  138. ST0 & Get stack address value (low byte) \\
  139. ST1 & Get stack address value (high byte) \\
  140. COMA & Get communication block address register value \\
  141. COMD & Read value from communication block \\\hline
  142. REG0 & Get value from general purpose register 0 \\
  143. REG1 & Get value from general purpose register 1 \\
  144. \end{longtable}