News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

assembly tutorials

Started by xdc, July 12, 2012, 09:02:26 AM

Previous topic - Next topic

xdc

at 'hello world in many programming languages' under assembly the 2nd one for linux(nasm):
http://c2.com/cgi/wiki?HelloWorldInManyProgrammingLanguages
says it doesn't require any C library code to be linked; it calls directly to the kernel through the interrupt 0x80 interface

this is the type of assembly programing I'm interested in, using simple output/input in a console,
low level programming without getting too low, like writing my own kernel/OS(which im lookin into)

is there a tutorial that doesn't use dialog boxes/windows?

dedndave

that is 16-bit code
in the old forum - 16-bit subforum - you will find lots of examples

however, 16-bit code is becoming obsolete
i wouldn't spend too much time on it

xdc

this explains it:
http://stackoverflow.com/questions/2489889/system-calls-in-windows-native-api

hutch--

The catch is that Linux and Windows are different planets and the assumption from one do not work on the other. You cannot use an interrupt interface in Windows, the OS design excludes it by design, you use the Windows API functions and write the rest yourself. In 32 bit Windows, console IO is technically trivial, you can find a share of examples in the current masm32 SDK that does simple console IO.

dedndave

i have seen programs that use conditional assembly to switch
i can't imagine trying to write macros and/or wrappers to do it any other way   :icon_eek:
there are just too many functions

Vortex

Hi xdc,

Is there a specific reason to prefer Nasm for Linux? You can also try SolAsm and JWasm. Both of them are supporting Linux.

Gunther

Hi Vortex,

QuoteIs there a specific reason to prefer Nasm for Linux? You can also try SolAsm and JWasm. Both of them are supporting Linux.

That's right, SolAsm and JWasm will do the same job. But the wiki code above for Linux is written in AT&T syntax for GAS, not for NASM.

Gunther
You have to know the facts before you can distort them.

Vortex

Hi Gunther,

The AT&T syntax is difficult and out of date. The author of the wiki code should move to the Intel syntax.

KeepingRealBusy

Quote from: xdc on July 12, 2012, 09:02:26 AM
at 'hello world in many programming languages' under assembly the 2nd one for linux(nasm):
http://c2.com/cgi/wiki?HelloWorldInManyProgrammingLanguages
says it doesn't require any C library code to be linked; it calls directly to the kernel through the interrupt 0x80 interface

this is the type of assembly programing I'm interested in, using simple output/input in a console,
low level programming without getting too low, like writing my own kernel/OS(which im lookin into)

is there a tutorial that doesn't use dialog boxes/windows?

xdc,

I code that way myself, all of the time. I use no libraries, just access the API's (except for those cases where I am adding my functions to any of the Lab timing exercises) . I wrote my own Win32.inc file from the documentation for the API's themselves, and only included the API's that I used. I wrote my own wrappers for all of the API's that I use. It's fun!

Dave.

Gunther

Hi Vortex,

Quote from: Vortex on July 13, 2012, 03:02:19 AM
The AT&T syntax is difficult and out of date. The author of the wiki code should move to the Intel syntax.

No doubt about this point. The crucial point is: the gcc uses AT&T for assembly language output. But the gas assembles since a few years Intel syntax, too. I've no clue about that strange behaviour.

Gunther
You have to know the facts before you can distort them.

deeR44


QuoteThe crucial point is: the gcc uses AT&T for assembly language output.

I don't understand that sentence at all. What does "AT&T" or "Intel" have to do with assembly language output?

hutch--

Simple, they both use different notation, most Windows assemblers use a variation of Intel notation where AT&T notation was used with the GNU assembler (GAS).

Vortex

Hi deeR44,

The Intel notation is much more easy to read and understand than the AT & T syntax.

deeR44

QuoteSimple, they both use different notation, most Windows assemblers use a variation of Intel notation where AT&T notation was used with the GNU assembler (GAS).

I understand that but I still don't see where it has anything, whatsoever, to do with an assembler output.

deeR44

QuoteThe Intel notation is much more easy to read and understand than the AT & T syntax.

Thank you and I agree. I have only used MASM going back to its first release in the 70's or 80's.

I still do and I don't do Linux or any sixty-four bit stuff. I have enough difficulty with thirty-two bits.