A89: Re: Address Error
[Prev][Next][Index][Thread]
A89: Re: Address Error
>
>I keep getting an address error (actually it is an Adress Error) when I run
this program I'm writing. I figured out where it it, sort of. I has to do
when I use a macro to display a varible.
>
>print_d0 MACRO
>bsr print_value
>move.w \3,-(a7)
>move.l a0,-(a7)
>move.w \2,-(a7)
>move.w \1,-(a7)
>jsr doorsos::DrawStrXY
>lea 10(a7),a7
>ENDM
lea 10(a7),a7 isn't the same as adding 10 to the stack pointer. (a7) is not
a7. change it to this and you should be all right: add.l #10,a7
it looks just like a telefunken u47
>
>print_value:
>move.l #str+8,a0
>clr.b (a0)
>clr.l d1
>
>print_loop:
>add.l #1,d1
>divu #10,d0
>swap d0
>add.b #48,d0
>move.b d0,-(a0)
>clr.w d0
>swap d0
>tst.w d0
>bne print_loop
>rts
>
>ch:
>jsr graphlib::clr_scr
>move.w #1,-(a7)
>jsr doorsos::FontSetSys
>add.l #2,a7
>pea cash(pc) ;cash if the varible
>move.w cash,d0
>print_d0 #70,#0,#4
>clr.w -(a7)
>jsr userlib::idle_loop
>bra mnscr
>
>I also have this at the bottom:
>str dc.b " ",0
>cash dc.w 0
>
>What do I need to do to fix this?
>
>
>____________________________________________________________________
>Get free e-mail and a permanent address at http://www.netaddress.com/?N=1
Follow-Ups: