This article is rated C-class on Wikipedia's
content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||
|
Some small and working examples of how to use assembly language. Usually examples makes people leap forward in knowledge and learning.
Thanks 193.28.147.12 08:40, 20 January 2007 (UTC)
I think this article :
Ericd 20:54 Apr 23, 2003 (UTC)
isn't NASM a free assembler?
Perhaps this should be moved to Wikibooks? Dysprosia 12:12, 23 Oct 2003 (UTC)
This article doesn't look like anything it has anything to do with assembly language, it looks more like a general overview of x86. Those articles already exist in the form of the x86 and IA-32 articles.
-- ykhan 17:25, 2004 May 3 (UTC)
I agree. In fact, its not even a fair or correct description of x86 CPUs -- in particular AMD's processors do not have a "rename register" stage. (Rename registers are implicit, and don't require an additional stage to be assigned like they do in other processors.) A corrected version of this description could probably be added to an x86 CPU page.
I think this article should contrast x86 assembly versus, say, DSP, RISC assemblies. Talk about complex addressing, independence from alignment restrictions, atomic instructions, SIMD instructions, implicit flags, partially implicit and partially general registers.
(Paul Hsieh July 6, 2005)
To answer the question of merging IA32 and IA64 article's.
A catalog separate's, and only usage binds.
A catalog can hold separate usage bindings.
Niels Krook
Yeah, I agree too guys. - Alex
LazyASM 0.52
NASM 0.98.39
FASM 1.64
NBASM32 00.25.97
YASM 0.40
maybe such a list should be created?
To answer the question of merging IA32 and IA64 article's.
A catalog seperate's, and only usage binds.
A catalog can hold seperate usage bindings.
Niels Krook.
How is Framebuffer UI in the External Links related to Assembly? This proves the above point that this article is not its own purpose, but rather an ad or a comparison. —The preceding unsigned comment was added by 24.185.112.164 ( talk) 02:03, 28 December 2006 (UTC).
The section on processor modes is just plain wrong. The *only* difference between 16- and 32-bit modes is the *default* data and address sizes, however, one can override the default address and data sizes with prefixes (67 and 66 hex, respectively.)
The difference between real and protected modes lies in the meaning of segment register values -- in real mode, the segment base is directly computed from the segment register value by shifting right by four and the limit value is left unmodified (it defaults to 64K at boot time), whereas in protected mode it is an index (selector) into one of the Descriptor Tables (Global Descriptor Table or Local Descriptor Table) from which the base and limit are obtained. One normally assumes 16 bits when one is discussing real mode, but it is possible to force the processor into 32-bit real mode. (This, incidentally, is not the so-called "unreal mode", that is simply 16-bit real mode with the segment limits set to 4 GB.)
There are a handful of instructions related to descriptor tables that are unavailable in real mode. Also, the processor will not allow paging to be enabled in real mode. Tere is no obvious technical reason for that restriction, but it is enforced by the processor.
V86 mode is formally a submode of protected mode, and all the memory protections of protected mode are active, however, segments are handled the same way as in (16-bit) real mode. There is no way to force the processor into any kind of "32-bit V86 mode" (that works on all processors, that is.)
32-bit and SIMD instructions are available in all these modes!
x86-64 adds a new top-level mode, long mode, with the submodes compatibility mode (which in turn can be 16 or 32 bit) and 64-bit mode, which makes considerable changes to the instruction encoding, which allows a bigger register set. 64-bit instructions and the extended register set are only available in 64-bit mode.
Thus, you have a mode chart looking like this:
There is also System Management Mode. This is actually not an ISA-level processor mode at all; rather, it is a special high-priority interrupt level (higher than even Non-Maskable Interrupt.) By default, SMM is entered in 16-bit Real Mode with 4 GB limits ("Unreal mode"), but it is possible and legal to switch processor modes while in SMM. The only instruction-level difference between SMM and ordinary execution is that the RSM (return from system management interrupt) instruction is only available after an SMM.
Hpa 00:45, 25 August 2007 (UTC)
I have fixed the issues that people have been concerned about with this article.
Hopefully this article is much better now. Da rulz07 08:16, 14 November 2007 (UTC)
Young, Holla —Preceding unsigned comment added by 75.161.178.31 ( talk) 06:00, 2 December 2007 (UTC)
Correction: Microcode is *the* lowest level possible. It's made up for every processor model by electronic engineers. Assembly language is assembled to binary, which is sent to the controller as electrical pulses. The controller "compiles" this to microcode which literally controls how electricity flows through the processor. Assembly is one rung above this, and how you interface with the complex electrical currents inside electrical devices (which represent higher level things). Some companies refer to their microcode and micro-software implementations as "firmware". :)
Don't call this "original research". (Ed. note: Taken to mean something like "I'm not a racist, but", combined with it being a directive, I guess it's correct) There are articles about it here on Wikipedia and plenty of info about it can be found on the web. I just happened to know this because I'm currently a mediocre systems programmer in "training". ;) If you really want hard links to sources, let me know. But the statement is erroneous and should be removed. Maybe it could be changed to say that ASM is the lowest-level language possible outside the electronic circuit manufacturing industry? It's not limited to computers either; there are microcode implementations in your remote control, alarm clock, etc. And it should be noted, microcode implementations are RARELY cross-compatible:
For example, a company makes a CPU series called "X":
X-1 model will have a distinct implementation
X-2 will be binary compatible with X-1, but have different microcode/aka firmware
To extend that, imagine series "Y" comes out with wider addressing:
1) It can still run X-series instructions
2) X-series can NOT run Y-series instructions
3) Internal microcode is TOTALLY different
...a contrived example, but generally how it works... —Preceding
unsigned comment added by
67.142.163.36 (
talk) 11:40, 27 January 2010 (UTC)
I looked in this article for a summary or pointer to the pseudo instructions and meta language of intel's family of assemblers, but don't see it. Such a description would explain the features of this non-sensical medley of examples:
name example %set (debug, 0) %*define (bit (b)) (%eval (1 shl (%b and 7))) %*define (set_bit (b)) (or ds:byte ptr %byte(%b), %bit (%b)) %if(%debug)then( ; debug stuff here )else( ; non-debug stuff here )fi $genonly $eject txt group rom_text dgroup group data assume cs:txt, ds:dgroup, es:dgroup Init_data segment public 'Init_data' extrn table_init :WORD Init_data ends stack_frame struc old_bp dw ? old_es dw ? old_ds dw ? ret_ip dw ? ret_seg dw ? arg2 dd ? arg1 dd ? stack_frame ends
Anybody know where I can find such a reference, whether on Wikipedia or online somewhere? 131.89.192.111 ( talk) 23:53, 27 January 2010 (UTC)
How linker assembly code 16B with the c language ?
There should be no subject called "x86 assembly language" in wikipedia.
An entry should cover one concept. Even if it is controversial what the concept should be named, the content should be one subject and cohesive.
This entry invites a mishmash of miscellaneous comments, as it actually is.
An interesting reference is Randall Hyde. He compares different assemblers, including his own. It comes out very well. I will not deny that this reference has value, but is this how Wikipedia is supposed to be?
Somewhere I had added a reference to the book of Morse, the designer of the 8086, what I consider the most seminal book of the architecture.
I can't find it back in the tangle of x86 stuff, nor can I point out which of the wikipedia subjects would be the place where this reference is to be expected.
80.100.243.19 (
talk) 14:23, 25 February 2011 (UTC)
In the very first sentence, backward compatibility is mentioned as a property. Yes, old programs may run unaltered on newer hardware. But that is a property of the x86 familiy of processors rather than its assembly language. Rbakels ( talk) 10:07, 9 December 2011 (UTC)
Hello fellow Wikipedians,
I have just modified 3 external links on X86 assembly language. Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:
When you have finished reviewing my changes, please set the checked parameter below to true or failed to let others know (documentation at {{
Sourcecheck}}
).
This message was posted before February 2018.
After February 2018, "External links modified" talk page sections are no longer generated or monitored by InternetArchiveBot. No special action is required regarding these talk page notices, other than
regular verification using the archive tool instructions below. Editors
have permission to delete these "External links modified" talk page sections if they want to de-clutter talk pages, but see the
RfC before doing mass systematic removals. This message is updated dynamically through the template {{
source check}}
(last update: 18 January 2022).
Cheers.— InternetArchiveBot ( Report bug) 13:35, 21 July 2016 (UTC)
It says "x86 assembly has the standard mathematical operations add
, sub
, mul
, and idiv
", but should imul
and div
be included in this list?
Thanks — Preceding unsigned comment added by IHeartHistory ( talk • contribs) 02:27, 1 November 2017 (UTC)
When and how did AT&T syntax come into being, and where is (was) it documented? The article should probably address this. If you, dear reader, know of any suitable sources ( man pages for an assembler that AT&T shipped as part of some version of UNIX, maybe? Something else?), please tell. Zazpot ( talk) 20:25, 30 December 2018 (UTC)
x86 Assembly, DOS MASM, Windows MASM, etc are all different languages. They are heavily base on x86 assembly, but NOT the same thing at all as x86 assembly. Software written in x86 assembly does not need an OS to execute on an x86 machine, however all those other examples do, because they are built on the foundation of their respective OSs along with the libraries and whatnot that those bring with them.
This section is conflating concepts which, while they are similar in some respects, are functionally very different. Nabeel_co ( talk) 20:11, 5 January 2023 (UTC)
This article is rated C-class on Wikipedia's
content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||
|
Some small and working examples of how to use assembly language. Usually examples makes people leap forward in knowledge and learning.
Thanks 193.28.147.12 08:40, 20 January 2007 (UTC)
I think this article :
Ericd 20:54 Apr 23, 2003 (UTC)
isn't NASM a free assembler?
Perhaps this should be moved to Wikibooks? Dysprosia 12:12, 23 Oct 2003 (UTC)
This article doesn't look like anything it has anything to do with assembly language, it looks more like a general overview of x86. Those articles already exist in the form of the x86 and IA-32 articles.
-- ykhan 17:25, 2004 May 3 (UTC)
I agree. In fact, its not even a fair or correct description of x86 CPUs -- in particular AMD's processors do not have a "rename register" stage. (Rename registers are implicit, and don't require an additional stage to be assigned like they do in other processors.) A corrected version of this description could probably be added to an x86 CPU page.
I think this article should contrast x86 assembly versus, say, DSP, RISC assemblies. Talk about complex addressing, independence from alignment restrictions, atomic instructions, SIMD instructions, implicit flags, partially implicit and partially general registers.
(Paul Hsieh July 6, 2005)
To answer the question of merging IA32 and IA64 article's.
A catalog separate's, and only usage binds.
A catalog can hold separate usage bindings.
Niels Krook
Yeah, I agree too guys. - Alex
LazyASM 0.52
NASM 0.98.39
FASM 1.64
NBASM32 00.25.97
YASM 0.40
maybe such a list should be created?
To answer the question of merging IA32 and IA64 article's.
A catalog seperate's, and only usage binds.
A catalog can hold seperate usage bindings.
Niels Krook.
How is Framebuffer UI in the External Links related to Assembly? This proves the above point that this article is not its own purpose, but rather an ad or a comparison. —The preceding unsigned comment was added by 24.185.112.164 ( talk) 02:03, 28 December 2006 (UTC).
The section on processor modes is just plain wrong. The *only* difference between 16- and 32-bit modes is the *default* data and address sizes, however, one can override the default address and data sizes with prefixes (67 and 66 hex, respectively.)
The difference between real and protected modes lies in the meaning of segment register values -- in real mode, the segment base is directly computed from the segment register value by shifting right by four and the limit value is left unmodified (it defaults to 64K at boot time), whereas in protected mode it is an index (selector) into one of the Descriptor Tables (Global Descriptor Table or Local Descriptor Table) from which the base and limit are obtained. One normally assumes 16 bits when one is discussing real mode, but it is possible to force the processor into 32-bit real mode. (This, incidentally, is not the so-called "unreal mode", that is simply 16-bit real mode with the segment limits set to 4 GB.)
There are a handful of instructions related to descriptor tables that are unavailable in real mode. Also, the processor will not allow paging to be enabled in real mode. Tere is no obvious technical reason for that restriction, but it is enforced by the processor.
V86 mode is formally a submode of protected mode, and all the memory protections of protected mode are active, however, segments are handled the same way as in (16-bit) real mode. There is no way to force the processor into any kind of "32-bit V86 mode" (that works on all processors, that is.)
32-bit and SIMD instructions are available in all these modes!
x86-64 adds a new top-level mode, long mode, with the submodes compatibility mode (which in turn can be 16 or 32 bit) and 64-bit mode, which makes considerable changes to the instruction encoding, which allows a bigger register set. 64-bit instructions and the extended register set are only available in 64-bit mode.
Thus, you have a mode chart looking like this:
There is also System Management Mode. This is actually not an ISA-level processor mode at all; rather, it is a special high-priority interrupt level (higher than even Non-Maskable Interrupt.) By default, SMM is entered in 16-bit Real Mode with 4 GB limits ("Unreal mode"), but it is possible and legal to switch processor modes while in SMM. The only instruction-level difference between SMM and ordinary execution is that the RSM (return from system management interrupt) instruction is only available after an SMM.
Hpa 00:45, 25 August 2007 (UTC)
I have fixed the issues that people have been concerned about with this article.
Hopefully this article is much better now. Da rulz07 08:16, 14 November 2007 (UTC)
Young, Holla —Preceding unsigned comment added by 75.161.178.31 ( talk) 06:00, 2 December 2007 (UTC)
Correction: Microcode is *the* lowest level possible. It's made up for every processor model by electronic engineers. Assembly language is assembled to binary, which is sent to the controller as electrical pulses. The controller "compiles" this to microcode which literally controls how electricity flows through the processor. Assembly is one rung above this, and how you interface with the complex electrical currents inside electrical devices (which represent higher level things). Some companies refer to their microcode and micro-software implementations as "firmware". :)
Don't call this "original research". (Ed. note: Taken to mean something like "I'm not a racist, but", combined with it being a directive, I guess it's correct) There are articles about it here on Wikipedia and plenty of info about it can be found on the web. I just happened to know this because I'm currently a mediocre systems programmer in "training". ;) If you really want hard links to sources, let me know. But the statement is erroneous and should be removed. Maybe it could be changed to say that ASM is the lowest-level language possible outside the electronic circuit manufacturing industry? It's not limited to computers either; there are microcode implementations in your remote control, alarm clock, etc. And it should be noted, microcode implementations are RARELY cross-compatible:
For example, a company makes a CPU series called "X":
X-1 model will have a distinct implementation
X-2 will be binary compatible with X-1, but have different microcode/aka firmware
To extend that, imagine series "Y" comes out with wider addressing:
1) It can still run X-series instructions
2) X-series can NOT run Y-series instructions
3) Internal microcode is TOTALLY different
...a contrived example, but generally how it works... —Preceding
unsigned comment added by
67.142.163.36 (
talk) 11:40, 27 January 2010 (UTC)
I looked in this article for a summary or pointer to the pseudo instructions and meta language of intel's family of assemblers, but don't see it. Such a description would explain the features of this non-sensical medley of examples:
name example %set (debug, 0) %*define (bit (b)) (%eval (1 shl (%b and 7))) %*define (set_bit (b)) (or ds:byte ptr %byte(%b), %bit (%b)) %if(%debug)then( ; debug stuff here )else( ; non-debug stuff here )fi $genonly $eject txt group rom_text dgroup group data assume cs:txt, ds:dgroup, es:dgroup Init_data segment public 'Init_data' extrn table_init :WORD Init_data ends stack_frame struc old_bp dw ? old_es dw ? old_ds dw ? ret_ip dw ? ret_seg dw ? arg2 dd ? arg1 dd ? stack_frame ends
Anybody know where I can find such a reference, whether on Wikipedia or online somewhere? 131.89.192.111 ( talk) 23:53, 27 January 2010 (UTC)
How linker assembly code 16B with the c language ?
There should be no subject called "x86 assembly language" in wikipedia.
An entry should cover one concept. Even if it is controversial what the concept should be named, the content should be one subject and cohesive.
This entry invites a mishmash of miscellaneous comments, as it actually is.
An interesting reference is Randall Hyde. He compares different assemblers, including his own. It comes out very well. I will not deny that this reference has value, but is this how Wikipedia is supposed to be?
Somewhere I had added a reference to the book of Morse, the designer of the 8086, what I consider the most seminal book of the architecture.
I can't find it back in the tangle of x86 stuff, nor can I point out which of the wikipedia subjects would be the place where this reference is to be expected.
80.100.243.19 (
talk) 14:23, 25 February 2011 (UTC)
In the very first sentence, backward compatibility is mentioned as a property. Yes, old programs may run unaltered on newer hardware. But that is a property of the x86 familiy of processors rather than its assembly language. Rbakels ( talk) 10:07, 9 December 2011 (UTC)
Hello fellow Wikipedians,
I have just modified 3 external links on X86 assembly language. Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:
When you have finished reviewing my changes, please set the checked parameter below to true or failed to let others know (documentation at {{
Sourcecheck}}
).
This message was posted before February 2018.
After February 2018, "External links modified" talk page sections are no longer generated or monitored by InternetArchiveBot. No special action is required regarding these talk page notices, other than
regular verification using the archive tool instructions below. Editors
have permission to delete these "External links modified" talk page sections if they want to de-clutter talk pages, but see the
RfC before doing mass systematic removals. This message is updated dynamically through the template {{
source check}}
(last update: 18 January 2022).
Cheers.— InternetArchiveBot ( Report bug) 13:35, 21 July 2016 (UTC)
It says "x86 assembly has the standard mathematical operations add
, sub
, mul
, and idiv
", but should imul
and div
be included in this list?
Thanks — Preceding unsigned comment added by IHeartHistory ( talk • contribs) 02:27, 1 November 2017 (UTC)
When and how did AT&T syntax come into being, and where is (was) it documented? The article should probably address this. If you, dear reader, know of any suitable sources ( man pages for an assembler that AT&T shipped as part of some version of UNIX, maybe? Something else?), please tell. Zazpot ( talk) 20:25, 30 December 2018 (UTC)
x86 Assembly, DOS MASM, Windows MASM, etc are all different languages. They are heavily base on x86 assembly, but NOT the same thing at all as x86 assembly. Software written in x86 assembly does not need an OS to execute on an x86 machine, however all those other examples do, because they are built on the foundation of their respective OSs along with the libraries and whatnot that those bring with them.
This section is conflating concepts which, while they are similar in some respects, are functionally very different. Nabeel_co ( talk) 20:11, 5 January 2023 (UTC)