The MASM Forum

General => The Campus => Topic started by: xdc on July 12, 2012, 09:02:26 AM

Title: assembly tutorials
Post by: 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?
Title: Re: assembly tutorials
Post by: dedndave on July 12, 2012, 11:14:47 AM
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
Title: Re: assembly tutorials
Post by: xdc on July 12, 2012, 11:47:05 AM
this explains it:
http://stackoverflow.com/questions/2489889/system-calls-in-windows-native-api
Title: Re: assembly tutorials
Post by: hutch-- on July 12, 2012, 12:36:13 PM
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.
Title: Re: assembly tutorials
Post by: dedndave on July 12, 2012, 12:50:38 PM
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
Title: Re: assembly tutorials
Post by: Vortex on July 12, 2012, 06:43:31 PM
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.
Title: Re: assembly tutorials
Post by: Gunther on July 12, 2012, 10:16:34 PM
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
Title: Re: assembly tutorials
Post by: Vortex on July 13, 2012, 03:02:19 AM
Hi Gunther,

The AT&T syntax is difficult and out of date. The author of the wiki code should move to the Intel syntax.
Title: Re: assembly tutorials
Post by: KeepingRealBusy on July 13, 2012, 03:34:23 AM
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.
Title: Re: assembly tutorials
Post by: Gunther on July 25, 2012, 01:17:44 AM
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
Title: Re: assembly tutorials
Post by: Mikl__ on September 15, 2020, 12:46:18 AM
Mahi01,
are you a necrophile? Have you noticed that you are trying to reanimate a topic that was last talked in 2012? (https://wasm.in/styles/smiles_s/negative.gif)
Title: Re: assembly tutorials
Post by: jj2007 on September 15, 2020, 01:51:08 AM
Hi Mikl,

He is just a poor spammer in a poor country who gets paid some cents for placing links to r.o.k.u. in forums etc :cool:
Title: Re: assembly tutorials
Post by: hutch-- on September 15, 2020, 03:48:36 AM
Our friend has been let lose to roam the internet.  :biggrin:
Title: Re: assembly tutorials
Post by: deeR44 on September 22, 2020, 03:08:33 PM

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?
Title: Re: assembly tutorials
Post by: hutch-- on September 22, 2020, 04:25:26 PM
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).
Title: Re: assembly tutorials
Post by: Vortex on September 22, 2020, 08:37:53 PM
Hi deeR44,

The Intel notation is much more easy to read and understand than the AT & T syntax.
Title: Re: assembly tutorials
Post by: deeR44 on September 25, 2020, 04:09:25 PM
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.
Title: Re: assembly tutorials
Post by: deeR44 on September 25, 2020, 04:15:35 PM
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.