Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: whitequark/Boneless-CPU
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f48bcba255b8
Choose a base ref
...
head repository: whitequark/Boneless-CPU
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 64128236514f
Choose a head ref
  • 1 commit
  • 12 files changed
  • 1 contributor

Commits on Jun 28, 2019

  1. Copy the full SHA
    6412823 View commit details
38 changes: 38 additions & 0 deletions boneless/arch/opcode_v3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
OPCODE4_LOGIC = 0b0000
OPTYPE2_AND = 0b00
OPTYPE2_OR = 0b01
OPTYPE2_XOR = 0b10
OPTYPE2_CMP = 0b11

OPCODE4_ARITH = 0b0001
OPTYPE2_ADD = 0b00
OPTYPE2_ADC = 0b01
OPTYPE2_SUB = 0b10
OPTYPE2_SBB = 0b11

OPCODE4_SHIFT = 0b0010
OPTYPE2_SLL = 0b00
OPTYPE2_ROT = 0b01
OPTYPE2_SRL = 0b10
OPTYPE2_SRA = 0b11

OPCODE5_LD = 0b01000
OPCODE5_LDR = 0b01001
OPCODE5_ST = 0b01010
OPCODE5_STR = 0b01011
OPCODE5_LDX = 0b01100
OPCODE5_LDXA = 0b01101
OPCODE5_STX = 0b01110
OPCODE5_STXA = 0b01111

OPCODE5_MOVR = 0b10000
OPCODE5_MOVI = 0b10001

OPCODE5_JAL = 0b10101

OPCODE5_JCC0 = 0b10110
OPCODE5_JCC1 = 0b10111

OPCODE3_EXTI = 0b110

OPCODE3_CUST = 0b111
Binary file modified doc/design.ods
Binary file not shown.
4 changes: 2 additions & 2 deletions doc/manual/insns/JAL.tex
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
\begin{instruction}{JAL}{Jump And Link}
\begin{encoding*}{short}
\mnemonic & \op{3}{100} & \op{2}{10} & \reg{d} & \off{8} \\
\mnemonic & \op{5}{10101} & \reg{d} & \off{8} \\
\end{encoding*}
\begin{encoding*}{long}
\exti
\mnemonic & \op{3}{100} & \op{2}{10} & \reg{d} & \off{8} \\
\mnemonic & \op{5}{10101} & \reg{d} & \off{8} \\
\end{encoding*}
\assembly{\mnemonic{} label}
\purpose{To transfer control to a subroutine.}
2 changes: 1 addition & 1 deletion doc/manual/insns/LDI.tex → doc/manual/insns/LDR.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
\begin{instruction}{LDI}{Load Indexed}
\begin{instruction}{LDR}{Load PC-relative}
\begin{encoding*}{short}
\mnemonic & \op{5}{01001} & \reg{d} & \reg{a} & \off{5} \\
\end{encoding*}
2 changes: 1 addition & 1 deletion doc/manual/insns/LDXZ.tex → doc/manual/insns/LDXA.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
\begin{instruction}{LDXZ}{Load External Absolute}
\begin{instruction}{LDXA}{Load External Absolute}
\begin{encoding*}{short}
\mnemonic & \op{5}{01101} & \reg{d} & \off{8} \\
\end{encoding*}
4 changes: 2 additions & 2 deletions doc/manual/insns/MOVI.tex
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
\begin{instruction}{MOVI}{Move Immediate}
\begin{encoding*}{short}
\mnemonic & \op{3}{100} & \op{2}{01} & \reg{d} & \imm{8} \\
\mnemonic & \op{5}{10001} & \reg{d} & \imm{8} \\
\end{encoding*}
\begin{encoding*}{long}
\exti
\mnemonic & \op{3}{100} & \op{2}{01} & \reg{d} & \imm{8} \\
\mnemonic & \op{5}{10001} & \reg{d} & \imm{8} \\
\end{encoding*}
\assembly{\mnemonic{} Rd, imm}
\purpose{To load a register with a constant.}
6 changes: 3 additions & 3 deletions doc/manual/insns/MOVA.tex → doc/manual/insns/MOVR.tex
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
\begin{instruction}{MOVA}{Move Address PC-relative}
\begin{instruction}{MOVR}{Move PC-relative Address}
\begin{encoding*}{short}
\mnemonic & \op{3}{100} & \op{2}{00} & \reg{d} & \off{8} \\
\mnemonic & \op{5}{10000} & \reg{d} & \off{8} \\
\end{encoding*}
\begin{encoding*}{long}
\exti
\mnemonic & \op{3}{100} & \op{2}{00} & \reg{d} & \off{8} \\
\mnemonic & \op{5}{10000} & \reg{d} & \off{8} \\
\end{encoding*}
\assembly{\mnemonic{} Rd, off}
\purpose{To load a register with an address relative to PC with a constant offset..}
2 changes: 1 addition & 1 deletion doc/manual/insns/STI.tex → doc/manual/insns/STR.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
\begin{instruction}{STI}{Store Indexed}
\begin{instruction}{STR}{Store PC-relative}
\begin{encoding*}{short}
\mnemonic & \op{5}{01011} & \reg{s} & \reg{a} & \off{5} \\
\end{encoding*}
2 changes: 1 addition & 1 deletion doc/manual/insns/STX.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
\begin{instruction}{STX}{Store External with Address in Register}
\begin{instruction}{STX}{Store External}
\begin{encoding*}{short}
\mnemonic & \op{5}{01110} & \reg{s} & \reg{a} & \off{5} \\
\end{encoding*}
2 changes: 1 addition & 1 deletion doc/manual/insns/STXZ.tex → doc/manual/insns/STXA.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
\begin{instruction}{STXZ}{Store External Absolute}
\begin{instruction}{STXA}{Store External Absolute}
\begin{encoding*}{short}
\mnemonic & \op{5}{01111} & \reg{s} & \off{8} \\
\end{encoding*}
10 changes: 5 additions & 5 deletions doc/manual/insns/index.tex
Original file line number Diff line number Diff line change
@@ -156,13 +156,13 @@
\input{JULT.tex} % pseudo
\input{JZ.tex}
\input{LD.tex}
\input{LDI.tex}
\input{LDR.tex}
\input{LDX.tex}
\input{LDXZ.tex}
\input{LDXA.tex}
\input{LEAV.tex} % pseudo
\input{MOV.tex} % pseudo
\input{MOVA.tex}
\input{MOVI.tex}
\input{MOVR.tex}
\input{OR.tex}
\input{ORI.tex}
\input{ROLI.tex} % pseudo
@@ -178,9 +178,9 @@
\input{SRL.tex}
\input{SRLI.tex}
\input{ST.tex}
\input{STI.tex}
\input{STR.tex}
\input{STX.tex}
\input{STXZ.tex}
\input{STXA.tex}
\input{SUB.tex}
\input{SUBI.tex}
% \input{SWPW.tex}
Binary file modified doc/manual/manual.pdf
Binary file not shown.