From 943d5f0ced11a60d7fff825107f94e53c946813f Mon Sep 17 00:00:00 2001 From: Michael McLoughlin Date: Fri, 11 Jan 2019 11:06:10 -0800 Subject: [PATCH] examples/sum: attempt to avoid asmfmt mismatch Updates #41 Updates #8 --- README.md | 8 ++++---- examples/sum/README.md | 4 ++-- examples/sum/asm.go | 4 ++-- examples/sum/sum.s | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 8aa2536..49a5feb 100644 --- a/README.md +++ b/README.md @@ -106,8 +106,8 @@ func main() { s := GP64() XORQ(s, s) - Comment("Loop until zero bytes remain.") Label("loop") + Comment("Loop until zero bytes remain.") CMPQ(n, Imm(0)) JE(LabelRef("done")) @@ -119,8 +119,8 @@ func main() { DECQ(n) JMP(LabelRef("loop")) - Comment("Store sum to return value.") Label("done") + Comment("Store sum to return value.") Store(s, ReturnIndex(0)) RET() Generate() @@ -143,8 +143,8 @@ TEXT ·Sum(SB), NOSPLIT, $0-32 // Initialize sum register to zero. XORQ DX, DX - // Loop until zero bytes remain. loop: + // Loop until zero bytes remain. CMPQ CX, $0x00 JE done @@ -156,8 +156,8 @@ loop: DECQ CX JMP loop - // Store sum to return value. done: + // Store sum to return value. MOVQ DX, ret+24(FP) RET ``` diff --git a/examples/sum/README.md b/examples/sum/README.md index 0c554b3..870126d 100644 --- a/examples/sum/README.md +++ b/examples/sum/README.md @@ -14,8 +14,8 @@ func main() { s := GP64() XORQ(s, s) - Comment("Loop until zero bytes remain.") Label("loop") + Comment("Loop until zero bytes remain.") CMPQ(n, Imm(0)) JE(LabelRef("done")) @@ -27,8 +27,8 @@ func main() { DECQ(n) JMP(LabelRef("loop")) - Comment("Store sum to return value.") Label("done") + Comment("Store sum to return value.") Store(s, ReturnIndex(0)) RET() Generate() diff --git a/examples/sum/asm.go b/examples/sum/asm.go index e8e8c4c..1cc332d 100644 --- a/examples/sum/asm.go +++ b/examples/sum/asm.go @@ -17,8 +17,8 @@ func main() { s := GP64() XORQ(s, s) - Comment("Loop until zero bytes remain.") Label("loop") + Comment("Loop until zero bytes remain.") CMPQ(n, Imm(0)) JE(LabelRef("done")) @@ -30,8 +30,8 @@ func main() { DECQ(n) JMP(LabelRef("loop")) - Comment("Store sum to return value.") Label("done") + Comment("Store sum to return value.") Store(s, ReturnIndex(0)) RET() Generate() diff --git a/examples/sum/sum.s b/examples/sum/sum.s index 61ca50b..94cec5b 100644 --- a/examples/sum/sum.s +++ b/examples/sum/sum.s @@ -10,8 +10,8 @@ TEXT ·Sum(SB), NOSPLIT, $0-32 // Initialize sum register to zero. XORQ DX, DX - // Loop until zero bytes remain. loop: + // Loop until zero bytes remain. CMPQ CX, $0x00 JE done @@ -23,7 +23,7 @@ loop: DECQ CX JMP loop - // Store sum to return value. done: + // Store sum to return value. MOVQ DX, ret+24(FP) RET