Skip to content

epi/xebin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xebin - Atari XL/XE Binary File Utility

xebin is a small command-line utility for manipulating atari binary (executable) files. It can list contents of binary file, merge several files into a single loadable file, or pack file in a way similar to Piotr Fusik’s FlashPack.

xebin is written in D programming language and tested under Linux and, occasionally, Windows. However, it should be possible to build and run it on any platform, for which D compiler is available. It is designed to be easily embeddable in build scripts.

Installation

Both binary releases for Windows and sources for all platforms are available at github.

To build xebin from sources, you need DMD 2.076 or newer.

Go to console window, and type:

$ dub build -b release

After successful build, you can move file xebin.exe or xebin to a directory within your PATH.

Usage

A general syntax is:

$ xebin command [options] [input_files]

You can place options wherever you wish in the command line, as well as join single-letter options together, if they do not require parameters.

For all specific commands below you can skip input files specification. In such case, xebin will read from standard input.

Similarly, xebin writes its output to standard output, but you can (and usually you should) specify an output file name with -o or --output option. When using -v or --verbose option, additional output is always written to stdout.

You can see the list of available commands and options by typing:

$ xebin help

Listing binary file contents

$ xebin l[ist] [input_files]

Example output:

D:\proj\tipview>xebin l tv10.xex
  0. 8C00-903C (043D)
  1. 91DD-A3B7 (11DB)
  2. Run 91FD

With -v contents of packed blocks are shown, e.g.:

D:\proj\fail\vrgb\xebin l vrgb10.xex
  0. 4000-470E (070F) (FlashPack 1.0)
      0. 3000-39A0 (09A1)
      1. 3C21-3C48 (0028)
      2. 3CC1-3CF1 (0031)
      3. Run 3000
  1. Init 4000

Merging two or more files

$ xebin m[erge] [-o=fn] [-v] [input_files]

Blocks from all files are concatenated in the order they appear in the list of input files.

Reduntant FFFF headers are dropped.

-v displays layout of resulting file.

Extracting block from binary file

$ xebin e[xtract] [-n=pos] [-r] [-o=fn] [-v] [input_files]

Default option is to extract first block of first input file, including its binary header.

Option -n=pos or --position=pos allows extracting other blocks. Block numbering is continuous across all input files and starts from 0. Only one block is extracted at a time.

Option -r or --raw strips header from extracted block.

-v displays info about extracted block.

Disassembling binary file

$ xebin d[isasm] [-o=fn] [input_files]

Generated output is compatible with xasm, except for the "unofficial" 6502 opcodes. Opcode names and argument syntax are taken from Atari 800 emulator. No labels are created — absolute addresses are printed for all variables, jumps, etc.

Compressing binary file

$ xebin p[ack] [-a=ad] [-s] [-o=fn] [-v] [input_files]

The command compresses a binary file using FlashPack algorithm. For each group of blocks between Init and Run blocks, it creates a single packed block with its own depacker. Init and Run blocks are copied unchanged.

xebin tries to determine address of packed block so it won’t collide with unpacked blocks. You can override its guess, or just give it a hand when it fails to do so, by using -a=ad or --address=ad option. Address may be supplied in decimal or hexadecimal (with 0x or $ prefix) notation. Address prefixed with - is treated as address of the last byte of packed block.

-s or --disable-os will cause the interrupts and OS ROM be disabled during depacking. Apart from an unnoticeable speed-up, it allows for placing unpacked blocks in areas of RAM normally hidden under OS ROM.

-v displays layout of resulting file and some statistics.

Unpacking binary file

xebin can also unpack FlashPack-compressed files. It handles files created by Piotr Fusik’s FlashPack 1.0 or 2.1, or xebin itself.

$ xebin u[npack] [-o=fn] [-v] [input_files]

-v displays layout of resulting file.

History

xebin 1.1.0 (2011-04-20)

Fixed bug in auto address setting for packed data. Command line options and parameters work according to description. Added support for hexadecimal addresses. Added simple disassembler. Added option to extract block from binary file. Added option to list contents of compressed blocks. xebin pack -v shows some statistics. Build process simplified by incorporating xasm in xebin.

xebin 1.0.0 (2011-01-13)

Initial release.

Bugs

It is impossible to set different addresses for multiple input files in pack option, as well as different settings for OS ROM and interrupts.

Feedback

Issues with xebin should be reported via this tracker.

Authors

Piotr Fusik

Original FlashPack program, depacker routines, testing.

Adrian Matoga

Programming.

License

Poetic License:

This work 'as-is' we provide.
No warranty express or implied.
We've done our best,
to debug and test.
Liability for damages denied.

Permission is granted hereby,
to copy, share, and modify.
Use as is fit,
free or for profit.
These rights, on this notice, rely.

About

Atari XL/XE Binary File Utility

Resources

Stars

Watchers

Forks

Packages

No packages published