LEARN.COBOLSTACK.COM
//CS165  EXEC PGM=COURSE,PARM='CS165'

Developer track · Intro · self-paced ~14h (2 days as a cohort) · prerequisite: CS100

Assembler On-Ramp: Mainframe Assembler from Zero

Mainframe assembler for the absolute beginner — no assembler and no COBOL needed. In plain English and in short sessions: what a machine instruction is, bits, bytes, hex and EBCDIC, registers and storage, and then real programs you type, assemble, link and run yourself. Ten sessions, ten small programs, each one checked from your own job: by the last one you have written a complete program with a loop, decimal arithmetic and a printed report, and you can say what an S0C7 means and find the bytes that caused it.

Self-paced available Cohort

Open for enrollment now. No assembler and no COBOL assumed — only CS100 Mainframe Foundations: you can log on, edit a member, submit a job and find its output. The lesson videos for this course are not recorded yet: every session below is published as its lessons and lab now and marked Coming soon until its videos are released. The next course is CS170 HLASM, which picks up where this one ends.

Plans: Free individual at no cost, or Paid individual at $249 per course, one-time — code review, extra exercises, grading and priority support.

//SYLLABUS DD DISP=SHR

Syllabus

Every session ends in a lab on your own environment. Labs are machine-checked against expected outputs — you and your L&D team always know exactly where you stand.

What assembler is, and your first run

Coming soon The videos for this session are being produced; its lessons and lab are published here now.

Four videos. A computer runs machine instructions — a few bytes each — and assembler is those instructions written with names instead of numbers: one statement, one instruction. Where you still meet it: product exits, small old utility routines, the system macros every language ends up calling, and the day a failure has to be read from bytes. Then your first run, before any theory: a job with three steps — ASM (the assembler, ASMA90), LKED (the binder) and GO (your program) — and a program whose only work is one WTO message. You copy the frame around it as it is; Sessions 4 and 5 take it apart. Live on the system: the three step return codes, your message in the job log, and what an assembly error looks like when you misspell an operation.

LAB Type the deck into your own library, submit it, and find the three return codes and your message. Then change the message so that it contains your userid and run it again: ASM, LKED and GO all RC 0. Session 1 checkpoint (AB01), checked from your own job.

4 videos · ~22 min
  1. 1.1 What Assembler Is 5 min
  2. 1.2 Why It Still Matters 5 min
  3. 1.3 Your First Run: Assemble, Link, Go 7 min
  4. 1.4 Lab: Make It Yours 5 min

Bits, bytes, hex and EBCDIC

Coming soon The videos for this session are being produced; its lessons and lab are published here now.

Four videos. A bit, a byte, and why everyone writes a byte as two hex digits. Whole numbers in storage: the halfword (2 bytes), the fullword (4) and the doubleword (8), and how a negative number is held — why −1 is FF FF FF FF. Characters are bytes too, and the mainframe’s table for them is EBCDIC: a blank is 40, A is C1, the digit 1 is F1 — which is not the number 1. You ask for all of these with DC (define constant): DC F'255', DC H'256', DC C'ASM', DC X'C1'. Live on the system: the listing’s OBJECT CODE column, where every constant shows the exact bytes it became — your proof for the rest of the course.

LAB Write the bytes of seven constants by hand — characters, a blank, a positive and a negative fullword, a halfword, a hex byte — then define them in program BYTES, run it to RC 0 and find every byte group in the listing. Session 2 checkpoint (AB02).

4 videos · ~22 min
  1. 2.1 Bits, Bytes and Hex 5 min
  2. 2.2 Numbers in Storage 6 min
  3. 2.3 EBCDIC: Letters Are Bytes Too 5 min
  4. 2.4 Lab: Read the Bytes You Defined 6 min

Registers and storage

Coming soon The videos for this session are being produced; its lessons and lab are published here now.

Four videos. The processor has sixteen general registers, numbered 0 to 15 — the slots where the work happens — and a register has no type: it holds whatever bits you last put in it. Main storage is one long row of numbered bytes, and because a program can be loaded anywhere, it names a place as a base register plus a displacement, never as a fixed address; write a name and the assembler works the displacement out. The four instructions that move data: L loads a fullword from storage into a register, ST stores it back, LR copies register to register, and LA loads a number or an address without reading storage. And the trick used for the next four sessions: whatever your program leaves in register 15 becomes the step’s return code, so the return code is your answer.

LAB Trace on paper first, then run: program REGS swaps two fullwords (30 and 12) with L and ST and returns the new first value. The GO step must end RC 12. Session 3 checkpoint (AB03).

