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
26 tc
-LINUX
/X86 value tc
-os
28 ;; 0: don
't change case; 1: upcase; -1: locase
29 0 value tc-create-case?
31 ;; align headers to dword?
32 true value tc-align-headers
33 true value tc-align-cfa
34 true value tc-align-pfa
41 0 value tc-align-headers-wasted
42 0 value tc-align-cfa-wasted
43 0 value tc-align-pfa-wasted
45 ;; set to `false` to create static ELF (`dlopen` will not be included)
46 true value tc-dynamic-binary
48 ;; set to `false` to omit debugger (faster, but no debugger at all)
49 ;; disable interactive debugger, i don't need it
. the system is faster this way
.
50 false value tc
-debugger
-enabled
51 ;; but enable debug info
for backtraces
52 true value tc
-debug
-info
-enabled
54 false value tc
-verbose
57 value tc
-nhash
-elf
;; use elf hash
58 value tc
-nhash
-joaat
;; use Bob Jenkins
' One-At-A-Time for hashing word names?
59 value tc-nhash-rot ;; use rotating hash
61 \ tc-nhash-rot value tc-wordhash-type
62 tc-nhash-joaat value tc-wordhash-type
68 tc-tls-fs value tc-tls-type
70 ;; only words with headers
71 0 value tc-created-words-count
73 240 value tc-max-word-name-length
75 ;; optimise chain of branches?
76 ;; i.e. branch to branch to branch
77 true value tc-opt-branches?
79 ;; set to `true` to enable optimising of aliases
80 ;; please note that alias optimiser cannot optimise forward references (yet)
81 false value tc-opt-aliases?
83 ;; 4096 constant tc-#userarea
84 1024 constant tc-#userarea
85 0 value tc-userarea-used
87 ;; total image size; as all so-called "modern" distros are broken, we have to reserve it in ELF header
88 1024 1024 * 2 * value tc-image-vsize
91 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
94 ;; dump Forth forward references?
95 false value tc-dump-forwards?
98 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
99 " meta-01-helper-low.f" tload
101 0 value prev-include-buf
103 : tc-refill ( -- flag )
104 prev-include-buf ifnot false exit endif
105 prev-include-buf dup @ to prev-include-buf
106 cell+ tibstate-restore
108 forth:(tib-curr-fname) cell- @ to forth:(tib-curr-fname)
109 ;; restore tload path
110 @tc-tload-last-include-dir-c4s cell- @ !tc-tload-last-include-dir-c4s
111 \ ." resuming: " forth:(tib-curr-fname) count type cr
116 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
117 : tc-token-check-comments ( -- againflag )
119 tib-peekch dup 32 <= if
120 ;; single-char comments
122 asmx86:lexer:tkvalue case
133 ;; multi-char comments
134 8 lshift asmx86:lexer:tkvalue or
137 skip-comment-multiline-nested
141 skip-comment-multiline
152 : tc-fix-id ( addr count -- )
153 asmx86:lexer:tkvalue c4s:copy-counted
156 : tc-check-special-token ( -- )
157 \ asmx86:tk-id? ifnot exit endif
158 asmx86:lexer:tkvalue count
161 tib-peekch [char] : = not-?abort" `:` expected"
163 ;; the next one should be blank
164 tib-peekch 32 <= not-?abort" blank char expected"
171 tib-peekch [char] - = ifnot exit endif
173 tib-peekch upcase-char [char] C = not-?abort" end-code expected"
174 asmx86:lexer:NextToken
175 asmx86:tk-id? not-?abort" end-code expected"
176 asmx86:lexer:tkvalue count " CODE" s= not-?abort" end-code expected"
182 ;; this skips more comments
183 : tc-next-token-noread ( -- )
186 asmx86:lexer:tktype ifnot
189 10 = if tib-getch drop endif
191 tc-refill ifnot break endif
193 asmx86:lexer:PrepareLineParser
194 asmx86:lexer:NextToken
197 ;; check for multiline comments
199 tc-token-check-comments if
200 asmx86:lexer:PrepareLineParser
201 asmx86:lexer:NextToken
205 asmx86:tk-id? if tc-check-special-token endif
209 \ endcr asmx86:lexer:(dump-current-token) cr
212 : tc-next-token ( -- )
213 asmx86:lexer:NextToken
218 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
219 : (file-error) ( addr count msgaddr msgcount -- )
220 endcr type space 34 emit type 34 emit space forth:error-line. cr
225 ;; please, don't
write such huge words
!
226 : include
-file
( addr count
-- )
227 dup not
-?abort
" cannot include nothing"
229 #tib
-save
-buffer cell
+ brk
-alloc
230 prev
-include
-buf over
! to prev
-include
-buf
231 prev
-include
-buf cell
+ tibstate
-save
232 ;; prepend current path
(remember the original address
, tho
)
233 2dup @tc
-tload
-last
-include
-dir
-c4s count pad
1024 + c4s
:copy
-counted pad
1024 + c4s
:cat
-counted
234 pad
1024 + count os
:o
-rdonly
0 os
:open
235 dup
0< if drop
" cannot open file" (file
-error
) endif
237 ;; ( addr count | fd
)
238 0 os
:seek
-end r@ os
:lseek
239 ;; ( addr count size | fd
)
241 drop r
> os
:close drop
242 " cannot get size of file" (file
-error
)
244 ;; seek back
to file start
245 ;; ( addr count size | fd
)
246 0 os
:seek
-set r@ os
:lseek
248 drop r
> os
:close drop
249 " cannot rewind file" (file
-error
)
251 ;; allocate temp pool space
252 \ TODO
: free memory somehow
253 ;; ( addr count size | fd
)
255 ;; ( addr count size bufaddr | fd
)
258 ;; ( addr count size bufaddr readbytes | fd
)
260 ;; ( addr count bufaddr readbytes | fd
)
261 drop
2drop r
> os
:close drop
262 " cannot get size of file" (file
-error
)
266 ;; ( addr count bufaddr readbytes
)
269 [DEFINED
] (tib
-last
-read-char
) [IF]
270 bl
(tib
-last
-read-char
) !
272 ;; replace current file name
(for error reporting
)
273 dup
2 +cells brk
-alloc
;; ( addr count namebuffaddr
)
274 forth
:(tib
-curr
-fname
) over
! cell
+
275 to forth
:(tib
-curr
-fname
)
276 2dup forth
:(tib
-curr
-fname
) c4s
:copy
-counted
277 ;; show message
, and
go with the new tib
278 tc
-verbose
if endcr
." processing: " type cr
else 2drop
endif
279 ;; replace current tload path
(for relative loads
)
280 pad
1024 + count dup
2 +cells brk
-alloc
281 ;; ( addr count newbuf
)
282 @tc
-tload
-last
-include
-dir
-c4s over
! cell
+
283 dup
!tc
-tload
-last
-include
-dir
-c4s
285 ;; remove file name from the path
286 @tc
-tload
-last
-include
-dir
-c4s dup count str
-extract
-path nip swap
!
287 ;; done with bookkeeping
291 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
292 " meta-02-mem.f" tload
293 " meta-04-str-hash.f" tload
294 " meta-10-asm-tc.f" tload
295 " meta-14-asm-defconsts.f" tload
296 " meta-20-elf.f" tload
298 ;; for "immediate (noop)" words
; just a list
299 vocabulary tc
-imm
-noops
301 " meta-40-tc-compiler-00-dbginfo.f" tload
302 " meta-40-tc-compiler-04-low.f" tload
303 " meta-40-tc-compiler-05-cfa-cvt.f" tload
304 " meta-40-tc-compiler-07-opt-basic.f" tload
305 " meta-40-tc-compiler-06-name-hash.f" tload
306 " meta-40-tc-compiler-10-word-utils.f" tload
307 " meta-40-tc-compiler-15-dbginfo.f" tload
308 " meta-40-tc-compiler-20-create.f" tload
309 " meta-40-tc-compiler-30-mid.f" tload
311 ;; later
, we will create
"tc-immediates" vocabulary
, and populate it with words from
"tc-immediates-src"
312 ;; this is
to avoid prepending
"tc-" to immediate words
(it is faster this way
)
313 nested
-vocabulary tc
-immediates
-src
314 also tc
-immediates
-src definitions
316 " meta-50-tc-imm-00-if-begin-do.f" tload
317 " meta-50-tc-imm-10-colon-var.f" tload
318 " meta-50-tc-imm-20-compile-tick.f" tload
319 " meta-50-tc-imm-30-cond-comp.f" tload
320 " meta-50-tc-imm-40-asm-misc.f" tload
324 ;; this creates
"tc-immediates" vocabulary
, and populates it
325 " meta-50-tc-imm-99-populate.f" tload
327 \ also tc
-immediates words previous
330 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
331 also asmx86 definitions
332 nested
-vocabulary tc
-instrs
333 also tc
-instrs definitions
336 " meta-60-asm-commands.f" tload
337 " meta-60-asm-commands-macros.f" tload
339 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
340 previous previous definitions
342 ;; now put our instructions into asmx86
:instructions vocabulary
343 vocid
-of asmx86
:tc
-instrs asmx86
:Register
-Macros
-From
-VocId
346 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
347 " meta-70-tc-interp-00-internal.f" tload
348 nested
-vocabulary tc
-interp
-words
349 also tc
-interp
-words definitions
350 " meta-70-tc-interp-05-vocab.f" tload
351 " meta-70-tc-interp-10-comp-flags.f" tload
352 " meta-70-tc-interp-20-mem.f" tload
353 " meta-70-tc-interp-30-math.f" tload
357 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
358 : tc
-find
-interp
( addr count
-- addr count false
// cfa true
)
359 vocid
: tc
-interp
-words voc
-search
362 : tc
-find
-imm
( addr count
-- addr count false
// cfa true
)
363 vocid
: tc
-immediates voc
-search
366 : tc
-is
-allowed
-instr
( addr count
-- addr count flag
)
367 over c@
[char
] $
= if true exit
endif
369 2dup
" DB" s
=ci
if true exit
endif
370 2dup
" DW" s
=ci
if true exit
endif
371 2dup
" DD" s
=ci
if true exit
endif
372 2dup
" RB" s
=ci
if true exit
endif
373 2dup
" RW" s
=ci
if true exit
endif
374 2dup
" RD" s
=ci
if true exit
endif
379 : tc
-find
-tc
-instr
( addr count
-- addr count false
// cfa true
)
380 tc
-is
-allowed
-instr ifnot false exit
endif
381 vocid
: asmx86
:instructions voc
-search
385 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
386 : tc
-(code
-word
) ( -- )
387 ;; we won
't create debug info for code words (yet)
391 asmx86:lexer:PrepareLineParser
395 \ lexer:tkvalue count endcr type cr
396 asmx86:lexer:tkvalue count " ENDCODE" s= if break endif
398 asmx86:(asm-tib) (sp-check) ifnot error-line. cr dbg endif
400 asmx86:lexer:tktype ifnot asmx86:ERRID_ASM_ENDCODE_EXPECTED asmx86:not-?asm-error endif
403 ;; latest disasm-word
404 asmx86:asm-Check-Undef-Labels
408 1024 constant #asm-line-buf
409 #asm-line-buf 2+ brk-buffer: asm-line-buf
411 : tc-collect-asm-line ( -- addr count )
416 over asm-line-buf + c!
417 1+ dup #asm-line-buf >= ?abort" asm line too long"
424 : tc-(code-line) ( -- )
428 ;; we won't create debug info
for code words
(yet
)
430 asmx86
:lexer
:PrepareLineParser
435 asmx86
:(asm
-tib
) (sp
-check
) ifnot error
-line
. cr dbg
endif
438 ;; latest disasm
-word
439 asmx86
:asm
-Check
-Undef
-Labels
445 : next
-equ?
( -- flag
)
450 parse
-name
2drop true
456 : tc
-(equ
) ( addr count
-- )
457 \ pad c4c
-copy
-a
-c
;; save constant name
458 asmx86
:lexer
:PrepareLineParser
460 asmx86
:Reset
-Instruction
462 ;; copy name
to `
*OffName`
, it is not used by `Imm`
463 asmx86
:*OffName c1s
:copy
-counted
465 ;; check
if it is using only defined labels
467 asmx86
:*ImmForthType asmx86
:ERRID_ASM_INVALID_FORWARD_REF asmx86
:?asm
-error
468 asmx86
:*ImmName c@ asmx86
:ERRID_ASM_INVALID_FORWARD_REF asmx86
:not
-?asm
-error
469 \
*ImmName bcount asm
-Label
-Defined? ERRID_ASM_INVALID_FORWARD_REF not
-?asm
-error
470 asmx86
:*ImmLabelDefined asmx86
:ERRID_ASM_INVALID_FORWARD_REF asmx86
:not
-?asm
-error
472 \
." |" *OffName bcount type
." | " *Imm
. cr
473 asmx86
:*OffName bcount asmx86
:*Imm asmx86
:asm
-Make
-Constant
477 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
478 : tc
-interp
-find
-tc
-word
( addr count
-- rva
-cfa flags true
// false
)
479 x
-tc
-xcfind dup
if over tc
-cfa
->nfa tc
-nfa
->ffa tc
-ffa@ swap
endif
482 : tc
-interp
-find
-tc
-word
-no
-imm
( addr count
-- rva
-cfa true
// false
)
483 2dup tc
-interp
-find
-tc
-word
if
484 tc
-(wflag
-immediate
) and
if drop
485 ;; ignore
(noop
) words
486 vocid
: tc
-imm
-noops voc
-search ifnot
487 endcr
." ERROR: \`" type
." \` is immediate!\n"
488 abort
" no TC immediate words allowed"
489 else drop
0 true
endif ;; 0 cfa won
't be compiled
490 else nrot 2drop true endif
491 else 2drop false endif
495 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
496 ;; main metacompiler loop
498 parse-name " ELF" s=ci not-?abort" not an elf?"
499 parse-name " executable" s=ci not-?abort" not an elf executable?"
500 ;; parse-name s=ci " 3" not-?abort" not an x86 abi?"
502 1 to asmx86:asm-Labman-Unresolved-As-Forwards?
504 (sp-check) ifnot error-line. cr dbg endif
505 \ tc-state @ ifnot break endif
507 parse-name-ex ;; ( addr count )
510 tc-state @ ?abort" definition not finished"
514 dup ifnot break endif
516 \ endcr ." TC: " 2dup type cr
517 ;; here we'll
do some hackery
: for compiling mode
, try
"tc-immediates" vocab first
518 tc
-find
-imm
if execute
continue endif
520 ;; compiling
, try
to find a tc word
521 2dup tc
-interp
-find
-tc
-word
-no
-imm
if ;; ( addr count rva
-cfa
)
523 nrot
2drop ?dup
if tc
-compile
, endif ;; compile it
to the target area
525 ;; unknown word
, try
to parse it as a number
530 ;; this should be a forward reference
532 ;; this seems
to be a forward reference
533 endcr
." forwardref to \`" 2dup type
." \`"
534 [DEFINED
] forth
:(tib
-fname
>error
-fname
) [IF] forth
:(tib
-fname
>error
-fname
) [ENDIF]
537 tc
-compile
,-(str
)-nochecks
542 \ endcr
." |" 2dup type
." | " tib
-line# @
. cr
543 tc
-find
-interp
if execute
continue endif
545 \ dup cfa
->nfa id
. cr
546 \ tibstate
>r parse
-name r
>tibstate endcr
." 000:<" type
." >\n"
547 asmx86
:lexer
:PrepareLineParser
550 \ tibstate
>r parse
-name r
>tibstate endcr
." 001:<" type
." >\n"
553 2dup
" code:" s
=ci
if 2drop tc
-(code
-word
) continue endif
554 2dup
" $asm" s
=ci
if 2drop tc
-(code
-line
) continue endif
555 ;; HACK
! check
if the next word is equ
556 next
-equ?
if tc
-(equ
) continue endif
557 ;; try
to find a tc word
-- this can be a constant
, for example
558 2dup tc
-interp
-find
-tc
-word
-no
-imm
if
559 dup tc
-is
-constant?
if nrot
2drop tc
-cfa
->pfa tc
-@
560 else dup tc
-is
-value?
if nrot
2drop tc
-cfa
->pfa tc
-@
561 else dup tc
-is
-variable?
if nrot
2drop tc
-cfa
->pfa
562 else drop endcr
." ERROR: uninterpretable tc word \`" type
." \`" abort
" wut?!"
565 ;; try
to parse it as a number
566 2dup number ifnot endcr
." ERROR: unknown tc word \`" type
." \`" abort
" wut?!" endif
572 asmx86
:asm
-Check
-Undef
-Labels
578 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
579 : brk
-alloc
-c4str
( addr count
-- newaddr
)
580 dup
0< ERR
-OUT
-OF
-MEMORY ?error
581 dup cell
+ 1+ brk
-alloc
;; ( addr count newaddr
)
583 2dup
! cell
+ ;; ( addr count newaddr
+4 | newaddr
)
590 0 value input
-file
-name
591 0 value output
-file
-name
594 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
596 also cliargs definitions
598 : (str
-arg
) ( -- addr count true
// false
)
599 cli
-arg
-next argc
< ifnot false exit
endif
600 cli
-arg
-next argv
-str cli
-arg
-skip true
604 ." known metacompiler cli args:\n"
605 vocid
: cliargs
[: ( nfa
-- stopflag
)
606 dup nfa
->cfa cfa
-hidden? ifnot
607 id
-count pad c4s
:copy
-counted
609 2 spaces pad count type cr
616 : --dump
-forwards
( -- ) true
to tc
-dump
-forwards?
;
618 : --verbose
( -- ) true
to tc
-verbose
;
619 : --no
-verbose
( -- ) false
to tc
-verbose
;
620 : --quiet
( -- ) false
to tc
-verbose
;
622 : --tls
-none
( -- ) tc
-tls
-none
to tc
-tls
-type
;
623 : --tls
-fs
( -- ) tc
-tls
-fs
to tc
-tls
-type
;
625 : --static
( -- ) false
to tc
-dynamic
-binary
;
626 : --dynamic
( -- ) true
to tc
-dynamic
-binary
;
628 : --align
( -- ) true
to tc
-align
-headers true
to tc
-align
-cfa true
to tc
-align
-pfa
;
629 : --no
-align
( -- ) false
to tc
-align
-headers false
to tc
-align
-cfa false
to tc
-align
-pfa
;
631 : --align
-headers
( -- ) true
to tc
-align
-headers
;
632 : --no
-align
-headers
( -- ) false
to tc
-align
-headers
;
634 : --align
-cfa
( -- ) true
to tc
-align
-cfa
;
635 : --no
-align
-cfa
( -- ) false
to tc
-align
-cfa
;
637 : --align
-pfa
( -- ) true
to tc
-align
-pfa
;
638 : --no
-align
-pfa
( -- ) false
to tc
-align
-pfa
;
640 : --debug
( -- ) true
to tc
-debugger
-enabled
;
641 : --no
-debug
( -- ) false
to tc
-debugger
-enabled
;
643 : --debug
-info
( -- ) true
to tc
-debug
-info
-enabled
;
644 : --no
-debug
-info
( -- ) false
to tc
-debug
-info
-enabled
;
646 : --opt
-alias
( -- ) true
to tc
-opt
-aliases?
;
647 : --no
-opt
-alias
( -- ) false
to tc
-opt
-aliases?
;
649 : --opt
-branch
( -- ) true
to tc
-opt
-branches?
;
650 : --no
-opt
-branch
( -- ) false
to tc
-opt
-branches?
;
653 (str
-arg
) not
-?abort
" '--whash' requires hash name"
654 2dup
" elf" s
=ci
if 2drop tc
-nhash
-elf
to tc
-wordhash
-type exit
endif
655 2dup
" joaat" s
=ci
if 2drop tc
-nhash
-joaat
to tc
-wordhash
-type exit
endif
656 2dup
" rot" s
=ci
if 2drop tc
-nhash
-rot
to tc
-wordhash
-type exit
endif
657 endcr
." \`" type
." \` doesn't look like a known hash name!\n"
662 (str
-arg
) not
-?abort
" '-i' requires input file name"
663 brk
-alloc
-c4str
to input
-file
-name
667 (str
-arg
) not
-?abort
" '-o' requires input file name"
668 brk
-alloc
-c4str
to output
-file
-name
674 : parse
-cli
-args
( -- )
675 begin cli
-arg
-next argc
< while
676 cli
-arg
-next argv
-str
677 vocid
: cliargs voc
-search
if cli
-arg
-skip execute
678 else endcr
." ERROR: invalid command line argument: \`" cli
-arg
-next argv
-str type
." \`!\n" 1 n
-bye
682 input
-file
-name ifnot
" ../level1/urforth.f" brk
-alloc
-c4str
to input
-file
-name
endif
683 output
-file
-name ifnot
" urforth" brk
-alloc
-c4str
to output
-file
-name
endif
684 ;; aligned PFA must be used with aligned CFA
685 tc
-align
-pfa
if true
to tc
-align
-cfa
endif
689 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
692 endcr
." compiling to \`" output
-file
-name count type
." \`...\n"
695 elf
-target
-memory build
-elf
-header elf
-target
-memory
- elf
-base
-rva
+ to elf
-current
-pc
698 alias ur
-meta
:format format
700 ur
-meta
:tc
-tls
-type ur
-meta
:tc
-tls
-fs
<> to asmx86
:asm
-ignore
-ts
702 ur
-meta
:create
-elf
-tc
-constants
703 ur
-meta
:tc
-define
-config
-constants
706 ur
-meta
:input
-file
-name count tload
708 ;; set user area size label
709 " ur_userarea_default_size" ur
-meta
:tc
-userarea
-used asmx86
:asm
-Make
-Label
710 ;; fix dictionary
end address
711 ur
-meta
:tc
-image
-vsize ur
-meta
:elf
-reserve
-bss
714 \ asmx86
:asm
-Dump
-Labels
715 asmx86
:asm
-Check
-Undef
-Labels
-Final
717 os
:gettickcount swap
- endcr
." build time: " . ." msecs, "
718 ur
-meta
:tc
-created
-words
-count
. ." words defined, "
719 ur
-meta
:tc
-userarea
-used
. ." bytes of user area allocated.\n"
720 [: ur
-meta
:tc
-align
-headers
-wasted ?dup
if . ." bytes wasted on aligned headers.\n" endif ;] execute
721 [: ur
-meta
:tc
-align
-cfa
-wasted ?dup
if . ." bytes wasted on aligned CFA.\n" endif ;] execute
722 [: ur
-meta
:tc
-align
-pfa
-wasted ?dup
if . ." bytes wasted on aligned PFA.\n" endif ;] execute
724 ur
-meta
:output
-file
-name count ur
-meta
:save
-elf
-binary
726 endcr
." new " ur
-meta
:tc
-dynamic
-binary
if ." dynamic" else ." static" endif
728 ur
-meta
:tc
-wordhash
-type case
729 ur
-meta
:tc
-nhash
-elf of
." ELF" endof
730 ur
-meta
:tc
-nhash
-joaat of
." JOAAT" endof
731 ur
-meta
:tc
-nhash
-rot of
." ROT" endof
734 ." vochash) created: " ur
-meta
:output
-file
-name count type
738 [DEFINED
] asm
-labman
:(mem
-allocated
) [IF]
739 asm
-labman
:(mem
-allocated
) @
. ." bytes used by assembler\n"