User Tools

Site Tools


using_20the_20fscale_20instruction

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
using_20the_20fscale_20instruction [2018/04/01 14:44]
86.143.37.84
using_20the_20fscale_20instruction [2018/04/13 10:55] (current)
richardrussell
Line 1: Line 1:
 =====Using the fscale instruction===== =====Using the fscale instruction=====
  
-//by Tony Tooth, January 2016. Edited by Tony Tooth April 2018//\\ \\  Randall Hyde's book "The Art of Assembly Language"​ omits to cover or even mention the fscale instruction in the main text or in the index, although it is in his Table B-2: Floating Point Instruction Set.\\ \\  fscale (I discovered only late in 2015 - after more than 10 years experience programming in assembly language) is a fast and efficient way to implement the exponential function in assembly language. The way I did this hitherto was incredibly cumbersome. I have written a simple sub-routine in assembly language to illustrate the use of fscale. Note that my illustrative routine does not check for out-of-bounds numbers.\\ \\+//by Tony Tooth, January 2016. Edited by Tony Tooth April 2018//\\ \\  Randall Hyde's book "The Art of Assembly Language"​ omits to cover or even mention the fscale instruction in the main text or in the index, although it is in his Table B-2: Floating Point Instruction Set.\\ \\  fscale (I discovered only late in 2015 - after more than 10 years experience programming in assembly language) is a fast and efficient way to implement the exponential function in assembly language. The way I did this hitherto was incredibly cumbersome. I have written a simple sub-routine in assembly language to illustrate the use of fscale. Note that my illustrative routine does not check for out-of-bounds numbers.
  
 +<code bb4w> ​
       DEF FN_fractpower(num,​ pow)       DEF FN_fractpower(num,​ pow)
       LOCAL pass&, res       LOCAL pass&, res
Line 43: Line 44:
  
       = res       = res
 +</​code>​
  
-\\ //Edit by Richard Russell, January 2016://\\ \\  An alternative way of computing the exponential function in BB4W v6 assembly language is to call the internal EXP routine, which is exposed via the **@fn%()** jump table, as follows (it uses **fscale** internally):​\\ \\ +//Edit by Richard Russell, January 2016://\\ \\  An alternative way of computing the exponential function in BB4W v6 assembly language is to call the internal EXP routine, which is exposed via the **@fn%()** jump table, as follows (it uses **fscale** internally):​ 
 + 
 +<code bb4w> ​
         @% = &1415         @% = &1415
         REPEAT         REPEAT
Line 73: Line 77:
         CALL X%         CALL X%
         = y         = y
 +</​code>​
 +
using_20the_20fscale_20instruction.txt · Last modified: 2018/04/13 10:55 by richardrussell