Ultimate Amiga

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Getting to the Source  (Read 3403 times)

0 Members and 1 Guest are viewing this topic.

wiiz

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 5
Getting to the Source
« on: May 26, 2009, 04:57:50 PM »

Hello,

Does anyone know if there's a utility (Amiga or Linux) that allows you to extract the source code from a *.AMOS file? I've been searching around but I've not been able to find anything. I've tried Aminet, AMOS PD and good ol' Google.

I'm working on a VM that allows you to run Basic code on various machines including consoles, and I'm testing it with some AMOS code.

I have tried using the specification for the AMOS file format given over at Amiga Coding to write my own parser, but there are lots of undocumented bits of files I don't know what to do with.

At the moment I'm using AMOS Pro under emulation on Linux, loading each program, selecting all text and saving as ASCII. Then going to direct mode and saving any memory banks from there.

Does anyone have a better (quicker or more automated) way of doing this?
Logged

SamuraiCrow

  • compile-time wierdo
  • Forum Mod
  • A1200
  • *****
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 946
  • Compile-time wierdo
Re: Getting to the Source
« Reply #1 on: May 27, 2009, 02:46:07 AM »

http://alvyn.sourceforge.net/amos_file_formats.html may help you get to the source.

-edit-
The extensions to the Amos language will leave undocumented holes in the code unless you know what the slots are for each extension.

You're best off saving the .ASC files like you've been doing.
« Last Edit: May 27, 2009, 02:49:02 AM by SamuraiCrow »
Logged

asymetrix

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 56
  • Amos Documentation
Re: Getting to the Source
« Reply #2 on: May 27, 2009, 09:58:31 AM »


SamuraiCrow is correct, thats the easiest way.

Amos Pro does have an AREXX port, maybe that could be a way to access the code.
Logged

SamuraiCrow

  • compile-time wierdo
  • Forum Mod
  • A1200
  • *****
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 946
  • Compile-time wierdo
Re: Getting to the Source
« Reply #3 on: May 27, 2009, 10:36:37 AM »

AmosPro can call other programs with AREXX ports but it doesn't support its own AREXX port as far as I know.  I just looked in the manual to verify it.
Logged

wiiz

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 5
Re: Getting to the Source
« Reply #4 on: May 27, 2009, 06:11:40 PM »

Thanks for confirming that. For a second I got excited about the prospect of using AREXX port, but I'm not going to follow that up now as I need to stop finding distractions, and get on with making the VM work. :)
Logged

asymetrix

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 56
  • Amos Documentation
Re: Getting to the Source
« Reply #5 on: May 28, 2009, 07:16:00 AM »

hmm just been checking too, documentation about adding AREXX to an Amos app, but no AREXX IN AMOS - OMG.

We need an extension with AREXX support.

Anyway, we also need to identify different extensions in the .AMOS format, I was after a batch converter a while back without success.

If we know where in memory the source is stored, or how the save as ascii menu works maybe you could trigger it.
Logged

wiiz

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 5
Re: Getting to the Source
« Reply #6 on: May 28, 2009, 08:20:05 AM »

The closest I got was writing my own C routine that reads in bytes from the *.AMOS file using the information I gathered from here: http://www.amigacoding.com/index.php/AMOS:File_Formats

I spent far too long getting around Big Endian / Little Endian compatibility then I got as far as printing the main structural tokens. I gave up when I realised I didn't have enough information to work out the ASCII for instructions or extension commands.

Automating calls to AMOS' built in Save as ASCII would be awesome, if someone could work that out.
Logged
Pages: [1]   Go Up
 

TinyPortal 2.2.2 © 2005-2022