program PointerBasic {
section module {
}
section data {
int rax = 0
int rbx = 0
int rdx = 0
string str_0 = "pointer disposed and set to nil"
string fmt_int = "%lld "
string fmt_str = "%s "
string newline = "\n"
ptr p = null
int x = 0
}
section code {
start:
alloc p, 8, 1
free p
store 100, p, 0, 1
load rbx, p, 0, 1
mov x, rbx
add x, 50
load rdx, p, 0, 1
print fmt_int, rdx
print newline
print fmt_int, x
print newline
free p
mov p, 0
print fmt_str, str_0
print newline
done
}
}