• addressing through base, index both in regs

    From erwin.matthijssen@gmail.com@21:1/5 to All on Sun Mar 12 03:56:17 2017
    Hi,

    I am struggling with the lburg syntax. I can get it to emit the most basic instructions but don't fully grasp how to do certain things. The book is not helping either.

    I have an instruction that loads a memory word into a reg using a base and offset, each in a reg:

    ldw.i tgt-reg, (offset, base)

    I can't figure out how to describe this addressing mode in my lburg file. How do I tell it, it should load atlas a base into a reg first?

    Any pointers in the right direction would be appreciated.
    Erwin

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From bill rowe@21:1/5 to erwin.ma...@gmail.com on Sun Mar 12 04:48:10 2017
    is this, for example loading a local from the stack frame?
    I handle something a bit similar with a macro where LCC emits ld2 tgt-reg,base-reg,offset-constant and a macro does the loading of base plus offset into a register and then loading the value. Could you do that?


    On Sunday, March 12, 2017 at 6:56:17 AM UTC-4, erwin.ma...@gmail.com wrote:
    Hi,

    I am struggling with the lburg syntax. I can get it to emit the most basic instructions but don't fully grasp how to do certain things. The book is not helping either.

    I have an instruction that loads a memory word into a reg using a base and offset, each in a reg:

    ldw.i tgt-reg, (offset, base)

    I can't figure out how to describe this addressing mode in my lburg file. How do I tell it, it should load atlas a base into a reg first?

    Any pointers in the right direction would be appreciated.
    Erwin

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From erwin.matthijssen@gmail.com@21:1/5 to All on Sun Mar 12 05:11:27 2017
    This could be loading a local, but could also be loading a global.

    I could do it with a macro, but then I would have to dedicate a register to just this use case? Since the macro cannot now if LCC has used any of its available regs..

    I was wondering if there wasn't a way to achieve this through LCC itself...

    Erwin


    Op zondag 12 maart 2017 12:48:12 UTC+1 schreef bill rowe:
    is this, for example loading a local from the stack frame?
    I handle something a bit similar with a macro where LCC emits ld2 tgt-reg,base-reg,offset-constant and a macro does the loading of base plus offset into a register and then loading the value. Could you do that?


    On Sunday, March 12, 2017 at 6:56:17 AM UTC-4, erwin.ma...@gmail.com wrote:
    Hi,

    I am struggling with the lburg syntax. I can get it to emit the most basic instructions but don't fully grasp how to do certain things. The book is not helping either.

    I have an instruction that loads a memory word into a reg using a base and offset, each in a reg:

    ldw.i tgt-reg, (offset, base)

    I can't figure out how to describe this addressing mode in my lburg file. How do I tell it, it should load atlas a base into a reg first?

    Any pointers in the right direction would be appreciated.
    Erwin

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)