Home
8085/Z80 ASSEMBLER USER`S MANUAL
Contents
1. XASM85 User s Mammal Page 3 10 3 10 Forward References A forward reference is a reference to a symbol which is not defined until later in the source program For example take the following program fragment DS GRINCH 1 GRINCH EQU 7 DS GRINCH 1 The use of GRINCH in the first DS statement is a forward reference since GRINCH has not yet been defined when this statement is encountered The use of GRINCH in the second DS is not a forward reference as the statement defining GRINCH has already been encountered There are a number of places in the assembly language where forward references and expressions containing then are specifically prohibited The general rule is that a forward reference is not allowed where the value of the expression affects the location counter or controls the number of bytes of code generated Most cases where this occurs are in pseudo instructions if forward references are not allowed this will be stated in the pseudo op descrip tion The assembler will report an F error whenever it finds an illegal forward reference To further clarify the notion of a forward reference consider the following statement JMP 5 The expression 5 is not a forward reference even though the jump is forward because the value of the location counter is already known when the JMP statement is processed XASM85 User s Manual Page 4 1 CHAPTER h THE 8085 280 INSTRUCTION SET This chapter describes th
2. occurs if any of the expressions is not in the range 128 255 For each string the characters of the string are stored in sequential reserved bytes If a compound expression beginning with a character con stant is used in a DB then the expression must be en closed in parentheses to keep it from being incorrectly parsed as a string For example DB A 1 legitimately sums a character constant and a number but DB A 1 causes a syntax error the operand is parsed as a l character string followed by some garbage XASM85 User s Manual Page 5 3 Define Words DN lt expr gt lt expr gt DW reserves a series of two byte locations initialized to the values of its operands For the 8085 the low byte of the each value is placed first and the high byte second For example the statement DW 2233H 4455H reserves and initializes four bytes as follows 33H 22H 55H Win Define Space DS lt expr gt DS reserves a block of n bytes where n is the value of the expression The bytes are not initialized The ex pression may not contain any forward references For example if the value of COUNT is 4 then DS COUNT 1 reserves five bytes XASM85 User s Manual Page 5 4 5 2 Program Origin ORG lt expr gt The ORG statement sets the program origin that is the starting value of the location counter to the value of its operand expression This sets the beginning address of the code and data which follows
3. buffers Each symbol occupies nth bytes where n is the number of characters in the symbol s name An additional two bytes per symbol are required near the end of the assembly run if a listing of the symbol table is produced this extra memory is used in sorting the symbol table Let s calculate approximately the number of symbols which could be defined in a typical CP M 80 system with 64K 65536 bytes of memory We ll make it a worst case calculation by assuming that every symbol is of maximum length 8 characters and that a full 4K is required for file buffers Total Memory Available d 65 000 bytes Less Memory Used By CP M 15 000 User Memory Available a a enne ewen 50 000 bytes Less memory required for assembler 12 500 Less memory required for buffers ch 200 te E reem pe Memory Available For Symbol Table 33 300 bytes 33 300 bytes 33 300 SE a a Se E 2 378 symbols 8 44 2 bytes symbol 1h The situation is actually even better than these figures indicate for several reasons First not all symbols will be of maximum length Second file buffers are dynamically allocated so not all of the 4K buffer space is needed throughout the assem bly And finally an assembly can be run successfully even if there is insufficient space to sort the symbol table at the expense of losing the symbol table listing
4. Ill formed argument or expression Undefined symbol s in operand field Instruction or mode not valid for chip specified eg attempt to use a 280 only instruction on the 8085 XASM85 USER S MANUAL Page A 2 Non Fatal Error Messages These messages are displayed on the console when the assembler encounters a non fatal error condition which cannot be associated with any particular line in the source file NO ROOM FOR SYMBOL TABLE SORT Not enough memory is available to sort the symbol table the symbol table listing is omitted END STATEMENT INSERTED COURTESY OF AVOCET SYSTEMS The assembler reached the end of the source file without seeing an END statement This could mean that part of your program is missing The assembler sup plies an END statement which is marked by a comment indicating where it came fron XASM85 USER S MANUAL Fatal Error Messages Page A 3 When a fatal error occurs assembler operation is immediately terminated and control returns to the operating systen One of the following explanatory messages will be displayed on the console SOURCE FILE NOT FOUND UNABLE TO CREATE OUTPUT FILE OUTPUT FILE WRITE ERROR EVALUATION STACK FULL SYMBOL TABLE FULL The specified source file doesn t exist The directory is full on the disk specifed for output The output disk is full An arithmetic expression was encountered which had too many levels of parentheses or of precedence nes
5. Indexed Addressing 4 2 4d 8 Bit Load Instructions 4 3 ks 16 Bit Load Instructions 4 4 4 6 Push and Pop Instructions hai 4 7 Exchange Instructions hak 4 8 Block Move and Compare Instructions 4 5 A Sg e XASMB5 User s Manual Table of Contents Continued D Ki 4 9 8 Bit Arithmetic Instructions L 6 4 10 Control Instructions ke 7 4 11 16 Bit Arithmetic Instructions h T 4 12 Shift and Rotate Instructions 4 8 4 13 Bit Manipulation Instructions 4 9 4 14 Jump Call and Return Instructions 4 10 4 15 Input and Output Instructions k 11 Chapter 5 Fseudo Instructions 5 1 Storage Definition 5 2 5 2 Program Origin 5 h 5 3 End of Program 5 5 5 4 Symbol Definition 5 6 5 5 Offset Assembly 5 7 5 6 Conditional Assembly 5 8 5 7 General Listing Control 5 9 5 8 Title and Subtitle 5 10 5 9 External Source Files 5 11 5 10 Target Microprocessor Validation 5 12 Chapter 6 Error Handling 6 1 Chapter 7 Format of Messages and Listings T 1 Assembler Sign On Banner T 1 7 2 Final Messages T 1 7 3 Page Headings T 2 7 4 Line Headings 7 2 7 5 Symbol Table Listing Tei Appendix A Error Messages and Flags A 1 Appendix B Object File Format Bei Appendix C Source File Preparation C 1 Appendix D Estimating Memory Requirements D 1 XASM85 User s Manual Page 1 1 CHAPTER 1 INTRODUCTION This manual describes the features and operation of XASM85 Avocet Systems assembler for the 8085 and 280 microprocessors In the introduction you ll find an overview of the assembler
6. User s Manual Page 3 1 CHAPTER 3 SYNTAX OF STATEMENTS AND OPERANDS An assembly language program consists of a sequence of statements each occupying one line of the source file A state ment comprises four fields not all of which need be present label operation operand and comment All statements are div ided into these same fields in the same way and thus share a common syntax The allowed contents of the operand field vary according to the operation specified but all operands are formed from a common set of elements symbols numbers strings arith metic operators etc Operations and therefore statements are of two kinds instructions and pseudo instructions This section describes the syntax common to both kinds of statements and the syntax of the elements used to form operands The two subsequent sections describe instructions and pseudo instructions in detail 3 1 Statements Each line of the source file contains a single assem ply language statement A statement consists of four fields label field operation field operand field and comment field arranged thus L lt label gt lt operation gt lt operand gt 13 lt comment gt The operation field contains a mnemonic symbol for an 8085 instruction or an pseudo instruction assembler direc tive The exact interpretation of the label and operand fields varies according to which instruction or directive is present The label field if present consi
7. WIDTH and TITLE do not appear at all in the listing XASMB5 User s Manual Page 1 3 T 5 Symbol Table Listing The symbol table listing shows all symbols defined in the current assembly with their hexadecimal values Only user defined symbols are listed Symbols are in vertical columns sorted alphabetically according to the ASCII col lating sequence The number of columns is adjusted auto matically to fit in the specified page width All pages of the symbol table listing are automatically subtitled SYMBOL TABLE Because the sorting scheme alphabetizes symbol names even if they end in numeric characters the listing order may not be what you expect For example a typical sequence of symbols might appear as follows SYM19 SYM2 SYM20 SYM21 SYM3 SACH d XASM85 USER S MANUAL Non Fatal Error Flags Page A 1 emmmer emm geg EE Em These flag characters will appear in the first column of the assembly listing to mark lines containing errors The first column is otherwise blank C Conditional Err Fwd Ref Err INCLUDE Err Multiple Defn Operator Err Phase Err Range Err Syntax Err Undefined Warning Unmatched IF ELSE or ENDIF or conditionals nested too deep Illegal forward reference File not found or nested INCLUDEs Symbol already defined Undefined or illegal operator Symbol had different value on Pass 2 than on Pass 1 Operand out of range address or value
8. character between double quotes and vice versa Character constants are evaluated as 16 bit integers with each character converted to its ASCII code For a single character constant the high order byte is zero and the low order byte is the character code For a two charac ter constant the high order byte of the value contains the first character code and the low order byte contains the second Thus the following are equivaient AT A and 41H AB AB and 4142H lt n mat StI MN XASM85 User s Manual Page 3 5 3 6 Location Counter Reference The assembly time location counter which keeps track of addresses in the generated code may be referenced by the special symbol dollar sign The value of this symbol is the address of the first byte of code or data generated by the current statement Thus for example the statements ORG 4455H IN IN would generate the following sequence of hex bytes rem ember that the low order byte comes first 55 44 55 44 59 44 59 44 3 7 Arithmetic Expressions Symbols numbers character constants and location counter references all evaluate to 16 bit integer values Wherever such a value is allowed you may also use an arith E metic expression composed of one or more of these elements connected by operators functions As you might expect the set of functions includes and addition subtraction multiplication division It also includes many
9. gt Shift Right Logical register SRLR M Shift Right Logical memory indirect SRLR lt ndx gt Shift Right Logical memory indexed RLD Rotate Left Digit RRD Rotate Right Digit XASMB5 User s Manual Page 4 8 4 13 Bit Manipulation Instructions BIT BIT BIT SET SET SET RES RES RES lt bitno gt lt reg gt lt bitno gt M Cbitno gt lt ndx gt lt bitno gt lt reg gt lt bitno gt M lt bitno gt lt ndx gt lt bitno gt lt reg gt lt bitno gt M lt vitno gt lt ndx gt Test bit in register Test bit in memory indirect Test bit in memory indexed Set bit in register Set bit in memory indirect Set bit in memory indexed Reset bit in register Reset bit in memory indirect Reset bit in memory indexed lt bitno gt is any quantity in the range 0 7 H XASM85 User s Manual Page 4 9 4 14 Jump Call and Return Instructions JMP JZ JNZ JC JNC JPE JPO JO JNO CPE CNO CP CM RST RST RST RST RST RST RS RST lt addr gt lt addr gt lt addr gt lt addr gt lt addr gt lt addr gt lt addr gt lt addr gt lt addr gt lt addr gt lt addr gt lt addr gt lt addr gt lt addr gt lt addr gt lt addr gt lt addr gt lt addr gt lt addr gt lt addr gt lt addr gt lt addr gt lt addr gt lt addr gt lt addr gt lt addr gt lt addr gt lt addr gt DON EWR Jump unconditionall
10. in combination as many as you wish other Other characters should be entered exactly as shown For example DB lt expr gt lt expr gt lt CR gt means that you must enter the letters DB or db followed by at least one space or tab followed by one or more arithmetic expressions and the RETURN key If you enter two or more expressions they must be separated by commas Since it is understood that every line in a source file ends with 2 RETURN we will gererslly omit the lt CR gt when describing the source language When we are presenting an example or specimen cf an essembly language construct wa will generally show it in bpoei iace as can be seen in the preceeding paragraphs XASM85 User s Manual Page 2 1 CHAPTER 2 HOW TO OPERATE THE ASSEMBLER This chapter describes the mechanics of using XASM85 how to invoke it how to specify the file to be assembled and how to control the generation and format of output files 2 1 Getting Started You can get started using the assembler even before you learn the details of its command line syntax You need only type its name XASM85 followed by the name of the source file which you want processed For example to assemble the file GRINCH ASM you would type XASM85 GRINCH lt CR gt This instructs the operating system to start the assembler running and to tell it to use GRINCH ASM as the source file the ASM part is supplied by the assembler if you don t tell it ot
11. is negative then the direction of the o eme een shift is reversed Byte Extraction Operators HIGH Returns the value of the mest significant cyte of ko uv s argument LOW Returns the value of the least significart byte of its argument YASM85 User s Manual Page 3 7 HIGH and LOW are unary operators taking an argument on the right For example HIGH 1122H is 11H and LOW 1122H is 22H Boolean Operators NOT Unary logical negation Complements all the bits in its argument AND Logical product ie each bit of the result is obtained by ANDing together the corresponding bits in the arguments OR Logical sun XOR Exc lusive OR These are all bitwise operators that is the same operation is performed on each operand bit position For example NOT O is OFFFFH 101B AND 010B is O 101B OR O10B is 1118 101B XOR O1OB is 111B 101B XOR 100B is 0018 Relational Operators These perform unsigned 16 bit comparisons of their operands returning 1 for TRUE and o for FALSE For comparison x R y where R is a relational operator the results are as follows iff means if and only if EQ TRUE iff x and y are equal NE TRUE iff x and y are not equal LE TRUE iff x is less than or equal to y LT TRUE iff x is strictly less than y GE TRUE iff x is greater than or equal to y GT TRUE iff x is strictly greater than y XASMB5 User s Manual Page 3 8 3 9 Evaluation of Expressions The order in which parts of an
12. the object file directs the listing to the console and suppresses pagination More examples are shown below Assembler Command Line Examples Example 1 Command Without Flags XASM85 GRINCH lt CR gt The file GRINCH ASM located on the current drive is assembled Two output files are generated GRINCH HEX contains the object code and GRINCH PRN contains the assembly listing and symbol table listing M XASM85 User s Manual Page 2 3 Example 2 Complete Source File Specification XASM85 C GRINCH FOO lt XCR gt The file GRINCH FOO located on the drive C is assem bled The output files are the same as in Example l above If we had left of the C then GRINCH FOO would have been sought on the current drive Example 3 Sending output files to a different drive XASM85 A GRINCH B lt CR gt The file GRINCH ASM located on drive A is assembled The output files are the same as in the previous ex amples but are placed on drive B Example 4 Sending the listing file to the printer YASM85 GRINCH PIKCR gt The file GRINCH ASM is assembled as before This time the listing file containing the assembly listing and symbol table listing is sent to your computer s LST device which presumably is the line printer In addition because we have included the L flag no object file is generated Example 5 Getting A List Of Error Lines Only XASM85 GRINCH LXY lt CR gt GRINCH ASM is assembled as before This
13. them by reading this manual carefully To fillin the gaps and see how these elements fit together read or skim one of the books listed below 1 3 Recommended Reading A visit to your local computer store or university bookstore should turn up any number of books on the 8085 and Z80 and on the CP M and MS DOS operating systems As a start you might look at the ones listed here Fernandez Judy N and Ruth Ashley 8080 8085 Assembly Language Programming John Wiley amp Sons 1981 Spracklen Kathe Z 80 and 8060 Assembly Language Progrenming Hayden Bock Co inc Larsen Titus amp Titus 8080 5085 Software Dese Howard TS a aana A o tit W Seams Books XASM85 User s Manual Page 1 3 In addition we recommend the data books and programming manuals available from manufacturers of the 8085 and 280 chips eg Intel Zilog and Mostek Even if you are experienced it may ve useful to have one of these on hand as a guide to the instruction set 1 4 System Requirements XASM85 is presently available under three different operat ing systems CP M 80 CP M 86 and MS DOS PCDOS There is a different version for each operating system The CP M 80 version works with CP M versions 1 3 and higher and also with extant versions of CDOS and TurboDos It has been used successfully with several other CP M look alikes though we cannot guarantee compatibility with unknown systems Under CP M 80 XASM85 runs on 8080 8085 and Z80 ba
14. uncertain about this read the next couple of paragraphs and then go ahead and try it If there are any problems they should show up right away If you see assembly errors with no apparent cause or find Lines missing from the assembly listing you should check the source file Frequently an offending line can be fixed by deleting and re typing it you may have to do the same for the lines immediately before and after it If you use WORDSTAR to edit source files be careful always to use its non document mode Use of the document mode may insert spurious characters typically spaces and linefeeds with the high order bit set into the file these characters will cause assembly problems The same advice holds for other word processors If there s a non document mode use it Each line in the source file should end with a RETURN and a LINEFEED in that order An EOF hex 1A must follow the end of the last line in the file Most editors take care of these special characters automatically No other non printing charac ters should appear in the file except within comments The SPACE and TAB characters may be used interchangeably or in com bination wherever whitespace is allowed XASMB5 USER S MANUAL Page D 1 APPENDIX D ESTIMATING MEMORY REQUIREMENTS In addition to space occupied by the assembler itself assembly time memory is used for file i o buffers and to store user defined symbols At most 4K bytes is required for
15. 000 loads HL with the 16 bit contents of memory locations 1000 1001 4 3 Indexed Addressing An operand address may be computed as the sum of a signed displacement and the contents of an index register IX or IY This is denoted by one of the forms lt d gt X lt a gt Y where lt d gt is an expression in the range 128 127 For example if index register X contains the value 1000H then MOV A 2 X loads the A register with the contents of location 1002H H XASM85 User s Manual Page 4 3 hh 8 Bit Load Instructions MOV lt reg gt lt reg gt Load register from register MVI lt reg gt lt imm8 gt Load register with immediate value MOV lt reg gt M Load register from memory indirect MOV lt reg gt lt ndx gt Load register from memory indexed MOV M lt reg gt Store register to memory indirect MOV lt ndx gt lt reg gt Store register to memory indexed MVI M lt imm8 gt Load memory immediate indirect MVI lt ndx gt lt imm8 gt Load memory immediate indexed LDAX B Load A indirect via BC LDAX D Load A indirect via DE LDA lt addr gt Load A from memory direct STAX B Store A indirect via BC STAX D Store A indirect via DE STA lt addr gt Store A to memory direct LDAI Load A from interrupt register LDAR Load A from refresh register STAI Store A to interrupt register STAR Store A to refresh register SYNTAX NOTATION In the instruction set description lt reg gt is a
16. 8085 Z80 ASSEMBLER USER S MANUAL XASM85 Assembler Version 1 04 Manua Revision 1 1 22 Dec 83 Copyright C 1983 1984 Avocet Systems Inc All rights reserved The name AVOCET and the bird logo are trademarks of Avocet Systems CP M is a trademark of Digital Research MS DOS is a trademark of Microsoft Corp VEDIT is a trademark of Compuview Products WORDSTAR is a trademark of Micropro AVOCET SYSTEMS INC 804 SOUTH STATE ST DOVER DELAWARE 19901 302 734 0151 re ey ee Ex a ANNIG VSEr B mouuUAL mole OF Lontents Chapter 1 Introduction 1 1 Who This Manual Is Written For 1 1 1 2 Hints For Novices 1 1 1 3 Recommended Reading 1 2 1 4 System Requirements 1 3 1 5 Overview of Assembler Operation 1 3 1 6 How Fast Is It 1 4 1 7 Syntax Notation In This Manual 1 5 Chapter 2 How To Operate The Assembler 2 1 Getting Started 2 1 2 2 XASM85 Command Lines 2 1 2 3 Command Line Flags 2 2 2 4 Assembler Command Line Examples 2 2 2 5 Summary of Defaults 2 4 2 6 Aborting An Assembly 2 4 Chapter 3 Syntax of Statements and Operands 3 1 Statements 3 1 3 2 Examples of Statements 3 2 3 3 Identifiers and Symbols 3 3 3 4 Numbers 3 3 3 5 Character Constants 3 4 3 6 Location Counter Reference 3 5 3 T Arithmetic Expressions 3 5 3 8 Operators Allowed In Expressions 3 6 3 9 Evaluation of Expressions 3 8 3 10 Forward References 3 10 Chapter 4 The 8085 Z80 Instruction Set 4 1 CPU Registers 4 1 4 2 Immediate and Direct Addressing 4 2 4 3
17. Every program should have an ORG before the first code generating statement Additional ORG statements may be used to produce program segments which will load at dif ferent locations The expression in the operand field may not contain any forward references If the source file contains no ORG statements the loca tion counter will initially be set to zero XASM85 User s Manual Page 5 5 5 3 End of Program END lt expr gt The END statement informs the assembler that the end of your source program has been reached It must be present and must be the last statement in the progran The operand expression if any specifies a program start address to be included in the object file This is the address to which a loader should transfer control after it loads the object code into memory If no start address is specified then the value 100H is used If you forget to include an END statement in your source file the assembler will supply one A warning message will be displayed on the console If for some reason you have statements after the END statement they will be completely ignored by the assem bler XASM85 User s Manual Page 5 6 5 4 Symbol Definition lt symbob EQU lt expr gt EQU defines a symbol with a specified value For example ZORCH EQU 22 creates a symbol named ZORCH whose value is 22 Symbols defined with EQU are treated as constants any attempt to re define such a symbol will cause an error In gene
18. RIM SIM 16 Bit Arithmetic Instructions DAD lt rp gt Add to HL DADC lt rp gt Add to HL with carry DP lt rp gt Subtract from HL with borrow DADX BC Add to X DADX DE i DADX IX DADX SP id DADY BC Add to IY DADY DE DADY IY DADY SP 7 INX lt rp gt Increment 16 bit register INA X 2 tax OY XASM85 User s Manual Page 4 T DCX lt rp gt Decrement 16 bit register DCH X bal DCX Y Shift and Rotate Instructions RLC Rotate A left RAL Rotate A left thru carry RRC Rotate A right RAR Rotate A right thru carry RLCR lt reg gt Rotate register left RLCR M Rotate memory left indirect RLCR lt ndx gt Rotate memory left indexed RALR lt reg gt Rotate register left thru carry RALR M Rotate memory left thru carry indirect RALR lt ndx gt Rotate memory left thru carry indexed RRCR lt reg g Rotate register right RRCR M Rotate memory right indirect RRCR lt ndx gt Rotate memory right indexed RARR lt reg gt Rotate register right thru carry RARR M Rotate memory right thru carry indirect RARR lt ndx gt Rotate memory right thru carry indexed SLAR lt reg gt Shift Left Arithmetic register SLAR M Shift Left Arithmetic memory indirect SLAR lt ndx gt Shift Left Arithmetic memory indexed SRAR lt reg gt Shift Right Arithmetic register SRAR M Shift Right Arithmetic memory indirect SRAR lt ndx gt Shift Right Arithmetic memory indexed SRLR lt reg
19. ROR HANDLING Two types of errors can occur during an assembly fatal and non fatal Fatal errors represent conditions which prevent the assembler from continuing For instance running out of disk space for an output file would cause a fatal error Non fatal errors represent faults detected in the source text which do not require termination of the assembly When a fatal error occurs assembly is aborted anda descriptive error message is printed on the console Con trol returns immediately to the operating system Some typical causes of fatal errors are missing source file insufficient disk space insufficient memory or overflow of various stacks internal to the assembler When a non fatal error occurs the source line contain ing the error is flagged with a character in the first column of the assembly listing this column is otherwise blank Lines containing errors are always listed even if listing is turned off In addition such lines are always displayed on the console as they are encountered There are some non fatal errors which cannot be assoc dated with a particular source line These errors are always noted by a message on the console A message giving the total number of erroneous lines is printed at the end of the assembly listing and displayed on the console It will say either nnnn LINES CONTAINED ERRORS res or NO ERRORS WERE DETECTED Only one error is listed per line hence if a line conta
20. arithmetic expression are evaluated is governed by precedence values assigned to the operators Precedence may be thought of as tightness of binding operators with higher precedence bind more tightly to their operands and thus are evaluated first For example 3 5 4 is interpreted as 3 5 4 because the multiplication operator has higher precedence than the addition operator In general precedence values have been chosen to coincide with your intuitive notions of how expressions should be read A table of relative opera tor precedences is given on the next page When two operators have the same precedence the ex pression is evaluated from left to right Thus k 2 is interpreted as 4 1 2 You can override the assumed order of evaluation by using parentheses in the normal way In fact we recommend that you do so in all but the simplest cases Not only will this leave no doubts about what you meant but it will prevent portability problems should you later use a differ ent assembler other assemblers may assign different relative precedence to the more obscure operators XASM85 User s Manual Page 3 9 TABLE 1 RELATIVE PRECEDENCE OF OPERATORS Groups of operators are shown in order of descending prec edence All operators in a group ie on the same line have the same precedence unary unary HIGHEST PRECEDENCE HIGH LOW MOD SHR SHEL E Se EQ NE LT LE GT GE NOT AND OR XOR LOWEST PRECEDENCE
21. ay consist of as many characters as you wish but only the first 8 characters are significant That is two identifiers are the same if their first eight char acters are the same Also the assembler makes no distinc tion between upper and lower case for example abcd and ABCD are the same identifier All of the pre defined indentifiers are reserved that is you may not redefine them as symbols Numbers A number consists of a sequence of digits possibly including the hexadecimal digits A through F optionally preceeded or followed by a character specifying the number base radix The first character must always be either a decimal digit 0 9 or a base specifier XASM85 User s Manual Page 3 4 The base specifiers are base leading specifier trailing specifier 2 z B 8 Dor Q 16 H If no base is specified then base 10 is assumed The following examples all represent the number 127 127 BUT 1TTQ TF TFE 1111111 11112111B Since a number must begin with a decimal digit or leading base specifier you must be careful in writing hex constants that begin with a letter For instance the number 255 may be written as FF or OFFH but not as FFH The latter would be treated as a symbol by the assembler resulting in a U Undefined Symbol error 3 5 Character Constants mme A character constant consists of one or two characters enclosed in single or double quotes or The single quote may be used as a
22. blank or tab must precede the operation Blank lines are specifically allowed they are treated as comments Examples Of Statements Example 1 Line consisting only of a comment sthis is a comment Example 2 Instruction with label operands and comment FOO LD A B sLoad A from B Example 3 Line consisting only of a label FOO Example 4 Line consisting only of an instruction LD HL 1234H8 Example 5 Yseudo instruction defining a symbol MOO EQU 5 XASMB5 User s Manual Page 3 3 3 3 Identifiers and Symbols An identifier is a word or name such as LDA GRINCH or A002 There are several kinds of identifiers in the assembly language Mnemonics are the names of instructions and pseudo instructions Operators are the names of arith metic functions such as MOD the remainder function and XOR bitwise exclusive or Symbols as we use the tern are identifiers representing registers addresses or numeric quantities which may be used in forming operands Mnemonics operators and some symbols for example the names of the 8085 registers are pre defined by the assem bler All other symbols must be defined by your program You can define an identifier as a symbol by using it as a label or by using it in the label field of an EQU or DEFL statement Identifiers may contain any of the following characters A 2 a z 0 9 _ The first character of an identifier may not be a digit or dollar sign An identifier m
23. decrement Input decrement and repeat Output from accumulator Output indirect via C Output and increment Output increment and repeat Output and decrement Output decrement and repeat lt port gt is any quantity in the range 0 255 XASM85 User s Manual Page 5 1 CHAPTER 5 PSEUDO INSTRUCTIONS Pseudo instructions are commands to the assembler which look syntactically like machine instructions For example to define a symbol S55 with the value 1000H you could write 555 EQU 1000H EQU is a pseudo instruction which EQUates the symbol to the value of the expression on the right Pseudo instructions are also called pseudo operations pseudo ops or directives We will use all of these terms interchangeably The remainder of this chapter describes the various pseudo instructions in detail XASM85 User s Manual Page 5 2 5 1 Storage Definition Define Bytes DB lt arg gt lt arg DB reserves a series of single byte locations initialized according to the values of its operands Each lt arg gt may be either an expression or a string Expressions must eval uate to 8 bit values high byte either 0 or 255 Strings look just like character constants except that a string may contain more than two characters A string may be enclosed in single or double quotes For each expression a single byte of storage is reserved initialized to the low byte of the expression s value A Range Error R
24. e and increment pointers CCIR Compare byte increment and repeat CCD Compare byte and decrement pointers CCDR Compare byte decrement and repeat 4 9 8 amp Bit Arithmetic Instructions ADD lt reg gt Add to accumulator ADI lt imm8 gt ADD M ADD lt ndx gt ADC lt reg Add to accumlator ACI lt imm8 gt ADC M ADC lt ndx gt 2 SUB lt reg gt Subtract from accumlator SUI lt imm8 gt SUB M SUB lt ndx gt 5BB lt reg gt Subtract from accumulator SBI lt imm8 gt with borrow SBB M SBB lt ndx gt b ANA lt reg gt Logical AND with accumulator ANI lt imm8 gt ANA M ANA lt ndx gt a ORA lt reg gt Logical ORA with accumulator ORI lt imm8 gt ORA M ORA lt ndx gt XRA lt reg gt xclusive OR with accumulator KRI lt imm amp gt ZRA M XRA lt ndx gt XASM85 User s Manual Page 4 6 CMP lt reg gt Compare with accumulator CPI lt imm8 gt CMP M CMP lt ndx gt K INR lt reg gt Increment register INR M Increment memory indirect INR lt ndx gt Increment memory indexed DCR lt reg gt Decrement register DCR M Decrement memory indirect DCH lt ndx gt Decrement memory indexed Control Instructions DAA Decimal Adjust Accumulator CMA Complement accumilator NEG Negate Accumulator CMC Complement Carry Flag STC Set Carry Flag NOP No Op HLT Halt processor DI Disable Interrupts EI Enable Interrupts IMO Set interrupt mode IML 3 IM Ki
25. e assembly language syntax of 8085 and Z280 instructions A complete discussion of 8085 280 archi tecture and instruction semantics ie what the instructions do is beyond the scope of this manual for this information see any of the books mentioned under Recommended Reading in the Introduc tion 4 1 CPU Registers The assembly language includes pre defined symbols for all of the CPU registers that may be referenced in instructions These symbols do not have numeric values and may be used only where a register is specifically allowed However their names are reserved they may not be re defined as user symbols The 8 bit registers are A BC D E HL The names B D H are also used to refer to the 16 bit register pairs consisting of BC DE and HL Other 16 bit registers are named as follows SP PSW X Y Also the memory location addressed by the contents of the HL register pair may be referred to by the name M which behaves syntactically like an 86 bit register name in most contexts XASM85 User s Manual Page 4 2 h 2 Immediate and Direct Addressing Direct addressing uses an instruction operand as the address of a data item to be operated upon Immediate addressing uses the operand itself as data In both cases the operand is syntactically just a numeric value ie an arithmetic expression the addressing mode depends upon the instruction mnemonic For instance LXI H 1000 loads HL with the immediate value 1000 LHLD 1
26. h a data or code byte will be placed when then assembled program is loaded at XASMB5 User s Mamual Page T 2 1 3 Page Headings T Paginated listings begin with a heading consisting of seven lines blank line blank line assembler name and version blank line title and page number subtitle blank line If no title is supplied in the source program then the assembler provides a default title consisting of the message SOURCE FILE NAME lt name gt lt ext gt where lt name gt is the file mame and lt ext gt is the file exten sion The page number is listed at the right hand end of this same line always within the specified page width If no subtitle is supplied the subtitle line is left blank Both title and subtitle will be truncated if necessary to satisfy page width constraints T h Line Headings Each code generating line of the listing begins with the error flag blank if no error and the 4 digit hexadec imal value of the location counter as of the start of the line This is followed by up to four bytes of generated code also in hexadecimal with two digits per byte State ments which generate more than 4 bytes will be assembled correctly but only the first four bytes are listed Lines which do not generate code but which evaluate an operand such as EQU list the operand value in their head er in place of the location counter Lines containing listing control pseudo ops such as
27. herwise 2 2 XASM85 Command Lines A complete XASM85 command line looks like this XASM85 lt drv gt lt name gt lt ext gt lt drv gt lt flag gt lt CR gt Where lt drv gt is a single character specifiying a disk drive eg A B etel The first lt drv gt specifies the drive on which the input file is located The second lt drv gt specifies the drive on which the output files are to be placed Either of the lt drv gt specifiers may be omitted in which case the current drive is used lt name gt is a string of up to 8 characters which is the name of the input file cext gt represents a file extension of up to three characters It may be omitted in which case the file extension ASM is used XASM85 User s Manual Page 2 2 2 3 2 4 lt flag gt is one of the single character commands shown below which control the operation of the assembler Command Line Flags The flags if supplied control various options as follows L Listing Only turn off object file Oo Object Only turn off assembly listing completely X Turn off assembly listing symbol table not suppressed Y Turn off symbol table assembly listing not suppressed c Send listings to the console P Send listings to the printer N Suppress pagination of assembly listing ie no page headings or page ejects Q Quiet Turns off assembler sign on banner Flags may be used in combination For example specifying LCN suppresses
28. ine switches which disable listing fie X and will take vorecedence over LIST gt NOLIST does not turn off listing of the symtol table LIST ard NCLIST are not themselves shown in the assembly Listing YASM85 User s Manual Page 5 10 po 5 8 Title and Subtitle TITLE lt dim lt text gt lt dim Causes the specified text to become the listing page title beginning with the next page header printed The delimiter lt dlm gt may be any single printing character which does not appear in the enclosed text For example using Single quote as a delimiter you could write TITLE 8085 Assembler Demo Program If the text contains a single quote you could delimit it with slashes instead as in TITLE Avocet s Demo Program Note that TITLE is a pseudo op and so must appear in the operationifieldl If you put it in the label field te begin it in column 1 it will not be recognized If no TITLE statement is used then XASM85 supplies a default title SOURCE FILE NAME lt name gt lt ext gt giving the name and extension of the source file SBTTL lt dim lt text gt lt dlm SBTTL has the same syntax as TITLE but it sets the page subtitle The subtitle is printed on the line following the title line If no SBTTL statement is present then the subtitle line will be left blank XASMB5 User s Manual Page 5 11 5 9 External Source Files INCLUDE lt filename gt INCLUDE inserts the contents of the specified file into
29. ins multiple errors some may not be caught until successive assembler runs Some non fatal errors not associated with a particular source line are indicated by messages on the conscle The error messages and error flag characters are des cribed in Appendix A XASM85 User s Manual Page 7 1 TT Ti Assembler Sign On Banner T When the assembler begins executing it displays the following banner on the console a ne A PN en ti ESS lt hh mm ms AVOCET 8085 280 ASSEMBLER Version 1 02 Serial 00100 Copyright C 1983 by Avocet Systems Inc All Rights Reserved ge i TE SSE SS The version and serial number may differ from the ones shown here as they represent your individual copy of the assem bler If you get tired of seeing the banner you can sup press it by specifying the Q Quiet flag in the assembler command line 2 Final Messages At the end of each run you will see two additional messages on the console USE FACTOR XXX HIGHEST ADDRESS USED aaaaHk The Use Factor is the fraction of available host memory used at assembly time expressed as a percentage For example a Use Factor of 15 means that 85 of the host computer s memory was unused This represents only the memory occupied by user defined symbols if your program defines no symbols then the Use Factor will be zero The Highest Address message refers to the target memory space The address given is the highest one into whic
30. ny of the 8 bit registers ABCDEHL lt r gt is any of the register pairs BDH SP lt addr gt is any 16 bit quantity lt imm8 gt is any quantity in the range 128 255 lt ndx gt is a X or a Y where is any quantity in the range l21 127 ndicates Z C enly instruction indicates amp 085 enly instructicn XASM85 User s Manual Page 4 4 4 5 16 Bit Load Instructions LXI lt rp gt addr Load immediate word LXI Y addr LHLD lt addr gt Load word from memory direct LBCD lt addr gt LDED lt addr gt LSPD lt addr gt LIXD lt addr gt LIYD lt addr gt k x SHLD lt addr gt Store word to memory direct SBCD lt addr gt SDED lt addr gt SSPD lt addr gt SIXD lt addr gt SIYD lt addr gt xk k x SPHL Load stack pointer from register SPIX SPIY 4 6 Push Pop Instructions SR PUSH PUSH PUSH PUSH PUSH PUSH Push 16 bit register on stack POP POP POP POP POP POP Pop stack top into 16 bit register SMO r k moO D x L T Erchange Instructions XCHG Exchange DE and HL EXAF Exchange AF with alternate AF EXX Exchange with alternate registers XTEL Exchange stack top with HL XTIX Exchange stack top with IX XTIY Exchange stack top with IY XASM85 User s Manual Page 4 5 LDI Move byte and increment pointers LDIR Move byte increment and repeat LDD Move byte and decrement pointers LDDR Move byte decrement and repeat ccI Compare byt
31. o use some of its utility programs when the time comes to test or download an assembled program For instance CP M s PIP and DDT programs are particularly useful COPY and DEBUG are the equivalent commands under MS DOS TEXT EDITOR There s no way you can use the assembler without one you have to have some way to get assembly language programs into a disk file If you re really new at this and haven t used an editor before you ll just have to bite the bullet and learn While we re on the subject your editor should be one of the full screen variety such as VEDIT or WORDSTAR Teletype orien ted editors such as CP M s ED are guaranteed to be frustrating although they can be used if nothing else is available THE 8085 CHIP You will have to know the 8085 s architecture and instruction set before you can write programs for it However you need not commit the entire instruction set to memory at once learn a few instructions at a time and begin using them The assembler itself can help you as it will reject most illegal instruction operand combinations This in turn should send you scurrying back to the 8085 Programming Manual or equivalent for review eventually you ll remember what s legal ASSEMBLY PROGRAMMING EXPERIENCE If you haven t used an assem bler before don t panic there s always a first time Basic notions like symbol expression and pseudo instruction may be unfamiliar to you but you can probably make sense of
32. other functions such as modulo rem ainder left and right shift and relational operators All the functions except and are represented by identifiers and must be separated from their arguments by at least one blank or tab Most of the operators treat their operands as 16 bit unsigned quantities However twos complement negation represented by a unary minus sign ts allowed Negatives tt me een omean quantities from 32768 to l can thus be written They will give the expected results when added or subtracted from other quantities However no overflow checking is perform ed and the results of other operations including multipli cation division and comparisons do not take arithmetic sign into account For example 1l is equal to OFFFFH the two s complement of OOC1H Thus 1 5 4 as expected but XASM85 User s Manual Page 3 6 a 1 LT 0 is an unsigned comparison of FFFF with 0 and is thus FALSE 3 8 Operators Allowed In Expressions Arithmetic Operators Sum Difference unary x is defined as 0 x unary x is defined as 0 x Product unsigned Quotient unsigned MOD Remainder unsigned J x MOD y gives the reminder of x y Shift Operators SHL Binary left shift x SHL y yields x shifted left y places ie x multiplied by 27 SHR Binary right shift logical x SHR y yields x shifted right y places ie x divided by 2Y High order bits are zero filled ee mif the right argument
33. r the operating system to find and load the assembler but not the time to re boot the operating system upon completion Please note that assembler speed will vary substantially with the speed of the host computer In particular the assem bler spends much of its time reading and writing disk files and so is sensitive to disk access times and data rates In general you should expect it to be significantly slower with floppy disks than with the hard disk used in our tests XASM85 User s Manual Page 1 5 1 7 Syntax Notation In This Manual Throughout this manual the following notation is used to describe the syntax of the assembly language and of assembler commands lt gt Angle brackets enclosing lower case text indi cate that you must enter an item of a type defined by the text For example lt expr gt means you must enter an arithmetic expression lt CR gt Angle brackets enclosing upper case text indi cate that you must press the key specified by the text For example lt CR gt means the RETURN key Brackets indicate that the enclosed item is op tional CAPS Capital letters indicate items that must be entered exactly as shown except for case That is you may enter the same letters in lowercase oats An ellipsis indicates the preceeding item or sequence of items may be repeated zero or more times space Where a space is shown at least one space or tab character is required Spaces and tabs may be used
34. ral you may write symbol EQU expression where the symbol on the left has not been previously defined The expression on the right may not contain any forward references lt symbol gt DEFL lt expr gt lt symbol gt ASET lt expr gt DEFL is used to define symbols just like EQU The only difference is that symbols defined with DEFL may have their values changed by subsequent DEFL s without causing an error ASET is a synonym for DEFL and behaves ident ically For example the sequence of statements XYZ DEFL 1 DB XYZ XYZ DEFI 5 DB XYZ would leave XYZ set to 5 and would generate the same data as f DB 1 5 XASMB5 5 5 Offset Assembly LOC ENDLOC The LOC and ENDLOC pseudo instructions allow you to assem ble code which will be moved to another address before execution For example you might have a ROM resident routine which will be copied into RAM and executed there A sequence of statements beginning with LOC and ending with ENDLOC will produce code that loads in line as if the LOC and ENDLOC were not present However the code will be assembled to execute at the address given in the LOC statement More specifically the location counter and consequently the values of and of any labels defined will reflect the LOC address An example may help to clarify this Suppose we have the following program fragment ORG 1008 FOO LD A B LOC 5000H BAR DEC B JNZ BAR MOO RET ENDLOC ZOT DB o When thi
35. rd references Each statement within a conditional block must be syntacticaly correct at least to the extent of having the fields properly delimited and a valid instruction field This is because the assembler must parse each statement in order to Look for an ELSE or ENDIF even if the block is not being assembled SE XASM85 User s Manual Page 5 9 D T General Listing Control New Page PAGE lt expr gt EJECT lt expr gt If the lt expr gt is omitted PAGE causes an immediate skip to the top of the next page If lt expr gt is present and has value n then a skip occurs only if less than n lines remain on the current page EJECT is synonymous with PAGE The PAGE or EJECT statement itself is not shown in the assembly listing Page Width WIDTH lt expr gt Sets the width of the listing page to the specified value which may range from 32 to 132 The WIDTH statement itself is not shown in the listing Page Length PGLEH lt expr gt Sets the number of lines which will be printed on each page of the listing this may range from 8 to 255 Note that seven of the lines are occupied by the page heading The PGLEN statement itself is not shown in the listing LISTING ON OFF LIST and NOLIST These allow selective listing of portions of a progran NOLIST turns off the assembly listing and LIST turns it back on If listing has been turned off with NOLIST then the next LIST encountered will begin a new page Command l
36. s features system requirements and performance There s also a list of skills and knowledge you should have before using the assembler and a description of the syntax notation used in the rest of the manual CT ve ANNE vmmmmee This is a reference manual written for experienced assem bly language programmers It presents the information needed to use the assembler in what we think is a clear and readable forn The manual is not intended to be a tutorial but there are oc casional tutorial asides for the benefit of newcomers Also we ve tried to provide plenty of examples to help you answer your own questions about how things work In writing this manual we assumed that you are reasonably familiar with your computer and its oper ating system CP M MS DOS or equivalent have a text editor and know how to use it know the architecture and instruction set of the 8085 and or the Z80 have programmed in assembly language before 1 2 Hints For Rovices If you lack any of the prerequisites listed above you sheuld vlan c do some surclemental reading before you begin using the assembler or at the same time if you re really ambi tious The rest of this secticen discusses the prerequisites in more detail and the next section suggests some books to read 43 L XASM85 User s Manual Page 1 2 OPERATING SYSTEM You can run the assembler without knowing your operating system intimately but you may need t
37. s sequence of statements is assembled and loaded the LD A B instruction will be found at 100H the DEC B at 101H the JNZ at 102H and soon However the values of the labels will be FOO 100H BAR 5000H MOO 5004H and ZOT 101H Thus the statements between LOC and ENDLOC will execute correctly if and only if their machine code is moved to location 5000H The effect of a LOC is cancelled when an ORG is encoun tered both the load and execution location counters are set to the address specified in the ORG Thus you must always set the load address first using ORG before setting the executicn address with LOC The expression in tre LOC statement may not contain for ward references YASM85 User s Manual Page 5 8 R 5 6 Conditional Assembly IF ELSE and ENDIF COND and ENDC Conditional assembly allows the value of a symbol to control whether or not a particular group of statements is assembled The construct IF lt expr gt statement ELSE statement ENDIF behaves as follows If the value of the expression is non zero then the statements between the IF and the ELSE are assembled Otherwise these statements are ignored and the statements between ELSE and ENDIF are assembled The ELSE and statements following it may be omitted The assembler recognizes COND as a synonym for IF and ENDC as a synonym for ENDIF Conditionals may be nested to a depth of 10 The expression in the IF statement may not contain any forwa
38. s them up into numbered pages for output to a printer Each page begins with a page number title and subtitle The object file is in Intel HEX format This format represents binary instruction codes and data as hexadecimal numbers in printable form It minimizes file size by eliminating the need to store large blocks of initialized addresses and it provides internal checksums to guard against file transmission errors During operation the assembler displays certain information on the computer console A sign on banner containing the assembler name version serial number and copyright message is displayed at the beginning of each run Any source lines which contain errors are displayed as they are encountered in assembly listing format At the end of the run the assembler tells you how many source lines contained errors what fraction of the memory av ailable at assembly time was actually used and the highest object address for which code or data was generated 1 6 How Fast Is It XASM85 assembles approximately 4800 lines per minute while generating both an object file and an assembly listing Without the assembly listing this increases to 5900 lines per minute These figures were obtained by using the CP M 80 version of the assembler running under CP M Version 2 2 on a 4 MHz 280 with a hard disk The input file for the test was 2371 lines long and defined about 100 symbols The speed computation included the time required fo
39. sed computers Approximately 17K bytes of memory are required for the assembler and internal buffers Additional memory is used to store the assembly time symbol table Although the assembler can probably be run in a 32K system we recommend 64K of memory Under CP M 86 MS DOS or PCDOS XASM85 runs on 8086 and 8088 based computers Approximately 20K bytes of memory are required with additional memory for the symbol table The computer should have at least 64K of memory For all versions at least one disk drive is required We strongly recommend that you have a second disk drive and a prin ter 1 5 Overview Of Assembler Operation XASM85 accepts assembly language text from an input file on disk often referred to as the source file It generates two output files The object file contains the machine language program produced by the assembler The listing file contains an assembly listing a copy of the input text annotated to show the instruction codes and data generated by the assembier and to indicate any errors detected It also contains a table showing all symbols defined in the input text and the values assigned to them The source language uses standard Intel mremenics fror the ROAS instruction set In addition it includes Intel style TDL mnemonics for the extended instruction set of the 250 Ag XASM85 User s Manual Page 1 4 The assembler normally paginates the assembly listing and symbol table That is it break
40. sts of an identifier optionally followed by a colon Using an identifier in the label field defines it as a user symbol and gives it a value Ordinarily this value is the address of the first byte of the instruction or data generated by the statement that is the symbol labels the current location However there are a few pseudo instructions which assign other val ues to the symbol independent of the current address EQU is an example of such a pseudc instruction The oterand field consists of zero or more crerands if there are two or more then they are separatec ty commas There are zeverail kinds of operands registers arithmetic expressions and character strings to name a Tew Just XASM85 User s Manual Page 3 2 3 2 which ones are allowed and how many depends on the opera tion specified The comment field consists of any sequence of printing characters preceeded by a semicolon It is intended for human consumption and is always ignored by the assembler The fields are separated by whitespace ie by any combination of blanks and tabs We suggest using tabs only This not only saves space in the source file but it allows you to line up the fields in vertical columns making your program easier to read All of the fields are optional except that operands may not be present unless there is an operation Fields may begin in any column except that The label if present must begin in the first colum At least one
41. the source text The syntax of lt filename gt follows stan dard CP M and MS DOS conventions A complete filename has the form lt drv gt lt name gt lt ext gt where lt drv gt is a single letter specifying a disk drive A B etc lt name gt is an alphanumeric file name of up to 8 characters and lt ext gt is an alphanumeric file extension of up to 3 characters INCLUDE statements may not be nested that is the file inserted may not contain another INCLUDE Ordinarily the entire file is read however if an END statement is encountered then INCLUDE processing terminates and text input reverts to the main source file XASM85 User s Manual Page 5 12 9 10 Target Microprocessor Validation These pseudo ops inform the assembler that the target microprocessor is other than an 8085 Any instructions not available in the specified processor will be flagged as VI errors to alert you that they will not run correctly In the absence of either of these directives all of the 8085 instructions are valid instructions which are available only in the Z80 will be flagged When 8080 is specified only the 8080 subset is valid This subset consists of all the 8085 instructions except RIM and SIM When 280 is specified the full 280 instruction set is valid This includes all the 8085 instructions except RIM and SIM along with all those instructions peculiar to the 280 au XASM85 User s Manual Page 6 1 CHAPTER 6 ER
42. time we have turned off the object file with L suppressed the assembly listing with X and suppressed the symbol table listing with Y You might expect that the assembler would produce no output at all However the assembler always lists lines which contain errors even if the listing is suppressed Thus the command line shown here will produce a PRN file containing only those lines in which errors occurred Since pagination is irrelevant here you will probably want to suppress it also thus XASM85 GRINCH LXYN lt CR gt XASM85 User s Manual Page 2 4 The order in which the flag characters appear is unim portant the command XASM85 GRINCH YXLN lt CR gt would have the same effect Finally since O is equivalent to writing X and Y we could have writ ten the command yet another way as XASM85 GRINCH OLN lt CR gt 2 5 Summry of Defaults If you don t specify otherwise in the command line the assembler will behave as follows The source input file is sought on the current drive and has extension ASM An object file is produced It is placed on the cur rent drive An assembly listing and a symbol table are generated They are placed in a file on the current drive with the same filename as the input file and with extension PRN 2 6 Aborting An Assembly You can terminate an assembly at any time by striking a control C at the console This causes an exit to the operating system z E XASM85
43. ting Not enough memory remains to create a table entry for a symbol being defined XASMB5 USER S MANUAL Page B 1 APPENDIX B OBJECT FILE FORMAT Object files are in the Intel HEX format which represents binary data bytes as two digit ASCII hexadecimal numbers file consists of a sequence of data records followed by a single end record The record formats are Data Record Byte Nene zl MI LA 8 9 10 x x tl x 2 x 3 x h End Record Byte 1 Le 3 4 ad 8 9 10 11 x 3 x h Colon Number of binary data bytes in this record Load address for this record high byte Load address Ka low byte Record Type 00 Data bytes two characters each Checksum 2 characters CR LF Colon oo Program execution address if specified in assembler END statement else 0000 Record Type 01 l a Checksum FF if load address is all zeros CR LF The checksum is the two s complement of the 8 bit sum without carry of all the data bytes the two bytes of load address and the byte count An object XASM85 USER S MANUAL Page CA APPENDIX C SOURCE FILE PREPARATION You can use almost any text editor or word processor to prepare source files for the assembler We use both VEDIT and WORDSTAR and have also used ED and EDLIN on occasion However you should be sure that your editor terminates lines properly and that it does not put any funny characters into the file If you re
44. y Jump if zero Jump if not zero Jump if carry Jump if no carry Jump if parity even Jump if parity odd Jump if overflow Jump if no overflow Jump if plus Jump if minus Jump unconditionally relative Jump if carry relative Jump if no carry relative Jump if zero relative Jump if not zero relative Jump indirect via HL Jump indirect via X Jump indirect via Y Decrement and jump if not zero Call unconditionally Call if zero Call if not zero Call if carry Call if no carry Call if parity even Call if parity odd Call if overflow Call if no overflow Call if plus Call if minus Restart special call XASMS5 User s Manual RET RZ RNZ RC RNC RPO RO RNO RETI RETN lt addr gt lt addr gt lt addr gt lt addr gt lt addr gt lt addr gt lt addr gt lt addr gt lt addr gt lt addr gt lt addr gt Page 4 10 S Return uncomitionally Return if zero Return if not zero Return if carry Return if no carry Return if perity even Return if parity odd Return if overflow Return if no overflow Return if plus Return if minus Return from interrupt Return from non maskable interrupt 4 15 Input and Output Instructions IN lt port gt INP lt reg gt INI INIR IND INDR out OUTP OUTI OUTIR OUTD OUTDR lt port gt lt reg gt Input to accumulator Input indirect via C Input and increment Input increment and repeat Input and
Download Pdf Manuals
Related Search
Related Contents
FOX User Manual - Broadcasting Services VSP 112W User Manual Blaupunkt Navigation Cordless Grass Shear Taille-Herbes sans Fil Tijeras Newstar Bidirectional Serial to Parallel Interface Converter TM_5-3805-263-14_P-2.. Samsung YP-F3QL 用户手册 県 庁 舎 県 庁 舎 宿 日 直 等 宿 日 直 等 宿 日 直 等 業 務 委 託 TELEVISORE A COLORI LCD Manuale utente Copyright © All rights reserved.
Failed to retrieve file