How to move the value of a floating point register to a general-purpose register in MIPS?
Date : March 29 2020, 07:55 AM
|
Can I move a float stored in a _m128 SSE register directly to a normal register?
Date : March 29 2020, 07:55 AM
help you fix your problem The result is actually already in register; you simply need to tell the compiler to interpret it as a scalar instead of a vector. You're looking for the _mm_cvtss_f32 intrinsic: float result = _mm_cvtss_f32(vector_result);
|
MASM Assembly move 8 bit register to the 16 bit register (ie. mov cx, ch)
Date : March 29 2020, 07:55 AM
I hope this helps you . The mov instruction is used to move between operands of the same size. What you want to is extend the 8-bit ch into the 16-bit cx. There are two instructions available for that purpose: movzx cx,ch ; zero-extends ch into cx. the upper byte of cx will be filled with zeroes
movsx cx,ch ; sign-extends ch into cx. the upper byte of cx will be filled with the most significant bit of ch
shr cx,8 ; zero-extend
sar cx,8 ; sign-extend
|
NASM - How do you move an 8-bit register into a full 32-bit register?
Date : March 29 2020, 07:55 AM
Any of those help Use the MOVZX instruction: movzx ecx, al ; move byte to doubleword, zero-extension
mov al,0x7F
movzx ebx,al ; ebx = 0x0000007F
movsx ebx,al ; ebx = 0x0000007F
mov al,0x80
movzx ebx,al ; ebx = 0x00000080
movsx ebx,al ; ebx = 0xFFFFFF80
|
Assembly - why do we need to move certain values from register to another register (f.ex., mov si, ax) during a write op
Date : March 29 2020, 07:55 AM
it fixes the issue The calling convention for interrupt 21h "system calls" has the arguments and return codes in specific registers. E.g. the selector of which type of call to make is in register ah. For the Open File call (3dh), al is the sharing mode and ds:dx is the pointer to the filename. It returns its result in ax. But ax overlaps ah and al and in order to do the write call, 40h must be put in ah as that is the selector for the Write call. The file handle returned in ax must be preserved, which involves either writing it to memory or moving it to a register which is guaranteed to be preserved across the call. You can see documentation on the int 21h calling conventions e.g. here, or in Ralph Brown's interrupt list. See also other x86 docs in the x86 tag wiki.
|