Lukasvg / Thumb399

ECE399 VHDL Repository
1 stars 0 forks source link

Missing arithmetic instructions. #5

Open Lukasvg opened 9 years ago

Lukasvg commented 9 years ago

The following 16bit arithmetic instructions need to be added to the design: SUB SBC MUL ADR NEG Note that there are several forms of SUB and that most of these instructions use or set the carry flag.

Lukasvg commented 9 years ago

Missing arithmetic instructions

Implement the arithmetic instructions that have not already been implemented. Make sure to set the NZC flags as needed. The V flag does not yet have to be implemented.

ADR 1 0 1 0 0 Rd Imm8 Rd = PC + #Imm8<<2 MUL 0 1 0 0 0 0 1 1 0 1 Rm Rd Rd = Rd * Rm NEG 0 1 0 0 0 0 1 0 0 1 Rn Rd Rd = #0-Rn SBC 0 1 0 0 0 0 0 1 1 0 Rm Rd Rd=Rd-Rm-C SUB 0 0 0 1 1 1 1 imm3 Rn Rd Rd = Rn-#imm3 SUB 0 0 0 1 1 0 1 Rm Rn Rd Rd = Rn-Rm SUB 1 0 1 1 0 0 0 0 1 Imm7 SP -= #Imm7<<2