fn rsSaveM(token_top: u64, token_bottom: u64, nrRegs: u64, sp1: u64) -> u64 {
	// ymh_log_str("Save \0");
	/*ymh_log_hex(token_top);
	ymh_log_hex(token_bottom);
	ymh_log_dec(nrRegs);*/
	// ymh_log_hex(sp1);
	// loop {}
	let id1: u64;
	let id2: u64;
	GET_PROCID!(id1);
	GET_THREADID!(id2);

	let mut storage = key_values::new(id1, id2, token_top, token_bottom);
	for i in 0..nrRegs as u32{
		/*let regNo = 15-i;
		let regVal = getX(sp1, regNo);
		ymh_log_str("Save X\0");
		ymh_log_dec(regNo as u64);
		ymh_log_str(":\0");
		ymh_log_hex(regVal);
		ymh_log_nl();*/
		
		addRegNoVal(&mut storage, 15-i, getX(sp1, 15-i));
	}

	// we don't need a new scope to drop the lock
	// because we're going to return soon.
	let mut lock = G_SS_STORAGE.lock();
	if let Some(ref mut v) = *lock {
		v.push(storage);
	} else {
		ymh_log_str("ERROR MUST NOT HAPPEN - G_SS_STORAGE is NONE\n\0");
		loop{}
	}

	// ymh_log_str("saveRETURNING...\n\0");
	0
}
/*
 * rsSaveM() does NOT clean old reg
 * used for debugging functions
 */
rsSaveM() does NOT clean old reg
used for debugging functions
rsSaveM () does NOT clean old reg used for debugging functions
fn rsSaveM(token_top: u64, token_bottom: u64, nrRegs: u64, sp1: u64) -> u64 {
	// ymh_log_str("Save \0");
	/*ymh_log_hex(token_top);
	ymh_log_hex(token_bottom);
	ymh_log_dec(nrRegs);*/
	// ymh_log_hex(sp1);
	// loop {}
	let id1: u64;
	let id2: u64;
	GET_PROCID!(id1);
	GET_THREADID!(id2);
	let mut storage = key_values::new(id1, id2, token_top, token_bottom);
	for i in 0..nrRegs as u32{
		/*let regNo = 15-i;
		let regVal = getX(sp1, regNo);
		ymh_log_str("Save X\0");
		ymh_log_dec(regNo as u64);
		ymh_log_str(":\0");
		ymh_log_hex(regVal);
		ymh_log_nl();*/
		addRegNoVal(&mut storage, 15-i, getX(sp1, 15-i));
	}
	// we don't need a new scope to drop the lock
	// because we're going to return soon.
	let mut lock = G_SS_STORAGE.lock();
	if let Some(ref mut v) = *lock {
		v.push(storage);
	} else {
		ymh_log_str("ERROR MUST NOT HAPPEN - G_SS_STORAGE is NONE\n\0");
		loop{}
	}
	// ymh_log_str("saveRETURNING...\n\0");
	0
}
fn rsSaveM ( token_top : u64 , token_bottom : u64 , nrRegs : u64 , sp1 : u64 ) -> u64 { // ymh_log_str("Save \0"); /*ymh_log_hex(token_top);
	ymh_log_hex(token_bottom);
	ymh_log_dec(nrRegs);*/ // ymh_log_hex(sp1); // loop {} let id1 : u64 ; let id2 : u64 ; GET_PROCID ! ( id1 ) ; GET_THREADID ! ( id2 ) ; let mut storage = key_values :: new ( id1 , id2 , token_top , token_bottom ) ; for i in 0 .. nrRegs as u32 { /*let regNo = 15-i;
		let regVal = getX(sp1, regNo);
		ymh_log_str("Save X\0");
		ymh_log_dec(regNo as u64);
		ymh_log_str(":\0");
		ymh_log_hex(regVal);
		ymh_log_nl();*/ addRegNoVal ( & mut storage , 15 - i , getX ( sp1 , 15 - i ) ) ; } // we don't need a new scope to drop the lock // because we're going to return soon. let mut lock = G_SS_STORAGE . lock ( ) ; if let Some ( ref mut v ) = * lock { v . push ( storage ) ; } else { ymh_log_str ( " \n \0 " ) ; loop { } } // ymh_log_str("saveRETURNING...\n\0"); 0 }
rsSaveM() does NOT clean old reg
 used for debugging functions
rsSaveM () does NOT clean old reg used for debugging functions
token_top
u64
token_bottom
u64
nrRegs
u64
sp1
u64
token_top
u64
token_bottom
u64
nrRegs
u64
sp1
u64