80-Bus News

  

May-June 1984, Volume 3, Issue 3











Page 34 of 51











SCRAMBLE M80 14 Oct 1984 20:45 PAGE 1-1 Program to scramble CP/M files using an 8-bit password. if 2q eq “*’* local 2b ,2z call 22 2b: defb 7£ la: pop hi 3 Get from ld be ,2?z-?b 3 Get len else 1d hl ,?7£ endif endif if not nul ?t ld de,?t endif if not nul 71 ld be ,?71 endif call mover mf defl -l ; Show expansion endm

3 Define CP/M macro – cpm fne,parm epm macro 2£,2p push be push de push hl if hot nul 7£ ld c,7f endif if not nul ?p ld de,?p endif call bdos pop hi pop de pop be endm

00007 aseg org 100h

3 Start of program execution 0100 cD 0122 call start 0103 OD OA 53 43 defb cr,1f,’SCRAMBLE as of * 0107 52 41 4D 42 O10B 4C 45 20 61 OLOF 73 20 6F 66 0113 20 o114 31 33 2F defb OLL7 31’30 2F defb OLIA 38 34 2E defb O1ID OD OA OD OA defb 0121 24

“0’+day/10,’0*+day mod 10,’/7 “O“+month/10,’O*+month mod 10,7/7 “O’+year/10,’O"+year mod 10,7 .7 ev,lf,er,1f£,’$"

0122 dL start: pop de ; Get id 0123 OE 09 ld c,print 0125 cD 0005 call bdos 5 Print ic

>

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

0128 012B 012c 012F

0132 0134 0137 0138

013B O13E 0140 0143 0146 O14A 014E 0152 0156 015A OLSE

0162 0162 0165 0168 0168

016E O171 0173 0173 OL76 0177 0178

OL7B OL7C 017D OL7E 0180 0183 0186 0187 0188 0189 018A

21 39 22 31

26 cp 25 C2

3A FE c2 cD 2B 61 6F 6E 38 74 20

21 ll 01

21 06

cD 23 05 C2

c5

ES OE 11 cD El

cl 3c c2

0000

0407 0407

00

02F8

0134

0074

0162 03A8

2B 73 72 6F

65 2B

20 73 64 74 62 73 2B

006D O3BF 0008 039D

O3BF

08

0313

0173

OF

005c 0005

0144

M=80

50 77 20 20 79 2E 24

14 Oct 1984

20:45 PAGE 1-2

3 Init. local stack

1d add 1d ld

hi,0

hl ,sp (stack) ,hl sp,stack

3; Scramble a while to mix up the seed

ld mixup: call

dec

jp

h,O0 3 Get 256 £%s pseuran 3 Get aft

h ; More?

nz mixup ; Loop if so

; See that the password is 8 characters

ld ep jp call defb

a,( feb2+8)

ng ,pwis8 exit “++ Password not 8 bytes. ++$”

3; Save the password

pwis8: move ld 1d 1d call

t+ t+

ld ld duptest: call inc dec ip

fcb2+1, passwd ,8 hi ,feb2+1

de, passwd

be ,8

mover

Password is 8 bytes, now make sure no character is repeated more than 2 times

hl ,passwd b,8 3; 8 chars to test

hi To next char b nz ,duptest

ekdup 3; Aborts if 3 = chars 3

3; See that the input file exists

cpm push push push ld ld call pop pop pop ine ip

tee tetgte

open, feb

be

de

hl

c,open

de,fcb

bdos

hl

de

be

a 3 Ok? nz,scramlp 5; Yes, seramble the file


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











Page 34 of 51