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, 05:09 PM
RE: The LeapYear - by Dale Yarker - 08.03.2025, 12:49 AM
RE: The LeapYear - by Andy Dee - 08.03.2025, 02:00 AM
RE: The LeapYear - by Dale Yarker - 08.03.2025, 09:50 AM
RE: The LeapYear - by Andy Dee - 08.03.2025, 12:57 PM
RE: The LeapYear - by Dale Yarker - 08.03.2025, 01:06 PM
RE: The LeapYear - by Andy Dee - 08.03.2025, 04:05 PM
RE: The LeapYear - by Andy Dee - 08.03.2025, 09:34 PM
RE: The LeapYear - by Andy Dee - 09.03.2025, 01:41 AM
RE: The LeapYear - by Dale Yarker - 09.03.2025, 06:30 AM
RE: The LeapYear - by Andy Dee - 09.03.2025, 06:01 PM
RE: The LeapYear - by Dale Yarker - 09.03.2025, 10:18 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)