|
|
|
@ -77,6 +77,13 @@ operations = {
|
|
|
|
|
adrrUT = {"adrrhU","adrrlT"},
|
|
|
|
|
adwrCB = {"adwrhC","adwrlB"},
|
|
|
|
|
adwIncUT = {"adwrUT","adwInc"},
|
|
|
|
|
adwP = {"adwlP","adwSaveP"},
|
|
|
|
|
adwQ = {"adwlQ","adwSaveQ"},
|
|
|
|
|
adwS = {"adwlS","adwSaveS"},
|
|
|
|
|
incP = {"adwP","adwInc"},
|
|
|
|
|
incQ = {"adwQ","adwInc"},
|
|
|
|
|
incP2 = {"adwP","adwr2"},
|
|
|
|
|
incQ2 = {"adwP","adwr2"},
|
|
|
|
|
|
|
|
|
|
jmpRelT = {"instrNext","adrrTX"},
|
|
|
|
|
jmpAbs = {"base","loadInstr","adrSaveI"},
|
|
|
|
@ -126,6 +133,11 @@ instructions = {
|
|
|
|
|
{ mnem="icc *s+imm8", opcode=0x2D, {"loadImmedT","instrSub1"}, {"loadStackRelU","instrSub2"}, {"aluU", "aluCinC", "aluAdd","aluSaveCarry","aluSaveNZ","instrSub3","instrPreload"}, {"storeStackRelU","instrNextPre"}, desc="*(S+imm8)+=CF, set flags" },
|
|
|
|
|
{ mnem="tst *s+imm8", opcode=0x2E, {"loadImmedT","instrSub1"}, {"loadStackRelU","instrSub2"}, {"alulU","aluRun","aluRInv","aluCinOn","aluAdd","aluSaveCarry","aluSaveNZ","instrNext"}, desc="Set flags according to *(S+imm8)-0" },
|
|
|
|
|
|
|
|
|
|
{ category = "16-bit Arithmetic", catlet = "X"},
|
|
|
|
|
{ mnem="adp imm8" , opcode=0x4A, {"loadImmedT","instrSub1"}, {"adwP","adwrTX","instrNext"}, desc="P+=imm8 signed"},
|
|
|
|
|
{ mnem="adq imm8" , opcode=0x4B, {"loadImmedT","instrSub1"}, {"adwQ","adwrTX","instrNext"}, desc="Q+=imm8 signed"},
|
|
|
|
|
{ mnem="ads imm8" , opcode=0x4C, {"loadImmedT","instrSub1"}, {"adwS","adwrTX","instrNext"}, desc="S+=imm8 signed"},
|
|
|
|
|
|
|
|
|
|
{ category = "8-bit Arithmetic/Logic", catlet="A" },
|
|
|
|
|
{ mnem="add imm8" , opcode=0x24, {"loadImmedT","instrSub1"}, {"aluA", "alurT","aluAdd", "aluSaveCarry","aluSaveNZ","instrNext"}, desc="A+=imm8, set flags" },
|
|
|
|
|
{ mnem="adb imm8" , opcode=0x72, {"loadImmedT","instrSub1"}, {"aluB", "alurT","aluAdd", "aluSaveCarry","aluSaveNZ","instrNext"}, desc="B+=imm8, set flags" },
|
|
|
|
@ -219,18 +231,30 @@ instructions = {
|
|
|
|
|
{ mnem="sta *imm16" , opcode=0x50, {"loadImm161","instrSub1"}, {"loadImm162","instrSub2",}, {"adrrUT","storeReg","alurA","instrSub3"}, {"instrNext"}, desc="*imm16=A" },
|
|
|
|
|
{ mnem="stb *imm16" , opcode=0x58, {"loadImm161","instrSub1"}, {"loadImm162","instrSub2",}, {"adrrUT","storeReg","alurB","instrSub3"}, {"instrNext"}, desc="*imm16=B" },
|
|
|
|
|
{ mnem="stc *imm16" , opcode=0x59, {"loadImm161","instrSub1"}, {"loadImm162","instrSub2",}, {"adrrUT","storeReg","alurC","instrSub3"}, {"instrNext"}, desc="*imm16=C" },
|
|
|
|
|
{ mnem="sta *p" , opcode=0x52, {"adrlP","storeReg","alurA","instrSub1"}, {"instrNext"}, desc="*P=A" },
|
|
|
|
|
{ mnem="stb *p" , opcode=0x5A, {"adrlP","storeReg","alurB","instrSub1"}, {"instrNext"}, desc="*P=B" },
|
|
|
|
|
{ mnem="stc *p" , opcode=0x5B, {"adrlP","storeReg","alurC","instrSub1"}, {"instrNext"}, desc="*P=C" },
|
|
|
|
|
{ mnem="sta *q" , opcode=0x54, {"adrlQ","storeReg","alurA","instrSub1"}, {"instrNext"}, desc="*Q=A" },
|
|
|
|
|
{ mnem="stb *q" , opcode=0x5C, {"adrlQ","storeReg","alurB","instrSub1"}, {"instrNext"}, desc="*Q=B" },
|
|
|
|
|
{ mnem="stc *q" , opcode=0x5D, {"adrlQ","storeReg","alurC","instrSub1"}, {"instrNext"}, desc="*Q=C" },
|
|
|
|
|
{ mnem="lda *p" , opcode=0x53, {"adrlP","loadReg","memSaveA","instrSub1"}, {"instrNext"}, desc="A=*P" },
|
|
|
|
|
{ mnem="ldb *p" , opcode=0x5E, {"adrlP","loadReg","memSaveB","instrSub1"}, {"instrNext"}, desc="B=*P" },
|
|
|
|
|
{ mnem="ldc *p" , opcode=0x5F, {"adrlP","loadReg","memSaveC","instrSub1"}, {"instrNext"}, desc="C=*P" },
|
|
|
|
|
{ mnem="lda *q" , opcode=0x55, {"adrlQ","loadReg","memSaveA","instrSub1"}, {"instrNext"}, desc="A=*Q" },
|
|
|
|
|
{ mnem="ldb *q" , opcode=0x61, {"adrlQ","loadReg","memSaveB","instrSub1"}, {"instrNext"}, desc="B=*Q" },
|
|
|
|
|
{ mnem="ldc *q" , opcode=0x62, {"adrlQ","loadReg","memSaveC","instrSub1"}, {"instrNext"}, desc="C=*Q" },
|
|
|
|
|
{ mnem="sta *p" , opcode=0x52, {"adrlP","storeReg","alurA", "instrSub1"}, {"instrNext"}, desc="*P=A" },
|
|
|
|
|
{ mnem="stb *p" , opcode=0x5A, {"adrlP","storeReg","alurB", "instrSub1"}, {"instrNext"}, desc="*P=B" },
|
|
|
|
|
{ mnem="stc *p" , opcode=0x5B, {"adrlP","storeReg","alurC", "instrSub1"}, {"instrNext"}, desc="*P=C" },
|
|
|
|
|
{ mnem="sta *q" , opcode=0x54, {"adrlQ","storeReg","alurA", "instrSub1"}, {"instrNext"}, desc="*Q=A" },
|
|
|
|
|
{ mnem="stb *q" , opcode=0x5C, {"adrlQ","storeReg","alurB", "instrSub1"}, {"instrNext"}, desc="*Q=B" },
|
|
|
|
|
{ mnem="stc *q" , opcode=0x5D, {"adrlQ","storeReg","alurC", "instrSub1"}, {"instrNext"}, desc="*Q=C" },
|
|
|
|
|
{ mnem="lda *p" , opcode=0x53, {"adrlP","loadReg","memSaveA", "instrSub1"}, {"instrNext"}, desc="A=*P" },
|
|
|
|
|
{ mnem="ldb *p" , opcode=0x5E, {"adrlP","loadReg","memSaveB", "instrSub1"}, {"instrNext"}, desc="B=*P" },
|
|
|
|
|
{ mnem="ldc *p" , opcode=0x5F, {"adrlP","loadReg","memSaveC", "instrSub1"}, {"instrNext"}, desc="C=*P" },
|
|
|
|
|
{ mnem="lda *q" , opcode=0x55, {"adrlQ","loadReg","memSaveA", "instrSub1"}, {"instrNext"}, desc="A=*Q" },
|
|
|
|
|
{ mnem="ldb *q" , opcode=0x61, {"adrlQ","loadReg","memSaveB", "instrSub1"}, {"instrNext"}, desc="B=*Q" },
|
|
|
|
|
{ mnem="ldc *q" , opcode=0x62, {"adrlQ","loadReg","memSaveC", "instrSub1"}, {"instrNext"}, desc="C=*Q" },
|
|
|
|
|
{ mnem="sta *p++" , opcode=0xC0, {"adrlP","storeReg","alurA", "incP","instrSub1"}, {"instrNext"}, desc="*P++=A" },
|
|
|
|
|
{ mnem="stb *p++" , opcode=0xC1, {"adrlP","storeReg","alurB", "incP","instrSub1"}, {"instrNext"}, desc="*P++=B" },
|
|
|
|
|
{ mnem="stc *p++" , opcode=0xC2, {"adrlP","storeReg","alurC", "incP","instrSub1"}, {"instrNext"}, desc="*P++=C" },
|
|
|
|
|
{ mnem="sta *q++" , opcode=0xC3, {"adrlQ","storeReg","alurA", "incQ","instrSub1"}, {"instrNext"}, desc="*Q++=A" },
|
|
|
|
|
{ mnem="stb *q++" , opcode=0xC4, {"adrlQ","storeReg","alurB", "incQ","instrSub1"}, {"instrNext"}, desc="*Q++=B" },
|
|
|
|
|
{ mnem="stc *q++" , opcode=0xC5, {"adrlQ","storeReg","alurC", "incQ","instrSub1"}, {"instrNext"}, desc="*Q++=C" },
|
|
|
|
|
{ mnem="lda *p++" , opcode=0xC6, {"adrlP","loadReg","memSaveA","incP","instrSub1"}, {"instrNext"}, desc="A=*P++" },
|
|
|
|
|
{ mnem="ldb *p++" , opcode=0xC7, {"adrlP","loadReg","memSaveB","incP","instrSub1"}, {"instrNext"}, desc="B=*P++" },
|
|
|
|
|
{ mnem="ldc *p++" , opcode=0xC8, {"adrlP","loadReg","memSaveC","incP","instrSub1"}, {"instrNext"}, desc="C=*P++" },
|
|
|
|
|
{ mnem="lda *q++" , opcode=0xC9, {"adrlQ","loadReg","memSaveA","incQ","instrSub1"}, {"instrNext"}, desc="A=*Q++" },
|
|
|
|
|
{ mnem="ldb *q++" , opcode=0xCA, {"adrlQ","loadReg","memSaveB","incQ","instrSub1"}, {"instrNext"}, desc="B=*Q++" },
|
|
|
|
|
{ mnem="ldc *q++" , opcode=0xCB, {"adrlQ","loadReg","memSaveC","incQ","instrSub1"}, {"instrNext"}, desc="C=*Q++" },
|
|
|
|
|
|
|
|
|
|
{ category = "16-bit Load/Store", catlet="W" },
|
|
|
|
|
{ mnem="ldp imm16" , opcode=0x21, {"loadImm161","instrSub1"}, {"loadImm162","instrSub2"}, {"adwrUT","adwSaveP","instrNext"}, desc="P=imm16" },
|
|
|
|
@ -251,6 +275,10 @@ instructions = {
|
|
|
|
|
{ mnem="ldq *q" , opcode=0x95, {"adrlQ","load161","instrSub1"}, {"adrlQ","load162","instrSub2"}, {"adwrUT","adwSaveQ","instrNext"}, desc="Q=*Q" },
|
|
|
|
|
{ mnem="stp *q" , opcode=0x7C, {"adrlQ","store161","alurPH","instrSub1"}, {"adrlQ","store162","alurPL","instrSub2"}, {"instrNext"}, desc="*Q=P" },
|
|
|
|
|
{ mnem="stq *p" , opcode=0x7D, {"adrlP","store161","alurQH","instrSub1"}, {"adrlP","store162","alurQL","instrSub2"}, {"instrNext"}, desc="*P=Q" },
|
|
|
|
|
{ mnem="ldq *p++" , opcode=0xCC, {"adrlP","load161","instrSub1"}, {"adrlP","load162","instrSub2","incP2"}, {"adwrUT","adwSaveQ","instrNext"}, desc="Q=*P++++" },
|
|
|
|
|
{ mnem="ldp *q++" , opcode=0xCD, {"adrlQ","load161","instrSub1"}, {"adrlQ","load162","instrSub2","incQ2"}, {"adwrUT","adwSaveP","instrNext"}, desc="P=*Q++++" },
|
|
|
|
|
{ mnem="stp *q++" , opcode=0xCE, {"adrlQ","store161","alurPH","instrSub1"}, {"adrlQ","store162","alurPL","instrSub2","incQ2"}, {"instrNext"}, desc="*Q++++=P" },
|
|
|
|
|
{ mnem="stq *p++" , opcode=0xCF, {"adrlP","store161","alurQH","instrSub1"}, {"adrlP","store162","alurQL","instrSub2","incP2"}, {"instrNext"}, desc="*P++++=Q" },
|
|
|
|
|
|
|
|
|
|
{ category = "Moves", catlet="M" },
|
|
|
|
|
{ mnem="lda b" , opcode=0x80, {"alurB" ,"aluAdd","aluSaveA","instrNext"}, desc="A=B" },
|
|
|
|
|