Skip to content

Commit

Permalink
Version 2.10
Browse files Browse the repository at this point in the history
  • Loading branch information
jdimeglio committed Mar 21, 2021
1 parent 22a546e commit 9cf2c9c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 32 deletions.
38 changes: 9 additions & 29 deletions Pack Utility.65s
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,10 @@ KBDCR = io_getc ;Keyboard control register

;------------------------------------------------------------------------
; Start Here
; 100c cccc Space
; 110c cccc DELIM
; 101c cccc OTHER
; 100c cccc Spare
; 110c cccc DASH
; 101c cccc HDASH
; 111c cccc space
;
;---------------------------------------------------------------------
*= $1000
Expand All @@ -164,67 +165,46 @@ START
LDA #$20
STA DEST+1 ;$2000 location to store



;---------------------------------------------------------------------
PACK1 LDY #0
.LOOP LDA (SRCE),y
BEQ .eol ;ends with a ZERO



CMP #SP
beq .pack
CMP #DASH
BEQ .pack
CMP #'_'
BEQ .pack

JSR BUMPSOURCE

JSR BUMPSOURCE
.WRITE STA (DEST),Y ;Save normal character
JSR BUMPDEST

JSR BUMPDEST
BRA .LOOP ;Always taken!

.pack STA DELIM ;Save character to pack
LDA #1 ;Init repetition counter
STA COUNT

.PCKLOOP JSR BUMPSOURCE ;Count number of same characters
LDA (SRCE),y
CMP DELIM
BNE .PCKEXIT ;It's not the same anymore!
INC COUNT ;Increment counter
LDA COUNT ;Don't allow it to exceed 63
LDA COUNT ;Don't allow it to exceed 31 (5 bits only)
CMP #31
BCC .PCKLOOP ;Still OK!
NOP

JSR BUMPSOURCE ;Compensate for normal exit
.PCKEXIT LDA DELIM ;Was it space or dash?
CMP #' ' ; (Makes A=0 if it is space
BEQ .SPACE ;It was space!
CMP #DASH
BEQ .DASH
LDA #%10100000 ;Set _ flag
BRA .ADDCOUNT
.DASH LDA #%11000000 ;Set dash flag
BRA .ADDCOUNT

.DASH LDA #%10100000 ;Set dash flag
BRA .ADDCOUNT

.SPACE LDA #%11100000
.ADDCOUNT ORA COUNT ;Combine with counter
BRA .WRITE
.eol RTS








;-----------------------------------------------------------------------------

BUMPSOURCE INC SRCE
Expand Down
6 changes: 3 additions & 3 deletions sysmon65.65s
Original file line number Diff line number Diff line change
Expand Up @@ -2055,9 +2055,9 @@ UNPACK_DECODE PHA ;Save packed type (space or -)
CMP #%11100000
BEQ .SPACE
CMP #%11000000
BEQ .DASH ;must be HDASH
;CMP #%10100000
;BEQ .HDASH
BEQ .DASH ;else must be HDASH
; CMP #%10100000
; BEQ .HDASH
;RTS ;return z=0 must be %10000000
.HDASH LDA #'_'
RTS ;
Expand Down

0 comments on commit 9cf2c9c

Please sign in to comment.