Assembly Language Input File Format

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Assembly Language Input File Format

702 次查看
jerrydurand
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.

标记 (2)
0 项奖励
1 回复

620 次查看
jerrydurand
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.

Thanks.

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

[code]

.syntax unified
.text

.align 2
.section .text

.global __MyFunction
.func
.thumb_func
.type __MyFunction, %function

__MyFunction:
   push {lr} // save return address

   

   do stuff here, passed arguments are in r0-r4

   place returned data in r0

   pop {pc}   // return from call

[/code]

0 项奖励