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 - 03-07-2025, 04:09 PM
RE: The LeapYear - by Dale Yarker - 03-07-2025, 11:49 PM
RE: The LeapYear - by Andy Dee - 03-08-2025, 01:00 AM
RE: The LeapYear - by Dale Yarker - 03-08-2025, 08:50 AM
RE: The LeapYear - by Andy Dee - 03-08-2025, 11:57 AM
RE: The LeapYear - by Dale Yarker - 03-08-2025, 12:06 PM
RE: The LeapYear - by Andy Dee - 03-08-2025, 03:05 PM
RE: The LeapYear - by Andy Dee - 03-08-2025, 08:34 PM
RE: The LeapYear - by Andy Dee - 03-09-2025, 12:41 AM
RE: The LeapYear - by Dale Yarker - 03-09-2025, 05:30 AM
RE: The LeapYear - by Andy Dee - 03-09-2025, 05:01 PM
RE: The LeapYear - by Dale Yarker - 03-09-2025, 09:18 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)