I'm trying to disassemble an old DOS application and got stuck at some point of the VESA graphics handling.
The VESA function to be called will be stored in a global variable, e.g.
vesa_fct_dword_749C8 = 0x4f00,
After checking the return value, the application will do some additional magic, which I, frankly, don't understand. My guess is that it will check for a specific error return value (
0x01, in particular), but I'm really not quite sure about it and how it's actually done.
Here's the relevant snippet:
cseg01:000159D8 loc_159D8: ; CODE XREF: checkForVesa+D4↑j cseg01:000159D8 mov eax, vesa_fct_dword_749C8 cseg01:000159DD mov edx, vesa_fct_dword_749C8 cseg01:000159E3 sar edx, 1Fh cseg01:000159E6 shl edx, 8 cseg01:000159E9 sbb eax, edx cseg01:000159EB sar eax, 8 cseg01:000159EE and eax, 0FFh cseg01:000159F3 cmp eax, 1 cseg01:000159F6 jnz short loc_15A01 cseg01:000159F8 mov [ebp+var_4], 0 cseg01:000159FF jmp short loc_15A29
Maybe someone knows what's up with that part, that would be really appreciated!