-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathavrforth.spf
94 lines (73 loc) · 2.36 KB
/
avrforth.spf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
\ AVR Forth
DECIMAL
C" 1.6.0" CONSTANT _VERSION
.( AVRForth by OCo. Version )
_VERSION COUNT TYPE CR
WARNING 0!
S" src/lib/include/tools.spf" INCLUDED \ [IF] [THEN]
S" src/lib/include/core-ext.spf" INCLUDED \ [IF] [THEN]
S" src/lib/ext/case.spf" INCLUDED \ CASE
S" src/lib/ext/testcase.spf" INCLUDED
S" src/util.spf" INCLUDED
S" src/lib/stack.spf" INCLUDED
S" src/lib/place.spf" INCLUDED
S" src/hex.spf" INCLUDED \ Intel hex saving
VOCABULARY TARGET
FORTH ONLY ALSO TARGET DEFINITIONS \ new definitions go to TARGET vocabulary
\ Context: TARGET FORTH
\ Current: TARGET
S" src/flash.spf" INCLUDED \ flash
S" src/avrasm.spf" INCLUDED \ assembly language
S" src/avrdisasm.spf" INCLUDED \ disassembly
S" src/avrlist.spf" INCLUDED \ listing creation
S" src/require.spf" INCLUDED \ words autoinclusion
S" src/xfbase.spf" INCLUDED \ defining words and control flow words
ALSO FORTH
\ Context: FORTH TARGET FORTH
\ Current: TARGET
\ ================= device
S" devices/devices.spf" INCLUDED \ devices constants
INCLUDED \ include device file that comes from the command line
S" src/init.spf" INCLUDED
\ words, defined before this will not go to the listing file
' RESET 'marker !
PREVIOUS
\ Context: TARGET FORTH
\ Current: TARGET
\ attention! words :, ;, CREATE, DOES> are redefined
RAM-BOTTOM DORG \ RАМ start address
0 EORG \ EEPROM start address
[F] 2VARIABLE FNAME [P] \ current file name
2DUP FNAME 2! \ store it
ONLY TARGET
INCLUDED \ include the program file from the command line
' MAIN [->] {MAIN} \ set the main word
[F]
CREATE FILENAME 256 ALLOT \ buffer for file extensions
\ create the hex file
FNAME 2@ FILENAME PLACE
S" .hex" FILENAME +PLACE
FILENAME COUNT T-SAVE
\ create the bin file
FNAME 2@ FILENAME PLACE
S" .bin" FILENAME +PLACE
FILENAME COUNT T-SAVE-BIN
\ create the eeprom hex file
FNAME 2@ FILENAME PLACE
S" .eep.hex" FILENAME +PLACE
FILENAME COUNT E-SAVE
\ create the eeprom bin file
FNAME 2@ FILENAME PLACE
S" .eep.bin" FILENAME +PLACE
FILENAME COUNT E-SAVE-BIN
\ create the listing
FNAME 2@ FILENAME PLACE
S" .lst" FILENAME +PLACE
FILENAME COUNT [P] LIST-SAVE [F]
COMMENTS FREE THROW \ free the memory for comments
AIStack FreeStack \ free the autoinclusion stack
?EMPTY
DECIMAL
.( Image size: ) THERE . .( bytes) CR
.( RAM size: ) DHERE RAM-BOTTOM - . .( bytes) CR
.( EEPROM size: ) EHERE . .( bytes) CR