Kernel 0.93+

This commit is contained in:
Rémy GIBERT 2019-10-26 16:33:37 +02:00
parent 9be1af0109
commit 12ad776ef6
9 changed files with 179 additions and 172 deletions

Binary file not shown.

Binary file not shown.

View File

@ -24,8 +24,8 @@ FieldNum .BS 1
StartChar .BS 1 StartChar .BS 1
EndChar .BS 1 EndChar .BS 1
Separator .BS 1 Separator .BS 1
ZS.END hToClose .BS 1
.ED ZS.END .ED
*-------------------------------------- *--------------------------------------
* File Header (16 Bytes) * File Header (16 Bytes)
*-------------------------------------- *--------------------------------------
@ -145,6 +145,10 @@ CS.RUN stz ArgCount
lda (ZPPtr1) lda (ZPPtr1)
cmp #S.FD.T.PIPE cmp #S.FD.T.PIPE
bne .97 bne .97
ldy #S.PS.hStdIn
lda (pPS),y
sta hToClose
*-------------------------------------- *--------------------------------------
CS.RUN.LOOP >SLEEP CS.RUN.LOOP >SLEEP
@ -160,8 +164,7 @@ CS.RUN.LOOP >SLEEP
beq CS.RUN.LOOP beq CS.RUN.LOOP
jsr CS.RUN.OUT jsr CS.RUN.OUT
bcs .9 bcc CS.RUN.LOOP
bra CS.RUN.LOOP
.8 cmp #MLI.E.EOF .8 cmp #MLI.E.EOF
bne .90 bne .90
@ -200,8 +203,10 @@ CS.RUN.OUT ldx FieldNum
.6 iny .6 iny
lda (ZPBufPtr),y lda (ZPBufPtr),y
beq .8 beq .8
eor Separator eor Separator
bne .6 bne .6
sta (ZPBufPtr),y sta (ZPBufPtr),y
.8 >LDYA ZPBufPtr .8 >LDYA ZPBufPtr
@ -264,7 +269,12 @@ CS.RUN.AddYToBufPtr
lda ZPBufPtr+1 lda ZPBufPtr+1
.8 rts .8 rts
*-------------------------------------- *--------------------------------------
CS.QUIT lda hBuf CS.QUIT lda hToClose
beq .1
>SYSCALL fclose Close the pipe
.1 lda hBuf
beq .8 beq .8
>SYSCALL FreeMem >SYSCALL FreeMem

View File

@ -109,6 +109,7 @@ CS.RUN stz ArgIndex
.8 lda hFile .8 lda hFile
bne .80 bne .80
ldy #S.PS.hStdIn ldy #S.PS.hStdIn
lda (pPS),y lda (pPS),y
tax tax
@ -119,6 +120,10 @@ CS.RUN stz ArgIndex
cmp #S.FD.T.PIPE cmp #S.FD.T.PIPE
bne .97 bne .97
ldy #S.PS.hStdIn
lda (pPS),y
sta hFile
.80 >LDYAI 256 .80 >LDYAI 256
>SYSCALL GetMem >SYSCALL GetMem
bcs .9 bcs .9
@ -130,12 +135,9 @@ CS.RUN.LOOP >SLEEP
>PUSHWI 256 >PUSHWI 256
>PUSHW ZPBufPtr >PUSHW ZPBufPtr
lda hFile
bne .1
ldy #S.PS.hStdIn
lda (pPS),y
.1 >SYSCALL fgets lda hFile
>SYSCALL fgets
bcs .9 bcs .9
inc LineNum inc LineNum
bne .2 bne .2
@ -219,16 +221,16 @@ CS.RUN.toUpper bit bIgnoreCase
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
CS.QUIT lda hBuf CS.QUIT lda hFILE
beq .1 beq .1
>SYSCALL FClose
.1 lda hBuf
beq .8
>SYSCALL FreeMem >SYSCALL FreeMem
.1 lda hFILE
beq .2
>SYSCALL FClose
.2
.8 clc .8 clc
rts rts
*-------------------------------------- *--------------------------------------
@ -250,8 +252,7 @@ MSG.NUMLINE .AZ "%5D:"
.DUMMY .DUMMY
.OR 0 .OR 0
DS.START DS.START
DS.END DS.END .ED
.ED
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE USR/SRC/BIN/GREP.S SAVE USR/SRC/BIN/GREP.S

View File

@ -279,21 +279,21 @@ CMD.SET.EXEC jsr CORE.ArgV.NextChar skip "`"
jmp CMD.READ.VAR jmp CMD.READ.VAR
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
CMD.DATE sec CMD.DATE >LEA.G TimeBuf
.HS 90 BCC
CMD.TIME clc
php
>LEA.G TimeBuf
>SYSCALL Time >SYSCALL Time
>PUSHEA.G TimeBuf >PUSHEA.G TimeBuf
plp
bcc .1
>PUSHW L.FMT.DATE
bra .2
.1 >PUSHW L.FMT.TIME
.2 >LEA.G StatBuf lda (ZPArgVBufPtr)
beq .1
>LDYA ZPArgVBufPtr
bra .2
.1 >LDYA L.FMT.DATE
.2 >PUSHYA
>LEA.G StatBuf
>SYSCALL StrFTime >SYSCALL StrFTime
>LEA.G StatBuf >LEA.G StatBuf
>SYSCALL puts >SYSCALL puts
@ -338,49 +338,8 @@ CMD.ECHO stz ZPPtr1 echo -N
CMD.ECHO.CSYN lda #E.CSYN CMD.ECHO.CSYN lda #E.CSYN
sec sec
rts
*--------------------------------------
CMD.GETKEY lda (ZPArgVBufPtr)
beq CMD.ECHO.CSYN
ldy #S.PS.hStdIn CMD.ECHO.RTS rts
lda (pPS),y
>SYSCALL feof
bcs .9
tay
beq .1
.10 lda #'0'
>STA.G M32.BUF
iny
lda #0
sta (pData),y
bra .8
.1 >SYSCALL getchar
bcs .9
cmp #'['
bne .4
>SYSCALL getchar
bcs .9
ldx #EscChars.Cnt-1
.2 cmp EscChars,x
beq .3
dex
bpl .2
bra .10
.3 lda EscChars.Remap,x
.4 >PUSHA
>PUSHBI 1
>PUSHW L.FMT.GETKEY
>LEA.G M32.BUF
>SYSCALL sprintf
bcs .9
.8 >PUSHEA.G M32.BUF
>LDYA ZPArgVBufPtr
>SYSCALL SetEnv
.9
CMD.GETKEY.RTS rts
*-------------------------------------- *--------------------------------------
CMD.READ lda (ZPArgVBufPtr) CMD.READ lda (ZPArgVBufPtr)
beq .9 beq .9
@ -404,7 +363,7 @@ CMD.READ lda (ZPArgVBufPtr)
>PUSHBI 0 >PUSHBI 0
>LDYA ZPArgVBufPtr >LDYA ZPArgVBufPtr
>SYSCALL printf >SYSCALL printf
bcs CMD.GETKEY.RTS bcs CMD.ECHO.RTS
bra .5 bra .5
.9 jmp CMD.E.CSYN .9 jmp CMD.E.CSYN
@ -414,7 +373,7 @@ CMD.READ lda (ZPArgVBufPtr)
beq .9 beq .9
>LDYA ZPArgVBufPtr >LDYA ZPArgVBufPtr
>SYSCALL AToL >SYSCALL AToL
bcs CMD.GETKEY.RTS bcs CMD.ECHO.RTS
>PULLA >PULLA
>STA.G READ.N >STA.G READ.N

View File

@ -107,35 +107,34 @@ CORE.Run.SYN lda #E.SYN
sec sec
rts rts
*-------------------------------------- *--------------------------------------
CORE.Run >LDYA ZPInputBufPtr Save Actual cmd for looping CORE.Run jsr IO.Reset
clc
.HS B0 BCS
CORE.Run.1 sec coming from PIPE OUT
ror
>STA.G CORE.bPipeIn
>LDYA ZPInputBufPtr Save Actual cmd for looping
>STYA ZPInputCmdPtr >STYA ZPInputCmdPtr
>LDYA ZPArgVBuf >LDYA ZPArgVBuf
>STYA ZPArgVBufPtr >STYA ZPArgVBufPtr
lda #0 Reset ArgV Buffer lda #0 Reset ArgV Buffer
sta (ZPArgVBuf) sta (ZPArgVBuf)
lda #S.PS.F.HOLD dec
sta CORE.PSFlags * lda #$ff
lda #$ff
sta CORE.IntCmd assume external sta CORE.IntCmd assume external
jsr CORE.GetCharNB lda #S.PS.F.HOLD
sta CORE.PSFlags
.3 jsr CORE.GetCharNB
bcs CORE.Run.EOF bcs CORE.Run.EOF
cmp #'|'
bne .21
jsr IO.Pipe.In cmp #C.CR empty line ?
bcs .9
jsr CORE.GetNextCharNB Skip |
bcs CORE.Run.SYN
bra .3
.21 pha
jsr IO.Reset
pla
.3 cmp #C.CR empty line ?
bne .33 bne .33
jsr CORE.GetNextChar skip CR... jsr CORE.GetNextChar skip CR...
bra .8 bra .8
@ -145,8 +144,7 @@ CORE.Run >LDYA ZPInputBufPtr Save Actual cmd for looping
.12 jsr CORE.SkipLine .12 jsr CORE.SkipLine
.8 jsr IO.Reset .8 lda #0
lda #0
clc clc
.9 rts EOL, CS,A=0 .9 rts EOL, CS,A=0
@ -197,36 +195,64 @@ CORE.Run.5 >LDYA L.CORE.IO
CORE.Run.6 jsr CORE.ArgV.Add CORE.Run.6 jsr CORE.ArgV.Add
CORE.Run.7 jsr CORE.GetCharNB CORE.Run.7 jsr CORE.GetCharNB
bcs CORE.ExecCmd.1 Nothing to skip bcs .2 Nothing to skip
jsr CORE.IsEndCmd jsr CORE.IsEndCmd
bcs CORE.Run.5 bcs CORE.Run.5
cmp #'|' tax
bne CORE.ExecCmd skip CR, ;
jsr CORE.GetNextCharNB Skip EoL char
cpx #'|' Pipe OUT ?
bne .2
sec
.1 .HS 90 BCC
.2 clc
ror
>STA.G CORE.bPipeOut
>LDA.G CORE.bPipeIn
bpl .3
jsr IO.Pipe.In
bcs CORE.Run.RTS
.3 >LDA.G CORE.bPipeOut
bpl CORE.ExecCmd
jsr IO.Pipe.Out jsr IO.Pipe.Out
bcs CORE.Run.RTS bcs CORE.Run.RTS
lda CORE.PSFlags lda #S.PS.F.HOLD Run in the background...
and #$ff^S.PS.F.HOLD Run in the background... trb CORE.PSFlags
ora #S.PS.F.CLOSEONX ...and close PIPE on exit lda #S.PS.F.CLOSEONX ...and close PIPE OUT on exit
sta CORE.PSFlags tsb CORE.PSFlags
jsr CORE.ExecCmd.1 Do not skip |
jsr CORE.ExecCmd
php php
pha pha
jsr IO.Pop.Out restore Output >LDA.G CORE.bPipeIn
bpl .4
jsr IO.Pop.In restore Input
.4 jsr IO.Pop.Out restore Output
pla pla
plp plp
bcs CORE.Run.RTS
jmp CORE.Run.1 Loop with Pipe IN
CORE.Run.RTS rts CORE.Run.RTS rts
*-------------------------------------- *--------------------------------------
* Input : ZPArgVBuf * Input : ZPArgVBuf
*-------------------------------------- *--------------------------------------
CORE.ExecCmd jsr CORE.GetNextCharNB Skip EoL char CORE.ExecCmd lda #0
CORE.ExecCmd.1 lda #0
sta (ZPArgVBufPtr) sta (ZPArgVBufPtr)
>LDYA ZPArgVBuf >LDYA ZPArgVBuf
>STYA ZPArgVBufPtr >STYA ZPArgVBufPtr
@ -252,10 +278,7 @@ CORE.ExecExtCmd >PUSHB CORE.PSFlags
>PUSHA >PUSHA
>PUSHBI 1 >PUSHBI 1
>PUSHW L.MSG.PID >PUSHW L.MSG.PID
ldy #S.PS.hStdErr jmp IO.PrintErr
lda (pPS),y
>SYSCALL fprintf
rts
.4 >SLEEP Suspend this PID .4 >SLEEP Suspend this PID
sec sec

View File

@ -48,13 +48,8 @@ IO.Reset.In sec
beq .8 beq .8
bcc .1 bcc .1
pha
ldy #S.PS.hStdIn ldy #S.PS.hStdIn
lda (pPS),y jsr IO.Close.Y
>SYSCALL fclose
pla
.1 ldy #S.PS.hStdIn .1 ldy #S.PS.hStdIn
sta (pPS),y sta (pPS),y
@ -102,11 +97,8 @@ IO.Reset.Out sec
bcc .1 bcc .1
pha
ldy #S.PS.hStdOut ldy #S.PS.hStdOut
lda (pPS),y jsr IO.Close.Y
>SYSCALL fclose
pla
.1 ldy #S.PS.hStdOut .1 ldy #S.PS.hStdOut
sta (pPS),y sta (pPS),y
@ -125,16 +117,21 @@ IO.Set.Err pha
*-------------------------------------- *--------------------------------------
IO.Reset.Err >LDA.G IO.hErr IO.Reset.Err >LDA.G IO.hErr
beq .8 beq .8
pha
ldy #S.PS.hStdErr ldy #S.PS.hStdErr
lda (pPS),y jsr IO.Close.Y
>SYSCALL fclose
pla
ldy #S.PS.hStdErr ldy #S.PS.hStdErr
sta (pPS),y sta (pPS),y
>STZ.G IO.hErr >STZ.G IO.hErr
.8 rts .8 rts
*-------------------------------------- *--------------------------------------
IO.Close.Y pha
lda (pPS),y
>SYSCALL fclose
pla
rts
*--------------------------------------
IO.Pipe.OpenR ldx #O.RDONLY+O.TEXT IO.Pipe.OpenR ldx #O.RDONLY+O.TEXT
.HS 2C BIT ABS .HS 2C BIT ABS

View File

@ -16,36 +16,34 @@ C.NOHUP .EQ 3
C.DATE .EQ 4 C.DATE .EQ 4
C.ECHO .EQ 5 C.ECHO .EQ 5
C.EXIT .EQ 6 C.EXIT .EQ 6
C.GETKEY .EQ 7 C.MD .EQ 7
C.MD .EQ 8 C.PAUSE .EQ 8
C.PAUSE .EQ 9 C.PWD .EQ 9
C.PWD .EQ 10 C.RD .EQ 10
C.RD .EQ 11 C.READ .EQ 11
C.READ .EQ 12 C.REN .EQ 12
C.REN .EQ 13 C.SET .EQ 13
C.SET .EQ 14 C.SLEEP .EQ 14
C.SLEEP .EQ 15 C.SHIFT .EQ 15
C.SHIFT .EQ 16 C.PUSHD .EQ 16
C.TIME .EQ 17 C.POPD .EQ 17
C.PUSHD .EQ 18 C.FUNCTION .EQ 18
C.POPD .EQ 19 C.CALL .EQ 19
C.FUNCTION .EQ 20 C.BREAK .EQ 20
C.CALL .EQ 21 C.SWITCH .EQ 21
C.BREAK .EQ 22 C.CASE .EQ 22
C.SWITCH .EQ 23 C.DEFAULT .EQ 23
C.CASE .EQ 24
C.DEFAULT .EQ 25
*-------------------------------------- *--------------------------------------
C.FOR .EQ 26 C.FOR .EQ 24
C.FOR.LIST .EQ 0 C.FOR.LIST .EQ 0
C.FOR.FILEEXEC .EQ 1 C.FOR.FILEEXEC .EQ 1
C.WHILE .EQ 27 C.WHILE .EQ 25
C.IF .EQ 28 C.IF .EQ 26
C.NEXT .EQ 29 C.NEXT .EQ 27
C.LOOP .EQ 30 C.LOOP .EQ 20
C.ELSE .EQ 31 C.ELSE .EQ 29
C.FI .EQ 32 C.FI .EQ 30
C.END .EQ 33 C.END .EQ 31
*-------------------------------------- *--------------------------------------
C.CLEXEC .EQ 63 C.CLEXEC .EQ 63
*-------------------------------------- *--------------------------------------
@ -124,8 +122,6 @@ L.MSG.ERROR .DA MSG.ERROR
L.MSG.PRINTENV .DA MSG.PRINTENV L.MSG.PRINTENV .DA MSG.PRINTENV
L.MSG.PID .DA MSG.PID L.MSG.PID .DA MSG.PID
L.FMT.DATE .DA FMT.DATE L.FMT.DATE .DA FMT.DATE
L.FMT.TIME .DA FMT.TIME
L.FMT.GETKEY .DA FMT.GETKEY
L.FMT.Long .DA FMT.Long L.FMT.Long .DA FMT.Long
J.ESC .DA CL.BS left arrow J.ESC .DA CL.BS left arrow
.DA HIS.GetNext .DA HIS.GetNext
@ -141,7 +137,6 @@ J.CMD .DA CMD...
.DA CMD.DATE .DA CMD.DATE
.DA CMD.ECHO .DA CMD.ECHO
.DA CMD.EXIT .DA CMD.EXIT
.DA CMD.GETKEY
.DA CMD.MD .DA CMD.MD
.DA CMD.PAUSE .DA CMD.PAUSE
.DA CMD.PWD .DA CMD.PWD
@ -151,7 +146,6 @@ J.CMD .DA CMD...
.DA CMD.SET .DA CMD.SET
.DA CMD.SLEEP .DA CMD.SLEEP
.DA CMD.SHIFT .DA CMD.SHIFT
.DA CMD.TIME
.DA CMD.PUSHD .DA CMD.PUSHD
.DA CMD.POPD .DA CMD.POPD
.DA CMD.FUNCTION .DA CMD.FUNCTION
@ -530,9 +524,7 @@ MSG.ERROR .AS "[$%h]:%S."
MSG.ECHOCRLF .AZ "\r\n" MSG.ECHOCRLF .AZ "\r\n"
MSG.PRINTENV .AZ "%s = %s\r\n" MSG.PRINTENV .AZ "%s = %s\r\n"
MSG.PID .AZ "PID=%d\r\n" MSG.PID .AZ "PID=%d\r\n"
FMT.DATE .AZ "%A (%w), %B %d %Y" FMT.DATE .AZ "%A, %B %d %Y %H:%M:%S"
FMT.TIME .AZ "%H:%M:%S (%I:%M:%S%p)"
FMT.GETKEY .AZ "%d"
FMT.Long .AZ "%L" FMT.Long .AZ "%L"
*-------------------------------------- *--------------------------------------
HOME.PROFILE .AZ "${HOME}PROFILE" HOME.PROFILE .AZ "${HOME}PROFILE"
@ -555,7 +547,6 @@ CMD .AT ".."
.AT "DATE" .AT "DATE"
.AT "ECHO" .AT "ECHO"
.AT "EXIT" .AT "EXIT"
.AT "GETKEY"
.AT "MD" .AT "MD"
.AT "PAUSE" .AT "PAUSE"
.AT "PWD" .AT "PWD"
@ -565,7 +556,6 @@ CMD .AT ".."
.AT "SET" .AT "SET"
.AT "SLEEP" .AT "SLEEP"
.AT "SHIFT" .AT "SHIFT"
.AT "TIME"
.AT "PUSHD" .AT "PUSHD"
.AT "POPD" .AT "POPD"
.AT "FUNCTION" .AT "FUNCTION"
@ -673,6 +663,8 @@ CL.Len .BS 1
CL.bReady .BS 1 CL.bReady .BS 1
CORE.hArgVBuf .BS 1 CORE.hArgVBuf .BS 1
CORE.bPipeIn .BS 1
CORE.bPipeOut .BS 1
HIS.hBuf .BS 1 HIS.hBuf .BS 1
HIS.Count .BS 1 HIS.Count .BS 1

View File

@ -39,8 +39,10 @@ K.PTime2Time jsr SHARED.SPtr1PPtr2
lsr C is high bit of month lsr C is high bit of month
ldy #S.Time.YEAR ldy #S.Time.YEAR
sta (ZPPtr2),y set year sta (ZPPtr2),y set year
sta ACC32+3 for conputing Century/WDAY later sta ACC32+3 for conputing Century/WDAY later
lda (ZPPtr1) Get Month/day lda (ZPPtr1) Get Month/day
pha save Day pha save Day
ror ror
lsr lsr
@ -53,6 +55,7 @@ K.PTime2Time jsr SHARED.SPtr1PPtr2
and #$1F and #$1F
iny iny
sta (ZPPtr2),y set day sta (ZPPtr2),y set day
lda ACC32+3 get back year lda ACC32+3 get back year
cmp #69 if before 70 CC,if > 70, CS cmp #69 if before 70 CC,if > 70, CS
lda #0 lda #0
@ -60,7 +63,7 @@ K.PTime2Time jsr SHARED.SPtr1PPtr2
eor #1 toggle C eor #1 toggle C
adc #19 set date before 1970 -> 20xx adc #19 set date before 1970 -> 20xx
sta (ZPPtr2) set Century sta (ZPPtr2) set Century
sta ACC32+2 for conputing WDAY later sta ACC32+2 for computing WDAY later
ldy #2 ldy #2
lda (ZPPtr1),y Get Min lda (ZPPtr1),y Get Min
@ -80,22 +83,28 @@ K.PTime2Time jsr SHARED.SPtr1PPtr2
*-------------------------------------- *--------------------------------------
K.ComputeWDAY lda #DAY0-1 Thursday : 4 (-1 for mod 7) K.ComputeWDAY lda #DAY0-1 Thursday : 4 (-1 for mod 7)
pha pha
lda #19
lda #CENTURY0
sta ACC32 sta ACC32
lda #70 lda #YEAR0
sta ACC32+1 sta ACC32+1
.1 ldy ACC32 .1 ldy ACC32
lda ACC32+1 lda ACC32+1
cpy ACC32+2 cpy ACC32+2
bne .2 bne .2
cmp ACC32+3 cmp ACC32+3
beq .4 beq .4
.2 jsr TIME.IsLeapYearYA CS = Leap .2 jsr TIME.IsLeapYearYA CS = Leap
pla pla
adc #1 adc #1 365 mod 7
cmp #7 cmp #7
bcc .3 bcc .3
sbc #7 MOD 7 sbc #7 MOD 7
.3 pha .3 pha
inc ACC32+1 inc ACC32+1
lda ACC32+1 lda ACC32+1
@ -109,28 +118,41 @@ K.ComputeWDAY lda #DAY0-1 Thursday : 4 (-1 for mod 7)
.4 ldy #S.Time.MONTH .4 ldy #S.Time.MONTH
lda (ZPPtr2),y get month lda (ZPPtr2),y get month
tax tax
.5 lda K.StrFTime.MDAY-1,x get day count in this month
clc dex don't include actual month
beq .71
.5 clc assume NO leap
lda K.StrFTime.MDAY-1,x get day count in this month
bne .6 february ? bne .6 february ?
ldy ACC32+2 ldy ACC32+2
lda ACC32+3 lda ACC32+3
jsr TIME.IsLeapYearYA CS = Leap jsr TIME.IsLeapYearYA CS = Leap
.6 pla .6 pla
adc K.StrFTime.MDAY-1,x adc K.StrFTime.MDAY-1,x
cmp #7 cmp #7
bcc .7 bcc .7
sbc #7 sbc #7
.7 pha .7 pha
dex dex
bne .5 bne .5
pla
.71 pla
ldy #S.Time.DAY ldy #S.Time.DAY
clc
adc (ZPPtr2),y get day in month (1..31) adc (ZPPtr2),y get day in month (1..31)
dec adjust range 0.30 for MOD 7 dec adjust range 0.30 for MOD 7
.8 cmp #7 MOD 7 .8 cmp #7 MOD 7
bcc .80 bcc .80
sbc #7 sbc #7
bra .8 bra .8
.80 inc adjust range 1..7 .80 inc adjust range 1..7
ldy #S.Time.WDAY ldy #S.Time.WDAY
sta (ZPPtr2),y sta (ZPPtr2),y
@ -256,14 +278,17 @@ K.CTime2Time.HMS
TIME.IsLeapYearYA TIME.IsLeapYearYA
cmp #0 Year = 00 ? cmp #0 Year = 00 ?
bne .1 no bne .1 no
tya year = 00, get century in a
and #$3 mod 4 = 0 ? tya year = 00, get century in A
beq .9 leap year
.8 clc not leap and #$3 Century mod 4 = 0 ?
beq .9 leap year (2000)
.8 clc not leap (1900)
rts rts
.1 and #$3 mod 4 = 0 ? .1 and #$3 mod 4 = 0 ?
bne .8 bne .8
.9 sec Leap .9 sec Leap
rts rts
*-------------------------------------- *--------------------------------------