Re: C# programmer wants to learn assembly?? plz help
- From: Frank Kotler <fbkotler@xxxxxxxxxxx>
- Date: Thu, 28 Dec 2006 16:32:24 GMT
giddy wrote:
Hi ,
i have good programmming background and i'm primarily a C# programmer.
I wanna learn assembly during the holidays now , lol . .and i dont have
much of an Idea of how to go about it.
I found a few links to tutorials , but i dont know which ones the best
, basically i dont plan to go hardcore i just want be able to make
simple programs in assembler , and i've done C with win32 API , i've
seen assembler code that looks kinda like the C code i used to write.
With the WndProc and everything.So i want to start with a simple
console progams and then be able to make a simple windows program.Any
suggestions for good simple tute???
Also. . . what do i compile asm with. I tried using ml.exe from Ms
VS.NET\VC\ dir. And when i compile this program from here.
->http://www.xs4all.nl/~smit/asm01001.htm#names
i get :
/OUT:tst.exe
tst.obj
tst.obj : fatal error LNK1190: invalid fixup found, type 0x0001
Assembling: E:\tst.asm
this is the code:
.model small
.stack
.data
message db "Hello world, I'm learning Assembly !!!", "$"
.code
main proc
mov ax,seg message
mov ds,ax
mov ah,09
lea dx,message
int 21h
mov ax,4c00h
int 21h
main endp
end main
Could someone please help me
I guess the Masm-heads are on vacation...
The problem (quite common) you've encountered with your example is that it's 16-bit code (specified by ".model small", as I understand it). Masm will assemble it, but the "incremental" linker is for 32-bit code only. For 16-bit code, you'd need an older "segmented" linker. Or else, you want an example of a "real Windows program". (Windows will run the dos stuff in emulation, so if you get it linked, it'll work.)
Some people feel that it's a waste of time to learn coding for a "dead" OS. Some people feel that the Windows API is much too complicated for anyone beginning to learn asm. I'm inclined toward the latter view, but since you're already familiar with the API, perhaps you can start with it.
It's very simple, really. Just push the parameters on the stack and call the API. That fails to address the questions, "what's push?", "what's the stack?", etc...
Ram's suggestion to visit Webster is good. If HLA appeals to you, you're set. If it doesn't, you can find links to the alternatives there.
Here's a console "hello world" using Nasm and Alink - get 'em at http://www.sf.net/projects/nasm and http://www.sf.net/projects/alink This will need modifications to work with Masm/msLink!!!
.
- Follow-Ups:
- Re: C# programmer wants to learn assembly?? plz help
- From: //\\\\o//\\\\annabee
- Re: C# programmer wants to learn assembly?? plz help
- From: Frank Kotler
- Re: C# programmer wants to learn assembly?? plz help
- References:
- C# programmer wants to learn assembly?? plz help
- From: giddy
- C# programmer wants to learn assembly?? plz help
- Prev by Date: Re: ///Re: RDTSC
- Next by Date: ///Re: RDTSC
- Previous by thread: Re: C# programmer wants to learn assembly?? plz help
- Next by thread: Re: C# programmer wants to learn assembly?? plz help
- Index(es):
Relevant Pages
|