Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/20/03 20:00
Read: times


 
#46162 - SDCC, large mem model, code inefficiency
I have this function:

void telnet() {
unsigned char message[] = { "Welcomen" };
...
...
...
...
}

once compiled by SDCC, using large memory model, with code-loc 0x8000 and xram-loc 0xc000 the ASM generated for this local variable is:

_telnet:
; telnet.c 9
mov dptr,#_telnet_message_1_1
mov a,#0x57
movx @dptr,a
mov dptr,#(_telnet_message_1_1 + 0x0001)
mov a,#0x65
movx @dptr,a
mov dptr,#(_telnet_message_1_1 + 0x0002)
mov a,#0x6C
movx @dptr,a
mov dptr,#(_telnet_message_1_1 + 0x0003)
mov a,#0x63
movx @dptr,a
mov dptr,#(_telnet_message_1_1 + 0x0004)
mov a,#0x6F
movx @dptr,a
mov dptr,#(_telnet_message_1_1 + 0x0005)
mov a,#0x6D
movx @dptr,a
mov dptr,#(_telnet_message_1_1 + 0x0006)
mov a,#0x65
movx @dptr,a

This is atrocious. At the very least, it should just increment DPTR, rather than reload DPTR each time. What I don't understand is, why does it not use an .ascii or .asciz assembler directive? So what I need to know is, how do I alter SDCC's behavior? I have generated code before with SDCC, that placed (const char) arrays in memory with the .asciz directive. This was using small memory model, though.

thanks

List of 8 messages in thread
TopicAuthorDate
SDCC, large mem model, code inefficiency            01/01/70 00:00      
   RE: SDCC, large mem model, code inefficiency            01/01/70 00:00      
   RE: SDCC, large mem model, code inefficiency            01/01/70 00:00      
      RE: SDCC, large mem model, code inefficiency            01/01/70 00:00      
      RE: SDCC, large mem model, code inefficiency            01/01/70 00:00      
   RE: Compiler hacking? VFM?            01/01/70 00:00      
   RE: SDCC, large mem model, code inefficiency            01/01/70 00:00      
   Thanks for all the responses...            01/01/70 00:00      

Back to Subject List