Assemble kernel on the client #1

Merged
cdo merged 72 commits from client-side-assembler into main 2026-03-18 15:21:33 +00:00
Showing only changes of commit 8d4c53ca92 - Show all commits

25
asm.js
View File

@@ -522,26 +522,21 @@ class Parser {
token_global_init(token) { token_global_init(token) {
if (token == LINE_END) { if (token == LINE_END) {
console.error( this.global.init = 0;
"ERROR: Unexpected newline in .global: expected"
+ " initial value");
this.global = undefined;
this.global_name = undefined;
this.state = State.TOP;
} else { } else {
const value = this.integer(token) ?? console.error( const value = this.integer(token) ?? console.error(
`ERROR: Unexpected token ${token} in .global: expected` `ERROR: Unexpected token ${token} in .global: expected`
+ " initial value"); + " initial value");
this.global.init = value; this.global.init = value;
const action = { }
type: Action.GLOBAL, const action = {
global: { [this.global_name]: this.global } type: Action.GLOBAL,
}; global: { [this.global_name]: this.global }
this.global = undefined; };
this.global_name = undefined; this.global = undefined;
this.state = State.TOP; this.global_name = undefined;
return action; this.state = State.TOP;
} return action;
} }
token_at_mem(token) { token_at_mem(token) {