Post Reply 
(11C) (15C) days per month (without labels or registers)
04-07-2018, 12:50 PM
Post: #1
(11C) (15C) days per month (without labels or registers)
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 ;)

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
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(11C) (15C) days per month (without labels or registers) - Michael Zinn - 04-07-2018 12:50 PM



User(s) browsing this thread: 1 Guest(s)