示例#1
0
void monitor_memory(unsigned int start, unsigned int count){
  unsigned int i=0;
  int pc_adr = 256 * conv_addr2int(pch) + conv_addr2int(pcl);;
  mvprintw(mem_row-1, mem_col, "mem adr.  binary ");
  for(i=0; i < count ; i++) 
	if( start+i == pc_adr )
	  mvprintw(mem_row+i, mem_col-5, "pc-->%04x   %s ", start+i, memory[start+i]);
	else
	  mvprintw(mem_row+i, mem_col, "%04x   %s ", start+i, memory[start+i]);
}
示例#2
0
/*
  memory_read: copy content of memoryaddress in addressbus register <abr> into
  databus register dbr
*/
void memory_read() {
    int rnd;
    int i;
    char dummy[2*REG_WIDTH+1];

    // zero page hack
    // 0xfe is random number
    rnd = rand()%REG_WIDTH;
    number2register(rnd,memory[0x00fe]);
    // 0xff is char from keyboard
    number2register(keyboardchar,memory[0x00ff]);

    cp_adr2mem( BREAK_IRQ_HANDLER , BREAK );
    cp_adr2mem(NMI_IRQ_HANDLER,NMI);
    cp_adr2mem(RESET_IRQ_HANDLER,RESET);

    for(i=0; i<REG_WIDTH; i++) {
        dummy[i]=abrh[i];
        dummy[i+REG_WIDTH]=abrl[i];
    }
    dummy[2*REG_WIDTH]='\0';



    int  startaddr = conv_addr2int(dummy);
    cp_memory2dbr(startaddr, dbr);

}
示例#3
0
void monitor_stack(unsigned int size){
  unsigned int i=0;
  int sp_adr = conv_addr2int(sp);
  int start = sp_adr - size/2;
  start = start<0?0:start;
  mvprintw(stack_row-1, stack_col, "stack adr.  binary ");
  for(i=0; i < size ; i++) 
	if( start+i == sp_adr )
	  mvprintw(stack_row+i, stack_col-5, "sp-->%04x   %s ", start+i, memory[start+i]);
	else
	  mvprintw(stack_row+i, stack_col, "%04x   %s ", start+i, memory[start+i]);
}
示例#4
0
/*
  memory_write: copy content of databus_register into content of
  memoryaddress <addressbus_register>
*/
void memory_write() {
    char dummy[2*REG_WIDTH+1];
    int i;
    for(i=0; i<REG_WIDTH; i++) {
        dummy[i]=abrh[i];
        dummy[i+REG_WIDTH]=abrl[i];
    }
    dummy[2*REG_WIDTH]='\0';

    int  startaddr = conv_addr2int(dummy);

    cp_dbr2memory(startaddr,dbr);
}