How to make listing visable after pokes in line 1

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
User avatar
XavSnap
Posts: 2072
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.
Contact:

Re: How to make listing visable after pokes in line 1

Post by XavSnap »

RS232,
Is it a wav converted to P ? (read error bits decays)
Can you send you P file on the forum ?
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
RS232
Posts: 90
Joined: Fri Apr 05, 2019 8:57 pm

Re: How to make listing visable after pokes in line 1

Post by RS232 »

XavSnap wrote: Thu Jun 13, 2024 10:47 pm RS232,
Is it a wav converted to P ? (read error bits decays)
Can you send you P file on the forum ?
apologies for any cross post confusion..
It is actually the fantastic zx81 draw command from Drbeep the download here (already on the forum)
https://www.sinclairzxworld.com/downloa ... p?id=14940

I am hoping to use this lovely tool in a new zx81 realise if i can get round the issue. Will have everyone credited in an
about page of course if used ;)
User avatar
XavSnap
Posts: 2072
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.
Contact:

Re: How to make listing visable after pokes in line 1

Post by XavSnap »

the main cause of this problem is due to a problem with the assembler routine, in its operation or its return to BASIC.
In this case, many POKEs damage the BASIC listing and the SAVE command catch the memory BASIC segment as is !
I use to check binarys, or extract the BASIC text listing using "ZXToken" to reconstruct a proper P file.
In the past, they advice to SAVE before a RUN, if the program call any ASM routines, to avoid to damage the BASIC program itself.
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
David G
Posts: 451
Joined: Thu Jul 17, 2014 7:58 am
Location: 48 North

Re: How to make listing visable after pokes in line 1

Post by David G »

Did this ever get resolved?


So this is dr beep's LINE-command

The original from dr beep (line3.p) has "pokes in line1" (machine code in line 0 REM). This line has effectively had the line number poked to be 0. This prevents the line from being deleted in the normal way


The following lines after 0 REM don't show up with LIST
line3.png
line3.png (8.18 KiB) Viewed 1857 times
... because 0 REM has two NEWLINES at the beginning of the REM (118/76h). These can be POKEd in and stop the LIST command at that point

But can still be viewed with LIST 1
LIST 1.png
in my experience the NEWLINES at the beginning of machine code are put there to stop LIST. Either to hide the machine code, or to make a program listing streamlined. Instead of a bunch of random keywords appearing it just shows the line number and REM, so that you don't get this:

Code: Select all

   0 REM 5: TRAND SCROLL RETURN PC¢Y×MKRNDSCROLL LN CLEAR RNDFAST LN CLEAR RNDAT VAL FAST LN PLOT RNDLPRINT AT |È?CºK¢GOSUB ??Ø¥W?}É?CºK¢GOSUB ??Ø¥W_yôK²iSTR$ ë_/¹íCOS hINKEY$ STR$ - `x3¯S¦ùS¹Ì? OR SGN STR$ /¤?STR$  OR SGN ¡==x¶?yª?LN PLOT RND OR y( TO SGN TAN GOSUB ?FAST RND?î"LN ºINKEY$ gFAST LN ºINKEY$ LPRINT oTAN SCROLL LN ???¢£
   1 LET U=10
  10 PRINT USR 16516;P;U;U;20;20
  20 PRINT USR 16516;U;U;U;20;20
RS232 wrote: Fri Jun 14, 2024 12:11 pmI am hoping to use this lovely tool in a new zx81 realise if i can get round the issue
The LINE-command can be used as-is, no need to fix it when using LIST. The simplest way to use LINE-command is to start with dr beep's line3.p, delete lines 1, 10 and 20 and put your own program after 0 REM


You could also replace the NEWLINEs with zeros:

Code: Select all

POKE 16514,0
POKE 16515,0
Whether the NEWLINEs are there or not has no affect on how LINE-command draws a line, it only affects how LIST shows the line
LIST with NEWLINE,NEWLINE removed.png

RS232 wrote: Fri Jun 14, 2024 12:11 pm
XavSnap wrote: Thu Jun 13, 2024 10:47 pm RS232,
Is it a wav converted to P ? (read error bits decays)
Can you send you P file on the forum ?
apologies for any cross post confusion..
It is actually the fantastic zx81 draw command from Drbeep the download here (already on the forum)
https://www.sinclairzxworld.com/downloa ... p?id=14940

I am hoping to use this lovely tool in a new zx81 realise if i can get round the issue. Will have everyone credited in an
about page of course if used ;)
User avatar
GCHarder
Posts: 450
Joined: Sat Dec 14, 2013 7:46 pm

Re: How to make listing visable after pokes in line 1

Post by GCHarder »

As I recall the two N/L characters are required only IF there are embedded N/L characters in you MC routine . Trying to LIST such a line can crash the computer.

Regards;

Greg
David G
Posts: 451
Joined: Thu Jul 17, 2014 7:58 am
Location: 48 North

Re: How to make listing visable after pokes in line 1

Post by David G »

GCHarder wrote: Fri Oct 11, 2024 11:37 pm As I recall the two N/L characters are required only IF there are embedded N/L characters in you MC routine . Trying to LIST such a line can crash the computer.

Regards;

Greg
i was thinking the same but have never encountered a problem, so recently i tested it ... no crash or any other problems
before N/L in REM
before N/L in REM
here is the machine code that's in the REM

Code: Select all

    1 REM _asm
           JR    mycode
           NOP            ;POKE a N/L (118) here
   mycode: LD BC,1
           RET
     END _asm
After RUN it still lists OK. I cannot find a scenario where an embedded N/L in a REM causes a problem on the ZX81. Only the visual quirks with LIST
LIST after RUN (with N/L 118)
LIST after RUN (with N/L 118)

I see reports that the "old ROM" crashed in this scenario, so i tried to figure out which ROM ... and it is apparently the ZX80 original ROM, which Toni Baker called the "OLD ROM" and said in Mastering Machine Code:
OLD ROM folk are specifically advised NOT to use a REM statement, since the machine code contains newline characters
User avatar
1024MAK
Posts: 5343
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: How to make listing visable after pokes in line 1

Post by 1024MAK »

Yes, the term “old ROM” generally means the ZX80. The ZX81 ROM being known as the “new ROM”.

It is possible to put some machine code in a REM on the ZX80, but various values (other than normal printable character codes) may cause problems often including a crash.
The ZX81 is much more robust in this regard and I can’t think of myself having any problems (apart from the effect on the listing).

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Autumn is here. Bye bye summer 2024...
User avatar
RS232
Posts: 90
Joined: Fri Apr 05, 2019 8:57 pm

Re: How to make listing visable after pokes in line 1

Post by RS232 »

David G wrote: Thu Oct 10, 2024 11:00 pm Did this ever get resolved?

in my experience the NEWLINES at the beginning of machine code are put there to stop LIST. Either to hide the machine code, or to make a program listing streamlined. Instead of a bunch of random keywords appearing it just shows the line number and REM, so that you don't get this:

Code: Select all

   0 REM 5: TRAND SCROLL RETURN PC¢Y×MKRNDSCROLL LN CLEAR RNDFAST LN CLEAR RNDAT VAL FAST LN PLOT RNDLPRINT AT |È?CºK¢GOSUB ??Ø¥W?}É?CºK¢GOSUB ??Ø¥W_yôK²iSTR$ ë_/¹íCOS hINKEY$ STR$ - `x3¯S¦ùS¹Ì? OR SGN STR$ /¤?STR$  OR SGN ¡==x¶?yª?LN PLOT RND OR y( TO SGN TAN GOSUB ?FAST RND?î"LN ºINKEY$ gFAST LN ºINKEY$ LPRINT oTAN SCROLL LN ???¢£
   1 LET U=10
  10 PRINT USR 16516;P;U;U;20;20
  20 PRINT USR 16516;U;U;U;20;20
The LINE-command can be used as-is, no need to fix it when using LIST. The simplest way to use LINE-command is to start with dr beep's line3.p, delete lines 1, 10 and 20 and put your own program after 0 REM


You could also replace the NEWLINEs with zeros:

Code: Select all

POKE 16514,0
POKE 16515,0
Whether the NEWLINEs are there or not has no affect on how LINE-command draws a line, it only affects how LIST shows the line

LIST with NEWLINE,NEWLINE removed.png
Much thanks
Post Reply