📄 sendstrt.s
字号:
/********************************************************
*
* FILE: sendstrt.s
*
* DESCRIPTION: Startup file for sendout.c and getinput.c
* DSP32c program (based on crt0_32c.s)
*
********************************************************/
#define sp r14e /* stack pointer */
#define rp r18 /* return pointer */
#define rpe r18e /* return pointer */
#define ir r19 /* increment register */
#define ip r22e /* interrupt pointer */
#define STACK_INC 4 /* stack increment */
#define FIFO_LENGTH_BYTES 0x1000
.rsect ".text"
.global __start
.global __end
.global errno
.global _ivtable
.global out_fifo_buffer
.global in_fifo_buffer
.align 4
__start: dauc = 0 /* Set round to int */
ioc = 0x40802 /* Disable any Serial I/O */
r1 = 0x0080 /* Initialize pcw for no wait state RAM and ... */
pcw = r1 /* ... pio high byte for direct I/O */
sp = _stack /* Stack is empty at bottom */
ir = STACK_INC /* stack increment */
ip = _ivtable /* Interrupt vector table pointer */
r20e = in_fifo_buffer /* input fifo input pointer */
r21e = out_fifo_buffer /* output fifo output pointer */
call main (rp) /* Nothing else to do now */
rpe = . + 4 /* to get around call bug in 32c */
r1 = 0
pdr = r1 /* exit (0) */
__end: goto __end
nop
_ivtable:
6 * nop
goto ibfisr
nop
goto obeisr
nop
6 * nop
#ifdef DBDADA
/* input interrupt service routine for CAC board */
ibfisr: /* DBDADA daughter card */
r22e = temp1 /* Read incoming data */
*r22 = ibufe
nop
r22 = *r22
nop
r22 & 1 /* If bit 0 set it is from wrong channel */
if (eq) pcgoto left_in
nop
r22e = temp2
r22 = *r22
nop
*r20++ = r22 /* Store in buffer */
r22e = in_fifo_buffer + FIFO_LENGTH_BYTES
r20e - r22
r22e = in_fifo_buffer
if (ge) r20e = r22
nop
left_in:
ip = _ivtable /* Restore Interrupt vector table pointer (r22) */
ireturn
temp1: int 0
temp2: int 0
tempo1: int 0
tempo2: int 0
/* output interrupt service routine for CAC board */
obeisr: /* DBDADA daughter card */
r22 = *r21 /* Value to send out */
nop
*tempo2 = r22
r22 = *tempo1 /* Toggle channel number */
nop
r22 = r22 ^ 1
nop
if (eq) pcgoto right_out /* If left channel output, */
*tempo1 = r22
r21 += 2 /* then increment memory ptr to next value */
right_out:
r22e = tempo1 /* Output 32-bit command to ADC */
obufe = *r22
r22e = out_fifo_buffer + FIFO_LENGTH_BYTES
r21e - r22
r22e = out_fifo_buffer
if (pl) r21e = r22
ip = _ivtable /* Restore Interrupt vector table pointer (r22) */
ireturn
#else
/* these interupts will work on a single cahnnel ADC/DAC system */
ibfisr:
*r20++ = ibuf
r22e = in_fifo_buffer + FIFO_LENGTH_BYTES
r20e - r22e
r22e = in_fifo_buffer
if (ge) r20e = r22e
ip = _ivtable /* Restore Interrupt vector table pointer (r22) */
ireturn
obeisr:
obuf = *r21++
r22e = out_fifo_buffer + FIFO_LENGTH_BYTES
r21e - r22e
r22e = out_fifo_buffer
if (pl) r21e = r22e
ip = _ivtable /* Restore Interrupt vector table pointer (r22) */
ireturn
#endif
.rsect ".data"
errno: int
.rsect ".bss"
_stack: byte
.rsect ".ofifo"
.align 4
out_fifo_buffer: int
.rsect ".ififo"
.align 4
in_fifo_buffer: int
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -