📄 csioa.a51
字号:
;*************************************************************************; An 8051 Based Web Server; csio.a51: driver code for CS8900A chip located at 7000h; By Mason Kidd 10/25/01;*************************************************************************$NOMOD51$INCLUDE(reg515.inc)name csioapublic _write_byte, _read_byte, _write_word, _read_wordL, _read_wordH sc_csio SEGMENT CODE RSEG sc_csio USING 0 csio_port EQU 70h ; write_byte(io_port = R7, data = R5)_write_byte: push ACC mov A, R7 add A, #csio_port mov DPH, A mov A, R5 movx @DPTR, A pop ACC ret ; read_byte(io_port = R7), value returned in R7_read_byte: push ACC mov A, R7 add A, #csio_port mov DPH, A movx A, @DPTR mov R7, A pop ACC ret ; write_word(io_port = R7, data = R4R5); send the low order byte first(R5)_write_word: push ACC mov A, R7 add A, #csio_port mov DPH, A mov A, R5 movx @DPTR, A mov A, R7 add A, #csio_port inc A mov DPH, A mov A, R4 movx @DPTR, A pop ACC ret ; read_wordL(io_port = R7) return in R6R7; read the low order byte first(R7)_read_wordL: push ACC mov A, R7 mov R1, A add A, #csio_port mov DPH, A movx A, @DPTR mov R7, A mov A, R1 add A, #csio_port inc A mov DPH, A movx A, @DPTR mov R6, A pop ACC ret ; read_wordH(io_port = R7) return in R6R7; read the high order byte first(R6)_read_wordH: push ACC mov A, R7 mov R1, A add A, #csio_port inc A mov DPH, A movx A, @DPTR mov R6, A mov A, R1 add A, #csio_port mov DPH, A movx A, @DPTR mov R7, A pop ACC ret end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -