I'm now looking for a correct assembler able of outputing a s-19 file. I use the wikipedia page and the linux man page to understand how this format file works.
S10D4000AD08408D094038607700D8
SA DEST 4009 0 17 2 0
SA SOURCE 4008 0 17 2 0
S9030000FC
The problem here is at the last line : a S9 command should contain the starting execution address, fasm is always giving 0000.
srec man wrote:
The address field contains the starting execution address and is interpreted as a 2-byte address.
Not necessarily. Motorola made that address optional (also true of S8 and S7 records), since S-records could be used for any kind of data transfer, not just transfer of an executable binary. It's up to the program that generates the S-records to decide whether or not to populate the execution address field. It's also up to the program that reads and interprets the S-records to decide if the address field in an S7, S8 or S9 record is meaningful. In your case, each S1 record implicitly states the load address.
Quote:
AS65 wrote:
S10D4000AD08408D094038607700D8
S5030001FB
The problem here is on the first line. If you look at the "count bytes" it's 0D, but it have to be 0E, no ?
srec man wrote:
These characters when paired and interpreted as a hexadecimal value, display the count of remaining character pairs in the record.
I counted 13 pairs, so $0D is correct. The byte count encompasses everything after the byte count. Hence the count includes the record load address (4000), the data (AD08408D094038607700) and the record checksum D8.
For that one a non-zero start address is generated by placing an expression representing it after an 'END' pseudo op. No 'END' pseudo op or no expression following it gets the default '0000' value in an S9 record.
I haven't read its documentation but FASM may also want the programmer to explicitly state somewhere what the start address value should be if it's supposed to be non-zero.
I notice that both FASM and AS65 generate the same first line, the S1 record, for your sample code. AS65's second output line is a correct S5 record (data record count), not an S9 (start address), which doesn't appear.
I notice that both FASM and AS65 generate the same first line, the S1 record, for your sample code. AS65's second output line is a correct S5 record (data record count), not an S9 (start address), which doesn't appear.
The S5 or S6 record, according to the official Motorola standard, is optional but recommended to help detect corruption issues (i.e., missing records). The only mandatory records are 1 (as many as required) and 9. While required, the S9 record is usually ignored by most loaders. Its presence in the data stream merely signifies the end of data.
The S5 or S6 record, according to the official Motorola standard, is optional but recommended to help detect corruption issues
Sorry, I didn't mean to imply these were required records. I simply meant that there is nothing wrong with the S5 record itself in AS65's output. The OP's concern seems to be about correct S1 records and S9 records that contain start addresses. I'm just pointing out that the S1 records are identical in both cases and that AS65 did not output any S9 record that was shown to us.
Well, it seems I may did an error or two
FASM and AS65 are good for their first S1 line, I was wrong (I was not sure, as I said in the first post). For the start address, I will have another look in the FASM doc in order to be sure that I can ask for a correct address.
Thanks to everyone for your help !
Mindiell
-----------------------
French coder of a new 6502 simulator