I've been converting some C code to assembly for my homework; it was going well but I'm having trouble with a for loop for hours. I could not understand where is the problem and decided to ask. I'm posting the part where I'm having trouble of my C-code and assembly-code; every other part of codes act same and the variable values are same. I'm waiting this two codes to act same, but they don't.
I have read where C is first converted to Assembly before its final compilation to binary. Is there a way to do this with Bash commands? I would like the understanding that Assembly allows to Bash somehow.
This is the make step error./tmp/cctiuwxL.s is the make temporary dirictory which is distroyed after the make process finises . The problem is how can I hold the /tmp/cctiuwxL.s dirictory .Then I can check it and find out the proiblem.
am writing a small search program for my class. I have decided to use indexing for my program. Ive researched online about indexing and how search engines do it. If im gonno do that I need to create inverted files to associate files to numbers ( numbers being the index of my paths ) . Now I was wondering what would be the best way to create an inverted file ? I was going to create sql tables using mysql api in C but then again there is no array data type or vectors to store few numbers in a single column in mysql and it is not advised to use Enum or SET
Could you please explain the relationship between the languages?For one, is C writing assembly when you compile, does every piece of code end up assembly/hex? Is there a way to convert (?port?) between them?I don't understand much at all of them yet, but I've seen examples where it looks like they are interacting, and an understanding of all of them looks to be important?
i wanna use chmod() in linux x86 [debian 3.7.2 x86] but i have some problem in function argv
look at this function: Code: Select all int chmod(const char *path, mode_t mode);
and mode_t modes: Code: Select all S_ISUID (04000) set-user-ID (set process effective user ID on execve(2))
S_ISGID (02000) set-group-ID (set process effective group ID on execve(2); mandatory locking, as described in fcntl(2); take a new file's group from parent direcق tory, as described in chown(2) and mkdir(2))
i know there is some problem in ecx and mode_t value/
I'm reading "Understanding the Linux Kernel" and came upon this assembly instruction: movl $(__KERNEL_CS << 16), %eax I am curious as to what "<<" means/does. I tried to gooogle, but google doesn't search for "<<".
I was following a simple tutorial on how to program and compile a hello world program using assembly when I got this error;Quote:ld: i386 architecture of input file `hello.o' is incompatible with i386:x86-64 output.The tutorial told me to make two files;Quote:hello.asmsection .data;section declaration
msg db "Hello, world!",0xa;our dear string len equ $ - msg ;length of our dear string section .text;section declaration
I have some code that opens a directory and reads in the names of files which are e.g. 0001, 0002, 0003 up to 9999I need to get all these numbers and then generate a new number that is not one of these numbers already.here is my code to check the files in the directory
As some of you know that I am new to this forum. I have another problem that I got stuck on. I have this file called "Fib.rbb" and my instructor told us to write an interpreter program by using Fib.rbb.
"You are to write an interpreter in Perl for Rongs Basic Basic (RBB) as explained in class. The BNF description for RBB and a test file called Fib.rbb are part of the RBB.zip file which is available in the Course Documents folder on blackboard. If you call your interpreter myIntp.pl, you would execute the program via perl myIntp.pl Fib.rbb
I am trying to extract 2 numbers from a same file and my goal is to print them both in another file, on the same line, separated with a space. I have to do that for 20 files and I would like to have therefore 20 lines like this in the output file. It would look like this :
And I did this by running a bash script with the following content :
#!/bin/bash ls execution$1$2*.* | while read filename do cat $filename | grep -e "Total aborts:" | cut -d " " -f3 >> abort$1$2.dat done
$1 and $2 are just strings to identify the different files I want to consider in this loop. This script works well to extract a number which is the 3rd field of a line starting with "Total aborts:".Now, how could I change this script to do what I mentioned above (i.e. extracting two numbers from two different lines) ? The second number is the 3rd field of a line starting with "Total throughput:"
I want the get the date of the oldest log in this directory and compare it with current date.Time of the each log can be seen before ".Z" prefix.I have written the following piece of code. However, it is not working for the following case:
LOGDAY=20101129 TODAY= 20101201
Difference is 72, which is not correct, since these are dates.
I'm trying to write a program that generates a random number and then tells if it is prime or not. I have doe some research about how to calculate prime and random numbers but I'm still having trouble. I don't really get how to calculate a prime number. I know a prime number is a number that is divisible by 1 and and itself. how to calculate a prime number in C?
I have a program that sends QByteArray datagrams over a udp socket. I would like to have 4 bytes of the datagram that contain a 32 bit integer. When saving numbers to the QByteArray, I have tried the static function number(int) and member function setNum(int), but they convert the integer to its decimal string representation and save that in the byte array. So if the number were 10, it takes 2 bytes, if it were 10,000,000 it takes 8 bytes. This wastes space, and makes it more difficult to get the number when it is packed with a few other pieces of data in the same datagram. Is there a standard way of doing this in Qt?
I would like to create a small C tool. I encounter a problem of how to make a function to check an input chars contains numbers (started from the second element).
char *mychar= "a3547"; (The result of function checking this is true) char *another_char = "t6548"; (The result of function checking this is true) char *next_char = "appl3"; (The result of function checking this is false) char *new_char = "b1aa3"; (The result of function checking this is false)
I'm learning shell scripting using bash and I want to generate 4 floating point number with 5 decimal places and write them to a file and a variable. I've done all this except the $RAMDOM enviroment variable does not generate a float number but a integrer.