include print: "./lib/io/print.dsa";
include alloc: "./lib/memory/block_alloc.dsa";

fn main() -> u32 {
	let allocator: u32 = alloc::init(64, 32);
	
	print::print_hex_word(allocator);

	print::print_newline();

	let ptr: u32 = alloc::alloc(allocator);
	print::print_hex_word(ptr);
	*ptr = 200;

	print::print_newline();

	let p2: u32 = alloc::alloc(allocator);
	print::print_hex_word(p2);
	print::print_newline();
	print::print_num(*ptr);

	alloc::free(allocator, &ptr);
	let ptr3: u32 = alloc::alloc(allocator);

	print::print_newline();

	print::print_hex_word(ptr3);

	print::print_newline();
	print::print_hex_word(ptr);

	if ptr == 0 {
		print::print("successful free of ptr");
	}

	return 0;
}