;;; expanddemo.s ;;; puts HC11 in expanded mode, ;;; writes sequentially increasing values to address 0x5000, ;;; and delays and clicks on PA4 between each write ;;; Fred G. Martin / UML CS 2002 PORTA= 0x1000 HPRIO= 0x103c ; highest priority bit int and misc reg ldaa HPRIO ; read the reg oraa #0x20 ; set MDA bit -> expanded mode staa HPRIO ; write it back clrb ; init b at 0 loop: stab 0x5000 ; write b to target incb ; inc it for next time ldaa PORTA eora #0x10 ; toggle piezo bit (click) staa PORTA ldy #0 ; delay for 65k loops delay: dey bne delay bra loop ; again