~rabbits/ornithologics

eb20c094ce6a05db90cab486e4b4db891cc54db2 — neauoire 2 years ago bfdee63
Auto unwrap
1 files changed, 33 insertions(+), 16 deletions(-)

M src/ornithologics.tal
M src/ornithologics.tal => src/ornithologics.tal +33 -16
@@ 13,7 13,7 @@
	;i ;cons JSR2
		;b ;cons JSR2
			;w ;cons JSR2
	( eval ) 
	( eval )
	;eval JSR2

	( lb ) #0a18 DEO


@@ 24,7 24,7 @@ BRK

( cons )

@alloc ( -- cell* )
@alloc ( -- list* )

	[ LIT2 &next :memory ] DUP2 #0004 ADD2 ,&next STR2



@@ 64,8 64,24 @@ JMP2r

JMP2r

@last ( list* -- list* )

	&w INC2 INC2 LDA2 LDA2k ;nil NEQ2 ,&w JCN
	#0004 ADD2

JMP2r

@unwrap ( list* -- list* )

	INC2k INC2 LDA2 SWP2 LDA2 STH2k
	,last JSR INC2 INC2 STA2
	STH2r

JMP2r

@eval ( list* -- )

	DUP2 ,echo JSR #0a18 DEO
	&w ,step JSR DUP2 #0000 NEQ2 ,&w JCN POP2

JMP2r


@@ 73,12 89,13 @@ JMP2r
@step ( list* -- list* )

	( letter ) LDA2k LDA2 POP #07 SFT ,&failure JCN
	( list ) LDA2k INC2 INC2 LDA2 ;nil NEQ2 ,&failure JCN
	INC2k INC2 LDA2 SWP2 LDA2 LDA2 JSR2 
	( list ) LDA2k INC2 INC2 LDA2 ;nil NEQ2 ,&unwrap JCN
	INC2k INC2 LDA2 SWP2 LDA2 LDA2 JSR2
	DUP2 ,echo JSR #0a18 DEO

JMP2r
	&failure POP2 #0000 JMP2r
	&unwrap ;unwrap JMP2

@echo ( list* -- )



@@ 94,22 111,22 @@ JMP2r

JMP2r

( variables )
( Names )

@x 8000 :nil 'x
@y 8001 :nil 'y
@z 8002 :nil 'z

( library )
( Birds )

@m :mockingbird :nil 'm
@k :kestrel :nil 'k
@t :thrush :nil 't
@b :bluebird :nil 'b
@c :cardinal :nil 'c
@w :warbler :nil 'w
@i :identity :nil 'i
@s :starling :nil 's
@m :mockingbird :nil 'M
@k :kestrel :nil 'K
@t :thrush :nil 'T
@b :bluebird :nil 'B
@c :cardinal :nil 'C
@w :warbler :nil 'W
@i :identity :nil 'I
@s :starling :nil 'S

( Bekimet Forest )



@@ 140,8 157,8 @@ JMP2r
	LDA2k STH2 ;pop JSR2
	LDA2k STH2 ;pop JSR2
	LDA2k STH2 ;pop JSR2
	;nil JSR2 
	STH2r ;cons JSR2 
	;nil JSR2
	STH2r ;cons JSR2
	STH2r ;cons JSR2 ;cons JSR2
	STH2r ;cons JSR2