Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Is Assembly too difficult to understand?


  • Please log in to reply
7 replies to this topic

Poll: Do you think Assembly is too complex? (4 member(s) have cast votes)

Is Assembly too Complex?

  1. Yes, and that is the reason nobody codes in it anymore. (0 votes [0.00%])

    Percentage of vote: 0.00%

  2. No, programmers are getting just lazy and stupid. (4 votes [100.00%] - View)

    Percentage of vote: 100.00%

Vote Guests cannot vote

#1 NullPointerException

NullPointerException

  • Banned
  • 125 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:11:44 PM

Posted 23 November 2014 - 12:04 PM

I have intermediate programming experience and a CS degree. Although I find Assembly too complicated. As compatibility problems are too much, learning Assembly would be like learning COBOL in the next 50 years. I just find Assembly too low-level, and that is why, perhaps, it is only used for education and not for real-world programming. Microsoft writes Windows in C, C++ and C#, and only few hundred lines of code are written with Assembly. Do you think Assembly is too complicated?



BC AdBot (Login to Remove)

 


m

#2 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer


  • Malware Response Team
  • 12,301 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:11:14 AM

Posted 23 November 2014 - 10:32 PM

Assembly is rarely used primarily because:Billy3
Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image

#3 NullPointerException

NullPointerException
  • Topic Starter

  • Banned
  • 125 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:11:44 PM

Posted 23 November 2014 - 11:10 PM

Yes, compatibility is a very serious issue. Java and C# do solve the problem, however, that causes performance hit and some end-users do not like Vms like NET Framework or JVM.



#4 Angoid

Angoid

  • Security Colleague
  • 299 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:East Midlands UK
  • Local time:07:14 PM

Posted 28 November 2014 - 10:52 AM

The compilers will generate code that will work on multiple platforms (portability).

 

If you're looking at x86 assembly and you're only intending your program to run on that platform, then the bog-standard x86 instructions will do fine.  But if you start referencing 64-bit registers (RAX, RBX, etc) and run your program on a 32-bit platform, then it'll fail.

 

Assembly language is not difficult to learn, but it is fiddly.  To do it properly you need to understand how each instruction handles the flags and how they can thus be made to work correctly together.

 

It starts to get fun if you're using the SIMD instructions, where there are different opcodes which are more platform-specific; SSE2 has instructions that do not exist in SSE1 and there may be differences between what AMD offer and what is provided by Intel.  I've not coded with those instructions, but I have read a bit about them online and it looks like you're VERY likely to run into cross-platform difficulties and backward compatibility problems if you're not careful.


Helping a loved one through a mental health issue?  Remember ALGEE...

Assess the risk | Listen nonjudgementally | Give reassurance and info | Encourage professional help | Encourage self-help and support network

#5 NullPointerException

NullPointerException
  • Topic Starter

  • Banned
  • 125 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:11:44 PM

Posted 28 November 2014 - 11:12 AM

But at least in C# or Java ; we have guaranteed portability. At least for C# there are 3rd party support for .NET Framework.

 

What really pinches me is x86 Assembly is way different than x64 Assembly. Once you'll get known to x86, it will almost become impossible to learn 64-Bit Assembly. Plus today's processors are too complicated. Look at Xeon, it's just so different compared to i7.



#6 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer


  • Malware Response Team
  • 12,301 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:11:14 AM

Posted 01 December 2014 - 12:07 PM

Java and C# do solve the problem, however, that causes performance hit and some end-users do not like Vms like NET Framework or JVM.

But at least in C# or Java ; we have guaranteed portability. At least for C# there are 3rd party support for .NET Framework.

As long as you have enough memory, I think you'll find the CLR or the JVM's performance to be fine for 99.9% of applications.

On the CLR or (modern) JVM you only get portability to x86, IA64, amd64, and a limited number of ARM platforms (Thumb-2 in the case of the CLR, as far as I know the JVM is slightly more flexible here). That's far Far FAR less portable than C.

It starts to get fun if you're using the SIMD instructions, where there are different opcodes which are more platform-specific; SSE2 has instructions that do not exist in SSE1 and there may be differences between what AMD offer and what is provided by Intel. I've not coded with those instructions, but I have read a bit about them online and it looks like you're VERY likely to run into cross-platform difficulties and backward compatibility problems if you're not careful.

You can access such things in C with intrinsics.

Billy3
Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image

#7 NullPointerException

NullPointerException
  • Topic Starter

  • Banned
  • 125 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:11:44 PM

Posted 01 December 2014 - 12:37 PM

 

As long as you have enough memory, I think you'll find the CLR or the JVM's performance to be fine for 99.9% of applications.

On the CLR or (modern) JVM you only get portability to x86, IA64, amd64, and a limited number of ARM platforms (Thumb-2 in the case of the CLR, as far as I know the JVM is slightly more flexible here). That's far Far FAR less portable than C.

 

I agree, that JVM is slightly more flexible. However, you're missing the point that a C programmer should never expect his source-code to run on any platform without modification.  Java and C# have their frameworks which doesn't require the programmer to modify the source-code at all.

C is "Write once, compile anywhere"

Java/C# is "Write once, run anywhere".



#8 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer


  • Malware Response Team
  • 12,301 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:11:14 AM

Posted 01 December 2014 - 12:50 PM

you're missing the point that a C programmer should never expect his source-code to run on any platform without modification

Erm, yes, you can very reasonably expect C source code to run on any platform without modification. If you make calls to platform specific APIs, sure, that won't be portable, but that's not a language issue. Boost has a huge assortment of libraries which work on most platforms without crazy source modifications beyond working around bugs in specific compilers.

Billy3
Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users