mirror of
https://github.com/byteworksinc/ORCALib.git
synced 2024-06-12 21:29:34 +00:00
Add a helper function to get the sign bit.
This commit is contained in:
parent
98cfd4e831
commit
9e727697d3
25
math2.asm
25
math2.asm
|
@ -128,3 +128,28 @@ lb1 sta val
|
||||||
|
|
||||||
creturn 2:val
|
creturn 2:val
|
||||||
end
|
end
|
||||||
|
|
||||||
|
****************************************************************
|
||||||
|
*
|
||||||
|
* int __signbit(long double x);
|
||||||
|
*
|
||||||
|
* Get the sign bit of a floating-point value
|
||||||
|
*
|
||||||
|
* Inputs:
|
||||||
|
* val - the number
|
||||||
|
*
|
||||||
|
* Outputs:
|
||||||
|
* 0 if positive, non-zero if negative
|
||||||
|
*
|
||||||
|
****************************************************************
|
||||||
|
*
|
||||||
|
__signbit start
|
||||||
|
|
||||||
|
csubroutine (10:val),0
|
||||||
|
|
||||||
|
lda val+8
|
||||||
|
and #$8000
|
||||||
|
sta val
|
||||||
|
|
||||||
|
creturn 2:val
|
||||||
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user