1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Courses Machine language course

  1. Mar 27, 2012 #1
    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
  2. jcsd
  3. Mar 27, 2012 #2
  4. Mar 27, 2012 #3


    User Avatar
    Gold Member

    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.
  5. Mar 28, 2012 #4


    User Avatar
    Science Advisor

    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.
  6. Mar 28, 2012 #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:


    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.
  7. Mar 28, 2012 #6
    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:
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook