
Instruction Set
4-172
OUT
OUT
Examples
This example for the SD186EM demonstration board lights all of the LEDs that are mapped
to eight of the PIO pins on the microcontroller.
This example sets the baud rate divisor for the asynchronous serial port on the Am186EM
controller.
Tips
Use OUT to talk to the peripheral registers, since they are initially set to I/O space (and not
memory-mapped).
Related Instructions
If you want to
See
Copy a component from a port in I/O memory to a register
IN
Copy a component from a port in I/O memory to a string in main memory
INS
Copy a component from a string in main memory to a port in I/O memory
OUTS
; assert PIO pins 15-14 and 5-0
; set up PIO pins 15-0 as outputs
MOV
DX,PIO_DIR0_ADDR
; address of PDIR0 register
MOV
AX,0
; 0 = output
OUT
DX,AX
; write directions to register
; PIO pins 15-0 will be asserted
MOV
DX,PIO_DATA0_ADDR
; address of PDATA0 register
MOV
AX,0FFFFh
; 1 = high
OUT
DX,AX
; write levels to register
; only enable PIOs 15-14 and 5-0, the other PIO pins
; will perform their preassigned functions
MOV
DX,PIO_MODE0_ADDR
; address of PIOMODE0 register
MOV
AX,0C07Fh
; PIOs 15-14 and 5-0
OUT
DX,AX
; write modes to register
; set baud rate divisor for asynchronous serial port
MOV
DX,SPRT_BDV_ADDR
; address of SPBAUD register
MOV
AX,129
; 9600 baud at 40 MHz
OUT
DX,AX
; write out baud rate to register
Содержание Am186 Series
Страница 1: ...Am186 and Am188 Family Instruction Set Manual February 1997...
Страница 10: ...Table of Contents x...
Страница 18: ...Programming 1 8...
Страница 40: ...Instruction Set Listing 3 14...