my code stock.com

Snippet options

Download: Download snippet as repaso-4110.txt.
Copy snippet: For this you need a free my code stock.com account.
Embed code : You will find the embed code for this snippet at the end of the page, if you want to embed it into a website or a blog!

;Repaso 4.1.10 Instrucciones de transferencia de datos
.386
.model flat

.data
var1 SBYTE -4, -2, 3, 1
var2 WORD 1000h, 2000h, 3000h, 4000h
var3 SWORD -16, -42
var4 DWORD 1, 2, 3, 4, 5

.code
main PROC

	;movsx ax, var1		; 7a) No es válida porque son de diferente tamaño
	mov ax, var2		; 7b) Si es una operación válida, son del mismo tamaño (16 bits)
	;mov eax, var3		; 7c) No porque eax es de 32 bits y var3 de 16 bits
	;mov var2, var3		; 7d) No, son de diferente tamaño
	;movzx ax, var2		; 7e) No, porque movzx requiere que destino > origen
	;movzx var2, al		; 7f) No, porque movzx rellena registros con ceros
	;mov ds, ax			; 7g) Sí se puede. DS ocupa 16 bits = 4 bytes ¡Preguntar!
	;mov ds, 11h		; 7h) No se puede. ¡Preguntar! ¿No se le puede dar valores inmediatos al DS?

	mov al, var1		; al = 0fch
	mov ah, var1+3		; ah = 01h

	mov ax, var2		; ax = 1000h
	mov ax, var2+4		; ax = 3000h		; Se mueve 4 bytes = 2 WORD
	mov ax, var3		; ax = fff0h
	mov ax, var3-2		; ax = 4000h

	mov edx, var4		; edx = 00000001h
	movzx edx, var2		; edx = 00001000h
	mov edx, var4+4		; edx = 00000002h	; Se mueve 4 bytes = 1 DWORD
	movsx edx, var1		; edx = fffffffch

	ret
main ENDP
END main

Create a free my code stock.com account now.

my code stok.com is a free service, which allows you to save and manage code snippes of any kind and programming language. We provide many advantages for your daily work with code-snippets, also for your teamwork. Give it a try!

Find out more and register now

You can customize the height of iFrame-Codes as needed! You can find more infos in our API Reference for iframe Embeds.