Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Starting out in assembly

Status
Not open for further replies.

nemesisrobot

Programmer
May 28, 2005
5
GB
Hey.

I have been reading up on Assembly for a while, and was wondering if someone can help me with these questions..

1: What compiler would I need? I was told I could a c++ compiler, is that the case?

2: When I compile, is the file called something.a ?

3: Also, when I compile, is it possible to run from the desktop? Or can assembly files only be run when booting? Im a n00b at assembly.

Cheers
 
Are you trying to learn Assembly or C++?
You use an assembler to build binary code from Assmebly language, not a compiler.

The output of the assembler is platform and assembler dependant.


Trojan.
 
I am trying to learn Assembly.

Are there are assemblers you know of I could use?
 
By platform you mean OS? If thats the case Windows,

Sorry as I say this is new to me.
 
Try this in google:

"free x86 assembler"

there appear to be several available.


However, I would not advise starting to learn assembler programming for Windows - start with DOS.

Hope this helps.
 
nemesisrobot said:
Also, when I compile, is it possible to run from the desktop? Or can assembly files only be run when booting? Im a n00b at assembly.

yes, assembled programs can be run from within the OS. You can
build standard DOS EXE/COM files and of course Windows EXE
files. It all depends on what assembler use and what your
target platform is.
 
Hi nemesis,

You can also include assembler code into your c/c++ code. Just use:
Code:
 _asm { 

(your code)

}

}

This is in Visual Studio C++ compiler syntax. But the principle is the same in others.

Hope this helps,

Rick
 
If you're willing to spend a bit of money, you should get "Assembly Language Step-by-Step" (I'm just recomending it not advertising it). It should answer any noobish questions and it comes with a cd that has a nice GUI which runs on NASM (my personal favorite of the assemblers), a debugger, and many tools+examples for DOS 16-bit and Linux 32-bit assembly programming. Otherwise go to < which is one of the best free sources for programming. The option of assembly language should be on the front page.
 
rwong's suggestion is really good. No one in their right mind writes a whole assembler program unless absolutely necessary. Assembler is usually best confined to places where it's really necessary. Write the rest in C (or whatever other language you like) and embed assembler as required... The only complication is that you'll have to know how your compiler works at a very nuts-and-bolts level, but that can be very educational, and as a side-effect, you'll write better in high-level languages too.
 
I knew there was a reason for me wearing this funny jacket with the arms tied around the back... makes it difficult to type, but a pencil in the teeth definitely helps...

I'm in the middle of writing an assembler program that reverse engineers the remote control of a satellite receiver.

I'm writing it on a Compaq Portable III using TASM under Dos.

Mostly for the fun of it & because the 286 in the Compaq doesn't use cache or any sophisticated stuff like that so the timings stay reasonably constant.


I remember disassembling the output of the M$ Fortran 77 compiler to figure out how to call assembler subroutines and such back in the mid 80s.

As LionelHill says, it teaches you a lot... especially when management nearly had heart failure at the cost of a £25 assembler book.
 
If you want a free (legal) one...

A86 is another choice...

Nasm, as mentioned above is another...

Though, if you can find it, I'd suggest TASM, which was borland's assembler...
That has been my favorite...

And if you want to just give your self a headache...
You can always use debug, which is probably already on your computer...
[Windows]+[R] (Run) ... Type "debug" and hit enter...
You should be greeted with an amazing BLACK SCREEN with a dash... ;-)

*Note:
[Q],[Enter] Exits the program...
[?],[Enter] for help

Honestly, Debug is a great tool for learning the basics of Assembly.

Here are a few Tutorials:



Better yet, just Google "Debug Tutorial"

then... of course... the FUN way to learn, is to read through "Demo" source code...
Search for 256b, 1k and 4k demos...
256b.com
pouet.net
scene.org

Have Fun ;-)
-Josh


Visit My Site
PROGRAMMER: (n) Red-eyed, mumbling mammal capable of conversing with inanimate objects.
 
After starting out programming in machine language (flipping buttons and writing a memory location, then advancing to the next memory address) learning assembler was a dream come true for me ... about a hundred years ago (or so it seems some days ...)

Seriously, after 39+ years in the computer software business, I've started looking back at my 'roots' ... and just installed HLA by Randall Hyde. HLA stands for 'High Level Assembler' and Dr. Hyde wrote it to teach assembly at the university level. His 900+ page book (The Art of Assembly Language) is really great and applicable to the newbie ... so I'd recommend that as well. It's about $35 or so but well worth the money, especially since it comes with the HLA assembler and a bunch of other 'stuff' on a CD.

Oh, yeah - and zeitghost's comment about the 'funny jacket' is true - a pencil helps a lot!!! :)

Good luck, nemesisrobot ... enjoy!

Tom

"My mind is like a steel whatchamacallit ...
 
Aaaaaaaaaaaaaaaaaah!

Toggling bootstraps into a GA Spc16 using the front panel switches... those were the days... 20 instructions just to get it to read from the card reader.
 
We (the USAF in 1966) had a Burroughs B263 as the base level system. As an operator, we got really proficient at jumping around sequence halts ... especially on jobs that had 30+ trays of IBM cards which ran through the reader at 300 cpm. From there it was a short jump to programming manually at the console ... finally learned the actual mnemonics and launched my career as a programmer/analyst/jack of all trades.

But you're right, those were the days ... I often think back to them and miss the simplicity of getting something to work (leaving out the interpreter board wiring, of course ... that was a nightmare at times!).

Tom

"My mind is like a steel whatchamacallit ...
 
My first exposure was to a System/360. Cards I could read OK , Punched Tape I could not get to grips with [smile]
 
General Automation used a format called pgs for executables on punched cards.

Funniest thing I've ever seen was someone trying to change a text message on a deck of pgs cards without recompiling the assembler source.

There's 12 bits in a card column, so that 16 bits took 1 and a third columns, 2 words taking 2.66 columns etc.

It was the checksum at the end of the card that was the real killer though...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top