diff options
Diffstat (limited to 'examples/factorial.asm')
-rw-r--r-- | examples/factorial.asm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/factorial.asm b/examples/factorial.asm index 76e80b5..021360b 100644 --- a/examples/factorial.asm +++ b/examples/factorial.asm @@ -1,6 +1,8 @@ ;;; factorial.asm: A program that generates the factorials of each ;;; number from 1 to 24 (24!~=UINT64_MAX). Using the registers to ;;; store `n` and `n!`. + ;; Constants + %const(limit) 22 %end ;; Setup entrypoint global main @@ -38,7 +40,7 @@ loopback: mult.word mov.word 1 - push.word 24 + push.word $limit push.reg.word 0 gte.word ;; Jump to `loopback` |