0
INCLUDE Irvine32.inc

.data
.code

main proc

  mov bh, 5
  mov bl, 3

  add bl, bh  
  mov si, bl  ; Why this wont work? How I store something in si?

  invoke ExitProcess, 0

main endp
end main
rkhb
  • 14,159
  • 7
  • 32
  • 60
Gabriel Rosario
  • 97
  • 2
  • 11
  • I don't know why the code look like this here. Sorry I'm a newbie. – Gabriel Rosario Sep 30 '15 at 03:59
  • 2
    because _si_ is a 16 bit register and bl is 8 bit. try `movsx si, bl` to sign extend _bl_ when placing it in _si_ . If you want the upper bits to be zero you can use `movzx si, bl` (zero extended) – Michael Petch Sep 30 '15 at 04:06
  • 1
    Should also point out that `movsz` and `movsx` are only available on 386+ , but I made the assumption that since you are using _Irvine32_ that you were targeting 32 bits already. – Michael Petch Sep 30 '15 at 04:18
  • Yes!!! It's working thanks a lot Michael. And yes I'm in 32 bits. Thanks for the help. – Gabriel Rosario Sep 30 '15 at 16:20

0 Answers0