home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / emulate / systems / pc370 / doc / user.doc < prev    next >
Text File  |  1988-01-04  |  43KB  |  955 lines

  1.  
  2. USER.DOC PC/370 User Documentation
  3.  
  4. Copyright 1987 Donald S. Higgins
  5.  
  6. Don Higgins
  7. 6365 - 32 Avenue North
  8. St. Petersburg, Florida 33710
  9.  
  10. E-mail CompuServe 73047,1113
  11.  
  12. PC/370 users:
  13.  
  14. This is the user documentation for the PC/370 cross assembler,
  15. linkage editor, and emulator for 370 assembly language users.
  16. The PC/370 package provides the capability to assemble, link,
  17. and execute IBM 370 assembler programs on any 80x86 MSDOS 2.0+ micro
  18. computer such as the IBM PC, XT, AT, PS/2, Compaq, etc.
  19.  
  20. Chapter table of contents:
  21.  
  22.  1. M370.COM macro preprocessor
  23.  
  24.  2. A370.EXE cross 370 assembler
  25.  
  26.  3. L370.EXE cross 370 linkage editor
  27.  
  28.  4. E370R42.EXE run time 370 emulator
  29.  
  30.  5. Technical hardware and software specifications
  31.  
  32.  6. ASSIST extended instructions for student use
  33.  
  34.  7. DEBUG interactive debugging facility
  35.  
  36.  8. Floating point instructions and scientific subroutines
  37.  
  38.  9. XA extended architecture instructions
  39.  
  40. 10. System subroutine library
  41.  
  42. 11. COBOL call interface
  43.  
  44. 12. Reference publications
  45.  
  46. *********
  47.  
  48. Chapter 1.  M370.COM macro preprocessor
  49.  
  50. *********
  51.  
  52. The M370 macro preprocessor has the following command format:
  53.  
  54. A>M370 file
  55.  
  56. where file is the name of a source macro program file which has the
  57. suffix (.MLC).  The source file must be in ASCII text format with
  58. each line terminated by a line feed character.  The only output from
  59. this program is a source basic assembler file with expanded macro
  60. statements.  The suffix of the output file is (.ALC).
  61.  
  62. Any number of macros can be used by M370 input files and must be
  63. defined in individual source macro files with the file name equal to
  64. the macro name and a suffix of (.MAC).  These macros must be placed on
  65. the default drive for access by M370.  For more speed, these files may
  66. be moved to RAM disk.
  67.  
  68. *********
  69.  
  70. Chapter 2.  A370.EXE cross 370 assembler
  71.  
  72. *********
  73.  
  74. The A370 assembler has the following command format:
  75.  
  76. A>A370 file/options
  77.  
  78. where file is the name of a source program file which has the
  79. suffix (.ALC).  The source file must be in ASCII text
  80. format with each line terminated by a line feed character.
  81. Any number of editors including SEE can be used to create ALC files.
  82. An optional drive and path may be specified such as B:\dir\file.
  83. The options which can be specified are as follows:
  84.  
  85.   A - alignment option. Default is on.
  86.   C - object code option. Default is on.
  87.   L - produce listing file (.PRN). Default is none.
  88.   T - trace assembler execution. Default is off.
  89.   X - produce symbol and literal cross reference. Default is none.
  90.  
  91. If an option is on by default, specifying it will turn it off.
  92. For example:
  93.  
  94. A>A370 B:DEMOPNUM/LX
  95.  
  96. will read the source file B:DEMOPNUM.ALC and produce the object
  97. code file B:DEMOPNUM.OBJ and the listing file B:DEMOPNUM.PRN.
  98.  
  99. The A370 assembler conforms to the OS/VS IBM 370 Assembly
  100. Language as defined in the IBM manual GC33-4010 with the
  101. following limitations:
  102.  
  103.   1.  No continuation lines.
  104.   2.  Maximum control sections and dummy sections is 255.
  105.   3.  Macros and system variable symbols are not supported (see M370).
  106.   4.  OPSYN statement not supported.
  107.   5.  EQU third operand (type attribute) not supported.
  108.   6.  Scale, exponent, and bit length data modifiers not supported.
  109.  
  110. Extended features include the following:
  111.  
  112.   1.  Data constant types F and H may use arithmetic expressions.
  113.  
  114.   2.  Extended ASSIST instruction set including XREAD, XPRNT,
  115.       XDECI, XDECO, AND XDUMP as defined in the book Assembler
  116.       Language with ASSIST by Ross A. Overbeek.  Also 2 more
  117.       instructions XFILI and XFILO are added to allow changing
  118.       default ASSIST input and output files at execution time.
  119.  
  120.   3.  ASCII character strings may be defining by using double
  121.       quotes instead of single quotes in DC and self defining
  122.       character constants.
  123.  
  124. *********
  125.  
  126. Chapter 3.  L370.EXE cross 370 linage editor
  127.  
  128. *********
  129.  
  130. The L370 linkage editor has the following command format:
  131.  
  132. A>L370 file/options
  133.  
  134. where file is the name of an A370 object code file (.OBJ) and
  135. may specify a specific drive.  The options supported by the
  136. linkage editor are as follows:
  137.  
  138.   B - create VS COBOL callable subroutine file (type .BIN).
  139.   D - set debug mode for emulator. Default is off.  When option D
  140.       is on, interactive debug is entered at beginning of each
  141.       COM or BIN file execution.
  142.   G - load and execute with no file output. Default is off.
  143.   I - turn off all interrupts from keyboard.
  144.   L - list CSECT addresses and lengths. Default is off.
  145.   M - create 370 code module without COM prefix code.
  146.   O - dump input object code records in hex. Default is off.
  147.   P - force floating point option off even if 80x87 installed.
  148.   X - cross reference of external symbols. Default is off.
  149.   U - allow unresolved external references
  150.  
  151. For example:
  152.  
  153. A>L370 B:DEMOPNUM/LX
  154.  
  155. will read the object code file B:DEMOPNUM.OBJ and produce the binary
  156. command file B:DEMOPNUM.COM, and the listing and cross-reference file
  157. B:DEMOPNUM.LST.  Note that since DEMOPNUM calls the external
  158. subroutine PET, the subroutine library L370.LIB must be available.
  159. The binary command file B:DEMOPNUM.COM may be directly executed by the
  160. MSDOS command:
  161.  
  162. A>B:DEMOPNUM
  163.  
  164. When the above command is executed, the program will load at X'0200'
  165. and the fetch routine linked with the program will load the
  166. emulator E370.EXE in high memory and transfer control to it.
  167.  
  168. The linkage editor uses two concatenated subroutine library
  169. files.  The first file is named file.LIB and may contain
  170. any number of A370 subroutine object modules which are called by the
  171. modules in file.obj.  This file is optional and only called modules
  172. are included.  The second file is named L370.LIB and may contain any
  173. number of A370 subroutine object modules which are commonly used by
  174. multiple programs.  An L370.OBJ file is included with the PC/370
  175. package and contains sample time and date routines.  The MS-DOS COPY
  176. command with option /B may be used to concatenate A370 object modules
  177. in either library file.  Note module references must be resolved in
  178. one sequential pass of library so backward module references may cause
  179. unresolved entry.
  180.  
  181. The linkage editor listing file (.LST) shows relative entry point
  182. and segment lengths and optional cross reference by segment.  The
  183. last line of the listing contains ENT/LNG which is the 370 relative
  184. entry point of the module and the length of the entire module.
  185.  
  186. *********
  187.  
  188. Chapter 4.  E370R42.EXE run time 370 native machine code emulator
  189.  
  190. *********
  191.  
  192. The emulator is transparent to the user when using A370 and L370 to
  193. create MSDOS command files.  The emulator is dynamically executed by
  194. the 80x86 COM file prefix generated by L370.  The 370 machine code
  195. starts at X'210' from the beginning of the COM file.  The origin of
  196. the 370 virtual address space for a COM program starts at X'10' from
  197. the beginning of the COM file.  The execution of the 370 machine code
  198. will start at the specified relative start address plus hex 200 with
  199. that absolute address in register 15.  Register 1 will point to
  200. standard MVS parameter list address at location X'80' with EBCDIC text
  201. passed from MS-DOS command line.  Register 13 will point to standard
  202. save area in ASCB and register 14 points to return to detach
  203. instruction in ASCB to exit to MS-DOS.  If a program check occurs, the
  204. interactive debug facility will be invoked and will initially display
  205. the general registers and the program status word at the time of the
  206. interruption.  See DOC\SYSTEM.DOC SPIE supervisor call for facility to
  207. handle program checks.  Also see MAC\MVS.MLC for example of how to run
  208. programs in problem state with your own supervisor shell.
  209.  
  210. A new facility with PC/370 release 4 is the ability to make the
  211. emulator resident by simply executing it directly.  The resident
  212. emulator reserves about 50k for code and uses an 80x86 hardware
  213. interrupt to transfer control when needed at execution time.  To
  214. remove the current resident emulator, simply execute it directly
  215. again.  Release 4.0 and 4.1 used interrupt hex DC.  Release 4.2 uses
  216. hex 60 within the Micro Focus Extended Memory (XM) real interrupt
  217. handler range of hex 60-6F.  See DOC\PTF.DOC for pathc to change
  218. interrupt in case it conflicts with another user installed software
  219. package.
  220.  
  221. With release 4.1 a new system queue area (SQA) memory option has been
  222. added to define a memory which can be shared by all COBOL subroutines
  223. and which is allocated in the resident emulator address space.  The
  224. size of the SQA is specified by a single hex parm when making the
  225. emulator resident.  The size is in hex paragraphs and the default is
  226. 10 or 256 bytes.  For example, the following command would make the
  227. emulator resident with an 8k byte SQA:
  228.  
  229.   C>E370R42 200
  230.  
  231. With the SQA facility, COBOL assembler subroutines can issue standard
  232. file I/O with dynamic buffers allocate from SQA. See BAT\RUNCBL.BAT
  233. for demo.
  234.  
  235. With release 4.2, PC/370 supports Micro Focus COBOL/2 assembler
  236. subroutine calles in normal MS-DOS mode or in extended memory XM mode.
  237. In both cases the emulator must be resident before starting the COBOL
  238. program via workbench or run time executive with or without XM.  In
  239. XM mode, the emulator still runs in real mode after requesting XM to
  240. mode the called subroutine code (BIN file) and the argument data
  241. segments to base memory area for access in V=R real mode.  This
  242. creates the XM restriction that there must be sufficient base memory
  243. for called BIN file and data segment at the time of the call.  Also,
  244. the emulator must not attempt to access memory beyond end of BIN or
  245. data segments in real memory.  The emulator can use SQA in XM mode.
  246. See BAT\RUNCBL.BAT for demo of XM mode subroutines (requires XM.EXE
  247. and RUN.EXE from Micro Focus).
  248.  
  249. There are five distinctly different ways to execute the E370 emulator:
  250.  
  251.   1.  Direct execution to make it resident if not currently resident.
  252.  
  253.   2.  Direct execution again to remove current resident copy.  If
  254.       another software package is using interrupt, an error message
  255.       will display.  See DOC\PTF.DOC to change interrupt number.
  256.  
  257.   3.  Execution of a 370 COM module without E370 resident causes
  258.       dynamic loading of E370 in high 64k of MS-DOS memory to support
  259.       execution of 370 code in the COM module.
  260.  
  261.   4.  Execution of a 370 COM module with E370 module resident causes
  262.       execution of resident copy via cross memory interrupt facility.
  263.  
  264.   5.  Execution of a 370 BIN module from within Micro Focus COBOL run
  265.       time environment causes execution of resident copy via cross
  266.       memory interrupt facility.  In XM mode, a protected interface
  267.       routine in the emulator is called directly by the BIN module
  268.       which in turn issues interrupt to execute emulator in real mode.
  269.  
  270.  
  271. *********
  272.  
  273. Chapter 5. Technical specifications
  274.  
  275. *********
  276.  
  277.    1.  A370.EXE requires 256k memory to execute and can handle source
  278.        programs with over 1000 labels.
  279.  
  280.    2.  L370.EXE requires 256k memory and can handle load modules up to
  281.        50k bytes long.
  282.  
  283.    3.  E370R42.EXE requires 50k plus SQA which includes the emulator,
  284.        and the extended SVC support functions, and interactive debug.
  285.        A production only copy of the emulator named E370P42.EXE is
  286.        included which only requires 40k but does not include
  287.        interactive debug facility or the ASSIST extended instructions.
  288.        This version saves resident base memory, but should only be
  289.        used for fully tested programs or programs with their own
  290.        program check handlers for error recovery.
  291.  
  292.    4.  E370R42 supports all the non-supervisor state IBM 370
  293.        instructions as defined in the IBM/370 XA Principals
  294.        of Operation manual SA22-7085 except the conditional
  295.        swapping feature instructions.  Short, long, and extended
  296.        floating point instructions are supported provided 80x87
  297.        is installed.
  298.  
  299.    5.  The minimum configuration for PC/370 is as follows:
  300.        a.  80x86 processor.  XM only supported on 80286/80386.
  301.        b.  256k RAM memory which allows execution of 370 program in
  302.            128k virtual address space.  Maximum virtual address space
  303.            is about 512k on 640k machine.
  304.        c.  1 floppy disk drive.
  305.        d.  80x87 only required for floating point instructions.
  306.  
  307.    6.  A benchmark program consisting of calculating the first
  308.        100 prime numbers was run in interpretive BASIC using
  309.        16 bit integer arithmetic.  It took 67 seconds on a
  310.        4.77 MHZ 8086 system.  The same program was rewritten in
  311.        370 assembler using 32 bit fixed point arithmetic.  It
  312.        took 25 seconds to execute on the same system.  This
  313.        benchmark program is included as a demo called DEMOPNUM.ALC.
  314.  
  315.        The demo may be run with the following commands:
  316.  
  317.          A>A370 DEMO\DEMOPNUM/LX  (create DEMOPNUM.OBJ)
  318.          A>L370 DEMO\DEMOPNUM/LX  (create DEMOPNUM.COM)
  319.          A>DEMO\DEMOPNUM
  320.  
  321.    7.  The following error messages are supported:
  322.  
  323.        A370/L370
  324.  
  325.         E01 - DUPLICATE LABEL
  326.         E02 - INVALID LABEL
  327.         E03 - SYMBOL TABLE FULL
  328.         E04 - INVALID OPERATION CODE
  329.         E05 - UNDEFINED OPERATION CODE
  330.         E06 - UNDEFINED LABEL
  331.         E07 - INVALID OPERAND
  332.         E08 - MEMORY FULL
  333.         E09 - EXPRESSION INVALID
  334.         E10 - SELF DEFINING TERM INVALID
  335.         E11 - ARITHMETIC OVERFLOW IN EXPRESSION
  336.         E12 - TOO MANY EXTERNAL SYMBOLS
  337.         E13 - NO BASE REGISTER AVAILABLE
  338.         E14 - LENGTH ERROR
  339.         E15 - OPERAND ERROR
  340.         E16 - DATA CONSTANT DUPLICATION FACTOR ERROR
  341.         E17 - DATA CONSTANT TYPE ERROR
  342.         E18 - DATA CONSTANT LENGTH ERROR
  343.         E19 - DATA CONSTANT DATA ERROR
  344.         E20 - START SEQUENCE ERROR
  345.         E21 - LTORG SEQUENCE ERROR
  346.         E22 - LOCATION COUNTER ERROR BETWEEN PASS 1 AND 2
  347.  
  348.    8.  IOS LOGICAL ACCESS METHOD USED BY A370, L370, AND E370
  349.  
  350.       IOS001 - NO DISK SPACE
  351.       IOS001 - FILE NOT FOUND
  352.       IOS001 - NO BUFFER SPACE
  353.       IOS001 - OPEN FAILED
  354.       IOS002 - CLOSE FAILED
  355.       IOS003 - READING UNWRITTEN DATA
  356.       IOS003 - INVALID REQUEST
  357.       IOS004 - ERROR IN EXTENDING FILE
  358.       IOS004 - END OF DISK DATA AREA
  359.       IOS004 - NO MORE DIRECTORY SPACE
  360.       IOS004 - INVALID REQUEST
  361.       IOS005 - INVALID RECORD TYPE
  362.       IOS005 - INVALID RECORD LENGTH
  363.       IOS006 - INVALID RECORD TYPE
  364.       IOS006 - INVALID RECORD LENGTH
  365.       IOS007 - DELETE FAILED
  366.  
  367. *********
  368.  
  369. Chapter 6. ASSIST extended instructions for student use
  370.  
  371. *********
  372.  
  373.   A.  Overview
  374.  
  375.       The book, "Assembler Language With ASSIST", by Ross A. Overbeek
  376.       and W. E. Singletary published by Science Research Associates,
  377.       Inc.  in 1976 describes a set of 370 extended instructions to
  378.       greatly simplify input and output for students learning to write
  379.       370 assembler programs.  A new book with also covers ASSIST is,
  380.       "IBM 370 Assembly Language with ASSIST, Structured Concepts, and
  381.       Advanced Topics", Charles J. Kacmar, Prentice Hall, September
  382.       1987, ISBN 0-13-455742-5.
  383.  
  384.       PC/370 implements these instructions to allow students to
  385.       code, assemble, and execute ASSIST 370 programs on any 80x86 MS-
  386.       DOS based micro-computer rather than having to use an IBM 370
  387.       mainframe.  This was the original objective for which PC/370 was
  388.       developed back in 1981.  The first students to use PC/370 with
  389.       ASSIST were volunteers at the University of South Florida,
  390.       College of Engineering.  The students used a CP/M based Z80
  391.       micro-computer with the original version of PC/370 instead of
  392.       the IBM 3033 mainframe ASSIST system accessed via RJE using
  393.       keypunched card decks.
  394.  
  395.   B.  ASSIST extended instructions
  396.  
  397.       1.  XFILI =C'filename'
  398.  
  399.           This extended instruction redirects input source for XREAD.
  400.           If open, the current input source file is closed.  The new
  401.           filename can be any standard MS-DOS path/filename ending
  402.           with suffix .xxx or a zero byte.  If the filename is CON:
  403.           then the input source is the console with a ? prompt.  To
  404.           set the ASSIST end of file condition code for XREAD from the
  405.           console, use the escape (ESC) key.  See DEMOAST3.ALC for
  406.           demo of redirection.
  407.  
  408.       2.  XFILO =C'filename'
  409.  
  410.           This extended instruction redirects the output from XPRNT.
  411.           If open, the current output file is closed.  The new file
  412.           name can be any standard MS-DOS path/filename ending with
  413.           suffix .xxx or a zero byte.  If the filename is CON: then
  414.           the output from XPRNT is directed to the console.  The first
  415.           byte which is printer control code is also printed on
  416.           console.
  417.  
  418.       3.  XREAD area [,length]
  419.  
  420.           Read record into area with default length of 80 padded with
  421.           blanks.  If the input is coming from console, the first
  422.           carriage return defines end of record, and single ESC
  423.           character defines end of file.  Note ASCII characters from
  424.           console or file are automatically translated to EBCDIC in
  425.           record area.  Condition code set as follows:
  426.  
  427.             0 - read successful
  428.             1 - end of file
  429.  
  430.           Default input source is file named ASSIST.DAT.  If the file
  431.           is not found, the input and output source is switched to
  432.           console.
  433.  
  434.       4.  XPRNT area [,length]
  435.  
  436.           Print record from area with default length of 132.  Trailing
  437.           blanks are stripped off.  The first character is used as
  438.           standard ASCII print control character:
  439.  
  440.            ' ' - space means skip one line
  441.            '/' - slash means skip two lines
  442.            '1' - one means skip a page
  443.            '+' - means skip no lines
  444.            '-' - dash means skip three lines
  445.  
  446.           Output to console includes print control character.  Default
  447.           output is to file named ASSIST.PRN which is also used by
  448.           interactive debug X logging command and XDUMP.
  449.  
  450.       5.  XDECI reg,area
  451.  
  452.           Read ASCII integer number from area and store into register.
  453.           Leading plus or minus signs may be present.  Condition code
  454.           is set as follows:
  455.  
  456.            0 - number is zero
  457.            1 - number less than zero
  458.            2 - number is greater than zero
  459.            3 - no number found in area
  460.  
  461.           Register 1 is set to address of first character after number
  462.           read.
  463.  
  464.       6.  XDECO reg,area
  465.  
  466.           Convert binary integer number in register to 12 character
  467.           display field with numeric value including sign.
  468.  
  469.       7.  XDUMP [area start, area end]
  470.  
  471.           Dump general purpose registers (default with no args) or
  472.           dump area of memory to output file.
  473.  
  474. *********
  475.  
  476. Chapter 7.  Interactive Debug Facility
  477.  
  478. *********
  479.  
  480.      A.  Overview
  481.  
  482.      The PC/370 interactive debug facility is designed to provide a
  483.      tool to help debug program errors in either 80x86 code or 370
  484.      code.  The facility provides the basic tools namely tracing
  485.      program flow via breakpoints defined by calls, and displaying
  486.      register and memory contents upon request.  In addition, the
  487.      facility provides a data and address stop option which is very
  488.      useful for locating errors.
  489.  
  490.      B.  Program Interface
  491.  
  492.      The PC/370 interactive debug facility is implemented via a single
  493.      module named MMDBUG which is linked into A370, L370 and E370
  494.      programs and is called with a single 3 byte ASCII argument
  495.      located immediately after the near call instruction.   In the
  496.      E370 emulator environment, the interactive debugger can be called
  497.      directly from 370 programs through SVC 9 which must be followed
  498.      by 3 byte EBCDIC argument and a 1 byte filler to keep
  499.      instructions on half word boundary.
  500.  
  501.      There are several special calling arguments as follows:
  502.  
  503.      1.   'OFF' - turn off (kill) trace facility for speed
  504.                   (a trace is killed by replacing call with jump over
  505.                   the trace ID to the next instruction)
  506.      2.   'ON ' - turn trace facility back on (stop killing traces)
  507.      3.   'BUG' - force interactive debug mode
  508.      4.   'IOF' - interrupts off (unsolicited keys queued for input)
  509.      5.   'ION' - interrupts on  (any key stroke invokes user
  510.                   interface)
  511.      6.   'IFL' - instruction fetch loop (special trace used in E370
  512.                   to identify next trace id as 370 operation trace to
  513.                   be stored in trace table)
  514.  
  515.      The first call to MMDBUG in A370, L370, and E370 is with 'OFF'
  516.      unless the trace option was requested via COM file parm or if the
  517.      debug option D was specified on link edit of COM or BIN file.
  518.  
  519.      C.  User Interface
  520.  
  521.      When MMDBUG is called without the 'OFF' argument, or when a key
  522.      is hit without the 'IOF' argument being issued previously, the
  523.      user interface mode is invoked and the following commands may
  524.      be entered in upper or lower case from the console:
  525.  
  526.           A - ADDRESS STOP (PROMPTS FOR ADDRESS, LENGTH, TYPE)
  527.           C - CONTINUE TO NEXT TRACE ENTRY
  528.           D - DUMP MEMORY (PROMPTS FOR ADDRESS)
  529.           F - FIND TRACE ENTRY (PROMPTS FOR TRACE ID)
  530.           H - HELP LIST MMDBUG COMMANDS (THIS LIST)
  531.           I - INSTRUCTION COUNTER WORD
  532.           J - RESET NEXT 370 OR 8086 INSTRUCTION ADDRESS
  533.           K - KILL MODE SET/RESET (kills or restores traces)
  534.           L - SET/RESET TRACE LIMIT FOR Q/T MODE
  535.           M - MODIFY MEMORY (PROMPTS FOR ADDRESS AND DATA)
  536.           N - LIST LAST 20 TRACE ENTRIES (NOTE K,Z  AFFECT THIS LIST)
  537.           P - SET/RESET PRINT COPY OF ALL MMDBUG I/O
  538.           Q - SET QUIET MODE (USED WITH F, L, AND 'BUG' OPTIONS)
  539.           R - DISPLAY REGISTERS (SEE Z OPTION)
  540.           S - SAVE/UNSAVE CURRENT TRACE ID FROM KILL MODE
  541.           T - SET TRACE MODE (USED WITH OPTIONS F AND L)
  542.           W - LIST FREE MEMORY QUEUE
  543.           X - SET/RESET ASSIST LOGGING OF INTERACTIVE DEBUG OUTPUT
  544.           Y - MODIFY 8086/370 REGISTER (PROMPTS FOR REGISTER/DATA)
  545.           Z - SET/RESET 8086/370 MODE
  546.                 IN 8086 MODE, R DUMPS 8086 REGISTERS AND D PRINTS
  547.                 PRINTABLE ASCII CHARACTERS IN DUMP.
  548.                 IN PC/370 MODE, R DUMPS 370 REGISTERS AND PSW
  549.                 AND D DUMPS PRINTABLE EBCDIC CHARACTERS IN DUMP.
  550.          <cr> - dump same address again as defined in D command
  551.          <sp> - dump forward until any key hit
  552.          <bs> - dump backwards until any key hit
  553.          <esc>- exit to MSDOS after attempting to close files
  554.  
  555.      Memory addresses may be entered in xxxx:xxxx or xxxxxx hex format
  556.      without leading zeros required.  In 370 mode, the xxxxxx format
  557.      always refers to the relative address within the current address
  558.      space.  In 80x86 mode, the xxxxxx format refers to the offset
  559.      using the current segment.  The segment:offset is initialized to
  560.      the emulator data segment area containing the 370 registers.
  561.  
  562.      D.  User Guide
  563.  
  564.      The PC/370 interactive debug facility can assist you in locating
  565.      errors within your 370 assembler programs.  But first there are
  566.      some more basic things to check:
  567.  
  568.      1. Are you sure that you are executing the latest version of
  569.         the source program.  To be absolutely sure, code the date
  570.         and time in a print statement at the beginning of the program
  571.         and then reassemble (A370) and relink (L370) and execute the
  572.         program again.
  573.  
  574.      2. Does the program run to normal termination?  If so then you
  575.         can run the program again specifying a T as the only parameter
  576.         on the execute command to initiate the interactive debug
  577.         facility.  Another way to invoke the interactive debug option
  578.         is to specify option D in the linkage editor.   This method
  579.         should be used if the program requires a parameter other than
  580.         T.
  581.  
  582.     3.  If the program terminated abnormally, the interactive debug
  583.         facility is automatically initiated along with a display of
  584.         the PSW and the failing instruction.  To calculate the
  585.         relative address of the failing instruction in the program,
  586.         subtract the program load address of X'0200' (Note you will
  587.         have to look at the link edit listing to get the starting
  588.         address if the failing instruction is in a subroutine.
  589.  
  590.     4.  To trace execution of the program, enter K once or twice to
  591.         restore all traces and then enter T.  To stop the trace at any
  592.         point hit any key.
  593.  
  594.     5.  To continue execution of the program normally, enter Q.
  595.         For fast execution, use K command to set kill trace mode
  596.         first.
  597.  
  598.     6.  To dump the current contents of the registers, enter R.
  599.  
  600.     7.  To dump any 32 byte area in memory, enter A followed by
  601.         the starting address in hex xxxx.
  602.  
  603.     8.  To continue to dump memory from the current location forward,
  604.         hit the space key.  To dump backwards, hit the backspace key.
  605.         To stop the dump, hit any key.
  606.  
  607.     9.  To stop the program at a specific address, enter A followed
  608.         by the address in hex xxxx followed by the option code A.
  609.         Then use Q or T to continue execution until the address is
  610.         found.
  611.  
  612.    10.  To stop the program when a specific data field in memory is
  613.         changed, enter A followed by the address in xxxx followed by
  614.         the option code E for equal data or N for not-equal data.
  615.         Next entry the length of the data compare in hex when
  616.         prompted.  If option E is selected, enter the hex value of the
  617.         data you want to search for when prompted.  Next press Q or T
  618.         to continue  execution until the data compare specified
  619.         triggers debug user interface again.  To stop at a specific
  620.         instruction count in a 370 program, use the I command to
  621.         display the instruction counter word and then use data equal
  622.         address stop on the word.  To obtain detail instruction trace
  623.         up to point of failure, either use Q or T from beginning of
  624.         the program or set address stop at previous multiple of 256
  625.         on instruction count field and then restore traces with K
  626.         command and then use Q or T proceed to point of failure.  At
  627.         point of failure, use N command to list last 20 instruction
  628.         trace points.
  629.  
  630.    11.  To turn off any address stop option, enter A.
  631.  
  632.    12.  To list the last 20 instruction trace table entries, enter N.
  633.         If running in 370 mode (option Z toggles mode), only the 370
  634.         instruction traces will be stored and listed via option N.
  635.         In 80x86 mode, all traces will be stored and listed.
  636.         Note that this list may be incomplete if the program
  637.         was running with K option active to kill traces for speed.
  638.         Option K kills each trace entry to debug the first time debug
  639.         is entered for that trace point.  Option K makes the program
  640.         run much faster at the expense of losing repeated trace
  641.         points until K reset is issued.  However, you can use Find to
  642.         locate selected trace id's and use Save to protect id from
  643.         kill mode.  This option allows much faster execution while
  644.         still being able to trace selected id's.  A very useful id to
  645.         save is IFL which will then trace each 370 instruction during
  646.         kill mode while killing all of the lower level ID's for
  647.         reasonable speed yet full visibility of 370 instructions.
  648.         Faster still is to save only one 370 instruction id such as
  649.         TRT.  This is very useful in conjunction with address stop,
  650.         since the address stop overhead is only incurred for the
  651.         selected saved id's.  Note that the trace table only contains
  652.         addresses of instructions, and as a result if instruction
  653.         modification or overlays are used, the data listed for a
  654.         previous instruction may be different from what it was at the
  655.         time it was executed.  In this case it may be helpful to rerun
  656.         program with address stop to see what was in memory at the
  657.         time an instruction was executed.
  658.  
  659.    13.  To set a fixed limit on the number of trace entries before
  660.         entering debug command mode again, enter L and count in hex
  661.         xxxx.  Next enter Q or T to continue until count reached zero.
  662.         If zero count is entered, the limit is not checked.
  663.  
  664.    14.  To modify memory, enter M followed by address in hex xxxx.
  665.         Next enter hex data bytes followed by return key.
  666.  
  667.    15.  To display the 8086 registers, type Z to switch to 8086 mode.
  668.         Now type R.  In 8086 mode, storage dumps translate data to
  669.         ASCII instead of EBCDIC for character display.  In 8086 mode,
  670.         N lists all trace entries instead of just IFL 370 instruction
  671.         traces.  In 8086 mode, Y changes 8086 registers instead of 370
  672.         registers.  To return to 370 mode, type Z again.
  673.  
  674.    16.  The W command displays free memory in the 8086 data segment
  675.         for 8086 mode and the free memory in the current address
  676.         space in 370 mode.  Note these are two totally separate free
  677.         areas.  The 8086 free area is limited to <= 64k addressable by
  678.         the DS register and uses 4 byte free queue elements
  679.         (next,length).  The 370 free area extends from the end of 370
  680.         code in COM module to the end of free memory and uses 8 byte
  681.         370 format free queue elements (next,length) on 8 byte
  682.         boundaries.  For BIN file execution, the free area is the SQA
  683.         area allocated in the emulator address space.  The first free
  684.         queue element in a 370 address space is pointed to by ASCASF
  685.         field in address space control block located at X'104' in low
  686.         memory (may be zero if no free memory currently available).
  687.         The ASCB for BIN modules can be located by subtracting
  688.         (X'200'-X'104') from the entry point address in register 15 at
  689.         entry (trace ID 370).
  690.  
  691.    17.  The J jump command may be used to modify either the emulator
  692.         or the 370 current instruction address depending on the
  693.         current Z mode.  In 370 mode, the address entered is a virtual
  694.         address.  In 80x86 mode, the address entered is a code segment
  695.         offset (This is a very dangerous function and not
  696.         recommended).
  697.  
  698. *********
  699.  
  700. Chapter 8.  Floating Point Support
  701.  
  702. *********
  703.  
  704.   A.  Register formats
  705.  
  706.     1.  General purpose registers
  707.  
  708.         The general purpose 370 registers are located at the beginning
  709.         of the data segment of the E370 emulator (DS:0).  They are
  710.         stored in 80x86/80x87 long integer format with least
  711.         significant byte first starting with register 0.  For example,
  712.         the high byte of register 0 is at DS:3 and the low byte of
  713.         register 1 is at DS:4.  This area can be used with address
  714.         stop to detect a specific register value or change in register
  715.         value (although remembering reverse format is always a
  716.         challenge).  This format is used to allow native loads and
  717.         stores without reversing bytes which speeds up register to
  718.         register operations and allows addition of registers directly
  719.         from memory without conversion.
  720.  
  721.     2.  Floating point registers
  722.  
  723.         If the 80x87 co-processor is installed, the R command displays
  724.         the four 8 byte floating point register values numbered 0, 2,
  725.         4, and 6.  This is one way (other than 123 /WS screen) to tell
  726.         if 80x87 is installed.   The floating point registers are
  727.         stored in 80x87 temporary real format which is 10 bytes long.
  728.         The first 8 bytes contain the normalized 64 bit unsigned
  729.         mantissa with the high bit always on stored in reverse order
  730.         (like a double long integer with the least significant byte at
  731.         low address.  The last 2 bytes contain the base two exponent
  732.         and the sign stored as an integer.  The 15 bit exponent is
  733.         stored in excess 3FFFH format.  True zero is represented by
  734.         plus or minus sign and all other bits zero.  This format
  735.         exceeds 370 double precision 8 byte format for both mantissa
  736.         and exponent range.  This format is used to significantly
  737.         speed up floating point register to register operations since
  738.         numbers can be directly transferred to/from 80x87 in this
  739.         format.  A conversion routine must be used to convert floating
  740.         point numbers when moved to/from memory to the floating point
  741.         registers.  The conversion routine is quite efficient but does
  742.         involve shifting entire number up to 3 bits left or right to
  743.         convert from normalized base 2 to base 16.  The floating point
  744.         register memory area can be dumped to see the real format and
  745.         can be used with address stop to detect specific value or
  746.         change in value.
  747.  
  748.   B.  Floating Point Scientific Subroutine Package
  749.  
  750.     Using floating point 370 instructions plus extended 80x87 function
  751.     SVC's described in SYSTEM.DOC, a set of efficient scientific
  752.     subroutines have been coded in SSP.ALC and are stored in the
  753.     L370.LIB subroutine library.  The argument and result is in F0 or
  754.     R0 unless noted otherwise.  The SSP functions are similar to the
  755.     FORTRAN IV intrinsic functions.
  756.  
  757.     FUNCTION   DESCRIPTION   RANGE LIMITATIONS           NOTES
  758.  
  759.     ATAN       ARCTAN
  760.     ALOG       LOG BASE E    0 < F0
  761.     ALOG10     LOG BASE 10   0 < F0
  762.     COS        COSINE
  763.     EXP        E ** X
  764.     REAL       CVT TO REAL   -2**32 <= R0 < 2**32        ARG. IN R0
  765.     INT        CVT TO INT    -2**32 <= F0 < 2**32        RESULT IN R0
  766.     MOD        MOD(F0,F2)                                REMAINDER R0
  767.     PI         PI            3.14159.............
  768.     SIN        SINE
  769.     SQRT       SQUARE ROOT   0 <= F0
  770.     TAN        TANGENT
  771.  
  772.   C.  Floating point co-processor assisted standard 370 instructions.
  773.  
  774.       1.  If the floating point option is on and an 80x87 co-processor
  775.           is installed, then it is used to assist the CVB and CVD
  776.           instructions for speed.  In the case of large numbers, the
  777.           speed improvement can be up to 4 times.  For numbers close
  778.           to zero, there is no improvement in speed.  Depending on
  779.           user demand, this type assist may be added for other packed
  780.           decimal instructions in the future.
  781.  
  782. *********
  783.  
  784. Chapter 9.  XA Extended Architecture Support
  785.  
  786. *********
  787.  
  788.   1.  A370 supports the XA instructions as defined in the
  789.       IBM System/370 XA Principles of Operation manual version
  790.       SA22-7085.
  791.  
  792.   2.  E370 supports the 6 XA non-privileged instructions
  793.       BAS, BASR, MVCIN, BASSM, IPM, and BSM.  When the emulator is in
  794.       31 bit mode, the PSW format displayed by MMDBUG is extended mode
  795.       with the high address bit on.  The emulator defaults to 24 bit
  796.       mode and the 370 basic PSW format.
  797.  
  798.   3.  The standard instructions LA, BAL, BALR, EDMK, and TRT
  799.       now support both the 24 bit and 31 bit addressing modes
  800.       as set by BASSM or BSM using the PSW address mode bit.
  801.       Note that in 31 bit addressing mode the LA instruction
  802.       adds all 31 bits of the index and base register plus
  803.       displacement and clears only the high bit of the result.  This
  804.       means the high byte of the index and base must be cleared when
  805.       using 24 bit addresses in 31 bit mode.
  806.  
  807. **********
  808.  
  809. Chapter 10.  System subroutine library
  810.  
  811. **********
  812.  
  813. The following subroutines are included in the default system
  814. subroutine relocatable library L370.LIB in the root directory:
  815.  
  816.  #  SUBROUTINE ENTRY   FUNCTION                    ARGUMENTS
  817.  
  818.  1  DAT                print date and time         none
  819.  
  820.  2  TIMER              return current time         none
  821.                        of day in R0 in 100th
  822.                        of a second units
  823.  
  824.  3  PET                print elapsed time since    none
  825.                        last call plus date and
  826.                        time and 370 instruction
  827.                        count interval statistics
  828.  
  829.  4  DTIME              print time in upper left    none
  830.                        corner of screen in format
  831.                        HH:MM:SS
  832.  
  833.  5  SYNERROR           print PC/370 input/output   R0 = error code
  834.                        error message based on      R1 = function code
  835.                        return codes passed in
  836.                        registers R0-R1 at entry
  837.                        to SYNAD DCB exit routine
  838.  
  839.  6  SSP                scientific subroutines
  840.                        (see chapter 8 for entry
  841.                        points to this module)
  842.  
  843.  7  API                support application using
  844.                        application program interface
  845.                        (API) with IBM PC 3270
  846.                        emulation via interrupt 7A
  847.  
  848. The 370 source code for all of the above modules is in the LIB
  849. directory, and the BAT\BLDLIB.BAT command file will rebuild library
  850. from the source.  Remember when adding subroutines to a relocatable
  851. library that there cannot be any backward references to prior modules
  852. in the library since L370.EXE uses serial one pass search for external
  853. references in the library.
  854.  
  855. **********
  856.  
  857. Chapter 11.  COBOL call interface support
  858.  
  859. **********
  860.  
  861. To call a PC/370 assembler subroutine from a Micro Focus COBOL program
  862. requires that the PC/370 emulator E370R42.EXE be made resident by
  863. executing it directly (see BAT\RUNCBL.BAT for demo).  Each subroutine
  864. to be called must be assembled and linked using option B to create a
  865. BIN type file which will be dynamically loaded on the first call.
  866.  
  867. The interface performs the following functions prior to transferring
  868. control to the assembler subroutine:
  869.  
  870.   1.  The address space control block at X'104' in the BIN file is
  871.       initialized to a virtual equals real (V=R) region in order to
  872.       address the arguments passed.   The ASCASF free memory pointer
  873.       is initialized to point to the current first free queue element
  874.       in the common system queue area (SQA) memory allocated along
  875.       with the resident emulator.   The SQA is used to dynamically
  876.       allocate buffers for subroutine file I/O and any other dynamic
  877.       memory requests via GETMAIN/FREEMAIN svc's.  Note that SQA is
  878.       shared by all subroutines and each subroutine must release any
  879.       memory it uses prior to exit or SQA will eventually be depleted
  880.       (just like MVS).
  881.  
  882.   2.  The segment and offset argument addresses on the stack are
  883.       converted into a standard 370 calling list of 32 bit absolute
  884.       addresses located at X'80' in the BIN file (normally the command
  885.       line area).  Up to 32 arguments can be passed.
  886.  
  887.   3.  The 370 registers are set as follows:
  888.  
  889.         R1 = absolute address of argument list at X'80' in BIN file
  890.  
  891.         R14 = absolute return address to exit subroutine at X'102' in
  892.         BIN file via detach SVC.
  893.  
  894.         R15 = absolute address of entry point (normally X'210' in BIN
  895.         file.   At exit from called BIN module, the low 16 bits of
  896.         register 15 are used to set special Micro Focus COBOL return
  897.         code value called RETURN-CODE.  If emulator is not resident
  898.         when a BIN module is called, a return code of 16 is passed.
  899.  
  900.   4.  If option D was specified in the L370 link of the BIN module
  901.       being called, the emulator interactive debug facility will be
  902.       invoked at entry with all traces restored.  If option D was
  903.       not specified, execution will proceed without interruption and
  904.       no traces will be restored to provide fast execution of one or
  905.       more BIN modules.
  906.  
  907.   5.  Note that BIN modules are dynamically loaded by COBOL run time
  908.       system at unknown addresses.  Since BIN subroutines run in
  909.       V=R address mode in order to address COBOL data areas, all 370
  910.       subroutine code must be self relocating.  See CBL\TESTCIO.ALC
  911.       for example of how to relocate any address constants required
  912.       such as subroutine entry points and DCB addresses.  The A370
  913.       assembler lists all relocation addresses in PRN listing created
  914.       with the /L option.
  915.  
  916. **********
  917.  
  918. Chapter 12.  Technical References:
  919.  
  920. **********
  921.  
  922.    1.  For information on 370 machine instructions see
  923.        IBM System 370 XA Principles of Operation manual SA22-7085.
  924.    2.  For information on 370 assembler language see:
  925.        a.  IBM OS/VS Assembler Language manual GC33-4010.
  926.        b.  Assembler Language Programming by G. W. Struble.
  927.    3.  For information on how the assembler, linkage editor, and
  928.        operating system software works see:
  929.        a.  Systems Programming by John J. Donovan.
  930.        b.  Operating Systems by S. E. Madnick and J. J. Donovan.
  931.    4.  For information on the 80x86 processors see:
  932.        a.  The 8086 Book by George Alexy.
  933.        b.  Intel iAPX 286 Programmer's Reference Manual 210498-003.
  934.        c.  Intel 80386 Programmer's Reference Manual 230985-001.
  935.    5.  For information on the MSDOS operating system and utilities
  936.        see:
  937.        a.  Disk Operating System Version 3.2 Reference 68X2405.
  938.        b.  Disk Operating System Technical Reference 6139658.
  939.        c.  Advanced MS-DOS by Microsoft Press ISBN 0-914845-77-2
  940.    6.  For information on usage of ASSIST extensions see:
  941.        a.  Assembler Language with Assist by Ross A. Overbeek and W.
  942.            E. Singletary.  Published by Science Research Associates,
  943.            Inc., Chicago, Copyright 1976, ISBN 0-574-21085-7.
  944.        b.  IBM 370 Assembly Language with ASSIST, Structured Concepts,
  945.            and Advanced Topics by Charles J. Kacmar.  Published by
  946.            Prentice Hall, September 1987, ISBN 0-13-455742-5.
  947.    7.  For summary article on how PC/370 was developed see ACM
  948.        Sigsmall Newsletter Volume 8 Number 3, August 1982.
  949.    8.  For article on conversion of PC/370 from CP/M to MS-DOS see
  950.        ACM SIGSMALL/PC Newsletter Volume 11 Number 3, August 1985.
  951.    9.  For information on 80x87 see Intel iAPX 286 Programmer's
  952.        Reference Manual #210498-003.  Also book by designer titled,
  953.        "The 8087 Primer" by John F. Palmer and Stephen P. Morse,
  954.        published by John Wiley & Sons, inc. Copyright 1984, ISBN 0-
  955.        471-87569-4.