Macro80/Link80 version 3.44 patches for ZRDOS/ZCPR3 The following two short .HEX segments are overlay patches for M80 and L80. To use them, write the hex code between the horizontal lines out into seperate files and use MLOAD to overlay the .COM originals. EG: (write first block of hex code to MPAT.HEX) MLOAD M80.COM MPAT.HEX The first, for Macro-80, causes M80 to increment ZCPR3 flags 0 and 1 whenever a fatal error or warning is found during assembly. I use ZEX frequently to assemble a number of files with different option switches and link the .RELs together; as this takes a while, I normally go and get a coffee during the assembly, and a well-known law states that if one of the files has errors the warning message will have been scrolled off the screen before I return. However, the patch allows ZEX to examine the flags and abort the batch if any errors are found. The second patch cures an annoying "feature" of Link-80. In between commands it resets the disk system, presumably in case the disks have been changed. Apart from adding significantly to the time for complex links, it crashes the system if there's no disk in the A drive. This is not necessary for ZRDOS and can be killed by writing NOPs over the three BDOS calls at 02DEH, 02C4H and 02DBH. I'd like to have a patch for detecting undefined globals at the end of the link and setting a flag for ZEX, but this requires detecting that L80 is about to exit. WARNING: these patches are only valid for the 3.44 versions of M80/L80 dated 09-Dec-81. Hack for Microsoft Macro-80 3.44 09-Dec-81 Intercepts errors and warnings and increments : Flag byte 0 (0FDB0H) for fatal errors Flag byte 1 (0FDB1H) for warnings If your flags are at different locations you'll have to edit your addresses into the hex and change the checksum. To calculate the checksum add all the data bytes together, mod 256, invert and add 1. EG: 01+01+27+00+80=A9, NOT(A9)=56, +1 gives 57. check: (01+01+27+00+80+57) MOD 100H = 00. ------------------------------------------- :010127008057 :012E1500803C :022EC900404F78 :032F0000CD504F62 :104F40003AB0FD3C32B0FDAFC3D12E0000000000EE flag 0 ^^^^ ^^^^ checksum ^^ :104F50003AB1FD3C32B1FDAF215F2FC90000000026 flag 1 ^^^^ ^^^^ checksum ^^ :00000001FF ------------------------------------------- (End Macro-80 hack) Hack for Microsoft Link-80 3.44 09-Dec-81 Removes disk reset between file links, greatly speeding up long batch jobs. ------------------------------------------- :0302CE000000002D :0302D40000000027 :0302DB0000000020 :00000001FF ------------------------------------------- (End Link-80 hack) My ZEX file to use these patches goes as follows. ;; ZEX submit file for multiple assembly. Assembles .MAC files ;; from current user area, transfers them into area $1 (you enter), ;; links them into $2.HEX (you enter), and saves an ID file $3 ;; (which you enter). 3 parameters needed. ;; --- eg --- ZEX ASM 1: HEXFILE -USERID ;; builds HEXFILE.HEX in user area 1 and saves -USERID as i/d ;; ^<^|Assembling into area $1 and producing file $1$2.HEX^|^> ;; clear error registers root:reg s# 0 root:quiet s root:m80 =file1 =file2 =file3 =file4 =file5 =file6 =file7 =file8 =file9 =file10 =vars ^C ;; if both flag 0 and flag 1 are zero, do the link if 0 0 if 1 0 echo Assembly complete, moving files now ..| $1| era *.rel root:move 0:*.rel $1 if ~nu $3 if ~ex $3 save 0 $3 fi fi echo Linking files ..| l80 /p:100,/d:4000 vars file1,file2,file3,file4,file5,file6,file7,file8,file9,file10 $2/n:p/e/x ;; else ;; if flag 1 was non-zero echo ^g There were assembler warnings!| root:reg d1 fi else ;; if flag 0 was non-zero echo ^g There were fatal errors!| root:reg d0 fi root:quiet r ^<^|That's all, folks!^|^> Peter Hand, Portsmouth, England