Hi Folks !
 
I downloaded of latest version of SDCC compiler.
I have a problem.
 
I want generate two pulses of chip-select of signal Read(RD), but the compiler optimize the code generated
resulting only one chip-select.
 
The code in main.c file is this:
 
    // Read two times and generate chip-select
    unsigned char far *PtrLatch;
   
    PtrLatch = 0x4003;
    byTensaoLida = *PtrLatch;//first red
    byTensaoLida = *PtrLatch;//second read
 
The code generated in main.lst file is this:
   003E                     295 00104$:
                            296 ;       main.c 28
   003E 75*00 03            297         mov     _PtrLatch,#0x03
   0041 75*01 40            298         mov     (_PtrLatch + 1),#0x40
                            299 ;       main.c 29
   0044 75 82 03            300         mov     dpl,#0x03
   0047 75 83 40            301         mov     dph,#0x40
   004A E0                  302         movx    a,@dptr
   004B F5*00               303         mov     _byTensaoLida,a
                            304 ;       main.c 33
   004D 85*00 82            305         mov     dpl,_byTensaoLida
Note, there is only one read
   004A E0                  302         movx    a,@dptr
How can I disable this optimization in the compiler ?
  
Thanks in advance
 
Alexandre Guglielmi