flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > DOS > Detecting C&T Super386 CPU

Author
Thread Post new topic Reply to topic
ACP



Joined: 23 Sep 2006
Posts: 197
Detecting C&T Super386 CPU
Here is a write up about detecting Super386 CPU:
https://corexor.wordpress.com/2015/12/05/calling-ct-scall-safely/

The code has been developed using FASM and can be used as a base for other testing purposes.
Post 06 Dec 2015, 19:48
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 6676
Location: Kraków, Poland
Thank you for this fascinating information! Do you have an access to actual Super386 CPU? I would love to find out whether it supported the 32-bit code in real mode. As far as I know, the Cyrix clones did not, but I had no chance to test this with a wider variety of 386 clones and variants.

Also, I quickly adapted this source to fasm g, because with the 386 macros I have there it is easy to implement such new instruction with actual arguments. I'm attaching it with the full set of macros needed to assemble it with fasm g (even though most of them come with the official fasm g package anyway). Perhaps you may find this approach useful when testing undocumented instructions.


Description: CnT Super386 CPU detection adapted to fasm g
Download
Filename: cnt_fasmg.zip
Filesize: 10.24 KB
Downloaded: 82 Time(s)

Post 06 Dec 2015, 20:17
View user's profile Send private message Visit poster's website Reply with quote
ACP



Joined: 23 Sep 2006
Posts: 197
Unfortunately I don't have an access to the real hardware, but the code has been tested on it thanks to Michal Necasek of os2museum fame. Please contact him through his blog and I guess he will be more than helpful.

As for the code I'm glad you liked it and it has some use for fasm g Smile Now you've forced me to take a better look at it. I'm developing more advanced code base on Super 386 experiences. Despite 32-bit code in real mode possibility Super 386 supported something that looks like advanced (sorry for simplification) SMM clone. The whole story is amazing and fascinating indeed.
Post 06 Dec 2015, 20:38
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 6676
Location: Kraków, Poland
I don't know whether I got the order of operands right for the "scall" macro, it might be r/m for the destination instead of source. Do you know more about this instruction? Still, the macro is very easy to tweak if you needed.
Post 07 Dec 2015, 12:48
View user's profile Send private message Visit poster's website Reply with quote
ACP



Joined: 23 Sep 2006
Posts: 197
Didn't have time to really peek at your code Crying or Very sad (something planned for evening today), but the 3rd byte is r/m following Intel encoding.
Post 08 Dec 2015, 12:07
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 6676
Location: Kraków, Poland
Yes, I knew that, but that third byte may encode either the "r/m,r" or "r,r/m" syntax, it's just about switching the order of operands. In this program the actual instruction is "scall eax,eax" so this does not matter. But if you wanted to try instruction with two different operands, the order would be important. You may need to switch the "dest" and "src" arguments in macro if my initial choice was wrong.
Post 08 Dec 2015, 15:59
View user's profile Send private message Visit poster's website Reply with quote
ACP



Joined: 23 Sep 2006
Posts: 197
Sorry for misunderstanding your initial post. You are right. I believe the initial setting is correct one.

As a side note I am writing new utility for detecting undocumented opcodes. Adding switching between different strange modes would be a next obvious stop, but at the moment I don't have a time for it.

The problem is that for testing you actually need a lot of original, not virtualized hardware. Emulators for obvious reasons fails. For example when I've run undoc from Undocumented PC under DOSBox it makes it closing down almost immediately.
Post 09 Dec 2015, 18:04
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >

Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.