This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Dallas contiguous mode : two doubts

Hi,

I have the following two doubts:

1)
When should I use Dallas contiguous mode:512k vs Dallas contiguous mode: 16M ?
512k is enough for me but I do not know if I get some advantages with 16M mode!?

2)
How to locate all functions in a file to a specific location: example 102H?
filename: ulm.c

Thanks
joao

Parents
  • First thanks for your comments.
    I now understand that I need to study carefully:)

    I have tested with the following code:

    char far a _at_ 0x12000L;
    char xdata b;
    
    char farfunc(void)
    {
        return a+b;
    }
    
    void main(void)
    {
        farfunc();
        while(1);
    }
    

    The farfunc is located at 0x010000

    On 512k mode the assembler is:
    ; FUNCTION farfunc (BEGIN)
                                               ; SOURCE LINE # 6
                                               ; SOURCE LINE # 7
                                               ; SOURCE LINE # 9
    0000 90000000    R     MOV     DPTR,#b
    0004 E0                MOVX    A,@DPTR
    0005 FF                MOV     R7,A
    0006 90000000    R     MOV     DPTR,#a
    000A E0                MOVX    A,@DPTR
    000B FE                MOV     R6,A
    000C EF                MOV     A,R7
    000D 2E                ADD     A,R6
    000E FF                MOV     R7,A
                                               ; SOURCE LINE # 10
    000F         ?C0001:
    000F 22                RET
                 ; FUNCTION farfunc (END)
    
                 ; FUNCTION main (BEGIN)
                                               ; SOURCE LINE # 13
                                               ; SOURCE LINE # 14
                                               ; SOURCE LINE # 15
    0000 110000      R     ACALL   farfunc
    0003         ?C0002:
                                               ; SOURCE LINE # 16
    0003 80FE              SJMP    ?C0002
                 ; FUNCTION main (END)
    

    MOVX DPTR are always 4 bytes(XDATA and HDATA) and the compiler uses ACALL(19 bit addr) - 3 bytes.

    On 16M mode the assembler is:
    ; FUNCTION farfunc (BEGIN)
                                               ; SOURCE LINE # 6
                                               ; SOURCE LINE # 7
                                               ; SOURCE LINE # 9
    0000 90000000    R     MOV     DPTR,#b
    0004 E0                MOVX    A,@DPTR
    0005 FF                MOV     R7,A
    0006 90000000    R     MOV     DPTR,#a
    000A E0                MOVX    A,@DPTR
    000B FE                MOV     R6,A
    000C EF                MOV     A,R7
    000D 2E                ADD     A,R6
    000E FF                MOV     R7,A
                                               ; SOURCE LINE # 10
    000F         ?C0001:
    000F 22                RET
                 ; FUNCTION farfunc (END)
    
                 ; FUNCTION main (BEGIN)
                                               ; SOURCE LINE # 13
                                               ; SOURCE LINE # 14
                                               ; SOURCE LINE # 15
    0000 12000000    R     LCALL   farfunc
    0004         ?C0002:
                                               ; SOURCE LINE # 16
    0004 80FE              SJMP    ?C0002
                 ; FUNCTION main (END)
    
    MOVX DPTR are still 4 bytes(XDATA and HDATA) and the compiler uses LCALL(24 bit addr) - 4 bytes.

    No paging for data access.
    In conclusion I must always configure the DS5250 for 24-bit contiguous mode.


    Just on note from the assembler: it seems that is generating one unnecessary MOV operation on the farfunc but this is another story.

    Thanks for all your comments.
    My biggest problem is that the projects timmings are really small so there is phew time for first understanding what really is going on!

    Joao

Reply
  • First thanks for your comments.
    I now understand that I need to study carefully:)

    I have tested with the following code:

    char far a _at_ 0x12000L;
    char xdata b;
    
    char farfunc(void)
    {
        return a+b;
    }
    
    void main(void)
    {
        farfunc();
        while(1);
    }
    

    The farfunc is located at 0x010000

    On 512k mode the assembler is:
    ; FUNCTION farfunc (BEGIN)
                                               ; SOURCE LINE # 6
                                               ; SOURCE LINE # 7
                                               ; SOURCE LINE # 9
    0000 90000000    R     MOV     DPTR,#b
    0004 E0                MOVX    A,@DPTR
    0005 FF                MOV     R7,A
    0006 90000000    R     MOV     DPTR,#a
    000A E0                MOVX    A,@DPTR
    000B FE                MOV     R6,A
    000C EF                MOV     A,R7
    000D 2E                ADD     A,R6
    000E FF                MOV     R7,A
                                               ; SOURCE LINE # 10
    000F         ?C0001:
    000F 22                RET
                 ; FUNCTION farfunc (END)
    
                 ; FUNCTION main (BEGIN)
                                               ; SOURCE LINE # 13
                                               ; SOURCE LINE # 14
                                               ; SOURCE LINE # 15
    0000 110000      R     ACALL   farfunc
    0003         ?C0002:
                                               ; SOURCE LINE # 16
    0003 80FE              SJMP    ?C0002
                 ; FUNCTION main (END)
    

    MOVX DPTR are always 4 bytes(XDATA and HDATA) and the compiler uses ACALL(19 bit addr) - 3 bytes.

    On 16M mode the assembler is:
    ; FUNCTION farfunc (BEGIN)
                                               ; SOURCE LINE # 6
                                               ; SOURCE LINE # 7
                                               ; SOURCE LINE # 9
    0000 90000000    R     MOV     DPTR,#b
    0004 E0                MOVX    A,@DPTR
    0005 FF                MOV     R7,A
    0006 90000000    R     MOV     DPTR,#a
    000A E0                MOVX    A,@DPTR
    000B FE                MOV     R6,A
    000C EF                MOV     A,R7
    000D 2E                ADD     A,R6
    000E FF                MOV     R7,A
                                               ; SOURCE LINE # 10
    000F         ?C0001:
    000F 22                RET
                 ; FUNCTION farfunc (END)
    
                 ; FUNCTION main (BEGIN)
                                               ; SOURCE LINE # 13
                                               ; SOURCE LINE # 14
                                               ; SOURCE LINE # 15
    0000 12000000    R     LCALL   farfunc
    0004         ?C0002:
                                               ; SOURCE LINE # 16
    0004 80FE              SJMP    ?C0002
                 ; FUNCTION main (END)
    
    MOVX DPTR are still 4 bytes(XDATA and HDATA) and the compiler uses LCALL(24 bit addr) - 4 bytes.

    No paging for data access.
    In conclusion I must always configure the DS5250 for 24-bit contiguous mode.


    Just on note from the assembler: it seems that is generating one unnecessary MOV operation on the farfunc but this is another story.

    Thanks for all your comments.
    My biggest problem is that the projects timmings are really small so there is phew time for first understanding what really is going on!

    Joao

Children
No data