Generated assembly language listings, was: Re: What is the draw of VMS?
- From: Simon Clubley <clubley@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 26 Jun 2012 12:05:00 +0000 (UTC)
On 2012-06-25, Richard B. Gilbert <rgilbert88@xxxxxxxxxxx> wrote:
On 6/25/2012 9:51 AM, Bob Koehler wrote:
In article <4fe74d84$0$1688$c3e8da3$f017e9df@xxxxxxxxxxxxxxxxx>, JF Mezei <jfmezei.spamnot@xxxxxxxxxxxxx> writes:
Personally I found the Assembler 370 course at university to be
extremely good because it tought me how computers work at a low level so
that I can understand how high level languages work. (There was also the
computer achitecture which went down to and/or/nan/nor gates and how
they can be assembled to build a caculator etc).
I can recall many times, when trying to learn and understand C, that
I used /list/machine_code to figure out WTF it was up to.
If you need to use /LIST /MACHINE_CODE to understand a program written
in C, I would suspect that that author was a poor programmer!
There are times, at least in embedded work, when this is a perfectly valid
thing to want to do. Two personal examples:
1) A project I built (using a 8 bit AVR) generates about 10,000 interrupts
per second in total when in full flow. (This consists of a high rate
interrupt source plus a lower rate source of upto several hundred interrupts
per second.) Both interrupts are used to drive state machines written in C.
The clock crystal was originally a 9.8304MHz crystal which gave me a
budget of 1024 clock cycles per event for the high rate source (a timer).
I also had to allow for the time consumed by the low rate interrupt source
triggering at the same time as well.
Given these constraints, I used the assembly listings to explore how
different C language constructs and ways of accessing data were
translated from C into assembly language and used this knowledge to
produce more efficient state machines which met my timing constraints.
2) On a specific 32 bit ARM board I was using, all register accesses MUST
be in units of 32 bits and aligned on the register boundary.
I discovered that certain C constructs, while perfectly valid C, were
resulting in byte level accesses to the registers. For normal memory
accesses, this is not a problem (other than performance). In these cases
however (this has happened twice to me), this would have resulted in
non-functioning code.
I found both cases during development before testing, because I have
a habit of giving the generated code a quick once over just to make
sure I not done something to generate hopelessly inefficient or
invalid code when I need to operate under these types of constraints.
Simon.
--
Simon Clubley, clubley@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Microsoft: Bringing you 1980s technology to a 21st century world
.
- Follow-Ups:
- References:
- Re: What is the draw of VMS?
- From: Bob Koehler
- Re: What is the draw of VMS?
- From: Paul Sture
- Re: What is the draw of VMS?
- From: Marc Van Dyck
- Re: What is the draw of VMS?
- From: Stephen Hoffman
- Re: What is the draw of VMS?
- From: Marc Van Dyck
- Re: What is the draw of VMS?
- From: Stephen Hoffman
- Re: What is the draw of VMS?
- From: David Froble
- Re: What is the draw of VMS?
- From: Stephen Hoffman
- Re: What is the draw of VMS?
- From: JF Mezei
- Re: What is the draw of VMS?
- From: Bob Koehler
- Re: What is the draw of VMS?
- From: Richard B. Gilbert
- Re: What is the draw of VMS?
- Prev by Date: Re: [OT] Unix environment tables, was: Re: What is the draw of VMS?
- Next by Date: Re: [OT] Unix environment tables, was: Re: What is the draw of VMS?
- Previous by thread: Re: What is the draw of VMS?
- Next by thread: Re: Generated assembly language listings, was: Re: What is the draw of VMS?
- Index(es):