Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Learning ARM assembler...
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 51 - 75 of 116 - Collapse all  -  Translate all to Translated (View all originals) < Older  Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
Terje Slettebø  
View profile   Translate to Translated (View Original)
 More options 16 Oct, 08:01
Newsgroups: comp.sys.acorn.programmer
From: Terje Slettebø <tslett...@gmail.com>
Date: Fri, 16 Oct 2009 00:01:38 -0700 (PDT)
Local: Fri 16 Oct 2009 08:01
Subject: Re: Learning ARM assembler...
On 15 Okt, 14:50, Rodolph Perfetta <rodolph.perfe...@arm.com> wrote:

You're right. ARM has also confirmed this (I asked them).

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rob Kendrick  
View profile   Translate to Translated (View Original)
 More options 16 Oct, 09:18
Newsgroups: comp.sys.acorn.programmer
From: Rob Kendrick <n...@rjek.com>
Date: Fri, 16 Oct 2009 09:18:35 +0100
Local: Fri 16 Oct 2009 09:18
Subject: Re: Learning ARM assembler...
On Thu, 15 Oct 2009 13:50:54 +0100

Rodolph Perfetta <rodolph.perfe...@arm.com> wrote:
> A9 has a VFP implementation optimised for speed and is a lot
> faster.

Although I make the habit of not believing the performance claims of
ARM CPUs until they're in production :)

B.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jake Waskett  
View profile   Translate to Translated (View Original)
 More options 16 Oct, 10:04
Newsgroups: comp.sys.acorn.programmer
From: Jake Waskett <j...@waskett.org>
Date: Fri, 16 Oct 2009 09:04:15 GMT
Local: Fri 16 Oct 2009 10:04
Subject: Re: Learning ARM assembler...

Yes, I looked into this about six months ago.  As I recall, it's SWI 0x0 -
the same as OS_WriteC.  I guess it would be possible to set an internal
flag when loading non-RO apps, but it could be messy.  Anyway I'm not sure
how much of an advantage there would be in running POSIX-type apps on RISC
OS: RO is a great platform, but it isn't designed to be a POSIX platform,
and is weak in that respect.  It seems to me that improving the
performance of RISC OS "SWI"s would be far more beneficial than emulation
layers for running code written for other platforms.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rob Kendrick  
View profile   Translate to Translated (View Original)
 More options 16 Oct, 10:52
Newsgroups: comp.sys.acorn.programmer
From: Rob Kendrick <n...@rjek.com>
Date: Fri, 16 Oct 2009 10:52:32 +0100
Local: Fri 16 Oct 2009 10:52
Subject: Re: Learning ARM assembler...
On Fri, 16 Oct 2009 09:04:15 GMT

Jake Waskett <j...@waskett.org> wrote:
> > Code from other EABI platforms.  In the same way Linux and RISC iX
> > have RISC OS personalities.  There is a standard SWI number used
> > for EABI, and a looser standard for different UNIX-flavoured system
> > calls.  

> Yes, I looked into this about six months ago.  As I recall, it's SWI
> 0x0 - the same as OS_WriteC.  I guess it would be possible to set an
> internal flag when loading non-RO apps, but it could be messy.

Not as messy as the rest of the state that the WIMP stores on each
process already.

> Anyway I'm not sure how much of an advantage there would be in
> running POSIX-type apps on RISC OS: RO is a great platform, but it
> isn't designed to be a POSIX platform, and is weak in that respect.

Well, there's plenty of value of running POSIX applications under RISC
OS.  Look at Firefox and NetSurf (which is POSIX) for examples.

There have been efforts in the past to allow running of ARM Linux
binaries directly under RISC OS, and it worked after a fashion.  (A
module that provided Linux's OABI syscall interface via SWI)

> It seems to me that improving the performance of RISC OS "SWI"s would
> be far more beneficial than emulation layers for running code written
> for other platforms.

But it's not possible to do and get an advantage, unless you want to
throw away all your existing software.

B.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ron  
View profile   Translate to Translated (View Original)
 More options 16 Oct, 11:25
Newsgroups: comp.sys.acorn.programmer
From: Ron <b...@woosh.co.nz>
Date: Fri, 16 Oct 2009 23:25:09 +1300
Local: Fri 16 Oct 2009 11:25
Subject: Re: Learning ARM assembler...
In message <gemini.krgxo3001qq0m033c.s...@softrock.co.uk>
          Vince M Hudd <s...@softrock.co.uk> wrote:

> Gazza <use...@garethlock.com> wrote:
> > On Oct 11, 6:20 pm, Chris Johnson <chrisjohnson+n...@spamcop.net> wrote:

> > > Get the Archive DVD and all this will be at your finger tips at the
> > > click of a mouse. The HTML version has full (live) indexes and cross
> > > references.

> > This sounds like the best way to go then... I guess the next question is
> > where to get this DVD and how much do I have to fork out?

> http://www.archivemag.co.uk

I have just found a history of ARM from Acorn through to Arm9
in year 2000.

http://www.realworldtech.com/page.cfm?ArticleID=RWT110900000000&p=1

Real World Technologies - ARM's Race to Embedded World Domination
by Paul DeMone

Cheers  Ron M


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jake Waskett  
View profile   Translate to Translated (View Original)
 More options 16 Oct, 14:26
Newsgroups: comp.sys.acorn.programmer
From: Jake Waskett <j...@waskett.org>
Date: Fri, 16 Oct 2009 13:26:39 GMT
Local: Fri 16 Oct 2009 14:26
Subject: Re: Learning ARM assembler...

On Fri, 16 Oct 2009 10:52:32 +0100, Rob Kendrick wrote:
> On Fri, 16 Oct 2009 09:04:15 GMT
> Jake Waskett <j...@waskett.org> wrote:

>> > Code from other EABI platforms.  In the same way Linux and RISC iX
>> > have RISC OS personalities.  There is a standard SWI number used for
>> > EABI, and a looser standard for different UNIX-flavoured system
>> > calls.

>> Yes, I looked into this about six months ago.  As I recall, it's SWI
>> 0x0 - the same as OS_WriteC.  I guess it would be possible to set an
>> internal flag when loading non-RO apps, but it could be messy.

> Not as messy as the rest of the state that the WIMP stores on each
> process already.

Fair point. :-)

>> It seems to me that improving the performance of RISC OS "SWI"s would
>> be far more beneficial than emulation layers for running code written
>> for other platforms.

> But it's not possible to do and get an advantage, unless you want to
> throw away all your existing software.

I'm not sure if that's true.  I've outlined a system that would work (I
reckon), but can't be sure without testing whether it would offer a
performance advantage or not.  My guess is that although it would cost an
extra 5 or so instructions per "SWI", the improved d-cache behaviour would
lead to a small overall gain in performance.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Terje Slettebø  
View profile   Translate to Translated (View Original)
 More options 16 Oct, 22:06
Newsgroups: comp.sys.acorn.programmer
From: Terje Slettebø <tslett...@gmail.com>
Date: Fri, 16 Oct 2009 14:06:45 -0700 (PDT)
Local: Fri 16 Oct 2009 22:06
Subject: Re: Learning ARM assembler...
Just a quick comment to this earlier posting:

On 14 Okt, 00:36, Rob Kendrick <n...@rjek.com> wrote:

> On Tue, 13 Oct 2009 15:12:36 -0700 (PDT)
> But by ARMv9, we'll have something more CISCy than x86.  No,
> seriously.  It's dangerously close to that complex now.  We already get
> to deal with the joys of remembering which instructions can be
> conditionally executed, and which only work on even-numbered registers,
> which operate on which halves of words, etc etc.

> ARM is no longer elegant.  ARM is now a CPU designed for performance,
> and not for the joy of the programmer.

A few days ago, I saw a great interview with Steve Furber, one of the
people behind the development of the ARM processor (http://
www.computinghistory.org.uk/det/5438/Steve-Furber-Interview-17-08-2009/),
and it's quite clear that two of the aims behind the ARM processor was
performance, and low interrupt latency.

It may be argued that these things are still driving the design, in
particular performance/Watt.

In other words, the "joy of the programmer" doesn't appear to have
been a design aim, and in fact, RISC processors have tended to be more
difficult to program in assembly than CISC processors, due to it
typically requiring more instructions to perform a task, compared to
the CISC version.

Fortunately, the ARM marries the easy to program part with
performance, but my point is that it appears they are still following
the original aims, even if it has lead to a drastically more complex
processor (especially due to all the specialised SIMD, etc.
instructions).

Anyway, what is elegant is subjective, and I still find ARM overall to
be an elegant processor (in particular with regard to other mainstream
processors), and SIMD/FP support are definitely useful additions.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rob Kendrick  
View profile   Translate to Translated (View Original)
 More options 17 Oct, 00:35
Newsgroups: comp.sys.acorn.programmer
From: Rob Kendrick <n...@rjek.com>
Date: Sat, 17 Oct 2009 00:35:31 +0100
Local: Sat 17 Oct 2009 00:35
Subject: Re: Learning ARM assembler...
On Fri, 16 Oct 2009 14:06:45 -0700 (PDT)

Terje Slettebø <tslett...@gmail.com> wrote:
> A few days ago, I saw a great interview with Steve Furber, one of the
> people behind the development of the ARM processor (http://
> www.computinghistory.org.uk/det/5438/Steve-Furber-Interview-17-08-2009/),
> and it's quite clear that two of the aims behind the ARM processor was
> performance, and low interrupt latency.

tbh, I had always assumed the main aim was to build something that
worked, and something cheap :)

> In other words, the "joy of the programmer" doesn't appear to have
> been a design aim, and in fact, RISC processors have tended to be more
> difficult to program in assembly than CISC processors, due to it
> typically requiring more instructions to perform a task, compared to
> the CISC version.

On the other hand, the instruction set was devised by a programmer who
loved the way 6502 worked.

> Anyway, what is elegant is subjective, and I still find ARM overall to
> be an elegant processor (in particular with regard to other mainstream
> processors), and SIMD/FP support are definitely useful additions.

You may also like PowerPC.

B.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Steve Fryatt  
View profile   Translate to Translated (View Original)
 More options 17 Oct, 01:51
Newsgroups: comp.sys.acorn.programmer
From: Steve Fryatt <n...@stevefryatt.org.uk>
Date: Sat, 17 Oct 2009 01:51:22 +0100
Local: Sat 17 Oct 2009 01:51
Subject: Re: Learning ARM assembler...

Rob Kendrick <n...@rjek.com> wrote:
> On Fri, 16 Oct 2009 14:06:45 -0700 (PDT) Terje Slettebø
> <tslett...@gmail.com> wrote:

> > A few days ago, I saw a great interview with Steve Furber, one of the
> > people behind the development of the ARM processor (http://

www.computinghistory.org.uk/det/5438/Steve-Furber-Interview-17-08-2009/),

> > and it's quite clear that two of the aims behind the ARM processor was
> > performance, and low interrupt latency.

> tbh, I had always assumed the main aim was to build something that worked,
> and something cheap :)

The interrupt latency issue is one that Steve seems to mention a lot in
these talks.  From memory (having heard a couple of his recent Acorn-group
talks), the problem was that they wanted to design the Archimedes (as it
became) using the same techniques as the Beeb.  The Beeb relied on
interrupts to operate, and Steve and Sophie found that the CISC processors
of the day were, in the worst case, simply not up to things like disc or
network access.

--
Steve Fryatt - Leeds, England

http://www.stevefryatt.org.uk/


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Terje Slettebø  
View profile   Translate to Translated (View Original)
 More options 17 Oct, 08:30
Newsgroups: comp.sys.acorn.programmer
From: Terje Slettebø <tslett...@gmail.com>
Date: Sat, 17 Oct 2009 00:30:58 -0700 (PDT)
Local: Sat 17 Oct 2009 08:30
Subject: Re: Learning ARM assembler...
On 17 Okt, 01:35, Rob Kendrick <n...@rjek.com> wrote:

> On Fri, 16 Oct 2009 14:06:45 -0700 (PDT)

> Terje Slettebø <tslett...@gmail.com> wrote:
> > A few days ago, I saw a great interview with Steve Furber, one of the
> > people behind the development of the ARM processor (http://
> >www.computinghistory.org.uk/det/5438/Steve-Furber-Interview-17-08-2009/),
> > and it's quite clear that two of the aims behind the ARM processor was
> > performance, and low interrupt latency.

> tbh, I had always assumed the main aim was to build something that
> worked, and something cheap :)

I assume you're joking, here, because of your earlier positive
comments on ARM, at least the earlier versions. :) Clearly, the
simplest would be to use an off-the-shelf processor, but they didn't
find any they were satisfied with, so they decided to try and make
their own.

In a way, I guess you can say that simplicity was part of the original
aim, because they were (intentionally) set up in such a way that they
had to keep the design very simple...

> > In other words, the "joy of the programmer" doesn't appear to have
> > been a design aim, and in fact, RISC processors have tended to be more
> > difficult to program in assembly than CISC processors, due to it
> > typically requiring more instructions to perform a task, compared to
> > the CISC version.

> On the other hand, the instruction set was devised by a programmer who
> loved the way 6502 worked.

Yes, and I found that a cute little processor, too (I did some
assembly programming for it on the BBC Micro).

Don't get me wrong: I like simplicity, as well. Just so you know where
I'm coming from, these are some of the things I in particular
appreciate about the ARM (which were even more unique at the time it
was released):

16 32-bit general-purpose registers
Three-register architecture
Conditional execution of every instruction
Optional updating of the PSR
Optional shift of one of the operands
32-bit instructions
Simple, yet complete instruction set

The extASM assembler (mentioned in an earlier message) auguments this,
by providing "auto-expansion", by increasing the range of operation of
each instruction, by automatically changing it, or substituting it
with several instructions, for example:

MOV R0,#&1234 -> MOV R0,#&34 : ORR R0,R0,#&1200
AND &FFFFFF -> BIC &FF000000
LDR R0,label_outside_range -> ADR R0, label_outside_range (auto-
expanded) : LDR R0,[R0]
etc.

This makes it possible to write assembly code with less concern for
the limitation of the instructions (although you should understand how
they are transformed, when needed, so that you don't inadvertantly
create inefficient code).

Now, some of the things in the above list don't quite hold, anymore,
namely:

Conditional execution of every instruction
Simple, yet complete instruction set

I'm no expert in microprocessor design, and maybe real-life use have a
need for 30 or so different variations of the multiply instruction, as
well as the plethora of other instructions in ARMv7, some of them
appearing to be very specialised.

I, too, prefer general facilities, compared to specialised features
and instructions (which is why I liked ARM so much when it came, and
why I disliked, and still do, the x86, with its abundance of special
cases and baggage from the past).

However, I also realise that for the ARM to be able to compete in its
market (or any market), it may need to acquire specialised or esoteric
features. I don't care much about Thumb, either (and it won't be
implemented in extASM), but I understand that in some segments of
their market, code desity is important (even if it reduces
performance), and it is, after all, their market.

I would have preferred that ARM focused more on performance, and less
on low power use, competing against processors like x86, rather than
aiming for the mobile market, which could have avoided quite a bit of
these things (such as Thumb). However, I also realise that they may
not have had much chance against giants like Intel in this market, and
it appears that going for the niche market of mobile and embedded
devices have been a winning move.

Since you're clearly not happy about the way the ARM processor has
evolved, let me ask you this: What would you have preferred that ARM
(the company) did differently, and would it have made business sense
(enabling them to survive and grow their business)?

> > Anyway, what is elegant is subjective, and I still find ARM overall to
> > be an elegant processor (in particular with regard to other mainstream
> > processors), and SIMD/FP support are definitely useful additions.

> You may also like PowerPC.

I don't know much about it (and finding an assembly code reference for
it online has proven difficult), but from what I remember, having
looked at it some in the past, I think it lacks quite a few of the
things that I like about ARM, as given in the above list.

Just to be clear: I like simplicity, elegance, and generality of
design just as much as you. It's just that the reality of the market
you're in will shape the design, and sometimes it may be difficult to
keep some of these things as a design evolves.

Case in point: As the number of instructions grew, it has apparently
been difficult to keep the feature of having all instructions
conditionally executable, and giving the choice between, say,
unconditional SIMD instructions, and no SIMD instructions at all, I
think the former makes sense as a choice.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Theo Markettos  
View profile   Translate to Translated (View Original)
 More options 17 Oct, 17:15
Newsgroups: comp.sys.acorn.programmer
From: Theo Markettos <theom+n...@chiark.greenend.org.uk>
Date: 17 Oct 2009 17:15:30 +0100 (BST)
Local: Sat 17 Oct 2009 17:15
Subject: Re: Learning ARM assembler...

Steve Fryatt <n...@stevefryatt.org.uk> wrote:
> The interrupt latency issue is one that Steve seems to mention a lot in
> these talks.  From memory (having heard a couple of his recent Acorn-group
> talks), the problem was that they wanted to design the Archimedes (as it
> became) using the same techniques as the Beeb.  The Beeb relied on
> interrupts to operate, and Steve and Sophie found that the CISC processors
> of the day were, in the worst case, simply not up to things like disc or
> network access.

It also allowed them to cut some corners on other hardware.  For example,
floppy controllers since the original IBM PC were designed for DMA.  They
don't have big buffers, but the idea is that they DMA the floppy data
straight into memory.  That means a DMA controller and some extra latches to
enable memory to be driven, which cost money (and potentially silicon area).

The Archimedes architecture has fast interrupts (FIQs), and so saves the
cost of a DMA controller.  When the floppy controller produces a byte, the
processor gets a FIQ, stops what it is doing, grabs the byte, stores it in
memory then gets back to work.  Due to the separate overlay registers
R8-R15, there's minimal overhead in switching to the FIQ routine.  Econet
works on the same principle.

This means you can throw away the extra hardware demands, but it doesn't
scale.  If the floppy controller is producing 10Kbyte/s, you can cope with
10K interrupts/sec.  If it's producing 10Mbytes/s, you can't.  The extra
hardware really does win in the end because it decouples the CPU from the
I/O.

But the idea of FIQs is a good one, especially in the embedded sphere. And
it does allow you to do things you couldn't previously do, with (AFAICS)
minimal knock-on effects for other things.

Theo


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
druck  
View profile   Translate to Translated (View Original)
 More options 19 Oct, 19:34
Newsgroups: comp.sys.acorn.programmer
From: druck <n...@druck.freeuk.com>
Date: Mon, 19 Oct 2009 19:34:06 +0100
Local: Mon 19 Oct 2009 19:34
Subject: Re: Learning ARM assembler...

We already have a similar mechanism of OS_CallASWI, but it can't be
patched in to applications as it requires and extra register to be
passed to the SWI.

---druck


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gazza  
View profile   Translate to Translated (View Original)
 More options 3 Nov, 14:53
Newsgroups: comp.sys.acorn.programmer
From: Gazza <use...@garethlock.com>
Date: Tue, 3 Nov 2009 06:53:51 -0800 (PST)
Local: Tues 3 Nov 2009 14:53
Subject: Re: Learning ARM assembler...
When I started this thread a while back looking for a beginner's guide
to programming Acorn machines in BBC BASIC's built in assembler, I
never knew I'd open such a can of worms. It's been fun reading it.

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Theo Markettos  
View profile   Translate to Translated (View Original)
 More options 3 Nov, 16:11
Newsgroups: comp.sys.acorn.programmer
From: Theo Markettos <theom+n...@chiark.greenend.org.uk>
Date: 03 Nov 2009 16:11:52 +0000 (GMT)
Local: Tues 3 Nov 2009 16:11
Subject: Re: Learning ARM assembler...

Gazza <use...@garethlock.com> wrote:
> When I started this thread a while back looking for a beginner's guide
> to programming Acorn machines in BBC BASIC's built in assembler, I
> never knew I'd open such a can of worms. It's been fun reading it.

So what did you end up doing?  Did we convince you that you really wanted to
learn Haskell, or .NET, or Z? ;-)

Theo


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gazza  
View profile   Translate to Translated (View Original)
 More options 4 Nov, 18:10
Newsgroups: comp.sys.acorn.programmer
From: Gazza <use...@garethlock.com>
Date: Wed, 4 Nov 2009 10:10:48 -0800 (PST)
Local: Wed 4 Nov 2009 18:10
Subject: Re: Learning ARM assembler...
On Nov 3, 4:11 pm, Theo Markettos <theom+n...@chiark.greenend.org.uk>
wrote:

> Gazza <use...@garethlock.com> wrote:
> > When I started this thread a while back looking for a beginner's guide
> > to programming Acorn machines in BBC BASIC's built in assembler, I
> > never knew I'd open such a can of worms. It's been fun reading it.

> So what did you end up doing?  Did we convince you that you really wanted to
> learn Haskell, or .NET, or Z? ;-)

> Theo

Well... I think I'll eventually end up doing what I started out
thinking about in the sense that I'll one day get that Invaders clone
you saw running at the show on the 3rd October moved from raw BASIC
to, at least, partial assembler. Once I have the speed and knowledge
from that, I might try and implement some sort of starfield or
background overlay with the space station in the background a la the
original arcade hardware. The other thing that comes to mind is maybe
try and implement the bunkers a la the original with pixel level
destruction rather than bumping them around like pinball targets. The
other things I'd like to get right are the timings. (Running the game
on a 48MHz A7000+ is about right, whereas it's too fast really on a
RPC.) The accuracy of some of the collision detection code. (Trying to
destroy a zig-zag type invader missile is a bit hit and miss.) But
where to start??

I'd want it 32 bit friendly and I'd want it to work pretty much as it
does now. I'd probably just convert the event handlers to asm and
leave the rest of the stuff in BASIC. After all it's the animation and
re-draw stuff that needs to be quick. This would have two advantages
over doing it in C. I would be able to work on the existing code-base
rather than re-coding from scratch. I wouldn't have to learn the ins
and outs of how BASIC stores files written in PRINT# format.

I might do it in C first, just to see if compilation as opposed to
BASIC mashing is any faster, but I've always fancied trying to learn
asm. Simple generic ARM certainly seems to be more palatable to me
than x86. Certainly to begin with anyhow. It also has the advantage
that there's a perfectly good assembler already built into the
machine... lol


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Terje Slettebø  
View profile   Translate to Translated (View Original)
 More options 5 Nov, 10:12
Newsgroups: comp.sys.acorn.programmer
From: Terje Slettebø <tslett...@gmail.com>
Date: Thu, 5 Nov 2009 02:12:49 -0800 (PST)
Local: Thurs 5 Nov 2009 10:12
Subject: Re: Learning ARM assembler...
On 4 Nov, 19:10, Gazza <use...@garethlock.com> wrote:

> Well... I think I'll eventually end up doing what I started out
> thinking about in the sense that I'll one day get that Invaders clone
> you saw running at the show on the 3rd October moved from raw BASIC
> to, at least, partial assembler.
> <snip>
> I might do it in C first, just to see if compilation as opposed to
> BASIC mashing is any faster, but I've always fancied trying to learn
> asm. Simple generic ARM certainly seems to be more palatable to me
> than x86. Certainly to begin with anyhow. It also has the advantage
> that there's a perfectly good assembler already built into the
> machine... lol

Sounds like fun. :)

I think you will find learning assembly code rewarding... I agree with
you about x86 vs ARM: I would never want to write x86 assembly code...
Then I'd rather go for a higher-level language. However, I've found
writing ARM assembly quite fun and rewarding, and as mentioned in an
earlier post, I'm currently updating the extASM ARM assembler, which
is itself written in assembly (about 25,000 lines of it), to the
latest ARM models (ARMv7).

extASM is a free-standing assembler, but if it turns out to be a
practical possibility, now that we have RISC OS Open, it might also be
used as the basis for an updated BASIC assembler...

There are a _lot_ of new instructions in ARMv7, compared to ARMv3/
ARMv4 (the ones currently in use in computers like RiscPC), including
a powerful floating point instruction set (something that has been
sorely lacking for years), long multiply instructions, and SIMD
instructions, and these are currently unavailable in the BASIC
assembler.

Also, to take advantage of them, you need to run RISC OS on hardware
with the latest ARM models, such as the BeagleBoard, or Touch Book (if
we get RISC OS ported to the latter).

Regards,

Terje

P.S. Feel free to contact me at tslett...@broadpark.no, if you have
questions about ARM assembly, or if you'd like to discuss something.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
jl  
View profile   Translate to Translated (View Original)
 More options 5 Nov, 11:58
Newsgroups: comp.sys.acorn.programmer
From: jl <j...@spamnet.junk>
Date: Thu, 05 Nov 2009 11:58:11 +0000 (GMT)
Local: Thurs 5 Nov 2009 11:58
Subject: Re: Learning ARM assembler...
In article
<ae63c1c0-e236-43a2-a91a-1b410aaf1...@15g2000yqy.googlegroups.com>,
   Gazza <use...@garethlock.com> wrote:

I did that once for my program !Planets. A small machine code routine
which wrote directly to screen memory.  It is a hack and only works in one
mode - but work it did.

Jochen

--

 ------------------------------------
 Limavady and the Roe Valley
 Roe Valley News Browser
 http://www.jochenlueg.freeuk.com


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Christopher Bazley  
View profile   Translate to Translated (View Original)
 More options 6 Nov, 19:22
Newsgroups: comp.sys.acorn.programmer
From: Christopher Bazley <christopher.baz...@blueyonder.co.uk>
Date: Fri, 06 Nov 2009 19:22:13 GMT
Local: Fri 6 Nov 2009 19:22
Subject: Re: Learning ARM assembler...
In message <02083a60-2a2c-4ee1-91f7-41894e394...@c3g2000yqd.googlegrou
ps.com>
          Gazza <use...@garethlock.com> wrote:

> I'm interested in cutting my teeth in ASM. Are there any resources out
> there for beginners. I've been writing in BASIC for years and I think
> I'm ready to move up a gear.

Up a gear? I'm not sure that metaphor works: In higher gears the
wheels of a car rotate more times per revolution of the engine's
crankshaft. Likewise, a single statement in a high-level programming
language typically encapsulates more behaviour than a statement in a
low-level language. You would use assembly language to get more
'traction'! :-)

Anyway, enough of strained analogies.

> I would need something fairly recent. By
> recent, I mean aware of the changes required to be 26/32 neutral. I
> would probably start off with using the assembler built into BASIC
> rather than buying any development tools, so I'd prefer something that
> was either neutral in that respect or something that concentrated on
> the BASIC assembler.

I started out with ARM assembly language programming using Nick
Roberts's ASM ( http://tigger.orpheusweb.co.uk/programs/misc.html ).
This is similar to Acorn's ObjAsm in that it comes with a desktop
front-end powered by the FrontEnd module and generates AOF files
suitable for linking with compiled C source code. ASM has some nice
features (named data structures, conditional assembly, macros and a
few built-in functions for use in constant expressions) and the major
benefit that it is free.

However, I eventually abandoned ASM in favour of Acorn's ObjAsm
because ASM is far less powerful than the assembler built into BBC
BASIC. I needed an assembler with all the features of the BASIC
assembler but which could generate AOF output for linking with new
code that I had written in C for Star Fighter 3000. As a result, the
source code for Star Fighter 3000 is currently a mixture of C, ASM and
ObjAsm assembly language!

The trouble was that ASM doesn't support loops and its support for
conditional assembly is severely limited in that sections of code can
only be included or excluded depending on whether or not a 'flag' has
been defined. In contrast, ObjAsm allows arithmetic, boolean and
string variables with either local or global scope, and can evaluate
complex expressions as the condition for its WHILE and IF directives.

As an example of the kind of thing that would be impossible using ASM,
here is a snippet of the texture mapping code for SF3000:

  GBLA text_compile
text_compile SETA firstmapper
  WHILE text_compile <= 4
    ROUT
    [ text_compile = 1
text_res SETA 2
bonus_texture SETL {FALSE}
    |
      [ text_compile = 2
text_res SETA 1
bonus_texture SETL {FALSE}
      |
        [ text_compile = 3
text_res SETA 0
bonus_texture SETL {FALSE}
        |
          [ text_compile = 4
text_res SETA -1
bonus_texture SETL {FALSE}
          ]
        ]
      ]
    ]

Richard Murray provides an appraisal of various assemblers for RISC OS
machines here: http://www.heyrick.co.uk/assembler/apcsasm.html
I certainly disagree with his opinion that "ASM leaves objasm
standing", although no doubt someone will be along soon to say that I
have unfairly impugned ASM.

> I know I could move onto C, but with the two competing environments
> out there, which one? GCC or Norcroft?

If I'm quite honest, I don't think that time spent learning assembly
language in this day and age is time well spent (except perhaps for
the edification and amusement of enthusiasts).

I made the transition from programming BASIC to programming in C
almost exactly ten years ago. At the time I was disappointed with the
poor performance of early programs that I wrote in C (which no doubt
used floating point arithmetic liberally). In retrospect I suppose I
was still in thrall to the proud claims on the packaging of Archimedes
games that they were '100% hand-optimised machine code' (as if that
were a good thing!). However, I have since realised that using
efficient and appropriate algorithms is far more important than the
choice of language used to implement them.

If optimisation is required then an experienced C programmer can use
simple tricks like using automatic variables to avoid dereferencing a
pointer multiple times, whilst keeping in mind the limited number of
variable registers available within each function. (It is no faster to
load an automatic variable's value from the stack than it would be to
access a structure member by dereferencing a pointer, and the ARM has
already wasted time by copying that member's value to the stack!)

I often optimise my C programs after examining the ARM code produced
by the compiler, but nowadays I would almost never abandon the
abstraction and portability of C in favour of assembly language. It's
nice to be able to compile the same source code for other platforms,
even if the results are sub-optimal! :-)

My early attempts at writing C were stunted by the fact that I was
translating directly from BASIC (sometimes mentally, sometimes using a
program that I had written to do the conversion automatically). There
are superficial similarities because they are both imperative
languages, but C is so much more powerful than BASIC that I urge you
to discard your preconceptions and buy a decent textbook on C
programming. I like 'The Practice of Programming' by Kernighan and
Pike.

For example, the lack of function pointers in BASIC makes it almost
impossible to write reusable code that doesn't suffer from hopeless
interdependencies between modules. Other features of C which initially
passed me by were the ternary operator ?: (best used in moderation),
the fact that the three expressions following a 'for' statement can be
*anything* (whereas BASIC's FOR keyword can only be used to iterate
through a linear numeric series), and the nicer alternative to GOTO
provided by the 'break' and 'continue' statements.

HTH,
--
Chris Bazley
Star Fighter 3000: http://starfighter.acornarcade.com/


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Terje Slettebø  
View profile   Translate to Translated (View Original)
 More options 7 Nov, 23:32
Newsgroups: comp.sys.acorn.programmer
From: Terje Slettebø <tslett...@gmail.com>
Date: Sat, 7 Nov 2009 15:32:42 -0800 (PST)
Local: Sat 7 Nov 2009 23:32
Subject: Re: Learning ARM assembler...
On 6 Nov, 20:22, Christopher Bazley

<christopher.baz...@blueyonder.co.uk> wrote:
> In message <02083a60-2a2c-4ee1-91f7-41894e394...@c3g2000yqd.googlegrou
> ps.com>

Hi Chris.

Great to hear from one of the authors (or maybe the author) of
Starfighter 3000, my favourite Archimedes game... :)

> Richard Murray provides an appraisal of various assemblers for RISC OS
> machines here:http://www.heyrick.co.uk/assembler/apcsasm.html
> I certainly disagree with his opinion that "ASM leaves objasm
> standing", although no doubt someone will be along soon to say that I
> have unfairly impugned ASM.

And extASM isn't even mentioned. Hrmmmf... :)

Granted, it's understandable, as hardly anyone knows about it, not at
least because it has no (proper) homepage, and it hasn't been updated
for over a decade, until recently.

Still, even at that time, it supported essentially a superset of the
BASIC assembler functionality (including loops, conditional assembly,
arbitrarily complex int/float/string expressions, etc.).

> > I know I could move onto C, but with the two competing environments
> > out there, which one? GCC or Norcroft?

> If I'm quite honest, I don't think that time spent learning assembly
> language in this day and age is time well spent (except perhaps for
> the edification and amusement of enthusiasts).

I think that's enough justification, actually... :)

Besides, as mentioned in other posts, it's useful to know what is
happening "at the bottom", even when using a high-level language. It
could help to avoid or pinpoint performance problems, for example.

It can also help you understand how high-level programming languages
work. For example, I had no problem understanding the "pointer"
feature in C, after having done some assembly programming earlier:
It's simply the address of a variable (or some other entity)... :)

I've heard that some have had great conceptual problems with
understanding pointers, but that didn't happen to me...

> I made the transition from programming BASIC to programming in C
> almost exactly ten years ago. At the time I was disappointed with the
> poor performance of early programs that I wrote in C (which no doubt
> used floating point arithmetic liberally). In retrospect I suppose I
> was still in thrall to the proud claims on the packaging of Archimedes
> games that they were '100% hand-optimised machine code' (as if that
> were a good thing!). However, I have since realised that using
> efficient and appropriate algorithms is far more important than the
> choice of language used to implement them.

Also, nowadays, a compiler is typically able to do as least as good a
job as an assembly programmer.

Still, there are some areas where I've found assembly programming to
fit quite nicely, and an assembler is one of them. :) Assembly is good
at "bit fiddling", and there's a lot of that in an assembler/
disassembler.

Still, if I were to write an assembler, today, I'd likely done it in C+
+, using the Spirit parser framework, or something like that, which
would enable one to work at a higher level of abstraction, and leave
more of the "boilerplate" to the compiler/library.

> If optimisation is required then an experienced C programmer can use
> simple tricks like using automatic variables to avoid dereferencing a
> pointer multiple times, whilst keeping in mind the limited number of
> variable registers available within each function. (It is no faster to
> load an automatic variable's value from the stack than it would be to
> access a structure member by dereferencing a pointer, and the ARM has
> already wasted time by copying that member's value to the stack!)

Here you are using your knowledge of assembly code to point out
possible performance optimisations in C code... Was it still not time
well spent learning...? ;)

Regards,

Terje


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
chrisbaz...@bigfoot.com  
View profile   Translate to Translated (View Original)
 More options 8 Nov, 11:22
Newsgroups: comp.sys.acorn.programmer
From: chrisbaz...@bigfoot.com
Date: Sun, 8 Nov 2009 03:22:42 -0800 (PST)
Local: Sun 8 Nov 2009 11:22
Subject: Re: Learning ARM assembler...
On Nov 7, 11:32 pm, Terje Slettebø <tslett...@gmail.com> wrote:

> On 6 Nov, 20:22, Christopher Bazley

> <christopher.baz...@blueyonder.co.uk> wrote:
> > In message <02083a60-2a2c-4ee1-91f7-41894e394...@c3g2000yqd.googlegrou
> > ps.com>

> Hi Chris.

> Great to hear from one of the authors (or maybe the author) of
> Starfighter 3000, my favourite Archimedes game... :)

I'd like to take credit for that, but I really can't. All I did was
hack the copy protection, fix lots of bugs, rewrite the sound player
module, make the game code into a state machine, and bolt on a desktop
interface. A huge amount of work, but not really the part that people
appreciate. :-)

> > If optimisation is required then an experienced C programmer can use
> > simple tricks like using automatic variables to avoid dereferencing a
> > pointer multiple times, whilst keeping in mind the limited number of
> > variable registers available within each function. (It is no faster to
> > load an automatic variable's value from the stack than it would be to
> > access a structure member by dereferencing a pointer, and the ARM has
> > already wasted time by copying that member's value to the stack!)

> Here you are using your knowledge of assembly code to point out
> possible performance optimisations in C code... Was it still not time
> well spent learning...? ;)

You make a good point, although conceivably that kind of thing could
be taught without knowledge of assembly language, by knowing certain
features of the target architecture/PCS.

For example:
1) In each function a maximum of 6 fast temporary storage locations
are available to hold automatic variables of type 'char', 'int',
'short int', 'long int' or 'void *'.
2) If too many automatic variables of the above types are declared
then some will be held in slower temporary storage.
4) Using the '&' operator to get a pointer to an automatic variable
forces it to be held in slower storage.
5) Automatic structures are always held in slower storage locations.
6) Calling a function or assigning to an l-value through a pointer
invalidates any values previously accessed through pointers that might
otherwise have been cached in fast temporary storage locations.
...etc

--
Christopher Bazley


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gavin Wraith  
View profile   Translate to Translated (View Original)
 More options 8 Nov, 12:27
Newsgroups: comp.sys.acorn.programmer
From: Gavin Wraith <ga...@wra1th.plus.com>
Date: Sun, 08 Nov 2009 12:27:32 GMT
Local: Sun 8 Nov 2009 12:27
Subject: Re: Learning ARM assembler...
In message <23f71761-f389-49be-ac9e-407b2740b...@v25g2000yqk.googlegroups.com>
          chrisbaz...@bigfoot.com wrote:

> You make a good point, although conceivably that kind of thing could
> be taught without knowledge of assembly language, by knowing certain
> features of the target architecture/PCS.

One of my criteria for a good programming language is to what extent it
allows the programmer a useful mental picture of what actually happens
when the program runs - the operational semantics. No picture can
be entirely accurate; it is a question of compromise. Assembly languages
can be particularly useful educationally in this way. However, I think
that particular architectures, adopted long in the past, tend to have
a restricting influence on the choice of algorithms and datastructures
that are encouraged by the languages influenced by them. C, for example,
stems from the PDP11 era, when everything was based on buffers and pointers,
as opposed, say to the use of hashing; so C promotes the mental picture that
pointer values are actual addresses, as opposed to any fancier sort of
descriptors that the compiled code may actually be using. I am not arguing
that there is anything wrong with this, just that we can be lulled into
making assumptions that may in some circumstances be limiting.

--
Gavin Wraith (ga...@wra1th.plus.com)
Home page: http://www.wra1th.plus.com/


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Richard Russell  
View profile   Translate to Translated (View Original)
 More options 8 Nov, 15:07
Newsgroups: comp.sys.acorn.programmer
From: Richard Russell <n...@rtrussell.co.uk>
Date: Sun, 8 Nov 2009 07:07:39 -0800 (PST)
Local: Sun 8 Nov 2009 15:07
Subject: Re: Learning ARM assembler...
On Nov 5, 10:12 am, Terje Slettebø <tslett...@gmail.com> wrote:

> I agree with you about x86 vs ARM: I would never want to write x86 assembly code...

It's simply a case of what you're used to.  Having been an x86
assembly language programmer for more than 20 years, I find it much
easier to understand and program than ARM assembler.  For me, thinking
in terms of conditional instructions rather than conditional jumps is
quite alien, requiring more of an intellectual leap from high-level
programming.

It's true that the old 16-bit x86 was horrible to program, because of
the asymmetrical nature of its instruction set (certain instructions
only being able to use certain registers).  Modern 32-bit IA-32 code
is much nicer, because (with few exceptions) all the registers are
equivalent.

I'm not qualified to comment on RISC OS, but on MS Windows using a
hybrid of BBC BASIC and assembler is a very powerful technique.  All
my 'large' applications are written that way.  In the case of games
programming, David Williams' site illustrates the sort of thing the
technique can achieve (you'll need a Windows PC to run the programs,
but there are YouTube videos of some of them):

 http://www.bb4w-games.com/

Richard.
http://www.rtrussell.co.uk/
To reply by email change 'news' to my forename.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Terje Slettebø  
View profile   Translate to Translated (View Original)
 More options 8 Nov, 22:31
Newsgroups: comp.sys.acorn.programmer
From: Terje Slettebø <tslett...@gmail.com>
Date: Sun, 8 Nov 2009 14:31:32 -0800 (PST)
Local: Sun 8 Nov 2009 22:31
Subject: Re: Learning ARM assembler...
On 8 Nov, 16:07, Richard Russell <n...@rtrussell.co.uk> wrote:

Hi Richard.

You're right, I guess it depends to a large extent on what you're used
to, and also, x86 and ARM have become closer to each other: x86 has
become more regularised, as you say (mostly, any register may be used
for any instruction, and we don't have the horrible segmented memory
system, anymore...), while ARM has grown quite a bit more complex (a
lot more instructions).

Also, I understand what you mean about the conditional executed
instructions. They take some getting used to, but once you've wrapped
your head around them, they may lead to very succinct code (and
eliminating many jumps). For example:

IF (A=1 OR B=2) AND C=3 AND D=4 THEN...

CMP   R0,#1
CMPNE R1,#2
CMPEQ R2,#3
CMPEQ R3,#4
BEQ   ...

By the way, your BBC for Windows is very nice. :) (I've got a licensed
copy of it)

Regards,

Terje


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Richard Russell  
View profile   Translate to Translated (View Original)
 More options 8 Nov, 23:30
Newsgroups: comp.sys.acorn.programmer
From: Richard Russell <n...@rtrussell.co.uk>
Date: Sun, 8 Nov 2009 15:30:05 -0800 (PST)
Local: Sun 8 Nov 2009 23:30
Subject: Re: Learning ARM assembler...
On Nov 8, 10:31 pm, Terje Slettebø <tslett...@gmail.com> wrote:

> IF (A=1 OR B=2) AND C=3 AND D=4 THEN...

> CMP   R0,#1
> CMPNE R1,#2
> CMPEQ R2,#3
> CMPEQ R3,#4
> BEQ   ...

Certainly that is elegant and succinct, but there's no guarantee it
will result in better performance or shorter code.  For example, the
most straightforward x86 equivalent (listed below) is exactly the same
length (20 bytes) and, on modern processors with branch prediction,
conditional jumps aren't expensive.

If you know in advance something about the statistics (for example you
know that D is hardly ever 4) then doing that test first and bailing
out if it fails may be more efficient than testing all four registers
every time.

Richard.
http://www.rtrussell.co.uk/
To reply by email change 'news' to my forename.

83 F8 01                       cmp eax,1
74 05                          je l1
83 FB 02                       cmp ebx,2
75 08                          jne l2
83 F9 03             .l1       cmp ecx,3
75 03                          jne l2
83 FA 04                       cmp edx,4
74 xx                .l2       je ...


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rob Kendrick  
View profile   Translate to Translated (View Original)
 More options 9 Nov, 00:18
Newsgroups: comp.sys.acorn.programmer
From: Rob Kendrick <n...@rjek.com>
Date: Mon, 9 Nov 2009 00:18:36 +0000
Local: Mon 9 Nov 2009 00:18
Subject: Re: Learning ARM assembler...
On Sun, 8 Nov 2009 15:30:05 -0800 (PST)

Richard Russell <n...@rtrussell.co.uk> wrote:
> > IF (A=1 OR B=2) AND C=3 AND D=4 THEN...

> > CMP   R0,#1
> > CMPNE R1,#2
> > CMPEQ R2,#3
> > CMPEQ R3,#4
> > BEQ   ...  

> Certainly that is elegant and succinct, but there's no guarantee it
> will result in better performance or shorter code.  For example, the
> most straightforward x86 equivalent (listed below) is exactly the same
> length (20 bytes) and, on modern processors with branch prediction,
> conditional jumps aren't expensive.

The idea here for the ARM is that doing the above and not having branch
prediction is a lot simpler for similar performance, and thus more
power efficient.  Doing the above for anything much more complex
however doesn't win you anything, because it's cheaper to take the
pipeline flush than execute all those no-ops.  MIPS has an elegant, but
quite confusing for new-comers approach to this; you have something
called the branch delay slot.  The instruction after a branch will be
executed regardless; at this point, it's already made its way through
half the pipeline, so you might as well finish it off.

B.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Messages 51 - 75 of 116 < Older  Newer >
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google