Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Nov 2014 03:11:43 +0100
From:      "Julian H. Stacey" <jhs@berklix.com>
To:        =?UTF-8?Q?fran=C3=A7ai_s?= <romapera15@gmail.com>
Cc:        freebsd-drivers@freebsd.org
Subject:   Re: Exist tutorial that teaches programming in machine code to FreeBSD?
Message-ID:  <201411170211.sAH2Bhtg057567@fire.js.berklix.net>
In-Reply-To: Your message "Fri, 14 Nov 2014 21:39:31 -0200." <CAK_6RwdxQdWM5sMHJW-1Mq7OYghvwZv3kG0CWupsst5_PiKmEg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
=?UTF-8?Q?fran=C3=A7ai_s?= wrote:
> A FreeBSD developer told me via private message that the most FreeBSD
> developers don’t develop in machine code.
> 
> The following link leads to tutorial that teaches programming Assembly in
> to FreeBSD:
> http://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/x86.html

There's an x86 in your URL.  Did You know that FreeBSD supports other CPUs 
too ?  Did you decide to target the x86 CPU ? Or just come across that URL ?


> Also exist tutorial that teaches programming in machine code to FreeBSD?
................................................. ^^^^^^^

I hope not! There's a difference between Assembler & Machine programming:

http://en.wikipedia.org/wiki/Machine_code
	"While it is possible to write programs directly in numerical
	machine code, it is tedious and error prone to manage
	individual bits and calculate numerical addresses and
	constants manually. It is therefore rarely done today,
	except for situations that require extreme optimization or debugging.

	Almost all practical programs today are written in higher-level
	languages or assembly language,"
http://en.wikipedia.org/wiki/Assembly_language

<Story>
  My last need to machine code program was probably for an NSC 16032 in ~1982.
  I had to as I had no C compiler, assembler, or computer.  I hand coded
  Hex on paper, typed & burnt it to an Eprom on a borrowed MDS, & my logic
  analyser showed it ran on my co- designed & self wrapped board - Magic!
  Then on CPM I wrote http://berklix.com/~jhs/src/bsd/jhs/bin/local/monitor/
  & we decided to avoid more machine code, & buy a compiler & assembler !
</Story>

Now there's free compilers & assemblers, so more than ever:
Doing much machine code programming is erroneous, (though
assembly programming remains occasionaly appropriate &/or essential).

Your x86 URL leads to 2 assemblers, no need to program in Machine Code.

I vaguely thought there was an assembler in docs/ but a find in /usr/share
failed to find an appropriate 'as'.

man as

Maybe some ports like binutils & gas might include refs to tutorials
	http://www.freebsd.org/cgi/ports.cgi?query=binutils&stype=all
	http://www.freebsd.org/cgi/ports.cgi?query=gas&stype=all&sektion=all
	http://svnweb.freebsd.org/ports/head/lang/intel2gas/
	http://www.freebsd.org/cgi/ports.cgi?query=nasm&stype=all&sektion=all

This list might discuss ports/ components that deliver tutorials:
	freebsd-toolchain@freebsd.org
	http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain

Cheers,
Julian
-- 
Julian Stacey, BSD Linux Unix C Sys Eng Consultant Munich http://berklix.com
 Indent previous with "> ".  Interleave reply paragraphs like a play script.
 Send plain text, not quoted-printable, HTML, base64, or multipart/alternative.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201411170211.sAH2Bhtg057567>