flat assembler
Message board for the users of flat assembler.

Index > Heap > why assembly?

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
Turbo Lover



Joined: 22 Feb 2013
Posts: 32
Turbo Lover
so the question must be as old as the concept of hll. I understand that programmers must know assembly, at least for debugging (I have done some cracking myself, thanks to Richardo Narvaja & Olly). I want you to give me a good reason to use assembly. My point is :
- It's much easier to develop with HLL. the libs, not having to write tons of code just to make a loop or use a multidimentional array.
- Bugs. the more code you write the more bugs there will be
- Readability. Share the code.
- I've heard the speed & optimization story. Do you really think that any sane human can optimize better writing assembly than gcc -O3 -march=native? I mean ordinary programmers don't know and don't wish to know every little thing about processor arch he's writing for. You would have to rewrite code in order to optimize for every single proc.
- libs again! I got frustrated when discovered that something like
push dword float
push format
call printf
doesn't work properly, because you should use
push qword float
push format
call printf
(don't mind the syntax).
How many more of that kind of surprises are there waiting for assembly programmer using libc?
So why should I prefer assembly (disregarding fun & situations when you can't use HLL) ?
Post 22 Feb 2013, 15:35
View user's profile Send private message Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1137
Location: Russian Federation
comrade
I don't use assembly. I don't see a good reason for any practical programming. But having used assembly helps you understood how things really work under the hood, and makes you a better HLL programmer.

I happened learned asm before I learned C++. Switched to C++ for < 1 year and went bananas with templates and over non-sense. Then I switched to C and have never looked back. There is a balance for everyone.
Post 22 Feb 2013, 15:44
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
Turbo Lover



Joined: 22 Feb 2013
Posts: 32
Turbo Lover
comrade wrote:
But having used assembly helps you understood how things really work under the hood, and makes you a better HLL programmer.

agreed.
Didn't understand about templates. I have a hard time with libraries and arrays so I find assembly really impractical. I don't program just for fun anymore on assembler. I don't use assembler anymore, I was crazy about it in the past, that makes me sad. I have realized that I can't make anything useful w/ this tool.
Post 22 Feb 2013, 15:57
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17279
Location: In your JS exploiting you and your system
revolution
For the embedded systems that I work with assembly is a must.

Not everyone is writing code for a multi-core/multi-GHz/multi-GB/300W/Ubiquitous-OS machines.
Post 22 Feb 2013, 16:14
View user's profile Send private message Visit poster's website Reply with quote
TmX



Joined: 02 Mar 2006
Posts: 821
Location: Jakarta, Indonesia
TmX
Turbo Lover wrote:
I find assembly really impractical.


There still are valid reasons to use assembly:
- Embedded system (revolution just mentioned it)
- Compiler writing (e.g for code generator)
- Kernel
- etc

But if by "practical" you mean "writing applications fast", assembly is not built for that purpose. Use HLL. Who wants to write CRM software in assembly nowadays?
Post 22 Feb 2013, 16:25
View user's profile Send private message Reply with quote
Turbo Lover



Joined: 22 Feb 2013
Posts: 32
Turbo Lover
TmX wrote:


There still are valid reasons to use assembly:
- Embedded system (revolution just mentioned it)
- Compiler writing (e.g for code generator)
- Kernel
- etc

I know and I don't doubt that assembly is the best choice for a narrow set of problems.
compiler? haven't seen any compiler written in asm
Kernel? Tell me the kernel of modern OS isn't 80% C.
Microcontrollers? C again.
Post 22 Feb 2013, 16:31
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17279
Location: In your JS exploiting you and your system
revolution
Turbo Lover wrote:
compiler? haven't seen any compiler written in asm
Hmm, well let's see ... fasm is 100% assembly.
Turbo Lover wrote:
Kernel? Tell me the kernel of modern OS isn't 80% C.
Even if your figure is true then what about the other 20%?
Turbo Lover wrote:

Microcontrollers? C again.
Sure, if you overspec you uC then you can write it in C for many of the chips out there. But for high volume cost sensitive situations overspeccing can put you out of the market pretty quickly.

Hehe, what sort of response did you expect when coming to an assembly board saying that assembly is not useful?!


Last edited by revolution on 22 Feb 2013, 16:55; edited 1 time in total
Post 22 Feb 2013, 16:44
View user's profile Send private message Visit poster's website Reply with quote
TmX



Joined: 02 Mar 2006
Posts: 821
Location: Jakarta, Indonesia
TmX
Turbo Lover wrote:

compiler? haven't seen any compiler written in asm
Kernel? Tell me the kernel of modern OS isn't 80% C.


Ah, it seems that I misunderstood your question. Apologies.
Most people don't write compilers/kernels in 100% asm anymore,
because being cross platform/portable is a hot thing nowadays, and using assembly will defeat the goal. But still the asm knowledge is relevant.

I think you'd better ask BogdanOntanu (haven't visit this forum for a long time).
He writes his self-hosting assembler, Sol_Asm, and his OS, Solar_OS (which is built using Sol_Asm).
Post 22 Feb 2013, 16:53
View user's profile Send private message Reply with quote
Turbo Lover



Joined: 22 Feb 2013
Posts: 32
Turbo Lover
revolution wrote:
Hmm, well let's see ... fasm is 100% assembly.

I believe It's an assembler. I was talking about compilers.
Have you noticed me saying that assembly is completely useless? (don't have to answer, rhetorical quest.)
Hehe, what sort of response did you expect when coming to an assembly board saying that assembly is not useful?![/quote]
I asked to give me confidence in assembly. I once liked this language and believed that 1 line in HLL = 1k years in hell. I want my interest in asm back. It was fun programming & debugging. Maybe I'm just too lazy. I use HLL in my research and for fun progr. not asm. This thread is persuasive. I even wanted to write a debugger completely in asm for linux, but then realized that I'll need libs and i had problems with them (see topic).
Post 22 Feb 2013, 16:55
View user's profile Send private message Reply with quote
asmhack



Joined: 01 Feb 2008
Posts: 431
asmhack
Because it isn't a programming language, it's processor instruction assembly. You can work with bits and bytes and see the data flows in action. So yeah, assembly is unique, for everything else there is HLL.
Post 22 Feb 2013, 17:42
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17279
Location: In your JS exploiting you and your system
revolution
Turbo Lover wrote:
Have you noticed me saying that assembly is completely useless?
Yup.
Turbo Lover wrote:
I have realized that I can't make anything useful w/ this tool.
Post 22 Feb 2013, 17:56
View user's profile Send private message Visit poster's website Reply with quote
Turbo Lover



Joined: 22 Feb 2013
Posts: 32
Turbo Lover
revolution wrote:
Turbo Lover wrote:
Have you noticed me saying that assembly is completely useless?
Yup.
Turbo Lover wrote:
I have realized that I can't make anything useful w/ this tool.

Your conclusion is not logical. Do you want me to help you find your mistake?
Post 22 Feb 2013, 18:02
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8903
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
is oil painting good or crayon paint or pencil paint or watercolor paint?

why you use ballpoint pen to paint?

wait, you should create acrylic paint,

you just said pencil painting is useless, what?

i thought we are creating Arts here?

Turbo Lover wrote:
So why should I prefer assembly

do what you love, life is short.
create impossible.


Last edited by sleepsleep on 22 Feb 2013, 18:06; edited 1 time in total
Post 22 Feb 2013, 18:05
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17279
Location: In your JS exploiting you and your system
revolution
Turbo Lover wrote:
Your conclusion is not logical. Do you want me to help you find your mistake?
I just wanted to perpetuate your mistake about what I said. Do you want me to help you find your mistake?
Post 22 Feb 2013, 18:05
View user's profile Send private message Visit poster's website Reply with quote
Turbo Lover



Joined: 22 Feb 2013
Posts: 32
Turbo Lover
sleepsleep wrote:

do what you love, life is short.
create impossible.

Best answer yet. The problem is I don't know what I really like.
Post 22 Feb 2013, 18:07
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1409
Location: Toronto, Canada
AsmGuru62
I would disagree about the libraries.
It is possible to write in Assembly for a lot of years and any usefull code
can be put into a library to be re-used, so no need to write it again.

Take me for example, I use FASM for Windows since around 2004 or so and I have a
very large code library. I even have an edit control which can syntax color the text!
I do not need to write it again - simple call to CreateWindow() and send some messages to set it up. Done.

Also, I have like 6 or 7 allocators of memory - all kinds, optimized to take certain
data and to make it faster and less fragmented than just use malloc().

So, yeah, if you can re-use code - assembler is no worse than C.
Post 22 Feb 2013, 18:08
View user's profile Send private message Send e-mail Reply with quote
Turbo Lover



Joined: 22 Feb 2013
Posts: 32
Turbo Lover
revolution wrote:
Turbo Lover wrote:
Your conclusion is not logical. Do you want me to help you find your mistake?
I just wanted to perpetuate your mistake about what I said. Do you want me to help you find your mistake?

I didn't understand this ^^^ so I'll say "yes"
Post 22 Feb 2013, 18:09
View user's profile Send private message Reply with quote
Turbo Lover



Joined: 22 Feb 2013
Posts: 32
Turbo Lover
AsmGuru62 wrote:
I would disagree about the libraries.
It is possible to write in Assembly for a lot of years and any usefull code
can be put into a library to be re-used, so no need to write it again.

Take me for example, I use FASM for Windows since around 2004 or so and I have a
very large code library. I even have an edit control which can syntax color the text!
I do not need to write it again - simple call to CreateWindow() and send some messages to set it up. Done.

Also, I have like 6 or 7 allocators of memory - all kinds, optimized to take certain
data and to make it faster and less fragmented than just use malloc().

So, yeah, if you can re-use code - assembler is no worse than C.

So you have written your lib to use it. G8! I'm using libc, but i didn't write it, see the point?
Post 22 Feb 2013, 18:15
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8903
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
Turbo Lover wrote:
sleepsleep wrote:

do what you love, life is short.
create impossible.

Best answer yet. The problem is I don't know what I really like.


choosing assembly doesn't mean you must stick to it till death. Laughing
( i assume you are choosing a language to learn atm, like marriage )

you are free 24x7 to change partner as you like.

you could try everything, or try one language then keep on thinking the untried one is better than what you are using right then.

remember, the girl that you fail to get is always the one in your mind.

idk what issues you got in your quest to choose, but there is nothing to lose except time if you try assembly language.
Post 22 Feb 2013, 18:16
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1409
Location: Toronto, Canada
AsmGuru62
@Turbo Lover: but I had so much fun writing that code!
Isn't that what we here (in this life) for?
Post 22 Feb 2013, 18:56
View user's profile Send private message Send e-mail Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.