Using MCoder2 in EightyOne

Anything Sinclair ZX Basic related; history, development, tips - differences between BASIC on the ZX80 and ZX81
User avatar
raspereira
Posts: 5
Joined: Tue Nov 24, 2020 1:29 pm
Location: Brazil

Using MCoder2 in EightyOne

Post by raspereira »

I am trying to compile .P file with MCoder2 in EightyOne. I converted the BASIC code with zxtext2p. When I load the .P via GUI it works normally.
I am not managing to load my .P file after MCoder2 without doing a hard reset.
I tried several ways with no success. Finally I opened Mcoder2 and my program at the Tape manager and used LOAD "" to load both files, but apparently it does a hard reset when my .P file is loaded.
Has someone experienced the same problem? Any tip?
User avatar
kmurta
Posts: 302
Joined: Tue Sep 01, 2009 5:04 am
Location: Belo Horizonte - BR
Contact:

Re: Using MCoder2 in EightyOne

Post by kmurta »

Take a look at this manual to see if you are following the correct procedure.

https://docs.google.com/viewer?a=v&pid= ... zYzMjc0NjU

But remember, once Mcoder is loaded above RAMTOP, there is less than 12Kb left for your BASIC program.
1 x ZX81, 2 x TK85 , 1 TK82C, 1 TK95, 1 x Alphacom 32 printer, 1 x ZXpand
ZeXtender board, Joy81 - Programmable Joystick Controller, Turbo Sound 81
http://zx81.eu5.org
https://toddysoftware.itch.io/
User avatar
raspereira
Posts: 5
Joined: Tue Nov 24, 2020 1:29 pm
Location: Brazil

Re: Using MCoder2 in EightyOne

Post by raspereira »

Hi kmurta,

I've followed this paper and discussed with Tim Swenson. We don't know what is figuring out.
We used these two test attached files.
Attachments
rod.P
(961 Bytes) Downloaded 206 times
example.p
(988 Bytes) Downloaded 227 times
User avatar
kmurta
Posts: 302
Joined: Tue Sep 01, 2009 5:04 am
Location: Belo Horizonte - BR
Contact:

Re: Using MCoder2 in EightyOne

Post by kmurta »

Click on picture to see th animated gif
mcoder2.gif
1 x ZX81, 2 x TK85 , 1 TK82C, 1 TK95, 1 x Alphacom 32 printer, 1 x ZXpand
ZeXtender board, Joy81 - Programmable Joystick Controller, Turbo Sound 81
http://zx81.eu5.org
https://toddysoftware.itch.io/
User avatar
raspereira
Posts: 5
Joined: Tue Nov 24, 2020 1:29 pm
Location: Brazil

Re: Using MCoder2 in EightyOne

Post by raspereira »

Thank you very much! I managed to compile. But now, how to save it in a file? I tried saving via Tape manager and via GUI, but the program did not work.
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: Using MCoder2 in EightyOne

Post by XavSnap »

I had to rebuild it, from the original one (just one side) and the www.Zx81.nl text file…

Mcoder II, user manual: (updated)
McoderII_livret.pdf
(82.77 KiB) Downloaded 208 times
McoderII_livret-1.jpg
McoderII_livret-2.jpg
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: Using MCoder2 in EightyOne

Post by Moggy »

Thanks for this Xav. :D
bwinkel67
Posts: 147
Joined: Mon Mar 23, 2020 2:38 am

Re: Using MCoder2 in EightyOne

Post by bwinkel67 »

So I've been trying to compile a rather simple program that uses plot:

Code: Select all

5 REM BOUNCING BALL
10 PRINT "ENTER SPEED (1-10), ADJUST (S/F)";
15 INPUT SPEED
20 CLS
25 FOR I=0 TO 20
30 LET Y=I
35 LET X=I
40 GOSUB 1000
45 PRINT AT Y,X;" ";
50 NEXT I
55 FOR I=21 TO 31
60 LET Y=42-I
65 LET X=I
70 GOSUB 1000
75 PRINT AT Y,X;" ";
80 NEXT I
85 FOR H=19 TO 30
87 LET I=49-H
90 LET Y=I-19
95 LET X=I
100 GOSUB 1000
105 PRINT AT Y,X;" ";
110 NEXT H
115 FOR H=0 TO 19
117 LET I=19-H
120 LET Y=19-I
125 LET X=I
130 GOSUB 1000
135 PRINT AT Y,X;" ";
140 NEXT H
145 FOR I=20 TO 21
150 LET Y=I
155 LET X=I-19
160 GOSUB 1000
165 PRINT AT Y,X;" ";
170 NEXT I
175 FOR H=0 TO 20
177 LET I=20-H
180 LET Y=I
185 LET X=23-I
190 GOSUB 1000
195 PRINT AT Y,X;" ";
200 NEXT H
205 FOR I=1 TO 8
210 LET Y=I
215 LET X=23+I
220 GOSUB 1000
225 PRINT AT Y,X;" ";
230 NEXT I
235 FOR I=8 TO 21
240 LET Y=I
245 LET X=38-I
250 GOSUB 1000
255 PRINT AT Y,X;" ";
260 NEXT I
265 FOR H=4 TO 20
267 LET I=24-H
270 LET Y=I
275 LET X=I-4
280 GOSUB 1000
285 PRINT AT Y,X;" ";
290 NEXT H
295 FOR H=1 TO 4
297 LET I=5-H
300 LET Y=I
305 LET X=0
310 GOSUB 1000
315 PRINT AT Y,X;" ";
320 NEXT H
325 GOTO 25
500 STOP
1000 REM SPINNIG BALL
1005 LET K$=INKEY$
1010 IF K$="F" THEN GOSUB 1085
1015 IF K$="S" THEN GOSUB 1105
1020 FOR J=1 TO SPEED
1025 PRINT AT Y,X;"\. ";
1030 PRINT AT Y,X;"\: ";
1035 PRINT AT Y,X;"\''";
1040 PRINT AT Y,X;"\ :";
1045 PRINT AT Y,X;"\..";
1050 PRINT AT Y,X;"\: ";
1055 PRINT AT Y,X;"\''";
1060 PRINT AT Y,X;"\ :";
1065 PRINT AT Y,X;"\..";
1070 NEXT J
1075 RETURN
1080 REM ADJUST SPEED
1085 LET SPEED=SPEED-1
1090 IF SPEED<1 THEN LET SPEED=1
1095 PRINT AT 0,4;"SPEED: ";SPEED;" "
1100 RETURN
1105 LET SPEED=SPEED+1
1110 GOTO 1095
I took care of the STEP -1 issues but when I run it after successful compilation, after entering its speed (as 1), I just get a blank screen and SHIFT-EDIT doesn't seem to break the program. Anyone here have any experience with the compiler?
bwinkel67
Posts: 147
Joined: Mon Mar 23, 2020 2:38 am

Re: Using MCoder2 in EightyOne

Post by bwinkel67 »

So I discovered that MCODER2 doesn't like GOSUB. In the documentation it say it supports it. No idea but if I substitute the GOSUB call with the actual code (i.e. I repeat the code) it works.

Code: Select all

5 REM BOUNCING BALL
10 PRINT "ENTER TO START";
15 INPUT S$
20 CLS
25 FOR I=0 TO 20
30 LET X=I
35 LET Y=I
40 PRINT AT X,Y;"\. ";AT X,Y;"\: ";AT X,Y;"\''";AT X,Y;"\ :";AT X,Y;"\..";AT X,Y;"\: ";AT X,Y;"\''";AT X,Y;"\ :";AT X,Y;"\..";AT X,Y;" ";
50 NEXT I
55 FOR I=21 TO 31
60 LET X=42-I
65 LET Y=I
70 PRINT AT X,Y;"\. ";AT X,Y;"\: ";AT X,Y;"\''";AT X,Y;"\ :";AT X,Y;"\..";AT X,Y;"\: ";AT X,Y;"\''";AT X,Y;"\ :";AT X,Y;"\..";AT X,Y;" ";
80 NEXT I
85 FOR H=19 TO 30
87 LET I=49-H
90 LET X=I-19
95 LET Y=I
100 PRINT AT X,Y;"\. ";AT X,Y;"\: ";AT X,Y;"\''";AT X,Y;"\ :";AT X,Y;"\..";AT X,Y;"\: ";AT X,Y;"\''";AT X,Y;"\ :";AT X,Y;"\..";AT X,Y;" ";
110 NEXT H
115 FOR H=0 TO 19
117 LET I=19-H
120 LET X=19-I
125 LET Y=I
130 PRINT AT X,Y;"\. ";AT X,Y;"\: ";AT X,Y;"\''";AT X,Y;"\ :";AT X,Y;"\..";AT X,Y;"\: ";AT X,Y;"\''";AT X,Y;"\ :";AT X,Y;"\..";AT X,Y;" ";
140 NEXT H
145 FOR I=20 TO 21
150 LET X=I
155 LET Y=I-19
160 PRINT AT X,Y;"\. ";AT X,Y;"\: ";AT X,Y;"\''";AT X,Y;"\ :";AT X,Y;"\..";AT X,Y;"\: ";AT X,Y;"\''";AT X,Y;"\ :";AT X,Y;"\..";AT X,Y;" ";
170 NEXT I
175 FOR H=0 TO 20
177 LET I=20-H
180 LET X=I
185 LET Y=23-I
190 PRINT AT X,Y;"\. ";AT X,Y;"\: ";AT X,Y;"\''";AT X,Y;"\ :";AT X,Y;"\..";AT X,Y;"\: ";AT X,Y;"\''";AT X,Y;"\ :";AT X,Y;"\..";AT X,Y;" ";
200 NEXT H
205 FOR I=1 TO 8
210 LET X=I
215 LET Y=23+I
220 PRINT AT X,Y;"\. ";AT X,Y;"\: ";AT X,Y;"\''";AT X,Y;"\ :";AT X,Y;"\..";AT X,Y;"\: ";AT X,Y;"\''";AT X,Y;"\ :";AT X,Y;"\..";AT X,Y;" ";
230 NEXT I
235 FOR I=8 TO 21
240 LET X=I
245 LET Y=38-I
250 PRINT AT X,Y;"\. ";AT X,Y;"\: ";AT X,Y;"\''";AT X,Y;"\ :";AT X,Y;"\..";AT X,Y;"\: ";AT X,Y;"\''";AT X,Y;"\ :";AT X,Y;"\..";AT X,Y;" ";
260 NEXT I
265 FOR H=4 TO 20
267 LET I=24-H
270 LET X=I
275 LET Y=I-4
280 PRINT AT X,Y;"\. ";AT X,Y;"\: ";AT X,Y;"\''";AT X,Y;"\ :";AT X,Y;"\..";AT X,Y;"\: ";AT X,Y;"\''";AT X,Y;"\ :";AT X,Y;"\..";AT X,Y;" ";
290 NEXT H
295 FOR H=1 TO 4
297 LET I=5-H
300 LET X=I
305 LET Y=0
310 PRINT AT X,Y;"\. ";AT X,Y;"\: ";AT X,Y;"\''";AT X,Y;"\ :";AT X,Y;"\..";AT X,Y;"\: ";AT X,Y;"\''";AT X,Y;"\ :";AT X,Y;"\..";AT X,Y;" ";
320 NEXT H
325 GOTO 25
500 STOP
User avatar
mrtinb
Posts: 1906
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: Using MCoder2 in EightyOne

Post by mrtinb »

The documentation says there is no compilation past STOP, so STOP has a different meaning than in Basic.

Maybe instead of
500 STOP
should be
500 GOTO 9999
9999 STOP
Martin
https://zx.rtin.be
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
Post Reply