Re: [Sdcc-user] jump with a macro

2018-03-18 Thread Maarten Brock
Hello Arne, Of course ".-2" is more cumbersome than a local label like 2$. But as you realized a local label is not always possible in a macro. What you're asking for is a way to say that some local labels are more local than others ;) Maybe you can do something with a parameter to the macro. Y

Re: [Sdcc-user] jump with a macro

2018-03-17 Thread AW via Sdcc-user
Hi Maarten! ".-2“ is a good idea...I tried "-5" (without the dot), which resulted in a weird linker error...but ".-2" compiles and links fine and produces good code... "2$" cannot work, if u have to wait twice within a macro, that uses this USBp macro (e. g. when u want to poll before a read). a

Re: [Sdcc-user] jump with a macro

2018-03-17 Thread Maarten Brock
Hello Arne, I believe you can use a relative offset like this: mov A,(USB0ADR) jb (ACC+USBBUSY), .-2 ; . = address of this instruction Or you can use reusable symbols below 100 (SDCC uses above 100) 2$: mov A,(USB0ADR) jb (ACC+USBBUSY), 2$ ; . = address of this instruction Have loo

[Sdcc-user] jump with a macro

2018-03-16 Thread AW via Sdcc-user
Hi! How can I jump within a macro in sdas8051? I do it like this now:.macro USBp   mov A, (USB0ADR)   .byte 0x20 , 0xE7 , 0xFB ; jb (ACC+USBBUSY), {to start of macro}   .endm but it feels like there should be a different notation... :) Thx. ByeArne--