home *** CD-ROM | disk | FTP | other *** search
/ CD-X 1 / cdx_01.iso / demodisc / basq / source / look / star.asm < prev    next >
Encoding:
Assembly Source File  |  1980-03-14  |  17.1 KB  |  619 lines

  1. .286
  2. stack    segment para stack
  3. ;    db 64 dup(0)
  4. stack    ends
  5. adatok    segment para 'data'
  6. ;-SIN es COS tablazat (az ertek word es szamolas utan el kell osztani 128-al)-
  7. sintbl    dw       0 ,   2 ,   4 ,   7 ,   9 ,  11 ,  13 ,  16 ,  18 ,  20
  8.     dw        22 ,  24 ,  27 ,  29 ,  31 ,  33 ,  35 ,  37 ,  40 ,  42
  9.     dw        44 ,  46 ,  48 ,  50 ,  52 ,  54 ,  56 ,  58 ,  60 ,  62
  10.     dw        64 ,  66 ,  68 ,  70 ,  72 ,  73 ,  75 ,  77 ,  79 ,  81
  11.     dw        82 ,  84 ,  86 ,  87 ,  89 ,  91 ,  92 ,  94 ,  95 ,  97
  12.     dw        98 ,  99 , 101 , 102 , 104 , 105 , 106 , 107 , 109 , 110
  13.     dw       111 , 112 , 113 , 114 , 115 , 116 , 117 , 118 , 119 , 119
  14.     dw       120 , 121 , 122 , 122 , 123 , 124 , 124 , 125 , 125 , 126
  15.     dw       126 , 126 , 127 , 127 , 127 , 128 , 128 , 128 , 128 , 128
  16. costbl    dw       128 , 128 , 128 , 128 , 128 , 128 , 127 , 127 , 127 , 126
  17.     dw       126 , 126 , 125 , 125 , 124 , 124 , 123 , 122 , 122 , 121
  18.     dw       120 , 119 , 119 , 118 , 117 , 116 , 115 , 114 , 113 , 112
  19.     dw       111 , 110 , 109 , 107 , 106 , 105 , 104 , 102 , 101 ,  99
  20.     dw        98 ,  97 ,  95 ,  94 ,  92 ,  91 ,  89 ,  87 ,  86 ,  84
  21.     dw        82 ,  81 ,  79 ,  77 ,  75 ,  73 ,  72 ,  70 ,  68 ,  66
  22.     dw        64 ,  62 ,  60 ,  58 ,  56 ,  54 ,  52 ,  50 ,  48 ,  46
  23.     dw        44 ,  42 ,  40 ,  37 ,  35 ,  33 ,  31 ,  29 ,  27 ,  24
  24.     dw        22 ,  20 ,  18 ,  16 ,  13 ,  11 ,   9 ,   7 ,   4 ,   2
  25.     dw        -0 ,  -2 ,  -4 ,  -7 ,  -9 , -11 , -13 , -16 , -18 , -20
  26.     dw       -22 , -24 , -27 , -29 , -31 , -33 , -35 , -37 , -40 , -42
  27.     dw       -44 , -46 , -48 , -50 , -52 , -54 , -56 , -58 , -60 , -62
  28.     dw       -64 , -66 , -68 , -70 , -72 , -73 , -75 , -77 , -79 , -81
  29.     dw       -82 , -84 , -86 , -87 , -89 , -91 , -92 , -94 , -95 , -97
  30.     dw       -98 , -99 ,-101 ,-102 ,-104 ,-105 ,-106 ,-107 ,-109 ,-110
  31.     dw      -111 ,-112 ,-113 ,-114 ,-115 ,-116 ,-117 ,-118 ,-119 ,-119
  32.     dw      -120 ,-121 ,-122 ,-122 ,-123 ,-124 ,-124 ,-125 ,-125 ,-126
  33.     dw      -126 ,-126 ,-127 ,-127 ,-127 ,-128 ,-128 ,-128 ,-128 ,-128
  34.     dw      -128 ,-128 ,-128 ,-128 ,-128 ,-128 ,-127 ,-127 ,-127 ,-126
  35.     dw      -126 ,-126 ,-125 ,-125 ,-124 ,-124 ,-123 ,-122 ,-122 ,-121
  36.     dw      -120 ,-119 ,-119 ,-118 ,-117 ,-116 ,-115 ,-114 ,-113 ,-112
  37.     dw      -111 ,-110 ,-109 ,-107 ,-106 ,-105 ,-104 ,-102 ,-101 , -99
  38.     dw       -98 , -97 , -95 , -94 , -92 , -91 , -89 , -87 , -86 , -84
  39.     dw       -82 , -81 , -79 , -77 , -75 , -73 , -72 , -70 , -68 , -66
  40.     dw       -64 , -62 , -60 , -58 , -56 , -54 , -52 , -50 , -48 , -46
  41.     dw       -44 , -42 , -40 , -37 , -35 , -33 , -31 , -29 , -27 , -24
  42.     dw       -22 , -20 , -18 , -16 , -13 , -11 ,  -9 ,  -7 ,  -4 ,  -2
  43.     dw       0 ,   2 ,   4 ,   7 ,   9 ,  11 ,  13 ,  16 ,  18 ,  20
  44.     dw        22 ,  24 ,  27 ,  29 ,  31 ,  33 ,  35 ,  37 ,  40 ,  42
  45.     dw        44 ,  46 ,  48 ,  50 ,  52 ,  54 ,  56 ,  58 ,  60 ,  62
  46.     dw        64 ,  66 ,  68 ,  70 ,  72 ,  73 ,  75 ,  77 ,  79 ,  81
  47.     dw        82 ,  84 ,  86 ,  87 ,  89 ,  91 ,  92 ,  94 ,  95 ,  97
  48.     dw        98 ,  99 , 101 , 102 , 104 , 105 , 106 , 107 , 109 , 110
  49.     dw       111 , 112 , 113 , 114 , 115 , 116 , 117 , 118 , 119 , 119
  50.     dw       120 , 121 , 122 , 122 , 123 , 124 , 124 , 125 , 125 , 126
  51.     dw       126 , 126 , 127 , 127 , 127 , 128 , 128 , 128 , 128 , 128
  52. ;------ A forgatashoz szukseges valtozok ------
  53. ralfa   dw     00          ; az alfa forgatas szoge
  54. rbeta   dw     00          ; az beta forgatas szoge
  55. rgamma  dw     00          ; az gamma forgatas szoge
  56. rdalfa  dw     2           ; az alfa szog valtozasanak erteke
  57. rdbeta  dw     3           ; az beta szog valtozasanak erteke
  58. rdgamma dw     2           ; az gamma szog valtozasanak erteke
  59. rox     dw     0d          ; az elforgatando pont x kordinataja
  60. roy     dw     0d          ; az elforgatando pont y kordinataja
  61. roz     dw     0d          ; az elforgatando pont z kordinataja
  62. roxyze  dw     0d          ; segedvaltozo x-hez
  63. roye    dw     0d          ; segedvaltozo y-hoz
  64. roze    dw     0d          ; segedvaltozo z-hez
  65. ropontx dw     0d          ; az elforgatott pont sikra valo lekepezesenek x kordinatja
  66. roponty dw     0d          ; az elforgatott pont sikra valo lekepezesenek y kordinatja
  67. ropk    dw     800d        ; a lekepezes allitasa
  68. ropl    dw     280d        ; a lekepezes allitasa
  69. ;------ objektum adatai ------
  70. obnum   dw     16           ; pontok szama
  71. obinc     dw     0
  72. obx     dw     20,-20,-20, 20, 20,-20,-20, 20,  0,  0,  0,  0,-99, 99
  73. oby     dw     20, 20,-20,-20, 20, 20,-20,-20,  0,  0, 99,-99,  0,  0
  74. obz     dw     20, 20, 20, 20,-20,-20,-20,-20, 99,-99,  0,  0,  0,  0
  75. obline    dw     36
  76. oblinei dw     0    
  77. kotmit  dw     0,1,2,3,4,5,6,7,0,1,2,3, 0,1,2,3, 4,5,6,7  
  78.     dw      0, 1, 4, 5,  2, 3, 6, 7,  1, 2, 5, 6,  0, 3, 4, 7 
  79. kotvel  dw     1,2,3,0,5,6,7,4,4,5,6,7, 8,8,8,8, 9,9,9,9 
  80.     dw     10,10,10,10, 11,11,11,11, 12,12,12,12, 13,13,13,13
  81. obszx   dw     16 dup (0h)
  82. obszy   dw     16 dup (0h)
  83. ;-------  A vonalhuzo rutin valtozoi --------
  84. lincolor   db    9
  85. linemode   db    00
  86. linx1      dw    0d
  87. linx2      dw    0
  88. liny1      dw    0d
  89. liny2      dw    0
  90. adatok    ends
  91.  
  92. begin     segment para 'code'
  93. main    proc far
  94.     assume cs:begin,ds:adatok,ss:stack
  95.     mov ax,adatok
  96.     mov ds,ax
  97.  
  98. ;*********** Fo torzs ***********
  99.     
  100.         mov ah,00h
  101.     mov al,13h
  102.     int 10h
  103.         call forgat
  104.         mov ah,00h
  105.     mov al,03h
  106.     int 10h
  107.     jmp ki
  108.  
  109. ;********** Fo torzs vege *******
  110.  
  111. ;-----  Forgatas ------
  112. forgat        proc
  113. rotoda: call pontoksz       ;Pontok kiszamolasa
  114.     mov linemode,0        ;Rajzolasai mod beallitasa    
  115.     call waitraster     ;Varakozas a kepernyofrissitesre 
  116.         call kitesz        ;Vonalak kirajzolasa
  117.     mov linemode,1        ;Torlesi mod beallitasa
  118.     call waitraster        ;Varakozas a kepernyofrissitesre    
  119.     call vaitraster
  120.     call waitraster        ;Varakozas a kepernyofrissitesre    
  121.     call kitesz        ;Vonalak torlese
  122.     call szoginc        ;Szog ertekek novelese
  123.     mov ah,0bh        ;Billentyu leutes figyelese
  124.     int 21h
  125.     cmp al,00h
  126.     je rotoda    
  127.         ret
  128. forgat        endp
  129.  
  130. ;------- A keprnyofrissitesre var ------
  131. waitraster proc
  132.     mov dx,3dah
  133. raster:    in ax,dx
  134.     ror al,4
  135.     jnc raster
  136.     ret
  137. waitraster endp
  138.  
  139. ;------- A keprnyofrissitesre var ------
  140. vaitraster proc
  141.     mov dx,3dah
  142. vraster:in ax,dx
  143.     ror al,4
  144.     jc vraster
  145.     ret
  146. vaitraster endp
  147.  
  148. ;------- Vonalak Kirajzolasa -----------
  149. kitesz  proc
  150.     mov cx,0
  151. rotki:    mov si,cx
  152.     rol si,1
  153.         mov ax,kotmit[si]
  154.     mov si,ax
  155.     rol si,1
  156.     mov ax,obszx[si]
  157.     mov linx1,ax
  158.     mov ax,obszy[si]
  159.     mov liny1,ax
  160.  
  161.         mov si,cx
  162.     rol si,1
  163.         mov ax,kotvel[si]
  164.     mov si,ax
  165.     rol si,1
  166.     mov ax,obszx[si]
  167.     mov linx2,ax
  168.     mov ax,obszy[si]
  169.     mov liny2,ax
  170.     push cx
  171.     call line
  172.     pop  cx
  173.     inc cx
  174.         cmp cx,obline
  175.         jnz rotki
  176.     ret
  177. kitesz    endp
  178.  
  179.  
  180. ;------- Pontok kordinatainak kiszamitasa -------
  181. pontoksz  proc
  182.     mov obinc,0
  183. rotide: call kordolv
  184.         call rotate
  185.     mov ax,rox
  186.     mov bx,roy
  187.         mov si,obinc
  188.         rol si,1
  189.     mov obszx[si],ax
  190.     mov obszy[si],bx
  191.         inc obinc
  192.     mov bx,obnum
  193.         cmp obinc,bx
  194.         jnz rotide
  195.         ret
  196. pontoksz  endp
  197.  
  198. ;-------  kordinata beallitas ------
  199. kordolv   proc
  200.         mov si,obinc
  201.     rol si,1
  202.     mov ax,obx[si]
  203.         mov bx,oby[si]
  204.         mov cx,obz[si]
  205.         mov rox,ax
  206.         mov roy,bx
  207.         mov roz,cx
  208.           ret
  209. kordolv   endp
  210.  
  211. ;-------- ALFA , BETA , GAMMA szogek novelese ------
  212. szoginc   proc
  213.           cmp rdalfa,0       ;{ha rdalfa>0 elugrik ide1 hoz}
  214.           jg szogidea1
  215.           mov ax,ralfa
  216.           add ax,rdalfa
  217.           cmp ax,0
  218.           jge  szogidea0      ;{ha ralfa>=0 akkor ide0-hoz}
  219.           neg ax             ;{kivonja 360-bol az uj szogerteket}
  220.           mov bx,360
  221.           sub bx,ax
  222.           mov ax,bx
  223. szogidea0:   mov ralfa,ax
  224.              jmp szogbeta
  225. szogidea1:   mov ax,ralfa
  226.              add ax,rdalfa
  227.              cmp ax,360
  228.              jge szogidea2       ;{ha ralfa=<359 akkor ide0-hoz}
  229.              mov ralfa,ax
  230.              jmp szogbeta
  231. szogidea2:   mov bx,360
  232.              mov dx,0
  233.              div bx
  234.              mov ralfa,dx
  235. szogbeta:    cmp rdbeta,0
  236.           jg szogideb1
  237.           mov ax,rbeta
  238.           add ax,rdbeta
  239.           cmp ax,0
  240.           jge  szogideb0
  241.           neg ax
  242.           mov bx,360
  243.           sub bx,ax
  244.           mov ax,bx
  245. szogideb0:  mov rbeta,ax
  246.             jmp szoggamma
  247. szogideb1:  mov ax,rbeta
  248.             add ax,rdbeta
  249.             cmp ax,360
  250.             jge  szogideb2
  251.             mov rbeta,ax
  252.             jmp szoggamma
  253. szogideb2:  mov bx,360
  254.             mov dx,0
  255.             div bx
  256.             mov rbeta,dx
  257. szoggamma:  cmp rdgamma,0
  258.           jg szogideg1
  259.           mov ax,rgamma
  260.           add ax,rdgamma
  261.           cmp ax,0
  262.           jge  szogideg0
  263.           neg ax
  264.           mov bx,360
  265.           sub bx,ax
  266.           mov ax,bx
  267. szogideg0:  mov rgamma,ax
  268.             jmp szogvege
  269. szogideg1:  mov ax,rgamma
  270.             add ax,rdgamma
  271.             cmp ax,360
  272.             jge  szogideg2
  273.             mov rgamma,ax
  274.             jmp szogvege
  275. szogideg2:  mov bx,360
  276.             mov dx,0
  277.             div bx
  278.             mov rgamma,dx
  279. szogvege:   ret
  280. szoginc   endp
  281.  
  282.  
  283.  
  284. deltabs proc
  285.         cmp di,0       ;{lindeltx:=abs(lindeltx);}
  286.         jg @lcser1
  287.         neg di
  288. @lcser1:cmp bp,0       ;{lindelty:=abs(lindelty);}
  289.         jg @lcser2
  290.         neg bp
  291. @lcser2:ret
  292. deltabs endp
  293.  
  294. putpont  proc
  295. ;{---------  pont rajzolasa -------}
  296.                     cmp linemode,0
  297.                     jne @vonaltorol
  298.                     ;{mov dl,es:[bx]      ;{XOR}
  299.                     ;{or dl,lincolor            ;{XOR}
  300.                     ;mov dl,lincolor    ;{NORMAL}
  301.             mov es:[si],dl
  302.                     ret
  303. @vonaltorol:        mov dh,es:[si]
  304.                     ;mov dh,0ffh
  305.                     xor dh,dl
  306.                     and dh,0
  307.                     mov es:[si],dh
  308.                     ret
  309. putpont endp
  310.  
  311. lcsere proc
  312.         mov cx,linx1      ;{x csere}
  313.         mov dx,linx2
  314.         mov linx1,dx
  315.         mov linx2,cx
  316.         mov cx,liny1      ;{y csere}
  317.         mov dx,liny2
  318.         mov liny1,dx
  319.         mov liny2,cx
  320.         ret
  321. lcsere endp
  322.  
  323. line proc
  324. ;{ Hasznalt regiszterek :
  325. ;{            AX, BX, CX, DX, ES, SI, DI, BP }
  326.       mov ax,0a000h
  327.       mov es,ax
  328.       mov di,linx2       ;{AX:=lindeltx:=linx2-linx1;}
  329.       sub di,linx1
  330.       mov bp,liny2       ;{BX:=lindelty:=liny2-liny1;}
  331.       sub bp,liny1
  332.       cmp di,0           ;{if (lindeltx<>0) and (lindelty<>0) then begin dolt; goto finish; end;}
  333.       je @ln1
  334.       cmp bp,0
  335.       je @ln1
  336.       jmp @ldolt
  337.  
  338. @ln1: cmp bp,0           ;{if (lindelty<>0) then begin fuggoleges; goto finish; end;}
  339.       je @ln2
  340.       jmp @lfuggo
  341.  
  342. @ln2: cmp di,0           ;{if (lindeltx<>0) then begin visszintes; goto finish; end;}
  343.       je @ln3
  344.       jmp @lvissz
  345.  
  346. ;{------------------ Pont ------------------}
  347. @ln3: mov dx,liny1       ;{linxx1:=linx1; linyy1:=liny1;}
  348.       mov ax,0320d
  349.       mul dx
  350.       add ax,linx1
  351.       mov si,ax
  352.       mov dl,lincolor
  353.       call putpont
  354.       ret
  355.  
  356. ;{-------------- Dolt vonalak ------------------}
  357. @ldolt: cmp di,0             ;{if (lindeltx<0) and (lindelty<0) then begin csere; eset1; goto vege; end;}
  358.         jg  @dolt1
  359.         cmp bp,0
  360.         jg  @dolt1
  361.         call lcsere
  362.         jmp @eset1
  363. @dolt1: cmp di,0             ;{if (lindeltx<0) and (lindelty>0) then begin csere; eset2; goto vege; end;}
  364.         jg  @dolt2
  365.         cmp bp,0
  366.         jl  @dolt2
  367.         call lcsere
  368.         jmp @eset2
  369. @dolt2: cmp bp,0             ;{if (lindelty>0) then begin eset1; goto vege; end;}
  370.         jl  @eset2
  371.         jmp @eset1
  372.  
  373. ;{---- Masodik eset ---}
  374. @eset2:
  375.         call deltabs
  376.         cmp di,bp
  377.         jl @leset2a       ;{if (lindeltx<lindelty) then goto eset2a;}
  378.         mov cx,di           ;{until linxx1=linx2;}
  379.  
  380.         mov dx,liny1
  381.         mov ax,0320d
  382.         mul dx
  383.         add ax,linx1
  384.         mov si,ax
  385.  
  386.         mov ax,di
  387.         sar ax,1
  388.  
  389.         mov dl,lincolor
  390.         mov bx,0320d
  391. @leset20:call putpont
  392.         add ax,bp            ;{linyp:=linyp+lindelty;}
  393.         cmp ax,di            ;{if linyp>=lindeltx then begin linyp:=linyp-lindeltx; dec(linyy1); end;}
  394.         jl  @leset20a
  395.         sub ax,di
  396.         sub si,bx
  397. @leset20a:inc si
  398.         loop @leset20
  399.         ret
  400.  
  401. @leset2a:
  402.         mov cx,bp            ;{until linyy1=liny2;}
  403.  
  404.         mov bx,bp
  405.         sar bx,1
  406.  
  407.         mov dx,liny1
  408.         mov ax,0320d
  409.         mul dx
  410.         add ax,linx1
  411.         mov si,ax
  412.  
  413.         mov dl,lincolor
  414.         mov ax,0320d
  415. @leset2b:call putpont
  416.         add bx,di            ;{linxp:=linxp+lindeltx;}
  417.         cmp bx,bp            ;{if linxp>=lindelty then begin linxp:=linxp-lindelty; inc(linxx1); end;}
  418.         jl  @leset2c
  419.         sub bx,bp
  420.         inc si
  421. @leset2c:sub si,ax
  422.         loop @leset2b
  423.         ret
  424.  
  425. ;{---- Elso eset ---}
  426. @eset1:
  427.         call deltabs
  428.         cmp di,bp
  429.         jl @leset1a       ;{if (lindeltx<lindelty) then goto eset1a;}
  430.         mov cx,di         ;{until linxx1=linx2;}
  431.  
  432.         mov dx,liny1
  433.         mov ax,0320d
  434.         mul dx
  435.         add ax,linx1
  436.         mov si,ax
  437.  
  438.         mov ax,di
  439.         sar ax,1
  440.  
  441.         mov dl,lincolor
  442.         mov bx,0320d
  443. @leset0:call putpont
  444.         add ax,bp            ;{linyp:=linyp+lindelty;}
  445.         cmp ax,di            ;{if linyp>=lindeltx then begin linyp:=linyp-lindeltx; inc(linyy1); end;}
  446.         jl  @leset0a
  447.         sub ax,di
  448.         add si,bx
  449. @leset0a:inc si
  450.         loop @leset0
  451.         ret
  452.  
  453. @leset1a:
  454.         mov cx,bp            ;{until linyy1=liny2;}
  455.         mov bx,bp
  456.         sar bx,1
  457.  
  458.         mov dx,liny1
  459.         mov ax,0320d
  460.         mul dx
  461.         add ax,linx1
  462.         mov si,ax
  463.  
  464.         mov dl,lincolor
  465.         mov ax,0320d
  466. @leset1b:call putpont
  467.         add bx,di            ;{linxp:=linxp+lindeltx;}
  468.         cmp bx,bp            ;{if linxp>=lindelty then begin linxp:=linxp-lindelty; inc(linxx1); end;}
  469.         jl  @leset1c
  470.         sub bx,bp
  471.         inc si
  472. @leset1c:add si,0320d
  473.         loop @leset1b
  474.         ret
  475.  
  476. ;{------------- Fuggoleges vonal --------------}
  477. @lfuggo:
  478.       cmp bp,0       ;{if lindelty<0 then csere;}
  479.       jg  @lnocs
  480.       call lcsere
  481.       neg bp
  482. @lnocs:mov dx,liny1    ;{linxx1:=linx1; linyy1:=liny1;}
  483.       mov ax,0320d
  484.       mul dx
  485.       add ax,linx1
  486.       mov si,ax
  487.       mov cx,bp        ;{until linyy1=liny2;}
  488.  
  489.       mov dl,lincolor
  490.       mov ax,0320d
  491. @lfis:call putpont
  492.       add si,ax
  493.       loop @lfis
  494.       ret
  495.  
  496. ;{------------- Visszintes vonal --------------}
  497. @lvissz:
  498.       cmp di,0       ;{if lindeltx<0 then csere;}
  499.       jg  @lnoc
  500.       call lcsere
  501.       neg di
  502. @lnoc:mov dx,liny1    ;{linxx1:=linx1; linyy1:=liny1;}
  503.       mov ax,0320d
  504.       mul dx
  505.       add ax,linx1
  506.       mov si,ax
  507.       mov cx,di       ;{until linxx1=linx2;}
  508.       mov dl,lincolor        
  509. @lvis:call putpont
  510.       inc  si
  511.       loop @lvis
  512.       ret
  513. line  endp
  514.  
  515. ;------------ PONT FORGATASANAK KISZAMITASA ---------
  516. rotate      proc
  517. ;      xe:=x;
  518. ;      x:=(sin(alfa)*y+(cos(alfa)*xe));
  519.         mov ax,rox
  520.         mov roxyze,ax
  521.             mov si,ralfa
  522.             rol si,1
  523.             mov bx,sintbl[si]
  524.             mov ax,roy
  525.             imul bx
  526.             mov bx,ax
  527.             mov ax,costbl[si]
  528.             mov dx,roxyze
  529.             imul dx
  530.             add ax,bx
  531.             sar ax,7
  532.             mov rox,ax
  533. ;      y:=(cos(alfa)*y)-(sin(alfa)*xe);
  534.             mov bx,costbl[si]
  535.             mov ax,roy
  536.             imul bx
  537.             mov bx,ax
  538.             mov ax,sintbl[si]
  539.             mov dx,roxyze
  540.             imul dx
  541.             sub bx,ax
  542.             sar bx,7
  543.             mov roy,bx
  544. ;xe:=x;
  545. ;x:=(cos(beta)*xe)-(sin(beta)*z);
  546.             mov ax,rox
  547.         mov roxyze,ax
  548.             mov si,rbeta
  549.             rol si,1
  550.             mov ax,costbl[si]
  551.             mov dx,roxyze
  552.             imul dx
  553.             mov bx,ax
  554.             mov ax,sintbl[si]
  555.             push cx
  556.             mov cx,roz
  557.             imul cx
  558.             sub bx,ax
  559.             pop cx
  560.             sar bx,7
  561.         add bx,0160d
  562.             mov rox,bx
  563. ;z:=(cos(beta)*z)+(sin(beta)*xe);
  564.             mov bx,costbl[si]
  565.             mov ax,roz
  566.             imul bx
  567.             mov bx,ax
  568.             mov ax,sintbl[si]
  569.             mov dx,roxyze
  570.             imul dx
  571.             add ax,bx
  572.             sar ax,7
  573.             mov roz,ax
  574. ;ye:=y;
  575. ;y:=(sin(gama)*z)+(cos(gama)*ye);
  576.             mov ax,roy
  577.         mov roxyze,ax
  578.             mov si,rgamma
  579.             rol si,1
  580.             mov bx,sintbl[si]
  581.             mov ax,roz
  582.             imul bx
  583.             mov bx,ax
  584.             mov ax,costbl[si]
  585.             mov dx,roxyze
  586.             imul dx
  587.             add ax,bx
  588.             sar ax,7
  589.         add ax,0100d
  590.             mov roy,ax
  591. ;z:=(cos(gama)*z)-(sin(gama)*ye);
  592.             mov bx,costbl[si]
  593.             mov ax,roz
  594.             imul bx
  595.             mov bx,ax
  596.             mov ax,sintbl[si]
  597.             mov dx,roxyze
  598.             imul dx
  599.             sub bx,ax
  600.             sar bx,7
  601.             mov roz,bx
  602.             ret
  603. rotate      endp
  604.  
  605. lekepez     proc
  606. ;xx:=trunc(x*(pl-pk)/(pl-z));
  607. ;yy:=trunc(y*(pl-pk)/(pl-z));
  608. lekepez     endp
  609.  
  610. ki:     
  611.  
  612.     mov ah,4ch   ;EXIT DOS
  613.     int 21h
  614. main     endp
  615. begin    ends
  616. end main
  617.  
  618.  
  619.