view kernelbase.rhope @ 163:9fab36cc706b

Add Raw Size method to blueprint to allow code to query the raw size of a type in bytes
author Mike Pavone <pavone@retrodev.com>
date Sun, 09 Jan 2011 23:03:30 -0500
parents fc3815b7462f
children
line wrap: on
line source


Val[in:out]
{
	out <- in
}

Blueprint Int32
{
	Num(Int32,Naked)
}

If@Int32[num:yes,no]
{
	yes,no <- If[[num]!=[0i32]]
}

Trunc UInt8@UInt8[in:out]
{
	out <- in
}

Blueprint UInt32
{
	Num(UInt32,Naked)
}

If@UInt32[num:yes,no]
{
	yes,no <- If[[num]!=[0u32]]
}

Blueprint UInt8
{
	Num(UInt8,Naked)
}

If@UInt8[num:yes,no]
{
	yes,no <- If[[num]!=[0u8]]
}

Abs@Int32[num:out]
{
	If[[num]<[0i32]]
	{ out <- [0i32]-[num] }
	{ out <- num }
}

Mod[a,b:out]
{
	out <- [a]-[[[a]/[b]]*[b]]
}

And[left,right:out]
{
	,out <- If[left]
	{
		out,out <- If[right]
	}
}

Or[left,right:out]
{
	out <- If[left] {}
	{
		out <- right
	}
}

Min[a,b:out]
{
	If[[a]<[b]]
	{
		out <- a
	}{
		out <- b
	}
}

Max[a,b:out]
{
	If[[a]>[b]]
	{
		out <- a
	}{
		out <- b
	}
}