8-appendix.tex 6.4 KB

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