Macro Assembler AS V1.42 User's Manual
Total Page:16
File Type:pdf, Size:1020Kb
Alfred Arnold, Stefan Hilse, Stephan Kanthak, Oliver Sellke, Vittorio De Tomasi Macro Assembler AS V1.42 User's Manual Edition September 2020 IBM, PPC403Gx, OS/2, and PowerPC are registered trademarks of IBM Corporation. Intel, MCS-48, MCS-51, MCS-251, MCS-96, MCS-196 und MCS-296 are registered trademarks of Intel Corp. Motorola and ColdFire are registered trademarks of Motorola Inc. MagniV is a registered trademark of Freescale Semiconductor. PicoBlaze is a registered trademark of Xilinx Inc. UNIX is a registered trademark of the The Open Group. Linux is a registered trademark of Linus Thorvalds. Microsoft, Windows, and MS-DOS are registered trademarks of Microsoft Corporation. All other trademarks not explicitly mentioned in this section and used in this manual are properties of their respective owners. This document has been processed with the LaTeX typesetting system, using the Linux operating system. Contents 1 Introduction 11 1.1 License Agreement . 11 1.2 General Capabilities of the Assembler . 13 1.3 Supported Platforms . 19 2 Assembler Usage 21 2.1 Hardware Requirements . 21 2.2 Delivery . 22 2.3 Installation . 26 2.4 Start-Up Command, Parameters . 29 2.5 Format of the Input Files . 39 2.6 Format of the Listing . 41 2.7 Symbol Conventions . 43 2.8 Temporary Symbols . 46 2.9 Named Temporary Symbols . 46 2.9.1 Nameless Temporary Symbols . 47 2.9.2 Composed Temporary Symbols . 49 2.10 Formula Expressions . 49 2.10.1 Integer Constants . 50 2.10.2 Floating Point Constants . 51 2.10.3 String Constants . 52 2.10.4 String to Integer Conversion and Character Constants . 53 2.10.5 Evaluation . 54 2.10.6 Operators . 56 2.10.7 Functions . 56 2.11 Forward References and Other Disasters . 59 2.12 Register Symbols . 63 2.13 Share File . 64 3 4 CONTENTS 2.14 Processor Aliases . 65 3 Pseudo Instructions 67 3.1 Definitions . 67 3.1.1 SET, EQU, and CONSTANT . 67 3.1.2 SFR and SFRB . 69 3.1.3 XSFR and YSFR . 70 3.1.4 LABEL . 70 3.1.5 BIT . 70 3.1.6 DBIT . 72 3.1.7 DEFBIT . 72 3.1.8 DEFBITFIELD . 74 3.1.9 PORT . 74 3.1.10 REG and NAMEREG . 75 3.1.11 LIV and RIV . 75 3.1.12 CHARSET . 76 3.1.13 CODEPAGE . 77 3.1.14 ENUM, NEXTENUM, and ENUMCONF . 77 3.1.15 PUSHV and POPV . 79 3.2 Code Modification . 80 3.2.1 ORG . 80 3.2.2 RORG . 85 3.2.3 CPU . 85 3.2.4 SUPMODE, FPU, PMMU . 105 3.2.5 FULLPMMU . 106 3.2.6 PADDING . 106 3.2.7 PACKING . 107 3.2.8 MAXMODE . 108 3.2.9 EXTMODE and LWORDMODE . 108 3.2.10 SRCMODE . 109 3.2.11 BIGENDIAN . 109 3.2.12 WRAPMODE . 109 3.2.13 SEGMENT . 110 3.2.14 PHASE and DEPHASE . 112 3.2.15 SAVE and RESTORE . 113 3.2.16 ASSUME . 114 3.2.17 CKPT . 124 3.2.18 EMULATED . 124 CONTENTS 5 3.2.19 BRANCHEXT . 125 3.2.20 Z80SYNTAX . 125 3.2.21 EXPECT and ENDEXPECT . 126 3.3 Data Definitions . 126 3.3.1 DC[.Size] . 127 3.3.2 DS[.Size] . 128 3.3.3 DN,DB,DW,DD,DQ, and DT . 129 3.3.4 DS, DS8 . 130 3.3.5 BYT or FCB . 131 3.3.6 BYTE . 131 3.3.7 DC8 . 131 3.3.8 ADR or FDB . 132 3.3.9 WORD . 132 3.3.10 DW16 . 132 3.3.11 LONG . 132 3.3.12 SINGLE, DOUBLE, and EXTENDED . 133 3.3.13 FLOAT and DOUBLE . 133 3.3.14 SINGLE and DOUBLE . 133 3.3.15 EFLOAT, BFLOAT, and TFLOAT . 133 3.3.16 Qxx and LQxx . 134 3.3.17 DATA . 134 3.3.18 ZERO . 135 3.3.19 FB and FW . 135 3.3.20 ASCII and ASCIZ . 135 3.3.21 STRING and RSTRING . 136 3.3.22 FCC . 136 3.3.23 DFS or RMB . 136 3.3.24 BLOCK . 136 3.3.25 SPACE . 137 3.3.26 RES . 137 3.3.27 BSS . 137 3.3.28 DSB and DSW . 137 3.3.29 DS16 . 137 3.3.30 ALIGN . 138 3.3.31 LTORG . 138 3.4 Macro Instructions . 138 3.4.1 MACRO . 139 3.4.2 IRP . 147 6 CONTENTS 3.4.3 IRPC . 148 3.4.4 REPT . 148 3.4.5 WHILE . 149 3.4.6 EXITM . 149 3.4.7 SHIFT . 150 3.4.8 MAXNEST . 150 3.4.9 FUNCTION . 151 3.5 Structures . 152 3.5.1 Definition . 152 3.5.2 Usage . 154 3.5.3 Nested Structures . 154 3.5.4 Unions . 155 3.5.5 Nameless Structures . 155 3.5.6 Structures and Sections . 156 3.5.7 Structures and Macros . 156 3.6 Conditional Assembly . 156 3.6.1 IF / ELSEIF / ENDIF . 157 3.6.2 SWITCH(SELECT) / CASE / ELSECASE / ENDCASE159 3.7 Listing Control . 160 3.7.1 PAGE . 160 3.7.2 NEWPAGE . 161 3.7.3 MACEXP DFT and MACEXP OVR . 162 3.7.4 LISTING . 164 3.7.5 PRTINIT and PRTEXIT . 164 3.7.6 TITLE . 165 3.7.7 RADIX . 165 3.7.8 OUTRADIX . 165 3.8 Local Symbols . 166 3.8.1 Basic Definition (SECTION/ENDSECTION) . 167 3.8.2 Nesting and Scope Rules . 168 3.8.3 PUBLIC and GLOBAL . 171 3.8.4 FORWARD . ..