![]() |
|
#1
|
|||
|
|||
Assembly Tutorial?I am a student in c++ i am taking datastructure I in college. I always was curious about assembly language so i am wondering if anyone can give an easy assembly tutorial ( please would you provide a link to download a compiler because i don't know how to run an asm file). I am also wondering if assembly is still a language to learn or just for hobbiest. Thnaks all for your efforts
|
|||
|
#2
|
|||
|
|||
Re: Assembly Tutorial ??????I tell ya, I recently got stated into assembly and have found it to be enlightening but confusing. )what else is new) It really gets down to basics. I can start to see where all the other languages come from.
I come mostly from C. I soon realized that when writing assembly there are three things I'm giving instructions to: - the cpu - the OS - the compiler Weird to get used to after being used to the neatly structured standard C or C++. You will see how all OS's need to interface with the cpu's registers. You will see that for the linux kernel there is one set interrupt codes (functions) to do things like print stuff and for the dos kernel there is a completely different set! You will see that each compiler deals with these things a little differently... So your first choice is to choose a compiler. I started in linux with the simple gcc 'as' compiler and a tutorial here: cs.princeton.edu/courses/archive/spr05/cos217/ Then I found there was another popular compiler called nasm which is available for linux (AND dos). I had that on my Fedora disks ant tried that too. Here is one I followed a bit for that: cin.ufpe.br/~if817/arquivos/asmtut/index.html Then I tried it in dos. (that's when I found there was the different interrupt set) This is a good tut that (lots of good background stuff) uses NASM in dos: drpaulcarter.com/pcasm/index.php Then I found that there are the MASM (M for bill (microsoft)) and TASM (borland-T for turbo) which supposedly use fairly identical syntax. I have not tried either an probably won't. This one uses that style: oopweb.com/Assembly/Documents/ArtOfAssembly/Volume/toc.html Note here that 'as' and GAS use the AT&T style of syntax while nasm, masm and tasm use the Intel style. Cornfused yet? Hang in there it gets better! Another route to take in dos is debug which comes with my '98se and I guess on up line. It is a simple yet VERY interesting compiler/debugger program to learn to use! I code in nasm and step through it with debug to watch what's happening with all the data and registers, etc. I found some good stuff on that here: armory.com/~rstevew/Public/Tutor/Debug/ Oh yeah , another concept to begin to learn is the different executable types in linux and dos. like .com and .exe and how they work. Just starting to get that. neat stuff. Well there are some ideas. Where do you want to go? |
|
#3
|
|||
|
|||
Re: Assembly Tutorial ??????CPP / C++ / C Code:
Yes i am confused good job, you 've nailed it lol, i choose this link to start with i have ubunto 8.01 installed in my system (i am just new to linux so i barely can open a terminal) so will this compiler run in ubuntu ? also if u would please write an asm file that display "hello Assemby" and adds two integer together and if you could comment it that would be my start; i read some about the computer architecture some about the binary deciman hexadecimal converstion i got to the registers inside the cpu and i stopped. |
|
#4
|
|||
|
|||
Re: Assembly Tutorial ??????Quote:
You may already have the 'as' assemler installed. (it is part of gcc compiler) type: gcc --h If that is installed you should see a bunch of help info. ( use shift>pg-up/pg-down to scroll xterm screen) If so try: as --h ...which should do the same. If so you have that assembler ready to go! In the first link I gave above it suggests this tutorial usin the as assembler. cs.princeton.edu/courses/archive/spr05/cos217/reading/ProgrammingGroundUp-1-0-lettersize.pdf Do you have man pages installed? try: 'man as' If that works try 'man nasm' If that works you probably have the NASM assembler installed and could follow this tutorial: : cin.ufpe.br/~if817/arquivos/asmtut/index.html cin.ufpe.br/~if817/arquivos/asmtut/index.html If not you will need to install. I'm using Fedora6 which uses the rpm for package management. I believe Ubunto uses Apt get? Have you used that to install a program yet? |
|
#5
|
|||
|
|||
Re: Assembly Tutorial ??????Quote:
|
|
#6
|
|||
|
|||
Re: Assembly Tutorial?Frustrating sometimes isn't it...
If you are talking about 'updating' over a dialup connection good luck. Fedora has that 'yum' updater which did nothing but stop my machine! It never even finish checking for available updates! I managed to turn the stupid thing off. They forget about us out in the boonies with dial-up only. I use what came on my disks and the 'old versions' work just fine , thanks ANYHOW. The Fedora 6 set that I got form Edmunds Enterprises for around $10 HAS everything AND the kitchen sink already on them. All developement packages for gcc, perl, python, nasm ... you name it! Screw the updates.... So you might want to order a full set of Ubuntu (or Fedora or other disto). What compiler are they using in your C++ class? Linux g++? If so you will want to have the full gnu cc developement suite installed. (gcc, g++) The 'as' assembler will be included with that (I think). Also you will want to get the 'gdb' debugger packages too.... On the other hand , the nasm assembler is not as much to get downloaded and installed... Hang in there. Meanwhile I have been playing with 'as' and gdb in linux. very nice. I now have this list of sites I am using for info: Code:
Last edited by Howard_L : 11-Dec-2008 at 09:41.
|
|
#7
|
|||
|
|||
Re: Assembly Tutorial?ok i am taking data structure class we are using Microsoft visual c++ express edition 2008 but i want to learn how to do that in gcc lunix but i can not download it cuz i am total newbi to the lunix.
i use the synaptic manager to instal gnu but it said it did install it, but i typed back gcc--h still saying no input file ? so i am kinda lost... |
|
#8
|
|||
|
|||
Re: Assembly Tutorial?I searched at ubuntu.com.
Post #3 in this thread talks about installing gcc right from your disk: ubuntuforums.org/showthread.php It your lucky maybe they included enough developement stuff to get started on the single disk you have... If you want to stick with Ubuntu you should join their forums where you could get distro specific help. Sorry I can't help more but I'm not up on ubuntu or the apt-get package system. Also, did you know that gcc is available for Windows? djgpp : http://www.delorie.com/djgpp/ mingw:http://www.mingw.org/ |
|
#9
|
|||
|
|||
Re: Assembly Tutorial?WAIT A MINUTE!!! , Did you say you got this:
Code:
I'm sorry to have given you that to try above without testing. I was wrong! We get that message because gcc is looking for an input filename after the --h. Try this instead Code:
If you have only used an IDE like Visual C++ this will be different but here's how we do gcc. So you know some C++ so how about you just try a hello.c program first: CPP / C++ / C Code:
Last edited by Howard_L : 11-Dec-2008 at 20:42.
|
|
#10
|
|||
|
|||
Re: Assembly Tutorial?Ok, i think i had to install g++ from the cd so i typed this (g++ -v) it shows g++ version 4.3.2
now i run this in the terminal g++ -o test.cpp test so it did generated a test.exe file but i did not see anything on my screen alrhough befor my int main(){ return 0;} i declared int i then cin>>i;to make the compiler wait for the user to enter the value of i but none happened |
Recent GIDBlog
Install Adobe Flash - Without Administrator Rights by LocalTech
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Mixing C and assembly in x86 - Makefile nuances | aijazbaig1 | Assembly Language | 3 | 23-Apr-2008 08:29 |
| Tutorial: How to Make a Web 2.0-Style Logo | PhotoshopTrend | Graphics Forum | 0 | 20-Sep-2007 05:57 |
| Assemblers & assembly language | BlueFireCO. | Assembly Language | 2 | 26-Mar-2007 09:56 |
| Photoshop Tutorial: Make An Inspirational/Mystical Picture | ToddSAFM | Graphics Forum | 9 | 09-Aug-2005 20:32 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The