Google 網路論壇不再支援新的 Usenet 貼文或訂閱項目,但過往內容仍可供查看。

ObjAsm versus ASM

瀏覽次數:57 次
跳到第一則未讀訊息

Christopher Bazley

未讀,
2002年1月17日 上午11:49:492002/1/17
收件者:
Hi,

I'm about to start coding a major assembly language project - a RISC
OS module. I have access to both ObjAsm from the Acorn C/C++
distribution, and Nick Robert's freeware ASM.

I was hoping that some people with experience of both assemblers could
give me an assessment of their relative capabilities. So far as I can
tell, their features seem similar, and they even implement many of the
same assembler directives. Both seem to be actively maintained.

Is there actually any reason to use ObjAsm/ASM rather than the 'good
old' BASIC assembler? (Which is what I'm used to.)

cheers,

Chris Bazley

Weiss Niklaus (privat)

未讀,
2002年1月17日 中午12:46:502002/1/17
收件者:
In article <464f803d.0201...@posting.google.com>,

I work with the assembler part of "Acorn C/C++" only! In my opinion it
is very good. This assembler generates debugging data, that you can use
with "!DDT", but the Basic inline assembler does not provide debugging
data. About the "Nick Robert ASM" I do not have any experience.

The "Acorn" assembler copes with macros and other powerful features.

With friendly greetings: Niklaus
--
Weiss Niklaus, Sagistrasse 20, CH-6300 Zug, Switzerland
Telephone +41 41 741 5778; Telefax +41 41 741 5776
Web: http://www.weissniklaus.ch
Email: in...@weissniklaus.ch or: weis...@datacomm.ch

Philip Ludlam

未讀,
2002年1月17日 下午4:07:042002/1/17
收件者:
In message <464f803d.0201...@posting.google.com>

I can't offer any objective insights into ASM I'm afraid, but I do
have experience of using BASIC assembler and ObjAsm.

ObjAsm offers the same benefits that any AOF generator offers. The
ability to link with C/C++ programs and to be able to split the source
code into multiple files.

<plug>
If you do use ObjAsm (or another suitable assembler) don't forget to
have a look at AssLib http://director.sourceforge.net/asslib
</plug>
or OSLib (can't remember URL).

The disadvantages of ObjAsm (and probably ASM) to BASIC Assembler is
that you can't do neat BASIC tricks. Things like calling functions
within the assembler code or looping through loops to generate data or
code.

The disadvantages of BASIC Assembler to ObjAsm (and probably ASM) is
that you can't (easily) incorporate libraries into the code and your
limited to having one source code file and you have to suffer the time
taken to compile the whole source code every time.

You many be able to incorporate BASIC generated code/data if you write
some extra code to wrap the data (or whatever) up in an AOF file.
Grab the 1.00 version of AssLib off of
http://www.sourceforge.net/projects/director (under Files) to see a
BASIC implementation of setdate - an AOF generator which parses it's
input through OS_ConvertDateAndTime (based on setdate done by
Straylight).

Sorry I can't help with the ASM/ObjAsm question.

Yours,

Phil L.
--
http://www.philipnet.com

What Happened?
Demon Monks. Should have gone to Las Vegas
! :-)

Martyn Fox

未讀,
2002年1月17日 下午4:23:552002/1/17
收件者:
In article <464f803d.0201...@posting.google.com>, Christopher
Bazley <chris...@bigfoot.com> wrote:

> Is there actually any reason to use ObjAsm/ASM rather than the 'good old'
> BASIC assembler? (Which is what I'm used to.)

I've devised techniques for writing assembly language programs of a fair size
using the Basic assembler. You can read about them in Foundation RISC User.

Issue 4 has an article introducing assembly language (you probably don't need
this), repeated from Issue 3. It also has a follow-up, describing in detail
the source code of the IClear module, which will probably be of use to you.
Issue 4 also has an article describing the technique of 2 1/2-pass assembly,
which is the key to writing large-ish programs using the Basic assembler.

Issue 5 has a repeat of a series of three articles from the last volume of
RISC User describing techniques for writing Wimp-based applications using the
Basic assembler with 1/2-pass assembly.

Someone from Computer Concepts once confirmed to me that Impression was
written using the Basic assembler, in sections which were put together using
a linker program that they'd written themselves. My techniques aim at doing
the same thing, but without the linker program.

Martyn

--
_
|\/| _ _ -+- _ |_ _ Windsor, Berks. UK
| | (_| | | (_| | ) | (_) )( mf...@argonet.co.uk
ZFC Cs _| Acorn Risc Pc with StrongARM - a Wintel-free zone!

Martin Wuerthner

未讀,
2002年1月17日 下午6:42:182002/1/17
收件者:
In message <4afa6ec...@argonet.co.uk>
Martyn Fox <mf...@argonet.co.uk> wrote:

> Someone from Computer Concepts once confirmed to me that Impression was
> written using the Basic assembler, in sections which were put together using
> a linker program that they'd written themselves.

The same is true for the ArtWorks kernel and its modules. Once a certain
size is exceeded, having all the code in a single source file is not
feasible. Therefore, CC have created BLinker, which allows you to export
labels from one source file and reference them in some other source file.
After assembling each source file, some sort of an object file is saved.
Then, these object files are linked together while resolving the label
references. Quite clever!

Martin
--
---------------------------------------------------------------------
Martin Wuerthner MW Software mar...@mw-software.com
---------------------------------------------------------------------

Martyn Fox

未讀,
2002年1月18日 清晨5:04:182002/1/18
收件者:
In article <81717bfa...@mw-software.com>, Martin Wuerthner
<mar...@mw-software.com> wrote:

> > Someone from Computer Concepts once confirmed to me that Impression was
> > written using the Basic assembler, in sections which were put together
> > using a linker program that they'd written themselves.

> The same is true for the ArtWorks kernel and its modules. Once a certain
> size is exceeded, having all the code in a single source file is not
> feasible.

If you use 2 1/2-pass assembly on the Basic assembler, you can split the
source code into as many files as you like.

Lee Johnston

未讀,
2002年1月18日 清晨5:35:392002/1/18
收件者:
chris...@bigfoot.com (Christopher Bazley) wrote in message news:<464f803d.0201...@posting.google.com>...
I wouldn't say that ObjAsm is being actively maintained, or rather
that it is but the latest versions don't seem to be available outside
of Pace.

I've got some experience of both. One of the neat things about ASM is
that it supports structures. You create data types (rather like C
structures), load a register with the address of an instance of that
structure and then access all the fields using a named label rather
than offset. It's quite nice.

Against ASM (and for ObjAsm) is the fact that ObjAsm has support for
repetitive assembly. I've never really used it but you can set up a
loop in which the instructions are copied N times during assembly -
kind of like setting up a for next loop around some instructions in
the BASIC assembler I guess. I've asked about the possibility of
something similar being added to ASM but apparently it would require
large changes to the structure of the assembler.

In addition I think ASM prefers it's source code in the "a" directory
as opposed to "s" directory. Oh and I've not tried using Paces
26/32bit macros with ASM.

Other than that there's very little to choose between them. Zaps
highlighting modes for ObjAsm are close enough to ASMs syntax to work
pretty well. Given the fact that an official update to Acorn C/C++ has
yet to appear, and that Nick has always responded promptly to bug
reports in the past, I'd be tempted to go with ASM.

If you have access to both the best bet would be to compare features
but, as I say, there's little to choose between them.

Lee

Nemo

未讀,
2002年1月18日 凌晨4:44:332002/1/18
收件者:
On 17 Jan, Christopher Bazley wrote:

> I'm about to start coding a major assembly language project - a RISC OS
> module. I have access to both ObjAsm from the Acorn C/C++ distribution,
> and Nick Robert's freeware ASM.

Well, ObjASM produces AOF code that must then be linked, and converted into
a module. Whereas ASM (IIRC) is like AAsm or BASIC - you can create a module
direct with no messing.

For a stand-alone module with no need of pre-assembled libraries, ASM will
be slightly more flexible than ObjAsm.

> Is there actually any reason to use ObjAsm/ASM rather than the 'good old'
> BASIC assembler? (Which is what I'm used to.)

Automatic workspace layout and use of macros - excerpt from the start of an
Aasm module:

GET Header:RegNames
GET Header:Macros
MACROS

VERSION 0.03
DATE 15 Dec 2001

; Workspace...
^ 0,R12
WS0 # 0

Paths # 4 ; The linked list of paths
Grey # 4 ; Wimp colour 1 in BbGgRrXx format
Trapped # 4 ; Has ColourTrans been grabbed?
Foreground # 4 ; New foreground
Background # 4 ; Background
FilerHandle # 4
q # 256

WS1 # 0
rmasize * WS1-WS0

; Module start...

P
P Initialise
P Finalise
P Service
P Title
P Help
P Commands
& 0
P
P
P
P
P ModuleFlags

ModuleFlags & 1 ; 32bit safe

etc etc. The above workspace construction allows you to LDR R0,FilerHandle
and the assembler works out that means LDR R0,[R12,#20] for you - easy. I
have a LOT of macros defined, it makes coding much easier.

--
Nemo ne...@20000.org

druck

未讀,
2002年1月18日 下午3:45:502002/1/18
收件者:
On 18 Jan 2002 Nemo <ne...@20000.org> wrote:

> On 17 Jan, Christopher Bazley wrote:
>
> > I'm about to start coding a major assembly language project - a RISC OS
> > module. I have access to both ObjAsm from the Acorn C/C++ distribution,
> > and Nick Robert's freeware ASM.
>
> Well, ObjASM produces AOF code that must then be linked, and converted into
> a module. Whereas ASM (IIRC) is like AAsm or BASIC - you can create a
> module direct with no messing.

You can also do this with the -bin flag which produces a plain binary output.
For a module you need to ensure the area with the lowest address contains the
module header.

---druck

--
The ARM Club * http://www.armclub.org.uk/

Martyn Fox

未讀,
2002年1月18日 下午4:49:182002/1/18
收件者:
In article <4afab46...@argonet.co.uk>, Martyn Fox <mf...@argonet.co.uk>
wrote:

> > The same is true for the ArtWorks kernel and its modules. Once a certain
> > size is exceeded, having all the code in a single source file is not
> > feasible.

> If you use 2 1/2-pass assembly on the Basic assembler, you can split the
> source code into as many files as you like.

I should have added that, if you want to see this in action, you can download
the IClear module and !Millennia (an assembly language Wimp-based
application), including their source codes, from my website at
http://www.argonet.co.uk/users/mfox/software

Jason Tribbeck

未讀,
2002年1月18日 下午6:47:532002/1/18
收件者:
Christopher Bazley wrote:

> I was hoping that some people with experience of both assemblers could
> give me an assessment of their relative capabilities. So far as I can
> tell, their features seem similar, and they even implement many of the
> same assembler directives. Both seem to be actively maintained.


Having used ObjAsm a lot, and ASM very little, the main problem I came
up with was with the following code:


AREA myCode, CODE, READONLY
EXPORT myCode

; wibble

END

Under ObjAsm, this becomes callable as a function (either in C, or in
assembler). Under Asm, it didn't really like it, and wouldn't export it.
The code would have to be rewritten as:

AREA myCodeArea, CODE, READONLY
EXPORT myCode
myCode

; wibble

END

This works on both assemblers, but with several 10s of thousands of
source lines, I didn't really feel like rewriting it (okay, so a simple
PERL script would've easily done the job, but I wasn't in the mood).

Jason Tribbeck
--
.sig MIA - please send replacement

Jon Ripley

未讀,
2002年1月18日 晚上10:23:372002/1/18
收件者:
Using Justin Fletcher's !JFPatch here with no problems and it interfaces
very nicely with being able to do lots of stuff in BBC BASIC assembler
is required.
--
Jon Ripley (j...@stryker.freeserve.co.uk) ICQ 59461687
http://www.stryker.freeserve.co.uk/ New & Improved (Honest...)

Stewart Brodie

未讀,
2002年1月23日 上午8:29:152002/1/23
收件者:
In message <8cbf501c.02011...@posting.google.com>
john...@yahoo.co.uk (Lee Johnston) wrote:

> chris...@bigfoot.com (Christopher Bazley) wrote in message news:<464f803d.0201...@posting.google.com>...

> I wouldn't say that ObjAsm is being actively maintained, or rather that it


> is but the latest versions don't seem to be available outside of Pace.

There isn't that much you can do to improve an assembler, though. The only
thing you can do is to add the new instructions in the later ARM
architectures, and since there are no RISC OS machines out there that have
such processors in them, it's a moot point.

No improvements of any real use have been made since the last public release
- the only visible change being that the FIX instruction required an
erroneous precision specifier if you wanted to specify the rounding mode. It
ignored the precision specifier, anyway - it was just a nuisance you had to
write it.

--
Stewart Brodie, Senior Software Engineer (Views expressed are my own and
Pace Micro Technology PLC not those of my employer)
645 Newmarket Road
Cambridge, CB5 8PB, United Kingdom WWW: http://www.pacemicro.com/

0 則新訊息