📄 rs232-asm.s
字号:
;;; ;;; ;;; rs232-asm.S;;; ;;; PC-6001 Architecture depend RS-232C implementation,;;; uses a bunch of BIOS functions.;;; ;;; @author Takahide Matsutsuka <markn@markn.org>;;; ;;; $Id: rs232-asm.S,v 1.2 2007/09/19 12:47:19 matsutsuka Exp $;;; ;; definitions of PC-6001 BIOS routines_rs232c_initialize = 0x19bf_rs232c_char_output = 0x19e8_char_input_sub = 0x2642_rs232c_interrupt_sub = 0x0f64 ;; export symbols .globl _rs232_arch_writeb .globl _rs232_arch_poll .globl _rs232_arch_init .area _CODE ;; --------------------------------- ;; void rs232_writeb(u8_t c) ;; Stack; retl reth c ;; AFBC__HL____ ;; return void ;; ---------------------------------_rs232_arch_writeb: ld hl, #2 add hl, sp ld a, (hl) call _rs232c_char_output ret ;; --------------------------------- ;; unsigned char rs232_arch_poll(unsigned char *stat); ;; Stack; retl reth statl stath ;; AFBCDEHL____ ;; return input byte (*stat == 0 if no input) ;; ---------------------------------_rs232_arch_poll: ld hl, #2 add hl, sp ld e, (hl) inc hl ld d, (hl) ld a, #0x01 ld (de), a di call #_char_input_sub ; read from buffer ei jr nz, _rs232_arch_poll_ret xor a ; we have no data in the buffer ld (de), a_rs232_arch_poll_ret: ld l, a ret ;; --------------------------------- ;; void rs232_init(unsigned long ubr); ;; Stack; retl reth ubr1 ubr2 ubr3 ubr4 ;; AFB_DEHL____ ;; return void ;; ---------------------------------_rs232_arch_init: ld b, #0x4f call _rs232c_initialize ret
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -