z88dk-dis making labels by it self

Requests for features
cborn
Well known member
Posts: 267
Joined: Tue Oct 06, 2020 7:45 pm

z88dk-dis making labels by it self

Post by cborn »

Hello,
I was using z88dk-dis and got a nice disas. Its stil very sober so to say.
But i would like it to make lables at the start of the line.
I only see the option to use an z80asm map which is already created, or do i misunderstand it?

I tryed to find the printing line within the z88dk-source and i geuss i found the place to add it.
its in /src/ticks/disassembler_alg.c and its all fetched in 'offs' like in the almost final part
offs += snprintf(buf + offs, buflen - offs, ";[%04x] ", start_pc);
which seems to add the correct address of the line.
that is the info i would like to start with eg like in SkoolDaze just starting with an 'L' instead of the dollar sign.
that is 1 step easier for further manual disas like with those JR adresses which a now "stuck" to the adres.
With the same trick its a label!
But the relative value like found in the code would be good to, like JR +10

I asume z88dk-dis is still underconstruction and i hope there is some time to build this in if i did NOT overlook it some where.
:lol:
cborn
Well known member
Posts: 267
Joined: Tue Oct 06, 2020 7:45 pm

Re: z88dk-dis making labels by it self

Post by cborn »

IF i see it correct the actual line with 'start_pc' easily could be moved UP in the file right under:

Code: Select all

    buf = bufstart + offs;
    buflen -= offs;

    offs = snprintf(buf, buflen, "%-20s", "");

but let it make that label on al JR/JP and CALL's is a big second step....

probably i am running ahead of my question now? do i?
nuc1e0n
Member
Posts: 49
Joined: Wed Jun 10, 2020 12:34 am

Re: z88dk-dis making labels by it self

Post by nuc1e0n »

My understanding of what you'd like to do is you'd like to create some assembly language symbol and make sure it is placed at a memory location that you define. You want to do this so you can then refer to this symbol from your C code.

Is my understanding of what you want correct?

If so, z88dk currently has a means to include assembly code inline in C files, using the __asm and __endasm C compiler intrinsics.

Here's a piece of code I wrote that uses inline assembly. As you can see, the newStack variable is reference in both the C code and the inline assembly:

Code: Select all

#pragma output protect8080
#pragma output nofileio
#include <compress/zx7.h>
extern unsigned char chooseCLib[];
extern int newStack;

void main(void) {
  /* decompress c lib chooser code from the embedded array into address 0x4000 */
  dzx7_turbo(((unsigned int *)chooseCLib), ((unsigned char *)16384));

  /* jp to the code */
  __asm
    ld hl, (cleanup+6)
    ld (_newStack), hl
    jp 16384
  __endasm;
}
The newStack label/symbol is actually exported from an .asm file that has a "PUBLIC _newStack" z88dk-z80asm directive (https://github.com/z88dk/z88dk/wiki/Too ... fxlib-name) within it to allow to to be referred to by other source files during linking.

you could export the _newStack symbol from a label in your assembly code, with code similar to this:

Code: Select all

PUBLIC _newStack
_newStack:
  defw 0x1234

If you'd like to directly export a hard coded value for the symbol in the asm file rather than a label, you can use the EQU assembler directive. For example :

Code: Select all

PUBLIC _newStack
_newStack EQU 0x401F 
cborn
Well known member
Posts: 267
Joined: Tue Oct 06, 2020 7:45 pm

Re: z88dk-dis making labels by it self

Post by cborn »

Hi, thank you very much for your extensive answer but my question is about the "service program" z88dk-dis, the native DISassembler.
this is a part of "tw3ctrl" a piece of tasword3 for DICiPLE from MGT and i hope to deduct HOW the so called "special" file is created, hence the use of z88dk-dis:

z88dk-dis -o 25000 -mz80 tw3ctrl.BIN > tw3ctrl.asm

Code: Select all

                    ld      h,l                             ;[645f] 65
                    ld      h,h                             ;[6460] 64
                    ld      hl,($645f)                      ;[6461] 2a 5f 64
                    jp      (hl)                            ;[6464] e9
                    ld      hl,$64c1                        ;[6465] 21 c1 64
                    ld      ($645f),hl                      ;[6468] 22 5f 64
                    ld      b,$08                           ;[646b] 06 08
                    ld      hl,$636f                        ;[646d] 21 6f 63
                    call    $64df                           ;[6470] cd df 64
                    call    nc,$64f1                        ;[6473] d4 f1 64
                    jr      nc,$646b                        ;[6476] 30 f3

it would be easier for me if it was combined like:

Code: Select all

L645f                    ld      h,l                             ;[645f] 65
L6460                    ld      h,h                             ;[6460] 64
L6461                    ld      hl,($645f)                      ;[6461] 2a 5f 64
L6464                    jp      (hl)                            ;[6464] e9
L6465                    ld      hl,$64c1                        ;[6465] 21 c1 64
L6468                    ld      ($645f),hl                      ;[6468] 22 5f 64

L646b                    ld      b,$08                           ;[646b] 06 08
L646d                    ld      hl,$636f                        ;[646d] 21 6f 63
L6470                    call    L64df                           ;[6470] cd df 64
L6473                    call    nc,L64f1                        ;[6473] d4 f1 64
L6476                   jr      nc,L646b                        ;[6476] 30 f3

L6478                    ld      hl,$6b00                        ;[6478] 21 00 6b
L647b                    call    L694b                           ;[647b] cd 4b 69
L647e                   jr      nc,L646b                        ;[647e] 30 eb
maybe i am smart enough to fix it myself, but if a 'senior' can do it its much more trustable.
nuc1e0n
Member
Posts: 49
Joined: Wed Jun 10, 2020 12:34 am

Re: z88dk-dis making labels by it self

Post by nuc1e0n »

I think I understand now. You'd like the assembly language output from z88dk-dis to produce a listing with symbolic labels rather than hard coded addresses right?

Looking at the output you've supplied here some of the instructions you're getting seem nonsensical to me. Is this definitely code and not data of some sort?

I know the fuse zx spectrum emulator has a built in debugger that can be used to step through instructions and set breakpoints on certain memory locations being reached. It also supports the disciple disk interface. Looking at a pdf of the disciple interface manual at https://spectrumcomputing.co.uk/entry/1 ... _Interface I can also see that it extends zx basic to allow loading and saving of files. Most such zx basic extensions work by triggering memory paging by hooking into the 'print a syntax error message' entry point at location 0x0008.

Maybe you could set a breakpoint on 0x0008 then run the relevant tasword code you'd like to modify. That might lead to the code you want to change more directly than inspecting disassembler output.
cborn
Well known member
Posts: 267
Joined: Tue Oct 06, 2020 7:45 pm

Re: z88dk-dis making labels by it self

Post by cborn »

No, thanks for going deep in it, Its much more simple.
The bin file i look at now is just an example. i program mostly on ZX with pasmo and a bit off zmake. After about 20 years of restarting with C i now a kind know what i did wrong 20 years ago, but "natively" i do z80 source and zx basic.
pasmo is a simple and straight forward assembler with JUST a label interpreter and a few extra's with which i did severall manualy disassemblies.
So now i am learning C and would like to use that z80 knowledge of me in my "diskreader"
What i show above is enough for what i want. I think i will (have to) try this myself. C is an universal language and for the sysvar printing, disk reading and the z88dk-dis, its all the same and thus possible. Maybe my proposal of placing the line higher is enough and maybe i just have to re-compile it.
I always can reload it with the last nightly. Thanks for your answer.
cborn
Well known member
Posts: 267
Joined: Tue Oct 06, 2020 7:45 pm

Re: z88dk-dis making labels by it self

Post by cborn »

Well,
my first addaptation works, i put the line a bit lower:
in z88dk/src/ticks/disassembler_alg.c
then i did a 'make' INSIDE this directory, how easy!

Code: Select all

    offs = snprintf(buf, buflen, "%-1s", ""); // was "%-20s"
    do {
        READ_BYTE(state, b);

        // Decoding the main page
        // x = the opcode's 1st octal digit (i.e. bits 7-6)
        // y = the opcode's 2nd octal digit (i.e. bits 5-3)
        // z = the opcode's 3rd octal digit (i.e. bits 2-0)
        uint8_t x = b >> 6;
        uint8_t y = ( b & 0x38) >> 3;
        uint8_t z = b & 0x07;
        uint8_t p = (y & 0x06) >> 1;
        uint8_t q = y & 0x01;

// added by c born feb 2022
    offs += snprintf(buf + offs, buflen - offs, "L%04x    ", start_pc);

        switch ( x ) {
YEAH!
i coded in z88dk!

Code: Select all

 L61a8    jp      $6461                                     ;[61a8] c3 61 64
 L61ab    jp      $6534                                     ;[61ab] c3 34 65
 L61ae    jp      $6599                                     ;[61ae] c3 99 65
now i have to select the JP etc. :p
nuc1e0n
Member
Posts: 49
Joined: Wed Jun 10, 2020 12:34 am

Re: z88dk-dis making labels by it self

Post by nuc1e0n »

Nice work. Glad to see you were able to achieve what you wanted. Sorry I wasn't able to provide better help.

Just out of curiosity, what's the larger project you're working on here? An MGT format .dsk reader for esxdos or something like that?
cborn
Well known member
Posts: 267
Joined: Tue Oct 06, 2020 7:45 pm

Re: z88dk-dis making labels by it self

Post by cborn »

Hi nuc1e0n, thats indeed my mgtDISCiPLEDisk reader (mgtDD) here on the forum, maybe i should start a single tread for it:
https://www.z88dk.org/forum/viewtopic.p ... 240#p20240

@DOM
meanwhile i feel over eager or some alike...:::
http://www.cborn.nl/c/mlabel.zip

Its not a patch at all since it ONLY add this label in front, or no label, but i think that for me it works.
i should have changed the names better probably!! becouse IF you apply it
now its a real CHANGE !!!!!
well, i added 'char *mlabel' in z88dk-dis with which you can make a SINGLE character label
./z88dk-dis -lZ -o 25000 -mz80 tw3ctrl.BIN
Z61a8 jp $6461 ;[61a8] c3 61 64
Z61ab jp $6534 ;[61ab] c3 34 65
Z61ae jp $6599 ;[61ae] c3 99 65
Z61b1 jp $658a ;[61b1] c3 8a 65

i changed ticks.h
extern int disassemble2(int pc, char *buf, size_t buflen, int compact, char *mlabel);

debugger.c at severall lines eg
len = disassemble2(pc, buf, sizeof(buf), 0, 0); // added ',0' for char mlabel c.b.

added '-l' argument choise in disassembler_main.c
char *mlabel=0; //added by c.b. mlabel means Make Labels in asm file 'Lhexx code hexx'

case 'l': //added by c.b.
mlabel=argv[0][2]; // 1 character only as a label
break;


changed severall lines in disassembler_alg.c

in the ZIP file the have all original varibale names, so it will realy change instead of adding a new program, sorry, that was easiest at this hack off a moment.
hmm, weird, i made it my self now!
yippie!
cborn
Well known member
Posts: 267
Joined: Tue Oct 06, 2020 7:45 pm

Re: z88dk-dis making labels by it self

Post by cborn »

Meanwhile i have at least two questions:
1)
in disassembly_main file file option '-i' is invoked

Code: Select all

            case 'i':
                inverted = 255;
                break;
What does it doe?
and its not in the common option enlisted, is it experimental?
2)
the file options are checked with
while ( argc > 1 ) {
but option 'i' and option 'm' dont use
argc--; argv++;
like the other options. I assumes its the NEXT argument instruction and then all options should have it?
then i should include it in 'l' myself and probaly add it for those other two options aswell?
for 'm' i would set the line 'nexter' in

Code: Select all

                } else {
                    printf("Unknown CPU: %s\n",&argv[0][2]);
                }
                argc--; argv++;    /////////////////
                break;
cheers
chris
nuc1e0n
Member
Posts: 49
Joined: Wed Jun 10, 2020 12:34 am

Re: z88dk-dis making labels by it self

Post by nuc1e0n »

It might be worth maintaining your own fork of z88dk which contains the changes you want in the short term. Perhaps some feature will be made available upstream that you can switch to using later. At the main developers discretion of course.

This is all obviously only my opinion, but if this were my project I would want to properly plan new features that benefit users in general rather changes for a specific use case.

Dom has most graciously added a feature similar to one I needed recently, but if he were to have chosen not to do that I would have had to keep maintaining my previous fork, which would've been fine by me.
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: z88dk-dis making labels by it self

Post by dom »

Some git annotating about -i option leads to this commit: 49ec6c16c48 which indicates that change is for reading files extracting from MZ2500 discs. The contents there are xor'd by 0xff - lets just say it's niche...

z88dk-dis is a single pass disassembler so creating and using labels wouldn't really work. Thankfully, it's pretty easy to turn into a two pass disassembler. It's not perfect and trips up over some types of self modifying code but something like this is probably a neat feature to add - I always used to use dz80 which has a similar feature.

Code: Select all

diff --git a/src/ticks/disassembler_alg.c b/src/ticks/disassembler_alg.c
index 0ed67ccd75..565ef246c8 100644
--- a/src/ticks/disassembler_alg.c
+++ b/src/ticks/disassembler_alg.c
@@ -63,6 +63,11 @@ static char *handle_rel8(dcontext *state, char *buf, size_t buflen)
     if ( (label = find_symbol(state->pc + displacement, SYM_ADDRESS)) != NULL ) {
         BUF_PRINTF("%s",label);
     } else {
+        char temp[10];
+
+        snprintf(temp,sizeof(temp),"L%04x",state->pc + displacement);
+        symbol_add_autolabel(state->pc + displacement,temp);
+
         BUF_PRINTF("$%04x", (unsigned short)(state->pc + displacement));
     }
     
@@ -83,6 +88,10 @@ static char *handle_addr16(dcontext *state, char *buf, size_t buflen)
     if ( (label = find_symbol(lsb + msb * 256, SYM_ADDRESS)) != NULL ) {
         BUF_PRINTF("%s",label);
     } else {
+        char temp[10];
+
+        snprintf(temp,sizeof(temp),"L%02x%02x",msb,lsb);
+        symbol_add_autolabel(lsb + msb * 256,temp);
         BUF_PRINTF("$%02x%02x", msb, lsb);
     }
     return buf;
diff --git a/src/ticks/disassembler_main.c b/src/ticks/disassembler_main.c
index c2010d404b..cc6a1fff55 100644
--- a/src/ticks/disassembler_main.c
+++ b/src/ticks/disassembler_main.c
@@ -141,9 +141,15 @@ int main(int argc, char **argv)
 static void disassemble_loop(int start, int end)
 {
     char   buf[256];
+    int    start2 = start;
 
-    while ( start < end ) {
-        start += disassemble2(start, buf, sizeof(buf), 0);
+    while ( start2 < end ) {
+        start2 += disassemble2(start2, buf, sizeof(buf), 0);
+    }
+
+    start2 = start;
+    while ( start2 < end ) {
+        start2 += disassemble2(start2, buf, sizeof(buf), 0);
         printf("%s\n",buf);
     }
 }
diff --git a/src/ticks/syms.c b/src/ticks/syms.c
index 7450280746..1a1c9689b0 100644
--- a/src/ticks/syms.c
+++ b/src/ticks/syms.c
@@ -283,3 +283,16 @@ char **parse_words(char *line, int *argc)
 
     return args;
 }
+
+void symbol_add_autolabel(int address, char *label)
+{
+    symbol *sym = calloc(1,sizeof(*sym));
+    sym->name = strdup(label);
+    sym->address = address;
+    sym->symtype = SYM_ADDRESS;
+    if ( sym->address >= 0 && sym->address <= 65535 ) {
+        LL_APPEND(symbols[sym->address], sym);
+    }
+    HASH_ADD_KEYPTR(hh, symbols_byname, sym->name, strlen(sym->name), sym);
+
+}
diff --git a/src/ticks/syms.h b/src/ticks/syms.h
index c4e11a41e8..5044e077c5 100644
--- a/src/ticks/syms.h
+++ b/src/ticks/syms.h
@@ -30,5 +30,6 @@ extern const char     *find_symbol(int addr, symboltype preferred_symtype);
 extern symbol   *find_symbol_byname(const char *name);
 extern int symbol_resolve(char *name);
 extern char **parse_words(char *line, int *argc);
+extern void symbol_add_autolabel(int addr, char *label);
 
 #endif
\ No newline at end of file

cborn
Well known member
Posts: 267
Joined: Tue Oct 06, 2020 7:45 pm

Re: z88dk-dis making labels by it self

Post by cborn »

thanks for your repley and the explain of '-i', meanwhile i did two things more:
http://www.cborn.nl/c/makelabel.zip

the JP and JR statements are included now
the 1 character label is limited to 'A"-'Z' and 'a'-'z'
maybe i get a real string as a labelname
i can try L_hexx becouse NOW A becomes eg AFFFF thats a value!

and btw i (already) changed 'mlabel' into 'makelabel' since then its make distict from a plain 'label'
i changed 'handle_addr16' and 'handle_rel8' aswell by adding an 'makelabel' decision

a two-pass disassembler probably first collects those step in a map and then uses that map to check it self some how?
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: z88dk-dis making labels by it self

Post by dom »

a two-pass disassembler probably first collects those step in a map and then uses that map to check it self some how?
So my diff runs through the disassembly (without printing to screen), gathering up the addresses that are used as part of jp, jr ld (NNMN),X ld x,(NNNN) and adds them to the symbol table.

The second pass runs through the disassembly, printing to the screen this time, and it can use the labels since they were defined on the first run. The two passes means that the target of a backwards jump can get a label.
cborn
Well known member
Posts: 267
Joined: Tue Oct 06, 2020 7:45 pm

Re: z88dk-dis making labels by it self

Post by cborn »

I was about to add opening a write file to make a map, but now you say that you use 'diff'. that is the common diff command? and you select the correct adresses with it?
what is the correct format of a map file anyway? the zxmgtDD file from nuc1e0n has oone but it much larger and holding all sytem vars aswell, and a lot of automated remarks.
cborn
Well known member
Posts: 267
Joined: Tue Oct 06, 2020 7:45 pm

Re: z88dk-dis making labels by it self

Post by cborn »

cborn wrote: Sun Feb 13, 2022 11:12 am but now you say that you use 'diff'. that is the common diff command?
You already gave that and you compare the file with itself.. ok
cborn
Well known member
Posts: 267
Joined: Tue Oct 06, 2020 7:45 pm

Re: z88dk-dis making labels by it self

Post by cborn »

dom wrote: Sat Feb 12, 2022 9:15 pm Some git annotating about -i option leads to this commit: 49ec6c16c48 which indicates that change is for reading files extracting from MZ2500 discs. The contents there are xor'd by 0xff - lets just say it's niche...
(..)
I found it
return mem[pc % 65536] ^ inverted;

the whole segment off 65536 bytes is returned as result but the result is totaly inverted with 0xff aka its a big CPL complement.
with just a single code ' ^ inverted '
i would need a whole routine for that..ok! :/
cheers

ps some zx programs are inverted to save loading time, since 0 is long and 1 is short as a beep (or reversed?)
its a time-compression trick
cheers
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: z88dk-dis making labels by it self

Post by dom »

I’ve committed the autolabel code I hacked together above. Just add -a to the command line.

Z88dk-dis is now section aware and won’t attempt to disassemble bss, data and rodata sections as named by z88dk
nuc1e0n
Member
Posts: 49
Joined: Wed Jun 10, 2020 12:34 am

Re: z88dk-dis making labels by it self

Post by nuc1e0n »

Very cool. Cheers dom :)
cborn
Well known member
Posts: 267
Joined: Tue Oct 06, 2020 7:45 pm

Re: z88dk-dis making labels by it self

Post by cborn »

To day is an update day!
thank you!
cborn
Well known member
Posts: 267
Joined: Tue Oct 06, 2020 7:45 pm

Re: z88dk-dis making labels by it self

Post by cborn »

do you perhaps have an example map ?
i would like to try to make a system.map eg for 128k and 48k as a kind of start maps.
Perhaps even with use off the systemvariables, although i dont know how often those are used within C projects. but the ramtop is probably set and thus mappable.
cborn
Well known member
Posts: 267
Joined: Tue Oct 06, 2020 7:45 pm

Re: z88dk-dis making labels by it self

Post by cborn »

Hi
with an '$' it works
and its what I personaly call an "egu list"
hope i didnt make any mistakes so i saved it as
sysvar48k.equ

eg VU-Calc
z88dk-dis -a -x sysvar48k.equ -o 25232 -mz80 VUbin.bin > VUcode_004.asm

Code: Select all


KSTATE  equ $5C00 ; 23552 ;
KSTATE1 equ $5C01 ; 23553 ;
KSTATE2 equ $5C02 ; 23554 ;
KSTATE3 equ $5C03 ; 23555 ;
KSTATE4 equ $5C04 ; 23556 ;
KSTATE5 equ $5C05 ; 23557 ;
KSTATE6 equ $5C06 ; 23558 ;
KSTATE7 equ $5C07 ; 23559 ;

