I did need a quick utility to convert the non-executable on QDOSMSQ, to an executable with the correct data space, as taken from the 'XTcc' header at the end of the compiled file. To this end, I quickly knocked up the following:
Code: Select all
1000 REMark A program to extract the XTcc record from the end of a
1010 REMark Cross-compiled executable file and set the dataspace to
1020 REMark the correct value.
1030 :
1040 REMark Norman Dunbar
1050 REMark 30th October 2018.
1060 :
1070 REMark Uses DJToolkit
1080 :
1085 CLS
2000 REPeat file_loop
2010 PRINT #1
2020 INPUT #1, 'Enter the cross-compiled filename please, ENTER to quit: '; f$
2030 IF f$ = '' THEN EXIT file_loop: END IF
2040 IF FILE_TYPE(f$) = 1 THEN
2050 PRINT #1,f$; ' is already an executable file, with dataspace set to ';
2060 PRINT #1,FILE_DATASPACE(f$)
2070 NEXT file_loop
2080 END IF
2090 :
2100 size = FILE_LENGTH(f$)
2110 IF size < 0 THEN
2120 PRINT #1,'Error '; size; ' reading file size for '; f$
2130 NEXT file_loop
2140 END IF
2150 :
2160 addr = RESERVE_HEAP(size)
2170 IF addr < 0 THEN
2180 PRINT #1, 'Error '; addr; ' allocating memory for '; f$
2190 NEXT file_loop
2200 END IF
2210 :
2220 LBYTES f$,addr
2230 xtcc = SEARCH_I(addr + size - 8, 4, 'XTcc')
2240 IF xtcc = 0 THEN
2250 PRINT #1, f$; ' has no XTcc record present. Cannot continue.'
2260 RELEASE_HEAP(addr)
2270 NEXT file_loop
2280 END IF
2290 :
2300 dspace = PEEK_L(xtcc + 4)
2310 PRINT #1, 'XTcc record found. Dataspace is '; dspace
2320 IF dspace < 512 THEN
2330 PRINT #1, 'Dataspace seems a tad small at '; dspace
2340 PRINT #1, 'You might need to increase it. '
2350 END IF
2360 :
2370 SEXEC_O f$, addr, size, dspace
2380 PRINT f$; ' resaved as executable file, with dataspace set to '; dspace; '.'
2390 RELEASE_HEAP(addr)
2400 PRINT 'Press any key to continue....'
2410 END REPeat file_loop
Cheers,
Norm.