First post, by superfury
According to the manuals I can find, the MUL and IMUL instructions (both byte and word sized) only affect the carry and sign flags (set or cleared depending on AX or DX::AX overflow).
However, I find some strange bit of CPU detection code in the Super PC/Turbo XT BIOS 2.5 (detecting 8088 vs V20 CPU):
;---------------------------------------------------------------------------------------------------
; Detect CPU type (8088 or V20)
;---------------------------------------------------------------------------------------------------
proc cpu_check near ; Test for 8088 or V20 CPU
xor al, al ; Clean out al to set ZF
mov al, 40h ; mul on V20 does not affect the zero flag
mul al ; but on an 8088 the zero flag is used
jz @@have_v20 ; Was zero flag set?
mov si, offset str_8088 ; No, so we have an 8088 CPU
ret
@@have_v20:
mov si, offset str_v20 ; Otherwise we have a V20 CPU
ret
endp cpu_check
According to this code, the zero flag is affected like other instructions with 8-bit MUL instructions? What about 16-bit MUL instructions and IMUL instructions? Does the zero flag work or not?
Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io