<s>
LOADALL	B-Device
is	O
the	O
common	O
name	O
for	O
two	O
different	O
,	O
undocumented	B-Language
machine	I-Language
instructions	I-Language
of	O
Intel	B-General_Concept
80286	I-General_Concept
and	O
Intel	B-General_Concept
80386	I-General_Concept
processors	O
,	O
which	O
allow	O
access	O
to	O
areas	O
of	O
the	O
internal	O
processor	O
state	O
that	O
are	O
normally	O
outside	O
of	O
the	O
IA-32	B-Device
API	B-Application
scope	O
,	O
like	O
descriptor	O
cache	O
registers	O
.	O
</s>
<s>
The	O
LOADALL	B-Device
for	O
286	B-General_Concept
processors	O
is	O
encoded	O
0Fh	O
05h	O
,	O
while	O
the	O
LOADALL	B-Device
for	O
386	B-General_Concept
processors	O
is	O
0Fh	O
07h	O
.	O
</s>
<s>
LOADALL	B-Device
had	O
the	O
unique	O
ability	O
to	O
set	O
up	O
the	O
visible	O
part	O
of	O
the	O
segment	B-General_Concept
registers	I-General_Concept
(	O
selector	O
)	O
independently	O
of	O
their	O
corresponding	O
cached	O
part	O
,	O
allowing	O
the	O
programmer	O
to	O
bring	O
the	O
CPU	O
into	O
states	O
not	O
otherwise	O
allowed	O
by	O
the	O
official	O
programming	O
model	O
.	O
</s>
<s>
As	O
an	O
example	O
of	O
the	O
usefulness	O
of	O
these	O
techniques	O
,	O
LOADALL	B-Device
can	O
set	O
up	O
the	O
CPU	O
to	O
allow	O
access	O
to	O
all	O
memory	O
from	O
real	B-Application
mode	I-Application
,	O
without	O
having	O
to	O
switch	O
it	O
into	O
unreal	B-Device
mode	I-Device
(	O
which	O
requires	O
switching	O
into	O
protected	B-Application
mode	I-Application
,	O
accessing	O
memory	O
and	O
finally	O
switching	O
back	O
to	O
real	B-Application
mode	I-Application
)	O
.	O
</s>
<s>
Programs	O
such	O
as	O
the	O
pre-XMS	O
versions	O
of	O
RAMDRIVE.SYS	B-Application
(	O
1985	O
)	O
,	O
SMARTDRV.SYS	B-Application
(	O
1986	O
)	O
as	O
well	O
as	O
HIMEM.SYS	O
(	O
2.03	O
,	O
1988-08-04	O
;	O
2.04	O
,	O
1988-08-17	O
)	O
drivers	O
in	O
MS-DOS	B-Application
,	O
Uniform	O
Software	O
Systems	O
 '	O
The	O
Extender	O
(	O
1985	O
)	O
and	O
The	O
Connector	O
(	O
1985	O
)	O
for	O
Lotus	B-Application
1-2-3	I-Application
,	O
Above	O
Disk	O
(	O
1986	O
)	O
(	O
a	O
LIMulator	O
by	O
Above	O
Software	O
(	O
formerly	O
Tele-Ware	O
West	O
aka	O
Los	O
Angeles	O
Securities	O
Group	O
)	O
that	O
converted	O
hard	B-Device
disk	I-Device
space	O
or	O
extended	B-Device
memory	I-Device
into	O
expanded	B-Device
memory	I-Device
)	O
,	O
and	O
OS/2	O
1.0	O
and	O
1.1	O
used	O
the	O
286	B-General_Concept
LOADALL	B-Device
instruction	O
.	O
</s>
<s>
DOS	O
3.3	O
and	O
4.0	O
reserved	O
a	O
102-byte	O
buffer	O
at	O
0070:0100h	O
(	O
which	O
was	O
normally	O
occupied	O
by	O
DOS	O
BIOS	O
data	O
)	O
so	O
that	O
there	O
was	O
no	O
need	O
to	O
save	O
&	O
restore	O
it	O
for	O
LOADALL	B-Device
.	O
</s>
<s>
Microsoft	O
's	O
EMM386.EXE	B-Device
special-cases	O
both	O
the	O
286	B-General_Concept
and	O
386	B-General_Concept
LOADALL	B-Device
instructions	O
in	O
its	O
invalid	B-Language
opcode	I-Language
handler	I-Language
.	O
</s>
<s>
Examination	O
of	O
the	O
virtual-machine	O
monitor	O
code	O
in	O
Windows/386	B-Application
2.10	I-Application
shows	O
that	O
it	O
uses	O
both	O
the	O
286	B-General_Concept
and	O
the	O
even	O
less	O
known	O
386	B-General_Concept
variant	O
.	O
</s>
<s>
Microsoft	O
's	O
HIMEM.SYS	O
version	O
2.06	O
also	O
used	O
LOADALL	B-Device
to	O
quickly	O
copy	O
to	O
and	O
from	O
extended	B-Device
memory	I-Device
on	O
286	B-General_Concept
systems	O
.	O
</s>
<s>
Another	O
interesting	O
usage	O
of	O
LOADALL	B-Device
,	O
laid	O
out	O
in	O
the	O
book	O
The	O
Design	O
of	O
OS/2	O
,	O
would	O
have	O
been	O
to	O
allow	O
running	O
former	O
real-mode	B-Application
programs	O
in	O
16-bit	O
protected	B-Application
mode	I-Application
,	O
as	O
utilized	O
by	O
Digital	O
Research	O
's	O
Concurrent	B-Operating_System
DOS	I-Operating_System
286	I-Operating_System
since	O
1985	O
,	O
as	O
well	O
as	O
FlexOS	B-Operating_System
286	I-Operating_System
and	O
IBM	B-Language
4680	I-Language
OS	I-Language
since	O
1986	O
.	O
</s>
<s>
Marking	O
all	O
the	O
descriptor	O
caches	O
in	O
the	O
GDT	B-General_Concept
and	O
LDTs	O
"	O
not	O
present	O
"	O
would	O
allow	O
the	O
operating	O
system	O
to	O
trap	B-Application
segment-register	O
reloads	O
,	O
as	O
well	O
as	O
attempts	O
at	O
performing	O
real-mode	B-Application
–	O
specific	O
"	O
segment	B-General_Concept
arithmetic	O
"	O
and	O
emulate	O
the	O
desired	O
behavior	O
by	O
updating	O
the	O
segment	B-Operating_System
descriptors	I-Operating_System
(	O
LOADALL	B-Device
again	O
)	O
.	O
</s>
<s>
This	O
"	O
8086	B-Operating_System
emulation	I-Operating_System
mode	I-Operating_System
"	O
for	O
the	O
80286	B-General_Concept
was	O
,	O
however	O
,	O
too	O
slow	O
to	O
be	O
practical	O
.	O
</s>
<s>
The	O
idea	O
had	O
to	O
be	O
mostly	O
discarded	O
,	O
furthermore	O
,	O
due	O
to	O
errata	O
in	O
some	O
early	O
Intel	B-General_Concept
80286	I-General_Concept
processors	O
before	O
the	O
E-2	O
stepping	B-General_Concept
.	O
</s>
<s>
As	O
a	O
result	O
,	O
OS/2	O
1.x	O
–	O
and	O
Windows	O
in	O
"	O
standard	O
"	O
mode	O
as	O
well	O
–	O
had	O
to	O
run	O
DOS	O
programs	O
in	O
real	B-Application
mode	I-Application
.	O
</s>
<s>
Nevertheless	O
,	O
the	O
idea	O
was	O
not	O
lost	O
;	O
it	O
led	O
Intel	O
to	O
introduce	O
the	O
virtual	B-Application
8086	I-Application
mode	I-Application
of	O
the	O
80386	B-General_Concept
,	O
allowing	O
the	O
implementation	O
of	O
"	O
DOS	O
boxes	O
"	O
at	O
last	O
in	O
a	O
relatively	O
efficient	O
and	O
documented	O
way	O
.	O
</s>
<s>
Because	O
LOADALL	B-Device
did	O
not	O
perform	O
any	O
checks	O
on	O
the	O
validity	O
of	O
the	O
data	O
loaded	O
into	O
processor	O
registers	O
,	O
it	O
was	O
possible	O
to	O
load	O
a	O
processor	O
state	O
that	O
could	O
not	O
be	O
normally	O
entered	O
,	O
such	O
as	O
using	O
real	B-Application
mode	I-Application
(	O
PE	O
=	O
0	O
)	O
together	O
with	O
paging	O
(	O
PG	O
=	O
1	O
)	O
on	O
386-class	O
CPUs	O
.	O
</s>
<s>
An	O
in-circuit	B-Application
emulator	I-Application
(	O
ICE	O
)	O
is	O
a	O
tool	O
used	O
for	O
low-level	O
debugging	O
.	O
</s>
<s>
On	O
Intel	B-General_Concept
80386	I-General_Concept
,	O
asserting	O
the	O
undocumented	O
pin	O
at	O
location	O
B6	O
causes	O
the	O
microprocessor	O
to	O
halt	O
execution	O
and	O
enter	O
ICE	O
mode	O
.	O
</s>
<s>
The	O
layout	O
of	O
this	O
area	O
is	O
suitable	O
for	O
LOADALL	B-Device
instruction	O
,	O
and	O
this	O
instruction	O
is	O
used	O
by	O
ICE	O
code	O
to	O
return	O
to	O
normal	O
execution	O
.	O
</s>
<s>
In	O
later	O
processors	O
,	O
this	O
evolved	O
into	O
System	B-Architecture
Management	I-Architecture
Mode	I-Architecture
(	O
SMM	O
)	O
.	O
</s>
<s>
The	O
layout	O
of	O
this	O
memory	O
area	O
is	O
similar	O
to	O
one	O
used	O
by	O
the	O
LOADALL	B-Device
instruction	O
.	O
</s>
<s>
386-style	O
LOADALL	B-Device
instruction	O
can	O
be	O
executed	O
on	O
486	O
too	O
,	O
but	O
only	O
in	O
SMM	O
mode	O
.	O
</s>
<s>
Microsoft	O
's	O
Codeview	B-Application
3.0	O
and	O
Borland	O
's	O
Turbo	B-Application
Debugger	I-Application
2.0	O
correctly	O
decode	O
286	B-General_Concept
and	O
386	B-General_Concept
LOADALL	B-Device
instructions	O
.	O
</s>
<s>
As	O
the	O
two	O
LOADALL	B-Device
instructions	O
were	O
never	O
documented	O
and	O
do	O
not	O
exist	O
on	O
later	O
processors	O
,	O
the	O
opcodes	O
were	O
reused	O
in	O
the	O
AMD64	B-Device
architecture	O
.	O
</s>
<s>
The	O
opcode	O
for	O
the	O
286	B-General_Concept
LOADALL	B-Device
instruction	O
,	O
0F05	O
,	O
became	O
the	O
AMD64	B-Device
instruction	O
SYSCALL	O
;	O
the	O
386	B-General_Concept
LOADALL	B-Device
instruction	O
,	O
0F07	O
,	O
became	O
the	O
SYSRET	O
instruction	O
.	O
</s>
<s>
These	O
definitions	O
were	O
implemented	O
even	O
on	O
Intel	O
CPUs	O
with	O
the	O
introduction	O
of	O
the	O
Intel	O
64	O
implementation	O
of	O
AMD64	B-Device
.	O
</s>
<s>
The	O
instruction	O
reads	O
data	O
from	O
addresses	O
0x00800	O
–	O
0x00866	O
,	O
whatever	O
the	O
content	O
of	O
the	O
segment	B-General_Concept
registers	I-General_Concept
.	O
</s>
<s>
The	O
80286	B-General_Concept
LOADALL	B-Device
instruction	O
can	O
not	O
be	O
used	O
to	O
switch	O
from	O
protected	O
back	O
to	O
real	B-Application
mode	I-Application
(	O
it	O
ca	O
n't	O
clear	O
the	O
PE	O
bit	O
in	O
the	O
MSW	O
)	O
.	O
</s>
<s>
However	O
,	O
use	O
of	O
the	O
LOADALL	B-Device
instruction	O
can	O
avoid	O
the	O
need	O
to	O
switch	O
to	O
protected	B-Application
mode	I-Application
altogether	O
.	O
</s>
