AminetAminet
Search:
78959 packages online
About
Recent
Browse
Search
Upload
Setup
Services

dev/asm/ira.lha

Mirror:Random
Showing:ppc-amigaosgeneric
No screenshot available
Short:MC68000/10/20/30/40 reassembler
Author:Tim Ruehsen, Christian Wasner, Ilkka Lehtoranta, Frank Wille
Uploader:frank phoenix owl de
Type:dev/asm
Version:2.04
Architecture:ppc-morphos; ppc-amigaos; m68k-amigaos >= 2.0.4
Date:2009-12-24
Download:http://aminet.net/dev/asm/ira.lha - View contents
Readme:http://aminet.net/dev/asm/ira.readme
Downloads:1201
When I was in need for a portable M68k reassembler I remembered Tim Ruehsen's
IRA source, and put some effort in it to make it portable to any architecture
and any compiler. Some code was taken from Ilkka Lehtoranta's MorphOS port
of IRA 1.05, who already cleaned the code from all SAS/C dependencies, but
the most effort was put into making the reassembler endian-independant (which
means it would even compile and work on x86 machines now!).


HISTORY

-- Modifications for V2.00 --

Bug fixes:
- ENTRY and OFFSET directives from the config file have been ignored
- The BASEADR for base-relative addressing is always a real address now,
  which is loaded to the base address register, and not an offset. This
  caused some confusion when the binary's OFFSET is not 0.
- MACHINE directive in the config file was emitted multiple times.
- Fixed -M option to specifiy the CPU type.
- Fixed parsing of RELOC32SHORT hunks.
- Better support for raw binary input.
- Fixed illegal access when making a label from a ROMtag name, and another
  one when running with -preproc over code which is not ended by an RTS or
  similar.

New features:
- Use BASEREG instead of the PhxAss-specific NEAR directive for base-relative
  addressing modes. There are more assemblers (including vasm 1.4 and PhxAss)
  supporting it.
- Option -BASEABS. When specified, a label in base-relative addressing mode
  is written as an absolute label, without the base register name (as with
  IRA V1.05). The default behaviour now is to write base-relative references
  as "(label,An)".
- Option -BITRANGE. Also recognizes bit-test/manipulation instructions as
  valid when accessing bits 8-15 in memory (e.g. btst #14,DMACONR).
- Config file directive PTRS. Syntax: PTRS <adr1> [<adr2>]. It defines a
  single address or a range of addresses which contain 32-bit pointers to
  addresses from the reassembled binary. This directive is especially useful
  in data sections of a raw binary, which has no relocation information.
  IRA will create a label for all the pointers in that range.
- Config file directive NBAS. Syntax: NBAS <adr1> <adr2>. Defines that the
  area between <adr1> and <adr2> should not use base-relative addressing
  modes (e.g. because the base register is used in another way here).
  IRA will start this area with an "ENDB An", to disable basereg-mode, and
  reenables base-relative mode with a BASEREG directive afterwards.
- I made sure that there is always a valid size extension as instruction
  suffix and in indirect addressing modes. ".W" was mostly missing before.
- Output an ORG directive instead of SECTION when the -binary option had
  been specified.
- Switched from PhxAss specific MACHINE/FPU/PMMU directives to MC680x0/
  MC68881/MC68851, which is understood by more assemblers (e.g. vasm,
  phxass, barfly, snma, etc.).


-- Modifications for V2.01 --

Bug fixes:
- Call fopen() in binary-mode where appropriate, for Windows support.

New features:
- " in strings are now encoded as "" by default. To get the PhxAss-specific
  (and vasm-supported) \" encoding, use the new -ESCCODES option.
- The string length is limited to 60 bytes, before a new line is started.


-- Modifications for V2.02 --

Bug fixes:
- Fixed NBAS config directive. Only the entry with the highest address worked.
- File buffers for binary and config file name were too small. Extended from
  32 to 128 bytes (as source and target file name buffer already were).
- An immediate width-field in bitfield instructions showed up as '0' when
  it should have been '32'.
- Multiple MACHINE directives in the config file confused IRA.
- Fixed DIVxL.L, DIVx.L and MULx.L.
- A new label is defined for the base-address, used in BASEREG. Using a
  SECSTRT_n-offset is unreliable when optimizing.

New features:
- New/improved BASEREG handling. The base-relative section specifier (BASESEC)
  has disappeared. It is sufficient to define base-relative addressing by
  a base-register and a base-address (e.g. -BASEREG=4,$12340).
- New config file directive BASEOFF (also as optional third argument in the
  -BASEREG option) defines an additional offset on the base-label (usually
  32766).
- (d8,An,Rn) addressing modes may also be used for base-relative addressing.
- Always create a SECSTRT_n symbol when starting a new section, even when
  this address is not referenced.
- After some modifications, Makefile.win32 was reported to work with VC6.


-- Modifications for V2.03 --

Bug fixes:
- Make sure that CODE areas, when read from a config file, are split at
  section boundaries. Otherwise IRA cannot detect the start of a new section
  during source generation.
- BASEADR didn't work correctly for raw binary files.

New features:
- Config file directive TEXT. To define a region in data as printable text.
  This overrides the automatic text recognition.
  Syntax: "TEXT $<start> - $<end>".
- Config file directives JMPB, JMPW and JMPL for generating jump-tables
  (or other offset-tables used to reference a program address).
  Syntax: "JMP<s> $<start> - $<end> [ at  $<base>]". <s> may be B, W or L and
  defines the width of the table entries (8, 16, 32 bit). The <base> is
  optional and same as <start>, when missing. It defines the base address
  where the table-offsets are added to.
- Option -BITRANGE, which was introduced in V2.00, was replaced by
  -COMPAT=<flags> to allow multiple compatibility flags. Currently known:
  b : Recognize immediate values of 8-15 for bit-instructions accessing
      memory (former -BITRANGE option).
  i : Recognize immediate byte addressing modes with an MSB of 0xff. Some
      assemblers generated 0xffff instead of 0x00ff for #-1.


-- Modifications for V2.04 --

Bug fixes:
- Fixed automatic ROM tag detection routine. Handling of absolute 32-bit
  function tables did not work when a relative 16-bit one was found before.
- Function names from ROM tag function tables were sometimes missing, when
  the input file is a raw binary.
- Fixed SECSTRT_n symbol recognition with BASEREG directive and small data
  adressing modes.
- Do not forget .W extension for word-sized LINK, MOVEA and MOVEP.
- Recognize BTST Dn,#x.

New features:
- Report about misplaced relocations in code (usually caused by a bad PTRS
  directive).
- Print a warning when a symbol from HUNK_SYMBOL is not inside the current
  section limits, and ignore this symbol.
- Base-relative symbols outside the small-data section's bounds are
  referenced via SECTSTRT_n and a warning is printed (because the
  instruction could be data, or the base register contains something
  else at this point).


INSTALLATION

Copy the binary for your architecture anywhere you want (e.g. C:) and rename
it into "ira".

ira_68k: IRA for AmigaOS2.x/3.x (680x0)
ira_os4: IRA for AmigaOS4.x (PPC)
ira_mos: IRA for MorphOS1.x/2.x (PPC)


SOURCE TEXT

Use "makefile" to compile the source with gcc on any architecture. It was
successfully tested on a Mac G4, Sun Sparcstation and an i386 system (all
running NetBSD kernels). Use "makefile.win32" to compile IRA for Windows
(tested with VC6). The other makefiles can be used to compile a native
binary with vbcc for AmigaOS 2.x/3.x, AmigaOS4.x or MorphOS.


USAGE

The original IRA was tuned for PhxAss, which might still work. The
recommended assembler is vasm/M68k V1.4 or greater though, which you
should call with the -devpac option to avoid optimizations and escape-code
handling, for the generation of an identical binary.

Other assemblers like DevPac, Barfly and SNMA can assemble IRA output
without error, but do not generate identical code. All of them convert
ADD/SUB/CMP/AND/etc. into their immediate form (ADDI/SUBI/CMPI/ANDI/etc.)
when possible, and DevPac additionally swaps registers in EXG.

Example: I'm using the following commands to reassemble AmigaBASIC and
to assemble an identical binary with vasm. The config file was manually
adjusted by me to reflect all valid code regions (create a config file
with -preproc first), then duplicated as NewAmigaBASIC.cnf. The diff test
reports no differences!

  ira -a -compat=bi -config -keepzh AmigaBASIC
  vasmm68k_mot -devpac -Fhunkexe -nosym -o NewAmigaBASIC AmigaBASIC.asm
  ira -a -compat=bi -config -keepzh NewAmigaBASIC
  diff -s AmigaBASIC.asm NewAmigaBASIC.asm

The option -compat=bi is needed to allow bad btst instructions which
access a bit number > 7 in a byte (b) and to recognize immediate byte
addressing modes with an MSB of 0xff (i), which both appear frequently
in the program. The -keepzh option preserves empty sections, so that the
number of sections stays the same as before.


Refer to ira.doc for the original IRA V1.xx documentation.


Note that IRA is no longer Shareware, but Freeware! The initial author,
Tim Ruehsen, should not be contacted as he left the Amiga and stopped
working on IRA many years ago.

For bug reports, suggestions, etc. contact Frank Wille (frank at phoenix.owl.de).


Contents of dev/asm/ira.lha
 PERMSSN    UID  GID    PACKED    SIZE  RATIO METHOD CRC     STAMP          NAME
---------- ----------- ------- ------- ------ ---------- ------------ -------------
[generic]                25616  100532  25.5% -lh5- fc44 Dec 19 17:06 ira.c
[generic]                 7330   18639  39.3% -lh5- 00f3 Apr  2  2009 ira.doc
[generic]                 1347    3754  35.9% -lh5- 0867 Dec 16 18:10 ira.h
[generic]                 4121    9135  45.1% -lh5- 273e Dec 20 21:34 ira.readme
[generic]                11007   42973  25.6% -lh5- f4af Dec 19 17:14 ira_2.c
[generic]                47104  107752  43.7% -lh5- fb07 Dec 20 21:36 ira_68k
[generic]                64045  190872  33.6% -lh5- dbb8 Dec 19 17:14 ira_mos
[generic]                68515  191324  35.8% -lh5- 61c0 Dec 20 21:36 ira_os4
[generic]                  172     371  46.4% -lh5- ab4a Jul  2 22:47 make.rules
[generic]                   94     104  90.4% -lh5- 3902 Oct 10 13:02 Makefile
[generic]                  129     149  86.6% -lh5- 5f39 Jun  5  2009 Makefile.mos
[generic]                  129     148  87.2% -lh5- f98b Jun  5  2009 Makefile.os3
[generic]                  140     165  84.8% -lh5- f0d7 Jun  5  2009 Makefile.os4
[generic]                  239     336  71.1% -lh5- b04d Jul  2 22:47 Makefile.win32
[generic]                    0       0 ****** -lh0- 0000 Apr  5  2009 obj/.dummy
[generic]                 1662    5000  33.2% -lh5- fe7a Jun 20  2009 supp.c
[generic]                  753    1787  42.1% -lh5- 98c7 Jun  6  2009 supp.h
---------- ----------- ------- ------- ------ ---------- ------------ -------------
 Total        17 files  232403  673041  34.5%            Dec 24 14:02

Aminet © 1992-2010 Urban Müller and the Aminet team. Aminet contact address: <aminetaminet net>