[Zx81:Type-Ins] "Your Computer" campaign...

Discussion about ZX80 / ZX81 Software
User avatar
XavSnap
Posts: 1247
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: [Type-Ins] "Your Computer" campaign...

Post by XavSnap »

"Your computer" 09/82


"Jump-Push-Pop"

/ASM tutorial/

Contributor : Antipontifex.

Code: Select all

Program 1:
---------

16514   LD HL NN   33 12 64   
        LD E (HL)  94
        INC HL     35
        LD D (HL)  86
        LD HL NN   33 3 0
        ADD HL DE  25
        LD A L    125 
        LD C A     79  
        LD A H    124
        LD B A     71 


16528   LD (HL) N   54 135 
        INC HL      35
        LD (HL) N   54 131
        INC HL      35
        LD (HL) N   54 131 
        INC HL      35
        LD (HL) N   54 131
        INC HL      35
        LD (HL) N   54 131
        INC HL      35
        LD (HL) N   54 131
        INC HL      35
        LD (HL) N   54 131
        INC HL      35
        LD (HL) N   54 131
        INC HL      35
        LD (HL) N   54 4 


16555   LD DE NN      17  10  0
        ADD HL DE     25
        LD (HL) N     54   5
        ADD HL DE     25
        LD (HL) N     54   5
        ADD HL DE     25
        LD (HL) N     54   5
        ADD HL DE     25
        LD (HL) N     54   5
        ADD HL DE     25
        LD (HL) N     54   1

16572   LD A C       121 
        LD L A       111
        LD A B       120
        LD H A       103
        ADD HL DE     25 
        LD (HL) N     54 133
        ADD HL DE     25
        LD (HL) N     54 133
        ADD HL DE     25
        LD (HL) N     54 133
        ADD HL DE     25
        LD (HL) N     54 133
        ADD HL DE     25
        LD (HL) N     54   2 

16591   INC HL        35
        LD (HL) N     54   3
        INC HL        35
        LD (HL) N     54   3
        INC HL        35
        LD (HL) N     54   3
        INC HL        35
        LD (HL) N     54   3
        INC HL        35
        LD (HL) N     54   3
        INC HL        35
        LD (HL) N     54   3
        INC HL        35
        LD (HL) N     54   3
        RET          201



Program 2:
---------

16514   LD HL NN   33  12 64
        LD E(HL)   94
        INC HL     35
        LD D (HL)  86          (16521)
        LD HL NN   33  3  0
        ADD HL DE  25
        PUSH HL   229   

16525   LD(HL) N   54 135
        LD B N      6   7
        INC HL     35
        LD (HL) N  54 131
        DJNZ DIS   16 251
        INC HL     35
        LD (HL) N  54   4

16537   LD DE NN      17  10  0 
        LD B N         6   4
        ADD HL DE     25
        LD (HL) N     54   5
        DJNZ DIS      16 251
        ADD HL DE     25
        LD (HL) N     54  1  
       
16550   POP HL       225
        LD B N         6   4
        ADD HL DE     25
        LD (HL) N     54 133
        DJNZ DIS      16 251
        ADD HL DE     25
        LD (HL) N     54   2

16561   LD B N         6   7
        INC HL        35
        LD (HL) N     54   3
        DJNZ DIS      16 251
        RET          201

Code: Select all

1 REM [DEC:\
33,12,64,94,35,86,33,3,0,25,125,\
79,124,71,54,135,35,54,131,35,54,\
131,35,54,131,35,54,131,35,54,131,\
35,54,131,35,54,131,35,54,4,17,10,\
0,25,54,5,25,54,5,25,54,5,25,54,5,\
25,54,1,121,111,120,103,25,54,133,\
25,54,133,25,54,133,25,54,133,25,\
54,2,35,54,3,35,54,3,35,54,3,35,54,\
3,35,54,3,35,54,3,35,54,3,201 ]
200 CLS
210 SLOW
220 FOR K=2 TO 7
230 PRINT AT K,8;"*"
240 NEXT K
250 LET C=USR 16514
300 STOP

Code: Select all

1 REM [DEC: 33,12,\
64,94,35,86,33,3,0,25,229,54,135,6,\
7,35,54,131,16,251,35,54,4,17,10,0,\
6,4,25,54,5,16,251,25,54,1,225,6,4,\
25,54,133,16,251,25,54,2,6,7,35,54,\
3,16,251,201 ]
200 CLS
210 SLOW
220 FOR K=2 TO 7
230 PRINT AT K,8;"*"
240 NEXT K
250 LET C=USR 16514
300 STOP
JUMP1.P
(1.08 KiB) Downloaded 17 times
JUMP2.P
(1.04 KiB) Downloaded 17 times
Xavier
User avatar
XavSnap
Posts: 1247
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: [Type-Ins] "Your Computer" campaign...

Post by XavSnap »

Your computer" 12/81


"SoundBox"

/Basic-ASM tool to drive a simple sound card IORQ $0B/



Contributor : XavSnap.

Code: Select all

1 REM [HEX: 0E,0B,3E,00,16,00,14,BA,C8,ED,49,21,FF,02,BC,CA,88,40,2B,C3,8F,40 ]
100 FAST 
110 POKE 16519,INT(RND*255)
120 POKE 16526,INT(RND*255)
130 LET SOUND=USR 16514
140 GOTO 110 
200 FAST
210 PRINT"LENGTH?" 
220 INPUT L
230 POKE 16519,L
240 PRINT"NOTE"
250 INPUT L 
260 POKE 16526,L
270 LET SOUND=USR 16514 
280 GOTO 210 
SOUNDBOX.P
(1.14 KiB) Downloaded 13 times
Xavier
User avatar
XavSnap
Posts: 1247
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: [Type-Ins] "Your Computer" campaign...

Post by XavSnap »

Your computer" 04/82

"Sorting on the ZX81"

/Basic tool/

Contributor : XavSnap.

Code: Select all

0 REM - SORTING ON THE ZX-81 -
1 GOTO 5 
2 SAVE "SORT" 
3 STOP 
1000 REM *********************** 
1010 REM RANDOM WORDS
1020 REM *********************** 
1030 DIM A$(100,15)
1040 DIM B$(100,15)
1050 FOR I=1 TO 100
1060 LET L=INT(RND*10+2)
1070 LET T$=""
1080 FOR J=1 TO L
1090 LET T$=T$+CHR$(INT(RND*26+38))
1100 NEXT J
1110 LET A$(I)=T$
1120 SCROLL 
1130 PRINT A$(I)
1140 NEXT I
1150 REM ***********************
1160 REM GOSUBS FOR SORTS
1170 REM ***********************
1180 GOSUB 2200 
1190 GOSUB 1250 
1200 GOSUB 2200
1210 GOSUB 1500
1220 GOSUB 2200
1230 GOSUB 1760
1240 STOP
1250 REM ***********************
1260 REM EXCHANGE SORT
1270 REM ***********************
1280 PRINT "EXCHANGE SORT" 
1290 LET N=100
1300 LET A=0
1310 LET B=0
1320 LET C=0
1330 LET S=0
1350 LET A=A+1
1360 IF A=N THEN GOTO 1480
1370 LET B=A+1
1380 LET C=C+1
1390 IF B$(A)>B$(B) THEN GOTO 1430
1400 LET B=B+1
1410 IF B>N THEN GOTO 1350
1420 GOTO 1380
1430 LET S=S+1
1440 LET T$=B$(A)
1450 LET B$(A)=B$(B)
1460 LET B$(B)=T$
1470 GOTO 1400
1480 GOSUB 2080
1490 RETURN
1500 REM **********************
1510 REM DELAYED REPLACEMENT
1520 REM **********************
1530 PRINT "DELAYED REPLACEMENT SORT"
1540 LET A=0
1550 LET B=0
1560 LET C=0
1570 LET D=0
1580 LET N=100
1590 LET S=0
1600 LET D=D+1
1610 IF D=N THEN GOTO 1740
1620 LET A=D
1630 LET B=A+1
1640 LET C=C+1
1650 IF B$(B)<B$(A) THEN LET A=B
1660 LET B=B+1
1670 IF B<=N THEN GOTO 1640
1680 IF D=A THEN GOTO 1600 
1690 LET S=S+1
1700 LET T$=B$(A)
1710 LET B$(A)=B$(D)
1720 LET B$(D)=T$
1730 GOTO 1600
1740 GOSUB 2080
1750 RETURN 
1760 REM **********************
1770 REM SHELL-METZNER
1780 REM **********************
1790 PRINT "SHELL-METZNER SORT"
1800 LET C=0
1810 LET S=0
1820 LET A=1
1830 LET N=100
1840 IF 2**A>N THEN GOTO 1870
1850 LET A=A+1
1860 GOTO 1840
1870 LET F=2**A-1
1880 LET F=INT(F/2)
1890 IF F=0 THEN GOTO 2060
1900 LET D=N-F
1910 LET B=1
1920 LET A=B
1930 LET E=A+F
1940 LET C=C+1
1950 IF B$(A)>B$(E) THEN GOTO 1990
1960 LET B=B+1
1970 IF B>D THEN GOTO 1880 
1980 GOTO 1920 
1990 LET S=S+1
2000 LET T$=B$(A)
2010 LET B$(A)=B$(E)
2020 LET B$(E)=T$
2030 LET A=A-F
2040 IF A<1 THEN GOTO 1960 
2050 GOTO 1930
2060 GOSUB 2080
2070 RETURN
2080 REM **********************
2090 REM PRINT SORTED LIST 
2100 REM **********************
2110 FOR I=1 TO 100 
2120 SCROLL 
2130 PRINT B$(I)
2140 NEXT I
2150 SCROLL
2160 PRINT "COMPARISONS:";C
2170 SCROLL 
2180 PRINT "SWAPS=";S
2190 RETURN
2200 REM **********************
2210 REM RESET LIST
2220 REM ********************** 
2230 FOR I=1 TO 100
2240 LET B$(I)=A$(I) 
2250 NEXT I
2260 CLS 
2270 RETURN
SORT.P
(3.17 KiB) Downloaded 15 times
Xavier
User avatar
XavSnap
Posts: 1247
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: [Type-Ins] "Your Computer" campaign...

Post by XavSnap »

Your computer" 03/82

"Snakes & Ladders"

/Basic game/

Contributor : XavSnap.

Code: Select all

10 LET L$="                                " 
20 LET U=0
30 PRINT AT 5,5;"SNAKES AND LADDERS"
40 PRINT AT 15,0;"HOW MANY PLAYERS? 1 TO 4"
50 INPUT P
60 IF P<1 OR P>4 THEN GOTO 50
70 DIM P$(P+1,6) 
80 DIM P(P+1)
90 FOR F=1 TO P
100 PRINT "NAME OF PLAYER ",F;"?"
110 INPUT P$(F)
120 LET P(F)=0
130 NEXT F
140 CLS 
150 IF P>1 THEN GOTO 190
160 LET P$(2)="*ZX81*"
170 LET P=2
180 LET P(2)=0
190 GOSUB 1000
200 FOR J=1 TO P 
210 PRINT AT 20,0;CHR$(J+165),CHR$ 0;P$(J);"S TURN"
220 PRINT AT 21,0;L$
230 IF P$(J)="*ZX81*" THEN GOTO 270 
240 GOSUB 600
250 LET X=INT((X-10)/10)
260 GOTO 280
270 LET X=INT(RND*6+1)
310 PRINT AT 20,16;"YOU CAUGHT A À";X;"À"
320 IF P(J)+X<100 THEN GOTO 410
330 IF P(J)+X > 100 THEN GOTO 390 
340 PRINT AT 0,1;"HOME";AT 20,0;P$(J);" WINS. WELL DONE ";P$(J)
350 PRINT " CONGRATULATIONSCONGRATULATIONS"
360 PAUSE 9999
370 CLS
380 GOTO 10
390 PRINT AT 21,8;"YOU NEED A ";CHR$(100-P(J)+156)
400 GOTO 480 
410 LET P(J)=P(J)+X
420 LET Y=P(J)
430 PRINT AT L(Y),C(Y);CHR$(J+165);CHR$(J+37)
440 IF U=0 THEN GOTO 460
450 PRINT AT L(Y-X),C(Y-X);CHR$(INT((Y-X)/10)+156);CHR$(Y-X-10*INT((Y-X)/10)+156)
460 IF J=P THEN LET U=1
470 GOSUB 800 
480 FOR F=1 TO 60
490 NEXT F
500 NEXT J
510 GOTO 200 
600 PRINT AT 20,16;"***PRESS ÀPÀ ***"
610 LET Z=1
620 FOR X=4 TO 54 STEP 10
630 IF P(J)=0 THEN GOTO 670
640 IF Z/2<>INT(Z/2) THEN PRINT AT L(P(J)),C(P(J));CHR$(J+37);CHR$(J+165)
650 IF Z/2=INT(Z/2) THEN PRINT AT L(P(J)),C(P(J));CHR$(J+165);CHR$(J+37)
660 LET Z=Z+1
670 PLOT X,0
680 IF INKEY$="P" THEN GOTO 720
690 UNPLOT X,0
700 NEXT X
710 GOTO 620
720 RETURN
800 IF Y=7 OR Y=15 OR Y=19 OR Y=35 OR Y=50 OR Y=60 OR Y=71 THEN GOTO 830
810 IF Y=24 OR Y=30 OR Y=54 OR Y=64 OR Y=87 OR Y=93 OR Y=98 THEN GOTO 870
820 GOTO 900
830 LET Y=Y+16
840 PRINT AT L(Y),C(Y):CHR$(J+165);CHR$(J+37);AT 21,0;"ÀLADDERÀÀLADDERÀÀLADDERÀÀLADDERÀ" 
850 PRINT AT L(Y-16),C(Y-16);"LL"
860 GOTO 900 
870 LET Y=Y-16
880 PRINT AT L(Y),C(Y);CHR$(J+165);CHR$(J+37);AT 21,0;"SSSSSSSSSSSSSSSSSSSSSSSSSSSSNAKE"
890 PRINT AT L(Y+16),C(Y+16);"SS" 
900 LET P(J)=Y 
910 RETURN 
1000 DIM L(100)
1010 DIM C(100) 
1020 FAST
1030 LET B=0
1040 LET E=0
1050 FOR F=1 TO 100
1060 IF F=11 OR F=21 OR F=31 OR F=41 OR F=51 OR F=61 OR F=71 OR F=81 OR F=91 THEN LET E=E+2
1070 LET L(F)=18-E
1080 IF F>10 AND F<21 OR F>30 AND F<41 OR F>50 AND F<61 OR F>70 AND F<81 OR F>90 THEN GOTO 1110
1090 LET C(F)=2+B
1100 GOTO 1120
1110 LET C(F)=29-B
1120 LET B=B+3 
1130 IF B=30 THEN LET B=0
1140 NEXT F
1150 LET C(100)=1 
1160 FOR F=1 TO 99
1170 IF F>9 THEN GOTO 1190
1180 PRINT AT L(F),C(F);CHR$ 128;CHR$(F+156)
1190 PRINT AT L(F),C(F);CHR$(INT F/10)+156);CHR$(F-10*INT(F/10)+156)
1220 NEXT F
1230 PRINT AT L(100),C(100);"%1%0%0"
1240 SLOW
1250 RETURN 
SNAKES.P
(3.74 KiB) Downloaded 17 times
Xavier
User avatar
XavSnap
Posts: 1247
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: [Type-Ins] "Your Computer" campaign...

Post by XavSnap »

Your computer" 11/81

"Renumber"

/ASM Tool/

Contributor : XavSnap.

Code: Select all

POKE 16388, 222
POKE 16389, 127
NEW

1 REM [DEC: 33, 125, 64, 17, 10, 0, 126,\
254, 118, 32, 6, 35, 126, 254, 118, 200,\
43, 114, 35, 115, 6, 10, 19, 16, 253, 35,\
126, 254, 118, 32, 250, 35, 24, 228 ]
10 LET A=16514
20 FOR B=17374 TO 17407
30 POKE B,PEEK A
40 LET A=A+1
50 NEXT B
60 PRINT AT 1,5;"ZX-81 RE-Number"
70 PRINT AT 3,5;"CALL AT: USR 17374"
80 PAUSE 200
90 NEW
9900 SAVE "RE-NO"
9999 GOTO 10
RE-NO.P
(1.14 KiB) Downloaded 11 times
Last edited by XavSnap on Tue Dec 01, 2020 10:54 am, edited 1 time in total.
Xavier
User avatar
XavSnap
Posts: 1247
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: [Type-Ins] "Your Computer" campaign...

Post by XavSnap »

Your computer" 01/82

"Renumber Rewrite"

/ASM Tool/

Contributor : XavSnap.

Code: Select all

POKE 16388,229
POKE 16389,127

100 LET C$="033125064017010000126254118200114035115006010019016253035126254118032250035024235"
200 PRINT "START ADDRESS?"
250 INPUT S
300 FOR I=1 TO LEN C$ STEP 3
350 LET C=VAL C$ (I TO I+2)
400 POKE (S+(I-1)/3),C
450 NEXT I 
460 STOP
9000 SAVE"RENUM2"

RAND USR 32741

RENUM2.P
(1.11 KiB) Downloaded 13 times
Xavier
User avatar
XavSnap
Posts: 1247
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: [Type-Ins] "Your Computer" campaign...

Post by XavSnap »

Your computer" 05/82

"Saint George"

/Basic game/

Contributor : XavSnap.

Code: Select all

10 REM ST GEORGE BY P. WATSON 
20 REM        18/2/82
30 DIM M$(20,30)
40 DIM R(12)
50 DIM Q(12) 
60 LET Z=1 
70 POKE 16418,0 
80 FAST
90 CLS 
100 PRINT "\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::"
110 PRINT AT 0,6;"THERE ARE:";Z;" DRAGONS" 
120 REM   SET UP LANDSCAPE
130 FOR I=1 TO 20 
140 FOR H=1 TO 30 
150 LET M$(I,H)=" "
160 IF INT(RND*10)>7 THEN LET M$(I,H)="\::"
170 NEXT H
180 PRINT "\::";M$(I);"\::"
190 NEXT I
200 REM  POSITION GEORGE 
210 LET GY=19 
220 LET GX=INT(RND*20)+5 
230 LET M$(GY,GX)=" "
240 REM POSITION DRAGONS 
250 FOR I=1 TO Z
260 LET R(I)=INT(RND*10)+5
270 LET Q(I)=INT(RND*20)+5
280 NEXT I
290 REM MAKE ROOM FOR DAMSEL
300 FOR I=2 TO 4 
310 FOR H=15 TO 17 
320 LET M$(I,H)=" " 
330 NEXT H 
340 PRINT AT I+19,0;"\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::";AT I,1;M$(I)
350 NEXT I
360 LET N=0 
370 LET S=0 
380 SLOW 
390 PRINT AT GY,GX;"G";AT 3,16;"*"
400 REM GET PLAYER/S MOVE
410 LET Y=0
420 LET X=0 
430 LET X=X-(INKEY$="5")+(INKEY$="8")
440 LET Y=Y-(INKEY$="7")+(INKEY$="6")
450 IF X=0 AND Y=0 THEN GOTO 430
460 REM IS THE POSITION EMPTY 
470 IF M$(GY+Y,GX+X)="\::" THEN GOTO 610 
480 REM CARRY OUT MOVE
490 PRINT AT GY,GX;" " 
500 LET GY=GY+Y 
510 LET GX=GX+X 
520 PRINT AT GY,GX;"G"
530 REM IS HE HOME
540 IF GY=3 AND GX=16 THEN GOTO 850 
550 REM TIME FOR A DRAGON? 
560 LET S=S+1
570 IF S/5<>INT (S/5) OR N+1>Z THEN GOTO 610 
580 LET N=N+1 
590 LET M$(R(N),Q(N))=" "
600 REM MOVE DRAGONS
610 FOR I=1 TO N 
620 LET A=0 
630 LET B=0 
640 LET A=A-(GY<R(I))+(GY>R(I)) 
650 IF A <> 0 AND M$(R(I)+A,Q(I)) <>"\::"  THEN GOTO 710
660 LET A=0 
670 LET B=B-(GX<Q(I))+(GX>Q(I))
680 REM IS POSITION VALID 
690 IF M$(R(I),Q(I)+B)="\::" THEN GOTO 760 
700 REM CARRY OUT MOVE
710 PRINT AT R(I),Q(I);" "
720 LET R(I)=R(I)+A
730 LET Q(I)=Q(I)+B
740 PRINT AT R(I),Q(I);"£"
750 REM IS GEORGE CAUGHT 
760 IF R(I)=GY AND Q(I)=GX THEN GOTO 800 
770 NEXT I
780 GOTO 390
790 REM ST GEORGE IS CAUGHT
800 PRINT AT 21,5;"GEORGY BOY ...YOU ARE DEAD"
810 PRINT AT 23,5;"YOU KILLED ";Z;" DRAGONS" 
820 PAUSE 3000
830 STOP
840 REM HOME SAFE
850 PRINT AT 21,1;"NICE ONE GEORGE YOU ARE A HERO" 
860 IF Z=12 THEN GOTO 930
870 LET Z=Z+1
880 PRINT AT 22,0;"BET YOU CANT SLAY ";Z;" DRAGONS" 
890  PRINT TAB(5);"PRESS ANY KEY TO START"
900 IF INKEY$<>"" THEN GOTO 80 
910 GOTO 900
920 REM ALL DRAGONS SLAIN
930 PRINT AT 23,1;"YOU HAVE KILLED ALL 12 DRAGONS" 
940 GOTO 820
GEORGE.P
(3.08 KiB) Downloaded 13 times
Xavier
User avatar
XavSnap
Posts: 1247
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: [Type-Ins] "Your Computer" campaign...

Post by XavSnap »

Your computer" 05/83


"Memory Man"

/Basic tool/

Contributor : XavSnap.

Code: Select all

9996 PRINT TAB 8;"ZX 81 MEMORY",,,"TOTAL RAM",((PEEK 16388+256*PEEK 16389)- 16384)/1024;" K" 
9997 PRINT ,,"BASIC PROGRAM", (PEEK 16396+256*PEEK 16397)-16509;" BYTES" 
9998 PRINT ,,"VARIABLES",(PEEK 16404+256*PEEK 16405)-(PEEK 16400+256*PEEK 16401);" BYTES"
9999 PRINT ,,"SPARE MEMORY",(PEEK 16388+256*PEEK 16389)-(PEEK 16404+256*PEEK 16405);" BYTES" 
MEMORY.P
(1.28 KiB) Downloaded 16 times
Xavier
User avatar
XavSnap
Posts: 1247
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: [Type-Ins] "Your Computer" campaign...

Post by XavSnap »

Your computer" 10/83


"Merge"

/ASM tool/

Load the "merge" programme, it's an autorun file how reboot the ZX81.
The program is now above the RAM_TOP.

Load the first program and type:

RAND USR (PEEK 16388+256*PEEK 16389)
and load the file to merge to the first program.

In EO, you had to uncheck the "fast charging" device and the "autoload" button in the TZX window.

Contributor : XavSnap.

Code: Select all

0 REM [HEX: \
76,76,CD,E7,02,2A,04,40,\
01,E2,00,B7,ED,42,22,04,\
40,E5,01,0C,00,09,22,C7,\
40,22,E6,40,22,F6,40,22,\
00,41,22,19,41,E1,54,5D,\
2B,36,3E,2B,F9,2B,2B,22,\
02,40,21,BF,40,01,E2,00,\
ED,B0,C3,C3,03,CD,E7,02,\
FD,CB,21,86,CD,CB,40,18,\
FB,0E,01,06,00,3E,7F,DB,\
FE,D3,FF,1F,30,5A,17,17,\
38,67,10,F1,C1,FD,CB,21,\
46,20,5A,CD,CB,40,FD,CB,\
21,C6,79,17,30,F5,1E,05,\
21,3C,40,CD,CB,40,71,23,\
1D,20,F8,1E,6F,CD,CB,40,\
1D,20,FA,2A,3F,40,11,7D,\
40,B7,ED,52,C8,EB,2A,1C,\
40,01,80,00,09,E5,CD,CB,\
40,71,23,ED,4B,02,40,05,\
E5,ED,42,E1,30,19,1B,7A,\
B3,20,EB,36,80,E1,18,2E,\
3E,FF,32,27,40,FD,CB,3B,\
86,CF,0C,18,8E,CF,0D,CF,\
03,D5,1E,94,06,1A,1D,DB,\
FE,17,CB,7B,7B,38,F5,10,\
F5,D1,20,04,FE,56,30,E3,\
3F,CB,11,30,DE,C9,11,7D,\
40,7E,E6,C0,20,31,1A,13,\
BE,23,20,02,1A,BE,1B,2B,\
30,08,E5,EB,CD,F2,09,E1,\
18,EC,28,13,D5,CD,F2,09,\
E3,C5,2B,CD,9E,09,23,23,\
C1,D1,EB,ED,B0,18,D2,D5,\
CD,F2,09,EB,D1,18,CA,21,\
00,00,22,29,40,CF,FF ]
10 SAVE "MERGE"
20 RAND USR 16514

Code: Select all

;------- TASM ASM mnemonics. -------
; Compile this file using:
; Set TASMOPTS = -b
; tasm -80 ThisCode.tas MyBinary.BIN
;-----------------------------------
; Zx81 Program name: VB81 XuR [MERGE.P] : Empty Basic Segment.
; REM   line   name: D=32543/32767 : H=7F1F/7FFF

#define ORG  .org       ; TASM cross-assembler definitions
#define equ  .equ
;-----------------------------------

;------- Rom and Ram Symbols -------
RAM_PRBUFF03 equ $403F
RAM_STKEND equ $401C
RAM_ERR_SP equ $4002
RAM_DBOUNCE equ $4027
NEXT_ONE equ $09F2
MAKE_ROOM equ $099E
RAM_NXTLIN equ $4029


ORG $7F1F ; [@32543/@h7F1F]
	RST 20H 
	LD (BC),A 
	RES 0,(IY+33) 
Lb7F25:
	CALL Lb7F2A ; [32554]
	JR Lb7F25 ; [$7F25:32549]
Lb7F2A:
	LD C,$01 
Lb7F2C:
	LD B,$00 
Lb7F2E:
	LD A,$7F 
	IN A,($FE) ; Keyboard Port.
	OUT ($FF),A ; Zx81 Display/Tape port
	RRA 
	JR NC, Lb7F91 ; [$7F91:32657]
	RLA 
	RLA 
	JR C, Lb7FA2 ; [$7FA2:32674]
	DJNZ Lb7F2E ; [$7F2E:32558]
	POP BC 
	BIT 0,(IY+33) 
	JR NZ, Lb7F9E ; [$7F9E:32670]
Lb7F44:
	CALL Lb7F2A ; [32554]
	SET 0,(IY+33) 
	LD A,C 
	RLA 
	JR NC, Lb7F44 ; [$7F44:32580]
	LD E,$05 
	LD HL,$403C 
Lb7F54:
	CALL Lb7F2A ; [32554]
	LD (HL),C 
	INC HL 
	DEC E 
	JR NZ, Lb7F54 ; [$7F54:32596]
	LD E,$6F 
Lb7F5E:
	CALL Lb7F2A ; [32554]
	DEC E 
	JR NZ, Lb7F5E ; [$7F5E:32606]
	LD HL,(RAM_PRBUFF03) ; GET PRBUFF
	LD DE,$407D 
	OR A 
	SBC HL,DE 
	RET Z 
	EX DE,HL 
	LD HL,(RAM_STKEND) ; GET STKEND
	LD BC,$0080 
	ADD HL,BC 
	PUSH HL 
Lb7F77:
	CALL Lb7F2A ; [32554]
	LD (HL),C 
	INC HL 
	RR BC,(RAM_E_SP) ; GET ERR-SP
	DEC B 
	PUSH HL 
	SBC HL,BC 
	POP HL 
	JR NC, Lb7FA0 ; [$7FA0:32672]
	DEC DE 
	LD A,D 
	OR E 
	JR NZ, Lb7F77 ; [$7F77:32631]
	LD (HL),$80 
	POP HL 
	JR Lb7FBF ; [$7FBF:32703]
Lb7F91:
	LD A,$FF 
	LD (RAM_DBOUNCE),A ; SET DEBOUNCE
	RES 0,(IY+59) 
	RST 08H 
.db	$0C ; RST8 Arg: Error Code:'D'
Lb7F9C:
	JR Lb7F2C ; [$7F2C:32556]
Lb7F9E:
	RST 08H 
.db	$0D ; RST8 Arg: Error Code:'E'
Lb7FA0:
	RST 08H 
.db	$03 ; RST8 Arg: Error Code:'4'
Lb7FA2:
	PUSH DE 
	LD E,$94 
Lb7FA5:
	LD B,$1A 
Lb7FA7:
	DEC E 
	IN A,($FE) ; Keyboard Port.
	RLA 
	BIT 7,E 
	LD A,E 
	JR C, Lb7FA5 ; [$7FA5:32677]
	DJNZ Lb7FA7 ; [$7FA7:32679]
	POP DE 
	JR NZ, Lb7FB9 ; [$7FB9:32697]
	CP $56 ; [86]
	JR NC, Lb7F9C ; [$7F9C:32668]
Lb7FB9:
	CCF 
	RL C 
	JR NC, Lb7F9C ; [$7F9C:32668]
	RET ; ==========================

Lb7FBF:
	LD DE,$407D 
Lb7FC2:
	LD A,(HL) 
	AND $C0 
	JR NZ, Lb7FF8 ; [$7FF8:32760]
Lb7FC7:
	LD A,(DE) 
	INC DE 
	CP (HL) 
	INC HL 
	JR NZ, Lb7FCF ; [$7FCF:32719]
	LD A,(DE) 
	CP (HL) 
Lb7FCF:
	DEC DE 
	DEC HL 
	JR NC, Lb7FDB ; [$7FDB:32731]
	PUSH HL 
	EX DE,HL 
	CALL NEXT_ONE ; [NEXT-ONE]
	POP HL 
	JR Lb7FC7 ; [$7FC7:32711]
Lb7FDB:
	JR Z, Lb7FF0 ; [$7FF0:32752]
	PUSH DE 
	CALL NEXT_ONE ; [NEXT-ONE]
	EX (SP),HL 
	PUSH BC 
	DEC HL 
	CALL MAKE_ROOM ; [MAKE-ROOM]
	INC HL 
	INC HL 
	POP BC 
	POP DE 
	EX DE,HL 
	LDIR 
	JR Lb7FC2 ; [$7FC2:32706]
Lb7FF0:
	PUSH DE 
	CALL NEXT_ONE ; [NEXT-ONE]
	EX DE,HL 
	POP DE 
	JR Lb7FC2 ; [$7FC2:32706]
Lb7FF8:
	LD HL,$0000 
	LD (RAM_NXTLIN),HL ; SET NXT-LINE
	RST 08H 
.db	$FF ; RST8 Arg: Error Code: ???

.end

MERGE.P
(1.21 KiB) Downloaded 13 times
Xavier
User avatar
XavSnap
Posts: 1247
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: [Type-Ins] "Your Computer" campaign...

Post by XavSnap »

"Your computer" 09/82


"Lower Case on ZxPrinter"

/ASM -Basic tool/

To do:

- Move the Ram-Top :
POKE 16388,0
POKE 16389,124

Load the basic program and RUN it.
- Type Shifted 9, to get graphics characters.
- Type "HELLO WORLD" …

The ZxPrinter write it in lower case characters...

Contributor : Antipontifex.

Code: Select all

