Author Topic: AMSDOS header and execution address  (Read 634 times)

0 Members and 1 Guest are viewing this topic.

Offline Toundrik

  • CPC464
  • **
  • Posts: 12
  • Country: fr
  • Liked: 4
  • Likes Given: 4
AMSDOS header and execution address
« on: 18: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 :
Code: [Select]
██ 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 !
 

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 2.510
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
  • Liked: 1200
  • Likes Given: 2822
Re: AMSDOS header and execution address
« Reply #1 on: 00:54, 25 July 19 »
The Amsdos header is also explained in the FutureOS manual. Maybe this helps a bit.  :)
http://futureos.de --> Get the revolutionary FutureOS (Recent update: 2021.01.24)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.05.02)

Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.244
  • Country: dk
    • spinpoint.org
  • Liked: 1452
  • Likes Given: 1151
Re: AMSDOS header and execution address
« Reply #2 on: 09:02, 25 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)

Offline Toundrik

  • CPC464
  • **
  • Posts: 12
  • Country: fr
  • Liked: 4
  • Likes Given: 4
Re: AMSDOS header and execution address
« Reply #3 on: 11: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  :)