PRICE $8.00 SERIES 1BDD MICROPROCESSOR SYSTEM r:I GENERAL INSTRUMENT L!!.I MICRDELECTRDNICS SOFTWARE DOCUMENTATION THE SERIES 1600 SEMICONDUCTOR LINEUP 1630 - 256)(4 Static RAM • MEMORIES • MICROPROCESSORS PROGRAMMABLE INTERFACE CONTROLLERS CP PIC 1600 - Basic Insl. Set • Available Fall 1975 SERIES 1600 MICROPROCESSOR SYSTEM SOFTWARE DOCUMENTATION CROSS ASSEMBLER/SIMULATOR USERS MANUAL This manual contains a detailed specification of the Series 1600 Symbolic Assembly Language and in- formation pertaining to the operating commands, input/ output options; and utility functions provided by the Series 1600 Cross Software Package. © Copyright 1975 All rights reserved GENERAL INSTRUMENT CORPORATION. MICROELECTRONICS DIVISION. 600 W. John St.• Hicksville.li.Y. 11802.516·733·3107 SUMMARY Title: Series 1600 Cross Assembler/Simulator Users Manual Document No. : S16DOC-XAJBIM-02, May 1975 Revision Level: Supersedes S16DOC-XALSIM-Ol. November 1974 Subject Programs: S16XSFT Series 1600 Cross Software Package a. S16XAL-l Series 1600 Symbolic Cross Assembler b. S16SIM-1 Series 1600 Simulator c. S16LNK-1 Series 1600 Object Module Linker d. S16XRF-l Series 1600 Concordance (XREF) Generator e. S16BPT-l Series 1600 Binary Paper Tape Generator f. S16RTG-1 Series 1600 ROM Tape Generator Scope: This manual describes the Cross Assembler (S16XAL-1) and Simulator (S16SIM-l) programs which support the General Instrument Corporation Series 1600 Microprocessor System. In addition, four companion programs, the Object Module Linker (S16LNK-l), Concordance Generator (S16XRF-l), Binary Paper Tape Genel'ator (S16BPT-l), and ROM Tape Generator (S16RTG-1) a,re described. Operating Environment: The Series 1600 Cross Software Package is written in F level Fortran IV and is specifically designed to operate in a 16-bit minicomputer environment. Versions are available for the following systems and require 12 to 16K words of memory, a disc operating system, and a terminal device: a. DEC-PDPll S16XSFT-PDPll b. DGC-NOVA SI6XSFT-NOVA The total S16XSFT Series 1600 Cross Software Package is also available for use on the General Electric Time-Share Computer Network. Support Programs: Host Computer System Editing Facilities Reference Documents: S16DOC-SXFTll-00 Series 1600 Cross Software Operators Guide - PDPll S16DOC-XSFTNV-OO Series 1600 Cross Software Operators Guide - NOVA S16DOC-XSFTGE-OO Series 1600 Cross Software Operators Guide - G.E. Time-Share TABLE OF CONTENTS CHAPTER 1: S16XAL SYMBOUC CROSS ASSEMBLER 1.1 INTRODUCTION 1.2 FEATURES 1.3 BASIC OPERATION 1.4 SOURCE PROGRAM FORMAT 1.4.1 Label 1.4.2 Operator 1.4.3 Operar.and 1.4.4 Comment 1.5 SYMBOLS 1.6 LITERALS 1. 6.1 Octal 1.6.2 Decimal 1. 6.3 Hexidecimal 1. 6.4 ASCII Character 1.7 EXPRESSIONS 1.8 ASSEMBLY DIRECTIVES 1. 8.1 PAGE 1. 8. 2 HEAD 1. 8. 3 REL 1. 8.4 ABS 1. 8.5 ENTR 1. 8. 6 GLOB 1. 8. 7 EXT 1. 8. 8 ORG 1. 8. 9 EQU 1. 8.10 RES 1. 8.11 ZERO 1. 8.12 BITS 1. 8.13 MEML 1. 8.14 WORD 1. 8.15 BYTE 1. 8.16 TEXT 1. 8.17 END 1. 8. 18 EOT ·1.8.19 NLST 1. 8. 20 LST 1. 8. 21 IFEQ 1. 8. 22 IFNE 1. 8. 23 ENDC 1.9 PROGRAM USTING 1.10 DIAGNOSTICS 1.11 INTERACTIVE DIALOGUE CHAPTER 2: S16LNK OBJECT MODULE UNKER 2. 1 INTRODUCTION 2.2 FEATURES 2. 3 BASIC OPERATION 2.4 INTERACTIVE DIALOGUE 2. 5 DIAGNOSTICS 2.6 UMITATIONS CHAPTER 3: S16SIM SIMULATOR 3. 1 INTRODUCTION 3. 2 FEATURES 3. 3 OPERATION 3.4 INITIAL CONDITIONS 3.5 SYSTEM LOADING 3.6 CONTROL COMMAND SEQUENCE 3.7 TRAPS AND TRACES 3.8 INPUT/OUTPUT AND INTERRUPT SIMULATION 3.9 EXTERNAL CONDITION SIMULATION 3. 10 TELETYPE SIMULATION 3. 11 COMMAND STRING FORMAT 3.12 SYSTEM PARAMETER DEFINITION 3. 12. 1 Load Binary Pro gram 3. 12.2 Set Data Display Radix 3. 12.4 Display /Modify CPU Clock Rate 3. 12. 5 Define Memory 3. 12. 6 Remove Memory Definition 3. 12. 7 Display Memory mocks 3. 12. 8 Set Stack Limits 3. 12. 9 Remove Stack Limits 3.12.10 Display Maximum Stack Used 3.13 SYSTEM CONTROL COMMANDS 3. 13. 1 Execute 3. 13.2 Execute and Display Registers 3.13/3 Step 3. 13. 4 Continue 3.13.5 Exit 3. 13. 6 Keyboard Interrupt 3.13.7 Display Elapsed Time 3. 13. 8 Display Registers 3. 13.9 Display Addresses 3. 13. 10 Search Addresses 3.13.11 Initialize Addresses 3. 13. 12 Display /Modify Addresses 3. 13. 13 Display /Modify Registers 3. 13. 14 Display /Modify Status Register 3. 13. 15 Branch Destination Modification 3. 13. 16 Jump Destination Modification 3.13.17 Display Symbols 3. 13. 18 Display Previous Addresses 3.13.19 Clear Previous Addresses 3.13.20 Set Software Interrupt Vector 3. 14 TRACE/TRAP COMMANDS 3. 14. 1 Memory Trap or Trace 3. 14. 2 Register Trap or Trace 3. 14. 3 Remove Register Trap or Trace 3. 14. 4 Remove Memory Trap or Trace 3.14.5 Display Register Trap or Trace 3.14.6 Display Memory Trap or Trace 3.15 INPUT/OUTPUT COMMANDS 3. 15. 1 Define I/O Buffer Register 3. 15. 2 Remove I/O Buffer Register Definition 3.15.3 Display I/O Buffer Register Table 3. 15. 4 Define 1. 0 Status Register 3. 15.5 Remove I/O Status Register Definition 3.15.6 Display I/O Status Register Table 3. 15. 7 Define Interrupt 3. 15. 8 Display Interrupt Table 3. 15. 9 Remove Interrupt Definition 3. 16 EXTERNAL CONDITION COMMANDS 3. 16. 1 Define External Condition 3. 16. 2 Remove External Condition Definition 3. 16.3 Display External Condition Table 3.17 INFORMATIVE MESSAGES CHAPTER 4: S16XR.F CONCORDANCE (XR.EF) GENERATOR 4.1 INTRODUCTION 4.2 OPERATION 4.3 INTERACTIVE DIALOGUE 4.4 ERROR MESSAGES 4.5 LISTING FORMAT 4.6 liMITATIONS CHAPTERS: S16BPT BINARY PARER TAPE GENERATOR 5. 1 INTRODUCTION 5.2 OPERATION 5.3 ERROR MESSAGES CHAPTER 6: S16 RTG ROM TAPE GENERATOR 6. 1 INTRODUCTION 6.2 OPERATION 6.3 ERROR MESSAGES CHAPTER 1 S16XAL SYMBOUC CROSS ASSEMBLER 1. 1 INTRODUCTION The Setie3 1600 Symbolic Cross Assembler (SI6XAL) is a program preparation aid which supports General Instrument's family of 16-bit microprocessors. It translates ASCII coded alphanumeric source programs into several different types of binary coded object modules. The S16XAL Symbolic Cross Assembler is written in F level Fortran IV and is designed for operation in a 16 -bit data word environment making it compatible with all minicomputers as well as larger computer systems. 1.2 FEATURES The S16XAL Symbolic Cross Assembler provides the following major features: Symbolic language representation of all instructions Literal representations in four formats; Octal, Decimal, Hexadecimal, Character . Arithmetic evaluation of operand expressions Assembly directives for Controlling memory allocation Defining character strings Specifying input/output options Establishing conditional assemblies . Declaring global and external' gymbols Assembly in three forms Absolute Relocatable Relocatable/ Linking . Program listings Error· detection 1. 3 OPERATION The S16XAL Symbolic Cross Assembler converts symbolic source programs into machine code format in a two pass process. During the first pass through the source file:;, all user specified symbols ar.e placed in a symbol table containing the symbol, its value, and several other attributes. During the second pass through the source file, symbolic inst,ruction mnemonics are translated, symbol references resolved, errorS diagnosed, a machine code file generated, and an optional program listing produced. The machine code file produced by the S16XAL Cross Assembler can be of several forms. If the source program specified an absolute assembly, the binary file will be an absolute load module. An absolute load module can be directly loaded and executed by the Series 1600 Simulator (SI6SIM) or punched on paper tape for sub- sequent loading in a microprocessor system by the resident loader (SI6LDR). If the source program contains global symbol definitions and/or external symbol definitions and/or external symbol references, the binary file will be a relo- catable object module. Relocatable object modules must be linked together by the Series 1600 Object Module linker (S16LNK) to form one relocatable load module for input to the Series 1600 Simulator (SI6SIM). Alternatively, relo- catable object modules or load modules may be punched on paper tape for sub- sequent loading in a microprocessor system by the resident relocatable/linking loader (S16LDR). If the source program does not contain global or external sym- bol references, the binary file will be a relocatable load module which can be di- rectly loaded and executed by the Series 1600 Simulator (S16SIM) or punched on paper tape for loading on a microprocessor system by the resident loader (S16 LOR). These options are shown diagramaticaily in Fig. 1. 3. 1. 1.4 SOURCE PROGRAM FORMAT A,s16XAL source program is composed of a sequence of statements with each statement contained on a single line. A statement is terminated by a carriage return character or is punched on one computer card. A statement may contain up to four fields which are identified by their order of appearance from left to right. The general format of a S16XAL statement is: Label, Operator, Operand, Comment. The label and comment are optional, while the operator is always re- quired. The presence and nature of the operand depends upon individual operators. It is recommended that statements be limited to approximately 50 characters so that assembled programs can be printed on teletype or CRT terminals. 1.4.1 Label A label is a .user defined character string, used to symbolically refer- ence a specific location within a program. If a statement contains a label, the label must begin in the first position of the statement. Labels may contain up to six characters, the first of which must be a letter (A-Z), a currency symbol ($), a question mark (?), or an ampersand (&). The re- maining five optional characters may be any valid character (EBCIOIC or ASCII) except a blank space, since this character is the label terminator. Labels containing more than six characters cause a diagnostic to be issued and are truncated after the sixth character. Labels must be unique in the first six characters, i. e., a specific character string cannot be used in the label field of a statement more than once in a program. Multiple use of a label causes a diagnostic to be issued and the subsequent definitions of the label to be ignored. 1.4.2 Operator An operator follows the label field in a statement. A statement operator contains up to four characters and may be an instruction mnemonic or an assembly directive. Instruction mnemonics are symbolic character strings which represent the various Series 1600 instructions. Assembly directives are also symbolic character strings but are used to represent S16XAL CROSS ASSEMBLER Global or No Global or External Symbols External Symbols Other Relocatable Object Modules S16BPT PAPER TAPE GEN. Program Tape S16SIM SIMULATOR S16RLLjLDR LOADERS Figure 1. 3.1 certain functions or actions performed by the assembler during the assembly process. If a statement does not contain a label, the operator must be preceded by at least one blank space. If the operator is the last field in a statement, it is followed by a carriage return, otherwise· it is followed by a blank space. 1.4.3 Operand An operand follows the statement operator separated by at least one blank space. The operand represents an item or items to be operated upon by the statement operator. Operands may be symbols, literals or expressions. When multiple operands are used, they are separated by commas. If an operand is the last field in a statement it is followed by a carriage return, otherwise it is followed by the comment field. 1.4.4 Comment The comment field is optional in all statements and must be preceded by a semicolon (;). The contents of the comment field are printed on the program listing but have no effect on the assembled program. Entire lines may serve as comments if the first non blank character is a semi- colon. Blank lines are printed on the program listing but otherwise ig- nored so that statements may be separated in order to enhance program readability. The liberal use of commentary is strongly recommended so that the function and operation of programs is evident from the program listing. 1. 5 S YMBO LS A symbol is a character string which appears in an operand and represents the value assigned to the symbol. A symbol is given a value by direot assignment via an assembly directive or by appearing in the label field of a statement. Labels are assigned the value of the assembly location counter for the instruction on which they appear. The assembler recognizes the exclamation (!) sign as a special symbol for the current value of the program counter. 1.6 LITERALS literals are character strings which serve as sources of data, i. e., cannot be changed and are interpreted by the assembler as constants. The assembler accepts literals expressed as octal, decimal, hexadecimal and character. Numeric literals may be preceded by a plus or minus to 3ignify sign. Plus is assumed unless a minus is present. 1. 6.1 Octal (Default Radix) soooooo s = optional + or -, + assumed o =0-7 000000 = 0 to 177777 1. 6.2 Decimal s~dddd s = optional + or -, + assumed d = 0 - 9 ddddd = - 32768 to 32767 1. 6.3 Hexadecimal sX'bhhh' s = optional + or -, + assumed h = 0-9, A - F bhhh = 0 to FFFF 1. 6.4 ASCII Character "cc" or 'c' "or' = delimiter c = any ASCII character One or two characters may be packed into each 16-bit word. If one character is specified ("c" or 'c') it is placed in the low order byte of the word with zeros in the high order byte. If two characters are specified· ("ab" or 'ab ') the first (a) is placed in the low order byte and the second (b) is placed in the high order byte. 1. 7 EXPRESSIONS Arithmetic operators (+and -) may be used to form operand expressions. An element of an expression may be: a user defined symbol, the current assembly location counter symbol (!), or a literal. Expressions may contain up to six elements separated by either + or - operators. The total expression may be terminated by a comma, a.. carriage return or a :semicolom· Expressions are always evaluated from lefj: to right with no parenthetical groupings allowed. 1.8 ASSEMBLY DIRECTIVES Assembly directives are used to control the assembly process and in some cases cause data to be generated. In the following assembly directive descriptions op- tional elements are enclosed in [ ]. Comments may be used with all assembly directives. LABEL OP OPRND ACTION 1. 8.1 PAGE Advance program listing to the top of the next page. Sixty lines are normally printed on each page. 1. 8. 2 HEAD 'ccc ... c' Use the character string specified as the operand as a page heading for the next page. The first character in the string is used as the string terminator. 1.8.3 REL [name] Generate a relocatable assembly and use the six character name as the ob- ject module identifier. If no name is specified, an unnamed relocatable ob- ject module is generated. The module name is used by the Series 1600 Object Module Linker (S16 LNK) to identify ob- ject modules on its load module map. The RE L directive must be encountered by the S16XAL assembler before any data generating operators are processed. If this is not the case, an informative di- agnostic is issued and an unnamed relo- catable object module generated. If no REL or ABS directive is specified, an unnamed relocatable object module is generated; 1. e., REL is the default assembly mode. 1. 8.4 ABS Generate an absolute assembly; the binary file generated by the S16XAL assembler will be an absolute load module. It can- not be relocated or linked when loaded. The ABS directive must be encountered by the S16XAL assembler before any data generating operators are processed. If this is not the case, an informative diagnos- tic is issued and an unnamed relocatable ohj..ect module is generated. 1. 8.5 ENTR v Establish the program entry point; 1. e. , the pOint at which execution is to begin. The operand may be either a symbol or a literal. LABEL OP OPRND ACTION 1.8.(s GLOB S[ , S, ... , S] Declare the symbol(s) as global. Global Global symbols must be defined as labels in the current program unit but can be referenced from other program units. 1. 8. 7 EXT S[, S, ... , S] Declare the symbol(s) as external. Ex- ternal symbols reference global symbols in other program units. Both external and global symbol references are re- solved by the Series 1600 Object Module Linker (SI6LNK) and the relocatable/ linking loader (SI6LDR) resident in the microprocessor system. 1. 8. 8 ORG expr Set the assembly location counter to the value of expr, default is zero. 1.8.9 SYMBOL EQU v Assign the value of the operand to the sym- bol.' The operand may be a symbol, a literal or the assembly location counter symbol (t). If! is specified it may be followed by + or - and a literal. 1. 8.10 [LABEL] RES expr Reserve a block of storage whose length is specified by expr. The contents of individual storage locations is undefined. If a label is specified, it is assigned a value equal to the address of the first word in the block. 1. 8.11 [LABEL] ZERO expr Zero a block of storage whose length is specified by expr. If a label is specified, it is assigned a value equal to the address of the first word in the block. 1. 8.12 BITS expr Specify the number of bits in a memory word as the value of expr. The word size is used by the assembler to check gener- ated data for magnitude exceeding word size. The default is 16 bits. 1. 8.13 MEML exprl[, expr2] Specify lower and upper memory address limits as the values of exprl and expr2. If only expr 1 is specified, its value will be used as the upper memory address limit and the lower limit will be set to zero. These limits are used by the as- sembler to check the validity of addresses assigned to generated code. The defaults are 0 and 17777. LABEL OP OPRND ACTION 1. 8.14 [LABEL] WORD expr[, expr, ... , expr] Generate a data word for each operand expression. The contents of each word is set equal to the value of the respective expr. If a label is specified it is assigned a value equal to the address of the first word. 1. 8. 15 [LABE L] BYTE expr[, expr, ... , expr] Generate twCD data bytes for each operand expression. The operation is the same as with but 8 bit data is gen- erated for use with double byte addressing in 10 bit memory. 1.8.16 [LABEL] TEXT 'cc .... cc' Generate a word or words of data which contain the seven bit ASCII code for each character. Two characters are packed in each word, low byte to high byte. In - complete words contain a blank in the high byte. If a label is specified, it is assigned a value equal to the address of the first word generated. 1. 8.17 END End of the program, the assembly is terminated on the previous statement 1. 8.18 EOT End of tape indicator, used to separate a source program into several paper tapes. This directive is ignored by the file oriented cross assembler. 1. 8.19 NI.ST Disable the program listing. The assembly proceeds normally but with the listing suppressed. This directive is used, for example, to avoid printing a length ZERO block. 1. 8. 20 LST Enable the program listing. This directive is used to cause a listing to again be pro- duced after a NLST directive. 1. 8. 21 IFEQ expr Start conditional assembly. The state- mentsthat follow will be assembled if expr is equal to zero. If expr is not equal to zero, the statements will be listed but not assembled. Conditional assemblies are useful when a program has statements which are to be assembled only under certain conditions. For example, statements which are to be assembled only during debugging of the program. LABEL OP OPERAND ACTION 1. 8. 22 IFNE expr Start conditional assembly. The follow- ing statements will be assembled if expr is not equal to zero, the following statements will be listed but :&lOt assembled. 1. 8. 23 ENDC .End conditional assembly, i. e., resume normal assembly. 1. 9 PROGRAM LISTING The S16XAL Symbolic Cross Assembler produces a listing of the assembled program containing the following fields: line number; six octal digits of address; six octal digits of contents; the statement label, operator, operand and comments. The oper- ator, operand and comments are tabulated to enhance program readability. If the assembled word is subject to modification when the program is loaded at an address different than that of assembly; i. e., relocated, the contents are followed by the letter "R". If the assembled word references an external symbol, the contents are followed by the letter "X". Each page of listing contains sixty lines and begins with a one or two line heading. The first heading line contains the module name, the version of the assembler in use, the time and date of the assembly and the page number. If the user has speci- fied a heading via the HEAD directive, it follows on the next line. The program listing follows, separated from the page heading by a blank line. At the end of the program listing, all user defined symbols are summarized followed by the number of diagnostics iSBued. The symbol summary contains each symbol in alphabetical order, its octal value, and its attributes. The following table lists the codes used for symbol attributes: U - symbol is undefined A - symbol is absolute R - symbol is relocatable X - symbol is external IN - symbols is an instruction label EQ - symbol is defined by an EQU statement RS - symbol is a RES or ZERO statement label DT - symbol is a WORD BYTE, or TEXT statement label G - symbol is global E - symbol is entry point DD - symbol is doubly defined UR - symbol is unreferenced 1. 10 DIAGNOSTICS The S16XAL Symbolic Cross Assembler performs extensive error checking during program assembly issuing both error and informative diagnostics. Each diagnostic is printed on the program listing on a line immediately pre- ceeding the offending statement. Diagnostics and the associated statement are always listed even though the program listing is-surpressed or no listing was requested by the user. The S16XAL assembly error codes are listed in the following table: ERROR CODE MEANING L (E) LABEL label illegal or missing D (E) DBLDEF label is doubly defined U (E) UNDFSYM reference to undefined symbol M (E) MDEF REF reference to multi defined symbol o (E) OP UNREC operator is unrecognized S (E) SYNTAX syntax illegal R (E) REGISTER :register designator illegal or use of reg illegal C (E) CHRILL character i3 illegal string terminator B (E) DBL BYTE double byte data sequence illegal P (E) PHASE label's value differs in phase 2 X (E) EXT NUM more than oneexterrial symbol in expression V (E) VAL OPRN va1lle of operand illegal N (E) NUMBER value of literal illegal Q (I) ?SYNTAX questionable syntax W (I) WRD SIZE word size exceeded A (I) ADR/DEST address out of range or destination questionable T (I) TRUNCATN possible statement truncation E (I) END? END directive missing ? (I) ? USE questional use of directive L (I) MEM UMIT memory limits exceeded 1.11 INTERACTIVE DIALOGUE The S16XAL Assembler is available for use on several interactive computer systems. In order to assemble programs, the user must first estalish communi- cations with the computer and log in with a valid account number or user code (see appropriate System Operation Manuals). After the log in has been completed, the computer operating system responds with a prompt character ($ or * used on many systems). The user responds by entering a command which requests the operating system to load and begin execution of the S16XAL assembler. The assembler first identifies the version in use by displaying S16XAL- VXX, then displays the message: SOURCE FILE, ACCNT? The user must enter an appropriate source file name followed by a comma. and the account in which the file exists. On some systems, if the source file exists in the current account the comma and account may be omitted. Next the assembly listing option is requested by the message: LISTING? (YIN OR F = NAME). If N is entered, no listing except for diagnostics will be produced, if Y is entered the program listing will be output on the interactive terminal. If F=name is entered the listing will be output to the named file. Finally the object file name is requested by the mes- sage: OBJECT FILE? At the end of the assembly if no terminal listing was requested the number of diagnostics issued is summarized. This concludes the current assembly and another source file is requested for the next assembly. If only a carriage return is entered, the assembler returns control to the op- erating system. CHAPTER 2 S16LNK OBJECT MODULE UNKER 2. 1 INTRODUCTION The Series 1600 Object Module linker (S16LNK~is a support program to the Series 1600 Symbolic Cross Assembler (S16XAL). It combines or links to- gether two or more relocatable object modules produced by the S16XAL Assembler to form the single relocatable load module necessary for input to the Series 1600 Simulator (S16SIM). The S16LNK Object Module linker is written in F level Fortran IV and is designed for operation in a 16 -bit data word environment making it compatible with all minicomputers as well as larger computer systems. 2. 2 FEATURES The Sl6LNK Object Module linker performs the following functions on object modules generated by the S16XAL Cross Assembler: Resolves global symbol declarations Satisfies external symbol references .Relocates and links multiple object modules into one load module Produces a load module memory map Generates a load module file for subsequent execution by the Sl6SIM Simulator 2.3 OPERATION The S16LNK Object Module linker performs the linkage function by making two passes through the specified object modules. During the first pass, a table of global symbols and their assigned addresses is constructed and a load module memory map is generated. The map lists the object modules in order of linkage, the relocated base address of each object module, all global symbols and their associated addresses in each module, $d the size of each module. At the end of the first pass, a linkage summary is produced which indicates the initial ad- dress, the final address, and the entry address of the relocatable load module. During the second pass, each object module is again read and the load module file is constructed. 2.4 INTERACTIVE DIALOGUE The S16LNK Object Module linker operates interactively with the user via any appropriate terminal. Upon program initiation the current version is use is iden- tified and the user is requested to name the resultant linked load module file by the message: LOAD MODULE? If a load module file currently exists with the same name, it is deleted and a new file of the same name created. Next, the user is requested to select a load map option by the message: MAP? (YIN or F = NAME) If the user enters "N", no map will be produced; if a "Y" is entered the map will be output on the terminal. If, however, F = NAME is entered the map will be output on a file with the specified name. Finally, the user is requested to enter the names of the object modules to be linked by the message: OBJECT MODULES? The user enters each object module file name in response to a prompt ":". If an object module exists in an account which is different than the current account, the account code is entered on the same line immediately after the file name separated by a comma ", ". The end of the object module identification sequence is indicated by entering a null line, i. e., only a carriage return. The S16LNK Object Module Linker then performs the required linkage and re- sponds with the load map if the user so requested, followed by the linkage sum- mary. 2, 5 ERROR DIAGNOSIS During the linkage process, S16LNK detects several error conditions and issues the following diagnostic messages: FILE DOES NOT EXIST I The last object module file specified does not exist, enter another file name. · OBJECT MODE: x x x x x x NO LONGER EXISTS! The indicated object module file has been deleted during linkage, link aborted. · MODULE: x x x x x x NOT REL, CANNOT LINK I The indicated file is not relocatable, i. e., it was declared absolute via the ABS assembly directive, link aborted. 1 I MULTIPLE ENTRY DEFINITION : x x x x x x IGNORED More than one entry point was specified, link continues. · CANNOT ACCOMMODATE ANY MORE GLOBAlS I ! The global symbol table has overflowed, link aborted. I 1 MULTIPLE GLOBAL DEFINITION: x x x x x x IGNORED A global symbol has been defined more than once, link continues. . UNSATISFIED EXTERNALS SSSSSS NNNNNN The indicated external symbol references could not be resolved because corresponding global symbols are not known. NNNNNN is the address of the first word of the instruction containing the external reference. The symbol is assigned value zero and the link continues. . ILLEGAL liNKAGE CODE A non valid linkage code was detected, link aborted. 2.6 UMITATIONS Since S16LNK is not a program loader, the linked relocatable load module size is limited only by available file space, not by memory size of the host computer. CHAPTER 3 S16SIM SIMULATOR 3. 1 INTRODUCTION The Series 1600 Simulator (S16SIM) is a program debugging aid for the Series 1600 Microprocessor System. Its input is either a relocatable or absolute load module derived from the Series 1600 Symbolic Cross Assembler (S16X.AL) or from the Series 1600 Object Module Linker (S16LNK). The S16SIM Simu- lator executes each instruction of a Series 1600 program in a simulated micro- processor environment allowing detailed examination of program flow and dyn- amic conditions in the simulated system. The S16SIM Simulator is written in F level Fortran IV and is designed for operation in a 16-bit data word environ- ment making it compatible with all minicomputers as well as larger computer systems. 3. 2 FEATURES The S16SIM Simulator provides a comprehensive simulation facility for debugging and testing Series 1600 programs before they are executed on an actual ~ctual microprocessor. It provides the following major features: Simulation of all Series 1600 instructions Simulation of full 65K memory '. Simulation of I/O via data files Simulation of external interrupts Simulation of external branch conditions Simulation of TTY I/O via interactive terminal device Execution in run or step mode Access to all registers and memory locations Trap or breakpoint on register or memory activity . Trace or monitor registers or memory activity Simulate varying memory configurations and speeds Display actual program execution time Determine actual stack depth used 3.3 OPERATION The user communicates interactively with the S16SIM Simulator using a vocabulary of commands which control the simulation environment and program execution. The user can inspec~ change, or monitor microprocessor registers and bus ad- dresses; begill and suspend program execution; execute a program one instruction at a time; simulate real time input/output operations, external interrupts and ex- ternal conditions and determine actual program execution time for various com- binations of ROM/RAM/CPU clock rates. 3.4 INITIAL SIMULATOR CONDITIONS After the S16SIM Simulator is initially loaded and before any user program is loaded or executed the following conditions exist: Register 0-7 are set to zero. Status bits S, Z, C and OV are set to zero. Interrupts are disabled. Privileged instruction mode prevails. Double byte data is disabled. CPU clock rate is 400 nanoseconds. External bus accesses are defined at 700 nanoseconds. RAM memory is assigned to bus addresses 0-167767 and is initialized at zero. TTY simulation is assigned to bus addresses 167775 -167777. All tables are initialized. 3.5 SYSTEM LOADING The S16SIM Simulator provides simulation of the full 65K address capability of the Series 1600 microprocessor by virtual memory techniques. The user may relocate and load any number of load modules produced by the Series 1600 Symbolic Cross Ass'~mbler (S16XAL) or Object Module Linker (S16LNK). Prior to program execution, the user may redefine memory blocks as Read Only (ROM), modify access times, and change word size. Up to 8 sets of parameters are accommodated. In addition, the upper and lower limits of the memory stack area can be defined. The S16SIM Simulator issues various error messages based on these memory definition values. During program execution, the S16SIM Simulator generates a pseudo real time execution clock which is used to schedule simulated input/output and interrupt activities. The microprocessor cycle time can be varied from its 400 nsec de- fault value to simulate different system speeds. The memory access times and the microprocessor cycle time determine if delays are required while waiting for memory accesses. If the microprocessor cycle time is 400 nsec, then memory access times from 1-700 nsec produce no wait, from 701-1100 nsec produce 1 wait cycle, 1101-1500 nsec produce 2 wait cycles, etc. 3.6 CONTROL COMMAND SEQUENCE After program load and environment definition, the program can be executed or single-stepped. Appropriate commands may be entered to display registers or memory locations; search memory for bit patterns; or modify registers or mem- ory. A table is kept of the last 10 program execution addresses in order to allow the user to retrace program flow. When the simulator is ready for input commands the message "ENTER COMMAND" is displayed; after the programmer has com- pleted his input he may continue simulation with a Continue (C), Step (S), or Execute (E). The C will remain in either the Step or Execute mode while the S and E will reset the mode. When in the execute mode the simulation may be interrupted by depressing the "Break" key on the console. 3.7 TRAPS AND TRACES The S16SIM Simulator provides program monitoring capability on CPU registers 0-7 and on any bus address. A trace provides a dynamic display of activities when specified conditions are met. A trap provides a suspension of program execution, i. e., a breakpoint, when specified conditions are met. Since register 7 serves as the CPU program counter, a trap on register 7 serves as a program trap or breakpoint and a trace on register 7 serves as a program flow trace. A memory address trap on a specific address may also serve as a breakpoint when a memory address is accessed during execution. Both traps and traces are in- spected after the instruction is executed. 3.8 INPUT/OUTPUT AND INTERRUPT SIMULATION S16SIM providesfor simulation of up to eight input/output devices and up to eight ext ernal interrupts. These activities are controlled by tables which specify when such events are to occur relative to real execution time. During program simu- lation, execution time is accumulated and used to schedule I/O operations and interrupts. This scheduling is relative to zero time, i. e., the start of program execution. Interrupts are scheduled by defining the start time and the repitition rate. Input/ output simulation is provided for through use of data register and status register tables. If a polled or sensed device is to be simulated, it is defined by corres- ponding entries in both data and status register tables. The status register table defines when and how a device becomes ready, while the data register table de- fines the data source or destination. If an interrupt driven device is to be simu- lated it is defined by entries in the interrupt table and the data register table. The eight simulated I/O devices correspond to eight data files named: SI6SIMOn, where n is 0 to 7. If input is to be simulated, the corresponding data file must be cre- ated by the user beforehand. Output files are created and extended during simula- tion. When output occurs on a file which already exists, it is deleted and a new file is created with the same name. 3.9 EXTERNAL CONDITION SIMULATION S16SIM provides for simulation of 16 external sensed conditions. In a real system configuration four lines derived from the four lower bits of the BEXT instruction are available at CPU output pins. These signals may be decoded externally to ob- tain up to 16 test points with the selected one being returned to the CPU for the iF' branch decision. Lll order to simulate these external sensing activities, a 16 posi- tion table is used to control when each of the possible 16 decodes is to be true or false. In a manner similar to I/O and interrupt simulation, the external condition activities are scheduled relative to program execution time accumulated since the start· of execution. The external conditions are scheduled by defining a start time and with what repetition rate they are to occur. In addition, the logical condition of individual external conditions when active or ready may be specified as true (high) or false (low). An. external condition not defined by a table entry always results in a false evaluation. 3.10 TELETYPE SIMULATION The input/output of ASCII characters from and to an ASR-33 teletype machine or equivalent is simulated without timing via bus addresses 167774 -167777 . The TTY is simulated during program execution by the user terminal which functions in a character by character mode. All other terminal activities are record, i. e., line oriented. Bus addresses 167774 and 167776 simulate the TTY keyboard and printer status registers respectively. Input from either of these addresses always returns 000001, indicating device ready. Bus address 167775 simulates the TTY keyboard data buffer register while bus address 167777 simulates the TTY printer data buffer register. Data input from the TTY is always 7 bit ASCII and data output to the TTY must always be 7 bit ASCII. Note that character literal data generated by the S16XAL assembler is 7 bit ASCII compatible with TTY data. 3. II COMMAND STRING FORMAT S16SIM interactive command strings must comform to a format which always contains a keyword or verb and seven elements which may be optional depending on the nature of the command verb. The general command string format is: VERB, n ; e1, e2, e3, e4, e~ The indicated element separators. i. e., commas and semicolon, must be used as shown. Command strings are limited in length to 60 characters and must be complete on one line. S16SIM recognizes a set of control commands which are entered on the terminal keyboard in response to the "ENTER COMMAND" display. If a command is entered which cannot be recognized, a question mark (?) is displayed under the question- able area of the command and "ENTER COMMAND" is again displayed. In the following descriptions, required command string elements are underlined, optional elements are not underlined and; represents a carriage return. Com- mand elements to the right of the semicolon (;) may be symbols from a S16XAL assembly, literals or expressions composed of symbols and literals. Expression operators may be addition (+) and subtraction (-). Command elements indicated by n which are to the left of the semicolon (;) mu~t be literals. Literals may be octal, decimal, hexadecimal, or ASCII and are expressed as follows: OCTAL - 8000000 (Default Radix) s = optional + or -, + assumed d = 0-7 000000 = 0 to 177777 DECIMAL - s.ddddd • =d,ecifual indicator ddddd = -32768 to +37767 HEXADECIMAL - s:{('hhhh' s = optional + or -, + assumed X' , = hexadecimal indicator hhhh = 0 to FFFF ASCII - 'cc' or "cc" 'or" = delimiters c - any ASCII character One or two characters are packed into each 16 bit word. If one character is specified ("c" or 'c') it is placed in the low order byte of the word with zeros in the high order byte. If two characte:Ls are specified ("ab" or 'ab') the first (a) is placed in the low order byte and the second (b) is placed in the high order byte. In the following descriptions "ENTER COMMAND" and ":" serve as user prompts, i. e., the user must respond with a keyboard entry. After each com- mand action is completed by SI6SIM, the user is again prompted. 3.12 LOADING AND SYSTEM PARAMETER DEFINITIONS 3.12.1 Load Binary Program ENTER COMMAND : LOAD, flJ Load indicated S16XAL generated 'binary ENTER BINARY FILE NAME, program file at address n, if n is not ACCOUNT specified the program will be loaded at : name, account;. the assembly base address. If the file exists in the current account, the account may be omitted. Any number of binary program fUes may be lC1)aded. 3.12.2 Set Data J::>i.splay Radix ENT~R COMMAND :RADX, n;, Octal radix = 8, decimal radix = 10, ASCII = 0, hexadecimal radix = 16. If no radix is specified, octal is used. 3.12.3 Set Time Limit :TLIM, tl Set program execution time limit of t microseconds. Program execution will be suspended after t microseconds have been accumulated. If t is not specified, . the tiroe limit is removed. 3.12.4 Display / Modify CPU Clock Rate ENTER COMMAND :CLK,; CLK::: nnnn·Nsec If nnn is entered the Clock rate will be :nnnn~ changed. If only a carriage return is entered the clock rate will not be changed. 3.12.5 Define Memory ENTER COMMAND :RAM, n ; add1, addh, t, b, f/ Define a Read!WriteMemory mock. n Position in the memory table for this entry. If not specified, the memory definition is added to the end of the table until eight (0-7) definitions have been accumulated. If more than eight memory definitions are specified, the most recent is replaced. add! Low bus address assigned to memory segment n. addh High bus address assigned to memory segment n. t Memory access time in nanoseconds. If not specified, the current CPU clock rate is used. f Fill mode, if word size is less than 16 bits. f specifies how data is read out of memory. If f is not specified, mode 0 is assumed. o - right justified, 0' s left fill. 1 - right justified, l' s left fill. 2 - right justified, sign bit extension. 3 - left justified, 0 's right fill. 4 - left justified, l' s right fill. 3.12.6 Remove Memory Definition ENTER COMMAND : RAM, n; or ENTER COMMAND : ROM, n, In the above command strings if n is specified, the corresponding mem - ory definition table entry will be removed. If n is not specified all en- tries will be removed. 3.12.7 Display Memory Blocks ENTER COMMAND : DMB~ The memory block table will be dis- played with all associated definitions. 3.12.8 Set Stack Limits ENTER COMMAND : SUM; addl, addh) Set the lower stack limit to address a.dd 1 and the upper stack limit to address addh. Program execution is suspended if the stack pOinter (R6) exceeds these limits. 3.12.9 Remove Stack Limits ENTER COMMAND : SUM" Remove stack limits. 3. 12. 10 Display Maximum Stack Used ENTER COMMAND : DMXSJI MAX STACK = x x x x x x x x x x x x is the maximum value that the stack pOinter reached during execution. 3.13 BASIC CONTROL COMMANDS 3.13.1 ENTER COMMAND : ~ ; addri, addrf JJ. Execute a program beginning at location addri and suspend execution when addrf is reached. If no addri is specified, execution begins using the current value of the program counter (register 7). If no addrf is specified, execution continues until: a HALT instruction is executed, a "BREAK" interrupt is issued by the user via the terminal keyboard, the execution time limit is exceeded, or a trap condition is reached. 3.13.2 Execute and Display Registers ENTER COMMAND : EDR ; addri, addrfl Same as above, except the registers are displa yed after each instruction is exe- cuted. 3.13.3 Step ENTER COMMAND : ~; addr, Step (one instruction at a time) a program beginning at location addr. If no addr is specified, the program is stepped using the current value of the program counter (register 7). 3.13.4 Continue ENTER COMMAND :C I Continue program execution from current -/I. location. C is used when in STEP mode, after a TRAP or after a "HLT" instruction. 3.13.5 Exit ENTER COMMAND :X / Exit from S16SIM to the operating system -;I- Monitor. 3.13.6 Keyboard Interrupt "BREAK" One depression of the "BREAK" Key gener- ates an interrupt to the S16SIM executive. This interrupt can be used during simulation to suspend program execution or to suspend extended terminal outputs requested by DA or SA commands. If the interrupt is issued during program execution, "BREAK" will be displayed followed by the ENTER COMMAND request. If the interrupt is issued during a non execution activity, the activity will be suspend~d and the ENTER COMMAND re- quest will be displayed. 3.13.7 Display Elapsed Time ENTER COMMAND : DET j Display program execution time in micro- seconds. 3.13.8 Display Registers ENTER COMMAND :DRJ Display the current contents of: Registers 0-7; status register bits S. Z. C. OV; INTPF and NONINT. 3.13.9 Display Add;resses ENTER COMMAND : DA ; addr1. addrh; Display the current contents of bus locations addr 1 through addrh inclusive. If addr 1 and addJ5 '+ ' .. M2 , ,SiT PI.YS FloG 'PLUS 67 0000,.5 OOlOO,. BEQ Aiel ,YES .. BYPASS IT 000086 0001.1'+ , •• 68S .tEl SyNTAX 0000,.7 001'+70 ASCIt iUSI 060 I I STR IP A st. 11 MASK OOooeo OOOObO 69 000061 0011,)1:.3 8MI Ail;FIN fNeJN D l(~, TRt1N tNVRT 000062 0000'+1 70 000063 00150~ CMf? O~hR2 ICHI< FOR A"F 000064 000021 71 000065 001005 SLT ASCS INOT IN,SC Gl SloX.AL. ViR I Oli: ~2119 JAN 30,'75 PAGE •• ASC 1 I T~ 61NMH CONVERSIeN •• OOOOS6 ooouO~ •• •• 12 S Q (E) SyNTAX. 0) 7 SYNTAX I I 000u57 001';)70 CMPI 02~I,R2 OOOO~O 000U26 •• 131.1 0( I I 7 SYNTAX 1.)00Obl 001v16 t3G T ASCF' IN I NON Dl G, TRMN CN~RT 000062 oOOu;;Jl 11+ 000 0063 0011+7c SUBI 07,RI ,AOJ A-F -> a.oO:l!~ 1)00061+ 000l,)U7 15 \,)00065 OOOb4tie A S C5 CMPR R,+,Ra ICMPR DIG & f ·t1ASE 71;) 000061;, COluiS aGE ASCF"!N ,,"eN DIU, TRMN CNVRT ijOOO67 ooou3i 77 GOOO 10 OOlb7'+ CMPI 10,R,. ;CIo4K F elf( DEC CN~RT 000011 00(1)12 78 000072 OOlU(.I1+ BEQ AtiCl0 000073 OOou33 •• 7')U 1£ ) UNDF Q)'M 000071+ 000.1.31,) SLI..C RO I sMUL.T ACCUM BY i 80 000075 0Oluu1 &C ASCF IN 000076 00Ou23 81 000077 001';)7 .. CMPI i,R4t I CHI< FI;JR BASE e U00100 OOOUU2 82 U0010l 0010041- BEQ ASC6 000102 000012 •• 83U 1E I lINDF SYI1 000103 OO.rL SUBiract of 'Register SSS from contents ~ register i:>DO; Results to ~ _:.::~ .. S;' .Z~ '~';'QL CMPR-- ·SSS. DOD 6 0101 SSS DOD . COMPUe RegisterSSS with register DOD'by subtraction. Results' not stored. . s. z. C" mf I ANDR SSS. '000 6 'ono SSS' DOD l~_~~(:outent8 of Regi'8ter SSS .Wlth. c()JiteDt~ of r~sister DDD~~~~lt~ t~ DOD. S.Z··· _..-....-.- XORR SSS, bob' '6- . ''OiIi ·-sss~· DOD eXclusive OR contents of Register SSSwith contents of register ,DOD. Results to DOD S. Z CLRR DOD 6 0111 DOD ODD CLeaR RegiSter to zero. S,Z INCR 000' 6- 0000' 6Of' ... DOD . INCrement contents of Register. DOD. ·ReSults to DOD S, Z . DBCR DOD 6 0000 010 ODD .DBCremeut contents of Register DOD. . Resuitsto DOD -. g,-'Z" .---- COMR DOD 6 0000 011 DOD orie's COMpiement contents of Register DOD•. Restilts to ODD S~ Z NBGR DOD 6 0000 100 riluj-' : ...~·s. c~plement eotitentsof~~gisterDDD. ~~ltsto.DDD .§..L;.Z.· CJ;JV . ~ ADCR-" ODD 6 ...-.. 0000-' 10i--- -DDi)- ADd Carry bit to contents of Register pOD. Results to DOD S, Z, C.OV RBGISTBR SHIFT Executable onlywitb Register O. 1. 2. 3- Shift Right instructions set the S flip-flOp with Bit 7 of the result after the instructIon. Add 2 cycles if shift 1s 2 bits or two bytes. ShIfts are not 1DI:erruptable. SWAP RR~D. 6 0001 --000 N-= o~ SWAP bYtes of register -RR--:-S equals Bit 7 ·ofresults of SWAP. NRR s. Z 1-.. ... _._._._._. __~~__. ______ N'" 1. SWAr.!»y!~s()f registerRR, ~n~p.t~m.~~~ to_o.r.!gi~!.! 6 0001 001 NRR N = 0. Shift Logical Left one bit, zero to low.bit~ S. Z ........ ___...... __ .... _.~__ .. . .N.=.'_l,Shift .LogiC!l ~~f;Wo b~~. zero to)ow_2 ..l>i~s. . . ... ____ . _________. S~._! .._____. RLC RR 6 0001 010 NRR N =0, Rotate Left one bit using Carry bit as bit 1 6 . S , Z. C • .' .•.. _~, _. _ ... > .~._ .N ~ 1.t.. R~t~_t.~ft two bits ,using c:: ~8. bit JI and9yali..l?.i..t..cl§.... ___ ..._ ...____ .. _ _ _ _. . . . . . ___ . ._ _ _ . S. Z!C• .QL SLLC RR<;n:::> 6 0001 011 NRR N = O. Shift LOgical Left one hit using Cas bit 16. zero to low bit. S, Z, C ~. SLR ......_._.. RR<;n> 8 6 ....... _..... _____• 0001 100 NRR N ':" J,Sll1!L~B!ealJ,.~._two .I)!t~_.!!8i!IK.9_as_~JJ7_d~.Y ~'_~__~H9 to IOW_2/:)i~, .S ... L...C. OV N- 0, Shift Logical Right one bit. zerotohigb bit. S, Z ...• _.._. __. . __. _.._I! _____ ..._. ___________ . N = 1, Shift Lo.gigJ..L~two ~~ zero to high.1!'O ~i!~..!.._..____ S Z SAR RR<,n > 6 0001 101 NRR N = 0, Shift Arithmetic Right one bit. sign bit C:Opled to high bit. S, Z ~ itRC 8 N .. 1, Shift Arithmetic Right tw~ bits, lIi~gn bit .copied to high bits. S. Z RR<:;il >" ·6---- -. "ooo'f- 110 NRR -. N =0, Rotate'Rl8iJt' one·bit"uliingC8.:rrj·as·hi£ 16. ---.. ------.------------- --S-,' Z~-C--·--' I RR<;nYT -'-6 . 8 N= 1, RotateRigbt two bits using C ~bit 16. OV as .bit 17... . .' _._~.1-~, C, OV I SARC 0001 Iii NRR N= 0, Shift Arithmetic Right ODe bit,-thruCarry, sign bit coPied to high bit. S, Z, C 8 N.: 1, Shift Arithmetic Right two bits,thru Carry and OV. sign bit copied to high 2 bite S, Z. C. OV -Bl- APPENDIX B INS T R U C T I 0 .N SET (continued) 'BRANCHES The Branch instructions are Program Counter Relative. I. e •• the Effective Address =PC+Displacement. PPPPPPPPPP is the ntsnlacementand S is 0 for +. 1 for -. If Memory is greater than 10 bits then the appropriate number of lead bits pppppp will be a part of the Displacement. For a ~d branch an addition is performed; for abaclcward branch a ones complement subtraction is performed. Computation performed on PC+2. \1:,\EMONIC I OPERAND CYCLES INSTRUCTION DESCRIPTION STATUS CHANGE B DA 7/9 1000 SO 0000 Branch unconditional, Program Counter Relative (+1025to -1024) ppPPf)p~ ppyp PP PPPP NOPP 7- 1000 SO 1000 NoOPeration t two words I p p p p p p PPPP PP PPPP BC I DA \ 7/9 - 1000 SO 0001 Branch on Carry. C= 1 BLGT ! DA pppppp pppp pp.pppp Branch if Logical Greater Than. _ C = J BNC BLL T BOV Ii DA DA DA 7/9 7/9 1000 SO 1001 PPPPPP_ pp?p_ pp _PPPP 1000 SO 0010 Branch on No Carry. C = 0 Branch if Logical LeSSTha. n. C = 0 Branch on OVerflow; OV = 1 ! pppppp pppp PP pppp 9N:::>V I DA 7/9 1000 SO 1010 Branch on No OVerflow. OV = 0 I pppppp Pm PP PPPP BPL I DA 7/9 1000 SO 0011 Branch on PLus. S =0 I -pppppp pppp pp pppp BMI DA 7/9 1000 SO 1011 Branch on Minus. S - 1 pppppp PPPP pp pppp BZE DA 7/9 - -- 1000 SO 0100 Branch on ZEro. Z = 1 BEQ DA peppPI PPPP PP PPPP Branch if EQual. Z- 1 BNZE DA 7/9 1000 SO 1100 Branch on No ZEro. z· 0 BNEQ DA PPPRlP pppp PP PPPP Branch if Not EQual. Z = 0 BLT DA 7/9 1000 SO 0101 Branch if Less Than. S¥OV=l pppppp pppp PP PPPP BGE \- DA 7/9 - - 1000 SO 1101 Branch if Greater than or Equal. S-\l-OV = (I PPPI1'P PPPP PP PPPP BLE I DA 7 / 9 - - - - - -100050 0110 Branch if Less than or Equal. ZV(S..-y.OV) = 1 pppppp PPPP PP BGT ! DA 7/9 - 1000 SO PPPP 1110 Branch if Greater Than. Z V (S-¥-OV) = 0 - \ pPpppp PPPP PP PPPP BUSC DA 7/9 .-. - -- 1000 SO 0111 Branch if Unequal Sign and Carry C-¥' S = 1 PWPW-' pppp PP PPPP - BESC DA 7/9-------- -fOi:xf--gO' 1111 Bran!:h if Equal-Sign and Carry C4lo-!': '" 0 ppPWR pppp. PP PPPP BEXT DA t E 7/9 l000~ SI EEEE Branch if EXternal condition is True; Field E is externally decoded to select 1 of 16 conditions. Response is tested for true condition. pppppp PPPP PP PPPP - ~_ I _ _ . __ ._.__ _._ .__ _ _._ _ _ _ _ _ _. _ _ ._ -B2- APPENDIX B INSTRUCTION SET (coDtinued) CONTROL Mr>.TEMONlC OPERAND CYCLES INSTRUCTION DESCR1P110N STATUS CHANGE -. - - GSWO 00 6 0000 110 OOD Get Status WorD in registerDD. Bits 0-3. 8-11 set to O. Bits 4. 12= C;S.- 13 = av; 6,14 = Z; 7, --IS == s. NOP . 6 0000 110 ION NO . SIN .<~- 6 0000 110 UN Software lDterrupt; pulse to Pen" * pin -. Restore Status Word from register _SSS;Bit 4 to c. Bit 5 to OV. Bit 6 to-z. RSWO SSS 6 0000 111 SSS S. Z. C, OV Bit 7 to S. ~ HLT 4 0000 000 000 -HaLT afterllex:t iDstrUctionis executed" Resmne on co.utrol start. EIS 4 0000 000 010 Enable lD:errupt System. Not·1nt Ie. OIS 4 0000 000 011 Disable interrUPt Systeni. Notlnt •hie. TCl 4 0000 000 101 Terminate CutTent interrUPt. Not Jnt~1JI)table. CLRC 4 0000 000 110 CLeaR CaiTvto zero; Not -Interruptable.- C I SETC 4 0000 000 111 SET Carry toone. Not Int Ie •. C I JUMP J DA 1 12 0000 11M 000 AM _100 1lOO_ Jump to address. Program counter is set to 16 bits .of A's. _ MAA AAA AAA JE DA 12 -0000 000 100 Jump to address.-~Enable interrupt system. Program counter is set to HAA AM AOl 16 bits of A's. AMA MA AM JO OA 12 0000 000 100 -Jump to address. Disable interrupt system. Program counter is set 11M AM AIO to 16 bits of A's. AAM MA AAA JSR 88.0A 12 OdO()----OOO -100 Jump and save Return address (PC+3) in register designatec by 1B8. 88M AAA AOO Program counter is set to 16 bits olA's; BM 11 AAM AM AM JSRE BB.OA 12 0000 000 100 Jump and Save Return and Enable interrupt system. Return (PC+3) is - BBM MA AOI saved in register lBB. Program counter is set to 16 bits of A's. BBfll i AMA AAA AM ; JSRO 0000 000 100 Jump _and save Return and Disable interrupt system. Return (PC+3) 88M AAA AlO is saved in register 11m. Program counter is set to 16 bits of A's. Be,tll , AAM AAA AM I 1-._-----_. ..B&- INS T R U C T ION SET (continued) D1REcr ADDRESSED DATA - MEMORY Field aaa aaa is dependent on the width of memory. 16 bits is maximum for aaaaaaAAAAAAAAAA. MNEMONIC OPERAND CYCLES . INSTRUCTION DESCRIPTION STATUS·CHANGE I MVO SSS. A 11 1001 000 SSS Mo V Out data from register SSS to address A-A. I aaaaaa AAAA AAA AAA ---- .... - .- II .'~ ·MVI A. ·ODD-- - 10 1010 OOU ODD Mo Ve In data from address A - A to register ODD. aaaaaa AAAA AAA AAA -.-.-.--- -- -"-"- ---,.-.-----._- -. -- -. - - -" ---- ... _- ..-.' -ADtf-----·· A: DDO--- - .. ..---. ••~~. O_·"_·~· ,. '_'"-" - S. Z. C. ov " ,..-~-.- 10 1011 000 DDD ADD data from address A - A to register DOD. Results to DDD. aaaaaa AAAA AAA AAA I Soo------- A;-rmtf· lO 1100 000 DDD - SUBtract data from address A - A from' register DOD. Results to DOD. S. Z. C. ov I ---..., _ _.- aaaaaa AAAA AAA AAA •..- - ." ---_._. _.. . .• II .. .. _ .. ·-To ~ CMP A: SSS 1101 000 SSS CoMPare data from address A - A with register SSS by subtraction. S. Z. C. OV aaa aaa AAAA AAA AAA Results .not stored. .. . . .....- . AND A. DOD 10 ·1110 000 DDD logical AND data from address A - A with register DDD. Results to DDD. S. Z aaaaaa AAAA AAA AAA -xoiC· A. Dim - 10 1111 000 DDD eXclusive OR data from address A - A With register DDD. Results to ODD. S. Z aaaaaa AAAA AAA AAA --~---. INDlREcr ADDRESSED DATA - REGISTER MMM Source data is located at the address contained in Register. MMM 4. 5 post increment R4 or R5. MMM 6 - MVO instruction - post increment R6. PUSH data from Register SSS to the Stack. Other instructions - pre-decrement R6. PULL data from the Stack to be used as the first operand. MVO@ I SSS, MMM I 9 1001 MMM SSS MoVe Out data from register SSS to the address in register MMM Note: SSS = MMM = 4, 5, 6 or 7 not supported. 1 PSHR \ SSS 9 1001 110 SSS PuSH data from RegisterSSS to the stack. ! .-----r----..... 1 , I i· ! MVl@ \ MMM. DDD 8* 1010 MMM DDD I MoVe In data to register DDD from address in register MMM. i I I P~~R lDDD 11 1010 110 ODD! PULl data from the stack to Register DDD. ~DD@ ____ i~MM.DDD8_~_1 8 1011 1011 MMM DOD. ~:."':.!.,":':: ~'o~". in,,,,:--, MMM to the oontent. Of~"'ote' is. Z.£.O' I SUBt@ \ MMM. DDD 8 *.1 lIOO MMM DDD: SUBtract data located at address in Register MMM from contents of : Ii CM~ ___MMM=~~D 8:t--ilOl--MM~-~ ANOO I !_=:;~:'~::~~:::e:::~::o~M ;,jth~S;'-- ,S. Z. pV -t MMM. DDD regi"~ 8• illO MMM DDD 1"'",,1 AND """ents of DOD with data 100ated at a i~z. C, OV c. txOR'@MMM, DOD 8* Ull MMM DDD 1·~~~I:i:~~M~o~~::t~~f ~~!;r DOD with~ta -l~~t-;d~t ad~es;---· ! v' L i in register MMM. Results to ODD. _ ...__ .__ 1 * Add 3 to number of cycles if MMM=6. -84- APPENDlXB IN S TRue T 10 N SET (continued) IMMBD-IATB DATA -'REGISTER' The number of iiiiii, bits depends ()n the lIleJIIOry width, 16 bits is 1U.Ximum. C OPBRAND CYCL$S INSTRUCTION -DESCIU:P'l'ION a'~A'",va !WOI SSSiI 9 1001 111 SSS ~ KoVeOUt Immediate data from register SSS to PC+l 1-=0,.., MVII - '-Z;DDD B tiiiii II II 1010 III 111 III' (field) - DDD 'MoVe In Immediate data to register DDD from PC+l ,__ iiiii! ',' .tUI.~, ,.lII, ~----,-" ADDI I,DDD 8 1011 111 '~~~ , ~ ~~~~~iate data :to contents of' register"' DDD. S, Z, C, OV iiiiii III I III III Resu1 ts to DDD,. 'I,DDO-·· t~~~ 8 1100 111 ODD SUBtract Immediate data from contents of register S, Z~ C. OV iiiiii lUI III III DDD~ Results to DDD. I,SSS 8 1101 111 SSS CoMPare Immediate data from contents of register S, Z, C, OV iiii,it IIII' III III SSSby subtract,~I,t.",,~~u.li;.s ,~qt ,si;.Qr.@q. ANDI I~DDD II ino Iii DDD logical AND Immediate data with contents of S, Z 'XOlU:· ..·,· .. " iiiiii IIII UI III register DOD. Resu.lts to ODD. - ....•-- I,DDD 8 1111 111 DOD eXclusive OR Immediate data with contents of s, z iii iii IIII III III' reqisterDDD. Results to DOD. iDBD' , 4' 0000 000 001 Set DOuble Byte Data for the next iD8t1'tK:tion which must be an f'his instruction is nonnally external ,reference instruCtion. The effective address of the external reference instruction will address the low order data supplied by .the. assenmleras byte; the. address of the bighorder data byte will be EA+l if required to properly generate register 4. 5 or 7 is used. If register 1-3 is used the EA wil. machine cqde. access the same byte twice resulting in both bytes of data being the same. Use of modes' 0 aud6 are not supponed by this instruction I .INDIRECT ADDRESSED DOUBLE BYTE DATA ;.. REGISTER SDBD 4 0000 000 001 MoVe In double byte data from the address in register MMM to I MVI@ MMM.QQQ.. f - " '10 . , 1010 MMM DDD t--~e!_~p:.._ "" - ' - - - - f- -"---"._"---'''.'--' ,. SDBD" 4 000 000 001' ADD double byte data from the address in register MMM to the S. z. c.-bv ADD@: MMM. I?QP - - .. 10 . .loil MMM DDD _~ntel!t,Q.L~!!&!!~~1:. POO· ._R~JIJ!JJJ.9J;mD... " SOOD -,,-'--'~ 4 ----"".,,-----0000- '''000'''''' 001' SUBtract double byte data located at address. MMM from the S. Z. c. OV SUB@ ,MMM~.PD.D, 10 - .......... _ .. 1190 ¥~M DOD , contentof,!:~gt~~LPQP~, ,.R~(J~!!...t2...Q.Pp.._,_, ____ ._~_"'_ _ ..,__ 1'---- ...... , .. '·"4 ~. SooD 0000 000 001 CoMPa~e doublebyte' data located at address in registerMMM S. Z. C, OV CMP@ MMM.P!?Q: -:--';4'" 10 ' 1101 MMM SSS _~~_content of register SSS by subtraction. Results is not store~~, ,,' ., ':- . "'.--.-.".". '"-''-OOOO··-''-~'-~''' logical AND double byte data located at address in register MMM SDSD AND@ . MMM, DDD 10 500D----- _...".- ... , ..... _'_ .. .•. '4- .. , 1110. MMM DOD ~th tb~colitent of rgister DDD~ Results to DDD. " "0000 -'OOO-~- eXclUSive OR double byte data located at address in register MMM I". S, Z S, Z XOR@ MMM, DDD 10 111 MMM DDD with the content of register DDD. Results to DDD. I ..S5- APPENDIX B INS T R U C T ION SET (coDtinued) Note: '1ll~ 8OBD.command is provided by the assembler wIlea the immediate data 1s greater than the IMMEDIATE DOUBLE am DATA - REGISTER meQlory width and require!! twO ~es. MVII I,DDO 14- 00'00 . 000 001 MoVe In Immediate double bYte data to reqister 1010 III DOD DOD. L's will be low byte and U's upper byte. XXLL LLL LLL XX = don't care. XXUU OW UUU 5, Z, C, OV ADDl t,DOD n 0000 000 001 ADDDRmediate double b,yte data to contents of 1011,. 111 DOD register DOD. Results to DOD. L's indicate low XXLL LLL LLL byte of literal, U's upper byte. XXW UUU OW 5, Z, C, OV SUBX .1,DDU 14- 0000 000. 001 SUBtract I . .ediate double byte data from contents 1100 III DOD of register DOD. Reaul ts to DOD. L's indicate XXLL LLL LLL low byte of literal,U's upper byte. xxutJ ODD DUU CJU>1 1,585 14- 0000 00.0 001 coilPare DRmediate double b,yte data with contents 5, Z, C, OV 1101 111 SSS of' register SSS by subtraction. Results not XXLL LLL LLL stored. L's indicate low byte of literal, U's XXW UUU UUU upper byte. S, z ARD:f I~DDD. 14 0000 0.00 001 logical AND Immediate double byte' d~ta with the 1;110 111 DOD contents of RegisterDDD. Results to regiater 'XXLL LLli t.i.i. ODD. L's in~cate low byte of literal, U's upper XXDU WU lJUU .byte.• s, Z x.U 1.DDD 14- 0000 000. 0.01 exclusive OR Immediate double byte data with the 1111 111' QeD contents of registerDDO. Results to Regiater XXLL LLL LLL DOD. L's indicate low byte of literal, U's upper XXUU OW OW byte .. , -'----~-.-- GLOSSARY OF TSaNS Sss - :~a~r MMM AddresS Mode ·OJ)p" . ~ri 1legtste.-. 000 direct address in location following instruction. n ~'ofSbifts 001 indirect address for Register 1 RR: . RegtatettoSb1ft(OIllY 0'·3 aBowed) oio Indirect address for Register 2 ".AAA/tAA 'Memory- addres8for Jwnp. 011 indirect address for Register 3 AAAMAAAAA (new Program Counter) 100 .indirect addrep for Register 4, post increment BBRe8f$tet to save old PC in for JUlnp. (Reg =188, 4,5. or 6) 101 ,. indirect address for ReJrister 5, post increment S . S j g n of address disp1acemeIlt for 8ranch(PC relative). 110 indirect address for Register 6. post increment for MVO only pppppp Pl'PPPPPPPP ;. Address displacement for Branch indirect address for RegiSter 6. pre decrement for all instruc- pppppp is dependent on the memory word size. tions except MVO. aaaaaa AAAAAAAAAA - Direct address of data word. . III indirect address for Register 7. POSt increment. aaassa is dependerit"on the memory word size. (Immediate data in I.cation following instruction.) liiiU nnmnr': Immediate data word. .liiiii is dependent on memory LLl;..LLLLL Lower 8 bits of double byta data. word size. UUUUUUUU Upper 8 bits ot doUble .bytedata. ·86- APPENDIX C S16LNK OBJECT MODULE UNKER SAMPLE DIALOGUE S16LNK VER.-OIA LOAD MODULE ? : IOCONVRT" MAP ?'lY/N OR F=NAME) :Y OBJECT MODULES :10CNVROB :INASCOB :OUTASCOB :TTYINOB :TTYOUTOR : GI S16LNK V~n.01A ,0:18 JAN 30,~75 LOAD MODULE:IOCQ..NV.~T **** MODULE:Cl'-lVRT GLOBALS IOCNVR 000000 **** MODULE: INASC GLOBALS HEXBIN 0003.15 INTBIN 000401 OCTBIN 000405 BINBIN 000411 **** MODULE:OUTASC GLOBALS HEXASC 000543 INTASC 000547 OCTASC 000555 BINASC 000561 **** MODULE:TTYIN GLOBALS TTYIN '001011 **** MODULE:TTYOUT GLOBALS TTYOUT 001234 TYPCHR 001257 TYPH2 001~70 LINKAGE SUMMARY: INITIAL ADDRESS 000000 FINAL ADDAESS 001306 ENTRY ADDRESS 000000 APPENDIX D ASCII CHARACTER CODES Char 7 Bit Octal Code Char 7 Bit Octal Code Space 040 @ 100 041 A 101 " 042 B 102 # 043 C 103 $ 044 D 104 % 045 E 105 & 046 F 106 047 G 107 ( 050 H 110 ) 051 I 111 * 052 J 112 + 053 K 113 054 L 114 055 M 115 056 N 116 / 057 a 117 0 060 P. '20 1 061 Q 121 2 062 R 122 3 063 S 123 4 064 T 124 5 065 U 125 6 066 V 126 7 067 W 127 8 070 X 130 9 071 Y 131 072 Z 132 073 [ 133 074 \ 134 = 075 J 135 ? 076 077 t .- 136 137 -D1- APPENDIX E GENERAL INSTRUMENT CORPORATION S16SIM~1 SIMULATOR COMMANDS RT SET REGISTER TRACE OR TRAP MT SET MEMORY TRACE OR TRAP RAM DEFINE RANDOM ACCESS MEMORY BLOCK ROM DEFINE READ ONLY MEMOR Y BLOCK 10SR DEFINE I/O DEVICE STATUS REGISTER 10DR DEFINE I/O DEVICE DATA REGISTER INT DEFINE INTERRUPT EXT DEFINE EXTERNAL CONDITION LOAD LOAD PROGRAM E EXECUTE PROGRAM EDR EXECUTE AND DISPLAY REGISTERS S STEP PROGRAM C CONTINUE PROGRAM X EXIT SIMULATOR IA INITIALIZE ADDRESSES SA SEARCH ADDRESSES CPA CLEAR PREVIOUS ADDRESSES TLIM SET EXECUTION TIME LIMIT RADX SET DISPLAY RADIX SLIM SET STACK LIMITS MB MODIFY BRANCH INSTRUCTION MJ MODIFY JUMP INSTRUCTION DRT DISPLA Y RE GlSTER TRAPS AND TRACES DMT DISPLA Y MEMOR Y TRAPS AND TRACES DMB DISPLAY MEMORY BLOCKS DIOS DISPLAY I/O DEVICE STATUS REGISTERS DIOD DISPLAY I/O DEVICE DATA REGISTERS DINT DISPLA Y INTERR UPTS DEXT DISPLA Y EXTERNAL CONDITIONS R DISPLA Y /MODIFY REGISTER A DISPLA Y /MODIFY ADDRESS SR DISPLAY /MODIFY CPU STATUS REGISTER CLK DISPLA Y /MODIFY CPU CLOCK RATE INFF DISPLA Y /MODIFY INTRPT FF DR DISPLA YREGISTERS DA DISPLA Y ADDRESSES DET DISPLA Y EXECUTION TIME DSYM DISPLA Y. SYMBOL VALUES DPA DISPLAY PREVIOUS ADDRESSES, IE, PC VALUES DMXS DISPLAY MAXIMUM STACK USED APPENDIX F OBJECT FILE FORMAT The object file produced by S16XAL contains relocatable object code generated during the assembly process. The file is composed of one or more 64 word records, each containing a three word header and up to 61 object data words. The first word in a"ll records is equal to either 1 or 2 (-lor -2 if the record is the last) which indicates a relocatable or absolute module respectively. The second word in the first record contains the assembly base address or origin, in subsequent records the second word has no significance. The third word in all records contains the number of object words following in the record. The remaining significant words in each record contain object code sequences derived from the assembly of instructions or directives. RE LOCATABLE BINARY FILE RECORD FORMAT 16-bit record header word ~ ----------------~ assembly base address number of data containing words in record 64 word data word 1 record data word 2 data word n RELOCATABLE O~ECT CODE SEQUENCES The data information in each record of a S16XAL object file is grouped into sequences of variable length. The first word in each sequence contains a link/load code which indicates the number and nature of object words following in the sequence. Code No. Data Words Object Word Significance 0 1 address adjustment 1 1 absolute word 2 2 absolute word 3 3 absolute word 4 1 relocatable word 5 2 absolute word, relocatable word 6 3 absolute word, 2 relocatable 8 -bit bytes 7 2 2 relocatable 8 -bit bytes 8 3 absolute word, 2 relocatable lO-bit bytes 9 1 external reference word 10 2 absolute word, external reference word 11 2 absolute word, external reference displacement 12 3 absolute word, 2 external reference 8 -bit bytes 13 2 2 external reference 8 -bit bytes 14 3 absolute word, 2 external reference lO-bit bytes 15 1 entry address word 16 2 module name" 1V 2 global. symbol 18 2 external symbol APPENDIX G BINAR Y PAPER TAPE FORMAT Binary paper tapes produced by S16BPT consist of variable length records which contain a four frame header and up to 132 data frames. The first significant frame in all records indicates a relocatable or absolute tape, 001 or 002 respectively (377 or 376 in the last record). The second and third frames in the first record contain the assembly base address or origin (low byte, high byte respectively); in subsequent records these two frames have no significance. The fourth frame contains the number of object data frames in the remainder of the record. The last data frame is ·followed by a record checksum frame which is used during loading to verify that the record has been read correctly. Object code sequences are the same as in a relocatable binary file except that the link/load code occupies one tape frame and each object data word occupies two tape frames, low byte, high byte respectively. The first record on a tape is preceded by approximately 50 frames of blank leader, the last record is followed by blank trailer of the same length and each record is separated by two blank frames. BLANK LEADER f HEADER CODES HEADER I - Relocatable 2 - Absolute B - 1 - Last Block of Relocatable L - 2 - Last Block of Absolute _0 UNK/ LOAD CODES C Same as codes for OBJECT FILE K FORMAT. 1 ,,------------ ___ .-_ __ -"-- .. .. .•. CHECKSUM FRAME I-...::B:::::.L~A!.:.N.!.!K~G~A~P______ ._____ _ BLANK GAP Header Blank Address \ Blank Address IFrame Count I__L/ L Fram~..__.._____. ._ ..~.__. Ii Low .. _..... -.- ..... -.. ---.- -----.--,,-.-...... I High i-~t·~~~~e __. __ ~- ·------01 ~gh , -------.... ~~-.-- ...... ~"",-," ... - -. ,,'." - .. ~ . THE SERIES 1600 SOFTWARE LINE UP ~ RESIDENT ON-LINE MINICOMPUTER TIMESHARE FIRMWARE SOFTWARE SOFTWARE SOFTWARE I S16MTR MONITOR ~ S16BMR Binary"Math Routines ~l] S16AL Assembler ]1] S16XAL Assembler J.l S16XAL Assembler ~] I S160DP On-Line Debug Program ]J S16CCR Code Conver- sion Routines Wl S16TXE Text Editor W S16SIM Simulator 1. S16SIM Simulator ~] I S16L~ Relocatable Loader IJ" S16~l I nput(Output Drivers p" S16RLL Relocatable Linking Loader ID S16LNK Object Module Linker ~ S16LNK Object Module Linker ~] I ] ..... S16UTL S16FPR S16XRF S16XRF S16DGS Basic Utilities 1. Floating Point Routines Diagnostics 1 Concordance Generator W Concordance Generator m I S 16Dn] Memory Dump S16DMR Decimal Math Routines 1] S16MPC Macro Processor 1 S16BPT Binary Tape Generator 111 S16BPT Binary Tape Generator 1: S16S0P String Operators l. S16LGP Language Gener- ation Package ~ S16RTG ROM Tape Generator 1 ) S16RTG ROM Tape Generator J GENERAL INSTRUMENT CORPORATION EASTERN AREA SALES HEADDUARTERS, SOO W. John St " Hicksville, N,Y, 11802, 151S) 733·3107 CENTRAL AREA SALES HEADQUARTERS, 3101 West Pratt Blvd., Chicago, III. SOS45, 13 12) 338·9200 WESTERN AREA SALES HEADQUARTERS, 71 20 Hayvenhurst Ave. , Van Nuys, Calif. 9140S, 1213) 781-04 89 GENERAL INSTRUMENT CANADA LTD" 61 Industry St., Toronto 33 7, Ontario, C. nad. , Te l: 14 16) 763-4133 GENERAL INSTRUMENT MICROELECTRONICS LTD " 57161 Morti mer St., Londo n, WI N 7TO, En glan d, Tel : 01·636·2022 GENERAL INSTRUMENT EUROPE S.P.A., Piazza Amen dola 9, 20149 Milano, ltaly, Tel: 469·7751 GENERAL INSTRUMENT FRANCE SA, 11-1 3 Ru e Gand on, 75·Par is·13eme, France, Tel: 588·74·31 GENERAL INSTRUMENT DEUTSCHLAND GMBH ,IMo. Produkigruppe) Nordendstrasse, lA 8000 Mu nchen 40 Tel: 28-40·31 GENERAL INSTRUMENT INTERNATIONAL CORP., Fukide Building, 17 Fukide·cho.. Minato·ku, Tokyo 105, Japan, Tel : (03) 437·0281-5 GENERAL INSTRUMENT OF TAIWAN LTD ., P,O. Bo x 22226 Taipei, T. iwan, Tel: 933861·3 Printed in U,S,A, © 1975, General I nstrument Corporation