Programming :: GCC Inline Assembler Doesn't Even Support Local Variable?
Jul 3, 2010
It's good that GCC support intel inline disassembly syntax, but it cannot even simply address local variables/parameters properly, making itself stupid and essentially useless, look at the following:
int myfunc(float f){
int x;
float fa[8];
asm(".intel_syntax noprefix
"
"mov eax, [x]
[Code]...
View 1 Replies
ADVERTISEMENT
Apr 12, 2010
I want to know is there some more efficient way of passing a pointer to a local variable as a parameter to a function in x86 asm? Right now I have to move the base pointer to a temp register, subtract from the register and pass that, like this (assuming a local var at esp-4):
Code:
mov eax, ebp
sub eax, 4
push eax
Is there a better way?
View 8 Replies
View Related
Jun 9, 2011
I am new to using 'pragma pack' and here is what I am running into :
Process A:
a.h -> defines a struct XYZ as PACKED and is of size 44bytes
a.c -> includes a.h and is able to print the size as 44 bytes.
Process B
b.c -> includes a.h,
b.c -> gets a message from process A, with struct XYZ in the message as data.
b.c -> After getting message, it is unable to print the elements of struct correctly. This is because the sizof (XYZ) in b.c is seen as 48 bytes.
I suspect, in b.c, the local variable of struct XYZ is being padded and not PACKED.
View 4 Replies
View Related
Feb 17, 2011
how to assign a local variable value to a global variable....
View 2 Replies
View Related
Feb 14, 2011
how to use absolute sections in gnu assembler?
View 2 Replies
View Related
Feb 3, 2011
Is it good to set a recursive function as inline? I would think it would increase the performance speed of the program.
View 2 Replies
View Related
Jan 6, 2010
I was creating a script and I can't figure out why this isn't working....
Code:
When I try to execute it, this happens:
Code:
Why is my value changed to 0? It's like it's checking it as a scalar value...
View 6 Replies
View Related
Aug 27, 2010
I was going through a file known as linux-2.6.34/kernel/timer.c and found following code.
static inline void
timer_set_base(struct timer_list *timer, struct tvec_base *new_base)
{
timer->base = (struct tvec_base *)((unsigned long)(new_base) |
tbase_get_deferrable(timer->base));
}
I want to understand what is it doing. What is the meaning of static inline in above? I searched and came across
[Code]...
View 4 Replies
View Related
Jan 16, 2010
I need to write a module in pure assembler.Now the linker needs symbols out of the kernel library to link to ( module_init, module_exit, printk).Does anybody know the kernel library name, or are these symbols only in the compressed kernel image (vmlinuz) ?And if, how can I link to a compressed kernel image ?
View 6 Replies
View Related
Jul 9, 2011
GNU assembler 2.17 And without having to prefix them. I'm skimming through as info page and can't find any pseudo operator or assembler directive of this type. E.g. 74 would be a decimal number. But I want it to be hexa 74 without the need to write 0x74.
NOTE: as is the GNU assembler.
EDIT: Google led me to discover this:
Quote:
If you write numbers without an explicit indication of the base, the most recent `.RADIX S' command determines how they are interpreted. However, on the one hand, it says the most recent and, on the other one, it applies to GASP, the GNU assembler preprocessor. IDK if it is the same as as (the GNU assembler).
View 2 Replies
View Related
Jun 16, 2010
I am trying to learn assembly using nasm as assembler. I did not found example related to string operation. I had following example code,
global asm_strlen
section .data
section .bss
section .text
[code].....
my problem is at highlighted line, I am not getting how to copy a byte into 4 byte reg. rather what is syntax of mov instruction to mov byte to WORD DWORD etc.
View 3 Replies
View Related
Feb 27, 2010
For some reason, mport support has been removed from iptables 1.3.8 (was there in 1.3.7). However, multiport support is there. Does anyone here know why and what's the difference between the two in terms of operation? I have written firewall rules using mport. Can it directly be replaced 1:1 with multiport?
View 1 Replies
View Related
Aug 21, 2009
I'm trying to read content of file to variable and use this variable in for loop. The problem is, when I have c++ comment style in file - /*. Spaces in line are also interpreted as separated lines.
For example:
Code:
Changing $files to "$files" eliminate these problems but causes that whole content of variable is treated as one string (one execution of loop).
View 6 Replies
View Related
Apr 7, 2010
my script has a variable which comes in the form +00.00 +0.00 -00.00 or -0.00 (the numbers can be any in that form) for any that have a + symbol I need to remove the +, but if it has a - symbol it needs to stay.
i need to make a new variable with the string from the old variable btut without any plus sign. I have tried a lot of different ways with no success, each thing I tried either left the + or removed the entire string. I think this should work but doesn't
foo=+12.40
bar=${foo#+}
View 4 Replies
View Related
Apr 25, 2011
how I can search within a variable and assign the results to a new variable. I'll use the following as an example -
cars="Audi BMW Cadillac Chevy Dodge Ferrari Ford Mercedes"
list=`echo ${cars} | egrep -o '<A?+|<C+'`
with the echo command I get the following output assigned to list -
A
C
C
What I'd like to get for output is -
Audi
Cadillac
Chevy
how I could do this regardless of upper/lower case letters?
View 5 Replies
View Related
Apr 28, 2010
included shell script inside c program, and i wanted to assign the value of c variable to shell variable..Can any one please suggest me how to do it?
View 8 Replies
View Related
Mar 17, 2011
This loop is part of a bash script which takes multiple arguments.
Code:
for ((i=1;i<=$number;++i)) ; do
offset=$(($i+5))
[code]...
View 3 Replies
View Related
Jan 11, 2011
I'm testing HTML5 for the first time, using Firefox (beta) 4.0b8 and SeaMonkey (beta) 2.1b1, and its ignoring some CSS. Specifically, I have problems with the <details> tag. (It is nested in a paragraph...I am using it to provide an in-paragraph definition in hopes it can be toggled.)
Firefox only partly supports <details>. It's not supposed to show anything except the content of <summary>, unless you click on <summary>'s content. Instead, it puts a line break before the content of <details>, splitting the paragraph in two peices (which looks silly), without the "closed/open" functionality.
So I tried using "display:inline" in my CSS, but that gets ignored. Just for fun, I also tried "display:hidden" (also ignored) and "display:none" (obeyed).
SeaMonkey doesn't doesn't do anything special with the content of <display>...but it also ignores the same CSS as Firefox.
The only thing I can do to support semantic design is apply "font-style:italic" to all <details> elements.
Granted, you might ask, "why bother using <details> at all. then?" Well, I would like to have <details> for the browsers that support it, with the "font-style:italic" to degrade the page nicely for those that don't (such as for SeaMonkey).
Does anyone know why "display:inline" and "display:hidden" get ignored?
View 1 Replies
View Related
Dec 4, 2010
i want to pass variable in mysql qyery in c programming
View 1 Replies
View Related
May 19, 2011
I am running opensuse11.4. When trying to forward emails I can only do so as attachment. When I click and hold to select the forward inline option I get an empty email - same as if I would have clicked new. The same happens when I place the inline button on to the toolbar. Is this a bug with Kmail or is there another setting to forward mail inline?
View 1 Replies
View Related
Aug 28, 2010
I am looking for a assembler, in my college there is a ia32build assembler. I have tried searching it in Google, but I can't find it. I have x86 processor and I want to install it in Ubuntu 10.4.
Edit 1 : I am not sure about the assembler name but we assemble it by ia32build command.
Edit 2 : The syntax is quite different from nasm. Here's my sample code.
.intel_syntax noprefix
.text
msg: .asciz "Hello World !"[code].....
View 2 Replies
View Related
Mar 4, 2010
presently am doing an LTSP project i have sucessfully insatlled DosBox and Oracle in fedora9 now i wanted to install tsam ( Turbo Assembler )
View 1 Replies
View Related
Feb 15, 2010
I was working my way through the steps for downloading and installing the kernel source I have done this on ever Fedora release, so this is a new error for me. The error was from yum-builddep. Here is the command and error output:
[Code]
While the symptom is a script error, I am not sure what is causing the problem.
View 2 Replies
View Related
Sep 20, 2010
I am running a Cron job which mails the content of a log report every day. The problem is that the contents are sent as an attachment instead of as the body of the email. The strange thing is that if I run the instructions from the command line everything works fine, but if I do so from the Cron job the log report is attached instead of being sent inline.
The instruction I use is:
Code:
mail -s "logfile for cron" cron@example.com </var/log/cron-log
Following some advice I read on a blog I also tried this instruction in my Cron file, but the result is the same: it works fine from the command line, but attaches the report when run from Cron:
Code:
echo "Content-Type: text/plain;" | mail -s "logfile for cron" cron@example.com </var/log/cron-log
How to ensure the content of the log file is inline?
View 11 Replies
View Related
Jan 23, 2011
I can insert an image inline with mutt by using attach, then using ctl+d to make the image appear inline. However, it appears below my signature. If anyone knows of a way to make the image appear above the signature, I'd be grateful for their input. (This is with mutt 1.5.21--usually sent from a Fedora 14 machine, but I haven't found the behavior to change with the platform.)
Unfortunately, it's necessary to do this at work, for a particular daily email. The workaround is to use Thunderbird for this particular email, but I'd much prefer to use mutt.
View 5 Replies
View Related
Oct 15, 2010
I set up some scripts n crontab and I found that the scripts are failing because cron seems not to load my user PATH variable. Is there any way to tell cron to load my PATH variable?
View 2 Replies
View Related
Sep 28, 2010
A simple TCP based chat server could allow users to use any TCP client (telnet, for example) to communicate with each other. For this question you should consider a single process, single thread server that can support exactly 2 clients at once, the server simply forwards whatever is sent from one client to the other (in both directions). Your server must not insist on any specific ordering of messages as soon as something is sent from one client it is immediately forwarded to the other client. As soon as either client terminates the connection the server can exit
View 4 Replies
View Related
Jul 28, 2011
i am trying to declare an environmental variable in the /etc/profile' (as per the tutorial i'm following) but when i declare it and do an echo i get nothing.Here's what i've done so far..nside /etc/profile:
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
if [ -d /etc/profile.d ]; then
[code]...
View 12 Replies
View Related
Mar 25, 2011
I have beat this enough and don't get what should have been a very simple thing to do. I build a variable;
Code:
CLIST=java,lua,python,php,perl,ruby,tcl
CLIST will be used by another bash script but I need to replace the commas with a space. I
[code]...
View 2 Replies
View Related
Apr 9, 2010
How would I go about defining a variable from a document name. Example:document01.doc I want to take the 01 and set X to equal integer 1.
View 1 Replies
View Related