Information about ASMop

  • KleineAap

    KleineAap - 2006-10-05


    we are currently working on a port of sdcc to the CR16c chip made by National. Doing so we've run into some trouble.

    In almost every port the code generator uses asmop's. This is to simplify the use of different operands. However, the functions are very poorly documented.

    To understand the working of these asmop functions better, we've made a dumper which dumps all kinds of information about the current operand. This however does not help in concluding some things.

    Questions we'd like to ask you are the following:
    We were hoping that someone has a bit more information about the asmop's. Is the function which determines in what address space the asmop is in dependend on the order in which the tests are done? For example is it necessary to first test wheter it's a literal or can also do this later?

    We're hoping for some help from the developers here...

    Kind regards,

    Fred & Stijn

    • Maarten Brock

      Maarten Brock - 2006-10-05

      Fred & Stijn,

      In what sense do you consider the CR16C a Small Device? It uses a 16 bit core and as far as I can see a Von Neumann architecture. Even National itself used GCC as the base for their toolset. Why did you choose SDCC as the base for your compiler and not GCC? My guess is that it's not very well suited.

      I'm not sure I understand your question. Could you be more specific by referring to an actual function name in one of the ports? Also this kind of questions is probably better asked on the developer mailing list.


    • KleineAap

      KleineAap - 2006-10-06


      The choise of using SDCC is not ours, we're doing feasibility study wheter or not porting SDCC to the CR16c architecture is possible.

      First two weeks of our project we have implemented basic math functions and were able to compile a program. We've changed the output of the generate code, so it generates code for the National assembler & linker.

      We're now busy implementing all the iCode operands. For this we decided to use the ASMop structure which is also used in the MCS51 and AVR port. However this framework is not very well documented.

      Our question is how the ASMop determines in what address space it is in. In the function "static void aopOp (operand * op, iCode * ic, bool result)" (AVR port) there are checks like:
      if (IS_OP_LITERAL (op))
      if (IS_SYMOP (op) && OP_SYMBOL (op)->aop)
      if (IS_TRUE_SYMOP (op))
      and more...

      It is unclear to us wheter or not these need to be in the exact order that they are in now. Does one exclude the other, for example is it clear to say that if it is a SYMBOL it can never be a LITERAL, since the current order implies such thing.

      We hope you can inform us a bit more about the working of the ASMop structure.

      Kind regards,

      Fred & Stijn

      ps. The developer mailinglist is a option, but since you are dutch maybe direct mail is faster and can be in our native language?


Log in to post a comment.