50 HLASM Interview Questions and Answers (2026)

TT

50 HLASM Interview Questions and Answers (2026)

This module covers the most common HLASM interview questions — from language fundamentals to advanced debugging and career topics. Use this as your final review before a mainframe assembler interview.


Language Fundamentals (Questions 1–12)

1. What is HLASM and what does it stand for? HLASM stands for High Level Assembler. It is IBM's current assembly language product for z/Architecture (IBM Z mainframe) systems. Despite "high level" in the name, it is an assembly language — each statement corresponds to one or a few machine instructions. It runs on z/OS, z/VM, z/VSE, and Linux on IBM Z.

2. What is the difference between a machine instruction and an assembler directive? A machine instruction (like L, ST, A, MVC) generates executable machine code. An assembler directive (like CSECT, DC, DS, USING, END) controls the assembly process without generating machine code — it defines data, establishes base register associations, or marks program boundaries.

3. What are the four fields of an HLASM statement? Name (columns 1–8), Operation (columns 10–14), Operands (columns 16–71), and Remarks (after operands). The name field is optional. Column 72 is the continuation indicator. Columns 73–80 are the sequence number (informational only).

4. What is a CSECT and what does it do? CSECT (Control Section) marks the beginning of an executable or data section. It gives the section a name, starts the location counter at zero, and marks the entry point for the program. A load module can contain multiple CSECTs.

5. What is a DSECT? A DSECT (Dummy Section) defines a data structure layout without allocating any storage. It is used to map named fields over existing storage — input records, work areas, z/OS control blocks, or parameter lists. The actual storage is allocated elsewhere (CSECT, GETMAIN, or passed from caller).

6. What is the purpose of the USING directive? USING label,register tells the assembler that the specified register contains the address of the given label at runtime. The assembler uses this to calculate base-displacement addresses for all labels within 4096 bytes of that base. It's purely an assembler-time directive — it generates no machine instructions.

7. What is base-displacement addressing? Every storage reference in a z/Architecture machine instruction is encoded as: effective address = base register + displacement (0–4095). The base register is one of the 16 GPRs. This addressing scheme is inherited from System/360 (1964) and all IBM Z programs use it.

8. What is the standard register usage convention? Register 0: parameter/return (context-dependent). Register 1: parameter list address. Registers 2–11: work registers (must be preserved). Register 12: base register (by convention). Register 13: save area address. Register 14: return address. Register 15: entry point address on entry; return code on exit.

9. What is the save area and why is it important? The save area is an 18-fullword (72-byte) region that stores register values across a program call. Register 13 always points to the current save area. The standard linkage convention requires every called program to save the caller's registers into the caller's save area, establish its own save area, and chain the two. This creates a linked list of save areas tracing the call chain.

10. What does STM 14,12,12(13) do? It stores registers 14 through 12 (wrapping around: 14, 15, 0, 1, 2, ... 12 — 15 registers total) into consecutive fullwords starting at offset 12 of the save area pointed to by register 13. This is the standard entry sequence that saves the caller's registers.

11. What is the difference between LA and L? LA reg,value (Load Address) loads an immediate value (0–4095) or computed address into a register without a memory access. L reg,storage loads a 32-bit fullword from storage into a register. LA is faster for small constants and address calculations because it doesn't access memory.

12. What does BCT do? BCT reg,label decrements the register by 1 and branches to label if the result is not zero. It is the standard counted-loop instruction, combining decrement and branch in a single instruction.


Instructions and Data (Questions 13–25)

13. What is the difference between C and CL (compare instructions)? C (Compare) performs a signed comparison of a 32-bit register with a fullword in storage. CL (Compare Logical) performs an unsigned comparison. Use C for signed integers. Use CL for addresses, byte values, and unsigned counts.

14. What does CLC do? CLC field1(length),field2 compares up to 256 bytes of storage left-to-right as unsigned bytes, setting the condition code to equal, less-than, or greater-than. It is the primary instruction for comparing character fields and record keys.

15. What is the MVI + MVC initialisation idiom? MVI FIELD,C' ' sets the first byte to a space. MVC FIELD+1(n-1),FIELD then copies that byte across the rest of the field (left-to-right propagation). This is the standard HLASM pattern for initialising a field to a repeated byte value.

16. What is packed decimal format? Packed decimal stores two decimal digits per byte, with the sign in the low nibble of the last byte (C=positive, D=negative, F=unsigned). It is used for financial arithmetic because it provides exact decimal representation. Instructions: PACK, UNPK, AP, SP, MP, DP, CP.

17. What is the difference between PACK and ZAP? PACK packed,zoned converts a zoned decimal (DISPLAY) field to packed format. ZAP dest,source copies one packed field to another (possibly wider) destination, zero-extending. Use PACK when the source is a COBOL DISPLAY field. Use ZAP to copy and zero-extend packed fields.

18. What are DC and DS directives? DC (Define Constant) allocates and initialises storage with a value. DS (Define Storage) reserves storage without initialising it. Both use type codes (C, X, F, H, P, Z, D, A) and optional length and duplication factors.

19. What is the maximum length for MVC? 256 bytes. MVC's length field is 8 bits (values 0–255, representing 1–256 bytes). For longer moves, use multiple MVC instructions, MVCL for very long fields, or a loop.

20. What is the EX instruction used for? EX reg,instruction executes a single instruction with the low byte of the register substituted into the length or mask field of the instruction. It is used to perform variable-length SS operations (MVC, CLC, TR) without looping — the length is computed at runtime and placed in the register.

21. What does the condition code contain after a compare instruction? CC=0 (equal), CC=1 (first operand less than second), CC=2 (first operand greater than second). CC=3 is not used by compare instructions. Branch mnemonics: BE (equal), BL (less), BH (high/greater), BNE, BNL, BNH.

22. What is TM (Test under Mask)? TM storage,mask ANDs one byte of storage with the mask byte and sets CC=0 (all tested bits zero), CC=1 (some zero, some one), or CC=3 (all tested bits one). Used to test flag bytes. Followed by BZ (all clear) or BO (all set).

23. What is TR (Translate)? TR field(length),table replaces each byte in the field with the byte at the corresponding position in the 256-byte translation table. Used for character set conversion (EBCDIC to ASCII, lowercase to uppercase), character class testing, and data transformation.

24. What is the difference between SRL and SRA? SRL (Shift Right Logical) fills vacated high-order bits with zeros — used for unsigned values. SRA (Shift Right Arithmetic) fills vacated bits with copies of the sign bit — preserves the sign of signed integers, effectively dividing by 2^n.

25. What are literals in HLASM? A literal =F'42' or =CL4'DATA' is an inline constant. The assembler collects literals and generates DC statements at the LTORG point (or end of CSECT). Literals are convenient for one-off constants that don't need a separate label.


Macros and Advanced Topics (Questions 26–35)

26. What is an HLASM macro? A macro is a text-substitution facility that expands into one or more HLASM statements at assembly time. Macros have a prototype (name and parameters), a body (generated statements), and are delimited by MACRO/MEND. System macros (WTO, OPEN, GET) are provided by IBM in SYS1.MACLIB.

27. What is the difference between positional and keyword macro parameters? Positional parameters are matched by position in the invocation. Keyword parameters are matched by name (PARM=value) and can have defaults. Keyword parameters make macros more readable and allow parameters in any order.

28. What is conditional assembly in HLASM macros? Conditional assembly uses AIF (condition).label, AGO .label, and ANOP to control which statements are generated during assembly. This allows macros to generate different code depending on their parameters, creating flexible code generation.

29. What is a DSECT and how is it different from a CSECT? A CSECT allocates real storage that becomes part of the load module. A DSECT defines field names and offsets but generates no storage — it is a template for mapping over existing storage. DSECTs are used to give names to fields in records, work areas, and z/OS control blocks.

30. What is the AMODE directive? AMODE 24/31/64 specifies the addressing mode for a CSECT. AMODE 31 allows addresses up to 2GB (standard for most modern z/OS programs). AMODE 64 allows addresses up to 16EB (exabytes). The assembler and linkage editor use this to set the correct PSW addressing mode bit.

31. What is ESTAE? ESTAE (Extended Specify Task Abnormal Exit) establishes a recovery routine that z/OS calls when an abend occurs. The recovery routine can log the error, close files, free storage, and either retry at a specified address or allow the abend to continue. It is the primary error recovery mechanism for HLASM programs.

32. What is the SDWA? The SDWA (System Diagnostic Work Area) is a z/OS control block created when an abend occurs. It contains the registers at time of error, the PSW at time of error, the abend code, and other diagnostic information. It is passed in register 1 to an ESTAE recovery routine.

33. How do you write a reentrant HLASM program? A reentrant program: (1) never modifies its own instructions, (2) allocates all writable data dynamically (GETMAIN), (3) maps work areas with DSECTs, and (4) uses the RENT assembly option. Reentrant programs can be executed simultaneously by multiple tasks using one copy of the code.

34. What is the difference between BALR and BASR? Both load the address of the next instruction into the first register operand and branch to the second. BALR is the original instruction; BASR is its z/Architecture equivalent that correctly handles 64-bit addressing. Use BASR for new programs; BALR remains valid for compatibility.

35. What is LTORG? LTORG causes the assembler to output the literal pool at that point in the program. Without LTORG, literals are placed at the END statement. Use LTORG to ensure literals are within 4096 bytes of the instructions that reference them — otherwise "USING range exceeded" errors occur.


Debugging and System Programming (Questions 36–42)

36. What does a 0C4 abend mean? Program interrupt code X'04' — Protection Exception. The program attempted to access storage outside its allocated region, typically caused by: an uninitialised pointer, an off-by-one past end of array, using register 0 as a base register, or forgetting to load an address before a USING.

37. What does a 0C7 abend mean? Data Exception — a packed decimal instruction encountered invalid packed decimal data (a nibble with value A–F in a digit position, or an invalid sign nibble). Common causes: using an uninitialised packed decimal field, failing to initialise a field with ZAP/MVC before AP/SP, or corrupting a packed field with a character move.

38. How do you find the failing instruction from a dump? Take the PSW instruction address from the dump. Subtract the load module's entry point address (or base register value) to get the offset. Look at the assembly listing at that offset. Note: the PSW address points to the next instruction to execute — subtract the failing instruction's length (2, 4, or 6) to find the actual failing instruction.

39. What is IPCS? IPCS (Interactive Problem Control System) is the z/OS dump analysis tool accessed via TSO. It formats dump datasets, displays registers and storage, locates z/OS control blocks, and provides commands for navigating dumps. Commands include STATUS REGISTERS, LIST address, WHERE address, and CBFORMAT.

40. What are common causes of a 0C1 (Operation Exception)? Bad base register (points to wrong area — instructions appear as data), corrupt PSW instruction address, branching to data instead of code, or executing a privileged instruction in problem state.

41. What is a save area chain? The save area chain is a doubly-linked list of save areas connecting all active programs in a task's call stack. Each save area's offset +4 points back to the caller's save area; offset +8 points forward to the called routine's save area. IPCS can walk this chain to reconstruct the call stack at time of abend.

42. What is SNAP used for? SNAP writes a formatted dump of specified storage areas and/or registers to a DD during program execution (not just at abend). It is used for debugging — you can dump a data structure or register set at any point in the program to a SNAPDUMP DD and examine it afterwards.


Career and Industry (Questions 43–50)

43. What industries hire HLASM developers? Banking and financial services (payment processing, core banking systems, trading), insurance, government agencies (IRS, SSA), healthcare (claims processing), and IBM itself. Any organisation running mission-critical workloads on IBM Z mainframes may need HLASM skills.

44. What is the salary premium for HLASM skills? HLASM is one of the rarest programming skills. Senior mainframe assembler developers earn 20–40% more than equivalent COBOL developers. Banks and financial institutions pay the highest rates for z/OS systems programmers with HLASM expertise.

45. What other mainframe skills complement HLASM? COBOL (most common combination), JCL, z/OS (TSO/ISPF, RACF, SMS), DB2, CICS, IMS, REXX, and z/OS Debugger. Systems programmers also need z/OS internals knowledge (DFSMS, WLM, RMF).

46. What is the Open Mainframe Project? The Open Mainframe Project (openMainframe.org) is a Linux Foundation initiative to promote open-source mainframe computing. It includes Zowe (open-source API framework for z/OS), the Mainframe Open Education project (free learning resources), and multiple open-source tools. IBM provides free z/OS access for learning through the Open Mainframe Project.

47. Is HLASM still in active development? Yes. IBM continues to enhance HLASM with each z/Architecture generation, adding support for new instructions (vector, AI accelerators, cryptographic), improved diagnostics, and better IDE integration. HLASM 6.0 is the current version, available as part of z/OS.

48. What tools are available for HLASM development? IBM Developer for z/OS (IDz) provides Eclipse-based editing, debugging, and testing. IBM Z Open Editor (VS Code extension) provides syntax highlighting and outline view. z/OS Debugger supports interactive debugging of HLASM programs. IBM Fault Analyzer analyses dump data for HLASM programs.

49. What is z/OS Debugger and how is it used with HLASM? z/OS Debugger is IBM's interactive debugger for all z/OS languages including HLASM. It allows setting breakpoints, stepping through instructions, examining registers and storage, and modifying values at runtime. Assemble with DBGDATA=FULL or TEST to include debugging information.

50. What advice do you have for someone starting with HLASM? Start with the basics: registers, base-displacement addressing, STM/LM linkage, and DC/DS. Write and run small programs on Hercules or a z/OS system. Read existing production code — even if you don't understand everything, patterns become familiar quickly. Study z/OS system macros (WTO, OPEN, GETMAIN) by reading the generated listing. Most importantly, practice reading dumps — dump analysis is the most practical skill for day-to-day HLASM work.


Frequently Asked Questions

Q: How should I prepare for an HLASM technical interview? Know the register conventions cold — which register does what, entry/exit sequence, save area structure. Practice reading assembler listings and matching instructions to source. Be able to explain base-displacement addressing clearly. Know the common abend codes (0C1, 0C4, 0C7) and how to diagnose them. Be prepared to trace through a short assembler program by hand.

Q: What is the most common HLASM interview mistake? Not knowing the standard linkage convention. Almost every HLASM interview includes a question about saving/restoring registers, the save area, and how programs return to their callers. This is the single most important topic to have completely mastered before any HLASM interview.

Q: Are HLASM interviews typically theoretical or practical? Both. Expect theoretical questions about instruction sets, addressing modes, and z/OS concepts. Also expect to read and trace through short assembler programs, identify bugs in code, and explain what a given instruction does. Some interviews include a small coding exercise — write a simple routine with correct linkage and entry/exit.


Part of HLASM Mastery Course — Module 22 of 22.