papierkorb:sample7.blk
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| papierkorb:sample7.blk [2025-08-16 17:50] – ↷ Seite von projects:sample7.blk nach papierkorb:sample7.blk verschoben mka | papierkorb:sample7.blk [Unbekanntes Datum] (aktuell) – gelöscht - Externe Bearbeitung (Unbekanntes Datum) 127.0.0.1 | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | === Examples for lecture number seven. === | ||
| - | < | ||
| - | Screen 0 not modified | ||
| - | 0 \ Examples for lecture number seven. | ||
| - | 1 \ Last change: | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | Screen 1 not modified | ||
| - | 0 \ Load Screen for sample 7.blk | ||
| - | 1 \ Typing | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 2 not modified | ||
| - | 0 \ Suggested Projects - choose one. | ||
| - | 1 1 HELP SYSTEM - organize, rewrite and/or add to existing help | ||
| - | | ||
| - | | ||
| - | | ||
| - | 5 2 LINE EDITOR - finish detailed comments screens 51 -62. Modify | ||
| - | | ||
| - | | ||
| - | 8 3 FORTH BBS & TERMINAL PROGRAM - Sample term pgm is in FORTH DIM | ||
| - | | ||
| - | 10 | ||
| - | 11 4 FLOATING POINT MATH - add the transcendental functions, square | ||
| - | 12 root, etc to our simple floating point package. Detailed | ||
| - | 13 | ||
| - | 14 5 FAST FOURIER TRANSFORM and COMPLEX NUMBERS - Reference | ||
| - | 15 DDJ V9 N9 Sept 1984 page34, I have some of the source on disk. | ||
| - | |||
| - | |||
| - | Screen 3 not modified | ||
| - | 0 \ Review-1 Star-slash the scaler. | ||
| - | 1 \ */ ( a b c ab/c ) | ||
| - | 2 \ Perform multiplication and then division. | ||
| - | 3 \ Star-slash multiplies 16bit a and 16bit b to form a 32bit | ||
| - | 4 \ intermediate result which is then divided by 16bit c to give a | ||
| - | 5 \ 16bit result. | ||
| - | 6 \ results when multiplying by fractions. | ||
| - | | ||
| - | 8 \ We use */ to multiply a by the fraction b/c | ||
| - | 9 \ Examples: | ||
| - | 10 \ 32-bit intermediate product results in correct answer. | ||
| - | 11 \ 15000 | ||
| - | 12 | ||
| - | 13 \ 16-bit intermediate product results in overflow and the | ||
| - | 14 \ 15000 | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 4 not modified | ||
| - | 0 \ Review-2 Star slash mod, Rounding Fracti | ||
| - | 1 \ */MOD ( a b c r q ) | ||
| - | 2 \ Compute ab/c with 32bit intermediate product ab and leave | ||
| - | 3 \ quotient q and remainder r . Note: Forth-83 */MOD uses | ||
| - | 4 \ signed values | ||
| - | | ||
| - | 6 \ Rounding calculations that involve division. | ||
| - | 7 : %R1 10 */ 5 + 10 / . ; | ||
| - | 8 : %R2 50 */ | ||
| - | 9 : %R3 100 */MOD SWAP 50 + 100 / + | ||
| - | 10 : %R4 100 */MOD SWAP 49 > NEGATE + | ||
| - | 11 | ||
| - | 12 \ Fractions: | ||
| - | 13 : *PI | ||
| - | 14 : *SQRT(2) | ||
| - | 15 : *E 28667 10546 */ ; | ||
| - | |||
| - | |||
| - | Screen 5 not modified | ||
| - | 0 \ Review-3 Timer module. | ||
| - | 1 \ Return current time in ticks (18.2/sec) as a double integer. | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 CX PUSH \ Push high 16 bits of double number. | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 \ Save current time in ticks. | ||
| - | 15 : !TIMER ( -- -- ) @TICKS TICKS 2! ; : TIME ; | ||
| - | |||
| - | |||
| - | Screen 6 not modified | ||
| - | 0 \ Review-2 Timing Template. | ||
| - | | ||
| - | 2 \ Fetch elapsed time in ticks. | ||
| - | 3 : @TIMER | ||
| - | | ||
| - | | ||
| - | 6 \ @TIMER gives time in ticks, 18.2 ticks/sec so if we perform | ||
| - | 7 \ 1000 passes we can get count in micro-secs for one pass. | ||
| - | | ||
| - | 9 : TIME.IT | ||
| - | 10 !TIMER 1000 | ||
| - | 11 DO TUCK | ||
| - | 12 @TIMER DROP CR | ||
| - | 13 5000 91 */ . 230 EMIT ." -seconds for one pass." ; | ||
| - | 14 | ||
| - | 15 : TEST CR 5 0 DO TIME.IT LOOP ; | ||
| - | |||
| - | |||
| - | Screen 7 not modified | ||
| - | 0 \ Review-5 Infinite & indefinite Loops | ||
| - | 1 The infinite loop with no exit. | ||
| - | | ||
| - | | ||
| - | | ||
| - | 5 The infinite loop with EXIT escape hatch. | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 AGAIN (s4) ... | ||
| - | 11 Indefinite Loops | ||
| - | 12 | ||
| - | 13 ... (s1) BEGIN | ||
| - | 14 (condition) | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 8 not modified | ||
| - | 0 \ Review-6 Indefinite Loops 15: | ||
| - | | ||
| - | 2 \ ... (s1) BEGIN (s2) | ||
| - | 3 \ | ||
| - | 4 \ WHILE (s3) | ||
| - | 5 \ REPEAT (s4) ... | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 9 not modified | ||
| - | 0 \ Review-7 Loops | ||
| - | 1 \ ... (s1) l i | ||
| - | 2 \ ... (s1) l i | ||
| - | 3 \ ... (s1) l i ?DO (s2) LOOP (s3) ... | ||
| - | 4 \ ... (s1) l i ?DO (s2) n +LOOP (s3) ... | ||
| - | 5 \ Leaving Loops early. | ||
| - | 6 \ | ||
| - | 7 \ | ||
| - | 8 \ | ||
| - | 9 \ | ||
| - | 10 \ This is an alternative form if step 3 is not required. | ||
| - | 11 \ | ||
| - | 12 \ | ||
| - | 13 \ | ||
| - | 14 \ | ||
| - | 15 \ | ||
| - | |||
| - | |||
| - | Screen 10 not modified | ||
| - | 0 \ [IN] .ASCII | ||
| - | 1 \ Leave true flag if a <= x <= b . | ||
| - | 2 : [IN] ( x a b f ) 1+ -ROT 1- OVER < -ROT > AND ; | ||
| - | | ||
| - | 4 : .ASCII ( n -- ) \ EMIT n as printable ascii or a space. | ||
| - | | ||
| - | 6 \ Double space if i is equal to 8 . | ||
| - | 7 : ?SPACE ( i -- ) 8 = IF SPACE SPACE THEN ; | ||
| - | 8 \ Print byte right justified in field w wide. | ||
| - | 9 : .RBYTE ( n w -- ) | ||
| - | 10 >R 0 <# # # #> R> OVER - SPACES TYPE ; | ||
| - | 11 \ Based on address adr , display heading for VERIFY | ||
| - | 12 : HEAD ( adr -- ) | ||
| - | 13 CR 5 SPACES 16 0 DO I OVER + 255 AND | ||
| - | 14 I ?SPACE 3 .RBYTE LOOP | ||
| - | 15 2 SPACES 16 0 DO I OVER + 15 AND 1 .R LOOP DROP ; | ||
| - | |||
| - | |||
| - | Screen 11 not modified | ||
| - | 0 \ 1LINE VERIFY | ||
| - | 1 : 1LINE ( adr -- ) \ Verify 16 bytes from address. | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 8 : VERIFY ( adr -- ) \ Only 32 bytes from adr with header. | ||
| - | | ||
| - | 10 DUP 1LINE DUP 16 + 1LINE HEAD CR BASE ! ; | ||
| - | 11 | ||
| - | 12 \ Dump out first 32 bytes of a word in the dictionary. | ||
| - | 13 : PEEK ' >NAME 1- VERIFY ; | ||
| - | 14 \ Problem 1: Use HEAD and 1LINE to write a better memory | ||
| - | 15 \ DUMP utility. | ||
| - | |||
| - | |||
| - | Screen 12 not modified | ||
| - | 0 \ String operators-1 | ||
| - | 1 \ A counted string in memory is | ||
| - | 2 \ preceded by character count. | ||
| - | 3 \ | ||
| - | 4 \ ," {text}" | ||
| - | 5 CREATE NAME$ ," George Smith" | ||
| - | 6 \ If adr points to a counted string, | ||
| - | 7 \ character count an increment adr to point to first character. | ||
| - | 8 \ Count is often used to fetch successive characters of a string | ||
| - | 9 \ as in the definition of TYPE below and VER of screen 11. | ||
| - | 10 \ COUNT ( adr adr+1 n) | ||
| - | 11 : COUNT DUP 1+ OVER C@ ; \ Actually | ||
| - | 12 \ Given address adr and character count n type the string. | ||
| - | 13 \ TYPE ( adr n -- ) Type n characters of string at adr. | ||
| - | 14 : TYPE | ||
| - | 15 0 ?DO COUNT EMIT LOOP DROP ; | ||
| - | |||
| - | |||
| - | Screen 13 not modified | ||
| - | 0 \ String operators-2 | ||
| - | 1 \ " {text}" | ||
| - | 2 \ Compile a counted string into a word definition. | ||
| - | 3 \ is later executed the address and count are returned. | ||
| - | 4 : JOB$ " FORTH Programmer" | ||
| - | | ||
| - | 6 : DASHED1 | ||
| - | 7 CREATE DASH ," ----------" | ||
| - | | ||
| - | 9 : DASHED2 | ||
| - | 10 : DASHED3 | ||
| - | 11 : DASHED4 | ||
| - | 12 | ||
| - | 13 \ FILL ( adr n c ) Fill string at adr with n copies of c . | ||
| - | 14 \ ERASE ( adr n | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 14 not modified | ||
| - | 0 \ String Examples. | ||
| - | 1 \ Input a string of length n to buffer at adr . Actual number | ||
| - | 2 \ of characters entered is stored in a variable called SPAN. | ||
| - | 3 \ EXPECT ( adr n -- ) | ||
| - | 4 \ Note: EXPECT does not return a counted string. | ||
| - | 5 CREATE BUFFER1 | ||
| - | 6 \ Accept a string up to 80 characters long from the console. | ||
| - | 7 : READLINE | ||
| - | | ||
| - | | ||
| - | 10 \ Note: Actual character count is returned in variable SPAN | ||
| - | 11 | ||
| - | 12 \ Display string stored in BUFFER1 | ||
| - | 13 : SHOWLINE | ||
| - | 14 CR BUFFER1 LEN @ TYPE ; | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 15 not modified | ||
| - | 0 \ Moving Strings. | ||
| - | 1 \ Move n bytes from adrf to adrt. Left-most or low memory bytes | ||
| - | 2 \ are moved first. ( ie Move starts at beginning of string.) | ||
| - | 3 \ CMOVE ( adrf adrt n -- ) Use when adrf > adrt | ||
| - | 4 \ Use CMOVE to move strings down to lower memory. | ||
| - | | ||
| - | 6 \ Move n bytes from adrf to adrt. Right-most or high memory | ||
| - | 7 \ bytes are moved first. ( ie Move starts at end of string.) | ||
| - | 8 \ CMOVE> | ||
| - | 9 \ Use CMOVE> to move strings up to higher memory. | ||
| - | 10 | ||
| - | 11 \ Move n bytes from adrf to adrt. If adrf < adrt use CMOVE> | ||
| - | 12 \ otherwise use CMOVE. | ||
| - | 13 \ MOVE ( adrf adrt n -- ) | ||
| - | 14 : MOVE -ROT 2DUP U< | ||
| - | 15 IF ROT CMOVE> | ||
| - | |||
| - | |||
| - | Screen 16 not modified | ||
| - | 0 \ Packing and chopping strings. | ||
| - | | ||
| - | | ||
| - | 3 \ Move a string at adrf and pack it at adrt with count n. | ||
| - | 4 : CPACK ( adrf adrt n -- ) | ||
| - | | ||
| - | | ||
| - | | ||
| - | 8 \ Try: READLINE | ||
| - | 9 \ | ||
| - | 10 \ | ||
| - | 11 | ||
| - | 12 \ Chopping n characters from the left of a string | ||
| - | 13 : CHOP ( adr count n adr' count' ) | ||
| - | 14 ROT OVER + -ROT - ; | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 17 not modified | ||
| - | 0 \ -TRAILING | ||
| - | 1 \ Remove trailing blanks from a string. | ||
| - | 2 : -TRAILING ( adr count1 | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 \ Convert a string at adr1+1 accumulating number into d1. | ||
| - | 11 \ Stops at first non digit character at addr2. | ||
| - | 12 \ the address of a counted or packed digit string. | ||
| - | 13 \ digit of the string will be at adr1+1 | ||
| - | 14 \ CONVERT | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 18 not modified | ||
| - | 0 \ Converting a string to a number. | ||
| - | 1 \ Convert a ASCII digit string to a double number. | ||
| - | 2 : VAL ( adr count | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 >R DNEGATE R> \ Apply the -ve sign to result. | ||
| - | 11 THEN C@ BL = ; \ Successful conversion if we end | ||
| - | 12 \ with a blank. | ||
| - | 13 : D#IN | ||
| - | 14 WHILE CR ." REDO FROM START" | ||
| - | 15 REPEAT | ||
| - | |||
| - | |||
| - | Screen 19 not modified | ||
| - | 0 \ EMIT CTYPE 15: | ||
| - | 1 \ Echo character n to the printer if its on and the console. | ||
| - | 2 \ : EMIT ( n -- ) | ||
| - | 3 \ | ||
| - | 4 \ | ||
| - | 5 \ | ||
| - | | ||
| - | 7 \ PRINTING | ||
| - | 8 \ (PRINT) | ||
| - | 9 \ (CONSOLE) ( n -- ) Send character n to the console only. | ||
| - | 10 \ #OUT ( -- adr ) Variable, # of characters output since | ||
| - | 11 the last carriage return. | ||
| - | 12 \ Output n bytes of string at adr to console only. | ||
| - | 13 : CTYPE ( adr n -- ) | ||
| - | 14 0 ?DO COUNT (CONSOLE) | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 20 not modified | ||
| - | 0 \ Double Number Conversion Primitives-1. | ||
| - | | ||
| - | 2 : PAD ( -- adr ) \ Return address for output string. | ||
| - | | ||
| - | | ||
| - | | ||
| - | 6 : HOLD ( n -- ) \ Add character n to string being formed. | ||
| - | | ||
| - | 8 \ Start numeric conversion. | ||
| - | 9 : <# ( -- -- ) | ||
| - | 10 | ||
| - | 11 \ Terminate numeric conversion. | ||
| - | 12 : #> ( dn adr len ) | ||
| - | 13 | ||
| - | 14 HLD @ \ Address of string. | ||
| - | 15 PAD OVER - ; \ Compute length of string. | ||
| - | |||
| - | |||
| - | Screen 21 not modified | ||
| - | 0 \ Double Number Conversion Primitives-2. | ||
| - | 1 \ If n is negative insert a -ve sign in the output string. | ||
| - | 2 : SIGN ( n -- ) | ||
| - | | ||
| - | 4 \ Convert a single digit using the current number BASE. | ||
| - | 5 : # ( dn | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 \ MU/ | ||
| - | 11 \ double number dn by a single divisor n leaving a single | ||
| - | 12 \ remainder r and a double quotiend dq. | ||
| - | 13 \ MU/ | ||
| - | 14 : #S ( dn dn' | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 22 not modified | ||
| - | 0 \ Numeric Output-1 | ||
| - | | ||
| - | 2 \ (U.) Convert an unsigned 16 bit number to a string. | ||
| - | 3 : (U.) (S u -- a l ) | ||
| - | 4 \ U. Output as an unsigned single number with trailing space. | ||
| - | 5 : U. (S u -- ) | ||
| - | 6 \ U.R | ||
| - | 7 : U.R (S u l -- ) > | ||
| - | | ||
| - | 9 \ (.) | ||
| - | 10 : (.) (S n -- a l ) DUP ABS 0 <# #S ROT SIGN #> | ||
| - | 11 \ . | ||
| - | 12 : . (S n -- ) | ||
| - | 13 \ .R Output as a signed single number right justified. | ||
| - | 14 : .R (S n l -- ) > | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 23 not modified | ||
| - | 0 \ Numeric Output-2 | ||
| - | | ||
| - | 2 \ (UD.) Convert an unsigned double number to a string. | ||
| - | 3 : (UD.) (S ud -- a l ) <# #S #> ; | ||
| - | 4 \ UD. | ||
| - | 5 : UD. (S ud -- ) (UD.) TYPE SPACE ; | ||
| - | 6 \ UD.R Output as an unsigned double number right justified. | ||
| - | 7 : UD.R (S ud l -- ) >R | ||
| - | | ||
| - | 9 \ (D.) Convert a signed double number to a string. | ||
| - | 10 : (D.) (S d -- a l ) TUCK DABS <# #S ROT SIGN #> ; | ||
| - | 11 \ D. Output as a signed double number with a trailing space. | ||
| - | 12 : D. (S d -- ) | ||
| - | 13 \ D.R | ||
| - | 14 : D.R (S d l -- ) > | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 24 not modified | ||
| - | 0 \ Number formating examples. | ||
| - | 1 \ Print single number as four digit hex and preserve system base | ||
| - | 2 : H. BASE @ >R 16 BASE ! | ||
| - | | ||
| - | | ||
| - | 5 \ Print 16-bit number as binary saving preserving current BASE. | ||
| - | 6 : B. BASE @ >R 2 BASE ! | ||
| - | | ||
| - | | ||
| - | 9 \ Print double number as signed dollars and cents. | ||
| - | 10 : $. ( dn -- ) | ||
| - | 11 TUCK DABS <# | ||
| - | 12 ROT 0< IF ASCII - HOLD ELSE ASCII + HOLD THEN | ||
| - | 13 # # ASCII . HOLD #S ASCII $ HOLD | ||
| - | 14 #> TYPE SPACE ; | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 25 not modified | ||
| - | 0 \ Formating the time. 15: | ||
| - | | ||
| - | 2 : SECONDS ( -- dn ) | ||
| - | | ||
| - | | ||
| - | 5 : SEX 6 BASE ! ; | ||
| - | | ||
| - | 7 : :## # | ||
| - | | ||
| - | | ||
| - | 10 : .TIME | ||
| - | 11 | ||
| - | 12 \ Problem: | ||
| - | 13 \ We need M*/ to get the SECONDS correct. | ||
| - | 14 \ and screen 24 of SAMPLE2.BLK | ||
| - | 15 \ correct time. | ||
| - | |||
| - | |||
| - | Screen 26 not modified | ||
| - | 0 \ Home Work | ||
| - | 1 \ Do problems 1 through 8 page 182 of BRODIE | ||
| - | | ||
| - | 3 \ Redefine | ||
| - | 4 \ 1234567. | ||
| - | | ||
| - | 6 \ Now do it again so that | ||
| - | 7 \ 1234567. | ||
| - | | ||
| - | 9 \ Write the word O. that displays a number as Octal while | ||
| - | 10 \ preserving the current system base. | ||
| - | 11 | ||
| - | 12 \ Write B.R H.R and O.R that take a number n and a field | ||
| - | 13 \ width w and then display | ||
| - | 14 \ justified in a field w wide while preserving the current | ||
| - | 15 \ system base. | ||
| - | |||
| - | |||
| - | Screen 27 not modified | ||
| - | 0 \ Editor words used in LEDIT | ||
| - | | ||
| - | 2 \ LITTLE-CURSOR | ||
| - | 3 \ BIG-CURSOR | ||
| - | | ||
| - | 5 \ Clear window with ul corner at (x,y) and lr at (x', | ||
| - | 6 \ a is the attribute byte. 7 or 0111 binary clears window. | ||
| - | 7 \ 112 or 01110000 binary clears window to all white!! | ||
| - | 8 \ INIT-WINDOW | ||
| - | 9 : DELAY 0 0 DO LOOP ; | ||
| - | 10 : WOW | ||
| - | 11 CR ." THIS IS NUMBER " I . DELAY LOOP ; | ||
| - | 12 | ||
| - | 13 \ Wait for key press ( without ^C abort ) and return as n. | ||
| - | 14 \ {KEY} ( -- n ) | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 28 not modified | ||
| - | 0 \ Multi-way branching IF .. ELSE .. THEN | ||
| - | 1 : TIS ( -- -- ) CR ." | ||
| - | 2 : TEST1 ( -- -- ) | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 ASCII 7 OVER = IF DROP TIS ." SEVEN " | ||
| - | 11 ASCII 8 OVER = IF DROP TIS ." EIGHT " | ||
| - | 12 ASCII 9 OVER = IF DROP TIS ." NINE " | ||
| - | 13 ASCII 0 OVER = IF DROP TIS ." ZERO " | ||
| - | 14 BEEP DROP THEN THEN THEN THEN THEN | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 29 not modified | ||
| - | 0 \ CASE ... OF ... ENDOF ... ENDCASE | ||
| - | 1 \ CASE causes an index value to be compared to a series | ||
| - | 2 \ OF values. | ||
| - | 3 \ OF is equivalent to OVER = IF DROP | ||
| - | 4 \ ENDOF is equivalent to ELSE | ||
| - | 5 \ ENDCASE is equivalent of DROP and number of THENs | ||
| - | 6 \ When the index value equals one of the OF values, the sequence | ||
| - | 7 \ between that OF and the corresponding ENDOF is executed. | ||
| - | 8 \ Control then branches to the word following ENDCASE. | ||
| - | 9 \ If no match is found, | ||
| - | 10 | ||
| - | 11 \ The " | ||
| - | 12 \ between the last ENDOF and ENDCASE. | ||
| - | 13 \ however be preserved across this otherwise sequence so that | ||
| - | 14 \ ENDCASE | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 30 not modified | ||
| - | 0 \ (OF) | ||
| - | 1 \ EQUIVALENT TO OVER = IF DROP | ||
| - | 2 CODE (OF) | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 NEXT END-CODE | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 31 not modified | ||
| - | 0 \ CASE OF ENDOF ENDCASE | ||
| - | 1 ( see FORTH DIMENSIONS, II/3 page 37 ) | ||
| - | | ||
| - | 3 : CASE CSP @ !CSP TRUE ; IMMEDIATE | ||
| - | | ||
| - | 5 : OF ?CONDITION COMPILE (OF) ?>MARK ; IMMEDIATE | ||
| - | | ||
| - | 7 : ENDOF | ||
| - | | ||
| - | | ||
| - | 10 : ENDCASE | ||
| - | 11 CSP @ = 0= WHILE ?> | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 32 not modified | ||
| - | 0 \ Multi-way branching | ||
| - | 1 : TEST2 ( -- -- ) | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 ASCII 7 OF | ||
| - | 11 ASCII 8 OF | ||
| - | 12 ASCII 9 OF | ||
| - | 13 ASCII 0 OF | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | |||
| - | |||
| - | Screen 34 not modified | ||
| - | 0 \ Sample code definitions for the curious. | ||
| - | 1 CODE SPLIT ( hilo lo hi ) | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 9 CODE MELD ( lo hi hilo ) | ||
| - | 10 AX POP | ||
| - | 11 BX POP | ||
| - | 12 AL AH MOV | ||
| - | 13 BL AL MOV | ||
| - | 14 AX PUSH | ||
| - | 15 | ||
| - | |||
| - | </ | ||
papierkorb/sample7.blk.1755359401.txt.gz · Zuletzt geändert: 2025-08-16 17:50 von mka