Skip to content

Commit

Permalink
Added prog/return.l1com
Browse files Browse the repository at this point in the history
  • Loading branch information
koder77 committed Feb 1, 2024
1 parent 4453ad2 commit 0607741
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions prog/return.l1com
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// return.l1com
//Brackets - return
//
#include <intr.l1h>
#include <bool.l1h>
(main func)
#var ~ main

(set int64 1 zero 0)
(set int64 1 x~ 0)
(set bool 1 Bret~)
(set int64 1 f~)
(set string s zerostr~ " is zero")
(set string s notzerostr~ " is not zero")

print_i (x~ )
(x~ :iszero !)
(Bret~ stpopi)
(((Bret~ true ==) f~ =) f~ if+)
print_s (zerostr~)
print_n
(else)
print_s (notzerostr~)
print_n
(endif)
(exit zero)
(funcend)

(iszero func)
#var ~ iszero

(set int64 1 zero~ 0)
(set int64 1 num~ 0)
(set bool 1 Bret~)
(set int64 1 f~ 0)

(num~ stpopi)
(((num~ zero~ ==) f~ =) f~ if+)
(true Bret~ =)
(Bret~ stpushi)
(return)
(else)
(false Bret~ =)
(Bret~ stpushi)
(return)
(endif)
(funcend)

0 comments on commit 0607741

Please sign in to comment.