home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 May / PCP163A.iso / Runimage / Cbuilder4 / Source / Vcl / CLASSCRE.ASM < prev    next >
Encoding:
Assembly Source File  |  1999-01-26  |  1.4 KB  |  84 lines

  1.     .386
  2.     .MODEL  FLAT
  3.  
  4.     LOCALS  @@
  5.  
  6.     PUBLIC  __ClassCreate,__ClassDestroy,__AfterConstruction,__BeforeDestruction
  7.  
  8.  
  9. vtAfterConstruction EQU -28
  10. vtBeforeDestruction EQU -24
  11. vtNewInstance       EQU -12
  12. vtFreeInstance      EQU -8
  13.  
  14.     .CODE
  15.  
  16. __ClassCreate PROC
  17.     ; ->    EAX = pointer to VMT
  18.     ; <-    EAX = pointer to instance
  19.     PUSH    EDX
  20.     PUSH    ECX
  21.     CALL    dword ptr [EAX].vtNewInstance
  22.     POP     ECX
  23.     POP     EDX
  24.     RET
  25.  
  26. __ClassCreate ENDP
  27.  
  28.  
  29. __ClassDestroy  PROC
  30.     ; ->    EAX = pointer to instance
  31.     MOV     EDX,[EAX]
  32.     JMP     dword ptr [EDX].vtFreeInstance
  33.  
  34. __ClassDestroy  ENDP
  35.  
  36.  
  37. __AfterConstruction PROC
  38.     ; ->    EAX = pointer to instance
  39.  
  40.     PUSH    EAX
  41.     MOV     EDX,[EAX]
  42.     CALL    dword ptr [EDX].vtAfterConstruction
  43.     POP     EAX
  44.     RET
  45.  
  46. __AfterConstruction ENDP
  47.  
  48. __BeforeDestruction PROC
  49.     ; ->    EAX  = pointer to instance
  50.     ;       DL   = dealloc flag
  51.  
  52.     TEST    DL,DL
  53.     JG      @@outerMost
  54.     RET
  55. @@outerMost:
  56.     PUSH    EAX
  57.     PUSH    EDX
  58.     MOV     EDX,[EAX]
  59.     CALL    dword ptr [EDX].vtBeforeDestruction
  60.     POP     EDX
  61.     POP     EAX
  62.     RET
  63.  
  64. __BeforeDestruction ENDP
  65.  
  66. public  __roundToInt64
  67. __roundToInt64  proc    near
  68.  
  69.     sub     esp, 8
  70.     fld     tbyte ptr [esp + 12]
  71.     fistp   qword ptr [esp]
  72.     pop     eax
  73.     pop     edx
  74.     ret
  75.  
  76. __roundToInt64  endp
  77.  
  78. ;
  79. ; The code previously in this section has been moved into the RTL
  80. ; (file CRTLVCL.CPP) to fix BCB-12433
  81. ;
  82.  
  83.     end
  84.