;----------------------------------------------------------------------------- ; 10/22/2004 sjd ; ; ; ; FILE NAME : INOUT32.ASM ; TARGET MCU : C8051F000 ; DESCRIPTION : This program illustrates how to configure the ; Crossbar, read and write to port 3 & 2 ; 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 mov PRT2CF, #0FFh ;push-pull mov PRT3CF, #0FFh ;push-pull ;P3 input, P2 output. ;loop. Blink: mov R7, P3 ;read port3 mov P2, R7 ;write port2 jmp Blink ;----------------------------------------------------------------------------- ; End of file. END