Repository navigation
Expand file tree
/
Copy pathAM_function.asm
More file actions
75 lines (65 loc) · 1.51 KB
/
Copy pathAM_function.asm
File metadata and controls
75 lines (65 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.code
am proc
; --- Synchronization of Base Memory Array Addresses Passed from Main ---
mov esi, dword ptr[file_ptr]
xor eax,eax
xor ecx,ecx
; --- ASCII-to-Decimal Sanitizing Pipeline with Exception Filtering ---
looper:
mov al, byte ptr[esi]
inc esi
cmp al,20h
je adder
imul ecx,10
add cl,al
sub cl, 30h
dec ebx
cmp ebx,0
je ender
jmp looper
; --- Accumulation Block (Aggregates 10,000 integers into a 64-bit buffer to prevent overflow) ---
adder:
add dword ptr [buffer],ecx
adc dword ptr [buffer+4],0
xor ecx,ecx
inc [counter]
cmp [counter], 10000
je adder2
jmp looper
; --- Local Batch Slicing Execution Path (Computes intermediate mean for the 10,000 element window) ---
adder2:
push eax
push ebx
mov eax, dword ptr [buffer]
mov ebx, dword ptr [counter]
xor edx,edx
div ebx
jmp final
; --- Stack Epilogue: Restoring Saved Context & Resetting Batch Window State ---
poper:
pop ebx
pop eax
mov [counter],0
jmp looper
; --- Cumulative Arithmetic Mean Node Splicing (Tracks the count of intermediate results) ---
final:
inc [counter2]
add dword ptr[finresult],eax
jmp poper
; --- Final Mathematical Reduction (Merges dynamic sub-averages into the global arithmetic mean) ---
ender:
push eax
push ebx
mov eax, dword ptr[buffer]
mov ebx, dword ptr [counter]
xor edx,edx
div ebx
inc [counter2]
pop ebx
pop eax
mov ebx, dword ptr [counter2]
mov eax, dword ptr[finresult]
xor edx,edx
div ebx
ret
am endp