50 unsigned char magic[2];
52 if (
'M'!=magic[0] ||
'Z'!=magic[1])
115 if (define_rm_section)
135 for (SgAsmGenericSectionPtrList::const_iterator si=sections.begin(); !dos2 && si!=sections.end(); si++)
220 write(f, 0,
sizeof(disk), &disk);
236 rose_addr_t rm_size = rm_end>rm_offset ? rm_end-rm_offset : 0;
241 if (max_offset < rm_offset) {
243 }
else if (rm_offset + rm_size > max_offset) {
244 rm_size = max_offset - rm_offset;
278 sprintf(p,
"%sDOSFileHeader[%zd].", prefix, idx);
280 sprintf(p,
"%sDOSFileHeader.", prefix);
287 fprintf(f,
"%s%-*s = %u 512-byte pages\n", p, w,
"e_total_pages",
p_e_total_pages);
288 fprintf(f,
"%s%-*s = %u relocations\n", p, w,
"e_nrelocs",
p_e_nrelocs);
290 fprintf(f,
"%s%-*s = %u 16-byte paragraphs\n", p, w,
"e_minalloc",
p_e_minalloc);
291 fprintf(f,
"%s%-*s = %u 16-byte paragraphs\n", p, w,
"e_maxalloc",
p_e_maxalloc);
292 fprintf(f,
"%s%-*s = 0x%08u (%u)\n", p, w,
"e_ss",
p_e_ss,
p_e_ss);
293 fprintf(f,
"%s%-*s = 0x%08u (%u)\n", p, w,
"e_sp",
p_e_sp,
p_e_sp);
294 fprintf(f,
"%s%-*s = %u (zero implies not used)\n",p, w,
"e_cksum",
p_e_cksum);
295 fprintf(f,
"%s%-*s = 0x%08u (%u)\n", p, w,
"e_ip",
p_e_ip,
p_e_ip);
296 fprintf(f,
"%s%-*s = 0x%08u (%u)\n", p, w,
"e_cs",
p_e_cs,
p_e_cs);
298 fprintf(f,
"%s%-*s = %u\n", p, w,
"e_overlay",
p_e_overlay);
301 fprintf(f,
"%s%-*s = [%d] \"%s\"\n", p, w,
"relocs",
304 fprintf(f,
"%s%-*s = none\n", p, w,
"relocs");
307 fprintf(f,
"%s%-*s = [%d] \"%s\"\n", p, w,
"rm_section",
310 fprintf(f,
"%s%-*s = none\n", p, w,
"rm_section");
381 write(f, 0,
sizeof disk, &disk);
389 sprintf(p,
"%sDOSExtendedHeader[%zd].", prefix, idx);
391 sprintf(p,
"%sDOSExtendedHeader.", prefix);
398 fprintf(f,
"%s%-*s = %u\n", p, w,
"e_oemid",
p_e_oemid);
399 fprintf(f,
"%s%-*s = %u\n", p, w,
"e_oeminfo",
p_e_oeminfo);
405 fprintf(f,
"%s%-*s = %"PRIu64
" byte offset (0x%"PRIx64
")\n", p, w,
"e_lfanew",
p_e_lfanew,
p_e_lfanew);