********************************************************************** * Example 1a ********************************************************************** * Version 1.00a, written by Kenrick Chin, 1999 Jun 24 * Demonstrates how to toggle PD5 output * using indexed addressing mode for I/O addresses * and BSET/BCLR to set and clear individual bits *--------------------------------------------------------------------- * Define hardware constants *--------------------------------------------------------------------- EEPROM EQU $F800 ;start of EEPROM REGS EQU $1000 ;I/O bas address PORTD EQU $08 ;offset address of portD DDRD EQU $09 ;offset for portD Data Direction Reg PD5 EQU %00100000 ;bit mask for PD5 ********************************************************************** * CODE SEGMENT ********************************************************************** ORG EEPROM start LDX #REGS ;setup I/O base address BSET DDRD,X PD5 ;set PD5 for output main BSET PORTD,X PD5 ;send high signal on PD5 BCLR PORTD,X PD5 ;and set it low again BRA main ;loop forever ********************************************************************** * Interrupt Vectors ********************************************************************** ORG $FFFE FDB start ;reset vector END