3 ms·
The 186 had another condition flag for 'segment prefix present' and decremented PC twice if it was set: ** 0.1010101x STOS 0 IK -> IND 0 F1 6
by rep_lodsb 4y ago
The 186 had another condition flag for 'segment prefix present' and decremented PC twice if it was set:
** 0.1010101x STOS
0 IK -> IND 0 F1 6 ;check count if repeated
1 M -> OPR 6 W DA,BL
2 1 DEC tmpa
3 IND -> IK 0 NF1 7 ;exit if no repeat
4 SIGMA -> BC 5 INT RPTI ;handle interrupt
5 BC -> tmpa 0 NZ 1 ;redundant check???
6 BC -> tmpa 0 NBCZ 1 ;loop while Not BC Zero
7 4 none RNI
** 1.10100100 string instr interrupted (RPTI:)
0 PC -> tmpb 4 none SUSP
1 1 DEC tmpb
2 SIGMA -> tmpb 0 F1 5
3 0 PFX 6
4 SIGMA -> PC 4 FLUSH RNI ;PC corrected
5 SIGMA -> tmpb 0 UNC 3 ;has REP
6 SIGMA -> tmpb 0 UNC 4 ;has seg pfx
7 4 none none
edit
- Posting code for STOS since it's simple, even though segment prefixes don't affect its function.
- No idea if line 5 could be removed, maybe needed for timing?
- MOVS, INS and OUTS use a special memory-to-memory/IO operation encoded as 'W IRQ DD,BL'. It doesn't use the IND register at all, maybe the internal DMA controller instead?
- bonzini 4y agoIs the 186 microcode from a patent as well?
- rep_lodsb 4y agoNo, from long hours of staring at photos of the actual die :) The 8086 patent also only included a few examples, and the naming conventions for microcode registers and instructions. The full microcode for that one was disassembled by Andrew Jenner.
- bonzini 4y agoYeah, I meant this specific example; I didn't know that the 80186 microcode was also disassembled, at least in part. It would be interesting to know how they sped up multiplication and division between the 8086 and 80186!