File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -955,6 +955,10 @@ with the hardware. Use with care!
955955 x = ADR("Hello")
956956 ? $( x )
957957
958+ - %(_ n_ ) :
959+ This returns the floating-point
960+ value stored at memory address _ n_ .
961+
958962
959963List Of Statements
960964==================
Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ FP_FUNCS:
8282 " COs" FP_T_EXPR emit TOK_FP_COS
8383 " Val" STR_PAR_EXPR emit TOK_FP_VAL
8484 " RNd()" emit TOK_FP_RND
85+ " %" PAR_EXPR emit TOK_FP_LOAD
8586
8687ADR_EXPR:
8788 emit { TOK_VAR_LOAD, VT_ARRAY_FLOAT } E_VAR_SEARCH " %"
Original file line number Diff line number Diff line change 1+ ' Procedure to sum N elements of an array:
2+ PROC SUM P N
3+ SUM% = 0
4+ WHILE N >0
5+ DEC N
6+ SUM% = SUM % + %(P )
7+ P = P + 6
8+ WEND
9+ ENDPROC
10+
11+ DIM A %(2 )
12+ A%(0 ) = 0.125
13+ A%(1 ) = 0.0625
14+ A%(2 ) = 0.03125
15+
16+ @SUM &A %, 3
17+ ? SUM%
18+
19+ X%=1234.5
20+
21+ @SUM &X %, 1
22+ ? SUM%
Original file line number Diff line number Diff line change 1+ Name: Test for using address of floating point vars
2+ Test: run-fp
3+ Output:
4+ 0.21875
5+ 1234.5
You can’t perform that action at this time.
0 commit comments