The LeapYear
#1
Here, Dale Yarker shows a fast Way to find a Leap Year.

This looks very nice - for 32-Bit Systems.

Programming in 16-Bit PB 3.5  for DOS, I can only make  Cry eyes…  Huh

I use a much slower routine, calculating results for julian and gregorian calendar.

Code:
Declare _
Function iFeb(ByVal iJahr As Integer)        As Integer
Function iFeb(ByVal iJahr As Integer) Public As Integer
  If iJahr < 1582% then
    Function = 29% _
             + ( _
                 ( _
                   iJahr Mod 4% _
                 ) _
                 <> 0% _
               )
  Else
    Function = 29% _
             + ( _
                 ( _
                   iJahr/4 _
                 ) _
                 <> _
                 ( _
                   iJahr\4 _
                 ) _
                 Or _
                 ( _
                   iJahr/100 _
                 ) _
                 = _
                 ( _
                   iJahr\100 _
                 ) _
                 And _
                 ( _
                   iJahr/400 _
                 ) _
                 <> _
                 ( _
                   iJahr\400 _
                 ) _
               )
  End If
End Function

Does someone has an idea, how this could look in 16-Bit-Inline-Asm?
Reply


Messages In This Thread
The LeapYear - by Andy Dee - 07.03.2025, 16:09
RE: The LeapYear - by Dale Yarker - 07.03.2025, 23:49
RE: The LeapYear - by Andy Dee - 08.03.2025, 01:00
RE: The LeapYear - by Dale Yarker - 08.03.2025, 08:50
RE: The LeapYear - by Andy Dee - 08.03.2025, 11:57
RE: The LeapYear - by Dale Yarker - 08.03.2025, 12:06
RE: The LeapYear - by Andy Dee - 08.03.2025, 15:05
RE: The LeapYear - by Andy Dee - 08.03.2025, 20:34
RE: The LeapYear - by Andy Dee - 09.03.2025, 00:41
RE: The LeapYear - by Dale Yarker - 09.03.2025, 05:30
RE: The LeapYear - by Andy Dee - 09.03.2025, 17:01
RE: The LeapYear - by Dale Yarker - 09.03.2025, 21:18

Forum Jump:


Users browsing this thread: 1 Guest(s)