Difference between revisions of "83Plus:BCALLs:4060"

From WikiTI
Jump to: navigation, search
 
m (Capitalization, links, formatting, and category)
 
Line 1: Line 1:
[[Category:83Plus:BCALLs:By Name:FP_Util|Trunc]] [[Category:83Plus:BCALLs:By Name|Trunc] [[Category:83Plus:BCALLs:By Address|4060 - Trunc]]
+
[[Category:83Plus:BCALLs:By Name:FP_Util|Trunc]] [[Category:83Plus:BCALLs:By Name|Trunc]] [[Category:83Plus:BCALLs:By Address|4060 - Trunc]]
 
== Synopsis ==
 
== Synopsis ==
 
'''Official Name:''' Trunc
 
'''Official Name:''' Trunc
Line 5: Line 5:
 
'''BCALL Address:''' 4060
 
'''BCALL Address:''' 4060
  
Truncates the fractional part of a floating point number in op1.
+
Truncates the fractional part of a floating point number in [[83Plus:RAM:8478|OP1]].
  
 
=== Inputs ===
 
=== Inputs ===
* op1 = floating point number
+
* OP1 = floating point number
  
 
=== Outputs ===
 
=== Outputs ===
* op1 = integer part of floating point number  
+
* OP1 = integer part of floating point number  
  
 
=== Registers Destroyed ===
 
=== Registers Destroyed ===
Line 20: Line 20:
  
 
== Example ==
 
== Example ==
Suppose op1=00h,80h,28h,00h,...
+
<nowiki>Suppose OP11=00h,80h,28h,00h,...
After B_CALL Trunc, op1=00h,80h,20h,00h,...
+
After B_CALL Trunc, OP1=00h,80h,20h,00h,...
  
Suppose op1=00h,7Fh,20h,00h,...
+
Suppose OP1=00h,7Fh,20h,00h,...
After B_CALL Trunc, op1=00h,80h,00h,00h,...
+
After B_CALL Trunc, OP1=00h,80h,00h,00h,...</nowiki>

Latest revision as of 08:15, 21 April 2005

Synopsis

Official Name: Trunc

BCALL Address: 4060

Truncates the fractional part of a floating point number in OP1.

Inputs

  • OP1 = floating point number

Outputs

  • OP1 = integer part of floating point number

Registers Destroyed

  • AF, BC, DE, HL

Comments

This is similar to the BASIC function int().

Example

Suppose OP11=00h,80h,28h,00h,...
After B_CALL Trunc, OP1=00h,80h,20h,00h,...

Suppose OP1=00h,7Fh,20h,00h,...
After B_CALL Trunc, OP1=00h,80h,00h,00h,...