diff options
author | Pixel <Pixel> | 2002-05-25 05:35:07 +0000 |
---|---|---|
committer | Pixel <Pixel> | 2002-05-25 05:35:07 +0000 |
commit | c19473a09f0e7a0262a603faee0b0e50654c0bae (patch) | |
tree | 6ee80c696cd302d03b37a816915051b08f15c4a4 /dte-asm.S | |
parent | 28374301bfd1f96490c1906cd239be05af062953 (diff) |
Welcome to the DTE thing.
Diffstat (limited to 'dte-asm.S')
-rw-r--r-- | dte-asm.S | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/dte-asm.S b/dte-asm.S new file mode 100644 index 0000000..7fc9563 --- /dev/null +++ b/dte-asm.S @@ -0,0 +1,70 @@ +.text +.align 4 + +.global dte_reset +.type dte_reset, @function + +dte_reset: + push %ecx + push %edi + movl $0x10000, %ecx + movl $dte_counters, %edi + xorl %eax, %eax + rep stosl + movl %eax, dte_counter + movl %eax, dte_most + pop %edi + pop %ecx + ret + +.global build_dte +.type build_dte, @function + +build_dte: + push %eax + push %ebx + push %ecx + push %edx + push %esi + push %edi + movl dte_text_size, %ecx + movl dte_text, %esi + movl $dte_flags, %edi + movl $dte_counters, %ebx + + + lodsl + movl %eax, %edx + + jmp innerjump + +loop: + lodsb + shrd $8, %eax, %edx + +innerjump: + push %edx + + andl $0xffff, %edx + testb $0xff, (%edi, %edx) + jnz invalid + incl (%ebx, %edx, 4) + movl (%ebx, %edx, 4), %eax + cmpl %eax, dte_counter + ja invalid + movl %edx, dte_most + movl %eax, dte_counter + +invalid: + pop %edx + + decl %ecx + jnz loop + + pop %edi + pop %esi + pop %edx + pop %ecx + pop %ebx + pop %eax + ret |