|
楼主 |
发表于 2006-10-31 15:26:06
|
显示全部楼层
. test_main.c:
#include <stdio.h>
void main()
{
while( TRUE )
{
asm(" rsbx xf ");
asm(" nop ");
asm(" nop ");
asm(" nop ");
asm(" ssbx xf ");
asm(" nop ");
asm(" nop ");
asm(" nop ");
}
}
test_vector.asm:
.mmregs
.ref _c_int00
.sect ".vectors"
.align 0x80
RESET:
BD _c_int00
STM #4FFEH,SP;#400,SP
nmi: RETE
NOP
NOP
NOP
; software interrupts
sint17 .space 4*16
sint18 .space 4*16
sint19 .space 4*16
sint20 .space 4*16
sint21 .space 4*16
sint22 .space 4*16
sint23 .space 4*16
sint24 .space 4*16
sint25 .space 4*16
sint26 .space 4*16
sint27 .space 4*16
sint28 .space 4*16
sint29 .space 4*16
sint30 .space 4*16
int0: RETE
NOP
NOP
NOP
int1: RETE
NOP
NOP
NOP
int2: RETE
NOP
NOP
NOP
tint: RETE
NOP
NOP
NOP
rint0: RETE
NOP
NOP
NOP
xint0: RETE
NOP
NOP
NOP
rint1: RETE
NOP
NOP
NOP
xint1: RETE
NOP
NOP
NOP
rint2: RETE
NOP
NOP
NOP
xint2: RETE
NOP
NOP
NOP
int3: RETE
NOP
NOP
NOP
hint: RETE
NOP
NOP
NOP
.end
test.cmd:
-c
-stack 0x0800
-m test.map
test_main.obj
test_vector.obj
MEMORY
{
PAGE 0: VECT: origin = 0x1000, len = 0x80
EPROG: origin = 0x1080, len = 0x2000
PAGE 1:
RAM1: origin = 0x0200, len = 0x0800
IDATA: origin = 0x4000, len = 0x1000
BUFFER: origin = 0x5000, len = 0x3000
}
SECTIONS
{
.vectors: {} > VECT PAGE 0
.text: {} > EPROG PAGE 0
.cinit: {} > EPROG PAGE 0
.switch: {} > EPROG PAGE 0
.bss: {} > IDATA PAGE 1
.const: {} > IDATA PAGE 1
.sysmem: {} > IDATA PAGE 1
.stack: {} > IDATA PAGE 1
} |
|