LASTK   equ $5C08 ; 23560 ;

REPDEL  equ $5C09 ; 23561 ;
REPPER  equ $5C0A ; 23562 ;

DEFADD  equ $5C0B ; 23563 ;
DEFADD2 equ $5C0C ; 23564 ;

KDATA   equ $5C0D ; 23565 ;

TVDATA  equ $5C0E ; 23566 ;
TVDATA2 equ $5C0F ; 23567 ;

STRMS   equ $5C10 ; 23568 ; // -3
STRMS01 equ $5C11 ; 23569 ;
STRMS02 equ $5C12 ; 23570 ; // -2
STRMS03 equ $5C13 ; 23571 ;
STRMS04 equ $5C14 ; 23572 ; // -1
STRMS05 equ $5C15 ; 23573 ;
STRMS06 equ $5C16 ; 23574 ; //  0
STRMS07 equ $5C17 ; 23575 ;
STRMS08 equ $5C18 ; 23576 ; //  1
STRMS09 equ $5C19 ; 23577 ;
STRMS10 equ $5C1A ; 23578 ; //  2
STRMS11 equ $5C1B ; 23579 ;
STRMS12 equ $5C1C ; 23580 ; //  3
STRMS13 equ $5C1D ; 23581 ;
STRMS14 equ $5C1E ; 23582 ; //  4
STRMS15 equ $5C1F ; 23583 ;
STRMS16 equ $5C20 ; 23584 ; //  5
STRMS17 equ $5C21 ; 23585 ;
STRMS18 equ $5C22 ; 23586 ; //  6
STRMS19 equ $5C23 ; 23587 ;
STRMS20 equ $5C24 ; 23588 ; //  7
STRMS21 equ $5C25 ; 23589 ;
STRMS22 equ $5C26 ; 23590 ; //  8
STRMS23 equ $5C27 ; 23591 ;
STRMS24 equ $5C28 ; 23592 ; //  9
STRMS25 equ $5C29 ; 23593 ;
STRMS26 equ $5C2A ; 23594 ; // 10
STRMS27 equ $5C2B ; 23595 ;
STRMS28 equ $5C2C ; 23596 ; // 11
STRMS29 equ $5C2D ; 23597 ;
STRMS30 equ $5C2E ; 23598 ; // 12
STRMS31 equ $5C2F ; 23599 ;
STRMS32 equ $5C30 ; 23600 ; // 13
STRMS33 equ $5C31 ; 23601 ;
STRMS34 equ $5C32 ; 23602 ; // 14
STRMS35 equ $5C33 ; 23603 ;
STRMS36 equ $5C34 ; 23604 ; // 15
STRMS37 equ $5C35 ; 23605 ;

CHARS   equ $5C36 ; 23606 ;
CHARS2  equ $5C37 ; 23607 ;

RASP    equ $5C38 ; 23608 ;

PIP     equ $5C39 ; 23609 ;

ERRNR   equ $5C3A ; 23610 ;

FLAGS   equ $5C3B ; 23611 ; //

TVFLAGS equ $5C3C ; 23612 ; //

ERRSP   equ $5C3D ; 23613 ;

ERRSP2  equ $5C3E ; 23614 ;

LISTSP  equ $5C3F ; 23615 ;
LISTSP2 equ $5C40 ; 23616 ;

MODE    equ $5C41 ; 23617 ; //

NEWPPC  equ $5C42 ; 23618 ;
NEWPPC2 equ $5C43 ; 23619 ;

NSPPC   equ $5C44 ; 23620 ;

PPC     equ $5C45 ; 23621 ;
PPC2    equ $5C46 ; 23622 ;

SUBPPC  equ $5C47 ; 23623 ;

BORDCR  equ $5C48 ; 23624 ;

EPPC    equ $5C49 ; 23625 ;
EPPC2   equ $5C4A ; 23626 ;

VARS    equ $5C4B ; 23627 ;
VARS2   equ $5C4C ;

DEST    equ $5C4D ; 23629 ;
DEST2   equ $5C4E ; 23630 ;

CHANS   equ $5C4F ; 23631 ;
CHANS2  equ $5C50 ; 23632 ;

CURCHL  equ $5C51 ; 23633 ;
CURCHL2 equ $5C52 ; 23634 ;

PROG    equ $5C53 ; 23635 ;
PROG2   equ $5C54 ; 23636 ;

NXTLIN  equ $5C55 ; 23637 ;
NXTLIN2 equ $5C56 ; 23638 ;

DATADD  equ $5C57 ; 23639 ;
DATADD2 equ $5C58 ; 23640 ;

ELINE   equ $5C59 ; 23641 ;
ELINE2  equ $5C5A ; 23642 ;

KCUR    equ $5C5B ; 23643 ;
KCUR2   equ $5C5C ; 23644 ;

CHADD   equ $5C5D ; 23645 ;
CHADD2  equ $5C5E ; 23646 ;

XPTR    equ $5C5F ; 23647 ;
XPTR2   equ $5C60 ; 23648 ;

WORKSP  equ 23649 ;
WORKSP2 equ 23650 ;

STKBOT  equ 23651 ;
STKBOT2 equ 23652 ;

STKEND  equ 23653 ;
STKEND2 equ 23654 ;

BREG    equ 23655 ;

MEM     equ 23656 ;
MEM2    equ 23657 ;

