A-3
WDT & GPIO
MS-98I0
GPIO Sample Code
GPI 0 ~ GPI 3
GPI 0
GPI 1
GPI 2
GPI 3
Memory Address
0FED8C428h 0FED8C420h 0FED8C440h 0FED8C410h
SIO IO Register
Bit
0
0
0
0
Sample code
#1
GPO 0 ~ GPO 3
GPO 0
GPO 1
GPO 2
GPO 3
Memory Address
0FED8C400h 0FED8C418h 0FED8C438h 0FED8C408h
SIO PIO Register
Bit
1
1
1
1
Sample code
#2
GPI0_Addr
equ
0FED8C428h
GPO0_Addr
equ
0FED8C400h
Sample Code:
#1: Get GPI 0 status
Push
es
Push
0
Pop
es
Push
esi
; Get GPI 0 Pin Status Register
mov esi, GPI0_Addr
mov al, byte ptr es:[esi]
;al bit0 = GPI 0 status
Pop
esi
Pop
es
#2: Set GPO 0 value to high
Push
es
Push
0
Pop
es
Push
esi
; Get GPO 0 Pin Status Register
mov esi, GPO0_Addr
mov al, byte ptr es:[esi]
or al, 02h
mov byte ptr es:[esi],al
Pop
esi
Pop
es