source: abuse/tags/pd/abuse/src/putline2.asm @ 99

Last change on this file since 99 was 49, checked in by Sam Hocevar, 15 years ago
  • Imported original public domain release, for future reference.
File size: 954 bytes
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        mov             ah, [edi]
26        mov             ebx, eax
27        jmp             remap_loop
28
29ALIGN   16
30remap_loop:
31
32        mov             al, [esi]
33        mov             bl, 1[esi]
34        mov             al, [eax]
35        mov             bl, [ebx]
36        mov             [esi], al
37        mov             1[esi], bl
38
39        add             edi, 1
40        mov             al, 2[esi]
41        mov             bl, 3[esi]
42        mov             al, [eax]
43        mov             bl, [ebx]
44        mov             2[esi], al
45        mov             3[esi], bl
46
47        mov             al, 4[esi]
48        mov             bl, 5[esi]
49        mov             al, [eax]
50        add             esi, 8
51        mov             bl, [ebx]
52        mov             -4[esi], al
53        mov             -3[esi], bl
54
55        dec             ebp
56        mov             al, -2[esi]
57        mov             bl, -1[esi]
58        mov             al, [eax]
59        mov             bl, [ebx]
60        mov             -2[esi], al
61        mov             -1[esi], bl
62
63        mov             ah, [edi]
64        mov             ebx, eax
65        jne             remap_loop
66
67        add             esp, 32
68        pop             edi
69        pop             esi
70        pop             ebp
71        ret
72
73; ENDP
74
75END
76
Note: See TracBrowser for help on using the repository browser.