标题: 特低级一问题 [打印本页] 作者: pika 时间: 2010-8-18 14:19 标题: 特低级一问题 从书上找了个程序,特简单一流水灯,如下:
INCLUDE 'derivative.inc'
ORG $1000
main:
Entry: LDAA #$FF
STAA DDRB
SEC
LDAA #$FE
SHIFT:
STAA PORTB
BSR DELAY;调用
ROLA ;带位左循环
BRA SHIFT
DELAY: PSHA
PSHB
PSHX
LDX #$0200
DELAY1: LDY #$0500
DELAY2: DEY
BNE DELAY2
DEX
BNE DELAY1
PULX
PULB
PULA
RTS
单步调试,为什么每次 子程序返回RTS时总一下回到 Entry 呢?
刚开始学,不懂啊。。。谢谢作者: pika 时间: 2010-8-18 20:15
恩,果然是个sb问题,我搞清楚了,正确代码如下:
INCLUDE 'derivative.inc'
; export symbols
XDEF Entry, main
; we use export 'Entry' as symbol. This allows us to
; reference 'Entry' either in the linker .prm file
; or from C/C++ later on
XREF __SEG_END_SSTACK