Benutzer-Werkzeuge

Webseiten-Werkzeuge


papierkorb:help.blk

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

papierkorb:help.blk [2025-08-16 17:50] – ↷ Seite von projects:help.blk nach papierkorb:help.blk verschoben mkapapierkorb:help.blk [Unbekanntes Datum] (aktuell) – gelöscht - Externe Bearbeitung (Unbekanntes Datum) 127.0.0.1
Zeile 1: Zeile 1:
-===On line HELP system=== 
  
-<code> 
-Screen 0 not modified      
- 0 \ Help System                                  11:43JWB03/25/86  
- 1 \ Last change:   Screen  009                   11:45JWB03/25/86  
-                                                                  
-                                                                  
-                                                                  
-                                                                  
-                                                                  
-                                                                  
-                                                                  
-                                                                  
-10                                                                  
-11                                                                  
-12                                                                  
-13                                                                  
-14                                                                  
-15                                                                  
- 
- 
-Screen 1 not modified      
- 0 \ HELP SYSTEM LOAD SCREEN                      11:43JWB03/25/86  
-                                                                  
-  CR .( Loading HELP system.)                                     
-                                                                  
-    9   THRU                                                    
-                                                                  
-                                                                  
-                                                                  
-                                                                  
-                                                                  
-10                                                                  
-11                                                                  
-12                                                                  
-13                                                                  
-14                                                                  
-15                                                                  
- 
- 
-Screen 2 not modified      
- 0 \ HELP-0 HBLOCK PBLOCK DONE? IPROMPT MAXPR     11:07JWB12/01/85  
- 1 ONLY EDITOR ALSO FORTH ALSO HIDDEN DEFINITIONS                   
-   VARIABLE #PROMPT     \ Prompt # and index into help screens.   
-   VARIABLE HBLOCK      \ Contains block # of first help screen.  
-   VARIABLE FINI        \ Flag set true when it's time to quit.   
-   VARIABLE MAXP        \ Contains max number of help screens.    
- 6 0 CONSTANT IPROMPT     \ Initial Prompt number.                  
-                                                                  
- 8 \ Leave number of last prompt.                                   
- 9 : MAXPROMPT ( --  n )                                            
-10         MAXP @ ;                                                 
-11                                                                  
-12 \ Leave true flag if user responds positively.                   
-13 : (Y/N? ( --  flag )                                           
-14   ." Yes/No " KEY DUP 223 ( $DF = 11011111 to allow lower case)  
-15   AND ASCII Y = SWAP BL = OR ;                                   
- 
- 
-Screen 3 not modified      
- 0 \ HELP-1  (Y/N? (LIST) .HELP                 10:15JWB12/01/85  
- 1 \ List a screen without its header and line numbers.             
- 2 : (LIST) ( n  -- )                                               
-         SCR ! CLEARSCREEN                                        
-         16 0 DO 8 I 3 + AT                                       
-                 SCR @ BLOCK I C/L * +                            
-                 C/L -TRAILING >TYPE CR                           
-              LOOP ;                                              
-                                                                  
- 9 \ Display the current help screen.                               
-10 : .HELP  ( --  -- )                                              
-11         #PROMPT @ HBLOCK @ 1+ + (LIST)                           
-12         20 21 AT BEEP ." More help? "                            
-13         (Y/N?  NOT  FINI ! ;                                   
-14 : WHITE 112  ATRIB ! ;  \ Set background to White.               
-15 : BLACK  15  ATRIB ! ;  \ Set backbround to black.               
- 
- 
-Screen 4 not modified      
- 0 \ HELP-2 PROMPT-ADR .PROMPT-CUR +.PROMPT.C     10:10JWB12/01/85  
- 1 \ Compute address and character count for prompt number n.       
- 2 : PROMPT-ADR ( n  adr count )                                    
-         32 * B/BUF /MOD                                          
-         HBLOCK @ + BLOCK          Note   the  BLOCK !!!        
-         SWAP + 32 -TRAILING ;                                    
- 6 \ Position cursor at correct position for current prompt and     
- 7 \ leave current prompt number n.                                 
- 8 : .PROMPT-CUR  ( --  n )                                         
-         #PROMPT @ DUP 3 /MOD                                     
-10         SWAP 25 * SWAP  AT ;                                     
-11 \ Increment prompt number by n and position cursor and leave new 
-12 \ prompt number as n'                                          
-13 : +.PROMPT-CUR  ( n   n' )                                       
-14         #PROMPT @ + MAXPROMPT MOD #PROMPT !                      
-15         .PROMPT-CUR  ;                                           
- 
- 
-Screen 5 not modified      
- 0 \ HELP-3 .PROMPT .RPROMPT +.PROMPT .HPROMP     10:21JWB12/01/85  
- 1 \ Display prompt number n at current cursor position.            
- 2 : .PROMPT ( n  -- )                                              
-         PROMPT-ADR  VTYPE ;                                      
- 4 \ As above but with blue background.                             
- 5 : .RPROMPT ( n  -- )                                             
-         PROMPT-ADR WHITE VTYPE BLACK ;                           
- 7 \ Increment prompt number by n amd move to new prompt.           
- 8 : +.PROMPT ( n  -- )                                             
-         .PROMPT-CUR .PROMPT                                      
-10        +.PROMPT-CUR .RPROMPT ;                                   
-11 \ Move to home position and display prompt number 0 .            
-12 : .HPROMPT ( --  -- )                                            
-13         #PROMPT OFF 0 +.PROMPT ;                                 
-14 : .EPROMPT ( --  -- )  \ Move to last prompt.                    
-15         MAXPROMPT 1- #PROMPT ! 0 +.PROMPT ;                      
- 
- 
-Screen 6 not modified      
- 0 \ HELP-4                                       11:00JWB12/01/85  
- 1 : .LPROMPT ( --  -- )  \ Move to last prompt on line.            
-         2 #PROMPT @ 3 MOD - +.PROMPT ;                           
- 3 : .FPROMPT ( --  -- )  \ Move to first prompt on line.           
-         MAXPROMPT #PROMPT @ 3 MOD - +.PROMPT ;                   
-                                                                  
- 6 : MENU  ( --  -- )                                               
-         #PROMPT @ CLEARSCREEN MAXPROMPT 0                        
-         DO I #PROMPT ! .PROMPT-CUR .PROMPT LOOP 9 22 AT          
-         ." Select with arrow keys and then press RETURN "        
-10         #PROMPT ! .PROMPT-CUR .RPROMPT ;                         
-11                                                                  
-12 : SCAN  ( false   flag )                                         
-13         200 0 DO DROP (KEY?) DUP ?LEAVE LOOP ;                   
-14                                                                  
-15                                                                  
- 
- 
-Screen 7 not modified      
- 0 \ HELP-5                                       11:04JWB12/01/85  
- 1 \ Same as PCKEY in line editor.                                  
- 2 : HCKEY ( --   n flag )                                          
-         {KEY}                                                    
-             ?DUP IF TRUE ELSE {KEY} FALSE THEN ;                 
-                                                                  
-                                                                  
- 7 : FKEY                                                           
-         (KEY?) IF HCKEY ELSE                                     
-         BEGIN FALSE .PROMPT-CUR .PROMPT SCAN                     
-10               .PROMPT-CUR .RPROMPT DUP NOT                       
-11               IF SCAN THEN                                       
-12         UNTIL .PROMPT-CUR  .PROMPT  HCKEY  THEN ;                
-13                                                                  
-14                                                                  
-15                                                                  
- 
- 
-Screen 8 not modified      
- 0 \ HELP-6                                       10:22JWB12/01/85  
- 1 : CHOOSE                                                         
-   BEGIN FKEY  IF DUP 13 <> ELSE TRUE THEN                        
-   WHILE CASE                                                     
-    72 OF MAXPROMPT 3 - +.PROMPT ENDOF   \ Up arrow               
-    73 OF MAXPROMPT 9 - +.PROMPT ENDOF   \ Pg up                  
-    71 OF             .HPROMPT   ENDOF   \ Home key               
-    79 OF             .EPROMPT   ENDOF   \ End  key               
-    75 OF MAXPROMPT 1-  +.PROMPT ENDOF   \ Left arrow             
-   115 OF     .FPROMPT   ENDOF           \ Control left arrow     
-10    77 OF  1 +.PROMPT    ENDOF           \ Right arrow            
-11   116 OF     .LPROMPT   ENDOF           \ Control right arrow    
-12    80 OF  3 +.PROMPT    ENDOF           \ Down arrow             
-13    81 OF  9 +.PROMPT    ENDOF           \ Pg down                
-14         ENDCASE REPEAT DROP ;                                    
-15                                                                  
- 
- 
-Screen 9 not modified      
- 0 \ HELP-7                                       11:45JWB03/25/86  
- 1 : (HELP)   ( scr  nmax   -- )                                    
-         MAXP ! HBLOCK !    FINI OFF                              
-         IPROMPT #PROMPT ! MENU                                   
-         BEGIN   MENU   CHOOSE #PROMPT @                          
-                 IF .HELP  THEN                                   
-                 FINI @ #PROMPT @ 0= OR                           
-         UNTIL   0 22 AT                                          
-         #PROMPT @ IS IPROMPT  ;                                  
- 9 ONLY FORTH ALSO DOS ALSO HIDDEN ALSO FORTH DEFINITIONS           
-10 : HELP  ( --  -- )                                               
-11         SCR @  FILE @ FLUSH                                      
-12   ( B: )  HELP.BLK  OPEN-FILE                                    
-13         [ BLK @ 1+ ] LITERAL   63  (HELP)                        
-14         !FILES  OPEN-FILE SCR ! ;                                
-15 ONLY FORTH ALSO DEFINITIONS                                      
- 
- 
-Screen 10 not modified      
- 0 EXIT HELP                       SCREEN VIEWING                   
- 1 PRINTER AND WORD VIEWING        NO. DISPLAYING WORDS             
- 2 COLD FORGET  EMPTY BYE          HEX AND DECIMAL                  
- 3 CONDITIONALS                    MORE CONDITIONALS                
- 4 SCREEN EDITING                  STAR-SLASH THE SCALAR            
- 5 INFINITE LOOPS                  INDEFINITE LOOPS                 
- 6 ANOTHER LOOP                    LEAVING LOOPS EARLY              
- 7 BASIC STACK OPERATORS           FURTHER STACK OPERATORS          
- 8 RETURN STACK                    VIRTUAL MEMORY                   
- 9 BLOCK AND UPDATE                MEMORY OPERATORS                 
-10 MORE MEMORY OPERATORS           WORD DEFINITION STRUCTURE        
-11 VOCABULARY:ROOT:ONLY            DIVISION                         
-12 STRINGS                         STRING:COUNT:TYPE:EXPECT         
-13 MOVING STRINGS                  BUFFER                           
-14 HIDE:REVEAL:IMMEDIATE           NUMBER FORMATING                 
-15 CASE STATEMENT                  VARIABLES AND CONSTANTS          
- 
- 
-Screen 11 not modified      
- 0 MORE VARIABLES & CONST.         MULTITASKING                     
- 1 TASK USER VARIABLES           PAUSE  RESTART                   
- 2 SLEEP WAKE STOP                 MULTI SINGLE                     
- 3 X                                                              
- 4 X                                                              
- 5 XMETA COMPILER                  X                                
- 6 X                                                              
- 7 XDEMOS                          X                                
- 8 XCRASH RECOVERY                                                
- 9 X8086 CPU REGISTERS                                            
-10 LEAVING FORTH                   STARTING FORTH P 50- 83          
-11 STARTING FORTH P110-112         STARTING FORTH P119-135          
-12 STARTING FORTH P137-143         STARTING FORTH P161-174          
-13 STARTING FORTH P177-247                                        
-14 X                                                              
-15 X                                                              
- 
- 
-Screen 12 not modified      
- 0 Screen Viewing Help                                              
-                                                                  
- 2 L               Lists current screen                             
- 3 B L             Lists previous screen                            
- 4 N L             Lists next screen                                
- 5 A L             Lists the shadow screen                          
-                                                                  
- 7 n LIST          Lists screen n                                   
- 8 n BROWSE        Use editor to browse screens                     
-                                                                  
-10 n1 n2 INDEX     Lists the first line of screens n1 thru n2       
-11                                                                  
-12 VIEW {word}     Browse the source definition for {word}          
-13                                                                  
-14                                                                  
-15                                                                  
- 
- 
-Screen 13 not modified      
- 0 Printer and word viewing help                                    
-                                                                  
- 2 PRINTING ON             Send output to printer, make sure its on 
- 3 PRINTING OFF            Send output to screen only               
-                                                                  
- 5 WORDS                   List words in the context vocabulary.    
-                                                                  
- 7 ONLY FORTH WORDS        Lists all words in FORTH                 
-                                                                  
- 9 ONLY EDITOR WORDS       Lists all words in EDITOR                
-10                                                                  
-11                                                                  
-12                                                                  
-13                                                                  
-14                                                                  
-15                                                                  
- 
- 
-Screen 14 not modified      
- 0 NUMBER DISPLAYING WORDS                                          
-    Single signed 16bit numbers      -32768  - 32767              
-    .    ( n   -- )    Display signed 16bit # followed by space.  
-    .R   ( n w  -- )   Display # right justified in w wide field. 
-                                                                  
- 5 Single unsigned 16bit numbers.      0  - 65535                   
-    U.   ( u  -- )     Display unsigned 16bit # followed by space 
-    U.R  ( u w   -- )  Display # right justified in w wide field  
-                                                                  
- 9 Double signed 32bit numbers   -2,147,483,648  - 2,147,483,647    
-10    D.   ( d  -- )     Display signed 32bit # followed by a space 
-11    D.R  ( d w   -- )  Display # right justified in w wide field  
-12                                                                  
-13 Double unsigned 32bit numbers.      0  - 4,294,967,296           
-14    UD.   ( ud  -- )   Display unsigned 32bit # followed by space 
-15    UD.R  ( ud w  -- ) Display # right justified in w wide field  
- 
- 
-Screen 15 not modified      
- 0 \COLD FORGET  EMPTY  BYE                                         
-                                                                  
-                                                                  
-                                                                  
-                                                                  
-    FORGET <name>   Remove <name> and all following words         
-                    from the dictionary.                          
-                                                                  
-                                                                  
-    EMPTY           Remove all new words added since this         
-10                    session started                               
-11                                                                  
-12                                                                  
-13    BYE             Exit Forth and return to DOS                  
-14                                                                  
-15                                                                  
- 
- 
-Screen 16 not modified      
- 0 HEX AND DECIMAL                                                  
-                                                                  
-                                                                  
-         HEX     ( --   -- ) Set the system number BASE to 16     
-                                                                  
-         DECIMAL ( --   -- ) Set the system number BASE to 10     
-                                                                  
-         You could also add the following words to your system.   
-                                                                  
- 9 : OCTAL ( --  -- )  \ Set system number base to 8.               
-10         8 BASE ! ;                                               
-11                                                                  
-12 : BINARY ( --  -- )  \ Set system number base to 2.              
-13         2 BASE ! ;                                               
-14                                                                  
-15                                                                  
- 
- 
-Screen 17 not modified      
- 0 CONDITIONALS                                                     
-         tf = 1111111111111111  binary or base 2                  
-         ff = 0000000000000000  binary or base 2                  
-     TRUE   ( --   tf )    Leave true flag on top of the stack    
-     FALSE  ( --   ff )    Leave false flag on top of the stack   
-    =    ( n m  flag )     Leave tf if n = m , otherwise ff       
-    <>   ( n m  flag )     Leave tf if n<> m , otherwise ff       
-    <    ( n m  flag )     Leave tf if n < m , otherwise ff       
-    >    ( n m  flag )     Leave tf if n > m , otherwise ff       
-                                                                  
-10    0=   ( n    flag )     Leave tf if n = 0 , otherwise ff       
-11    0<>  ( n    flag )     Leave tf if n<> 0 , otherwise ff       
-12    0 <  ( n    flag )     Leave tf if n < 0 , otherwise ff       
-13    0 >  ( n    flag )     Leave tf if n > 0 , otherwise ff       
-14    ?DUP ( n    n (n))     Duplicate n if n is non zero           
-15    NOTE IF TRIGGERS ON ZERO                                      
- 
- 
-Screen 18 not modified      
- 0 MORE CONDITIONALS                                                
-                 NOTE THESE OPERATORS WORK AT THE BINARY LEVEL    
-                                                                  
-    AND  ( f1 f2   flag ) Leave tf only if f1 and f2 are true     
-                                                                  
-    OR   ( f1 f2   flag ) Leave tf if either f1 or f2 are true    
-                                                                  
-    XOR  ( f1 f2   flag ) Leave tf if f1=tf or f2=tf but not both 
-                                                                  
-    NOT  ( f1  not-flag ) Reverse the flag f1                     
-10 NOTE : Starting FORTH  NOT is the same as F83  0=                
-11        Starting FORTH  NOT is different than F83 NOT             
-12        F83 NOT operates on each of a numbers 16 bits             
-13        F83 NOT leaves a false flag ( zero ) only if it           
-14        operates on a true flag -1111111111111111 binary          
-15        F83 NOT is not the same as 0=                             
- 
- 
-Screen 19 not modified      
- 0 SCREEN EDITING                                                   
-                                                                  
-        FILE?      Display current screen file                    
-        DEFAULT    Revert to default screen file                  
-                   used when FORTH was started                    
-                                                                  
-        OPEN <name>.BLK   Open an existing screen file            
-                                                                  
-        CREATE-FILE <name>.BLK  ( n )                             
-                   Create a new screen file <name>.BLK            
-10                   with  n  blank screens                         
-11         MORE      Add  n  blank screens to the end of            
-12                   the current screen file                        
-13         CAPACITY  Leave number of screens in the current         
-14                   screen file                                    
-15                                                                  
- 
- 
-Screen 20 not modified      
- 0 STAR-SLASH THE SCALAR                                            
-                                                                  
-     */   ( a b c   ab/c )  Perform multiplication and then       
-     division. Star-slash multiplies 16bit a  and  b  to form     
-     a 32bit intermediate result which is then divided by 16bit   
-      to give a 16bit result. The 32bit intermediate product    
-     ensures accurate results when multipying by fractions.       
-                                                                  
-                                                                  
-                                                                  
-10                                                                  
-11                                                                  
-12                                                                  
-13                                                                  
-14                                                                  
-15                                                                  
- 
- 
-Screen 21 not modified      
- 0 INFINITE LOOPS                                                   
-                                                                  
-         The infinite loop with no exit. This is recommended      
-         only for an end user application.                        
-                                                                  
-           ... (step 1)   BEGIN   (step 2)  AGAIN  (step 3) ...   
-                                                                  
-         step 1 is executed once; step 2 is repeated forever.     
-         Note: step 3 is never executed.                          
-                                                                  
-10                                                                  
-11                                                                  
-12                                                                  
-13                                                                  
-14                                                                  
-15                                                                  
- 
- 
-Screen 22 not modified      
- 0 INDEFINITE LOOPS                                                 
-                                                                  
-         In the indefinite loop the main action is repeated       
-         until a condition is true. Step 1 is executed once,      
-         step 2 is executed and (condition) is tested. If         
-         condition is false step 2 is executed again, if          
-         condition is true then step 3 is executed. Note          
-         that step 3 following the loop will be executed          
-         when loop is exited .                                    
-                                                                  
-10                                                                  
-11               ... (step 1)   BEGIN   (step 2)                    
-12                                      (condition)                 
-13                              UNTIL   (step 3)   ...              
-14                                                                  
-15                                                                  
- 
- 
-Screen 23 not modified      
- 0 ANOTHER LOOP                                                     
-                                                                  
-         Indefinite loop - another form                           
-         In this form step 1 is executed once. Step 2 is          
-         executed if condition is true do step 3 and repeat       
-         starting with step 2 if condition is false leave loop    
-         and do step 4.                                           
-                                                                  
-         ... (step 1)   BEGIN   (step 2)                          
-                                (condition)                       
-10                        WHILE   (step 3)                          
-11                        REPEAT  (step 4)  ...                     
-12                                                                  
-13                                                                  
-14                                                                  
-15                                                                  
- 
- 
-Screen 24 not modified      
- 0 LEAVING LOOPS EARLY                                              
- 1 Execute step 1. Repeat loop executing step 2 and step 4 on each  
- 2 pass - except that if condition is true before loop is finished  
- 3 execute step 3 and leave loop to execute step 5. Note step 4     
- 4 will not be executedif we leave the loop early.                  
-                                                                  
-    ...     (step 1)   DO     (step 2)                            
-                              (condition) IF (step 3) LEAVE THEN  
-                              (step 4)                            
-                       LOOP   (step 5)   ...                      
-10 This is an alternative form if step 3 is not required.           
-11    ...     (step 1)   DO     (step 2)                            
-12                              (condition)  ?LEAVE                 
-13                              (step 4)                            
-14                       LOOP   (step 5)   ...                      
-15 NOTE:EXIT CANNOT BE USED IN DO LOOPS -IT RUINS THE RETURN STACK  
- 
- 
-Screen 25 not modified      
- 0 BASIC STACK OPERATORS                                            
-    DROP  ( n   -- )      Drop top number on data stack           
-    SWAP  ( n m   m n )   Swap top two numbers on data stack      
-    DUP   ( n  n n )      Duplicate top number on data stack      
-    OVER  ( n m   n m n ) Make copy of second item to top of      
-    ROT   ( a b c b c a ) Rotate third item to the top of stack   
-   -ROT   ( a b c c a b ) Rotate in opposite direction            
-    PICK  ( ? n  ? nth  ) Copy nth item to top of stack (0 based) 
-    ROLL  ( ? n  ? nth  ) Rotate nth item to top (0 based)        
-    NIP   ( n m   m )     Discard second item on data stack       
-10    TUCK  ( n m   m n m ) Push copy of top under second item      
-11    3DUP  ( a b c  a b c a b c )   Make a copy of the top 3 items 
-12    2DROP ( dn   -- )     Drop double number from the top         
-13    2SWAP ( dn dm   dm dn ) Swap the top two double numbers       
-14    2DUP  ( dn   dn dn )  Make another copy of top double number  
-15    2OVER ( dn dm   dn dm dn ) Copy second double number to top   
- 
- 
-Screen 26 not modified      
- 0 FURTHER STACK OPERATORS                                          
-         1+      Increment top stack item by                      
-                                                                  
-         2+      Increment top stack iten by 2                    
-                                                                  
-         1-      Decrement top stack item by 1                    
-                                                                  
-         2-      Decrement top stack item by 2                    
-                                                                  
-         2*      Multiply  top stack item by 2                    
-10                                                                  
-11         2/      Divide    top stack item by 2                    
-12                                                                  
-13         ABS     Replace top item by its absolute value           
-14                                                                  
-15         NEGATE  Negate top stack item                            
- 
- 
-Screen 27 not modified      
- 0 RETURN STACK                                                     
-  >R  R> and  R@ are for accessing the return stack.These words   
- 2 are very dangerous!!. Do NOT test or execut them interactively.  
- 3 They can only be used within colon definitions.                  
-   Note: D) indicates data stack,  R) indicates return stack.     
- 5 Transfer top data stack item to return stack.                    
-         >  ( n   -- D )   ( --   n R )                         
- 7 Transfer top return stack item to data stack.                    
-         R>   ( --   n D )   ( n   -- R )                         
- 9 Copy top return stack item to data stack.                        
-10         R@   ( --   n D )   ( n    n R )                         
-11                                                                  
-12 RULES:                                                           
-13  1. Each use of >R must be balanced with a corresponding R>    
-14  2. Do not use >R R> and R@ within DO ... LOOPS. Loop control    
-15     info is kept on the return stack and could be destroyed.     
- 
- 
-Screen 28 not modified      
- 0 VIRTUAL MEMORY                                                   
- 1 F83 virtual memory operates as follows:                          
- 2 The current file open on the mass storage is divided into        
- 3 consecutive blocks. The block is the basic unit of storage.      
- 4 Each block holds 1024 bytes. Blocks are numbered consecutively   
- 5 starting with block 0 at the beggining of the file. On the mass  
- 6 storage device (disk or hard disk) the only limit to the number  
- 7 of blocks in a file is the capacity of the mass storage device.  
-                                                                  
- 9 In the ram memory of the computer there is an area reserved for  
-10 disk buffers. One disk buffer will hold 1024 bytes. In F83 there 
-11 are 4 disk buffers. Thus in the computers ram memory there can   
-12 only be 4 blocks at any one time. FORTH's virtual memory system  
-13 keeps track of which blocks are in ram memory and which blocks   
-14 are on the mass storage device. This housekeeping is transparent 
-15 to the user.                                                     
- 
- 
-Screen 29 not modified      
- 0 BLOCK AND UPDATE                                                 
-                                                                  
-                                                                  
- 3 BLOCK  ( n   adr )  Given the block number n, BLOCK returns      
-        the address, adr, of the assigned block buffer. The       
-        buffer address, adr, is the loaction of the first data    
-        storage cell of the buffer, which consists if 1024 bytes. 
-                                                                  
-                                                                  
- 9 UPDATE ( --   -- )  Mark most recently referenced block as       
-10        modified. Then if it's block buffer is required it will   
-11        automatically be transfered back to mass storage.         
-12                                                                  
-13                                                                  
-14                                                                  
-15                                                                  
- 
- 
-Screen 30 not modified      
- 0 MEMORY OPERATORS                                                 
-   DUMP  ( adr n   -- ) Dump n bytes of memory starting at adr.   
-   ERASE ( adr n   -- ) Erase n bytes of memory starting at       
-                        adr to zeros.                             
-   FILL ( adr n m  -- ) Fill n bytes of memory starting at adr    
-                        with low 8 bits of m  ( 0 - 255 ).        
-                                                                  
-      ( n adr   -- )  STORE 16 bit value at address adr.        
-      ( adr      )  FETCH 16 bit value at adr and leave as n. 
-                                                                  
-10 NOTE: 16 BIT NUMBERS ARE STORED WITH THE LOW BYTE AT adr AND THE 
-11       HIGH BYTE AT adr+1 ( THIS IS THE CONVENTION FOR 6502 AND   
-12       8086 CPUs - THE 68000 IS NORMAL ).                         
-13   C!   ( n adr   -- )  Store low 8 bits of n at address adr.     
-14   C@   ( adr      )  Fetch 8 bit value at adr and leave as n.  
-15   ?    ( adr     -- )  Display contents of cell at adr.          
- 
- 
-Screen 31 not modified      
- 0 MORE MEMORY OPERATORS                                            
-        NOTE : cell = 2 bytes = 16 bits = 1 word                  
-    +!   ( n adr  -- ) Add n to the value found at address adr.   
-    ON   ( adr    -- ) Set cell at adr to true or -1              
-    OFF  ( adr    -- ) Set cell at adr to false or 0              
-                                                                  
- 6 CREATE (name) (-- --) Creates a dictionary entry named <named>   
-                       when executed,<name> leaves the address    
- 8 <name>  ( --    adr ) of the first memory cell which follows     
-                       the word name. No memory is allocated.     
-10 ALLOT   ( n      -- ) Allocate n bytes of memory in the          
-11                       dictionary.                                
-12    ,    ( n      -- ) Allocate 16 bits ( 2 bytes ) of memory     
-13                       initializing it to the value n.            
-14   C,    ( n      -- ) Allocate 8 bits ( 1 byte ) of memory       
-15                       initializing it to low 8 bits of n.        
- 
- 
-Screen 32 not modified      
- 0 WORD DEFINITION STRUCTURE                                        
-                                                                  
-                                                                  
-              | 4bits    12 bits                              
-    vfa   ->  | File #  |  Block #       View Field             
-    lfa   ->  | Link address             Link Field             
-    nfa   ->               | 1PScount  |   Name Field count=5bits 
-                           | 0 char    |                          
-                           | 0 char    |   char = 7bits           
-                           | 0 char    |                          
-10                           | 1 char    |                          
-11    cfa   ->  | Addr Inner Interpr.    |   Code field             
-12    pfa   ->  | Parameter List           Parameter Field        
-13              |    .  .    .           Also called the        
-14              |    .  .    .           BODY of the word       
-15              |    .  .    .           definition             
- 
- 
-Screen 33 not modified      
- 0 VOCABULARY:ROOT:ONLY                                             
-                                                                  
-   VOCABULARY  {name}  ( --   -- )                                
-   A dictionary entery for  {name}  is created which specifies a  
-   new list of word definitions. Subsequent execution of  {name}  
-   replaces the first vocabulary in the current search order with 
-   {name} . When name becomes the compilation vocabulary new      
-   definitions will be appended to  {names}'s word list.          
-                                                                  
-   ROOT  ( --   -- )                                              
-10   A small vocabulary for controlling search order.               
-11                                                                  
-12   ONLY  ( --   -- )                                              
-13   Erases the search order and forces the ROOT vocabulary to be   
-14   first and last.                                                
-15                                                                  
- 
- 
-Screen 34 not modified      
- 0 DIVISION                                                         
-                                                                  
-              Floored symetric division                           
-                                                                  
-              Note that q and r must satisfy the equation.        
-                                                                  
-                        m/n = q + r/n                             
-                                                                  
-                or      m = nq + r                                
-                                                                  
-10         /   ( m n   q )  Leave q  ,the floor of real quotient    
-11                                                                  
-12         MOD ( m n   r )  Leave r  ,remainder (satisfying above)  
-13                                                                  
-14         /MOD (m n   r q ) Leave remainder r and quotient q       
-15                                                                  
- 
- 
-Screen 35 not modified      
- 0 STRINGS                                                          
- 1 A counted string in memory is    |05|48|45|4C|4C|4F|  <-hex-<    
- 2 preceded by character count.     |05| H| E| L| L| O|             
-                                                                  
- 4 ," {text}"  ( --   -- )  ONLY USE OUTSIDE A WORD DEFINITION      
- 5 Compile a counted {text} string into dictionary. Do not use in   
- 6 a word definition!!  SYSTEM WILL CRASH.                          
-                                                                  
- 8 " {text}" ( --   adr count )  ONLY USE WITHIN A WORD DEFINITION  
- 9 Compile a counted string into a word definition. When word is    
-10 later executed the address and count are returned.               
-11                                                                  
-12 Examples:                                                        
-13 CREATE NAME$ ," GEORGE SMITH"                                    
-14 : JOB$  " FORTH Progammer" ;                                     
-15                                                                
- 
- 
-Screen 36 not modified      
- 0 STRING COUNT TYPE EXPECT                                         
- 1 COUNT  ( adr   adr+1 n )                                         
-      If adr points to a counted string, COUNT will fetch the     
-      character count an increment adr to point to first          
-      character. Count is often used to fetch succesive           
-      characters of a string.                                     
-                                                                  
- 7 TYPE   ( adr n  -- )  Type n characters of a string at adr.      
-                                                                  
- 9 FILL   ( adr   n c )  Fill string at adr with n copies of c.     
-10                                                                  
-11 ERASE  ( adr  n )     Fill string at adr with n null's or 0'   
-12                                                                  
-13 EXPECT ( adr  n )  Input a string of length n  to beffer at adr. 
-14 Actual number of characters entered is stored in a variable      
-15 called SPAN .NOTE: EXPECT does not return a counted string.      
- 
- 
-Screen 37 not modified      
- 0 MOVING STRINGS                                                   
-                                                                  
-    CMOVE    ( adrf adrt   n -- )      Use when adrf > adrt       
- 3 Move n bytes from adrf to adrt. Left-most or low memory bytes    
- 4 are moved first. ( ie Move starts at begginning of string. )     
- 5 Use  CMOVE  to move strings down to lower memory.                
-                                                                  
-    CMOVE>   ( adrf adrt   n -- )      Use when adrf < adrt       
- 8 Move n bytes from adrf to adrt. Right-most or high memory bytes  
- 9 are moved first. ( ie Move starts at end of string. )            
-10 Use  CMOVE> to move strings up to a higher memory.               
-11                                                                  
-12    MOVE     ( adrf adrt   n -- )                                 
-13 Move n bytes from adrf to adrt. If adrf < adrt use CMOVE>        
-14 otherwise use CMOVE. this will prevent overlap.                  
-15 Use MOVE when you can't remember wether to use CMOVE or CMOVE> 
- 
- 
-Screen 38 not modified      
- 0 BUFFER                                                           
- 1 BUFFER  ( n  adr ) Assign block n the buffer storage area at     
-       adr . The function is the same as for BLOCK except         
-       that the contents of the data storage area are undefined   
-       That is . . . The buffer is assigned only and if the       
-       block is not already in memory its contents might not be   
-       transferred from mass storage. Not often used.             
-                                                                  
- 8 EMPTY-BUFFERS ( --   -- ) Erase all data in block buffers,       
-       initialize buffer pointers and mark buffers as empty.      
-10                                                                  
-11 SAVE-BUFFERS  ( --   -- ) Transfer all buffers marked as         
-12       updated to mass storage and then mark them as unmodified.  
-13                                                                  
-14 FLUSH         ( --   -- ) Same effect as SAVE-BUFFERS followed   
-15       by EMPTY-BUFFERS                                           
- 
- 
-Screen 39 not modified      
- 0 HIDE:REVEAL:IMMEDIATE                                            
-                                                                  
- 2 HIDE        Unlink most latest word from dictionary.             
-                                                                  
- 4 REVEAL      Link the latest word inti the dictionary.            
-                                                                  
- 6 IMMEDIATE   Set precedence bit so latest word is executed        
-             during compilation instead of being compiled.        
-                                                                  
- 9 ['] {word}  This is an IMMEDIATE word used within a definition   
-10             It is used to compile the cfa of the following word  
-11             as a LITERAL or number. It is equivalent to the      
-12             sequence                                             
-13                                                                  
-14 [ ' {word} ] LITERAL                                             
-15                                                                  
- 
- 
-Screen 40 not modified      
- 0 NUMBER FORMATING                                                 
-                                                                  
- 2 PAD  ( --   adr )  Return address for string output buffer.      
- 3 HLD  ( --   adr )  Pointer to current loacation in output buffer 
- 4 HOLD ( --   adr )  Add character n to string being formed.       
- 5 SIGN ( n    --  )  If n is negative insert a -ve sign in the     
-                    output string. This is different from BRODIE. 
-                                                                  
-  <#  ( dn   dn  )  Start number formating  ( pad hld ! )         
-                    dn, the number to be formated , is not used   
-10                    <# but is usually present.                    
-11  #   ( dn   dn' )  Convert one digit of dn using current number  
-12                    BASE and remaining digits as dn' .            
-13  #S  ( dn   dn' )  Convert a number until finished. When         
-14                    conversion is finished dn' will be zero.      
-15  #>  ( dn   adr len )  Terminate numeric conversion.             
- 
- 
-Screen 41 not modified      
- 0 CASE STATEMENT                                                   
- 1 CASE ... OF ... ENDOF ... ENDCASE                                
- 2 CASE     causes an index value to be compared to a series        
- 3 OF       values. Any number of OF .. ENDOF pairs may be used.    
- 4 OF       is equivalent to OVER = IF DROP                         
- 5 ENDOF    is equivalent to else                                   
- 6 ENDCASE  is equivalent to DROP and number of THENs               
- 7 When the index value equals one of the OF values,the sequence    
- 8 between that OF and the corresponding ENDOF is executed.         
- 9 Control then branches to the word following ENDCASE.             
-10 If no match is found, ENDCASE drops the index from the stack.    
-11                                                                  
-12 The "otherwise" case may be handled by a sequence placed between 
-13 the last ENDOF and ENDCASE. The index value must however be      
-14 preserved across this otherwise sequence so that ENDCASE may     
-15 DROP it.                                                         
- 
- 
-Screen 42 not modified      
- 0 VARIABLES AND CONSTANTS                                          
- 1 Values which change quite frequently and must be accessed by a   
- 2 number of words are best represented by the use of  VARIABLES.   
- 3 Values represented by variables have the added convenience of    
- 4 reference by name.                                               
-                                                                  
-      VARIABLE <name> (--  -- )   Create 16bit data storage       
-                                  called <name>                   
-      <name>          (--  adr )  Leave storage address of <name> 
-                                                                  
-10 Values which never change are best represented by CONSTANTs      
-11                                                                  
-12      CONSTANT <name> ( n  -- )   Create a constant  <name>       
-13                                  whose value is  n.              
-14      <name>          ( --  n )   Leave value of <name> on stack  
-15                                                                  
- 
- 
-Screen 43 not modified      
- 0 MORE VARIABLES AND CONSTANTS                                     
-                                                                  
-   2VARIABLE <name>      Creates a 2 cell ( 4 byte ) variable     
-                         called <name>                          
-                                                                  
-   <name>   ( --   adr ) When <name> is executed it will push     
-                         the address of the first cell onto the   
-                         stack.                                   
-                                                                  
-   2CONSTANT <name>      Creates a double constant called <name>  
-10             ( --    d ) When <name> is executed the double       
-11                         number is pushed onto the data stack.    
-12                                                                  
-13   2!      ( d adr  -- ) Store the double number d at adr.        
-14                                                                  
-15   2@      ( adr     d ) Fetch the double number d from adr.      
- 
- 
-Screen 44 not modified      
- 0 MULTITASKING                                                     
- 1 Multitasking allows one computer to appear to do several things  
- 2 at the same time. Most of the time a single user computer sits   
- 3 in an idle loop waiting for the operator to press the keyboard.  
-                                                                  
- 5 The idea is to utilize this waiting time to perform other useful 
- 6 tasks. Typical background tasks would be watching over           
- 7 instruments in the lab,printing a long file,updating a clock etc 
-                                                                  
- 9 F83 uses a very simple yet effective round-robin scheduling      
-10 technique. Task switching is extremely fast because each task    
-11 maintains its own parameter and return stacks and its own set    
-12 of critical variables (called USER variables ) .                 
-13                                                                  
-14 The task switcher just changes the pointer to the correct list   
-15 of USER variables.                                               
- 
- 
-Screen 45 not modified      
- 0 TASK DEPENDENT USER VARIABLES                                    
- 1 The following USER variables are needed in every task.           
- 2 TOS       Saved during Task switching.                           
- 3 ENTRY     Jumped to during multitasking.                         
- 4 LINK      Points to next task in the circular queue.             
- 5 SP0       Empty parameter stack for this task.                   
- 6 RPO       Empty return stack for this task.                      
- 7 DP        Size of dictionary. Next available location.           
- 8 #OUT      Number of characters sent since last CR.               
- 9 #LINE     Number of CR's sent since last page.                   
-10 OFFSET    Added to all block references.                         
-11 BASE      The current numeric base for number input output.      
-12 HLD       Points to a converted character during numeric output. 
-13 FILE      Allows printing of one file while editing another.     
-14 IN-FILE   Allows printing of one file while editing another.     
-15 PRINTING  Indicates wether printing is enabled.                  
- 
- 
-Screen 46 not modified      
- 0 PAUSE RESTART                                                    
-                                                                  
- 2 PAUSE   When multitasking PAUSE stops the current task and       
-         passes control to the next task in the round robin.      
-                                                                  
-         When singletasking PAUSE is equivalent to a NOOP.        
-                                                                  
- 7 RESTART When multitasking RESTART does the reverse of PAUSE.     
-         It restores critical information stored in task user     
-         variables and starts executing the task left asleep      
-10         during the last pass.                                    
-11                                                                  
-12                                                                  
-13                                                                  
-14                                                                  
-15                                                                  
- 
- 
-Screen 47 not modified      
- 0 SLEEP WAKE STOP                                                  
-                                                                  
-                                                                  
- 3 SLEEP  ( adr   -- ) Used in the form:   {taskname} SLEEP         
-        Make the addressed task pause indefinitely.               
-                                                                  
- 6 WAKE   ( adr   -- ) Used in the form:   {taskname} WAKE          
-        Wake up task so that it will execute the next time round. 
-                                                                  
- 9 STOP   ( --    -- ) Make the current task pause indefinitely.    
-10                                                                  
-11                                                                  
-12                                                                  
-13                                                                  
-14                                                                  
-15                                                                  
- 
- 
-Screen 48 not modified      
- 0 MULTI SINGLE                                                     
-                                                                  
-                                                                  
- 3 MULTI   Start the multitasker. This is done by installing the    
-         the sheduler/dispatcher loop and activating PAUSE.       
-                                                                  
- 6 SINGLE  Stop multitasking. This is done by removing the          
-         sheduler/dispatcher loop and restoring PAUSE to          
-         its NOOP function.                                       
-                                                                  
-10                                                                  
-11                                                                  
-12                                                                  
-13                                                                  
-14                                                                  
-15                                                                  
- 
- 
- 
-Screen 53 not modified      
- 0 \ Hard copy screen documentation.              11:23JWB11/23/85  
-                                                                  
- 2 \ Print three screens starting with n on the printer.            
- 3 : HTRIAD  ( n   -- )                                             
-         PRINTING ON                DUP 3 +  SWAP                 
-       ( 27 EMIT ASCII E EMIT  ) CONTROL N EMIT                   
-         DO CR I LIST LOOP  ( 27 EMIT ASCII F EMIT )              
-         CONTROL O EMIT  PRINTING OFF ;                           
-                                                                  
- 9 \ Send a top of page command to printer.                         
-10 : FFEED                                                          
-11         PRINTING ON 12 EMIT PRINTING OFF ;                       
-12                                                                  
-13 \ Print screens  first through last  on printer, three per page. 
-14 : DOC   ( first last   -- )                                      
-15         1+ SWAP DO I HTRIAD FFEED 3 +LOOP ;                      
- 
- 
- 
- 
-Screen 64 not modified      
- 0 \ Notes on Starting Forth. 1                   14:09JWB01/09/86  
- 1 \ P 50    Replace 'S with SP@ or define  : '  SP@ ;            
- 2 \         Replace S0 with SP0 or define  : S0   SP0 ;            
- 3 \  Because FORTH83 loops work differently you should use:        
-         : .S CR  SP@ SP0 @ 2DUP <>                               
-              IF   2- DO I  @ . -2 +LOOP                          
-              ELSE 2DROP ." EMPTY" THEN   ;                       
- 7 \ Or  just use .S  that is already part of your system.          
-                                                                  
- 9 \ P 66-72  Use:    n  VEDIT     to edit screen n .               
-10 \ The original F83.COM fill supports the STARTING FORTH style    
-11 \ editor.   Go back to DOS and type  F83  <name>.BLK  to try it. 
-12 \ P 83  See notes for P 50 above.  Also VIEW  .S  to see how     
-13 \        the F83 version is implemented.                         
-14                                                                  
-15                                                                  
- 
- 
-Screen 65 not modified      
- 0 \ Notes on Starting Forth. 2                   17:12JWB09/22/85  
- 1 \ P 110 In F83 I J and K are used only within loops to fetch     
- 2 \       the current values of the loop counters.  Use  R@        
- 3 \       instead of I to fetch a copy of the top of the return    
- 4 \       stack to the parameter stack without changing the        
- 5 \       return stack.                                            
- 6 \       Use the sequence:  R> R@ SWAP >R  within a definition    
- 7 \       instead of I' to fetch  a copy of the second item on     
- 8 \       the return stack.  Or use the definition:                
- 9 : 2R@   R> R> R@ -ROT >R >R ;                                    
-10 \       Use 2R@  for I' .   I' is a poor name!!                  
-11 \       WARNING!  It is dangerous to mess with the return stack. 
-12 \ P112  Use  R@  instead of I  ,  also a dot  .  was ommited     
-13 \       from the definition of QUADRATIC.   See below.           
-14 : QUADRATIC     ( a b c x   n )                                  
-15         >R SWAP ROT R@ * + R> * + .  ;                           
- 
- 
-Screen 66 not modified      
- 0 \ Notes on Starting Forth. 3                   17:13JWB09/22/85  
- 1 \ P 119 Error in footnote!                                       
- 2 : R%  50 */ 1+ 2/ ;                                              
- 3 \ P 123 I I' and J  see comments for page 110.                   
- 4 \ P 131 For COMPOUND to display as in text  insert a   CR        
- 5 \       before  SWAP .  ie  : COMPOUND  CR SWAP 21 0 DO  etc     
- 6 \ P 135 There is an error in TEST -  should be 10 10 DO  but     
- 7 \       even so . .   the FORTH83  DO .. LOOP is not like        
- 8 \       the one in Starting FORTH !!!!   Try the following       
- 9 : -TEST  DO I . ?KEY ?LEAVE ( any key exit ) -1 +LOOP ;          
-10 : +TEST  DO I . ?KEY ?LEAVE ( any key exit )  1 +LOOP ;          
-11 \  9 10 +TEST   loops 65534 times.  9 10 -TEST gives   10 9      
-12 \ 10 10 +TEST   loops 65535 times. 10 10 -TEST gives   10        
-13 \ 11 10 +TEST  gives  10           11 10 -TEST loops 65535 times 
-14 \ If you try any of the longer loops above press any key to      
-15 \ abort!!                                                        
- 
- 
-Screen 67 not modified      
- 0 \ Notes on Starting Forth. 4                   17:13JWB09/22/85  
- 1 \ P 137 XX will clear the stack as indicated but our definition  
- 2 \       : CLEAR  DEPTH 0 ?DO DROP LOOP ;  will do it without     
- 3 \       the error message.  An alternate definition of CLEAR is: 
- 4 : CLEAR  SP0 @ SP! ;                                             
- 5 \ P 140 In FORTH83  LEAVE causes an immediate exit from the      
- 6 \       DO ... LOOP  !!  Thus any words between LEAVE and LOOP   
- 7 \       will not be executed if the condition for leaving is     
- 8 \       is satisfied.  Try the following and note that  HELLO    
- 9 \       is not printed the last time.                            
-10 : HELLOS  10 1 DO CR I . I 5 = IF LEAVE THEN ." HELLO" LOOP ;    
-11 \       Note: ?LEAVE can replace the phrase  IF LEAVE THEN       
-12 \ P 142-143  Use CLEAR-SCREEN definition below instead of PAGE   
-13 : CLEAR-SCREEN  0 0 0 2 [ EDITOR ] VIDEO-IO 2DROP 2DROP ; FORTH  
-14                                                                  
-15                                                                  
- 
- 
-Screen 68 not modified      
- 0 \ Notes on Starting Forth. 5                   17:13JWB09/22/85  
- 1 \ P 161 In FORTH83  UM*     is the name for U*                   
- 2 \       and         UM/MOD  is the name for U/MOD                
- 3 \       In FORTH83  all loops are relative, use +LOOP for /LOOP  
- 4 \ P 164 Double number punctuation is  .  only!  not  ,           
- 5 \ P 166 Use the     for the  ,  in the double numbers!!!       
- 6 \ P 169 FORTH83   SIGN  uses the first number on the stack!!     
- 7 \       Whenever Brodie uses  SIGN  replace it with  ROT SIGN    
- 8 \ P 170 Replace   SIGN   with   ROT  SIGN                        
- 9 \       VIEW  D.  to see how F83  formats numbers.               
-10 \ P 172 Replace   SIGN   with   ROT  SIGN                        
-11 \ P 174 Use the definitions below:                               
-12 : M+    S>D D+ ;     : M/    M/MOD  NIP ;                        
-13 : M*/   2DUP XOR SWAP ABS >R SWAP ABS >R OVER XOR -ROT           
-14         DABS SWAP R@ UM* ROT R> UM* ROT 0 D+ R@ UM/MOD           
-15         -ROT R> UM/MOD NIP SWAP ROT ?DNEGATE ;                   
- 
- 
-Screen 69 not modified      
- 0 \ Notes on Starting Forth. 6                   17:28JWB09/22/85  
- 1 \ P 177 In FORTH83  use   UM*  for  U* and UM/MOD for U/MOD      
- 2 \       In FORTH83  use  +LOOP for /LOOP                         
- 3 \ P 178 Use  ROT SIGN where ever Brodie uses SIGN  !!            
- 4 \ P 202 Use CLEAR-SCREEN definition given earlier for  PAGE      
- 5 \ P 204 Use +LOOP  for /LOOP                                     
- 6 \ P 215 Type  VIEW  INTERPRET  for definition of our INTERPRET   
- 7 \ P 217 In F83  DEFER   is used for execution vectors.           
- 8 \ P 233 In F83  the variable H is called  DP                     
- 9 \ P 235-237  : ' SP@ ;                                         
-10 \ P 240 Use DP  instead of H  ;  No OFFSET in this system.       
-11 \ P 242 F83 Uses the ONLY vocabulary structure. See the FORTH-83 
-12 \       standard or wait till we discuss it in class.            
-13 \ P 247 Use DP  instead of H  .                                  
-14                                                                  
-15                                                                  
- 
-</code> 
papierkorb/help.blk.1755359401.txt.gz · Zuletzt geändert: 2025-08-16 17:50 von mka