MAC/65 When entering source lines they must begin with a line number which must be followed by one space. Then, the second space is the label column. The label must start in this column. The third space after the line number is the instruction column. Instructions may either start in at least the third column after the line number or at least one space after the label. The operand may begin anywhere after the instruction, and comments may begin anywhere after the operand or instruction. e.g.:- 10 *=$4000 This tells the program where to assemble the code in memory. 20 LABEL LDA #$00 Load the accumulator with 0. 30 STA $9C40 If there is no label leave 2 spaces after the line number. 40 EXIT RTS The end. 50 ;This is like a REM statement. MAC/65 COMMANDS command: ASM purpose: ASeMble source files usage: ASM [#file1],[#file2],[#file3],[#file4] ASM will assemble the specified source file and will produce a listing and object code output. File1 is the source device, file2 is the list device, file3 is the object device, and file4 is a temporary file used to help generate the cross reference listing. Any or all of the four filespec's may be omitted, in which case MAC/65 assumes the following default filespec(s) are to be used: file1 - user source memory. file2 - screen editor. file3 - memory. file4 - none, therefore no cross reference. A filespec (#file1, #file3, etc.) can be omitted by substituting a comma in which case the respective default will be used. For the listing file ONLY, you may use the special form "#-", to indicate that you do NOT want a listing file at all. Example: ASM #D2:SOURCE,#D:LIST,#D2:OBJECT In this example, the source will come from D2:SOURCE, the assembler will list to D:LIST, and the object code will be written to D2:OBJECT. Example: ASM #D:SOURCE , , #D:OBJECT In this example, the source will be read from D:SOURCE and the object will be written to D:OBJECT. The listing will be written to the screen. Example: ASM,,#D:OBJECT In this example, the source will be read from the memory, the object will be written to D:OBJECT, and the listing will be written on the screen. Example: ASM ,#- This produces what is probably the fastest possible MAC/65 assembly. Source code is read from memory and no listing is produced (because of the "#-"). If your program does not contain a ".OPT OBJ" line, this becomes what is essentially simply an error checking assembly. (Though even if you ARE producing object code, the assembly speed is extremely fast.) Note: If assembling from a "filespec", the source MUST have been a SAVEd file. command: DEL purpose: DELete a line or group of lines from the source/text in memory. usage: DEL lno1 [ ,lno2 ] Examples: DEL 100 deletes only line 100 DEL 200,1300 deletes lines 200 through 1300, inclusive command: REN purpose: RENumber all lines in Editor memory. usage: REN [ dcnum1 [ ,dcnum2 ] ] REN renumbers the source lines in memory. If no dcnums are specified, REN will renumber the program starting at line 10 in increments of 10. REN dcnum1 will renumber the lines starting at line 10 in increments of dcnum1. REN dcnum1,dcnum2 will renumber starting at line dcnum1 in increments of dcnum2. command: DOS purpose: exits from MAC/65 to DOS usage: DOS or CP command: LOAD purpose: to reLOAD a previously SAVEd MAC/65 token file from disk to editor memory. usage: LOAD #filespec [ ,A ] LOAD will clear the user memory before loading from the specified device unless the ",A" parameter is appended. command: SAVE purpose: SAVEs the internal (tokenised) form of the user's in-memory text/source to a disk file. usage: SAVE #filespec command: LIST purpose: to list the contents of all or part of MAC/65's editor buffer in ASCII (ATASCII) form to a disk or device usage: LIST [ #filespec, ] [ lno1 [,lno2 ] ] LIST lists the source file to the screen, or device when "#filename" is specified. If no lnos are specified, listing will begin at the first line in memory and end with the last line in memory. If only lno1 is specified, that line will be listed if it is in memory. If lno1 and lno2 are specified, all lines between and including lno1 and lno2 will be listed. When lno1 and lno2 are specified, neither one has to be in memory as LIST will search for the first line in memory greater than or equal to lno1, and will stop listing when the line in memory is greater than lno2. EXAMPLE: LIST #P: will list the current contents of the editor memory to the P: (printer) device. EXAMPLE: LIST #D2:TEMP, 1030, 1800 lists only those lines lying in the line number range from 1030 to 1800, inclusive, to the disk file named "TEMP" on disk drive 2. NOTE: The second example points out a method of moving or duplicating large portions of text or source via the use of temporary disk files. By suitably RENumbering the in-memory text before and after the LIST, and by then using ENTER with the Merge option, quite complex movements are possible. command: ENTER purpose: allow entry of ASCII (or ATASCII) text file into MAC/65 editor memory usage: ENTER #filespec [ (,N) (,A) ] Enter will cause the Editor to get ASCII text from the specified device. ENTER will clear the text area before entering from the filespec. That is any user program in memory at the time the ENTER command is given will be erased. The parameter "M" (MERGE) will cause MAC/65 to NOT clear the text area before entering from the file, text entered will be merged with the text in memory. If a line is entered which has the same line number of a line in memory, the line from the device will overwrite the line in memory. The parameter "A" allows the user to enter un-numbered text from the specified device. The Editor will number the incoming text starting at line 10, in increments of 10. CAUTION: The "A" option will always clear the text area before entering from the filespec. You may NOT use "M" in conjunction with the "A" option. command: TEXT purpose: allow entry of arbitrary ASCII (ATASCII) text without syntax checking. usage: TEXT TEXT will clear all user source code from memory and put the Editor in the text mode. TEXTMODE may be terminated by the NEW command. command: ? purpose: makes hexadecimal/decimal conversions usage: ? ($hxnum) (dcnum) ? is the resident hex/decimal decimal/hex converter. Numbers in the range 0-65535 decimal (0000 to FFFF hex) may be converted. Example: ? $1200 will print =4608 ? 8190 will print =$1FFE MAC/65 DIRECTIVES directive: .OPT purpose: selects various assembly control OPTions. usage: .OPT option [, [NO] option ...] usage notes:the valid options are as follows: LIST ERR EJECT OBJ MLIST CLIST NUM XREF The .OPT directive allows the user to control certain functions of the assembly. Generally, coding ".OPT option" will invoke a feature or option, while ".OPT NO option" will "turn off" that same feature. You may use any number of options (or NO options) on a single source line. For example, it is legal to use: .OPT NO LIST, NO XREF, OBJ, ERR The following are descriptions of the individual options: LIST controls the entire assembly listing. NO LIST turns off all listing except error lines. ERR will determine if errors are returned to the user in the listing and/or the screen. NO ERR is thus dangerous. EJECT controls the title and page listing. NO EJECT only turns off the automatic page generation: it has no effect on .PAGE requests. OBJ determines if the object code is written to the device/memory. NO OBJ is useful during trial assemblies. OBJ is NECESSARY when the code is to be placed in memory. NUM will auto number the assembly listing instead of using the user line numbers. NUM will begin at 100 and increment by 1. NUM is generally not useful except for final, "pretty" assemblies. MLIST controls the listing of MACRO expansions. NO MLIST will list only the lines within a Macro expansion which generate object code. MLIST will expand the entire Macro. Note that NO MLIST is extraordinarily useful in producing readable listings. CLIST controls the listing of conditional assembly. NO CLIST will not list source lines which are not assembled. CLIST will list all lines within the conditional construct. XREF allows the user, when a cross reference has been specified in the ASM command line, to control which portions of the source program will be cross referenced during the assembly. Any lines of source code between a .OPT NO XREF and the next succeeding .OPT XREF will not be cross referenced. By combining NO XREF and NO LIST, you can list and cross reference even extremely large programs in pieces. Or you might use NO XREF to avoid indexing entries out of an INCLUDED file. XREF and NO XREF are useless and inoperative (but do not generate errors) if you have not specified a cross reference file name in the ASM command line. NOTE: Unless specified otherwise by the user, all of the options will assume their default settings. The default settings for .OPT are: LIST listing is produced ERR errors are reported EJECT pages are numbered and ejected NO NUM use programmer's line numbers MLIST all macro lines are listed CLIST all failed conditionals list XREF continuous cross reference NO OBJ SEE CAUTION !!!!! CAUTION: The OBJ option is handled in a special way: IF assembling to memory the object default is NO OBJ. IF assembling to a device the object option is OBJ. directive: .INCLUDE purpose: allows one assembly language program to request that another program be included and assembled in-line. usage: .INCLUDE #filespec usage note:this directive should NOT have a label. The .INCLUDE directive causes the assembler to begin reading source lines from the specified "filespec". When the end of "filespec" is reached, the assembler will resume reading source from the previous file (or memory). CAUTION: The .INCLUDEd file MUST be properly SAVEd MAC/65 tokenised program. It can NOT be a ASCII file. Note: a .INCLUDEd file can not itself contain a .INCLUDE directive. EXAMPLE: .INCLUDE #D:SYSEQU.M65