Link to home
Start Free TrialLog in
Avatar of arminl
arminl

asked on

How access 286 extended registers via Turbo Pascal 6.5 Inlines?

Anyone left who still uses the Turbo Pascal 6.5 compiler? I need some inline code to move the 286+ extended Registers into some kind of variable ...

Anyone who can help?

Armin.Linder@Adlon.de
Avatar of Hypo
Hypo
Flag of Sweden image

Hello,
I'm not familiar with the Turbo Pascal 6.5 compiler, though I'm very used to assembler programming in BP 7.

I'm not sure if it is the EAX,EBX,ECX,EDX etc. registers you are speaking of... though if you are, I'm sure I can help you!

regards Hypo.
Avatar of dbrunton
Surely you mean the 386 chip?
Avatar of nrico
nrico

You can't just use the register name EAX under the inline assembler. Instead, I believe you do to move 0 into EAX:

  DB $60; MOV AX,0

but I could be wrong.

And yep, those registers, and FS and GS are 386+.
EAX,EBX,ECX,EDX are not available in the 286...but I think that the 286 had some extra registers for protected mode...
True, EAX,EBX,ECX,EDX... which is the 32bit versions of AX,BX,CX,DX... was first introduced with the 80386CPU.

Also "DB $60; MOV AX,0" will most probably crash your computer or generate an illegal oppcode exception.

The correct oppcode should be (in this case) "DB $66; MOV AX,0; DW 0"

The preceeding byte you should put infront of _MOST_ 16bit register instructions to make them 32bit reg. instructions are 66h.

Here's an old question about 32bit instructions in pascal:
   https://www.experts-exchange.com/jsp/qShow.jsp?ta=pascal&qid=10168326


Yet, I still don't know if these are the extended registers you want to use... Could you please reply?
Avatar of arminl

ASKER

Hello Turbo veterans,

it's good news that there are still some left out there ...

I mean the extended registers of the 386+, of course.

What I need to do is move the contents of EAX into a variable.

Armin.Linder@Adlon.de
ASKER CERTIFIED SOLUTION
Avatar of Hypo
Hypo
Flag of Sweden image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
yo! did it work?
Always the same thing...
Avatar of arminl

ASKER

Hi Hypo,

thanks for your response. unfortunately I am busy with another project right now and won't be able to check that out for the next 2 weeks.

I do, however, assume that this is exactly what I was looking for, and that it will work like intended.

Thanks for your help, and beg your pardon for beeing silent so long (have no regular access to my e-mails right now as well).

....Armin
oh... tha's ok,
I thought you'd just left it to autograde... (tha's happend me before)