|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
||||
|
||||
|
Concenating Strings in Assembly
i got bored the other day, thought id go through some of the programs ive made and optimize them a bit .etc ive got to the the point where the only way to make the executable smaller or faster is to port my code to a lower level language, and considering i use C, assembly is a good option (and as far as i know the only one). ive literally "converted" almost all my code except 3 lines
. in these 3 lines i concenate 3 strings to together. usually to find a function i would have a look through msdn for a function find out what .dll its stored in and then import it. However i cannot find one to concenate strings ive looked through user32.dll, kernel32.dll (duno why i looked there), advapi.dll and so on, i could make my own dll in C then import the strcat() into my asm application. but i want my application to be all assembly any help appreciated. |
|
#2
|
||||
|
||||
|
1. "Premature Optimization is the root of all evil" -- These are wise words indeed.
2. strcat() is a C function and is found in the standard C library (libc.lib or something like that). It is pretty trivially implemented in a few lines of C code. Here's one implementation. 3. Speaking of efficiency, strcat() is rather inefficient anyway, unless you really know how to use it. It is probably better to have a pointer to the end of the source string and append characters that way. See my point 1 about premature optimization.
__________________
Up the Irons What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home. "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest Down with Sharon Osbourne Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month |
|
#3
|
||||
|
||||
|
assembly really shud have it own forum here. The only other forum i know is fasm's own and there all transfixed on OS construction to help me and my string problems
. its a dieing language..... i wanna learn it b4 all learning resources go down with it. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Other Programming Languages > Concenating Strings in Assembly |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|