mov_sreg.asm 573 B

1234567891011121314151617181920212223242526272829303132
  1. global _start
  2. section .data
  3. align 16
  4. mydword:
  5. dd 0
  6. %include "header.inc"
  7. ; 32-bit register move should set higher bits to zero
  8. mov eax, -1
  9. mov eax, ss
  10. and eax, 0xffff0000
  11. mov ebx, -1
  12. db 66h
  13. mov ebx, ss
  14. and ebx, 0xffff0000
  15. ; 32-bit memory move should preserver higher bits
  16. mov dword [mydword], 0xdeadbeef
  17. mov [mydword], ss
  18. mov ecx, [mydword]
  19. and ecx, 0xffff0000
  20. mov dword [mydword+4], 0xdeadbeef
  21. db 66h
  22. mov [mydword+4], ss
  23. mov edx, [mydword+4]
  24. and edx, 0xffff0000
  25. %include "footer.inc"