-
Notifications
You must be signed in to change notification settings - Fork 1
/
applemlx.txt
52 lines (52 loc) · 2.68 KB
/
applemlx.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
100 N=9: HOME: NORMAL: PRINT "APPLE MLX": POKE 34,2: ONERR GOTO 610
110 VTAB 1: HTAB 20: PRINT "START ADDRESS";: GOSUB 530: IF A=0 THEN PRINT CHR$ (7): GOTO 110
120 S=A
130 VTAB 2: HTAB 20: PRINT "END ADDRESS ";: GOSUB 530: IF S>=A OR A=0 THEN PRINT CHR$ (7): GOTO 130
140 E=A
150 PRINT: PRINT "CHOOSE:(E)NTER DATA";: HTAB 22: PRINT "(D)ISPLAY DATA": HTAB 8: PRINT "(L)OAD FILE (S)AVE FILE (Q)UIT": PRINT
160 GET A$: FOR I=1 TO 5: IF A$ < > MID$ ("EDLSQ",I,1) THEN NEXT: GOTO 160
170 ON I GOTO 270,220,180,200: POKE 34,0: END
180 INPUT "FILENAME: ";A$: IF A$ < > "" THEN PRINT CHR$ (4);"BLOAD";A$;",A";S
190 GOTO 150
200 INPUT "FILENAME: ";A$: IF A$ < > "" THEN PRINT CHR$ (4);"BSAVE";A$;",A";S;",L";E-S
210 GOTO 150
220 GOSUB 590: IF B=0 THEN 150
230 FOR B=B TO E STEP 8:L=4:A=B:GOSUB 580: PRINT A$;": ";:L=2
240 FOR F=0 TO 7:V(F+1)=PEEK(B+F):NEXT:GOSUB 560:V(9)=C
250 FOR F=1 TO N:A=V(F):GOSUB 580:PRINT A$" ";: NEXT: PRINT: IF PEEK(49152)<128 THEN NEXT
260 POKE 49168,0: GOTO 150
270 GOSUB 590: IF B=0 THEN 150
280 FOR B=B TO E STEP 8
290 HTAB 1:A=B:L=4:GOSUB 580:PRINT A$;": ";: CALL 64668:A$="":PRINT A$;": ";: CALL 64668:A$ = "":P=0: GOSUB 330: IF L=0 THEN 150
300 GOSUB 470: IF F<>N THEN PRINT CHR$(7);: GOTO 290
310 IF N=9 THEN GOSUB 560: IF C<> V(9) THEN PRINT CHR$(7);: GOTO 290
320 FOR F=1 TO 8: POKE B+F-1,V(F): NEXT: PRINT: NEXT: GOTO 150
330 IF LEN(A$)=33 THEN A$=O$:P=O: PRINT CHR$(7);
340 L=LEN(A$):O$=A$:O=P:L$="": IF P>0 THEN L$=LEFT$(A$,P)
350 R$="": IF P<L-1 THEN R$=RIGHT$(A$,L-P-1)
360 HTAB 7:PRINT L$;: FLASH: IF P<L THEN PRINT MID$(A$,P+1,1);: NORMAL: PRINT R$;
370 PRINT " ";: NORMAL
380 K=PEEK(49152): IF K<128 THEN 380
390 POKE 49168,0:K=K-128
400 IF K=13 THEN HTAB 7: PRINT A$;"";: RETURN
410 IF K=32 OR K>47 AND K<58 OR K>64 AND K<71 THEN A$=L$+CHR$(K)+R$:P=P+1
420 IF K=4 THEN A$=L$+R$
430 IF K=9 THEN A$=L$+" "+MID$(A$,P+1,1)+R$
440 IF K=8 THEN P=P-(P>0)
450 IF K=21 THEN P=P+(P<L)
460 GOTO 330
470 F=1:D=0:FOR P=1 TO LEN(A$): C$=MID$(A$,P,1): IF F>N AND C$<>" " THEN RETURN
480 IF C$<>" " THEN GOSUB 520:V(F)=J+16*(D=1)*V(F):D=D+1
490 IF D>0 AND C$=" " OR D=2 THEN D=0:F=F+1
500 NEXT: IF D=0 THEN F=F-1
510 RETURN
520 J=ASC(C$):J=J-48-7*(J>64): RETURN
530 A=0: INPUT A$:A$=LEFT$(A$,4): IF LEN(A$)=0 THEN RETURN
540 FOR P=1 TO LEN(A$):C$=MID$(A$,P,1): IF C$<"0" OR C$>"9" AND C$<"A" OR C$>"Z" THEN A=0: RETURN
550 GOSUB 520: A=A*16+J: NEXT: RETURN
560 C=INT(B/256): C=B-254*C-255*(C>127): C=C-255*(C>255)
570 FOR F=1 TO 8:C=C*2-255*(C>127)+V(F):C=C-255*(C>255):NEXT:RETURN
580 I=FRE(0):A$="":FOR I=1 TO L:T=INT(A/16):A$=MID$("0123456789ABCDEF",A-16*T+1,1)+A$:A=T:NEXT:RETURN
590 PRINT "FROM ADDRESS ";: GOSUB 530: IF S>A OR E<A OR A=0 THEN B=0:RETURN
600 B=S+8*INT((A-S)/8):RETURN
610 PRINT "DISK ERROR": GOTO 150