Corrected naming of CMPJUMP(u) to CMPJUMP(u)I to match current naming standard

This commit is contained in:
Jeremiah Orians 2016-10-29 09:06:57 -04:00
parent 558392977f
commit 1b1b94a121
No known key found for this signature in database
GPG Key ID: 7457821534D2ACCD
10 changed files with 128 additions and 127 deletions

View File

@ -9,6 +9,7 @@
+ created roms/ to store previously built roms and expanded .gitignore to prevent binary blobs from being checked in.
+ Revised stage0 Monitor to utilize ANDI and updated the Hex0 version to incorporate the enhancements made previously
+ Imported CMPSKIP instructions that operate on 2 registers
+ Corrected CMPJUMP(u) to CMPJUMP(u)I to match current naming scheme for instructions
** Fixed
+ Fixed leading char bug in M0

View File

@ -332,16 +332,16 @@ void assemble(struct Token* p)
setExpression(p, "NANDI", "B3", 4);
setExpression(p, "NORI", "B4", 4);
setExpression(p, "XNORI", "B5", 4);
setExpression(p, "CMPJUMP.G", "C0", 4);
setExpression(p, "CMPJUMP.GE", "C1", 4);
setExpression(p, "CMPJUMP.E", "C2", 4);
setExpression(p, "CMPJUMP.NE", "C3", 4);
setExpression(p, "CMPJUMP.LE", "C4", 4);
setExpression(p, "CMPJUMP.L", "C5", 4);
setExpression(p, "CMPJUMPU.G", "D0", 4);
setExpression(p, "CMPJUMPU.GE", "D1", 4);
setExpression(p, "CMPJUMPU.LE", "D4", 4);
setExpression(p, "CMPJUMPU.L", "D5", 4);
setExpression(p, "CMPJUMPI.G", "C0", 4);
setExpression(p, "CMPJUMPI.GE", "C1", 4);
setExpression(p, "CMPJUMPI.E", "C2", 4);
setExpression(p, "CMPJUMPI.NE", "C3", 4);
setExpression(p, "CMPJUMPI.LE", "C4", 4);
setExpression(p, "CMPJUMPI.L", "C5", 4);
setExpression(p, "CMPJUMPUI.G", "D0", 4);
setExpression(p, "CMPJUMPUI.GE", "D1", 4);
setExpression(p, "CMPJUMPUI.LE", "D4", 4);
setExpression(p, "CMPJUMPUI.L", "D5", 4);
/* 1OPI Group */
setExpression(p, "JUMP.C", "2C0", 4);

View File

@ -161,16 +161,16 @@ DEFINE XORI B2
DEFINE NANDI B3
DEFINE NORI B4
DEFINE XNORI B5
DEFINE CMPJUMP.G C0
DEFINE CMPJUMP.GE C1
DEFINE CMPJUMP.E C2
DEFINE CMPJUMP.NE C3
DEFINE CMPJUMP.LE C4
DEFINE CMPJUMP.L C5
DEFINE CMPJUMPU.G D0
DEFINE CMPJUMPU.GE D1
DEFINE CMPJUMPU.LE D4
DEFINE CMPJUMPU.L D5
DEFINE CMPJUMPI.G C0
DEFINE CMPJUMPI.GE C1
DEFINE CMPJUMPI.E C2
DEFINE CMPJUMPI.NE C3
DEFINE CMPJUMPI.LE C4
DEFINE CMPJUMPI.L C5
DEFINE CMPJUMPUI.G D0
DEFINE CMPJUMPUI.GE D1
DEFINE CMPJUMPUI.LE D4
DEFINE CMPJUMPUI.L D5
# 1OPI Group
DEFINE JUMP.C 2C0

View File

@ -911,54 +911,54 @@ void decode_Integer_2OPI(struct Instruction* c)
strncpy(Name, "XNORI", 19);
break;
}
case 0xC0: /* CMPJUMP.G */
case 0xC0: /* CMPJUMPI.G */
{
strncpy(Name, "CMPJUMP.G", 19);
strncpy(Name, "CMPJUMPI.G", 19);
break;
}
case 0xC1: /* CMPJUMP.GE */
case 0xC1: /* CMPJUMPI.GE */
{
strncpy(Name, "CMPJUMP.GE", 19);
strncpy(Name, "CMPJUMPI.GE", 19);
break;
}
case 0xC2: /* CMPJUMP.E */
case 0xC2: /* CMPJUMPI.E */
{
strncpy(Name, "CMPJUMP.E", 19);
strncpy(Name, "CMPJUMPI.E", 19);
break;
}
case 0xC3: /* CMPJUMP.NE */
case 0xC3: /* CMPJUMPI.NE */
{
strncpy(Name, "CMPJUMP.NE", 19);
strncpy(Name, "CMPJUMPI.NE", 19);
break;
}
case 0xC4: /* CMPJUMP.LE */
case 0xC4: /* CMPJUMPI.LE */
{
strncpy(Name, "CMPJUMP.LE", 19);
strncpy(Name, "CMPJUMPI.LE", 19);
break;
}
case 0xC5: /* CMPJUMP.L */
case 0xC5: /* CMPJUMPI.L */
{
strncpy(Name, "CMPJUMP.L", 19);
strncpy(Name, "CMPJUMPI.L", 19);
break;
}
case 0xD0: /* CMPJUMPU.G */
case 0xD0: /* CMPJUMPUI.G */
{
strncpy(Name, "CMPJUMPU.G", 19);
strncpy(Name, "CMPJUMPUI.G", 19);
break;
}
case 0xD1: /* CMPJUMPU.GE */
case 0xD1: /* CMPJUMPUI.GE */
{
strncpy(Name, "CMPJUMPU.GE", 19);
strncpy(Name, "CMPJUMPUI.GE", 19);
break;
}
case 0xD4: /* CMPJUMPU.LE */
case 0xD4: /* CMPJUMPUI.LE */
{
strncpy(Name, "CMPJUMPU.LE", 19);
strncpy(Name, "CMPJUMPUI.LE", 19);
break;
}
case 0xD5: /* CMPJUMPU.L */
case 0xD5: /* CMPJUMPUI.L */
{
strncpy(Name, "CMPJUMPU.L", 19);
strncpy(Name, "CMPJUMPUI.L", 19);
break;
}
default: /* Unknown 2OPI*/

View File

@ -595,27 +595,27 @@ DO NOT USE.
| ... | Reserved | |
| BF FF FF FF | Reserved | |
** CMPJUMP Group
| Hex | Name | Comment |
|-------------+-----------------------+-------------------------------------|
| C0 ab ii ii | CMPJUMP.G a b ii ii | a > b ? PC = PC + ii ii |
| C1 ab ii ii | CMPJUMP.GE a b ii ii | a >= b ? PC = PC + ii ii |
| C2 ab ii ii | CMPJUMP.E a b ii ii | a == b ? PC = PC + ii ii |
| C3 ab ii ii | CMPJUMP.NE a b ii ii | a != b ? PC = PC + ii ii |
| C4 ab ii ii | CMPJUMP.LE a b ii ii | a <= b ? PC = PC + ii ii |
| C5 ab ii ii | CMPJUMP.L a b ii ii | a < b ? PC = PC + ii ii |
| C6 ab ii ii | Reserved | |
| ... | Reserved | |
| CF ab ii ii | Reserved | |
| D0 ab ii ii | CMPJUMPU.G a b ii ii | a > b ? PC = PC + ii ii (unsigned) |
| D1 ab ii ii | CMPJUMPU.GE a b ii ii | a >= b ? PC = PC + ii ii (unsigned) |
| D2 ab ii ii | Reserved | |
| D3 ab ii ii | Reserved | |
| D4 ab ii ii | CMPJUMPU.LE a b ii ii | a <= b ? PC = PC + ii ii (unsigned) |
| D5 ab ii ii | CMPJUMPU.L a b ii ii | a < b ? PC = PC + ii ii (unsigned) |
| D6 ab ii ii | Reserved | |
| ... | Reserved | |
| DF ab ii ii | Reserved | |
** CMPJUMPI Group
| Hex | Name | Comment |
|-------------+------------------------+-------------------------------------|
| C0 ab ii ii | CMPJUMPI.G a b ii ii | a > b ? PC = PC + ii ii |
| C1 ab ii ii | CMPJUMPI.GE a b ii ii | a >= b ? PC = PC + ii ii |
| C2 ab ii ii | CMPJUMPI.E a b ii ii | a == b ? PC = PC + ii ii |
| C3 ab ii ii | CMPJUMPI.NE a b ii ii | a != b ? PC = PC + ii ii |
| C4 ab ii ii | CMPJUMPI.LE a b ii ii | a <= b ? PC = PC + ii ii |
| C5 ab ii ii | CMPJUMPI.L a b ii ii | a < b ? PC = PC + ii ii |
| C6 ab ii ii | Reserved | |
| ... | Reserved | |
| CF ab ii ii | Reserved | |
| D0 ab ii ii | CMPJUMPUI.G a b ii ii | a > b ? PC = PC + ii ii (unsigned) |
| D1 ab ii ii | CMPJUMPUI.GE a b ii ii | a >= b ? PC = PC + ii ii (unsigned) |
| D2 ab ii ii | Reserved | |
| D3 ab ii ii | Reserved | |
| D4 ab ii ii | CMPJUMPUI.LE a b ii ii | a <= b ? PC = PC + ii ii (unsigned) |
| D5 ab ii ii | CMPJUMPUI.L a b ii ii | a < b ? PC = PC + ii ii (unsigned) |
| D6 ab ii ii | Reserved | |
| ... | Reserved | |
| DF ab ii ii | Reserved | |
** Reserved Block 3
At this time these instructions only produce a warning; but could do anything.

View File

@ -160,7 +160,7 @@ A020000a # CMPSKIPI.E R0 10 ; Stop When LF is reached
05049045 # STOREX8 R0 R4 R5 ; Store the Byte
42100100 # FGETC ; Get next Byte
0F550001 # ADDUI R5 R5 1 ; Prep for next loop
C306 @Store_String_0 # CMPJUMP.NE R0 R6 @Store_String_0 ; Loop if matching not found
C306 @Store_String_0 # CMPJUMPI.NE R0 R6 @Store_String_0 ; Loop if matching not found
# ;; Clean up
23420008 # STORE32 R4 R2 8 ; Set Text pointer
0F050004 # ADDUI R0 R5 4 ; Correct Malloc
@ -538,7 +538,7 @@ A0400039 # CMPSKIPI.LE R0 57 ; If nybble was greater than '9'
2D0F @numerate_string # CALLI R15 @numerate_string ; Convert to number in R0
14110000 # LOAD8 R1 R1 0 ; Get first char of Text
A0210030 # CMPSKIPI.E R1 48 ; Skip next comparision if '0'
C205 @Eval_Immediates_1 # CMPJUMP.E R0 R5 @Eval_Immediates_1 ; Don't do anything if string isn't a number
C205 @Eval_Immediates_1 # CMPJUMPI.E R0 R5 @Eval_Immediates_1 ; Don't do anything if string isn't a number
09000510 # MOVE R1 R0 ; Preserve number
2D200005 # LOADUI R0 5 ; Allocate enough space for 4 hex and a null
2D0F @malloc # CALLI R15 @malloc ; Obtain the pointer the newly allocated Expression
@ -547,7 +547,7 @@ C205 @Eval_Immediates_1 # CMPJUMP.E R0 R5 @Eval_Immediates_1 ; Don't do anything
2D0F @hex16 # CALLI R15 @hex16 ; Shove our number into expression
# ;; Handle looping
:Eval_Immediates_1
C245 @Eval_Immediates_2 # CMPJUMP.E R4 R5 @Eval_Immediates_2 ; If null be done
C245 @Eval_Immediates_2 # CMPJUMPI.E R4 R5 @Eval_Immediates_2 ; If null be done
09000504 # MOVE R0 R4 ; Prepare for next loop
3C00 @Eval_Immediates_0 # JUMP @Eval_Immediates_0 ; And loop
# ;; Clean up

View File

@ -182,7 +182,7 @@
STOREX8 R0 R4 R5 ; Store the Byte
FGETC ; Get next Byte
ADDUI R5 R5 1 ; Prep for next loop
CMPJUMP.NE R0 R6 @Store_String_0 ; Loop if matching not found
CMPJUMPI.NE R0 R6 @Store_String_0 ; Loop if matching not found
;; Clean up
STORE32 R4 R2 8 ; Set Text pointer
@ -602,7 +602,7 @@
CALLI R15 @numerate_string ; Convert to number in R0
LOAD8 R1 R1 0 ; Get first char of Text
CMPSKIPI.E R1 48 ; Skip next comparision if '0'
CMPJUMP.E R0 R5 @Eval_Immediates_1 ; Don't do anything if string isn't a number
CMPJUMPI.E R0 R5 @Eval_Immediates_1 ; Don't do anything if string isn't a number
MOVE R1 R0 ; Preserve number
LOADUI R0 5 ; Allocate enough space for 4 hex and a null
CALLI R15 @malloc ; Obtain the pointer the newly allocated Expression
@ -612,7 +612,7 @@
;; Handle looping
:Eval_Immediates_1
CMPJUMP.E R4 R5 @Eval_Immediates_2 ; If null be done
CMPJUMPI.E R4 R5 @Eval_Immediates_2 ; If null be done
MOVE R0 R4 ; Prepare for next loop
JUMP @Eval_Immediates_0 ; And loop

20
vm.h
View File

@ -183,16 +183,16 @@ void STORER32(struct lilith* vm, struct Instruction* c);
void JUMP(struct lilith* vm, struct Instruction* c);
void JUMP_P(struct lilith* vm, struct Instruction* c);
void JUMP_NP(struct lilith* vm, struct Instruction* c);
void CMPJUMP_G(struct lilith* vm, struct Instruction* c);
void CMPJUMP_GE(struct lilith* vm, struct Instruction* c);
void CMPJUMP_E(struct lilith* vm, struct Instruction* c);
void CMPJUMP_NE(struct lilith* vm, struct Instruction* c);
void CMPJUMP_LE(struct lilith* vm, struct Instruction* c);
void CMPJUMP_L(struct lilith* vm, struct Instruction* c);
void CMPJUMPU_G(struct lilith* vm, struct Instruction* c);
void CMPJUMPU_GE(struct lilith* vm, struct Instruction* c);
void CMPJUMPU_LE(struct lilith* vm, struct Instruction* c);
void CMPJUMPU_L(struct lilith* vm, struct Instruction* c);
void CMPJUMPI_G(struct lilith* vm, struct Instruction* c);
void CMPJUMPI_GE(struct lilith* vm, struct Instruction* c);
void CMPJUMPI_E(struct lilith* vm, struct Instruction* c);
void CMPJUMPI_NE(struct lilith* vm, struct Instruction* c);
void CMPJUMPI_LE(struct lilith* vm, struct Instruction* c);
void CMPJUMPI_L(struct lilith* vm, struct Instruction* c);
void CMPJUMPUI_G(struct lilith* vm, struct Instruction* c);
void CMPJUMPUI_GE(struct lilith* vm, struct Instruction* c);
void CMPJUMPUI_LE(struct lilith* vm, struct Instruction* c);
void CMPJUMPUI_L(struct lilith* vm, struct Instruction* c);
void CMPSKIPI_G(struct lilith* vm, struct Instruction* c);
void CMPSKIPI_GE(struct lilith* vm, struct Instruction* c);
void CMPSKIPI_E(struct lilith* vm, struct Instruction* c);

View File

@ -1830,114 +1830,114 @@ bool eval_2OPI_Int(struct lilith* vm, struct Instruction* c)
XNORI(vm, c);
break;
}
case 0xC0: /* CMPJUMP.G */
case 0xC0: /* CMPJUMPI.G */
{
#ifdef DEBUG
strncpy(Name, "CMPJUMP.G", 19);
strncpy(Name, "CMPJUMPI.G", 19);
#elif TRACE
record_trace("CMPJUMP.G");
record_trace("CMPJUMPI.G");
#endif
CMPJUMP_G(vm, c);
CMPJUMPI_G(vm, c);
break;
}
case 0xC1: /* CMPJUMP.GE */
case 0xC1: /* CMPJUMPI.GE */
{
#ifdef DEBUG
strncpy(Name, "CMPJUMP.GE", 19);
strncpy(Name, "CMPJUMPI.GE", 19);
#elif TRACE
record_trace("CMPJUMP.GE");
record_trace("CMPJUMPI.GE");
#endif
CMPJUMP_GE(vm, c);
CMPJUMPI_GE(vm, c);
break;
}
case 0xC2: /* CMPJUMP.E */
case 0xC2: /* CMPJUMPI.E */
{
#ifdef DEBUG
strncpy(Name, "CMPJUMP.E", 19);
strncpy(Name, "CMPJUMPI.E", 19);
#elif TRACE
record_trace("CMPJUMP.E");
record_trace("CMPJUMPI.E");
#endif
CMPJUMP_E(vm, c);
CMPJUMPI_E(vm, c);
break;
}
case 0xC3: /* CMPJUMP.NE */
case 0xC3: /* CMPJUMPI.NE */
{
#ifdef DEBUG
strncpy(Name, "CMPJUMP.NE", 19);
strncpy(Name, "CMPJUMPI.NE", 19);
#elif TRACE
record_trace("CMPJUMP.NE");
record_trace("CMPJUMPI.NE");
#endif
CMPJUMP_NE(vm, c);
CMPJUMPI_NE(vm, c);
break;
}
case 0xC4: /* CMPJUMP.LE */
case 0xC4: /* CMPJUMPI.LE */
{
#ifdef DEBUG
strncpy(Name, "CMPJUMP.LE", 19);
strncpy(Name, "CMPJUMPI.LE", 19);
#elif TRACE
record_trace("CMPJUMP.LE");
record_trace("CMPJUMPI.LE");
#endif
CMPJUMP_LE(vm, c);
CMPJUMPI_LE(vm, c);
break;
}
case 0xC5: /* CMPJUMP.L */
case 0xC5: /* CMPJUMPI.L */
{
#ifdef DEBUG
strncpy(Name, "CMPJUMP.L", 19);
strncpy(Name, "CMPJUMPI.L", 19);
#elif TRACE
record_trace("CMPJUMP.L");
record_trace("CMPJUMPI.L");
#endif
CMPJUMP_L(vm, c);
CMPJUMPI_L(vm, c);
break;
}
case 0xD0: /* CMPJUMPU.G */
case 0xD0: /* CMPJUMPUI.G */
{
#ifdef DEBUG
strncpy(Name, "CMPJUMPU.G", 19);
strncpy(Name, "CMPJUMPUI.G", 19);
#elif TRACE
record_trace("CMPJUMPU.G");
record_trace("CMPJUMPUI.G");
#endif
CMPJUMPU_G(vm, c);
CMPJUMPUI_G(vm, c);
break;
}
case 0xD1: /* CMPJUMPU.GE */
case 0xD1: /* CMPJUMPUI.GE */
{
#ifdef DEBUG
strncpy(Name, "CMPJUMPU.GE", 19);
strncpy(Name, "CMPJUMPUI.GE", 19);
#elif TRACE
record_trace("CMPJUMPU.GE");
record_trace("CMPJUMPUI.GE");
#endif
CMPJUMPU_GE(vm, c);
CMPJUMPUI_GE(vm, c);
break;
}
case 0xD4: /* CMPJUMPU.LE */
case 0xD4: /* CMPJUMPUI.LE */
{
#ifdef DEBUG
strncpy(Name, "CMPJUMPU.LE", 19);
strncpy(Name, "CMPJUMPUI.LE", 19);
#elif TRACE
record_trace("CMPJUMPU.LE");
record_trace("CMPJUMPUI.LE");
#endif
CMPJUMPU_LE(vm, c);
CMPJUMPUI_LE(vm, c);
break;
}
case 0xD5: /* CMPJUMPU.L */
case 0xD5: /* CMPJUMPUI.L */
{
#ifdef DEBUG
strncpy(Name, "CMPJUMPU.L", 19);
strncpy(Name, "CMPJUMPUI.L", 19);
#elif TRACE
record_trace("CMPJUMPU.L");
record_trace("CMPJUMPUI.L");
#endif
CMPJUMPU_L(vm, c);
CMPJUMPUI_L(vm, c);
break;
}
default: return true;

View File

@ -1649,7 +1649,7 @@ void JUMP_NP(struct lilith* vm, struct Instruction* c)
}
}
void CMPJUMP_G(struct lilith* vm, struct Instruction* c)
void CMPJUMPI_G(struct lilith* vm, struct Instruction* c)
{
int32_t tmp1, tmp2;
tmp1 = (int32_t)(vm->reg[c->reg0]);
@ -1660,7 +1660,7 @@ void CMPJUMP_G(struct lilith* vm, struct Instruction* c)
}
}
void CMPJUMP_GE(struct lilith* vm, struct Instruction* c)
void CMPJUMPI_GE(struct lilith* vm, struct Instruction* c)
{
int32_t tmp1, tmp2;
tmp1 = (int32_t)(vm->reg[c->reg0]);
@ -1671,7 +1671,7 @@ void CMPJUMP_GE(struct lilith* vm, struct Instruction* c)
}
}
void CMPJUMP_E(struct lilith* vm, struct Instruction* c)
void CMPJUMPI_E(struct lilith* vm, struct Instruction* c)
{
if((vm->reg[c->reg0]) == (vm->reg[c->reg1]))
{
@ -1679,7 +1679,7 @@ void CMPJUMP_E(struct lilith* vm, struct Instruction* c)
}
}
void CMPJUMP_NE(struct lilith* vm, struct Instruction* c)
void CMPJUMPI_NE(struct lilith* vm, struct Instruction* c)
{
if((vm->reg[c->reg0]) != (vm->reg[c->reg1]))
{
@ -1687,7 +1687,7 @@ void CMPJUMP_NE(struct lilith* vm, struct Instruction* c)
}
}
void CMPJUMP_LE(struct lilith* vm, struct Instruction* c)
void CMPJUMPI_LE(struct lilith* vm, struct Instruction* c)
{
int32_t tmp1, tmp2;
tmp1 = (int32_t)(vm->reg[c->reg0]);
@ -1698,7 +1698,7 @@ void CMPJUMP_LE(struct lilith* vm, struct Instruction* c)
}
}
void CMPJUMP_L(struct lilith* vm, struct Instruction* c)
void CMPJUMPI_L(struct lilith* vm, struct Instruction* c)
{
int32_t tmp1, tmp2;
tmp1 = (int32_t)(vm->reg[c->reg0]);
@ -1709,7 +1709,7 @@ void CMPJUMP_L(struct lilith* vm, struct Instruction* c)
}
}
void CMPJUMPU_G(struct lilith* vm, struct Instruction* c)
void CMPJUMPUI_G(struct lilith* vm, struct Instruction* c)
{
if((vm->reg[c->reg0]) > (vm->reg[c->reg1]))
{
@ -1717,7 +1717,7 @@ void CMPJUMPU_G(struct lilith* vm, struct Instruction* c)
}
}
void CMPJUMPU_GE(struct lilith* vm, struct Instruction* c)
void CMPJUMPUI_GE(struct lilith* vm, struct Instruction* c)
{
if((vm->reg[c->reg0]) >= (vm->reg[c->reg1]))
{
@ -1725,7 +1725,7 @@ void CMPJUMPU_GE(struct lilith* vm, struct Instruction* c)
}
}
void CMPJUMPU_LE(struct lilith* vm, struct Instruction* c)
void CMPJUMPUI_LE(struct lilith* vm, struct Instruction* c)
{
if((vm->reg[c->reg0]) <= (vm->reg[c->reg1]))
{
@ -1733,7 +1733,7 @@ void CMPJUMPU_LE(struct lilith* vm, struct Instruction* c)
}
}
void CMPJUMPU_L(struct lilith* vm, struct Instruction* c)
void CMPJUMPUI_L(struct lilith* vm, struct Instruction* c)
{
if((vm->reg[c->reg0]) < (vm->reg[c->reg1]))
{