hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/examples/circle.hdass
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-10-12 11:41:05 +0200
committerhachem <im@hachem.wtf>2026-10-12 11:41:05 +0200
commit62636576bce8e8121a3d70f63547fae40a52f697 (patch)
tree077dfe4f04235cce63b7abb1b05bb539232ae74a /examples/circle.hdass
parentc0f000ea166a24781fcdbf23c080b203cd9b8ed7 (diff)
chore: refactor
Diffstat (limited to 'examples/circle.hdass')
-rw-r--r--examples/circle.hdass12
1 files changed, 5 insertions, 7 deletions
diff --git a/examples/circle.hdass b/examples/circle.hdass
index 8a4edaa..71b204b 100644
--- a/examples/circle.hdass
+++ b/examples/circle.hdass
@@ -1,17 +1,15 @@
[entry: main]
-// Floating-point math on the SSE registers. Computes the area of a circle
-// (pi * r * r) with r = 3, then exits with the truncated result (28).
const SYS_EXIT = 60
proc main
{
- xmm0 = 3.0 // radius
- xmm0 *= xmm0 // r * r = 9.0
- xmm1 = 3.14159 // pi
- xmm0 *= xmm1 // area ~= 28.27
+ xmm0 = 3.0 // radius
+ xmm0 *= xmm0 // r * r = 9.0
+ xmm1 = 3.14159 // pi
+ xmm0 *= xmm1 // area ~= 28.27
- rdi = xmm0 // truncate to int -> 28
+ rdi = xmm0 // truncate
rax = SYS_EXIT
syscall
}