* Simple program that uses STAF to determine when a new value has been presented * by the user on PortC and strobed STRA from off to on. * Define symbolic names for the port addresses portc equ $1003 portb equ $1004 portcl equ $1005 ddrc equ $1007 pioc equ $1002 lcd equ $1040 org $e000 start lds #$FF It is a good idea to initialize the stack pointer loop ldaa Pioc copy PIOC into A bpl loop STAF bit is msb. If 0, number looks positive and we check again ldaa portcl STAF had changed from 0 to 1 so new value is portcl * Reading portcl causes STAF to be cleared staa portb Display number on port b staa lcd a single character is displayed on the lcd for each stra flip bra loop repeat indefinitely org $fffe reset vector tells processor where to start on power on. fdb start