-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
544 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
( AI-COMMANDS FOR FORTH ) | ||
: AI ; | ||
: ATOM ( -- ) <BUILDS 0. , , | ||
DOES> 0 ( -- A 0 ) ; | ||
: ATOMS ( C --- ) 0 DO ATOM LOOP ; | ||
: SYMBOL ( A A A C --- ) <BUILDS DUP 1+ 0 DO , LOOP | ||
DOES> 1 ( -- A 1 ) ; | ||
: (DOWN) ( A --- A A A C ) DUP @ DUP | ||
IF 2 * OVER + SWAP 2 - SWAP | ||
DO I @ -2 +LOOP THEN ; | ||
: SYMTYPE ( A A A N -- ) | ||
REVERSE 0 DO 2- NFA ID. LOOP ; | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
( GRAFISKA KOMMANDON:PLOT UNPLOT) | ||
|
||
FORTH DEFINITIONS HEX | ||
: PIT ;CODE E1 C, D1 C, C5 C, 4D C, 43 C, CD C, 0BB2 , C1 C, | ||
C3 C, NEXT , SMUDGE PIT | ||
: PIT1 4030 C! PIT ; | ||
: PLOT1 ( Y X --- ) 9B PIT1 ; | ||
: UNPLOT1 ( Y X --- ) A0 PIT1 ; | ||
DECIMAL | ||
: ?UTANF0R OVER OVER >R >R R -1 > R 44 < AND R> DROP R -1 > | ||
R 64 < AND R> DROP AND ; | ||
: 2DROP DROP DROP ; | ||
: PLOT ?UTANF0R IF PLOT1 ELSE 2DROP ENDIF ; | ||
: UNPLOT ?UTANF0R IF UNPLOT1 ELSE 2DROP ENDIF ; | ||
|
||
;S |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
( CONVOY BOMB 83.05.07) | ||
FORTH DEFINITIONS DECIMAL | ||
( SCR # 21 <GRAFIK> LOADAD.) | ||
: TASK ; | ||
0 VARIABLE VB | ||
0 VARIABLE N 0 VARIABLE AB | ||
: VISA-P HOME ." CONVOY BOMB" 10 SPACES ." POANG:" N @ 5 .R ; | ||
0 VARIABLE XF 0 VARIABLE YF | ||
: FLYGPLAN YF @ 1+ XF @ PLOT YF @ XF @ PLOT YF @ XF @ 1+ PLOT | ||
YF @ XF @ 2+ PLOT YF @ XF @ 3 + PLOT YF @ XF @ 4 + PLOT | ||
YF @ XF @ 5 + PLOT YF @ XF @ 6 + PLOT ; | ||
|
||
: FLYG YF @ 1+ XF @ 1 - UNPLOT YF @ XF @ 1 - UNPLOT FLYGPLAN 1 | ||
XF +! XF @ 65 = IF -7 XF ! 16436 C@ 9 / 12 + YF ! VB @ IF -117 N | ||
+! N @ 0< IF 0 N ! THEN VISA-P THEN THEN ; | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
( CONVOY BOMB SCR 2 IS MISSING DUE TO A MISTAKE WHEN COPYING TO | ||
RAMDISC IN 1983. ALL BACKUPS FOUND SO FAR ARE WRONG. ) | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
( CONVOY BOMB 83.05.07) | ||
( SKEPP DEF. FORTS. >> ) YS @ 2+ XS @ 5 + PLOT YS @ 1+ XS @ 5 + | ||
PLOT YS @ XS @ 5 + PLOT YS @ 2+ XS @ 4 + PLOT YS @ 1+ XS @ 4 + | ||
PLOT YS @ XS @ 4 + PLOT YS @ 2+ XS @ 3 + PLOT YS @ 1+ XS @ 3 + P | ||
LOT YS @ 2+ XS @ 2+ PLOT YS @ 1+ XS @ 2+ PLOT YS @ 2+ XS @ 1+ PL | ||
OT YS @ 2+ XS @ PLOT ; | ||
|
||
: FLYT -1 XS +! SKEPP YS @ 5 + XS @ 12 + UNPLOT YS @ 4 + | ||
XS @ 13 + UNPLOT YS @ 3 + XS @ 13 + UNPLOT YS @ 2+ XS @ 15 + | ||
UNPLOT YS @ 1+ XS @ 14 + UNPLOT YS @ XS @ 13 + UNPLOT XS @ -14 < | ||
IF 1 AB +! 64 XS ! THEN ; | ||
: VATTEN HOME 21 0 DO CR LOOP 32 0 DO 23 EMIT LOOP | ||
; : VISA 0 VB ! VATTEN -6 XF ! 2 YS ! 64 XS ! BEGIN 40 YF ! FLY | ||
G FLYT FLYG 16421 @ -577 = UNTIL ; | ||
|
||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
( CONVOY BOMB 83.05.07) | ||
0 VARIABLE XB 4 VARIABLE RB 0 VARIABLE ?BOMB -1 VARIABLE ?S | ||
: BOM 2 XB @ 1 - PLOT 2 XB @ 1+ PLOT 3 XB @ PLOT 3 XB @ 2+ | ||
PLOT 4 XB @ 1+ PLOT ; | ||
: SUDDA HOME 17 0 DO CR LOOP 128 SPACES ; | ||
: EXPLODERA SUDDA 13 5 12 4 13 4 10 3 9 5 2 4 4 6 6 6 6 5 0 3 | ||
0 1 15 3 14 0 8 3 6 3 4 3 3 2 3 1 2 1 3 0 13 1 12 2 12 1 | ||
11 1 11 0 4 1 5 2 6 2 7 2 8 1 6 1 5 0 9 0 8 0 6 0 7 0 36 0 | ||
DO YS @ + SWAP XS @ + PLOT LOOP 1 AB +! ; 0 VARIABLE YB | ||
: ?TRAFF YB @ RB @ - 3 < IF XB @ XS @ 3 + > XB @ XS @ 14 + < | ||
AND IF EXPLODERA 375 N +! VISA-P 72 XS ! ELSE BOM THEN VATTEN 0 | ||
?BOMB ! 6 ?S ! THEN ; : FALL YB @ RB @ - XB @ UNPLOT YB @ RB @ | ||
13 * 10 / DUP RB ! - XB @ 1+ DUP XB ! PLOT ?TRAFF ; | ||
: BOMBINIT 16421 @ -8321 = IF 1 ?BOMB ! XF @ 4 + XB ! 4 RB ! | ||
YF @ 3 + YB ! THEN ; | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
( CONVOY BOMB 83.05.07) | ||
: B 0 N ! CLS VISA-P 0 AB ! 1 VB ! VATTEN | ||
BEGIN FLYG FLYT ?BOMB @ IF FALL ELSE BOMBINIT THEN -1 ?S +! | ||
FLYG ?S @ 0= IF SUDDA THEN AB @ 5 = UNTIL ; | ||
: IT CLS CR CR 6 SPACES ." C O N V O Y B O M B" CR CR | ||
." DITT UPPDRAG AR ATT SANKA ALLA" CR ." FARTYGEN I EN KONVOJ. K | ||
ONVOJEN" CR ." BESTAR AV 8 HANDELSFARTYG." CR ." DU FAR POANG F0 | ||
R VARJE SANKT" CR ." SKEPP OCH POANGAVDRAG F0R VARJE" CR | ||
." 0VERFLYGNING." CR ." F0R ATT FALLA EN BOMB, TRYCK NER" | ||
." <B> TILLS DU SER BOMBEN FALLA." CR ." DU KAN INTE FALLA NASTA | ||
BOMB" CR ." F0RREN DEN F0RRA HAR LANDAT." CR ." DU KAN EJ REGLE | ||
RA H0JDEN EFTER-" CR ." SOM DU EJ AR PILOT UTAN BOMB-" CR | ||
." FALLARE." CR ." F0R ATT B0RJA, SKRIV <N/L>." ; | ||
: CONVOY-BOMB BEGIN IT VISA B HOME CR CR CR CR ." VILL DU SPELA | ||
EN GANG TILL?(J/N)" 0 BEGIN DROP KEY DUP DUP 78 = SWAP 74 = OR U | ||
NTIL 78 = UNTIL CLS ." ADJ0. HOPPAS NI HADE TREVLIGT." CR ; ;S |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
( SCR 1 OF EDITOR ) | ||
FORTH DEFINITIONS HEX | ||
: TEXT HERE C/L 1+ BLANKS WORD HERE PAD C/L 1+ CMOVE ; | ||
: LINE DUP FFF0 AND 17 ?ERROR SCR @ (LINE) DROP ; | ||
VOCABULARY EDITOR IMMEDIATE HEX | ||
: WHERE DUP DUP SCR ! ." SCR # " DECIMAL . SWAP C/L /MOD C/L | ||
* ROT BLOCK + CR C/L TYPE CR HERE C@ - SPACES 5E EMIT [COMPILE] | ||
EDITOR QUIT ; | ||
EDITOR DEFINITIONS | ||
: #LOCATE R# @ C/L /MOD ; | ||
: #LEAD #LOCATE LINE SWAP ; | ||
: #LAG #LEAD DUP >R + C/L R> - ; | ||
: -MOVE LINE C/L CMOVE ; | ||
|
||
|
||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
( SCR 2 OF EDITOR ) | ||
: H LINE PAD 1+ C/L DUP PAD C! CMOVE ; | ||
: E LINE C/L BLANKS ; | ||
: S DUP 1 - 0E DO I LINE I 1+ -MOVE -1 +LOOP E ; | ||
: D DUP H 0F DUP ROT DO I 1+ LINE I -MOVE LOOP E ; | ||
: M R# +! CR SPACE #LEAD TYPE 5F EMIT #LAG TYPE #LOCATE | ||
. DROP ; : T DUP C/L * R# ! DUP H 0 M ; | ||
: L SCR @ LIST 0 M ; | ||
: R PAD 1+ SWAP -MOVE ; | ||
: P 1 TEXT R ; | ||
: I DUP S R ; | ||
: TOP 0 R# ! ; | ||
: CLEAR DUP FIRST ! SCR ! 10 0 DO FORTH I EDITOR E LOOP ; | ||
|
||
|
||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
( SCR 3 OF EDITOR - CLEVER ONES) | ||
FORTH DEFINITIONS | ||
: 2DROP DROP DROP ; | ||
: 2SWAP ROT >R ROT R> ; | ||
EDITOR DEFINITIONS | ||
: -TEXT SWAP -DUP IF OVER + SWAP DO DUP C@ FORTH I C@ | ||
- IF 0= LEAVE ELSE 1+ THEN LOOP ELSE DROP 0= THEN ; | ||
: MATCH >R >R 2DUP R> R> 2SWAP OVER + SWAP DO 2DUP FORTH I | ||
-TEXT IF >R 2DROP R> - I SWAP - 0 SWAP 0 0 LEAVE THEN LOOP | ||
2DROP SWAP 0= SWAP ; | ||
: 1LINE #LAG PAD COUNT MATCH R# +! ; | ||
: FIND BEGIN 3FF R# @ < IF TOP PAD HERE C/L 1+ CMOVE 0 | ||
ERROR ENDIF 1LINE UNTIL ; | ||
: DELETE >R #LAG + FORTH R - #LAG R MINUS R# +! #LEAD + SWAP | ||
CMOVE R> BLANKS ; : N FIND 0 M ; | ||
: F 1 TEXT N ; --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
( SCR 4 OF EDITOR THE LAST ONE ) | ||
: B PAD C@ MINUS M ; | ||
: X 1 TEXT FIND PAD C@ DELETE 0 M ; | ||
: TILL #LEAD + 1 TEXT 1LINE 0= 0 ?ERROR #LEAD + SWAP - | ||
DELETE 0 M ; | ||
: C 1 TEXT PAD COUNT #LAG ROT OVER MIN >R FORTH R R# +! R - | ||
>R DUP HERE R CMOVE HERE #LEAD + R> CMOVE R> CMOVE 0 M ; | ||
;S | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
( FORTH-79 DEFINITIONS ) | ||
FORTH DEFINITIONS DECIMAL | ||
: 1- 1 - ; | ||
: 2- 2 - ; | ||
: <> = 0= ; | ||
: DEPTH ( -- N ) | ||
SP@ S0 @ SWAP - 2 / ; | ||
: PICK ( N1 -- N2 ) | ||
( IF N1 >0, GET THE N1TH. NUMBER FROM THE STACK, AND RETURN | ||
IT ON TOP OF THE STACK ) | ||
DEPTH 1- OVER < OVER 1 < OR | ||
( CHECK FOR BAD INDEX: LEAVE TRUE IF BAD, FALSE IF OK ) | ||
IF ." INDEX OUTSIDE LIMITS" | ||
7 EMIT QUIT | ||
ELSE DUP + SP@ + @ | ||
THEN ; --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
( FORTH-79 DEFINITIONS ) | ||
: ROLL ( N -- RE-ARRANGED STACK ) | ||
>R R PICK SP@ DUP 2+ R> DUP + CMOVE DROP ; | ||
: >< ( SWAP BYTES ) ( FORTH DEF. ) | ||
DUP 256 / SWAP 255 AND 256 * + ; | ||
VOCABULARY FORTH-79 IMMEDIATE | ||
FORTH-79 DEFINITIONS DECIMAL | ||
: CREATE ( AGREES WITH BRODIE ) | ||
0 VARIABLE -2 ALLOT ; | ||
: WORD ( -- ADDRESS ) | ||
WORD HERE ; | ||
;S | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
( ASSEMBLER 1 ) | ||
HEX VOCABULARY ASSEMBLER IMMEDIATE ' ASSEMBLER CFA | ||
' ;CODE 08 + ! | ||
: CODE ?EXEC CREATE [COMPILE] ASSEMBLER !CSP ; IMMEDIATE | ||
: C; CURRENT @ CONTEXT ! ?EXEC ?CSP SMUDGE ; IMMEDIATE | ||
: LABEL ?EXEC 0 VARIABLE SMUDGE -2 ALLOT [COMPILE] ASSEMBLER | ||
!CSP ; IMMEDIATE | ||
: 8* DUP + DUP + DUP + ; | ||
ASSEMBLER DEFINITIONS | ||
4 CONSTANT H 5 CONSTANT L | ||
2 CONSTANT D 3 CONSTANT E | ||
6 CONSTANT M 6 CONSTANT SP | ||
7 CONSTANT A 6 CONSTANT PSW | ||
0 CONSTANT B 1 CONSTANT C | ||
: 1MI <BUILDS C, DOES> C@ C, ; | ||
DECIMAL ;S |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
( ASSEMBLER 2 ) | ||
ASSEMBLER DEFINITIONS HEX | ||
: 2MI <BUILDS C, DOES> C@ + C, ; | ||
: 3MI <BUILDS C, DOES> C@ | ||
SWAP 8* + C, ; | ||
: 4MI <BUILDS C, DOES> C@ C, C, ; | ||
: 5MI <BUILDS C, DOES> C@ C, , ; | ||
00 1MI NOP 76 1MI HLT F3 1MI DI FB 1MI EI | ||
07 1MI RLC 0F 1MI RRC 17 1MI RAL 1F 1MI RAR | ||
E9 1MI PCHL F9 1MI SPHL E3 1MI XTHL EB 1MI XCHG | ||
27 1MI DAA 2F 1MI CMA 37 1MI STC 3F 1MI CMC | ||
80 2MI ADD 88 2MI ADC 90 2MI SUB 98 2MI SBB | ||
A0 2MI ANA A8 2MI XRA B0 2MI ORA B8 2MI CMP | ||
09 3MI DAD C1 3MI POP C5 3MI PUSH 02 3MI STAX | ||
0A 3MI LDAX 04 3MI INR 05 3MI DCR 03 3MI INX | ||
DECIMAL --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
( ASSEMBLER 3 ) | ||
ASSEMBLER DEFINITIONS HEX | ||
0B 3MI DCX C9 3MI RST D3 4MI OUT DB 4MI IN | ||
C6 4MI ADI CE 4MI ACI D6 4MI SUI DE 4MI SBI | ||
E6 4MI ANI EE 4MI XRI F6 4MI ORI FE 4MI CPI | ||
22 5MI SHLD 2A 5MI LHLD 32 5MI STA 3A 5MI LDA | ||
C4 5MI CNZ CC 5MI CZ D4 5MI CNC DC 5MI CC | ||
E4 5MI CPO EC 5MI CPE F4 5MI CP FC 5MI CM | ||
CD 5MI CALL C0 1MI RNC C8 1MI RZ D0 1MI RNC | ||
D8 1MI RC E0 1MI RPO E8 1MI RPE F8 1MI RM | ||
C9 1MI RET C3 5MI JMP F0 1MI RP | ||
C2 CONSTANT 0= D2 CONSTANT CS E2 CONSTANT PE | ||
F2 CONSTANT 0< | ||
: NOT 8 + ; : MOV 8* 40 + + C, ; : MVI 8* 6 + C, C, ; | ||
: LXI 8* 1+ C, , ; | ||
DECIMAL --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
( ASSEMBLER 4 ) | ||
ASSEMBLER DEFINITIONS HEX | ||
: ENDIF 2 ?PAIRS HERE SWAP ! ; | ||
: THEN [COMPILE] ENDIF ; | ||
: IF C, HERE 0 , 2 ; | ||
: ELSE 2 ?PAIRS C3 IF ROT | ||
SWAP ENDIF 2 ; | ||
: BEGIN HERE 1 ; | ||
: UNTIL SWAP 1 ?PAIRS C, , ; | ||
: AGAIN 1 ?PAIRS C3 C, , ; | ||
: WHILE IF 2+ ; | ||
: REPEAT >R >R AGAIN R> R> | ||
2 - ENDIF ; | ||
FORTH DEFINITIONS DECIMAL | ||
--> ( LOAD Z80-ADDITION ) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
( ASSEMBLER 5 ) | ||
ASSEMBLER DEFINITIONS HEX | ||
NEXT 1 - CONSTANT HPUSH | ||
NEXT 2 - CONSTANT DPUSH | ||
: END-CODE [COMPILE] C; ; | ||
D9 1MI EXX | ||
: BITAD <BUILDS C, DOES> CB | ||
C, C@ SWAP 8* + + C, ; | ||
40 BITAD BIT | ||
80 BITAD RES | ||
C0 BITAD SET | ||
: 2BYTE <BUILDS C, DOES> ED C, C@ C, ; | ||
67 2BYTE RRD 6F 2BYTE RLD A0 2BYTE LDI A1 2BYTE CPII | ||
A2 2BYTE INI A3 2BYTE OUTI A8 2BYTE LDD A9 2BYTE CPD | ||
AA 2BYTE IND AB 2BYTE OUTD B0 2BYTE LDIR B1 2BYTE CPIR | ||
FORTH DEFINITIONS DECIMAL --> |
Oops, something went wrong.