Debugging assembly

Nov 24, 2005 16 Replies

Hi all, I'm writing some routine for a Motorola 68HC11, but it seems that debugging the code in assembler is a little bit difficult !! Please, what software do U suggest me to simplify this job ??



Assembling the code with asmhc11.exe give me back many errors, but not what this error are and where thery are !! Is there a way to know it ??



Thank U



Ric



I take it you cannot get the program to assemble, debugging is normaly the phase after you have got the program assembled, you need to take each error 1 at a time starting from the top. 1 mistake can cause multiple error messages to be generated so it's not as bad as it first appears. Your assembler should tell you what the error is and what line it appears on fix all the obvious ones first.

Uhm, ok well, but the assembler don't seems to like this way ;-) and tells me just the number of errors :-((

If your assembler only tells you the number of errors and not what the errors are, you need a new/different assembler.

James T. White

As is so often the case, the answer may be to RTFM. Look there for command line options that control the assembler's error output.

-- ======================================================================== Michael Kesti | "And like, one and one don't make | two, one and one make one." mrkesti at comcast dot net | - The Who, Bargain

try to generate the .lst file (or whatever it is for MOT) and find out from there the details of the error(s) rw

Many assemblers provide you with listing files (.lst) that contain the errorneous lines of the assembly program. When you run the assembler for you code file, check if a similarly named .lst file appears in the directory. This file usually contains the errors. Also, there might be a command-line option to enable/disable the listing-file generation. The answer is to RTFM, like someone so oftly put :)

- Antti Keskinen

Ditch assembly, get yourself a good C compiler.

Dan

OK, thanks all, I'll try some option of my assembler !!

Sorry but...what does RTFM means ??

formatting link

-- ======================================================================== Michael Kesti | "And like, one and one don't make | two, one and one make one." mrkesti at comcast dot net | - The Who, Bargain

Bad advice, that's just assembly with a different set of mnemonics ;-)

And a whole extra bunch or errors to make.

Ian

While assembly might not be a cost effective tool for implementing large (more than a few kilobytes) systems, understanding of assembly/disassembly at least at a rudimentary level is essential for working with embedded systems.

Paul

No, I've worked with embedded systems for 25 years now, and whereas I had to learn the assembler in the earlier days, everything is in C now. It's still not totally portable, because of the closeness to the hardware and its vagaries, but I'm supporting four processors at the moment, and most of the time I couldn't care which is which.

You only really need assembler if you've underestimated the processor capacity, or you have to support someone else's system, or you're writing the compiler.

Paul Burke

Or if you want to write in C but want to get the most out of size/performance. In such cases I frequently check the generated assembly from the compiler.

Meindert

Thanks All, I've RTFM and solved many problems (one of the problems was that I didn't have the manual !!)...now searching for the complete list of the assembler error codes ...

I noticed in the 1970's that I could not consistently beat the RSX-11 Fortran IV+ compiler by manually translating the modules one by one into assembly. Of course if I used e.g. global register assignment, which the compiler did not know anything about, I could write much better code.

Anyhow, a person working with embedded systems should have a clear view of what each C/C++ construction will cost in terms of code space and execution time. Writing an ISR routine entry/exit code as well as any debugging would still require some understanding of the assembly language for that platform.

Paul

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required