Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_18.ADF » F/C/COMPsc2

F/C/COMPsc2

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_18.ADF
Filename: F/C/COMPsc2
Read OK:
File size: 0772 bytes
Load address: FFFF1D00
Exec address: FFFF8023
Duplicates

There is 1 duplicate copy of this file in the archive:

File contents
   10REM >Compres
   20REM By Richard Talbot-Watkins
   30REM For 8-bit machines
   40REM (C) BAU December 1992
   50REM Adapted to Write/read disc
   60REM by Richard Dimond April 1994
   70:
   80PRINT "Assembling..."
   90screen   = &70
  100mem      = &74
  110temp     = &78
  120flagbyte = &7A
  130chan     = &80
  140osbput   = &FFD4
  150osbget   = &FFD7
  160:
  170FOR N%=0 TO 2 STEP 2
  180P%=&B00
  190[OPT N%
  200.jumpvectors
  210JMP compress
  220JMP expand
  230:
  240.compress
  250JSR findflag
  260LDA flagbyte
  270LDY chan
  280JSR osbput
  290.comploop
  300LDY #0
  310LDA (screen),Y
  320.repetition
  330INY
  340CPY #255
  350BEQ sequence
  360CMP (screen),Y
  370BEQ repetition
  380CPY #4
  390BCS sequence
  400LDY chan
  410JSR osbput
  420INC screen
  430BNE comploop
  440INC screen+1
  450BPL comploop
  460RTS
  470.sequence
  480STA temp
  490STY temp+1
  500TYA
  510CLC
  520ADC screen
  530STA screen
  540BCC P%+4
  550INC screen+1
  560LDY chan
  570LDA flagbyte
  580JSR osbput
  590LDA temp+1
  600JSR osbput
  610LDA temp
  620JSR osbput
  630BIT screen+1
  640BPL comploop
  650RTS
  660.findflag
  670LDA #0
  680STA flagbyte
  690.findflag2
  700LDA screen
  710STA temp
  720LDA screen+1
  730STA temp+1
  740LDY #0
  750.findflag3
  760LDA (temp),Y
  770CMP flagbyte
  780BEQ notthis
  790INY
  800BNE findflag3
  810INC temp+1
  820BPL findflag3
  830RTS
  840.notthis
  850INC flagbyte
  860BNE findflag2
  870BRK
  880EQUB 255
  890EQUS "Can't compress screen"
  900BRK
  910:
  920.expand
  930LDY chan
  940JSR osbget
  950STA flagbyte
  960.exploop
  970LDY chan
  980JSR osbget
  990CMP flagbyte
 1000BEQ unpack
 1010LDY#0
 1020STA (screen),Y
 1030INC screen
 1040BNE exploop
 1050INC screen+1
 1060BPL exploop
 1070RTS
 1080.unpack
 1090LDY chan
 1100JSR osbget
 1110STA temp
 1120TAX
 1130LDY chan
 1140JSR osbget
 1150LDY #0
 1160.storelots
 1170STA (screen),Y
 1180INY
 1190DEX
 1200BNE storelots
 1210LDA temp
 1220CLC
 1230ADC screen
 1240STA screen
 1250BCC exploop
 1260INC screen+1
 1270BPL exploop
 1280RTS
 1290]
 1300NEXT
 1310:
 1320PRINT '"Code assembled."
 1330PRINT '"Saving:"
 1340A$="SAVE CPCODE2 B00 "+STR$~P%
 1350PRINT '"*";A$
 1360OSCLI A$

� >Compres
� By Richard Talbot-Watkins
� For 8-bit machines
(� (C) BAU December 1992
2 � Adapted to Write/read disc
<"� by Richard Dimond April 1994
F:
P� "Assembling..."
Zscreen   = &70
dmem      = &74
ntemp     = &78
xflagbyte = &7A
�chan     = &80
�osbput   = &FFD4
�osbget   = &FFD7
�:
�� N%=0 � 2 � 2
�P%=&B00
�[OPT N%
�.jumpvectors
�JMP compress
�JMP expand
�:
�
.compress
�JSR findflag
LDA flagbyte
LDY chan
JSR osbput
"
.comploop
,
LDY #0
6LDA (screen),Y
@.repetition
JINY
TCPY #255
^BEQ sequence
hCMP (screen),Y
rBEQ repetition
|
CPY #4
�BCS sequence
�LDY chan
�JSR osbput
�INC screen
�BNE comploop
�INC screen+1
�BPL comploop
�RTS
�
.sequence
�STA temp
�STY temp+1
�TYA
�CLC
ADC screen
STA screen
BCC P%+4
&INC screen+1
0LDY chan
:LDA flagbyte
DJSR osbput
NLDA temp+1
XJSR osbput
bLDA temp
lJSR osbput
vBIT screen+1
�BPL comploop
�RTS
�
.findflag
�
LDA #0
�STA flagbyte
�.findflag2
�LDA screen
�STA temp
�LDA screen+1
�STA temp+1
�
LDY #0
�.findflag3
�LDA (temp),Y
CMP flagbyte
BEQ notthis
INY
 BNE findflag3
*INC temp+1
4BPL findflag3
>RTS
H.notthis
RINC flagbyte
\BNE findflag2
fBRK
pEQUB 255
z EQUS "Can't compress screen"
�BRK
�:
�.expand
�LDY chan
�JSR osbget
�STA flagbyte
�.exploop
�LDY chan
�JSR osbget
�CMP flagbyte
�BEQ unpack
�	LDY#0
�STA (screen),Y
INC screen
BNE exploop
INC screen+1
$BPL exploop
.RTS
8.unpack
BLDY chan
LJSR osbget
VSTA temp
`TAX
jLDY chan
tJSR osbget
~
LDY #0
�.storelots
�STA (screen),Y
�INY
�DEX
�BNE storelots
�LDA temp
�CLC
�ADC screen
�STA screen
�BCC exploop
�INC screen+1
�BPL exploop
RTS

]
�
:
(� '"Code assembled."
2� '"Saving:"
<A$="SAVE CPCODE2 B00 "+�~P%
F
� '"*";A$
P� A$
�
00000000  0d 00 0a 0e f4 20 3e 43  6f 6d 70 72 65 73 0d 00  |..... >Compres..|
00000010  14 1f f4 20 42 79 20 52  69 63 68 61 72 64 20 54  |... By Richard T|
00000020  61 6c 62 6f 74 2d 57 61  74 6b 69 6e 73 0d 00 1e  |albot-Watkins...|
00000030  18 f4 20 46 6f 72 20 38  2d 62 69 74 20 6d 61 63  |.. For 8-bit mac|
00000040  68 69 6e 65 73 0d 00 28  1b f4 20 28 43 29 20 42  |hines..(.. (C) B|
00000050  41 55 20 44 65 63 65 6d  62 65 72 20 31 39 39 32  |AU December 1992|
00000060  0d 00 32 20 f4 20 41 64  61 70 74 65 64 20 74 6f  |..2 . Adapted to|
00000070  20 57 72 69 74 65 2f 72  65 61 64 20 64 69 73 63  | Write/read disc|
00000080  0d 00 3c 22 f4 20 62 79  20 52 69 63 68 61 72 64  |..<". by Richard|
00000090  20 44 69 6d 6f 6e 64 20  41 70 72 69 6c 20 31 39  | Dimond April 19|
000000a0  39 34 0d 00 46 05 3a 0d  00 50 15 f1 20 22 41 73  |94..F.:..P.. "As|
000000b0  73 65 6d 62 6c 69 6e 67  2e 2e 2e 22 0d 00 5a 12  |sembling..."..Z.|
000000c0  73 63 72 65 65 6e 20 20  20 3d 20 26 37 30 0d 00  |screen   = &70..|
000000d0  64 12 6d 65 6d 20 20 20  20 20 20 3d 20 26 37 34  |d.mem      = &74|
000000e0  0d 00 6e 12 74 65 6d 70  20 20 20 20 20 3d 20 26  |..n.temp     = &|
000000f0  37 38 0d 00 78 12 66 6c  61 67 62 79 74 65 20 3d  |78..x.flagbyte =|
00000100  20 26 37 41 0d 00 82 12  63 68 61 6e 20 20 20 20  | &7A....chan    |
00000110  20 3d 20 26 38 30 0d 00  8c 14 6f 73 62 70 75 74  | = &80....osbput|
00000120  20 20 20 3d 20 26 46 46  44 34 0d 00 96 14 6f 73  |   = &FFD4....os|
00000130  62 67 65 74 20 20 20 3d  20 26 46 46 44 37 0d 00  |bget   = &FFD7..|
00000140  a0 05 3a 0d 00 aa 12 e3  20 4e 25 3d 30 20 b8 20  |..:..... N%=0 . |
00000150  32 20 88 20 32 0d 00 b4  0b 50 25 3d 26 42 30 30  |2 . 2....P%=&B00|
00000160  0d 00 be 0b 5b 4f 50 54  20 4e 25 0d 00 c8 10 2e  |....[OPT N%.....|
00000170  6a 75 6d 70 76 65 63 74  6f 72 73 0d 00 d2 10 4a  |jumpvectors....J|
00000180  4d 50 20 63 6f 6d 70 72  65 73 73 0d 00 dc 0e 4a  |MP compress....J|
00000190  4d 50 20 65 78 70 61 6e  64 0d 00 e6 05 3a 0d 00  |MP expand....:..|
000001a0  f0 0d 2e 63 6f 6d 70 72  65 73 73 0d 00 fa 10 4a  |...compress....J|
000001b0  53 52 20 66 69 6e 64 66  6c 61 67 0d 01 04 10 4c  |SR findflag....L|
000001c0  44 41 20 66 6c 61 67 62  79 74 65 0d 01 0e 0c 4c  |DA flagbyte....L|
000001d0  44 59 20 63 68 61 6e 0d  01 18 0e 4a 53 52 20 6f  |DY chan....JSR o|
000001e0  73 62 70 75 74 0d 01 22  0d 2e 63 6f 6d 70 6c 6f  |sbput.."..complo|
000001f0  6f 70 0d 01 2c 0a 4c 44  59 20 23 30 0d 01 36 12  |op..,.LDY #0..6.|
00000200  4c 44 41 20 28 73 63 72  65 65 6e 29 2c 59 0d 01  |LDA (screen),Y..|
00000210  40 0f 2e 72 65 70 65 74  69 74 69 6f 6e 0d 01 4a  |@..repetition..J|
00000220  07 49 4e 59 0d 01 54 0c  43 50 59 20 23 32 35 35  |.INY..T.CPY #255|
00000230  0d 01 5e 10 42 45 51 20  73 65 71 75 65 6e 63 65  |..^.BEQ sequence|
00000240  0d 01 68 12 43 4d 50 20  28 73 63 72 65 65 6e 29  |..h.CMP (screen)|
00000250  2c 59 0d 01 72 12 42 45  51 20 72 65 70 65 74 69  |,Y..r.BEQ repeti|
00000260  74 69 6f 6e 0d 01 7c 0a  43 50 59 20 23 34 0d 01  |tion..|.CPY #4..|
00000270  86 10 42 43 53 20 73 65  71 75 65 6e 63 65 0d 01  |..BCS sequence..|
00000280  90 0c 4c 44 59 20 63 68  61 6e 0d 01 9a 0e 4a 53  |..LDY chan....JS|
00000290  52 20 6f 73 62 70 75 74  0d 01 a4 0e 49 4e 43 20  |R osbput....INC |
000002a0  73 63 72 65 65 6e 0d 01  ae 10 42 4e 45 20 63 6f  |screen....BNE co|
000002b0  6d 70 6c 6f 6f 70 0d 01  b8 10 49 4e 43 20 73 63  |mploop....INC sc|
000002c0  72 65 65 6e 2b 31 0d 01  c2 10 42 50 4c 20 63 6f  |reen+1....BPL co|
000002d0  6d 70 6c 6f 6f 70 0d 01  cc 07 52 54 53 0d 01 d6  |mploop....RTS...|
000002e0  0d 2e 73 65 71 75 65 6e  63 65 0d 01 e0 0c 53 54  |..sequence....ST|
000002f0  41 20 74 65 6d 70 0d 01  ea 0e 53 54 59 20 74 65  |A temp....STY te|
00000300  6d 70 2b 31 0d 01 f4 07  54 59 41 0d 01 fe 07 43  |mp+1....TYA....C|
00000310  4c 43 0d 02 08 0e 41 44  43 20 73 63 72 65 65 6e  |LC....ADC screen|
00000320  0d 02 12 0e 53 54 41 20  73 63 72 65 65 6e 0d 02  |....STA screen..|
00000330  1c 0c 42 43 43 20 50 25  2b 34 0d 02 26 10 49 4e  |..BCC P%+4..&.IN|
00000340  43 20 73 63 72 65 65 6e  2b 31 0d 02 30 0c 4c 44  |C screen+1..0.LD|
00000350  59 20 63 68 61 6e 0d 02  3a 10 4c 44 41 20 66 6c  |Y chan..:.LDA fl|
00000360  61 67 62 79 74 65 0d 02  44 0e 4a 53 52 20 6f 73  |agbyte..D.JSR os|
00000370  62 70 75 74 0d 02 4e 0e  4c 44 41 20 74 65 6d 70  |bput..N.LDA temp|
00000380  2b 31 0d 02 58 0e 4a 53  52 20 6f 73 62 70 75 74  |+1..X.JSR osbput|
00000390  0d 02 62 0c 4c 44 41 20  74 65 6d 70 0d 02 6c 0e  |..b.LDA temp..l.|
000003a0  4a 53 52 20 6f 73 62 70  75 74 0d 02 76 10 42 49  |JSR osbput..v.BI|
000003b0  54 20 73 63 72 65 65 6e  2b 31 0d 02 80 10 42 50  |T screen+1....BP|
000003c0  4c 20 63 6f 6d 70 6c 6f  6f 70 0d 02 8a 07 52 54  |L comploop....RT|
000003d0  53 0d 02 94 0d 2e 66 69  6e 64 66 6c 61 67 0d 02  |S.....findflag..|
000003e0  9e 0a 4c 44 41 20 23 30  0d 02 a8 10 53 54 41 20  |..LDA #0....STA |
000003f0  66 6c 61 67 62 79 74 65  0d 02 b2 0e 2e 66 69 6e  |flagbyte.....fin|
00000400  64 66 6c 61 67 32 0d 02  bc 0e 4c 44 41 20 73 63  |dflag2....LDA sc|
00000410  72 65 65 6e 0d 02 c6 0c  53 54 41 20 74 65 6d 70  |reen....STA temp|
00000420  0d 02 d0 10 4c 44 41 20  73 63 72 65 65 6e 2b 31  |....LDA screen+1|
00000430  0d 02 da 0e 53 54 41 20  74 65 6d 70 2b 31 0d 02  |....STA temp+1..|
00000440  e4 0a 4c 44 59 20 23 30  0d 02 ee 0e 2e 66 69 6e  |..LDY #0.....fin|
00000450  64 66 6c 61 67 33 0d 02  f8 10 4c 44 41 20 28 74  |dflag3....LDA (t|
00000460  65 6d 70 29 2c 59 0d 03  02 10 43 4d 50 20 66 6c  |emp),Y....CMP fl|
00000470  61 67 62 79 74 65 0d 03  0c 0f 42 45 51 20 6e 6f  |agbyte....BEQ no|
00000480  74 74 68 69 73 0d 03 16  07 49 4e 59 0d 03 20 11  |tthis....INY.. .|
00000490  42 4e 45 20 66 69 6e 64  66 6c 61 67 33 0d 03 2a  |BNE findflag3..*|
000004a0  0e 49 4e 43 20 74 65 6d  70 2b 31 0d 03 34 11 42  |.INC temp+1..4.B|
000004b0  50 4c 20 66 69 6e 64 66  6c 61 67 33 0d 03 3e 07  |PL findflag3..>.|
000004c0  52 54 53 0d 03 48 0c 2e  6e 6f 74 74 68 69 73 0d  |RTS..H..notthis.|
000004d0  03 52 10 49 4e 43 20 66  6c 61 67 62 79 74 65 0d  |.R.INC flagbyte.|
000004e0  03 5c 11 42 4e 45 20 66  69 6e 64 66 6c 61 67 32  |.\.BNE findflag2|
000004f0  0d 03 66 07 42 52 4b 0d  03 70 0c 45 51 55 42 20  |..f.BRK..p.EQUB |
00000500  32 35 35 0d 03 7a 20 45  51 55 53 20 22 43 61 6e  |255..z EQUS "Can|
00000510  27 74 20 63 6f 6d 70 72  65 73 73 20 73 63 72 65  |'t compress scre|
00000520  65 6e 22 0d 03 84 07 42  52 4b 0d 03 8e 05 3a 0d  |en"....BRK....:.|
00000530  03 98 0b 2e 65 78 70 61  6e 64 0d 03 a2 0c 4c 44  |....expand....LD|
00000540  59 20 63 68 61 6e 0d 03  ac 0e 4a 53 52 20 6f 73  |Y chan....JSR os|
00000550  62 67 65 74 0d 03 b6 10  53 54 41 20 66 6c 61 67  |bget....STA flag|
00000560  62 79 74 65 0d 03 c0 0c  2e 65 78 70 6c 6f 6f 70  |byte.....exploop|
00000570  0d 03 ca 0c 4c 44 59 20  63 68 61 6e 0d 03 d4 0e  |....LDY chan....|
00000580  4a 53 52 20 6f 73 62 67  65 74 0d 03 de 10 43 4d  |JSR osbget....CM|
00000590  50 20 66 6c 61 67 62 79  74 65 0d 03 e8 0e 42 45  |P flagbyte....BE|
000005a0  51 20 75 6e 70 61 63 6b  0d 03 f2 09 4c 44 59 23  |Q unpack....LDY#|
000005b0  30 0d 03 fc 12 53 54 41  20 28 73 63 72 65 65 6e  |0....STA (screen|
000005c0  29 2c 59 0d 04 06 0e 49  4e 43 20 73 63 72 65 65  |),Y....INC scree|
000005d0  6e 0d 04 10 0f 42 4e 45  20 65 78 70 6c 6f 6f 70  |n....BNE exploop|
000005e0  0d 04 1a 10 49 4e 43 20  73 63 72 65 65 6e 2b 31  |....INC screen+1|
000005f0  0d 04 24 0f 42 50 4c 20  65 78 70 6c 6f 6f 70 0d  |..$.BPL exploop.|
00000600  04 2e 07 52 54 53 0d 04  38 0b 2e 75 6e 70 61 63  |...RTS..8..unpac|
00000610  6b 0d 04 42 0c 4c 44 59  20 63 68 61 6e 0d 04 4c  |k..B.LDY chan..L|
00000620  0e 4a 53 52 20 6f 73 62  67 65 74 0d 04 56 0c 53  |.JSR osbget..V.S|
00000630  54 41 20 74 65 6d 70 0d  04 60 07 54 41 58 0d 04  |TA temp..`.TAX..|
00000640  6a 0c 4c 44 59 20 63 68  61 6e 0d 04 74 0e 4a 53  |j.LDY chan..t.JS|
00000650  52 20 6f 73 62 67 65 74  0d 04 7e 0a 4c 44 59 20  |R osbget..~.LDY |
00000660  23 30 0d 04 88 0e 2e 73  74 6f 72 65 6c 6f 74 73  |#0.....storelots|
00000670  0d 04 92 12 53 54 41 20  28 73 63 72 65 65 6e 29  |....STA (screen)|
00000680  2c 59 0d 04 9c 07 49 4e  59 0d 04 a6 07 44 45 58  |,Y....INY....DEX|
00000690  0d 04 b0 11 42 4e 45 20  73 74 6f 72 65 6c 6f 74  |....BNE storelot|
000006a0  73 0d 04 ba 0c 4c 44 41  20 74 65 6d 70 0d 04 c4  |s....LDA temp...|
000006b0  07 43 4c 43 0d 04 ce 0e  41 44 43 20 73 63 72 65  |.CLC....ADC scre|
000006c0  65 6e 0d 04 d8 0e 53 54  41 20 73 63 72 65 65 6e  |en....STA screen|
000006d0  0d 04 e2 0f 42 43 43 20  65 78 70 6c 6f 6f 70 0d  |....BCC exploop.|
000006e0  04 ec 10 49 4e 43 20 73  63 72 65 65 6e 2b 31 0d  |...INC screen+1.|
000006f0  04 f6 0f 42 50 4c 20 65  78 70 6c 6f 6f 70 0d 05  |...BPL exploop..|
00000700  00 07 52 54 53 0d 05 0a  05 5d 0d 05 14 05 ed 0d  |..RTS....]......|
00000710  05 1e 05 3a 0d 05 28 18  f1 20 27 22 43 6f 64 65  |...:..(.. '"Code|
00000720  20 61 73 73 65 6d 62 6c  65 64 2e 22 0d 05 32 10  | assembled."..2.|
00000730  f1 20 27 22 53 61 76 69  6e 67 3a 22 0d 05 3c 1f  |. '"Saving:"..<.|
00000740  41 24 3d 22 53 41 56 45  20 43 50 43 4f 44 45 32  |A$="SAVE CPCODE2|
00000750  20 42 30 30 20 22 2b c3  7e 50 25 0d 05 46 0d f1  | B00 "+.~P%..F..|
00000760  20 27 22 2a 22 3b 41 24  0d 05 50 08 ff 20 41 24  | '"*";A$..P.. A$|
00000770  0d ff                                             |..|
00000772
F/C/COMPsc2.m0
F/C/COMPsc2.m1
F/C/COMPsc2.m2
F/C/COMPsc2.m4
F/C/COMPsc2.m5