-
Notifications
You must be signed in to change notification settings - Fork 7
/
boot.lab
4880 lines (3511 loc) · 305 KB
/
boot.lab
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
COPYRIGHT (c) 2000-2016 Albert van der Horst, THE NETHERLANDS
LICENSE
This program is free software; you can redistribute it and/or
modify it under the terms of version 2 of the GNU General
Public License as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111, USA.
( -a :_Make_want_available_silently ) \ AvdH B0nov25
( WANT WANTED CF: ) \ AvdH A7feb24
CREATE _pad 80 ALLOT \ Word surrounded by spaces
: FILL-pad ( sc --) " " _pad $! _pad $+! " " _pad $+! ;
\ For LINE : return the POSITION of the word at ``_pad''.
: POSITION _pad @ - 0 MAX OVER + SWAP
DO I _pad $@ CORA 0= IF I UNLOOP EXIT THEN LOOP 0 ;
\ Find WORD in blocks N and up. Leave the BLOCK or throw.
: #LOCATED >R FILL-pad R> BEGIN 0 OVER (LINE) -TRAILING
DUP 0= 24 AND THROW POSITION 0= WHILE 1+ REPEAT ;
: (WANTED) ( sc -- sc ) ERRSCR @ 4 + >R BEGIN 2DUP PRESENT
0= WHILE 2DUP R> #LOCATED DUP 1+ >R LOAD REPEAT RDROP ;
: WANTED ( Make WORD available. ) '(WANTED) CATCH DUP 24 = IF
>R ETYPE R> MESSAGE ELSE THROW 2DROP THEN ;
: WANT ^J PARSE SAVE SET-SRC BEGIN NAME DUP WHILE WANTED
REPEAT 2DROP RESTORE ; : CF: "CONFIG" WANTED ;
( -b :_This_option_is_available )
\
( -c PROGRAM :_compile_PROGRAM_to_binary ) \ AvdH B7mar28
1 LOAD WANT OLD: TURNKEY SWAP-DP
WANT ARG[] INCLUDE SRC>EXEC
: MY-ERROR DUP EXIT-CODE ! OLD: ERROR BYE ;
'MY-ERROR DUP 'ERROR 3 CELLS MOVE HIDDEN
\ Don't include source in executable.
: INCD' SWAP-DP GET-FILE SWAP-DP EVALUATE ;
'INCD' DUP 'INCLUDED 3 CELLS MOVE HIDDEN
'TASK 'OPTIONS 3 CELLS MOVE \ No options.
'TASK '.SIGNON 3 CELLS MOVE \ No sign on.
: REGRESS POSTPONE \ ; IMMEDIATE \ Turn off regression test
ARGC 3 < 13 ?ERROR
2 ARG[] INCLUDED 4096 ALLOT
LATEST 2 ARG[] SRC>EXEC TURNKEY
( -d :_This_option_is_available )
\
( -e :_Load_system_electives ) \ AvdH A3sep01
.SIGNON CR 0 MESSAGE CR 0 BLOCK B/BUF TYPE
1 LOAD
\ "-legacy-" WANTED \ If you want this, it must be up front
WANT CONFIG HELP ORDER
WANT L-S DO-DEBUG H. DUMP
WANT $.
WANT INCLUDE SEE LOCATE
"CASE-INSENSITIVE" WANTED CASE-INSENSITIVE
\ WANT EDITOR \ WANT OOPS \ WANT FARDUMP
\ "ASSEMBLERi86" WANTED \ "DEADBEEF" WANTED
\ Select os-interface DOS/Unix
"OS-IMPORT" WANTED ( "DIR" WANTED ) "ls" WANTED
"-scripting-" WANTED
"AUTOLOAD" WANTED
: TASK ; OK
( -f :_Forth_words_to_be_executed_80_chars) \ AvdH A1oct05
1 LOAD
"ARG[]" WANTED "Z$@" WANTED
CREATE COMMAND-BUFFER 0 , 1000 ALLOT
: DOIT
BEGIN SHIFT-ARGS ARGC 1 > WHILE
1 ARG[] COMMAND-BUFFER $+! BL COMMAND-BUFFER $C+
REPEAT ;
DOIT COMMAND-BUFFER $@
\ 'DOIT HIDDEN COMMAND-BUFFER HIDDEN
2DUP TYPE EVALUATE
\
( -g GROW :_grow_by_megabytes ) \ AvdH B4may28
'FORTH >WID >LFA @ HERE CONSTANT HERE-NOW
1 LOAD "ARG[]" WANTED CF: ?LI
ARGC 4 <> 13 ?ERROR "SAVE-SYSTEM" WANTED
SM HERE-NOW OVER - $, CONSTANT thisforth$
2 ARG[] EVALUATE 20 LSHIFT CONSTANT INCREASE
thisforth$ CELL+ SM - CONSTANT >TARGET
: PATCH >TARGET + INCREASE SWAP +! ;
: PATCH-CONSTANT >DFA PATCH ;
: PATCH-ALL 5 0 DO I CELLS +ORIGIN PATCH LOOP
_PREV PATCH G-SIZE PATCH
'EM PATCH-CONSTANT '_FIRST PATCH-CONSTANT
'_LIMIT PATCH-CONSTANT ;
: GROW 'FORTH >WID >LFA >TARGET + ! PATCH-ALL
thisforth$ $@ 3 ARG[] PUT-FILE ;
GROW BYE
( -h :_help,_show_options ) \ AvdH B6feb26
.SIGNON CR 0 MESSAGE
0 BLOCK B/BUF TYPE
: _indices DO 0 I (LINE) BL $/ 2DROP &) $/ 2SWAP 2DROP
BEGIN 2DUP &_ $^ DUP WHILE BL SWAP C! REPEAT DROP
TYPE CR LOOP ;
^Z 1+ 1 _indices CR
.( See also the pdf documentation ) CR
.( or print the PostScript documentation ) CR
OK BYE
\
( -i BINARY-PATH LIBRARY-PATH SHELL-PATH )\ A3aug30
CREATE task 1 LOAD
"ARG[]" WANTED "SAVE-SYSTEM" WANTED
: INSTALL-LIB BLOCK-FILE $@ GET-FILE 3 ARG[] PUT-FILE
3 ARG[] BLOCK-FILE $! ;
\ Trim back to before ``task''. Save system at binary path.
\ Must be done all at once, because of forgetting.
: INSTALL-BIN 'task DUP 'FORTH FORGET-VOC >NFA @ DP !
2 ARG[] SAVE-SYSTEM BYE ;
\ Specify shell name.
: INSTALL-SHELL 4 ARG[] SHELL $! ;
: DOIT ARGC 4 6 WITHIN 0=
IF ." -i requires 2 or 3 arguments" CR BYE THEN
ARGC 5 = IF INSTALL-SHELL THEN INSTALL-LIB INSTALL-BIN ;
DOIT
\
( -j :_This_option_is_available )
\
( -k :_This_option_is_available )
\
( -l LIBRARY :_LIBRARY_to_be_used_for_blocks ) \ AvdH A1oct05
CREATE task
1 LOAD "SHIFT-ARGS" WANTED "ARG[]" WANTED
\ Install other library
: SWITCH-LIBS BLOCK-EXIT
2 ARG[] BLOCK-FILE $!
2 BLOCK-INIT
SHIFT-ARGS SHIFT-ARGS
'task 'FORTH FORGET-VOC COLD ;
\ Must all be done in one go!
SWITCH-LIBS
\
( -m/--/--help/--version :_Help_and_version_information )
1 31 INDEX OK \ Help
22 LOAD
\
( -n :_This_option_is_available )
\
( -o :_This_option_is_available )
\
( -p :_Load_system_preferences ) \ AvdH A1oct02
1 LOAD
"-legacy-" WANTED \ Must be first to WANT
\
( -q :_This_option_is_available )
\
( -r :_This_option_is_available )
\
( -s SCRIPT-FILE :_Interpret_SCRIPT-FILE ) \ AvdH A1oct02
1 LOAD "OLD:" WANTED "ARG[]" WANTED
"CTYPE" WANTED 2 ARG[] $, CONSTANT SCRIPT-NAME
: BY-WHO "XOS" PRESENT IF " run by " TYPE
0 ARG[] TYPE THEN ;
\ This error handler may be overwritten by the script.
: MY-ERROR OLD: ERROR
"Fatal error in file :" TYPE SCRIPT-NAME $@ TYPE CR
BY-WHO CR BYE ;
-1 WARNING ! 'MY-ERROR >DFA @ 'ERROR >DFA !
SHIFT-ARGS SHIFT-ARGS
SCRIPT-NAME $@ GET-FILE "-scripting-" WANTED
^J $/ 2DROP \ Line with #!lina
EVALUATE
BYE
( -t FILE :_Try_to_compile_FILE_by_all_means ) \ AvdH A1oct26
.SIGNON 1 LOAD
\ Reload "with" WANTED new ``CORA'' but hide it direct after.
"CORA-IGNORE" WANTED
: CORA CORA-IGNORE ; 1 LOAD 'CORA HIDDEN
"[IF]" WANTED "ARG[]" WANTED "PREFIX" WANTED
"CASE-INSENSITIVE" WANTED CASE-INSENSITIVE
"NO-SECURITY" WANTED NO-SECURITY
"AUTOLOAD" WANTED AUTOLOAD
ARGC 3 < 13 ?ERROR
2 ARG[] INCLUDED
SECOND-PASS @ 0= ?LEAVE-BLOCK
2 ARG[] INCLUDED
\
( -u :_This_option_is_available )
\
( -v :_Version_and_copyright_information_)
"CPU NAME VERSION" TYPE .SIGNON CR
"LIBRARY FILE: " TYPE
0 MESSAGE
"$RCSfile: boot.lab,v $ $Revision: 5.3 $" TYPE CR
CR
0 BLOCK B/BUF TYPE
BYE
\
( -w :_Make_want_available ) \ AvdH B2sep22
.SIGNON 1 LOAD OK
\
( -x :_This_option_is_available )
\
( -y :_This_option_is_available )
\
( -z :_This_option_is_available )
\
( :_This_option_is_available )
\
( :_This_option_is_available )
\
( :_This_option_is_available )
\
( - :_This_option_is_available )
\
( -? :_This_option_is_available )
8 LOAD
\
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: (No text message available for this error)
: Unknown error 128
: Unknown error 127
: Unknown error 126
: Unknown error 125
: Wrong medium type
: No medium found
: Disk quota exceeded
: Remote I/O error
: Is a named type file
: No XENIX semaphores available
: Not a XENIX named type file
: Structure needs cleaning
: Stale NFS file handle
: Operation now in progress
: Operation already in progress
: No route to host
: Host is down
: Connection refused
: Connection timed out
: Too many references: cannot splice
: Cannot send after transport endpoint shutdown
: Transport endpoint is not connected
: Transport endpoint is already connected
: No buffer space available
: Connection reset by peer
: Software caused connection abort
: Network dropped connection on reset
: Network is unreachable
: Network is down
: Cannot assign requested address
: Address already in use
: Address family not supported by protocol
: Protocol family not supported
: Operation not supported
: Socket type not supported
: Protocol not supported
: Protocol not available
: Protocol wrong type for socket
: Message too long
: Destination address required
: Socket operation on non-socket
: Too many users
: Streams pipe error
: Interrupted system call should be restarted
: Invalid or incomplete multibyte or wide character
: Cannot exec a shared library directly
: Attempting to link in too many shared libraries
: .lib section in a.out corrupted
: Accessing a corrupted shared library
: Can not access a needed shared library
: Remote address changed
: File descriptor in bad state
: Name not unique on network
: Value too large for defined data type
: Bad message
: RFS specific error
: Multihop attempted
: Protocol error
: Communication error on send
: Srmount error
: Advertise error
: Link has been severed
: Object is remote
: Package not installed
: Machine is not on the network
: Out of streams resources
: Timer expired
: No data available
: Device not a stream
: Bad font file format
: Unknown error 58
: Invalid slot
: Invalid request code
: No anode
: Exchange full
: Invalid request descriptor
: Invalid exchange
: Level 2 halted
: No CSI structure available
: Protocol driver not attached
: Link number out of range
: Level 3 reset
: Level 3 halted
: Level 2 not synchronized
: Channel number out of range
: Identifier removed
: No message of desired type
: Unknown error 41
: Too many levels of symbolic links
: Directory not empty
: Function not implemented
: No locks available
: File name too long
: Resource deadlock avoided
: Numerical result out of range
: Numerical argument out of domain
: Broken pipe
: Too many links
: Read-only file system
: Illegal seek
: No space left on device
: File too large
: Text file busy
: Inappropriate ioctl for device
: Too many open files
: Too many open files in system
: Invalid argument
: Is a directory
: Not a directory
: No such device
: Invalid cross-device link
: File exists
: Device or resource busy
: Block device required
: Bad address
: Permission denied
: Cannot allocate memory
: Resource temporarily unavailable
: No child processes
: Bad file descriptor
: Exec format error
: Argument list too long
: Device not configured
: Input/output error
: Interrupted system call
: No such process
: No such file or directory
: Operation not permitted
ciforth lab $Revision: 5.3 $ (c) Albert van der Horst
: EMPTY STACK
: DICTIONARY FULL
: FIRST ARGUMENT MUST BE OPTION
: ISN'T UNIQUE
: EMPTY NAME FOR NEW DEFINITION
: DISK RANGE ?
: FULL STACK/DICTIONARY FULL
: ERROR ACCESSING BLOCKS FROM MASS STORAGE
: UNRESOLVED FORWARD REFERENCE
: NOT A WORD, NOR A NUMBER OR OTHER DENOTATION
: WORD IS NOT FOUND
: NOT RECOGNIZED
: ERROR, NO FURTHER INFORMATION
: SAVE/RESTORE MUST RUN FROM FLOPPY
: CANNOT FIND WORD TO BE POSTPONED
: CANNOT FIND WORD TO BE COMPILED
: COMPILATION ONLY, USE IN DEFINITION
: EXECUTION ONLY
: CONDITIONALS NOT PAIRED
: STACK UNBALANCE, STRUCTURE UNFINISHED?
: IN PROTECTED DICTIONARY
: USE ONLY WHEN LOADING
: OFF CURRENT EDITING SCREEN
: (WARNING) NOT PRESENT, THOUGH WANTED
: LIST EXPECTS DECIMAL
: AS: PREVIOUS INSTRUCTION INCOMPLETE
: AS: INSTRUCTION PROHIBITED IRREGULARLY
: AS: UNEXPECTED FIXUP/COMMAER
: AS: DUPLICATE FIXUP/UNEXPECTED COMMAER
: AS: COMMAERS IN WRONG ORDER
: AS: DESIGN ERROR, INCOMPATIBLE MASK
: AS: PREVIOUS OPCODE PLUS FIXUPS INCONSISTENT
: ( NO TEXT MESSAGE AVAILABLE FOR THIS ERROR )
: ( NO TEXT MESSAGE AVAILABLE FOR THIS ERROR )
: ( NO TEXT MESSAGE AVAILABLE FOR THIS ERROR )
: ( NO TEXT MESSAGE AVAILABLE FOR THIS ERROR )
: ( NO TEXT MESSAGE AVAILABLE FOR THIS ERROR )
: ( NO TEXT MESSAGE AVAILABLE FOR THIS ERROR )
: ( NO TEXT MESSAGE AVAILABLE FOR THIS ERROR )
: REGRESSION TEST FAILS, STACK DEPTH ERROR
: REGRESSION TEST FAILS, RETURN VALUE ERROR
: REGRESSION TEST MALL-FORMED, SECOND PART MISSING
: ( NO TEXT MESSAGE AVAILABLE FOR THIS ERROR )
: ( NO TEXT MESSAGE AVAILABLE FOR THIS ERROR )
: ( NO TEXT MESSAGE AVAILABLE FOR THIS ERROR )
: ( NO TEXT MESSAGE AVAILABLE FOR THIS ERROR )
: ( NO TEXT MESSAGE AVAILABLE FOR THIS ERROR )
: NO BUFFER COULD BE FREED, ALL LOCKED
: EXECUTION OF EXTERNAL PROGRAM FAILED
: NOT ENOUGH MEMORY FOR ALLOCATE
: UNKNOWN FORMAT IDENTIFIER
: ( NO TEXT MESSAGE AVAILABLE FOR THIS ERROR )
: ( NO TEXT MESSAGE AVAILABLE FOR THIS ERROR )
: ( NO TEXT MESSAGE AVAILABLE FOR THIS ERROR )
: ( NO TEXT MESSAGE AVAILABLE FOR THIS ERROR )
: ( NO TEXT MESSAGE AVAILABLE FOR THIS ERROR )
: ( NO TEXT MESSAGE AVAILABLE FOR THIS ERROR )
: ( NO TEXT MESSAGE AVAILABLE FOR THIS ERROR )
: ( NO TEXT MESSAGE AVAILABLE FOR THIS ERROR )
: ( NO TEXT MESSAGE AVAILABLE FOR THIS ERROR )
: ( NO TEXT MESSAGE AVAILABLE FOR THIS ERROR )
: ( NO TEXT MESSAGE AVAILABLE FOR THIS ERROR )
: ( NO TEXT MESSAGE AVAILABLE FOR THIS ERROR )
( ************** configuration *******************************)
\
( CONFIG ?LEAVE-BLOCK ?16 ?64 ?LI ?PC ?MS ?FD ?HD ) \ B0jan12
: ?LEAVE-BLOCK IF SRC CELL+ @ PP ! THEN ;
: CONFIG CREATE 0= , DOES> @ ?LEAVE-BLOCK ;
0 CELL+ DUP 2 = CONFIG ?16 DUP 2 > CONFIG ?32+
DUP 4 = CONFIG ?32 DUP 8 = CONFIG ?64 DROP
"CALL" PRESENT DUP CONFIG ?WI \ (MS-windows)
"BIOS31" PRESENT DUP CONFIG ?DP \ DPMI (legacy windows)
DUP 0= "BIOSN" PRESENT AND DUP CONFIG ?MS \ MS-DOS
OR OR DUP CONFIG ?WIMS \ One of 3 above
"XOSV" PRESENT DUP CONFIG ?OSX \ OSX.
DUP 0= "XOS" PRESENT AND DUP CONFIG ?LI \ Linux, BSD.,
OR OR CONFIG ?HS \ Any host
"BIOSN" PRESENT CONFIG ?PC \ MS-DOS OR dpmi
"LBAPAR" PRESENT DUP CONFIG ?HD \ Hard disk, modern
"SEC-RW" PRESENT DUP CONFIG ?FD \ Floppy or hard disk old
OR CONFIG ?SA
( HELP ) CF: ?HS \ A5dec07
: HELP-WANTED? ." Press space to skip " TYPE
." , other key to confirm" CR KEY BL <> ;
: HELP 1 20 INDEX CR
"I will try to start a help window" TYPE CR
"Press a key" TYPE CR KEY DROP
"XOS" PRESENT IF
"PDF" HELP-WANTED? IF
"acroread ci86.lina.pdf&" SYSTEM EXIT THEN
"PostScript" HELP-WANTED? IF
"gv ci86.lina.ps&" SYSTEM THEN
"info" HELP-WANTED? IF
"info -f ci86.lina.info" SYSTEM THEN
ELSE "BDOSN" PRESENT IF
"wina.pdf" SYSTEM THEN THEN ;
( -syscalls- ) CF: ?LI ?32 \ AvdH B5feb08
DECIMAL
13 CONSTANT __NR_time
43 CONSTANT __NR_times
1 CONSTANT __NR_exit
120 CONSTANT __NR_clone
37 CONSTANT __NR_kill
48 CONSTANT __NR_signal
12 CONSTANT __NR_chdir
HEX
36 CONSTANT __NR_ioctl 8E CONSTANT __NR_select
2A CONSTANT __NR_pipe
65 CONSTANT __NR_ioperm 6E CONSTANT __NR_iopl
CREATE -syscalls- DECIMAL
( -syscalls- ) CF: ?LI ?64 \ AvdH B5feb08
DECIMAL
201 CONSTANT __NR_time
100 CONSTANT __NR_times
60 CONSTANT __NR_exit
56 CONSTANT __NR_clone
62 CONSTANT __NR_kill
48 CONSTANT __NR_signal
80 CONSTANT __NR_chdir
HEX
10 CONSTANT __NR_ioctl 17 CONSTANT __NR_select
16 CONSTANT __NR_pipe
0AD CONSTANT __NR_ioperm 0AC CONSTANT __NR_iopl
CREATE -syscalls- DECIMAL
( -syscalls- ) CF: ?OSX \ AvdH B4feb10
\ 13 CONSTANT __NR_time
\ 43 CONSTANT __NR_times
1 CONSTANT __NR_exit
\ 120 CONSTANT __NR_clone
\ 37 CONSTANT __NR_kill
\ 48 CONSTANT __NR_signal
\ 12 CONSTANT __NR_chdir
CREATE -syscalls- DECIMAL
( -legacy- ) CF: ?LI \ AvdH A8jun24
: LINOS XOS ;
( -legacy- $!-BD $S $I PRESENT? REQUIRE ) \ AvdH B4may28
\ This will make most old programs run.
"ALIAS" WANTED
'$/ ALIAS $S '$^ ALIAS $I
: $!-BD 2DUP C! 1+ SWAP CMOVE ;
: REQUIRE WANT ; : REQUIRED WANTED ;
: PRESENT? PRESENT 0= 0= ; \ For WORD sc: it IS found as such
( -legacy- IN >IN REFILL 0>IN ) \ AvdH B5jan7
"ALIAS" WANTED
\ Fake a parse area that starts at address 0.
'PP ALIAS >IN 'PP ALIAS IN
: SOURCE 0 SCR CELL+ @ ;
\ Set parse pointer at start of line.
: 0>IN BEGIN -1 PP +! PP @ 1- C@ ^J = PP @ SRC @ = OR UNTIL ;
\ Closest match to traditional line by line interpreting.
\ Set parse pointer at start of next line
: REFILL BEGIN PP @ 1- C@ ^J <> PP @ SRC CELL+ @ <> AND WHILE
+1 PP +! REPEAT PP @ SRC CELL+ @ <> ;
\ UNCLEAR IF THIS EVER WORKED, KEEP FOR REFERENCE!
\ \ Use L_>IN instead of >IN , don't store into it!
\ : L_>IN PP @ SRC @ - (>IN) ! (>IN) ;
\ 'L_>IN ALIAS >IN
( -legacy- VOCABULARY ) \ AvdH B5dec01
\ Use replacing vocabularies instead of pushing namespaces.
: FORTH CONTEXT @ 'ONLY >WID <> IF PREVIOUS THEN FORTH ;
: VOCABULARY NAMESPACE DOES> CELL+ CONTEXT ! ;
ALSO \ Start up with two FORTH namespaces.
\ -legacy- WORD FIND (WORD) (PARSE) \ AvdH B2oct02
"ALIAS" WANTED "$!-BD" WANTED
\ ISO
: FIND DUP COUNT PRESENT DUP IF NIP DUP SWAP
>FFA @ 4 AND -1 SWAP IF NEGATE THEN THEN ;
\ ISO
: WORD DUP BL = IF DROP NAME ELSE >R
BEGIN PP@@ R@ = WHILE DROP REPEAT DROP -1 PP +!