BPX1RED (read) example

The following code reads 80 bytes from the specified file (FILEDESC) and places them in the area provided (BUFFERA). For the callable service, see read (BPX1RED, BPX4RED) — Read from a file or socket. AMODE 64 callers use BPX4RED (read) example.
                                              
       MVC   FILEDESC,..           File descriptor                    57
         LA    R15,BUFFERA           Buffer                             
         ST    R15,BUFA              Buffer address                     
         MVC   BUFLENA,=F'80'        Read buffer length                 
         SPACE ,                                                        
         CALL  BPX1RED,              Read from a file                  +
               (FILEDESC,            Input: File descriptor            +
               BUFA,                 ->Buffer to read into             +
               PRIMARYALET,          Input: Buffer ALET                +
               BUFLENA,              Input: Number of bytes to read    +
               RETVAL,               Return value: 0, -1, or char count+
               RETCODE,              Return code                       +
               RSNCODE),             Reason code                       +
               VL,MF=(E,PLIST)       ----------------------------------