home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / sigm / vol140 / x68.h < prev    next >
Encoding:
C/C++ Source or Header  |  1984-04-29  |  4.1 KB  |  104 lines

  1. /*    Global variable header file for X68 Assembler    */
  2. /*
  3.  *    PERMISSION IS GRANTED FOR THE PUBLIC DOMAIN
  4.  *    NON COMMERCIAL USE OF THIS SOFTWARE.
  5.  *
  6.  *    (C) CHRIS UNDERY 25th OCTOBER 1982
  7.  *    11 MARGARET ST NEWTOWN 2042
  8.  *    SYDNEY, AUSTRALIA
  9.  */
  10.  
  11. #include "bdscio.h"
  12. #define NUL '\0'        /* null string definition        */
  13. #define COMMA ','        /* Comma delimiter            */
  14. #define TAB '\t'        /* white space character        */
  15. #define SP " "            /* single space                */
  16. #define SP2 "  "        /* two spaces                */
  17. #define SP4 "    "        /* four spaces                */
  18. #define QUOTE 0x27        /* ASCII Quote                */
  19. #define LINELEN 150        /* maximum length of source line    */
  20. #define SYMSIZE 8        /* maximum # of characters in a symbol    */
  21. char obuf[BUFSIZ];        /* GP input buffer            */
  22. char ibuf[BUFSIZ];        /* GP output buffer            */
  23. char ifile[BUFSIZ];        /* include file             */
  24. int lineno;            /* current line number of source file    */
  25. int numlines;            /* total number of lines assembled    */
  26. int decad;            /* assembler location counter        */
  27. int dec;            /* temp global variable            */
  28. int dlabad;            /* Decimal copy of branch addresss    */
  29. int sourcef, prnf;        /* FCB pointers                */
  30. int symf, hexf, nemf;        /* FCB pointers                */
  31. int errors;            /* Total errors count            */
  32. int useage;            /* Symbol table useage            */
  33. int nb;                /* Number of bytes in this expansion    */
  34. int offset;            /* Offset for Relative addresses    */
  35. int colum1, colum2;        /* For use with field function        */
  36. int indx1,indx2,indx3;        /* String operation indices        */
  37. int linecnt, pageno;        /* Listing control variables        */
  38. int bcc;            /* Intel checksum            */
  39. int xptr;            /* Expresssion evaluation pointer    */
  40. int bias;            /* Prom burner bias factor        */
  41. int numbytes;            /* number of bytes of code produced    */
  42. int checksum;            /* assembler generated global checksum  */
  43. char xp1[20], xp2[20];        /* Sub-sub expression registers        */
  44. char operator, hex[5];        /* Hex conversion buffer        */
  45. char line[LINELEN+100];        /* source file input line buffer    */
  46. char title[64];            /* title of listing             */
  47. char symn[16];            /* Symbol file name            */
  48. char hexname[16];        /* Hex file name buffer            */
  49. char label[SYMSIZE];        /* label field                */
  50. char mnem[SYMSIZE];        /* mnemonic field            */
  51. char subexp[LINELEN];        /* Sub-expression for opnd evaluation   */
  52. char operand[LINELEN];        /* operand field            */
  53. char comment[LINELEN];        /* comment field            */
  54. char hexad[SYMSIZE];        /* hex result field            */
  55. char labrec[SYMSIZE];        /* symbol tree search key field        */
  56. char inst[SYMSIZE];        /* 6800 Hex inst from OPTAB table    */
  57. char class[SYMSIZE];        /* Operand Class descriptor        */
  58. char dest[4];            /* Mnemonic lookup descriptor        */
  59. char temp[LINELEN];        /* String op scratch buffer        */
  60. char hexrec[50];        /* Intel hex file record        */
  61. char binrec[25];        /* as above                */
  62. char i1[4];            /* Instruction byte 1            */
  63. char i2[4];            /* Instruction byte 2            */
  64. char i3[4];            /* Instruction byte 3            */
  65. char m4[4];            /* Instruction byte 4            */
  66. char brad[5];            /* Branch address             */
  67. char labad[5];            /* Relative branch offset        */
  68. char filename[16];        /* Primary file name of job         */
  69. char symname[16];        /* Symbol file name            */
  70. char lstname[16];        /* List file name            */
  71. char printing;            /* True if outputting to printer    */
  72. char iname[16];            /* include file name            */
  73. char syming;            /* True if outputting symbol table     */
  74. char xing;            /* True if writing HEX file         */
  75. char mloading;            /* True if including OBJECT code    */
  76. char including;            /* True if including source code    */
  77. char yanking;            /* True if using old symbol table    */
  78. char listing;            /* True if writing .PRN file        */
  79. char debug;            /* True if .TMP file not to be erased    */
  80.  
  81. #define HASHSIZE 100        /* Modulo of hash bucket pointer list   */
  82. #define NKEYS 108        /* Number of entries in OPTAB+1        */
  83.  
  84. /*    Prototypical symbol table definition    */
  85.  
  86. struct nlist {
  87.     char *name;        /* Symbol name string     */
  88.     char *def;        /* Numeric value of symbol    */
  89.     struct nlist *next;    /* Hash group chain pointer    */
  90. };
  91.  
  92. /*    Prototypical opcode binary lookup table    */
  93.  
  94. struct key {
  95.     char keyword[5];    /* Motorola 6800 mnemonics list    */
  96.     char hexcode[3];    /* Hex value of mnemonic    */
  97.     char use[2];        /* Steering byte        */
  98. };
  99.  
  100. struct key v[NKEYS];        /* Mnemonic lookup table    */
  101. struct nlist *hashtab[HASHSIZE]; /* HASHSIZE bucket pointers    */
  102.  
  103. struct nlist *last;        /* keeps track of last node read */
  104.