gitweb on Svarog

projekti pod git sistemom za održavanje verzija -- projects under the git version control system
version 0.81
[asm2wsl.git] / samples / gcd-predef.asm
diff --git a/samples/gcd-predef.asm b/samples/gcd-predef.asm
new file mode 100644 (file)
index 0000000..b61b2eb
--- /dev/null
@@ -0,0 +1,31 @@
+.model      small\r
+data segment\r
+  strNZD db "        "\r
+data ends\r
+;#macros-removed-from-listing
+\r
+.code      \r
+\r
+start:\r
+            mov   ax,12\r
+            mov   bx,8\r
+\r
+compare:    \r
+            cmp   ax,bx\r
+            je    exit ;exit since they're equal\r
+            ja    greater\r
+            sub   bx,ax\r
+            jmp   compare\r
+\r
+greater:\r
+            sub   ax,bx\r
+            jmp   compare\r
+\r
+exit:\r
+;exit out of the program\r
+       print_num ax\r
+; print out a result\r
+            end_execution\r
+\r
+.stack\r
+end start\r
Svarog.pmf.uns.ac.rs/gitweb maintanance Doni Pracner