### Add new attachment

Only authorized users are allowed to upload new attachments.

### List of attachments

Kind Attachment Name Size Version Date Modified Author Change note
atr
fig-FORTH1.4S-1.atr 92.2 kB 1 05-Jul-2016 10:53 Roland B. Wassenberg fig-FORTH1.4S-1
atr
fig-FORTH1.4S-2.atr 92.2 kB 1 05-Jul-2016 10:53 Roland B. Wassenberg fig-FORTH1.4S-2

This page (revision-72) was last changed on 01-May-2018 03:30 by Roland B. Wassenberg

This page was created on 20-Feb-2010 21:56 by Carsten Strotmann

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

#### Difference between version 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 and 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1

 At line 6 changed one line Stack-based languages simplify the interpreter's parser considerably, because the data for an instruction always appears in the source code before the instructions that will use it. To see why this helps, consider this typical line of [BASIC]: Stack-based languages simplify the interpreter's parser considerably because the data for an instruction always appears in the source code before the instructions that will use it. To see why this helps, consider this typical line of [Basic]:\\ \\ {{A = 10 + 20 * B}}\\ \\ To perform this line, the interpreter has to read the entire line, look up the value of B (let's say 30), realize that the * has to be performed before + and order the instructions correctly, and then finally convert those into instructions something like:\\ \\ {{get(B,temp1)}} - get the value in B and store it in temp1\\ {{multiply(20,temp1,temp2)}} - multiply that value by 20 and store the result in temp2\\ {{add(10,temp2,temp3)}} - add 10 to temp2 and store the result in temp3 \\ {{put(temp3,A)}} - store the value of temp3 into the variable A\\ \\ In contrast, in a stack-based system, the programmer organizes the code in the fashion it will ultimately be performed. The equivalent would be something like:\\ \\ {{B 20 mul}}\\ {{10 add}}\\ \\ When this code is performed, the interpreter pushes the value of B on the stack, then 20. It then encounters the mul, which removes the last two items, the 30 and 20, multiplies them, and puts the result back on the stack. Next, it pushes 10 on the stack, leaving the top two locations containing 60 and 10. It then encounters add, taking the two values, adding them, and putting the result back on the stack. The top of the stack now contains the result, 70. At line 8 changed 3 lines A = 10 + 20 * B To perform this line, the interpreter has to read the entire line, look up the value of B (let's say 30), realize that the * has to be performed before +, and then finally convert those into instructions something like: Notice that the stack-based version ''has no temporary values'', and only reads a single instruction at a time, not an entire line of code. As a result, the parser is much simpler, smaller and requires less memory to run. This, in turn, generally makes it much faster, comparable to compiled programs. At line 12 removed 14 lines get(B,temp1) mul(20,temp1, temp2) add(10,temp2, temp3) put(temp3,A) In contrast, in a stack-based system, the programmer organizes the code in the fashion it will ultimately be performed. The equivalent would be: B 20 mul 10 add When this code is performed, the interpreter pushes the value of B on the stack, then 20. It then encounters the mul, which removes the last two items, the 30 and 20, multiplies them, and puts the result back on the stack. Next, it pushes 10 on the stack, and encounters add, taking the two values, adding them, and putting the result back on the stack. Notice that the stack-based version *has no temporary values*, and only reads a single instruction at a time, not an entire line of code. As a result, the parser is much simpler, smaller and requires less memory to run. This, in turn, generally makes it much faster, comparable to compiled programs. At line 108 removed one line
Version Date Modified Size Author Changes ... Change note
72 01-May-2018 03:30 6.695 kB Roland B. Wassenberg to previous
71 28-Apr-2018 15:44 6.695 kB Maury Markowitz to previous | to last
70 28-Apr-2018 15:38 6.295 kB Maury Markowitz to previous | to last
69 28-Apr-2018 15:36 6.27 kB Maury Markowitz to previous | to last
68 26-Apr-2018 22:31 4.923 kB Maury Markowitz to previous | to last
67 26-Apr-2018 22:19 4.336 kB Maury Markowitz to previous | to last
66 29-Aug-2017 04:50 3.271 kB Roland B. Wassenberg to previous | to last
65 25-Feb-2017 16:55 3.292 kB Carsten Strotmann to previous | to last
64 05-Jul-2016 10:56 3.153 kB Roland B. Wassenberg to previous | to last
63 02-Jul-2016 01:07 3.103 kB Roland B. Wassenberg to previous | to last
62 01-Jul-2016 18:40 3.062 kB Roland B. Wassenberg to previous | to last
61 23-Jan-2014 18:28 3.048 kB Carsten Strotmann to previous | to last
« This page (revision-72) was last changed on 01-May-2018 03:30 by Roland B. Wassenberg
G’day (anonymous guest) My Prefs
© 2010-2017 AtariWiki
All content in the Wiki is licensed under Creative Commons Share Alike License, unless otherwise noted.
JSPWiki v2.8.3