Assembly
-
I'm interested in learning assembly, so i can better understand how my code executes with the hopes of writing more effecient code. Does anyone have any good suggestions on books and or sites?
Why not start with a $1 CPU. Get a PIC 16F57. It has all of 80 bytes of RAM and more than enough code space to do something useful with all that RAM. I wrote firmware for a pellet stove - in assembly - on that CPU. And Microchip has a free IDE for that and most of the chips they make. There is more to assembly than x86. I have written assembly in the IBM 1620, 1440, 7090/94. I wrote floppy disk controller PCB firmware firmware on an 8085 and plotter firmware on a Z80. Large OS code for both CP & PP on CDC 6000/Cyber 70 - all in assembly. -Peter Butler
-
I'm interested in learning assembly, so i can better understand how my code executes with the hopes of writing more effecient code. Does anyone have any good suggestions on books and or sites?
-
Hundreds, you can't have any of them. :) I was a contract programmer once, I felt at the time as I was doing it that it was a suckers game and I feel even more so that way now. Here I was writing code over and over again, getting paid by the hour or job once then moving on and doing it all over again. Now, any code I write, I'll be selling that same product countless times over for years to come. Of course it's a *lot* more work than contracting ever was for the first few years. One hour of writing contract code was just that, one hour of code, one hour of pay. Now, one hour of time spent writing code for software we sell to the public in general has almost exponential rewards that keep giving and giving. The feeling is *completely* different.
"I don't want more choice. I just want better things!" - Edina Monsoon
Those thoughts are on my mind every single day. I'm constantly looking for ideas of something to write.
-
Those thoughts are on my mind every single day. I'm constantly looking for ideas of something to write.
code-frog wrote:
I'm constantly looking for ideas of something to write.
If you don't have ideas for yourself, I would seriously tell you to consider SBIR work. If you have no problems with where the money comes from, the process basically posts ideas and you bid on them. Generally it starts at 90k to100k for 6 to 9 months the first year, strictly R&D, and then if you have an innovative enough approach and they fund Phase II, it jumps to 250k to 750k for the next 2 years to reach prototype. Not bad considering you didn't even have to come up with the idea, only the solution. There are lots of problems to be solved, and sometimes they fund two or more on the same project hoping that one person will come up with a highly innovative solution. And, you MUST have an idea of how to commercialize it. That is the whole idea, after the funding creates the product, you get to sell it for more $$. It is competative, but with R&D paid for, your $$ outlay for any given project is relatively little compared to completely doing it on your own dime.
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-
code-frog wrote:
I'm constantly looking for ideas of something to write.
If you don't have ideas for yourself, I would seriously tell you to consider SBIR work. If you have no problems with where the money comes from, the process basically posts ideas and you bid on them. Generally it starts at 90k to100k for 6 to 9 months the first year, strictly R&D, and then if you have an innovative enough approach and they fund Phase II, it jumps to 250k to 750k for the next 2 years to reach prototype. Not bad considering you didn't even have to come up with the idea, only the solution. There are lots of problems to be solved, and sometimes they fund two or more on the same project hoping that one person will come up with a highly innovative solution. And, you MUST have an idea of how to commercialize it. That is the whole idea, after the funding creates the product, you get to sell it for more $$. It is competative, but with R&D paid for, your $$ outlay for any given project is relatively little compared to completely doing it on your own dime.
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
I'm dumb as a nail. What's SBIR?
-
Out of curiosity, what language are you using to write your code? If it's not a .NET language then you're on the right track. If it is a .NET language then you would want to learn about IL.
At work its .net, but i'm not as interested in learning assembly for the sake of writing assembly, I'm more interested in having an understanding of how my code is executing. At home I write C++ (my goal is to have my program run on this [^] )
-
I'm dumb as a nail. What's SBIR?
code-frog wrote:
What's SBIR?
http://www.dodsbir.net/[^] check the current solicitation, just avoid the ones I am bidding on. ;P Actually, given the closing date is less than a month away, you might not want to do it this time around (but you might want to also). About 3-4 times a year a solicitaton is opened up with any number of topics, you choose a topic, bid on it, and if you win, you get the honor of doing the work and submitting horrid accounting documentation of the process, but reasonable compensation in most cases.
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-
Various microcontroller vendors make prototyping development kits, often free, that come with a processor, a little breadboard area for some custom hardware, pots and leds and switches, etc., and an assembler. I think it's a good way to learn assembly language, by actually doing something at the hardware level. Check out development systems for the 8051 processor, which is a popular microcontroller. Marc
-
I'm interested in learning assembly, so i can better understand how my code executes with the hopes of writing more effecient code. Does anyone have any good suggestions on books and or sites?
After getting a feeling for Assembler, compile your C/C++ with the assembler listing. Even debug/step through code at the assembly level. I worked in industry where we were VERY limited on program space (embedded project). At one release, we could not fit in the memory space. We looked at the assembler listing and saw that i++ and i+=1 took one more instruction than ++i. We were able to recode all the "don't matter" cases to use ++1 and shoehorn the code in. No change to logic, just to program size (and therefore, minimally, to execution speed). This will no doubt help you think along the lines of code optimization as you move along in your career.
Gary
-
I did 4 years of Motorola 68000 assembly programming for embedded control applications. Keep in mind that Intel x86 type processors and their decendants are not the only hardware out there (yes, I know, they dominate). You may find a good book for another processor type, and that is still good for understanding assembler in general. I would suggest also reading up on compiler theory, because this may more directly benefit you in understanding what your program in a higher-level language will do. Even if you knew assembler well, that does not tell you what the compiler may be doing.
-
Emulators. Afaik my college didn't have any hardware for the MIPS assembly they taught.
-- You have to explain to them [VB coders] what you mean by "typed". their first response is likely to be something like, "Of course my code is typed. Do you think i magically project it onto the screen with the power of my mind?" --- John Simmons / outlaw programmer
-
Emulators. Afaik my college didn't have any hardware for the MIPS assembly they taught.
-- You have to explain to them [VB coders] what you mean by "typed". their first response is likely to be something like, "Of course my code is typed. Do you think i magically project it onto the screen with the power of my mind?" --- John Simmons / outlaw programmer
I first learnt Z80 assembly language when I first joined the industry in 1982. Of course, in those days I was only a tea boy...
-
> Just remember you can only try the code on the processor type you have. Not at all. Simulators/emulators are used heavily in universities and I'm sure in real-world embedded systems development. Sometimes getting your code onto the target is a hassle, so you want to be reasonably sure it's working before you send it/burn it/whatever. We used simulators for MIPS64 (probably the most fun assignment I've ever had) and an 8088 embedded board. Try it out - it's mind-expanding! Someone else mentioned the m68k - that's a decent old architecture too. I've got one sitting in an Atari ST on the floor here :)
-
Absolutely true. Got any ideas?:laugh:
You could run a contest of sorts and offer your development services for free to the winning idea. There are businesses that have needs and if you find a common one, you can build it, use the company as a test bed and then market it to all the others that need the same solution. If not, you might try just talking with different business owners in your area and seeing exactly what problems they run into. A good place to start is at Chamber of Commerce meetings or local business groups.
Rocky <>< Blog Post: Windows Live Authentication - Easy Stuff! Tech Blog Post: Vista ReadyBoost! Tech Sites: SilverlightCity.com ~ TheSilverlightDirectory.com ~ TheWPFDirectory.com
-
I'm interested in learning assembly, so i can better understand how my code executes with the hopes of writing more effecient code. Does anyone have any good suggestions on books and or sites?
Steve, Have you considered reading Donald Knuth's books on MMIX? There are two that I can find on Amazon, a shorter version that is new(-ish) http://www.amazon.com/Art-Computer-Programming-Fascicle-Millennium/dp/0201853922/ref=sr_1_2/104-0305406-5819919?ie=UTF8&s=books&qid=1188429114&sr=8-2[^] and the original one (which is quite a bit longer) and is more about the architecture. http://www.amazon.com/MMIXware-RISC-Computer-Third-Millennium/dp/3540669388/ref=sr_1_5/104-0305406-5819919?ie=UTF8&s=books&qid=1188429114&sr=8-5[^] There is no hardware that actually runs MMIX natively, but there are emulators, and if you are doing this for pedagogical reasons I think that doing the exercises out of the first book will probably be more useful for you. Cheers, Peter.
-
At work its .net, but i'm not as interested in learning assembly for the sake of writing assembly, I'm more interested in having an understanding of how my code is executing. At home I write C++ (my goal is to have my program run on this [^] )
The fit looks like a nice small form factor pc. It states it can run XP or Linux which is nice. It's too bad that it only has 256 MB of memory that cannot be added to. So you want to understand how your C++ code is executing after being translated to assembler. So in essence you're asking what is the best C++ coding style to write that will generate the most efficient assembler? You can start by making sure you have the 'Optimize' option selected in your project properties settings in Visual Studio. The Optimize option actually will cause the compiler to create more efficient assembler. And it really works. Try running a cpu intensive test project with and without that option and you can see the difference in how your code executes. As for .NET there are some simple tricks you can do to write better code. One example is: if you use a 'Get' property in a method more than once, you'd want to create a local variable and call the property once and store the return value in the local variable and then use the local variable in the rest of the method. A 'Getter' property is essentially a method call so reducing the number of those will improve your code. And of course, never ever use a Get property in a loop statement as that will cause the property (AKA method call) to be called at every iteration which would slow down any loop considerably. I hope my ramblings are helpful to you. It's good that you are thinking about the bigger picture and trying to understand how your source code affects your object code.
-
I'm interested in learning assembly, so i can better understand how my code executes with the hopes of writing more effecient code. Does anyone have any good suggestions on books and or sites?
Take a look to masm32 web site, it contains handy informations.
-
I'm interested in learning assembly, so i can better understand how my code executes with the hopes of writing more effecient code. Does anyone have any good suggestions on books and or sites?
Search for and download "masm32". This is Microsoft's last released assembler. There are gobs-and-gobs of free resources to help you learn, including Intel's website. Most assembly source examples that you find are from the old, DOS days, when there was a 640K memory barrier, and the CPU used a segmented address architecture heavily. It's still good to know the inner workings of the CPU you are programming. You'll appreciate all the incredible things the machine can do a lot more. And ... you'll waste a lot of time. ;P
-Bill