diff --git a/src/ibranch.gdb b/src/ibranch.gdb new file mode 100644 index 0000000..9820885 --- /dev/null +++ b/src/ibranch.gdb @@ -0,0 +1,2 @@ +c +info registers r0 r1 r2 r3 diff --git a/src/ibranch.log b/src/ibranch.log new file mode 100644 index 0000000..f141c5d --- /dev/null +++ b/src/ibranch.log @@ -0,0 +1,9 @@ +Breakpoint 1 at 0x10078 +Breakpoint 2 at 0x100c8 +0x0000000000010078 in _start () + +Breakpoint 2, 0x00000000000100c8 in _stop () +r0 <00> 0x0 0 +r1 <00> 0x1 1 +r2 <00> 0x2 2 +r3 <00> 0x3 3 diff --git a/src/ibranch.s b/src/ibranch.s new file mode 100644 index 0000000..6f6ea86 --- /dev/null +++ b/src/ibranch.s @@ -0,0 +1,30 @@ +.global _start +.global _stop + +_start: +{ + ibranch 3f +} +0: +{ + addd %r0, 1, %r1 + ibranch 2f +} +1: +{ + addd %r2, 1, %r3 + ibranch _stop +} +2: +{ + addd %r1, 1, %r2 + ibranch 1b +} +3: +{ + addd 0, 0, %r0 + ibranch 0b +} + +_stop: + udivs 0, 0, %empty