Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

dpoke.c

Go to the documentation of this file.
00001 
00002 #include <stdio.h>
00003 #include <stdlib.h>
00004 #include <signal.h>
00005 #include "pmac.h"
00006 
00007 static int done = 0;
00008 
00009 void handler(int sig)
00010 {
00011   done = 1;
00012 }
00013 
00014 int main(int argc, char **argv)
00015 {
00016   int n;
00017   int value;
00018   static char syntax[] = "syntax:  %s <index> <value>\n";
00019 
00020   /* get DP RAM */
00021   pmac_init();
00022 
00023   if (argc != 3)
00024   {
00025     printf(syntax, argv[0]);
00026     exit(1);
00027   }
00028 
00029   if (sscanf(argv[1], "%d", &n) != 1)
00030   {
00031     printf(syntax, argv[0]);
00032     exit(1);
00033   }
00034 
00035   if (sscanf(argv[2], "%x", &value) != 1)
00036   {
00037     printf(syntax, argv[0]);
00038     exit(1);
00039   }
00040 
00041   write_pmac_uint32(n, value);
00042 
00043   pmac_exit();
00044 
00045   exit(0);
00046 }

Generated on Sun Dec 2 15:56:49 2001 for rcslib by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001