m68kif.s
来自「motorola自己开发的针对coldfire 5272的Dbug bootlo」· S 代码 · 共 72 行
S
72 行
/*
* File: m68kif.s
* Purpose: MC68000 and MCF5200 system call handler for dBUG.
*
* Notes:
*
* Author: Eric DeVolder
* Date:
*
* Modifications:
*
*/
/*
* This file contains the low level interrupt service routines
* for implementing a user system call interface into the monitor.
*/
.global _dbug_sc_handler
.text
/*
* NOTE: This handler uses the convention that D0,D1,A0,A1 are
* scratch registers. Thus these registers are not preserved.
*/
_dbug_sc_handler:
lea -12(sp),sp /* room for used regs */
movem.l d2/a0-a1,(sp)
extw.l d0
/* Serial I/O routines, port A */
cmpi.l #0x0010,d0
beq.w in_char
cmpi.l #0x0013,d0
beq.w out_char
cmpi.l #0x0014,d0
beq.w char_present
/* Not a supported system call, jump back to monitor */
movem.l (sp),d2/a0-a1
lea 12(sp),sp
move.l sp,-(sp)
jsr _asm_sc_exit_to_dbug
in_char:
jsr _board_getchar /* char returned in D0 */
move.l d0,d1
moveq.l #0,d0
bra.w done
out_char:
move.l d1,-(sp)
jsr _board_putchar
lea 4(sp),sp
moveq.l #0,d0
bra.w done
char_present:
jsr _board_getchar_present /* value returned in D0 */
bra.w done
done:
movem.l (sp),d2/a0-a1
lea 12(sp),sp
rte
.end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?