I think that I'll have a look at this forum from time to time, I *try* to learn assembly and I hope that you might be able to help me from time to time... There are not many ASM-Newbies around, you might ask how I got the idea to start learning. You might laugh, but it was Geoff Crammonds Grand Prix 2 (Racing Game). The follow up (GP3 - published last year) has been written pure Assembly...this game fascinated me so much that I'll try to learn a bit ASM. Till now, I'm a bit PHP experienced, I know Turbo Pascal a bit better. Regards, Matthias
Posted on 2001-07-06 09:11:00 by Matthias Pfau
welcome Mathhias! :) i'm a newbie, therefore, you're not alone. i believe you will have no problem with asm. cause i can see that you have plenty of potential and + your pascal knowledge, you'll get ahead very quick with easy explaination. enjoy your stay.
Posted on 2001-07-06 09:15:00 by disease_2000
welcome Mathhias! :) i'm a newbie, therefore, you're not alone.
Thanks I still forgot some things: I'm learning with "Oliver Mueller's Assembler Reference" (German book) which seems to be very good -> more than 400 pages with instructions. And I use MASM, my first questions comes with this: is OOP with MASM possible? Regards, Matthias This message was edited by Matthias Pfau, on 7/6/2001 9:40:23 AM This message was edited by Matthias Pfau, on 7/6/2001 9:44:05 AM
Posted on 2001-07-06 09:39:00 by Matthias Pfau
Welcome to the board! OOP is a concept or abstraction - there are no inherant tools with MASM that help you create OOP, but it is possible with some work. An example would be the COM work that has been done in assembly.
Posted on 2001-07-06 09:59:00 by bitRAKE
OOP with masm is possible yes. But a lot of work. However, as long as you got some oop "mentality" (data hiding, "black boxes", structured programming, modularization, etc), "true" oop isn't all that necessary most of the time -- unless you're trying to interface with DirectX or other COM (?) stuff. Sure "true" oop can be useful, but in my experience, I've only "needed" it when programming in high level languages. But taste might differ, and thanks whatever_deity for that.
Posted on 2001-07-06 10:02:00 by f0dder
Welcome Matthias! Nice to see another German here (I'm German, too).
Posted on 2001-07-06 10:32:00 by bazik
Thanks for all the greetings :) I just think whether I should switch to TASM because it supports OOP. What do you think/prefer? Regards, Matthias
Posted on 2001-07-06 11:49:00 by Matthias Pfau
tasm supports oop? As far as I know, tasm does nothing that masm doesn't do as well. Masm supports structures, macros, .if and all sorts of goodies. Besides, masm is free (legally) while tasm is commercial (pirated). And most of the win32asm users use masm. So I think which assembler to use is pretty obvious :) (stubborn still uses nasm most of the time though)
Posted on 2001-07-06 13:05:00 by f0dder
And don't forget: TASM isn't supported by Borland (Inprise) anymore.
Posted on 2001-07-06 14:27:00 by bazik
TASM do support object oriented programming via the METHOD structure modifier. You can have functions, virtual functions and heritance. If you can get the book, 'Mastering Turbo Assembler' by Tom Swan you can read all about it, also the manuals that come with tasm gives you an intro of its OO extensions. For Example (TASM IDEAL MODE):

 getX:dword = TPoint_getX
 getY:dword = TPoint_getY
 setX:dword = TPoint_setX
 setY:dword = TPoint_setY
 x dd ?
 y dd ?

 mov eax, [(TPoint PTR esi).x]
ENDP TPoint_getX

 mov eax, [(TPoint PTR esi).x]
ENDP TPoint_getY

 ARG @@x:dword
 mov eax, [@@x]
 mov [(TPoint PTR esi).x], eax
ENDP TPoint_SetX

 ARG @@y:dword
 mov eax, [@@y]
 mov [(TPoint PTR esi).y], eax
ENDP TPoint_SetY
An example call would be

 p1 TPoint<>
 mov esi, offset p1
 call esi METHOD TPoint::getX
which will expand to

 mov esi, offset p1
 call TPoint_getX
Note that no data was added to the structure. TASM Called the function directly. But can also handle virtual methods. For Example if we declare the above class like this:

 construct:dword = TPoint_construct
 VIRTUAL getX:dword = TPoint_getX
 VIRTUAL getY:dword = TPoint_getY
 VIRTUAL setX:dword = TPoint_setX
 VIRTUAL setY:dword = TPoint_setY
 x dd ?
 y dd ?

PROC TPoint_construct PASCAL
ENDP TPoint_construct
Then when you call the function this way

;call constructor
mov esi, p1
call esi TPoint:construct

;call method
call esi TPoint:getX
This call will be expanded to: call TASM Also support inHeritance. For Example:

 getZ:dword = T3DPoint_getZ
 setZ:dword = T3DPoint_setZ
 z dd ?
will have all the members that TPoint, plus 2 methods and 1 extra data. The OO extensions are only area in that I believe TASM superior to MASM. However MASM has .if/.else/.endif .while/.endw .repeat/.until that TASM does not have on ideal mode. (Im not sure if it has it in the MASM compatible mode). Also MASM has function prototypes, and parameter checking. Both are fairly good assemblers, however: TASM is not free, MASM is (at least for the time being) TASM is like a dead project for a long time, and Inprise (alias Borland) hasn't show any sign of upgrading it. You can get macros for new opcodes like MMX, SMID and 3DNow, but is not the same as having the compiler understand it. You can get a lot of community support for MASM. As for TASM and its OO Extensions that could be difficult. Finally remember, OO Programming its an actitude, not a language or an extension. You can do OO programming in MASM without the need of OO extensions.
Posted on 2001-07-06 14:35:00 by dxantos
Like most of you here I also recommend using masm. It has a lot of advantages and the most important advantage is that it has great support (a lot of source code, and of course this board, 90% is focussed on masm). If you want OOP, take a look at objects.inc by NaN (nan32asm.cjb.net). He has written a utility and macros that allow you to create and use an object. Thomas
Posted on 2001-07-06 15:26:00 by Thomas
Hi hehe dxantos its true TASM has all that OOP allready build in, and you can switch fro IDEAL to MASM compatible mode at any time in code, besides ".if .while .elseif" and stuff are also working in TASM :) "call" extended syntax replaces "invoke" very easy with the same PROTOTYPEING .... so i guess TASM still (today) has more stuff inside then MASM :) LOL after 5 years....this tells a story about the IQ of programmers at some 2 big companys ... but yeat another story about the quality of the management team (stupid leave of TASM undeveloped for 5 years :( ) besides TASM is 10x faster compiling then MASM and at a very large project like our game (300.000 lines of code) TASM speed saves the day... But as everybody stated before TASM is a little old and NOT free even today (i payed 95USD+VAT for each copy we own) So unless u are a pro and know what u are doing, or you need to get away with MASM "licence for Windows (Drivers) ONLY" a begginner should stick with MASM...doh...if you survive and understand the long "red tape" around real instructions ;) that MASM overuses But with this board help and Iczelion's tutorials you should be OK with MASM...in time you will be able to make your own decisions .... By that time i hope NASM, SpASM or FASM or whatever will evolve enough to compete with MASM :) (and Betov please change that SpASM icon...it makes my female secretary to start looking strange at my desktop ;) )
Posted on 2001-07-06 15:51:00 by BogdanOntanu
mmm, didn't know that .if/.endif etc worked in TASM, maybe I should try it today :) BogdanOntanu, do you know where I can get MMX, SMID and 3DNow macros for TASM?
Posted on 2001-07-06 17:40:00 by dxantos
Bogdan, is it true that borland has abandoned their work on TASM? i know that the current version is: 5.0 i believe if they keep on working, it would be faster than masm oneday. :)
Posted on 2001-07-06 17:49:00 by disease_2000
Thanks for all your help! I think I''ll try to learn with masm first, looks like you all are able to help me then :) I might switch to TASM later, but that''s just a thought for the far away future... @BogdanOntanu: What project are you talking about? And why don''t you use the inline Assemblers? Regards, Matthias
Posted on 2001-07-07 04:40:00 by Matthias Pfau
Matthias, goto www.hostileencounter.com and you''ll see Bogdan''s project :cool:
Posted on 2001-07-07 06:11:00 by bazik
Bogdan says:
besides TASM is 10x faster compiling then MASM and at a very large project like our game (300.000 lines of code) TASM speed saves the day...
This shouldn''t really matter if you use project modularization and makefiles, should it now? :)
Posted on 2001-07-07 07:33:00 by f0dder
Matthias, goto www.hostileencounter.com and you''ll see Bogdan''s project
Huh, this looks very promising :) @BogdanOntanu: I read somewhere, that pure ASM will cost 15% more time (in comparison to eg. c++), what do you think? This was a very ASM friendly site...but the reason was plausible: a programmer just uses 1/3 of his time for coding... Regards, Matthias
Posted on 2001-07-07 10:02:00 by Matthias Pfau