HLASM - IC = Insert Character

The opcode of the IC instruction is X'43'.


  1. Insert a single byte from storage into the low-order byte of a register.


  1. Register into which the byte is to be inserted.
  2. Address where byte is to be loaded from.


  1. The processor retrieves the byte from storage.
  2. The byte is inserted into the low-order byte of the register; the high-order three bytes of the register remain unchanged.
  3. The condition code does not change.

Special Cases

  1. None.

Related Instructions

  1. ICY differs from IC only in that is uses a 20-bit displacement.
  2. STC stores a single byte.
  3. ICM loads a set of bytes.


  1. All hardware supports the IC instruction, except the original 360 machines.


  1. None.


Notes on the example below:

  1. The GETDATA routine is a separate program.
  2. TESTDATA is an internal routine.
  3. The same parameter list can be used for both, but only TESTDATA uses the RETCODE field.
  4. R1 is used as an index into the error routine table.
  5. The use of BALR to get to error routines allows the routine to either return, or take a separate path. Good structured design/coding requires a return.
         YREGS                          * Define register names
* This routine calls an external routine to get some data.
* Then it calls a subroutine to examine/validate that data,
* Note that the GETDATA routine does not use a return code,
* but the TESTDATA edit routine does use a return code.
* If TESTDATA finds an error, we call an error routine.
* TESTDATA will set RETCODE to either 0, 4, or 8 (0 means normal)
         L     R15,=V(GETDATA)          * Load address of program to get some data
         LA    R1,PARAMLST              * provide address to store that data.
         BALR  R14,R15                  * Call the external program.
         L     R15,=A(TESTDATA)         * Load the address of the edit rtn.
         LA    R1,PARAMLST              * Load address of the parameter list
         BALR  R14,R15                  * go execute the data test rtn.
         SR    R1,R1                    * Zero 3 high bytes of work register
         IC    R1,RETCODE               * Load the return code, and use it as
*                                       * as an index into the RETLIST table.
         L     R15,RETLIST(R1)          * Load addr of proper error handling rtn.
         BALR  R14,R15                  * Go execute error rtn
*                                       * Or fall through if there was no error.
NORMAL   DS    0H                       * Continue normal execution.
PARAMLST DC    A(DATA)                  * Address of data area.
         DC    A(RETCODE)               * Place for SUBRTN to put the return code.
DATA     DC    CL132' '                 * Data
RETCODE  DC    X'00'                    * One byte return code
RETLIST  DC    A(NORMAL)                * This addr is used if there was no err.
         DC    A(ERROR)                 * This rtn handles errors.
         DC    A(NOTFOUND)              * This rtn takes care of "no data"

To the Opcodes Overview.
To the English Homepage for Hlasm.com.
To the General Homepage for Bixoft and Hlasm.com.

This site is a member of WebRing.
You are invited to browse the list of mainframe-loving sites.
Running Tyrannosaurus Rex Dinos are not dead. They are alive and well and living in data centers all around you. They speak in tongues and work strange magics with computers. Beware the dino! And just in case you're waiting for the final demise of these dino's: remember that dinos ruled the world for 155-million years!
Dinos and other anachronisms
[ Join Now | Ring Hub | Random | << Prev | Next >> ]

Below you find the logo of our sponsor and logos of the web-standards that this page adheres to.