Skip to content

Commit

Permalink
Changed most of the comments in example/snippet code to use superior …
Browse files Browse the repository at this point in the history
…C-style comments.
  • Loading branch information
calculuswhiz committed Jan 25, 2016
1 parent 2354bfe commit 7f1d441
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
3 changes: 2 additions & 1 deletion snippets/skel32.sublime-snippet
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<snippet>
<content><![CDATA[
// Compiles with `gcc -nostdlib`. On 64-bit machines, use the `-m32` flag also.
#define SYS_EXIT \$1
.global _start
Expand All @@ -10,7 +11,7 @@ _start:
exit:
movl SYS_EXIT, %eax
xorl %ebx, %ebx # The exit code.
xorl %ebx, %ebx // The exit code.
int \$0x80
.data
Expand Down
3 changes: 2 additions & 1 deletion snippets/skel64.sublime-snippet
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<snippet>
<content><![CDATA[
// Compiles with `gcc -nostdlib`
#define SYS_EXIT \$60
.global _start
Expand All @@ -10,7 +11,7 @@ _start:
exit:
movq SYS_EXIT, %rax
xorq %rdi, %rdi # The exit code.
xorq %rdi, %rdi // The exit code.
syscall
.data
Expand Down
4 changes: 2 additions & 2 deletions test/stdinTest.S
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ print:
movq SYS_WRITE, %rax
movq STDOUT, %rdi
movq $message, %rsi
movzx len, %rdx # Intro+echo
movzx len, %rdx // Intro+echo
addq $27, %rdx
syscall


exit:
movq SYS_EXIT, %rax
xorq %rdi, %rdi # The exit code.
xorq %rdi, %rdi // The exit code.
syscall

.data
Expand Down
13 changes: 7 additions & 6 deletions test/stdoutTest.S
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@
.text

_start:
movq $message, %rsi # char *
movb -2(%rsi,1), %cl # Just trying something out.
movq $message, %rsi // char *
movb -2(%rsi,1), %cl // Just trying something out.
incLoop:
movb %cl, 7(%rsi,1) # Position in string
movb %cl, 7(%rsi,1) // Position in string
movq SYS_WRITE, %rax
movq STDOUT, %rdi
movq len, %rdx # number of bytes
movb %cl, letter // comment test
movq len, %rdx // number of bytes
movb %cl, letter # <- Yes, these still work. But now that
## you know //'s work, why would you want to?
syscall
movb letter, %cl

Expand All @@ -27,7 +28,7 @@ incLoop:
jg incLoop

movq SYS_EXIT, %rax
xorq %rdi, %rdi # The exit code.
xorq %rdi, %rdi // The exit code.
syscall

.data
Expand Down
2 changes: 1 addition & 1 deletion test/sxTest.sx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ _start:

exit:
movq SYS_EXIT, %rax
xorq %rdi, %rdi # The exit code.
xorq %rdi, %rdi // The exit code.
syscall

.data
Expand Down

0 comments on commit 7f1d441

Please sign in to comment.