The following section covers use of the Apple II mini-assembler only. It is not a course in assembly language programming. The following section assumes the user has a working knowledge of 6502 programming and mnemonics. The Apple II mini-assembler is a programming aid aimed at reducing the amount of time requir.ed to convert a handwritten program to object code. The mini-assembler is basically a look-up table for opcodes. With it, you can type mnemonics with their absolute addresses, and the assembler will convert it to the correct object code and store it in memory.
Typing “F666G” will put the user in mini-assembler mode. While in this mode, any line typed in will be interpreted as an assembly language instruction, assembled, anctstored in binary form unless the first character on th’e command line is a “$”.
If it is, the remainder of the line will be interpreted as a normal monitor command, executed, and control returned to assembler mode. To get out of the assembler mode, reset ml1st be pushed. If the first character on the line is blank, the assembled instruction will be stored starting at the address immediately following the previously assembled instruction.
If the first character is nonblank (and not “$”). the line is assumed to contain an assembly language instruction preceded by the instruction address (a hex number followed by a “:”1. In either case. the instruction will be retyped over the line just entered in disassembler format to provide a visual check of what has been assembled. The counter that keeps track of where the next instruction will be stored is the pseudo PC (Pro~ram Counter) and it can be changed by many monitor commands (eg .• ·L·. ‘T’ •.. .1. Therefore. it is advisable to use the explicit instruction address mode after every monitor command and. of course, when the mini-assembler is first entered.
Errors (unrecognized mnemonic, illegal format, etc.l are Signalled by a “beep” and a carrot (“-“) will be printed beneath the last character read from the input line by the mini-assembler. The mnemonics and formats accepted by the mini-assembler are the same as those listed by the 6502 Programmers Manual, with the following exceptions and differences:
1. All imbedded blanks are ignored. except inside addresses.
2. All addresses typed in are assumed to be in hex (rather than decimal or symbolic). A preceding “$” (Indicating hex rather than decimal or symbolic) is therefore optional. except that it should not precede the instruction address.
3. Instructions that operate on the accumulator have a blank operand field instead of “A”.
4. When entering a branch instruction, following the branch mnemonic should be the target of the branch. If the destination address is not known at the time the instruction is entered. simply enter an address that is in the neighborhood, and later re-enter the branch instruction with the correct target address. NOTE: If a branch target is specified that is out of range. the mini-assembler will flag the address as being in error.
5. The operand field of an instruction can only be followed by a comment field. which starts with a semi-colon (“;”1. Obviously. the mini-assembler ignores the field and in fact will type over it when the line is typed over in disassemblerformat. This “feature” is included only to be compatible with future upgrades including input sources other than the keyboard.
6. Any page zero references will generate page zero instruction formats if such a mode exists. There is no way to force a page zero address to be.two bytes. even if the address has leading zeros.
In general, to specify an addressing type. simply enter it as it would be listed in the disassembly. For information on the disassembler. see Apple II System Monitor in the previous section. A complete listing of the mini-assembler appears at the end of this section. An example of the mini-assembler appears below. Note that the second “BRK” has no space before it hence Apple refused the input. sounded the bell and typed a “‘” underneath the “R”. In “LDA3B45”, Apple also refused the instruction because “R” is not a legal hex digit. Remember to hit the “RESET” key to get out of the mini-assembler.
0000- E8 INX
0001- ·8A TXA
! JSR £FDED
0002- 20 ED FD JSR $FDED
! JMP $0
0005- 4C 00 00 JMP $0000
0008- 00 BRK
0009- 00 BRK
! LDA 3B45