- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
When I read the book "Intel® 64 and IA-32 Architectures Software Developer’s Manual Volume 2 (2A, 2B & 2C):Instruction Set Reference", each instruction has some pseudo-code, for example:
IF 64-Bit Mode
THEN
#UD;
ELSE
tempAL ← AL;
tempAH ← AH;
AL ← (tempAL + (tempAH ∗ imm8)) AND FFH;
(* imm8 is set to 0AH for the AAD mnemonic.*)
AH ← 0;
FI;
And "Intrinsics Guide" is also described by pseudo-code(https://software.intel.com/sites/landingpage/IntrinsicsGuide/), for example:
Operation
- Tags:
- Intel® Advanced Vector Extensions (Intel® AVX)
- Intel® Streaming SIMD Extensions
- Parallel Computing
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Psudo code may vary from author to author, and potentially from document to document from the same author. When well written, the pseudo coded should be well understood by someone who's had some programming experience.
In the first case, you would (potentially) look like an IF THEN ELSE ENDIF type of programming structure except you do not see ENDIF, instead you see FI (IF spelled backwards). So this dialect appears to substitute FI for ENDIF. The first example also appears to use statements terminated with a semicolon (;), and use left arrow for assignment. You may find in the front of the book (first book) a glossary of terms to define what #UD means. Sight unseen, I would guess "Undefined" and the processor potentially would issue a fault. Comments appear to be using (* for open quote, and *) for close quote. It is relatively easy to grasp this.
The second example appears to use the := token for assignment as opposed to left arrow, and the FOR statement spells out the range instead of using comma separator. Why it does not use ROF for ENDFOR I cannot say, but regardless of choice of token, you would interpret the pseudo code correctly (the brain is capable of making sense out of fuzzy input).
In the second example:
FOR j := 0 to 7
i := j*16
dst[i+15:i] := ABS(a[i+15:i])
ENDFOR
You have to be mindful that the instruction set inside the CPU may have bit fields. The above appears to describe copying the absolute value of 8 16-bit bit fields from "a" into "dst".
Sometimes pseudo code is written in an actual language...
... but with the understanding that the pseudo code may violate something in the language and/or may have expressive or misspelled terms.
The point of the pseudo code is to convey the information, presumably in a better understanding way than actual code.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks you for your answer.
jimdempseyatthecove wrote:
Psudo code may vary from author to author, and potentially from document to document from the same author. When well written, the pseudo coded should be well understood by someone who's had some programming experience.
In the first case, you would (potentially) look like an IF THEN ELSE ENDIF type of programming structure except you do not see ENDIF, instead you see FI (IF spelled backwards). So this dialect appears to substitute FI for ENDIF. The first example also appears to use statements terminated with a semicolon (;), and use left arrow for assignment. You may find in the front of the book (first book) a glossary of terms to define what #UD means. Sight unseen, I would guess "Undefined" and the processor potentially would issue a fault. Comments appear to be using (* for open quote, and *) for close quote. It is relatively easy to grasp this.
The second example appears to use the := token for assignment as opposed to left arrow, and the FOR statement spells out the range instead of using comma separator. Why it does not use ROF for ENDFOR I cannot say, but regardless of choice of token, you would interpret the pseudo code correctly (the brain is capable of making sense out of fuzzy input).
In the second example:
FOR j := 0 to 7
i := j*16
dst[i+15:i] := ABS(a[i+15:i])
ENDFORYou have to be mindful that the instruction set inside the CPU may have bit fields. The above appears to describe copying the absolute value of 8 16-bit bit fields from "a" into "dst".
Sometimes pseudo code is written in an actual language...
... but with the understanding that the pseudo code may violate something in the language and/or may have expressive or misspelled terms.The point of the pseudo code is to convey the information, presumably in a better understanding way than actual code.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found this . Might help you . i am a newbie so :0
http://refspecs.linux-foundation.org/IA64-softdevman-vol1.pdf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Amir
You uploaded Intel Itanium Programming Manual which is not so relevant neither to you nor to us. I suppose that you should have a look at Intel Intel 64 and IA-32 manuals.
http://www.intel.com/content/www/us/en/processors/architectures-software-developer-manuals.html

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page