diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9cf89ac --- /dev/null +++ b/Makefile @@ -0,0 +1,22 @@ +all: build + +clean: + rm -rf build/* + +LIBS != pkg-config --libs-only-l --libs-only-L sdl3 sdl3-image sdl3-ttf + +HARE_SOURCES != find . -name '*.ha' + +build: build/meadow + +run: build + build/meadow + +build/meadow: $(HARE_SOURCES) + hare build $(LIBS) -o build/meadow src/ + +build/meadowcli: $(HARE_SOURCES) + hare build -o build/meadowcli clisrc/ + +cli: build/meadowcli + build/meadowcli factor.rom diff --git a/assets/mascot.jpg b/assets/mascot.jpg new file mode 100644 index 0000000..35d1ab0 Binary files /dev/null and b/assets/mascot.jpg differ diff --git a/build/meadow b/build/meadow new file mode 100755 index 0000000..015cb02 Binary files /dev/null and b/build/meadow differ diff --git a/build/meadowcli b/build/meadowcli new file mode 100755 index 0000000..4b2f3b1 Binary files /dev/null and b/build/meadowcli differ diff --git a/clisrc/uxnmin.ha b/clisrc/uxnmin.ha new file mode 100644 index 0000000..f39ba60 --- /dev/null +++ b/clisrc/uxnmin.ha @@ -0,0 +1,766 @@ +use fmt; +use os; +use fs; +use io; +use strings; + +let console_vector: u16 = 0; +let ram: [0x10000] u8 = [0...]; +let dev: [0x100] u8 = [0...]; +let ptr: [2] u8 = [0...]; +let stk: [2][0x100] u8 = [[0...],[0...]]; + +fn emu_dei(port: u8) u8 = { + let val = dev[port]; + // fmt::printfln("Read {:x} from port {:x}", val, port)!; + return val; +}; + + +fn emu_deo(port: u8, value: u8) void = { + // fmt::printfln("Writing {:x} to port {:x}", value, port)!; + dev[port] = value; + switch(port) { + case 0x11 => + let high = dev[0x10]; + let low = value; + console_vector = short_from_bytes(high,low); + // fmt::printfln("Setting console_vector to: {:x}", console_vector)!; + return; + case 0x18 => + fmt::print(value: rune)!; + return; + case 0x19 => + fmt::error(value)!; + return; + case => + return; + }; +}; + + +type evalerror = !void; +type unhandled = !u8; + +type error = !(evalerror | unhandled); + +type simple_op = void; +type literal_op = struct { short: bool, ret: bool}; +type normal_op = struct { short: bool, keep: bool, ret: bool}; + +type BRK = simple_op; +type JCI = simple_op; +type JMI = simple_op; +type JSI = simple_op; +type LIT = literal_op; +type INC = normal_op; +type POP = normal_op; +type NIP = normal_op; +type SWP = normal_op; +type ROT = normal_op; +type DUP = normal_op; +type OVR = normal_op; +type EQU = normal_op; +type NEQ = normal_op; +type GTH = normal_op; +type LTH = normal_op; +type JMP = normal_op; +type JCN = normal_op; +type JSR = normal_op; +type STH = normal_op; +type LDZ = normal_op; +type STZ = normal_op; +type LDR = normal_op; +type STR = normal_op; +type LDA = normal_op; +type STA = normal_op; +type DEI = normal_op; +type DEO = normal_op; +type ADD = normal_op; +type SUB = normal_op; +type MUL = normal_op; +type DIV = normal_op; +type AND = normal_op; +type ORA = normal_op; +type EOR = normal_op; +type SFT = normal_op; + +type instruction = (BRK | JCI | JMI | JSI | LIT | INC | POP | NIP | SWP | ROT | DUP | OVR | EQU | NEQ + | GTH | LTH | JMP | JCN | JSR | STH | LDZ | STZ | LDR | STR | LDA | STA | DEI + | DEO | ADD | SUB | MUL | DIV | AND | ORA | EOR | SFT); + + +fn get_instruction(byte: u8) (instruction | error) = { + let k: bool = (byte & (0b10000000) != 0 ); + let r: bool = (byte & (0b01000000) != 0 ); + let s: bool = (byte & (0b00100000) != 0 ); + let opcode: u8 = byte & (0b00011111); + switch(opcode) { + case 0x00 => + switch(byte){ + case 0x00 => + return void: BRK; + case 0x20 => + return void: JCI; + case 0x40 => + return void: JMI; + case 0x60 => + return void: JSI; + case 0x80 => // LIT + return LIT {short=false, ret=false}; + case 0xa0 => // LIT2 + return LIT {short=true, ret=false}; + case 0xc0 => // LITr + return LIT {short=false, ret=true}; + case 0xe0 => // LIT2r + return LIT {short=true, ret=true}; + case => + return byte: unhandled; + }; + case 0x01 => + return INC {short = s, keep = k, ret = r}; + case 0x02 => + return POP {short = s, keep = k, ret = r}; + case 0x03 => + return NIP {short = s, keep = k, ret = r}; + case 0x04 => + return SWP {short = s, keep = k, ret = r}; + case 0x05 => + return ROT {short = s, keep = k, ret = r}; + case 0x06 => + return DUP {short = s, keep = k, ret = r}; + case 0x07 => + return OVR {short = s, keep = k, ret = r}; + case 0x08 => + return EQU {short = s, keep = k, ret = r}; + case 0x09 => + return NEQ {short = s, keep = k, ret = r}; + case 0x0a => + return GTH {short = s, keep = k, ret = r}; + case 0x0b => + return LTH {short = s, keep = k, ret = r}; + case 0x0c => + return JMP {short = s, keep = k, ret = r}; + case 0x0d => + return JCN {short = s, keep = k, ret = r}; + case 0x0e => + return JSR {short = s, keep = k, ret = r}; + case 0x0f => + return STH {short = s, keep = k, ret = r}; + + case 0x10 => + return LDZ {short = s, keep = k, ret = r}; + case 0x11 => + return STZ {short = s, keep = k, ret = r}; + case 0x12 => + return LDR {short = s, keep = k, ret = r}; + case 0x13 => + return STR {short = s, keep = k, ret = r}; + case 0x14 => + return LDA {short = s, keep = k, ret = r}; + case 0x15 => + return STA {short = s, keep = k, ret = r}; + case 0x16 => + return DEI {short = s, keep = k, ret = r}; + case 0x17 => + return DEO {short = s, keep = k, ret = r}; + case 0x18 => + return ADD {short = s, keep = k, ret = r}; + case 0x19 => + return SUB {short = s, keep = k, ret = r}; + case 0x1a => + return MUL {short = s, keep = k, ret = r}; + case 0x1b => + return DIV {short = s, keep = k, ret = r}; + case 0x1c => + return AND {short = s, keep = k, ret = r}; + case 0x1d => + return ORA {short = s, keep = k, ret = r}; + case 0x1e => + return EOR {short = s, keep = k, ret = r}; + case 0x1f => + return SFT {short = s, keep = k, ret = r}; + case => + return byte: unhandled; + }; +}; + +fn short_from_bytes(high: u8, low: u8) u16 = { + return (high: u16) << 8 | (low: u16); +}; + + +fn push_to_stack(ret: bool, val: (u8 | u16)) void = { + let stack = switch(ret){ + case true => + yield 1; + case false => + yield 0; + }; + match(val) { + case let bval: u8 => + stk[stack][ptr[stack]] = bval; + ptr[stack] = ptr[stack] + 1; + + case let sval: u16 => + let low: u8 = (sval & 0xFF): u8; + let high: u8 = (sval >> 8): u8; + stk[stack][ptr[stack]] = high; + ptr[stack] = ptr[stack] + 1; + stk[stack][ptr[stack]] = low; + ptr[stack] = ptr[stack] + 1; + }; +}; + +// Get value from stack, offset 0 is top of stack. +fn get_stack_val(ret: bool, short: bool, off: u8) (u8 | u16) = { + let stack = switch(ret){ + case true => + yield 1; + case false => + yield 0; + }; + + if(!short){ + let val: u8 = stk[stack][ptr[stack] - 1 - off]; + return val; + } else { + let low: u8 = stk[stack][ptr[stack]-1 - (off * 2)]; + let high: u8 = stk[stack][ptr[stack]-2 - (off * 2)]; + return short_from_bytes(high,low); + }; +}; + +fn increment_stack(ret: bool, short: bool) void = { + let stack = switch(ret){ + case true => + yield 1; + case false => + yield 0; + }; + if(short){ + ptr[stack] = ptr[stack] + 2; + } else { + ptr[stack] = ptr[stack] + 1; + }; +}; +fn decrement_stack(ret: bool, short: bool) void = { + let stack = switch(ret){ + case true => + yield 1; + case false => + yield 0; + }; + if(short){ + ptr[stack] = ptr[stack] - 2; + } else { + ptr[stack] = ptr[stack] - 1; + }; +}; + +fn pop_from_stack(keep: bool, ret: bool, short: bool) (u8 | u16) = { + let val = get_stack_val(ret, short, 0); + if(!keep) decrement_stack(ret, short); + return val; +}; + +fn pop_or_get(inst: normal_op, off: u8) (u8 | u16) = { + return switch(inst.keep) { + case false => + yield pop_from_stack(false,inst.ret,inst.short); + case true => + yield get_stack_val(inst.ret,inst.short, off); + }; +}; +fn uxn_eval(pc: u16) (done | error ) = { + // let a: u16 = 0, b: u16 = 0, c: u16 = 0, x: [2]u16 = [0...], y: [2]u16 = [0...], z: [2]u16 = [0...]; + for(true){ + // fmt::printfln("Starting eval with pc: {:x}", pc)!; + let readval = ram[pc]; + let inst: instruction = get_instruction(readval)?; + pc = pc+1; //TODO verify all pc changes + + match(inst) { + // /* BRK */ case 0x00: return 1; + case BRK => + // fmt::println("Break!")!; + return done; + // /* JCI */ case 0x20: if(DEC(0)) { IMM pc += a; } else pc += 2; break; + case JCI => + let val: u8 = pop_from_stack(false, false, false): u8; + if(val != 0) { + pc = pc + 2 + short_from_bytes(ram[pc],ram[pc+1]); //TODO, is this signed? + }else{ + pc = pc + 2; + }; + // /* JMI */ case 0x40: IMM pc += a; break; + case JMI => + pc = pc + 2 + short_from_bytes(ram[pc],ram[pc+1]); //TODO is this signed? + // /* JSI */ case 0x60: IMM PUx(pc, 1, 1) pc += a; break; + case JSI => + push_to_stack(true, pc + 2); + pc = pc + 2 + short_from_bytes(ram[pc],ram[pc+1]); //TODO is this signed? + + // /* LIT */ case 0x80: INC(0) = ram[pc++]; break; + case let lit_inst: LIT => + push_to_stack(lit_inst.ret, ram[pc]); + pc = pc + 1; + if(lit_inst.short) { + push_to_stack(lit_inst.ret, ram[pc]); + pc = pc + 1; + }; + // /* INC */ OPC(0x01,POx(a,d),PUx(a + 1,d,r)) + case let inc_inst: INC => + let val = match(pop_from_stack(inc_inst.keep,inc_inst.ret,inc_inst.short)) { + //TODO this whole match statement seems unnecessary + case let byte: u8 => + yield byte + 1; + case let short: u16 => + yield short + 1; + }; + + push_to_stack(inc_inst.ret,val); + // /* POP */ OPC(0x02,ptr[r] -= 1 + d;,{}) + case let pop_inst: POP => + if(!pop_inst.keep){ + pop_from_stack(false,pop_inst.ret,pop_inst.short); + }; + // /* NIP */ OPC(0x03,GOT(x) ptr[r] -= 1 + d;,PUT(x,r)) + case let nip_inst: NIP => + let top = pop_or_get(nip_inst,0); + let bot = pop_or_get(nip_inst,1); + push_to_stack(nip_inst.ret, top); + // /* SWP */ OPC(0x04,GOT(x) GOT(y),PUT(x,r) PUT(y,r)) + case let swp_inst: SWP => + let top = pop_or_get(swp_inst,0); + let bot = pop_or_get(swp_inst,1); + + push_to_stack(swp_inst.ret, top); + push_to_stack(swp_inst.ret, bot); + // /* ROT */ OPC(0x05,GOT(x) GOT(y) GOT(z),PUT(y,r) PUT(x,r) PUT(z,r)) + case let rot_inst: ROT => + let top = pop_or_get(rot_inst,0); + let mid = pop_or_get(rot_inst,1); + let bot = pop_or_get(rot_inst,2); + + push_to_stack(rot_inst.ret, mid); + push_to_stack(rot_inst.ret, top); + push_to_stack(rot_inst.ret, bot); + // /* DUP */ OPC(0x06,GOT(x),PUT(x,r) PUT(x,r)) + case let dup_inst: DUP => + let val = pop_from_stack(dup_inst.keep, dup_inst.ret, dup_inst.short); + push_to_stack(dup_inst.ret, val); + push_to_stack(dup_inst.ret, val); + // /* OVR */ OPC(0x07,GOT(x) GOT(y),PUT(y,r) PUT(x,r) PUT(y,r)) + case let ovr_inst: OVR => + let top = pop_or_get(ovr_inst,0); + let bot = pop_or_get(ovr_inst,1); + + push_to_stack(ovr_inst.ret, bot); + push_to_stack(ovr_inst.ret, top); + push_to_stack(ovr_inst.ret, bot); + // /* EQU */ OPC(0x08,POx(a,d) POx(b,d),PUx(b == a,0,r)) + case let equ_inst: EQU => + let top = pop_or_get(equ_inst,0); + let bot = pop_or_get(equ_inst,1); + + //TODO, I think this works, but it feels unclean with the casting + let val: u8 = if(top: u16 == bot: u16){ + yield 1; + } else { + yield 0; + }; + push_to_stack(equ_inst.ret, val); + // /* NEQ */ OPC(0x09,POx(a,d) POx(b,d),PUx(b != a,0,r)) + case let neq_inst: NEQ => + let top = pop_or_get(neq_inst,0); + let bot = pop_or_get(neq_inst,1); + + //TODO, I think this works, but it feels unclean with the casting + let val: u8 = if(top: u16 != bot: u16){ + yield 1; + } else { + yield 0; + }; + push_to_stack(neq_inst.ret, val); + // /* GTH */ OPC(0x0a,POx(a,d) POx(b,d),PUx(b > a,0,r)) + case let gth_inst: GTH => + let top = pop_or_get(gth_inst,0); + let bot = pop_or_get(gth_inst,1); + + //TODO, I think this works, but it feels unclean with the casting + let val: u8 = if(bot: u16 > top: u16){ + yield 1; + } else { + yield 0; + }; + push_to_stack(gth_inst.ret, val); + // /* LTH */ OPC(0x0b,POx(a,d) POx(b,d),PUx(b < a,0,r)) + case let lth_inst: LTH => + let top = pop_or_get(lth_inst,0); + let bot = pop_or_get(lth_inst,1); + + //TODO, I think this works, but it feels unclean with the casting + let val: u8 = if(bot: u16 < top: u16){ + yield 1; + } else { + yield 0; + }; + push_to_stack(lth_inst.ret, val); + // /* JMP */ OPC(0x0c,POx(a,d),MOV) + case let jmp_inst: JMP => + let addr = pop_or_get(jmp_inst,0); + match(addr) { + case let b: u8 => + pc = pc + b: u16; //TODO verify if pc changes are right + case let s: u16 => + pc = s; + }; + + // /* JCN */ OPC(0x0d,POx(a,d) POx(b,0),if(b) MOV) + case let jcn_inst: JCN => + let addr = pop_or_get(jcn_inst,0); + let cond: u8 = pop_or_get(normal_op {keep = jcn_inst.keep, + ret = jcn_inst.ret, + short = false}, + if(jcn_inst.short){ yield 2;} else { yield 1; } ): u8; + if( cond != 0) { + match(addr) { + case let b: u8 => + let off = b: i8: i32; + pc = (pc: i32 + off): u16; //TODO verify if pc changes are right + case let s: u16 => + pc = s; + }; + }; + // /* JSR */ OPC(0x0e,POx(a,d),PUx(pc,1,!r) MOV) + case let jsr_inst: JSR => + let addr = pop_or_get(jsr_inst,0); + push_to_stack(true, pc); + match(addr) { + case let b: u8 => + let off = b: i8: i32; + pc = (pc: i32 + off): u16; //TODO verify if pc changes are right + case let s: u16 => + pc = s; + }; + + // /* STH */ OPC(0x0f,GOT(x),PUT(x,!r)) + case let sth_inst: STH => + let val = pop_or_get(sth_inst,0); + push_to_stack(!sth_inst.ret, val); + // /* LDZ */ OPC(0x10,POx(a,0),PEK(a, x, 0xff)) + case let ldz_inst: LDZ => + let addr: u16 = pop_from_stack(ldz_inst.keep, ldz_inst.ret, false): u16 & 0x00FF; + let val = if(ldz_inst.short){ + yield short_from_bytes(ram[addr],ram[addr+1 & 0x00FF]); + } else { + yield ram[addr]; + }; + push_to_stack(ldz_inst.ret, val); + // /* STZ */ OPC(0x11,POx(a,0) GOT(y),POK(a, y, 0xff)) + case let stz_inst: STZ => + let addr: u16 = pop_or_get(normal_op{short = false, keep = stz_inst.keep, ret = stz_inst.ret}, 0): u16 & 0x00FF; + let val = if(stz_inst.short){ + let low = pop_or_get(normal_op{short = false, keep = stz_inst.keep, ret = stz_inst.ret}, 1): u8; + let high = pop_or_get(normal_op{short = false, keep = stz_inst.keep, ret = stz_inst.ret}, 2): u8; + yield short_from_bytes(high,low); + + }else{ + yield pop_or_get(stz_inst, 1): u8; + }; + match (val) { + case let b: u8 => + ram[addr] = b; + case let s: u16 => + let high = (s >> 8 ): u8; + let low = s: u8; + ram[addr] = high; + ram[addr+1 & 0x00FF] = low; + //TODO verify correct endianness + }; + // /* LDR */ OPC(0x12,POx(a,0),PEK(pc + (Sint8)a, x, 0xffff)) + case let ldr_inst: LDR => + let reladdr = (pop_from_stack(ldr_inst.keep, ldr_inst.ret, false): u16): i8; + let addr: u16 = (pc: u32: i32 + reladdr): u16; + let val = if(ldr_inst.short){ + yield short_from_bytes(ram[addr],ram[addr+1]); + } else { + yield ram[addr]; + }; + push_to_stack(ldr_inst.ret, val); + // /* STR */ OPC(0x13,POx(a,0) GOT(y),POK(pc + (Sint8)a, y, 0xffff)) + case let str_inst: STR => + let reladdr = (pop_from_stack(str_inst.keep, str_inst.ret, false): u16): i8; + let addr: u16 = (pc: u32: i32 + reladdr): u16; + let val = pop_from_stack(str_inst.keep, str_inst.ret, str_inst.short); + match (val) { + case let b: u8 => + ram[addr] = b; + case let s: u16 => + let high = (s >> 8 ): u8; + let low = s: u8; + ram[addr] = high; + ram[addr+1] = low; + //TODO verify correct endianness + }; + // /* LDA */ OPC(0x14,POx(a,1),PEK(a, x, 0xffff)) + case let lda_inst: LDA => + let addr: u16 = pop_from_stack(lda_inst.keep, lda_inst.ret, true): u16; + let val = if(lda_inst.short){ + yield short_from_bytes(ram[addr],ram[addr+1]); + } else { + yield ram[addr]; + }; + push_to_stack(lda_inst.ret, val); + // /* STA */ OPC(0x15,POx(a,1) GOT(y),POK(a, y, 0xffff)) + case let sta_inst: STA => + let addr: u16 = pop_from_stack(sta_inst.keep, sta_inst.ret, true): u16; + let val = pop_from_stack(sta_inst.keep, sta_inst.ret, sta_inst.short); + match (val) { + case let b: u8 => + ram[addr] = b; + case let s: u16 => + let high = (s >> 8 ): u8; + let low = s: u8; + ram[addr] = high; + ram[addr+1] = low; + //TODO verify correct endianness + }; + // /* DEI */ OPC(0x16,POx(a,0),DEI(a, x)) + case let dei_inst: DEI => + // fmt::println("DEI Instruction")!; + let port: u8 = pop_from_stack(dei_inst.keep, dei_inst.ret, false): u8; + let val = if(dei_inst.short){ + yield short_from_bytes(emu_dei(port),emu_dei(port+1)); + }else{ + yield emu_dei(port); + }; + push_to_stack(dei_inst.ret,val); + // /* DEO */ OPC(0x17,POx(a,0) GOT(y),DEO(a, y)) + case let deo_inst: DEO => + let port: u8 = pop_or_get(normal_op{short = false, keep = deo_inst.keep, ret = deo_inst.ret}, 0): u8; + if(deo_inst.short){ + let low = pop_or_get(normal_op{short = false, keep = deo_inst.keep, ret = deo_inst.ret}, 1): u8; + let high = pop_or_get(normal_op{short = false, keep = deo_inst.keep, ret = deo_inst.ret}, 2): u8; + emu_deo(port,high); + emu_deo(port+1,low); + }else{ + let val = pop_or_get(deo_inst, 1): u8; + emu_deo(port,val); + }; + // /* ADD */ OPC(0x18,POx(a,d) POx(b,d),PUx(b + a, d,r)) + case let add_inst: ADD => + let top = pop_or_get(add_inst,0); + let bot = pop_or_get(add_inst,1); + let res = if(!add_inst.short){ + yield (top: u8 + bot: u8); + } else { + yield (top: u16 + bot: u16); + }; + push_to_stack(add_inst.ret, res); + // /* SUB */ OPC(0x19,POx(a,d) POx(b,d),PUx(b - a, d,r)) + case let sub_inst: SUB => + let top = pop_or_get(sub_inst,0); + let bot = pop_or_get(sub_inst,1); + let res = if(!sub_inst.short){ + yield (bot: u8 - top: u8); + } else { + yield (bot: u16 - top: u16); + }; + push_to_stack(sub_inst.ret, res); + // /* MUL */ OPC(0x1a,POx(a,d) POx(b,d),PUx(b * a, d,r)) + case let mul_inst: MUL => + let top = pop_or_get(mul_inst,0); + let bot = pop_or_get(mul_inst,1); + let res = if(!mul_inst.short){ + yield (bot: u8 * top: u8); + } else { + yield (bot: u16 * top: u16); + }; + push_to_stack(mul_inst.ret, res); + // /* DIV */ OPC(0x1b,POx(a,d) POx(b,d),PUx(a ? b / a : 0, d,r)) + case let div_inst: DIV => + let top = pop_or_get(div_inst,0); + let bot = pop_or_get(div_inst,1); + + let res = if(!div_inst.short){ + assert(bot is u8); + assert(top is u8); + if(top: u8 == 0) yield top; + yield (bot: u8 / top: u8): u8; + } else { + assert(bot is u16); + assert(top is u16); + if(top: u16 == 0) yield top; + yield (bot: u16 / top: u16): u16; + };//TODO handle rounding and edge cases with division + push_to_stack(div_inst.ret, res); + // /* AND */ OPC(0x1c,POx(a,d) POx(b,d),PUx(b & a, d,r)) + case let and_inst: AND => + let top = pop_or_get(and_inst,0); + let bot = pop_or_get(and_inst,1); + let res = if(!and_inst.short){ + yield (bot: u8 & top: u8); + } else { + yield (bot: u16 & top: u16); + }; + push_to_stack(and_inst.ret, res); + // /* ORA */ OPC(0x1d,POx(a,d) POx(b,d),PUx(b | a, d,r)) + case let ora_inst: ORA => + let top = pop_or_get(ora_inst,0); + let bot = pop_or_get(ora_inst,1); + let res = if(!ora_inst.short){ + yield (bot: u8 | top: u8); + } else { + yield (bot: u16 | top: u16); + }; + push_to_stack(ora_inst.ret, res); + // /* EOR */ OPC(0x1e,POx(a,d) POx(b,d),PUx(b ^ a, d,r)) + case let eor_inst: EOR => + let top = pop_or_get(eor_inst,0); + let bot = pop_or_get(eor_inst,1); + let res = if(!eor_inst.short){ + yield (bot: u8 ^ top: u8); + } else { + yield (bot: u16 ^ top: u16); + }; + push_to_stack(eor_inst.ret, res); + // /* SFT */ OPC(0x1f,POx(a,0) POx(b,d),PUx(b >> (a & 0xf) << (a >> 4), d,r)) + case let sft_inst: SFT => + let shifts: u8 = pop_or_get(normal_op{short = false, keep = sft_inst.keep, ret = sft_inst.ret}, 0): u8; + let rightshifts = shifts & 0b00001111; + let leftshifts = (shifts & 0b11110000) >> 4; + if(sft_inst.short){ //TODO, this seems like it can be cleaned up a bit + let low = pop_or_get(normal_op{short = false, keep = sft_inst.keep, ret = sft_inst.ret}, 1): u8; + let high = pop_or_get(normal_op{short = false, keep = sft_inst.keep, ret = sft_inst.ret}, 2): u8; + let val = short_from_bytes(high,low); + let res = (val >> rightshifts ) << leftshifts; + push_to_stack(sft_inst.ret, res); + }else{ + let val = pop_or_get(sft_inst, 1): u8; + let res = (val >> rightshifts ) << leftshifts; + push_to_stack(sft_inst.ret, res); + }; + + + case => + return readval: unhandled; + }; + }; + + + // return evalerror; +}; + +fn console_input(c: u8, ctype: u8) (done | error) = { + dev[0x12] = c; + dev[0x17] = ctype; + if(console_vector != 0){ + // fmt::println("Evaluating Console Vector")!; + uxn_eval(console_vector)?; + }; //TODO implement eval + return done; +}; + + + +// Converts an error into a user-friendly string +fn strerror(err: error) str = { + match (err) { + case evalerror => + return "Reached unexpected part of eval code"; + case let val: unhandled => + return fmt::asprintf("Unknown Opcode read: {:x}", val: u8)!; + }; +}; + + +export fn main() void = { + if(len(os::args) < 2){ + fmt::printf("usage: %s file.rom [args..]\n")!; + return; + }; + let path = os::args[1]; + //Open rom file + let romfile = match (os::open(path,fs::flag::RDONLY)) { + case let file: io::file => + yield file; + case let err: fs::error => + fmt::fatalf("Error opening {}: {}", path, fs::strerror(err)); + }; + //Copy rom into ram + let bytesread = match (io::read(romfile,ram[0x100..0xff00])){ + case let bytes: size => + yield bytes; + case let eof: io::EOF => + fmt::fatalf("Empty Rom"); + case let err: io::error => + fmt::fatalf("Error reading: {}", io::strerror(err)); + }; + io::close(romfile)!; //TODO, isn't there some kind of oversized roms? + // fread(&ram[0x100], 0xff00, 1, f), fclose(f); + let hasargs = len(os::args) > 2; + if(hasargs){ + dev[0x17] = 1; + }; + // dev[0x17] = argc > 2; + + let eval = match (uxn_eval(0x100)) { + case done => + yield done; + case let val: u8 => + fmt::fatalf("Unhandled Opcode: {:x}", val); + }; + //TODO see if the above needs to not run if console vector not set + if(console_vector != 0){ + let args = os::args[2..]; + let i: u8 = 0; + let argcount = len(args): u8; + for (let arg .. args){ + // fmt::println("Console input args")!; + for(let char: u8 .. strings::toutf8(arg)){ + // fmt::printfln("Console input arg char: {:x}", char)!; + match (console_input(char,2)) { + case done => + yield done; + case let val: u8 => + fmt::fatalf("Unhandled Opcode: {:x}", val); + }; + }; + let ctype: u8 = if(i == (argcount - 1)){ + yield 4; + } else { + yield 3; + }; + match (console_input('\n',ctype)) { + case done => + yield done; + case let val: u8 => + fmt::fatalf("Unhandled Opcode: {:x}", val); + }; + i+=1; //TODO using i here seems inelegant + }; + for( dev[0x0f] == 0; i+=1 ){ + let buf: [1]u8 = [0]; + let count = io::read(os::stdin, buf)!; + // fmt::println("Read input")!; + if(count != 0) { + match (console_input(buf[0],1)) { + case done => + yield done; + case let val: u8 => + fmt::fatalf("Unhandled Opcode: {:x}", val); + }; + // fmt::println("Retuned from console_input")!; + }; + }; + match (console_input('\n',4)) { + case done => + yield done; + case let val: u8 => + fmt::fatalf("Unhandled Opcode: {:x}", val); + }; + }; + +}; diff --git a/src/font.ha b/src/font.ha new file mode 100644 index 0000000..08980a0 --- /dev/null +++ b/src/font.ha @@ -0,0 +1,604 @@ +// tiny.txt +// Font: Tiny +// Created By: Matthew Welch +// E-Mail: matt@squaregear.net +// Web Address: http://www.squaregear.net/fonts/ +// +// My fonts are all free. You can use them for personal or commercial projects, +// and I ask for no money. I would, however, love to hear from you. If you use +// my fonts for something please e-mail me letting me know how you used it. Send +// me a copy if you can or let me know where I can find your work. You are under +// no obligation to do this, I just like to see how my fonts get used. +// +// A license.txt file should have been included with this font, explaining the +// license under which it is made available. You can also read it at: +// +// http://www.squaregear.net/fonts/license.shtml +// +// About the font: +// +// Tiny is, I believe, the smallest possible font (in pixel size). It stands at +// a lofty four pixels tall (five if you count descenders), yet it still contains +// all the printable ASCII characters. Presented here in TrueType format, you can +// print it out at any size you want, in order to make it actually readable. If +// you do want to show it in all its four pixel glory I recommend you render it +// first at a larger size (9 point worked well for me) and then shrink it down. +// +// license.txt +// Copyright (C) 2004 by Matthew Welch +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of +// this font software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights to +// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +// of the Software, and to permit persons to whom the Software is furnished to do +// so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +let tiny_ttf: [_]u8 = [ + 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x80, 0x00, 0x03, 0x00, 0x20, + 0x4f, 0x53, 0x2f, 0x32, 0x7a, 0x61, 0x7a, 0x16, 0x00, 0x00, 0x00, 0xac, + 0x00, 0x00, 0x00, 0x4e, 0x63, 0x6d, 0x61, 0x70, 0x07, 0x3b, 0x08, 0x5a, + 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x01, 0xd2, 0x67, 0x6c, 0x79, 0x66, + 0x6b, 0x16, 0x56, 0x6e, 0x00, 0x00, 0x02, 0xd0, 0x00, 0x00, 0x11, 0xf4, + 0x68, 0x65, 0x61, 0x64, 0xdb, 0x9f, 0xe5, 0xd7, 0x00, 0x00, 0x14, 0xc4, + 0x00, 0x00, 0x00, 0x36, 0x68, 0x68, 0x65, 0x61, 0x07, 0xd2, 0x05, 0x14, + 0x00, 0x00, 0x14, 0xfc, 0x00, 0x00, 0x00, 0x24, 0x68, 0x6d, 0x74, 0x78, + 0x30, 0xb0, 0xff, 0xff, 0x00, 0x00, 0x15, 0x20, 0x00, 0x00, 0x01, 0x90, + 0x6c, 0x6f, 0x63, 0x61, 0xde, 0xd4, 0xda, 0x87, 0x00, 0x00, 0x16, 0xb0, + 0x00, 0x00, 0x00, 0xca, 0x6d, 0x61, 0x78, 0x70, 0x00, 0x6b, 0x00, 0x22, + 0x00, 0x00, 0x17, 0x7c, 0x00, 0x00, 0x00, 0x20, 0x6e, 0x61, 0x6d, 0x65, + 0x47, 0xfd, 0xed, 0x65, 0x00, 0x00, 0x17, 0x9c, 0x00, 0x00, 0x02, 0x3f, + 0x70, 0x6f, 0x73, 0x74, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x19, 0xdc, + 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x03, 0x0c, 0x01, 0x90, 0x00, 0x05, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x73, 0x66, 0x74, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x7f, + 0x03, 0xe8, 0xff, 0x38, 0x00, 0x00, 0x03, 0xe8, 0x00, 0xc8, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x01, 0x1a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0xb8, 0x00, 0x00, + 0x00, 0x22, 0x00, 0x20, 0x00, 0x04, 0x00, 0x02, 0x00, 0x20, 0x00, 0x29, + 0x00, 0x2a, 0x00, 0x2e, 0x00, 0x30, 0x00, 0x34, 0x00, 0x39, 0x00, 0x40, + 0x00, 0x57, 0x00, 0x5a, 0x00, 0x60, 0x00, 0x64, 0x00, 0x66, 0x00, 0x7a, + 0x00, 0x7e, 0x00, 0x7f, 0xff, 0xff, 0x00, 0x00, 0x00, 0x20, 0x00, 0x21, + 0x00, 0x2a, 0x00, 0x2b, 0x00, 0x2f, 0x00, 0x31, 0x00, 0x35, 0x00, 0x3a, + 0x00, 0x41, 0x00, 0x58, 0x00, 0x5b, 0x00, 0x61, 0x00, 0x65, 0x00, 0x67, + 0x00, 0x7b, 0x00, 0x7f, 0xff, 0xff, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, + 0x00, 0x23, 0x00, 0x00, 0x00, 0x08, 0x00, 0x09, 0x00, 0x00, 0xff, 0xdd, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xa2, 0x00, 0x00, 0xff, 0xa3, 0xff, 0xe5, + 0xff, 0xd3, 0x00, 0x01, 0x00, 0x22, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, + 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x26, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x09, 0x00, 0x35, 0x00, 0x53, 0x00, 0x43, 0x00, 0x54, + 0x00, 0x55, 0x00, 0x56, 0x00, 0x58, 0x00, 0x57, 0x00, 0x59, 0x00, 0x4d, + 0x00, 0x36, 0x00, 0x37, 0x00, 0x38, 0x00, 0x3d, 0x00, 0x08, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0xff, 0x38, 0x02, 0x58, 0x03, 0xe8, 0x00, 0x03, + 0x00, 0x00, 0x05, 0x09, 0x02, 0x01, 0x2c, 0xfe, 0xd4, 0x01, 0x2c, 0x01, + 0x2c, 0xc8, 0x02, 0xbc, 0x01, 0xf4, 0xfe, 0x0c, 0x00, 0x02, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x58, 0x02, 0x58, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, + 0x33, 0x35, 0x33, 0x35, 0x23, 0x35, 0x21, 0x11, 0x01, 0x15, 0x23, 0x35, + 0xc8, 0xc8, 0xc8, 0x01, 0x90, 0xfe, 0x70, 0xc8, 0xc8, 0xc8, 0xc8, 0xfd, + 0xa8, 0x01, 0x90, 0xc8, 0xc8, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x58, 0x03, 0x20, 0x00, 0x09, 0x00, 0x0d, 0x00, 0x00, 0x31, 0x11, + 0x33, 0x15, 0x33, 0x15, 0x23, 0x15, 0x33, 0x15, 0x11, 0x33, 0x15, 0x23, + 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0x03, 0x20, 0xc8, 0xc8, 0xc8, 0xc8, + 0x01, 0x90, 0xc8, 0x4d, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x02, 0x58, + 0x02, 0x58, 0x00, 0x03, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x33, 0x35, + 0x21, 0x15, 0x01, 0x15, 0x23, 0x35, 0x29, 0x01, 0x35, 0x21, 0xc8, 0x01, + 0x90, 0xfe, 0x70, 0xc8, 0x02, 0x58, 0xfe, 0x70, 0x01, 0x90, 0xc8, 0xc8, + 0x01, 0x90, 0xc8, 0xc8, 0xc8, 0x5d, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x58, 0x03, 0x20, 0x00, 0x09, 0x00, 0x0d, 0x00, 0x00, 0x33, 0x35, + 0x33, 0x35, 0x23, 0x35, 0x33, 0x35, 0x33, 0x11, 0x01, 0x15, 0x23, 0x35, + 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xfe, 0x70, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, + 0xfc, 0xe0, 0x01, 0x90, 0xc8, 0xc8, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x58, 0x02, 0x58, 0x00, 0x0b, 0x00, 0x00, 0x33, 0x35, 0x23, 0x35, + 0x33, 0x35, 0x33, 0x15, 0x33, 0x15, 0x23, 0x15, 0xc8, 0xc8, 0xc8, 0xc8, + 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0x00, 0x02, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x90, 0x03, 0x20, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, + 0x31, 0x11, 0x33, 0x15, 0x33, 0x15, 0x23, 0x15, 0x11, 0x35, 0x33, 0x15, + 0xc8, 0xc8, 0xc8, 0xc8, 0x02, 0x58, 0xc8, 0xc8, 0xc8, 0x02, 0x58, 0xc8, + 0xc8, 0x00, 0x00, 0x01, 0x00, 0x00, 0xff, 0x38, 0x01, 0x90, 0x02, 0x58, + 0x00, 0x07, 0x00, 0x00, 0x33, 0x35, 0x23, 0x11, 0x21, 0x11, 0x21, 0x35, + 0xc8, 0xc8, 0x01, 0x90, 0xfe, 0x70, 0xc8, 0x01, 0x90, 0xfc, 0xe0, 0xc8, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x02, 0x58, 0x03, 0x20, 0x00, 0x07, + 0x00, 0x0b, 0x00, 0x00, 0x31, 0x11, 0x33, 0x15, 0x33, 0x15, 0x23, 0x11, + 0x13, 0x33, 0x11, 0x23, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0x03, 0x20, + 0xc8, 0xc8, 0xfe, 0x70, 0x01, 0x90, 0xfe, 0x70, 0x00, 0x02, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xc8, 0x03, 0x20, 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, + 0x31, 0x11, 0x33, 0x11, 0x03, 0x35, 0x33, 0x15, 0xc8, 0xc8, 0xc8, 0x01, + 0x90, 0xfe, 0x70, 0x02, 0x58, 0xc8, 0xc8, 0x01, 0x00, 0x02, 0x00, 0x00, + 0xff, 0x38, 0x00, 0xc8, 0x03, 0x20, 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, + 0x15, 0x11, 0x33, 0x11, 0x03, 0x35, 0x33, 0x15, 0xc8, 0xc8, 0xc8, 0xc8, + 0x02, 0x58, 0xfd, 0xa8, 0x03, 0x20, 0xc8, 0xc8, 0x00, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x58, 0x03, 0x20, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x0f, + 0x00, 0x00, 0x31, 0x11, 0x33, 0x11, 0x33, 0x15, 0x23, 0x15, 0x37, 0x33, + 0x15, 0x23, 0x11, 0x35, 0x33, 0x15, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, + 0xc8, 0x03, 0x20, 0xfe, 0x70, 0xc8, 0xc8, 0xc8, 0xc8, 0x01, 0x90, 0xc8, + 0xc8, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x03, 0x20, + 0x00, 0x03, 0x00, 0x00, 0x31, 0x11, 0x33, 0x11, 0xc8, 0x03, 0x20, 0xfc, + 0xe0, 0x18, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x03, 0xe8, 0x02, 0x58, + 0x00, 0x05, 0x00, 0x09, 0x00, 0x0d, 0x00, 0x11, 0x00, 0x00, 0x31, 0x11, + 0x21, 0x15, 0x23, 0x11, 0x13, 0x33, 0x11, 0x23, 0x13, 0x35, 0x33, 0x15, + 0x19, 0x01, 0x33, 0x11, 0x01, 0x90, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, + 0xc8, 0x02, 0x58, 0xc8, 0xfe, 0x70, 0x01, 0x90, 0xfe, 0x70, 0x01, 0x90, + 0xc8, 0xc8, 0xfe, 0x70, 0x01, 0x90, 0xfe, 0x70, 0x00, 0x02, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x58, 0x02, 0x58, 0x00, 0x05, 0x00, 0x09, 0x00, 0x00, + 0x31, 0x11, 0x21, 0x15, 0x23, 0x11, 0x13, 0x33, 0x11, 0x23, 0x01, 0x90, + 0xc8, 0xc8, 0xc8, 0xc8, 0x02, 0x58, 0xc8, 0xfe, 0x70, 0x01, 0x90, 0xfe, + 0x70, 0x90, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x02, 0x58, 0x02, 0x58, + 0x00, 0x03, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x0f, 0x00, 0x00, 0x33, 0x35, + 0x33, 0x15, 0x03, 0x15, 0x23, 0x35, 0x21, 0x23, 0x35, 0x33, 0x11, 0x35, + 0x33, 0x15, 0xc8, 0xc8, 0xc8, 0xc8, 0x01, 0x90, 0xc8, 0xc8, 0xc8, 0xc8, + 0xc8, 0x01, 0x90, 0xc8, 0xc8, 0xc8, 0xfe, 0x70, 0xc8, 0xc8, 0x00, 0x02, + 0x00, 0x00, 0xff, 0x38, 0x02, 0x58, 0x02, 0x58, 0x00, 0x09, 0x00, 0x0d, + 0x00, 0x00, 0x15, 0x11, 0x21, 0x15, 0x23, 0x15, 0x33, 0x15, 0x23, 0x15, + 0x13, 0x33, 0x15, 0x23, 0x01, 0x90, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, + 0xc8, 0x03, 0x20, 0xc8, 0xc8, 0xc8, 0xc8, 0x02, 0x58, 0xc8, 0x00, 0x02, + 0x00, 0x00, 0xff, 0x38, 0x02, 0x58, 0x02, 0x58, 0x00, 0x09, 0x00, 0x0d, + 0x00, 0x00, 0x33, 0x35, 0x33, 0x35, 0x23, 0x35, 0x21, 0x11, 0x23, 0x35, + 0x03, 0x15, 0x23, 0x35, 0xc8, 0xc8, 0xc8, 0x01, 0x90, 0xc8, 0xc8, 0xc8, + 0xc8, 0xc8, 0xc8, 0xfc, 0xe0, 0xc8, 0x01, 0x90, 0xc8, 0xc8, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x90, 0x02, 0x58, 0x00, 0x05, 0x00, 0x00, + 0x31, 0x11, 0x21, 0x15, 0x23, 0x11, 0x01, 0x90, 0xc8, 0x02, 0x58, 0xc8, + 0xfe, 0x70, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x02, 0x58, 0x02, 0x58, + 0x00, 0x07, 0x00, 0x00, 0x31, 0x35, 0x33, 0x11, 0x21, 0x15, 0x23, 0x11, + 0xc8, 0x01, 0x90, 0xc8, 0xc8, 0x01, 0x90, 0xc8, 0xfe, 0x70, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x58, 0x03, 0x20, 0x00, 0x0b, 0x00, 0x00, + 0x33, 0x11, 0x23, 0x35, 0x33, 0x35, 0x33, 0x15, 0x33, 0x15, 0x23, 0x11, + 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0x01, 0x90, 0xc8, 0xc8, 0xc8, 0xc8, + 0xfe, 0x70, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x02, 0x58, 0x02, 0x58, + 0x00, 0x05, 0x00, 0x09, 0x00, 0x00, 0x01, 0x11, 0x21, 0x35, 0x33, 0x11, + 0x03, 0x23, 0x11, 0x33, 0x02, 0x58, 0xfe, 0x70, 0xc8, 0xc8, 0xc8, 0xc8, + 0x02, 0x58, 0xfd, 0xa8, 0xc8, 0x01, 0x90, 0xfe, 0x70, 0x01, 0x90, 0x40, + 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x02, 0x58, 0x02, 0x58, 0x00, 0x03, + 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x33, 0x35, 0x33, 0x15, 0x03, 0x11, + 0x23, 0x11, 0x01, 0x11, 0x33, 0x11, 0xc8, 0xc8, 0xc8, 0xc8, 0x01, 0x90, + 0xc8, 0xc8, 0xc8, 0x02, 0x58, 0xfe, 0x70, 0x01, 0x90, 0xfe, 0x70, 0x01, + 0x90, 0xfe, 0x70, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x03, 0xe8, + 0x02, 0x58, 0x00, 0x03, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x0f, 0x00, 0x13, + 0x00, 0x00, 0x33, 0x35, 0x33, 0x15, 0x03, 0x11, 0x23, 0x11, 0x01, 0x35, + 0x33, 0x1d, 0x01, 0x35, 0x33, 0x15, 0x35, 0x11, 0x33, 0x11, 0xc8, 0xc8, + 0xc8, 0xc8, 0x01, 0x90, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0x02, 0x58, 0xfe, + 0x70, 0x01, 0x90, 0xfe, 0x70, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0x01, + 0x90, 0xfe, 0x70, 0x04, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x02, 0x58, + 0x02, 0x58, 0x00, 0x03, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x0f, 0x00, 0x13, + 0x00, 0x00, 0x37, 0x35, 0x33, 0x1d, 0x01, 0x35, 0x33, 0x15, 0x03, 0x35, + 0x33, 0x15, 0x21, 0x35, 0x33, 0x15, 0x03, 0x35, 0x33, 0x15, 0xc8, 0xc8, + 0xc8, 0xc8, 0xc8, 0xfd, 0xa8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, + 0xc8, 0xc8, 0x01, 0x90, 0xc8, 0xc8, 0xc8, 0xc8, 0xfe, 0x70, 0xc8, 0xc8, + 0x00, 0x02, 0x00, 0x00, 0xff, 0x38, 0x02, 0x58, 0x02, 0x58, 0x00, 0x09, + 0x00, 0x0d, 0x00, 0x00, 0x35, 0x11, 0x33, 0x15, 0x33, 0x35, 0x33, 0x11, + 0x23, 0x35, 0x1d, 0x01, 0x21, 0x35, 0xc8, 0xc8, 0xc8, 0xc8, 0xfe, 0x70, + 0xc8, 0x01, 0x90, 0xc8, 0xc8, 0xfd, 0xa8, 0xc8, 0xc8, 0xc8, 0xc8, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x02, 0x58, 0x02, 0x58, 0x00, 0x0b, + 0x00, 0x00, 0x31, 0x35, 0x33, 0x35, 0x23, 0x35, 0x21, 0x15, 0x23, 0x15, + 0x33, 0x15, 0xc8, 0xc8, 0x02, 0x58, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, + 0xc8, 0xc8, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x02, 0x58, 0x03, 0x20, + 0x00, 0x0b, 0x00, 0x0f, 0x00, 0x00, 0x31, 0x11, 0x33, 0x15, 0x33, 0x35, + 0x33, 0x11, 0x23, 0x35, 0x23, 0x15, 0x11, 0x35, 0x33, 0x15, 0xc8, 0xc8, + 0xc8, 0xc8, 0xc8, 0xc8, 0x02, 0x58, 0xc8, 0xc8, 0xfd, 0xa8, 0xc8, 0xc8, + 0x02, 0x58, 0xc8, 0xc8, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x02, 0x58, + 0x03, 0x20, 0x00, 0x0b, 0x00, 0x00, 0x31, 0x11, 0x21, 0x15, 0x33, 0x11, + 0x23, 0x35, 0x23, 0x15, 0x33, 0x15, 0x01, 0x90, 0xc8, 0xc8, 0xc8, 0xc8, + 0x03, 0x20, 0xc8, 0xfe, 0x70, 0xc8, 0xc8, 0xc8, 0x00, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x58, 0x03, 0x20, 0x00, 0x03, 0x00, 0x07, 0x00, 0x0b, + 0x00, 0x00, 0x35, 0x11, 0x33, 0x19, 0x01, 0x35, 0x21, 0x15, 0x01, 0x35, + 0x21, 0x15, 0xc8, 0x01, 0x90, 0xfe, 0x70, 0x01, 0x90, 0xc8, 0x01, 0x90, + 0xfe, 0x70, 0x01, 0x90, 0xc8, 0xc8, 0xfd, 0xa8, 0xc8, 0xc8, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x58, 0x03, 0x20, 0x00, 0x07, 0x00, 0x0b, + 0x00, 0x00, 0x31, 0x11, 0x21, 0x15, 0x23, 0x11, 0x33, 0x15, 0x35, 0x11, + 0x33, 0x11, 0x01, 0x90, 0xc8, 0xc8, 0xc8, 0x03, 0x20, 0xc8, 0xfe, 0x70, + 0xc8, 0xc8, 0x01, 0x90, 0xfe, 0x70, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x58, 0x03, 0x20, 0x00, 0x09, 0x00, 0x00, 0x31, 0x11, 0x21, 0x15, + 0x23, 0x15, 0x23, 0x15, 0x21, 0x15, 0x02, 0x58, 0xc8, 0xc8, 0x01, 0x90, + 0x03, 0x20, 0xc8, 0xc8, 0xc8, 0xc8, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x58, 0x03, 0x20, 0x00, 0x09, 0x00, 0x00, 0x31, 0x11, 0x21, 0x15, + 0x21, 0x15, 0x33, 0x15, 0x23, 0x15, 0x02, 0x58, 0xfe, 0x70, 0xc8, 0xc8, + 0x03, 0x20, 0xc8, 0xc8, 0xc8, 0xc8, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x58, 0x03, 0x20, 0x00, 0x03, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, + 0x35, 0x11, 0x33, 0x19, 0x01, 0x35, 0x21, 0x15, 0x01, 0x35, 0x33, 0x35, + 0x33, 0x11, 0xc8, 0x01, 0x90, 0xfe, 0x70, 0xc8, 0xc8, 0xc8, 0x01, 0x90, + 0xfe, 0x70, 0x01, 0x90, 0xc8, 0xc8, 0xfd, 0xa8, 0xc8, 0xc8, 0xfe, 0x70, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x02, 0x58, 0x03, 0x20, 0x00, 0x0b, + 0x00, 0x00, 0x31, 0x11, 0x33, 0x11, 0x33, 0x11, 0x33, 0x11, 0x23, 0x35, + 0x23, 0x15, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0x03, 0x20, 0xfe, 0x70, 0x01, + 0x90, 0xfc, 0xe0, 0xc8, 0xc8, 0xc8, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x58, 0x03, 0x20, 0x00, 0x0b, 0x00, 0x00, 0x31, 0x35, 0x33, 0x11, + 0x23, 0x35, 0x21, 0x15, 0x23, 0x11, 0x33, 0x15, 0xc8, 0xc8, 0x02, 0x58, + 0xc8, 0xc8, 0xc8, 0x01, 0x90, 0xc8, 0xc8, 0xfe, 0x70, 0xc8, 0x00, 0x03, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x58, 0x03, 0x20, 0x00, 0x03, 0x00, 0x07, + 0x00, 0x0b, 0x00, 0x00, 0x33, 0x35, 0x33, 0x15, 0x27, 0x23, 0x35, 0x33, + 0x17, 0x11, 0x33, 0x11, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, + 0xc8, 0xc8, 0xc8, 0xc8, 0x02, 0x58, 0xfd, 0xa8, 0x00, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x03, 0x20, 0x03, 0x20, 0x00, 0x09, 0x00, 0x0d, 0x00, 0x11, + 0x00, 0x00, 0x31, 0x11, 0x33, 0x11, 0x33, 0x35, 0x33, 0x11, 0x21, 0x15, + 0x01, 0x35, 0x33, 0x15, 0x03, 0x33, 0x15, 0x23, 0xc8, 0xc8, 0xc8, 0xfe, + 0x70, 0x01, 0x90, 0xc8, 0xc8, 0xc8, 0xc8, 0x03, 0x20, 0xfe, 0x70, 0xc8, + 0xfe, 0x70, 0xc8, 0x02, 0x58, 0xc8, 0xc8, 0xfe, 0x70, 0xc8, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x58, 0x03, 0x20, 0x00, 0x05, 0x00, 0x00, + 0x31, 0x11, 0x33, 0x11, 0x21, 0x15, 0xc8, 0x01, 0x90, 0x03, 0x20, 0xfd, + 0xa8, 0xc8, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x20, + 0x00, 0x07, 0x00, 0x0b, 0x00, 0x13, 0x00, 0x00, 0x31, 0x11, 0x33, 0x15, + 0x33, 0x15, 0x23, 0x11, 0x37, 0x35, 0x33, 0x15, 0x3d, 0x01, 0x33, 0x35, + 0x33, 0x11, 0x23, 0x11, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, + 0x03, 0x20, 0xc8, 0xc8, 0xfe, 0x70, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, + 0xfc, 0xe0, 0x01, 0x90, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x03, 0x20, + 0x03, 0x20, 0x00, 0x07, 0x00, 0x0f, 0x00, 0x00, 0x31, 0x11, 0x33, 0x15, + 0x33, 0x15, 0x23, 0x11, 0x37, 0x35, 0x33, 0x11, 0x33, 0x11, 0x23, 0x35, + 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0x03, 0x20, 0xc8, 0xc8, 0xfe, + 0x70, 0xc8, 0xc8, 0x01, 0x90, 0xfc, 0xe0, 0xc8, 0x00, 0x04, 0x00, 0x00, + 0x00, 0x00, 0x03, 0x20, 0x03, 0x20, 0x00, 0x03, 0x00, 0x07, 0x00, 0x0b, + 0x00, 0x0f, 0x00, 0x00, 0x35, 0x11, 0x33, 0x19, 0x01, 0x35, 0x21, 0x15, + 0x01, 0x35, 0x21, 0x15, 0x11, 0x33, 0x11, 0x23, 0xc8, 0x01, 0x90, 0xfe, + 0x70, 0x01, 0x90, 0xc8, 0xc8, 0xc8, 0x01, 0x90, 0xfe, 0x70, 0x01, 0x90, + 0xc8, 0xc8, 0xfd, 0xa8, 0xc8, 0xc8, 0x02, 0x58, 0xfe, 0x70, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x58, 0x03, 0x20, 0x00, 0x09, 0x00, 0x0d, + 0x00, 0x00, 0x31, 0x11, 0x21, 0x15, 0x23, 0x15, 0x33, 0x15, 0x23, 0x15, + 0x13, 0x35, 0x33, 0x15, 0x01, 0x90, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0x03, + 0x20, 0xc8, 0xc8, 0xc8, 0xc8, 0x01, 0x90, 0xc8, 0xc8, 0x00, 0x00, 0x04, + 0x00, 0x00, 0xff, 0x38, 0x03, 0x20, 0x03, 0x20, 0x00, 0x03, 0x00, 0x07, + 0x00, 0x0d, 0x00, 0x11, 0x00, 0x00, 0x35, 0x11, 0x33, 0x19, 0x01, 0x35, + 0x21, 0x15, 0x01, 0x35, 0x21, 0x11, 0x23, 0x35, 0x13, 0x33, 0x11, 0x23, + 0xc8, 0x01, 0x90, 0xfe, 0x70, 0x01, 0x90, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, + 0x01, 0x90, 0xfe, 0x70, 0x01, 0x90, 0xc8, 0xc8, 0xfd, 0xa8, 0xc8, 0xfe, + 0x70, 0xc8, 0x02, 0x58, 0xfe, 0x70, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x58, 0x03, 0x20, 0x00, 0x09, 0x00, 0x0d, 0x00, 0x11, 0x00, 0x00, + 0x31, 0x11, 0x21, 0x15, 0x23, 0x15, 0x33, 0x15, 0x23, 0x15, 0x13, 0x35, + 0x33, 0x15, 0x07, 0x33, 0x15, 0x23, 0x01, 0x90, 0xc8, 0xc8, 0xc8, 0xc8, + 0xc8, 0xc8, 0xc8, 0xc8, 0x03, 0x20, 0xc8, 0xc8, 0xc8, 0xc8, 0x01, 0x90, + 0xc8, 0xc8, 0xc8, 0xc8, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x02, 0x58, + 0x03, 0x20, 0x00, 0x03, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x0f, 0x00, 0x00, + 0x31, 0x35, 0x21, 0x15, 0x3d, 0x01, 0x33, 0x15, 0x25, 0x23, 0x35, 0x33, + 0x31, 0x35, 0x21, 0x15, 0x01, 0x90, 0xc8, 0xfe, 0x70, 0xc8, 0xc8, 0x01, + 0x90, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x58, 0x03, 0x20, 0x00, 0x07, 0x00, 0x00, + 0x33, 0x11, 0x23, 0x35, 0x21, 0x15, 0x23, 0x11, 0xc8, 0xc8, 0x02, 0x58, + 0xc8, 0x02, 0x58, 0xc8, 0xc8, 0xfd, 0xa8, 0x01, 0x00, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x03, 0x20, 0x03, 0x20, 0x00, 0x03, 0x00, 0x07, 0x00, 0x0b, + 0x00, 0x00, 0x35, 0x11, 0x33, 0x11, 0x15, 0x35, 0x21, 0x15, 0x11, 0x33, + 0x11, 0x23, 0xc8, 0x01, 0x90, 0xc8, 0xc8, 0xc8, 0x02, 0x58, 0xfd, 0xa8, + 0xc8, 0xc8, 0xc8, 0x03, 0x20, 0xfd, 0xa8, 0x90, 0x00, 0x05, 0x00, 0x00, + 0x00, 0x00, 0x03, 0xe8, 0x03, 0x20, 0x00, 0x03, 0x00, 0x07, 0x00, 0x0b, + 0x00, 0x0f, 0x00, 0x13, 0x00, 0x00, 0x11, 0x33, 0x11, 0x23, 0x17, 0x35, + 0x33, 0x15, 0x31, 0x33, 0x15, 0x23, 0x37, 0x35, 0x33, 0x15, 0x35, 0x11, + 0x33, 0x11, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0x03, + 0x20, 0xfe, 0x70, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0x01, + 0x90, 0xfe, 0x70, 0x01, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x03, 0xe8, + 0x03, 0x20, 0x00, 0x03, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x0f, 0x00, 0x13, + 0x00, 0x00, 0x33, 0x35, 0x33, 0x15, 0x03, 0x11, 0x23, 0x11, 0x01, 0x11, + 0x33, 0x11, 0x15, 0x35, 0x33, 0x15, 0x35, 0x11, 0x33, 0x11, 0xc8, 0xc8, + 0xc8, 0xc8, 0x01, 0x90, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0x03, 0x20, 0xfd, + 0xa8, 0x02, 0x58, 0xfd, 0xa8, 0x01, 0x90, 0xfe, 0x70, 0xc8, 0xc8, 0xc8, + 0xc8, 0x02, 0x58, 0xfd, 0xa8, 0x73, 0x00, 0x05, 0x00, 0x00, 0x00, 0xc8, + 0x02, 0x58, 0x03, 0x20, 0x00, 0x03, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x0f, + 0x00, 0x13, 0x00, 0x00, 0x25, 0x35, 0x33, 0x15, 0x03, 0x35, 0x33, 0x15, + 0x01, 0x35, 0x33, 0x15, 0x3d, 0x01, 0x33, 0x15, 0x25, 0x35, 0x33, 0x15, + 0x01, 0x90, 0xc8, 0xc8, 0xc8, 0xfd, 0xa8, 0xc8, 0xc8, 0xfe, 0x70, 0xc8, + 0xc8, 0xc8, 0xc8, 0x01, 0x90, 0xc8, 0xc8, 0xfe, 0x70, 0xc8, 0xc8, 0xc8, + 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x58, 0x03, 0x20, 0x00, 0x03, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x0f, + 0x00, 0x13, 0x00, 0x00, 0x21, 0x11, 0x33, 0x11, 0x03, 0x35, 0x33, 0x15, + 0x01, 0x11, 0x33, 0x19, 0x01, 0x35, 0x33, 0x15, 0x25, 0x35, 0x33, 0x15, + 0x01, 0x90, 0xc8, 0xc8, 0xc8, 0xfd, 0xa8, 0xc8, 0xc8, 0xfe, 0x70, 0xc8, + 0x01, 0x90, 0xfe, 0x70, 0x02, 0x58, 0xc8, 0xc8, 0xfd, 0xa8, 0x01, 0x90, + 0xfe, 0x70, 0x01, 0x90, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0x00, 0x00, 0x05, + 0x00, 0x00, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x20, 0x00, 0x03, 0x00, 0x07, + 0x00, 0x0b, 0x00, 0x0f, 0x00, 0x13, 0x00, 0x00, 0x11, 0x33, 0x15, 0x23, + 0x3b, 0x01, 0x15, 0x23, 0x3b, 0x01, 0x11, 0x23, 0x13, 0x35, 0x33, 0x15, + 0x3d, 0x01, 0x33, 0x15, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, + 0xc8, 0xc8, 0xc8, 0x03, 0x20, 0xc8, 0xc8, 0xfe, 0x70, 0x01, 0x90, 0xc8, + 0xc8, 0xc8, 0xc8, 0xc8, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x03, 0x20, + 0x03, 0x20, 0x00, 0x07, 0x00, 0x0f, 0x00, 0x00, 0x11, 0x21, 0x15, 0x23, + 0x15, 0x23, 0x35, 0x21, 0x05, 0x15, 0x21, 0x15, 0x21, 0x35, 0x33, 0x35, + 0x03, 0x20, 0xc8, 0xc8, 0xfe, 0x70, 0x01, 0x90, 0x01, 0x90, 0xfc, 0xe0, + 0xc8, 0x03, 0x20, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xff, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x02, 0x58, 0x03, 0x20, 0x00, 0x0b, + 0x00, 0x00, 0x31, 0x35, 0x33, 0x35, 0x23, 0x35, 0x33, 0x35, 0x33, 0x11, + 0x33, 0x15, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xfd, + 0xa8, 0xc8, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x02, 0x58, 0x03, 0x20, + 0x00, 0x05, 0x00, 0x09, 0x00, 0x0d, 0x00, 0x00, 0x31, 0x11, 0x33, 0x15, + 0x21, 0x15, 0x01, 0x21, 0x15, 0x29, 0x01, 0x33, 0x15, 0x23, 0xc8, 0x01, + 0x90, 0xfd, 0xa8, 0x01, 0x90, 0xfe, 0x70, 0x01, 0x90, 0xc8, 0xc8, 0x01, + 0x90, 0xc8, 0xc8, 0x03, 0x20, 0xc8, 0xc8, 0x00, 0x00, 0x02, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x58, 0x03, 0x20, 0x00, 0x03, 0x00, 0x0d, 0x00, 0x00, + 0x31, 0x35, 0x21, 0x15, 0x01, 0x21, 0x15, 0x33, 0x11, 0x23, 0x35, 0x23, + 0x35, 0x23, 0x01, 0x90, 0xfe, 0x70, 0x01, 0x90, 0xc8, 0xc8, 0xc8, 0xc8, + 0xc8, 0xc8, 0x03, 0x20, 0xc8, 0xfe, 0x70, 0xc8, 0xc8, 0x03, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x58, 0x03, 0x20, 0x00, 0x09, 0x00, 0x00, + 0x21, 0x35, 0x21, 0x11, 0x33, 0x15, 0x33, 0x11, 0x33, 0x11, 0x01, 0x90, + 0xfe, 0x70, 0xc8, 0xc8, 0xc8, 0xc8, 0x01, 0x90, 0xc8, 0x01, 0x90, 0xfc, + 0xe0, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x02, 0x58, 0x02, 0x58, + 0x00, 0x0b, 0x00, 0x00, 0x33, 0x35, 0x23, 0x35, 0x33, 0x35, 0x21, 0x15, + 0x23, 0x15, 0x33, 0x15, 0xc8, 0xc8, 0xc8, 0x01, 0x90, 0xc8, 0xc8, 0xc8, + 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0x70, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x58, 0x03, 0x20, 0x00, 0x03, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, + 0x31, 0x35, 0x21, 0x15, 0x3d, 0x01, 0x33, 0x15, 0x25, 0x23, 0x11, 0x21, + 0x15, 0x21, 0x01, 0x90, 0xc8, 0xfe, 0x70, 0xc8, 0x02, 0x58, 0xfe, 0x70, + 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0x01, 0x90, 0xc8, 0x6f, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x58, 0x03, 0x20, 0x00, 0x05, 0x00, 0x09, + 0x00, 0x00, 0x31, 0x11, 0x33, 0x15, 0x21, 0x11, 0x01, 0x35, 0x21, 0x15, + 0xc8, 0x01, 0x90, 0xfe, 0x70, 0x01, 0x90, 0x02, 0x58, 0xc8, 0xfe, 0x70, + 0x02, 0x58, 0xc8, 0xc8, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x02, 0x58, + 0x03, 0x20, 0x00, 0x05, 0x00, 0x09, 0x00, 0x0d, 0x00, 0x00, 0x11, 0x35, + 0x21, 0x11, 0x23, 0x35, 0x03, 0x35, 0x33, 0x15, 0x05, 0x35, 0x33, 0x15, + 0x02, 0x58, 0xc8, 0xc8, 0xc8, 0xfe, 0x70, 0xc8, 0x02, 0x58, 0xc8, 0xfe, + 0x70, 0xc8, 0xfe, 0x70, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0x79, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x58, 0x03, 0x20, 0x00, 0x03, 0x00, 0x0f, + 0x00, 0x00, 0x37, 0x33, 0x15, 0x23, 0x13, 0x23, 0x15, 0x23, 0x11, 0x33, + 0x35, 0x33, 0x15, 0x33, 0x11, 0x23, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, + 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0x01, 0x90, 0xc8, 0x01, 0x90, 0xc8, + 0xc8, 0xfe, 0x70, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x02, 0x58, + 0x03, 0x20, 0x00, 0x0b, 0x00, 0x00, 0x21, 0x35, 0x21, 0x11, 0x33, 0x15, + 0x33, 0x35, 0x23, 0x35, 0x21, 0x11, 0x01, 0x90, 0xfe, 0x70, 0xc8, 0xc8, + 0xc8, 0x01, 0x90, 0xc8, 0x01, 0x90, 0xc8, 0xc8, 0xc8, 0xfc, 0xe0, 0x21, + 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x02, 0x58, 0x03, 0x20, 0x00, 0x03, + 0x00, 0x07, 0x00, 0x0b, 0x00, 0x0f, 0x00, 0x00, 0x35, 0x11, 0x33, 0x19, + 0x01, 0x35, 0x33, 0x15, 0x03, 0x35, 0x33, 0x15, 0x11, 0x33, 0x11, 0x23, + 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0x01, 0x90, 0xfe, 0x70, 0x01, + 0x90, 0xc8, 0xc8, 0xfd, 0xa8, 0xc8, 0xc8, 0x02, 0x58, 0xfe, 0x70, 0x58, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x03, 0x20, 0x00, 0x03, + 0x00, 0x07, 0x00, 0x00, 0x11, 0x33, 0x11, 0x23, 0x11, 0x35, 0x33, 0x15, + 0xc8, 0xc8, 0xc8, 0x03, 0x20, 0xfe, 0x70, 0xfe, 0x70, 0xc8, 0xc8, 0xc8, + 0x00, 0x02, 0x00, 0x00, 0x01, 0x90, 0x02, 0x58, 0x03, 0x20, 0x00, 0x03, + 0x00, 0x07, 0x00, 0x00, 0x13, 0x11, 0x23, 0x11, 0x01, 0x11, 0x33, 0x11, + 0xc8, 0xc8, 0x01, 0x90, 0xc8, 0x03, 0x20, 0xfe, 0x70, 0x01, 0x90, 0xfe, + 0x70, 0x01, 0x90, 0xfe, 0x70, 0xfe, 0x00, 0x02, 0x00, 0x00, 0xff, 0x38, + 0x03, 0xe8, 0x03, 0x20, 0x00, 0x1b, 0x00, 0x1f, 0x00, 0x00, 0x11, 0x35, + 0x33, 0x35, 0x33, 0x15, 0x33, 0x35, 0x33, 0x15, 0x33, 0x15, 0x23, 0x15, + 0x33, 0x15, 0x23, 0x15, 0x23, 0x35, 0x23, 0x15, 0x23, 0x35, 0x23, 0x35, + 0x33, 0x35, 0x17, 0x33, 0x35, 0x23, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, + 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0x01, 0x90, + 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, + 0xc8, 0xc8, 0xc8, 0xc8, 0x00, 0x01, 0x00, 0x00, 0xff, 0x38, 0x02, 0x58, + 0x03, 0x20, 0x00, 0x13, 0x00, 0x00, 0x11, 0x35, 0x33, 0x35, 0x33, 0x15, + 0x33, 0x15, 0x23, 0x15, 0x33, 0x15, 0x23, 0x15, 0x23, 0x35, 0x23, 0x35, + 0x33, 0x35, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0x01, + 0x90, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, + 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x03, 0x20, 0x03, 0x20, 0x00, 0x03, + 0x00, 0x07, 0x00, 0x0b, 0x00, 0x0f, 0x00, 0x13, 0x00, 0x17, 0x00, 0x00, + 0x37, 0x35, 0x33, 0x15, 0x01, 0x35, 0x33, 0x15, 0x17, 0x35, 0x33, 0x15, + 0x11, 0x35, 0x33, 0x15, 0x21, 0x35, 0x33, 0x15, 0x01, 0x23, 0x35, 0x33, + 0xc8, 0xc8, 0xfe, 0x70, 0xc8, 0xc8, 0xc8, 0xc8, 0xfc, 0xe0, 0xc8, 0x02, + 0x58, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0x01, 0x90, 0xc8, 0xc8, 0xc8, 0xc8, + 0xc8, 0xfe, 0x70, 0xc8, 0xc8, 0xc8, 0xc8, 0x02, 0x58, 0xc8, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x00, 0x03, 0x20, 0x03, 0x20, 0x00, 0x03, 0x00, 0x07, + 0x00, 0x0b, 0x00, 0x11, 0x00, 0x00, 0x33, 0x35, 0x21, 0x15, 0x3d, 0x01, + 0x33, 0x15, 0x21, 0x23, 0x35, 0x33, 0x31, 0x11, 0x21, 0x15, 0x23, 0x15, + 0xc8, 0x01, 0x90, 0xc8, 0xfd, 0xa8, 0xc8, 0xc8, 0x01, 0x90, 0xc8, 0xc8, + 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0x01, 0x90, 0xc8, 0xc8, 0x74, 0x00, 0x01, + 0x00, 0x00, 0x01, 0x90, 0x00, 0xc8, 0x03, 0x20, 0x00, 0x03, 0x00, 0x00, + 0x13, 0x11, 0x23, 0x11, 0xc8, 0xc8, 0x03, 0x20, 0xfe, 0x70, 0x01, 0x90, + 0x00, 0x03, 0x00, 0x00, 0xff, 0x38, 0x01, 0x90, 0x03, 0x20, 0x00, 0x03, + 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x31, 0x11, 0x33, 0x11, 0x13, 0x23, + 0x35, 0x33, 0x11, 0x23, 0x35, 0x33, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, + 0x02, 0x58, 0xfd, 0xa8, 0x02, 0x58, 0xc8, 0xfc, 0x18, 0xc8, 0x00, 0x03, + 0x00, 0x00, 0xff, 0x38, 0x01, 0x90, 0x03, 0x20, 0x00, 0x03, 0x00, 0x07, + 0x00, 0x0b, 0x00, 0x00, 0x33, 0x11, 0x33, 0x11, 0x03, 0x23, 0x35, 0x33, + 0x11, 0x23, 0x35, 0x33, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0x02, + 0x58, 0xfd, 0xa8, 0x02, 0x58, 0xc8, 0xfc, 0x18, 0xc8, 0xc8, 0x00, 0x03, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x58, 0x03, 0x20, 0x00, 0x03, 0x00, 0x09, + 0x00, 0x0d, 0x00, 0x00, 0x35, 0x11, 0x33, 0x19, 0x01, 0x35, 0x21, 0x11, + 0x23, 0x35, 0x03, 0x35, 0x21, 0x15, 0xc8, 0x01, 0x90, 0xc8, 0xc8, 0x01, + 0x90, 0xc8, 0x01, 0x90, 0xfe, 0x70, 0x01, 0x90, 0xc8, 0xfe, 0x70, 0xc8, + 0xfd, 0xa8, 0xc8, 0xc8, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x02, 0x58, + 0x02, 0x58, 0x00, 0x0b, 0x00, 0x00, 0x33, 0x35, 0x23, 0x35, 0x33, 0x35, + 0x33, 0x15, 0x33, 0x15, 0x23, 0x15, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, + 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0x00, 0x01, 0x00, 0x00, 0xff, 0x38, + 0x00, 0xc8, 0x00, 0xc8, 0x00, 0x03, 0x00, 0x00, 0x17, 0x23, 0x11, 0x33, + 0xc8, 0xc8, 0xc8, 0xc8, 0x01, 0x90, 0x00, 0x01, 0x00, 0x00, 0x00, 0xc8, + 0x02, 0x58, 0x01, 0x90, 0x00, 0x03, 0x00, 0x00, 0x3d, 0x01, 0x21, 0x15, + 0x02, 0x58, 0xc8, 0xc8, 0xc8, 0x15, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xc8, 0x00, 0xc8, 0x00, 0x03, 0x00, 0x00, 0x31, 0x35, 0x33, 0x15, + 0xc8, 0xc8, 0xc8, 0x11, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x02, 0x58, + 0x03, 0x20, 0x00, 0x03, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x37, 0x11, + 0x33, 0x11, 0x13, 0x23, 0x35, 0x33, 0x01, 0x23, 0x35, 0x33, 0xc8, 0xc8, + 0xc8, 0xc8, 0xc8, 0xfe, 0x70, 0xc8, 0xc8, 0xc8, 0x01, 0x90, 0xfe, 0x70, + 0x01, 0x90, 0xc8, 0xfc, 0xe0, 0xc8, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x20, 0x03, 0x20, 0x00, 0x03, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x0f, + 0x00, 0x00, 0x37, 0x35, 0x33, 0x15, 0x3d, 0x01, 0x33, 0x15, 0x01, 0x35, + 0x33, 0x15, 0x01, 0x23, 0x35, 0x33, 0xc8, 0xc8, 0xc8, 0xfd, 0xa8, 0xc8, + 0x02, 0x58, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xfe, 0x70, + 0xc8, 0xc8, 0x02, 0x58, 0xc8, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xc8, 0x02, 0x58, 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x31, 0x35, + 0x33, 0x15, 0x11, 0x23, 0x35, 0x33, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0x01, + 0x90, 0xc8, 0x00, 0x02, 0x00, 0x00, 0xff, 0x38, 0x00, 0xc8, 0x02, 0x58, + 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x17, 0x23, 0x11, 0x33, 0x35, 0x23, + 0x35, 0x33, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0x01, 0x90, 0xc8, 0xc8, + 0x00, 0x05, 0x00, 0x00, 0xff, 0x38, 0x02, 0x58, 0x03, 0x20, 0x00, 0x03, + 0x00, 0x07, 0x00, 0x0b, 0x00, 0x0f, 0x00, 0x13, 0x00, 0x00, 0x37, 0x23, + 0x35, 0x33, 0x31, 0x35, 0x33, 0x15, 0x3d, 0x01, 0x33, 0x15, 0x01, 0x35, + 0x33, 0x1d, 0x01, 0x35, 0x33, 0x15, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xfe, + 0x70, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xfd, 0xa8, + 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0x9c, 0x00, 0x05, 0x00, 0x00, 0xff, 0x38, + 0x02, 0x58, 0x03, 0x20, 0x00, 0x03, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x0f, + 0x00, 0x13, 0x00, 0x00, 0x25, 0x23, 0x35, 0x33, 0x21, 0x35, 0x33, 0x15, + 0x25, 0x35, 0x33, 0x15, 0x11, 0x35, 0x33, 0x15, 0x05, 0x35, 0x33, 0x15, + 0x02, 0x58, 0xc8, 0xc8, 0xfe, 0x70, 0xc8, 0xfe, 0x70, 0xc8, 0xc8, 0xfe, + 0x70, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xfd, 0xa8, 0xc8, + 0xc8, 0xc8, 0xc8, 0xc8, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x02, 0x58, + 0x02, 0x58, 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x31, 0x35, 0x21, 0x15, + 0x01, 0x35, 0x21, 0x15, 0x02, 0x58, 0xfd, 0xa8, 0x02, 0x58, 0xc8, 0xc8, + 0x01, 0x90, 0xc8, 0xc8, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x02, 0x58, + 0x03, 0x20, 0x00, 0x03, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x11, 0x35, + 0x21, 0x15, 0x31, 0x33, 0x15, 0x23, 0x03, 0x35, 0x33, 0x15, 0x01, 0x90, + 0xc8, 0xc8, 0xc8, 0xc8, 0x02, 0x58, 0xc8, 0xc8, 0xc8, 0xfe, 0x70, 0xc8, + 0xc8, 0x00, 0x00, 0x01, 0x00, 0x00, 0xff, 0x38, 0x01, 0x90, 0x03, 0x20, + 0x00, 0x07, 0x00, 0x00, 0x15, 0x11, 0x21, 0x15, 0x23, 0x11, 0x33, 0x15, + 0x01, 0x90, 0xc8, 0xc8, 0xc8, 0x03, 0xe8, 0xc8, 0xfd, 0xa8, 0xc8, 0x00, + 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x03, 0x20, 0x03, 0x20, 0x00, 0x03, + 0x00, 0x07, 0x00, 0x0b, 0x00, 0x0f, 0x00, 0x00, 0x11, 0x35, 0x33, 0x15, + 0x13, 0x35, 0x33, 0x15, 0x01, 0x33, 0x15, 0x23, 0x05, 0x33, 0x15, 0x23, + 0xc8, 0xc8, 0xc8, 0xfe, 0x70, 0xc8, 0xc8, 0x01, 0x90, 0xc8, 0xc8, 0x02, + 0x58, 0xc8, 0xc8, 0xfe, 0x70, 0xc8, 0xc8, 0x01, 0x90, 0xc8, 0xc8, 0xc8, + 0x00, 0x01, 0x00, 0x00, 0xff, 0x38, 0x01, 0x90, 0x03, 0x20, 0x00, 0x07, + 0x00, 0x00, 0x15, 0x35, 0x33, 0x11, 0x23, 0x35, 0x21, 0x11, 0xc8, 0xc8, + 0x01, 0x90, 0xc8, 0xc8, 0x02, 0x58, 0xc8, 0xfc, 0x18, 0x01, 0x00, 0x03, + 0x00, 0x00, 0x01, 0x90, 0x02, 0x58, 0x03, 0x20, 0x00, 0x03, 0x00, 0x07, + 0x00, 0x0b, 0x00, 0x00, 0x11, 0x35, 0x33, 0x15, 0x3d, 0x01, 0x33, 0x15, + 0x31, 0x33, 0x15, 0x23, 0xc8, 0xc8, 0xc8, 0xc8, 0x01, 0x90, 0xc8, 0xc8, + 0xc8, 0xc8, 0xc8, 0xc8, 0x00, 0x01, 0x00, 0x00, 0xff, 0x38, 0x02, 0x58, + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x31, 0x21, 0x15, 0x21, 0x02, 0x58, + 0xfd, 0xa8, 0xc8, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x90, 0x01, 0x90, + 0x03, 0x20, 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x11, 0x35, 0x33, 0x15, + 0x31, 0x33, 0x15, 0x23, 0xc8, 0xc8, 0xc8, 0x02, 0x58, 0xc8, 0xc8, 0xc8, + 0x00, 0x01, 0x00, 0x00, 0xff, 0x38, 0x02, 0x58, 0x03, 0x20, 0x00, 0x0b, + 0x00, 0x00, 0x3d, 0x01, 0x33, 0x11, 0x21, 0x15, 0x23, 0x11, 0x33, 0x15, + 0x21, 0x11, 0xc8, 0x01, 0x90, 0xc8, 0xc8, 0xfe, 0x70, 0xc8, 0xc8, 0x01, + 0x90, 0xc8, 0xfd, 0xa8, 0xc8, 0x01, 0x90, 0x00, 0x00, 0x01, 0x00, 0x00, + 0xff, 0x38, 0x00, 0xc8, 0x03, 0x20, 0x00, 0x03, 0x00, 0x00, 0x15, 0x11, + 0x33, 0x11, 0xc8, 0xc8, 0x03, 0xe8, 0xfc, 0x18, 0x00, 0x01, 0x00, 0x00, + 0xff, 0x38, 0x02, 0x58, 0x03, 0x20, 0x00, 0x0b, 0x00, 0x00, 0x15, 0x35, + 0x33, 0x11, 0x23, 0x35, 0x21, 0x11, 0x33, 0x15, 0x23, 0x11, 0xc8, 0xc8, + 0x01, 0x90, 0xc8, 0xc8, 0xc8, 0xc8, 0x02, 0x58, 0xc8, 0xfe, 0x70, 0xc8, + 0xfe, 0x70, 0x00, 0x04, 0x00, 0x00, 0x01, 0x90, 0x03, 0x20, 0x03, 0x20, + 0x00, 0x03, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x0f, 0x00, 0x00, 0x11, 0x35, + 0x33, 0x15, 0x25, 0x35, 0x33, 0x15, 0x21, 0x33, 0x15, 0x23, 0x27, 0x35, + 0x33, 0x15, 0xc8, 0x01, 0x90, 0xc8, 0xfe, 0x70, 0xc8, 0xc8, 0xc8, 0xc8, + 0x01, 0x90, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x6a, 0xd9, 0x38, + 0x5f, 0x0f, 0x3c, 0xf5, 0x00, 0x00, 0x04, 0xb0, 0x00, 0x00, 0x00, 0x00, + 0xbc, 0x53, 0x50, 0x89, 0x00, 0x00, 0x00, 0x00, 0xbc, 0x53, 0x50, 0x89, + 0x00, 0x00, 0xff, 0x38, 0x03, 0xe8, 0x03, 0xe8, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x03, 0xe8, 0xff, 0x38, 0x00, 0x00, 0x04, 0xb0, 0x00, 0x00, 0x00, 0xc8, + 0x03, 0xe8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x04, 0xb0, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, + 0x03, 0x20, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, + 0x03, 0x20, 0x00, 0x00, 0x02, 0x58, 0x00, 0x00, 0x02, 0x58, 0x00, 0x00, + 0x02, 0x58, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, 0x01, 0x90, 0x00, 0x00, + 0x01, 0x90, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, 0x01, 0x90, 0x00, 0x00, + 0x04, 0xb0, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, + 0x03, 0x20, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, 0x02, 0x58, 0x00, 0x00, + 0x03, 0x20, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, + 0x03, 0x20, 0x00, 0x00, 0x04, 0xb0, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, + 0x03, 0x20, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, + 0x03, 0x20, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, + 0x03, 0x20, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, + 0x03, 0x20, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, + 0x03, 0xe8, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, 0x04, 0xb0, 0x00, 0x00, + 0x03, 0xe8, 0x00, 0x00, 0x03, 0xe8, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, + 0x03, 0xe8, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, + 0x03, 0x20, 0x00, 0x00, 0x03, 0xe8, 0x00, 0x00, 0x04, 0xb0, 0x00, 0x00, + 0x04, 0xb0, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, + 0x04, 0xb0, 0x00, 0x00, 0x03, 0xe8, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, + 0x03, 0x20, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, + 0x03, 0x20, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, + 0x03, 0x20, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, + 0x03, 0x20, 0x00, 0x00, 0x01, 0x90, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, + 0x04, 0xb0, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, 0x03, 0xe8, 0x00, 0x00, + 0x03, 0xe8, 0x00, 0x00, 0x01, 0x90, 0x00, 0x00, 0x02, 0x58, 0x00, 0x00, + 0x02, 0x58, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, + 0x01, 0x90, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, 0x01, 0x90, 0x00, 0x00, + 0x03, 0x20, 0x00, 0x00, 0x03, 0xe8, 0x00, 0x00, 0x01, 0x90, 0x00, 0x00, + 0x01, 0x90, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, + 0x03, 0x20, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, 0x02, 0x58, 0x00, 0x00, + 0x03, 0xe8, 0x00, 0x00, 0x02, 0x58, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, + 0x03, 0x20, 0x00, 0x00, 0x02, 0x58, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, + 0x01, 0x90, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, 0x03, 0xe8, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x27, 0x00, 0x3e, + 0x00, 0x57, 0x00, 0x6f, 0x00, 0x82, 0x00, 0x97, 0x00, 0x97, 0x00, 0xa8, + 0x00, 0xbe, 0x00, 0xd0, 0x00, 0xe2, 0x00, 0xfd, 0x01, 0x09, 0x01, 0x2a, + 0x01, 0x3f, 0x01, 0x5b, 0x01, 0x73, 0x01, 0x8b, 0x01, 0x99, 0x01, 0xa9, + 0x01, 0xbd, 0x01, 0xd4, 0x01, 0xee, 0x02, 0x12, 0x02, 0x34, 0x02, 0x4c, + 0x02, 0x5f, 0x02, 0x78, 0x02, 0x8c, 0x02, 0xa5, 0x02, 0xbb, 0x02, 0xcd, + 0x02, 0xdf, 0x02, 0xfa, 0x03, 0x0f, 0x03, 0x23, 0x03, 0x3a, 0x03, 0x59, + 0x03, 0x67, 0x03, 0x86, 0x03, 0xa0, 0x03, 0xbf, 0x03, 0xd7, 0x03, 0xf9, + 0x04, 0x16, 0x04, 0x31, 0x04, 0x42, 0x04, 0x5a, 0x04, 0x7c, 0x04, 0xa1, + 0x04, 0xc5, 0x04, 0xeb, 0x05, 0x0c, 0x05, 0x28, 0x05, 0x3b, 0x05, 0x56, + 0x05, 0x6f, 0x05, 0x83, 0x05, 0x97, 0x05, 0xb1, 0x05, 0xc6, 0x05, 0xe1, + 0x05, 0xfc, 0x06, 0x12, 0x06, 0x30, 0x06, 0x42, 0x06, 0x57, 0x06, 0x80, + 0x06, 0x9c, 0x06, 0xc5, 0x06, 0xe3, 0x06, 0xf0, 0x07, 0x07, 0x07, 0x1f, + 0x07, 0x3a, 0x07, 0x4d, 0x07, 0x59, 0x07, 0x65, 0x07, 0x70, 0x07, 0x89, + 0x07, 0xa7, 0x07, 0xb7, 0x07, 0xc8, 0x07, 0xe9, 0x08, 0x0c, 0x08, 0x1e, + 0x08, 0x35, 0x08, 0x46, 0x08, 0x64, 0x08, 0x75, 0x08, 0x8a, 0x08, 0x96, + 0x08, 0xa6, 0x08, 0xbc, 0x08, 0xc8, 0x08, 0xdd, 0x08, 0xfa, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x20, 0x00, 0x06, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, + 0x00, 0xc6, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, + 0x00, 0x09, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x07, + 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, + 0x00, 0x13, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x03, + 0x00, 0x16, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x0c, + 0x00, 0x19, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x03, + 0x00, 0x25, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x09, + 0x00, 0x28, 0x00, 0x03, 0x00, 0x01, 0x04, 0x09, 0x00, 0x00, 0x00, 0x6e, + 0x00, 0x31, 0x00, 0x03, 0x00, 0x01, 0x04, 0x09, 0x00, 0x01, 0x00, 0x08, + 0x00, 0x9f, 0x00, 0x03, 0x00, 0x01, 0x04, 0x09, 0x00, 0x02, 0x00, 0x0e, + 0x00, 0xa7, 0x00, 0x03, 0x00, 0x01, 0x04, 0x09, 0x00, 0x03, 0x00, 0x32, + 0x00, 0xb5, 0x00, 0x03, 0x00, 0x01, 0x04, 0x09, 0x00, 0x04, 0x00, 0x18, + 0x00, 0xe7, 0x00, 0x03, 0x00, 0x01, 0x04, 0x09, 0x00, 0x05, 0x00, 0x18, + 0x00, 0xff, 0x00, 0x03, 0x00, 0x01, 0x04, 0x09, 0x00, 0x06, 0x00, 0x16, + 0x01, 0x17, 0x00, 0x03, 0x00, 0x01, 0x04, 0x09, 0x00, 0x07, 0x00, 0x40, + 0x01, 0x2d, 0x43, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x4e, + 0x65, 0x77, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x4e, 0x65, 0x77, + 0x4e, 0x65, 0x77, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x31, + 0x2e, 0x30, 0x30, 0x4e, 0x65, 0x77, 0x54, 0x72, 0x61, 0x64, 0x65, 0x6d, + 0x61, 0x72, 0x6b, 0x00, 0x43, 0x00, 0x6f, 0x00, 0x70, 0x00, 0x79, 0x00, + 0x72, 0x00, 0x69, 0x00, 0x67, 0x00, 0x68, 0x00, 0x74, 0x00, 0x20, 0x00, + 0xa9, 0x00, 0x20, 0x00, 0x32, 0x00, 0x30, 0x00, 0x30, 0x00, 0x34, 0x00, + 0x20, 0x00, 0x62, 0x00, 0x79, 0x00, 0x20, 0x00, 0x4d, 0x00, 0x61, 0x00, + 0x74, 0x00, 0x74, 0x00, 0x68, 0x00, 0x65, 0x00, 0x77, 0x00, 0x20, 0x00, + 0x57, 0x00, 0x65, 0x00, 0x6c, 0x00, 0x63, 0x00, 0x68, 0x00, 0x2e, 0x00, + 0x20, 0x00, 0x41, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x20, 0x00, 0x52, 0x00, + 0x69, 0x00, 0x67, 0x00, 0x68, 0x00, 0x74, 0x00, 0x73, 0x00, 0x20, 0x00, + 0x52, 0x00, 0x65, 0x00, 0x73, 0x00, 0x65, 0x00, 0x72, 0x00, 0x76, 0x00, + 0x65, 0x00, 0x64, 0x00, 0x2e, 0x00, 0x54, 0x00, 0x69, 0x00, 0x6e, 0x00, + 0x79, 0x00, 0x52, 0x00, 0x65, 0x00, 0x67, 0x00, 0x75, 0x00, 0x6c, 0x00, + 0x61, 0x00, 0x72, 0x00, 0x54, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x79, 0x00, + 0x20, 0x00, 0x52, 0x00, 0x65, 0x00, 0x67, 0x00, 0x75, 0x00, 0x6c, 0x00, + 0x61, 0x00, 0x72, 0x00, 0x3a, 0x00, 0x56, 0x00, 0x65, 0x00, 0x72, 0x00, + 0x73, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x20, 0x00, 0x31, 0x00, + 0x2e, 0x00, 0x30, 0x00, 0x30, 0x00, 0x54, 0x00, 0x69, 0x00, 0x6e, 0x00, + 0x79, 0x00, 0x20, 0x00, 0x52, 0x00, 0x65, 0x00, 0x67, 0x00, 0x75, 0x00, + 0x6c, 0x00, 0x61, 0x00, 0x72, 0x00, 0x56, 0x00, 0x65, 0x00, 0x72, 0x00, + 0x73, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x20, 0x00, 0x31, 0x00, + 0x2e, 0x00, 0x30, 0x00, 0x30, 0x00, 0x54, 0x00, 0x69, 0x00, 0x6e, 0x00, + 0x79, 0x00, 0x52, 0x00, 0x65, 0x00, 0x67, 0x00, 0x75, 0x00, 0x6c, 0x00, + 0x61, 0x00, 0x72, 0x00, 0x54, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x79, 0x00, + 0x99, 0x00, 0x20, 0x00, 0x54, 0x00, 0x72, 0x00, 0x61, 0x00, 0x64, 0x00, + 0x65, 0x00, 0x6d, 0x00, 0x61, 0x00, 0x72, 0x00, 0x6b, 0x00, 0x20, 0x00, + 0x6f, 0x00, 0x66, 0x00, 0x20, 0x00, 0x4d, 0x00, 0x61, 0x00, 0x74, 0x00, + 0x74, 0x00, 0x68, 0x00, 0x65, 0x00, 0x77, 0x00, 0x20, 0x00, 0x57, 0x00, + 0x65, 0x00, 0x6c, 0x00, 0x63, 0x00, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +]; diff --git a/src/main.ha b/src/main.ha new file mode 100644 index 0000000..665cbcc --- /dev/null +++ b/src/main.ha @@ -0,0 +1,90 @@ +use sdl3; +use sdl3::image; +use sdl3::ttf; +use types::c; + +def WIDTH = 640; +def HEIGHT = 480; + +export fn main() void = { + sdl3::Init(sdl3::InitFlags::VIDEO)!; + defer sdl3::Quit(); + + const win = sdl3::CreateWindow( + c::nulstr("Meadow\0"), + WIDTH, HEIGHT, 0)!; + defer sdl3::DestroyWindow(win); + + const render = sdl3::CreateRenderer(win, null)!; + defer sdl3::DestroyRenderer(render); + sdl3::SetRenderDrawColor(render, 0, 0, 128, 255)!; + + const img = image::LoadTexture(render, c::nulstr("./assets/mascot.jpg\0"))!; + defer sdl3::DestroyTexture(img); + + ttf::Init()!; + defer ttf::Quit(); + + let font = ttf::OpenFontIO( + sdl3::IOFromConstMem(&tiny_ttf, len(tiny_ttf))!, true, 18.0)!; + defer ttf::CloseFont(font); + + let text_color = sdl3::Color { r = 0, g = 255, b = 0, a = 255 }; + let text = ttf::RenderText_Blended(font, c::nulstr("Hello World!\0"), + 0, text_color)!; + let text_texture = sdl3::CreateTextureFromSurface(render, text)!; + sdl3::DestroySurface(text); + defer sdl3::DestroyTexture(text_texture); + + let w = 0.0f32, h = 0.0f32; + sdl3::GetTextureSize(img, &w, &h)!; + sdl3::get_error()!; + const w = w: int, h = h: int; + + let x = 0, y = 0; + let xd = 1, yd = 1; + + let run = true; + let ev = sdl3::Event { ... }; + for (run) { + for (sdl3::PollEvent(&ev)) { + if (ev.event_type == sdl3::EventType::QUIT) { + run = false; + }; + }; + + sdl3::RenderClear(render)!; + + sdl3::RenderTexture(render, img, null, &sdl3::FRect { + x = x: f32, + y = y: f32, + w = w: f32, + h = h: f32, + })!; + + let dst = sdl3::FRect { y = y: f32, ... }; + sdl3::GetTextureSize(text_texture, &dst.w, &dst.h)!; + dst.x = x: f32 + (w: f32 - dst.w) / 2.0; + sdl3::RenderTexture(render, text_texture, null, &dst)!; + + sdl3::RenderPresent(render)!; + sdl3::Delay(1000 / 60); + + x += xd; + y += yd; + if (x + w >= WIDTH) { + xd = -1; + }; + if (x <= 0) { + xd = 1; + }; + if (y + h >= HEIGHT) { + yd = -1; + }; + if (y <= 0) { + yd = 1; + }; + + sdl3::get_error()!; + }; +}; diff --git a/uxn-tests/break.rom b/uxn-tests/break.rom new file mode 100644 index 0000000..85f6548 Binary files /dev/null and b/uxn-tests/break.rom differ diff --git a/uxn-tests/break.rom.sym b/uxn-tests/break.rom.sym new file mode 100644 index 0000000..d0afbdd Binary files /dev/null and b/uxn-tests/break.rom.sym differ diff --git a/uxn-tests/break.tal b/uxn-tests/break.tal new file mode 100644 index 0000000..2790e84 --- /dev/null +++ b/uxn-tests/break.tal @@ -0,0 +1,19 @@ +( uxncli hello.rom ) + +|10 @Console/vector $2 &read $5 &type $1 &write $1 &error $1 + +|000 + + +|100 + +@on-reset ( -> ) + BRK + ;text + &while ( -- ) + LDAk .Console/write DEO + INC2 LDAk ?&while + POP2 + BRK + +@text "Hello $1 diff --git a/uxn-tests/echo.rom b/uxn-tests/echo.rom new file mode 100644 index 0000000..194e6d7 Binary files /dev/null and b/uxn-tests/echo.rom differ diff --git a/uxn-tests/echo.rom.sym b/uxn-tests/echo.rom.sym new file mode 100644 index 0000000..09e09f0 Binary files /dev/null and b/uxn-tests/echo.rom.sym differ diff --git a/uxn-tests/echo.tal b/uxn-tests/echo.tal new file mode 100644 index 0000000..8d3d473 --- /dev/null +++ b/uxn-tests/echo.tal @@ -0,0 +1,17 @@ +( uxncli hello.rom ) + +|10 @Console/vector $2 &read $5 &type $1 &write $1 &error $1 + +|000 + + +|100 + +@on-reset ( -> ) + ;on-console .Console/vector DEO2 + BRK + +@on-console ( -> ) + .Console/read DEI .Console/write DEO + #20 .Console/write DEO + BRK diff --git a/uxn-tests/hello.rom b/uxn-tests/hello.rom new file mode 100644 index 0000000..a298559 Binary files /dev/null and b/uxn-tests/hello.rom differ diff --git a/uxn-tests/hello.rom.sym b/uxn-tests/hello.rom.sym new file mode 100644 index 0000000..e0bda86 Binary files /dev/null and b/uxn-tests/hello.rom.sym differ diff --git a/uxn-tests/hello.tal b/uxn-tests/hello.tal new file mode 100644 index 0000000..3fbda48 --- /dev/null +++ b/uxn-tests/hello.tal @@ -0,0 +1,18 @@ +( uxncli hello.rom ) + +|10 @Console/vector $2 &read $5 &type $1 &write $1 &error $1 + +|000 + + +|100 + +@on-reset ( -> ) + ;text + &while ( -- ) + LDAk .Console/write DEO + INC2 LDAk ?&while + POP2 + BRK + +@text "Hello $1 diff --git a/uxn-tests/opcodes.rom b/uxn-tests/opcodes.rom new file mode 100644 index 0000000..720569b Binary files /dev/null and b/uxn-tests/opcodes.rom differ diff --git a/uxn-tests/opcodes.rom.sym b/uxn-tests/opcodes.rom.sym new file mode 100644 index 0000000..5fe840a Binary files /dev/null and b/uxn-tests/opcodes.rom.sym differ diff --git a/uxn-tests/opcodes.tal b/uxn-tests/opcodes.tal new file mode 100644 index 0000000..cd7ca02 --- /dev/null +++ b/uxn-tests/opcodes.tal @@ -0,0 +1,565 @@ +( Opcode Tester ) + +|0013 + + @zeropage/hb $1 &lb $1 + @id $1 + +|100 + +@on-reset ( -> ) + + ( part 1 + > LIT2: Puts a short on the stack + > LIT: Puts a byte on the stack + > #06 DEO: Write to metadata ports + > #18 DEO: Write a letter in terminal ) + + ;meta #06 DEO2 + [ LIT2 "kO ] #18 DEO #18 DEO + [ LIT2 "1 18 ] DEO #0a18 DEO + + ( part 2 + > LITr: Put a byte on return stack + > STH: Move a byte from working stack to return stack + > STH2r: Move a short from return stack to working stack ) + + [ LITr "k ] [ LIT "O ] STH STH2r #18 DEO #18 DEO + [ LIT2 "2 18 ] DEO #0a18 DEO + + ( part 3 + > LIT2r: Put a short on return stack + > DUP: Duplicate byte + > ADDr: Add bytes on return stack ) + + [ LIT2r "k 4d ] #01 DUP STH ADDr STH ADDr STH2r #18 DEO #18 DEO + [ LIT2 "3 18 ] DEO #0a18 DEO + + ( part 4 + > JSI: Subroutine to relative short address + > JMP2r: Jumps to absolute address on return stack ) + + subroutine + [ LIT2 "4 18 ] DEO #0a18 DEO + + ( part 5 + > POP2: Removes a short from the stack + > INC2: Increments short on stack + > DUP2: Duplicate short + > LDA: load byte from absolute address + > JCI: Conditional subroutine to relative short address ) + + ;Dict/ok pstr + [ LIT2 "5 18 ] DEO #0a18 DEO + + ( part 6 + > JSR2: Jump to subroutine from short pointer + > LDAk: Non-destructive load byte from absolute address ) + + { "Ok $1 } STH2r ;pstr-jcn JSR2 + [ LIT2 "6 18 ] DEO #0a18 DEO + + ( part 7 + > Relative distance bytes ) + + rel-distance/entry SWP #18 DEO #18 DEO + [ LIT2 "7 18 ] DEO #0a18 DEO + + ( part xx + > GTH2k: Non-destructive greater-than short + > LDA2k: Non-destructive load short from absolute address + > STA2: Store short at absolute address ) + + [ LIT2r 0000 ] + ;tests/end ;tests + &l + run-test [ LITr 00 ] STH ADD2r + INC2 INC2 GTH2k ?&l + POP2 POP2 + STH2r ;tests/end ;tests SUB2 #01 SFT2 + EQU2 ;Dict/opctests test-part + + ( Part xx + > Testing that stacks are circular and wrapping + > Storing 12 at -1 and 34 at 0 ) + + POP #12 #34 ADD #46 EQU STH + POP #1234 ADD #46 EQU STH + POP2 #1111 #2222 ADD2 #3333 EQU2 + STHr AND STHr AND + ;Dict/stack-wrap test-part + + ( restore stack ) #0000 #0000 + + ( Part xx + > Testing RAM wrapping + > Storing 12 in 0xffff, and 34 in 0x0000 ) + + #1234 #ffff STA2 + ( LDA ) #0000 LDA #ffff LDA ADD #46 EQU + ( LDA2 ) #ffff LDA2 ADD #46 EQU + AND ;Dict/ram-wrap test-part + + ( Part xx + > Testing PC wrapping: split instruction + > Storing 80[LIT] in 0xffff, and 55[val8] in 0x0000 + > Storing 6c[JMP2r] in 0x0001 ) + + #8055 #ffff STA2 #6c #01 STZ #ffff JSR2 #55 EQU + ;Dict/pc-wrap test-part + + ( Part xx + > Testing PC wrapping: split value after instruction + > Storing a0[LIT2] in 0xfffe, + > and 0x55[hi-byte] in 0xffff, and 0xaa[lo-byte] in 0x0000 + > Storing 6c[JMP2r] in 0x0001 ) + + #a055 #fffe STA2 #aa6c #0000 STA2 #fffe JSR2 #55aa EQU2 + ;Dict/pc2-wrap test-part + + ( Part xx + > Testing that zero-page is wrapping ) + + #5678 #ff STZ2 + ( LDZ ) #00 LDZ #ff LDZ ADD #ce EQU + ( LDZ2 ) #ff LDZ2 ADD #ce EQU + AND ;Dict/zp-wrap test-part + + ( Part xx + > Testing that device page is wrapping ) + + #1234 #ff DEO2 + ( DEI ) #00 DEI #ff DEI ADD #46 EQU + ( DEI2 ) #ff DEI2 ADD #46 EQU + AND ;Dict/dev-wrap test-part + #0000 DEO #00ff DEO + + ( end ) + + [ LIT &fail 80 ] + DUP #80 EQU ;Dict/result test-part + #0f DEO + + #0a18 DEO + #010e DEO + +BRK + +( +@|metadata ) + +@meta 00 + ( name ) "Opctest 0a + ( details ) "A 20 "Testing 20 "Program 0a + ( author ) "By 20 "Devine 20 "Lu 20 "Linvega 0a + ( date ) "13 20 "Feb 20 "2026 $2 + +@test-part ( f name* -- ) + pstr ?{ + #01 ;on-reset/fail STA + ;Dict/failed !pstr } + ;Dict/passed !pstr + +@run-test ( addr* -- addr* f ) + + LDA2k JSR2 DUP ?&pass + ;Dict/missed pstr + [ LIT2 &name $2 ] pstr + [ LIT2 "# 18 ] DEO + [ LIT2 "a -id ] LDZ ADD #18 DEO + #0a18 DEO + #01 ;on-reset/fail STA + &pass + .id LDZ INC .id STZ + +JMP2r + +@set ( name* -- f ) + + ;run-test/name STA2 #01 + [ LIT2 ff -id ] STZ + +JMP2r + +@pstr ( str* -- ) + DUP2 LDA + DUP ?{ POP POP2 JMP2r } + #18 DEO + INC2 !pstr + +@pstr-jcn ( str* -- ) + LDAk #18 DEO + INC2 LDAk ,pstr-jcn JCN + POP2 + JMP2r + +@tests +=op-equ [ + =op-equ/a =op-equ/b =op-equ/c =op-equ/d + =op-equ/e =op-equ/f =op-equ/g =op-equ/h ] +=op-neq [ + =op-neq/a =op-neq/b =op-neq/c =op-neq/d + =op-neq/e =op-neq/f =op-neq/g =op-neq/h ] +=op-gth [ + =op-gth/a =op-gth/b =op-gth/c =op-gth/d + =op-gth/e =op-gth/f =op-gth/g =op-gth/h ] +=op-lth [ + =op-lth/a =op-lth/b =op-lth/c =op-lth/d + =op-lth/e =op-lth/f =op-lth/g =op-lth/h ] +=op-add [ + =op-add/a =op-add/b =op-add/c =op-add/d + =op-add/e =op-add/f =op-add/g =op-add/h ] +=op-sub [ + =op-sub/a =op-sub/b =op-sub/c =op-sub/d + =op-sub/e =op-sub/f =op-sub/g =op-sub/h ] +=op-mul [ + =op-mul/a =op-mul/b =op-mul/c =op-mul/d + =op-mul/e =op-mul/f =op-mul/g =op-mul/h ] +=op-div [ + =op-div/a =op-div/b =op-div/c =op-div/d + =op-div/e =op-div/f =op-div/g =op-div/h + =op-div/i =op-div/j ] +=op-inc [ + =op-inc/a =op-inc/b =op-inc/c =op-inc/d + =op-inc/e =op-inc/f =op-inc/g =op-inc/h + =op-inc/i =op-inc/j ] +=op-pop [ + =op-pop/a =op-pop/b =op-pop/c =op-pop/d + =op-pop/e =op-pop/f =op-pop/g =op-pop/h + =op-pop/i =op-pop/j ] +=op-dup [ + =op-dup/a =op-dup/b =op-dup/c =op-dup/d ] +=op-nip [ + =op-nip/a =op-nip/b =op-nip/c =op-nip/d ] +=op-swp [ + =op-swp/a =op-swp/b =op-swp/c =op-swp/d ] +=op-ovr [ + =op-ovr/a =op-ovr/b =op-ovr/c =op-ovr/d ] +=op-rot [ + =op-rot/a =op-rot/b =op-rot/c =op-rot/d ] +=op-and [ + =op-and/a =op-and/b =op-and/c =op-and/d + =op-and/e =op-and/f =op-and/g =op-and/h ] +=op-ora [ + =op-ora/a =op-ora/b =op-ora/c =op-ora/d + =op-ora/e =op-ora/f =op-ora/g =op-ora/h ] +=op-eor [ + =op-eor/a =op-eor/b =op-eor/c =op-eor/d + =op-eor/e =op-eor/f =op-eor/g =op-eor/h ] +=op-sft [ + =op-sft/a =op-sft/b =op-sft/c =op-sft/d + =op-sft/e =op-sft/f =op-sft/g =op-sft/h ] +=op-stz [ + =op-stz/a =op-stz/b =op-stz/c =op-stz/d ] +=op-str [ + =op-str/a =op-str/b =op-str/c =op-str/d + =op-str/e =op-str/f =op-str/g =op-str/h ] +=op-sta [ + =op-sta/a =op-sta/b =op-sta/c =op-sta/d ] +=op-jmp [ + =op-jmp/a =op-jmp/b ] +=op-jcn [ + =op-jcn/a =op-jcn/b =op-jcn/c =op-jcn/d ] +=op-jsr [ + =op-jsr/a =op-jsr/b ] +=op-sth [ + =op-sth/a =op-sth/b =op-sth/c =op-sth/d + =op-sth/e =op-sth/f ] +=op-jci [ + =op-jci/a =op-jci/b =op-jci/c ] +=op-jmi [ + =op-jmi/a ] +=op-jsi [ + =op-jsi/a =op-jsi/b =op-jsi/c =op-jsi/d ] + &end + +( +@|StackI ) + +@op-inc ;Dict/inc !set + &a #01 INC [ #02 ] EQU JMP2r + &b #ff INC [ #00 ] EQU JMP2r + &c #fe INC [ #ff ] EQU JMP2r + &d #00 INC [ #01 ] EQU JMP2r + &e #00ff INC2 [ #0100 ] EQU2 JMP2r + &f #ffff INC2 [ #0000 ] EQU2 JMP2r + &g #fffe INC2 [ #ffff ] EQU2 JMP2r + &h #0000 INC2 [ #0001 ] EQU2 JMP2r + &i #00ff INCk NIP EQU JMP2r + &j #00ff INC2k POP ADD EQU JMP2r +@op-pop ;Dict/pop !set + &a #0a #0b POP [ #0a ] EQU JMP2r + &b #0a #0b #0c POP POP [ #0a ] EQU JMP2r + &c #0a #0b #0c ADD POP [ #0a ] EQU JMP2r + &d #0a #0b #0c POP ADD [ #15 ] EQU JMP2r + &e #0a0b #0c0d POP2 [ #0a0b ] EQU2 JMP2r + &f #0a0b #0c0d #0e0f POP2 POP2 [ #0a0b ] EQU2 JMP2r + &g #0a0b #0c0d #0e0f ADD2 POP2 [ #0a0b ] EQU2 JMP2r + &h #0a0b #0c0d #0e0f POP2 ADD2 [ #1618 ] EQU2 JMP2r + &i #0a POPk [ #0a ] EQU JMP2r + &j #0a0b POP2k [ #0a0b ] EQU2 JMP2r +@op-nip ;Dict/nip !set + &a #12 #34 #56 NIP ADD [ #68 ] EQU JMP2r + &b #12 #34 #56 NIPk ADD2 ADD [ #f2 ] EQU JMP2r + &c #1234 #5678 #9abc NIP2 ADD2 [ #acf0 ] EQU2 JMP2r + &d #1234 #5678 #9abc NIP2k ADD2 ADD2 ADD2 [ #9e24 ] EQU2 JMP2r + +( +@|StackII ) + +@op-swp ;Dict/swp !set + &a #02 #10 SWP DIV [ #08 ] EQU JMP2r + &b #0a0b #0c0d SWP2 NIP2 [ #0a0b ] EQU2 JMP2r + &c #abcd SWPk SWP EQU2 JMP2r + &d #abcd #1234 SWP2k ADD2 ADD2 ADD2 #7c02 EQU2 JMP2r +@op-rot ;Dict/rot !set + &a #02 #04 #10 ROT DIV ADD [ #0c ] EQU JMP2r + &b #0a0b #0c0d #0c0f ROT2 ADD2 NIP2 [ #161a ] EQU2 JMP2r + &c #0a0b #0c ROTk ADD2 ADD2 [ #2220 ] EQU2 JMP2r + &d #1234 #5678 #9abc ROT2k ADD2 ADD2 ADD2 ADD2 ADD2 #06d0 EQU2 JMP2r +@op-dup ;Dict/dup !set + &a #0a #0b DUP ADD ADD [ #20 ] EQU JMP2r + &b #0a0b DUP2 ADD2 [ #1416 ] EQU2 JMP2r + &c #12 DUPk ADD ADD [ #36 ] EQU JMP2r + &d #1234 DUP2k ADD2 ADD2 [ #369c ] EQU2 JMP2r +@op-ovr ;Dict/ovr !set + &a #02 #10 OVR DIV ADD [ #0a ] EQU JMP2r + &b #0a0b #0c0d OVR2 NIP2 ADD2 [ #1416 ] EQU2 JMP2r + &c #abcd OVRk EQU2 #ab01 EQU2 JMP2r + &d #abcd #1234 OVR2k ROT2 ADD2 ADD2 ADD2 SUB2 #2fcb EQU2 JMP2r + +( +@|Log ) + +@op-equ ;Dict/equ !set + &a #f8 #f8 EQU [ #01 ] EQU JMP2r + &b #01 #01 EQU [ #01 ] EQU JMP2r + &c #f8 #01 EQU [ #00 ] EQU JMP2r + &d #00 #ff EQU [ #00 ] EQU JMP2r + &e #f801 #f801 EQU2 [ #01 ] EQU JMP2r + &f #01f8 #01f8 EQU2 [ #01 ] EQU JMP2r + &g #f801 #01f8 EQU2 [ #00 ] EQU JMP2r + &h #01f8 #f801 EQU2 [ #00 ] EQU JMP2r +@op-neq ;Dict/neq !set + &a #f8 #f8 NEQ [ #00 ] EQU JMP2r + &b #01 #01 NEQ [ #00 ] EQU JMP2r + &c #f8 #01 NEQ [ #01 ] EQU JMP2r + &d #01 #f8 NEQ [ #01 ] EQU JMP2r + &e #f801 #f801 NEQ2 [ #00 ] EQU JMP2r + &f #01f8 #01f8 NEQ2 [ #00 ] EQU JMP2r + &g #f801 #01f8 NEQ2 [ #01 ] EQU JMP2r + &h #01f8 #f801 NEQ2 [ #01 ] EQU JMP2r +@op-gth ;Dict/gth !set + &a #f8 #f8 GTH [ #00 ] EQU JMP2r + &b #01 #01 GTH [ #00 ] EQU JMP2r + &c #f8 #01 GTH [ #01 ] EQU JMP2r + &d #01 #f8 GTH [ #00 ] EQU JMP2r + &e #f801 #f801 GTH2 [ #00 ] EQU JMP2r + &f #01f8 #01f8 GTH2 [ #00 ] EQU JMP2r + &g #f801 #01f8 GTH2 [ #01 ] EQU JMP2r + &h #01f8 #f801 GTH2 [ #00 ] EQU JMP2r +@op-lth ;Dict/lth !set + &a #f8 #f8 LTH [ #00 ] EQU JMP2r + &b #01 #01 LTH [ #00 ] EQU JMP2r + &c #f8 #01 LTH [ #00 ] EQU JMP2r + &d #01 #ff LTH [ #01 ] EQU JMP2r + &e #f801 #f801 LTH2 [ #00 ] EQU JMP2r + &f #01f8 #01f8 LTH2 [ #00 ] EQU JMP2r + &g #f801 #01f8 LTH2 [ #00 ] EQU JMP2r + &h #01f8 #f801 LTH2 [ #01 ] EQU JMP2r + +( +@|Sth ) + +@op-jmp ;Dict/jmp !set + &a #12 #34 ,&reljmp JMP SWP &reljmp POP [ #12 ] EQU JMP2r + &b #56 #78 ;&absjmp JMP2 SWP &absjmp POP [ #56 ] EQU JMP2r +@op-jcn ;Dict/jcn !set + &a #23 #01 ,&reljcn-y JCN INC &reljcn-y [ #23 ] EQU JMP2r + &b #23 #00 ,&reljcn-n JCN INC &reljcn-n [ #24 ] EQU JMP2r + &c #23 #01 ;&absjcn-y JCN2 INC &absjcn-y [ #23 ] EQU JMP2r + &d #23 #00 ;&absjcn-n JCN2 INC &absjcn-n [ #24 ] EQU JMP2r +@op-jsr ;Dict/jsr !set + &a #1234 #5678 ,&routine JSR [ #68ac ] EQU2 JMP2r + &b #12 #34 ;routine JSR2 [ #46 ] EQU JMP2r + &routine ADD2 JMP2r +@op-sth ;Dict/sth !set + &a #0a STH #0b STH ADDr STHr [ #15 ] EQU JMP2r + &b #000a STH2 #000b STH2 ADD2r STH2r [ #0015 ] EQU2 JMP2r + &c #abcd STH STH STH2r [ #cdab ] EQU2 JMP2r + &d #abcd STH2k STH2r EQU2 JMP2r + &e #abcd STH2k STHr STHr SWP EQU2 JMP2r + &f [ LIT2r abcd ] STHr STHr [ #cdab ] EQU2 JMP2r + +( +@|Mem ) + +@op-stz ;Dict/stz !set + &a #ab .zeropage/hb STZ .zeropage/hb LDZ [ #ab ] EQU JMP2r + &b #cd .zeropage/lb STZ .zeropage/lb LDZ [ #cd ] EQU JMP2r + &c .zeropage/hb LDZ2 [ #abcd ] EQU2 JMP2r + &d #1234 .zeropage/hb STZ2 .zeropage/hb LDZ2 [ #1234 ] EQU2 JMP2r +@op-str ;Dict/str !set + [ LIT2 &before-hb $1 &before-lb $1 ] + &a #ab ,&before-hb STR ,&before-hb LDR [ #ab ] EQU JMP2r + &b #cd ,&before-lb STR ,&before-lb LDR [ #cd ] EQU JMP2r + &c ,&before-hb LDR2 [ #abcd ] EQU2 JMP2r + &d #1234 ,&before-hb STR2 ,&before-hb LDR2 [ #1234 ] EQU2 JMP2r + &e #ab ,&after-hb STR ,&after-hb LDR [ #ab ] EQU JMP2r + &f #cd ,&after-lb STR ,&after-lb LDR [ #cd ] EQU JMP2r + &g ,&after-hb LDR2 [ #abcd ] EQU2 JMP2r + &h #1234 ,&after-hb STR2 ,&after-hb LDR2 [ #1234 ] EQU2 JMP2r + [ LIT2 &after-hb $1 &after-lb $1 ] +@op-sta ;Dict/sta !set + &a #ab ;absolute/hb STA ;absolute/hb LDA [ #ab ] EQU JMP2r + &b #cd ;absolute/lb STA ;absolute/lb LDA [ #cd ] EQU JMP2r + &c ;absolute/hb LDA2 [ #abcd ] EQU2 JMP2r + &d #1234 ;absolute/hb STA2 ;absolute/hb LDA2 [ #1234 ] EQU2 JMP2r + +( +@|Ari ) + +@op-add ;Dict/add !set + &a #ff #00 ADD [ #ff ] EQU JMP2r + &b #01 #ff ADD [ #00 ] EQU JMP2r + &c #ff #ff ADD [ #fe ] EQU JMP2r + &d #12 #34 ADDk ADD ADD [ #8c ] EQU JMP2r + &e #ffff #0000 ADD2 [ #ffff ] EQU2 JMP2r + &f #0001 #ffff ADD2 [ #0000 ] EQU2 JMP2r + &g #ffff #ffff ADD2 [ #fffe ] EQU2 JMP2r + &h #fffe #ffff ADD2 [ #fffd ] EQU2 JMP2r +@op-sub ;Dict/sub !set + &a #ff #00 SUB [ #ff ] EQU JMP2r + &b #01 #ff SUB [ #02 ] EQU JMP2r + &c #ff #ff SUB [ #00 ] EQU JMP2r + &d #fe #ff SUB [ #ff ] EQU JMP2r + &e #ffff #0000 SUB2 [ #ffff ] EQU2 JMP2r + &f #0001 #ffff SUB2 [ #0002 ] EQU2 JMP2r + &g #ffff #ffff SUB2 [ #0000 ] EQU2 JMP2r + &h #fffe #ffff SUB2 [ #ffff ] EQU2 JMP2r +@op-mul ;Dict/mul !set + &a #00 #01 MUL [ #00 ] EQU JMP2r + &b #3f #e7 MUL [ #d9 ] EQU JMP2r + &c #37 #3f MUL [ #89 ] EQU JMP2r + &d #10 #02 MUL [ #20 ] EQU JMP2r + &e #1000 #0003 MUL2 [ #3000 ] EQU2 JMP2r + &f #abcd #1234 MUL2 [ #4fa4 ] EQU2 JMP2r + &g #8000 #0200 MUL2 [ #0000 ] EQU2 JMP2r + &h #2222 #0003 MUL2 [ #6666 ] EQU2 JMP2r +@op-div ;Dict/div !set + &a #10 #06 DIV [ #02 ] EQU JMP2r + &b #20 #20 DIV [ #01 ] EQU JMP2r + &c #34 #01 DIV [ #34 ] EQU JMP2r + &d #02 #ef DIV [ #00 ] EQU JMP2r + &e #02 #00 DIV [ #00 ] EQU JMP2r + &f #03e8 #0006 DIV2 [ #00a6 ] EQU2 JMP2r + &g #abcd #1234 DIV2 [ #0009 ] EQU2 JMP2r + &h #8000 #0200 DIV2 [ #0040 ] EQU2 JMP2r + &i #2222 #0003 DIV2 [ #0b60 ] EQU2 JMP2r + &j #0202 #0000 DIV2 [ #0000 ] EQU2 JMP2r + +( +@|Bit ) + +@op-and ;Dict/and !set + &a #fc #3f AND [ #3c ] EQU JMP2r + &b #f0 #0f AND [ #00 ] EQU JMP2r + &c #ff #3c AND [ #3c ] EQU JMP2r + &d #02 #03 AND [ #02 ] EQU JMP2r + &e #f0f0 #00f0 AND2 [ #00f0 ] EQU2 JMP2r + &f #aaaa #5555 AND2 [ #0000 ] EQU2 JMP2r + &g #ffff #1234 AND2 [ #1234 ] EQU2 JMP2r + &h #abcd #0a0c AND2 [ #0a0c ] EQU2 JMP2r +@op-ora ;Dict/ora !set + &a #0f #f0 ORA [ #ff ] EQU JMP2r + &b #ab #cd ORA [ #ef ] EQU JMP2r + &c #12 #34 ORA [ #36 ] EQU JMP2r + &d #88 #10 ORA [ #98 ] EQU JMP2r + &e #0f0f #f0f0 ORA2 [ #ffff ] EQU2 JMP2r + &f #abab #cdcd ORA2 [ #efef ] EQU2 JMP2r + &g #1122 #1234 ORA2 [ #1336 ] EQU2 JMP2r + &h #8888 #1000 ORA2 [ #9888 ] EQU2 JMP2r +@op-eor ;Dict/eor !set + &a #00 #00 EOR [ #00 ] EQU JMP2r + &b #ff #00 EOR [ #ff ] EQU JMP2r + &c #aa #55 EOR [ #ff ] EQU JMP2r + &d #ff #ff EOR [ #00 ] EQU JMP2r + &e #ffff #ff00 EOR2 [ #00ff ] EQU2 JMP2r + &f #aaaa #5555 EOR2 [ #ffff ] EQU2 JMP2r + &g #1122 #1234 EOR2 [ #0316 ] EQU2 JMP2r + &h #8888 #1000 EOR2 [ #9888 ] EQU2 JMP2r +@op-sft ;Dict/sft !set + &a #ff #08 SFT [ #00 ] EQU JMP2r + &b #ff #e0 SFT [ #00 ] EQU JMP2r + &c #ff #11 SFT [ #fe ] EQU JMP2r + &d #ff #12 SFT [ #7e ] EQU JMP2r + &e #ffff #01 SFT2 [ #7fff ] EQU2 JMP2r + &f #ffff #70 SFT2 [ #ff80 ] EQU2 JMP2r + &g #ffff #7e SFT2 [ #0180 ] EQU2 JMP2r + &h #ffff #e3 SFT2 [ #c000 ] EQU2 JMP2r + +( +@|Imm ) + +@op-jci ;Dict/jci !set + &before #01 JMP2r + &a #01 ?&skip-a #00 JMP2r &skip-a #01 JMP2r + &b #00 ?&skip-b #01 JMP2r &skip-b #00 JMP2r + &c #01 ?&before #00 JMP2r +@op-jmi ;Dict/jmi !set + &a !&skip-a #00 JMP2r &skip-a #01 JMP2r +@op-jsi ;Dict/jsi !set + &a #02 #04 routine #06 EQU JMP2r + &b ;&return special &return JMP2r + &c ,&skip-c JMP &routine-c ADD JMP2r &skip-c #02 #04 op-jsi/routine-c #06 EQU JMP2r + &d ,&skip-d JMP &routine-d ADD JMP2r &skip-d #02 #04 op-jsi-far-routine-d #06 EQU JMP2r + +@special ( routine* -- f ) + + ( test that the stack order is LIFO ) + DUP2 STH2kr EQU2 + ROT ROT DUP2r STHr STHr SWP EQU2 AND + +JMP2r + +@routine ( a b -- c ) ADD JMP2r +@subroutine ( -- ) [ LIT2 "kO ] #18 DEO #18 DEO JMP2r +@absolute/hb $1 &lb $2 + +@Dict [ + &ok "Ok $1 + &done "Tests 20 "Complete. 0a $1 + &opctests "Opcodes $1 + &stack-wrap "Stack-wrap $1 + &ram-wrap "RAM-wrap $1 + &pc-wrap "PC-wrap $1 + &pc2-wrap "PC2-wrap $1 + &zp-wrap "Zeropage-wrap $1 + &dev-wrap "Devices-wrap $1 + &result "Result: $1 + &passed 20 "passed! 0a $1 + &missed "Opcode 20 "Failed 20 "-- 20 $1 + &failed 20 "failed. 0a $1 + &equ "EQU $1 &neq "NEQ $1 >h "GTH $1 <h "LTH $1 + &add "ADD $1 &sub "SUB $1 &mul "MUL $1 &div "DIV $1 + &inc "INC $1 &pop "POP $1 &dup "DUP $1 &nip "NIP $1 + &swp "SWP $1 &ovr "OVR $1 &rot "ROT $1 + &and "AND $1 &ora "ORA $1 &eor "EOR $1 &sft "SFT $1 + &stz "STZ $1 &str "STR $1 &sta "STA $1 + &jmp "JMP $1 &jcn "JCN $1 &jsr "JSR $1 &sth "STH $1 + &jmi "JMI $1 &jci "JCI $1 &jsi "JSI $1 ] + +( +@|Relative Distance Bytes ) + +@rel-distance/back "O $7c +&entry + ,&back LDR + ,&forw LDR + JMP2r +$7e +&forw "k + +@op-jsi-far-routine-d + op-jsi/routine-d JMP2r +