IBM Assembler

  Home  Mainframes  IBM Assembler


“IBM Assembler frequently Asked Questions in various IBM Assembler job Interviews by interviewer. Get preparation of IBM Assembler job interview”



27 IBM Assembler Questions And Answers

3⟩ How to Pass the parameters from JCL to assembler Pgm?

R1 contains a fullword that contains a address pointing to

tyhe parm data. In pgm before accessing the parm data use L

Rn,0(,R1) where n=3,..11 , Rn contains the address that

points to parm data. Create DSECT that contains a halfword

and the length of the data.

 129 views

4⟩ How to retrieve the instream data in SYSIN?

Use Accept in procedure division.

Example :

WORKING-STORAGE SECTION.

01 empno. Pic x(05).

01 empname pic x(15).

01 empsal pic 9(10).

PROCEDURE DIVISION.

................

PERFORM ACCEPT-PARA.

..............

ACCEPT-PARA.

ACCEPT EMPNO.

ACCEPT EMPNAME.

ACCEPT EMPSAL.

In JCL :

...........

............

//sysin dd *

001

aaaa

330000

/*

 157 views

5⟩ Can we use an equated value as operand for an MVC instruction? Reason for the same?

If you write an MVC statement with an equated value as the

sending operand, then the assembler will try to resolve that

operand value as a base and displacement, it will not

necessarily throw an error at assembly, but the results at

execution will be unpredictable and may well give rise to a

protection exception.

The point of the MVI statement is that the single byte

sending operand value is assembled as part of the

instruction itself and does not have to be 'fetched' at

execution time, therefore if you are only moving a single

byte of fixed value, then an MVI will be marginally more

efficient than an MVC

 166 views

6⟩ Explain ICM instruction?

ICM means INsert character under mask. its a movement of character under mask bits

eg

ICM R8,B'0110',SRC

Before execution:

R8 ==> 12 34 56 78

SRC ==> AB CD EF 10

After Excecution:

R8 ==> 12 CD EF 78

 132 views

8⟩ Change process tool(code changes from dev to prd) The changes made to your code should be effected in live. How the process takes place. That is how can you move the code changes from development to production?

1) If there is any updates in the Macros regarding the

structure change or addition/removal of byte, then you need

to Promote the macro to Live first.

2) Reassemble your codes against the Live Macros.

3) Raise ELAS for the Codes to go to production.

4)Promote the codes to production.

 151 views

10⟩ How to produce SOC7 abend?

S0C7 occurs when the data exception occurs.They are many

ways to produce S0C7

1)Move non numeric data to a numeric feild

2)compare junk data with a numeric feild

3) Use a non numeric data in COMPUTE statement

4) Refer to the occurence in a table beyond the occurs time

with SSRANGE not checked in complier options

 142 views

11⟩ registers(0-15) ,where they are going be resides does that mean here is it resides whether real or virtual memory? and why? then why we are assign even registers(0 to 6) for FP operations?

Registers are part of the CPU logic and should not be

confused with memory real or virtual. The question is

about as sensical as asking where the uterus resides in a

man. Also, general purpose registers 0--16 are an

entirely different breed that the floating point

registers. As for the numbering, a decision made by the

manufacturer's design people.

 184 views

12⟩ Write the fetch cycle and execute cycle for following instructionsJMPNZ (jump to the given address if the accumulator not equal to zero) RET(return from a subroutine) ADB (add the contents of register B to the accumulator and save result in the accumulator)?

As this is mainframe assembler section, this is a trick

question - there is no JMPNZ opcode for mainframe (recently

added JNZ with relative addressing in the z/800 and later,

but no JMPNZ) and the mainframe has no RET instruction

(there is a PR to return from a cross address space or PC

"call" statement) and the mainframe has no accumulator, ADB

opcode, or B register.

 194 views

14⟩ How to initialize 20,000 bytes in the Assembler?

since the machine-code for MVC moves up to 256 bytes, you would need to do a series of MVCs to initialize 20000 bytes. this requires that you maintain a register or two to keep track of how far you've progressed through initialization.

possibly, you could get MVCL to do it; i've never tried...

MVCL uses 2 sets of even-odd pairs of registers to do the move.

you specify source address, destination address, length of source, length of destination, and fill character in the registers. the fill-character goes into the high order byte of (I THINK...) the destination length register (in this case r4)

l r4,=f'20000'

l r6,=f'20000'

la r7,source_field

la r5,dest_field

mvcl r4,r6

 154 views

16⟩ How to pass instream data in sysin with Assembler?

You will need to open de file SYSIN via a DCB and read the

data via GET commands. The data in the PARM field is passed

via register 1. Any dataset you want to use in Assembler

you will need to open. There are no automatic allocation.

 159 views

18⟩ HOW MANY MAXIMUM BASE REGISTERS WE CAN HAVE IN A PROGRAM AND ALSO HOW MANY MAXIMUM BASE REGISTERS WE CAN HAVE IN A SINGLE PROGRAM?

There are 16 registers, and ALL can be used as a base EXCEPT

for register 0, so the answer is AT LEAST 15. AT LEAST is

specified here because in any section of code, you can

"re-use" a previous base register once you are no longer

within the original address range ("scope") of that

particular base register. By re-using the registers, you can

have base registers that will cover ALL of the memory in the

machine - but not all at once - you have to "bite off" 15

base reg-at-a-time chunks of memory (all addressable memory

does not have to be contiguous - it can be scattered around

memory in 4K pieces).

 145 views

19⟩ How are data passed from JCL parm to assembler program. And how is data passed from a calling program to an assembler called program?

By convention, general purpose register 1 will have the

address of the parameter list. The list will be a list of

pointers (addresses) to individual parameters. The CALL

macro does this, but you can bypass the CALL macro and be

creative on how you set up the parameter list. Don't forget

the parameter must be on a fullword boundary.

 220 views

20⟩ What is need of START 0? In steed of can we use anyother numerics? if we use what will happen?

START is an assembler directive which has an optional

operand, (0 in your example). This operand acts as the

starting address of the program e.g. PROGNAME START X'3E0'

tells the linkage editor that this program is to be loaded

into main storage at address '3E0' in hex. This explanation

answers all your questions.

 148 views