1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2 ;; UrForth level
1: self
-hosting
32-bit Forth compiler
4 ;; Copyright
(C
) 2020 Ketmar Dark
// Invisible Vector
6 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7 ;; metacompiling support
8 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
10 false
to tload
-verbose
12 " meta-00-compat.f" tload
13 asmx86
:asm
-Labman
-Reinit
16 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
17 only forth definitions
19 also ur
-meta definitions
21 ;; 0: don
't change case; 1: upcase; -1: locase
22 0 value tc-create-case?
24 ;; align headers to dword?
25 true value tc-align-headers
26 true value tc-align-cfa
27 true value tc-align-pfa
34 0 value tc-align-headers-wasted
35 0 value tc-align-cfa-wasted
36 0 value tc-align-pfa-wasted
38 ;; set to `false` to create static ELF (`dlopen` will not be included)
39 true value tc-dynamic-binary
41 ;; set to `false` to omit debugger (faster, but no debugger at all)
42 true value tc-debugger-enabled
44 false value tc-verbose
47 value tc-nhash-elf ;; use elf hash
48 value tc-nhash-joaat ;; use Bob Jenkins' One
-At
-A
-Time
for hashing word names?
49 value tc
-nhash
-rot
;; use rotating hash
51 tc
-nhash
-rot value tc
-wordhash
-type
57 tc
-tls
-fs value tc
-tls
-type
59 ;; only words with headers
60 0 value tc
-created
-words
-count
62 240 value tc
-max
-word
-name
-length
64 ;; optimise forth code?
65 ;; currently does only alias optimising
66 false value tc
-opt
-forth?
68 ;; set
to `true`
to enable optimising of aliases
69 ;; please note that alias optimiser cannot optimise forward references
(yet
)
70 true value tc
-opt
-aliases?
72 ;; 4096 constant tc
-#userarea
73 1024 constant tc
-#userarea
74 0 value tc
-userarea
-used
76 ;; total image size
; as all so
-called
"modern" distros are broken
, we have
to reserve it in ELF header
77 1024 1024 * 2 * value tc
-image
-vsize
80 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
83 ;; dump Forth forward references?
84 false value tc
-dump
-forwards?
87 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
88 " meta-01-helper-low.f" tload
90 0 value prev
-include
-buf
92 : tc
-refill
( -- flag
)
93 prev
-include
-buf ifnot false exit
endif
94 prev
-include
-buf dup @
to prev
-include
-buf
95 cell
+ tibstate
-restore
97 forth
:(tib
-curr
-fname
) cell
- @
to forth
:(tib
-curr
-fname
)
99 @tc
-tload
-last
-include
-dir
-c4s cell
- @
!tc
-tload
-last
-include
-dir
-c4s
100 \
." resuming: " forth
:(tib
-curr
-fname
) count type cr
105 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
106 : tc
-token
-check
-comments
( -- againflag
)
108 tib
-peekch dup
32 <= if
109 ;; single
-char comments
111 asmx86
:lexer
:tkvalue case
122 ;; multi
-char comments
123 8 lshift asmx86
:lexer
:tkvalue or
126 skip
-comment
-multiline
-nested
130 skip
-comment
-multiline
141 : tc
-fix
-id
( addr count
-- )
142 asmx86
:lexer
:tkvalue c4s
:copy
-counted
145 : tc
-check
-special
-token
( -- )
146 \ asmx86
:tk
-id? ifnot exit
endif
147 asmx86
:lexer
:tkvalue count
150 tib
-peekch
[char
] : = not
-?abort
" `:` expected"
152 ;; the next one should be blank
153 tib
-peekch
32 <= not
-?abort
" blank char expected"
160 tib
-peekch
[char
] - = ifnot exit
endif
162 tib
-peekch upcase
-char
[char
] C
= not
-?abort
" end-code expected"
163 asmx86
:lexer
:NextToken
164 asmx86
:tk
-id? not
-?abort
" end-code expected"
165 asmx86
:lexer
:tkvalue count
" CODE" s
= not
-?abort
" end-code expected"
171 ;; this skips more comments
172 : tc
-next
-token
-noread
( -- )
175 asmx86
:lexer
:tktype ifnot
178 10 = if tib
-getch drop
endif
180 tc
-refill ifnot
break endif
182 asmx86
:lexer
:PrepareLineParser
183 asmx86
:lexer
:NextToken
186 ;; check
for multiline comments
188 tc
-token
-check
-comments
if
189 asmx86
:lexer
:PrepareLineParser
190 asmx86
:lexer
:NextToken
194 asmx86
:tk
-id?
if tc
-check
-special
-token
endif
198 \ endcr asmx86
:lexer
:(dump
-current
-token
) cr
201 : tc
-next
-token
( -- )
202 asmx86
:lexer
:NextToken
207 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
208 : (file
-error
) ( addr count msgaddr msgcount
-- )
209 endcr type space
34 emit type
34 emit space forth
:error
-line
. cr
214 ;; please
, don
't write such huge words!
215 : include-file ( addr count -- )
216 dup not-?abort" cannot include nothing"
218 #tib-save-buffer cell+ brk-alloc
219 prev-include-buf over ! to prev-include-buf
220 prev-include-buf cell+ tibstate-save
221 ;; prepend current path (remember the original address, tho)
222 2dup @tc-tload-last-include-dir-c4s count pad 1024 + c4s:copy-counted pad 1024 + c4s:cat-counted
223 pad 1024 + count os:o-rdonly 0 os:open
224 dup 0< if drop " cannot open file" (file-error) endif
226 ;; ( addr count | fd )
227 0 os:seek-end r@ os:lseek
228 ;; ( addr count size | fd )
230 drop r> os:close drop
231 " cannot get size of file" (file-error)
233 ;; seek back to file start
234 ;; ( addr count size | fd )
235 0 os:seek-set r@ os:lseek
237 drop r> os:close drop
238 " cannot rewind file" (file-error)
240 ;; allocate temp pool space
241 \ TODO: free memory somehow
242 ;; ( addr count size | fd )
244 ;; ( addr count size bufaddr | fd )
247 ;; ( addr count size bufaddr readbytes | fd )
249 ;; ( addr count bufaddr readbytes | fd )
250 drop 2drop r> os:close drop
251 " cannot get size of file" (file-error)
255 ;; ( addr count bufaddr readbytes )
258 [DEFINED] (tib-last-read-char) [IF]
259 bl (tib-last-read-char) !
261 ;; replace current file name (for error reporting)
262 dup 2 +cells brk-alloc ;; ( addr count namebuffaddr )
263 forth:(tib-curr-fname) over ! cell+
264 to forth:(tib-curr-fname)
265 2dup forth:(tib-curr-fname) c4s:copy-counted
266 ;; show message, and go with the new tib
267 tc-verbose if endcr ." processing: " type cr else 2drop endif
268 ;; replace current tload path (for relative loads)
269 pad 1024 + count dup 2 +cells brk-alloc
270 ;; ( addr count newbuf )
271 @tc-tload-last-include-dir-c4s over ! cell+
272 dup !tc-tload-last-include-dir-c4s
274 ;; remove file name from the path
275 @tc-tload-last-include-dir-c4s dup count str-extract-path nip swap !
276 ;; done with bookkeeping
280 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
281 " meta-02-mem.f" tload
282 " meta-04-str-hash.f" tload
283 " meta-10-asm-tc.f" tload
284 " meta-14-asm-defconsts.f" tload
285 " meta-20-elf.f" tload
287 " meta-40-tc-compiler-00-dbginfo.f" tload
288 " meta-40-tc-compiler-04-low.f" tload
289 " meta-40-tc-compiler-05-cfa-cvt.f" tload
290 " meta-40-tc-compiler-07-opt-basic.f" tload
291 " meta-40-tc-compiler-06-name-hash.f" tload
292 " meta-40-tc-compiler-10-word-utils.f" tload
293 " meta-40-tc-compiler-15-dbginfo.f" tload
294 " meta-40-tc-compiler-20-create.f" tload
295 " meta-40-tc-compiler-30-mid.f" tload
297 ;; later, we will create "tc-immediates" vocabulary, and populate it with words from "tc-immediates-src"
298 ;; this is to avoid prepending "tc-" to immediate words (it is faster this way)
299 nested-vocabulary tc-immediates-src
300 also tc-immediates-src definitions
302 " meta-50-tc-imm-00-if-begin-do.f" tload
303 " meta-50-tc-imm-10-colon-var.f" tload
304 " meta-50-tc-imm-20-compile-tick.f" tload
305 " meta-50-tc-imm-30-cond-comp.f" tload
306 " meta-50-tc-imm-40-asm-misc.f" tload
310 ;; this creates "tc-immediates" vocabulary, and populates it
311 " meta-50-tc-imm-99-populate.f" tload
313 \ also tc-immediates words previous
316 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
317 also asmx86 definitions
318 nested-vocabulary tc-instrs
319 also tc-instrs definitions
322 " meta-60-asm-commands.f" tload
323 " meta-60-asm-commands-macros.f" tload
325 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
326 previous previous definitions
328 ;; now put our instructions into asmx86:instructions vocabulary
329 vocid-of asmx86:tc-instrs asmx86:Register-Macros-From-VocId
332 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
333 " meta-70-tc-interp-00-internal.f" tload
334 nested-vocabulary tc-interp-words
335 also tc-interp-words definitions
336 " meta-70-tc-interp-05-vocab.f" tload
337 " meta-70-tc-interp-10-comp-flags.f" tload
338 " meta-70-tc-interp-20-mem.f" tload
339 " meta-70-tc-interp-30-math.f" tload
343 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
344 : tc-find-interp ( addr count -- addr count false // cfa true )
345 vocid: tc-interp-words voc-search
348 : tc-find-imm ( addr count -- addr count false // cfa true )
349 vocid: tc-immediates voc-search
352 : tc-is-allowed-instr ( addr count -- addr count flag )
353 over c@ [char] $ = if true exit endif
355 2dup " DB" s=ci if true exit endif
356 2dup " DW" s=ci if true exit endif
357 2dup " DD" s=ci if true exit endif
358 2dup " RB" s=ci if true exit endif
359 2dup " RW" s=ci if true exit endif
360 2dup " RD" s=ci if true exit endif
365 : tc-find-tc-instr ( addr count -- addr count false // cfa true )
366 tc-is-allowed-instr ifnot false exit endif
367 vocid: asmx86:instructions voc-search
371 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
372 : tc-(code-word) ( -- )
373 ;; we won't create debug info
for code words
(yet
)
377 asmx86
:lexer
:PrepareLineParser
381 \ lexer
:tkvalue count endcr type cr
382 asmx86
:lexer
:tkvalue count
" ENDCODE" s
= if break endif
384 asmx86
:(asm
-tib
) (sp
-check
) ifnot error
-line
. cr dbg
endif
386 asmx86
:lexer
:tktype ifnot asmx86
:ERRID_ASM_ENDCODE_EXPECTED asmx86
:not
-?asm
-error
endif
389 ;; latest disasm
-word
390 asmx86
:asm
-Check
-Undef
-Labels
394 1024 constant #asm
-line
-buf
395 #asm
-line
-buf
2+ brk
-buffer
: asm
-line
-buf
397 : tc
-collect
-asm
-line
( -- addr count
)
402 over asm
-line
-buf
+ c
!
403 1+ dup #asm
-line
-buf
>= ?abort
" asm line too long"
410 : tc
-(code
-line
) ( -- )
414 ;; we won
't create debug info for code words (yet)
416 asmx86:lexer:PrepareLineParser
421 asmx86:(asm-tib) (sp-check) ifnot error-line. cr dbg endif
424 ;; latest disasm-word
425 asmx86:asm-Check-Undef-Labels
431 : next-equ? ( -- flag )
436 parse-name 2drop true
442 : tc-(equ) ( addr count -- )
443 \ pad c4c-copy-a-c ;; save constant name
444 asmx86:lexer:PrepareLineParser
446 asmx86:Reset-Instruction
448 ;; copy name to `*OffName`, it is not used by `Imm`
449 asmx86:*OffName c1s:copy-counted
451 ;; check if it is using only defined labels
453 asmx86:*ImmForthType asmx86:ERRID_ASM_INVALID_FORWARD_REF asmx86:?asm-error
454 asmx86:*ImmName c@ asmx86:ERRID_ASM_INVALID_FORWARD_REF asmx86:not-?asm-error
455 \ *ImmName ccount asm-Label-Defined? ERRID_ASM_INVALID_FORWARD_REF not-?asm-error
456 asmx86:*ImmLabelDefined asmx86:ERRID_ASM_INVALID_FORWARD_REF asmx86:not-?asm-error
458 \ ." |" *OffName ccount type ." | " *Imm . cr
459 asmx86:*OffName ccount asmx86:*Imm asmx86:asm-Make-Constant
463 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
464 : tc-interp-find-tc-word ( addr count -- rva-cfa flags true // false )
465 x-tc-xcfind dup if over tc-cfa->nfa tc-nfa->ffa tc-ffa@ swap endif
468 : tc-interp-find-tc-word-no-imm ( addr count -- rva-cfa true // false )
469 2dup tc-interp-find-tc-word if
470 tc-(wflag-immediate) and if drop
471 endcr ." ERROR: \`" type ." \` is immediate!\n"
472 abort" no TC immediate words allowed"
473 else nrot 2drop true endif
474 else 2drop false endif
478 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
479 ;; main metacompiler loop
481 parse-name " ELF" s=ci not-?abort" not an elf?"
482 parse-name " executable" s=ci not-?abort" not an elf executable?"
483 ;; parse-name s=ci " 3" not-?abort" not an x86 abi?"
485 1 to asmx86:asm-Labman-Unresolved-As-Forwards?
487 (sp-check) ifnot error-line. cr dbg endif
488 \ tc-state @ ifnot break endif
490 parse-name-ex ;; ( addr count )
493 tc-state @ ?abort" definition not finished"
497 dup ifnot break endif
499 \ endcr ." TC: " 2dup type cr
500 ;; here we'll
do some hackery
: for compiling mode
, try
"tc-immediates" vocab first
501 tc
-find
-imm
if execute
continue endif
503 ;; compiling
, try
to find a tc word
504 2dup tc
-interp
-find
-tc
-word
-no
-imm
if ;; ( addr count rva
-cfa
)
506 nrot
2drop tc
-compile
, ;; compile it
to the target area
508 ;; unknown word
, try
to parse it as a number
513 ;; this should be a forward reference
515 ;; this seems
to be a forward reference
516 endcr
." forwardref to \`" 2dup type
." \`"
517 [DEFINED
] forth
:(tib
-fname
>error
-fname
) [IF] forth
:(tib
-fname
>error
-fname
) [ENDIF]
520 tc
-compile
,-(str
)-nochecks
525 \ endcr
." |" 2dup type
." | " tib
-line# @
. cr
526 tc
-find
-interp
if execute
continue endif
528 \ dup cfa
->nfa id
. cr
529 \ tibstate
>r parse
-name r
>tibstate endcr
." 000:<" type
." >\n"
530 asmx86
:lexer
:PrepareLineParser
533 \ tibstate
>r parse
-name r
>tibstate endcr
." 001:<" type
." >\n"
536 2dup
" code:" s
=ci
if 2drop tc
-(code
-word
) continue endif
537 2dup
" $asm" s
=ci
if 2drop tc
-(code
-line
) continue endif
538 ;; HACK
! check
if the next word is equ
539 next
-equ?
if tc
-(equ
) continue endif
540 ;; try
to find a tc word
-- this can be a constant
, for example
541 2dup tc
-interp
-find
-tc
-word
-no
-imm
if
542 dup tc
-is
-constant?
if nrot
2drop tc
-cfa
->pfa tc
-@
543 else dup tc
-is
-value?
if nrot
2drop tc
-cfa
->pfa tc
-@
544 else dup tc
-is
-variable?
if nrot
2drop tc
-cfa
->pfa
545 else drop endcr
." ERROR: uninterpretable tc word \`" type
." \`" abort
" wut?!"
548 ;; try
to parse it as a number
549 2dup number ifnot endcr
." ERROR: unknown tc word \`" type
." \`" abort
" wut?!" endif
555 asmx86
:asm
-Check
-Undef
-Labels
561 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
562 : brk
-alloc
-c4str
( addr count
-- newaddr
)
563 dup
0< ERR
-OUT
-OF
-MEMORY ?error
564 dup cell
+ 1+ brk
-alloc
;; ( addr count newaddr
)
566 2dup
! cell
+ ;; ( addr count newaddr
+4 | newaddr
)
573 0 value input
-file
-name
574 0 value output
-file
-name
577 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
579 also cliargs definitions
581 : (str
-arg
) ( -- addr count true
// false
)
582 cli
-arg
-next argc
< ifnot false exit
endif
583 cli
-arg
-next argv
-str cli
-arg
-skip true
587 ." known metacompiler cli args:\n"
588 vocid
: cliargs
[: ( nfa
-- stopflag
)
589 dup nfa
->cfa cfa
-hidden? ifnot
590 id
-count pad c4s
:copy
-counted
592 2 spaces pad count type cr
599 : --dump
-forwards
( -- ) true
to tc
-dump
-forwards?
;
601 : --verbose
( -- ) true
to tc
-verbose
;
602 : --no
-verbose
( -- ) false
to tc
-verbose
;
603 : --quiet
( -- ) false
to tc
-verbose
;
605 : --tls
-none
( -- ) tc
-tls
-none
to tc
-tls
-type
;
606 : --tls
-fs
( -- ) tc
-tls
-fs
to tc
-tls
-type
;
608 : --static
( -- ) false
to tc
-dynamic
-binary
;
609 : --dynamic
( -- ) true
to tc
-dynamic
-binary
;
611 : --align
( -- ) true
to tc
-align
-headers true
to tc
-align
-cfa true
to tc
-align
-pfa
;
612 : --no
-align
( -- ) false
to tc
-align
-headers false
to tc
-align
-cfa false
to tc
-align
-pfa
;
614 : --align
-headers
( -- ) true
to tc
-align
-headers
;
615 : --no
-align
-headers
( -- ) false
to tc
-align
-headers
;
617 : --align
-cfa
( -- ) true
to tc
-align
-cfa
;
618 : --no
-align
-cfa
( -- ) false
to tc
-align
-cfa
;
620 : --align
-pfa
( -- ) true
to tc
-align
-pfa
;
621 : --no
-align
-pfa
( -- ) false
to tc
-align
-pfa
;
623 : --debug
( -- ) true
to tc
-debugger
-enabled
;
624 : --no
-debug
( -- ) false
to tc
-debugger
-enabled
;
627 (str
-arg
) not
-?abort
" '--whash' requires hash name"
628 2dup
" elf" s
=ci
if 2drop tc
-nhash
-elf
to tc
-wordhash
-type exit
endif
629 2dup
" joaat" s
=ci
if 2drop tc
-nhash
-joaat
to tc
-wordhash
-type exit
endif
630 2dup
" rot" s
=ci
if 2drop tc
-nhash
-rot
to tc
-wordhash
-type exit
endif
631 endcr
." \`" type
." \` doesn't look like a known hash name!\n"
636 (str
-arg
) not
-?abort
" '-i' requires input file name"
637 brk
-alloc
-c4str
to input
-file
-name
641 (str
-arg
) not
-?abort
" '-o' requires input file name"
642 brk
-alloc
-c4str
to output
-file
-name
648 : parse
-cli
-args
( -- )
649 begin cli
-arg
-next argc
< while
650 cli
-arg
-next argv
-str
651 vocid
: cliargs voc
-search
if cli
-arg
-skip execute
652 else endcr
." ERROR: invalid command line argument: \`" cli
-arg
-next argv
-str type
." \`!\n" 1 n
-bye
656 input
-file
-name ifnot
" ../level1/urforth.f" brk
-alloc
-c4str
to input
-file
-name
endif
657 output
-file
-name ifnot
" urforth" brk
-alloc
-c4str
to output
-file
-name
endif
658 ;; aligned PFA must be used with aligned CFA
659 tc
-align
-pfa
if true
to tc
-align
-cfa
endif
663 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
666 endcr
." compiling to \`" output
-file
-name count type
." \`...\n"
669 elf
-target
-memory build
-elf
-header elf
-target
-memory
- elf
-base
-rva
+ to elf
-current
-pc
672 alias ur
-meta
:format format
674 ur
-meta
:tc
-tls
-type ur
-meta
:tc
-tls
-fs
<> to asmx86
:asm
-ignore
-ts
676 ur
-meta
:create
-elf
-tc
-constants
677 ur
-meta
:tc
-define
-config
-constants
680 ur
-meta
:input
-file
-name count tload
682 ;; set user area size label
683 " ur_userarea_default_size" ur
-meta
:tc
-userarea
-used asmx86
:asm
-Make
-Label
684 ;; fix dictionary
end address
685 ur
-meta
:tc
-image
-vsize ur
-meta
:elf
-reserve
-bss
688 \ asmx86
:asm
-Dump
-Labels
689 asmx86
:asm
-Check
-Undef
-Labels
-Final
691 os
:gettickcount swap
- endcr
." build time: " . ." msecs, "
692 ur
-meta
:tc
-created
-words
-count
. ." words defined, "
693 ur
-meta
:tc
-userarea
-used
. ." bytes of user area allocated.\n"
694 [: ur
-meta
:tc
-align
-headers
-wasted ?dup
if . ." bytes wasted on aligned headers.\n" endif ;] execute
695 [: ur
-meta
:tc
-align
-cfa
-wasted ?dup
if . ." bytes wasted on aligned CFA.\n" endif ;] execute
696 [: ur
-meta
:tc
-align
-pfa
-wasted ?dup
if . ." bytes wasted on aligned PFA.\n" endif ;] execute
698 ur
-meta
:output
-file
-name count ur
-meta
:save
-elf
-binary
700 endcr
." new " ur
-meta
:tc
-dynamic
-binary
if ." dynamic" else ." static" endif
702 ur
-meta
:tc
-wordhash
-type case
703 ur
-meta
:tc
-nhash
-elf of
." ELF" endof
704 ur
-meta
:tc
-nhash
-joaat of
." JOAAT" endof
705 ur
-meta
:tc
-nhash
-rot of
." ROT" endof
708 ." vochash) created: " ur
-meta
:output
-file
-name count type
712 [DEFINED
] asm
-labman
:(mem
-allocated
) [IF]
713 asm
-labman
:(mem
-allocated
) @
. ." bytes used by assembler\n"