1 Replies - 1357 Views - Last Post: 29 January 2013 - 04:37 AM Rate Topic: -----

#1 c3phalex1n  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 25-January 13

whats does movsx instruction do?!

Posted 29 January 2013 - 03:20 AM

Hi guys...!
I have searched on the net about this question but i could'nt find a good help...!
However, in the follow source i can not understand what does movsx do?!!!
Who can help me?! and describe for me?!!! Please

.section .data
        milad:
        .int 20
.section .text
.globl _start
_start:
        nop

        movl $0, %eax
        movl $0, %ebx
        movl $0, %ecx
        movb $20, %al
        addb $10, %al
        movw %100, %cx
        addw %cx, %bx
        movsx %bx, %ebx
        movl $100, %edx
        addl %edx, %edx
        addl milad, %edx
        addl %edx, milad
        movl $1, %eax
        movl $0, %ebx
        int &0x80




Is This A Good Question/Topic? 0
  • +

Replies To: whats does movsx instruction do?!

#2 andrewsw  Icon User is offline

  • Fire giant boob nipple gun!
  • member icon

Reputation: 2885
  • View blog
  • Posts: 9,575
  • Joined: 12-December 12

Re: whats does movsx instruction do?!

Posted 29 January 2013 - 04:37 AM

MOVSX destination, source
Logic: destination <- sign extend(source)

This instruction copies a source operand to a destination operand and extends its sign. This is particularly useful to preserve sign when copying from 8-bit register to 16-bit one, or from 16-bit register to 32-bit one.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1