-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestMacros.asm
More file actions
62 lines (55 loc) · 1.93 KB
/
testMacros.asm
File metadata and controls
62 lines (55 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
%include "map.inc"
%include "macros.inc"
%include "std/filesystem.asm" ; filesystem class!
new string, outside, "This variable is defined outside any section", newline
new string, example, "print ", doublequote, "yay newlines with escapes \\n", doublequote
class cats
value cats.calico, "A calico cat is a domestic cat with a coat that is typically three colors: white, black, and orange.\n"
value cats.siamese, "A Siamese cat is a breed of domestic cat that is known for its striking blue almond-shaped eyes and short coat with color points on the ears, face, paws, and tail.\n"
value cats.persian, "A Persian cat is a long-haired breed of cat characterized by its round face, short muzzle, and long, flowing coat.\n"
value cats.tabby, "tabby kittie is sillie kitty :3\n"
method cats, grey, static
print cats.calico
end
method cats, all, static
; print cats.calico
print cats.siamese
print cats.persian
print cats.tabby
end
func printHello
while meow, <, 5
print "hi\n"
break meow
print "outside the break\n"
end while, meow
print "outside while loop\n"
for hello, 5
mod helloMod, hello, 5
if helloMod, ==, 0
print "yes five\n"
endif helloMod, 0
end for, hello
end
func main
print "Code ran: \n", example, newline, newline
call printHello
run cats.grey
run cats.all
print "Called cat.grey function CLASSES YIPPIEEE\n"
print "Output: \n"
print "yay newlines with escapes \n"
print outside
new string, inside, "This variable was defined inside _start (.text) section :)", NEWLINE
print inside
print "Filesystem test: \n"
run filesystem.getCwd
print "Current working directory: "
printC cwd
new dword, firstArg, 0
argv firstArg, 1
print "First argument: "
printC firstArg
new int, exitStatus, 0
random exitStatus, 1
exit exitStatus