4.9.32 Irp And Irpc Directives

The IRP and IRPC directives operate in a similar way to REPT; however, instead of repeating the block a fixed number of times, it is repeated once for each member of an argument list.

In the case of IRP, the list is a conventional macro argument list. In the case or IRPC, it is each character in one argument. For each repetition, the argument is substituted for one formal parameter.

For example:

IRP number,4865h,6C6Ch,6F00h
    DW number
ENDM

would expand to:

DW 4865h
DW 6C6Ch
DW 6F00h

Note that you can use local labels and angle brackets in the same manner as with conventional macros.

The IRPC directive is similar, except it substitutes one character at a time from a string of non-space characters.

For example:

IRPC char,ABC
    DB ’char’
ENDM

will expand to:

DB ’A’
DB ’B’
DB ’C’