Application Examples
Assembly Language Setup
The following example is written in Assembly language.
The
ZT 8825 is loaded with 8 x 32K RAM. The 20-bit memory address
starts at 8000:000 (segment 8000 or 512K).
;MEMORY EQUATES
START_MAP
EQU
20H
;=SEGMENT 8000H SHIFTED RIGHT 10 TIMES
SIZE
EQU
16
;16 X 16K = 256K
;8825 I/O ADDRESSES
LO_ADDR
EQU
0EE68H
HI_ADDR
EQU
0EE69H
DATA
EQU
0EE6AH
CONFIG
EQU
0EE6BH
;CONFIG REGISTER EQUATES
ALT_REG
EQU
80H
VALID
EQU
80H
;VALID PAGE
EN_MAP_WR
EQU
0EH
EN_BOARD
EQU
0BH
MOV
DX, CONFIG
MOV
AL, EN_MAP_WR
OUT
DX, AL
;ENABLE WRITES TO MAP REGISTER
MOV
DX, HI_ADDR
MOV
AL, 0
OUT
DX, AL
;SELECT LOWER 64 MAP REGISTERS
MOV
AL, 0
;START AT REGISTER 0
MOV
CX, 64
;CLEAR ALL 64 MAP REGISTERS
MOV
AH, 0
;NOT VALID PAGE
CLEAR_LOOP:
MOV
DX, LO_ADDR
OUT
DX, AL
;SELECT NEXT MAP REGISTER
XCHG
AH, AL
MOV
DX, DATA
OUT
DX, AL
;CLEAR IT TO 0
XCHG
AH, AL
INC
AL
LOOP
CLEAR_LOOP
MOV
CX, SIZE
MOV
AL, START_MAP
MOV
AH, VALID
INIT_LOOP:
MOV
DX, LO_ADDR
OUT
DX, AL
;SELECT WINDOW
MOV
DX, DATA
XCHG
AH, AL
OUT
DX, AL
;ENABLE PAGE
XCHG
AH, AL
INC
AL
;INCREMENT WINDOW NUMBER
4-2
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com