List Remedy

Anything Sinclair ZX Basic related; history, development, tips - differences between BASIC on the ZX80 and ZX81
User avatar
GCHarder
Posts: 477
Joined: Sat Dec 14, 2013 7:46 pm

List Remedy

Post by GCHarder »

Here's a type-in I did from Your Computer 8305. It's a nice Basic Listing program. It comes in very handy when comparing a printed listing from a magazine to what you've typed in, to see if they match. The only problem is line numbers for 0 to 999 aren't padded with spaces, so there's not an exact match until line number 1000 and up is reached. Maybe someone can fix that, I've looked into it but don't see any easy solution.

Regards;

Greg
Attachments
List Remedy (yc8305).zip
(2.26 KiB) Downloaded 1610 times
poglad
Posts: 133
Joined: Mon Mar 24, 2014 3:11 pm
Location: Aberdeen, Scotland

Re: List Remedy

Post by poglad »

This is a very nifty little routine, actually! I'm impressed.

As for your leading-space problem, it's actually very easily solved:

POKE 16528,229
POKE 16529,205
POKE 16530,165
POKE 16531,10
POKE 16532,225
POKE 16533,35

Entering these before using it for the first time, you'll now find the line numbers indented perfectly with leading spaces. 8-)
User avatar
GCHarder
Posts: 477
Joined: Sat Dec 14, 2013 7:46 pm

Re: List Remedy

Post by GCHarder »

Thanks for the fix poglad. I knew there had to be something in the ROM to do that!

I'm uploading a copy of the fixed version, I've also added a "Relocator" with it, which should've been included in the original listing.

Regards;

Greg
Attachments
List Remedy v2.zip
List Remedy prog and mag scan
(169.12 KiB) Downloaded 492 times
stroebeljc
Posts: 114
Joined: Thu Apr 23, 2020 6:02 am
Location: Minneapolis, MN

Re: List Remedy

Post by stroebeljc »

I know this thread is a decade old, but I found it interesting and also found issues with the tool. I've attached an update that allows the display of lines greater than 255 bytes, isn't fooled by 7Eh's in REM statements, and works in either fast or slow mode.
I've also included the source.
Attachments
List Remedy v3.zip
(4.92 KiB) Downloaded 333 times
John
stroebeljc
Posts: 114
Joined: Thu Apr 23, 2020 6:02 am
Location: Minneapolis, MN

Re: List Remedy

Post by stroebeljc »

A few final tweaks before moving on to something else. ;)
The project is also available on GitHub.
Attachments
List Remedy v4.zip
(5.01 KiB) Downloaded 303 times
John
David G
Posts: 632
Joined: Thu Jul 17, 2014 7:58 am
Location: 48 North

Re: List Remedy

Post by David G »

Nice The original "List Remedy.p" works with RAND USR 16516. Has anyone been able to get "List Remedy v4.p" to work?


From Your Computer magazine, March 1983 page 135
List Remedy

-----
ZX-81
-----

Robert Pearlman
Winchmore Hill,
London.

The List routine provided by Sinclair in the ZX-81 ROM is inadequate for the serious programmer for several reasons: a long program must be listed in small sections using many List statements, which is time-consuming and leads to mistakes; the end of a very long line cannot be listed; after a Newline character in a line, which is common in machine-code programs, the rest of the line and the rest of the program are sometimes not listed. Finally, after a Chr$ 126, a common character in machine-code programs, the next five bytes are not listed.

These faults are remedied by my List routine. When executed, a screenful of text is scrolled up the screen and displayed. A small black square then appears in the bottom left of the screen indicating that the program is waiting for a key to be pressed, either Break to abort the listing, or any other key to continue.

The machine-code routine occupies 160 bytes and may be located anywhere in RAM because it uses no absolute addressing, a good place being in RAMtop or in a Rem statement. It can be entered using any of the hexadecimal loaders that have been in previous issues of Your Computer. It is executed by Rand Usr followed by the start address.
Attachments
scan from Your Computer
scan from Your Computer
User avatar
XavSnap
Posts: 2193
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.
Contact:

Re: List Remedy

Post by XavSnap »

Found on an old tape: (release 1 ?)
https://www.sinclairzxworld.com/viewtop ... 032#p40032
9ListRemedy.p
(1.63 KiB) Downloaded 165 times

Not available on this link: https://www.sinclairzxworld.com/viewtop ... =11&t=3896
Last edited by XavSnap on Mon Nov 04, 2024 5:32 pm, edited 2 times in total.
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
David G
Posts: 632
Joined: Thu Jul 17, 2014 7:58 am
Location: 48 North

Re: List Remedy

Post by David G »

Nice find!
XavSnap wrote: Mon Nov 04, 2024 1:17 amFound on an old tape: (release 1 ?)
https://www.sinclairzxworld.com/viewtop ... 032#p40032

9ListRemedy.p

Not available on this tread: https://www.sinclairzxworld.com/viewtop ... =11&t=3896
I will add the original type-in to the topic "[Zx81:Type-Ins] "Your Computer" campaign" and also link back to this
David G
Posts: 632
Joined: Thu Jul 17, 2014 7:58 am
Location: 48 North

Re: List Remedy

Post by David G »

stroebeljc wrote: Wed Mar 13, 2024 5:51 pm List Remedy v4
This evening I got the idea to look the ASM file for List Remedy v4 to see what the entry point is

It turns out to be:

Code: Select all

RAND USR 16541
V4 works! Nice feature upgrades ... next I will have fun figuring out how List Remedy works, what methods it uses
User avatar
XavSnap
Posts: 2193
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.
Contact:

Re: List Remedy

Post by XavSnap »

Hi David,

It's a claver program use to scan the BASIC memory segment.

All chars are retrieved in each line, and displayed on the screen.
The same process than the text to P tokens translater.
If the screen is full, the program stop to wait a key.

The process for "LIST line" stop on a display error.
But this code able to display the listing the ASM REM like a LLIST, without $76;$76 [end of BASIC bloc] end.

It's used to display a LLIST function on the screen and avoid the famous LIST display crash on the illegals ASM codes in a REM line.

Is there anyone able to do a REM able to freeze or rebout a BASIC program ? (Witout a $76;$76 code!)
1 REM HELLO WORLD
2 REM END
POKE 16513,0 (SPACE)
RUN
C/1
POKE 16513,228 (SLOW)
POKE 16513,229 (FAST)
RUN
0/2
LIST is ok...

POKE 16513,232 (CONT)
RUN
wait a break to exit.
POKE 16513,240 (LIST)
RUN
2/1
Without $76;$76 in the REM line...
(...)
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Post Reply