Implemened arrayed ASMDIRIMM thing...

This commit is contained in:
xolatile
2024-07-15 19:50:20 -04:00
parent 4f6275d0c6
commit 9e1480c4ad
4 changed files with 27 additions and 19 deletions

View File

@ -89,14 +89,8 @@ static void delay (form when,
static void asmdirimm (form when,
size_index size,
//~next redo,
next data) {
/* */
//~next i;
//~for (i = 0; i < redo; ++i) {
print (when, size, data);
//~}
}
static form front (form data) { return ((data >= 4) && (data <= 7)); }
@ -359,8 +353,12 @@ void assemble (next count,
asmdirmem (1, array [index + 1]);
index += 1;
} else if (array [index] == ASMDIRIMM) {
asmdirimm (1, array [index + 1], array [index + 2]);
index += 2;
next repeat;
for (repeat = 0; repeat < array [index + 2]; ++repeat) {
asmdirimm (1, array [index + 1],
array [index + 3 + repeat]);
}
index += 2 + array [index + 2];
//~} else if (array [index] == ASMDIRREP) {
} else if ((array [index] >= REGULAR_BEGIN)
&& (array [index] <= REGULAR_END)) {

View File

@ -1,17 +1,17 @@
unix program heyo_world
/*s8 heyo = "Heyo world!\n"
s8 cyaa = "Cyaa world!\n"*/
s8 <12> heyo = "Heyo world!\n"
s8 <12> cyaa = "Cyaa world!\n"
begin
nop mov eax 1
nop mov edi 1
nop mov esi 4198618
nop mov esi heyo
nop mov edx 12
nop syscall
nop mov eax 1
nop mov edi 1
nop mov esi cyaa
nop mov edx 12
nop syscall
/*mov eax 1
mov edi 1
mov esi cyaa
mov edx 12
syscall*/
nop mov eax 60
nop mov edi 60
nop syscall

View File

@ -176,7 +176,17 @@ int main (void) {
} else if (index == token_count) {
if (isdigit (buffer [offset - size - 1]) != 0) {
if (scope_directive) {
scope = atoi (& buffer [offset - size - 1]);
tokenize (scope);
do {
leq_string (& buffer [offset], & word, & size);
index = 0;
do {
if (word == token_leq [index]) break;
} while (++index != token_count);
offset += size + 1;
tokenize (atoi (& buffer [offset - size - 1]));
} while (--scope != 0);
scope_directive = 0;
} else {
buffer [offset - 1] = '\0';

View File

@ -6,5 +6,5 @@ nop syscall
nop mov eax 60
nop mov edi 60
nop syscall
nop . heyo db 72 db 69 db 89 db 79 db 10
nop . heyo db 5 72 69 89 79 10
end