 | Discussion Forum |  |
|
|
DW8051 MPAGE regNext Thread | Thread List | Previous Thread Start a Thread | Settings | Details | Message |
|---|
Read-Only Author Henrik Holm Posted 14-Mar-2001 15:01 GMT Toolset C51 |  DW8051 MPAGE reg Henrik Holm Hi, The Synopsis DW8051 core uses a MPAGE sfr reg at 0x92 hex instead of the standard P2 register when accessing data with MOVX etc. Do Keil support this register? If so what do I do to enable it?
Regards
Henrik | | Read-Only Author Jon Ward Posted 14-Mar-2001 16:58 GMT Toolset C51 |  RE: DW8051 MPAGE reg Jon Ward From the documentation that I have, it appears that the MPAGE register is only used if you do not include a P2 module in your Synopsis design.
The MPAGE register provides the upper 8 bits for:
movx a, @r0/@r1
movx @r0/@r1, a
In the C51 compiler, these instructions are used only in the COMPACT memory model (for PDATA variables).
In the startup code, there is a section where you may set the value of P2 for all PDATA operations. Change this code to set the value in the MPAGE register.
Jon
| | Read-Only Author Andrew Neil Posted 14-Mar-2001 20:24 GMT Toolset C51 |  RE: DW8051 MPAGE reg Andrew Neil "In the C51 compiler, these instructions are used only in the COMPACT memory model (for PDATA variables)."
Incorrect: the compiler must always use these instructions for any reference to PDATA - that's what PDATA means!
The effect of the COMPACT memory model is simply to make PDATA the default - you can still explicitly define a variable to be in PDATA in any memory model you want (in fact, some contributors will urge that you should always do so!)
| | Read-Only Author Jon Ward Posted 14-Mar-2001 21:02 GMT Toolset C51 |  RE: DW8051 MPAGE reg Jon Ward Good point. Thanks for clarifying that.
What I meant was that MPAGE is only used when you use PDATA variables. PDATA is the default memory space in COMPACT model.
:-)
Jon | |
Next Thread | Thread List | Previous Thread Start a Thread | Settings |
|