Awk is an extremely versatile programming language for working on files. We’ll teach you just enough to understand the examples in this page, plus a smidgen.

The examples given below have the extensions of the executing script as part of the filename. Once you download it, and make it executable, you can rename it anything you want.

Continue

This was originally written for the Phil Inch’s Game Developer’s Magazine and after getting lots of positive feedback I expanded and improved it. I have spent a lot of time working on this and would appreciate hearing from you if you like it.

Here is some of the feedback I have recieved.

If you want to contact me then e-mail me at: gavin@senator.demon.co.uk or on CompuServe at 100767,1325

Continue

Welcome to my PC Assembly Page
I taught Computer Science at the University of Central Oklahoma for 10 years. During this time I taught an introductory course in PC Assembly Language programming. I grew frustrated at teaching 16-bit real mode programming and decided to change to 32-bit protected mode. However, I soon ran into a problem. I could not find a textbook that covered 32-bit protected mode assembly programming! So, I decided to write my own.

Continue

The GNU C Compiler uses the assembler `as’ as a backend. This
assembler uses AT&T syntax. Here is a brief overview of the syntax.
For more information about `as’, look in the system info
documentation.

- as uses the form;

nemonic source, destination (opposite to intel syntax)

- as prefixes registers with `%’, and prefixes numeric constants
with `$’.

- Effective addresses use the following general syntax;

Continue

The programs listed here are provided as exhibitions of just how compressed a Linux ELF executable can be and still function.

Take a look through /usr/bin: how big is the smallest ELF executable in there? Now try writing the smallest hello-world program you can. Can you get it under 1K? Can you get it under 100 bytes?

This is precisely what I set out to do one day, and I ended up with a minor obsession over creating the smallest possible executables.

The distribution comes with preassembled binaries along with the assembly source code. If you wish to be able to rebuild them yourself, you will need to have a copy of Nasm, the excellent x86 assembler. Nasm’s home page is at http://nasm.sourceforge.net/.

Continue

If you’re a programmer who’s become fed up with software bloat, then may you find herein the perfect antidote.

This document explores methods for squeezing excess bytes out of simple programs. (Of course, the more practical purpose of this document is to describe a few of the inner workings of the ELF file format and the Linux operating system. But hopefully you can also learn something about how to make really teensy ELF executables in the process.)

Please note that the information and examples given here are, for the most part, specific to ELF executables on a Linux platform running under an Intel-386 architecture. I imagine that a good bit of the information is applicable to other ELF-based Unices, but my experiences with such are too limited for me to say with certainty.

The assembly code that appears in this document is written for use with Nasm. (Besides being more appropriate for our needs, Nasm’s syntax beats the hell out of AT&T syntax for anyone who learned x86 assembly language before learning to use Gas.) Nasm is freely available and extremely portable; see http://nasm.sourceforge.net/.

Please also note that if you aren’t a little bit familiar with assembly code, you may find parts of this document sort of hard to follow.

Continue

There is no longer a web page present at the URL specified. If you followed a link from another web page, please notify the mainter of that site that this link is invalid.

If the URL begins with, “http://www.eskimo.com/~name”, where “name” is a 1-8 alphanumeric string, the web page belonged to our customer with that username. Try going to their home page at “http://www.eskimo.com/~name”. Their e-mail is “name@eskimo.com”.
If the URL begins with “http://www.eskimo.com/”, the page is a Eskimo North system page. You may find what you are looking for in the left and right bars or on our home page at “http://www.eskimo.com/”. You can contact us at support@eskimo.com.
If the URL begins with a different domain name, then it is most likely a page that belonged to a business domain hosting, personal domain hosting, or virtual domain customer. You can find contact information by using a domain registries whois such as “http://www.gandi.net/whois”.

Continue

Introduction
The following is designed familiarize the reader with programming in x86 (AT&T style, that produced by gcc) assembly under Linux and how to interface assembly and higher-level language code (i.e. C). The tutorial will also briefly cover debugging your assembly using GDB.
This tutorial requires the following:

an i386 family PC running Linux
GCC, the GNU C-compiler
GDB, the GNU debugger command line debugger
The tutorial was developed on and tested with GCC version 2.95.4 and GDB 19990928 under Linux kernel 2.4.9

I highly recommend working through this tutorial with “as” and “gdb” documentation close at hand.

Continue

Bharata B. Rao offers a guide to the overall use and structure of inline assembly for x86 on the Linux platform. He covers the basics of inline assembly and its various usages, gives some basic inline assembly coding guidelines, and explains the instances of inline assembly code in the Linux kernel.
If you’re a Linux kernel developer, you probably find yourself coding highly architecture-dependent functions or optimizing a code path pretty often. And you probably do this by inserting assembly language instructions into the middle of C statements (a method otherwise known as inline assembly). Let’s take a look at the specific usage of inline assembly in Linux. (We’ll limit our discussion to the IA32 assembly.)

GNU assembler syntax in brief

Let’s first look at the basic assembler syntax used in Linux. GCC, the GNU C Compiler for Linux, uses AT&T assembly syntax. Some of the basic rules of this syntax are listed below. (The list is by no means complete; I’ve included only those rules pertinent to inline assembly.)

Register naming
Register names are prefixed by %. That is, if eax has to be used, it should be used as %eax.

Source and destination ordering
In any instruction, source comes first and destination follows. This differs from Intel syntax, where source comes after destination.

Continue

This article will describe assembly language programming under Linux. Contained within the bounds of the article is a comparison between Intel and AT&T syntax asm, a guide to using syscalls and a introductory guide to using inline asm in gcc.

This article was written due to the lack of (good) info on this field of programming (inline asm section in particular), in which case i should remind thee that this is not a shellcode writing tutorial because there is no lack of info in this field.

Various parts of this text I have learnt about through experimentation and hence may be prone to error. Should you find any of these errors on my part, do not hesitate to notify me via email and enlighten me on the given issue.

There is only one prerequisite for reading this article, and thats obviously a basic knowledge of x86 assembly language and C.

Continue