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

dev/asm/ira.lha

Mirror:Random
Showing: ppc-warpup icongeneric icon
No screenshot available
Short:MC680x0/851 reassembler
Author:Tim Ruehsen, Ilkka Lehtoranta, Frank Wille, Nicolas Bastien
Uploader:frank phoenix owl de
Type:dev/asm
Version:2.11
Architecture:m68k-amigaos,ppc-amigaos,ppc-morphos
Date:2025-02-09
Download:dev/asm/ira.lha - View contents
Readme:dev/asm/ira.readme
Downloads:9805

When I was in need for a portable M68k reassembler I remembered Tim Ruehsen's
IRA source, and put some effort into it to make it portable to any
architecture and to any compiler. Parts were taken from Ilkka Lehtoranta's
MorphOS port of IRA 1.05, who already cleaned the code from all SAS/C
dependencies. But most effort was put into making the reassembler
endian-independant.


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> [@ $<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
  addressing 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).


-- Modifications for V2.05 --

Bug fixes:
- Fixed a possible crash when a config file defines a SYMBOL where the
  assigned value is not within the reassembled address range.
- Fixed a crash on encountering relocations at an odd address. This cannot
  easily be supported at the moment, so IRA will just quit when it happens.
- Reverted some stupid changes of the last release. Always prefer a label
  from the referring section in case both have the same address.

New features:
- Config file directive NOPTRS. Syntax is like PTRS, but it will prevent IRA
  from taking any address in this region as a program pointer (which would
  generate a label). Only works with binary input files!


-- Modifications for V2.06 --

Bug fixes:
- Make IRA compile and work on 64-bit systems (using a 64-bit compiler).
- An empty register list is now written as #0 instead of (NOREG!). This
  makes it assemble (with vasm at least).
- Fixed label-generation for references into the middle of a data relocation
  (e.g. use "label+2" instead of making a new label, which caused trouble).
- Put both sides of the subtract operation into parentheses, when generating
  code for a jump table (to avoid problems with "label1-label2+2").
- Fixed some possible crashes.


-- Modifications for V2.07 --

Bug fixes:
- A lot more fixes to make IRA clean for 64-bit compilers. Seems to work
  much better now.
- A base address of 0 should be allowed with binary files.

New features:
- Allow comments ';' and empty lines in the config file.


-- Modifications for V2.08 --

Bug fixes:
- Fixed problems with printf output formats for 64-bit compilers.
- $083c is illegal and was erroneously disassembled to BTST #n,CCR.
- Fixed CMP2, CHK2, CAS, CAS2.

New features:
- Do not overwrite an existing config file, when -preproc is specified.
- Make it work on Mac OSX 64-bit systems.


-- Modifications for V2.09 --

Bug fixes:
- Fixed possible crash with low memory.
- Fixed CINV and CPUSH (only "LINE" operations were recognized).
- Fixed input file names with deep paths.
- Fixed negative values on 64-bit systems.
- Fixed MOVE16 (only MOVE16 (Ax)+,(Ay)+ were recognized).
- Fixed MOVEC (incorrect control register).
- Fixed MOVES (extension word were ignored).
- Fixed BFINS (swapped operands).

New features:
- Support for extended memory attributes in Amiga executables.
- Improve CPU choice on command line.
- New general documentation file (ira2.doc).
- New documentation file about config file's directives (ira_config.doc).
- New directives for config file: COMMENTS, BANNER, EQU and LABEL (see
  ira_config.doc).
- Improve error messages.
- Also support '0x' to denote hexadecimal addresses on the command line.
- New option -AW enforces 8-digit address output, when printing address
  and data in the comment field.
- Support for 68060 instructions (except FPU).
- Support for MMU instructions.


-- Modifications for V2.10 --

Bug fixes:
- Fixed parsing of HUNK_RELOC32SHORT/HUNK_DREL32.
- Renamed itoa() to avoid conflicts with compilers providing that function.
- -binary option always overrides the automatic format detection.
- Fixed detection of memory rotate instructions.
- Instructions with 32-bit absolute addressing, but with a relocation
  which extends into the following instruction, cannot be valid.
- Fixed ROMTag detection with a NULL-pointer for the Init-code.

New features:
- Supports HUNK_RELRELOC32 and EXT_RELREF32 in executables and object files.
  But cannot create labels for such references at this time.


