Skip to Main Content
The X86 Microprocessors: Architecture and Programming (8086 to Pentium), 1st Edition
book

The X86 Microprocessors: Architecture and Programming (8086 to Pentium), 1st Edition

by Lyla B. Das
May 2024
Intermediate to advanced content levelIntermediate to advanced
665 pages
23h 2m
English
Pearson India
Content preview from The X86 Microprocessors: Architecture and Programming (8086 to Pentium), 1st Edition
510 THE x86 MICROPROCESSORS
MOV AX, [ESI] ;AX = 0560H
BSR BX, AX ;BX = 000AH meaning that D10 = 1
BSF CX, AX ;CX = 0005 meaning that D5 = 1
END STRT
15.4.3 | MOVSX and MOVZX Instructions
Two other new and useful instructions are the MOVSX and MOVZX instructions. In MOVSX,
the sign bit of a register (or memory) can be extended to any register. MOVZX zero extends the
contents of a register or memory location.  e MOVSX instruction is used for signed arithme-
tic and MOVZX for unsigned arithmetic.
Example 15.5
.386
.MODEL FLAT, STDCALL
.CODE
DAT1 DW 269
DAT2 DB 56
DAT3 DB 123
STRT: MOV AX, DAT1 ;AX = FEF3H
MOVSX ECX, AX ;ECX = FFFFFEF3H ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Microprocessors and Microcontrollers  by Pearson

Microprocessors and Microcontrollers by Pearson

Lyla B Das

Publisher Resources

ISBN: 9781282663169