repos / gbc

GBC - Go B Compiler
git clone https://github.com/xplshn/gbc.git

gbc / tests
xplshn  ·  2025-08-13

deref_assign.b

B
 1main() {
 2    extrn printf, malloc;
 3    auto v;
 4    v = malloc(8);
 5
 6    *v =   1;    printf("*v =   1    v=%d\n", *v);
 7    *v |=  16;   printf("*v |=  16   v=%d\n", *v);
 8    *v *=  2;    printf("*v *=  2    v=%d\n", *v);
 9    *v +=  35;   printf("*v +=  35   v=%d\n", *v);
10    *v <<= 1;    printf("*v <<= 1    v=%d\n", *v);
11    *v &=  127;  printf("*v &=  127  v=%d\n", *v);
12}