Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] Re: ARM halfword bugs?

2006-03-29 by Peter Jakacki

This bit of assembler code is a very simple "quick & dirty" routine as 
far as assembler goes. I don't have any problem coding in ARM assembler 
or any assembler for that matter. My problem is not with the routine 
otherwise I would not have posted.

I have been having a sneaking suspicion that there is a bug elsewhere 
(silicon?) when performing halfword accesses in ARM mode, that's what 
the original post was about, not any difficulty with assembler. All my 
assembly is done in pure ARM mode as I am never going to run out of code 
space and crippling the code just to save a few bytes seems pointless.

When I have a bit more time to spare I will thoroughly exercise the chip 
in halfword mode and try and find what is happening.

As for C programming a great deal of the threads on this group seem to 
stem from problems with the compiler not doing what you would expect it 
to. I don't have that problem, assembler is assembler and I can see 
every instruction.


Hiho Hiho, back to coding we go.

*Peter*


brendanmurphy37 wrote:
> Jerome/Peter,
>
> I think the example below is a very good illustration of why it's 
> best not to bother with assembler at all, if you can avoid it.
>
> Unless you're doing something very unusual, you can get away with 
> less than about fifty lines of assembler. All you need is:
>
> - interrupt vector table and startup (to setup stacks)
> - IRQ interrupt dispatch stub (there's been a couple of very good 
> examples of this posted here recently)
> - maybe a pair of functions to disable/re-enable interrupts
>
> Everything else can be in 'C', including the basic environment setup 
> (e.g. copying initialised data, zeroing uninitialised data etc.; PLL 
> setup, VIC, MAM setup, peripheral interrupt handlers etc. etc.).
>
> Note that the assembler code mentioned above will typically suit for 
> every system you're working on (i.e. is done once), and can typically 
> be found elsewhere (here for example). 
>
> RISC and RISC-like architectures are very much designed around the 
> ideas of utilising optimising compilers to make use of the simplified 
> instruction sets, rather than human programmers.
>
> You need some expertise to be able to understand ARM assembler 
> (mainly an ability to lookup and understand the "ARM ARM" book), and 
> modify it if necessary, but my guess is that there are very few ARM 
> (or MIPS or other RISC) assembler "experts" out there, and certainly 
> no need to become one.
>
> All this is just an opinion, though!
>
> Brendan

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.