Example #1
0
char ismf(char *a){
  int r=0;
  while(1){
    if(!_PC(strcmp,(farr[r].name,a)))
	    return r;
    r++;
  }
  return -1;
}
Example #2
0
int inList(const char *key,const char **list){
	int r=0;
	while(list[r]!=NULL){
	  if(!_PC(strcmp,(list[r],key)))
		return r;
	  r++;
	}
	return -1;
}
Example #3
0
int option(int c,char **v){
  if(c<2) error("no argument");
  int ch;
  while((ch=_PC(getopt,(c,v,opt)))){
	switch(ch){
	  case 'v':
		  version();break;
	  case 'h': usage();break;
	  default: continue;
	}
  }
}
Example #4
0
	stb		r4,_A(r3)
	stb		r4,_X(r3)
	stb		r4,_Y(r3)
	stw		r4,_CycleBK(r3)
	stw		r4,_IntReq(r3)
	li		r5,R_FLAG|Z_FLAG
	stb		r5,_F(r3)
	li		r6,0xFF
	stb		r6,_SP(r3)

	li		r9,0
	lwz		r7,_MEM_X(r3)				// load PC with reset vector
	ori		r9,r9,RESET_VECTOR
	lwz		r7,ROMSeg4_Ind(r7)
	lhbrx	r8,r9,r7
	sth		r8,_PC(r3)

	blr
}



// -----------------------------------------------------------------------
// This function loops until cycles <= 0.
// Ignores bad opcodes, doesn't return anything.
asm void N6502_Exec()
{
	mflr	r14							// save our calling address
	
entry static __execloop
	subc.	r28,r28,r4					// decrease cycles by r4