📄 hpi.asm
字号:
;the HPI space in our system
;0x8000 8 HPIC0 bit 7 6 5 4 3 2 1 0
;0X8001 9 HPIC1 TL1 TL0 BIL
;0X8002 a HPID0(AUTO) 1 00 HPIC
;0X8003 b HPID1(AUTO) 1 01 HPID (ATO)
;0X8004 c HPIA0 1 10 HPIA
;0X8005 d HPIA1 1 11 HPID (NO ATO)
;0X8006 e HPID0(NO AUTO)
;0X8007 f HPID1(NO AUTO)
;result is 0x1002=AA 0x1003=DD
;A0-->HBIL HBIL
;A1-->HCNTL0 HCNTL0
;A2-->HCNTL1 HCNTL1
;A15-->HCS }C_HCS
;A3-->
;other pins connection
;HAS-->1
;HDS1-->IOSTRB IOSTRB
;HDS2-->1
;HINT-->INT0 INT0
;HREADY-->BREADY BREADY
;HR/W-->R/W R/W
;###########################################################
.global _main
.ref _InitC5402
_main:
stm 0x1000,ar1
st 0x00,*ar1
portw *ar1,0x8008 ;write 0x00 to HPIC0
st 0x00,*ar1
portw *ar1,0x8009 ;write 0x00 to HPIC1
st 0x10,*ar1
portw *ar1,0x800C ;write 0x10 to HPIA0
st 0x20,*ar1
portw *ar1,0x800D ;write 0x20 to HPIA1
;then the address is:0x1020
loop:
st 0xAA,*ar1
portw *ar1,0x800e ;write 0x55 to HPID0(AUTO)
nop
nop
nop
stm 0x1002,ar2
nop
nop
portr 0x800E,*ar2 ;read data from HPID0(AUTO)
nop
nop
nop
b loop
nop
nop
.end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -