BPX1MMI (__map_init) example

The following code creates a shared memory map with 10 map blocks each with a size of 1 meg. For the callable service, see __map_init (BPX1MMI, BPX4MMI) — Create a mapped megabyte area. For the data structure, see BPXYMMG — Map interface for _map_init and _map_service. AMODE 64 callers use BPX4MMI (__map_init) example.
                                              
         LA    R2,INITPARM           Set address of init parm list      
         ST    R2,INITADDR                                              
         USING _MMG_INIT_PARM,R2                                        
         XC    _MMG_INIT_PARM(_MMG_INIT_PARM_LEN),_MMG_INIT_PARM        
         L     R1,=F'10'             Map area to contain 10 blocks      
         ST    R1,_MMG_NUMBLKS       *                                  
         L     R1,=F'1'              Each block is to be 1 meg in size  
         ST    R1,_MMG_MEGSPERBLK    *                                  
         SPACE ,                                                        
         CALL  BPX1MMI,                                                +
               (=A(MMG_INIT),        Input: Function code              +
               INITADDR,             Input: __map_init parameter list  +
               RETVAL,               Return value: 0, -1               +
               RETCODE,              Return code                       +
               RSNCODE),             Reason code                       +
               VL,MF=(E,PLIST)       ----------------------------------