Re: C# programmer wants to learn assembly?? plz help
- From: Frank Kotler <fbkotler@xxxxxxxxxxx>
- Date: Thu, 28 Dec 2006 19:33:29 GMT
Herbert Kleebauer wrote:
....
Using Frank's example:
(which I think isn't correct, because -11 is not the handle
for stdout).
I'm quite sure you're right, but -11 "works for me", and I wanted to post something I'd tested (in the bad old days, when I was a microserf). "Corrected" - but untested! - code would look like...
==============================================================
; nasm -f obj hwcons.asm
; alink -oPE -subsys console hwcons.obj
extern WriteFile
import WriteFile kernel32.dll
extern ExitProcess
import ExitProcess kernel32.dll
extern GetStdHandle
import GetStdHandle kernel32.dll ;(I assume kernel32.dll ???)
section _TEXT use32 class=CODE
..start
push -11
call [GetStdHandle]
; returns the "real" stdout handle in eax
push dword 0
push dword num_chars
push dword MSGLEN
push dword msg
push dword -11
push eax ; instead of -11
call [WriteFile]
push dword 0
call [ExitProcess]
section _DATA use32 class=DATA
num_chars dd 0
msg db 'Hello, Console.', 13, 10
MSGLEN equ $ - msg
==============================================================
then this is the flight with the auto pilot. You have to
do work, but because the auto pilot (assembler/linker) hides
most, you will learn nearly nothing.
Your refusal to use a linker puts you uncomfortably close to the RasAsm camp. At least, *I* wouldn't be comfortable there!
Gideon, if you want to try Herbert's code:
ftp://137.193.64.130/pub/assembler/windela.zip
Filename has to end in ".mac"...
Best,
Frank
.
- Follow-Ups:
- Re: C# programmer wants to learn assembly?? plz help
- From: Herbert Kleebauer
- Re: C# programmer wants to learn assembly?? plz help
- From: Betov
- Re: C# programmer wants to learn assembly?? plz help
- References:
- C# programmer wants to learn assembly?? plz help
- From: giddy
- Re: C# programmer wants to learn assembly?? plz help
- From: Frank Kotler
- Re: C# programmer wants to learn assembly?? plz help
- From: //\\\\o//\\\\annabee
- Re: C# programmer wants to learn assembly?? plz help
- From: Herbert Kleebauer
- C# programmer wants to learn assembly?? plz help
- Prev by Date: Re: C# programmer wants to learn assembly?? plz help
- Next by Date: Re: A programming wiki?
- 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
|