80-Bus News

  

May–June 1984, Volume 3, Issue 3











Page 35 of 51











SCRAMBLE

01 8D 0190 0194 0198 O1g9c 01A0

O1A4 OLAS O1A7 OLAA O1AD O1LBO 01B3

O1B6 O1B6 O1B7 O1B8 O1B9 01BB OLBE O1Ccl 01C2 01c3 01c4 01Cc5 O1C8 O1CB OLCF 01D3 OLD7 O1DB O1DB OLDE O1E2 O1B6 OLEA OEE O1F2 O1F6 OLFA OLFC 0200 0204 0208

cD 2B 6F 63 69 20

cD DA cD cD cD c3

cS DS ES 10) ll cD El DL cl 3G CA cD 2B

6F 20

cD 28 6c 20 oF 20 65 66 6E 75 6F 63 69

M-80 Program to scramble CP/M files using an 8-bit password.

03A8 2B 20 20 73 68 20 6C 65 2B 2B

0212 O1B6 0253 0260 02C1 O1A4

10 005c 0005

O1DB O3A8 2B 20 6C 20 6E 65 2B 2B

0348

6F 73 65 72 72 20 66 69 20 6C 74 20

6E 6B 77 66 6F 6E

4E 75 66 2E 24

64 2E 24

43 65 72 2D 6c 65 69

6E 20 64 6F

14 Oct 1984

call defb

\

20:45 PAGE 1-3

exit “++ No such file. ++$7

; Read the file, scramble a sector, re-write it.

scramlp: call ip call call call jp

finish: cpm push push push ld ld eall pop pop pop ine dp call defb

tee ete tats

finishi: call defb

defb

All done ...

«+» On a “normal” cp/m system, we wouldn”t have to do anything, because we re-wrote in place. However, for such systems as the NorthStar CP/M, we must

explicitly close the file, because the write to the directory will cause the clever Lifeboat-designed BIOS to flush it’s memory-resident disk buffers.

rdsect c,finish scrambl backup wrsect scramlp

Read a sector

Exit loop if eof Scramble it Re-position for write Re-write the sector Loop until eof

close ,fcb

be

de

hi

c,close

de,feb

bdos

hl

de

be . a 3; This better work.. z,finishl

exit

“++ All done. ++$”

exit “++ Close error – file left in ”

“unknown condition. ++$7

SCRAMBLE

020c 0210

0212 0212 0213 0214 0215 0217 O21A 021D O21E 021F 0220 0221

0222 0224 0225 0226 0229 022D 0231 0235 0239 023D 0241 0245 0249 024D 0251

0253 0253 0256 0259 025A 025B 025c 02 5F

0260 0263 0264 0267

0268 026B 026C

6E 23

FE 37 cs cD 2B 65 65 72 66 20 20 64 72 64 2B

3A 3D 32 FO

3A 3D 32

M-80 Program to scramble CP/M files using an 8-bit password.

2E 20 2B

24

14

005c 0005

ol

0348

2B 61 72 20 69

62 65 6F 2E 24

20 64 72

6C 61 65 73 79 20

0080 O2F8

0256

007c

007c

0068

0068

52 20 6F 20 65 79 20 74 65 2B

14 Oct 1984

20:45 PAGE

3; Sector read routine

rdsect: cpm push push push ld

ld

eall pop pop pop or

ret

te teetete te

5; Read error or cp set ret eall defb

defb

read ,fcb be

de

hl c,read de,fcb bdos hl

de

be

a

z

eof 1

exit

1-4

All Ok

eofu Carry shows eof ret, carry set

“++ Read error – file may be *

“destroyed. ++E¶

3; Seramble the sector

scrambl: ld serlp: call xor ld ine

jp

ret

hl, 80h pseuran (hl) Chi),a 1

nz,scerlp

3; Backup the file pointer for the

backup: ld dec 1d ret

a,(febrno) a Cfebrno) ,a p

, fy

Point to sector Get pseudo random £ Scramble

More in sectoru

re-write Get sector £ Back up

Return if Ok

3 We backed up into previous extent, will have

to re-open it ld dec ld

a,(febext) a Cfcbext),a

3 x

Get extent Back up |

35


This is an OCR’d version of the scanned page and likely contains recognition errors.











Page 35 of 51