~rabbits/uxn5

fcafe72180a0204d539cc8c6eb403164f512d3fc — Devine Lu Linvega a month ago 28cb954
Use new drifloon
6 files changed, 272 insertions(+), 54 deletions(-)

M build.sh
M etc/drifloon.tal
M index.html
A src/asm.js
M src/emu.js
M src/uxn.js
M build.sh => build.sh +3 -3
@@ 7,11 7,11 @@ rm -rf bin
mkdir bin

# Assembler
echo "Assembling formatter.."
uxnasm etc/format-js.tal bin/format-js.rom
uxnasm etc/drifloon.tal bin/drifloon.rom

echo "Assembling unicycle.."
echo "Assembling formatter.."

echo "Writing program.js.."
uxncli bin/format-js.rom bin/drifloon.rom > src/asm.js
echo "Done."


M etc/drifloon.tal => etc/drifloon.tal +6 -3
@@ 12,18 12,19 @@ BRK

	.Console/read DEI
	DUP [ LIT2 &buffer =source ] STA
	;&buffer LDA2k INC2 SWP2 STA2
	#0a NEQ ?&end
		,&buffer LDR2 ;source EQU2 ?&empty
		assemble
		print-summary
		&end
	;&buffer LDA2k INC2 SWP2 STA2

BRK
	&empty ;err pstr ;err/empty pstr ( halt ) #010f DEO BRK

@on-error ( id* name* -> )

	#0a19 DEO
	( print ) ;err pstr pstr #2019 DEO pstr ;dict/in pstr ;scope pstr ;dict/dot pstr
	;err pstr pstr #2019 DEO pstr ;dict/in pstr ;scope pstr ;dict/dot pstr
	( halt ) #010f DEO

BRK


@@ 38,6 39,7 @@ BRK
		LDAk handle-char
		INC2 LDAk ?&w
	POP2

JMP2r

@handle-char ( c -- )


@@ 399,6 401,7 @@ JMP2r
	&invalid "Invalid $1
	&mode "Mode $1
	&rewind "Rewind $1
	&empty "Empty $1

@opcodes
	"LIT "INC "POP "NIP "SWP "ROT "DUP "OVR

M index.html => index.html +50 -36
@@ 3,71 3,85 @@
<head>
	<meta charset="utf-8"/>
	<title>Uxntal Playground</title>
	<script src="src/programs.js"></script>
	<script src="src/asm.js"></script>
	<script src="src/emu.js"></script>
	<script src="src/uxn.js"></script>
</head>
<body>
	<textarea id="editor" spellcheck="false">Program</textarea>
	<div id='term'></div>
	<textarea id="editor" spellcheck="false">|0100 ( init )

	;hello-word ;print-text JSR2

BRK

@print-text ( str* -- )

	&while
		( send ) LDAk #18 DEO
		( loop ) INC2 LDAk ,&while JCN
	POP2

JMP2r

@hello-word "Hello 20 "World! 00</textarea>
	<div id='term'>Press <b>Run</b> to evaluate this program</div>
	<div id='stack'>
		<input type="button" id="run" value="Run">
		<span id='wst'>empty</span>
		<span id='wst'>Ready.</span>
	</div>

	<script type="text/javascript">
		'use strict'

		let term_el = document.getElementById("term")
		term_el.innerHTML = "Ready."

		let editor_el = document.getElementById("editor")
		editor_el.value = hello_tal;
		document.body.className = "active"

		let wst_el = document.getElementById("wst")
		wst_el.innerHTML = "--"
		let term_el = document.getElementById("term")

		function assemble(query, program){
		function assemble(query, program) {
			let emulator = new Emu()
			let length = 0
			emulator.console.write = (char) => { program[length++] = char }
			emulator.console.error = (char) => { term_el.innerHTML += String.fromCharCode(char) }
			emulator.uxn.load(drifloon_rom).eval(0x0100)
			emulator.uxn.load(assembler).eval(0x0100)
			term_el.innerHTML = ""
			for (let i = 0; i < query.length; i++)
				emulator.console.input(query.charAt(i).charCodeAt(0))
			emulator.console.input(0x0a)
		}

		/* assembler */
		let run_el = document.getElementById("run")		
		run_el.addEventListener("click", (event) => {
			let program = new Uint8Array(0x10000)
			assemble(editor_el.value.replace(/(\r\n|\n|\r|\t)/gm, " "), program)
			let emulator = new Emu()
			emulator.console.write = (char) => { term_el.innerHTML += String.fromCharCode(char) }
			emulator.uxn.load(program).eval(0x0100)
			/* draw stack */
			if(!emulator.uxn.wst.ptr())
		function print_stack(stack) {
			let wst_el = document.getElementById("wst")
			if(!stack.ptr())
				wst_el.innerHTML = "Stack: Empty"
			else {
				let i = 0;
				wst_el.innerHTML = "Stack: "
				for(i = 0; i< emulator.uxn.wst.ptr(); i++){
					wst_el.innerHTML += ('0' + (emulator.uxn.wst.get(i) & 0xFF).toString(16)).slice(-2) + " ";
				}
				for(i = 0; i< stack.ptr(); i++)
					wst_el.innerHTML += ('0' + (stack.get(i) & 0xFF).toString(16)).slice(-2) + " ";
			}
			
		})
		}

		function run() {
			let editor_el = document.getElementById("editor")
			let program = new Uint8Array(0x10000)
			assemble(editor_el.value.replace(/(\r\n|\n|\r|\t)/gm, " "), program)
			let emulator = new Emu()
			emulator.console.write_el = term_el
			emulator.console.error_el = term_el
			emulator.uxn.load(program).eval(0x0100)
			print_stack(emulator.uxn.wst)
		}
	
		document.getElementById("run").addEventListener("click", run)

	</script>
	<style>
		body { max-width:600px; font-family:monospace; padding:30px }
		textarea { resize:none; width:100%; height:275px; border:2px solid #000; border-radius:0px; padding:10px; margin-bottom:0px; }
		textarea:focus { outline: none !important; border:2px solid black; }
		div#term { width:100%; background:#000; padding:12px; color:white; max-height:60px; overflow:scroll; white-space:pre }
		div#ctrl { margin-bottom:10px }
		div#stack { width:100%; background:#72dec2; padding:12px; margin-bottom:20px;font-weight:bold }
		body { font-family:monospace; overflow:hidden; height:100vh; padding:0; margin:0 }
		textarea { resize:none; width:100%; height:100vh; border:0; padding:10px; margin-bottom:0px; background:#efefef }
		textarea:focus { outline: none !important; }
		div#term { width:100%; background:#000; padding:10px; color:white; height:55px; overflow:scroll; white-space:pre; display:none }
		div#stack { width:100%; height:25px; background:#72dec2; padding:10px; margin-bottom:20px;font-weight:bold; display:none }
		body.active textarea { height:calc(100% - 140px); }
		body.active div#term, body.active div#stack { display:block }
	</style>
	<noscript>This form requires Javascript.</noscript>
</body>
</html> 
\ No newline at end of file

A src/asm.js => src/asm.js +207 -0
@@ 0,0 1,207 @@
const assembler = new Uint8Array([
	0xa0, 0x01, 0x07, 0x80, 0x10, 0x37, 0x00, 0x80, 
	0x12, 0x16, 0x06, 0xa0, 0x07, 0xcc, 0x15, 0x80, 
	0x0a, 0x09, 0x20, 0x00, 0x10, 0x80, 0xf4, 0x32, 
	0xa0, 0x07, 0xcc, 0x28, 0x20, 0x00, 0x0e, 0x60, 
	0x00, 0x99, 0x60, 0x03, 0xcd, 0xa0, 0x01, 0x0c, 
	0xb4, 0x21, 0x24, 0x35, 0x00, 0xa0, 0x06, 0x90, 
	0x60, 0x04, 0x21, 0xa0, 0x06, 0xd3, 0x60, 0x04, 
	0x1b, 0xa0, 0x01, 0x0f, 0x17, 0x00, 0xa0, 0x06, 
	0x90, 0x60, 0x04, 0x10, 0x60, 0x04, 0x0d, 0xa0, 
	0x20, 0x19, 0x17, 0x60, 0x04, 0x06, 0xa0, 0x06, 
	0x6c, 0x60, 0x04, 0x00, 0xa0, 0x07, 0x8c, 0x60, 
	0x03, 0xfa, 0xa0, 0x06, 0x73, 0x60, 0x03, 0xf4, 
	0xa0, 0x01, 0x0f, 0x17, 0x00, 0xa0, 0x07, 0xcc, 
	0x94, 0x60, 0x00, 0x07, 0x21, 0x94, 0x20, 0xff, 
	0xf7, 0x22, 0x6c, 0x80, 0x20, 0x8a, 0x03, 0x20, 
	0x00, 0x0a, 0x02, 0xa0, 0x07, 0x6c, 0x94, 0x20, 
	0x00, 0x12, 0x22, 0x6c, 0xa0, 0x07, 0x6c, 0x26, 
	0x60, 0x03, 0xf0, 0xa0, 0x00, 0x1f, 0x2b, 0x20, 
	0x03, 0xde, 0x02, 0x6c, 0x26, 0x60, 0x00, 0x03, 
	0x40, 0x04, 0x02, 0x94, 0x80, 0x28, 0x08, 0x20, 
	0x00, 0x0f, 0x94, 0x80, 0x29, 0x08, 0x20, 0x00, 
	0x08, 0x80, 0x00, 0x20, 0x00, 0x0b, 0x40, 0x00, 
	0x35, 0x14, 0x80, 0x28, 0x08, 0x80, 0xf2, 0x13, 
	0x6c, 0x22, 0x6c, 0xa0, 0x01, 0x00, 0x60, 0x03, 
	0x2c, 0xa0, 0x06, 0x5f, 0xa0, 0x07, 0x8c, 0x60, 
	0x03, 0xbb, 0x60, 0xff, 0x98, 0xa0, 0x01, 0x00, 
	0x60, 0x03, 0x1a, 0xa0, 0x06, 0x5f, 0xa0, 0x07, 
	0x8c, 0x60, 0x03, 0xa9, 0x80, 0x00, 0xa0, 0x03, 
	0x2a, 0x15, 0x60, 0xff, 0x80, 0x6c, 0x94, 0x80, 
	0x08, 0x13, 0xa0, 0x07, 0x6c, 0xa0, 0x07, 0x3c, 
	0x94, 0x80, 0x00, 0x09, 0x20, 0x00, 0x04, 0x23, 
	0x21, 0x34, 0x2c, 0xa0, 0x00, 0x03, 0x38, 0xaa, 
	0x20, 0xff, 0xed, 0x22, 0x22, 0x26, 0x60, 0x02, 
	0x28, 0x20, 0x00, 0x87, 0x26, 0x60, 0x02, 0x36, 
	0x20, 0x00, 0x87, 0x60, 0x00, 0x62, 0x6c, 0x21, 
	0x60, 0x01, 0x38, 0x60, 0x00, 0x84, 0x40, 0x02, 
	0xcc, 0x21, 0x60, 0x01, 0x2e, 0x40, 0x00, 0x9b, 
	0x21, 0xa0, 0x07, 0x8c, 0x27, 0x24, 0x60, 0x03, 
	0x54, 0x40, 0x01, 0x96, 0x21, 0x60, 0x01, 0xe3, 
	0x40, 0x01, 0x8f, 0x80, 0x80, 0x60, 0x00, 0xdc, 
	0x21, 0x60, 0x01, 0x4b, 0x60, 0x01, 0x1c, 0x01, 
	0x40, 0x00, 0xd1, 0x80, 0x80, 0x60, 0x00, 0xcc, 
	0x21, 0x60, 0x01, 0x3b, 0x34, 0x03, 0x40, 0x00, 
	0xc3, 0x80, 0xa0, 0x60, 0x00, 0xbe, 0x21, 0x60, 
	0x01, 0x2d, 0x34, 0x40, 0x00, 0xb2, 0x80, 0x20, 
	0x60, 0x00, 0xb1, 0x21, 0x40, 0x00, 0x73, 0x80, 
	0x40, 0x60, 0x00, 0xa8, 0x21, 0x40, 0x00, 0x6a, 
	0x80, 0x60, 0x60, 0x00, 0x9f, 0x40, 0x00, 0x62, 
	0x21, 0x26, 0x60, 0x02, 0xf6, 0x03, 0x80, 0x02, 
	0x1f, 0xa0, 0xa0, 0x80, 0x05, 0x0c, 0x04, 0x02, 
	0x60, 0x00, 0x89, 0x40, 0x00, 0x5a, 0x21, 0x40, 
	0x00, 0x3d, 0x60, 0x01, 0xb3, 0x40, 0x00, 0x7c, 
	0x22, 0x6c, 0xa0, 0x03, 0x20, 0x34, 0xab, 0x20, 
	0x00, 0x06, 0xb9, 0x60, 0x00, 0x15, 0x22, 0x6c, 
	0x27, 0xa0, 0x01, 0x00, 0x2b, 0x20, 0x00, 0x09, 
	0xa0, 0x07, 0x6c, 0xa0, 0x06, 0xcc, 0x40, 0xfe, 
	0x7d, 0x22, 0x6c, 0xa0, 0x00, 0x00, 0xa8, 0x20, 
	0x00, 0x0a, 0x80, 0x00, 0x60, 0x00, 0x4d, 0x21, 
	0xaa, 0x20, 0xff, 0xf6, 0x22, 0x22, 0x6c, 0x94, 
	0x60, 0x00, 0x41, 0x21, 0x94, 0x20, 0xff, 0xf7, 
	0x22, 0x6c, 0x60, 0x00, 0xaa, 0x34, 0xa0, 0x03, 
	0x20, 0x34, 0x21, 0x21, 0x39, 0x40, 0x00, 0x28, 
	0x26, 0x60, 0x02, 0x87, 0x27, 0x60, 0x00, 0x5b, 
	0x24, 0x03, 0x06, 0x80, 0x02, 0x08, 0x20, 0x00, 
	0x0f, 0x06, 0x80, 0x04, 0x08, 0x20, 0x00, 0x0e, 
	0x02, 0x22, 0xa0, 0x06, 0xa5, 0x40, 0xfe, 0x2e, 
	0x02, 0x23, 0x03, 0x40, 0x00, 0x06, 0x02, 0x23, 
	0x04, 0x60, 0x00, 0x00, 0x80, 0x23, 0x13, 0xa0, 
	0x01, 0x00, 0xa0, 0x01, 0x00, 0x2b, 0x20, 0x00, 
	0x15, 0x80, 0x01, 0x20, 0x00, 0x13, 0xa0, 0x00, 
	0x00, 0x80, 0xec, 0x32, 0x2b, 0x20, 0x00, 0x06, 
	0x80, 0x07, 0x12, 0x80, 0x18, 0x17, 0x40, 0x01, 
	0xa7, 0x80, 0x00, 0x80, 0x00, 0x08, 0x20, 0x00, 
	0x07, 0x80, 0xd4, 0x32, 0xa0, 0x03, 0x2f, 0x35, 
	0x40, 0x01, 0x95, 0x26, 0x60, 0x00, 0xda, 0x20, 
	0x00, 0x06, 0xa0, 0x06, 0xa5, 0x40, 0xfd, 0xde, 
	0x40, 0x02, 0x9e, 0xa0, 0x03, 0x2a, 0x14, 0x20, 
	0x00, 0x21, 0xb4, 0xa0, 0x03, 0x20, 0x34, 0x39, 
	0xa0, 0x00, 0x03, 0x39, 0x26, 0xa0, 0x00, 0x80, 
	0x38, 0x02, 0x20, 0x00, 0x03, 0x23, 0x03, 0x6c, 
	0x22, 0xa0, 0x00, 0x03, 0x38, 0xa0, 0x06, 0xb6, 
	0x40, 0xfd, 0xb3, 0x22, 0x80, 0xff, 0x6c, 0xa0, 
	0x03, 0x2a, 0x14, 0x80, 0x00, 0x08, 0x20, 0x00, 
	0x05, 0x22, 0xa0, 0x03, 0xc0, 0x6c, 0x94, 0x80, 
	0x26, 0x09, 0x20, 0x00, 0x04, 0x21, 0x60, 0x00, 
	0x72, 0x60, 0x01, 0x15, 0xa1, 0x1d, 0x20, 0x00, 
	0x07, 0x22, 0xa0, 0x06, 0xac, 0x40, 0xfd, 0x86, 
	0xa1, 0x21, 0x94, 0x01, 0x05, 0x05, 0x15, 0x6c, 
	0xff, 0xff, 0x5b, 0x65, 0x6d, 0x70, 0x74, 0x79, 
	0x5d, 0x00, 0xa0, 0x03, 0x2a, 0x14, 0x80, 0x00, 
	0x08, 0x20, 0x00, 0x45, 0x26, 0x60, 0x00, 0x59, 
	0x20, 0x00, 0x32, 0x26, 0x60, 0x00, 0x67, 0x20, 
	0x00, 0x2b, 0x26, 0x60, 0x00, 0xdb, 0x21, 0x1d, 
	0x20, 0x00, 0x28, 0xa0, 0x03, 0x20, 0x34, 0xa0, 
	0x47, 0xcc, 0xaf, 0x35, 0x61, 0x61, 0x61, 0x26, 
	0xef, 0x60, 0x01, 0x89, 0x60, 0x01, 0x7c, 0x6f, 
	0x38, 0x21, 0x80, 0xeb, 0x33, 0xa0, 0x00, 0x00, 
	0x21, 0x80, 0xfa, 0x33, 0x6c, 0xa0, 0x06, 0xbf, 
	0x40, 0xfd, 0x2b, 0xa0, 0x06, 0x9b, 0x40, 0xfd, 
	0x25, 0x22, 0x6c, 0xa0, 0x07, 0x8c, 0xa0, 0x07, 
	0xac, 0xaf, 0x60, 0x01, 0x60, 0x80, 0x2f, 0xef, 
	0x60, 0x01, 0x45, 0xef, 0x60, 0x01, 0x53, 0x6f, 
	0x6c, 0x94, 0x60, 0x01, 0xb6, 0x01, 0x20, 0x00, 
	0x04, 0x22, 0x80, 0x00, 0x6c, 0x21, 0x94, 0x20, 
	0xff, 0xef, 0x22, 0x80, 0x01, 0x6c, 0x26, 0xa0, 
	0x07, 0x39, 0x60, 0x01, 0x8f, 0x20, 0x00, 0x32, 
	0x2f, 0xa0, 0x20, 0x00, 0x80, 0x00, 0x07, 0x80, 
	0x03, 0x1a, 0xa0, 0x06, 0xd9, 0x38, 0xef, 0x60, 
	0x01, 0x7a, 0x20, 0x00, 0x0a, 0x01, 0x8a, 0x20, 
	0xff, 0xea, 0x22, 0x62, 0x80, 0x00, 0x6c, 0x03, 
	0x06, 0x80, 0x00, 0x08, 0x80, 0x70, 0x1f, 0x18, 
	0x6f, 0xa0, 0x00, 0x03, 0x38, 0x60, 0x00, 0x06, 
	0x18, 0x6c, 0x22, 0x80, 0x01, 0x6c, 0xc0, 0x00, 
	0x94, 0x80, 0x20, 0x07, 0x80, 0x32, 0x08, 0x20, 
	0x00, 0x24, 0x06, 0x18, 0x07, 0x80, 0x72, 0x08, 
	0x20, 0x00, 0x1b, 0x06, 0x18, 0x07, 0x80, 0x6b, 
	0x08, 0x20, 0x00, 0x12, 0x06, 0x18, 0x07, 0x80, 
	0x21, 0x0b, 0x20, 0x00, 0x09, 0xa0, 0x07, 0x6c, 
	0xa0, 0x06, 0xc7, 0x40, 0xfc, 0x88, 0x03, 0x0f, 
	0x5d, 0x21, 0x94, 0x20, 0xff, 0xca, 0x22, 0x4f, 
	0x6c, 0x2f, 0xa0, 0x47, 0xcc, 0xa0, 0x00, 0x03, 
	0x38, 0x26, 0xef, 0x60, 0x00, 0xf5, 0x20, 0x00, 
	0x11, 0x60, 0x00, 0x91, 0x21, 0xa1, 0x21, 0x21, 
	0x14, 0x20, 0xff, 0xe9, 0x22, 0x62, 0xa0, 0xff, 
	0xff, 0x6c, 0xa0, 0x00, 0x03, 0x39, 0x62, 0x6c, 
	0xa0, 0x03, 0x20, 0x34, 0x21, 0xa0, 0x03, 0x20, 
	0x35, 0x6c, 0xa0, 0x47, 0xcc, 0xa1, 0x21, 0x21, 
	0x14, 0x06, 0x80, 0x40, 0x0a, 0x04, 0x80, 0x5b, 
	0x0b, 0x1c, 0x20, 0x00, 0x18, 0xa1, 0x21, 0x14, 
	0x20, 0x00, 0x12, 0xa0, 0x06, 0x7e, 0x60, 0x00, 
	0x43, 0xa0, 0x00, 0x03, 0x38, 0x26, 0x60, 0x00, 
	0x3b, 0xa0, 0x0a, 0x19, 0x17, 0x60, 0x00, 0x45, 
	0x21, 0xa1, 0x21, 0x21, 0x14, 0x20, 0xff, 0xcd, 
	0x22, 0xa0, 0x06, 0x54, 0x60, 0x00, 0x25, 0xa0, 
	0x03, 0x2f, 0x34, 0xa0, 0x00, 0xff, 0x39, 0x60, 
	0x00, 0xdd, 0xa0, 0x06, 0x64, 0x60, 0x00, 0x14, 
	0xa0, 0x04, 0x06, 0x34, 0x60, 0x00, 0xd0, 0xa0, 
	0x06, 0x76, 0x60, 0x00, 0x07, 0xa0, 0x06, 0x72, 
	0x60, 0x00, 0x01, 0x6c, 0x94, 0x20, 0x00, 0x02, 
	0x22, 0x6c, 0x94, 0x80, 0x19, 0x17, 0x21, 0x94, 
	0x20, 0xff, 0xf7, 0x22, 0x6c, 0x94, 0x20, 0x00, 
	0x01, 0x6c, 0x21, 0x94, 0x20, 0xff, 0xfb, 0x6c, 
	0x60, 0xff, 0xf2, 0xa1, 0x80, 0x00, 0x05, 0x05, 
	0x15, 0x15, 0x6c, 0x26, 0x60, 0xff, 0xe6, 0x24, 
	0x39, 0x6c, 0x60, 0xff, 0xe0, 0x27, 0x14, 0x20, 
	0x00, 0x03, 0x22, 0x22, 0x6c, 0x2f, 0x94, 0xef, 
	0x15, 0x61, 0x21, 0x94, 0x20, 0xff, 0xf7, 0x22, 
	0x80, 0x00, 0x6f, 0x15, 0x6c, 0x94, 0x20, 0x00, 
	0x02, 0x22, 0x6c, 0xaf, 0x80, 0x00, 0x6f, 0x15, 
	0x21, 0x94, 0x20, 0xff, 0xf6, 0x22, 0x6c, 0x07, 
	0x80, 0x21, 0x0b, 0x20, 0x00, 0x09, 0x80, 0x00, 
	0x04, 0x60, 0xff, 0xb4, 0x80, 0x00, 0x6c, 0x22, 
	0x80, 0x01, 0x6c, 0x2f, 0x94, 0xd4, 0x4f, 0x9c, 
	0x80, 0x00, 0x08, 0x20, 0x00, 0x0a, 0x89, 0x20, 
	0x00, 0x06, 0x22, 0x21, 0x61, 0x40, 0xff, 0xec, 
	0x23, 0x62, 0x08, 0x6c, 0xb4, 0x25, 0xb4, 0x25, 
	0x28, 0x0f, 0x21, 0x34, 0x24, 0x21, 0x34, 0x28, 
	0x4f, 0x1c, 0x6c, 0x80, 0x30, 0x19, 0x06, 0x80, 
	0x09, 0x0a, 0x0c, 0x6c, 0x80, 0x27, 0x19, 0x06, 
	0x80, 0x0f, 0x0a, 0x0c, 0x6c, 0x02, 0x80, 0xff, 
	0x6c, 0xe0, 0x00, 0x00, 0xc0, 0x40, 0x7f, 0xc0, 
	0x00, 0x94, 0x60, 0xff, 0xde, 0x0f, 0x78, 0x21, 
	0x94, 0x20, 0xff, 0xf0, 0x22, 0x6f, 0x6c, 0x80, 
	0x00, 0x80, 0x23, 0x13, 0xa0, 0x27, 0x10, 0x60, 
	0x00, 0x1a, 0xa0, 0x03, 0xe8, 0x60, 0x00, 0x14, 
	0xa0, 0x00, 0x64, 0x60, 0x00, 0x0e, 0xa0, 0x00, 
	0x0a, 0x60, 0x00, 0x08, 0x03, 0x80, 0x30, 0x18, 
	0x80, 0x19, 0x17, 0x6c, 0xbb, 0x86, 0x80, 0x00, 
	0x08, 0x20, 0x00, 0x0c, 0x06, 0x80, 0x30, 0x18, 
	0x80, 0x19, 0x17, 0x80, 0xff, 0x80, 0xef, 0x13, 
	0x02, 0x3a, 0x39, 0x6c, 0x41, 0x73, 0x73, 0x65, 
	0x6d, 0x62, 0x6c, 0x65, 0x64, 0x20, 0x00, 0x49, 
	0x4e, 0x49, 0x54, 0x00, 0x20, 0x62, 0x79, 0x74, 
	0x65, 0x73, 0x28, 0x00, 0x2c, 0x20, 0x69, 0x6e, 
	0x20, 0x00, 0x29, 0x2e, 0x0a, 0x00, 0x20, 0x6c, 
	0x61, 0x62, 0x65, 0x6c, 0x73, 0x00, 0x2d, 0x2d, 
	0x20, 0x55, 0x6e, 0x75, 0x73, 0x65, 0x64, 0x20, 
	0x6c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x00, 
	0x21, 0x21, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 
	0x3a, 0x20, 0x00, 0x44, 0x75, 0x70, 0x6c, 0x69, 
	0x63, 0x61, 0x74, 0x65, 0x00, 0x4e, 0x75, 0x6d, 
	0x62, 0x65, 0x72, 0x00, 0x52, 0x65, 0x66, 0x65, 
	0x72, 0x65, 0x6e, 0x63, 0x65, 0x00, 0x44, 0x69, 
	0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x00, 0x49, 
	0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x00, 0x4d, 
	0x6f, 0x64, 0x65, 0x00, 0x52, 0x65, 0x77, 0x69, 
	0x6e, 0x64, 0x00, 0x45, 0x6d, 0x70, 0x74, 0x79, 
	0x00, 0x4c, 0x49, 0x54, 0x49, 0x4e, 0x43, 0x50, 
	0x4f, 0x50, 0x4e, 0x49, 0x50, 0x53, 0x57, 0x50, 
	0x52, 0x4f, 0x54, 0x44, 0x55, 0x50, 0x4f, 0x56, 
	0x52, 0x45, 0x51, 0x55, 0x4e, 0x45, 0x51, 0x47, 
	0x54, 0x48, 0x4c, 0x54, 0x48, 0x4a, 0x4d, 0x50, 
	0x4a, 0x43, 0x4e, 0x4a, 0x53, 0x52, 0x53, 0x54, 
	0x48, 0x4c, 0x44, 0x5a, 0x53, 0x54, 0x5a, 0x4c, 
	0x44, 0x52, 0x53, 0x54, 0x52, 0x4c, 0x44, 0x41, 
	0x53, 0x54, 0x41, 0x44, 0x45, 0x49, 0x44, 0x45, 
	0x4f, 0x41, 0x44, 0x44, 0x53, 0x55, 0x42, 0x4d, 
	0x55, 0x4c, 0x44, 0x49, 0x56, 0x41, 0x4e, 0x44, 
	0x4f, 0x52, 0x41, 0x45, 0x4f, 0x52, 0x53, 0x46, 
	0x54, 0x42, 0x52, 0x4b, 0x7c, 0x02, 0x17, 0x24, 
	0x02, 0x21, 0x40, 0x02, 0x28, 0x26, 0x02, 0x34, 
	0x2c, 0x02, 0x3b, 0x5f, 0x02, 0x40, 0x2e, 0x02, 
	0x4b, 0x2d, 0x02, 0x50, 0x3b, 0x02, 0x59, 0x3d, 
	0x02, 0x5e, 0x3f, 0x02, 0x66, 0x21, 0x02, 0x6f, 
	0x5b, 0x02, 0xa0, 0x5d, 0x02, 0xa0, 0x23, 0x02, 
	0x80, 0x22, 0x02, 0x96, 0x00, 0x00])

M src/emu.js => src/emu.js +5 -11
@@ 3,21 3,15 @@
function Console(emu)
{
	this.buffer = ""
	this.display = null
	this.emit = null
	this.write_el = null
	this.error_el = null

	this.write = (char) => {
		this.display.innerHTML += this.buffer
		this.write_el.innerHTML += String.fromCharCode(char)
	}

	this.error = (char) => {
		if(char == 0x0a) {
			console.warn(this.buffer)
			this.buffer = ""
		}
		else{
			this.buffer += String.fromCharCode(char)
		}
		this.error_el.innerHTML += String.fromCharCode(char)
	}

	this.input = (char) => {


@@ 89,7 83,7 @@ function Emu ()
			this.console.error(val)
		}
		else if(port == 0x0f) {
			// console.warn("Program ended.")
			console.warn("Program ended.")
		}
		else {
			console.log("Unknown deo", port, val)

M src/uxn.js => src/uxn.js +1 -1
@@ 203,7 203,7 @@ function Uxn (emu)
		if(vec)
			this.eval(vec)
		else
			console.error("Error", this.rr ? "Return-stack" : "Working-stack", this.errors[err]);
			emu.console.error_el.innerHTML = "<b>Error</b>: " + (this.rr ? "Return-stack" : "Working-stack") + " " + this.errors[err] + "."
		this.pc = 0x0000
	}