上传者: fan7hoo
|
上传时间: 2022-09-07 20:01:45
|
文件大小: 6.11MB
|
文件类型: PDF
目录
1. 预备与基础知识 .......................................................................................................................... 5
1.1 PSW & Real Address and Virtual Address ........................................................................... 5
1.1.1PSW(Program Status Word) ................................................................................ 5
1.1.2Virtual Address: ......................................................................................................... 5
1.2 EBCDIC 码 ........................................................................................................................... 6
1.3 数的表示、转换与计算 ................................................................................................... 6
1.3.1字符数据 .................................................................................................................. 6
1.3.2二进制数 .................................................................................................................. 7
1.3.3逻辑数 ...................................................................................................................... 8
1.3.4十进制数 .................................................................................................................. 8
1.4 主机环境下汇编语言源程序→可执行模块流程 ........................................................... 9
1.5 什么是主程序?什么是子程序? ................................................................................... 9
1.6 汇编程序书写格式与样本 ............................................................................................. 10
1.6.1汇编控制语句:START、END .......................................................................... 10
1.6.2汇编控制语句:USING指令 .............................................................................. 10
1.7 关于地址: 基地址、变址与相对地址 .......................................................................... 11
1.8 寄存器的约定 ................................................................................................................. 11
1.9 常数的定义 ..................................................................................................................... 12
1.9.1数据区域的定义 .................................................................................................... 12
1.9.2常数的定义 ............................................................................................................ 13
1.10 指令格式与类型: 指令格式与类型例子 .................................................................... 18
2. Sequential Input & Output .......................................................................................................... 19
2.1 分析一个带有输出文件的汇编语言程序 ..................................................................... 19
2.2 有关输入/出的宏指令 ................................................................................................. 20
2.2.1 OPEN .............................................................................................................................. 21
2.2.2 CLOSE ..................................................................................................................... 21
2.2.3GET(读) & PUT(写) ...................................................................................... 21
2.3关于ORG, EQU, PRINT等指令的介绍 ............................................................................ 23
2.3.1 ORG语句(置地址计数器) ................................................................................ 23
2.3.2 EQU “等价”指令,格式:name EQU constant ............................................... 24
2.3.3 PRINT 操作数 ........................................................................................................ 24
2.4 什么是保护区?以及关于STM, LM 指令的介绍 ...................................................... 24
3.编程 Move,Comparing& Branching ........................................................................................ 28
3.1 MOVE:MVC,MVI ,MVZ,MVN ................................................................................ 28
3.1.1字符传送指令MVC D1(L1,B1),D2(B2) ............................................................. 28
3.1.2直接传送指令:MVI D1(B1),I2 .................................................................... 29
3.1.3MVZ、MVN D1(B1),D2(B2) ..................................................................................... 29
3.2逻辑比较指令: ............................................................................................................... 31
3.2.1CLC D1(L,B1),D2(B2) ................................................................................................ 31
3.2.2直接数逻辑比较指令:CLI.................................................................................. 32
3.2.3 十进制比较CP D1(L1,B1),D2(L2,B2) .................................................................... 33
3.3 MVCL R1,R2 长传送 ...................................................................................................... 33
2
3 IBM 大型机汇编语言
3.4CLCL R1,R2 两域比较 ........................................................................................................ 35
3.4 Branching逻辑比较转移,算术运算转移及条件转移 ............................................... 37
3.4.1算术运算转移 ........................................................................................................ 37
3.4.2逻辑比较转移 ........................................................................................................ 37
3.4.3条件转移:BC、BCR .......................................................................................... 37
4. 编程:Packed Decimal .............................................................................................................. 39
4.1 压缩十进制运算 ............................................................................................................. 39
4.1.1.十进制加法指令AP ........................................................................................... 39
4.1.2.十进制减法指令SP ............................................................................................ 39
4.1.3.清零及加十进制指令ZAP: .............................................................................. 40
4.1.4.比较十进制指令CP ........................................................................................... 41
4.1.5十进制乘法指令MP: ......................................................................................... 42
4.1.6十进制除法指令DP .............................................................................................. 43
4.2 PACK & UNPK .................................................................................................................... 44
4.2.1PACK A,B .................................................................................................................. 44
4.2.2拆卸:UNPK ........................................................................................................ 45
4.2.3指令:OI (“或”) ............................................................................................... 46
4.3SRP( 压缩十进数的舍入移位)(Shift & Round Packed) ......................................... 47
5.编程Table Handling& Editing ..................................................................................................... 47
5.1 LA ...................................................................................................................................... 47
5.2 BCT / BCTR 计数转 ........................................................................................................... 48
5.3 ED / EDMK 编辑 ............................................................................................................... 49
5.3.1编辑指令:ED ...................................................................................................... 49
5.3.2编辑并说明:EDMK ............................................................................................ 50
6.编程Binary Arithmetic &Tables ................................................................................................... 53
6.1 有关Binary Arithmetic 指令 .......................................................................................... 53
6.1.1 L 指令 ................................................................................................................. 53
6.1.2寄存器装载LR ....................................................................................................... 54
6.1.3多寄存器恢复指令LM .......................................................................................... 56
6.1.4多寄存器保存指令STM........................................................................................ 57
6.1.5存储指令ST ........................................................................................................... 58
6.2二进制数(算术)运算 ................................................................................................... 59
6.2.1CVB &CVD 指令 ...................................................................................................... 60
6.2.2 A 、AH 、AR 二进数“加”指令 ........................................................................... 61
6.2.3 S、SH 、SR 二进数“减”指令 .............................................................................. 63
6.2.4 M、MH 、MR 二进数“乘”指令 ............................................................................ 64
6.2.5 D、DR 二进数“除”指令 ........................................................................................ 65
6.3比较指令 ........................................................................................................................... 66
6.3.1 C,CB,CR ................................................................................................................... 66
6.3.2变址器比较指令BXLE,BXH ................................................................................... 68
6.3.3 插入与存入字符IC、STC ..................................................................................... 71
6.3.4屏蔽插入与存入字符ICM,STCM .......................................................................... 73
7编程Shifting,Boolean &Bit Operations .................................................................................... 77
7.1 SHIFT 移位指令 ................................................................................................................ 77
3
4 IBM 大型机汇编语言
7.1.1.逻辑左移单寄存器指令SLL ............................................................................... 78
7.1.2.逻辑右移单寄存器指令SRL: .......................................................................... 78
7.1.3.逻辑左移双寄存器指令SLDL ............................................................................ 78
7.1.4.逻辑右移双寄存器指令SRDL ............................................................................ 79
7.1.5算术左移单寄存器指令SLA ................................................................................. 82
7.1.6.算术右移寄存器指令SRA ................................................................................. 83
7.1.7.算术左移双寄存器指令SLDA ............................................................................ 83
7.2 有关Boolean 指令 ......................................................................................................... 86
7.3 有关Bit Operations指令 ................................................................................................ 89
8编程Subroutines&Macros .......................................................................................................... 92
8.1内部子程序 ....................................................................................................................... 92
8.1.1 BAL(内部)子程序 .............................................................................................. 92
8.1.2BALR(外部)子程序 ............................................................................................ 93
8.2 子程序参数传递 .............................................................................................................. 95
8.2.1调用序列的约定方法 ............................................................................................ 95
8.2.2参数地址区的约定方法 ........................................................................................ 96
8.3 宏指令介绍 ....................................................................................................................... 97
•8.3.1宏指令与子程序的区别: ................................................................................... 97
8.3.2宏指令的形式 ......................................................................................................... 97
8.3.3符号参数 ................................................................................................................ 97
8.3.4宏定义及宏调用 .................................................................................................. 100
8.3.5关于宏的两个例子 .............................................................................................. 107
4