4 videos · ~23 min
  1. 3.1 Sixteen Registers 5 min
  2. 3.2 Storage and Addresses 6 min
  3. 3.3 L, ST, LA and LR 6 min
  4. 3.4 Lab: Swap Two Fullwords 6 min

The shape of a program

Coming soon The videos for this session are being produced; its lessons and lab are published here now.

Four videos. The statement and its columns: a name starting in column 1, the operation, the operands, a remark — and column 72, which nothing may reach. CSECT names the program and starts it, END finishes it, instructions come first and data after the final branch, because the processor runs whatever bytes come next. DC defines a value, DS only reserves space, EQU names a number without using storage. Then the two lines that have opened every program so far: BALR 12,0 puts the address of the next instruction into register 12, and USING *,12 tells the assembler to measure every displacement from there — the base register, explained by reading the object code it produces. Live on the system: the listing, where BALR is two bytes, USING is none, and every storage operand carries register 12 and a displacement.

LAB From a blank member, write program SHAPE in the right order — CSECT, entry lines, exit lines, END, then the work and the data: an EQU of 7, a reserved fullword, store the value, return it. GO must end RC 7. Session 4 checkpoint (AB04).

4 videos · ~23 min
  1. 4.1 The Statement and Its Columns 5 min
  2. 4.2 CSECT, END and Where Data Lives 5 min
  3. 4.3 The Base Register: BALR and USING 7 min
  4. 4.4 Lab: A Program from a Blank Member 6 min

Standard linkage

Coming soon The videos for this session are being produced; its lessons and lab are published here now.

Three videos. Your program is always called by something, and the caller expects its registers back. The convention every z/OS program follows: register 15 is your entry address on the way in and your return code on the way out, register 14 is where to return to, register 13 points to an 18-fullword save area, register 1 to the parameters. STM 14,12,12(13) saves the caller’s registers and LM puts them back — read register by register on a drawing of the save area, not copied on faith. Then your own save area, chained to the caller’s, and the macros SAVE and RETURN that write the same instructions for you. This is the full frame every later program uses.

LAB Write program LINKAGE with the full frame: SAVE, a base register, your own save area chained in, one WTO, the caller’s register 13 restored, RETURN with RC=4. GO must end RC 4 with your message in the job log. Session 5 checkpoint (AB05).

3 videos · ~18 min
  1. 5.1 Who Calls Your Program 6 min
  2. 5.2 Entry and Exit, Written Out 6 min
  3. 5.3 Lab: The Full Frame 6 min

Assemble, link and run with JCL

Coming soon The videos for this session are being produced; its lessons and lab are published here now.

Four videos. The deck you have submitted since Session 1, now line by line. The ASM step runs ASMA90: SYSIN is your source, SYSPRINT the listing, SYSLIB the macro library, SYSLIN the object deck it passes on. The LKED step runs the binder, which turns the object deck into a load module in SYSLMOD. The GO step runs that module, and COND skips the later steps when an earlier one failed. Then the listing as a tool: LOC, OBJECT CODE, the statement number, the symbol table, and the error messages — an operation the assembler does not know, a name never defined, an operand it cannot read. The method that always works: fix the first error first.

LAB Program FIXME arrives with three errors — a wrong operation, a misspelled name and a constant with a missing quote. Fix each one from the listing’s messages alone until ASM ends RC 0 and GO ends RC 9. Session 6 checkpoint (AB06).

4 videos · ~24 min
  1. 6.1 Three Steps, Three Programs 5 min
  2. 6.2 The Deck, Line by Line 7 min
  3. 6.3 Reading the Listing and Its Messages 6 min
  4. 6.4 Lab: Fix Three Errors 6 min

Arithmetic, compare, branch and loop

Coming soon The videos for this session are being produced; its lessons and lab are published here now.

Four videos. A and S add and subtract a fullword from storage, AR and SR do it between registers. There is no IF in assembler: C and CR compare and set the condition code — equal, low or high — and the next instruction branches on it: BE, BNE, BH, BL, BNH, BNL, or plain B. A loop is a branch backwards: BCT subtracts 1 from a register and branches while it is not zero. To walk a table, keep its address in a register, fetch the entry it points at, and step it on by the entry’s length. Live on the system: 10 + 9 + … + 1 returned as RC 55 — and, on paper, why a count that starts at zero goes round about four thousand million times.

LAB Program LOOP walks a table of five fullwords with BCT and adds up only the entries higher than a limit of 10. Trace the first two trips on paper, then run it: GO must end RC 38. Session 7 checkpoint (AB07).

4 videos · ~25 min
  1. 7.1 Add and Subtract 6 min
  2. 7.2 Compare and Branch 7 min
  3. 7.3 Loops with BCT 6 min
  4. 7.4 Lab: Walk a Table 6 min

Characters and packed decimal

Coming soon The videos for this session are being produced; its lessons and lab are published here now.

Four videos. Text is worked on where it lies in storage: MVC copies a field, MVI sets one byte, CLC and CLI compare — each with its length fixed when the program is assembled. A message your program builds itself is printed with WTO TEXT=: a length, then the text. Then the number format business data lives in: packed decimal, one digit in each half byte and the sign in the last — 12.50 held as 01 25 0C. ZAP copies a packed number, AP adds, SP subtracts, CP compares. To print one, UNPK spreads the digits one to a byte and OI makes the last one printable.

LAB Program PACKED computes 12.50 + 2.75 − 1.00 in packed decimal, prints TOTAL IN CENTS IS 01425 in the job log, and returns RC 0 only when the total is right. Session 8 checkpoint (AB08).

4 videos · ~26 min
  1. 8.1 Moving and Comparing Characters 6 min
  2. 8.2 A Message You Build Yourself 6 min
  3. 8.3 Packed Decimal 7 min
  4. 8.4 Lab: Compute and Print an Amount 7 min

Abends and reading storage

Coming soon The videos for this session are being produced; its lessons and lab are published here now.

Four videos. An abend is an abnormal end, and its completion code says what kind. The three every assembler beginner meets: S0C1, the bytes at that point were not an instruction — execution ran into data; S0C4, the program used an address that is not its own — usually a register holding the wrong thing; S0C7, a decimal instruction met bytes that are not a packed number. Each is caused on purpose and read from the job’s messages. Then the dump: storage printed in hex, with the same bytes as characters beside it. The full system dump of a production abend (SYSUDUMP) is described as a concept only — this environment does not produce one for assembler programs — so you learn the dump you can ask for anywhere: SNAP, a display of exactly the bytes you name.

LAB Three programs that abend — say the code, the statement at fault and the fix for each. Then program SNAPFIX: cure its S0C7, add a SNAP of the packed fields, and run it to RC 0 with the total’s bytes visible in the SNAP output. Session 9 checkpoint (AB09).

4 videos · ~25 min
  1. 9.1 What an Abend Is 5 min
  2. 9.2 Three Abends, Caused on Purpose 7 min
  3. 9.3 A Dump You Ask For: SNAP 7 min
  4. 9.4 Lab: Find It, Fix It, Prove It 6 min

Final project: the till report

Coming soon The videos for this session are being produced; its lessons and lab are published here now.

Three videos. One small complete program of the kind assembler was written for. A table of five sales in cents, packed; report the total, the largest sale and how many sales were over 50.00, and check the total against a control total: RC 0 when it balances, RC 8 and a warning when it does not. It is built in stages — the frame and data, the loop and the total, the largest and the count, the three messages — and run at every stage, never written whole and then debugged. The course closes with an honest map of what comes next in CS170: record maps with DSECT, reading and writing files, edited output, multiplying and dividing decimals, and calling a second module.

LAB Capstone (AB10): program TILL prints TOTAL CENTS 0026049, LARGEST 12000 and BIG SALES 2 in the job log and ends RC 0 because the total balances — full standard linkage, a BCT loop, packed arithmetic, messages built at run time.

3 videos · ~20 min
  1. 10.1 The Job to Be Done 6 min
  2. 10.2 Build It in Stages 8 min
  3. 10.3 Capstone, and Where Next 6 min
//SKILLS  DD DSN=AFTER.THIS.COURSE

After this course, you can

//CERT    DD DSN=CS165.CERTIFICATE,DISP=(NEW,CATLG)

How the certificate is earned

CobolStack Certificate of Completion — Assembler On-Ramp (CS165) is issued from the lab harness’s own record of your runs — not from attendance. To earn it you must clear every gate below:

The certificate attests that you can read and write a small, complete mainframe assembler program — standard linkage, a loop over a table, packed-decimal arithmetic and a printed result — assemble, link and run it with JCL, and diagnose its common abends: the starting point for CS170 HLASM and for reading the assembler an estate still depends on.

The environment

Your seat is a private, full z/OS-compatible environment with a real HLASM assembler (ASMA90), the binder, an S/390 instruction interpreter, the assemble–link–run job, listings, abend codes and storage displays in the browser — nothing to install, snapshot and reset per exercise. By the end of the course the lab harness will have verified: ten programs of your own assembled, link-edited and run — a first message, constants read in the listing, a swap, a program written from a blank member, standard linkage, three assembly errors fixed, a table loop, packed-decimal arithmetic with a printed amount, an abend diagnosed and fixed with a storage display, and a final report program that balances to a control total at RC 0.