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

F/C/COMPsc1

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/COMPsc1
Read OK:
File size: 0800 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
   50:
   60PRINT "Assembling..."
   70screen   = &70
   80mem      = &74
   90temp     = &78
  100flagbyte = &7A
  110:
  120FOR N%=0 TO 2 STEP 2
  130P%=&B00
  140[OPT N%
  150.jumpvectors
  160JMP compress
  170JMP expand
  180:
  190.compress
  200JSR findflag
  210LDA flagbyte
  220LDY #0
  230STA (mem),Y
  240INC mem
  250BNE P%+4
  260INC mem+1
  270.comploop
  280LDY #0
  290LDA (screen),Y
  300.repetition
  310INY
  320CPY #255
  330BEQ sequence
  340CMP (screen),Y
  350BEQ repetition
  360CPY #4
  370BCS sequence
  380LDY #0
  390STA (mem),Y
  400INC mem
  410BNE P%+4
  420INC mem+1
  430INC screen
  440BNE comploop
  450INC screen+1
  460BPL comploop
  470RTS
  480.sequence
  490STA temp
  500STY temp+1
  510TYA
  520CLC
  530ADC screen
  540STA screen
  550BCC P%+4
  560INC screen+1
  570LDY #0
  580LDA flagbyte
  590STA (mem),Y
  600LDA temp+1
  610INY
  620STA (mem),Y
  630LDA temp
  640INY
  650STA (mem),Y
  660CLC
  670LDA mem
  680ADC #3
  690STA mem
  700BCC P%+4
  710INC mem+1
  720BIT screen+1
  730BPL comploop
  740RTS
  750.findflag
  760LDA #0
  770STA flagbyte
  780.findflag2
  790LDA screen
  800STA temp
  810LDA screen+1
  820STA temp+1
  830LDY #0
  840.findflag3
  850LDA (temp),Y
  860CMP flagbyte
  870BEQ notthis
  880INY
  890BNE findflag3
  900INC temp+1
  910BPL findflag3
  920RTS
  930.notthis
  940INC flagbyte
  950BNE findflag2
  960BRK
  970EQUB 255
  980EQUS "Can't compress screen"
  990BRK
 1000:
 1010.expand
 1020LDY #0
 1030LDA (mem),Y
 1040STA flagbyte
 1050INC mem
 1060BNE P%+4
 1070INC mem+1
 1080.exploop
 1090LDA (mem),Y
 1100CMP flagbyte
 1110BEQ unpack
 1120STA (screen),Y
 1130INC mem
 1140BNE P%+4
 1150INC mem+1
 1160INC screen
 1170BNE exploop
 1180INC screen+1
 1190BPL exploop
 1200RTS
 1210.unpack
 1220INY
 1230LDA (mem),Y
 1240STA temp
 1250TAX
 1260INY
 1270LDA (mem),Y
 1280LDY #0
 1290.storelots
 1300STA (screen),Y
 1310INY
 1320DEX
 1330BNE storelots
 1340CLC
 1350LDA mem
 1360ADC #3
 1370STA mem
 1380BCC P%+4
 1390INC mem+1
 1400LDY #0
 1410LDA temp
 1420CLC
 1430ADC screen
 1440STA screen
 1450BCC exploop
 1460INC screen+1
 1470BPL exploop
 1480RTS
 1490]
 1500NEXT
 1510:
 1520PRINT '"Code assembled."
 1530PRINT '"Saving:"
 1540A$="SAVE CPCODE1 B00 "+STR$~P%
 1550PRINT '"*";A$
 1560OSCLI A$

