examples/complex: and bugfixes

This commit is contained in:
Michael McLoughlin
2018-12-12 00:02:22 -08:00
parent 2189d38d1e
commit b89d211ff4
12 changed files with 179 additions and 34 deletions

View File

@@ -4,15 +4,15 @@
// func Sum(xs []uint64) uint64
TEXT ·Sum(SB),0,$0-32
MOVQ xs_base(FP), DX
MOVQ xs_len+8(FP), CX
XORQ AX, AX
MOVQ xs_len+8(FP), AX
XORQ CX, CX
loop:
CMPQ CX, $0x0
CMPQ AX, $0x0
JE done
ADDQ (DX), AX
ADDQ (DX), CX
ADDQ $0x8, DX
DECQ CX
DECQ AX
JMP loop
done:
MOVQ AX, ret+24(FP)
MOVQ CX, ret+24(FP)
RET