* * Ex2.asm ---- Example program 2 for the Ep2711E9 Rev.C board * (c)2003, EVBplus.com, Written by Wayne Chu * * Function: Makes the port B as a binary counter. * * The 68HC11 control register address is the offset address from the * register base address $1000, so index addressing mode can also be used, * otherwise only extended addressing mode can be used. * * ORG $c4 *** Vector jump table for BUFFALO monitor *** JSCI RMB 3 JSPI RMB 3 JPAIE RMB 3 JPAO RMB 3 JTOF RMB 3 JTOC5 RMB 3 JTOC4 RMB 3 JTOC3 RMB 3 JTOC2 RMB 3 JTOC1 RMB 3 JTIC3 RMB 3 JTIC2 RMB 3 JTIC1 RMB 3 JRTI RMB 3 JIRQ RMB 3 JXIRQ RMB 3 JSWI RMB 3 JILLOP RMB 3 JCOP RMB 3 JCLM RMB 3 portb: equ $4 REGBLK: equ $1000 SPEED: equ $2500 ; change this number to change counting speed STACK: equ $8FFF * org $D000 ; user program starts at $D000 start: lds #STACK ldx #REGBLK back: inca staa portb,x jsr delay jmp back * delay: pshx ldx #SPEED ; delay 2500 loops =2000 cycles = 10ms dly: dex ; 3 cycles nop ; 2 cycle bne dly ; 3 cycles pulx rts * end