Esempio n. 1
0
int get_word(u16 segment, u16 offset){
	u16 word;
	setds(segment);
	word = *(u16 *)offset;
	setds(MTXSEG);
	return word;
}
Esempio n. 2
0
u8 get_byte(u16 segment, u16 offset){
 	 u8 byte;
 	 setds(segment);
 	 byte = *(u8 *)offset;
 	 setds(MTXSEG);
 	 return byte;
}
Esempio n. 3
0
int put_byte(u8 byte, u16 segment, u16 offset)
{
  setds(segment);
  *(u8 *)offset = byte;
  setds(OSSEG);
  return byte;
}
Esempio n. 4
0
// WRITE YOUR OWN put_word, which writes a WORD
int put_word(u16 word, u16 segment, u16 offset)
{
	// Usage:
	// put_word(4, p->uss, p->usp+(2*9));
	// ** It's always times 2 of the amount of indexes.
	setds(segment);
	*(u16 *)offset = word;
	setds(MTXSEG);

	
}
Esempio n. 5
0
// WRITE YOUR OWN get_word, which gets a WORD
int get_word(u16 segment, u16 offset)
{
	u16 word;
	setds(segment);
	word = *(u16 *)offset;
	setds(MTXSEG);
	return word;

	// // bit shift high << 8
	// u8 high, low;
	// setds(segment);
	// high = *(u8 *)(offset >> 8);
	// low = *(u8 *)(offset);
	// setds(MTXSEG);
	// return (high << 8) + low;
}
Esempio n. 6
0
int put_byte(u8 byte, u16 segment, u16 offset)
{
	setds(segment);
	*(u8 *)offset = byte;
	setds(MTXSEG);
}
Esempio n. 7
0
int put_word(u16 word, u16 segment, u16 offset){
	setds(segment);
	*(u16 *)offset = word;
	setds(MTXSEG);
}