Synchronization...

This commit is contained in:
xolatile
2024-07-13 08:36:40 -04:00
parent bdf303028b
commit 2175f5506c
3 changed files with 28 additions and 9 deletions

View File

@ -23,10 +23,11 @@
#define MOVE_IF_COUNT (MOVE_IF_END - MOVE_IF_BEGIN + 1)
// Regulates displacement, immediate, label, variable, constant, string data.
/*static next * empty_from;
static next holes;
static next * empty_from;
static next * empty_to;
static next * imbue_with;
static next * imbue_size;*/
static next * imbue_size;
// Main function.
static void place (form when,
@ -47,6 +48,24 @@ static void print (form when,
place ((when != 0) && (size >= D32), (byte) ((data >> 24) & 0xff));
}
static void delay (form when,
size_index size,
next data) {
/* */
empty_from [holes] = text_sector_size;
imbue_with [holes] = data;
imbue_size [holes] = size;
place ((when != 0) && (size >= D8), (byte) ((data >> 0) & 0xff));
place ((when != 0) && (size >= D16), (byte) ((data >> 8) & 0xff));
place ((when != 0) && (size >= D32), (byte) ((data >> 16) & 0xff));
place ((when != 0) && (size >= D32), (byte) ((data >> 24) & 0xff));
empty_to [holes] = text_sector_size;
holes += when;
}
static form front (form data) { return ((data >= 4) && (data <= 7)); }
static form lower (form data) { return ((data >= 0) && (data <= 7)); }
static form upper (form data) { return ((data >= 8) && (data <= 15)); }
@ -276,10 +295,10 @@ static void build_move (size_index size,
place ((to == MEM) && (from == IMM), (byte) (0xc6 + (size != D8)));
place ((to == MEM) && (from == IMM), (byte) (0x05));
print ((to == REG) && (from == MEM), D32, (next) ~0);
print ((to == REG) && (from == IMM), D32, source);
print ((to == MEM) && (from == REG), D32, (next) ~0);
print ((to == MEM) && (from == IMM), D32, (next) ~0);
delay ((to == REG) && (from == MEM), D32, (next) ~0);
print ((to == REG) && (from == IMM), size, source);
delay ((to == MEM) && (from == REG), D32, (next) ~0);
delay ((to == MEM) && (from == IMM), D32, (next) ~0);
print ((to == MEM) && (from == IMM), size, source);
}

View File

@ -16,13 +16,13 @@ typedef enum {
} type_index;
typedef enum {
XDCL, XLBL, XRPT, XLCT,
RECORD,
/* HIGHLY EXPERIMENTAL CODE ABOVE... */
ADD, OR, ADC, SBB,
AND, SUB, XOR, CMP,
/* */
INC, DEC, NOT, NEG,
UMUL, IMUL, UDIV, IDIV,
MUL, IMUL, DIV, IDIV,
/* */
NOP, RETN, RETF, LEAVE,
LOCK, HLT,

View File

@ -1,4 +1,4 @@
program heyo_world
unix program heyo_world
begin