04-07-2018, 12:50 PM
I ran out of labels and registers so here is a way to calculate the number of days per month using only one flag. Note that it always returns 28 days for February, so it's 98% accurate ;)
As you can see you need a modulo function. If you don't already have one in your calculator you can use this one:
Code:
CF 0
2
x><y
TEST x = y
SF 0
.
8
8
/
INT
2
GSB "modulo" ; you need a modulo function somewhere
3
0
+
F? 0
-
ABS
RTN
As you can see you need a modulo function. If you don't already have one in your calculator you can use this one:
Code:
LBL "modulo"
X<>Y
STO .7
X<>Y
/
LastX
X<>Y
INT
x
RCL .7
X<>Y
–
RTN