Skip to content
Browse files

sugar.asm provides some nice macros, pop(), push(), peek(), return()

  • Loading branch information...
1 parent e575a8c commit d87f8a4dd1b09da02f8d1219db6c93a3fd4ecbc0 @dankuck committed May 17, 2012
Showing with 27 additions and 0 deletions.
  1. +27 −0 lib/sugar.asm
View
27 lib/sugar.asm
@@ -0,0 +1,27 @@
+; Syntactic sugar
+;
+; Would you rather say pop(X) than SET X, POP?
+; This is what you want.
+;
+; Author: while1dan
+
+
+.ifndef pop
+.macro pop(target){
+ SET target, POP
+}
+.end
+
+
+.ifndef push
+.macro push(target){
+ SET PUSH, target
+}
+.end
+
+
+.ifndef return
+.macro return(){
+ SET PC, POP
+}
+.end

0 comments on commit d87f8a4

Please sign in to comment.
Something went wrong with that request. Please try again.