//------------------------------------------------------------------- // mywrite.c // // This program shows that we don't need to include the usual // header-files if we will provide the information that the C // compiler needs in order to know how to generate the proper // machine-instructions for our calls to the standard library // functions that we are using (i.e., write() and exit() ). // // compile using: $ gcc mywrite.c -o mywrite // execute using: $ ./mywrite // // ---------------------------------------------------------- // NOTE: If you want to see the actual assembly language code // that the compiler generates for this program, you can use // // compile-to-assembler: $ gcc -S mywrite.c // // Then find assembly output in a textfile named 'mywrite.s'. // ---------------------------------------------------------- // // programmer: ALLAN CRUSE // date begun: 31 AUG 2004 //------------------------------------------------------------------- extern int write( int, char *, unsigned int ); extern void exit( int ); char message[] = "Hello!\n"; int main( void ) { write( 1, message, 7 ); exit( 0 ); }