Housekeeping
This commit is contained in:
parent
affab72624
commit
330dbcbe3a
|
@ -94,24 +94,22 @@ JMP2r
|
||||||
NIP NIP
|
NIP NIP
|
||||||
|
|
||||||
JMP2r
|
JMP2r
|
||||||
&m 1f 1c 1f 1e 1f 1e 1f 1f 1e 1f 1e 1f
|
&m [ 1f 1c 1f 1e 1f 1e 1f 1f 1e 1f 1e 1f ]
|
||||||
|
|
||||||
@is-leap-year ( year* -- bool )
|
@is-leap-year ( year* -- bool )
|
||||||
|
|
||||||
( leap year if perfectly divisible by 400 )
|
( leap year if perfectly divisible by 400 )
|
||||||
DUP2 #0190 ( MOD2 ) DIV2k MUL2 SUB2 #0000 EQU2 ?&leap
|
DUP2 #0190 ( MOD2 ) DIV2k MUL2 SUB2 #0000 EQU2 ?&leap
|
||||||
( not a leap year if divisible by 100 )
|
( not a leap year if divisible by 100, but not divisible by 400 )
|
||||||
( but not divisible by 400 )
|
|
||||||
DUP2 #0064 ( MOD2 ) DIV2k MUL2 SUB2 #0000 EQU2 ?¬-leap
|
DUP2 #0064 ( MOD2 ) DIV2k MUL2 SUB2 #0000 EQU2 ?¬-leap
|
||||||
( leap year if not divisible by 100 )
|
( leap year if not divisible by 100, but divisible by 4 )
|
||||||
( but divisible by 4 )
|
#0003 AND2 #0000 EQU2
|
||||||
DUP2 #0003 AND2 #0000 EQU2 ?&leap
|
JMP2r
|
||||||
( all other years are not leap years )
|
|
||||||
¬-leap
|
¬-leap
|
||||||
POP2 #00
|
POP2 #00
|
||||||
|
|
||||||
JMP2r
|
JMP2r
|
||||||
&leap POP2 #01 JMP2r
|
&leap
|
||||||
|
POP2 #01
|
||||||
|
JMP2r
|
||||||
|
|
||||||
@print-greg ( doty* year* -- )
|
@print-greg ( doty* year* -- )
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue