Assembly Language Input File Format

Showing results for 
Show  only  | Search instead for 
Did you mean: 

Assembly Language Input File Format

Contributor II

IDE:  MCUXpresso IDE v11.0.0 [Build 2516] [2019-06-05]

OS:  Linux (KDE)

Processor:  LPC1754

Libraries:  CMSIS_CORE_LPC17xx

I'm having a hard time debugging some inline assembly I've written. I'm competent writing assembly language and this code is just being ported over from a different LPC processor (I wrote that code years ago).  The assembly code is currently written as inline and is about 4 pages long.

The issue I'm having is the MCUxpresso disassembly view is getting lost after a page or so of assembly instruction stepping and a long jump.  This used to work perfectly back in the Code Red days.

I'm thinking moving the code to its own file might help the debugger keep track of things.

The problem is I'm having a hard time finding out what the current required format is for the file (and is it .s, .a, .asm. ?).  I've tried saving temporaries but but the .s file has a ton of debug stuff in it.  I need to know what the format for a hand written input file looks like.  I used to be pretty simple, a short header and then the assembly code.

Also, if there's a way to get the debugger to stay in sync with the program counter, that would help a lot too.

0 Kudos
1 Reply

Contributor II

I've found a default file format that works and am porting to that now.  Still, if anyone knows how to keep the debugger in sync with the PC while instruction stepping past long jumps, let me know.


File format for .asm file (I'm not sure if all the header is needed, but it does work):


.syntax unified

.align 2
.section .text

.global __MyFunction
.type __MyFunction, %function

   push {lr} // save return address


   do stuff here, passed arguments are in r0-r4

   place returned data in r0

   pop {pc}   // return from call


0 Kudos