Author Topic: assembly tutorials  (Read 7392 times)

xdc

  • Guest
assembly tutorials
« 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?
« Last Edit: July 12, 2012, 10:56:23 AM by xdc »

dedndave

  • Member
  • *****
  • Posts: 8827
  • Still using Abacus 2.0
    • DednDave
Re: assembly tutorials
« Reply #1 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

xdc

  • Guest
Re: assembly tutorials
« Reply #2 on: July 12, 2012, 11:47:05 AM »

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 7608
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: assembly tutorials
« Reply #3 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.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

dedndave

  • Member
  • *****
  • Posts: 8827
  • Still using Abacus 2.0
    • DednDave
Re: assembly tutorials
« Reply #4 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

Vortex

  • Member
  • *****
  • Posts: 2372
Re: assembly tutorials
« Reply #5 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.

Gunther

  • Member
  • *****
  • Posts: 3585
  • Forgive your enemies, but never forget their names
Re: assembly tutorials
« Reply #6 on: July 12, 2012, 10:16:34 PM »
Hi Vortex,

Quote
Is 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
Get your facts first, and then you can distort them.

Vortex

  • Member
  • *****
  • Posts: 2372
Re: assembly tutorials
« Reply #7 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.

KeepingRealBusy

  • Member
  • ***
  • Posts: 426
Re: assembly tutorials
« Reply #8 on: July 13, 2012, 03:34:23 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

  • Member
  • *****
  • Posts: 3585
  • Forgive your enemies, but never forget their names
Re: assembly tutorials
« Reply #9 on: July 25, 2012, 01:17:44 AM »
Hi Vortex,

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
Get your facts first, and then you can distort them.

Mikl__

  • Member
  • *****
  • Posts: 1017
Re: assembly tutorials
« Reply #10 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?

jj2007

  • Member
  • *****
  • Posts: 10644
  • Assembler is fun ;-)
    • MasmBasic
Re: assembly tutorials
« Reply #11 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:

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 7608
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: assembly tutorials
« Reply #12 on: September 15, 2020, 03:48:36 AM »
Our friend has been let lose to roam the internet.  :biggrin:
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

deeR44

  • Regular Member
  • *
  • Posts: 28
Re: assembly tutorials
« Reply #13 on: September 22, 2020, 03:08:33 PM »

Quote
The 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--

  • Administrator
  • Member
  • ******
  • Posts: 7608
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: assembly tutorials
« Reply #14 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).
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy: