home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / emulate / systems / pc370 / doc / system.doc < prev    next >
Text File  |  1988-01-05  |  30KB  |  635 lines

  1. SYSTEM.DOC PC/370 release 4.1 system services documentation
  2.  
  3. Chapter table of contents:
  4.  
  5.   1.  Introduction
  6.   2.  File input and output services
  7.   3.  Program load and execution services
  8.   4.  SVC documentation in SVC # order
  9.   4.  Floating point system documentation
  10.  
  11. *********
  12.  
  13. Chapter 1.  Introduction
  14.  
  15. *********
  16.  
  17. The PC/370 system supports a number of supervisor services through
  18. the standard 370 SVC interface.  In supervisor state, each SVC invokes
  19. pseudo microcode which performs the function requested at native
  20. processor speed.  In problem state each SVC causes a standard SVC
  21. interrupt storing the current PSW at location X'20' and loading the
  22. new PSW from location X'60'.  Supervisor call routines can be user
  23. written to map any SVC into any desired function in problem state.
  24.  
  25. In supervisor state, svc's 1-7 provide a set of input and output
  26. facilities using MS-DOS file handle I/O and an extended data control
  27. block defined by the user which allows access to sequential and random
  28. files.  Svc's 10-11 provide virtual memory dynamic management.  In
  29. addition to the other misc. functions provided, svc 34 provides a
  30. general purpose interrupt interface which can be used to map PC/370
  31. area into PC registers and issue any MS-DOS function call or BIOS
  32. interrupt.  Svc's 128-191 map into BIOS interrupts using simple
  33. register to register mapping.  Svc's 200-241 map into MS-DOS function
  34. calls 0-41 using simple register to register mapping.  Note function
  35. calls above 41 can be issued using svc 34 interface which is the
  36. preferred method for future releases.
  37.  
  38. *********
  39.  
  40. Chapter 2.  File input and output services
  41.  
  42. *********
  43.  
  44. The PC/370 supervisor calls to the I/O supervisor all require register
  45. 2 to point to the DCB.  The SVC's are as follows:
  46.  
  47.  SVC  FUNCTION  OPTIONS
  48.  
  49.    1  OPEN
  50.    2  CLOSE
  51.    3  READ      register 1 must be address of block or zero
  52.    4  WRITE     register 1 must be address of block or zero
  53.    5  GET       register 1 must be address of area or zero
  54.    6  PUT       register 1 must be address of area or zero
  55.    7  DELETE
  56.    8  SEARCH
  57.   23  RENAME
  58.  
  59. The PC/370 system supports sequential and random access to
  60. files using MS-DOS file handle I/O with directory pathing.
  61. To access a file, a data control block (DCB) must be defined
  62. in the program with fields defined as shown in the dummy
  63. section (DSECT) called IHADCB found in CPY\IHADCB.CPY and
  64. demonstrated in UTIL\PRINTDOC.ALC.   All fields must be defined
  65. prior to open and cannot be changed while the file is open
  66. with the exception of RCD, BUF, and RBA as described below.
  67.  
  68. An explanation of each field in the DCB follows:
  69.  
  70.   1.  DCBDCB - DCB identifier consisting of the four EBCDIC
  71.                characters ADCB.  These characters are
  72.                verified each time an I/O routine is called
  73.                with the address of the DCB in register 2.
  74.                An attempt is made to exit to the synchronous
  75.                error exit address if there is no match.
  76.  
  77.   2.  DCBDSN - address of up to 64 character EBCDIC path and
  78.                file name followed by a zero byte.  This field
  79.                is automatically translated to ASCII as
  80.                required.
  81.  
  82.   3.  DCBFID - MS-DOS assigned file handle at open time.
  83.                This field must be initialized to high values
  84.                or open routine will assume file is already
  85.                open and take SYNAD exit.
  86.  
  87.   4.  DCBFLG - file condition flags used by I/O routines.
  88.                This field must be initialized to zero except
  89.                user defined buffer bit DFUBUF and user
  90.                requested ASCII file conversion bit DFTRAN may
  91.                be turned on.  No other bits may be modified
  92.                by user.  If the DFTRAN (X'08') bit is set, input
  93.                records are translated to EBCDIC in the record area.
  94.                Output records are translated to ASCII in the record
  95.                area, written, and then translated back to EBCDIC.
  96.                The entire LRECL area is translated.  For text mode,
  97.                each record must end with EBCDIC line feed.
  98.  
  99.   5.  DSORG  - data set organization EBCDIC code:
  100.  
  101.                  S for sequential
  102.                  R for random file access.
  103.  
  104.   6.  MACRF  - data set access EBCDIC code:
  105.  
  106.                  R for read block with length of BLKSZ
  107.                  W for write block with length of BLKSZ
  108.                  (note PRECL can override BLKSZ on write)
  109.                  G for get logical record into RCD area
  110.                  P for put logical record form RCD area
  111.  
  112.   7.  RECFM  - data set record format EBCDIC code:
  113.  
  114.                  F - fixed length records with length LRECL
  115.                      for get/put sequential access or length
  116.                      BLKSZ for read/write random or
  117.                      sequential access.
  118.                  V - variable length records with length
  119.                      stored in first 2 bytes (valid lengths
  120.                      range from 3 to 64k).  Maximum length
  121.                      allowed for a file is LRECL and only
  122.                      sequential get/put modes supported.
  123.                  T - text records ending with end of record
  124.                      code (EOR usually X'0A' line feed).
  125.                      Maximum length allowed for a file is
  126.                      LRECL and only sequential get/put modes
  127.                      supported.
  128.  
  129.   8.  EOR    - end of record code for text (default NL X'0A')
  130.  
  131.   9.  EOF    - end of file code for text (default X'1A')
  132.  
  133.  10.  LRECL  - length of logical record. Maximum is 64K less 17 bytes.
  134.                Minimum is 3 for RECFM=V, 2 for RECFM=T or 1 for
  135.                RECFM=F.
  136.  
  137.  11.  BLKSZ  - length of block.  Maximum is 64K less 17 bytes
  138.                and minimum is 3.  If zero is specified, a
  139.                default block of 8k will be dynamically
  140.                allocated and deallocated at open and close
  141.                respectively.  BLKSZ should be specified for
  142.                read/write access.  For sequential access,
  143.                larger block size reduces contention between
  144.                multiple files by reading or writing entire
  145.                blocks at one time rather than for each
  146.                record.  If insufficient memory is available,
  147.                the maximum available will be allocated.
  148.  
  149.  12.  EODAD  - end of file exit address. This cannot be changed
  150.                while file is open.
  151.  
  152.  13.  SYNAD  - synchronous error exit.  This cannot be changed while
  153.                file is open.  If register 2 does not point to a valid
  154.                DCBDCB ID field not exit is taken and interactive debug
  155.                is invoked.  If exit is taken, register 0 contains
  156.                error code and register 1 contains function code which
  157.                can be used by to produce error message by calling
  158.                subroutine LIB\SYNERROR.ALC which is in the default
  159.                system relocatable library L370.LIB.
  160.  
  161.  14.  RCD    - record area address for get/put only.  This
  162.                address may be changed on each get or put by
  163.                placing new address in register 1.  If register 1
  164.                contains zero, then current DCB area will be used.
  165.  
  166.  15.  BLK    - block area address used for direct I/O via MS-
  167.                DOS.  If DFUBUF is not set at open, this area
  168.                is dynamically allocated and deallocated using
  169.                BLKSZ or default for length.  If DFUBUF is set, then
  170.                new block address can be set for each read or write
  171.                by placing new address in register 1.  If register 1
  172.                contains zero, then current DCB block will be used.
  173.  
  174.  16.  RBA   -  relative byte address for random access
  175.                read/write.  First byte of file is zero.  This field
  176.                must be reset for each random read or write.
  177.  
  178.  17.  REN   -  address of file rename followed by zero.
  179.                Only used by RENAME SVC.  Both DCBDSN and REN must be
  180.                initialized in a closed DCB prior to RENAME SVC 23.
  181.  
  182.  18.  IOCNT -  physical I/O count since open.  Larger
  183.                BLKSZ will reduce physical I/O count for
  184.                sequential file access.
  185.  
  186.  19.  PRECL -  physical record length on last read or
  187.                write.  This field is initialized to zero
  188.                at open.  On write, BLKSZ will be calculated
  189.                if this field is zero, else this field will
  190.                override length allowing short blocks to be
  191.                written.  This is useful in processing files
  192.                of unknown length with fixed block logic.
  193.                The last block read may be short, and the
  194.                corresponding last block written may be short.
  195.  
  196. Do not modify the reserved areas which are only used by
  197. PC/370 IOS while file is open.  See UTIL\PRINTDOC.ALC for
  198. example of file access method.
  199.  
  200. *********
  201.  
  202. Chapter 3.  Program load and execution services
  203.  
  204. *********
  205.  
  206.     SVC  FUNCTION  OPTIONS
  207.  
  208.      15  USEREXIT  Transfer control to native code user exit at
  209.                    relative address in reg 15 via far call
  210.  
  211.      25  LOAD      Reg 1 points to ASCIIZ path/filename
  212.                    on return, reg 0 has file address, reg 1 has length
  213.  
  214.      26  ATTACH    Reg 0 must have file address of COM file and
  215.                    reg 1 must have desired length of attached addr.
  216.                    space
  217.  
  218.      27  DETACH    If in attached address space, exit to next
  219.                    instruction after attach in mother address space
  220.                    else exit to MS-DOS
  221.  
  222.      36  RELOAD    Reload file int memory at location in reg 0.
  223.                    Reg 1 must have file address and reg 15 must have
  224.                    maximum length of file allowed to be loaded into
  225.                    preallocated area.
  226.  
  227. The PC/370 system includes support for dynamic loading and execution
  228. of 370 modules assembled and linked by A370.EXE and L370.EXE.
  229. Any file including COM and MOD type files can be loaded into free
  230. memory by use of the LOAD SVC 25.  The only argument required is
  231. the address of the path and file name in register 1.  The file name
  232. must end with a suffix of the form .XXX or a zero byte.  The largest
  233. free memory area will be allocated and the file loaded into it.
  234. Register 0 will be set to the address of the area, and register 1 will
  235. be set to the length of the file.  The unused portion of the allocated
  236. area will be freed.  If the load operation was successful, register 15
  237. will be set to zero, else it will be set to 1.  Demo test program
  238. DEMOSVC.ALC illustrates the use of the load function to load an 8086
  239. assembly language subroutine and execute it via user exit SVC 15.
  240.  
  241. Any 370 COM file created by L370.EXE and loaded via the load SVC 25
  242. above, can be executed it its own address space via the attach SVC 26.
  243. Register 0 must be set to point to the COM file (set by load SVC 25)
  244. and register 1 must be set to address space size (minimum set by load
  245. SVC 25),  If additional space is to be included in the attached
  246. address space for dynamic use via GETMAIN/FREEMAIN SVC's 10/11, then
  247. the area to be added must be allocated in the mother address space
  248. prior to issuing attach SVC 26 and the total length of the COM file
  249. plus the allocated free space placed in register 1.  A COM file can be
  250. executed multiple times via attach by reloading registers 0 and 1 and
  251. reissuing SVC 26.  On second and following calls, the same address
  252. space control block built on the first call in the COM prefix area
  253. is reused (See CPY\IHASCB.CPY for layout) since it overlays original
  254. COM prefix data.
  255.  
  256. Execution of the attached address space can be terminated via a detach
  257. SVC 27 which restores the mother address space and continues execution
  258. at the next instruction following the attach SVC 26.  The only other
  259. way to terminate the attached address space normally is to issue an
  260. exit SVC 0 which exits directly to MS-DOS.  A detach SVC 27 in an
  261. address space which has no mother, will cause exit to MS-DOS.
  262.  
  263. An alternative to using attach/detach to execute dynamically loaded
  264. 370 code is to use simple branch and link.  For 370 code linked into
  265. COM file, the 370 code starts X'210' from the beginning of the COM
  266. file.  For code linked into MOD type file by L370.EXE using option M,
  267. the 370 code starts immediately at the beginning of the file (i.e. the
  268. file load address returned in register 0 by load SVC 25).
  269.  
  270. For example of each type program loading and execution, see
  271. DEMO\MVS.ALC and DEMO\DEMOPSW.ALC demo programs.
  272.  
  273. The virtual address space established for the execution of COM files
  274. created by L370.EXE has the following memory layout.  For a sample
  275. DSECT of the address space control block, see CPY\IHASCB.CPY.
  276.  
  277.  000 INITIAL PROGRAM LOAD PSW
  278.  008 INITIAL PROGRAM LOAD CCW1
  279.  010 INITIAL PROGRAM LOAD CCW2
  280.  018 EXTERNAL OLD PSW
  281.  020 SUPERVISOR CALL OLD PSW
  282.  028 PROGRAM OLD PSW
  283.  030 MACHINE CHECK OLD PSW
  284.  038 INPUT/OUTPUT OLD PSW
  285.  040 CHANNEL STATUS WORD
  286.  048 CHANNEL ADDRESS WORD
  287.  050 INTERVAL TIMER
  288.  058 EXTERNAL NEW PSW
  289.  060 SUPERVISOR CALL NEW PSW
  290.  068 PROGRAM NEW PSW
  291.  070 MACHINE CHECK NEW PSW
  292.  078 INPUT/OUTPUT NEW PSW
  293.  080 MVS PARM AREA POINTED TO BY REGISTER 1 AT ENTRY (A,H,EBCDIC TEXT)
  294.  100 SVC ATTACH INSTRUCTION
  295.  102 SVC DETACH INSTRUCTION POINTED TO BY REG 14 AT ENTRY
  296.  104 ADDRESS SPACE CONTROL BLOCK ASCB FOR CURRENT COM PROGRAM
  297.  124 RESERVED
  298.  138 SAVE AREA POINTED TO BY REG 13 AT ENTRY
  299.  180 PC/370 PACKAGE IDENTIFICATION RECORD
  300.  200 BEGINNING OF 370 CODE AND DEFAULT ENTRY POINTED TO BY REG 15
  301.      AT ENTRY IF NO OTHER ENTRY POINT SPECIFIED ON ALC END STATEMENT.
  302.  
  303. *********
  304.  
  305. Chapter 4.  All PC/370 supervisor services in SVC order
  306.  
  307. *********
  308.  
  309.     SVC  FUNCTION        REGISTERS input/output
  310.  
  311.       0  exit to MS-DOS  none
  312.       1  open file       reg 2 = DCB address (see I/O section
  313.                          documentation)
  314.       2  close file      reg 2 = DCB address
  315.       3  read block      reg 2 = DCB, reg 1 must be address of block
  316.                          or zero
  317.       4  write block     reg 2 = DCB, reg 1 must be address of block
  318.                          or zero
  319.       5  get record      reg 2 = DCB, reg 1 must be address of area or
  320.                          zero
  321.       6  put record      reg 2 = DCB, reg 1 must be address of area or
  322.                          zero
  323.       7  delete file     reg 2 = DCB address
  324.       8  search file     reg 2 = DCB address
  325.                          /reg 0 = return code 0 if found
  326.       9  program trace   3 character trace ID follows SVC
  327.      10  get memory      reg 1 = length
  328.                          /reg 2 = address, reg 0 = 0 if ok
  329.                          if reg 0 > 0, then reg 1 = maximum memory
  330.                          available
  331.      11  free memory     reg 1 = length and reg 2 = address
  332.                          /reg 0 = 0 if ok
  333.      12  ASCII to EBCDIC reg 1 = address and reg 2 = length
  334.      13  EBCDIC to ASCII reg 1 = address and reg 2 = length
  335.      14  set SPIE        if reg 1 = 0, remove SPIE else set SPIE exit
  336.                          to reg 1
  337.                          at SPIE entry, reg 0 contains instruction
  338.                          length in high 16 bits, interruption code in
  339.                          low 16 bits, reg 1 contains interruption
  340.                          address, and reg 2 contains program
  341.                          interruption element block (see
  342.                          CPY\IHAPIE.CPY).
  343.      15  user exit       reg 15 = entry point to COM 80x86 code via
  344.                          far call
  345.      16  instr. count    /reg 1 = current 370 instruction count
  346.      17  load user exit  reg 1 = ASCIIZ path/file name
  347.                          /reg 0=addr.reg 1=len.
  348.      18  time of date    /reg 0 = hour, minute, second, 100th second,
  349.                          reg 1 = year, reg 2 = day, month, day of week
  350.      19  allocate memory reg 1 = address of MS-DOS real block, reg 2 =
  351.                          length
  352.                          /if reg 0 not zero, then reg 2 = max.
  353.                          available
  354.      20  deallocate mem. reg 1 = address of MS-DOS real block
  355.      21  input byte      reg 1 = device address, reg 0 = byte
  356.      22  output byte     reg 1 = device, reg 0 = byte
  357.      23  rename file     reg 2 = DCB address
  358.      24  display line    reg 1 = attributes, reg 2 = address, reg 15 =
  359.                          row/col
  360.      25  load file       reg 1 = path/filename
  361.                          /reg 0 = address, reg 1 = length
  362.      26  attach program  reg 0 = COM file address, reg 1 = address
  363.                          space length
  364.      27  detach program  none (return to instruction after attach)
  365.      28  svc 209 EBCDIC  set EBCDIC to ASCII trans. for WTO svc 209
  366.                          (default)
  367.      29  svc 209 ASCII   turn off EBCDIC to ASCII translation
  368.      30  svc 209 CR      turn on carriage return and line feed
  369.                          (default)
  370.      31  svc 209 no CR   turn off carriage return and line feed
  371.      32  VA to SEG:OFF   convert virtual address in R1 to
  372.                          segment:offset in R0
  373.      33  SEG:OFF to VA   convert segment:offset in R0 to virtual
  374.                          address in R1
  375.      34  interrupt       general purpose interrupt facility which
  376.                          supports all MS-DOS and BIOS interrupts using
  377.                          PC register vector table pointed to by R1
  378.                          must be defined as follows (see
  379.                          CPY\IHAPCB.CPY):
  380.  
  381.                             0  PCVT DC C'PCVT'  ID REQUIRED BY SVC 34
  382.                             4  PCIN DS H        INTERRUPT # (0-255)
  383.                             6  PCPF DS H        PF FLAGS REGISTER
  384.                             8  PCAX DS H        AX
  385.                            10  PCBX DS H        BX
  386.                            12  PCCX DS H        CX
  387.                            14  PCDX DS H        DX
  388.                            16  PCDS DS H        DS
  389.                            18  PCSI DS H        SI
  390.                            20  PCES DS H        ES
  391.                            22  PCDI DS H        DI
  392.  
  393.                          PC registers are loaded from PCVT for
  394.                          interrupt. PC register results are also
  395.                          stored in PCVT area immediately after
  396.                          interrupt.  Note segment:offset addresses
  397.                          such as DS:DX, DS:SI, or ES:DI required
  398.                          by interrupts can be calculated via SVC 32.
  399.                          Likewise returned segment:offset results can
  400.                          be translated back to PC/370 virtual
  401.                          addresses via SVC 33.  This is a very
  402.                          powerful and therefore dangerous instruction.
  403.                          SVC's 128-191 and SVC's 200-241 should be
  404.                          used in place of this more general SVC when
  405.                          possible since they are a little faster (they
  406.                          don't load and store all PC registers and
  407.                          don't require PCVT setup).  They are also
  408.                          much safer since an error in PCVT setup could
  409.                          invoke wrong interrupt or pass bad registers
  410.                          to any function including reboot interrupt,
  411.                          write to disk, etc SVC 34 does verify PCVT
  412.                          identifier and range of PCIN within 0-255.
  413.                          If verify fails, program interruption
  414.                          19 occurs.  If carry bit is set by interrupt,
  415.                          condition code 3 is set, else condition code
  416.                          0 is set.
  417.  
  418.      35  80x87 assist    Scientific subroutine function assist via
  419.                          80x87. Register 1 contains function # and
  420.                          values are passed via floating point
  421.                          registers.  See chapter on floating
  422.                          point for more information.
  423.  
  424.      36  RELOAD          Load file into memory at address in reg 0.
  425.                          Reg 1 must have file address and reg 15 must
  426.                          have maximum file length allowed to be loaded
  427.                          in preallocated area.
  428.  
  429.      37  SVCTRAP         Define svc trap table via register 1 which
  430.                          contains address of user exit routine to be
  431.                          used with each svc.  If register 1 is zero
  432.                          current svc trap table is cancelled.  After
  433.                          table is defined, each svc call functions as
  434.                          follows:
  435.  
  436.                            1.  If table+4*(svc #) contains zero,
  437.                                execute real PC/370 svc normally.
  438.                            2.  If svc trap active mode is set,
  439.                                execute real PC/370 svc normally.
  440.                            3.  If table+4*(svc #) is not zero,
  441.                                store current psw at old svc psw x'20',
  442.                                set trap active mode, and branch to
  443.                                trap exit address in table entry.
  444.  
  445.                          LPSW instruction will always reset trap
  446.                          active mode, and normal exit from trap
  447.                          is via LPSW OLDSVC.  All svc calls within
  448.                          trap routine including the svc which
  449.                          invoked trap will process as real svcs
  450.                          normally without storing psw.  See DEMO\
  451.                          DEMOTRAP.ALC program for examples.
  452.  
  453.     128 - 191 issue BIOS interrupt number = svc # - X'80' with PC
  454.               registers mapped as follows before and after interrupt:
  455.  
  456.         AX - low bytes of register 0
  457.         BX - low bytes of register 1
  458.         CX - low bytes of register 14
  459.         DX - low bytes of register 15
  460.  
  461.         If carry set by call, then CC =3 else CC = 0.
  462.         8086 flags returned in high bytes of R0.
  463.  
  464.     200 - 241 issue interrupt 21H with PC registers mapped as follows:
  465.  
  466.         For all svc's 200-241:
  467.  
  468.           AH - MS-DOS function call number = svc number -200
  469.           AL - low byte  of register 0
  470.           BX - low bytes of register 1
  471.  
  472.         for svc # 201-208, 211, 213, 214, and 225:
  473.  
  474.           DL - low byte register 2
  475.  
  476.         for svc 209, 210, 212, and 215-241:
  477.  
  478.           DS:DS - segment:offset from virtual address in register 2
  479.           CX    - returned in register 14
  480.           DX    - returned in register 15
  481.  
  482.           One of the most frequently used SVC's is 209 (write to
  483.           operator).  For example, to print message on standard output
  484.           device via MS-DOS function call 9, the following 2 PC/370
  485.           instructions can be used:
  486.  
  487.            LA  R2,=C'THIS IS A DEMO WTO MESSAGE$'
  488.            SVC 209
  489.  
  490.           The above example will print message on console and issue
  491.           carriage return and line feed following message ending with
  492.           $.  To turn off automatic carriage return and line feed,
  493.           issue SVC 31 prior to SVC 209.  To eliminate overhead of
  494.           converting from default EBCDIC strings to ASCII for 209,
  495.           issue SVC 29 prior to SVC 209 and use PC/370 assembler
  496.           extension for ASCII strings in double quotes.  For
  497.           example, this is the most efficient method of issuing
  498.           messages:
  499.  
  500.             SVC 29  TURN OFF EBCDIC TO ASCII CONVERSION FOR 209
  501.              .
  502.              .
  503.             LA  R2,=C"THIS IS A DEMO WTO MESSAGE$"
  504.             SVC 209
  505.  
  506. *********
  507.  
  508. Chapter 5.  Floating Point System Documentation
  509.  
  510. *********
  511.  
  512.  A.  Introduction
  513.  
  514.      PC/370 release 4.0 contains support for the entire 370 floating
  515.      point instruction set using the Intel 80x87 co-processor.  If the
  516.      co-processor is not installed, all floating point instructions
  517.      cause operation exceptions as they would on a 370 without the
  518.      floating point option.  There is a new option in the L370 linkage
  519.      editor (option P) which can be used to force turning off floating
  520.      point option even when co-processor is installed.  Default is to
  521.      support floating point if it is installed and 370 module has been
  522.      linked using release 3.0+ linkage editor.  In addition to the
  523.      standard floating point instructions, two additional levels of
  524.      support have been added.  Section F describes a set of SVC's
  525.      which invoke extended microcode functions on the 80x87 chip such
  526.      as square root, logs, etc.  These SVC's are fast but most require
  527.      special scaling of arguments.  DOC\USER.DOC describes a set of
  528.      scientific subroutines written in ALC which can be called to
  529.      efficiently calculate functions over extended range of real
  530.      numbers.
  531.  
  532.  B.  Data formats
  533.  
  534.      The Intel 80x87 actually only supports one IEEE floating point
  535.      format which has 64 bit mantissa and exponent range of 10**4932
  536.      which exceeds both the 370 short and long (double precision)
  537.      formats of 24 and 56 bit mantissa's.  Therefore, both the short
  538.      and long operations are done with extra precision.  The 370
  539.      extended format instructions are all supported but the precision
  540.      actually available is only 64 bits versus the 112 on a 370.  When
  541.      short and long numbers are loaded into the 80x87, they are padded
  542.      with zeros to the 64 bit length required.  When an extended
  543.      number is loaded into the 80x87, the last 8 bits are obtained
  544.      from the second register in the specified extended register pair.
  545.      The PC/370 cross assembler now supports E, D, and L data formats
  546.      when the 80x87 is installed.
  547.  
  548.  C.  Data exceptions
  549.  
  550.      The standard 370 exponent overflow, exponent underflow, and
  551.      floating point divide exceptions are all supported.  The program
  552.      mask can be set to control whether program exception is allowed.
  553.      One deviation from standard 370 convention, is to return the
  554.      maximum floating point number with correct sign when overflow
  555.      occurs instead of an invalid number.  This is consistent with
  556.      IEEE standard.
  557.  
  558.  D.  Floating point instructions
  559.  
  560.      1.  Note that all operations are normalized using 80x87 and that
  561.          the 370 unnormalized function identical to normalized
  562.          instructions.
  563.  
  564.      2.  Compare short and long include all 64 bits in comparison.  To
  565.          round number to specific number of bits in short or long
  566.          format, use the LRER or LRDR instruction prior to compare.
  567.  
  568.  E.  Interactive debug facilities for floating point
  569.  
  570.      1.  When floating point support is active (i.e. option P is on
  571.          and the 80x87 co-processor is installed), the R command will
  572.          display third line with floating point register contents in
  573.          hex.  Note that the actual floating point register areas in
  574.          memory are stored in 80x87 temporary real format to allow
  575.          register to register instructions to execute faster since no
  576.          conversion from or to 370 format is required.
  577.  
  578.  F.  Extended 80x87 microcoded arithmetic functions
  579.  
  580.      The following extended arithmetic floating point functions are
  581.      supported via SVC 35 with the function number in register 1.
  582.      Arguments and results are in the floating point registers F0 and
  583.      F2.
  584.  
  585.      #   Formula:                Notes:
  586.  
  587.      1.  F0 = LOG10(2)           constant
  588.      2.  F0 = LOGE(2)            constant
  589.      3.  F0 = LOG2(E)            constant
  590.      4.  F0 = LOG2(10)           constant
  591.      5.  F0 = PI                 constant 3.14159....
  592.      6.  F0 = ARCTAN(F2/F0)      0 <= F2 <= F0 < IFI (infinity)
  593.      7.  F2/F0 = TAN(F0)         0 <= F0 <= PI/4 (sets F0 and F2)
  594.      8.  F0 = SQRT(F0)           0 <= F0 < IFI
  595.      9.  F0 = F2 * LOG2(F0)      0 < F0 < IFI, -IFI < F2 < IFI
  596.     10.  F0 = F2 * LOG2(F0+1)    0 <= F0 < (1-(SQRT(2)/2)), _IFI < F2
  597.                                  < IFI
  598.     11.  F0 = 2**F0              -IFI < F0 < IFI (note 1)
  599.     12.  F0 = R0                 convert to real
  600.     13.  R0 = F0                 convert to integer
  601.     14.  F0 = MOD(F0/F2)         return fraction of F0 mod F2 in F0
  602.                                  (note 2)
  603.     15.  F0 = SIN(F0)            argument may be any real radian value
  604.                                  (note 3)
  605.     16.  F0 = COS(F0)            argument may be any real radian value
  606.                                  (note 3)
  607.     17.  F0 = TAN(F0)            argument may be any real radian value
  608.                                  (note 3)
  609.  
  610.    Notes:
  611.  
  612.      1.  This function uses equivalence expression to derive 2**F0 for
  613.          all values of F0 rather than just the 0.0-0.5 range supported
  614.          via the F2XM1 80x87 instruction.
  615.  
  616.      2.  Note this uses FPREM 80x87 instruction repeatedly to
  617.          calculate exact remainder via successive subtraction.
  618.  
  619.      3.  Note 15-17 perform scaling of argument via FPREM 80x87
  620.          instruction and use FPTAN 80x87 instruction to derive
  621.          tangent, sine and cosine.
  622.  
  623.    Register 15 is set to one of the following values at exit from svc:
  624.  
  625.     hex
  626.  
  627.      00 - no errors detected
  628.      80 - 80x87 not operational
  629.      40 - invalid function number in register 1
  630.      20 - 80x87 precision error (inexact result such as 1/3 etc.)
  631.      10 - 80x87 underflow error (zero returned)
  632.      08 - 80x87 overflow  error (max 370 value returned)
  633.      04 - 80x87 zero divide     (max 370 value returned)
  634.      02 - 80x87 denormalized operand error (should not occur)
  635.      01 - 80x87 invalid operation error    (should not occur)