diff --git a/BIN/MD5.S.txt b/BIN/MD5.S.txt index ba831e4b..02fc6851 100644 --- a/BIN/MD5.S.txt +++ b/BIN/MD5.S.txt @@ -17,6 +17,15 @@ FILEBUF.SIZE .EQ 4096 ZS.START ZPPtr1 .BS 2 ZPDataBufPtr .BS 2 +ZPDataLen .BS 2 + +ArgIndex .BS 1 +Arg .BS 1 +bText .BS 1 +hFile .BS 1 +hDataBuf .BS 1 +hMD5Ctx .BS 1 + ZS.END .ED *-------------------------------------- * File Header (16 Bytes) @@ -38,24 +47,21 @@ CS.START cld .DA CS.RUN .DA CS.DOEVENT .DA CS.QUIT -L.LIBCRYPT .DA LIBCRYPT L.MSG.USAGE .DA MSG.USAGE .DA 0 *-------------------------------------- -CS.INIT >LDYA L.LIBCRYPT - >SYSCALL LoadLib - bcs .9 - sta hLIBCRYPT - -.9 rts +CS.INIT clc + rts *-------------------------------------- CS.RUN ldy #S.PS.ARGC lda (pPs),y beq .99 -.1 >INC.G ArgIndex +.1 inc ArgIndex + lda ArgIndex >SYSCALL ArgV bcs .8 + >STYA ZPPtr1 lda (ZPPtr1) cmp #'-' @@ -71,70 +77,83 @@ CS.RUN ldy #S.PS.ARGC dex bpl .2 -.99 >PUSHBI 0 - >LDYA L.MSG.USAGE - >SYSCALL printf +.99 >PUSHW L.MSG.USAGE + >PUSHBI 0 + >SYSCALL printf2 lda #E.SYN sec rts .3 ldy OptionVars,x lda #$80 - sta (pData),y + sta 0,y bra .1 -.4 >LDA.G Arg +.4 lda Arg bne .99 - >LDA.G ArgIndex - >STA.G Arg + + lda ArgIndex + sta Arg bra .1 -.8 >LDA.G Arg + +.8 lda Arg beq .99 - >LDA.G bText + + lda bText beq CS.RUN.FILE *-------------------------------------- -CS.RUN.TEXT >PUSHEA.G MD5Buf - >LDA.G Arg +CS.RUN.TEXT lda Arg >SYSCALL ArgV >PUSHYA - >LIBCALL hLIBCRYPT,LIBCRYPT.MD5 + >PUSHEA.G MD5Buf + >SYSCALL MD5 jmp CS.RUN.PRINT *-------------------------------------- CS.RUN.FILE >LDYAI FILEBUF.SIZE >SYSCALL getmem bcs .9 + >STYA ZPDataBufPtr - txa - >STA.G hDataBuf - >PUSHWZ Aux type + stx hDataBuf + >PUSHWZ Aux type >PUSHBI 0 ftype >PUSHBI O.RDONLY - >LDA.G Arg + lda Arg >SYSCALL ArgV >SYSCALL FOpen bcs .9 - >STA.G hFile - >LIBCALL hLIBCRYPT,LIBCRYPT.MD5Init + + sta hFile + + >SYSCALL MD5Init bcs .9 - >STA.G hMD5Ctx + + sta hMD5Ctx + .1 >PUSHWI FILEBUF.SIZE Bytes To Read >PUSHW ZPDataBufPtr Dst Ptr - >LDA.G hFile + lda hFile >SYSCALL FRead bcc .2 + eor #MLI.E.EOF beq .8 + .9 rts -.2 >PUSHYA MD5 DataLen + +.2 >STYA ZPDataLen + + >PUSHB hMD5Ctx >PUSHW ZPDataBufPtr - >LDA.G hMD5Ctx - >LIBCALL hLIBCRYPT,LIBCRYPT.MD5Update + >PUSHW ZPDataLen + >SYSCALL MD5Update bra .1 -.8 >PUSHEA.G MD5Buf - >LDA.G hMD5Ctx - >LIBCALL hLIBCRYPT,LIBCRYPT.MD5Finalize + +.8 >PUSHB hMD5Ctx + >PUSHEA.G MD5Buf + >SYSCALL MD5Finalize + CS.RUN.PRINT >LEA.G MD5Buf - >SYSCALL strlwr >SYSCALL puts lda #0 * sec @@ -143,18 +162,16 @@ CS.RUN.PRINT >LEA.G MD5Buf CS.DOEVENT sec rts *-------------------------------------- -CS.QUIT >LDA.G hDataBuf +CS.QUIT lda hDataBuf beq .2 + >SYSCALL FreeMem -.2 >LDA.G hFile +.2 lda hFile beq .3 >SYSCALL fclose -.3 lda hLIBCRYPT - beq .4 - >SYSCALL UnloadLib -.4 clc +.3 clc rts *-------------------------------------- CS.END @@ -163,19 +180,10 @@ OptionList .AZ "Dd" OptionVars .DA #bText,#bText *-------------------------------------- MSG.USAGE .AZ "Usage : MD5 [ -d input text | input file ]\r\n" -*-------------------------------------- -LIBCRYPT .AZ "libcrypt" -hLIBCRYPT .BS 1 *-------------------------------------- .DUMMY .OR 0 DS.START -ArgIndex .BS 1 -Arg .BS 1 -bText .BS 1 -hFile .BS 1 -hDataBuf .BS 1 -hMD5Ctx .BS 1 MD5Buf .BS 33 DS.END .ED *-------------------------------------- diff --git a/BIN/USERADD.S.txt b/BIN/USERADD.S.txt index 0a9da257..b738e204 100644 --- a/BIN/USERADD.S.txt +++ b/BIN/USERADD.S.txt @@ -49,7 +49,6 @@ CS.START cld .DA CS.RUN .DA CS.DOEVENT .DA CS.QUIT -L.LIBCRYPT .DA LIBCRYPT L.MSG.USAGE .DA MSG.USAGE L.MSG.ROOTPWD1 .DA MSG.ROOTPWD1 L.MSG.ROOTPWD2 .DA MSG.ROOTPWD2 @@ -67,12 +66,8 @@ J.CS.RUN.CheckArg * Called once at process creation * Put code for loading LIB here *-------------------------------------- -CS.INIT >LDYA L.LIBCRYPT - >SYSCALL LoadLib - bcs .9 - sta hLIBCRYPT - -.9 rts +CS.INIT clc + rts *-------------------------------------- * Called until exit with CS * if RUN exits with CC, RN entered again @@ -140,9 +135,9 @@ CS.RUN.ROOT ldy #0 jsr CS.RUN.GetStr bcs .90 - >PUSHEA.G PW+S.PW.PASSWD >PUSHW ZPStrPtr - >LIBCALL hLIBCRYPT,LIBCRYPT.MD5 + >PUSHEA.G PW+S.PW.PASSWD + >SYSCALL MD5 >PUSHBI 0 >LDYA L.MSG.ROOTPWD2 >SYSCALL printf @@ -152,7 +147,7 @@ CS.RUN.ROOT ldy #0 >PUSHW ZPStrPtr >PUSHW ZPStrPtr - >LIBCALL hLIBCRYPT,LIBCRYPT.MD5 + >SYSCALL MD5 >PUSHW ZPStrPtr >LEA.G PW+S.PW.PASSWD >SYSCALL strcmp @@ -284,13 +279,9 @@ CS.RUN.CheckArg.P lda ArgIndex >SYSCALL ArgV bcs CS.RUN.CheckArg.9 - phy - pha - >PUSHEA.G S.PW.PASSWD - pla - ply >PUSHYA - >LIBCALL hLIBCRYPT,LIBCRYPT.MD5 + >PUSHEA.G S.PW.PASSWD + >SYSCALL MD5 jmp CS.RUN.CheckArg *-------------------------------------- CS.RUN.CheckArg.C @@ -355,10 +346,7 @@ CS.QUIT lda ZPhStr .1 lda ZPhPW beq .2 >SYSCALL freemem -.2 lda hLIBCRYPT - beq .8 - >SYSCALL UnloadLib -.8 clc +.2 clc rts *-------------------------------------- CS.END @@ -367,9 +355,6 @@ OptionList >PSTR "CcDdPpSs" *-------------------------------------- * Initialized DATA *-------------------------------------- -LIBCRYPT .AZ "libcrypt" -hLIBCRYPT .BS 1 -*-------------------------------------- MSG.USAGE .AS "Usage : USERADD username\r\n" .AS " -c : Comment (GECOS)\r\n" .AS " -d : Home Directory\r\n" diff --git a/SYS/KERNEL.S.MD5.txt b/SYS/KERNEL.S.MD5.txt index 7fa0f421..eba580bc 100644 --- a/SYS/KERNEL.S.MD5.txt +++ b/SYS/KERNEL.S.MD5.txt @@ -12,8 +12,7 @@ NEW * ## RETURN VALUE * CC *\-------------------------------------- -K.MD5 >DEBUG - >PULLW FORPNT +K.MD5 >PULLW FORPNT >PULLYA >STYA TXTPTR