This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:multiasm:papc:chapter_6_7 [2025/10/23 14:52] – [BMI1 and BMI2 Instructions] ktokarz | en:multiasm:papc:chapter_6_7 [2026/01/22 12:11] (current) – [Sign extension] ktokarz | ||
|---|---|---|---|
| Line 159: | Line 159: | ||
| * **cwde** - converts word in ax to doubleword extended in eax | * **cwde** - converts word in ax to doubleword extended in eax | ||
| * **cdq** - converts doubleword in eax to quadword in edx:eax | * **cdq** - converts doubleword in eax to quadword in edx:eax | ||
| + | * **cdqe** - convert doubleword in eax to quadword in rax | ||
| + | * **cqo** - convert quadword in rax to double quadword in rdx:rax | ||
| - | Sign extension instructions work solely with the accumulator. Fortunately, | + | Sign extension instructions work solely with the accumulator. Fortunately, |
| * **movsx** - copies and sign-extends a byte to a word or doubleword or word to doubleword. | * **movsx** - copies and sign-extends a byte to a word or doubleword or word to doubleword. | ||
| * **movzx** - copies and zero-extends a byte to a word or doubleword or word to doubleword. | * **movzx** - copies and zero-extends a byte to a word or doubleword or word to doubleword. | ||
| Line 544: | Line 546: | ||
| </ | </ | ||
| - | BEXTR Contiguous bitwise extract. | + | The **blsi** instruction extracts the single, |
| - | BLSI Extract | + | |
| - | BLSMSK Set all lower bits below first set bit to 1. | + | |
| - | BLSR Reset lowest set bit. | + | |
| - | BZHI Zero high bits starting from specified bit position. | + | |
| - | PDEP Parallel | + | <figure blsi_instr> |
| - | PEXT Parallel | + | {{ : |
| + | < | ||
| + | </ | ||
| + | |||
| + | The **blsmsk** instruction sets all lower bits below a first bit set to 1. It is shown in figure {{ref> | ||
| + | |||
| + | <figure blsmsk_instr> | ||
| + | {{ : | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | The **blsr** instruction resets (clears the bit to zero value) the lowest set bit. It is shown in figure {{ref> | ||
| + | |||
| + | <figure blsr_instr> | ||
| + | {{ : | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | The **bzhi** instruction resets high bits starting from the specified bit position, as shown in figure {{ref> | ||
| + | |||
| + | <figure bzhi_instr> | ||
| + | {{ : | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | The **pdep** instruction performs a parallel | ||
| + | |||
| + | <figure pdep_instr> | ||
| + | {{ : | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | The **pext** instruction performs a parallel | ||
| + | |||
| + | <figure pext_instr> | ||
| + | {{ : | ||
| + | < | ||
| + | </ | ||