All pastes #984850 Raw Edit

Untitled

public text v1 · immutable
·published 2008-04-14 16:43 UTC
rendered paste body
class PtrTest {
	unsafe static byte *PutChar(char ch, byte *ptr) {
		*ptr = (byte) ch;
		ptr++;
		*ptr = 0x0F;
		ptr++;
		return ptr;
	}
	
	unsafe static public void Main() {
		byte *ptr = (byte *) 0xB8000U;
		ptr = PutChar('H', ptr);
		ptr = PutChar('e', ptr);
		ptr = PutChar('l', ptr);
		ptr = PutChar('l', ptr);
		ptr = PutChar('o', ptr);
		ptr = PutChar(' ', ptr);
		ptr = PutChar('W', ptr);
		ptr = PutChar('o', ptr);
		ptr = PutChar('r', ptr);
		ptr = PutChar('l', ptr);
		ptr = PutChar('d', ptr);
		
		while(true) {}
	}
}