How do I get completed assembly code generated by sdcc for hc08?

2013-11-28
2013-11-29
  • hello,

    I need to disassembly from the S-record generated by sdcc.

    When I run makefile, this generates main.s19, main.asm and other files but
    those file don't contain complete assembly code.

    I build sdcc from its source code and its version is:

    sdcc -v
    SDCC : mcs51/gbz80/z80/z180/r2k/ds390/pic16/pic14/TININative/ds400/hc08 3.1.0 #7066 (Nov 27 2013) (Linux)
    

    Makefile is:

    CSRS=main.c
    
    OBJS=$(CSRS:.c=.rel)
    
    CFLAGS = --verbose -mhc08 --std-c99 --model-small
    
    LDFLAGS = --data-loc 0x0060 \
          --iram-size 0x009f \
          --xram-size 0x03c1 \
          --stack-loc 0x045f \
          --code-loc 0x0860 --code-size 0x0400 \
          --verbose 
    
    all: $(OBJS)
        sdcc $(CFLAGS) $(LDFLAGS) $(OBJS)
    
    $(OBJS): %.rel: %.c
        sdcc $(CFLAGS) $(LDFLAGS) -c $<
    
    clean:
        ls | grep -v "\.*.[c|h]$$" | grep -v "Makefile" | xargs rm -f
    
    main.c file code is:
    
    
    #include <mc68hc908apxx.h>
    
    #include <stdlib.h>
    #include <string.h>
    
    void
    main(void){
        char *c=(char*)malloc(20*sizeof(char));
    
        strncpy(c, "hello world!", 12);
    
        while(1){
            }
    }
    

    Thank You.

    fernando

     
    Last edit: fernando rafael filipuzzi 2013-11-28
  • Maarten Brock
    Maarten Brock
    2013-11-29

    SDCC cannot generate an assembly output of all linked objects.

    It generates a .map file which tells you which objects were linked. You can look in the assembly files for those objects to see what's in there. The linker can even generate .rst files with the addresses filled in for objects that did not come from a library.

    Maarten