~rabbits/ornithologics

dd0c5d02a826463140e32de5bdafee08017803e2 — neauoire 2 years ago cbb876f
Display variable names
1 files changed, 22 insertions(+), 43 deletions(-)

M src/ornithologics.tal
M src/ornithologics.tal => src/ornithologics.tal +22 -43
@@ 10,14 10,15 @@
			;y ;cons JSR2
				;x ;cons JSR2
	( program )
	;w ;cons JSR2 
		;s ;cons JSR2 
	;i ;cons JSR2
		;b ;cons JSR2
			;w ;cons JSR2
	( eval )
	;step JSR2
		;step JSR2
				
	;echo JSR2
			;step JSR2

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


@@ 74,7 75,7 @@ JMP2r
			( list )
			LDA2k ;echo JSR2 ,&resume JMP
			&fn
			LDA2k LDA2 ,print JSR #2018 DEO
			LDA2k #0004 ADD2 LDA #18 DEO #2018 DEO
		&resume
		INC2 INC2 LDA2 LDA2k ;nil NEQ2 ,&w JCN
	POP2


@@ 82,51 83,29 @@ JMP2r

JMP2r

@eval ( list* -- )
@step ( list* -- list* )

	DUP2 ;print JSR2 #0a18 DEO
	&w
		LDA2k INC2 INC2 LDA2 ;nil EQU2 ,&fn JCN
			( list )
			LDA2k ;eval JSR2 ,&resume JMP
			&fn
			LDA2k LDA2 OVR #07 SFT JMP JSR2k POP2
		&resume
		INC2 INC2 LDA2 LDA2k ;nil NEQ2 ,&w JCN
	POP2

JMP2r

@step ( list* -- )

	INC2k INC2 LDA2 SWP2 LDA2 LDA2 JSR2

JMP2r

@print ( short* -- )

	SWP ,&byte JSR
	&byte ( byte -- ) DUP #04 SFT ,&char JSR
	&char ( char -- ) #0f AND DUP #09 GTH #27 MUL ADD #30 ADD #18 DEO
	INC2k INC2 LDA2 SWP2 LDA2 LDA2 JSR2 
	DUP2 ;echo JSR2 #0a18 DEO

JMP2r

( variables )

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

( library )

@m :mockingbird :nil
@k :kestrel :nil
@t :thrush :nil
@b :bluebird :nil
@c :cardinal :nil
@w :warbler :nil
@i :identity :nil
@s :starling :nil
@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 )



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