Difference between revisions of "83Plus:BCALLs:4060"
From WikiTI
		
		
		
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   | + | Truncates the fractional part of a floating point number in [[83Plus:RAM:8478|OP1]].  | 
=== Inputs ===  | === Inputs ===  | ||
| − | *   | + | * OP1 = floating point number  | 
=== Outputs ===  | === Outputs ===  | ||
| − | *   | + | * OP1 = integer part of floating point number    | 
=== Registers Destroyed ===  | === Registers Destroyed ===  | ||
| Line 20: | Line 20: | ||
== Example ==  | == Example ==  | ||
| − | Suppose   | + |  <nowiki>Suppose OP11=00h,80h,28h,00h,...  | 
| − | After B_CALL Trunc,   | + | After B_CALL Trunc, OP1=00h,80h,20h,00h,...  | 
| − | Suppose   | + | Suppose OP1=00h,7Fh,20h,00h,...  | 
| − | After B_CALL Trunc,   | + | 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,...