diff --git a/src/dos32a/loader.asm b/src/dos32a/loader.asm index 23c34e6..65fff5d 100755 --- a/src/dos32a/loader.asm +++ b/src/dos32a/loader.asm @@ -294,17 +294,27 @@ apply_fixups: @@0: push ecx edi mov _err_code,4005h ; "unrecognized fixup data" mov cx,gs:[esi+0] ; get SRC/FLAGS + test cl,20h + jnz srclist movsx edx,word ptr gs:[esi+2] ; get SRCOFF movzx eax,word ptr gs:[esi+4] ; get OBJNUM + add esi,6 add edi,edx ; calculate dest addr to be fixed - test cx,0F20h ; SrcLists/Imports not supported + jmp srclst_cnt +srclist: + shl ecx, 8 + mov cl,byte ptr gs:[esi+2] ; get number of list entries + movzx eax,word ptr gs:[esi+3] ; get OBJNUM + add esi,5 + ror ecx, 8 +srclst_cnt: + test cx,0F00h ; Imports not supported jnz file_errorm ; jump if one of these test cx,4000h ; test if 16bit object number jnz @@1 ; if yes, jump mov ah,0 dec esi -@@1: add esi,6 - dec eax ; Object Number - 1 +@@1: dec eax ; Object Number - 1 shl eax,4 mov edx,_app_tmp_addr1 sub edx,eax @@ -323,11 +333,28 @@ apply_fixups: movzx eax,ax sub esi,2 @@2: add esi,4 -@@3: cmp cl,07h + + test cl,20h ; On source list: + jz @@3 +@@7: pop edi ; Restore edi for next entry + push edi + movsx edx,word ptr gs:[esi] ; get SRCOFF + add esi, 2 + add edi,edx ; calculate dest addr to be fixed + +@@3: cmp cl,07h ; 32bit offset fixup jnz @@4 add eax,edx mov gs:[edi+0],eax -@@5: pop edi ecx +@@5: test cl,20h ; On source list: + jz @@6 + ror ecx, 16 ; Check if number of entries has been eached + inc cl + cmp cl, ch + ja @@6 + rol ecx, 16 + jmp @@7 +@@6: pop edi ecx cmp esi,ecx jb @@0 ret