提起程序开发,就不得不说合久必分,分久必合,反成各个程序段之间都有这个关系,而多个程序又组成一个功能组,可以完成一项业务,ASM比JCL难很多,因为它涉及到地址和业务。
一 ASM 的难度如何
比方说下面这个宏,和上文提的JCLsort 不是一个层级的,很复杂
Figure 1. Macro instructions
Prototype ┌───────────────┐ ┌───────────────┐ ┌───────────────┐
Statement │ │ │ │ │ │
│ Symbolic │ │ Symbolic │ │ Zero or more │
│ Parameter │ │ Operation │ │ Symbolic │
│ │ │ Code │ │ Parameters │
│ │ │ │ │ │
└───────┬───────┘ └───────┬───────┘ └───────┬───────┘
│ │ │
V Which can be V Must be the V Which can be
│ │ same as │
│ │ │
─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─
─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─
│ │ │
Macro ┌───────┴───────┐ ┌───────┴───────┐ ┌───────┴───────┐
Instruction │ │ │ │ │ │
Statement │ NAME │ │ OPERATION │ │ OPERAND │
│ Field │ │ Field │ │ Field │
│ │ │ │ │ │
└───────┬───────┘ └───────────────┘ └───────┬───────┘
V V
│ ┌───────┴───────┐
│ │ │
│ │ Zero or more │
│ │ Operands │
│ │ │
│ │ │
│ └───────┬───────┘
│ │
V Which can be V Which can be
┌─────────────────────┴─────────────────────┐ ┌──────────┴──────────┐
V V V V
┌───────┴───────┐ ┌───────┴───────┐ ┌───────┴───────┐ ┌───────┴───────┐
│ │ │ │ │ │ │ │
│ A Symbol │ │ Character │ │ Operands with │ │ Sublists with │
│ │ │ String │ │ one value │ │ one or more │
│ │ │ │ │ │ │ entries │
│ │ │ │ │ │ │ │
└───────┬───────┘ └───────┬───────┘ └───────┬───────┘ └───────┬───────┘
V V V V
│ │ │ ┌───────┴───────┐
│ │ │ │ │
│ │ │ │ Each entry │
│ │ │ │ can have a │
│ │ │ │ value │
│ │ │ │ │
│ │ │ └───────┬───────┘
│ V V V
│ └────────────────────────────┴──────────┬──────────┘
│ │
V Which can be V Which can be
├─────────────────────┬─────────────────────┐ ┌──────────┴──────────┐
V V V V V
┌───────┴───────┐ ┌───────┴───────┐ ┌───────┴───────┐ ┌───────┴───────┐ ┌───────┴───────┐
│ │ │ │ │ │ │ │ │ │
│ Ordinary │ │ Sequence │ │ Variable │ │ Character │ │ ‘Character │
│ Symbol │ │ Symbol │ │ Symbol │ │ String │ │ String’ │
│ (or space) │ │ │ │ │ │ (excluding │ │ (including │
│ │ │ │ │ │ │ spaces and │ │ spaces) │
│ │ │ │ │ │ │ commas) │ │ │
│ │ │ │ │ │ │ │ │ │
└───────────────┘ └───────────────┘ └───────────────┘ └───────────────┘ └───────────────┘
二 笔者对ASM的掌握如何
基本上知道个 MVC,MVI,CSECT,DSECT,其他的就直接不知道了
当然了,还有个START END,指令数目非常庞大,而且还有个寄存器
2.1 CSECT
The CSECT instruction initiates an executable control section or indicates the continuation of an executable control section.
Read syntax diagramSkip visual syntax diagram
-±-------±-CSECT-------------------------------------------><
‘-symbol-’
symbol
Is one of the following:
An ordinary symbol
A variable symbol that has been assigned a character string with a value that is valid for an ordinary symbol
A sequence symbol
The CSECT instruction can be used anywhere in a source module after any ICTL or *PROCESS statements. If it is used to initiate the first executable control section, it must not be preceded by any instruction that affects the location counter and thus causes a control section to be initiated.
If symbol denotes an ordinary symbol, the ordinary symbol identifies the control section. If several CSECT instructions within a source module have the same symbol in the name field, the first occurrence initiates the control section and the rest indicate the continuation of the control section. The ordinary symbol denoted by symbol represents the address of the first byte in the control section, and has a length attribute value of 1.
If symbol is not specified, or if name is a sequence symbol, the CSECT instruction initiates, or indicates the continuation of the unnamed control section.
If the first control section is initiated by a START instruction, the CSECT instruction which continues the section must have the same name as the START instruction.