]> 4ch.mooo.com Git - plz.git/blob - u2/SPLINE.ASM
unable to compile because LINK.EXE is unknown. thus i cannot test original codes...
[plz.git] / u2 / SPLINE.ASM
1         IDEAL\r
2         MODEL large\r
3         P386\r
4 \r
5 EXTRN   C kx:word, C ky:word, C kz:word\r
6 EXTRN   C dis:word, C tx:word, C ty:word\r
7 EXTRN   C ls_kx:word, C ls_ky:word, C ls_kz:word\r
8 \r
9 CODESEG\r
10 \r
11 PUBLIC C getspl\r
12 \r
13 LABEL   buu     WORD\r
14 INCLUDE 'rata.inc'\r
15 \r
16 LABEL splinecoef WORD\r
17 INCLUDE "spline.inc"\r
18 \r
19 PROC C getspl\r
20 \r
21         ARG     position:word\r
22 \r
23         push    ds bp si di\r
24 \r
25         mov     si, OFFSET buu\r
26         push    cs\r
27         pop     ds\r
28         mov     di, [position]\r
29 \r
30         MASM\r
31 \r
32         ;ds:si=pointer to spline\r
33         ;di=position in spline, add 256 for next point\r
34 \r
35         mov     ax,di\r
36         shr     ax,8\r
37         shl     ax, 4d\r
38         add     si,ax\r
39         and     di,255\r
40         shl     di,1\r
41 \r
42         ccc=0\r
43         REPT 8\r
44         mov     ax,ds:[si+3*2*8+ccc]\r
45         imul    cs:splinecoef[di]\r
46         mov     bx,ax\r
47         mov     cx,dx\r
48         mov     ax,ds:[si+2*2*8+ccc]\r
49         imul    cs:splinecoef[di+64*8]\r
50         add     bx,ax\r
51         adc     cx,dx\r
52         mov     ax,ds:[si+1*2*8+ccc]\r
53         imul    cs:splinecoef[di+128*8]\r
54         add     bx,ax\r
55         adc     cx,dx\r
56         mov     ax,ds:[si+0*2*8+ccc]\r
57         imul    cs:splinecoef[di+192*8]\r
58         add     bx,ax\r
59         adc     cx,dx\r
60         shld    cx,bx,1\r
61         push    cx\r
62         ccc=ccc+2\r
63         ENDM\r
64 \r
65         mov     ax,  SEG kx\r
66         mov     ds, ax\r
67         pop     cx\r
68         mov     [ls_ky], cx\r
69         pop     cx\r
70         mov     [ls_kx], cx\r
71         pop     cx\r
72         mov     [kz], cx\r
73         pop     cx\r
74         mov     [ky], cx\r
75         pop     cx\r
76         mov     [kx], cx\r
77         pop     cx\r
78         mov     [dis], cx\r
79         pop     cx\r
80         mov     [ty], cx\r
81         pop     cx\r
82         mov     [tx], cx\r
83 \r
84         pop     di si bp ds\r
85         ret\r
86         IDEAL\r
87 ENDP\r
88 \r
89 END