Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- macro putc
- 1 swap 1 swap 1 4 syscall
- mem 100000 + 10 mPush
- 1 1 mem 100000 + 1 4 syscall
- macroEnd
- macro endl
- mem 100000 + 10 mPush
- 1 1 mem 100000 + 1 4 syscall
- macroEnd
- macro take
- mem + mLoad
- macroEnd
- macro put
- swap mem + swap mPush
- macroEnd
- macro =+
- dup take 1 + put
- macroEnd
- macro =-
- dup take 1 - put
- macroEnd
- macro strlen
- mem 0 mPush
- 0 while dup 0 == :
- over
- mem mLoad
- swap over
- + mLoad
- if 0 !=
- : 1 +
- else
- : swap 1 + swap
- end
- mem swap mPush
- end drop
- drop
- mem mLoad
- macroEnd
- macro puts
- 1 1 2 overm dup strlen 4 syscall endl
- drop
- macroEnd
- macro StoreStrPointer
- 64000 swap put
- 64000 take 1 + while dup 64000 take 9 + < :
- dup mem + 2 overm 100 % mPush
- swap 100 //
- swap
- 1 +
- end drop
- 1 while dup 9 < :
- dup mem + mLoad drop
- 1 +
- end drop
- macroEnd
- "hello" 100 StoreStrPointer
- macro loadStrPointer
- mem 108 + mLoad + 100 *
- mem 107 + mLoad + 100 *
- mem 106 + mLoad + 100 *
- mem 105 + mLoad + 100 *
- mem 104 + mLoad + 100 *
- mem 103 + mLoad + 100 *
- mem 102 + mLoad + 100 *
- mem 101 + mLoad +
- 10 cDebug 10 cDebug
- macroEnd
- macro printStrPointer
- mem 108 + mLoad + 100 *
- mem 107 + mLoad + 100 *
- mem 106 + mLoad + 100 *
- mem 105 + mLoad + 100 *
- mem 104 + mLoad + 100 *
- mem 103 + mLoad + 100 *
- mem 102 + mLoad + 100 *
- mem 101 + mLoad +
- 10 cDebug dup iDebug 10 cDebug puts
- macroEnd
- loadStrPointer
- macro IsCharEqual
- over over mLoad swap mLoad ==
- macroEnd
- macro ContainsChar
- mLoad 11 swap put
- dup strlen 12 swap put
- while 12 take 0 > :
- if dup mLoad 11 take == :
- 1 iDebug 10 cDebug
- end
- 1 +
- 12 =-
- end
- macroEnd
- "fasdueqhfaw" "q" ContainsChar
- macro CountChar
- mLoad 11 swap put
- dup strlen 12 swap put
- 13 0 put
- while 12 take 0 > :
- if dup mLoad 11 take == :
- 13 =+
- end
- 1 +
- 12 =-
- end
- 13 take
- macroEnd
- "ashduhifhiush" "h" CountChar iDebug 10 cDebug
Advertisement
Add Comment
Please, Sign In to add comment