#53 omit lcall _main sjmp .

closed
None
1
2004-06-03
2004-01-09
No

Currently SDCC inserts a call to main
and depending on the option --main-return
an sjmp or a ret.

For most embedded applications this just
means an overhead of some bytes in code space
and 2 bytes of lost idata (stack) memory.

(Couldn't the call be simply omitted if
there was an option --main-lock for the
regression tests?)

__sdcc_program_startup:
lcall _main
; return from main will lock up
sjmp .
;------------------------------------------------------------
;tst.c:9: main()
; -----------------------------------------
; function main
; -----------------------------------------
_main:
ar2 = 0x02
ar3 = 0x03

Discussion

  • Maarten Brock

    Maarten Brock - 2004-06-03
    • status: open --> closed
     
  • Maarten Brock

    Maarten Brock - 2004-06-03
    • assigned_to: nobody --> frief
     
  • Maarten Brock

    Maarten Brock - 2004-06-03

    Logged In: YES
    user_id=888171

    Implemented by frief in src/SDCCglue.c 1.169

     

Log in to post a comment.