Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"Be *excellent* to each other." -- Bill, or Ted, in Bill and Ted's Excellent Adventure


devel / comp.os.cpm / SLR Z80ASM Question/Discussion

SubjectAuthor
* SLR Z80ASM Question/Discussionfred_...@hotmail.com
+* Re: SLR Z80ASM Question/DiscussionTony Nicholson
|`* Re: SLR Z80ASM Question/Discussionfred_...@hotmail.com
| `* Re: SLR Z80ASM Question/DiscussionАндрей Никитин
|  +* Re: SLR Z80ASM Question/Discussionfred_...@hotmail.com
|  |`* Re: SLR Z80ASM Question/DiscussionАндрей Никитин
|  | `* Re: SLR Z80ASM Question/Discussionfred_...@hotmail.com
|  |  `- Re: SLR Z80ASM Question/DiscussionАндрей Никитин
|  `* Re: SLR Z80ASM Question/Discussionfred_...@hotmail.com
|   `- Re: SLR Z80ASM Question/DiscussionАндрей Никитин
`- Re: SLR Z80ASM Question/Discussiondxforth

1
SLR Z80ASM Question/Discussion

<989df0c4-0a21-4deb-b3d5-b121944b7786n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2597&group=comp.os.cpm#2597

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:ad4:424b:: with SMTP id l11mr19721692qvq.58.1623091751218; Mon, 07 Jun 2021 11:49:11 -0700 (PDT)
X-Received: by 2002:a4a:d754:: with SMTP id h20mr14327374oot.40.1623091750913; Mon, 07 Jun 2021 11:49:10 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!tr1.eu1.usenetexpress.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.cpm
Date: Mon, 7 Jun 2021 11:49:10 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=2607:f2c0:956b:6a00:ec5e:c05b:3cc1:fa0a; posting-account=KOfC_woAAAC0YBGf-3r2aV5g2Aifd9jO
NNTP-Posting-Host: 2607:f2c0:956b:6a00:ec5e:c05b:3cc1:fa0a
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <989df0c4-0a21-4deb-b3d5-b121944b7786n@googlegroups.com>
Subject: SLR Z80ASM Question/Discussion
From: fred_wei...@hotmail.com (fred_...@hotmail.com)
Injection-Date: Mon, 07 Jun 2021 18:49:11 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 183
 by: fred_...@hotmail.com - Mon, 7 Jun 2021 18:49 UTC

I am using Hi-Tech C 3.09.

I compile hello.c:

/* hello.c
*
*/ new comment feature of cpp

#include <stdio.h>
int main(int ac, char **av) {
printf("Hello, world!\n");
return 0;
}

compile using c -v -c hello.c, giving hello.obj

