beautypg.com

B.2 assembly language samples, B.2.1 gpio initialization procedure, B.2.2 general purpose output procedure – Intel iEi Motherboard A300 User Manual

Page 172: B.2 a, Ssembly, Anguage, Amples

background image

A300 Motherboard

Bit 4

00h

00h

Bit 5

00h

00h

Bit 6

00h

00h

Bit 7

00h

00h

B.2 Assembly Language Samples

B.2.1 GPIO Initialization Procedure

The following instruction set initializes one pin on the GPIO connector.

MOV DX,

320h

Moves 320h into the DX data register for one of the GPIO

pins

MOV AL,

XXh

Moves the user defined output value XXh into the low bit

accumulator register AL

OUT DX,

AL The content of the low bit accumulator register AL is

transmitted to the address stored in the DX data register

The following instruction set initializes the input/output setting register for one pin on the

GPIO connector to specify whether that pin inputs or outputs data.

MOV DX,

321h

Moves 320h into the DX data register for one of the GPIO

pins

MOV AL,

YYh

Moves the user defined output value YYh into the low bit

accumulator register AL. If YY is specified as 0, the pin is

an output pin. If YY is specified as 1, the pin is an input

pin.

OUT DX,

AL The content of the low bit accumulator register AL is

transmitted to the address stored in the DX data register

B.2.2 General Purpose Output Procedure

The following instruction set is for a GPO procedure for one pin on the GPIO connector.

Page 157