Below is some sample code to demonstrate what it can do so far, nothing overly special. 'virtual' methods can be overloaded whereas 'static' methods cannot. That might change as I'm thinking of making a change to the syntax now that the core is working fairly well.
Even though I mention it in the source, I want to go ahead and thank Ultrano and Homer for their help with this as I wouldn't have ever gotten this far without their help.
BITS 32
%define SINGLE_FILE_BUILD
%include "objects.inc"
EXTERN puts
EXTERN printf
CLASS CTest
virtual method, Say
static method, CTest
static method, Hello
static method, GoodBye
static dword, m_who
ENDCLASS
CLASS CHaha, CTest
ENDCLASS
CLASS CBlah, CHaha
virtual method, Say
static method, CBlah
static method, Hi
ENDCLASS
CLASS MYA
static method, Say
static method, @MYA
ENDCLASS
SECTION .text
MYA_@MYA:
%push
%stacksize flat
%arg this:DWORD
push ebp
mov ebp, esp
push dword strAuthor
push dword strGoodBye
call printf
add esp, (4 * 2)
leave
ret
%pop
MYA_Say:
%push
%stacksize flat
%arg this:DWORD, msg:DWORD
push ebp
mov ebp, esp
push dword [msg]
call puts
add esp, 4
leave
ret
%pop
CBlah_CBlah:
%push
%stacksize flat
%arg this:DWORD
push ebp
mov ebp, esp
mov ecx, [this]
mov edx, strAuthor
mov [ecx + CBlah.m_who], edx
leave
ret
%pop
CBlah_Hi:
%push
%stacksize flat
%arg this:DWORD
push ebp
mov ebp, esp
mov ecx, [this]
push dword [ecx + CBlah.m_who]
push dword strHello
call printf
add esp, 8
leave
ret
%pop
CBlah_Say:
%push
%stacksize flat
%arg this:DWORD, msg:DWORD
push ebp
mov ebp, esp
mov ecx, [this]
push dword [msg]
push dword strCBS
call printf
add esp, 8
leave
ret
%pop
CTest_CTest:
%push
%stacksize flat
%arg this:DWORD, msg:DWORD
push ebp
mov ebp, esp
mov ecx, [this]
mov edx, [msg]
mov [ecx + CTest.m_who], edx
leave
ret
%pop
CTest_Say:
%push
%stacksize flat
%arg this:DWORD, msg:DWORD
push ebp
mov ebp, esp
mov ecx, [this]
push dword [msg]
call puts
add esp, 4
leave
ret
%pop
CTest_Hello:
%push
%stacksize flat
%arg this:DWORD
push ebp
mov ebp, esp
mov ecx, [this]
push dword [ecx + CTest.m_who]
push dword strHello
call printf
add esp, 8
leave
ret
%pop
CTest_GoodBye:
%push
%stacksize flat
%arg this:DWORD
push ebp
mov ebp, esp
mov ecx, [this]
push dword [ecx + CTest.m_who]
push dword strGoodBye
call printf
add esp, 8
leave
ret
%pop
GLOBAL main
main:
push ebp
mov ebp, esp
new CTest, dword strAuthor
mov [pObject], eax
vcall [pObject], CTest,Say, strTitle
mcall [pObject], CTest,Hello
mcall [pObject], CTest,GoodBye
delete [pObject]
new CBlah
mov [pObject], eax
mcall [pObject], CBlah,Hi
vcall [pObject], CBlah,Say, strTitle
delete [pObject]
new MYA
mov [pObject], eax
mcall [pObject], MYA,Say, strTitle
delete [pObject]
xor eax, eax
leave
ret
SECTION .data
pObject DD 0 ;; Our Object Pointer
strHello DB "Hello, %s", 10, 0
strGoodBye DB "GoodBye, %s", 10, 0
strTitle DB "NASM OOP Demo", 0
strAuthor DB "Bryant Keller", 0
strCBS DB "CBS: %s", 10, 0