CPCWiki forum

General Category => Programming => Topic started by: Toundrik on 16:23, 24 July 19

Title: AMSDOS header and execution address
Post by: Toundrik on 16:23, 24 July 19
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 !
 
Title: Re: AMSDOS header and execution address
Post by: GUNHED on 22:54, 24 July 19
The Amsdos header is also explained in the FutureOS manual. Maybe this helps a bit.  :)
Title: Re: AMSDOS header and execution address
Post by: Duke on 07:02, 25 July 19
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)
Title: Re: AMSDOS header and execution address
Post by: Toundrik on 09:07, 25 July 19
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