� >Compres
� By Richard Talbot-Watkins
� For 8-bit machines
(� (C) BAU December 1992
2:
<� "Assembling..."
Fscreen   = &70
Pmem      = &74
Ztemp     = &78
dflagbyte = &7A
n:
x� N%=0 � 2 � 2
�P%=&B00
�[OPT N%
�.jumpvectors
�JMP compress
�JMP expand
�:
�
.compress
�JSR findflag
�LDA flagbyte
�
LDY #0
�STA (mem),Y
�INC mem
�BNE P%+4

INC mem+1

.comploop

LDY #0
"LDA (screen),Y
,.repetition
6INY
@CPY #255
JBEQ sequence
TCMP (screen),Y
^BEQ repetition
h
CPY #4
rBCS sequence
|
LDY #0
�STA (mem),Y
�INC mem
�BNE P%+4
�
INC mem+1
�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
0INC screen+1
:
LDY #0
DLDA flagbyte
NSTA (mem),Y
XLDA temp+1
bINY
lSTA (mem),Y
vLDA temp
�INY
�STA (mem),Y
�CLC
�LDA mem
�
ADC #3
�STA mem
�BCC P%+4
�
INC mem+1
�BIT screen+1
�BPL comploop
�RTS
�
.findflag
�
LDA #0
STA flagbyte
.findflag2
LDA screen
 STA temp
*LDA screen+1
4STA temp+1
>
LDY #0
H.findflag3
RLDA (temp),Y
\CMP flagbyte
fBEQ notthis
pINY
zBNE findflag3
�INC temp+1
�BPL findflag3
�RTS
�.notthis
�INC flagbyte
�BNE findflag2
�BRK
�EQUB 255
� EQUS "Can't compress screen"
�BRK
�:
�.expand
�
LDY #0
LDA (mem),Y
STA flagbyte
INC mem
$BNE P%+4
.
INC mem+1
8.exploop
BLDA (mem),Y
LCMP flagbyte
VBEQ unpack
`STA (screen),Y
jINC mem
tBNE P%+4
~
INC mem+1
�INC screen
�BNE exploop
�INC screen+1
�BPL exploop
�RTS
�.unpack
�INY
�LDA (mem),Y
�STA temp
�TAX
�INY
�LDA (mem),Y

LDY #0

.storelots
STA (screen),Y
INY
(DEX
2BNE storelots
<CLC
FLDA mem
P
ADC #3
ZSTA mem
dBCC P%+4
n
INC mem+1
x
LDY #0
�LDA temp
�CLC
�ADC screen
�STA screen
�BCC exploop
�INC screen+1
�BPL exploop
�RTS
�]
��
�:
�� '"Code assembled."
�� '"Saving:"
A$="SAVE CPCODE1 B00 "+�~P%

� '"*";A$
� 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 05 3a 0d 00 3c  15 f1 20 22 41 73 73 65  |..2.:..<.. "Asse|
00000070  6d 62 6c 69 6e 67 2e 2e  2e 22 0d 00 46 12 73 63  |mbling..."..F.sc|
00000080  72 65 65 6e 20 20 20 3d  20 26 37 30 0d 00 50 12  |reen   = &70..P.|
00000090  6d 65 6d 20 20 20 20 20  20 3d 20 26 37 34 0d 00  |mem      = &74..|
000000a0  5a 12 74 65 6d 70 20 20  20 20 20 3d 20 26 37 38  |Z.temp     = &78|
000000b0  0d 00 64 12 66 6c 61 67  62 79 74 65 20 3d 20 26  |..d.flagbyte = &|
000000c0  37 41 0d 00 6e 05 3a 0d  00 78 12 e3 20 4e 25 3d  |7A..n.:..x.. N%=|
000000d0  30 20 b8 20 32 20 88 20  32 0d 00 82 0b 50 25 3d  |0 . 2 . 2....P%=|
000000e0  26 42 30 30 0d 00 8c 0b  5b 4f 50 54 20 4e 25 0d  |&B00....[OPT N%.|
000000f0  00 96 10 2e 6a 75 6d 70  76 65 63 74 6f 72 73 0d  |....jumpvectors.|
00000100  00 a0 10 4a 4d 50 20 63  6f 6d 70 72 65 73 73 0d  |...JMP compress.|
00000110  00 aa 0e 4a 4d 50 20 65  78 70 61 6e 64 0d 00 b4  |...JMP expand...|
00000120  05 3a 0d 00 be 0d 2e 63  6f 6d 70 72 65 73 73 0d  |.:.....compress.|
00000130  00 c8 10 4a 53 52 20 66  69 6e 64 66 6c 61 67 0d  |...JSR findflag.|
00000140  00 d2 10 4c 44 41 20 66  6c 61 67 62 79 74 65 0d  |...LDA flagbyte.|
00000150  00 dc 0a 4c 44 59 20 23  30 0d 00 e6 0f 53 54 41  |...LDY #0....STA|
00000160  20 28 6d 65 6d 29 2c 59  0d 00 f0 0b 49 4e 43 20  | (mem),Y....INC |
00000170  6d 65 6d 0d 00 fa 0c 42  4e 45 20 50 25 2b 34 0d  |mem....BNE P%+4.|
00000180  01 04 0d 49 4e 43 20 6d  65 6d 2b 31 0d 01 0e 0d  |...INC mem+1....|
00000190  2e 63 6f 6d 70 6c 6f 6f  70 0d 01 18 0a 4c 44 59  |.comploop....LDY|
000001a0  20 23 30 0d 01 22 12 4c  44 41 20 28 73 63 72 65  | #0..".LDA (scre|
000001b0  65 6e 29 2c 59 0d 01 2c  0f 2e 72 65 70 65 74 69  |en),Y..,..repeti|
000001c0  74 69 6f 6e 0d 01 36 07  49 4e 59 0d 01 40 0c 43  |tion..6.INY..@.C|
000001d0  50 59 20 23 32 35 35 0d  01 4a 10 42 45 51 20 73  |PY #255..J.BEQ s|
000001e0  65 71 75 65 6e 63 65 0d  01 54 12 43 4d 50 20 28  |equence..T.CMP (|
000001f0  73 63 72 65 65 6e 29 2c  59 0d 01 5e 12 42 45 51  |screen),Y..^.BEQ|
00000200  20 72 65 70 65 74 69 74  69 6f 6e 0d 01 68 0a 43  | repetition..h.C|
00000210  50 59 20 23 34 0d 01 72  10 42 43 53 20 73 65 71  |PY #4..r.BCS seq|
00000220  75 65 6e 63 65 0d 01 7c  0a 4c 44 59 20 23 30 0d  |uence..|.LDY #0.|
00000230  01 86 0f 53 54 41 20 28  6d 65 6d 29 2c 59 0d 01  |...STA (mem),Y..|
00000240  90 0b 49 4e 43 20 6d 65  6d 0d 01 9a 0c 42 4e 45  |..INC mem....BNE|
00000250  20 50 25 2b 34 0d 01 a4  0d 49 4e 43 20 6d 65 6d  | P%+4....INC mem|
00000260  2b 31 0d 01 ae 0e 49 4e  43 20 73 63 72 65 65 6e  |+1....INC screen|
00000270  0d 01 b8 10 42 4e 45 20  63 6f 6d 70 6c 6f 6f 70  |....BNE comploop|
00000280  0d 01 c2 10 49 4e 43 20  73 63 72 65 65 6e 2b 31  |....INC screen+1|
00000290  0d 01 cc 10 42 50 4c 20  63 6f 6d 70 6c 6f 6f 70  |....BPL comploop|
000002a0  0d 01 d6 07 52 54 53 0d  01 e0 0d 2e 73 65 71 75  |....RTS.....sequ|
000002b0  65 6e 63 65 0d 01 ea 0c  53 54 41 20 74 65 6d 70  |ence....STA temp|
000002c0  0d 01 f4 0e 53 54 59 20  74 65 6d 70 2b 31 0d 01  |....STY temp+1..|
000002d0  fe 07 54 59 41 0d 02 08  07 43 4c 43 0d 02 12 0e  |..TYA....CLC....|
000002e0  41 44 43 20 73 63 72 65  65 6e 0d 02 1c 0e 53 54  |ADC screen....ST|
000002f0  41 20 73 63 72 65 65 6e  0d 02 26 0c 42 43 43 20  |A screen..&.BCC |
00000300  50 25 2b 34 0d 02 30 10  49 4e 43 20 73 63 72 65  |P%+4..0.INC scre|
00000310  65 6e 2b 31 0d 02 3a 0a  4c 44 59 20 23 30 0d 02  |en+1..:.LDY #0..|
00000320  44 10 4c 44 41 20 66 6c  61 67 62 79 74 65 0d 02  |D.LDA flagbyte..|
00000330  4e 0f 53 54 41 20 28 6d  65 6d 29 2c 59 0d 02 58  |N.STA (mem),Y..X|
00000340  0e 4c 44 41 20 74 65 6d  70 2b 31 0d 02 62 07 49  |.LDA temp+1..b.I|
00000350  4e 59 0d 02 6c 0f 53 54  41 20 28 6d 65 6d 29 2c  |NY..l.STA (mem),|
00000360  59 0d 02 76 0c 4c 44 41  20 74 65 6d 70 0d 02 80  |Y..v.LDA temp...|
00000370  07 49 4e 59 0d 02 8a 0f  53 54 41 20 28 6d 65 6d  |.INY....STA (mem|
00000380  29 2c 59 0d 02 94 07 43  4c 43 0d 02 9e 0b 4c 44  |),Y....CLC....LD|
00000390  41 20 6d 65 6d 0d 02 a8  0a 41 44 43 20 23 33 0d  |A mem....ADC #3.|
000003a0  02 b2 0b 53 54 41 20 6d  65 6d 0d 02 bc 0c 42 43  |...STA mem....BC|
000003b0  43 20 50 25 2b 34 0d 02  c6 0d 49 4e 43 20 6d 65  |C P%+4....INC me|
000003c0  6d 2b 31 0d 02 d0 10 42  49 54 20 73 63 72 65 65  |m+1....BIT scree|
000003d0  6e 2b 31 0d 02 da 10 42  50 4c 20 63 6f 6d 70 6c  |n+1....BPL compl|
000003e0  6f 6f 70 0d 02 e4 07 52  54 53 0d 02 ee 0d 2e 66  |oop....RTS.....f|
000003f0  69 6e 64 66 6c 61 67 0d  02 f8 0a 4c 44 41 20 23  |indflag....LDA #|
00000400  30 0d 03 02 10 53 54 41  20 66 6c 61 67 62 79 74  |0....STA flagbyt|
00000410  65 0d 03 0c 0e 2e 66 69  6e 64 66 6c 61 67 32 0d  |e.....findflag2.|
00000420  03 16 0e 4c 44 41 20 73  63 72 65 65 6e 0d 03 20  |...LDA screen.. |
00000430  0c 53 54 41 20 74 65 6d  70 0d 03 2a 10 4c 44 41  |.STA temp..*.LDA|
00000440  20 73 63 72 65 65 6e 2b  31 0d 03 34 0e 53 54 41  | screen+1..4.STA|
00000450  20 74 65 6d 70 2b 31 0d  03 3e 0a 4c 44 59 20 23  | temp+1..>.LDY #|
00000460  30 0d 03 48 0e 2e 66 69  6e 64 66 6c 61 67 33 0d  |0..H..findflag3.|
00000470  03 52 10 4c 44 41 20 28  74 65 6d 70 29 2c 59 0d  |.R.LDA (temp),Y.|
00000480  03 5c 10 43 4d 50 20 66  6c 61 67 62 79 74 65 0d  |.\.CMP flagbyte.|
00000490  03 66 0f 42 45 51 20 6e  6f 74 74 68 69 73 0d 03  |.f.BEQ notthis..|
000004a0  70 07 49 4e 59 0d 03 7a  11 42 4e 45 20 66 69 6e  |p.INY..z.BNE fin|
000004b0  64 66 6c 61 67 33 0d 03  84 0e 49 4e 43 20 74 65  |dflag3....INC te|
000004c0  6d 70 2b 31 0d 03 8e 11  42 50 4c 20 66 69 6e 64  |mp+1....BPL find|
000004d0  66 6c 61 67 33 0d 03 98  07 52 54 53 0d 03 a2 0c  |flag3....RTS....|
000004e0  2e 6e 6f 74 74 68 69 73  0d 03 ac 10 49 4e 43 20  |.notthis....INC |
000004f0  66 6c 61 67 62 79 74 65  0d 03 b6 11 42 4e 45 20  |flagbyte....BNE |
00000500  66 69 6e 64 66 6c 61 67  32 0d 03 c0 07 42 52 4b  |findflag2....BRK|
00000510  0d 03 ca 0c 45 51 55 42  20 32 35 35 0d 03 d4 20  |....EQUB 255... |
00000520  45 51 55 53 20 22 43 61  6e 27 74 20 63 6f 6d 70  |EQUS "Can't comp|
00000530  72 65 73 73 20 73 63 72  65 65 6e 22 0d 03 de 07  |ress screen"....|
00000540  42 52 4b 0d 03 e8 05 3a  0d 03 f2 0b 2e 65 78 70  |BRK....:.....exp|
00000550  61 6e 64 0d 03 fc 0a 4c  44 59 20 23 30 0d 04 06  |and....LDY #0...|
00000560  0f 4c 44 41 20 28 6d 65  6d 29 2c 59 0d 04 10 10  |.LDA (mem),Y....|
00000570  53 54 41 20 66 6c 61 67  62 79 74 65 0d 04 1a 0b  |STA flagbyte....|
00000580  49 4e 43 20 6d 65 6d 0d  04 24 0c 42 4e 45 20 50  |INC mem..$.BNE P|
00000590  25 2b 34 0d 04 2e 0d 49  4e 43 20 6d 65 6d 2b 31  |%+4....INC mem+1|
000005a0  0d 04 38 0c 2e 65 78 70  6c 6f 6f 70 0d 04 42 0f  |..8..exploop..B.|
000005b0  4c 44 41 20 28 6d 65 6d  29 2c 59 0d 04 4c 10 43  |LDA (mem),Y..L.C|
000005c0  4d 50 20 66 6c 61 67 62  79 74 65 0d 04 56 0e 42  |MP flagbyte..V.B|
000005d0  45 51 20 75 6e 70 61 63  6b 0d 04 60 12 53 54 41  |EQ unpack..`.STA|
000005e0  20 28 73 63 72 65 65 6e  29 2c 59 0d 04 6a 0b 49  | (screen),Y..j.I|
000005f0  4e 43 20 6d 65 6d 0d 04  74 0c 42 4e 45 20 50 25  |NC mem..t.BNE P%|
00000600  2b 34 0d 04 7e 0d 49 4e  43 20 6d 65 6d 2b 31 0d  |+4..~.INC mem+1.|
00000610  04 88 0e 49 4e 43 20 73  63 72 65 65 6e 0d 04 92  |...INC screen...|
00000620  0f 42 4e 45 20 65 78 70  6c 6f 6f 70 0d 04 9c 10  |.BNE exploop....|
00000630  49 4e 43 20 73 63 72 65  65 6e 2b 31 0d 04 a6 0f  |INC screen+1....|
00000640  42 50 4c 20 65 78 70 6c  6f 6f 70 0d 04 b0 07 52  |BPL exploop....R|
00000650  54 53 0d 04 ba 0b 2e 75  6e 70 61 63 6b 0d 04 c4  |TS.....unpack...|
00000660  07 49 4e 59 0d 04 ce 0f  4c 44 41 20 28 6d 65 6d  |.INY....LDA (mem|
00000670  29 2c 59 0d 04 d8 0c 53  54 41 20 74 65 6d 70 0d  |),Y....STA temp.|
00000680  04 e2 07 54 41 58 0d 04  ec 07 49 4e 59 0d 04 f6  |...TAX....INY...|
00000690  0f 4c 44 41 20 28 6d 65  6d 29 2c 59 0d 05 00 0a  |.LDA (mem),Y....|
000006a0  4c 44 59 20 23 30 0d 05  0a 0e 2e 73 74 6f 72 65  |LDY #0.....store|
000006b0  6c 6f 74 73 0d 05 14 12  53 54 41 20 28 73 63 72  |lots....STA (scr|
000006c0  65 65 6e 29 2c 59 0d 05  1e 07 49 4e 59 0d 05 28  |een),Y....INY..(|
000006d0  07 44 45 58 0d 05 32 11  42 4e 45 20 73 74 6f 72  |.DEX..2.BNE stor|
000006e0  65 6c 6f 74 73 0d 05 3c  07 43 4c 43 0d 05 46 0b  |elots..<.CLC..F.|
000006f0  4c 44 41 20 6d 65 6d 0d  05 50 0a 41 44 43 20 23  |LDA mem..P.ADC #|
00000700  33 0d 05 5a 0b 53 54 41  20 6d 65 6d 0d 05 64 0c  |3..Z.STA mem..d.|
00000710  42 43 43 20 50 25 2b 34  0d 05 6e 0d 49 4e 43 20  |BCC P%+4..n.INC |
00000720  6d 65 6d 2b 31 0d 05 78  0a 4c 44 59 20 23 30 0d  |mem+1..x.LDY #0.|
00000730  05 82 0c 4c 44 41 20 74  65 6d 70 0d 05 8c 07 43  |...LDA temp....C|
00000740  4c 43 0d 05 96 0e 41 44  43 20 73 63 72 65 65 6e  |LC....ADC screen|
00000750  0d 05 a0 0e 53 54 41 20  73 63 72 65 65 6e 0d 05  |....STA screen..|
00000760  aa 0f 42 43 43 20 65 78  70 6c 6f 6f 70 0d 05 b4  |..BCC exploop...|
00000770  10 49 4e 43 20 73 63 72  65 65 6e 2b 31 0d 05 be  |.INC screen+1...|
00000780  0f 42 50 4c 20 65 78 70  6c 6f 6f 70 0d 05 c8 07  |.BPL exploop....|
00000790  52 54 53 0d 05 d2 05 5d  0d 05 dc 05 ed 0d 05 e6  |RTS....]........|
000007a0  05 3a 0d 05 f0 18 f1 20  27 22 43 6f 64 65 20 61  |.:..... '"Code a|
000007b0  73 73 65 6d 62 6c 65 64  2e 22 0d 05 fa 10 f1 20  |ssembled."..... |
000007c0  27 22 53 61 76 69 6e 67  3a 22 0d 06 04 1f 41 24  |'"Saving:"....A$|
000007d0  3d 22 53 41 56 45 20 43  50 43 4f 44 45 31 20 42  |="SAVE CPCODE1 B|
000007e0  30 30 20 22 2b c3 7e 50  25 0d 06 0e 0d f1 20 27  |00 "+.~P%..... '|
000007f0  22 2a 22 3b 41 24 0d 06  18 08 ff 20 41 24 0d ff  |"*";A$..... A$..|
00000800
F/C/COMPsc1.m0
F/C/COMPsc1.m1
F/C/COMPsc1.m2
F/C/COMPsc1.m4
F/C/COMPsc1.m5