From 666f54dfd6d03151c6558f8f6b92ec98918ec42b Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sat, 18 Jan 2014 09:26:08 +0700 Subject: system/d52: Added (disassembler for 8051/8052, 8041/8048, and Z80). Signed-off-by: Willy Sudiarto Raharjo --- system/d52/20-fix-format-security-error.patch | 12 ++ system/d52/README | 5 + system/d52/d52.1 | 239 ++++++++++++++++++++++++++ system/d52/d52.SlackBuild | 88 ++++++++++ system/d52/d52.info | 10 ++ system/d52/d52.pod | 143 +++++++++++++++ system/d52/slack-desc | 19 ++ system/d52/tests/test.asm | 60 +++++++ system/d52/tests/test.ctl | 125 ++++++++++++++ system/d52/tests/test.d52 | 102 +++++++++++ system/d52/tests/test.hex | 4 + 11 files changed, 807 insertions(+) create mode 100644 system/d52/20-fix-format-security-error.patch create mode 100644 system/d52/README create mode 100644 system/d52/d52.1 create mode 100644 system/d52/d52.SlackBuild create mode 100644 system/d52/d52.info create mode 100644 system/d52/d52.pod create mode 100644 system/d52/slack-desc create mode 100644 system/d52/tests/test.asm create mode 100644 system/d52/tests/test.ctl create mode 100644 system/d52/tests/test.d52 create mode 100644 system/d52/tests/test.hex (limited to 'system') diff --git a/system/d52/20-fix-format-security-error.patch b/system/d52/20-fix-format-security-error.patch new file mode 100644 index 0000000000..c7ed896ade --- /dev/null +++ b/system/d52/20-fix-format-security-error.patch @@ -0,0 +1,12 @@ +diff -Nur -x '*.orig' -x '*~' d52-3.4.1/d52pass2.c d52-3.4.1.new/d52pass2.c +--- d52-3.4.1/d52pass2.c 2007-09-02 15:31:16.000000000 +0000 ++++ d52-3.4.1.new/d52pass2.c 2011-11-08 02:22:21.000000000 +0000 +@@ -932,7 +932,7 @@ + } + else if (dir < 0x80) + { +- kcnt += fprintf(fp, rbname[dir].dent); ++ kcnt += fprintf(fp, "%s",rbname[dir].dent); + dirregs[dir] |= 1; + } + else diff --git a/system/d52/README b/system/d52/README new file mode 100644 index 0000000000..a609a2d832 --- /dev/null +++ b/system/d52/README @@ -0,0 +1,5 @@ +d52 (disassembler for 8051/8052, 8041/8048, and Z80 object code) + +d52 is a 8051/8052 command line disassembler for Linux and Windows with +C source code that is distributed under GNU General Public License. Also +included are d48 and dz80. diff --git a/system/d52/d52.1 b/system/d52/d52.1 new file mode 100644 index 0000000000..257dd3e6c0 --- /dev/null +++ b/system/d52/d52.1 @@ -0,0 +1,239 @@ +.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +. ds C` +. ds C' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.\" +.\" Avoid warning from groff about undefined register 'F'. +.de IX +.. +.nr rF 0 +.if \n(.g .if rF .nr rF 1 +.if (\n(rF:(\n(.g==0)) \{ +. if \nF \{ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. if !\nF==2 \{ +. nr % 0 +. nr F 2 +. \} +. \} +.\} +.rr rF +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "D52 1" +.TH D52 1 "2014-01-17" "3.3.6" "SlackBuilds.org" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +d52 \- disassembler for Intel 8052/8051/8031/etc +.PP +d48 \- disassembler for Intel 8048 and 8041 +.PP +dz80 \- disassembler for Zilog Z80, Intel 8080 and 8085 +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +d52 \fIoptions\fR \fBfilename\fR +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +Full documentation may be found in \fI/usr/doc/d52\-3.4.1/d52manual.html\fR +and \fI/usr/doc/d52\-3.4.1/dz80\-d48addendum.html\fR. +.SH "OPTIONS" +.IX Header "OPTIONS" +Options may be entered Unix style (\-d) or \s-1DOS\s0 style (/b). +.PP +Options may be entered in a freeform fashion as long as a dash (\-) or +a slash (/) precedes any option that precedes the filename. +Examples: +.PP +.Vb 3 +\& d52 filename bd +\& d52 \-d filename x100 +\& d52 /h filename d \-x100 +.Ve +.SS "Common Options" +.IX Subsection "Common Options" +These options are supported by d52, d48, and dz80. +.IP "\fB\-b\fR" 4 +.IX Item "-b" +disassemble file with .bin extension. +.IP "\fB\-h\fR" 4 +.IX Item "-h" +disassemble file with .hex extension. If neither 'b' nor 'h' is specified, first search for a .hex file, and if not found, then a .bin file +.IP "\fB\-a\fR" 4 +.IX Item "-a" +use ascii macro instead of db/defb for text. +.IP "\fB\-d\fR" 4 +.IX Item "-d" +include address and data in the comment field. +.IP "\fB\-n\fR" 4 +.IX Item "-n" +use C style for hexadecimal operands +.IP "\fB\-p\fR" 4 +.IX Item "-p" +put dot '.' at beginning of pseudo ops +.IP "\fB\-s\fR" 4 +.IX Item "-s" +use 'defb' and 'defw' instead of 'db' and 'dw' for binary data. +.IP "\fB\-u\fR" 4 +.IX Item "-u" +output labels, symbols, and mnemonics in upper case. +.SS "D52 Options" +.IX Subsection "D52 Options" +.IP "\fB\-i\fR" 4 +.IX Item "-i" +put statement in output file to include 'sfr52.inc'. +.IP "\fB\-k\fR" 4 +.IX Item "-k" +disassemble for Keil A51 (obsolete). +.IP "\fB\-x\fR" 4 +.IX Item "-x" +add a hexadecimal offset to file addresses. +.IP "\fB\-z[filename]\fR" 4 +.IX Item "-z[filename]" +read cycle count file. Cycle count files are installed to /usr/share/d52/ in this build. +See /usr/doc/d52\-3.4.1/cycle_counting.htm for more information. +.IP "\fB\-t\fR" 4 +.IX Item "-t" +trace and analyze code before disassembly. will overwrite any existing ctl file for the file being disassembled. +.SS "D48 Options" +.IX Subsection "D48 Options" +.IP "\fB\-1\fR" 4 +.IX Item "-1" +disassemble 8041 code (note, this is the numeral one, not the lowercase letter L). +.SS "\s-1DZ80\s0 Options" +.IX Subsection "DZ80 Options" +.IP "\fB\-c\fR" 4 +.IX Item "-c" +disassemble \s-1CP/M \s0.com file (implies \-x100). +.IP "\fB\-t\fR" 4 +.IX Item "-t" +trace and analyze code before disassembly. will overwrite any existing ctl file for the file being disassembled. +.IP "\fB\-x\fR" 4 +.IX Item "-x" +add a hexadecimal offset to file addresses. +.IP "\fB\-80\fR" 4 +.IX Item "-80" +generate 8080 mnemonics. +.IP "\fB\-85\fR" 4 +.IX Item "-85" +generate 8085 mnemonics. +.SH "AUTHOR" +.IX Header "AUTHOR" +d52, d48, and dz80 are copyright (C) 1995\-2007 by J. L. Post. +.PP +This man page was written by B. Watson for the SlackBuilds.org project. It +may be used by anyone. diff --git a/system/d52/d52.SlackBuild b/system/d52/d52.SlackBuild new file mode 100644 index 0000000000..19747701bd --- /dev/null +++ b/system/d52/d52.SlackBuild @@ -0,0 +1,88 @@ +#!/bin/sh + +# Slackware build script for d52 + +# Written by B. Watson (yalhcru@gmail.com) + +# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. + +PRGNAM=d52 +VERSION=${VERSION:-3.4.1} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i486 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -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 + +ZIPVER=${VERSION//./} +BINS="dz80 d48 $PRGNAM" + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION.orig +tar xvf $CWD/${PRGNAM}_$VERSION.orig.tar.gz +cd $PRGNAM-$VERSION.orig +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +# Patch from Debian, fix minor security flaw +patch -p1 < $CWD/20-fix-format-security-error.patch + +make CFLAGS="$SLKCFLAGS" +mkdir -p $PKG/usr/bin +install -s -m0755 $BINS $PKG/usr/bin + +# just keep the HTML doc +rm cyclefiles/cycle_counting.doc cyclefiles/cycle_counting.rtf + +mkdir -p $PKG/usr/share/$PRGNAM +cp -a cyclefiles/* $PKG/usr/share/$PRGNAM + +# man page written for this build +mkdir -p $PKG/usr/man/man1 +gzip -9c < $CWD/$PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz +ln -s $PRGNAM.1.gz $PKG/usr/man/man1/d48.1.gz +ln -s $PRGNAM.1.gz $PKG/usr/man/man1/dz80.1.gz + +# tests/* came from an older release of d52. Still useful IMO. +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a $CWD/tests/* COPYING README *.html $PKG/usr/doc/$PRGNAM-$VERSION +mv $PKG/usr/share/$PRGNAM/*.htm $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$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:-tgz} diff --git a/system/d52/d52.info b/system/d52/d52.info new file mode 100644 index 0000000000..fc92cfb8c9 --- /dev/null +++ b/system/d52/d52.info @@ -0,0 +1,10 @@ +PRGNAM="d52" +VERSION="3.4.1" +HOMEPAGE="http://packages.debian.org/sid/d52" +DOWNLOAD="http://ftp.debian.org/debian/pool/main/d/d52/d52_3.4.1.orig.tar.gz" +MD5SUM="0d6fefeb3f30922d1c5046569f2ad665" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="B. Watson" +EMAIL="yalhcru@gmail.com" diff --git a/system/d52/d52.pod b/system/d52/d52.pod new file mode 100644 index 0000000000..8f2502ebc6 --- /dev/null +++ b/system/d52/d52.pod @@ -0,0 +1,143 @@ +# pod source for d52 man page +# pod2man -s1 -r3.4.1 --stderr -nD52 -cSlackBuilds.org < d52.pod > d52.1 + +=pod + +=head1 NAME + +d52 - disassembler for Intel 8052/8051/8031/etc + +d48 - disassembler for Intel 8048 and 8041 + +dz80 - disassembler for Zilog Z80, Intel 8080 and 8085 + +=head1 SYNOPSIS + +d52 I B + +=head1 DESCRIPTION + +Full documentation may be found in I +and I. + +=head1 OPTIONS + +Options may be entered Unix style (-d) or DOS style (/b). + +Options may be entered in a freeform fashion as long as a dash (-) or +a slash (/) precedes any option that precedes the filename. +Examples: + + d52 filename bd + d52 -d filename x100 + d52 /h filename d -x100 + +=head2 Common Options + +These options are supported by d52, d48, and dz80. + +=over + +=item B<-b> + +disassemble file with .bin extension. + +=item B<-h> + +disassemble file with .hex extension. If neither 'b' nor 'h' is specified, first search for a .hex file, and if not found, then a .bin file + +=item B<-a> + +use ascii macro instead of db/defb for text. + +=item B<-d> + +include address and data in the comment field. + +=item B<-n> + +use C style for hexadecimal operands + +=item B<-p> + +put dot '.' at beginning of pseudo ops + +=item B<-s> + +use 'defb' and 'defw' instead of 'db' and 'dw' for binary data. + +=item B<-u> + +output labels, symbols, and mnemonics in upper case. + +=back + +=head2 D52 Options + +=over + +=item B<-i> + +put statement in output file to include 'sfr52.inc'. + +=item B<-k> + +disassemble for Keil A51 (obsolete). + +=item B<-x> + +add a hexadecimal offset to file addresses. + +=item B<-z[filename]> + +read cycle count file. Cycle count files are installed to /usr/share/d52/ in this build. +See /usr/doc/d52-3.4.1/cycle_counting.htm for more information. + +=item B<-t> + +trace and analyze code before disassembly. will overwrite any existing ctl file for the file being disassembled. + +=back + +=head2 D48 Options + +=over + +=item B<-1> + +disassemble 8041 code (note, this is the numeral one, not the lowercase letter L). + +=back + +=head2 DZ80 Options + +=over + +=item B<-c> + +disassemble CP/M .com file (implies -x100). + +=item B<-t> + +trace and analyze code before disassembly. will overwrite any existing ctl file for the file being disassembled. + +=item B<-x> + +add a hexadecimal offset to file addresses. + +=item B<-80> + +generate 8080 mnemonics. + +=item B<-85> + +generate 8085 mnemonics. + +=back + +=head1 AUTHOR + +d52, d48, and dz80 are copyright (C) 1995-2007 by J. L. Post. + +This man page was written by B. Watson for the SlackBuilds.org project. It +may be used by anyone. diff --git a/system/d52/slack-desc b/system/d52/slack-desc new file mode 100644 index 0000000000..70305205ab --- /dev/null +++ b/system/d52/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------------------------------------------------------| +d52: d52 (disassembler for 8051/8052, 8041/8048, and Z80 object code) +d52: +d52: d52 is a 8051/8052 command line disassembler for Linux and Windows +d52: with C source code that is distributed under GNU General Public +d52: License. Also included are d48 and dz80. +d52: +d52: +d52: +d52: +d52: +d52: diff --git a/system/d52/tests/test.asm b/system/d52/tests/test.asm new file mode 100644 index 0000000000..7313e33c0f --- /dev/null +++ b/system/d52/tests/test.asm @@ -0,0 +1,60 @@ +; +; Test file for D52. +; This, with the associated test.ctl file, demonstrates the +; use of control file directives. +; +accum equ 0e0h +; + org 0 +; +start: nop + ajmp main + ljmp subrt +; +main: rr a + inc accum + inc 12h + inc @r0 + inc @r1 + inc r0 + jbc acc.3,label + acall subrt + lcall subrt +label: rrc a + dec a + dec 10h + dec @r0 + dec @r1 + dec r0 + cjne a,#12h,label + mov dptr,#vectbl + jmp @a+dptr +; +subrt: nop + nop + nop + nop + nop + ret +; +vectbl: dw subrt + dw 0 +; +mesg: db 'This is text',0 +; +bindat: db 0,1,2,3 +wordat: dw 10h,20h,30h +; +; random junk to fake out the disassembler +; + db 80h,29h,44h,33h +; +; valid code: +; +delay: mov r0,#5 +delay1: clr 20h + djnz r0,delay1 + ret +; + end +; diff --git a/system/d52/tests/test.ctl b/system/d52/tests/test.ctl new file mode 100644 index 0000000000..1a6731b362 --- /dev/null +++ b/system/d52/tests/test.ctl @@ -0,0 +1,125 @@ +; +; TEST.CTL - Sample Control File for D52 +; +; Control codes allowed in the CTL file: +; +; A - Address Specifies that the word entry is the address of +; something for which a label should be generated. +; +; B - Byte binary Eight bit binary data (db). +; +; C - Code Executable code that must be analyzed. +; +; F - SFR label Specify name for SFR. +; +; I - Ignore Treat as uninitialized space. Will not be dis- +; assembled as anything unless some other valid +; code reaches it. +; +; K - SFR bit Specify name for SFR bit. +; +; L - Label Generate a label for this address. +; +; M - Memory Generate a label for bit addressable memory. +; +; P - Patch Add inline code (macro, for example) +; +; R - Register Specify name for register +; (instead of rb2r5 for example). +; +; S - Symbol Generate a symbol for this value. +; +; T - Text ASCII text (db). +; +; W - Word binary Sixteen bit binary data (dw). +; +; X - Operand name Specify special name for operand. +; +; # - Comment Add header comment to output file. +; +; ! - Inline comment Add comment to end of line. +; +; example labels: +; +l 0000 start +l 0006 main +l 0016 loop +l 0024 subrtn +l 002a vectbl +l 002e message +; +; example symbol: +; +s 12 counter +; +; example ascii text: +; +t 002e-003a +; +; example register names: +; +r 10 reg0 +r 12 reg2 +; +; example SFR name: +; +f e0 accum +; +; example SFR bit name: +; +k e3 abit3 +; +; example memory bit name: +; +m 20 membit +; +; example operand name: +; +x 004a five +; +; example header comments: +; +# 0024 This is a subroutine.\n +# 002e 't' directive for ascii text\n +# 003b \nData - 'b' and 'w' directives\n +# 003f +; +; example inline comments: +; +! 0007 note sfr bit def only affects indirect addressing +! 001d do the loop +! 0024 do nothing routine +! 0025 these nops would not be disassembled +! 0026 without the 'c' directive +! 003b binary data +! 003f word data +# 0049 would get junk from 45h to 48h if not for the 'i' directive\n +! 0049 example of operand name 'x' directive +! 004b 'm' bit addressable memory directive +; +; example address table: +; +a 002a-002d +; +; example force disassembly of code (nops): +; +c 0025-0029 +; +; example code to ignore: +; +i 0045-0048 +; +; example binary data: +; +b 003b-003e +; +; example word data: +; +w 003f-0044 +; +; example patch code: +; +p 0003 include "myfile.inc"\n; +; +; end of control file +; diff --git a/system/d52/tests/test.d52 b/system/d52/tests/test.d52 new file mode 100644 index 0000000000..3809b2be2b --- /dev/null +++ b/system/d52/tests/test.d52 @@ -0,0 +1,102 @@ +; +; D52 V3.3.6 8052 Disassembly of test.hex +; 01/23/05 12:15 +; + org 0 +; +start: nop ; 0000 00 . + ajmp main ; 0001 01 06 .. +; + include "myfile.inc" +; + ljmp subrtn ; 0003 02 00 24 ..$ +; +main: rr a ; 0006 03 . + inc accum ; 0007 05 e0 .` ; note sfr bit def only affects indirect addressing + inc reg2 ; 0009 05 12 .. + inc @r0 ; 000b 06 . + inc @r1 ; 000c 07 . + inc r0 ; 000d 08 . + jbc abit3,loop ; 000e 10 e3 05 .c. + acall subrtn ; 0011 11 24 .$ + lcall subrtn ; 0013 12 00 24 ..$ +loop: rrc a ; 0016 13 . + dec a ; 0017 14 . + dec reg0 ; 0018 15 10 .. + dec @r0 ; 001a 16 . + dec @r1 ; 001b 17 . + dec r0 ; 001c 18 . + cjne a,#counter,loop ; 001d b4 12 f6 4.v ; do the loop + mov dptr,#vectbl ; 0020 90 00 2a ..* + jmp @a+dptr ; 0023 73 s +; +; This is a subroutine. +; +subrtn: nop ; 0024 00 . ; do nothing routine + nop ; 0025 00 . ; these nops would not be disassembled + nop ; 0026 00 . ; without the 'c' directive + nop ; 0027 00 . + nop ; 0028 00 . + ret ; 0029 22 " +; +vectbl: dw subrtn ; 002a 00 24 .$ + dw start ; 002c 00 00 .. +; +; 't' directive for ascii text +; +message: db 'This is text' ; 002e + db 0 ; 003a . +; +; Data - 'b' and 'w' directives +; + db 0 ; 003b . ; binary data + db 1,2,3 ; 003c ... +; + dw 10h ; 003f 00 10 .. ; word data + dw 20h ; 0041 00 20 . + dw 30h ; 0043 00 30 .0 +; +; +; would get junk from 45h to 48h if not for the 'i' directive +; + org 49h +; + mov r0,#five ; 0049 78 05 x. ; example of operand name 'x' directive +X004b: clr membit ; 004b c2 20 B ; 'm' bit addressable memory directive + djnz r0,X004b ; 004d d8 fc X| + ret ; 004f 22 " +; +; Register/Memory Equates +; +reg0 equ 10h +reg2 equ 12h +; +; SFR Equates +; +accum equ 0e0h +; +; SFR bit Equates +; +abit3 equ 0e3h +; +; Memory bit Equates +; +membit equ 20h +; +; Symbol equates +; +; These are symbols from the control +; file that are referenced in the code +; +counter equ 12h +; +; Operand symbol equates +; +; These are operand symbols from the control +; file that are referenced in the code +; +five equ 5 +; + end +; + diff --git a/system/d52/tests/test.hex b/system/d52/tests/test.hex new file mode 100644 index 0000000000..ade6d93051 --- /dev/null +++ b/system/d52/tests/test.hex @@ -0,0 +1,4 @@ +:200000000001060200240305E0051206070810E305112412002413141510161718B412F6EF +:2000200090002A7300000000002200240000546869732069732074657874000001020300CE +:100040001000200030802944337805C220D8FC22DB +:00005001AF -- cgit v1.2.3