AsmPDP - PDP-11 Assembler, Version 1.11 ======================================= J.G.Harston, 70 Camm Street, Walkley, Sheffield, S6 3TR http://mdfs.net/Software/PDP11/Assembler/ Date: 27-Jul-2009 AsmPDP is a PDP-11 assembler which will run on any platform capable of running BBC BASIC V, such as RISC OS, DOS, Windows and Unix. AsmPDP is also available as a precompiled executable for DOS/Windows. On running, various command line options can be given: AsmPDP [ [ []]] is the source file. This should be plain text. is the destination file to save the object code to. On RISC OS this will be filetyped to &1C5 "PDP-11". is a file to spool the assembler listing to. If absent, no listing file will be generated. On RISC OS this will be filetyped to &FFF "Text". If no parameters are given, then AsmPDP prompts for them. Source Format ------------- AsmPDP recognises the DEC opcodes and syntax detailed on the "PDP-11 Programming Card", in "Assembly Language for the PDP-11", Kapps & Stafford and in "Introduction to the PDP-11 And Its Assembly Language", Frank. Opcodes can be upper or lower case. Comments start with ';' and carry on to the end of the line. Labels are declared with '.label' or 'label:' at the start of a line. Labels are case sensitive. As the BBC BASIC evaluator is used, labels cannot be BASIC commands or functions, eg 'PRINT' or 'TAN'. Use lower case or prefix with with additional characters, eg 'cmdPRINT'. Numeric values can be any valid value recognised by BBC BASIC. Hexadecimal constants start with &, binary constants start with %. The current location counter can be found with '$' or 'P%'. Pseudo-ops ---------- #include Includes the specified file. org
Sets the location counter. bss Marks the start of the uninitialised data section and the final point of saved code. adr ,dst Calculates the absolute address of the specified label in a position-independant manner as an offset from the program counter. align Forces the location counter to an even value by storing a zero if needed. equm Stores the specified string. equs Reserves an amount of space. equb Stores the specified byte. equw <16-bit word> Stores the specified 16-bit word, low byte first. equd <32-bit word> Stores the specified 32-bit word, low byte first. equ Sets the label to the specified value. Filenames --------- When running on RISC OS '.' and '/' characters are swapped in input filenames. So, for example, '#include "Lib/UnixIO.mac"' includes the file "Lib.UnixIO/mac" and 'AsmPDP hello.mac' assembles the file 'hello/mac'. If no file extension is specified on an input filename, a search is made first for the plain filename, and then with a '.mac' extension. Bugs, ommissions ---------------- - $ and P% need to be prefixed with + or -, eg label+$, not $+label. - adr only generates correct code for address modes 0-6. Using adr with predecrement and postincrement modes will double the decrement or increment. - Need to add DEC style .byte, etc. - Need to add octal constants. History ------- v1.04 31-Aug-2005 Added #include, checks for DOS filenames. v1.05 30-Apr-2006 Runs correctly as a Windows console application. v1.06 19-May-2006 '$' recognised in constants. v1.07 25-Feb-2007 Implemented ADR label,dst. v1.08 02-Mar-2007 Errors trapped in evaluation, SXT, SWAB, ENDCODE implemented. v1.09 12-Aug-2008 SOB, M[T|F][PI|PD|PS] implemented. v1.10 20-Feb-2009 Listing only output if list file given or error occurs. v1.11 27-Jul-2009 Correctly parses quoted parameters, eg AsmPDP "File 1.mac". label-$ correctly gives error if label not defined.