8080 Assembly Language Programming System (A. L. P. S.) User Guide Copyright 1979 Dave Dunfield ALPS Users Guide TABLE OF CONTENTS Page 1. INTRODUCTION 1 2. EDITOR ASSEMBLER 2 2.1 USING THE EDITOR 3 2.2 USING THE ASSEMBLER 7 3. DISASSEMBLER 10 3.1 DISASSEMBLER COMMANDS. 11 4. TEST 12 4.1 8080 Restart Interrupts 12 4.2 Breakpoints 13 5. TEST COMMANDS 14 5.1 A ON|OFF 14 5.2 B [0-7 address] 14 5.3 C 14 5.4 D
14 5.5 E
14 5.6 F 15 5.7 G [address] 15 5.8 I 15 5.9 K 15 5.10 M
15 5.11 O 15 5.12 Q 15 5.13 R [rp value] 15 5.14 S ON|OFF 16 5.15 T ON|OFF 16 5.16 U [address] 16 5.17 ? 16 6. EDITOR COMMAND SUMMARY 17 7. DISASSEMBLER COMMAND SUMMARY 18 8. TEST COMMAND SUMMARY 18 ALPS Users Guide Page: 1 1. INTRODUCTION ALPS is a system designed to aid in the creation, modification, and debugging of assembly language programs for the 8080 family of micro processors. there are three modules which have the following names and functions: EDIT (3K) - Editor-Assembler, creates, modifies and assembles source files. DISASM(2K) - Disassembler, disassembles object code to produce a listing or a source file. TEST(3K) - Run time interactive program debugging. The above modules are described in detail on the following pages. ALPS Users Guide Page: 2 2. EDITOR ASSEMBLER The editor uses no line numbers, it operates with the use of a "CURRENT" line. This line is kept track of by an internal pointer, and can be manipulated by editing commands. The line pointer itself can be moved with other commands. Files used by the editor are of the following format: Each line is stored exactly as it is entered. All lines are stored in proper sequence. Lines in the file are separated by the ASCII carrage-return character (0D-HEX). The end of the file is indicated by a line beginning with an (FF-hex) this form of file is very compact requireing less disk space than other popular formats. The assembler uses the currently loaded edit file for the source file. It produces object code directly in RAM There is provision for generating the code at a different address than that it is intended to run at. This allows the programmer to assemble and save a program that is to run in the same location as the editor assembler or the source program. Source to the assembler is typed in with only a single space separating the labels, instructions, operands and comments. The assembler will automaticaly format its output to produce a proper looking listing. There is also a command in the editor which will print the file in formatted form. (By eliminating extra spaces, source file size is greatly reduced) NOTE: The assembler is free format, allowing any number of blanks to separate the input, however to obtain a proper listing only one blank should be used. If an instruction has no operand, then use two spaces before the comment. This will cause the output formatter to skip the operand space in the listing. Blanks contained within quotes are ignored by the output formatter. ALPS Users Guide Page: 3 2.1 USING THE EDITOR The editor commands are given below. Any command can be entered when the editor prompts with '.' (unless you are in input mode). Files must be created with the dos.The editor initially expects the files to be type five (5) files. The file type can be changed with the '#T' command. Filenames may be followed by an optional drive number, EG: 'LF FILE,2'. If the drive number is omitted, the default drive number is used. For all single letter commands, the editor will ignore any non-numeric characters entered between the command and its operand. If a mistake is made while typing at any time, input characters can be deleted with the backspace or delete keys. The entire input line can be aborted with a CONTROL-C. Any time the editor is printing, the output can be stopped by pressing a SPACE, it can be resumed by pressing a CARRIAGE-RETURN. Output can be stopped altogether with a CONTROL-C. NOTE: When output is stopped with CONTROL-C the current-line pointer is reset to the top of the file. If you stop an assembly listing with CONTROL-C, the code will only be generated up to the higest address shown in the listing. When the editor is initially run, it clears the current file. To enter the editor without clearing the file, enter it at address=starting address of EDIT+3. For North-Star system, use: 'JP 2A03' ALPS Users Guide Page: 4 2.1.1 EDITOR COMMANDS The following notation will be used to indicate operands to commands. - Decimal number having the range 1 - 255. If ZERO (0) or ommited, defaults to 1. - Decimal number having the range 0 - 255. If ommited, defaults to ZERO (0). - Hexidecimal value with the range 0 - FFFF. If more than four digits, last four used. LIST OF EDITOR COMMANDS B - Begin: Moves the current-line pointer to the start of the file. The message "TOF:" and the first line of the file are displayed. First line of the file is the current line. E - End: Moves the current-line pointer to the end of the file. the message "EOF:" is printed. The current-line pointer now points to the END OF FILE marker following the last line in the file. N - Next: Moves the current-line pointer down lines and displays new current line. U - Up: Moves the current-line pointer up lines and displays new current line. T - Type: Prints lines, starting at current line. New current line is last line printed. P - Print: Same as Type but gives formatted output. DE- Delete: Deletes lines, starting with current line. I - Insert: Inserts line(s) directly ahead of current line. If is given, then spaces are automatically inserted at the beginning of each line. (Control-c will cancel auto tab for the current line) Enter blank line to exit. C - Change: Displays "=" followed by current line. Prompts for input on next line. First NON-BLANK character deletes character in line above. Each occurence of the same character, deletes another character from the current line. If different character is typed, it and all following characters are inserted. If is given, cursor is automaticaly spaced over that many spaces. After edit, new line is displayed. Q - Quit: Quits and returns to dos. ALPS Users Guide Page: 5 LF - LoadFile: Loads file "name" from disk. sets current line to first line of new file. If file is not found prints "?FILE". SF - SaveFile: Saves file as "name". If not found, prints "?FILE". If edit file is larger than file on disk, prints "?SIZE". (neither file is changed) GF - GetFile: Gets the file "name" from disk, and appends it to the currently loaded file. NOTE: FILENAMES for 'LF', 'SF' and 'GF' may be followed by an optional disk-drive number. E.G: 'LF THISFILE,2' A - Assemble: Assembles source file. produces code to run at and places it at . If is not given,places code at . Produces formatted listing. AD - AsmDisp: Displays the symbol table from the last assembly. AE - Assemble Error: Assembles source file, displays lines containing errors only. AS - Builds and displays the symbol table for the currently loaded source file. No code is generated. * - list: Lists the directory on disk drive , If is ommited, uses default drive#. (chosen with the '#D' command). :S - Saveline: Saves current-line pointer. :R - Restore: Returns to previously saved current-line. NOTE: If text above saved line pointer is altered, ":R" may not return to the correct line. (main use is to examine rest of file and quickly return to previous location) X - Evaluates the expression and displays the result (in hex). can be any expression which is acceptable to the assembler (see assembler section) if an assembly has been done, then labels from that assembly can be used. ? - Query: Displays address (in hex) of the first byte following the END-OF-FILE at end of current file. Also prints size of file (also in hex.). + - Repeat: Repeats the current line times. /string- Locate: Moves to and displays first line following the current line containing the characters "string". if string not found, moves to end of file and prints "EOF:". NOTE1: Search starts on line following current line. (this is so that repeated "/" commands will not keep finding same line.) NOTE2: A "/" command can be repeated by typing or and when prompted for new command. ALPS Users Guide Page: 6 $- Setcmd: Sets automatic command to "". Pressing key now has same effect as Typing "" and carrage-return. NOTE: To display current auto command, Type "$" followed by . # - Switch: Sets editor defaults as followes: (NorthStar only) #O - Sets output device to . #D - Sets default disk drive used by LF, SF, GF and * commands ( should be less then 4). #T - Sets file-type accepted by "LF" "SF" and "GF" commands to . NOTE: Under DMF, use DOS commands for these functions: eg: \SET OUTPUT <- Set output device \SET DRIVE <- Set default drive + DMF includes the type/extension as part of the filename, and no #T function is required. The editor can load and save any DMF text file type. \- Doscmd: Execute a DOS command (DMF only) ALPS Users Guide Page: 7 2.2 USING THE ASSEMBLER The assembler uses Intel standard neumonics for the instructions. Anything starting in column one of the source is assumed to be a label. Otherwise input is free format. Labels may include any characters but may not begin with 0-9,$,* or =. Labels may be of any length. Labels are not followed by colons. Comments may follow any instruction, and need not be preceded by any special character. Any line beginning with '*' is ignored by the assembler and printed exactly as is (unformatted) in the listing. Hexadecimal constants are preceded with '$'. E.G.: ' LXI H,$0' - ' MVI A,$40' Decimal constants are also allowed. E.G.: ' MVI A,10' , ' LXI B,0' The resister specifications 'SP' and 'PSW' can be abbreviated to 'S' and 'P' respectively. All values are calculated by the assembler as sixteen bit quantities, When such a value is used in an instruction requiring only eight bits of data, the LOWER eight bits are used. If the value is preceded by an equals sign, then the high and low bytes are swapped, thereby allowing access to the upper eight bits of the result. EG: 1000 LABEL EQU $0123 1000 FE 23 CPI LABEL 1002 FE 01 CPI =LABEL 1004 23 01 DW LABEL 1006 01 23 DW =LABEL The symbol '*' is always equal to the total value calculated in an operand expression. (expressions are always evaluated from left to right). EG: A EQU B+C+* is the same as : A EQU B+C+B+C If a '*' is used as the first element in an expression, its value is equal to the address of the instruction on that line. (or next line in the case of an 'EQU' stmt.) EG: 1000 C3 03 10 JMP *+3 1003 00 NOP JUMPS TO HERE. Elements in an expression can be added(+), subtracted(-), anded(&) or ored(!) together. All expression processing is done from left to right, with NO operator precedence. EG: 1000 LABEL EQU *+$101 1000 C3 12 10 JMP LABLE&$FFFE+$12 ALPS Users Guide Page: 8 2.2.1 ASSEMBLER DIRECTIVES EQU - SYNTAX: