Previous Thread
Next Thread
Print Thread
Page 255 of 256 1 2 253 254 255 256
Re: PC/XT/AT (inside) WIP topic [Re: Kale] #114272
11/12/18 06:52 PM
11/12/18 06:52 PM
Joined: May 2012
Posts: 490
S
shattered Offline
Senior Member
shattered  Offline
Senior Member
S
Joined: May 2012
Posts: 490
This CPU detection code in Turbo Pascal 7 runtime (RTLSRC/SYS/MAIN.ASM) mis-detects NEC V20 as 80386. That breaks things later on (Runtime error 200). Should V20 emulation do the same as 8086 and set top bits to 1?
Code
Check8086:

        XOR     AX,AX                   ;0 means 8088/8086
        PUSHF                           ;BX = Flags
        POP     BX
        AND     BH,0FH                  ;Clear bits 12-15
        PUSH    BX                      ;Flags = BX
        POPF
        PUSHF                           ;CX = Flags
        POP     CX
        AND     CH,0F0H                 ;Bits 12-15 set?
        CMP     CH,0F0H
        JE      @@1                     ;Yes, 8086
        INC     AX                      ;1 means 80286
        OR      BH,0F0H                 ;Set bits 12-15
        PUSH    BX                      ;Flags = BX
        POPF
        PUSHF                           ;CX = Flags
        POP     CX
        AND     CH,0F0H                 ;Bits 12-15 cleared?
        JE      @@1                     ;Yes, 80286
        INC     AX                      ;2 means 80386
@@1:    MOV     Test8086,AL             ;Save CPU test result
        RET


Last edited by shattered; 11/12/18 06:52 PM.
Re: PC/XT/AT (inside) WIP topic [Re: Kale] #114273
11/12/18 08:00 PM
11/12/18 08:00 PM
Joined: Mar 2001
Posts: 16,070
USA
R
R. Belmont Offline
Very Senior Member
R. Belmont  Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 16,070
USA
As long as we know Turbo Pascal doesn't blow up on a real V20 (and I'm sure that's true because putting V20s in 5150s was a popular sport in the 80s) then yes, please send in a patch that does that.

Last edited by R. Belmont; 11/12/18 08:01 PM.
Re: PC/XT/AT (inside) WIP topic [Re: Kale] #114274
11/12/18 08:07 PM
11/12/18 08:07 PM
Joined: Jan 2012
Posts: 796
C
crazyc Offline
Senior Member
crazyc  Offline
Senior Member
C
Joined: Jan 2012
Posts: 796
The top most bit of the v20 flags register is the mode flag which indicates whether it's in 8080 mode. I don't know exactly how it works off the top of my head,

Edit: according to the datasheet, the mode flag is clear when in emulation mode and can only be cleared by a brkem instruction.

Last edited by crazyc; 11/13/18 01:23 AM.
Re: PC/XT/AT (inside) WIP topic [Re: crazyc] #114275
11/13/18 12:46 AM
11/13/18 12:46 AM
Joined: Apr 2005
Posts: 550
GERMANY
Darkstar Offline
Senior Member
Darkstar  Offline
Senior Member
Joined: Apr 2005
Posts: 550
GERMANY
According to Ralf Brown's famous list of undocumented opcodes(*) (which was very spot-on back in the day and could probably be considered authoritative), the top bit should indeed only be clear on 386+ only:
Code
4) Standard way: Part 1
   (Intel recomended this way)

	pushf
	pop	ax
	and	ax,0fffh	; Clear bits 15..12
	push	ax
	popf
	pushf
	pop	ax
	and	ax,0f000h	; Is bits 15..12=0 ?
	jz	286_CPU
	and	ax,8000h	; Is bit 15=0
	jz	386_and_Higher
	jmp	86_88and186_186etc


The way to separate Intel 8086/8088 from NEC is this:

Code
5) How separate 86/88, 186/188 and NECs

	mov	ax,1
	mov	cl,33
	shl	ax,cl
	jnz	186_188
	pusha		; Executed on 8086/8088 as JMP $+2
	stc
	jc	NECs
	jmp	86_88


(*): It's here as OPCODES.LST in the inter61d.zip file

Re: PC/XT/AT (inside) WIP topic [Re: Kale] #114288
11/13/18 10:51 PM
11/13/18 10:51 PM
Joined: May 2005
Posts: 28
L
Luigi30 Offline
Member
Luigi30  Offline
Member
L
Joined: May 2005
Posts: 28
Started installing MS-DOS 5 in ibm5150 with CGA. I created a standard 10MB type 1 hard drive. It prompted me to ask if I wanted to partition the whole drive for MS-DOS - after hitting yes, the center of the screen flickers and the F11 display shows 300 partial updates(!) instead of 200. The system reboots without warning and the installation continues. Weird but it works.

Last edited by Luigi30; 11/13/18 10:51 PM.
Re: PC/XT/AT (inside) WIP topic [Re: R. Belmont] #114308
11/15/18 07:26 PM
11/15/18 07:26 PM
Joined: May 2012
Posts: 490
S
shattered Offline
Senior Member
shattered  Offline
Senior Member
S
Joined: May 2012
Posts: 490
Originally Posted by R. Belmont
As long as we know Turbo Pascal doesn't blow up on a real V20 (and I'm sure that's true because putting V20s in 5150s was a popular sport in the 80s) then yes, please send in a patch that does that.


I've asked someone with a HP 95LX to check what its V20 CPU does in this case.

Re: PC/XT/AT (inside) WIP topic [Re: Kale] #114311
11/15/18 07:56 PM
11/15/18 07:56 PM
Joined: Mar 2001
Posts: 16,070
USA
R
R. Belmont Offline
Very Senior Member
R. Belmont  Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 16,070
USA
Well, we do know for sure that regardless of its effects on V20, this patch was wrong for V30/V33/V35.

Re: PC/XT/AT (inside) WIP topic [Re: Kale] #114312
11/15/18 08:07 PM
11/15/18 08:07 PM
Joined: Jan 2012
Posts: 796
C
crazyc Offline
Senior Member
crazyc  Offline
Senior Member
C
Joined: Jan 2012
Posts: 796
It's correct for the v20/v30 and v33 (at least until get 8080 emulation mode) but wrong for the v25/v35 where bits 12-14 set the register bank.

Last edited by crazyc; 11/15/18 08:10 PM.
Re: PC/XT/AT (inside) WIP topic [Re: Kale] #114313
11/15/18 09:58 PM
11/15/18 09:58 PM
Joined: May 2012
Posts: 490
S
shattered Offline
Senior Member
shattered  Offline
Senior Member
S
Joined: May 2012
Posts: 490
Looks like the correct fix is actually
Code
--- a/src/devices/cpu/nec/necpriv.h
+++ b/src/devices/cpu/nec/necpriv.h
@@ -108,8 +108,8 @@ enum BREGS {
 
 /************************************************************************/
 #define CompressFlags() (WORD)(int(CF) | 0x02 | (int(PF) << 2) | (int(AF) << 4) | (int(ZF) << 6) \
-                               | (int(SF) << 7) | (m_TF << 8) | (m_IF << 9) \
-                               | (m_DF << 10) | (int(OF) << 11) | 0x7000 | (m_MF << 15))
+                               | (int(SF) << 7) | (int(m_TF) << 8) | (int(m_IF) << 9) \
+                               | (int(m_DF) << 10) | (int(OF) << 11) | 0x7000 | (int(m_MF) << 15))


m_MF is already 1 but wasn't packed correctly.

Re: PC/XT/AT (inside) WIP topic [Re: Kale] #114405
12/09/18 01:36 PM
12/09/18 01:36 PM
Joined: Jan 2012
Posts: 950
Bavaria
rfka01 Offline
Senior Member
rfka01  Offline
Senior Member
Joined: Jan 2012
Posts: 950
Bavaria
i recently got a Schneider Euro AT ... there are versions with an onboard EGA card, but this one's got a "Euro VGA" board, an ATI card with a proprietary connector. The EGA portion and ROM are not populated on the mainboard.
Plugging the ROM into the AT driver makes the system emit a series of beeps that seem to indicate that the "BigJIM" chip is not initialized, a nice tip of the hat to the JIM chip of the Euro XTs.

As always, drivers, pictures and documentation are on the FTP.


NCR DMV- DEC Rainbow- Siemens PCD- ITT 3030-Oly People- Acorn A5000- Olivetti M20
Page 255 of 256 1 2 253 254 255 256

Who's Online Now
0 registered members (), 109 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Shout Box
Forum Statistics
Forums9
Topics8,606
Posts112,516
Members4,827
Most Online296
Dec 5th, 2018
Powered by UBB.threads™ PHP Forum Software 7.6.1.1
(Release build 20180111)
Page Time: 0.127s Queries: 15 (0.096s) Memory: 5.7309 MB (Peak: 5.9547 MB) Zlib enabled. Server Time: 2018-12-16 10:16:21 UTC