source: abuse/branches/pd/abuse/src/putline.asm @ 636

Last change on this file since 636 was 49, checked in by Sam Hocevar, 15 years ago
  • Imported original public domain release, for future reference.
File size: 1.1 KB
Line 
1
2        .386
3        .MODEL  small
4
5.code
6
7; parm1 = scrn addr
8; parm2 = remap addr
9; parm3 = scrwidth
10
11ALIGN 16
12PUBLIC  remap_line_asm_
13remap_line_asm_:
14
15        push    ebp
16        push    esi
17        push    edi
18        sub             esp, 32
19
20        mov             esi, eax        ; esi = screen addr
21        mov             eax, edx        ; eax = remap_table
22        mov             edi, ebx        ; edi = remap_seq
23        mov             ebp, ecx        ; ebp = remap_seq_len
24
25        cmp             ebp, 0
26        je              remap_end
27
28        mov             ah, [edi]
29        mov             ebx, eax
30        jmp             remap_loop
31
32ALIGN   16
33remap_loop:
34
35        mov             al, [esi]
36        mov             bl, 1[esi]
37        mov             al, [eax]
38        mov             bl, [ebx]
39        mov             [esi], al
40        mov             1[esi], bl
41        mov             al, 2[esi]
42        mov             bl, 3[esi]
43        mov             al, [eax]
44        mov             bl, [ebx]
45        mov             2[esi], al
46        mov             3[esi], bl
47
48        mov             al, 4[esi]
49        mov             bl, 5[esi]
50        mov             al, [eax]
51        mov             bl, [ebx]
52        mov             4[esi], al
53        mov             5[esi], bl
54        mov             al, 6[esi]
55        mov             bl, 7[esi]
56        mov             al, [eax]
57        mov             bl, [ebx]
58        mov             6[esi], al
59        mov             7[esi], bl
60
61        add             esi, 8
62        add             edi, 1
63        mov             ah, [edi]
64        mov             ebx, eax
65        dec             ebp
66        jne             remap_loop
67
68remap_end:
69        add             esp, 32
70        pop             edi
71        pop             esi
72        pop             ebp
73        ret
74
75; ENDP
76
77END
78
Note: See TracBrowser for help on using the repository browser.