home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga 13 / MA_Cover_13.bin / source / c / stefanb_src / private_projects / mmureset / readks.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-09-06  |  471 b   |  33 lines

  1. #include <fcntl.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. int main(int argc, char *argv[])
  6. {
  7.  int fd;
  8.  void (*f)(void)= (void *) 0x7fff008;
  9.  
  10.  if (argc<2) {
  11.   fprintf(stderr,"wrong args!\n");
  12.   exit(20);
  13.  }
  14.  
  15.  if (!(fd=open(argv[1],O_RDONLY))) {
  16.   fprintf(stderr,"no file!\n");
  17.   exit(20);
  18.  }
  19.  
  20.  if (read(fd,(char *) 0x7f80000,0x80000)<0x80000) {
  21.   fprintf(stderr,"read error!\n");
  22.   close(fd);
  23.   exit(20);
  24.  }
  25.  
  26.  read(fd,(char *) 0x7fff000,0xA00);
  27.  
  28.  (*f)();
  29.  
  30.  return(0);
  31. }
  32.  
  33.