mirror of
https://github.com/A2osX/A2osX.git
synced 2025-01-25 12:30:06 +00:00
Kernel 0.93++
This commit is contained in:
parent
149a3bd080
commit
b6f7d0ec1a
@ -4,11 +4,8 @@ NEW
|
||||
.DUMMY
|
||||
.OR ZPTMP 29 bytes
|
||||
ZS.START
|
||||
ZPDataPtr .BS 2
|
||||
ZPDataLen .BS 2
|
||||
ZPHashPtr .BS 2
|
||||
|
||||
ZPCtxPtr .BS 2
|
||||
ZPDataLen .BS 2
|
||||
|
||||
ZPChunkLen .BS 2
|
||||
|
||||
@ -94,12 +91,13 @@ ZS.END .ED
|
||||
* ## RETURN VALUE
|
||||
* CC
|
||||
*\--------------------------------------
|
||||
K.MD5 >PULLW ZPHashPtr
|
||||
>PULLW ZPDataPtr
|
||||
|
||||
>LDYA ZPDataPtr
|
||||
K.MD5 >PULLW FORPNT
|
||||
>PULLYA
|
||||
>STYA TXTPTR
|
||||
|
||||
>SYSCALL2 strlen
|
||||
>STYA ZPDataLen
|
||||
|
||||
.1 jsr K.MD5Init
|
||||
bcs .9
|
||||
pha save MD5 Context hMem
|
||||
@ -157,7 +155,7 @@ K.MD5Init >LDYAI S.MD5
|
||||
* ## RETURN VALUE
|
||||
*\--------------------------------------
|
||||
K.MD5Update >PULLW ZPDataLen get LEN
|
||||
>PULLW ZPDataPtr get DATA
|
||||
>PULLW TXTPTR get DATA
|
||||
>PULLA
|
||||
>SYSCALL2 GetMemPtr get MD5 Context
|
||||
>STYA ZPCtxPtr
|
||||
@ -178,12 +176,15 @@ MD5Update.I ldy #S.MD5.FINALIZED
|
||||
.3 lda #64
|
||||
.50 sta ZPChunkLen Save Chunk Len
|
||||
jsr MD5UpdateBitCount
|
||||
|
||||
ldy #0
|
||||
.51 lda (ZPDataPtr),y Load Buffer with data
|
||||
|
||||
.51 jsr SHARED.TXTPTR.GetY Load Buffer with data
|
||||
sta MD5.BUFFER64,y
|
||||
iny
|
||||
cpy ZPChunkLen
|
||||
bne .51
|
||||
|
||||
cpy #64 Full 64 Bytes DATA ?
|
||||
beq .58
|
||||
* Append "$80" & Padding & original size
|
||||
@ -211,12 +212,13 @@ MD5Update.I ldy #S.MD5.FINALIZED
|
||||
sta ZPDataLen
|
||||
bcs .81
|
||||
dec ZPDataLen+1
|
||||
.81 lda ZPDataPtr Add Bytes processed to DATA
|
||||
|
||||
.81 lda TXTPTR Add Bytes processed to DATA
|
||||
clc
|
||||
adc ZPChunkLen
|
||||
sta ZPDataPtr
|
||||
sta TXTPTR
|
||||
bcc .1
|
||||
inc ZPDataPtr+1
|
||||
inc TXTPTR+1
|
||||
bra .1
|
||||
*/--------------------------------------
|
||||
* ## MD5Finalize
|
||||
@ -228,15 +230,15 @@ MD5Update.I ldy #S.MD5.FINALIZED
|
||||
* `>SYSCALL MD5Finalize`
|
||||
* ## RETURN VALUE
|
||||
*\--------------------------------------
|
||||
K.MD5Finalize pha
|
||||
>PULLW ZPHashPtr
|
||||
pla
|
||||
pha
|
||||
K.MD5Finalize >PULLW FORPNT
|
||||
>PULLA
|
||||
sta .8+1
|
||||
>SYSCALL2 GetMemPtr
|
||||
>STYA ZPCtxPtr get MD5 Context
|
||||
|
||||
jsr MD5Finalize.I
|
||||
|
||||
pla
|
||||
.8 lda #$ff SELF MODIFIED
|
||||
>SYSCALL2 FreeMem
|
||||
rts
|
||||
|
||||
@ -254,23 +256,20 @@ MD5Finalize.I ldy #S.MD5.FINALIZED
|
||||
lsr
|
||||
tax
|
||||
lda MD5.DIGITS,x
|
||||
sta (ZPHashPtr)
|
||||
inc ZPHashPtr
|
||||
bne .2
|
||||
inc ZPHashPtr+1
|
||||
.2 lda (ZPCtxPtr),y
|
||||
jsr SHARED.FORPNT.PutNext
|
||||
|
||||
lda (ZPCtxPtr),y
|
||||
and #$0F
|
||||
tax
|
||||
lda MD5.DIGITS,x
|
||||
sta (ZPHashPtr)
|
||||
inc ZPHashPtr
|
||||
bne .3
|
||||
inc ZPHashPtr+1
|
||||
.3 iny
|
||||
jsr SHARED.FORPNT.PutNext
|
||||
|
||||
iny
|
||||
cpy #S.MD5.ABCD0+16
|
||||
bne .1
|
||||
|
||||
lda #0
|
||||
sta (ZPHashPtr)
|
||||
jsr SHARED.FORPNT.PutNext
|
||||
clc
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user