Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Oct 5th, 2008, 12:25 AM   #1
pan1c
Newbie
 
Join Date: Oct 2008
Posts: 5
Rep Power: 0 pan1c is on a distinguished road
Looking for advice

I'm anxious to get into assembly, I've already decided on a few things, but I don't know what tools would be best for my situation.

I have the basic idea of how assembly works with specifying different memory types and where certain values need to be for various calls but I really can't apply any of it just yet.

What I'm looking for.

I want to use an intel syntax assembler but it also needs to be compatible on both windows and linux. (or maybe 2 different assemblers that aren't too different in syntax).

Learning material, I own a hard-copy of the 6 intel developer manuals but they are really useless at the moment.


I really appreciate any advice you can provide.
pan1c is offline   Reply With Quote
Old Oct 5th, 2008, 5:32 AM   #2
Freaky Chris
Professional Programmer
 
Freaky Chris's Avatar
 
Join Date: Dec 2007
Location: England
Posts: 448
Rep Power: 1 Freaky Chris is on a distinguished road
Send a message via MSN to Freaky Chris
Re: Looking for advice

http://www.arl.wustl.edu/~lockwood/c...ofasm/toc.html

Great resource
__________________
Steven Skiena - Algorithms

,[->+>+<<]>>[-<<+>>]>++++++++[-<++++++++>]<+[-<->]>+<<[[-]+++++++++++++++.[-]>]>>[+++++++++.[-]],
brainf**k -- It's such a pretty language
Freaky Chris is offline   Reply With Quote
Old Oct 6th, 2008, 8:06 AM   #3
Grich
Professional Programmer
 
Grich's Avatar
 
Join Date: Sep 2007
Location: Sydney - Australia
Posts: 330
Rep Power: 2 Grich is on a distinguished road
Re: Looking for advice

First, look at the page Freaky Chris gave you. It's a great start.
Second, I use an assembler called NASM. It is free and can work on both Windows and Linux.
Also (you have to pay for this), get a book called step by step assembly. It's a great intro to coding assembly using nasm for DOS and Linux. It's the only book I recommend to get for beginners at assembly.
__________________
SYNTAX ERROR ...
Grich is offline   Reply With Quote
Old Oct 6th, 2008, 12:00 PM   #4
MasterWill
C/C++ Developer
 
MasterWill's Avatar
 
Join Date: Sep 2008
Location: Florida, USA
Posts: 43
Rep Power: 0 MasterWill is on a distinguished road
Re: Looking for advice

Great resource, Chris. I have added that to my bookmarks, even though I don't normally develop in Assembly (nice to have a good reference when I do drop down for speed).

Another good Assembler is MASM (Microsoft's assembler), but I am pretty sure that it does not work on Linux (it's amazing it works on Windows ... ). I have not tried taking code written for MASM and seeing if it will compile without any changes using NASM on Linux, but one would assume that some changes would be necessary simply because you are talking about two different OSes and two different kernels.

Just out of curiosity, has anyone tried writing an assembly app and running it on Vista? With all the "security" features that Microsoft has put into the OS, I wonder if you can still use assembly apps/routines for low-level, speedy routines or if it will get flagged as trying to do something "inappropriate" according to the OS.
__________________
-- William
MasterWill is offline   Reply With Quote
Old Oct 6th, 2008, 4:02 PM   #5
lectricpharaoh
SEXY SHOELESS GOD OF WAR!
 
lectricpharaoh's Avatar
 
Join Date: Jun 2005
Location: Wet west coast of Canada
Posts: 1,198
Rep Power: 5 lectricpharaoh will become famous soon enough
Re: Looking for advice

Quote:
Originally Posted by MasterWill
I have not tried taking code written for MASM and seeing if it will compile without any changes using NASM on Linux, but one would assume that some changes would be necessary simply because you are talking about two different OSes and two different kernels.
Not to mention two different assemblers, with different syntax. NASM syntax is pretty close to MASM syntax- much more so than gas, which uses the AT&T syntax- but it's by no means the same. Perhaps the most significant difference is the use of square brackets for referencing a memory operand (omitting the brackets uses the value of the address, similar to using the OFFSET directive in MASM). Macros also have different syntax and semantics, so be sure to read the docs to avoid some nasty surprises. Lastly, NASM lacks a lot of the superfluous 'red tape' directives that MASM, TASM, etc use, which (in my eyes) makes the code much cleaner.
Quote:
Originally Posted by MasterWill
Just out of curiosity, has anyone tried writing an assembly app and running it on Vista? With all the "security" features that Microsoft has put into the OS, I wonder if you can still use assembly apps/routines for low-level, speedy routines or if it will get flagged as trying to do something "inappropriate" according to the OS.
There are only two ways I can see an OS (Vista or otherwise) trapping a piece of code as doing something that's potentially dangerous. First would be if the code tries to use a privileged instruction and the CPU raises an exception. Second is if it calls, directly or indirectly, an API function that the OS recognizes (however it does so, metadata being one possible mechanism) as being dangerous. Both of these have everything to do with what the code is doing, and nothing to do with how it was generated.

In other words, I can't see why it would matter if the code was compiled, assembled, or even written by sticking raw opcodes together with a hex editor.
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot.
- Vaarsuvius, Order of the Stick
lectricpharaoh is offline   Reply With Quote
Old Oct 7th, 2008, 4:16 AM   #6
Grich
Professional Programmer
 
Grich's Avatar
 
Join Date: Sep 2007
Location: Sydney - Australia
Posts: 330
Rep Power: 2 Grich is on a distinguished road
Re: Looking for advice

Quote:
Originally Posted by lectricpharaoh View Post
... or even written by sticking raw opcodes together with a hex editor.
Ha Ha I remember a mate doing that for an assignment!
__________________
SYNTAX ERROR ...
Grich is offline   Reply With Quote
Old Oct 7th, 2008, 1:04 PM   #7
MasterWill
C/C++ Developer
 
MasterWill's Avatar
 
Join Date: Sep 2008
Location: Florida, USA
Posts: 43
Rep Power: 0 MasterWill is on a distinguished road
Re: Looking for advice

Quote:
In other words, I can't see why it would matter if the code was compiled, assembled, or even written by sticking raw opcodes together with a hex editor.
I would assume so too, but knowing how Microsoft is and the overly protective nature of Vista -- it asks if you really want to run "Notepad" as it may be a risk to do so -- I was curious if anyone knew of any measures that may have been put in place to monitor application activity. I would not be surprised if they have done so, perhaps at the kernel level as you mentioned where a warning of some sort is raised when you try and make a possibly destructive system call, i.e. trying to delete a file or format a partition.

You know, just thinking about it, you're absolutely right - they wouldn't know from where the code came. I guess I was originally thinking about low-level system calls vs going through the NET framework, but didn't quite get that out. hmm ... brain cramp, I suppose
__________________
-- William
MasterWill is offline   Reply With Quote
Old Oct 21st, 2008, 10:44 PM   #8
pan1c
Newbie
 
Join Date: Oct 2008
Posts: 5
Rep Power: 0 pan1c is on a distinguished road
Re: Looking for advice

Sorry, been away - actually I forgot about this until I read some of my filtered email, anyways - Chris, that is really an amazing page. used it a bit so far.


NASM is what I was thinking about I wasn't sure about other possibilities MASM isn't really in question if its win only - maybe once I have a better understanding.


Step by step assembly, I believe I have the ebook to that around here somewhere. Since Its recommended I will have to dig it up.

About the whole Vista and stuff... wut? LOL!

Thanks everyone.
pan1c is offline   Reply With Quote
Old Oct 21st, 2008, 11:00 PM   #9
Grich
Professional Programmer
 
Grich's Avatar
 
Join Date: Sep 2007
Location: Sydney - Australia
Posts: 330
Rep Power: 2 Grich is on a distinguished road
Re: Looking for advice

Quote:
Originally Posted by pan1c View Post
About the whole Vista and stuff... wut? LOL!
Don't go there ... you may never come back. If you want to use Assembly with vista (Good luck), use MASM.

ADDON: I don't know anyone who does programming in a 64-BIT environment with Assembly.
__________________
SYNTAX ERROR ...

Last edited by Grich; Oct 21st, 2008 at 11:01 PM. Reason: add on
Grich is offline   Reply With Quote
Old Oct 22nd, 2008, 11:50 PM   #10
pan1c
Newbie
 
Join Date: Oct 2008
Posts: 5
Rep Power: 0 pan1c is on a distinguished road
Re: Looking for advice

I've been trekking through Assembly Language Step-by-Step. Turns out, its a really good book. Understanding a handful of what was presented in the earlier chapters made it a bit of a bore, but other than that the author is very good it has so far been much less cumbersome then trying to find a good book on C.

Now the assembly begins, was able to read/skim/skip up to chapter 6 ( 6 of 13 chapters and 5 appendixes )
pan1c is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:15 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC