?? beg8251r_s.asm
字號:
;*****************************************************************************
; Function: uart.asm
; Version : 1.00
; Description: uart
;
; Copyright Texas instruments Inc, 2000
;*****************************************************************************
.mmregs
; .global _sample_buff
;*****************************************************************************
.def _int23
.global _t8251 ,_rend,_send
;rend為接收完標志,send為發送完標志
dr8251 .set 8000h
cr8251 .set 8001h
icr .set 0ffech
.text
_int23:
nop
MAR *,AR1
sst #1,*+
sst #0,*+
sar ar0,*+
sar ar1,*+
SAR AR3,*+
sar ar4,*+
SAR AR5,*+
sacl *+
sach *+ ;以上為保護寄存器
ldp #0h
lar ar0,#0h
IN 60h,icr
nop
BIT 60h,13 ;測試INT2
bcnd SEND,NTC
; BIT 60h,12
; bcnd SEND,TC
; lar ar5,61H ;接收的數據量
RECEIVE: ldp #0h
lar ar3,6eh ;啟動接收
mar *,ar3
IN *+,dr8251
nop
sar ar3,6eh
;mar *,ar5
;mar *-
;sar ar5,61h
;cmpr 0 ;判斷是否已經接收了10個數
;bcnd next,ntc
;lar ar3,#(_rend) ;rend=1 則往下執行 主程序
;mar *,ar3
; splk #1h,*
; splk #00ffh,63h
;splk #0012h,60h
;out 60H,icr
next:
B end
SEND:
BIT 60h,12 ;測試INT3
bcnd end,NTC
lar ar5,64H ;發送的數據量
lar ar3,6dH ;啟動串口發送
mar *,ar3
out *+,dr8251
nop
sar ar3,6dh
mar *,ar5
mar *-
sar ar5,64h
cmpr 0 ;判斷是否已經發送了20個數
bcnd end,ntc
lar ar3,#(_send) ;send=1 則往下執行 主程序
mar *,ar3
splk #1h,*
splk #00ffh,63h
lar ar3,6cH
SAR AR3,6dH ;恢復t8251初始地址
splk #001dh,60h
out 60H,icr
; ldp #0h
; splk #00BBh,60h
; LAR AR5,6FH
; nop
; out 60H,dr8251
; nop
; nop
; nop
; nop
; nop
end: SPLK #003FH,ifr
in 62h,icr
nop
nop
nop
nop
out 62h,icr
MAR *,AR1
mar *-
lacc *-,16
add *-
LAR AR5,*-
nop
LAR AR4,*-
nop
LAR AR3,*-
nop
lar ar1,*
nop
mar *-
lar ar0,*-
nop
lst #0,*-
nop
lst #1,*
nop
clrc intm
ret
; .endif
;end of file. please do not remove. it is left here to ensure that no lines of code are removed by any editor
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -