Difference between revisions of "83Plus:BCALLs:405A"

From WikiTI
Jump to: navigation, search
 
m (Cosmetic changes)
Line 2: Line 2:
 
[[Category:83Plus:BCALLs:By Name:Math|Floor]]
 
[[Category:83Plus:BCALLs:By Name:Math|Floor]]
 
[[Category:83Plus:BCALLs:By Address|405A - Floor]]
 
[[Category:83Plus:BCALLs:By Address|405A - Floor]]
 
----
 
 
 
== Synopsis ==
 
== Synopsis ==
 
'''Unofficial Name:''' Floor
 
'''Unofficial Name:''' Floor
Line 10: Line 7:
 
'''BCALL Address:''' 405A
 
'''BCALL Address:''' 405A
  
Calculates the floor of the value in OP1, and stores it in OP1. Floor is rounding down to the nearest integer, e.g. floor(3.5) = 3 and floor(-4.0001) = -4.
+
Calculates the floor of the value in [[83Plus:RAM:8478|OP1]], and stores it in [[83Plus:RAM:8478|OP1]]. Floor is rounding down to the nearest integer, e.g. floor(3.5) = 3 and floor(-4.0001) = -4.
  
 
=== Inputs ===
 
=== Inputs ===
Line 22: Line 19:
  
 
== Comments ==
 
== Comments ==
This BCALL calculates the floor of the value in OP1 by taking the fractional part, reversing its sign, and adding it to the original value.
+
This BCALL calculates the floor of the value in [[83Plus:RAM:8478|OP1]] by taking the fractional part, reversing its sign, and adding it to the original value.
  
 
== Example ==
 
== Example ==

Revision as of 17:27, 5 November 2006

Synopsis

Unofficial Name: Floor

BCALL Address: 405A

Calculates the floor of the value in OP1, and stores it in OP1. Floor is rounding down to the nearest integer, e.g. floor(3.5) = 3 and floor(-4.0001) = -4.

Inputs

  • OP1: Number to take floor of

Outputs

  • OP1 contains floor

Destroys

Comments

This BCALL calculates the floor of the value in OP1 by taking the fractional part, reversing its sign, and adding it to the original value.

Example

ld a,3
B_CALL SetXXOP1
B_CALL TimesPt5 ;OP1 is 1.5
B_CALL Floor ;OP1 is now 1