Re: how to set some value at a memory location in stack

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Vaibhav Shrimali <vaibhav.shrimali@xxxxxxxxx> writes:

> I can use a hard register for this task. But will it allow me to
> modify the memory location, between original return address and saved
> frame pointer, stored in it?

My point about the hard register was that you can't call force_reg
after register allocation.

> I think it will be just saved in the "saved registers" area of stack.
> The assembly conversion of the prologue I need is:
>
> POP EAX		        ; new prologue start
> PUSH EAX		; unencrypted return address
> PUSH EAX		; duplicate return address
> PUSH EBP		; standard prologue
> MOVE EBP, ESP
> XOR [EBP+4], EBP  	; [EBP+4] has EIP and XOR encryptes ret addr(EIP)
>
> I want to know the function which allows me to write a value at a
> memory address specified by a variable (generated by gen_rtx_MEM).
> I thought force_reg is the one. Now, can I use ebx/ecx/...etc register
> for the purpose.
> OR will copy_to_mode_reg() function do the job?
> OR is there any other function to do the job?

You need to copy your memory location into a register.  force_reg
copies it into a pseudo-register.  You need to copy it into a chosen
hard register.  Use emit_move_insn.

Ian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux