/* Author: Jose Romeo Vela Date: March 24, 2002 email: jrvela@aristasol.com http://www.aristasol.com/ This software is licensed under GNU's GPL. For details see http://www.gnu.org/ Copyright (c) 2002, Jose Romeo Vela ============================================================================== Modifications: 4/13/2002 jrv Added comments to the code */ #include "config.h" int cinc_init_hw(struct cardiac_s * cardiac) { int rc = 0; int i; cardiac->running=FALSE; cardiac->dump=FALSE; cardiac->IN=NULL; cardiac->OUT=NULL; /* set ACCUMULATOR to 0 */ cardiac->ac=0; /* set ACCUMULATOR sign to positive */ cardiac->ac_sign=1; /* Initilaize memory cells to 000 */ for (i=0;iram[i]=0; } /* Memory cell 0 allwas has a hardwired 001 */ cardiac->ram[0]=001; /* The last memory cell allways has a hardwired opcode of 8 */ cardiac->ram[MAXRAM-1]=800; /* Program counter points to memory cell 0 */ cardiac->pc =0; /* The instruction register (opcode+address) is set to instructin HRS. This is not strictly necessary but it is better to have initialized variables. */ cardiac->opcode = 9; cardiac->address = 0; return(rc); }