Assembly language > Assembly discussions

I am begginer

<< < (3/3)

zellJunior:
Ok. i analyzed this code, i see that we declare 3 procedures : GetStdHandle,..., and then we call  them in "main" procedure with invoke. But i am a little confused. When i debug a C code, i see there a lot of "ADD","MOV","SUB"...<-- mnemonics.they miss from this code. I also know, assembler works with registers: ax,bx,cx,dx,eax,ebx,...
so : mov ax,10  ;means we move 10 to ax register.
my question is - what does the : (invoke GetStdHandle, -11) function. I changed -11 with other number and there is nothing shown.

Reading anachronistic's reply carefully, i think i cannot program in POASM for embeded systems.

Bitbeisser:

--- Quote from: jj2007 on February 05, 2014, 11:48:38 PM ---
--- Quote from: Bitbeisser on February 05, 2014, 11:34:42 PM ---without any indication of what his/her problem is
--- End quote ---


--- Quote from: zellJunior on February 05, 2014, 09:17:49 PM ---Please someone help me adapt this code to POASM
--- End quote ---

This is what Timo and I have done. Re environments, for console apps the switch from DOS to Win32 is not a big issue.

--- End quote ---
You missed that he clearly stated to be a beginner, and the source code he posted is a 16 bit DOS equivalent of a Hello World in x86 assembler.

The fact that he is/was trying to adapt this to PoASM is rather due to the effect that this is what he has at hand as a tool (as included in Pelle's C). And as stated by me, PoASM and 16 bit code simply don't mix.

You in fact did more then just adapting his program to PoASM, you rather adapted a 16bit DOS program to a 32bit Windows console application. And in his latest reply, he clearly states that he is even more confused by your adaptation...

"If someone's only tool he knows to use is a hammer, everything looks like a nail"...

Ralf

Bitbeisser:

--- Quote from: zellJunior on February 06, 2014, 08:37:26 AM ---Ok. i analyzed this code, i see that we declare 3 procedures : GetStdHandle,..., and then we call  them in "main" procedure with invoke. But i am a little confused. When i debug a C code, i see there a lot of "ADD","MOV","SUB"...<-- mnemonics.they miss from this code. I also know, assembler works with registers: ax,bx,cx,dx,eax,ebx,...
so : mov ax,10  ;means we move 10 to ax register.
my question is - what does the : (invoke GetStdHandle, -11) function. I changed -11 with other number and there is nothing shown.
--- End quote ---
That's what I referred to in my latest reply to JJ, they not only adapted the code to to PoASM, they made a Windows program out of it.

They pretty much replaced to the direct screen output via INT21h of your initial (DOS) code posted with the more (much) complicated way of processing screen output via Windows handles, in effect changing your running environment, which for a beginner (as you called yourself) is indeed much  more confusing....

--- Quote ---Reading anachronistic's reply carefully, i think i cannot program in POASM for embeded systems.

--- End quote ---
If you referring to my post (my name is Ralf, as you can see as I sign each and every post of mine (with some rare exceptions) with my real (first) name), then that is indeed what I was getting at.

You are presenting a DOS based program, using very specific DOS based services (INT21h is the DOS service interrupt) that simply do not exist/aren't allowed anymore in real Windows programs (as mentioned your program,  when compiled and linked as true 16bit code won't run on any of the 64bit Windows versions anymore).
And PoASM (together with the rest of the Pelle's C programming environment) are specifically geared to create Windows programs. That is why I still think that it is the best option if you are using a tool (like JWAsm) that is more adapt to your task...

PoIDE works very nicely as an editor with syntax highlighting for any kind of x86 assembler code (that is actually one of the purposes I am using it myself for), but if you want to create plain DOS (or embedded as you eluded to) programs, you a tool specifically suited for that task.

Ralf

tienkhoanguyen:
 :)  Well, I specifically develop for the DOS environment using Borland Turbo C and Borland Turbo Assembler.  Both are DOS based however the Assembler has a version which also compiles for 32-bit mode in Windows.  Since I have specialized using the 8086 chip which is DOS, I can give an example of an assembly using my tool.  I hope it works for you.  Sorry if I am kind of late, and a permanent friendly hello to everyone.

p8086
model small
dataseg
udataseg
stack 100h
codeseg
startupcode

mov dl, 'U'
mov ah, 2
int 21h

mov ah, 04ch
mov al, 0
int 21h

end

Okay this only prints out the word 'U' as in You.  However it illustrates the use of interrupts which is the main cooking ingredientes for DOS assembly programming.  hehe

tienkhoanguyen:
 :)  I am a dork.  I just noticed the original poster wanted to adapt a Borland Turbo Assembler program to a version by Pelles.  I do not know Pelles, however, I can tell you what the program does so anyone who wants to help can adapt it.  The program simply states "Salut!" then it goes to the next line with a line feed character.  After that it tabs over and exit.

Cheers!

Navigation

[0] Message Index

[*] Previous page

Go to full version