PageRenderTime 29ms CodeModel.GetById 27ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 1ms

/asm/sort/sort.s

http://github.com/dennis-gemini/tests
Assembly | 35 lines | 29 code | 6 blank | 0 comment | 0 complexity | c0d4b341559e77da3fb0c9ce99150c87 MD5 | raw file
 1
 2.section .data
 3values:
 4	.int 105, 235, 61, 315, 134, 221, 53, 145, 117, 5
 5
 6.section .text
 7.globl _start
 8
 9_start:
10	nop
11	movl $values, %esi
12	movl $9, %ecx
13	movl $9, %ebx
14
15loop:
16	movl (%esi), %eax
17	cmp %eax, 4(%esi)
18	jge skip
19	xchg %eax, 4(%esi)
20	movl %eax, (%esi)
21
22skip:
23	add $4, %esi
24	dec %ebx
25	jnz loop
26	dec %ecx
27	jz end
28	movl $values, %esi
29	movl %ecx, %ebx
30	jmp loop
31end:
32	movl $1, %eax
33	movl $0, %ebx
34	int $0x80
35