(I'm a newbie to SSE/asm, apologies if this is obvious or redundant)
Is there a better way to transpose 8 SSE registers containing 16-bit values than performing 24 unpck[lh]ps and 8/16+ shuffles and using 8 extra registers? (Note using up to SSSE 3 instructions, Intel Merom, aka lacking BLEND* from SSE4.)
Say you have registers v[0-7] ...
I have a piece of C++ code (compiled with g++ under a GNU/Linux environment) that load a function pointer (how it does that doesn't matter), pushes some arguments onto the stack with some inline assembly and then calls that function, the code is like :
unsigned long stack[] = { 1, 23, 33, 43 };
/* save all the registers and the stack p...
I have a project for my System Software class, we have to produce a subroutine to decompose a line of source into 4 components: label, op code, operand1, and operand2, and identify the n,i,x and e bit settings. I'm having a problem trying to figure out the nixbpe bit. thank you in advance for your help
here are some examples:
Compon...
In another question i had the problem to port the code
unsigned long stack[] = { 1, 23, 33, 43 };
/* save all the registers and the stack pointer */
unsigned long esp;
asm __volatile__ ( "pusha" );
asm __volatile__ ( "mov %%esp, %0" :"=m" (esp));
for( i = 0; i < sizeof(stack); i++ ){
unsigned long val = stack[i];
asm __volatil...
There seem to be a .CFI directive after every line and also there are wide varities of these ex.,.cfi_startproc , .cfi_endproc etc.. more here.
.file "temp.c"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
movq %rsp, %rbp
.cfi_offset 6, -16...
Does anyone have any visual examples?
...
I'm trying to develop a simple kernel using TASM, using this code:
; beroset.asm
;
; This is a primitive operating system.
;
;**********************************************************************
code segment para public use16 '_CODE'
.386
assume cs:code, ds:code, es:code, ss:code
org 0
Start:
mov ax...
We are working on a project to learn how to write a kernel and learn the ins and outs. We have a bootstrap loader written and it appears to work. However we are having a problem with the kernel loading. I'll start with the first part:
bootloader.asm:
[BITS 16]
[ORG 0x0000]
;
; all the stuff in between
;
; the bottom of ...
when compiling the instruction
movl 4(%ebp), 8(%ebp)
i got 'too many memory referene', what's wrong with it??
...
In the following text I asked two questions and I also described that what I know about these question so that you can understand my thinking.
Your precious comments about the below text are required.
Below is the Detail of 1ST Question
As we know that if we have one mega byte memory then we need 20 bits to address this memory. Another...
Hello,
I've been told that C types are machine dependent. Today I wanted to verify it.
void legacyTypes()
{
/* character types */
char k_char = 'a';
//Signedness --> signed & unsigned
signed char k_char_s = 'a';
unsigned char k_char_u = 'a';
/* integer types */
int k_int = 1; /* Same as "signe...
Consider the following sequence of actual outcomes for a single static branch. T means the branch is taken. N means the branch is not taken. For this question, assume that this is the only branch in the program.
T T T N T N T T T N T N T T T N T N
Assume a two-level branch predictor that uses one bit of branch history—i.e., a one-bit B...
Explains both UNIX (BSD flavor) & Linux system call conventions for x86-32:
http://www.int80h.org/bsdasm/#system-calls
http://www.freebsd.org/doc/en/books/developers-handbook/x86-system-calls.html
Can any one please tell me or point me to similar doc for x86-64 on both UNIX & Linux?
...
I have a pointer to a function (which i get from a vtable) and I want to edit the function by changing the assembler code (changing a few bytes) at runtime. I tried using memset and also tried assigning the new value directly (something like mPtr[0] = X, mPtr[1] = Y etc.) but I keep getting segmentation fault.
How can I change the code?...
ESP = ? stack pointer
What does E stand for here?
UPDATE
RSP for 64bit?
What does R mean here?
...
Standard Entry Sequence:
_function:
push ebp ;store the old base pointer
mov ebp, esp ;make the base pointer point to the current
;stack location – at the top of the stack is the
;old ebp, followed by the return address and then
;the parameters.
sub esp, x ...
Given a stack that displays characters to the screen First in First Out(FIFO), how do you switch it to display them Last in First Out(LIFO). Theoretically speaking... is it simply just sending the characters to print in reverse order?
...
I'm porting a small academic OS from TriCore to ARM Cortex (Thumb-2 instruction set). For the scheduler to work, I sometimes need to JUMP directly to another function without modifying the stack nor the link register.
On TriCore (or, rather, on tricore-g++), this wrapper template (for any three-argument-function) works:
template< class...
The code I currently have can be found at: http://fasm.pastebin.com/yY3C0aVF
I'm exceptionally new to assembly, only picked it up yesterday and I've looked through many an example and still can't figure out for myself how to write to the console. I always get an error when I seem to replicate it in my own way. If I'm not on the right t...
I've always wondered this, and still haven't found the answer. Whenever we use "cout" or "printf" how exactly is that printed on the screen?. How does the text come out as it does...(probably quite a vague question here, ill work with whatever you give me.). So basically how are those functions made?..is it assembly?, if so where does th...