![]() |
|
#31
|
|||
|
|||
Re: Assembly Tutorial?Code:
(gdb) <-- is the prompt once you've started gdb. You need to start gdb with the file you want to load as an argument first: Code:
Quote:
Code:
Have fun! |
|||
|
#32
|
|||
|
|||
Re: Assembly Tutorial?Hi Howard i hope u r not annoyed by my beginner questions. i always try to know where i am, so i think it is time to know about the specific use for those registers EAX, EBX, ECX, EDX,
i think for example EAX takes the system call like if we pass the integer $4,%eax and call int $0,x80 then the kernel call the write function. i think if u can go over quickly that will help me to understand them better noe the part that stil confuse me is this one CPP / C++ / C Code:
|
|
#33
|
|||
|
|||
Re: Assembly Tutorial?Code:
|
|
#34
|
|||
|
|||
Re: Assembly Tutorial?Your last two posts are like a chapter itself so i am working on them i am at work so i just read it briefly i did not grap a pen and a paper to analyze it step by step but here my two main concern now :
1 - i typed man 2 write i got an error message saying manual not installed or not found and i am wondering how to install it 2- when i type : as -gstabs example. s -o example .o then ld example.o -o example then gdb ./example this is what i got in my screen <gdb>...... now if i modify the code again and try to compile it and link it :i got an error nessage saying : as not a valid command so how to exit the gdb so i can compile again now i got the week end to work on the posts really good and i will set my goal to do this take a long variable and display it on the screen so if i am not mistaking i should convert the long to ascii then i can display it ? if i got stuck which i will lol i will ask you now i remmebred that this function :"ssize_t write(int fd, const void *buf, size_t count);" i can indentify int fd, when it comes to const void * buf there where i have to tell you that i never see some like that in c++ and i don't know where is that. The same think will apply to (size_t count) also ssize_t write(arg1,arg2,arg3)is it a return type or a void type your next post is crucial so i will be waiting ( i knwo i am asking too much and the reason is i could not use my man 2 write command thanks Howard |
|
#35
|
|||
|
|||
Re: Assembly Tutorial?Quote:
How to install would be a 'ubuntu support' question. Google that. You can also try 'man 2 write' for the particular man page. You could save the web page or copy/paste into editor for a smaller .txt file. Quote:
Code:
Code:
|
|
#36
|
|||
|
|||
Re: Assembly Tutorial?Hi, i know u may be going and not what ? lol
ok i am still doing the last two posts u did submit and this is what i got when i typed CPP / C++ / C Code:
thanks i will be working at ur post till u submit a response also i am getting the ssize function. So let me focus on that till ur next post. thanks again |
|
#37
|
|||
|
|||
Re: Assembly Tutorial?I think you should have thought and tried a bit more before sending this. You probably know this by now but:
Code:
That is because the program is not running at the time you are making that request. You need to: - start gdb with the file.s to run - then set a 'break' point, - then 'run' and look at register states while running - 'quit' - make adjustments to source.s file and and recompile - repeat There is no ssize function in that program. It's ssize_t and it is a datatype as I said above except I think it is signed. |
|
#38
|
|||
|
|||
Re: Assembly Tutorial?hi,
Part 1: CPP / C++ / C Code:
as -gstabs -sample.s -o sample.o ld sample.o -o sample gdb ./sample CPP / C++ / C Code:
break *_start+5 [cpp] - then 'run' and look at register states while running [cpp] it is here where i don't know what to type cuz if i type: info registers it will says program has no registers CPP / C++ / C Code:
Part 2: i am looking how to convert a long var to ascii code let is say my section data is like this: CPP / C++ / C Code:
so where the address of the tag obj should go and where the value(using the $ sign is the immediate mode i think which retrieve the value of the tag if i am not mistaking?) should go ?? Part 3: Merry Christmas for all Assembly Devs |
|
#39
|
|||
|
|||
Re: Assembly Tutorial?Code:
Make sure you do each of the commands and get similar results. If you are still having difficulties showing registers in gdb and have TRIPLE checked that you are doing EXACTLY what is shown, please post everything shown in xterm during your trial. |
|
#40
|
|||
|
|||
Re: Assembly Tutorial?Hi Howard
i need help to understand this instruction leal M, I/R/M O/S/Z/A/C This takes a memory location given in the standard format ( what is the standard format ??? ), and, instead of loading the contents of the memory location, loads the computed address ( what he means here by computed address ???) . For example, leal 5(%ebp,%ecx,1), %eax loads the address computed by 5 + %ebp + 1*%ecx and stores that in %eax this is my code to print A into the screen CPP / C++ / C Code:
now what is going to make it even greater is the following lwt is say that i have an integer var called num like this CPP / C++ / C Code:
hopefully i am getting something i already did dispay the "A" using the ascii code which 65 so the code posted did convert the 65 to char "A" the proble is how to tell the compiler to take my num=1975 and dispaly it ??? by the way 1975 is my birth year see later thanks |
Recent GIDBlog
Problems with the Navy (Chiefs) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Mixing C and assembly in x86 - Makefile nuances | aijazbaig1 | Assembly Language | 3 | 23-Apr-2008 09:29 |
| Tutorial: How to Make a Web 2.0-Style Logo | PhotoshopTrend | Graphics Forum | 0 | 20-Sep-2007 06:57 |
| Assemblers & assembly language | BlueFireCO. | Assembly Language | 2 | 26-Mar-2007 10:56 |
| Photoshop Tutorial: Make An Inspirational/Mystical Picture | ToddSAFM | Graphics Forum | 9 | 09-Aug-2005 21:32 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The