~rabbits/uxnrea

f51f32c17e5b82c1acb86f00c206179de7ae502f — Devine Lu Linvega 1 year, 4 months ago 8ac3991
Standard loadout
2 files changed, 66 insertions(+), 10 deletions(-)

M build.sh
M src/uxnrea.tal
M build.sh => build.sh +2 -0
@@ 17,6 17,8 @@ case "$*" in *--lint*) $lin $src ;; esac
$asm $src $dst
case "$*" in *--save*) cp $dst $roms_dir ;; esac

# uxnemu "${roms_dir}/left.rom" etc/hello.tal | uxncli "${roms_dir}/drifblim.rom" bin/hello.rom

# hello.tal -> hello.rom -> hello.tal
$asm etc/hello.tal bin/hello.rom
$emu $dst bin/hello.rom bin/hello.dis.tal # > etc/hello-dis.tal

M src/uxnrea.tal => src/uxnrea.tal +64 -10
@@ 20,24 20,78 @@
	@nested $1
	@last $1

|0100 ( -> )
|0100

	.Console/type DEI ?&has-args ;dict/usage pstr &has-args
	;&await .Console/vector DEO2 BRK
	&await ( -> ) .Console/read DEI .src skey ?ready-dst BRK
	@ready-dst ( -> ) ;&await .Console/vector DEO2 BRK
	&await ( -> ) .Console/read DEI .dst skey ?on-ready BRK
@on-reset ( -> )

@on-ready ( -> )
	.Console/type DEI ?&has-args
		;dict/usage pstr &has-args
	;&await-src .Console/vector DEO2

BRK

&await-src ( -> )

	.Console/read DEI
		DUP LIT "^ EQU ?on-interactive
		.src skey ?on-default

BRK

(
@|modes )

@on-default ( -> )

	;&await-dst .Console/vector DEO2

BRK &await-dst ( -> ) .Console/read DEI .dst skey ?&eval-once BRK

&eval-once ( -> )

	reassemble print-summary
	( debug ) #010e DEO
	( halt ) #800f DEO

BRK

@on-interactive ( c -> )

	;&await-dst .Console/vector DEO2

BRK &await-dst ( -> ) .Console/read DEI .dst skey ?&capture-src BRK

&capture-src ( -> )

	;&await-src .Console/vector DEO2

BRK &await-src ( -> ) .Console/read DEI .src skey ?&eval-loop BRK

&eval-loop ( -> )

	reassemble print-summary
	;src sclr

BRK

(
@|main )

@reassemble ( -- )

	load-symbols
	stream
	#0a emit
	#0a emit
	( debug ) #010e DEO
	( halt ) #800f DEO

BRK

JMP2r

@print-summary ( -- )



JMP2r

(
@|core )