Keil Logo

µVISION DEBUGGER: DEBUGGING A51 MPL MACROS


Information in this article applies to:

  • C51 Version 6.23

QUESTION

I have a assembler modules that use MPL MACROs. In previous versions of C51 (before 6.23) the µVision Debugger did not synchronize with the source code at all. This problem seems to be fixed in Version 6.23. However, I'm still unable to set breakpoints at the MPL macro itself. Is there some trick?

ANSWER

MPL macros are an historic feature of the 8051 assembler. They were initally implemented in the Intel ASM51 Assembler and we have added them to the Keil A51 Assembler. At the time MPL macros were developed, debug tools did not support source-level debugging. Therefore, the concept of the MPL macro processor did not correctly handle problems that arise when you want synchronization between source code and the generated object files.

The Keil A51 Assembler (starting with C51 Version 6.23) implements proper line number synchronisation for assembler files that contain MPL macros. It is possible to set breakpoints on the MPL macro when the first assembler instruction of the macro is in the same line as the %define statement of the MPL macro language. For example:

$MPL

; First MPL macro line does not start with code
%*define (ldxdata1 (Var))

   mov dptr,#%Var
   movx a,@dptr
)

; First MPL macro line contains assembler instructions
%*define (ldxdata2 (Var)) ( mov dptr,#%Var
   movx a,@dptr
)

?XD?mplmac segment xdata
rseg ?XD?mplmac
Var1:   DS 1
Var2:   DS 1

?PR?mplmac SEGMENT CODE
RSEG ?PR?mplmac

   %ldxdata1(Var1)  ; no code at macro begin
                    ; -> no break information at source level
   MOV  R6,A
   %ldxdata2(Var2)  ; code at macro begin
                    ; -> breaks at source level possible
   MOV  R7,A
   ret

   end

CONCLUSION

The µVision debugger supports source-level debugging for code that was initally written for Intel ASM51. However, you must have an assembler instruction in the same line as the MPL %define statement.

FORUM THREADS

The following Discussion Forum threads may provide information related to this topic.

Last Reviewed: Friday, July 9, 2004


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.