-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMACRO-80.txt
2675 lines (1843 loc) · 85.7 KB
/
MACRO-80.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Microsoft M80 DOC
CONTENTS
CHAPTER 1 Introduction
CHAPTER 2 MACRO-80 Assembler
2.1 Running MACRO-80
2.2 Command Format
2.2.1 Devices
2.2.2 Switches
2.3 Format of MACRO-80 Source Files
2.3.1 Statements
2.3.2 Symbols
2.3.3 Numeric Constants
2.3.4 Strings
2.4 Expression Evaluation
2.4.1 Arithmetic and Logical Operators
2.4.2 Modes
2.4.3 Externals
2.5 Opcodes as Operands
2.6 Pseudo Operations
2.6.1 ASEG
2.6.2 COMMON
2.6.3 CSEG
2.6.4 DB - Define Byte
2.6.5 DC - Define Character
2.6.6 DS - Define Space
2.6.7 DSEG
2.6.8 DW - Define Word
2.6.9 END
2.6.10 ENTRY/PUBLIC
2.6.11 EQU
2.6.12 EXT/EXTRN
2.6.13 INCLUDE
2.6.14 NAME
2.6.15 ORG - Define Origin
2.6.16 PAGE
2.6.17 SET
2.6.18 SUBTTL
2.6.19 TITLE
2.6.20 .COMMENT
2.6.21 .PRINTX
2.6.22 .RADIX
2.6.23 .Z80
2.6.24 .8080
2.6.25 .REQUEST
2.6.26 Conditional Pseudo Operations
2.6.26.1 ELSE
2.6.26.2 ENDIF
2.6.27 Listing Control Pseudo Operations
2.6.28 Relocation Pseudo Operations
2.6.28.1 ORG Pseudo-op
2.6.29.2 LINK-80
2.6.29 Relocation Before Loading
2.7 Macros and Block Pseudo Operations
2.7.1 Terms
2.7.2 REPT-ENDM
2.7.3 IRP-ENDM
2.7.4 IRPC-ENDM
2.7.5 MACRO
2.7.6 ENDM
2.7.7 EXITM
2.7.8 LOCAL
2.7.9 Special Macro Operators and Forms
2.8 Using z80 Pseudo-ops
2.9 Sample Assembly
2.10 MACRO-80 Errors
2.11 Compatability with Other Assemblers
2.12 Format of Listings
2.12.1 Symbol Table Listing
CHAPTER 3 CREF-80 Cross Reference Facility
CHAPTER 4 LINK-80 Linking Loader
4.1 Running LINK-80
4.2 Command Format
4.2.1 LINK-80 Switches
4.2.2 Sample Link
4.3 Format of LINK Compatible Object Files
4.4 LINK-80 Error Messages
4.5 Program Break Information
CHAPTER 5 LIB-80 Library Manager
5.1 LIB-80 Commands
5.1.1 Modules
5.2 LIB-80 Switches
5.3 LIB-80 Listings
5.4 Sample LIB Session
5.5 Summary of Switches and Syntax
APPENDIX A TEXDOS Operating System
A.1 TEXDOS Command Files
A.2 MACRO-80
A.3 CREF-80
A.4 LINK-80
CHAPTER 1
INTRODUCTION
MACRO-80 is a relocatable macro assembler for 8080 and z80
microcomputer systems. It assembles 8080 or z80 code on any 8080 or z80
development system running the CP/M, ISIS-II, TRSDOS or TEKDOS
operating system. The MACRO-80 package includes the MACRO-80 assembler,
the LINK-890 linking loader, and the CREF-80 cross reference facility.
CP/M versions also include the LIB-80 Library Manager. MACRO-80 resides
in approximately 14K of memory and has an assembly rate of over 1000
lines per minute.
MACRO-80 incorporates almost all "big computer" assembler features
without sacrificing speed or memory space. The assembler supports a
complete Intel standard macro facility, including IRP, IRPC, REPEAT,
local variables and EXITM. Nesting of macros is limited only by memory.
Code is assembled in relocatable modules that are manipulated with the
flexible linking loader. Conditional assembly capability is enchanced
by an expanded set of conditional pseudo operations that include
testing of assembly pass, symbol definition, and parameters to macros.
Conditionals may be nested up to 255 levels.
MACRO-80's linking loader provides a versatile array of loader
capabilities, which are executed by means of easy command lines and
switches. Any number of programs may be loaded with one command,
relocatable modules may be loaded in user-specified locations, and
external references between modules are resolved automatically by the
loader. The loader also performs library searches for system
subroutines and generates a load map of memory showing the locations of
the main program and subroutines. The cross reference facility that is
included in this package supplies a convenient alphabetic list of all
program variable names, along with the line numbers where they are
referenced and defined.
This manual is designed to serve as a reference guide to the MACRO-80
package. It defines, explains and gives examples of all the features in
MACRO-80 in terms that should be understandable to anyone familiar with
assembly language programming. It is not intended, however, to serve as
instructional material and presumes the user has substantial knowledge
of assembly language programming. The user should refer to
instructional material available from a variety of sources for
additional tutorial information.
CHAPTER 2
MACRO-80 ASSEMBLER
2.1 RUNNING MACRO-80
The command to run MACRO-80 is
M80
MACRO-80 returns the prompt "*", indicating it is ready to accept
commands.
NOTE
If you are using the TEKDOS
operating system, see Appendix
A for proper command formats.
2.2 COMMAND FORMAT
A command to MACRO-80 consists of a string of filenames with optional
switches. All filenames should follow the operating system's
conventions for filenames and extensions. The default extensions
supplied by Microsoft software are as follows:
File CP/M ISIS-II
Relocatable object file REL REL
Listing file PRN LST
MACRO-80 source file MAC MAC
FORTRAN source file FOR FOR
COBOL source file COB COB
Absolute file COM
2.2.1 Devices
Any field in the MACRO-80 command string can also specify a device
name. The default device name with the CP/M operating system is the
currently logged disk. The default device name with the ISIS-II
operating system is disk drive 0. The command format is:
dev:objfile,dev:lstfile=dev:source file
The device names are as follows:
Device CP/M ISIS-II
Disk drives A:, B:, C:,... :F0:, :F1:, :F2:, ...
Line printer LST: LST:
Teletype or CRT TTY: TTY:
High speed reader HSR
Examples:
*,TTY:=TEST Assemble the source file TEST.MAC
and list the program on the
console. No object code is
generated. Useful for error check.
*SMALL,TTY:=B:TEST Assemble TEST.MAC (found
on disk drive B), place
the object file in SMALL.REL
and list the program on the console.
2.2.2 Switches
A switch is a letter that is appended to the command string, preceded
by a slash. It specifies an optional task to be performed during
assembly. More than one switch can be used, but each must be preceded
by a slash. (With the TEKDOS operating system, switches are preceded by
commas or spaces. See Appendix A.) All switches are optional. The
available switches are:
Switch Action
O Octal lising
H Hexadecimal listing (default)
R Force generation of an object file
L Force generation of a lising file
C Force generation of a cross reference file
Z Assemble Z80 opcodes (default for Z80 operating systems)
I Assemble 8080 opcodes (default for 8080 operating systems)
P Each /P allocates an extra 256 bytes of stack space for use
during assembly. Use /P if stack overflow occurs during
assembly. Otherwise, not needed.
M Initialize Block Data Areas. If the programmer wants the
area that is defined by the DS (Define Space) pseudo-op
initialized to zeros, then the programmer should use the /M
switch in the command line. Otherwise, the space is not
guaranteed to contain zeros. That is, DS does not
automattically initialize the space to zeros.
X Usually used to suppress the listing of false conditionals.
The following paragraph describes the /X switch more
completely but in very technical terms.
The presence or absence of /X in the command line sets the
initial current mode and the initial value of the default
for listing or suppressing lines in false conditional
blocks. /X sets the current mode and initial value of
default to not-to-list. No /X sets current mode and initial
value of default to list. Current mode determines whether
false conditionals will be listed or suppressed. The
initial value of the default is used with the .TFCOND
pseudo-op so that .TFCOND is independent of .SFCOND and
.LFCOND. If the program contains .SFCOND or .LFCOND, /X has
no effect after .SFCOND or .LFCOND is encountered until a
.TFCOND is encountered in the file. So /X has an effect
only when used with a file that contains no conditional
listing psuedo-ops or when used with .TFCOND.
Examples:
*=TEST/L Assemble TEST.MAC, places the object file in TEST.REL
and a listing file in TEST.PRN. (With ISIS-II, the
listing file is TEST.LST.)
*=TEST/L/O Same as above, but listing file addresses will be in
octal.
*LAST=TEST/C Assemble TEST.MAC, place the object file in LAST.REL
and cross reference file in TEST.CRF. (See Chapter 3.)
2.3 FORMAT OF MACRO-80 SOURCE FILES
Input source lines of up to 132 characters in length are acceptable.
MACRO-80 preserves lower case letters in quoted strings and comments.
All symbols, opcodes and pseudo-opcodes typed in lower case will be
converted to upper case.
If the source file includes line numbers from an editor, each byte of
th eline number must have the high bit on. Line numbers from
Microsoft's EDIT-80 are acceptable.
2.3.1 Statements
Source files input to MACRO-80 consist of statements of the form:
[label:[:]] [operator] [arguments] [;comment]
With the exception of the ISIS assembler $ controls (see Section 2.11),
it is nog necessary that statements begin in column 1. Multiple blanks
or tabs may be used to improve readability.
If a label is present, it is the first item in the statement and is
immediately followed by a colon. If it is followed by two colons, it is
declared as PUBLIC (seen ENTRY/PUBLIC, Section 2.6.10). For example:
FOO:: RET
is equivalent to
PUBLIC FOO
FOO: RET
The next item after the label, or the first item on the line if no
label is present, is an operator. An operator may be an 8080 mnemonic,
pseudo-op, macro call or expression. The evaluation is as follows:
1. Macro call
2. Mnemonic/Pseudo operation
3. Expression
Instead of flagging an expression as an error, the assembler treats it
as if it were a DB statement (see Section 2.6.4).
The arguments following the operator will, of course, vary in form
according to the operator.
A comment always begins with a semicolon and ends with a carriage
return. A comment may be a line by itself or it may be appended to a
line that contains a statement. Extended comments can be entered using
the .COMMENT pseudo operation (see Section 2.6.20).
2.3.2 Symbols
MACRO-80 symbols may be of any length, however, only the first six
characters are significant. The following characters are legal in a
symbol:
A-Z 0-9 $ . ? @
With Microsoft's 8080/Z80/8086 assemblers, the underline character is
also legal in a symbol. A symbol may not start with a digit. When a
symbol is read, lower case is translated into upper case. If a symbol
reference is followed by ## it is declared external (see also the
EXT/EXTRN pseudo-op, Section 2.6.12).
2.3.3 Numeric Constants
The default base for numeric constants is decimal. This may be changed
by the .RADIX pseudo-op (see Section 2.6.22). Any base from 2 (binary)
to 16 (hexadecimal) may be selected. When the base is greater than 10,
A-F are the digits following 9. If the first digit of a number is not
numeric the number must be preceeded by a zero.
Numbers are 16-bit unsigned quantities. A number is always evaluated in
the current radix unless one of the following special notations is
used:
nnnnB Binary
nnnnD Decimal
nnnnO Octal
nnnnQ Octal
nnnnH Hexadecimal
X'nnnn' Hexadecimal
Overflow of a number beyond two bytes is ignored and the result is the
low order 16-bits.
A character constant is a string comprised of zero, one or two ASCII
characters, delimited by quotation marks, and used in a non-simple
expression. For example, in the statement
DB 'A' + 1
'A' is a character constant. But the statement
DB 'A'
uses 'A' as a string because it is in a simple expression. The rules
for character constant delimiters are the same as for strings.
A character constant comprised of one character has as its value the
ASCII value of that character. That is, the high order byte of the
value is zero, and the low order byte is the ASCII value of the
character. For example, the value of the constant 'A' is 41H.
A character constant comprised of two characters has as its value the
ASCII value of the first character in the high order byte and the ASCII
value of the second character in the low order byte. For example, the
value of the character constant 'AB' is 41H*256+42H
2.3.4 Strings
A string is comprised of zero or more characters delimited by quotation
marks. Either single or double quotes may be used as string delimiters.
The delimiter quotes may be used as characters if they appear twice for
every character occurrence desired. For example, the statement
DB "I am ""great"" today"
stores the string
I am "great" today
If there are zero characters between the delimiters, the string is a
null string.
2.4 EXPRESSION EVALUATION
2.4.1 Arithmetic And Logical Operators
The following operators are allowed in expressions. The operators are
listed in order of precedence.
NUL
LOW, HIGH
*, /, MOD, SHR, SHL
Unary Minus
+, -
EQ, NE, LT, LE, GT, GE
NOT
AND
OR, XOR
Parantheses are used to change the order of precedence. During
evaluation of an expression, as soon as a new operator is encountered
that has precedence less than or equal to the last operator
encountered, all operations up to the new operator are performed. That
is, subexpressions involving operators of higher precedence are
computed first.
All operators except +, -, *, / must be separated from their operands
by at least one space.
The byte isolation operators (HIGH, LOW) isolate the high or low order
8 bits of an Absolute 16-bit value. If a relocatable value is supplied
as an operand, HIGH and LOW will treat it as if it were relative to
location zero.
2.4.2 Modes
All symbols used as operands in expressions are in one of the following
modes: Absolute, Data Relative, Program (Code) Relative or COMMON. (See
Section 2.6 for the ASEG, CSEG, DSEG and COMMON pseudo-ops.) Symbols
assembled under the ASEG, CSEG (default), or DSEG pseudo-ops are in
Absolute, Code Relative or Data Relative mode respectively.
The number of COMMON modes in a program is determined by the number of
COMMON blocks that have been named with the COMMON pseudo-op. Two
COMMON symbols are not in the same mode unless they are in the same
COMMON block. In any operation other than addition or subtraction, the
mode of both operands must be Absolute.
If the operation is addition, the following rules apply:
1 At least one of the operands must be Absolute.
2 Absolute + <mode> = <mode>
If the operation is subtraction, the following rules apply:
1 <mode> - Absolute = <mode>
1 <mode> - <mode> = Absolute
where the two <mode>s are the same.
Each intermediate step in the evaluation of an expression must conform
to the above rules for modes, or an error will be generated. For
example, if FOO, BAZ and ZAZ are three Program Relative symbols, the
expression
FOO + (BAZ -ZAZ)
if legal because the first step (BAZ - ZAZ) generates an Absolute value
that is then added to the Program Relative value, FOO.
2.4.3 Externals
Aside from its classification by mode, a symbol is either External or
not External. (See EXT/EXTRN, Section 2.6.12.) An External value must
be assembled into a two-byte field. (Singe-byte Externals are not
supported.) The following rules apply to the use of Externals in
expressions:
1. Externals are legal only in addition and subtraction.
2. If an External symbol is used in an expression, the result of
the expression is always External.
3. When the operation is addition, either operand (but not both)
may be External.
4. When the operation is subtraction, only the first operand may
be External.
2.5 OPCODES AS OPERANDS
8080 opcodes are valid one-byte operands. Note that only the first byte
is a valid operand. For example:
MVI A,(JMP)
ADI (CPI)
MVI B,(RNZ)
CPI (INX H)
ACI (LXI B)
MVI C,MOV A,B
Errors will be generated if more than one byte is included in the
operand -- such as (CPI 5), LXI B,LABEL1 or (JMP LABEL2).
Opcodes used as one-byte operands need not be enclosed in parentheses.
NOTE
Opcodes are not valid operands
in Z80 mode.
2.6 PSEUDO OPERATIONS
2.6.1 ASEG
ASEG
ASEG sets the location counter to an absolute segment of memory. The
location of the absolute counter will be that of the last ASEG (default
is 0), unless an ORG is done after the ASEG to change the location. The
effect of ASEG is also achieved by using the code segment (CSEG) pseudo
operation and the /P switch in LINK-80. See also section 2.6.28
2.6.2 COMMON
COMMON /<block name>/
COMMON sets the location counter to the selected common block in
memory. The location is always the beginning of the area so that
compatibility with the FORTRAN COMMON statement is maintained. If
<block name> is omitted or consists of spaces, it is considered to be
blank common. See also Section 2.6.28.
2.6.3 CSEG
CSEG
CSEG sets the location counter to the code relative segment of memory.
The location will be that of the last CSEG (default is 0), unless an
ORG is done after the CSEG to change the location. CSEG is the default
condition of the assembler (the INTEL assembler defaults to ASEG). See
also Section 2.6.28.
2.6.4 DB - Define Byte
DB <exp>[,<exp>...]
DB <string>[<string>...]
The arguments to DB are either expressions or strings. DB stores the
values of the expressions or the characters of the strings in
successive memory locations beginning with the current location
counter.
Expressions must evaluate to one byte. (if the high byte of the result
is 0 or 255, no error is given; otherwise, an A error results.)
Strings of three or more characters may not be used in expressions
(i.e., they must be immediately followed by a comma or the end of the
line). The characters in a string are stored in the order of
appearance, each as a one-byte value with the high order bit set to
zero.
Example:
0000' 41 42 DB 'AB'
0002' 42 DB 'AB' AND 0FFH
0003' 41 42 43 DB 'ABC'
2.6.5 DC - Define Character
DC <string>
DC stores the characters in <string> in successive memory locations
beginning with the current location counter. As with DB, characters are
stored in order of appearance, each as a one-byte value with the high
order bit set to zero. However, DC stores the last character of the
string with the high order bit set to one. An error will result if the
argument to DC is a null string.
2.6.6 DS - Define Space
DS <exp>
DS reserves an area of memory. The value of <exp> gives the number of
bytes to be allocated. All names used in <exp> must be previously
defined (i.e., all names known at that point on pass 1). Otherwise, a V
error is generated during pass 1 and a U error may be generated during
pass 2. If a U error is nog generated during pass 2, a phase error will
probably be generated because the DS generated no code on pass 1.
2.6.7 DSEG
DSEG
DSEG sets the location counter to the Data Relative segment of memory.
The location of the data relative counter wil be that of the last DSEG
(default is 0), unless an ORG is done after the DSEG to change the
location. See also Section 2.6.28.
2.6.8 DW - Define Word
DW <exp>[,<exp>...]
DW stores the values of the expressions in successive memory locations
beginning with the current location counter. Expressions are evaluated
as 2-byte (word) values.
2.6.9 END
END [<exp>]
The END statement specifies the end of the program. If <exp> is
present, it is the start address of the program. If <exp> is not
present, then no start address is passed to LINK-80 for that program.
NOTE
If an assembly language program
is the main program, a start
address (label) must be
specified. If not, LINK-80 will
issue a "no start address"
error. If the program is a
subroutine to a FORTRAN program
(for example), the start
address is nog required because
FORTRAN has supplied one.
2.6.10 ENTRY/PUBLIC
ENTRY <name>[,<name>...]
or
PUBLIC <name>[,<name>...]
ENTRY or PUBLIC declares each name in the list as internal and
therefore available for use by this program and other programs to be
loaded concurrently. All of the names in the list must be defined in
the current program or a U error results. An M error is generated if
the name is an external name or common-blockname.
2.6.11 EQU
<name> EQU <exp>
EQU assigns the value of <exp> to <name>. If <exp> is external, an
error is generated. If <name> already has a value other than <exp>, an
M error is generated.
2.6.12 EXT/EXTRN
EXT <name>[,<name>...]
or
EXTRN <name>[,<name>...]
EXT or EXTRN declares that the name(s) in the list are external (i.e.,
defined in a different program). If any item in the list references a
name that is defined in the current program, an M error results. A
reference to a name where the name is followed immediately by two pound
signs (e.g., NAME##) also declares the name as external.
2.6.13 INCLUDE
INCLUDE <filename>
The INCLUDE pseudo-op applies only to CP/M versions of MACRO-80. The
pseudo-ops INCLUDE, $INCLUDE and MACLIB are synonymous.
The INCLUDE pseudo-op assembles source statements from an alternate
source file into the current source file. Use of INCLUDE eliminates the
need to repeat an often-used sequence of statements in the current
source file.
<filename> is any valid specification, as determined by the operating
system. Defaults for filename extensions and device names are the same
as those in a MACRO-80 command line.
The INCLUDE file is opened and assembled into the current source file
immediately following the INCLUDE statement. When end-of-file is
reached, assembly resumes with the statement following INCLUDE.
On a MACRO-80 listing, a plus sign is printed between the assembled
code and the source line on each line assembled from an INCLUDE file.
(See Section 2.12.)
Nested INCLUDEs are not allowed. If encountered, they will result in an
objectionable syntax error 'O'.
The file specified in the operand field must exist. If the file is not
found, the error 'V' (value error) is given, and the INCLUDE is
ignored.
2.6.14 NAME
NAME ('modname')
NAME defines a name for the module. Only the first six characters are
significant in a module name. A module name may also be defined with
the TITLE pseudo-op. In the absence of both the NAME and TITLE
pseudo-ops, the module name is created from the source file name.
2.6.15 ORG - Define Origin
ORG <exp>
The location counter is set to the value of <exp> and the assembler
assigns code starting with that value. All names used in <exp> must be
known on pass 1, and the value must either be absolute or in the same
area as the location counter.
2.6.16 PAGE
PAGE [<exp>]
PAGE causes the assembler to start a new output page. The value of
<exp>, if included, becomes the new page size (measured in lines per
page) and must be in the range 10 to 255. The default page size is 50
lines per page. The assembler puts a form feed character in the listing
file at the end of a page.
2.6.17 SET
<name> SET <exp>
SET is the same as EQU, except no error is generated if <name> is
already defined.
2.6.18 SUBTTL
SUBTTL <text>
SUBTTL specifies a subtitle to be listed on the line after the title
(see TITLE, Section 2.6.19) on each page heading. <text> is truncated
after 60 characters. Any number of SUBTTLs may be given in a program.
2.6.19 TITLE
TITLE <text>
TITLE specifies a title to be listed on the first line of each page. If
more than one TITLE is given, a Q error results. The first six
characters of the title are used as the module name unless a NAME
pseudo operation is used. If neither a NAME or TITLE pseudo-op is used,
the module name is created from the source filename.
2.6.20 .COMMENT
.COMMENT <delim><text><delim>
The first non-blank character encountered after .COMMENT is the
delimiter. The following <text> comprises a comment block which
continues until the next occurence of <delimiter> is encountered. For
example, using an asterisk as the delimiter, the format of the comment
block would be:
.COMMENT *
any amount of text entered
here as the comment block
.
.
. *
;return to normal mode
2.6.21 .PRINTX
.PRINTX <delim><text><delim>
The first non-blank character encountered after .PRINTX is the
delimiter. The following text is listed on the terminal during assembly
until another occurence of the delimiter is encountered. .PRINTX is
useful for displaying progress through a long assembly or for
displaying the value of conditional assembly switches. For example:
IF CPM
.PRINTX /CPM version/
ENDIF
NOTE
.PRINTX will output on both
passes. If only one printout
is desired, use the IF1 or
IF2 pseudo-op. For example:
IF2
IF CPM
.PRINTX /CPM version/
ENDIF
ENDIF
will only print if CPM is
true and M80 is in pass 2.
2.6.22 .RADIX
.RADIX <exp>
The default base (or radix) for all constants is decimal. The .RADIX
statement allows the default radix to be changed to any base in the
range of 2 to 16. For example:
MOVI BX,0FFH
.RADIX 16
MOVI BC,0FF
The two MOVIs in the example are indentical. The <exp> in a .RADIX
statement is always in decimal radix, regardless of the current radix.
2.6.23 .Z80
.Z80 enables the assembler to accept Z80 opcodes. This is the default
condition when the assembler is running on a Z80 operating system. Z80
mode may also be set by appending the Z switch to the MACRO-80 command
string -- see Section 2.2.2.
2.6.24 .8080
.8080 enables the assembler to accept 8080 opcodes. This is the default
condition when the assembler is running on an 8080 operating system.
8080 mode may also be set by appending the I switch to the MACRO-80
command string -- see Section 2.2.2.
2.6.25 REQUEST
.REQUEST <filename>[,<filename>...]
.REQUEST sends a request to the LINK-80 loader to search the filenames
in the list for undefined globals. The filenames in the list should be
in the form of legal symbols. They should not include filename
extensions or disk specifications. LINK-80 supplies a default extension
and assumes the default disk drive.
2.6.26 Conditional Pseudo Operations
The conditional pseudo operations are:
IF/IFT <exp> True if <exp> is no 0.
IFE/IFF <exp> True if <exp> is 0.
IF1 True if pass 1.
IF2 True if pass 2.
IFDEF <symbol> True if <symbol> is defined or has been
declared External.
IFNDEF <symbol> True if <symbol> is undefined or not
declared External.
IFB <arg> True if <arg> is blank. The angle
brackets around <arg> are required.
IFNB <arg> True if <arg> is not blank. Used for
testing when dummy parameters are
supplied. The angle brackets around <arg>
are required.
IFIDN <arg1>,<arg2> True if the string <arg1> is IDeNtical to
the string <arg2>.
The angle brackets around <arg1> and
<arg2> are required.
IFDIF <arg1>,<arg2> True if the string <arg1> is DIFferent
from the string <arg2>.
The angle brackets around <arg1> and
<arg2> are required.
All conditionals use the following format:
IFxx [argument]
.
.
.
[ELSE
.
.
. ]
ENDIF
Conditionals may be nested to any level. Any argument to a conditional
must be known on pass 1 to avoid V errors and incorrect evaluation. For
IF, IFT, IFF, and IFE the expression must involve values which were
previously defined and the expression must be absolute. If the name is
defined after an IFDEF or IFNDEF, pass 1 considers the name to be
undefined, but it will be defined on pass 2.
2.6.26.1 ELSE - Each conditional pseudo operation may optionally be
used with the ELSE pseudo operation which allows alternate code to be
generated when the opposite condition exists. Only one ELSE if
permitted for a given IF, and an ELSE is always bound to the most
recent, open IF. A conditional with more than one ELSE or an ELSE
without a conditional will cause a C error.
2.6.26.2 ENDIF - Each IF must have a matching ENDIF to terminate the
conditional. Otherwise, an 'Unterminated conditional' message is
generated at the end of each pass. An ENDIF without a matching IF
causes a C error.
2.6.27 Listing Control Pseudo Operations
Output to the listing file can be controlled by two pseudo-ops:
.LIST and .XLIST
If a listing is nog being made, these pseudo-ops have no effect. .LIST
is the default condition. When a .XLIST is encountered, source and
object code fill not be listed until a .LIST is encountered.
The output of false conditional blocks is controlled by three
pseudo-ops: .SFCOND, .LFCOND, and .TFCOND.
These pseudo-ops give the programmer control over four cases.
1. Normally list false conditionals.
For this case, the programmer simply allows the default mode
to control the listing. The default mode is list false
conditionals. If the programmer decides to suppress false
conditionals, the /X switch can be issued in the command line
instead of editing the source file.