Using my objtomac utility (https://github.com/ratboy666/mtrel)

obj2mac hello.obj >hello.mac

and then

m80 =hello/l
ld80 zcrtcpm,hello,hello/n/e

giving hello.com

But...

copy hello.mac to hello.z80 and edit SET to DEFL -- gives us something like:

; GENERATED BY OBJTOMAC 0.50
CSEG
text:
DSEG
data:
CSEG
OFFSET DEFL 00000H
ORG OFFSET
DB 0CDH,000H,000H,000H,000H,021H,000H,000H ; 0000
DB 0E5H,0CDH,000H,000H,021H,002H,000H,039H ; 0008
DB 0F9H,021H,000H,000H,0C3H,017H,000H,0C3H ; 0010
DB 000H,000H ; 0018
ORG OFFSET+00001H
DW ncsv
ORG OFFSET+00006H
DW data
ORG OFFSET+0000AH
DW _printf
ORG OFFSET+00015H
DW text+00017H
ORG OFFSET+00018H
DW cret
DSEG
OFFSET DEFL 00000H
ORG OFFSET
DB 048H,065H,06CH,06CH,06FH,02CH,020H,077H ; 0000
ORG OFFSET+00006H
DW data
ORG OFFSET+0000AH
DW _printf
ORG OFFSET+00015H
DW text+00017H
ORG OFFSET+00018H
DW cret
DSEG
OFFSET DEFL 00000H
ORG OFFSET
DB 048H,065H,06CH,06CH,06FH,02CH,020H,077H ; 0000
DB 06FH,072H,06CH,064H,021H,00AH,000H ; 0008
CSEG
ORG 00000H
_main:
PUBLIC _main
EXTRN _printf
EXTRN cret
EXTRN indir
EXTRN ncsv
END

Note the use of ORG to place relocations. This assembles with

Z80ASM Copyright (C) 1983-86 by SLR Systems Rel. 1.32 #AB1234
%hello/m
hello/m
End of file Pass 1
0 Error(s) Detected.
26 Absolute Bytes. 8 Symbols Detected.

hello/m to produce a REL file. I then link it and get:

B>r ld80

Link-80 Disk Vers. 3.55 10-Sep-82 Copyright (c) 1981 Microsoft

*zcrtcpm
Data 0103 0147 < 68>

LIBC RQUEST
-STARTU 0000 -_EXIT 0000 -_MAIN 0000
-__ARGC 0000
4 Undefined Global(s)
37860 Bytes Free

*hello
%Overlaying Program area
%Overlaying Program area
%Overlaying Program area
%Overlaying Program area
%Overlaying Program area
%Overlaying Program area
? Max memory addr exceeded.
*

Cool, huh? Z80ASM is a bit... um... broken. I am using Hi-Tech C 3.09 to build the AM9511 emulation, (and test DSD-80 function). I decided that a lot of people seem to REALLY like SLR and do not like Microsoft M80, and I should give Z80ASM a chance... And... bug #1. It does not appear to handle the
relocation overlap technique I use to translate Hi-Tech OBJ to MAC format.

As a PS. M80 *does* use DEFL or SET interchangeably. Using PSA PLINK-II
we get a different result:
B>r plink-ii

PSA Linkage Editor II (CP/M) [P20100-0114 ]
Copyright (C) 1981 by Phoenix Software Associates Ltd.

*out hello.com
*fi zcrtcpm,hello
*;
The following symbols were referenced, but not defined anywhere:
_CLOSE _PRINTF __CLEA
Pass 1 Error 60
*

Here is M80 and PLINK-II:

B>r m80 =hello/l
?File not found
*=hello.z80/l

No Fatal error(s)

*

*^C
B>r plink-ii

PSA Linkage Editor II (CP/M) [P20100-0114 ]
Copyright (C) 1981 by Phoenix Software Associates Ltd.

*out hello.com
*fi zcrtcpm,hello
*;
HELLO.COM (136AH, 5K)
*^C
B>hello
Hello, world!

I *WAS* thinking about SLR support -- but it is just too strange. The object
files produced do strange case-sensitive things with library, it does *NOT*
support SET (just DEFL). And it seems to generate REL files that the
standard Microsoft tools do not like.

The benefit would be 7 character external support. Possibly speed.

Anyone else can weigh in on SLR Z80ASM vs Microsoft M80? For building AM9511 native, I think I will use Hi-Tech ZAS, and LINK, *or* M80 and L80
(LD80) or PLINK. At least those choices work without issue.

As I recall "in the day" I used M80 exclusively, but I forgotten WHY. It becomes clear again.

Thanks
FredW

Re: SLR Z80ASM Question/Discussion

<8c0f8afb-944b-4e39-b55f-f03100bae60en@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2600&group=comp.os.cpm#2600

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:ac8:5815:: with SMTP id g21mr9826532qtg.266.1623118001823;
Mon, 07 Jun 2021 19:06:41 -0700 (PDT)
X-Received: by 2002:a4a:95c4:: with SMTP id p4mr15387686ooi.51.1623118001459;
Mon, 07 Jun 2021 19:06:41 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!feeder1.cambriumusenet.nl!feed.tweak.nl!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.cpm
Date: Mon, 7 Jun 2021 19:06:41 -0700 (PDT)
In-Reply-To: <989df0c4-0a21-4deb-b3d5-b121944b7786n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=159.196.124.142; posting-account=5wnjpAoAAABrhNpKTP0a5hOqJUBnLT3d
NNTP-Posting-Host: 159.196.124.142
References: <989df0c4-0a21-4deb-b3d5-b121944b7786n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8c0f8afb-944b-4e39-b55f-f03100bae60en@googlegroups.com>
Subject: Re: SLR Z80ASM Question/Discussion
From: agn...@gmail.com (Tony Nicholson)
Injection-Date: Tue, 08 Jun 2021 02:06:41 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Tony Nicholson - Tue, 8 Jun 2021 02:06 UTC

On Tuesday, June 8, 2021 at 4:49:11 AM UTC+10, FredW wrote:
> I am using Hi-Tech C 3.09.
[snip]
> Anyone else can weigh in on SLR Z80ASM vs Microsoft M80? For building AM9511 native, I think I will use Hi-Tech ZAS, and LINK, *or* M80 and L80
> (LD80) or PLINK. At least those choices work without issue.
>
> As I recall "in the day" I used M80 exclusively, but I forgotten WHY. It becomes clear again.

I have used a mix of assemblers.. starting with the TDL/PASM (8080-style
with Z80 extensions) and PLINK then PLINK-II; and then for a long time the
Microsoft M80 macro assembler (because I like the Zilog mnemonics).
The SLR Z80ASM assember is fast but has some "quirks" as you have
found.

In the last few years with my tinkering in the Z280 world, I've migrated to
mostly using Hector Peraza's ZSM4 macro assembler. It has a /Sn switch
that can select symbol lengths between 6 and 8 characters, and produces
object files in the standard Digital Research LINK format (also compatible
with Microsoft L80 and PLINK linkers - but it doesn't use the M80 V3.44
or SLR linker REL format extensions). It can also assemble Z80/Z180
and Z280 opcodes (all Zilog mnemonics) and uses a range of
M80-compatible pseudo-ops (like DW/DEFW, DS/DEFS etc).

Hector provides the assembler source-code and binaries for CP/M (and
his RSX180/RSX280 operating systems) with full documentation at

https://github.com/hperaza/ZSM4

ZSM4 runs fine under the John Elliott's zxcc CP/M emulator on Linux/
macOS too (from https://www.seasip.info/Unix/Zxcc/ ).

HI-TECH's ZAS has some quirks too (strict source-code formatting) and
has an added advantage of being able to optimise absolute jumps (JP)
into relative ones (JR) - albeit with a strange label convention for forward
references. The object file format is different too (see Andrey Nikitin's
recent reconstruction of the HI-TECH's object file DUMP utility for an
explanation of the object-file format (https://github.com/nikitinprior/ddump ).

Tony

Re: SLR Z80ASM Question/Discussion

<s9mkbl$5f9$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2601&group=comp.os.cpm#2601

  copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!aioe.org!xrnZ5uanw3pSzK+Ytx4Jfg.user.gioia.aioe.org.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.os.cpm
Subject: Re: SLR Z80ASM Question/Discussion
Date: Tue, 8 Jun 2021 12:23:49 +1000
Organization: Aioe.org NNTP Server
Lines: 7
Message-ID: <s9mkbl$5f9$1@gioia.aioe.org>
References: <989df0c4-0a21-4deb-b3d5-b121944b7786n@googlegroups.com>
NNTP-Posting-Host: xrnZ5uanw3pSzK+Ytx4Jfg.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-GB
 by: dxforth - Tue, 8 Jun 2021 02:23 UTC

On 8/06/2021 04:49, fred_...@hotmail.com wrote:
>
> Anyone else can weigh in on SLR Z80ASM vs Microsoft M80?

M80 was the de-facto standard assembler for Z80 CP/M. SLR was
backward compatible with M80. If the aim is to write M80-compatible
code using SLR, you'll likely need to check it against M80.

Re: SLR Z80ASM Question/Discussion

<89df32d8-9867-4cdc-9aad-e7d3328a7ca6n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2602&group=comp.os.cpm#2602

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:a37:8407:: with SMTP id g7mr19806817qkd.123.1623121856663;
Mon, 07 Jun 2021 20:10:56 -0700 (PDT)
X-Received: by 2002:a05:6830:1b6e:: with SMTP id d14mr16708114ote.186.1623121856391;
Mon, 07 Jun 2021 20:10:56 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.cpm
Date: Mon, 7 Jun 2021 20:10:56 -0700 (PDT)
In-Reply-To: <8c0f8afb-944b-4e39-b55f-f03100bae60en@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2607:f2c0:956b:6a00:ec5e:c05b:3cc1:fa0a;
posting-account=KOfC_woAAAC0YBGf-3r2aV5g2Aifd9jO
NNTP-Posting-Host: 2607:f2c0:956b:6a00:ec5e:c05b:3cc1:fa0a
References: <989df0c4-0a21-4deb-b3d5-b121944b7786n@googlegroups.com> <8c0f8afb-944b-4e39-b55f-f03100bae60en@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <89df32d8-9867-4cdc-9aad-e7d3328a7ca6n@googlegroups.com>
Subject: Re: SLR Z80ASM Question/Discussion
From: fred_wei...@hotmail.com (fred_...@hotmail.com)
Injection-Date: Tue, 08 Jun 2021 03:10:56 +0000
Content-Type: text/plain; charset="UTF-8"
 by: fred_...@hotmail.com - Tue, 8 Jun 2021 03:10 UTC

On Monday, June 7, 2021 at 10:06:42 PM UTC-4, Tony Nicholson wrote:
> On Tuesday, June 8, 2021 at 4:49:11 AM UTC+10, FredW wrote:
> > I am using Hi-Tech C 3.09.
> [snip]
> > Anyone else can weigh in on SLR Z80ASM vs Microsoft M80? For building AM9511 native, I think I will use Hi-Tech ZAS, and LINK, *or* M80 and L80
> > (LD80) or PLINK. At least those choices work without issue.
> >
> > As I recall "in the day" I used M80 exclusively, but I forgotten WHY. It becomes clear again.
> I have used a mix of assemblers.. starting with the TDL/PASM (8080-style
> with Z80 extensions) and PLINK then PLINK-II; and then for a long time the
> Microsoft M80 macro assembler (because I like the Zilog mnemonics).
> The SLR Z80ASM assember is fast but has some "quirks" as you have
> found.
>
> In the last few years with my tinkering in the Z280 world, I've migrated to
> mostly using Hector Peraza's ZSM4 macro assembler. It has a /Sn switch
> that can select symbol lengths between 6 and 8 characters, and produces
> object files in the standard Digital Research LINK format (also compatible
> with Microsoft L80 and PLINK linkers - but it doesn't use the M80 V3.44
> or SLR linker REL format extensions). It can also assemble Z80/Z180
> and Z280 opcodes (all Zilog mnemonics) and uses a range of
> M80-compatible pseudo-ops (like DW/DEFW, DS/DEFS etc).
>
> Hector provides the assembler source-code and binaries for CP/M (and
> his RSX180/RSX280 operating systems) with full documentation at
>
> https://github.com/hperaza/ZSM4
>
> ZSM4 runs fine under the John Elliott's zxcc CP/M emulator on Linux/
> macOS too (from https://www.seasip.info/Unix/Zxcc/ ).
>
> HI-TECH's ZAS has some quirks too (strict source-code formatting) and
> has an added advantage of being able to optimise absolute jumps (JP)
> into relative ones (JR) - albeit with a strange label convention for forward
> references. The object file format is different too (see Andrey Nikitin's
> recent reconstruction of the HI-TECH's object file DUMP utility for an
> explanation of the object-file format (https://github.com/nikitinprior/ddump ).
>
> Tony
Tony

I reversed Hi-Tech OBJ format - see my OBJTOMAC utility that converts
OBJ from Hi-Tech to MAC that can be assembled by M80. If you get MTREL,
you also get the Hi-Tech LIBC and LIBM in REL format.

FredW

Re: SLR Z80ASM Question/Discussion

<ca471bc3-4970-466f-b285-16174fc60cean@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2603&group=comp.os.cpm#2603

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:a05:620a:240c:: with SMTP id d12mr21250711qkn.190.1623155003417; Tue, 08 Jun 2021 05:23:23 -0700 (PDT)
X-Received: by 2002:aca:4c41:: with SMTP id z62mr2525154oia.29.1623155003189; Tue, 08 Jun 2021 05:23:23 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!feeder1.feed.usenet.farm!feed.usenet.farm!tr3.eu1.usenetexpress.com!feeder.usenetexpress.com!tr3.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.cpm
Date: Tue, 8 Jun 2021 05:23:22 -0700 (PDT)
In-Reply-To: <89df32d8-9867-4cdc-9aad-e7d3328a7ca6n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.37.209.254; posting-account=g8ksUwoAAAC0mgCsQ1LJvKj1k2HoKsbw
NNTP-Posting-Host: 77.37.209.254
References: <989df0c4-0a21-4deb-b3d5-b121944b7786n@googlegroups.com> <8c0f8afb-944b-4e39-b55f-f03100bae60en@googlegroups.com> <89df32d8-9867-4cdc-9aad-e7d3328a7ca6n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ca471bc3-4970-466f-b285-16174fc60cean@googlegroups.com>
Subject: Re: SLR Z80ASM Question/Discussion
From: nikitinp...@gmail.com (Андрей Никитин)
Injection-Date: Tue, 08 Jun 2021 12:23:23 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 90
 by: Андрей Ник - Tue, 8 Jun 2021 12:23 UTC

вторник, 8 июня 2021 г. в 06:10:57 UTC+3, fred_...@hotmail.com:
> On Monday, June 7, 2021 at 10:06:42 PM UTC-4, Tony Nicholson wrote:
> > On Tuesday, June 8, 2021 at 4:49:11 AM UTC+10, FredW wrote:
> > > I am using Hi-Tech C 3.09.
> > [snip]
> > > Anyone else can weigh in on SLR Z80ASM vs Microsoft M80? For building AM9511 native, I think I will use Hi-Tech ZAS, and LINK, *or* M80 and L80
> > > (LD80) or PLINK. At least those choices work without issue.
> > >
> > > As I recall "in the day" I used M80 exclusively, but I forgotten WHY. It becomes clear again.
> > I have used a mix of assemblers.. starting with the TDL/PASM (8080-style
> > with Z80 extensions) and PLINK then PLINK-II; and then for a long time the
> > Microsoft M80 macro assembler (because I like the Zilog mnemonics).
> > The SLR Z80ASM assember is fast but has some "quirks" as you have
> > found.
> >
> > In the last few years with my tinkering in the Z280 world, I've migrated to
> > mostly using Hector Peraza's ZSM4 macro assembler. It has a /Sn switch
> > that can select symbol lengths between 6 and 8 characters, and produces
> > object files in the standard Digital Research LINK format (also compatible
> > with Microsoft L80 and PLINK linkers - but it doesn't use the M80 V3.44
> > or SLR linker REL format extensions). It can also assemble Z80/Z180
> > and Z280 opcodes (all Zilog mnemonics) and uses a range of
> > M80-compatible pseudo-ops (like DW/DEFW, DS/DEFS etc).
> >
> > Hector provides the assembler source-code and binaries for CP/M (and
> > his RSX180/RSX280 operating systems) with full documentation at
> >
> > https://github.com/hperaza/ZSM4
> >
> > ZSM4 runs fine under the John Elliott's zxcc CP/M emulator on Linux/
> > macOS too (from https://www.seasip.info/Unix/Zxcc/ ).
> >
> > HI-TECH's ZAS has some quirks too (strict source-code formatting) and
> > has an added advantage of being able to optimise absolute jumps (JP)
> > into relative ones (JR) - albeit with a strange label convention for forward
> > references. The object file format is different too (see Andrey Nikitin's
> > recent reconstruction of the HI-TECH's object file DUMP utility for an
> > explanation of the object-file format (https://github.com/nikitinprior/ddump ).
> >
> > Tony
> Tony
>
> I reversed Hi-Tech OBJ format - see my OBJTOMAC utility that converts
> OBJ from Hi-Tech to MAC that can be assembled by M80. If you get MTREL,
> you also get the Hi-Tech LIBC and LIBM in REL format.
>
> FredW

The Microsoft M80 and Z80ASM SLR Systems macro assemblers and some others were developed to compile source files in assembly language. The Microsoft fortran, basic, and cobol compilers compiled high-level language source files directly into a rel object file. The Microsoft fortran compiler allowed you to get a listing of a compiled file with processor opcodes, but the use of files with assembly code obtained by compiling code from a high-level language was not originally intended. Moreover, the length of variable names (identifiers) in these languages did not exceed 6 characters, which affected their length in rel object files.
The C standard allowed longer variable and function names. For this reason, the rel format did not meet this requirement.
When creating the Hi-Tech C compiler, they developed their own object file format, taking into account the increased length of names and support for processors other than Z80. Microsoft M80 and SLR Systems Z80ASM did not even think about this.
The software package of the then commercial Hi-Tech C compiler is consistent with each other and does not require third-party software and, accordingly, additional costs. When translating libraries to the rel format, you were forced to change (reduce) the names of part of the standard functions. The use of third-party assemblers restricts the C language and turns a good compiler into something non-standard. It seems to me that it is more productive to use the capabilities of Hi-Tech assembler in your development. And if they are not enough, write your own preprocessor to translate the M80 or Z80ASM syntax into a form that the Hi-Tech ZAS assembler understands.

Andrey Nikitin

Re: SLR Z80ASM Question/Discussion

<8e5ee087-44f6-490c-8343-25cebcf6d912n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2604&group=comp.os.cpm#2604

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:a37:a404:: with SMTP id n4mr6735973qke.296.1623160171821; Tue, 08 Jun 2021 06:49:31 -0700 (PDT)
X-Received: by 2002:a4a:9405:: with SMTP id h5mr11156488ooi.3.1623160171545; Tue, 08 Jun 2021 06:49:31 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!tr3.eu1.usenetexpress.com!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.cpm
Date: Tue, 8 Jun 2021 06:49:31 -0700 (PDT)
In-Reply-To: <ca471bc3-4970-466f-b285-16174fc60cean@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2607:f2c0:956b:6a00:ec5e:c05b:3cc1:fa0a; posting-account=KOfC_woAAAC0YBGf-3r2aV5g2Aifd9jO
NNTP-Posting-Host: 2607:f2c0:956b:6a00:ec5e:c05b:3cc1:fa0a
References: <989df0c4-0a21-4deb-b3d5-b121944b7786n@googlegroups.com> <8c0f8afb-944b-4e39-b55f-f03100bae60en@googlegroups.com> <89df32d8-9867-4cdc-9aad-e7d3328a7ca6n@googlegroups.com> <ca471bc3-4970-466f-b285-16174fc60cean@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8e5ee087-44f6-490c-8343-25cebcf6d912n@googlegroups.com>
Subject: Re: SLR Z80ASM Question/Discussion
From: fred_wei...@hotmail.com (fred_...@hotmail.com)
Injection-Date: Tue, 08 Jun 2021 13:49:31 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 145
 by: fred_...@hotmail.com - Tue, 8 Jun 2021 13:49 UTC

On Tuesday, June 8, 2021 at 8:23:23 AM UTC-4, nikiti...@gmail.com wrote:
> вторник, 8 июня 2021 г. в 06:10:57 UTC+3, fred_...@hotmail.com:
> > On Monday, June 7, 2021 at 10:06:42 PM UTC-4, Tony Nicholson wrote:
> > > On Tuesday, June 8, 2021 at 4:49:11 AM UTC+10, FredW wrote:
> > > > I am using Hi-Tech C 3.09.
> > > [snip]
> > > > Anyone else can weigh in on SLR Z80ASM vs Microsoft M80? For building AM9511 native, I think I will use Hi-Tech ZAS, and LINK, *or* M80 and L80
> > > > (LD80) or PLINK. At least those choices work without issue.
> > > >
> > > > As I recall "in the day" I used M80 exclusively, but I forgotten WHY. It becomes clear again.
> > > I have used a mix of assemblers.. starting with the TDL/PASM (8080-style
> > > with Z80 extensions) and PLINK then PLINK-II; and then for a long time the
> > > Microsoft M80 macro assembler (because I like the Zilog mnemonics).
> > > The SLR Z80ASM assember is fast but has some "quirks" as you have
> > > found.
> > >
> > > In the last few years with my tinkering in the Z280 world, I've migrated to
> > > mostly using Hector Peraza's ZSM4 macro assembler. It has a /Sn switch
> > > that can select symbol lengths between 6 and 8 characters, and produces
> > > object files in the standard Digital Research LINK format (also compatible
> > > with Microsoft L80 and PLINK linkers - but it doesn't use the M80 V3.44
> > > or SLR linker REL format extensions). It can also assemble Z80/Z180
> > > and Z280 opcodes (all Zilog mnemonics) and uses a range of
> > > M80-compatible pseudo-ops (like DW/DEFW, DS/DEFS etc).
> > >
> > > Hector provides the assembler source-code and binaries for CP/M (and
> > > his RSX180/RSX280 operating systems) with full documentation at
> > >
> > > https://github.com/hperaza/ZSM4
> > >
> > > ZSM4 runs fine under the John Elliott's zxcc CP/M emulator on Linux/
> > > macOS too (from https://www.seasip.info/Unix/Zxcc/ ).
> > >
> > > HI-TECH's ZAS has some quirks too (strict source-code formatting) and
> > > has an added advantage of being able to optimise absolute jumps (JP)
> > > into relative ones (JR) - albeit with a strange label convention for forward
> > > references. The object file format is different too (see Andrey Nikitin's
> > > recent reconstruction of the HI-TECH's object file DUMP utility for an
> > > explanation of the object-file format (https://github.com/nikitinprior/ddump ).
> > >
> > > Tony
> > Tony
> >
> > I reversed Hi-Tech OBJ format - see my OBJTOMAC utility that converts
> > OBJ from Hi-Tech to MAC that can be assembled by M80. If you get MTREL,
> > you also get the Hi-Tech LIBC and LIBM in REL format.
> >
> > FredW
> The Microsoft M80 and Z80ASM SLR Systems macro assemblers and some others were developed to compile source files in assembly language. The Microsoft fortran, basic, and cobol compilers compiled high-level language source files directly into a rel object file. The Microsoft fortran compiler allowed you to get a listing of a compiled file with processor opcodes, but the use of files with assembly code obtained by compiling code from a high-level language was not originally intended. Moreover, the length of variable names (identifiers) in these languages did not exceed 6 characters, which affected their length in rel object files.
> The C standard allowed longer variable and function names. For this reason, the rel format did not meet this requirement.
> When creating the Hi-Tech C compiler, they developed their own object file format, taking into account the increased length of names and support for processors other than Z80. Microsoft M80 and SLR Systems Z80ASM did not even think about this.
> The software package of the then commercial Hi-Tech C compiler is consistent with each other and does not require third-party software and, accordingly, additional costs. When translating libraries to the rel format, you were forced to change (reduce) the names of part of the standard functions. The use of third-party assemblers restricts the C language and turns a good compiler into something non-standard. It seems to me that it is more productive to use the capabilities of Hi-Tech assembler in your development. And if they are not enough, write your own preprocessor to translate the M80 or Z80ASM syntax into a form that the Hi-Tech ZAS assembler understands.
>
> Andrey Nikitin

Andrey

Back "in the day" I used Whitesmiths 8080 C - and cross compiler (Whitesmiths on a VAX target was Z80). Whitesmiths used something called
"A-natural" for the assembler.. completely non-standard. So, M80 it was.

Some people distributed object code in REL format -- Micropro had SuperSort, for example, and Micro B+ from Faircom are examples. In my opinion,
it is important to have a common object format. And, from 1977 to 1982, that was REL. Both Microsoft and Digital Research used it... And that gave us
PLINK-II, SuperSort and Micro B+ Of course, there were others... but, as nice as they are --- I am writing a core AM9511 emulator. It will
(eventually) go into 8080/Z80 emulators (that is the end-goal). But... it needs to be checked against the actual hardware. So, I want to link the
emulator, written in C, into (for example) FORTRAN-80. Or MBASIC, BASCOM, or have "plain" C wrappers.

I *could* use Whitesmiths C 2.0 (I used Whitesmiths native 8080 and cross on VAX in the day - 1981 through 1983 or so), because I know that PLINK-II can link that, along with Microsoft REL. But, I wanted to use a slightly more modern variant of C -- Hi-Tech fits the bill. And, with OBJTOMAC I can coerce REL files out of it (and, yes, I have converted the ENTIRE LIBC and LIBM libraries into REL format already). So, I can have my cake, and eat it too. And, as a freebie, if I link with PLINK-II, I get overlays.

If you recall I translated Hi-Tech ZAS to M80 -- AS2MAC is the program. That was used to convert the run-time library. But, there are...
issues. It is possible to compile C to assembler with Hi-Tech C, and have ZAS *NOT ABLE TO ASSEMBLE THE AS FILE*. And, AS2MAC will
then not be able to convert it, either. Sometimes, specifying optimization helps. As does reducing the source size.This did not show up
while I was converting the run-time library. OBJTOMAC exists to remedy those and does so very well. It just works. (and, when I get around to
it -- post AM9511 code and a couple of other projects, I am going to generate OBJTOREL -- and, once I understand REL -- having never generated a REL file, RELTOOBJ would seem reasonable -- but all that is FAR FUTURE retro work).

AS2MAC.COM, OBJTOMAC.COM, LIBC.REL and LIBM.REL are all available (with all source) in https://github.com/ratboy666/mtrel

The thing was -- I took a MAC file produced by my OBJTOMAC tool and assembled it with SLR Systems Z80ASM. The *assembly* went just fine, but the
relocatable result was NOT LINKABLE. That indicates some issues with SLR Z80ASM. If I ran into these sorts of issues back in the day,
I would simply have rejected the tool and gone back to M80.

FredW

Re: SLR Z80ASM Question/Discussion

<e72cc005-5263-4120-aa3e-64fae74066f2n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2605&group=comp.os.cpm#2605

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:aed:210f:: with SMTP id 15mr22051788qtc.149.1623166015394; Tue, 08 Jun 2021 08:26:55 -0700 (PDT)
X-Received: by 2002:aca:5889:: with SMTP id m131mr3139052oib.140.1623166015104; Tue, 08 Jun 2021 08:26:55 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.net!newsfeed.xs4all.nl!newsfeed9.news.xs4all.nl!tr2.eu1.usenetexpress.com!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.cpm
Date: Tue, 8 Jun 2021 08:26:54 -0700 (PDT)
In-Reply-To: <8e5ee087-44f6-490c-8343-25cebcf6d912n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.37.209.254; posting-account=g8ksUwoAAAC0mgCsQ1LJvKj1k2HoKsbw
NNTP-Posting-Host: 77.37.209.254
References: <989df0c4-0a21-4deb-b3d5-b121944b7786n@googlegroups.com> <8c0f8afb-944b-4e39-b55f-f03100bae60en@googlegroups.com> <89df32d8-9867-4cdc-9aad-e7d3328a7ca6n@googlegroups.com> <ca471bc3-4970-466f-b285-16174fc60cean@googlegroups.com> <8e5ee087-44f6-490c-8343-25cebcf6d912n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e72cc005-5263-4120-aa3e-64fae74066f2n@googlegroups.com>
Subject: Re: SLR Z80ASM Question/Discussion
From: nikitinp...@gmail.com (Андрей Никитин)
Injection-Date: Tue, 08 Jun 2021 15:26:55 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 179
 by: Андрей Ник - Tue, 8 Jun 2021 15:26 UTC

вторник, 8 июня 2021 г. в 16:49:32 UTC+3, fred_...@hotmail.com:
> On Tuesday, June 8, 2021 at 8:23:23 AM UTC-4, nikiti...@gmail.com wrote:
> > вторник, 8 июня 2021 г. в 06:10:57 UTC+3, fred_...@hotmail.com:
> > > On Monday, June 7, 2021 at 10:06:42 PM UTC-4, Tony Nicholson wrote:
> > > > On Tuesday, June 8, 2021 at 4:49:11 AM UTC+10, FredW wrote:
> > > > > I am using Hi-Tech C 3.09.
> > > > [snip]
> > > > > Anyone else can weigh in on SLR Z80ASM vs Microsoft M80? For building AM9511 native, I think I will use Hi-Tech ZAS, and LINK, *or* M80 and L80
> > > > > (LD80) or PLINK. At least those choices work without issue.
> > > > >
> > > > > As I recall "in the day" I used M80 exclusively, but I forgotten WHY. It becomes clear again.
> > > > I have used a mix of assemblers.. starting with the TDL/PASM (8080-style
> > > > with Z80 extensions) and PLINK then PLINK-II; and then for a long time the
> > > > Microsoft M80 macro assembler (because I like the Zilog mnemonics).
> > > > The SLR Z80ASM assember is fast but has some "quirks" as you have
> > > > found.
> > > >
> > > > In the last few years with my tinkering in the Z280 world, I've migrated to
> > > > mostly using Hector Peraza's ZSM4 macro assembler. It has a /Sn switch
> > > > that can select symbol lengths between 6 and 8 characters, and produces
> > > > object files in the standard Digital Research LINK format (also compatible
> > > > with Microsoft L80 and PLINK linkers - but it doesn't use the M80 V3.44
> > > > or SLR linker REL format extensions). It can also assemble Z80/Z180
> > > > and Z280 opcodes (all Zilog mnemonics) and uses a range of
> > > > M80-compatible pseudo-ops (like DW/DEFW, DS/DEFS etc).
> > > >
> > > > Hector provides the assembler source-code and binaries for CP/M (and
> > > > his RSX180/RSX280 operating systems) with full documentation at
> > > >
> > > > https://github.com/hperaza/ZSM4
> > > >
> > > > ZSM4 runs fine under the John Elliott's zxcc CP/M emulator on Linux/
> > > > macOS too (from https://www.seasip.info/Unix/Zxcc/ ).
> > > >
> > > > HI-TECH's ZAS has some quirks too (strict source-code formatting) and
> > > > has an added advantage of being able to optimise absolute jumps (JP)
> > > > into relative ones (JR) - albeit with a strange label convention for forward
> > > > references. The object file format is different too (see Andrey Nikitin's
> > > > recent reconstruction of the HI-TECH's object file DUMP utility for an
> > > > explanation of the object-file format (https://github.com/nikitinprior/ddump ).
> > > >
> > > > Tony
> > > Tony
> > >
> > > I reversed Hi-Tech OBJ format - see my OBJTOMAC utility that converts
> > > OBJ from Hi-Tech to MAC that can be assembled by M80. If you get MTREL,
> > > you also get the Hi-Tech LIBC and LIBM in REL format.
> > >
> > > FredW
> > The Microsoft M80 and Z80ASM SLR Systems macro assemblers and some others were developed to compile source files in assembly language. The Microsoft fortran, basic, and cobol compilers compiled high-level language source files directly into a rel object file. The Microsoft fortran compiler allowed you to get a listing of a compiled file with processor opcodes, but the use of files with assembly code obtained by compiling code from a high-level language was not originally intended. Moreover, the length of variable names (identifiers) in these languages did not exceed 6 characters, which affected their length in rel object files.
> > The C standard allowed longer variable and function names. For this reason, the rel format did not meet this requirement.
> > When creating the Hi-Tech C compiler, they developed their own object file format, taking into account the increased length of names and support for processors other than Z80. Microsoft M80 and SLR Systems Z80ASM did not even think about this.
> > The software package of the then commercial Hi-Tech C compiler is consistent with each other and does not require third-party software and, accordingly, additional costs. When translating libraries to the rel format, you were forced to change (reduce) the names of part of the standard functions. The use of third-party assemblers restricts the C language and turns a good compiler into something non-standard. It seems to me that it is more productive to use the capabilities of Hi-Tech assembler in your development. And if they are not enough, write your own preprocessor to translate the M80 or Z80ASM syntax into a form that the Hi-Tech ZAS assembler understands.
> >
> > Andrey Nikitin
> Andrey
>
> Back "in the day" I used Whitesmiths 8080 C - and cross compiler (Whitesmiths on a VAX target was Z80). Whitesmiths used something called
> "A-natural" for the assembler.. completely non-standard. So, M80 it was.
>
> Some people distributed object code in REL format -- Micropro had SuperSort, for example, and Micro B+ from Faircom are examples. In my opinion,
> it is important to have a common object format. And, from 1977 to 1982, that was REL. Both Microsoft and Digital Research used it... And that gave us
> PLINK-II, SuperSort and Micro B+ Of course, there were others... but, as nice as they are --- I am writing a core AM9511 emulator. It will
> (eventually) go into 8080/Z80 emulators (that is the end-goal). But... it needs to be checked against the actual hardware. So, I want to link the
> emulator, written in C, into (for example) FORTRAN-80. Or MBASIC, BASCOM, or have "plain" C wrappers.
>
> I *could* use Whitesmiths C 2.0 (I used Whitesmiths native 8080 and cross on VAX in the day - 1981 through 1983 or so), because I know that PLINK-II can link that, along with Microsoft REL. But, I wanted to use a slightly more modern variant of C -- Hi-Tech fits the bill. And, with OBJTOMAC I can coerce REL files out of it (and, yes, I have converted the ENTIRE LIBC and LIBM libraries into REL format already). So, I can have my cake, and eat it too. And, as a freebie, if I link with PLINK-II, I get overlays.
>
> If you recall I translated Hi-Tech ZAS to M80 -- AS2MAC is the program. That was used to convert the run-time library. But, there are...
> issues. It is possible to compile C to assembler with Hi-Tech C, and have ZAS *NOT ABLE TO ASSEMBLE THE AS FILE*. And, AS2MAC will
> then not be able to convert it, either. Sometimes, specifying optimization helps. As does reducing the source size.This did not show up
> while I was converting the run-time library. OBJTOMAC exists to remedy those and does so very well. It just works. (and, when I get around to
> it -- post AM9511 code and a couple of other projects, I am going to generate OBJTOREL -- and, once I understand REL -- having never generated a REL file, RELTOOBJ would seem reasonable -- but all that is FAR FUTURE retro work).
>
> AS2MAC.COM, OBJTOMAC.COM, LIBC.REL and LIBM.REL are all available (with all source) in https://github.com/ratboy666/mtrel
>
> The thing was -- I took a MAC file produced by my OBJTOMAC tool and assembled it with SLR Systems Z80ASM. The *assembly* went just fine, but the
> relocatable result was NOT LINKABLE. That indicates some issues with SLR Z80ASM. If I ran into these sorts of issues back in the day,
> I would simply have rejected the tool and gone back to M80.
>
> FredW

In those ancient times, the format of floating-point numbers was not yet standardized. Microsoft has used its version in all of its products. The AM9511 was one of the first coprocessors to speed up the computation of real numbers. He had his own idea of how they should be arranged. Other developers have used their own formats and libraries for this purpose. However, the speed of development of computer technology and the increase in the bit depth of the processor data bus led to the standardization of the representation of floating numbers, and as a result, Intel became the winner in this competition, which immediately released the 8087.

Perhaps the AM9511 emulation is needed to run programs written with this coprocessor in mind. Although there are very few such programs, but they are there. CP/M emulators emulate Z80 codes and operating system calls. Your emulation will allow you to extend the capabilities of the latter by executing binary code using this coprocessor. Emulation of AM9511 commands in a CP/M system that does not have this coprocessor is most likely not advisable due to the overhead of emulation, which will reduce the already small memory for the program. In this regard, it is also impractical to use any C compiler for CP/M to emulate AM9511 inside this system.

For a while, IBM PC compatible computers were available with or without a coprocessor. Compilers of that time could generate code both for the coprocessor and without it. However, they had significantly more memory, and when composing an executable program, they could use different libraries with code for the coprocessor or emulating it.


Click here to read the complete article
Re: SLR Z80ASM Question/Discussion

<77931d74-0f8b-425b-a8f5-eab782c62193n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2606&group=comp.os.cpm#2606

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:ad4:5fc7:: with SMTP id jq7mr1153027qvb.41.1623172845732;
Tue, 08 Jun 2021 10:20:45 -0700 (PDT)
X-Received: by 2002:a9d:6d01:: with SMTP id o1mr2797738otp.285.1623172845419;
Tue, 08 Jun 2021 10:20:45 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.cpm
Date: Tue, 8 Jun 2021 10:20:45 -0700 (PDT)
In-Reply-To: <e72cc005-5263-4120-aa3e-64fae74066f2n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2607:f2c0:956b:6a00:ec5e:c05b:3cc1:fa0a;
posting-account=KOfC_woAAAC0YBGf-3r2aV5g2Aifd9jO
NNTP-Posting-Host: 2607:f2c0:956b:6a00:ec5e:c05b:3cc1:fa0a
References: <989df0c4-0a21-4deb-b3d5-b121944b7786n@googlegroups.com>
<8c0f8afb-944b-4e39-b55f-f03100bae60en@googlegroups.com> <89df32d8-9867-4cdc-9aad-e7d3328a7ca6n@googlegroups.com>
<ca471bc3-4970-466f-b285-16174fc60cean@googlegroups.com> <8e5ee087-44f6-490c-8343-25cebcf6d912n@googlegroups.com>
<e72cc005-5263-4120-aa3e-64fae74066f2n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <77931d74-0f8b-425b-a8f5-eab782c62193n@googlegroups.com>
Subject: Re: SLR Z80ASM Question/Discussion
From: fred_wei...@hotmail.com (fred_...@hotmail.com)
Injection-Date: Tue, 08 Jun 2021 17:20:45 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: fred_...@hotmail.com - Tue, 8 Jun 2021 17:20 UTC

On Tuesday, June 8, 2021 at 11:26:56 AM UTC-4, nikiti...@gmail.com wrote:
> вторник, 8 июня 2021 г. в 16:49:32 UTC+3, fred_...@hotmail.com:
> > On Tuesday, June 8, 2021 at 8:23:23 AM UTC-4, nikiti...@gmail.com wrote:
> > > вторник, 8 июня 2021 г. в 06:10:57 UTC+3, fred_...@hotmail.com:
> > > > On Monday, June 7, 2021 at 10:06:42 PM UTC-4, Tony Nicholson wrote:
> > > > > On Tuesday, June 8, 2021 at 4:49:11 AM UTC+10, FredW wrote:
> > > > > > I am using Hi-Tech C 3.09.
> > > > > [snip]
> > > > > > Anyone else can weigh in on SLR Z80ASM vs Microsoft M80? For building AM9511 native, I think I will use Hi-Tech ZAS, and LINK, *or* M80 and L80
> > > > > > (LD80) or PLINK. At least those choices work without issue.
> > > > > >
> > > > > > As I recall "in the day" I used M80 exclusively, but I forgotten WHY. It becomes clear again.
> > > > > I have used a mix of assemblers.. starting with the TDL/PASM (8080-style
> > > > > with Z80 extensions) and PLINK then PLINK-II; and then for a long time the
> > > > > Microsoft M80 macro assembler (because I like the Zilog mnemonics).
> > > > > The SLR Z80ASM assember is fast but has some "quirks" as you have
> > > > > found.
> > > > >
> > > > > In the last few years with my tinkering in the Z280 world, I've migrated to
> > > > > mostly using Hector Peraza's ZSM4 macro assembler. It has a /Sn switch
> > > > > that can select symbol lengths between 6 and 8 characters, and produces
> > > > > object files in the standard Digital Research LINK format (also compatible
> > > > > with Microsoft L80 and PLINK linkers - but it doesn't use the M80 V3.44
> > > > > or SLR linker REL format extensions). It can also assemble Z80/Z180
> > > > > and Z280 opcodes (all Zilog mnemonics) and uses a range of
> > > > > M80-compatible pseudo-ops (like DW/DEFW, DS/DEFS etc).
> > > > >
> > > > > Hector provides the assembler source-code and binaries for CP/M (and
> > > > > his RSX180/RSX280 operating systems) with full documentation at
> > > > >
> > > > > https://github.com/hperaza/ZSM4
> > > > >
> > > > > ZSM4 runs fine under the John Elliott's zxcc CP/M emulator on Linux/
> > > > > macOS too (from https://www.seasip.info/Unix/Zxcc/ ).
> > > > >
> > > > > HI-TECH's ZAS has some quirks too (strict source-code formatting) and
> > > > > has an added advantage of being able to optimise absolute jumps (JP)
> > > > > into relative ones (JR) - albeit with a strange label convention for forward
> > > > > references. The object file format is different too (see Andrey Nikitin's
> > > > > recent reconstruction of the HI-TECH's object file DUMP utility for an
> > > > > explanation of the object-file format (https://github.com/nikitinprior/ddump ).
> > > > >
> > > > > Tony
> > > > Tony
> > > >
> > > > I reversed Hi-Tech OBJ format - see my OBJTOMAC utility that converts
> > > > OBJ from Hi-Tech to MAC that can be assembled by M80. If you get MTREL,
> > > > you also get the Hi-Tech LIBC and LIBM in REL format.
> > > >
> > > > FredW
> > > The Microsoft M80 and Z80ASM SLR Systems macro assemblers and some others were developed to compile source files in assembly language. The Microsoft fortran, basic, and cobol compilers compiled high-level language source files directly into a rel object file. The Microsoft fortran compiler allowed you to get a listing of a compiled file with processor opcodes, but the use of files with assembly code obtained by compiling code from a high-level language was not originally intended. Moreover, the length of variable names (identifiers) in these languages did not exceed 6 characters, which affected their length in rel object files.
> > > The C standard allowed longer variable and function names. For this reason, the rel format did not meet this requirement.
> > > When creating the Hi-Tech C compiler, they developed their own object file format, taking into account the increased length of names and support for processors other than Z80. Microsoft M80 and SLR Systems Z80ASM did not even think about this.
> > > The software package of the then commercial Hi-Tech C compiler is consistent with each other and does not require third-party software and, accordingly, additional costs. When translating libraries to the rel format, you were forced to change (reduce) the names of part of the standard functions. The use of third-party assemblers restricts the C language and turns a good compiler into something non-standard. It seems to me that it is more productive to use the capabilities of Hi-Tech assembler in your development. And if they are not enough, write your own preprocessor to translate the M80 or Z80ASM syntax into a form that the Hi-Tech ZAS assembler understands.
> > >
> > > Andrey Nikitin
> > Andrey
> >
> > Back "in the day" I used Whitesmiths 8080 C - and cross compiler (Whitesmiths on a VAX target was Z80). Whitesmiths used something called
> > "A-natural" for the assembler.. completely non-standard. So, M80 it was..
> >
> > Some people distributed object code in REL format -- Micropro had SuperSort, for example, and Micro B+ from Faircom are examples. In my opinion,
> > it is important to have a common object format. And, from 1977 to 1982, that was REL. Both Microsoft and Digital Research used it... And that gave us
> > PLINK-II, SuperSort and Micro B+ Of course, there were others... but, as nice as they are --- I am writing a core AM9511 emulator. It will
> > (eventually) go into 8080/Z80 emulators (that is the end-goal). But... it needs to be checked against the actual hardware. So, I want to link the
> > emulator, written in C, into (for example) FORTRAN-80. Or MBASIC, BASCOM, or have "plain" C wrappers.
> >
> > I *could* use Whitesmiths C 2.0 (I used Whitesmiths native 8080 and cross on VAX in the day - 1981 through 1983 or so), because I know that PLINK-II can link that, along with Microsoft REL. But, I wanted to use a slightly more modern variant of C -- Hi-Tech fits the bill. And, with OBJTOMAC I can coerce REL files out of it (and, yes, I have converted the ENTIRE LIBC and LIBM libraries into REL format already). So, I can have my cake, and eat it too. And, as a freebie, if I link with PLINK-II, I get overlays.
> >
> > If you recall I translated Hi-Tech ZAS to M80 -- AS2MAC is the program. That was used to convert the run-time library. But, there are...
> > issues. It is possible to compile C to assembler with Hi-Tech C, and have ZAS *NOT ABLE TO ASSEMBLE THE AS FILE*. And, AS2MAC will
> > then not be able to convert it, either. Sometimes, specifying optimization helps. As does reducing the source size.This did not show up
> > while I was converting the run-time library. OBJTOMAC exists to remedy those and does so very well. It just works. (and, when I get around to
> > it -- post AM9511 code and a couple of other projects, I am going to generate OBJTOREL -- and, once I understand REL -- having never generated a REL file, RELTOOBJ would seem reasonable -- but all that is FAR FUTURE retro work).
> >
> > AS2MAC.COM, OBJTOMAC.COM, LIBC.REL and LIBM.REL are all available (with all source) in https://github.com/ratboy666/mtrel
> >
> > The thing was -- I took a MAC file produced by my OBJTOMAC tool and assembled it with SLR Systems Z80ASM. The *assembly* went just fine, but the
> > relocatable result was NOT LINKABLE. That indicates some issues with SLR Z80ASM. If I ran into these sorts of issues back in the day,
> > I would simply have rejected the tool and gone back to M80.
> >
> > FredW
> In those ancient times, the format of floating-point numbers was not yet standardized. Microsoft has used its version in all of its products. The AM9511 was one of the first coprocessors to speed up the computation of real numbers. He had his own idea of how they should be arranged. Other developers have used their own formats and libraries for this purpose. However, the speed of development of computer technology and the increase in the bit depth of the processor data bus led to the standardization of the representation of floating numbers, and as a result, Intel became the winner in this competition, which immediately released the 8087.
>
> Perhaps the AM9511 emulation is needed to run programs written with this coprocessor in mind. Although there are very few such programs, but they are there. CP/M emulators emulate Z80 codes and operating system calls. Your emulation will allow you to extend the capabilities of the latter by executing binary code using this coprocessor. Emulation of AM9511 commands in a CP/M system that does not have this coprocessor is most likely not advisable due to the overhead of emulation, which will reduce the already small memory for the program. In this regard, it is also impractical to use any C compiler for CP/M to emulate AM9511 inside this system.
>
> For a while, IBM PC compatible computers were available with or without a coprocessor. Compilers of that time could generate code both for the coprocessor and without it. However, they had significantly more memory, and when composing an executable program, they could use different libraries with code for the coprocessor or emulating it.
>
> Andrey Nikitin


Click here to read the complete article
Re: SLR Z80ASM Question/Discussion

<8cc7c107-ae06-49a0-9f51-78cc2a4df834n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2607&group=comp.os.cpm#2607

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:a0c:8346:: with SMTP id j64mr1024368qva.16.1623174512117;
Tue, 08 Jun 2021 10:48:32 -0700 (PDT)
X-Received: by 2002:a05:6808:65a:: with SMTP id z26mr932721oih.85.1623174511787;
Tue, 08 Jun 2021 10:48:31 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.cpm
Date: Tue, 8 Jun 2021 10:48:31 -0700 (PDT)
In-Reply-To: <77931d74-0f8b-425b-a8f5-eab782c62193n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.37.209.254; posting-account=g8ksUwoAAAC0mgCsQ1LJvKj1k2HoKsbw
NNTP-Posting-Host: 77.37.209.254
References: <989df0c4-0a21-4deb-b3d5-b121944b7786n@googlegroups.com>
<8c0f8afb-944b-4e39-b55f-f03100bae60en@googlegroups.com> <89df32d8-9867-4cdc-9aad-e7d3328a7ca6n@googlegroups.com>
<ca471bc3-4970-466f-b285-16174fc60cean@googlegroups.com> <8e5ee087-44f6-490c-8343-25cebcf6d912n@googlegroups.com>
<e72cc005-5263-4120-aa3e-64fae74066f2n@googlegroups.com> <77931d74-0f8b-425b-a8f5-eab782c62193n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8cc7c107-ae06-49a0-9f51-78cc2a4df834n@googlegroups.com>
Subject: Re: SLR Z80ASM Question/Discussion
From: nikitinp...@gmail.com (Андрей Никитин)
Injection-Date: Tue, 08 Jun 2021 17:48:32 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Андрей Ник - Tue, 8 Jun 2021 17:48 UTC

вторник, 8 июня 2021 г. в 20:20:46 UTC+3, fred_...@hotmail.com:
> On Tuesday, June 8, 2021 at 11:26:56 AM UTC-4, nikiti...@gmail.com wrote:
> > вторник, 8 июня 2021 г. в 16:49:32 UTC+3, fred_...@hotmail.com:
> > > On Tuesday, June 8, 2021 at 8:23:23 AM UTC-4, nikiti...@gmail.com wrote:
> > > > вторник, 8 июня 2021 г. в 06:10:57 UTC+3, fred_...@hotmail.com:
> > > > > On Monday, June 7, 2021 at 10:06:42 PM UTC-4, Tony Nicholson wrote:
> > > > > > On Tuesday, June 8, 2021 at 4:49:11 AM UTC+10, FredW wrote:
> > > > > > > I am using Hi-Tech C 3.09.
> > > > > > [snip]
> > > > > > > Anyone else can weigh in on SLR Z80ASM vs Microsoft M80? For building AM9511 native, I think I will use Hi-Tech ZAS, and LINK, *or* M80 and L80
> > > > > > > (LD80) or PLINK. At least those choices work without issue.
> > > > > > >
> > > > > > > As I recall "in the day" I used M80 exclusively, but I forgotten WHY. It becomes clear again.
> > > > > > I have used a mix of assemblers.. starting with the TDL/PASM (8080-style
> > > > > > with Z80 extensions) and PLINK then PLINK-II; and then for a long time the
> > > > > > Microsoft M80 macro assembler (because I like the Zilog mnemonics).
> > > > > > The SLR Z80ASM assember is fast but has some "quirks" as you have
> > > > > > found.
> > > > > >
> > > > > > In the last few years with my tinkering in the Z280 world, I've migrated to
> > > > > > mostly using Hector Peraza's ZSM4 macro assembler. It has a /Sn switch
> > > > > > that can select symbol lengths between 6 and 8 characters, and produces
> > > > > > object files in the standard Digital Research LINK format (also compatible
> > > > > > with Microsoft L80 and PLINK linkers - but it doesn't use the M80 V3.44
> > > > > > or SLR linker REL format extensions). It can also assemble Z80/Z180
> > > > > > and Z280 opcodes (all Zilog mnemonics) and uses a range of
> > > > > > M80-compatible pseudo-ops (like DW/DEFW, DS/DEFS etc).
> > > > > >
> > > > > > Hector provides the assembler source-code and binaries for CP/M (and
> > > > > > his RSX180/RSX280 operating systems) with full documentation at
> > > > > >
> > > > > > https://github.com/hperaza/ZSM4
> > > > > >
> > > > > > ZSM4 runs fine under the John Elliott's zxcc CP/M emulator on Linux/
> > > > > > macOS too (from https://www.seasip.info/Unix/Zxcc/ ).
> > > > > >
> > > > > > HI-TECH's ZAS has some quirks too (strict source-code formatting) and
> > > > > > has an added advantage of being able to optimise absolute jumps (JP)
> > > > > > into relative ones (JR) - albeit with a strange label convention for forward
> > > > > > references. The object file format is different too (see Andrey Nikitin's
> > > > > > recent reconstruction of the HI-TECH's object file DUMP utility for an
> > > > > > explanation of the object-file format (https://github.com/nikitinprior/ddump ).
> > > > > >
> > > > > > Tony
> > > > > Tony
> > > > >
> > > > > I reversed Hi-Tech OBJ format - see my OBJTOMAC utility that converts
> > > > > OBJ from Hi-Tech to MAC that can be assembled by M80. If you get MTREL,
> > > > > you also get the Hi-Tech LIBC and LIBM in REL format.
> > > > >
> > > > > FredW
> > > > The Microsoft M80 and Z80ASM SLR Systems macro assemblers and some others were developed to compile source files in assembly language. The Microsoft fortran, basic, and cobol compilers compiled high-level language source files directly into a rel object file. The Microsoft fortran compiler allowed you to get a listing of a compiled file with processor opcodes, but the use of files with assembly code obtained by compiling code from a high-level language was not originally intended. Moreover, the length of variable names (identifiers) in these languages did not exceed 6 characters, which affected their length in rel object files.
> > > > The C standard allowed longer variable and function names. For this reason, the rel format did not meet this requirement.
> > > > When creating the Hi-Tech C compiler, they developed their own object file format, taking into account the increased length of names and support for processors other than Z80. Microsoft M80 and SLR Systems Z80ASM did not even think about this.
> > > > The software package of the then commercial Hi-Tech C compiler is consistent with each other and does not require third-party software and, accordingly, additional costs. When translating libraries to the rel format, you were forced to change (reduce) the names of part of the standard functions. The use of third-party assemblers restricts the C language and turns a good compiler into something non-standard. It seems to me that it is more productive to use the capabilities of Hi-Tech assembler in your development.. And if they are not enough, write your own preprocessor to translate the M80 or Z80ASM syntax into a form that the Hi-Tech ZAS assembler understands..
> > > >
> > > > Andrey Nikitin
> > > Andrey
> > >
> > > Back "in the day" I used Whitesmiths 8080 C - and cross compiler (Whitesmiths on a VAX target was Z80). Whitesmiths used something called
> > > "A-natural" for the assembler.. completely non-standard. So, M80 it was.
> > >
> > > Some people distributed object code in REL format -- Micropro had SuperSort, for example, and Micro B+ from Faircom are examples. In my opinion,
> > > it is important to have a common object format. And, from 1977 to 1982, that was REL. Both Microsoft and Digital Research used it... And that gave us
> > > PLINK-II, SuperSort and Micro B+ Of course, there were others... but, as nice as they are --- I am writing a core AM9511 emulator. It will
> > > (eventually) go into 8080/Z80 emulators (that is the end-goal). But.... it needs to be checked against the actual hardware. So, I want to link the
> > > emulator, written in C, into (for example) FORTRAN-80. Or MBASIC, BASCOM, or have "plain" C wrappers.
> > >
> > > I *could* use Whitesmiths C 2.0 (I used Whitesmiths native 8080 and cross on VAX in the day - 1981 through 1983 or so), because I know that PLINK-II can link that, along with Microsoft REL. But, I wanted to use a slightly more modern variant of C -- Hi-Tech fits the bill. And, with OBJTOMAC I can coerce REL files out of it (and, yes, I have converted the ENTIRE LIBC and LIBM libraries into REL format already). So, I can have my cake, and eat it too. And, as a freebie, if I link with PLINK-II, I get overlays.
> > >
> > > If you recall I translated Hi-Tech ZAS to M80 -- AS2MAC is the program. That was used to convert the run-time library. But, there are...
> > > issues. It is possible to compile C to assembler with Hi-Tech C, and have ZAS *NOT ABLE TO ASSEMBLE THE AS FILE*. And, AS2MAC will
> > > then not be able to convert it, either. Sometimes, specifying optimization helps. As does reducing the source size.This did not show up
> > > while I was converting the run-time library. OBJTOMAC exists to remedy those and does so very well. It just works. (and, when I get around to
> > > it -- post AM9511 code and a couple of other projects, I am going to generate OBJTOREL -- and, once I understand REL -- having never generated a REL file, RELTOOBJ would seem reasonable -- but all that is FAR FUTURE retro work).
> > >
> > > AS2MAC.COM, OBJTOMAC.COM, LIBC.REL and LIBM.REL are all available (with all source) in https://github.com/ratboy666/mtrel
> > >
> > > The thing was -- I took a MAC file produced by my OBJTOMAC tool and assembled it with SLR Systems Z80ASM. The *assembly* went just fine, but the
> > > relocatable result was NOT LINKABLE. That indicates some issues with SLR Z80ASM. If I ran into these sorts of issues back in the day,
> > > I would simply have rejected the tool and gone back to M80.
> > >
> > > FredW
> > In those ancient times, the format of floating-point numbers was not yet standardized. Microsoft has used its version in all of its products. The AM9511 was one of the first coprocessors to speed up the computation of real numbers. He had his own idea of how they should be arranged. Other developers have used their own formats and libraries for this purpose. However, the speed of development of computer technology and the increase in the bit depth of the processor data bus led to the standardization of the representation of floating numbers, and as a result, Intel became the winner in this competition, which immediately released the 8087.
> >
> > Perhaps the AM9511 emulation is needed to run programs written with this coprocessor in mind. Although there are very few such programs, but they are there. CP/M emulators emulate Z80 codes and operating system calls. Your emulation will allow you to extend the capabilities of the latter by executing binary code using this coprocessor. Emulation of AM9511 commands in a CP/M system that does not have this coprocessor is most likely not advisable due to the overhead of emulation, which will reduce the already small memory for the program. In this regard, it is also impractical to use any C compiler for CP/M to emulate AM9511 inside this system.
> >
> > For a while, IBM PC compatible computers were available with or without a coprocessor. Compilers of that time could generate code both for the coprocessor and without it. However, they had significantly more memory, and when composing an executable program, they could use different libraries with code for the coprocessor or emulating it.
> >
> > Andrey Nikitin
> Andrey
>
> This reply is going to ramble. Your communication brought up 4 points I want to address. And a comment from me about the state of software "then" and "now".
>
> ---
>
> Yes! But... the AM9512 implemented IEEE, and Intel licensed both the AM9511 and AM9512, prior to releasing the 8087. I am interested in the AM9511 because it provided 16 bit and 32 bit fixed, and 32 bit float, and functions.. The 9512 didn't have the functions... Before the last AM9511 (and those ran HOT! 2W dissipated in a 24 pin package, afair) dies, I wanted to provide an emulation. Just for my own interest. I wanted to be able to run the emulation on the same machine that runs the actual chip... to allow validation of the emulation! And, speaking of the 8087 as a "ps" -- in 1988 I released
>
> emul87: https://www.pcorner.com/list/UTILITY/EMUL87.ZIP/INFO/
>
> as freeware (no source) (if you have an old DOS system with 286 or 386, have fun with it!) (I used my middle name back then -- F Martin Weigel).
>
> ---
> The emulation *must* be written in C to incorporate into Z80pack. I strongly desire to run it on a Z80 with AM9511 chip. Yes, you are correct... it
> is going to be too large for production. So far, its 20K bytes in length (includes all float functions, single and double fixed) -- missing 32x32->64 multiply
> No optimizations... the final should be 15K in size. But, it will only be run ON the Z80 for validation -- not for production. That will be in Z80pack or
> another host (Altair-Duino).
>
> ---
> For format conversion of floats, I published https://github.com/ratboy666/am9511 at the beginning of this project-- this has floatcnv.c which implements Microsoft 32 bit float, IEEE 32 bit float, HiTech C 32 bit float and AM9511 32 bit float convert back and forth. Written in C, Including floating point output for Hi-Tech (which is fairly huge) -- 11K with tests. Works with Hi-Tech C, GCC and TCC (maybe other compilers). Needs testing, as it is "young" code (only a week old at this writing). I welcome change requests, and patches. The next part of the emulator to be published (soon) will be "ova.c" -- no eggs, overflow arithmetic in fixed format for 16 and 32 bit with proper carry and overflow. In C for hi-tech C and GCC (and TCC).
>
> ---
>
> Very tight code can be produced with Hi-Tech C -- I am using it as a sort of "portable assembler". It would be easy enough to hand-compile floatcnv.c
> and bring it to 1/3 of its object size. But... YAGNI (yah ain't gonna need it) -- there has been no need to optimize it yet...
>
> ---
> As a side note, I am doing this as a hobby. At the early pandemic, my partner bought me an Altair-Duino. This was my first personal computer (the
> original Altair 8800). I started having a blast programming for the 2Mhz 8080 -- it occurred to me that there were things I had never done... work
> with a A9511 was one of them. But, I also realized that these early personal systems were more capable than I had thought at the time. They
> force "methodical programming"; that is more thinking about what you are doing, resulting in better programs. Simply because compiling
> etc. is so time expensive. Think first! No "experimenting". So, my OBJTOMAC program actually worked the first time! I was darn surprised that
> it didn't work with SLR! So, much credit to whoever wrote M80/L80. That worked predictably!
>
> I was working with a young lad in 2019/2020, "mentoring". He had the urge to dive in and program ... without looking for what was there,
> and how it could be pieced together. Spent a year teaching the lad Unix (Linux) command line, sqlite3, and other topics. How to get an
> aesthetic sense of what is a "good" piece of software or a "good" system. And, looking at the Altair-Duino, I am trying to recover a sense
> of the "good" of programming "back in the day". It is a fun journey.
>
> FredW


Click here to read the complete article
Re: SLR Z80ASM Question/Discussion

<bf7395e1-feb1-4b73-8594-c0c1b45f9549n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2608&group=comp.os.cpm#2608

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:a05:622a:100e:: with SMTP id d14mr1900683qte.254.1623174849608; Tue, 08 Jun 2021 10:54:09 -0700 (PDT)
X-Received: by 2002:a05:6830:245c:: with SMTP id x28mr6886519otr.169.1623174849333; Tue, 08 Jun 2021 10:54:09 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!tr3.eu1.usenetexpress.com!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.cpm
Date: Tue, 8 Jun 2021 10:54:09 -0700 (PDT)
In-Reply-To: <ca471bc3-4970-466f-b285-16174fc60cean@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2607:f2c0:956b:6a00:ec5e:c05b:3cc1:fa0a; posting-account=KOfC_woAAAC0YBGf-3r2aV5g2Aifd9jO
NNTP-Posting-Host: 2607:f2c0:956b:6a00:ec5e:c05b:3cc1:fa0a
References: <989df0c4-0a21-4deb-b3d5-b121944b7786n@googlegroups.com> <8c0f8afb-944b-4e39-b55f-f03100bae60en@googlegroups.com> <89df32d8-9867-4cdc-9aad-e7d3328a7ca6n@googlegroups.com> <ca471bc3-4970-466f-b285-16174fc60cean@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <bf7395e1-feb1-4b73-8594-c0c1b45f9549n@googlegroups.com>
Subject: Re: SLR Z80ASM Question/Discussion
From: fred_wei...@hotmail.com (fred_...@hotmail.com)
Injection-Date: Tue, 08 Jun 2021 17:54:09 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 131
 by: fred_...@hotmail.com - Tue, 8 Jun 2021 17:54 UTC

On Tuesday, June 8, 2021 at 8:23:23 AM UTC-4, nikiti...@gmail.com wrote:
> вторник, 8 июня 2021 г. в 06:10:57 UTC+3, fred_...@hotmail.com:
> > On Monday, June 7, 2021 at 10:06:42 PM UTC-4, Tony Nicholson wrote:
> > > On Tuesday, June 8, 2021 at 4:49:11 AM UTC+10, FredW wrote:
> > > > I am using Hi-Tech C 3.09.
> > > [snip]
> > > > Anyone else can weigh in on SLR Z80ASM vs Microsoft M80? For building AM9511 native, I think I will use Hi-Tech ZAS, and LINK, *or* M80 and L80
> > > > (LD80) or PLINK. At least those choices work without issue.
> > > >
> > > > As I recall "in the day" I used M80 exclusively, but I forgotten WHY. It becomes clear again.
> > > I have used a mix of assemblers.. starting with the TDL/PASM (8080-style
> > > with Z80 extensions) and PLINK then PLINK-II; and then for a long time the
> > > Microsoft M80 macro assembler (because I like the Zilog mnemonics).
> > > The SLR Z80ASM assember is fast but has some "quirks" as you have
> > > found.
> > >
> > > In the last few years with my tinkering in the Z280 world, I've migrated to
> > > mostly using Hector Peraza's ZSM4 macro assembler. It has a /Sn switch
> > > that can select symbol lengths between 6 and 8 characters, and produces
> > > object files in the standard Digital Research LINK format (also compatible
> > > with Microsoft L80 and PLINK linkers - but it doesn't use the M80 V3.44
> > > or SLR linker REL format extensions). It can also assemble Z80/Z180
> > > and Z280 opcodes (all Zilog mnemonics) and uses a range of
> > > M80-compatible pseudo-ops (like DW/DEFW, DS/DEFS etc).
> > >
> > > Hector provides the assembler source-code and binaries for CP/M (and
> > > his RSX180/RSX280 operating systems) with full documentation at
> > >
> > > https://github.com/hperaza/ZSM4
> > >
> > > ZSM4 runs fine under the John Elliott's zxcc CP/M emulator on Linux/
> > > macOS too (from https://www.seasip.info/Unix/Zxcc/ ).
> > >
> > > HI-TECH's ZAS has some quirks too (strict source-code formatting) and
> > > has an added advantage of being able to optimise absolute jumps (JP)
> > > into relative ones (JR) - albeit with a strange label convention for forward
> > > references. The object file format is different too (see Andrey Nikitin's
> > > recent reconstruction of the HI-TECH's object file DUMP utility for an
> > > explanation of the object-file format (https://github.com/nikitinprior/ddump ).
> > >
> > > Tony
> > Tony
> >
> > I reversed Hi-Tech OBJ format - see my OBJTOMAC utility that converts
> > OBJ from Hi-Tech to MAC that can be assembled by M80. If you get MTREL,
> > you also get the Hi-Tech LIBC and LIBM in REL format.
> >
> > FredW
> The Microsoft M80 and Z80ASM SLR Systems macro assemblers and some others were developed to compile source files in assembly language. The Microsoft fortran, basic, and cobol compilers compiled high-level language source files directly into a rel object file. The Microsoft fortran compiler allowed you to get a listing of a compiled file with processor opcodes, but the use of files with assembly code obtained by compiling code from a high-level language was not originally intended. Moreover, the length of variable names (identifiers) in these languages did not exceed 6 characters, which affected their length in rel object files.
> The C standard allowed longer variable and function names. For this reason, the rel format did not meet this requirement.
> When creating the Hi-Tech C compiler, they developed their own object file format, taking into account the increased length of names and support for processors other than Z80. Microsoft M80 and SLR Systems Z80ASM did not even think about this.
> The software package of the then commercial Hi-Tech C compiler is consistent with each other and does not require third-party software and, accordingly, additional costs. When translating libraries to the rel format, you were forced to change (reduce) the names of part of the standard functions. The use of third-party assemblers restricts the C language and turns a good compiler into something non-standard. It seems to me that it is more productive to use the capabilities of Hi-Tech assembler in your development. And if they are not enough, write your own preprocessor to translate the M80 or Z80ASM syntax into a form that the Hi-Tech ZAS assembler understands.
>
> Andrey Nikitin

Andrey

I was also curious about 6 character external names. In "The C Programming Language", Second Edition, Brian W. Kernighan and Dennis M. Ritchie, Page 259 (Appendix C: Summary of Changes).

- The minimum significance of all internal identifiers is increased to 31 characters; the smallest mandated significance of identifiers with external linkage remains 6 monocase letters. (Many implementations provide more).

This was 1988!

So, it is probably good that Hi-Tech supports longer external identifiers.... but... C did not require that. C89 has 6 character monocase for external identifiers.
M80 and L80 are fine! But... drum roll... Hi-Tech prepends an underscore, reducing it to 5... See my library notes when I created LIBC.REL and LIBM.REL

To be exact: I introduced stncpy, stncat and stncmp (for strncpy strncat, and strncmp) With 6 character limit AND prepending '_' we got
_strnc for ALL of these functions! we now get _stncp _stnca and _stncm which works. I also renamed __cpm_clean to __cpcl

I would have preferred Hi-Tech C appends a '_' to names: that would give a full six -- but I think Whitesmiths had the same issue. The '_'
was put there to avoid user specified names from colliding with system functions. If system functions were limited to 5 characters, we
would have had a full six characters. If you even rebuild the actual compiler, consider moving that underscore to the end!

FredW

Re: SLR Z80ASM Question/Discussion

<a2086174-cfbf-46b0-b774-9f406d90b504n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2609&group=comp.os.cpm#2609

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:a05:622a:40f:: with SMTP id n15mr22558216qtx.10.1623175644357; Tue, 08 Jun 2021 11:07:24 -0700 (PDT)
X-Received: by 2002:a4a:ded3:: with SMTP id w19mr4707313oou.46.1623175644101; Tue, 08 Jun 2021 11:07:24 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.net!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!tr1.eu1.usenetexpress.com!feeder.usenetexpress.com!tr3.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.cpm
Date: Tue, 8 Jun 2021 11:07:23 -0700 (PDT)
In-Reply-To: <bf7395e1-feb1-4b73-8594-c0c1b45f9549n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.37.209.254; posting-account=g8ksUwoAAAC0mgCsQ1LJvKj1k2HoKsbw
NNTP-Posting-Host: 77.37.209.254
References: <989df0c4-0a21-4deb-b3d5-b121944b7786n@googlegroups.com> <8c0f8afb-944b-4e39-b55f-f03100bae60en@googlegroups.com> <89df32d8-9867-4cdc-9aad-e7d3328a7ca6n@googlegroups.com> <ca471bc3-4970-466f-b285-16174fc60cean@googlegroups.com> <bf7395e1-feb1-4b73-8594-c0c1b45f9549n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a2086174-cfbf-46b0-b774-9f406d90b504n@googlegroups.com>
Subject: Re: SLR Z80ASM Question/Discussion
From: nikitinp...@gmail.com (Андрей Никитин)
Injection-Date: Tue, 08 Jun 2021 18:07:24 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 141
 by: Андрей Ник - Tue, 8 Jun 2021 18:07 UTC

вторник, 8 июня 2021 г. в 20:54:10 UTC+3, fred_...@hotmail.com:
> On Tuesday, June 8, 2021 at 8:23:23 AM UTC-4, nikiti...@gmail.com wrote:
> > вторник, 8 июня 2021 г. в 06:10:57 UTC+3, fred_...@hotmail.com:
> > > On Monday, June 7, 2021 at 10:06:42 PM UTC-4, Tony Nicholson wrote:
> > > > On Tuesday, June 8, 2021 at 4:49:11 AM UTC+10, FredW wrote:
> > > > > I am using Hi-Tech C 3.09.
> > > > [snip]
> > > > > Anyone else can weigh in on SLR Z80ASM vs Microsoft M80? For building AM9511 native, I think I will use Hi-Tech ZAS, and LINK, *or* M80 and L80
> > > > > (LD80) or PLINK. At least those choices work without issue.
> > > > >
> > > > > As I recall "in the day" I used M80 exclusively, but I forgotten WHY. It becomes clear again.
> > > > I have used a mix of assemblers.. starting with the TDL/PASM (8080-style
> > > > with Z80 extensions) and PLINK then PLINK-II; and then for a long time the
> > > > Microsoft M80 macro assembler (because I like the Zilog mnemonics).
> > > > The SLR Z80ASM assember is fast but has some "quirks" as you have
> > > > found.
> > > >
> > > > In the last few years with my tinkering in the Z280 world, I've migrated to
> > > > mostly using Hector Peraza's ZSM4 macro assembler. It has a /Sn switch
> > > > that can select symbol lengths between 6 and 8 characters, and produces
> > > > object files in the standard Digital Research LINK format (also compatible
> > > > with Microsoft L80 and PLINK linkers - but it doesn't use the M80 V3.44
> > > > or SLR linker REL format extensions). It can also assemble Z80/Z180
> > > > and Z280 opcodes (all Zilog mnemonics) and uses a range of
> > > > M80-compatible pseudo-ops (like DW/DEFW, DS/DEFS etc).
> > > >
> > > > Hector provides the assembler source-code and binaries for CP/M (and
> > > > his RSX180/RSX280 operating systems) with full documentation at
> > > >
> > > > https://github.com/hperaza/ZSM4
> > > >
> > > > ZSM4 runs fine under the John Elliott's zxcc CP/M emulator on Linux/
> > > > macOS too (from https://www.seasip.info/Unix/Zxcc/ ).
> > > >
> > > > HI-TECH's ZAS has some quirks too (strict source-code formatting) and
> > > > has an added advantage of being able to optimise absolute jumps (JP)
> > > > into relative ones (JR) - albeit with a strange label convention for forward
> > > > references. The object file format is different too (see Andrey Nikitin's
> > > > recent reconstruction of the HI-TECH's object file DUMP utility for an
> > > > explanation of the object-file format (https://github.com/nikitinprior/ddump ).
> > > >
> > > > Tony
> > > Tony
> > >
> > > I reversed Hi-Tech OBJ format - see my OBJTOMAC utility that converts
> > > OBJ from Hi-Tech to MAC that can be assembled by M80. If you get MTREL,
> > > you also get the Hi-Tech LIBC and LIBM in REL format.
> > >
> > > FredW
> > The Microsoft M80 and Z80ASM SLR Systems macro assemblers and some others were developed to compile source files in assembly language. The Microsoft fortran, basic, and cobol compilers compiled high-level language source files directly into a rel object file. The Microsoft fortran compiler allowed you to get a listing of a compiled file with processor opcodes, but the use of files with assembly code obtained by compiling code from a high-level language was not originally intended. Moreover, the length of variable names (identifiers) in these languages did not exceed 6 characters, which affected their length in rel object files.
> > The C standard allowed longer variable and function names. For this reason, the rel format did not meet this requirement.
> > When creating the Hi-Tech C compiler, they developed their own object file format, taking into account the increased length of names and support for processors other than Z80. Microsoft M80 and SLR Systems Z80ASM did not even think about this.
> > The software package of the then commercial Hi-Tech C compiler is consistent with each other and does not require third-party software and, accordingly, additional costs. When translating libraries to the rel format, you were forced to change (reduce) the names of part of the standard functions. The use of third-party assemblers restricts the C language and turns a good compiler into something non-standard. It seems to me that it is more productive to use the capabilities of Hi-Tech assembler in your development. And if they are not enough, write your own preprocessor to translate the M80 or Z80ASM syntax into a form that the Hi-Tech ZAS assembler understands.
> >
> > Andrey Nikitin
> Andrey
>
> I was also curious about 6 character external names. In "The C Programming Language", Second Edition, Brian W. Kernighan and Dennis M. Ritchie, Page 259 (Appendix C: Summary of Changes).
>
> - The minimum significance of all internal identifiers is increased to 31 characters; the smallest mandated significance of identifiers with external linkage remains 6 monocase letters. (Many implementations provide more).
>
> This was 1988!
>
> So, it is probably good that Hi-Tech supports longer external identifiers.... but... C did not require that. C89 has 6 character monocase for external identifiers.
> M80 and L80 are fine! But... drum roll... Hi-Tech prepends an underscore, reducing it to 5... See my library notes when I created LIBC.REL and LIBM.REL
>
> To be exact: I introduced stncpy, stncat and stncmp (for strncpy strncat, and strncmp) With 6 character limit AND prepending '_' we got
> _strnc for ALL of these functions! we now get _stncp _stnca and _stncm which works. I also renamed __cpm_clean to __cpcl
>
> I would have preferred Hi-Tech C appends a '_' to names: that would give a full six -- but I think Whitesmiths had the same issue. The '_'
> was put there to avoid user specified names from colliding with system functions. If system functions were limited to 5 characters, we
> would have had a full six characters. If you even rebuild the actual compiler, consider moving that underscore to the end!
>
> FredW

I think the compiler developers made the decision about the underscore character at the beginning of the characters consciously. This is some protection. If the name is more than 6 characters, the compiler truncates the subsequent characters, and then there may be a conflict with the names assigned by the user.

Andrey Nikitin

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor