0xF1 opcode-prefix on i80286
Does the Fireball spell damage objects?
Why is the result of ('b'+'a'+ + 'a' + 'a').toLowerCase() 'banana'?
Normalization constant of a planar wave
Does fossil fuels use since 1990 account for half of all the fossil fuels used in history?
What is this "Table of astronomy" about?
Is God unknowable?
0xF1 opcode-prefix on i80286
Can a PC use the Levitate spell to avoid movement speed reduction from exhaustion?
How can this older-style irrigation tee be replaced?
How do some PhD students get 10+ papers? Is that what I need for landing good faculty position?
Heating Margarine in Pan = loss of calories?
Solution to German Tank Problem
PhD advisor lost funding, need advice
Can the ground attached to neutral fool a receptacle tester?
Why does the standard fingering / strumming for a D maj chord leave out the 5th string?
Why isn’t SHA-3 in wider use?
How to create events observer that only call when REST api dispatch events?
A torrent of foreign terms
If a digital camera can be "hacked" in the ransomware sense, how best to protect it?
Are employers legally allowed to pay employees in goods and services equal to or greater than the minimum wage?
Is there any way to stop a user from creating executables and running them?
Why are Tucker and Malcolm not dead?
Is this curved text blend possible in Illustrator?
How much maintenance time did it take to make an F4U Corsair ready for another flight?
0xF1 opcode-prefix on i80286
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
On intel IAPX 80286, as I recall from experience, the undocumented - officially unassigned - "opcode" position 0xF1 was actually decoded as an instruction-prefix, thus counting for maximum allowed instruction length (ten bytes), but otherwise not modifying the prefixed instruction : a "no operation" prefix, sort of. Now, what I have always wondered and could not assert lacking appropriate lab equipment ("logic analyzer" or a mere oscilloscope) : was F1h perhaps an 'alias' for the lock-prefix (F0h), or was it just ignored by the CPU (apart from counting for instruction length) ?
Note : we know that position 0xF1 of the opcode 'matrix' was later reused for a one-byte "int 1" opcode (not a prefix) starting with the i80386, that also was not documented until much later. This later conflicting assignment of the opcode position is not part of the here question.
80286 undocumented-opcodes
New contributor
add a comment |
On intel IAPX 80286, as I recall from experience, the undocumented - officially unassigned - "opcode" position 0xF1 was actually decoded as an instruction-prefix, thus counting for maximum allowed instruction length (ten bytes), but otherwise not modifying the prefixed instruction : a "no operation" prefix, sort of. Now, what I have always wondered and could not assert lacking appropriate lab equipment ("logic analyzer" or a mere oscilloscope) : was F1h perhaps an 'alias' for the lock-prefix (F0h), or was it just ignored by the CPU (apart from counting for instruction length) ?
Note : we know that position 0xF1 of the opcode 'matrix' was later reused for a one-byte "int 1" opcode (not a prefix) starting with the i80386, that also was not documented until much later. This later conflicting assignment of the opcode position is not part of the here question.
80286 undocumented-opcodes
New contributor
add a comment |
On intel IAPX 80286, as I recall from experience, the undocumented - officially unassigned - "opcode" position 0xF1 was actually decoded as an instruction-prefix, thus counting for maximum allowed instruction length (ten bytes), but otherwise not modifying the prefixed instruction : a "no operation" prefix, sort of. Now, what I have always wondered and could not assert lacking appropriate lab equipment ("logic analyzer" or a mere oscilloscope) : was F1h perhaps an 'alias' for the lock-prefix (F0h), or was it just ignored by the CPU (apart from counting for instruction length) ?
Note : we know that position 0xF1 of the opcode 'matrix' was later reused for a one-byte "int 1" opcode (not a prefix) starting with the i80386, that also was not documented until much later. This later conflicting assignment of the opcode position is not part of the here question.
80286 undocumented-opcodes
New contributor
On intel IAPX 80286, as I recall from experience, the undocumented - officially unassigned - "opcode" position 0xF1 was actually decoded as an instruction-prefix, thus counting for maximum allowed instruction length (ten bytes), but otherwise not modifying the prefixed instruction : a "no operation" prefix, sort of. Now, what I have always wondered and could not assert lacking appropriate lab equipment ("logic analyzer" or a mere oscilloscope) : was F1h perhaps an 'alias' for the lock-prefix (F0h), or was it just ignored by the CPU (apart from counting for instruction length) ?
Note : we know that position 0xF1 of the opcode 'matrix' was later reused for a one-byte "int 1" opcode (not a prefix) starting with the i80386, that also was not documented until much later. This later conflicting assignment of the opcode position is not part of the here question.
80286 undocumented-opcodes
80286 undocumented-opcodes
New contributor
New contributor
New contributor
asked 14 hours ago
NimbUsNimbUs
361 bronze badge
361 bronze badge
New contributor
New contributor
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
According to an Intel document describing opcodes which don’t result in exception 6,
The 0F1H opcode is a prefix which performs no function. It counts like any other prefix towards the maximum instruction length. No restrictions apply to its execution.
The same document mentions explicitly when opcodes are aliases for others. I interpret the above as meaning that 0xF1 is not an alias for 0xF0. If it was, I would have hoped the locking behaviour would be mentioned.
However this 2010 post in comp.lang.asm.x86
does mention that 0xF1 is an alias for 0xF0, and that the only way to determine this is by testing it, since the Intel documentation is unreliable.
I don’t have a 286 handy to test this behaviour though. To test this on a real 80286, you’d need either a logic analyser (as you mention), or a protected-mode test program — since LOCK
is a privileged prefix, if 0xF1 is an alias for it, it should generate a general protection fault if it’s used without the appropriate privilege. (On a 386 or later CPU, the test would be easier, since LOCK
with an inappropriate instruction or operand generates an invalid opcode exception, but 0xF1 is different there.)
How comeLOCK
is privileged? Many modern atomic operations in user space rely on this prefix. Did it behave different on a 286?
– Ruslan
4 hours ago
@Ruslan as I understand the 286 manual, the 286 designers considered that it caused I/O (in the shape of theLOCK#
signal), so if IOPL < CPL the operation causes an exception. The I/O permission model changed with the 386. However I have conflicting docs aroundLOCK
on 286s, so really its behaviour should be tested on a real 286...
– Stephen Kitt
4 hours ago
Would a test on an AMD 286 be of any use?
– Ruslan
4 hours ago
@Ruslan yes, they were licensed clones, and should behave identically to Intel CPUs. The things I’d like to test, beyond the 0xF0/0xF1 equivalence, are: isLOCK
allowed with any instruction, or does it produce an invalid opcode exception with anything other thanINS
,MOVS
,OUTS
andXCHG
? Does the behaviour change in protected mode? And obviously the IOPL behaviour above ;-).
– Stephen Kitt
4 hours ago
1
I might try to test sometime on this weekend.
– Ruslan
4 hours ago
|
show 3 more comments
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "648"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
NimbUs is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fretrocomputing.stackexchange.com%2fquestions%2f12004%2f0xf1-opcode-prefix-on-i80286%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
According to an Intel document describing opcodes which don’t result in exception 6,
The 0F1H opcode is a prefix which performs no function. It counts like any other prefix towards the maximum instruction length. No restrictions apply to its execution.
The same document mentions explicitly when opcodes are aliases for others. I interpret the above as meaning that 0xF1 is not an alias for 0xF0. If it was, I would have hoped the locking behaviour would be mentioned.
However this 2010 post in comp.lang.asm.x86
does mention that 0xF1 is an alias for 0xF0, and that the only way to determine this is by testing it, since the Intel documentation is unreliable.
I don’t have a 286 handy to test this behaviour though. To test this on a real 80286, you’d need either a logic analyser (as you mention), or a protected-mode test program — since LOCK
is a privileged prefix, if 0xF1 is an alias for it, it should generate a general protection fault if it’s used without the appropriate privilege. (On a 386 or later CPU, the test would be easier, since LOCK
with an inappropriate instruction or operand generates an invalid opcode exception, but 0xF1 is different there.)
How comeLOCK
is privileged? Many modern atomic operations in user space rely on this prefix. Did it behave different on a 286?
– Ruslan
4 hours ago
@Ruslan as I understand the 286 manual, the 286 designers considered that it caused I/O (in the shape of theLOCK#
signal), so if IOPL < CPL the operation causes an exception. The I/O permission model changed with the 386. However I have conflicting docs aroundLOCK
on 286s, so really its behaviour should be tested on a real 286...
– Stephen Kitt
4 hours ago
Would a test on an AMD 286 be of any use?
– Ruslan
4 hours ago
@Ruslan yes, they were licensed clones, and should behave identically to Intel CPUs. The things I’d like to test, beyond the 0xF0/0xF1 equivalence, are: isLOCK
allowed with any instruction, or does it produce an invalid opcode exception with anything other thanINS
,MOVS
,OUTS
andXCHG
? Does the behaviour change in protected mode? And obviously the IOPL behaviour above ;-).
– Stephen Kitt
4 hours ago
1
I might try to test sometime on this weekend.
– Ruslan
4 hours ago
|
show 3 more comments
According to an Intel document describing opcodes which don’t result in exception 6,
The 0F1H opcode is a prefix which performs no function. It counts like any other prefix towards the maximum instruction length. No restrictions apply to its execution.
The same document mentions explicitly when opcodes are aliases for others. I interpret the above as meaning that 0xF1 is not an alias for 0xF0. If it was, I would have hoped the locking behaviour would be mentioned.
However this 2010 post in comp.lang.asm.x86
does mention that 0xF1 is an alias for 0xF0, and that the only way to determine this is by testing it, since the Intel documentation is unreliable.
I don’t have a 286 handy to test this behaviour though. To test this on a real 80286, you’d need either a logic analyser (as you mention), or a protected-mode test program — since LOCK
is a privileged prefix, if 0xF1 is an alias for it, it should generate a general protection fault if it’s used without the appropriate privilege. (On a 386 or later CPU, the test would be easier, since LOCK
with an inappropriate instruction or operand generates an invalid opcode exception, but 0xF1 is different there.)
How comeLOCK
is privileged? Many modern atomic operations in user space rely on this prefix. Did it behave different on a 286?
– Ruslan
4 hours ago
@Ruslan as I understand the 286 manual, the 286 designers considered that it caused I/O (in the shape of theLOCK#
signal), so if IOPL < CPL the operation causes an exception. The I/O permission model changed with the 386. However I have conflicting docs aroundLOCK
on 286s, so really its behaviour should be tested on a real 286...
– Stephen Kitt
4 hours ago
Would a test on an AMD 286 be of any use?
– Ruslan
4 hours ago
@Ruslan yes, they were licensed clones, and should behave identically to Intel CPUs. The things I’d like to test, beyond the 0xF0/0xF1 equivalence, are: isLOCK
allowed with any instruction, or does it produce an invalid opcode exception with anything other thanINS
,MOVS
,OUTS
andXCHG
? Does the behaviour change in protected mode? And obviously the IOPL behaviour above ;-).
– Stephen Kitt
4 hours ago
1
I might try to test sometime on this weekend.
– Ruslan
4 hours ago
|
show 3 more comments
According to an Intel document describing opcodes which don’t result in exception 6,
The 0F1H opcode is a prefix which performs no function. It counts like any other prefix towards the maximum instruction length. No restrictions apply to its execution.
The same document mentions explicitly when opcodes are aliases for others. I interpret the above as meaning that 0xF1 is not an alias for 0xF0. If it was, I would have hoped the locking behaviour would be mentioned.
However this 2010 post in comp.lang.asm.x86
does mention that 0xF1 is an alias for 0xF0, and that the only way to determine this is by testing it, since the Intel documentation is unreliable.
I don’t have a 286 handy to test this behaviour though. To test this on a real 80286, you’d need either a logic analyser (as you mention), or a protected-mode test program — since LOCK
is a privileged prefix, if 0xF1 is an alias for it, it should generate a general protection fault if it’s used without the appropriate privilege. (On a 386 or later CPU, the test would be easier, since LOCK
with an inappropriate instruction or operand generates an invalid opcode exception, but 0xF1 is different there.)
According to an Intel document describing opcodes which don’t result in exception 6,
The 0F1H opcode is a prefix which performs no function. It counts like any other prefix towards the maximum instruction length. No restrictions apply to its execution.
The same document mentions explicitly when opcodes are aliases for others. I interpret the above as meaning that 0xF1 is not an alias for 0xF0. If it was, I would have hoped the locking behaviour would be mentioned.
However this 2010 post in comp.lang.asm.x86
does mention that 0xF1 is an alias for 0xF0, and that the only way to determine this is by testing it, since the Intel documentation is unreliable.
I don’t have a 286 handy to test this behaviour though. To test this on a real 80286, you’d need either a logic analyser (as you mention), or a protected-mode test program — since LOCK
is a privileged prefix, if 0xF1 is an alias for it, it should generate a general protection fault if it’s used without the appropriate privilege. (On a 386 or later CPU, the test would be easier, since LOCK
with an inappropriate instruction or operand generates an invalid opcode exception, but 0xF1 is different there.)
edited 12 hours ago
answered 13 hours ago
Stephen KittStephen Kitt
48.3k8 gold badges199 silver badges203 bronze badges
48.3k8 gold badges199 silver badges203 bronze badges
How comeLOCK
is privileged? Many modern atomic operations in user space rely on this prefix. Did it behave different on a 286?
– Ruslan
4 hours ago
@Ruslan as I understand the 286 manual, the 286 designers considered that it caused I/O (in the shape of theLOCK#
signal), so if IOPL < CPL the operation causes an exception. The I/O permission model changed with the 386. However I have conflicting docs aroundLOCK
on 286s, so really its behaviour should be tested on a real 286...
– Stephen Kitt
4 hours ago
Would a test on an AMD 286 be of any use?
– Ruslan
4 hours ago
@Ruslan yes, they were licensed clones, and should behave identically to Intel CPUs. The things I’d like to test, beyond the 0xF0/0xF1 equivalence, are: isLOCK
allowed with any instruction, or does it produce an invalid opcode exception with anything other thanINS
,MOVS
,OUTS
andXCHG
? Does the behaviour change in protected mode? And obviously the IOPL behaviour above ;-).
– Stephen Kitt
4 hours ago
1
I might try to test sometime on this weekend.
– Ruslan
4 hours ago
|
show 3 more comments
How comeLOCK
is privileged? Many modern atomic operations in user space rely on this prefix. Did it behave different on a 286?
– Ruslan
4 hours ago
@Ruslan as I understand the 286 manual, the 286 designers considered that it caused I/O (in the shape of theLOCK#
signal), so if IOPL < CPL the operation causes an exception. The I/O permission model changed with the 386. However I have conflicting docs aroundLOCK
on 286s, so really its behaviour should be tested on a real 286...
– Stephen Kitt
4 hours ago
Would a test on an AMD 286 be of any use?
– Ruslan
4 hours ago
@Ruslan yes, they were licensed clones, and should behave identically to Intel CPUs. The things I’d like to test, beyond the 0xF0/0xF1 equivalence, are: isLOCK
allowed with any instruction, or does it produce an invalid opcode exception with anything other thanINS
,MOVS
,OUTS
andXCHG
? Does the behaviour change in protected mode? And obviously the IOPL behaviour above ;-).
– Stephen Kitt
4 hours ago
1
I might try to test sometime on this weekend.
– Ruslan
4 hours ago
How come
LOCK
is privileged? Many modern atomic operations in user space rely on this prefix. Did it behave different on a 286?– Ruslan
4 hours ago
How come
LOCK
is privileged? Many modern atomic operations in user space rely on this prefix. Did it behave different on a 286?– Ruslan
4 hours ago
@Ruslan as I understand the 286 manual, the 286 designers considered that it caused I/O (in the shape of the
LOCK#
signal), so if IOPL < CPL the operation causes an exception. The I/O permission model changed with the 386. However I have conflicting docs around LOCK
on 286s, so really its behaviour should be tested on a real 286...– Stephen Kitt
4 hours ago
@Ruslan as I understand the 286 manual, the 286 designers considered that it caused I/O (in the shape of the
LOCK#
signal), so if IOPL < CPL the operation causes an exception. The I/O permission model changed with the 386. However I have conflicting docs around LOCK
on 286s, so really its behaviour should be tested on a real 286...– Stephen Kitt
4 hours ago
Would a test on an AMD 286 be of any use?
– Ruslan
4 hours ago
Would a test on an AMD 286 be of any use?
– Ruslan
4 hours ago
@Ruslan yes, they were licensed clones, and should behave identically to Intel CPUs. The things I’d like to test, beyond the 0xF0/0xF1 equivalence, are: is
LOCK
allowed with any instruction, or does it produce an invalid opcode exception with anything other than INS
, MOVS
, OUTS
and XCHG
? Does the behaviour change in protected mode? And obviously the IOPL behaviour above ;-).– Stephen Kitt
4 hours ago
@Ruslan yes, they were licensed clones, and should behave identically to Intel CPUs. The things I’d like to test, beyond the 0xF0/0xF1 equivalence, are: is
LOCK
allowed with any instruction, or does it produce an invalid opcode exception with anything other than INS
, MOVS
, OUTS
and XCHG
? Does the behaviour change in protected mode? And obviously the IOPL behaviour above ;-).– Stephen Kitt
4 hours ago
1
1
I might try to test sometime on this weekend.
– Ruslan
4 hours ago
I might try to test sometime on this weekend.
– Ruslan
4 hours ago
|
show 3 more comments
NimbUs is a new contributor. Be nice, and check out our Code of Conduct.
NimbUs is a new contributor. Be nice, and check out our Code of Conduct.
NimbUs is a new contributor. Be nice, and check out our Code of Conduct.
NimbUs is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Retrocomputing Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fretrocomputing.stackexchange.com%2fquestions%2f12004%2f0xf1-opcode-prefix-on-i80286%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown