Re: C# programmer wants to learn assembly?? plz help



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!!!
.



Relevant Pages

  • Re: Rapport from installation of Ubuntu 7.10 on amd64
    ... This isn't done in Windows nor in Linux ... And when that dont work, bittourment and games, and seeing other apps written by other programmers, may help reengange some energy for the main task. ... But I told you to write your assembler in ... mov ebx Source ...
    (alt.lang.asm)
  • Re: HLA Stdlib v2.2 is now available.
    ... Its a generalization of the whole asm community based on the results of a single man. ... You dont get it. ... Because it is an assembler, and a very good one, showing the way for other spesific assemblers. ... As they both are needed for doing programming, I see no reason to seperate them. ...
    (alt.lang.asm)
  • Re: Assembly Code in 64 bit driver
    ... There is no equivalent of MOV, why should there be if you are going this far ... since there is little or no need for assembler in 99% of the ... Don Burn (MVP, Windows DDK) ... Windows 2k/XP/2k3 Filesystem and Driver Consulting ...
    (microsoft.public.development.device.drivers)
  • Re: which book to start with...?
    ... Want to learn the DOS API. ... i dont really mind about the system but right now im stuck with Ubuntu. ... programming per se, but they are often the objective for many people to ... 32 bit assembler is even ...
    (alt.lang.asm)
  • C# programmer wants to learn assembly?? plz help
    ... i have good programmming background and i'm primarily a C# programmer. ... I found a few links to tutorials, but i dont know which ones the best ... seen assembler code that looks kinda like the C code i used to write. ... mov ax,seg message ...
    (alt.lang.asm)