-- Modifications for V2.11 --

Bug fixes:
- Fixed TRAP_nn symbols for address range $80 to $bc.
- Instructions with PC-relative references outside of the current section
  are no longer ignored but generated with a constant displacement.
- Paths are no longer trimmed to their file-part before adding an
  extension. Support for '\' and '/' as path separators.
- Fixed references using an offset relative to a section's start, when a
  symbol is defined for that start address.
- Referencing a location before the program's first section made the
  reassembler fail and probably crash. Patch by Howard Price.
- OFFSET from the config file needs to be parsed before the source file.
- Fixed missing hex-dump for 8-bit jump-tables. Patch by Howard Price.
- Ignore symbols at section start, whenever the current or the previous
  section is empty (-keepzh). Otherwise it would be undefined to which
  section such symbols belong.

New features:
- IRA reads Atari TOS executables!
- Option -LABEL=<n> lets you select the label-style.
  0: original style with 4-digit continuous index: LAB_NNNN, EXT_NNNN
  1: use hexadecimal address in label: LAB_ADDR, EXT_ADDR
- Option -RADIX=<n> selects the radix for displacements and equates.
  0: use hex for values >= 10, decimal for the rest (including negatives)
  10: print as decimal
  16: print as hexadecimal, except -9 to 9, which is printed decimal
- -compat=bi writes the original 16-bit value for a negative 8-bit
  immediate, which can be reproduced by vasm V2.
- Option -FIXLABELS prepends 'L' in front of symbol names which might be
  illegal or have local scope on many assemblers.
- COMMENT and BANNER directives allow text with leading blanks. Patch by
  Howard Price.
- New config file directive EXTSYM to define replacement symbols for the
  auto-generated EXT_nnn equates.


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/3.x (PPC)


SOURCE TEXT

- Use "Makefile" to compile IRA with gcc for any Unix.
- Use "Makefile.win32" to compile IRA for Windows (tested with VC6).
- Use "Makefile.osx" to compile IRA for Mac OS X.
- Use "Makefile.os3" to compile a native binary with vbcc for AmigaOS 2.x/3.x.
- Use "Makefile.os4" to compile a native binary with vbcc for AmigaOS4.x.
- Use "Makefile.mos" to compile a native binary with vbcc for MorphOS.

Note: On BSD systems use GNU's make command ("gmake") and not the
      native one ("make").


USAGE

The original IRA was tuned for PhxAss, which might still work. The
recommended assembler is vasm/M68k V1.7 or greater though, which you
should call with the -no-opt option to avoid optimizations, 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 -no-opt -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 within 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.
Refer to ira2.doc for IRA V2.xx documentation.
Refer to ira_config.doc for a description of config directives.

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@phoenix.owl.de).


Contents of dev/asm/ira.lha
 PERMSSN    UID  GID    PACKED    SIZE  RATIO METHOD CRC     STAMP          NAME
---------- ----------- ------- ------- ------ ---------- ------------ -------------
drwxr-xr-x  1000/100         0       0 ****** -lhd- 0000 Feb  8 10:35 ira/
-rw-r--r--  1000/100       101     113  89.4% -lh5- 6ae5 Aug 31  2015 ira/Makefile
-rw-r--r--  1000/100       129     149  86.6% -lh5- 5f39 Jun  5  2009 ira/Makefile.mos
-rw-r--r--  1000/100       133     153  86.9% -lh5- 7a17 Aug 31  2013 ira/Makefile.os3
-rw-r--r--  1000/100       140     165  84.8% -lh5- f0d7 Jun  5  2009 ira/Makefile.os4
-rw-r--r--  1000/100       103     117  88.0% -lh5- 1319 Jan 20  2014 ira/Makefile.osx
-rw-r--r--  1000/100       239     336  71.1% -lh5- b04d Jul  2  2009 ira/Makefile.win32
-r--r--r--  1000/100      5391   32477  16.6% -lh5- bd00 Oct  2  2021 ira/amiga_hunks.c
-rw-r--r--  1000/100      1767    4993  35.4% -lh5- 4799 Apr 21  2021 ira/amiga_hunks.h
-r--r--r--  1000/100      2345    7106  33.0% -lh5- db04 Jun  2  2024 ira/atari.c
-rw-r--r--  1000/100       727    1718  42.3% -lh5- 3d44 Jun  1  2024 ira/atari.h
-rw-r--r--  1000/100       685    1525  44.9% -lh5- 9631 Apr 23  2021 ira/binary.c
-rw-r--r--  1000/100       228     359  63.5% -lh5- fea1 Mar 17  2017 ira/binary.h
-r--r--r--  1000/100      7322   39324  18.6% -lh5- 715c Jan  2 17:20 ira/config.c
-rw-r--r--  1000/100       443    1113  39.8% -lh5- 8d77 Dec 21 10:16 ira/config.h
-rw-r--r--  1000/100      6807   59865  11.4% -lh5- 4ab0 Jun  2  2024 ira/constants.c
-rw-r--r--  1000/100       413     987  41.8% -lh5- 664a Mar 17  2017 ira/constants.h
-rw-r--r--  1000/100       239     389  61.4% -lh5- dd1f Mar 17  2017 ira/elf.c
-rw-r--r--  1000/100       621    1414  43.9% -lh5- 0a4c Mar 17  2017 ira/elf.h
-rw-r--r--  1000/100      4932   20522  24.0% -lh5- 099f Jan  6 16:29 ira/init.c
-rw-r--r--  1000/100       340     607  56.0% -lh5- 6801 Mar 17  2017 ira/init.h
-rw-r--r--  1000/100     27530  155388  17.7% -lh5- 8171 Jan  6 16:37 ira/ira.c
-rw-r--r--  1000/100      7330   18639  39.3% -lh5- 00f3 Apr  2  2009 ira/ira.doc
-rw-r--r--  1000/100      7724   32251  23.9% -lh5- 32bd Feb  8 10:19 ira/ira.h
-rw-r--r--  1000/100      6063   14639  41.4% -lh5- 3e61 Jan  6 16:38 ira/ira.readme
-rw-r--r--  1000/100      5412   13869  39.0% -lh5- 5c4d Jan  6 16:41 ira/ira2.doc
-rw-r--r--  1000/100      4268   18141  23.5% -lh5- 91b0 Dec 22 13:04 ira/ira_2.c
-rw-r--r--  1000/100       432     972  44.4% -lh5- f129 Dec 22 13:04 ira/ira_2.h
-rwxr-xr-x  1000/100     52212  118464  44.1% -lh5- a94d Feb  8 10:35 ira/ira_68k
-rw-r--r--  1000/100      3405   13259  25.7% -lh5- f6b9 Dec 21 10:02 ira/ira_config.doc
-rwxr-xr-x  1000/100     63702  166492  38.3% -lh5- 3f0d Feb  8 10:35 ira/ira_mos
-rwxr-xr-x  1000/100     66090  167028  39.6% -lh5- 39ee Feb  8 10:35 ira/ira_os4
-rw-r--r--  1000/100       581    1975  29.4% -lh5- 7fa1 May 17  2019 ira/make.rules
-rw-r--r--  1000/100       549    1377  39.9% -lh5- 8fa3 Mar 13  2017 ira/megadrive.c
-rw-r--r--  1000/100       343     571  60.1% -lh5- 978a Mar 13  2017 ira/megadrive.h
-rw-r--r--  1000/100       130     149  87.2% -lh5- 12ee Aug 17 09:50 ira/mymakefile
drwxr-xr-x  1000/100         0       0 ****** -lhd- 0000 Feb  8 10:25 ira/obj/
-rw-r--r--  1000/100         0       0 100.0% -lh0- 0000 Mar 29  2009 ira/obj/.dummy
-rw-r--r--  1000/100      1392    3365  41.4% -lh5- e0f0 Mar 13  2017 ira/opcode.c
-rw-r--r--  1000/100       294     498  59.0% -lh5- c1e3 Mar 13  2017 ira/opcode.h
-r--r--r--  1000/100      1604    5037  31.8% -lh5- cdb9 Dec 22  2023 ira/supp.c
-r--r--r--  1000/100       431    1032  41.8% -lh5- ddb6 Dec 27  2020 ira/supp.h
---------- ----------- ------- ------- ------ ---------- ------------ -------------
 Total        42 files  282597  906578  31.2%            Feb  9 00:40
Page generated in 0.02 seconds
Aminet © 1992-2024 Urban Müller and the Aminet team. Aminet contact address: <aminetaminet net>