;----------------------------------------------------------------------------- ; 9/25/2002 sjd ; ; ; ; FILE NAME : INOUT01.ASM ; TARGET MCU : C8051F000 ; DESCRIPTION : This program illustrates how to configure the ; Crossbar, read and write to port 0 & 1 ; I/O pins. ; ; ; NOTES: ; ; (1) This note intentionally left blank. ; ; ;----------------------------------------------------------------------------- ;----------------------------------------------------------------------------- ; EQUATES ;----------------------------------------------------------------------------- $include (c8051f000.inc) ; Include register definition file. ;----------------------------------------------------------------------------- ; VARIABLES ;----------------------------------------------------------------------------- ;----------------------------------------------------------------------------- ; RESET and INTERRUPT VECTORS ;----------------------------------------------------------------------------- ; Reset Vector cseg AT 0 ljmp Main ; Locate a jump to the start of code at ; the reset vector. ;----------------------------------------------------------------------------- ; CODE SEGMENT ;----------------------------------------------------------------------------- Code_Seg segment CODE rseg Code_Seg ; Switch to this code segment. using 0 ; Specify register bank for the following ; program code. ; Enable the Port I/O Crossbar Main: mov XBR2, #40h ;P0 input, P1 output. Make sure jumpers J3 & J1 are removed to ;use all 8 bits on port P1. The on-board LED D3 and SW2 are connected ;to P1.6 and P1.7 ;loop. Blink: mov R7, P0 ;read port 0 mov P1, R7 ;write port1 jmp Blink ;----------------------------------------------------------------------------- ; End of file. END