1 REM LOWER-CASE LETTERS PROGRAM BAY BRIAN CADGE
2 IF NOT (PEEK 16388+256*PEEK 16389=31744) THEN STOP 
3 REM COPY LPRINT ROUTINE                 FROM R.O.M.
4 FAST
5 FOR I=0 TO 112 
6 POKE 31744+I,PEEK(2161+I)
7 NEXT I
8 POKE 31800,63 
9 POKE 31857,201
10 DIM A$(32,8) 
11 GOTO 24
12 REM SUBROUTINE TO PRINT             FILL PRINTER-BUFFER AND PRINT OUT CHRRACTERS
13 FOR I=1 TO 32
14 FOR J=1 TO 8 
15 POKE 32255+J+8*(I-1),CODE A$(I,J)
16 NEXT J
17 NEXT I
18 REM FILL BUFFER
19 FOR I=1 TO 32
20 POKE 16443+I,I-1 
21 NEXT I
22 LET PRINTOUT=USR 31744
23 RETURN
24 DIM L$(96,8)
25 LET L$(1)="  S\. W"+CHR$ 68+"W "
26 LET L$(2)="  @40@40"+CHR$ 120+CHR$ 68+CHR$ 120+CHR$ 0 
27 LET L$(3)="   W@40@40W "
28 LET L$(4)="  "+CHR$ 4+CHR$ 4+"W"+CHR$ 68+"W "
29 LET L$(5)="  S"+CHR$ 68+CHR$ 124+"@40S " 
30 LET L$(6)=" /44"+CHR$ 112+"44 "
31 LET L$(7)=" S"+CHR$ 68+"W\. S "
32 LET L$(8)="  @40@40"+CHR$ 120+CHR$ 68+CHR$ 68+CHR$ 0
33 LET L$(9)="  ( (((( "
34 LET L$(10)=" "+CHR$ 8+" "+CHR$ 8+CHR$ 8+CHR$ 8+CHR$ 112+CHR$ 0
35 LET L$(11)=" @40"+CHR$ 72+CHR$ 60+CHR$ 96+CHR$ 80+CHR$ 72+" " 
36 LET L$(12)=" (((((( "
37 LET L$(13)="  C"+CHR$ 84+CHR$ 84+CHR$ 84+CHR$ 84+" "
38 LET L$(14)="   /888 "
39 LET L$(15)="  S"+CHR$ 68+CHR$ 68+CHR$ 68+"S "
40 LET L$(16)="  S"+CHR$ 68+CHR$ 120+"@40@40 "
41 LET L$(17)="  S"+CHR$ 68+CHR$ 68+CHR$ 124+"\.  "
42 LET L$(18)="   0444 "
43 LET L$(19)="  S@40S\. S "
44 LET L$(20)="  4"+CHR$ 112+"48/ "
45 LET L$(21)="   888/ "
46 LET L$(22)="   "+CHR$ 68+CHR$ 68+"C( "
47 LET L$(23)="   \:.%>e"+CHR$ 68+" "
48 LET L$(24)="   "+CHR$ 68+"C(C" +CHR$ 68+" "
49 LET L$(25)="  "+CHR$ 68+"C(4@40 "  
50 LET L$(26)="  S"+CHR$ 8+"(4S "
51 LET L$(94)=" K"+CHR$ 72+"KO"+CHR$ 72+"O "
52 LET L$(95)="  "+CHR$ 100+CHR$ 104+"(G"+CHR$ 76+" "
53 LET L$(96)=" (((( ( "
54 REM COPY CHR$ 0 TO 63 FROM        R.O.M. AND PUT INTO L$
55 FOR I=0 TO 63
56 LET K$=""
57 FOR J=0 TO 7 STEP 2
58 LET K$=K$+CHR$(PEEK (7680+I*8+J))+CHR$(PEEK(7680+I*8+J+1)) 
59 NEXT J
60 LET L$(30+I)=K$ 
61 NEXT I 
62 SLOW
  63 REM PROGRAM TO CONVERT     \
MESSAGE IN Z$ TO UPPER AND LOWER\
CASE LETTERS
  64 PRINT "\
  THIS PROGRAM PRINTS  ONE LINE \
AT A TIME.USE THE FOLLOWING :","\
NORMAL CHARACTERS 0 TO 63 FOR   \
NORMAL PRINT-OUT","\
INVERSE VIDEO a TO z FOR LOWER  \
CASE",,"\
** (TO THE POWER OF) FOR PERCENT\
SIGN",,"%/ FOR EXCLAMATION MARK"," AND (SHIFTED 2) FOR AND SIGN"
65 PRINT 
66 DIM Z$(32) 
67 PRINT "TYPE IN SENTENCE?" 
68 INPUT Z$ 
69 IF Z$(1)="@E3" THEN STOP 
70 FAST 
71 FOR I=1 TO 32
72 IF Z$(I)=CHR$ 218 OR Z$(I)=CHR$ 216 OR Z$(I)="%/" THEN GOTO 85
73 IF Z$(I)="\::" THEN GOTO 83 
74 IF CODE Z$(I)<64 THEN GOTO 83 
75 IF CODE Z$(I)>191 OR CODE Z$(I)<166 THEN GOTO 83 
76 LET A$(I)=L$(CODE Z$(I)-165) 
77 NEXT I 
78 GOSUB 13 
79 SLOW
80 GOTO 68 
81 LET A$(I)=L$(CODE Z$(I)+30)
82 GOTO 77 
83 LET A$(I)="                                "
84 GOTO 77
85 IF Z$(I)=CHR$ 218 THEN LET A$(I)=L$(94)
86 IF Z$(I)=CHR$ 216 THEN LET A$(I)=L$(95) 
87 IF Z$(I)="%/" THEN LET A$(I)=L$(96)
88 GOTO 77 
89 REM 
  90 REM IF YOU WANT TO USE THIS\
AS PART OF A MAIN PROGRAM THEN  \
CHANGE LINE 64 TO GOTO FIRST    \
LINE NO.,LINE 80 TO RETURN AND  \
USE GOSUB 70 TO PRINT OUT       \
MESSAGE IN Z$ WHICH MUST HAVE   \
BEEN DIM Z$(32) BEFORE. 
LOWCASE.P
(5.32 KiB) Downloaded 13 times
Xavier
Post Reply