~rabbits/ornithologics

bfdee638ac3406c9b60a13c1bd4c35fe3a55d578 — neauoire 2 years ago dd0c5d0
Added evaluation loop
1 files changed, 21 insertions(+), 17 deletions(-)

M src/ornithologics.tal
M src/ornithologics.tal => src/ornithologics.tal +21 -17
@@ 13,12 13,9 @@
	;i ;cons JSR2
		;b ;cons JSR2
			;w ;cons JSR2
	( eval )
	;step JSR2
		;step JSR2
			;step JSR2
	( eval ) 
	;eval JSR2

	( tail ) POP2
	( lb ) #0a18 DEO
	( debugger ) #010e DEO
	( halt ) #010f DEO


@@ 67,15 64,29 @@ JMP2r

JMP2r

@eval ( list* -- )

	&w ,step JSR DUP2 #0000 NEQ2 ,&w JCN POP2

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 
	DUP2 ,echo JSR #0a18 DEO

JMP2r
	&failure POP2 #0000 JMP2r

@echo ( list* -- )

	#2818 DEO #2018 DEO
	&w
		LDA2k INC2 INC2 LDA2 ;nil EQU2 ,&fn JCN
			( list )
			LDA2k ;echo JSR2 ,&resume JMP
			&fn
			LDA2k #0004 ADD2 LDA #18 DEO #2018 DEO
			( list ) LDA2k ,echo JSR ,&resume JMP
			&fn LDA2k #0004 ADD2 LDA #18 DEO #2018 DEO
		&resume
		INC2 INC2 LDA2 LDA2k ;nil NEQ2 ,&w JCN
	POP2


@@ 83,13 94,6 @@ JMP2r

JMP2r

@step ( list* -- list* )

	INC2k INC2 LDA2 SWP2 LDA2 LDA2 JSR2 
	DUP2 ;echo JSR2 #0a18 DEO

JMP2r

( variables )

@x 8000 :nil 'x


@@ 163,7 167,7 @@ JMP2r

@identity ( list* -- list* )

	( nothing.. )
	( chrip )

JMP2r