Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Need an Assembler/Linker
Index -> General Programming
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
mirhagk




PostPosted: Tue Jan 05, 2010 3:57 pm   Post subject: Need an Assembler/Linker

Hey so I've started to get into assembly, I understand the architecture and the concepts very well, but I haven't written any code because I do not what to use for an assembler and what to use for a linker. I'm using Windows XP on my laptop and Vista on my home computer so I can't use any Linux Programs (If you know a good binary/hex reader that'd be great to know as well).

Thanks in advance
Sponsor
Sponsor
Sponsor
sponsor
btiffin




PostPosted: Tue Jan 05, 2010 10:06 pm   Post subject: Re: Need an Assembler/Linker

For free? I'll assume.

For small tinkering (very small, one or two instructions at a time) open a console and run DEBUG. The (A)ssemble and (U)n-assemble commands are really handy. IIRC (and I don't run Windows often enough to remember correctly) take care if you use "A" or "E". debug alone can set the registers to Windows owned memory, so depositing values and instructions willy-nilly can cause some grief. Edit a small text file, put some spaces in it and use
code:

C:> debug textfile
and that will keep your OS safe while you play. Debug will set the registers pointing to what it thinks is the file you are debugging, not random, possibly critical, areas.

I'm not overly sure if XP still ships with LINK or not?? See the rant below as to why I don't care to boot to XP to find out.

One recommendation for an assembler.
The Netwide assembler nasm is a goodie. You can fart around with getting the proper install on Windows, http://sourceforge.net/projects/nasm/ and/or http://www.nasm.us/

or check out places like http://www.asmcommunity.net/projects/nasmx/ and get a bundle with helpful hints from other fans.

When you get to GNU/Linux, nasm may still be a good choice. gas, the GNU Assembler is designed as the last stage of the GNU Compiler Chain and isn't really meant for mortals, but optimizing compilers instead. Humans can use it, but it's not the primary goal of gas.

One thing; regardless of software you use. For intel chipsets, http://www.intel.com/products/processor/manuals/ is a great place for documentation.

Hope that helps a little.
Cheers

Old guy ranting ... please feel free to ignore

Why develop on Windows when GNU/Linux is free and and can teach you programming, not simply (and insidiously, imho) Windows programming. How many .NET applications has MS produced? (Not tools, applications). Yet they suck everyone else into thinking .NET is the greatest thing since Java. It IS frickin' Java (in spirit and idea). Innovation my arse. Lock in. Avoid it, unless you really want a career limited to playing on toy computers that people use at home. POSIX is an ok thing. MS's 25+ year attempt to "suffer no other software to live" is completely and utterly bogus in the grand scheme of human evolution (again, imho). Don't inbreed ... your grandkids could smell funny. Wink

we now return to your regularly scheduled programming
mirhagk




PostPosted: Tue Jan 05, 2010 10:25 pm   Post subject: RE:Need an Assembler/Linker

lol I would program with Linux, in fact the assembly book I'm reading is based on Linux assembly but since Linux uses the same computer architecture the difference in the two is easy enough to learn from a reference sheet since the concepts of assembly programming are the hardest part.

The only thing is I'm learning assembly to [italics]attempt[/italics] to create an open-source Turing compiler. Plus I do not own a Linux machine, cannot afford a new one, and do not feel like sacrificing all my games and downloaded stuff just to program. Maybe in a couple of days I'll pick up a computer and install it with Linux (I'll be wanting it someday anyways because I need to set up a server for an online game I'm making).

Thank you for your help sir, and I will gladly read any rants ya got. Clearly I don't have much of a life if I'm learning assembly lol.
btiffin




PostPosted: Tue Jan 05, 2010 11:28 pm   Post subject: Re: Need an Assembler/Linker

Not to dilute your thread too too much, but ...
Just so ya know...

Check out Cygwin. http://www.cygwin.com/ ... get used to rxvt. It almost feels like a programmable machine interface that does Windows. Not bad.

OR

Almost all machines that ship with Windows can have the grub installed and dual-boot into GNU/Linux. You keep Windows and get to have a POSIX(ish) operating system.

I don't recommend it on machines you have data on; but next time around, on a fresh machine, use GRUB.

Repeating the "On a new machine" part ... with nothing personal installed. Turn off disk recovery, repartition a chunk of hard drive and then run a Debian or other grub based distro install.

Happy days after that. When you need to, for say the SIMS 3 <grin>, boot Windows. When you need or want a programming or personal productivity tool, boot a freebie.

The amount of kick ass free(dom) software is extraordinary. When society gets over this whole DRM thing and hardware manufacturers wake up and smell the beans, the media and desktop side will only get better. It is a downside for the free side for now Media companies are not overly "free" thinking. Fair, given the position they are in, but I don't think that hardware specs for device driver writers should be as fearfully tied to "cash for the content" as it is now.

Note that Windows, the 6 billion dollar+ OS isn't as smart as the Debian based installers and will usually nuke your Linux partitions (MBR to be more specific) if installed after grub is already in place. Because, hey, you spent hundreds of dollars on software so that Microsoft could assume ownership of your hardware and data. Good deal. Plus the positive ethics and morals ... double bonus. Wink

Cheers
mirhagk




PostPosted: Wed Jan 06, 2010 8:12 am   Post subject: RE:Need an Assembler/Linker

just out of curiousity do you know what is added to an .exe file to convert it from the simple binary code? Maybe even I could make a simple program to find and replace the keywords with the binary codes, remove the comments and add the neccasary things to make it an .exe. It wouldn't link together but that would come later.
btiffin




PostPosted: Wed Jan 06, 2010 3:54 pm   Post subject: RE:Need an Assembler/Linker

Try http://www.delorie.com/djgpp/doc/exe/ and see if that helps.

Is short, an MZ header and then a relocation table. Not much need for relocation fixups anymore, but they can still occur with some linkers or older code.

Cheeer
andrew.




PostPosted: Wed Jan 06, 2010 4:00 pm   Post subject: RE:Need an Assembler/Linker

I recommend listening to btiffin. Dual-boot Linux on your computer. If you use a more user-friendly Linux distro like Ubuntu or Mint, it will set up the partitions easily for you. Just drag a slider to tell it how much Windows should have and it will do the rest. It will also set up GRUB for you so that you can dual-boot. The only problem is that reinstalling or recovering Windows, like btiffin said, will kill GRUB because Windows is stupid and they wipe the MBR.

Development on Linux is much better than development on Windows. IMO, Windows is the worst OS to develop on/for.

Also, I feel that I should mention that you can install a program called Wine. It's a compatibility layer which will allow you to use most Windows apps in Linux. Even some games work decently (but obviously not as well as on Windows).

I hope you decide to dual-boot. You really don't know what you're missing until you see it.
md




PostPosted: Wed Jan 06, 2010 6:05 pm   Post subject: RE:Need an Assembler/Linker

You could also run linux inside a virtual machine. Nearly the same experience - minus all the better graphical bits (no hardware acceleration usually).
Sponsor
Sponsor
Sponsor
sponsor
andrew.




PostPosted: Wed Jan 06, 2010 6:29 pm   Post subject: RE:Need an Assembler/Linker

Actually, that's not a bad idea because if you screw something up when you run your program, at least it's not a physical machine and OS. You can just delete it and make a new one.
mirhagk




PostPosted: Wed Jan 06, 2010 10:00 pm   Post subject: RE:Need an Assembler/Linker

my teacher advised me to do that, I'm going to look into it probably. And learning Assembly is not going to be a long term thing, I mostly want to develop games for 360, so I need windows
DtY




PostPosted: Wed Jan 06, 2010 10:19 pm   Post subject: Re: RE:Need an Assembler/Linker

andrew. @ Wed Jan 06, 2010 4:00 pm wrote:
Also, I feel that I should mention that you can install a program called Wine. It's a compatibility layer which will allow you to use most Windows apps in Linux. Even some games work decently (but obviously not as well as on Windows).
Some programs have even been reported to work better under wine than under windows.
I had much better luck running Diablo in wine, for example.
btiffin




PostPosted: Fri Jan 29, 2010 5:28 pm   Post subject: RE:Need an Assembler/Linker

Excuse the necro...

From a slashdot article on 29-Jan. JWasm

http://www.japheth.de/JWasm.html

Cheers
Display posts from previous:   
   Index -> General Programming
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 12 Posts ]
Jump to:   


Style:  
Search: