~rabbits/uxnlin

55920b9aa2995cbddbbec93ac9abb98cbb87e1e5 — neauoire 4 months ago b152c0e
Added eager/late stack rules
1 files changed, 30 insertions(+), 13 deletions(-)

M src/uxnlin.tal
M src/uxnlin.tal => src/uxnlin.tal +30 -13
@@ 333,9 333,10 @@ JMP2r
@keep "Unkept $1 ( opcode should use non-destructive keep mode )
@unsafe "Unsafe $1 ( bitwise opcode used in relative jump )
@unstashed "Unstashed $1 ( literal was created on the wrong stack )
@latestack "Late-stack $1 ( arithmetic performed after stashing )
@eagerstack "Eager-stack $1 ( arithmetic performed before stashing )
@tokenlen "Token-length $1 ( token is longer than 24 characters )
@combine "Combine $1 ( sequences of two literal bytes )
@slowstack "Slowstack $1 ( arithmetic performed after stashing )

@inc "INC $1 @inc2 "INC2 $1
@inc-twice "INC 20 "INC $1


@@ 400,8 401,8 @@ JMP2r
@orak00equ "ORAk 20 "#00 20 "EQU $1
@rotswp "ROT 20 "SWP $1
@rot2swp2 "ROT2 20 "SWP2 $1
@ldakr-sthr "LDAkr 20 "STHr $1
@ldak-sth "LDAk 20 "STH $1
@ldakrsthr "LDAkr 20 "STHr $1
@ldaksth "LDAk 20 "STH $1
@inc2ora "INC2 20 "ORA $1

(


@@ 465,14 466,30 @@ JMP2r
	".__   $1 "STH    $1 :unstashed
	"#__   $1 "STH    $1 :unstashed
	"#____ $1 "STH2   $1 :unstashed
	"LDZ $1 "STH $1 :slowstack
	"LDZ2 $1 "STH2 $1 :slowstack
	"DEIk $1 "STH $1 :slowstack
	"DEI2k $1 "STH2 $1 :slowstack
	"LDZk $1 "STH $1 :slowstack
	"LDZ2k $1 "STH2 $1 :slowstack
	"DEI $1 "STH $1 :slowstack
	"DEI2 $1 "STH2 $1 :slowstack
	"LDZ $1 "STH $1 :latestack
	"LDZ2 $1 "STH2 $1 :latestack
	"DEIk $1 "STH $1 :latestack
	"DEI2k $1 "STH2 $1 :latestack
	"LDZk $1 "STH $1 :latestack
	"LDZ2k $1 "STH2 $1 :latestack
	"DEI $1 "STH $1 :latestack
	"DEI2 $1 "STH2 $1 :latestack
	"STH2r $1 "ADD $1 :eagerstack
	"STH2r $1 "SUB $1 :eagerstack
	"STH2r $1 "MUL $1 :eagerstack
	"STH2r $1 "DIV $1 :eagerstack
	"STH2r $1 "EQU $1 :eagerstack
	"STH2r $1 "NEQ $1 :eagerstack
	"STH2r $1 "GTH $1 :eagerstack
	"STH2r $1 "LTH $1 :eagerstack
	"STH2 $1 "ADDr $1 :eagerstack
	"STH2 $1 "SUBr $1 :eagerstack
	"STH2 $1 "MULr $1 :eagerstack
	"STH2 $1 "DIVr $1 :eagerstack
	"STH2 $1 "EQUr $1 :eagerstack
	"STH2 $1 "NEQr $1 :eagerstack
	"STH2 $1 "GTHr $1 :eagerstack
	"STH2 $1 "LTHr $1 :eagerstack
	"#__   $1 "#__    $1 :combine
	"DUP   $1 "DUP    $1 :keep
	"DUP2  $1 "DUP2   $1 :keep


@@ 552,8 569,8 @@ JMP2r
	"#10   $1 "SFT2   $1 :dup2add2
	"JSR2  $1 "JMP2r  $1 :jmp2
	"JSR   $1 "JMP2r  $1 :jmp
	"STH2kr $1 "LDA $1 :ldakr-sthr
	"STH2k $1 "LDAr $1 :ldak-sth
	"STH2kr $1 "LDA $1 :ldakrsthr
	"STH2k $1 "LDAr $1 :ldaksth
	"#ff $1 "NEQ $1 :inc

&end