Advertisement
Ham62

Pythagorean theorem.RBS

Oct 19th, 2017
525
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. rem Declare variables
  2. float C 'Restore the result in here
  3. float Squared 'Number in here gets squared in SquareVar routine
  4. float A = 25
  5. float B = 15
  6.  
  7. let Squared = A 'Square A first
  8. Gosub SquareVar
  9.  
  10. let C = Squared 'store squared result in C
  11.  
  12. mov Squared, B 'now square B
  13. Gosub SquareVar
  14.  
  15. Add C, Squared 'Add squared value of B to that of A
  16. Sqrt C 'Square root to get final answer
  17.  
  18. BIOS.End()
  19.  
  20. SquareVar: 'Sqaures value in variable Squared
  21. mul Squared, Squared
  22. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement