WinAsm Studio, The Assembly IDE - Free Downloads, Source Code
Sponsors
Articles
Programming Quick Start
32-bit Assembler is Easy
Porting Iczelion tutorials
What is FASM
What is FASM G
Hard Drive Recovery
Wiring your own LAN
Personal menu
Welcome Guest
User:
Pass:
Register!
Resend Validation Email
 
Forum
Pages (2) [1] 2   ( Go to first unread post )

Very confused about WinASM & ASM in general, Warning: super noob here

Evlesoa
Quote Post


New Member
*

Group: Members
Posts: 4
Member No.: 64406
Joined: 6-January 15


Sponsored Links
Okay, I'd like to try WinASM, but every book I look at has a different syntax than what every IDE/Compiler out there seems to have. I've been reading The Art of Assembly, and I bump into another problem: the syntax used there is HLA, I guess, which means it looks a lot more like C and a lot less like the assembler that I am used to in Cheat Engine. I even tried FASM, but I will do that when I become more proficient in general assembly (CE is my motivation, really).

Right now I'd like to know how to start since every tutorial out there looks very different and only seems to work with "specific" compilers. That confuses a noob like me (especially since half of them say you need a linker, and half say you don't). The only thing that looks familiar to CE in syntax is http://www.wiremod.com/forum/cpu-tutorials/271-assembly-programming-tutorial.html

Anyway, I have no idea where to start now. Can someone tell me what to read or what is reliable? There's MASM, FASM, WinAsm, MASM32 (different from MASM?), ZASM, NASM, LZASM, POASM, VASM, YASM, etc. What in the world is going on?

Let me say this: I understand computers to a good extent because I did computer engineering for a few years, but never finished. So, I get the whole binary and hex stuff, along with what registers are and memory allocation (a general understanding, ok), but I don't know how I can start "writing something." From my perspective, clearly just moving around pieces of memory doesn't make programs without having a GUI to command and labels to define.

Please explain. Otherwise is it better to just learn C from a book because it has a streamlined syntax and all compilers work in relatively same fashion?
PMEmail Poster
Top
shoorick
Quote Post


Extremely Active Member
******

Group: Admins
Posts: 2342
Member No.: 160
Joined: 22-June 04


at first you must distinguish two separate things:
1: IDE - a specific complex editor which can run tools
2: assembler - a tool or set of tools to build some binary from text source

WinAsm Studio is IDE, it can not build binary by itself

then we can see some kinds of assemblers. they have different developers, different syntax, different targets, different licenses, different behavior, different set of tools and different popularity.

in the books you will meet mostly masm and tasm (at least at old books).
tasm is product of borland and now is kinda abandonware, i.e. unavailable officially.
masm is product of microsoft, it is included in visual studio and it is possible to use it in non-commercial self-educational properties.
tasm has different syntax, but has masm compatible mode.
they both produce object files (incompatible between them) and need linkers to build target executable. the only plain ms-dos "com" ("copy of memory") file can be output directly without linker.

masm and tasm are ms-dos/ms-windows tools only.

fasm is crossplatform assembler, it is actual and free to use for any purpose.
it produces binary file directly without linker, but it is possible to produce objects with it for later linking with objects of other origin. i did not heard about books about fasm, but it is enough documented to guess how to deal with it.

more about basic documentation: there are Intel Architecture Manuals: a set of pdfs with detailed description of each CPU instruction, kinda "bible" for asm programmer ;) if program works not as expected and nothing helps - it is usefull to read in those manuals about certain commands to find a clue.

all other assemblers are crossplatform or not, have syntax like tasm or like masm, or even absolutely different...

the environment: any program, even written in assembly, while executing deals in close communication with operation system, it uses more or less API (existing functions) of the OS and must call them properly to get expected result. these API functions are described in OS documentation, for ms win - say, in msdn. they are described in C syntax, so, assembly coder (as unwanted person) must understand C and know how to transform it to call in assemly (with "invoke" its not too complex indeed). also, without knowing of these functions it is impossible to do anything impressing: to show any window, dialog or even messagebox we must use system API.

finally, some tips about masm: masm by ms is just a tool to assemble text into object.
ms does not add required includes, which program needs to call system API (constants and functions prototypes like header files (*.h) for C), so somebody made them by itself, and called its package as MASM32 - thanks to him it became possible to do all this assembly things in windows.

and about ms linker: there are two kinds of linkers - 16-bit and 32-bit (dunno about separate 64-bit, i still use 32-bit cpu). both of them ms calls as "link.exe", thus to be able to make same time 32-bit and 16-bit (ms dos) applications somebody download hard-but-possible-to-find 16-bit linker and rename it to "link16.exe" - it is usefull to those who read old books and start with 16-bit assembly applications.

well, as a conclusion, you must choose assembler of your destiny by yourself, start with hello-world application and go far step-by-step. nothing bad if you were try some assemblers and dislike them - it should only rise your experience and skill. to reduce your time waste i would suggest you to choose between fasm and masm. in any case, the assembler you disliked before, may give you a very usefull example or template, and it is good to know how to convert it into syntax you like ;)
PMEmail PosterUsers Website
Top
Evlesoa
Quote Post


New Member
*

Group: Members
Posts: 4
Member No.: 64406
Joined: 6-January 15


Thank you for your informative reply.

In that case, I will learn C and go back to assembly.

This makes me also want to ask another question. Where does someone learn about API calls and what they are? Is that something you learn from a higher level language before learning Assembly?
PMEmail Poster
Top
shoorick
Quote Post


Extremely Active Member
******

Group: Admins
Posts: 2342
Member No.: 160
Joined: 22-June 04


yes, in any case knowing of C basics is extremely usefull as most API usage and algorithms are described in books or online sources using HLL, mostly in C, also you can meet them in Pascal (Delphi) or VBA, etc.

sure, it is possible to learn API calls without HLL using only assembly examples, but I would not reccomend this way.
PMEmail PosterUsers Website
Top
Evlesoa
Quote Post


New Member
*

Group: Members
Posts: 4
Member No.: 64406
Joined: 6-January 15


Hmm, alright.

Fair enough. Thanks for all your help. I will go with C first.

Many thanks again.
PMEmail Poster
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Topic Options Pages (2) [1] 2  Reply to this topicStart new topicStart Poll

 

Sponsors
Computer Science

Internet
C/C++
Hardware & PC maintenance

HiEditor

General Discussions
Suggestions/Bug Reports
WinAsm Studio

General Discussions
Suggestions/Bug Reports
WinAsm Studio FAQ
Multilingual User Interface
Add-Ins
Assembly Programming

Main
Newbies
Projects
Custom Controls
Snippets
Announcements & Rules

Announcements

General

Online Degrees - Distance Learning
The Heap
Russian
Google