Function:

(8080 is written here as 8O8O to avoid visual confusion with the 8088).
This is the basic instruction used to switch to 8O8O emulation mode.
The BRKEM instruction is used in a similar way to an INT instruction,
(referred to as BRK by NEC). The mode flag (MD) is set to zero, the Flags,
CS & IP are pushed onto the stack then CS & IP are loaded from the
specified interrupt vector.

In 8O8O emulation mode the V30 registers and flags are mapped to 8O8O
registers and flags.

General purpose register names:
┌───┬───┬───┬───┬───┬───┬───┬───┬───┐
8O8O name───────│ A │ B │ C │ D │ E │ H │ L │ SP│ PC│
Intel x86 name──│ AL│ CH│ CL│ DH│ DL│ BH│ BL│ BP│ IP│
V30 name────────│ AL│ CH│ CL│ DH│ DL│ BH│ BL│ BP│ PC│
└───┴───┴───┴───┴───┴───┴───┴───┴───┛

Individual flag names:
┌───┬───┬───┬───┬───┐
8O8O name───────│ C │ Z │ S │ P │ AC│
Intel x86 name──│ CF│ ZF│ SF│ PF│ AF│
V30 name────────│ C │ Z │ S │ P │ AC│
└───┴───┴───┴───┴───┛

In 8O8O emulation mode the segment used for instructions is determined
by the CS (PS) register. The DS (DS0) register determines the segment
used for data.

When an interrupt occurs during 8O8O emulation the CPU switches to native
V30 mode to process the interrupt. When the interrupt handler is complete
the IRET, (RETI in NEC nomenclature), will return to 8O8O emulation mode.

From 8O8O emulation mode RETEM (Return from Emulation, opcode ED FD) returns
to native mode, setting MD flag and restoring flags, CS & IP from the native
stack. Alternatively CALLN imm8 (Call Native, opcode ED ED imm) can be used
to call native V30 interrupts, (just like a regular INT).

Note that 0F is treated as <POP CS> on the 88/86 and prefixes newer
instructions on 286+ CPUs.

(Supplied by Anthony Naggs)




BSF, Bit Scan Forward
──────────────────────────────────────────────────────────────────────────────