diff options
author | B. Watson <urchlay@slackware.uk> | 2023-05-25 23:31:43 +0100 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2023-05-27 08:08:49 +0700 |
commit | 35124212c6e8ced9cf76716924672caf70070031 (patch) | |
tree | 5ca9ae416970618784e929f1b180e1c186e4d3dc | |
parent | 16cc68401e52f4a6015f653562336c7d3577a7d8 (diff) |
development/zmac: Added (Z-80 cross assembler)
Signed-off-by: bedlam <dave@slackbuilds.org>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r-- | development/zmac/README | 16 | ||||
-rw-r--r-- | development/zmac/slack-desc | 19 | ||||
-rw-r--r-- | development/zmac/zmac.1 | 262 | ||||
-rw-r--r-- | development/zmac/zmac.SlackBuild | 108 | ||||
-rw-r--r-- | development/zmac/zmac.info | 12 | ||||
-rw-r--r-- | development/zmac/zmac.rst | 207 |
6 files changed, 624 insertions, 0 deletions
diff --git a/development/zmac/README b/development/zmac/README new file mode 100644 index 000000000000..898b2f7cf994 --- /dev/null +++ b/development/zmac/README @@ -0,0 +1,16 @@ +zmac (Z-80 cross assembler) + +zmac is a Z-80 macro cross-assembler. It has all the features you'd +expect. It assembles the specified input file (with a '.z' extension +if there is no pre-existing extension and the file as given doesn't +exist) and produces program output in many different formats. It also +produces a nicely-formatted listing of the machine code and cycle +counts alongside the source in a ".lst" file. Undocumented Z-80 +instructions are supported as well as 8080 and Z-180 (aka HD64180). + +zmac strives to be a powerful assembler with expressions familiar to C +programmers while providing good backward compatibility with original +assemblers such as Edtasm, MRAS and Macro-80. + +Also included in the package is ld80, a linker which is mostly +compatible with the Microsoft L80 linker for CP/M and other Z-80 OSes. diff --git a/development/zmac/slack-desc b/development/zmac/slack-desc new file mode 100644 index 000000000000..aba6b8d1cb7f --- /dev/null +++ b/development/zmac/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +zmac: zmac (Z-80 cross assembler) +zmac: +zmac: zmac is a Z-80 macro cross-assembler. It has all the features you'd +zmac: expect. It assembles the specified input file (with a '.z' extension +zmac: if there is no pre-existing extension and the file as given doesn't +zmac: exist) and produces program output in many different formats. It also +zmac: produces a nicely-formatted listing of the machine code and cycle +zmac: counts alongside the source in a ".lst" file. Undocumented Z-80 +zmac: instructions are supported as well as 8080 and Z-180 (aka HD64180). +zmac: +zmac: diff --git a/development/zmac/zmac.1 b/development/zmac/zmac.1 new file mode 100644 index 000000000000..9e336443ebd9 --- /dev/null +++ b/development/zmac/zmac.1 @@ -0,0 +1,262 @@ +.\" Man page generated from reStructuredText. +. +. +.nr rst2man-indent-level 0 +. +.de1 rstReportMargin +\\$1 \\n[an-margin] +level \\n[rst2man-indent-level] +level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] +- +\\n[rst2man-indent0] +\\n[rst2man-indent1] +\\n[rst2man-indent2] +.. +.de1 INDENT +.\" .rstReportMargin pre: +. RS \\$1 +. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] +. nr rst2man-indent-level +1 +.\" .rstReportMargin post: +.. +.de UNINDENT +. RE +.\" indent \\n[an-margin] +.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] +.nr rst2man-indent-level -1 +.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] +.in \\n[rst2man-indent\\n[rst2man-indent-level]]u +.. +.TH "ZMAC" 1 "2023-05-18" "20221018_0.7" "SlackBuilds.org" +.SH NAME +zmac \- Z-80 macro cross-assembler +.\" RST source for zmac(1) man page. Convert with: +. +.\" rst2man.py zmac.rst > zmac.1 +. +.SH SYNOPSIS +.sp +\fBzmac\fP [\fI\-\-help\fP] [\fI\-\-version\fP] [\fI\-\-dep\fP] [\fI\-\-mras\fP] [\fI\-\-od dir\fP] [\fI\-\-oo sfx1,sfx2\fP] [\fI\-\-xo sfx1,sfx2\fP] [\fI\-\-dri\fP] [\fI\-\-rel\fP] [\fI\-\-rel7\fP] [\fI\-\-nmnv\fP] [\fI\-\-z180\fP] [\fI\-\-fcal\fP] [\fI\-\-doc\fP] [\fI\-\-zmac\fP] [\fI\-8bcefghijJlLmnopstz\fP] [\fIfilename[.z]\fP] +.SH DESCRIPTION +.sp +zmac is a Z\-80 macro cross\-assembler. It has all the features you\(aqd +expect. It assembles the specified input file (with a \(aq.z\(aq extension +if there is no pre\-existing extension and the file as given doesn\(aqt +exist) and produces program output in many different formats. It also +produces a nicely\-formatted listing of the machine code and cycle +counts alongside the source in a ".lst" file. +.sp +To reduce clutter and command line option usage, by default all zmac +output is put into an (auto\-created) zout subdirectory. For file.z +the listing will be in zout/file.lst, the TRS\-80 executable format +in zout/file.cmd and so on. For more friendly usage in make files +and integrated development environments the \-o, \-\-oo, \-\-xo and \-\-xd +options may be used to select specific output file formats and where +they are written. +.sp +Undocumented Z\-80 instructions are supported as well as 8080 and Z\-180 +(aka HD64180). +.sp +zmac strives to be a powerful assembler with expressions familiar to C +programmers while providing good backward compatibility with original +assemblers such as Edtasm, MRAS and Macro\-80. +.sp +This man page only documents the command\-line options. The full documentation can be found here: +/usr/doc/zmac\-20221018_0.7/zmac.html +.SH OPTIONS +.sp +Space\-separated arguments in the ZMAC_ARGS environment variable are added to the +end of the command line. +.INDENT 0.0 +.TP +.B \-\-help +Display a list of options and a terse description of what the +options do. +.TP +.B \-\-version +Print zmac version name. +.TP +.B \-\-mras +MRAS compatibility mode. Any ? in a label will be expanded to +the current module identifier as set by *mod. Operator +precedence and results are changed. +.TP +.BI \-\-od \ dir +Place output files in dir instead of the default "zout" +subdirectory. Creates dir if necessary. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-oo hex,cmd +Output only the the file types by suffix. Multiple \-\-oo +arguments may be used. "\-\-oo lst,cas" is equivalent to "\-\-oo +lst \-\-oo cas". See "Output Formats" for a list of output types +by suffix. +.TP +.B \-\-xo tap,wav +Do not output the file type types listed by suffix. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-dri +Enable compatibility with Digital Research (CP/M) assemblers: +Ignores dollar signs in constants and symbols. Silences a +warning when using Z80.LIB. Allows the use of \(aq*\(aq in first +column for comment lines. Accepts $\-MACRO directives. +.TP +.B \-\-nmnv +Do not interpret Z\-80 or 8080 mnemonics as values in +expressions. +.TP +.B \-\-rel +Output ".rel" (relocatable object file) format only. Exported +symbols are truncated to length 6. +.TP +.B \-\-rel7 +Output ".rel" (relocatable object file) format only. Exported +symbols are truncated to length 7. +.TP +.B \-\-zmac +zmac compatibility mode. defl labels are undefined after each +pass. Quotes and double quotes are stripped from macro +arguments before expansion. $ is ignored in identifiers +allowing foo$bar to construct identifiers in macro expansions. +Use \(ga (backquote) instead in normal mode. Labels starting with +"." are temporary and are reset whenever a non\-temporary label +is defined (thus they may be reused). Labels starting with "_" +are local to their file thus avoid multiple definition when +brought in with include. +.TP +.B \-\-z180 +Use Z\-180 timings and extended instructions. Undocumented Z\-80 +instructions will generate errors as the Z\-180 (or H64810) does +not support them. Equivalent to .z180 pseudo\-op. +.TP +.B \-\-dep +Print all files read by include, incbin and import. +.TP +.B \-\-doc +Print full documentation in HTML format to standard output. +.UNINDENT +.INDENT 0.0 +.TP +.B \-Pk=number +Set @@k to the given numeric value before assembly. Up to 10 +parameters can be set from 0 though 9. \-Pk is shorthand for +\-Pk=\-1. For example, P4=$123 effectively puts @@4 equ $123 at +the top of the first file. +.UNINDENT +.INDENT 0.0 +.TP +.BI \-D\fB symbol +Define symbol to be 1 before assembly. +.TP +.B \-\-fcal +Always treat an indentifier in the first column as a label. +zmac uses various heuristics in the case of ambiguity when a +label does not have a colon. This option turns heuristics off. +.TP +.B \-8 +Accept 8080 mnemonics preferentially and use 8080 instruction +timings. Equivalent to .8080 pseudo\-op. +.TP +.B \-b +Don\(aqt generate any machine code output at all. +.TP +.B \-c +Don\(aqt display cycle counts in the listing. +.TP +.B \-e +Omit the "error report" section in the listing. +.TP +.B \-f +List instructions not assembled due to "if" expressions being +false. (Normally these are not shown in the listing.) +.TP +.B \-g +List only the first line of equivalent hex for a source line. +.TP +.B \-h +Display a list of options and a terse description of what the +options do. (same as \-\-help) +.TP +.B \-i +Don\(aqt list files included with include, read or import. +.TP +.BI \-I \ dir +Add dir to the end of the include file search path. +.TP +.B \-j +Promote relative jumps and DJNZ to absolute equivalents as +needed. +.TP +.B \-J +Error if an absolute jump could be replaced with a relative +jump. +.TP +.B \-l +List to standard output. +.TP +.B \-L +Generate listing no matter what. Overrides any conflicting +options. +.TP +.B \-m +List macro expansions. +.TP +.B \-n +Omit line numbers from listing. +.UNINDENT +.INDENT 0.0 +.TP +.B \-o filename.cmd +Output only the named file. Multiple "\-o" options can be used +to name a set of different files. +.UNINDENT +.INDENT 0.0 +.TP +.B \-p +Use a few linefeeds for page break in listing rather than ^L. +.TP +.B \-P +Output listing for a printer with headers, multiple symbols per +column, etc. +.TP +.B \-s +Omit the symbol table from the listing. +.TP +.B \-t +Only output number of errors instead list of each one. +.TP +.B \-z +Accept Z\-80 mnemonics preferentially and use Z\-80 instruction +timings. Equivalent to .z80 pseudo\-op. +.UNINDENT +.SH LICENSE +.sp +\fBCC0\fP +.sp +To the extent possible under law, George Phillips has waived all copyright +and related or neighboring rights to zmac macro cross assembler for the Zilog +Z\-80 microprocessor. This work is published from: Canada. +.SH AUTHORS +.sp +Bruce Norskog originally wrote zmac in 1978. +.sp +Updates and bugfixes over the years by John Providenza, Colin Kelley, and more +recently by Russell Marks, Mark RISON, Chris Smith, Matthew Phillips and Tim +Mann. +.sp +Extensive modifications for cycle counting, multiple output formats, ".rel" +output, 8080 mode and older assembler compatibilty were written by George +Phillips. +.sp +This man page written for the SlackBuilds.org project +by B. Watson, and is licensed under the WTFPL. +.SH SEE ALSO +.sp +\fBld80\fP(1) +.sp +The zmac homepage: \fI\%http://48k.ca/zmac.html\fP +.\" Generated by docutils manpage writer. +. diff --git a/development/zmac/zmac.SlackBuild b/development/zmac/zmac.SlackBuild new file mode 100644 index 000000000000..61312de89e36 --- /dev/null +++ b/development/zmac/zmac.SlackBuild @@ -0,0 +1,108 @@ +#!/bin/bash + +# Slackware build script for zmac + +# Written by B. Watson (urchlay@slackware.uk) + +# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. + +# This is a combo: the assembler and the linker in one package. + +# VERSION is the zmac version (which is just a release date) plus +# the ld80 version. I downloaded the .zip files from the author's +# site, but as they're unversioned there (zmac.zip and ld80.zip), +# they will be replaced with newer versions someday, and break this +# SlackBuild. So I put them on my server with versioned filenames +# (otherwise unmodified). + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=zmac +VERSION=${VERSION:-20221018_0.7} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +ZMACVER="$( echo $VERSION | cut -d_ -f1 )" +LD80VER="$( echo $VERSION | cut -d_ -f2 )" +ZMAC=zmac-$ZMACVER +LD80=ld80-$LD80VER + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +mkdir $PRGNAM-$VERSION +cd $PRGNAM-$VERSION +TOPDIR=$(pwd) +mkdir zmac-$ZMACVER ld80-$LD80VER +unzip -j $CWD/$ZMAC.zip -d $ZMAC -x '*.exe' '*.bat' +unzip $CWD/$LD80.zip -d $LD80 -x '*.exe' '*.bat' '*.vcproj' '*.sln' +chown -R root:root . +chmod 755 * +chmod 644 */* + +sed -i "s,-g,$SLKCFLAGS," $LD80/Makefile + +# These really do fail with -jN in the env, if N>1. They're also +# small enough that it's not painfully slow with -j1. +make -j1 -C $ZMAC CXXFLAGS="$SLKCFLAGS" CFLAGS="$SLKCFLAGS" +make -j1 -C $LD80 + +# No 'make install' for either one. +PKGBIN=$PKG/usr/bin +PKGMAN1=$PKG/usr/man/man1 +PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION +mkdir -p $PKGBIN $PKGMAN1 $PKGDOC + +install -s $ZMAC/zmac $LD80/ld80 $PKGBIN + +# ld80 has a nice man page, zmac man page is copypasta from zmac.html. +gzip -9c < $CWD/zmac.1 > $PKGMAN1/zmac.1.gz +gzip -9c < $LD80/ld80.1 > $PKGMAN1/ld80.1.gz + +# HTML doc is built into the binary, extract it. Don't bother with doc.txt, +# since it's the source for the HTML. +./$ZMAC/zmac --doc > $PKGDOC/zmac.html + +cp -a $LD80/ld80.html $PKGDOC +cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/development/zmac/zmac.info b/development/zmac/zmac.info new file mode 100644 index 000000000000..5265d51ae6fa --- /dev/null +++ b/development/zmac/zmac.info @@ -0,0 +1,12 @@ +PRGNAM="zmac" +VERSION="20221018_0.7" +HOMEPAGE="http://48k.ca/zmac.html" +DOWNLOAD="https://slackware.uk/~urchlay/src/zmac-20221018.zip \ + https://slackware.uk/~urchlay/src/ld80-0.7.zip" +MD5SUM="42948c0e0060dd15336df1bedfde6631 \ + 91569de47101a0d0dfffbca7a2b9365e" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="B. Watson" +EMAIL="urchlay@slackware.uk" diff --git a/development/zmac/zmac.rst b/development/zmac/zmac.rst new file mode 100644 index 000000000000..ae264d28db90 --- /dev/null +++ b/development/zmac/zmac.rst @@ -0,0 +1,207 @@ +.. RST source for zmac(1) man page. Convert with: +.. rst2man.py zmac.rst > zmac.1 + +.. |version| replace:: 20221018_0.7 +.. |date| date:: + +==== +zmac +==== + +-------------------------- +Z-80 macro cross-assembler +-------------------------- + +:Manual section: 1 +:Manual group: SlackBuilds.org +:Date: |date| +:Version: |version| + +SYNOPSIS +======== + +**zmac** [*--help*] [*--version*] [*--dep*] [*--mras*] [*--od dir*] [*--oo sfx1,sfx2*] [*--xo sfx1,sfx2*] [*--dri*] [*--rel*] [*--rel7*] [*--nmnv*] [*--z180*] [*--fcal*] [*--doc*] [*--zmac*] [*-8bcefghijJlLmnopstz*] [*filename[.z]*] + +DESCRIPTION +=========== + +zmac is a Z-80 macro cross-assembler. It has all the features you'd +expect. It assembles the specified input file (with a '.z' extension +if there is no pre-existing extension and the file as given doesn't +exist) and produces program output in many different formats. It also +produces a nicely-formatted listing of the machine code and cycle +counts alongside the source in a ".lst" file. + +To reduce clutter and command line option usage, by default all zmac +output is put into an (auto-created) zout subdirectory. For file.z +the listing will be in zout/file.lst, the TRS-80 executable format +in zout/file.cmd and so on. For more friendly usage in make files +and integrated development environments the -o, --oo, --xo and --xd +options may be used to select specific output file formats and where +they are written. + +Undocumented Z-80 instructions are supported as well as 8080 and Z-180 +(aka HD64180). + +zmac strives to be a powerful assembler with expressions familiar to C +programmers while providing good backward compatibility with original +assemblers such as Edtasm, MRAS and Macro-80. + +This man page only documents the command-line options. The full documentation can be found here: +/usr/doc/zmac-|version|/zmac.html + +OPTIONS +======= + +Space-separated arguments in the ZMAC_ARGS environment variable are added to the +end of the command line. + + +--help Display a list of options and a terse description of what the + options do. + +--version Print zmac version name. + +--mras MRAS compatibility mode. Any ? in a label will be expanded to + the current module identifier as set by \*mod. Operator + precedence and results are changed. + +--od dir Place output files in dir instead of the default "zout" + subdirectory. Creates dir if necessary. + +--oo hex,cmd + Output only the the file types by suffix. Multiple --oo + arguments may be used. "--oo lst,cas" is equivalent to "--oo + lst --oo cas". See "Output Formats" for a list of output types + by suffix. + +--xo tap,wav + Do not output the file type types listed by suffix. + +--dri Enable compatibility with Digital Research (CP/M) assemblers: + Ignores dollar signs in constants and symbols. Silences a + warning when using Z80.LIB. Allows the use of '*' in first + column for comment lines. Accepts $-MACRO directives. + +--nmnv Do not interpret Z-80 or 8080 mnemonics as values in + expressions. + +--rel Output ".rel" (relocatable object file) format only. Exported + symbols are truncated to length 6. + +--rel7 Output ".rel" (relocatable object file) format only. Exported + symbols are truncated to length 7. + +--zmac zmac compatibility mode. defl labels are undefined after each + pass. Quotes and double quotes are stripped from macro + arguments before expansion. $ is ignored in identifiers + allowing foo$bar to construct identifiers in macro expansions. + Use ` (backquote) instead in normal mode. Labels starting with + "." are temporary and are reset whenever a non-temporary label + is defined (thus they may be reused). Labels starting with "_" + are local to their file thus avoid multiple definition when + brought in with include. + +--z180 Use Z-180 timings and extended instructions. Undocumented Z-80 + instructions will generate errors as the Z-180 (or H64810) does + not support them. Equivalent to .z180 pseudo-op. + +--dep Print all files read by include, incbin and import. + +--doc Print full documentation in HTML format to standard output. + +-Pk=number + Set @@k to the given numeric value before assembly. Up to 10 + parameters can be set from 0 though 9. -Pk is shorthand for + -Pk=-1. For example, P4=$123 effectively puts @@4 equ $123 at + the top of the first file. + +-Dsymbol Define symbol to be 1 before assembly. + +--fcal Always treat an indentifier in the first column as a label. + zmac uses various heuristics in the case of ambiguity when a + label does not have a colon. This option turns heuristics off. + +-8 Accept 8080 mnemonics preferentially and use 8080 instruction + timings. Equivalent to .8080 pseudo-op. + +-b Don't generate any machine code output at all. + +-c Don't display cycle counts in the listing. + +-e Omit the "error report" section in the listing. + +-f List instructions not assembled due to "if" expressions being + false. (Normally these are not shown in the listing.) + +-g List only the first line of equivalent hex for a source line. + +-h Display a list of options and a terse description of what the + options do. (same as --help) + +-i Don't list files included with include, read or import. + +-I dir Add dir to the end of the include file search path. + +-j Promote relative jumps and DJNZ to absolute equivalents as + needed. + +-J Error if an absolute jump could be replaced with a relative + jump. + +-l List to standard output. + +-L Generate listing no matter what. Overrides any conflicting + options. + +-m List macro expansions. + +-n Omit line numbers from listing. + +-o filename.cmd + Output only the named file. Multiple "-o" options can be used + to name a set of different files. + +-p Use a few linefeeds for page break in listing rather than ^L. + +-P Output listing for a printer with headers, multiple symbols per + column, etc. + +-s Omit the symbol table from the listing. + +-t Only output number of errors instead list of each one. + +-z Accept Z-80 mnemonics preferentially and use Z-80 instruction + timings. Equivalent to .z80 pseudo-op. + +LICENSE +======= + +**CC0** + +To the extent possible under law, George Phillips has waived all copyright +and related or neighboring rights to zmac macro cross assembler for the Zilog +Z-80 microprocessor. This work is published from: Canada. + +AUTHORS +======= + +Bruce Norskog originally wrote zmac in 1978. + +Updates and bugfixes over the years by John Providenza, Colin Kelley, and more +recently by Russell Marks, Mark RISON, Chris Smith, Matthew Phillips and Tim +Mann. + +Extensive modifications for cycle counting, multiple output formats, ".rel" +output, 8080 mode and older assembler compatibilty were written by George +Phillips. + +This man page written for the SlackBuilds.org project +by B. Watson, and is licensed under the WTFPL. + +SEE ALSO +======== + +**ld80**\(1) + +The zmac homepage: http://48k.ca/zmac.html |