Lazer Interactivce Symbollic Assembler
Apple II LISA Assembler Cheat Sheet
Table of Contents
Basic Syntax
LABEL OPCODE OPERAND ;COMMENT
- Labels start in column 1
- Opcodes typically start at column 10
- Operands typically start at column 18
- Comments begin with semicolon (;)
Essential Assembler Directives
Memory and Origin
ORG $address ; Set origin address (e.g., ORG $800)
OBJ $address ; Set object code address
END ; End of source file
Data Definition
DFB byte,... ; Define byte(s) (8-bit)
DW word,... ; Define word(s) (16-bit, lo/hi format)
DA address,... ; Define address (16-bit)
ASC "string" ; ASCII string
DCI "string" ; ASCII with high bit set on last char
STR "string" ; Pascal string (length byte first)
HEX hexdata ; Hex data (e.g., HEX 0A1B2C)
DS count ; Define storage (reserve bytes)
MSB ON/OFF ; Set high bit for ASC strings
Conditional Assembly
DO expression ; Begin conditional assembly
ELSE ; Alternative condition
FIN ; End conditional block
IF expression ; Single-line conditional
Symbols and Labels
EQU value ; Define constant
LABEL = value ; Alternative constant definition
EXT label,... ; External labels
ENT label,... ; Entry points (global labels)
Listing Control
LST ON/OFF ; Listing on/off
LSTDO OFF ; Don't list DO/FIN blocks
PAG ; New page in listing
TTL "title" ; Set listing title
SKP lines ; Skip lines in listing
CHR char ; Define string delimiter
File Operations
PUT filename ; Include source file
SAV filename ; Save object code
DSK filename ; Specify disk file for object
Addressing Modes
LDA #$FF ; Immediate
LDA $FF ; Zero page
LDA $FF,X ; Zero page,X
LDA $FF,Y ; Zero page,Y
LDA $FFFF ; Absolute
LDA $FFFF,X ; Absolute,X
LDA $FFFF,Y ; Absolute,Y
LDA ($FF,X) ; Indexed indirect
LDA ($FF),Y ; Indirect indexed
JMP ($FFFF) ; Indirect (JMP only)
Operators and Expressions
Arithmetic Operators
| Operator | Description |
|---|---|
| + | Addition |
| - | Subtraction |
| * | Multiplication |
| / | Division |
| ! | Modulo (remainder) |
Logical Operators
| Operator | Description |
|---|---|
| & | Bitwise AND |
| .OR. | Bitwise OR |
| .EOR. | Bitwise XOR |
| .NOT. | Bitwise NOT |
Comparison Operators
| Operator | Description |
|---|---|
| = | Equal |
| <> | Not equal |
| < | Less than |
| > | Greater than |
| <= | Less than or equal |
| >= | Greater than or equal |
Special Operators
| Operator | Description |
|---|---|
| # | Immediate mode prefix |
| < | Low byte of expression |
| > | High byte of expression |
| ^ | Bank byte (65816) |
| * | Current location counter |
Pseudo Variables
* Current address/location counter ]1-]9 Macro parameters (in macro definitions)
Common Macros
Define a Macro
name MAC ; Begin macro definition
; macro body
<<< ; End macro (or EOM)
Use a Macro
name param1;param2;param3
Example Macros
PRINT MAC ; Print string macro
LDA #<]1
LDY #>]1
JSR STROUT
<<<
SAVE MAC ; Save registers
PHA
TXA
PHA
TYA
PHA
<<<
RESTORE MAC ; Restore registers
PLA
TAY
PLA
TAX
PLA
<<<
LISA Editor Commands
(If using integrated editor)
| Command | Function |
|---|---|
| A | Append lines |
| C | Change lines |
| D | Delete lines |
| E | Edit (enter editor) |
| F | Find string |
| I | Insert lines |
| L | List lines |
| M | Move lines |
| N | Renumber lines |
| P | Print to printer |
| Q | Quit editor |
| R | Replace string |
| W | Write to disk |
Common Program Structure
; Program header
ORG $800 ; ProDOS binary location
; Constants
BELL EQU $FF3A ; Monitor bell routine
HOME EQU $FC58 ; Clear screen
COUT EQU $FDED ; Character output
STROUT EQU $DB3A ; String output
; Main program
START JSR HOME ; Clear screen
LDA #<MSG
LDY #>MSG
JSR STROUT
RTS
; Data
MSG ASC "HELLO, WORLD!"
DFB $8D,$00 ; CR + terminator
END
; Save object code
SAV HELLO.OBJ
Memory Map Quick Reference
$0000-$00FF
Zero Page
$0100-$01FF
Stack
$0200-$02FF
Input buffer/Free space
$0300-$03FF
Vector locations
$0400-$07FF
Text screen 1
$0800-$0BFF
Text screen 2 (common load address)
$0C00-$1FFF
Free RAM
$2000-$3FFF
Hi-res page 1
$4000-$5FFF
Hi-res page 2
$6000-$BFFF
Free RAM (common program area)
$C000-$CFFF
I/O area
$D000-$FFFF
ROM/Language card
Common Monitor Routines
| Address | Name | Description |
|---|---|---|
| $FD8E | CROUT | Output carriage return |
| $FDED | COUT | Output character in A |
| $FF3A | BELL | Ring bell |
| $FC58 | HOME | Clear text screen |
| $FB60 | PRBL2 | Print blanks (X = count) |
| $FDDA | PRBYTE | Print byte in A as hex |
| $FF65 | MON | Enter monitor |
| $FE80 | SETINV | Set inverse text |
| $FE84 | SETNORM | Set normal text |
Tips
Case Sensitivity: LISA is generally not case-sensitive for opcodes and directives
Hex Numbers: Use $ prefix for hex (e.g., $FF00)
Binary Numbers: Use % prefix for binary (e.g., %10101010)
Local Labels: Use numbers (e.g., :1, :2) for local labels within routines
Comments: Use semicolons liberally for documentation
Listing Files: Generate listings with LST ON for debugging
Symbol Tables: Use meaningful label names for easier debugging
Error Messages
| Error | Description |
|---|---|
| SYNTAX ERROR | Invalid syntax in line |
| UNDEFINED | Label or symbol not defined |
| DUPLICATE | Label defined more than once |
| RANGE | Branch out of range (>127 bytes) |
| MEMORY FULL | Source too large for available memory |
| BAD OPERAND | Invalid operand for instruction |
Note: LISA syntax may vary slightly between versions. This guide covers LISA 2.5-2.6 commonly used on Apple II systems.