Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Filip Kokosiński <[email protected]>
  • Loading branch information
fkokosinski committed Jun 13, 2024
1 parent e1ed6df commit ef8a8e3
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
1 change: 1 addition & 0 deletions c-test-arith/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../common/common.mk
33 changes: 33 additions & 0 deletions c-test-arith/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
static void putc(int);

int x;
int y;
int z;

void _start(void)
{
/* TODO: handle sp/fp init better -- separate crt0.S? */
asm ("law 03000");
asm ("dac 209");
asm ("law 04000");
asm ("dac 208");

x = 21;
y = 37;

z = x << 3;
if (z == 168)
putc(027);

z = y >> 3;
if (z == 4)
putc(027);

asm ("hlt");
__builtin_unreachable();
}

static void putc(int c) {
asm ("lio %0" : : "r"(c));
asm ("tyo");
}
2 changes: 1 addition & 1 deletion pdp1-gcc

0 comments on commit ef8a8e3

Please sign in to comment.