大机中的汇编语言该怎么学

本文探讨了程序开发中的ASM语言,特别是通过一个复杂的宏示例展示了其高级别难度,并介绍了CSECT指令在结构中的作用。作者自述对ASM的掌握有限,主要熟悉MVC等基本概念,但CSECT指令的庞大数量和细节要求显示出ASM的深度。
摘要由CSDN通过智能技术生成

提起程序开发,就不得不说合久必分,分久必合,反成各个程序段之间都有这个关系,而多个程序又组成一个功能组,可以完成一项业务,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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

「已注销」

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值