Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!inria!litp!pda From: pda@litp.ibp.fr (Pierre DAVID) Newsgroups: comp.sys.handhelds Subject: Saturn Assembler (Part 8/8) Message-ID: <3309@litp.ibp.fr> Date: 5 Jul 90 16:26:50 GMT Reply-To: pda@litp.ibp.fr.UUCP (Pierre DAVID) Organization: M.A.S.I., Universite P. & M. Curie, Paris, FRANCE Lines: 1191 #---------------------------------- cut here ---------------------------------- # This is a shell archive. Remove anything before this line, # then unpack it by saving it in a file and typing "sh file". # # Wrapped by Pierre David on Sun Jul 1 12:33:08 1990 # # This archive contains: # areuh/assembler/mdep.c areuh/assembler/tabgrp.c # areuh/assembler/tabopc.c areuh/assembler/Makefile # areuh/assembler/aas.1 areuh/README # # Error checking via wc(1) will be performed. LANG=""; export LANG PATH=/bin:/usr/bin:$PATH; export PATH echo x - areuh/assembler/mdep.c cat >areuh/assembler/mdep.c <<'@EOF' /* * Authors : * Pierre DAVID (pda@masi.ibp.fr or pda@frunip62.bitnet) * Janick TAILLANDIER * * This program can be freely used or distributed as long as this * note is kept. * * This program is provided "as is". */ /****************************************************************************** M A C H I N E D E P E N D E N C I E S ******************************************************************************/ #include "flag.h" #if ASSEMBLER #include "aglobal.h" #else #include "lglobal.h" #endif extern struct symbol *add_label() ; #if HPUX void format_time (str) uchar *str ; { long int l ; extern long int time () ; extern char *ctime () ; l = time (0L) ; strcpy (str, ctime (&l)) ; str [strlen (str) - 1] = EOL ; } char *tab[] = { "", "/usr/lib/", "/usr/local/lib/", "/lib/", "/hp71/lib/", "/local/lib/", 0 } ; void load_file (file) uchar *file ; { int i = 0 ; uchar name [MAXLEN+1] ; saddr val ; FILE *fp ; fp = (FILE *) NULL ; while ((tab[i])&&(!fp)) { sprintf (name, "%s%s", tab[i++], file) ; fp = fopen (name, "r") ; } if (!fp) error (ERROPN, file) ; #if LINKER file = 0 ; #endif while (fscanf (fp, "%s\n%X\n", name, &val) != EOF) { #if ASSEMBLER add_label (name, val, "", LABS, 1) ; #else add_label (name, val, 1) ; #endif } if (ferror (fp)) error (ERRWRT, file) ; if (fclose (fp)) error (ERRCLO, file) ; } #include #include /* look for object file (object code or listing file) * if non existent, ok * if exists and not directory, ok * if exists and directory, then append "/" */ look_obj (fname, dfl) uchar *fname, *dfl ; { struct stat buf ; if (*fname == EOL) /* if fname == "" then default it */ strcpy (fname, dfl) ; if (!stat (fname, &buf)) /* file exists. Is it a directory ? */ { if ((buf.st_mode & S_IFMT) == S_IFDIR) sprintf (fname, "%s/%s", fname, dfl) ; } } /* build a default file name, based on "source" basename and a given * default extension. */ dfl_extension (object, source, extension) uchar *object, *source, *extension ; { uchar *pname ; strcpy (object, source) ; pname = object ; while ((*pname)&&(*pname!='.')) pname++ ; if (*pname==EOL) *pname = '.' ; strcpy (pname+1, extension) ; } #endif /* HPUX */ #if ATARI_LATTICE char skipvar ; void format_time (str) uchar *str ; { strcpy (str, "Areuh Tagada Bouzouh bouzouh areuh areuh... et toc !") ; } char *optarg ; int optind = 0, opterr = 0 ; int getopt (argc, argv, optstr) int argc ; char *argv[], *optstr ; { char *o, car ; static char *index = 0 ; extern char *strchr () ; if ((index==(char *)0)||(*(index+1)==0)) { if (++optind>argc-1) return (EOF) ; index = argv[optind] ; if (*index!='-') return (EOF) ; } car = *(++index) ; /* state 6 */ if (!(o = strchr (optstr, car))) return ('?') ; if (*(o+1)!=':') return ((int) car) ; if (*(index+1)) optarg = index+1 ; else { if (++optind>argc-1) return (EOF) ; else optarg = argv[optind] ; } index = (char *) 0 ; return ((int) car) ; } uchar *tab[] = { "", "A:", "A:\\TABLE\\", 0 } ; void load_file (file) uchar *file ; { int i = 0 ; uchar name [MAXLEN+1] ; saddr val ; FILE *fp ; fp = (FILE *) NULL ; while ((tab[i])&&(!fp)) { sprintf (name, "%s%s", tab[i++], file) ; fp = fopen (name, "r") ; } if (!fp) error (ERROPN, file) ; #if LINKER file = 0 ; #endif while (fscanf (fp, "%s\n%x\n", name, &val) != EOF) { #if ASSEMBLER add_label (name, val, "", LABS, 1) ; #else add_label (name, val, 1) ; #endif } if (fclose (fp)) error (ERRCLO, file) ; } #endif /* ATARI_LATTICE */ #if PC_MSC char skipvar ; void format_time (str) uchar *str ; { long int l ; extern long int time () ; extern char *ctime () ; time (&l) ; strcpy (str, ctime (&l)) ; str [strlen (str) - 1] = EOL ; } char *optarg ; int optind = 0, opterr = 0 ; int getopt (argc, argv, optstr) int argc ; char *argv[], *optstr ; { char *o, car ; static char *index = 0 ; extern char *strchr () ; if ((index==(char *)0)||(*(index+1)==0)) { if (++optind>argc-1) return (EOF) ; index = argv[optind] ; if (*index!='-') return (EOF) ; } car = *(++index) ; /* state 6 */ if (!(o = strchr (optstr, car))) return ('?') ; if (*(o+1)!=':') return ((int) car) ; if (*(index+1)) optarg = index+1 ; else { if (++optind>argc-1) return (EOF) ; else optarg = argv[optind] ; } index = (char *) 0 ; return ((int) car) ; } uchar *tab[] = { "", "c:", "c:\\hp71\\", "c:\\lib\\hp71\\", "c:\\lib\\", "c:\\areuh\\lib\\", 0 } ; void load_file (file) uchar *file ; { int i = 0 ; uchar name [MAXLEN+1] ; saddr val ; FILE *fp ; fp = (FILE *) NULL ; while ((tab[i])&&(!fp)) { sprintf (name, "%s%s", tab[i++], file) ; fp = fopen (name, "r") ; } if (!fp) error (ERROPN, file) ; #if LINKER file = 0 ; #endif while (fscanf (fp, "%s\n%X\n", name, &val) != EOF) { #if ASSEMBLER add_label (name, val, "", LABS, 1) ; #else add_label (name, val, 1) ; #endif } if (fclose (fp)) error (ERRCLO, file) ; } #include #include /* look for object file (object code or listing file) * if non existent, ok * if exists and not directory, ok * if exists and directory, then append "/" */ look_obj (fname, dfl) uchar *fname, *dfl ; { struct stat buf ; if (*fname == EOL) /* if fname == "" then default it */ strcpy (fname, dfl) ; if (!stat (fname, &buf)) /* file exists. Is it a directory ? */ { if ((buf.st_mode & S_IFMT) == S_IFDIR) sprintf (fname, "%s\\%s", fname, dfl) ; } } /* build a default file name, based on "source" basename and a given * default extension. */ dfl_extension (object, source, extension) uchar *object, *source, *extension ; { uchar *pname ; strcpy (object, source) ; pname = object ; while ((*pname)&&(*pname!='.')) pname++ ; if (*pname==EOL) *pname = '.' ; strcpy (pname+1, extension) ; } #endif /* PC_MSC */ @EOF set `wc -lwc areuh/assembler/tabgrp.c <<'@EOF' /* * Authors : * Pierre DAVID (pda@masi.ibp.fr or pda@frunip62.bitnet) * Janick TAILLANDIER * * This program can be freely used or distributed as long as this * note is kept. * * This program is provided "as is". */ #include "aglobal.h" int h_opcode [] = { /* 00 */ 0, /* 01 */ 9, /* 02 */ 24, /* 03 */ 33, /* 04 */ 40, /* 05 */ 53, /* 06 */ 64, /* 07 */ 72, /* 08 */ 79, /* 09 */ 93, /* 10 */ 100, /* 11 */ 107, /* 12 */ 114, /* 13 */ 125, /* 14 */ 134, /* 15 */ 140, /* 16 */ 152, /* 17 */ 162, /* 18 */ 168, /* 19 */ 174, /* 20 */ 180, /* 21 */ 185, /* 22 */ 191, /* 23 */ 200, /* 24 */ 207, /* 25 */ 212, /* 26 */ 224, /* 27 */ 230, /* 28 */ 239, /* 29 */ 244, /* 30 */ 250, /* 31 */ 257, /* 32 */ 267, /* 33 */ 275, /* 34 */ 287, /* 35 */ 295, /* 36 */ 305, /* 37 */ 312, /* 38 */ 318, /* 39 */ 328, /* 40 */ 337, /* 41 */ 342, /* 42 */ 351, /* 43 */ 356, } ; @EOF set `wc -lwc areuh/assembler/tabopc.c <<'@EOF' /* * Authors : * Pierre DAVID (pda@masi.ibp.fr or pda@frunip62.bitnet) * Janick TAILLANDIER * * This program can be freely used or distributed as long as this * note is kept. * * This program is provided "as is". */ #include "aglobal.h" struct mnemo_desc mnemo_table [] = { /* 000 */ {1, "?A>B", 3, 3, "800", 2, 0}, /* 001 */ {5, "CR1EX", 5, 3, "129", 0, 0}, /* 002 */ {5, "AR0EX", 5, 3, "120", 0, 0}, /* 003 */ {10, "P=C", 33, 4, "80D0", 0, 0}, /* 004 */ {5, "SETDEC", 5, 2, "05", 0, 0}, /* 005 */ {3, "C=C!B", 1, 4, "0E0D", 0, 0}, /* 006 */ {5, "CSLC", 1, 3, "812", 0, 0}, /* 007 */ {5, "D1=CS", 5, 3, "13D", 0, 0}, /* 008 */ {40, "ENDIF", 0, 0, "", 0, 0}, /* 009 */ {4, "GOYES", 41, 2, "00", 1, 2}, /* 010 */ {4, "GOSBVL", 53, 7, "8F000", 3, 5}, /* 011 */ {13, "DAT0=A", 32, 4, "1500", 0, 0}, /* 012 */ {4, "GONC", 33, 3, "500", 2, 2}, /* 013 */ {22, "EQU", 36, 0, "", 0, 0}, /* 014 */ {1, "?C>A", 3, 3, "802", 2, 0}, /* 015 */ {1, "?A>=C", 3, 3, "80E", 2, 0}, /* 016 */ {1, "?B#C", 7, 3, "805", 1, 0}, /* 017 */ {1, "?A<=B", 7, 3, "80C", 2, 0}, /* 018 */ {2, "B=B+B", 4, 3, "005", 1, 0}, /* 019 */ {5, "RTNC", 5, 3, "400", 0, 0}, /* 020 */ {33, "CHAR", 32, 1, "0", 0, 0}, /* 021 */ {5, "D1=AS", 5, 3, "138", 0, 0}, /* 022 */ {5, "NOP4", 5, 4, "6300", 0, 0}, /* 023 */ {5, "RTI", 1, 2, "0F", 0, 0}, /* 024 */ {2, "A=C", 4, 3, "00A", 2, 0}, /* 025 */ {7, "RTNYES", 13, 2, "00", 0, 0}, /* 026 */ {2, "A=A-B", 0, 3, "000", 3, 0}, /* 027 */ {1, "?B#A", 7, 3, "804", 1, 0}, /* 028 */ {5, "RTNNC", 1, 3, "500", 0, 0}, /* 029 */ {2, "C=D", 0, 3, "00B", 2, 0}, /* 030 */ {5, "DSLC", 5, 3, "813", 0, 0}, /* 031 */ {8, "?P#", 39, 3, "880", 0, 0}, /* 032 */ {6, "?MP=0", 3, 3, "838", 0, 0}, /* 033 */ {13, "DAT0=C", 32, 4, "1540", 0, 0}, /* 034 */ {2, "A=A+B", 0, 3, "000", 1, 0}, /* 035 */ {2, "C=D+C", 4, 3, "00B", 1, 0}, /* 036 */ {1, "?D#0", 7, 3, "80F", 1, 0}, /* 037 */ {29, "ID", 36, 16, "", 0, 0}, /* 038 */ {27, "WORDI", 32, 0, "", 0, 0}, /* 039 */ {4, "LC(6)", 177, 8, "35000", 3, 6}, /* 040 */ {2, "B=C", 4, 3, "005", 2, 0}, /* 041 */ {5, "R0=C", 5, 3, "108", 0, 0}, /* 042 */ {5, "CR0EX", 1, 3, "128", 0, 0}, /* 043 */ {1, "?A=B", 7, 3, "800", 1, 0}, /* 044 */ {2, "ABEX", 4, 3, "00C", 2, 0}, /* 045 */ {1, "?B<=A", 3, 3, "808", 2, 0}, /* 046 */ {2, "D=D-C", 4, 3, "003", 3, 0}, /* 047 */ {3, "C=D!C", 1, 4, "0E0F", 0, 0}, /* 048 */ {3, "A=A!B", 5, 4, "0E08", 0, 0}, /* 049 */ {5, "ASRC", 1, 3, "814", 0, 0}, /* 050 */ {4, "LC(4)", 177, 6, "33000", 3, 4}, /* 051 */ {5, "C=ST", 5, 2, "09", 0, 0}, /* 052 */ {5, "A=R4", 1, 3, "114", 0, 0}, /* 053 */ {1, "?C=A", 3, 3, "802", 1, 0}, /* 054 */ {1, "?A=0", 7, 3, "808", 1, 0}, /* 055 */ {5, "R0=A", 1, 3, "100", 0, 0}, /* 056 */ {2, "B=A+B", 0, 3, "008", 1, 0}, /* 057 */ {4, "LC(2)", 177, 4, "3100", 3, 2}, /* 058 */ {5, "A=R2", 5, 3, "112", 0, 0}, /* 059 */ {23, "LIST", 5, 0, "", 0, 0}, /* 060 */ {2, "D=D+C", 4, 3, "003", 1, 0}, /* 061 */ {4, "D0=(2)", 177, 4, "1900", 3, 2}, /* 062 */ {5, "R4=C", 5, 3, "10C", 0, 0}, /* 063 */ {5, "BUSCC", 5, 3, "80B", 0, 0}, /* 064 */ {5, "A=R0", 1, 3, "110", 0, 0}, /* 065 */ {2, "A=B", 4, 3, "004", 2, 0}, /* 066 */ {4, "CON(4)", 49, 4, "0000", 1, 4}, /* 067 */ {3, "B=A!B", 1, 4, "0E0C", 0, 0}, /* 068 */ {5, "RTNSXM", 5, 2, "00", 0, 0}, /* 069 */ {3, "D=D!C", 5, 4, "0E0B", 0, 0}, /* 070 */ {5, "BSRC", 5, 3, "815", 0, 0}, /* 071 */ {5, "R4=A", 1, 3, "104", 0, 0}, /* 072 */ {4, "GOTO", 33, 4, "6000", 2, 3}, /* 073 */ {1, "?C>=A", 7, 3, "80A", 2, 0}, /* 074 */ {2, "C=C+C", 4, 3, "006", 1, 0}, /* 075 */ {9, "?ST=0", 35, 3, "860", 0, 0}, /* 076 */ {3, "A=C&A", 5, 4, "0E06", 0, 0}, /* 077 */ {5, "ST=C", 5, 2, "0A", 0, 0}, /* 078 */ {5, "A=IN", 1, 3, "802", 0, 0}, /* 079 */ {13, "A=DAT0", 36, 4, "1520", 0, 0}, /* 080 */ {5, "D0=C", 5, 3, "134", 0, 0}, /* 081 */ {12, "D1=D1+", 33, 3, "170", 0, 0}, /* 082 */ {5, "CSRC", 1, 3, "816", 0, 0}, /* 083 */ {1, "?AC", 7, 3, "803", 2, 0}, /* 112 */ {35, "TOKEN", 36, 2, "00", 0, 0}, /* 113 */ {5, "C=IN", 1, 3, "803", 0, 0}, /* 114 */ {13, "C=DAT0", 32, 4, "1560", 0, 0}, /* 115 */ {14, "NIBHEX", 4, 0, "", 1, 14}, /* 116 */ {10, "P=", 33, 2, "20", 0, 0}, /* 117 */ {2, "B=A", 0, 3, "008", 2, 0}, /* 118 */ {1, "?A#B", 7, 3, "804", 1, 0}, /* 119 */ {1, "?B>=C", 3, 3, "809", 2, 0}, /* 120 */ {3, "A=A!C", 5, 4, "0E0E", 0, 0}, /* 121 */ {3, "C=B!C", 5, 4, "0E0D", 0, 0}, /* 122 */ {5, "C=ID", 1, 3, "806", 0, 0}, /* 123 */ {5, "RESET", 5, 3, "80A", 0, 0}, /* 124 */ {41, "ABS", 0, 0, "", 0, 0}, /* 125 */ {13, "C=DAT1", 36, 4, "1570", 0, 0}, /* 126 */ {1, "?C#A", 3, 3, "806", 1, 0}, /* 127 */ {1, "?A#0", 7, 3, "80C", 1, 0}, /* 128 */ {2, "D=D+D", 0, 3, "007", 1, 0}, /* 129 */ {3, "B=B&A", 1, 4, "0E04", 0, 0}, /* 130 */ {6, "?XM=0", 3, 3, "831", 0, 0}, /* 131 */ {2, "A=-A-1", 4, 3, "00C", 4, 0}, /* 132 */ {5, "OUT=CS", 5, 3, "800", 0, 0}, /* 133 */ {42, "RDSYMB", 0, 0, "", 0, 0}, /* 134 */ {2, "C=A", 0, 3, "006", 2, 0}, /* 135 */ {2, "A=0", 4, 3, "000", 2, 0}, /* 136 */ {2, "C=A-C", 4, 3, "00E", 3, 0}, /* 137 */ {4, "CON(5)", 53, 5, "00000", 1, 5}, /* 138 */ {34, "KEY", 32, 0, "", 0, 0}, /* 139 */ {2, "C=C-D", 0, 3, "00B", 3, 0}, /* 140 */ {2, "C=A+C", 4, 3, "002", 1, 0}, /* 141 */ {5, "R1=C", 5, 3, "109", 0, 0}, /* 142 */ {2, "ACEX", 0, 3, "00E", 2, 0}, /* 143 */ {1, "?C<=A", 7, 3, "80E", 2, 0}, /* 144 */ {1, "?C>=B", 3, 3, "80D", 2, 0}, /* 145 */ {1, "?D=C", 7, 3, "803", 1, 0}, /* 146 */ {2, "C=C+D", 0, 3, "00B", 1, 0}, /* 147 */ {9, "?ST=1", 35, 3, "870", 0, 0}, /* 148 */ {2, "A=-A", 4, 3, "008", 4, 0}, /* 149 */ {30, "MSG", 32, 4, "0000", 0, 0}, /* 150 */ {6, "?SB=0", 3, 3, "832", 0, 0}, /* 151 */ {6, "?SR=0", 7, 3, "834", 0, 0}, /* 152 */ {5, "R1=A", 5, 3, "101", 0, 0}, /* 153 */ {2, "B=0", 4, 3, "001", 2, 0}, /* 154 */ {9, "?ST#1", 35, 3, "860", 0, 0}, /* 155 */ {1, "?B=0", 7, 3, "809", 1, 0}, /* 156 */ {4, "D1=(2)", 177, 4, "1D00", 3, 2}, /* 157 */ {2, "D=C-D", 4, 3, "00F", 3, 0}, /* 158 */ {3, "C=A!C", 5, 4, "0E0A", 0, 0}, /* 159 */ {2, "C=-C-1", 0, 3, "00E", 4, 0}, /* 160 */ {3, "C=C!D", 1, 4, "0E0F", 0, 0}, /* 161 */ {31, "POLL", 32, 5, "00000", 0, 0}, /* 162 */ {15, "LCHEX", 4, 2, "30", 3, 2}, /* 163 */ {2, "D=C+D", 4, 3, "003", 1, 0}, /* 164 */ {2, "BCEX", 0, 3, "00D", 2, 0}, /* 165 */ {3, "B=C&B", 5, 4, "0E01", 0, 0}, /* 166 */ {4, "REL(2)", 33, 2, "00", 1, 2}, /* 167 */ {21, "END", 0, 0, "", 0, 0}, /* 168 */ {2, "C=0", 4, 3, "002", 2, 0}, /* 169 */ {5, "AD1EX", 5, 3, "133", 0, 0}, /* 170 */ {10, "C=P", 33, 4, "80C0", 0, 0}, /* 171 */ {2, "C=-C", 0, 3, "00A", 4, 0}, /* 172 */ {3, "D=C!D", 5, 4, "0E0B", 0, 0}, /* 173 */ {43, "ELSE", 0, 0, "", 0, 0}, /* 174 */ {4, "GOLONG", 33, 6, "8C000", 3, 4}, /* 175 */ {5, "D1=C", 1, 3, "135", 0, 0}, /* 176 */ {1, "?DC", 7, 3, "806", 2, 0}, /* 186 */ {4, "D0=(4)", 177, 6, "1A000", 3, 4}, /* 187 */ {2, "DCEX", 4, 3, "00F", 2, 0}, /* 188 */ {1, "?C>D", 3, 3, "807", 2, 0}, /* 189 */ {20, "EJECT", 1, 0, "", 0, 0}, /* 190 */ {2, "BSL", 4, 3, "001", 4, 0}, /* 191 */ {13, "DAT1=A", 36, 4, "1510", 0, 0}, /* 192 */ {5, "C=RSTK", 5, 2, "07", 0, 0}, /* 193 */ {5, "CD1EX", 1, 3, "137", 0, 0}, /* 194 */ {5, "AD0EX", 1, 3, "132", 0, 0}, /* 195 */ {1, "?C>B", 7, 3, "805", 2, 0}, /* 196 */ {5, "NOP5", 1, 5, "64000", 0, 0}, /* 197 */ {5, "SHUTDN", 5, 3, "807", 0, 0}, /* 198 */ {4, "CON(6)", 53, 6, "00000", 1, 6}, /* 199 */ {5, "PC=(A)", 1, 4, "808C", 0, 0}, /* 200 */ {1, "?C<=B", 7, 3, "809", 2, 0}, /* 201 */ {3, "A=A&B", 5, 4, "0E00", 0, 0}, /* 202 */ {3, "C=D&C", 5, 4, "0E07", 0, 0}, /* 203 */ {1, "?D#C", 3, 3, "807", 1, 0}, /* 204 */ {2, "CSL", 0, 3, "002", 4, 0}, /* 205 */ {5, "NOP3", 5, 3, "420", 0, 0}, /* 206 */ {5, "AD1XS", 1, 3, "13B", 0, 0}, /* 207 */ {5, "RTN", 5, 2, "01", 0, 0}, /* 208 */ {13, "DAT1=C", 36, 4, "1550", 0, 0}, /* 209 */ {1, "?B#0", 7, 3, "80D", 1, 0}, /* 210 */ {32, "ENTRY", 32, 8, "00000", 0, 0}, /* 211 */ {5, "C+P+1", 1, 3, "809", 0, 0}, /* 212 */ {1, "?A=C", 7, 3, "802", 1, 0}, /* 213 */ {5, "RTNCC", 1, 2, "03", 0, 0}, /* 214 */ {5, "RTNSC", 5, 2, "02", 0, 0}, /* 215 */ {4, "REL(3)", 37, 3, "000", 1, 3}, /* 216 */ {4, "LC(5)", 177, 7, "34000", 3, 5}, /* 217 */ {1, "?C=D", 3, 3, "803", 1, 0}, /* 218 */ {3, "B=A&B", 5, 4, "0E04", 0, 0}, /* 219 */ {3, "D=D&C", 1, 4, "0E03", 0, 0}, /* 220 */ {19, "BSS", 32, 0, "", 0, 0}, /* 221 */ {2, "DSL", 4, 3, "003", 4, 0}, /* 222 */ {4, "CON(1)", 53, 1, "0", 1, 1}, /* 223 */ {44, "IF", 0, 0, "", 0, 0}, /* 224 */ {5, "CD0EX", 1, 3, "136", 0, 0}, /* 225 */ {5, "R2=C", 1, 3, "10A", 0, 0}, /* 226 */ {5, "A=R3", 1, 3, "113", 0, 0}, /* 227 */ {1, "?C=B", 7, 3, "801", 1, 0}, /* 228 */ {5, "ASRB", 5, 3, "81C", 0, 0}, /* 229 */ {4, "LC(3)", 181, 5, "32000", 3, 3}, /* 230 */ {1, "?C=0", 7, 3, "80A", 1, 0}, /* 231 */ {5, "A=R1", 1, 3, "111", 0, 0}, /* 232 */ {5, "R2=A", 5, 3, "102", 0, 0}, /* 233 */ {4, "LC(1)", 177, 3, "300", 3, 1}, /* 234 */ {2, "ASR", 4, 3, "004", 4, 0}, /* 235 */ {5, "AR4EX", 1, 3, "124", 0, 0}, /* 236 */ {5, "CD1XS", 1, 3, "13F", 0, 0}, /* 237 */ {5, "AD0XS", 5, 3, "13A", 0, 0}, /* 238 */ {5, "CLRHST", 5, 3, "82F", 0, 0}, /* 239 */ {4, "GOSUB", 101, 4, "7000", 2, 3}, /* 240 */ {5, "BSRB", 5, 3, "81D", 0, 0}, /* 241 */ {16, "D0=HEX", 0, 4, "1900", 3, 2}, /* 242 */ {38, "CHAIN", 32, 12, "00000", 0, 0}, /* 243 */ {5, "CONFIG", 5, 3, "805", 0, 0}, /* 244 */ {4, "D0=(5)", 177, 7, "1B000", 3, 5}, /* 245 */ {1, "?A=D", 7, 3, "80F", 2, 0}, /* 263 */ {2, "CSR", 0, 3, "006", 4, 0}, /* 264 */ {3, "C=B&C", 5, 4, "0E05", 0, 0}, /* 265 */ {5, "CR4EX", 5, 3, "12C", 0, 0}, /* 266 */ {5, "CD0XS", 1, 3, "13E", 0, 0}, /* 267 */ {4, "GOSUBL", 97, 6, "8E000", 3, 4}, /* 268 */ {12, "D0=D0+", 33, 3, "160", 0, 0}, /* 269 */ {2, "D=D+1", 0, 3, "007", 3, 0}, /* 270 */ {4, "D1=(4)", 181, 6, "1E000", 3, 4}, /* 271 */ {1, "?B>C", 7, 3, "801", 2, 0}, /* 272 */ {5, "DSRB", 5, 3, "81F", 0, 0}, /* 273 */ {5, "D0=CS", 1, 3, "13C", 0, 0}, /* 274 */ {5, "INTON", 5, 4, "8080", 0, 0}, /* 275 */ {1, "?A#C", 7, 3, "806", 1, 0}, /* 276 */ {2, "C=C-A", 0, 3, "002", 3, 0}, /* 277 */ {2, "C=C-1", 4, 3, "00E", 1, 0}, /* 278 */ {2, "A=B-A", 0, 3, "00C", 3, 0}, /* 279 */ {1, "?C#D", 7, 3, "807", 1, 0}, /* 280 */ {1, "?B>A", 3, 3, "804", 2, 0}, /* 281 */ {4, "CON(2)", 53, 2, "00", 1, 2}, /* 282 */ {4, "REL(4)", 37, 4, "0000", 1, 4}, /* 283 */ {2, "DSR", 4, 3, "007", 4, 0}, /* 284 */ {5, "D0=AS", 1, 3, "138", 0, 0}, /* 285 */ {5, "MP=0", 1, 3, "828", 0, 0}, /* 286 */ {5, "RSI", 1, 5, "80810", 0, 0}, /* 287 */ {4, "GOVLNG", 53, 7, "8D000", 3, 5}, /* 288 */ {2, "C=C+1", 0, 3, "006", 3, 0}, /* 289 */ {2, "C=C+A", 4, 3, "002", 1, 0}, /* 290 */ {12, "D0=D0-", 33, 3, "180", 0, 0}, /* 291 */ {2, "A=B+A", 0, 3, "000", 1, 0}, /* 292 */ {1, "?C#B", 7, 3, "805", 1, 0}, /* 293 */ {1, "?D>=C", 3, 3, "80B", 2, 0}, /* 294 */ {36, "BIN", 36, 0, "", 0, 0}, /* 295 */ {1, "?C#0", 7, 3, "80E", 1, 0}, /* 296 */ {2, "B=B-1", 0, 3, "00D", 1, 0}, /* 297 */ {2, "B=B-A", 4, 3, "008", 3, 0}, /* 298 */ {5, "AR2EX", 5, 3, "122", 0, 0}, /* 299 */ {5, "CR3EX", 1, 3, "12B", 0, 0}, /* 300 */ {3, "C=C!A", 1, 4, "0E0A", 0, 0}, /* 301 */ {3, "A=B!A", 1, 4, "0E08", 0, 0}, /* 302 */ {3, "C=A&C", 1, 4, "0E02", 0, 0}, /* 303 */ {3, "C=C&D", 5, 4, "0E07", 0, 0}, /* 304 */ {5, "XM=0", 5, 3, "821", 0, 0}, /* 305 */ {4, "GOC", 37, 3, "400", 2, 2}, /* 306 */ {2, "B=B+A", 4, 3, "008", 1, 0}, /* 307 */ {1, "?B=C", 3, 3, "801", 1, 0}, /* 308 */ {2, "B=B+1", 0, 3, "005", 3, 0}, /* 309 */ {1, "?A>=B", 7, 3, "808", 2, 0}, /* 310 */ {2, "B=-B-1", 4, 3, "00D", 4, 0}, /* 311 */ {37, "FORTH", 0, 0, "", 0, 0}, /* 312 */ {2, "A=A-1", 4, 3, "00C", 1, 0}, /* 313 */ {8, "?P=", 35, 3, "890", 0, 0}, /* 314 */ {5, "R3=C", 1, 3, "10B", 0, 0}, /* 315 */ {1, "?B=A", 7, 3, "800", 1, 0}, /* 316 */ {3, "B=B!A", 1, 4, "0E0C", 0, 0}, /* 317 */ {3, "D=C&D", 5, 4, "0E03", 0, 0}, /* 318 */ {2, "A=A+1", 0, 3, "004", 3, 0}, /* 319 */ {18, "LCASC", 32, 2, "30", 3, 2}, /* 320 */ {1, "?D=0", 7, 3, "80B", 1, 0}, /* 321 */ {5, "R3=A", 5, 3, "103", 0, 0}, /* 322 */ {25, "STITLE", 1, 0, "", 0, 0}, /* 323 */ {2, "A=A+A", 4, 3, "004", 1, 0}, /* 324 */ {2, "B=-B", 0, 3, "009", 4, 0}, /* 325 */ {2, "BAEX", 4, 3, "00C", 2, 0}, /* 326 */ {5, "INTOFF", 1, 4, "808F", 0, 0}, /* 327 */ {26, "WORD", 36, 0, "", 0, 0}, /* 328 */ {5, "P=P-1", 5, 2, "0D", 0, 0}, /* 329 */ {2, "B=C-B", 4, 3, "00D", 3, 0}, /* 330 */ {5, "AR1EX", 5, 3, "121", 0, 0}, /* 331 */ {5, "CR2EX", 1, 3, "12A", 0, 0}, /* 332 */ {1, "?B>=A", 7, 3, "80C", 2, 0}, /* 333 */ {1, "?C<=D", 3, 3, "80B", 2, 0}, /* 334 */ {5, "ASLC", 1, 3, "810", 0, 0}, /* 335 */ {16, "D1=HEX", 4, 4, "1D00", 3, 2}, /* 336 */ {2, "D=-D-1", 0, 3, "00F", 4, 0}, /* 337 */ {4, "D1=(5)", 177, 7, "1F000", 3, 5}, /* 338 */ {5, "P=P+1", 5, 2, "0C", 0, 0}, /* 339 */ {2, "B=C+B", 0, 3, "001", 1, 0}, /* 340 */ {1, "?Bareuh/assembler/Makefile <<'@EOF' # # Makefile genere automatiquement par mkmf (le masque par defaut a ete adapte) # CFLAGS = -O LDFLAGS = LIBS = SYSLIBS = BINDEST = /usr/local/bin # # S'il y a plus d'un programme, il faut aussi remplacer la cible # $(PROGRAM) par autant de cibles que necessaire. # PROGRAM = aas SRCS = aerror.c \ ainput.c \ alabel.c \ alist.c \ amain.c \ amnemo.c \ aobj.c \ aopc1.c \ aopc2.c \ apass.c \ areport.c \ autil.c \ exp.c \ mdep.c \ tabgrp.c \ tabopc.c HDRS = agen.h \ aglobal.h \ common.h \ err.h \ flag.h EXTHDRS = /usr/include/stdio.h \ /usr/include/sys/stat.h \ /usr/include/sys/types.h OBJS = aerror.o \ ainput.o \ alabel.o \ alist.o \ amain.o \ amnemo.o \ aobj.o \ aopc1.o \ aopc2.o \ apass.o \ areport.o \ autil.o \ exp.o \ mdep.o \ tabgrp.o \ tabopc.o MANDEST = /usr/local/man/man1.Z MANPAGES = aas.1 # # Les cibles : # all : compiler tout # clean : effacer les .o et les core # clobber : effacer tout ce qui peut etre regenere # depend : recalculer toutes les dependances et les inserer ici # install : installe le programme dans l'aborescence # tags : cree les tags # all: $(PROGRAM) $(PROGRAM): $(OBJS) $(LIBS) cc $(LDFLAGS) $(OBJS) $(LIBS) $(SYSLIBS) -o $(PROGRAM) clean:; rm -f $(OBJS) core clobber:; rm -f $(OBJS) $(PROGRAM) core tags depend:; mkmf ROOT=$(ROOT) install: $(PROGRAM) -strip $(PROGRAM) if [ $(BINDEST) != . ] ; \ then \ (cd $(BINDEST) ; rm -f $(PROGRAM)) ; \ cp $(PROGRAM) $(BINDEST) ; \ if [ "$(MANPAGES)" != none ] ; \ then \ (cd $(MANDEST) ; rm -f $(MANPAGES)) ; \ for i in $(MANPAGES) ; \ do \ compress < $$i > $(MANDEST)/$$i ; \ done ; \ fi ; \ fi tags: $(HDRS) $(SRCS) ctags $(HDRS) $(SRCS) # # Dependances calculees automatiquement par mkmf. # Ne rien changer apres cette ligne ! # ### aerror.o: aglobal.h common.h /usr/include/stdio.h err.h ainput.o: aglobal.h common.h /usr/include/stdio.h err.h alabel.o: aglobal.h common.h /usr/include/stdio.h err.h alist.o: aglobal.h common.h /usr/include/stdio.h err.h amain.o: aglobal.h common.h /usr/include/stdio.h err.h amnemo.o: aglobal.h common.h /usr/include/stdio.h err.h aobj.o: aglobal.h common.h /usr/include/stdio.h err.h aopc1.o: aglobal.h common.h /usr/include/stdio.h err.h agen.h aopc2.o: aglobal.h common.h /usr/include/stdio.h err.h agen.h apass.o: aglobal.h common.h /usr/include/stdio.h err.h agen.h areport.o: aglobal.h common.h /usr/include/stdio.h err.h autil.o: aglobal.h common.h /usr/include/stdio.h err.h exp.o: flag.h aglobal.h common.h /usr/include/stdio.h err.h mdep.o: flag.h aglobal.h common.h /usr/include/stdio.h err.h \ /usr/include/sys/types.h /usr/include/sys/stat.h tabgrp.o: aglobal.h common.h /usr/include/stdio.h err.h tabopc.o: aglobal.h common.h /usr/include/stdio.h err.h @EOF set `wc -lwc areuh/assembler/aas.1 <<'@EOF' .TH AAS 1L .SH NAME aas \- areuh assembler .SH SYNOPSIS .B aas [ .B -p ] [ .B -l .I page length ] [ .B -A ] [ .B -a .I listing file ] [ .B -x ] [ .B -o .I object file ] [ file1 ... filen ] .SH DESCRIPTION .I Aas est le cross-assembleur pour le HP-71, qui prend un ou des fichiers sources, les assemble et place dans le fichier objet soit un Lex ou Bin complet, soit un fichier intermediaire pour edition de liens ulterieure (voir .IR ald (1L)). .PP Les options sont : .TP 17 .B -p Utilisation interactive : demande les noms des fichiers au clavier. Option par defaut lorsqu'il n'y a aucun parametre. .TP .BI -l " page length" La longueur des pages du .I listing file est fixee a .I page length lignes (72 par defaut). .TP .B -A Genere un listing d'assemblage avec offset, codes hexadecimaux, et texte source. Le listing est envoye sur la sortie standard. .TP .BI -a " listing file" Genere un listing d'assemblage dans le fichier .IR "listing file" . .TP .I -x Genere dans le .I listing file une table des references croisees, indiquant pour chaque symbole sa valeur et les numeros des lignes y faisant reference. .TP .BI -o " object file" Place le code objet dans le fichier specifie. Par defaut, le nom est celui du fichier source avec le suffixe .IR .as , remplace par .I .ao en cas d'assemblage separe, ou .B lex en assemblage complet. Si .I object file est un repertoire, le fichier est place dans le repertoire indique avec les regles de renommage ci-dessus (note : c'est l'utilisation la plus simple lorsque plusieurs sources sont donnes sur la ligne de commandes). .SH AUTHORS Pierre David Janick Taillandier .SH SEE ALSO ald(1L), adp(1L), amg(1L), cp71(1L). .br .I "IDS vol I" for HP-71. @EOF set `wc -lwc areuh/README <<'@EOF' AUTHORS ------- Pierre DAVID (pda@masi.ibp.fr or pda@frunip62.bitnet) Janick TAILLANDIER You are free to use or distribute these programs as long as you keep this note These programs are provided as is. They are in no way supported by us. PRESENTATION ------------ These programs provide you with a complete development system for the Saturn processor (used on the HP-71, HP-28, HP-48 among others). It includes an assembler, a linker for separate assembly, and various utilities to generate message tables for the HP-71 as well as download programs to the HP-71 via HP-IL or RS-232. HISTORY ------- It was developped for the HP-71 in order for us to produce more easily the JPC Rom (PPC Paris Rom) for the HP-71. The final Rom module was 45 KB (executable) for a total of 1.5 MB source files. The speed was one of the main design objectives. These programs were written in C for the HP Integral PC (under HP-UX) in 1986 and have been adaptated for PC compatibles (Microsoft C 4.0 in 1987). It was also used as the final stage of a simple C compiler for the HP-71. HP-71 DEPENDENCIES ------------------ This development system is fully compatible with the assembler described in the HP-71 Internal Design Specifications (Volumes I or IV). The opcode syntax is the one used by HP : it seems crazy to invent a new one, just to confuse everyone! Some macros (LEX, BIN, FORTH, TOKEN...) are specific to the HP-71, but you are free not to use them. You may also want to write specific HP-48 macros to generate specific objects (it would be nice if HP give us the syntax they use). Some opcodes used in newer machines (28, 48...) are not present in the HP-71. Those opcodes (but PC=(A) and RSI) are not in our opcode table, but could be easily added if they are known. The linker preloads a special file (/usr/local/lib/hp71.ep) containing all HP-71 operating system entry points. Do not use any name contained in this file, or remove the loading of this file. In summary, HP-71 dependencies should not be a problem. However if you want to use new opcodes, you will have to add them. Please, post your modifications. CONTENTS -------- Makefile The global Makefile (HP-UX) to generate all programs. assembler Source code for aas (the assembler). Some files are shared between assembler, linker and dump (common.h, err.h), some are shared between assembler and linker (exp.c, mdep.c). Contains a manual page in French. linker Source code for ald (the linker). Contains a manual page in French. dump Source code for adp (the file dumper, used for debugging). Contains a manual page in French. cpy Source code for downloading files from a PC to an HP-71 using HP-IL Link card or RS-232. This should now superseded for HP-48 by Kermit. load Source code for acp, utility for copying an executable file generated by the linker to a LIF disk (to be read by an HP-71 with HP-9114). equ Source for all HP-71 operating system entry points. jmpdoc Some thoughts about adding a new generic branch macro. In French. Garbage. msg Source code for amg (HP-71 message table generator). Contains a manual page in French. doc Various documentations. PORTING ------- If you are using HP-UX, just type make, then make install. If you are using another flavor of Unix, the Makefile should work. We think there are no special system dependencies (it was successfully compiled on Suns 3 and 4 with SunOS 4 and a Vax under BSD 4.3). If you are using PC compatibles, we cannot do anything for you. The Makefiles will probably be difficult to use... If you are using an Amiga, a Mac or anything else, good work ! Have fun ! Pierre DAVID & Janick TAILLANDIER (July 1st, 1990) @EOF set `wc -lwc