usage of direct adressing mode at hc08

  • kosmonaut_pirx

    kosmonaut_pirx - 2006-06-08

    since programs size is growing, i'm getting generated assembler code which may cause the trouble i'm confused with.

    at hc08, there's only a few bytes directly adressable, from address 0x00-0xFF. looking in the .map-file, everything in this adress space is filled with sloc's:
    --------------------------------   ----   ----   ------- ----- ------------
    DSEG                               0050   00E0 =    224. bytes (REL,CON)

          Value  Global
       --------  --------------------------------
         0050    LGetTempC$sloc0$1$0

    [and so on ..]
         0126    Ltima_setup_channel$sloc0$1$0
    [and some more]

    how is it possible to use the direct addressing mode in the following .rst-line?

      AADD 55 26               460         ldhx    *_tima_setup_channel_sloc0_1_0

    is this a bug or didn't i understand something right? upper byte is completly missing (of course), so in the end ldhx loads something from a wrong adress, or am i wrong?
    maybe solution would be to remove all the sloc's from the direct page 0x00-0xFF to free spacec there. how can i do that? already tryed --nogcse with no result.
    the last solution i know is to use --stack-auto, so direct page is nearly empty. not very nice, is there a better way around this?

    thank you for your help,
    bye kosmo

    • Maarten Brock

      Maarten Brock - 2006-06-08

      Are you sure it's not

      ldhx #_time...

      That's IMMediate addressing, not direct.

    • kosmonaut_pirx

      kosmonaut_pirx - 2006-06-08

      yes, i am.
      opcode is 55, which means direct mode. it seems too easy, that's why i'm not sure if i understand something wrong in ram adressing instead.