papierkorb:sample5.blk
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| papierkorb:sample5.blk [2025-08-16 17:50] – ↷ Seite von projects:sample5.blk nach papierkorb:sample5.blk verschoben mka | papierkorb:sample5.blk [Unbekanntes Datum] (aktuell) – gelöscht - Externe Bearbeitung (Unbekanntes Datum) 127.0.0.1 | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | === Examples for lecture number five. === | ||
| - | < | ||
| - | Screen 0 not modified | ||
| - | 0 \ Examples for lecture number five. 10: | ||
| - | 1 \ Last change: | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 A Fancy Line Editor. | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | Screen 1 not modified | ||
| - | 0 \ Load screen for help system. | ||
| - | | ||
| - | 2 \ The word FROM temporarily redirects the input to the | ||
| - | 3 \ indicated block file for ONE screen load only. | ||
| - | 4 \ However.... that one screen could specify that others be | ||
| - | 5 \ loaded. | ||
| - | 6 \ Go back and check it yourself. | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 2 not modified | ||
| - | 0 \ Review-1 Return Stack 19: | ||
| - | 1 \ Note: D) indicates data stack, | ||
| - | 2 \ Transfer top data stack item to return stack. | ||
| - | 3 \ >R ( n -- D) ( -- n R) | ||
| - | 4 \ Transfer top return stack item to data stack. | ||
| - | 5 \ R> ( -- n D) ( n -- R) | ||
| - | 6 \ Copy top return stack item to data stack. | ||
| - | 7 \ R@ ( -- n D) ( n | ||
| - | | ||
| - | 9 \ 1. Do not test or execute these words interactively. | ||
| - | 10 \ 2. Only use these words within colon definitions. | ||
| - | 11 \ 3. Each use of >R must be balanced with a corresponding R> | ||
| - | 12 \ 4. Do not use >R R> and R@ within DO ... LOOPs. | ||
| - | 13 \ info is kept on the return stack and could be destroyed. | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 3 not modified | ||
| - | 0 \ Review-2 Memory Operators. | ||
| - | 1 HEX ( -- -- ) Set system number BASE to 16 (decimal). | ||
| - | 2 DECIMAL ( -- -- ) Set system number BASE to 10 (decimal). | ||
| - | 3 TIB ( -- adr ) Leave address of terminal input buffer. | ||
| - | 4 PAD ( -- adr ) Leave address of text output buffer. | ||
| - | 5 HERE ( -- adr ) Leave address of word buffer. | ||
| - | 6 DUMP ( adr n -- ) Dump n bytes of memory starting at adr. | ||
| - | 7 ERASE ( adr n -- ) Erase n bytes of memory starting at adr | ||
| - | | ||
| - | 9 FILL ( adr n m -- ) Fill n bytes of memory starting at adr | ||
| - | 10 with low 8 bits of m ( 0 - 255 ). | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 C! ( n adr -- ) Store low 8 bits of n at address adr. | ||
| - | 14 C@ ( adr | ||
| - | 15 ? ( adr -- ) Display contents of cell at adr. | ||
| - | |||
| - | |||
| - | Screen 4 not modified | ||
| - | 0 \ Review-3 Variables and Constants. | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 : DRIP 1 RAIN @ + RAIN ! ; | ||
| - | 12 : DRIP 1 RAIN +! ; | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 5 not modified | ||
| - | 0 \ Review-4 | ||
| - | 1 CREATE < | ||
| - | | ||
| - | | ||
| - | | ||
| - | 5 ALLOT ( n -- ) Allocate n bytes of memory in the | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 initializing it to low 8 bits of n. | ||
| - | 11 CREATE MARBLE | ||
| - | 12 0 CONSTANT RED 2 CONSTANT BLUE 4 CONSTANT YELLOW | ||
| - | 13 : MARBLES MARBLE + ; | ||
| - | 14 2 RED | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 6 not modified | ||
| - | 0 \ Review-5 Double Variables and Constants | ||
| - | | ||
| - | 2 2VARIABLE | ||
| - | | ||
| - | 4 < | ||
| - | | ||
| - | | ||
| - | 7 2CONSTANT | ||
| - | | ||
| - | 9 < | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 2! ( d adr -- ) Store the double number d at adr. | ||
| - | 13 | ||
| - | 14 2@ ( adr d ) Fetch the double number d from adr. | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 7 not modified | ||
| - | 0 \ Review-6 User stacks. | ||
| - | | ||
| - | 2 : P-CLEAR | ||
| - | 3 : P-DEPTH | ||
| - | 4 : P-INC ( -- -- D) | ||
| - | | ||
| - | | ||
| - | 7 : P-DEC ( -- -- D) | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 : >P ( n -- D) ( -- n P) P-INC P-INDEX @ P-STACK + ! ; | ||
| - | 12 : P@ ( -- n D) ( n n P) P-INDEX @ P-STACK + @ ; | ||
| - | 13 : P> ( -- n D) ( n -- P) P@ P-DEC ; | ||
| - | 14 : .P P-DEPTH ?DUP IF 1+ 1 ?DO I 2* P-STACK + @ 8 .R LOOP | ||
| - | 15 ELSE ." P-STACK EMPTY" THEN ; | ||
| - | |||
| - | |||
| - | Screen 8 not modified | ||
| - | 0 \ Solution to Problem 8. | ||
| - | 1 \ Write FORTH words for the following user stack operations. | ||
| - | 2 \ The should leave the data stack unchanged!!! | ||
| - | 3 : PDUP P@ >P ; | ||
| - | 4 : PDROP P> DROP ; | ||
| - | 5 : PSWAP P> P> SWAP >P >P ; | ||
| - | 6 : POVER P> P@ SWAP >P >P ; | ||
| - | 7 : PROT P> P> P> -ROT >P >P >P ; | ||
| - | 8 : -PROT PROT PROT ; | ||
| - | 9 : PTUCK PSWAP POVER ; | ||
| - | 10 : PNIP PSWAP PDROP ; | ||
| - | 11 : 2PDUP POVER POVER ; | ||
| - | 12 : 3PDUP P> 2PDUP DUP >P -PROT >P ; | ||
| - | 13 : 2PSWAP | ||
| - | 14 : 2PDROP | ||
| - | 15 : 2POVER | ||
| - | |||
| - | |||
| - | Screen 9 not modified | ||
| - | 0 \ Review-8 Indexed arrays. | ||
| - | 1 CREATE X 102 ALLOT \ Array for x coordinates | ||
| - | 2 CREATE Y 102 ALLOT \ Array for y coordinates | ||
| - | 3 VARIABLE | ||
| - | 4 VARIABLE | ||
| - | 5 \ Compute address of ith component. | ||
| - | 6 : II ( i adr adr{i} ) | ||
| - | | ||
| - | 8 \ Fetch ith x component. | ||
| - | 9 : X@ ( i x{i} ) X II @ ; | ||
| - | 10 \ Fetch ith y component. | ||
| - | 11 : Y@ ( i y{i} ) Y II @ ; | ||
| - | 12 \ Store ith x component. | ||
| - | 13 : X! ( x i -- ) X II ! ; | ||
| - | 14 \ Store ith y component. | ||
| - | 15 : Y! ( y i -- ) Y II ! ; | ||
| - | |||
| - | |||
| - | Screen 10 not modified | ||
| - | 0 \ Reasons for using Fixed-point arithmetic | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 Do not require floating point. | ||
| - | 12 | ||
| - | 13 Read Brodie | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 11 not modified | ||
| - | 0 \ Reasons for using Floating-point. | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 To add floating point to F83 see: | ||
| - | 11 FORTH Tools and Applications | ||
| - | 12 pages 51-58 for a high-level floating point package | ||
| - | 13 with 16 bit exponent and 32 bit mantissa. | ||
| - | 14 See screens 40-45 of this file for a floating point package | ||
| - | 15 with 16 bit exponent and 16 bit mantissa. | ||
| - | |||
| - | |||
| - | Screen 12 not modified | ||
| - | 0 \ Star-slash the scaler | ||
| - | 1 \ */ ( a b c ab/c ) Perform multiplication and then division. | ||
| - | 2 \ Star-slash multiplies 16bit a and 16bit b to form a 32bit | ||
| - | 3 \ intermediate result which is then divided by 16bit c to give a | ||
| - | 4 \ 16bit result. | ||
| - | 5 \ results when multiplying by fractions. | ||
| - | | ||
| - | 7 \ We use */ to multiply a by the fraction b/c | ||
| - | 8 \ Examples: | ||
| - | 9 \ 15000 | ||
| - | 10 \ 15000 | ||
| - | 11 \ m is p % of n | ||
| - | 12 : %% ( n p m ) | ||
| - | 13 : % ( n p m ) | ||
| - | 14 \ Try 1820 32 %% and 1820 32 % | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 13 not modified | ||
| - | 0 \ Percentage calculations | ||
| - | 1 \ Use % to find Result | ||
| - | 2 \ 15 % of | ||
| - | 3 \ 15 % of | ||
| - | 4 \ 15 % of | ||
| - | | ||
| - | 6 \ Rounding. | ||
| - | | ||
| - | 8 : %R 10 */ 5 + 10 / . ; | ||
| - | | ||
| - | 10 \ Use DEBUG to follow the operation of %R on the above | ||
| - | 11 \ examples. | ||
| - | 12 | ||
| - | 13 \ See Brodie pp116-119 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 14 not modified | ||
| - | 0 \ Rational approximations. Problem 1. 23: | ||
| - | 1 \ See Brodie page 122 for more. | ||
| - | 2 : *PI | ||
| - | 3 : *SQRT(2) | ||
| - | 4 : *SQRT(3) | ||
| - | 5 : *E 28667 10546 */ ; \ | ||
| - | 6 \ Area of circle | ||
| - | 7 : AREA ( r a ) | ||
| - | | ||
| - | 9 \ Volume of sphere | ||
| - | 10 : VS ( r v ) | ||
| - | 11 DUP DUP * * *PI 4 3 */ ; | ||
| - | 12 \ Volume of a cone. | ||
| - | 13 : VC ( h r v ) | ||
| - | 14 | ||
| - | 15 \ Problem 1. Determine the valid ranges for r in above examples. | ||
| - | |||
| - | |||
| - | Screen 15 not modified | ||
| - | 0 \ Brute force approach to fractions. | ||
| - | 1 \ Display decimal equivalent of fraction m/n. | ||
| - | 2 : .XXX ( m n -- ) | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 9 \ Print the decimal equivalent of the mixed fraction i+m/n | ||
| - | 10 : I.XXX ( i m n -- ) | ||
| - | 11 ROT . CONTROL H EMIT .XXX ; | ||
| - | 12 \ Display decimal equivalents of 1/n through | ||
| - | 13 : TEST ( n -- ) | ||
| - | 14 CR DUP 1 ?DO CR I OVER 2DUP SWAP | ||
| - | 15 . ." /" . ." = " | ||
| - | |||
| - | |||
| - | Screen 16 not modified | ||
| - | 0 \ Star slash mod */MOD | ||
| - | 1 \ Compute ab/c with 32bit intermediate product ab and leave | ||
| - | 2 \ quotient q and remainder r . Note: Forth-83 */MOD uses | ||
| - | 3 \ signed values | ||
| - | 4 \ */MOD ( a b c r q ) | ||
| - | 5 \ Calculate area of a circle and display to 3 decimal places. | ||
| - | 6 : AREA ( r -- ) | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 \ Calculate volume of a sphere and display to 3 decimals. | ||
| - | 11 : VOLUME | ||
| - | 12 DUP DUP * SWAP 1420 * ( r*r r*1420 ) | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 \ Problem 2. Do circle circumference and sphere surface area. | ||
| - | |||
| - | |||
| - | Screen 17 not modified | ||
| - | 0 \ Rounding with */MOD 09: | ||
| - | 1 \ Example: | ||
| - | 2 \ Using */ we rounded this way. | ||
| - | 3 : %R1 10 */ 5 + 10 / DROP ; | ||
| - | 4 : %R2 50 */ | ||
| - | | ||
| - | 6 : %R3 100 */MOD SWAP 50 + 100 / + DROP ; | ||
| - | 7 : %R4 100 */MOD SWAP 49 > NEGATE + DROP ; | ||
| - | | ||
| - | 9 \ Note: Change the . to DROP when doing the timing tests. | ||
| - | 10 \ Do this using the editor replace function. | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 18 not modified | ||
| - | 0 \ Timer module | ||
| - | 1 ONLY EDITOR ALSO FORTH ALSO DEFINITIONS | ||
| - | | ||
| - | 3 \ Return current time in ticks as a double integer. | ||
| - | 4 \ ( 18.2 ticks/ | ||
| - | | ||
| - | | ||
| - | | ||
| - | 8 \ Save current time in ticks. | ||
| - | 9 : !TIMER ( -- -- ) | ||
| - | 10 | ||
| - | 11 \ Fetch elapsed time in ticks. | ||
| - | 12 : @TIMER | ||
| - | 13 @TICKS TICKS 2@ D- ; | ||
| - | 14 : TIME.IT ; | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 19 not modified | ||
| - | 0 \ Timing Template. | ||
| - | 1 \ @TIMER gives time in ticks, 18.2 ticks/sec so if we perform | ||
| - | 2 \ 1000 passes we can get count in micro-secs for one pass. | ||
| - | 3 ONLY EDITOR ALSO FORTH DEFINITIONS | ||
| - | | ||
| - | 5 : TIME.IT | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 \ 1234 32 %R3 ( 2692 micro-sec ) | ||
| - | 12 \ 1234 32 %R4 ( 1648 micro-sec ) | ||
| - | 13 LOOP @TIMER DROP CR | ||
| - | 14 5000 91 */ . 230 EMIT ." -seconds for one pass." ; | ||
| - | 15 : TEST CLEARSCREEN | ||
| - | |||
| - | |||
| - | Screen 20 not modified | ||
| - | 0 \ Infinite Loops. | ||
| - | 1 The infinite loop with no exit. This is recommended only for | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 7 The infinite loop with EXIT escape hatch. | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 ... (s1) BEGIN (s2) | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 AGAIN (s4) ... | ||
| - | |||
| - | |||
| - | Screen 21 not modified | ||
| - | 0 \ Indefinite Loops | ||
| - | 1 \ In the indefinite loop the main action is repeated until a | ||
| - | 2 \ condition is true. Step 1 is executed once, step 2 is | ||
| - | 3 \ executed and (condition) is tested. If condition is false | ||
| - | 4 \ step 2 is executed again, if condition is true then step 3 | ||
| - | 5 \ is executed. | ||
| - | 6 \ executed when loop is exited - this is not the case with | ||
| - | 7 \ the infinite loop with EXIT of previous screen. | ||
| - | 8 \ | ||
| - | 9 \ ... (s1) BEGIN | ||
| - | 10 \ | ||
| - | 11 \ | ||
| - | 12 | ||
| - | 13 : COUNT-UP | ||
| - | 14 : COUNT.UP | ||
| - | 15 KEY? IF EXIT THEN AGAIN ." DONE" ; | ||
| - | |||
| - | |||
| - | Screen 22 not modified | ||
| - | 0 \ Indefinite Loops. | ||
| - | 1 \ Indefinite loop illustrates incredible integer property. | ||
| - | 2 : DOIT ( n -- ) | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 9 \ Problem 3. Modify program to count the number of cycles | ||
| - | 10 \ before termination. | ||
| - | 11 \ Hint: Use a variable to save the count. | ||
| - | 12 \ Problem 4. Modify the program so the value of the largest | ||
| - | 13 \ number encountered is printed when the program terminates. | ||
| - | 14 \ Is there a limit to the maximum number? Are 16 bit numbers | ||
| - | 15 \ large enough. | ||
| - | |||
| - | |||
| - | Screen 23 not modified | ||
| - | 0 \ Indefinite Loop - another form. Prob 5. 21: | ||
| - | 1 \ In this form step 1 is executed once. Step 2 is executed | ||
| - | 2 \ if condition is true do step 3 and repeat starting with (s2) | ||
| - | 3 \ if condition is false leave loop and do step 4. | ||
| - | 4 \ ... (s1) BEGIN (s2) | ||
| - | 5 \ | ||
| - | 6 \ WHILE (s3) | ||
| - | 7 \ REPEAT (s4) ... | ||
| - | 8 \ This word clears the data stack. | ||
| - | 9 : CLEAR ( ?? -- ) | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 \ Problem 5. Can you write CLEAR using BEGIN ... UNTIL ? | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 24 not modified | ||
| - | 0 \ Finite 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 \ Problem 6: Given the following loop testing words: | ||
| - | 6 : DOLOOP | ||
| - | 7 : DO+LOOP | ||
| - | 8 : DO-LOOP | ||
| - | 9 : ? | ||
| - | 10 : ?DO+LOOP ?DO CR I . 2 +LOOP ; | ||
| - | 11 : ?DO-LOOP ?DO CR I . -2 +LOOP ; | ||
| - | 12 \ Determine the output for the following stack inputs. | ||
| - | 13 \ a) 10 8 b) 10 10 c) 10 12 | ||
| - | 14 \ Caution: | ||
| - | 15 \ DO PROBLEMS 1 THRU 6 PAGE 145 OF STARTING FORTH. | ||
| - | |||
| - | |||
| - | Screen 25 not modified | ||
| - | 0 \ Leaving Loops early. | ||
| - | 1 \ Execute step 1. Repeat loop as before executing step 2 and | ||
| - | 2 \ step 4 on each pass - except that if condition is true | ||
| - | 3 \ before loop is finished execute step 3 and leave loop to | ||
| - | 4 \ execute step 5. Note: step 4 will not be executed if we | ||
| - | 5 \ leave the loop early. | ||
| - | 6 \ | ||
| - | 7 \ | ||
| - | 8 \ | ||
| - | 9 \ | ||
| - | 10 \ | ||
| - | 11 \ This is an alternative form if step 3 is not required. | ||
| - | 12 \ | ||
| - | 13 \ | ||
| - | 14 \ | ||
| - | 15 \ | ||
| - | |||
| - | |||
| - | Screen 26 not modified | ||
| - | 0 \ Example | ||
| - | | ||
| - | 2 : (RND) SEED @ 259 * 3 + 32767 AND DUP SEED ! ; | ||
| - | 3 : RND ( n r ) \ r is a random number | ||
| - | | ||
| - | 5 CREATE TABLE 100 ALLOT | ||
| - | 6 : FILL-TABLE | ||
| - | 7 : SEE-TABLE | ||
| - | 8 : MATCH ( n -- ) | ||
| - | | ||
| - | 10 IF CR ." Its in the " | ||
| - | 11 LEAVE THEN | ||
| - | 12 LOOP DROP ; | ||
| - | 13 \ Problem 7: Write SIGMA a word which sums the numbers in | ||
| - | 14 \ in TABLE until a 0 is encountered. | ||
| - | 15 \ number of numbers and the average. | ||
| - | |||
| - | |||
| - | Screen 27 not modified | ||
| - | 0 \ Zen Floating Point Math 09: | ||
| - | | ||
| - | 2 28 31 THRU | ||
| - | | ||
| - | 4 EXIT | ||
| - | | ||
| - | 6 "Less is more" floating point implementation by Martin Tracy. | ||
| - | 7 Put in the public domain in 1984 Forml Proceedings. | ||
| - | | ||
| - | 9 10-20-85 Modified by JWB for compatibility with F83 | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 28 not modified | ||
| - | 0 \ ZEN MATH, documentation. | ||
| - | 1 EXIT | ||
| - | 2 Floating-point four-function single-precision match package | ||
| - | 3 with four significant digits and an unlimited dynamic range. | ||
| - | 4 Floating-point numbers are represented by a signed mantissa | ||
| - | 5 and an exponent of ten, with the exponent on top of the stack. | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 Used like | ||
| - | 12 | ||
| - | 13 FLOAT asumes that a number containing a decimal point is forced | ||
| - | 14 to a double-integer and the number of digits following the | ||
| - | 15 decimal point is stored in the variable DPL. | ||
| - | |||
| - | |||
| - | Screen 29 not modified | ||
| - | 0 \ D10* TRIM ZEN MATH | ||
| - | | ||
| - | | ||
| - | 3 ( d1 --- d2 ; multiplies d1 by 10 ) | ||
| - | 4 : D10* D2* 2DUP D2* D2* D+ ; | ||
| - | | ||
| - | 6 ( trims a double number mantissa and an exponent of ten to ) | ||
| - | 7 ( a reasonable floating point number; dn n --- f ) | ||
| - | 8 : TRIM >R SWAP OVER DABS | ||
| - | | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 30 not modified | ||
| - | 0 \ F+ FNEGATE | ||
| - | 1 : F+ ( f1 f2 f1+f2 ) | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 : FNEGATE | ||
| - | 14 >R NEGATE R> ; | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 31 not modified | ||
| - | 0 \ F- F* | ||
| - | 1 : F- ( f1 f2 f1-f2 ) | ||
| - | | ||
| - | 3 : F* ( f1 f2 f1*f2 ) | ||
| - | | ||
| - | | ||
| - | | ||
| - | 7 : F/ ( f1 f2 f1/f2 ) | ||
| - | | ||
| - | | ||
| - | 10 ABS DUP 6553 MIN ROT ABS 0 | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 2SWAP DROP UM/MOD SWAP DROP 0 ROT ?DNEGATE R> TRIM ; | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 32 not modified | ||
| - | 0 \ FLOAT F. ZEN MATH 09: | ||
| - | | ||
| - | 2 \ Convert a double number to a floating point number. | ||
| - | 3 : FLOAT ( d f ) | ||
| - | | ||
| - | | ||
| - | 6 \ Print a floating point number. | ||
| - | 7 : F. ( f -- ) | ||
| - | | ||
| - | | ||
| - | 10 <# | ||
| - | 11 R@ 0< | ||
| - | 12 | ||
| - | 13 THEN R> DROP #S ROT SIGN | ||
| - | 14 #> | ||
| - | 15 | ||
| - | |||
| - | </ | ||
papierkorb/sample5.blk.1755359401.txt.gz · Zuletzt geändert: 2025-08-16 17:50 von mka