(base64) Fixed issue where ends too early

This commit is contained in:
Devine Lu Linvega 2024-06-05 10:39:58 -08:00
parent 6177f80024
commit 183c2930eb
1 changed files with 14 additions and 22 deletions

View File

@ -1,25 +1,21 @@
( uxncli b64enc.rom data ) ( uxncli b64enc.rom data )
|10 @Console &vector $2 &read $1 &pad $4 &type $1 &write $1 &error $1 |10 @Console &vector $2 &read $1 &pad $4 &type $1 &write $1 &error $1
|000
|0000
@queue $1 @queue $1
|0100 |100
@on-reset ( -> ) @on-reset ( -> )
;on-console .Console/vector DEO2 ;on-console .Console/vector DEO2
BRK BRK
@on-console ( -> ) @on-console ( -> )
.Console/read DEI DUP ?{ .Console/type DEI #04 EQU ?{ .Console/read DEI <b64enc>
&terminate ( -> ) BRK }
.queue LDZ EQU ?{ #00 <b64enc> } .queue LDZ EQU ?{ #00 <b64enc> }
#800f DEO #800f DEO
BRK }
<b64enc>
.Console/type DEI #04 EQU ?&terminate
BRK BRK
( (
@ -28,21 +24,17 @@
@<b64enc> ( byte -- ) @<b64enc> ( byte -- )
,&buf STR ,&buf STR
#0800 #0800
&l ( -- ) &>l ( -- )
[ LIT &buf $1 ] OVR #07 SWP SUB SFT #01 AND [ LIT &buf $1 ] OVR #07 SWP SUB SFT #01 AND
[ LIT &inc $1 ] INCk #06 DIVk MUL SUB ,&inc STR ( ) [ LIT &inc $1 ] INCk #06 DIVk MUL SUB ,&inc STR
( bit id -- ) ( bit id -- ) SWP .queue LDZ ORA DUP ADD .queue STZ
SWP .queue LDZ ORA DUP ADD .queue STZ
#05 NEQ ?{ #05 NEQ ?{
[ LIT2 00 -queue ] [ LIT2 00 -queue ] DUP2 LDZ #01 SFT ;MIME ADD2 LDA #18 DEO
DUP2 LDZ #01 SFT ;MIME ADD2 LDA #18 DEO
STZ } STZ }
INC GTHk ?&l INC GTHk ?&>l
POP2 JMP2r POP2 JMP2r
@MIME [ @MIME [
"ABCDEFGHIJKLMNOP "ABCDEFGHIJKLMNOP "QRSTUVWXYZabcdef
"QRSTUVWXYZabcdef "ghijklmnopqrstuv "wxyz0123456789+/ ]
"ghijklmnopqrstuv
"wxyz0123456789+/ ]