anyone know how to code in ...

macka

Senior member
Apr 30, 2001
262
0
0
assembly language?? and where i can find some examples of programs such as one that finds the longest paldindrome in a file?
~macka
 

RSMemphis

Golden Member
Oct 6, 2001
1,521
0
0
Eeek.
Nowadays, next to no one programs in assembler, because programs typically run under Windows. Strangely, even for command line linux I have rarely seen assembler.

File handling (this works with software interrupts in assembler) is a little tricky.
Here is my suggestion:

Program the whole thing in C/Pascal/Basic and rest assured that computers nowadays do that at reasonable speed.

or:

Do all the file handling in C, and do the time critical stuff in assembler. You can place assembler code directly in C code, if I am not completely wrong with asm{}, maybe it was #asm (as a compiler directive)...

C compilers these days will likely producer better assembler code than you if you do it for the first time.
 

Elledan

Banned
Jul 24, 2000
8,880
0
0


<< Strangely, even for command line linux I have rarely seen assembler. >>


Portability and development time, 'nuff said ;)
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
There's virtually no reason to use asm at all, all you do is make your program more complicated, harder to maintain, non-portable and potentially slower. Trust in the compiler of your language of choice to generate asm for you, it's got more practice than you =)
 

thornc

Golden Member
Nov 29, 2000
1,011
0
0
Well assembler is still very used. The Linux kernel has many parts in assembly, embedded systems are usually programmed in
assembly just to state a few examples... anything that get near the hardware will be programmed in assembler



<< non-portable and potentially slower. Trust in the compiler of your language of choice to generate asm for you >>


I wouldn't, I have seen to many examples of what code the compilers generate... it's a bloat compared to what
a good assembler programmer would generate... and slower only if you don't know what you're doing...