News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

AMSDOS header and execution address

Started by Toundrik, 16:23, 24 July 19

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Toundrik

Hi !I was wondering lately if I could disassemble an original program, like 'Roland In Time' for instance  :D
So I started by extracting DISC.BIN from the dsk file and with an hex editor (hexdump on Linux), I read the AMSDOS header, which looks like this :
██ hd disc.bin
00000000  00 44 49 53 43 20 20 20  20 42 49 4e 00 00 00 00  |.DISC    BIN....|
00000010  00 00 02 00 00 40 00 00  25 05 d3 00 00 00 00 00  |.....@..%.......|
00000020  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00000040  25 05 00 e5 03 16 ff fd  6e 02 26 00 cb 7d 28 02  |%.......n.&..}(.|
00000050  26 ff fd 7e 00 fe 01 d8  28 05 cd c3 bb 18 03 cd  |&..~....(.......|
00000060  f9 bb fd 23 fd 23 fd 23  18 d2 1a 00 00 00 00 00  |...#.#.#........|
00000070  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

Looking in the wiki, they say that addresses are in the Least Significant Byte first format and so I understand that bytes 0 to 15 are the filename, 18 is file type (binary) , 21 and 22 where the data originated from (&0040 ??) , 26 and 27 the execution adress (&00d3 ??). So should I assume that this particular program put itself in memory starting at &0040 and start executing from &00d3  ? Or is it, as I guess, &4000 and &d300 ?
Thanks !
 

GUNHED

The Amsdos header is also explained in the FutureOS manual. Maybe this helps a bit.  :)
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

Duke

Quote from: Toundrik on 16:23, 24 July 19
Looking in the wiki, they say that addresses are in the Least Significant Byte first format and so I understand that bytes 0 to 15 are the filename, 18 is file type (binary) , 21 and 22 where the data originated from (&0040 ??) , 26 and 27 the execution adress (&00d3 ??). So should I assume that this particular program put itself in memory starting at &0040 and start executing from &00d3 ?
That is correct. (start &40, length &525 exec &d3)

Toundrik

Thanks ! I was a little disturbed by the very low loading address (&0040) but it's just at the beginning of Basic token area so it's ok for assembly. Now I'll try to dissasemble and understand this loading program  :)

Powered by SMFPacks Menu Editor Mod