List Labels

Discussion about ZX80 / ZX81 Software
Post Reply
User avatar
mrtinb
Posts: 524
Joined: Fri Nov 06, 2015 4:44 pm
Location: Denmark
Contact:

List Labels

Post by mrtinb » Sat Apr 15, 2017 10:02 pm

Name of Software: List Labels
Author: Martin Ancher
Release Date: 15 April 2017
Requirements: 16K
Description: My first ZX81 release. A small utility to print the labels (and their address) generated by ZX Assembler 2 v38.
Download link: lstlab-h4f.p (source is relocatable)
Freeware - BSD license.

Code: Select all

   1 REM ///<<<< LIST LABELS <<<
   EMRND? PLOT  4:5 ?Y 7 IF 7 PL
   OT FFPI4PF NEW LIST ACS ZACS 
   ZACS ZACS ZLEN 0NOT ? NEW ?LE
   N 0NOT FACS ZACS ZACS ZLEN 0N
   OT ? NEW ?LEN 0NOT Y8711 /TAN
                      ?NOT ?
   2 RAND 1
   3 RAND USR 16516
   4 STOP
   5 PRINT "INPUT CODE YOU REMBERED [X999]"
   6 INPUT A$
  55 RAND (CODE A$( TO 1)-28)*1000+VAL A$(2 TO )
  56 CLS
  57 RAND USR 16516
9995 STOP
9996 SAVE "LSTLAB"
9997 LIST 9999
9999 REM       LIST LABELS      
               ___________      
THIS LITTLE UTILITY WILL LIST   
LABELS OF ASSEMBLER SOURCE      
COMPILED WITH [ZX] [ASSEMBLER] [2] [V38]                                

[RUN] WILL DISPLAY THE 1ST PAGE.
THIS CAN THEN BE PRINTED WITH   
[LLIST]

IF THERE ARE MORE LABELS THAN   
CAN BE WRITTEN ON 1 PAGE, THE   
PROGRAM STOPS WITH ERROR [5] AND A
CODE LIKE [X999]. REMEMBER THIS
CODE                                                            

START THE PROGRAM AGAIN WITH    
[GOTO] [5] AND INPUT THE CODE TO    
CONTINUE THE DISPLAY OF THE LIST                                

THIS MAY BE REPEATED TO DISPLAY 
AND PRINT ALL PAGES

Code: Select all

SEED=4032
      ; CALL WITH RAND 1
      ;           RAND USR X
      ; IF SEED IS NOT 1 MOVE
      ; SEED TO POSITION AND
      ; GO TO LABEL FIRST
      JR START
      DM "<<< LIST LABELS <<<"
START LD HL,(SEED)
      LD A,H
      OR 0
      JR NZ NXTLT
      ; FIND 00 00
      LD HL,6100
FIRST LD A,0
      INC HL
      CP (HL)
      JR NZ FIRST
      INC HL
      CP (HL)
      JR NZ FIRST
      DEC HL
NXTLT DEC HL
      ; GO BACKWARD AND WRITE
      ; CHAR UNTIL CHAR IS
      ; BELOW 28 OR PI
      LD A,(HL)
      CP 1C
      JR C END
      CP 42
      JR NZ WRITE
      ; IF PI WRITE SPACES, THE
      ; NEXT 2 NUMBERS AND
      ; SPACES AND GO BACK TO
      ; LABEL WRITE
      DEC HL
      LD A,(HL)
      LD B,A
      LD A,0
      RST 10
      LD A,B
      AND F0
      SRL A
      SRL A
      SRL A
      SRL A
      ADD A,1C
      RST 10
      LD A,B
      AND F
      ADD A,1C
      RST 10
      DEC HL
      LD A,(HL)
      LD B,A
      AND F0
      SRL A
      SRL A
      SRL A
      SRL A
      ADD A,1C
      RST 10
      LD A,B
      AND F
      ADD A,1C
      RST 10
      LD A,76
      LD (4007),HL
WRITE RST 10
      JR NXTLT
END   RET
Edit: Requires ZX Assembler 2 v38 has just assembled your program, and that the area around $6100 where the labels are stored have not been corrupted yet.
Martin
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest