mirror of
https://github.com/nineties/planckforth
synced 2024-12-25 21:58:22 +01:00
Use 'implementation' instead of command line arguments
This commit is contained in:
parent
5942192ada
commit
56cf2ede18
1 changed files with 2 additions and 27 deletions
29
bootstrap.fs
29
bootstrap.fs
|
@ -2068,27 +2068,7 @@ v argc ! argv !
|
|||
|
||||
( === Environment-Dependent Code === )
|
||||
|
||||
\ Parse codegeneration option.
|
||||
\ $ ./planck < bootstrap --i386-linux ...
|
||||
|
||||
variable codegen-target
|
||||
|
||||
\ Parse command-line arguments.
|
||||
:noname ( -- )
|
||||
s" no-codegen" codegen-target !
|
||||
begin argc @ 1 > while
|
||||
1 arg dup c@ '-' <> if drop exit then
|
||||
dup s" --i386-linux" streq if
|
||||
2 + codegen-target !
|
||||
shift-args
|
||||
else
|
||||
." Unknown option: " type cr
|
||||
abort
|
||||
then
|
||||
repeat
|
||||
; execute
|
||||
|
||||
codegen-target @ s" i386-linux" streq [if]
|
||||
implementation s" hand-written i386-linux" streq [if]
|
||||
|
||||
%000 constant eax immediate
|
||||
%001 constant ecx immediate
|
||||
|
@ -2302,12 +2282,7 @@ BLOCK-SIZE remaining-size !
|
|||
SYS-WRITE syscall3 \ ( u1 u2 )
|
||||
;
|
||||
|
||||
[else] \ i386-linux
|
||||
|
||||
codegen-target @ s" no-codegen" streq not [if]
|
||||
." Unknown codegen target: " codegen-target @ type cr
|
||||
abort
|
||||
[then] [then] \ End of environment dependent code
|
||||
[then] \ End of environment dependent code
|
||||
|
||||
: defined? ( "name" -- f )
|
||||
word throw find <> 0
|
||||
|
|
Loading…
Reference in a new issue