FLAGS2  equ 23658 ; //

DFSZ    equ 23659 ;

S_TOP   equ 23660 ;
S_TOP2  equ 23661 ;

OLDPPC  equ 23662 ;
OLDPPC2 equ 23663 ;
OSPPC   equ 23664 ;

FLAGX   equ 23665 ; //

STRLEN  equ 23666 ;
STRLEN2 equ 23667 ;

TADDR   equ 23668 ;
TADDR2  equ 23669 ;

SEED    equ 23670 ;
SEED2   equ 23671 ;

FRAMES  equ 23672 ;
FRAMES2 equ 23673 ;
FRAMES3 equ 23674 ;

UDG     equ 23675 ;
UDG2    equ 23676 ;

COORDX  equ 23677 ;
COORDY  equ 23678 ;

PPOSN   equ 23679 ;

PRCC    equ 23680 ;
PRCC2   equ 23681 ;

ECHOE   equ 23682 ;
ECHOE2  equ 23683 ;

DFCC    equ 23684 ;
DFCC2   equ 23685 ;
DFCCL   equ 23686 ;
DFCCL2  equ 23687 ;

SPOSUC  equ 23688 ;
SPOSUL  equ 23689 ;
SPOSLC  equ 23690 ;
SPOSLL  equ 23691 ;

SCRCT   equ 23692 ;

ATTRP   equ 23693 ;
MASKP   equ 23694 ;

ATTRT   equ 23695 ;
MASKT   equ 23696 ;

PFLAG   equ 23697 ;

MEMBOT  equ 23698 ;
MEMBOT01 equ 23699 ;
MEMBOT02 equ  23700 ;
MEMBOT03 equ  23701 ;
MEMBOT04 equ  23702 ;
MEMBOT05 equ  23703 ;
MEMBOT06 equ  23704 ;
MEMBOT07 equ  23705 ;
MEMBOT08 equ  23706 ;
MEMBOT09 equ  23707 ;

MEMBOT10 equ  23708 ;
MEMBOT11 equ  23709 ;
MEMBOT12 equ  23710 ;
MEMBOT13 equ  23711 ;
MEMBOT14 equ  23712 ;
MEMBOT15 equ  23713 ;
MEMBOT16 equ  23714 ;
MEMBOT17 equ  23715 ;
MEMBOT18 equ  23716 ;
MEMBOT19 equ  23717 ;

MEMBOT20 equ  23718 ;
MEMBOT21 equ  23719 ;
MEMBOT22 equ  23720 ;
MEMBOT23 equ  23721 ;
MEMBOT24 equ  23722 ;
MEMBOT25 equ  23723 ;
MEMBOT26 equ  23724 ;
MEMBOT27 equ  23725 ;
MEMBOT28 equ  23726 ;
MEMBOT29 equ  23727 ;

NONAME   equ  23728 ;
NONAME2  equ  23629 ;

RAMTOP   equ  23730 ;
RAMTOP2  equ  23631 ;

PRAMT    equ  23632 ;
PRAMT2   equ  23633 ;
cborn
Well known member
Posts: 267
Joined: Tue Oct 06, 2020 7:45 pm

Re: z88dk-dis making labels by it self

Post by cborn »

result

ld hl,(CHARS) ;[64ff] 2a 36 5c

nice !!
now the 128k and the IF1 sysvar equ lists
cborn
Well known member
Posts: 267
Joined: Tue Oct 06, 2020 7:45 pm

Re: z88dk-dis making labels by it self

Post by cborn »

i was a bit TOO enthousiastic on those STREAMS
its only 16+3 so i made correct names with the second being the lower byte

Code: Select all

STRMS    equ $5C10
STRMSFD  equ $5C10 ; 23568 ; // -3
STRMSFDl equ $5C11 ; 23569 ;
STRMSFE  equ $5C12 ; 23570 ; // -2
STRMSFEl equ $5C13 ; 23571 ;
STRMSFF  equ $5C14 ; 23572 ; // -1
STRMSFFl equ $5C15 ; 23573 ;
STRMS00  equ $5C16 ; 23574 ; //  0
STRMS00l equ $5C17 ; 23575 ;
STRMS01  equ $5C18 ; 23576 ; //  1
STRMS01l equ $5C19 ; 23577 ;
STRMS02  equ $5C1A ; 23578 ; //  2
STRMS02l equ $5C1B ; 23579 ;
STRMS03  equ $5C1C ; 23580 ; //  3
STRMS03l equ $5C1D ; 23581 ;
STRMS04  equ $5C1E ; 23582 ; //  4
STRMS04l equ $5C1F ; 23583 ;
STRMS05  equ $5C20 ; 23584 ; //  5
STRMS05l equ $5C21 ; 23585 ;
STRMS06  equ $5C22 ; 23586 ; //  6
STRMS06l equ $5C23 ; 23587 ;
STRMS07  equ $5C24 ; 23588 ; //  7
STRMS07l equ $5C25 ; 23589 ;
STRMS08  equ $5C26 ; 23590 ; //  8
STRMS08l equ $5C27 ; 23591 ;
STRMS09  equ $5C28 ; 23592 ; //  9
STRMS09l equ $5C29 ; 23593 ;
STRMS10  equ $5C2A ; 23594 ; // 10
STRMS10l equ $5C2B ; 23595 ;
STRMS11  equ $5C2C ; 23596 ; // 11
STRMS11l equ $5C2D ; 23597 ;
STRMS12  equ $5C2E ; 23598 ; // 12
STRMS12l equ $5C2F ; 23599 ;
STRMS13  equ $5C30 ; 23600 ; // 13
STRMS13l equ $5C31 ; 23601 ;
STRMS14  equ $5C32 ; 23602 ; // 14
STRMS14l equ $5C33 ; 23603 ;
STRMS15  equ $5C34 ; 23604 ; // 15
STRMS15l equ $5C35 ; 23605 ;
cborn
Well known member
Posts: 267
Joined: Tue Oct 06, 2020 7:45 pm

Re: z88dk-dis making labels by it self

Post by cborn »

a little automation
i think you can use only 1 map at the time
but combining make huge files with loads off double entry

disasVU.sh

Code: Select all

rm this.map
cat sysvar48khex.equ VU-Calc.map  > this.map
z88dk-dis -a -x  this.map      -o 25232 -mz80 VU-Calc.bin > VU-Calc_005.asm
Post Reply