Will a Machine Language Course Benefit My Computational Physics Emphasis?

In summary, the conversation discusses the possible benefits and drawbacks of taking a machine language course over the summer for someone interested in computational physics. The objectives of the course include understanding program logic and structure, common applications of assembly language, binary arithmetic calculations, boolean operations, loading and executing programs, using assembly language instructions, linking to external code libraries, creating conditional and looping structures, using decision and looping directives, understanding and using certain instructions, discussing stack frames and recursive functions, and using advanced forms of directives. The conversation also mentions the potential usefulness of learning assembly language for understanding computer architecture and for certain fields in computational physics, but acknowledges that it may not be necessary for all students.
  • #1
tmbrwlf730
42
0
I'm thinking of taking machine language over the summer because it seems interesting to me but I'm not sure if it'll be useful to my emphasis in computational physics. The objectives of the class are below, could anyone give me advice on whether it'll be helpful to me or not. Thank you.

A. Use flowcharts to describe program logic and use procedures when designing program structure
B. Discuss common applications of assembly language and what an assembler does
C. Perform binary arithmetic calculations with signed and unsigned binary integers
D. Explain basic boolean operations and recognize and convert boolean and hexadecimal integers
E. Describe how the operating system loads and executes programs
F. Represent integer constants, expressions, real number constants, character constants, and string
constants in assembly language
G. Formulate assembly language instructions using valid syntax
H. Use the OFFSET, ALIGH, PTR, TYPE, LENGTHOF, and SIZEOF operators PUSH and POP
I. Link programs to an external code library
J. Create conditional and looping structures using assembly language
K. Use the high-level MASM decision and looping directives such as .IF, .ELSE, .REPEAT, and WHILE
L. Explain and use the MUL, IMUL, DIV, and IDIV instructions
M. Discuss how stack frames are used by high-level languages
N. Write recursive functions in assembly language
O. Use the advanced forms of the INVOKE, ADDR, PROC, and PROTO directives
P. Traverse a two-dimensional array using advanced indexed addressing modes
Q. Create nested macros and macros with multiple parameters
R. Use heap allocation functions to create dynamic data structures
 
Physics news on Phys.org
  • #3
I cannot imagine why any sane person would choose assembly/machine language for computational anything. Pretty much any other language you can think of (C, C++, VB.NET, FORTRAN, JAVA, etc) would be better.

On the other hand, assembly/machine language will teach you how computers work in a way that none of the others can even approach.
 
  • #4
phinds said:
On the other hand, assembly/machine language will teach you how computers work in a way that none of the others can even approach.

This is the main point: teaching how computers really work.

You have a lot of interesting things that need to be paid attention to especially if you are writing OS code components, device drivers, and even some optimized code using a particular mechanism like the floating point calculator or some kind of vector processing component like the SIMD SSE, SSE2.

What it forces the programmer to do is understand what everything in memory really represents and how flow actually works on a computer.

A lot of people don't realize the complications in doing simple things like allocating memory in an environment that separates the kernel from the application space and even amongst processes or things like device drivers where you need a tonne of assembly language to not only do simple things like print a character or set the screen mode, but also to co-ordinate everything in an optimal and fault free way. This is not as easy and many people think.

The thing is that if you have done a bit of assembly, you'll have a really good idea of what your compiler does to generate data structures (even in C++) as well as how functions and addresses are computed and also what is going on 'in-between process cycles' with all of the other stuff that the OS has to take care of. It also can help you become a better debugger as well.

Most people won't use it for most of their software development, but it is far from useless.
 
  • #5
Joel Spolsky, founder of Stack-Exchange and Fog Creek (a very Google-like startup), has some really good things to say on why someone working in software should have some understanding of every level of development:

http://www.joelonsoftware.com/articles/LeakyAbstractions.html

There are certain fields of computational physics, like doing quantum chromodynamic calculations, astrophysics/hydrodynamics, electromagnetics, etc. that will require some very in-depth knowledge of how computers work. The reason for this is because QCD simulations can sometimes take months (someone mentioned a year-- A YEAR!), or astrophysics simulations can take a month on hundreds or thousands of nodes on a supercomputer. When you're dealing with this kind of scale, it's important to make sure that you're not wasting any time because you're implementing stupid/inferior algorithms, creating a bottle-neck because of some basic hardware architecture that you were unaware of, ignorant of how memory management works, etc. Anything could throw days, or even weeks, into your total run time. Also knowing how the computer handles and represents data is kind of crucial if you're coming up with garbage values or you need some extreme precision.

Still, these are things you could learn on your own. I wouldn't take a class on it... but that's just me. Most people can't learn those kinds of things by themselves, but physics PhDs (assuming you want to go to graduate school) are a special kind and should be able to do that sort of thing. Also, you may not be very motivated to learn it too.. but anyway, point is that you ought to be able to learn it independently.
 
  • #6
tmbrwlf730 said:
I'm thinking of taking machine language over the summer because it seems interesting to me but I'm not sure if it'll be useful to my emphasis in computational physics.

Why does it have to be? If you can take the course without failing or leaving out a more important one, just do it if it seems interesting! :smile:
 

1. What is machine language?

Machine language is a low-level programming language that uses binary code (0s and 1s) to communicate with a computer's central processing unit (CPU). It is the most fundamental form of software that allows computers to perform specific tasks.

2. Why should I learn machine language?

Machine language is the foundation of all computer programming and is essential for understanding how computers work at a fundamental level. It also allows for direct control over the computer's hardware, making it useful for optimizing performance and creating efficient programs.

3. Is machine language difficult to learn?

Learning machine language can be challenging, especially for those without prior programming experience. However, with dedication, practice, and a good understanding of computer architecture, it is possible to become proficient in machine language.

4. What are the benefits of taking a machine language course?

A machine language course can provide you with a strong foundation in computer programming and an understanding of how computers work at a low level. It can also improve your problem-solving and critical thinking skills, which are essential for any career in science or technology.

5. Are there any prerequisites for taking a machine language course?

Some basic knowledge of computer hardware and programming concepts is helpful but not necessary. Most machine language courses assume no prior knowledge and will teach you everything you need to know from the ground up.

Similar threads

  • Set Theory, Logic, Probability, Statistics
2
Replies
40
Views
6K
Replies
10
Views
4K
  • STEM Academic Advising
Replies
5
Views
1K
  • STEM Academic Advising
Replies
1
Views
2K
  • STEM Academic Advising
Replies
13
Views
3K
  • Sticky
  • Programming and Computer Science
Replies
13
Views
4K
  • Programming and Computer Science
Replies
29
Views
3K
  • Programming and Computer Science
2
Replies
60
Views
16K
Replies
1
Views
3K
Back
Top