aboutsummaryrefslogtreecommitdiff
path: root/amforth-6.5/common/words/tib.asm
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2017-08-19 12:15:28 +0200
committerDimitri Sokolyuk <demon@dim13.org>2017-08-19 12:15:28 +0200
commit67d25d837ac55f28a366c0a3b262e439a6e75fc3 (patch)
treedf7715c7724c5935ab87c807f3b8b4ef529315e3 /amforth-6.5/common/words/tib.asm
parente0d6784e89dba33226c0edb815bb974486fa7c48 (diff)
Add AmForth
Diffstat (limited to 'amforth-6.5/common/words/tib.asm')
-rw-r--r--amforth-6.5/common/words/tib.asm96
1 files changed, 96 insertions, 0 deletions
diff --git a/amforth-6.5/common/words/tib.asm b/amforth-6.5/common/words/tib.asm
new file mode 100644
index 0000000..ca5601f
--- /dev/null
+++ b/amforth-6.5/common/words/tib.asm
@@ -0,0 +1,96 @@
+; ( -- f )
+; System
+; refills the input buffer
+.if cpu_msp430==1
+ HEADER(XT_REFILLTIB,10,"refill-tib",DOCOLON)
+.endif
+
+.if cpu_avr8==1
+VE_REFILLTIB:
+ .dw $ff0a
+ .db "refill-tib"
+ .dw VE_HEAD
+ .set VE_HEAD = VE_REFILLTIB
+XT_REFILLTIB:
+ .dw DO_COLON
+PFA_REFILLTIB:
+.endif
+ .dw XT_TIB
+ .dw XT_DOLITERAL
+ .dw TIB_SIZE
+ .dw XT_ACCEPT
+ .dw XT_NUMBERTIB
+ .dw XT_STORE
+ .dw XT_ZERO
+ .dw XT_TO_IN
+ .dw XT_STORE
+ .dw XT_TRUE ; -1
+ .dw XT_EXIT
+
+; ( -- addr n )
+; System
+; address and current length of the input buffer
+.if cpu_msp430==1
+ HEADER(XT_SOURCETIB,10,"source-tib",DOCOLON)
+.endif
+
+.if cpu_avr8==1
+VE_SOURCETIB:
+ .dw $FF0A
+ .db "source-tib"
+ .dw VE_HEAD
+ .set VE_HEAD = VE_SOURCETIB
+XT_SOURCETIB:
+ .dw DO_COLON
+PFA_SOURCETIB:
+.endif
+ .dw XT_TIB
+ .dw XT_NUMBERTIB
+ .dw XT_FETCH
+ .dw XT_EXIT
+
+; ( -- addr )
+; System Variable
+; terminal input buffer address
+.if cpu_msp430==1
+ VARIABLE(XT_TIB,3,"tib")
+ .DW TIBAREA
+.endif
+
+.if cpu_avr8==1
+VE_TIB:
+ .dw $ff03
+ .db "tib",0
+ .dw VE_HEAD
+ .set VE_HEAD = VE_TIB
+XT_TIB:
+ .dw PFA_DOVARIABLE
+PFA_TIB:
+ .dw ram_tib
+.dseg
+ram_tib: .byte TIB_SIZE
+.cseg
+.endif
+
+; ( -- addr )
+; System Variable
+; variable holding the number of characters in TIB
+.if cpu_msp430==1
+ VARIABLE(XT_NUMBERTIB,4,"#tib")
+ .DW RAM_NUMBERTIB
+.endif
+
+.if cpu_avr8==1
+VE_NUMBERTIB:
+ .dw $ff04
+ .db "#tib"
+ .dw VE_HEAD
+ .set VE_HEAD = VE_NUMBERTIB
+XT_NUMBERTIB:
+ .dw PFA_DOVARIABLE
+PFA_NUMBERTIB:
+ .dw ram_sharptib
+.dseg
+ram_sharptib: .byte 2
+.cseg
+.endif