Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Understanding assembler


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 Ashaira   Members   -  Reputation: 105

Like
0Likes
Like

Posted 17 April 2012 - 05:17 AM

Well it seems i am lacking some very basic knowledge regarding c++ and a friend of mine told me i seem to not understand the hardware part of how programming and memory works and that understanding how the assembler works would help me cement and connect what i already know.
(consider that when i saw square(3++); i thought 4 would be sent as a parameter i tend to agree with him)

so does anyone know where i could learn about how assembler works? i dont want to learn to code in it just understand the principles of how it does things.

Sponsor:

#2 Hodgman   Moderators   -  Reputation: 31926

Like
1Likes
Like

Posted 17 April 2012 - 05:43 AM

With that specific example (square(3++)), it's more of a C++ nuance than a "big picture"/hardware knowledge deficiency. In C++, "x++" means "x = x + 1", so "3++" means "3 = 4", which isn't valid code ;)

Back to your actual problem though, in a Computer Science or Software Engineering course, you'd likely take a class called something like "Computer Architecture", where you'll learn the basics of different hardware components, assembly languages, and low-level OS systems. Reading some text-books on "computer architecture" and/or "operating systems" may be useful to you.

#3 NightCreature83   Crossbones+   -  Reputation: 3036

Like
0Likes
Like

Posted 17 April 2012 - 06:36 AM

If you want to learn assmebler have a look at this series of post on altdevblogaday: http://www.altdevblo...e-conditionals/ . Having said that assembler is an advanced topic for coding and most programmers know only the basiscs of assembler (thats including me), which means they can read it but not write it. The only time I actually look at assembler is when I get a crash bug that only happens in a release build of our game.

PS:
Its a good habit to write your for in the following manner:
for (int counter; <condition>; ++counter)
{
}
In this case it isn't really an optimisation just a habit so that when the ++operator is overloaded and does more work than you expect your not making an unessecary assignment. This is mostly the case when you have a custom assignment operater that makes a non-shallow copy.
Worked on titles: CMR:DiRT2, DiRT 3, DiRT: Showdown, GRID 2, Mad Max

#4 brx   Members   -  Reputation: 720

Like
0Likes
Like

Posted 17 April 2012 - 08:24 AM

PS:
Its a good habit to write your for in the following manner:

for (int counter; <condition>; ++counter)
{
}

It could be considered nitpicking (since it was not what you aimed at), but I have to say that I would not consider this for-declaration "good habit" as it is using the uninitialized variable counter... Just saying ;)

#5 MESEnterprisesLLC   Members   -  Reputation: 107

Like
0Likes
Like

Posted 17 April 2012 - 09:24 AM

so does anyone know where i could learn about how assembler works? i dont want to learn to code in it just understand the principles of how it does things.


If you want to get a good understanding of assembly, and computer architecture, (how hardware plays nice with each other) I suggest that you download some of the microcontroller documents - I develop on the Microchip (http://www.microchip.com/) PIC lines, and they have a very simple to understand language as they are not CPUs, but MCUs and therefore don't have all the shift registers, and alike that can cause the novice to dropout from learning the language due to confusion. Read about how to connect peripheral devices (as that is everything not embedded in the CPU/MCU - including memory are really peripheral devices.) - I know that the Microchip's documentation on each chip is very well written and comprehensive - and best of all free. There are other MCU manufactures out there - I just like the PICs.

Edited by MESEnterprisesLLC, 17 April 2012 - 09:28 AM.

Michael Suess
MES Enterprises, LLC
http://mesenterprisesllc.com

#6 NightCreature83   Crossbones+   -  Reputation: 3036

Like
0Likes
Like

Posted 17 April 2012 - 09:32 AM

It could be considered nitpicking (since it was not what you aimed at), but I have to say that I would not consider this for-declaration "good habit" as it is using the uninitialized variable counter... Just saying ;)


Yeah my bad I should have initialised counter, it was more the incrementer pattern I was on about :$.
Worked on titles: CMR:DiRT2, DiRT 3, DiRT: Showdown, GRID 2, Mad Max

#7 alcedine   Members   -  Reputation: 100

Like
0Likes
Like

Posted 17 April 2012 - 06:43 PM

Stanford University has put three of their courses on programming on youtube, open to watch. There's one on java, another or C++, and a third one that broadly talks some generics and paradigms, but in the first lectures, also pops the hood and looks around what actually happens when you use std::vector (for example). Depending on how much you already know, particularly about pointers and dynamic memory use, you'll want the second or the third one. This is where they begin.



By the way, I know you asked about assembly, but from what I could gather about your intentions, I'd say you'll do better with one of these courses. Paradigms touches on assembly a bit, but you're probably more concerned with getting a feeling for the mechanics of C++.

Edited by alcedine, 17 April 2012 - 06:49 PM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS