如下:Error 56: unrecognised opcode '#include "mapping.inc"'
程序如下:
stm8/
#include "mapping.inc"
PB_ODR EQU $5005
PB_IDR EQU $5006
PB_DDR EQU $5007
PB_CR1 EQU $5008
PB_CR2 EQU $5009
stack_start.w EQU $stack_segment_start
stack_end.w EQU $stack_segment_end
segment 'rom'
main.l
ldw X, #stack_end
ldw SP, X
ld A, #$20
ld PB_DDR, A ;Set to Output
ld A, #$20
ld PB_CR1, A ;Set to PushPull
ld A, #$00
ld PB_CR2, A ;2MHz
main_loop.l
ld A, #$20
ld PB_ODR, A ;PB.5 set to 1
ld A, #100
call delay_ms
ld A, #$00
ld PB_ODR, A ;PB.5 set to 0
ld A, #100
call delay_ms
jra main_loop
delay_ms.l
push A
ld A, #250
delay_ms_1.l
nop
nop
nop
nop
nop
dec a
jrne delay_ms_1
pop a
dec a
jrne delay_ms
ret
interrupt NonHandledInterrupt
NonHandledInterrupt.l
iret
segment 'vectit'
dc.l {$82000000+main} ; reset
dc.l {$82000000+NonHandledInterrupt} ; trap
dc.l {$82000000+NonHandledInterrupt} ; irq0
dc.l {$82000000+NonHandledInterrupt} ; irq1
dc.l {$82000000+NonHandledInterrupt} ; irq2
dc.l {$82000000+NonHandledInterrupt} ; irq3
dc.l {$82000000+NonHandledInterrupt} ; irq4
dc.l {$82000000+NonHandledInterrupt} ; irq5
dc.l {$82000000+NonHandledInterrupt} ; irq6
dc.l {$82000000+NonHandledInterrupt} ; irq7
dc.l {$82000000+NonHandledInterrupt} ; irq8
dc.l {$82000000+NonHandledInterrupt} ; irq9
dc.l {$82000000+NonHandledInterrupt} ; irq10
dc.l {$82000000+NonHandledInterrupt} ; irq11
dc.l {$82000000+NonHandledInterrupt} ; irq12
dc.l {$82000000+NonHandledInterrupt} ; irq13
dc.l {$82000000+NonHandledInterrupt} ; irq14
dc.l {$82000000+NonHandledInterrupt} ; irq15
dc.l {$82000000+NonHandledInterrupt} ; irq16
dc.l {$82000000+NonHandledInterrupt} ; irq17
dc.l {$82000000+NonHandledInterrupt} ; irq18
dc.l {$82000000+NonHandledInterrupt} ; irq19
dc.l {$82000000+NonHandledInterrupt} ; irq20
dc.l {$82000000+NonHandledInterrupt} ; irq21
dc.l {$82000000+NonHandledInterrupt} ; irq22
dc.l {$82000000+NonHandledInterrupt} ; irq23
dc.l {$82000000+NonHandledInterrupt} ; irq24
dc.l {$82000000+NonHandledInterrupt} ; irq25
dc.l {$82000000+NonHandledInterrupt} ; irq26
dc.l {$82000000+NonHandledInterrupt} ; irq27
dc.l {$82000000+NonHandledInterrupt} ; irq28
dc.l {$82000000+NonHandledInterrupt} ; irq29
end
大家帮忙看看?万分感谢。
|