# atlas.s

.text # section declaration

# we must export the entry point to the ELF linker or
.global _start # loader. They conventionally recognize _start as their
# entry point. Use ld -e foo to override the default.

_start:

# write our string to stdout

movl $len,%edx # third argument: message length
movl $msg,%ecx # second argument: pointer to message to write
movl $1,%ebx # first argument: file handle (stdout)
movl $4,%eax # system call number (sys_write)
int $0x80 # call kernel

# and exit

movl $0,%ebx # first argument: exit code
movl $1,%eax # system call number (sys_exit)
int $0x80 # call kernel

.data # section declaration

msg:
.ascii "Excerpt: Every man builds his world in his own image,\n\he said. He has the power to choose, but no power\nto escape the necessity of choice. If he abdicates his power,\n\he abdicates the status of man, and the grinding chaos of the\nirrational is what he achieves as his sphere of existence--\nby his own choice.\n" # our dear string
len = . - msg # length of our dear string

# command line to assemble:
# as atlas.s -o atlas.o
# ld atlas.o
# cp a.out /bin/atlas


/*
*banner.c
*/
/*
* B A N N E R
*
* Print a message surrounded by a border. Use
* functions to draw the elements of the border.
*/

#include <stdio.h>

#define WIDTH 72
#define ROWS 4

Line()
{
int x;

for (x = 0; x <= WIDTH; ++x)
putchar('*');
putchar('\n');
}

Sides()
{
int y;

for (y = 0; y <= ROWS; ++y)
printf("*\t\t\t\t\t\t\t\t\t*\n");
}

int main(void){
Line();
Sides();
printf("*\t\t\t (Linux Mint 10!)\t\t\t\t*\n");
Sides();
Line();

// return 0;
}

/* command line to compile:
* gcc banner.c -o banner
* cp banner /bin/banner
*/

stats

Hosted by T35 Free Web HostingFree Domains - Backlink Service - Domain Names - Paid Proxy - Colorado Printing Company - Free file share on Freefilezhare