• No se han encontrado resultados

ESTUDIO ECONÓMICO DE LA INTEGRACIÓN DEL SISTEMA SANITARIO SORIANO

3.3. Estudio de la eficiencia del sistema

3.3.2. Comparativa internacional

So, you can very happily go through the earlier TASM program of this chapter replacing CALLS with INVOKES and with (or delete the entirely). However, a major problem still exists: the lack of a WINDOWS for PROC. This means that you cannot have a high-level PROC declaration for the callback function, and you have to resort to a macro or insert the and epilog code manually. The demo program uses CMACROSINC to achieve this.

Without the high-level PROC you can’t have the LOCAL directive, for convenient creation of data on the stack (CMACROSINC gets us around this problem).

Because a program isn’t going to have too many callbacks, it’s not a total disaster, just a nuisance, if you don’t want to use CMACROSINC. The manual approach is to insert the code as follows:

push ds code for callback function. ax inc bp push bp mov push ds mov ds,ax bp code dec bp mov ds bp dec bp ret 10

You can have local data on the stack, but you will have to manipulate the stack directly. To get at all of the data on the stack segment, you could do something like this:

hwnd TEXTEQU PTR msgtype TEXTEQU PTR wparam TEXTEQU <WORD PTR

TEXTEQU PTR

dummy TEXTEQU <WORD PTR

hdc TEXTEQU <WORD PTR 12

s3 TEXTEQU SIZE PAINTSTRUCT)

LEA sp, s t a c k t o f r e e r e g i o n . Labelscope differences syntax differences assembler differences

Something along these lines will give you access to the labels within the callback. Note that I used TEXTEQU, because EQU cannot be used for text aliasing with ML, a major divergence from earlier and from TASM. Notice that the text to be must be inside

Anyway, this is academic.

Other

So what else needs changing . . .

There is a slight difference in the syntax of the high-level PROC directive. If you look back to the declaration for you will see that it started like this: PROC PASCAL NEAR

hinstance:WORD With MASM6 it has to be rearranged

like this: PROC NEAR PASCAL, hinstance:WORD

. . . .

With Borland has allowed MASM high-level PROC

syntax.

I also came across an interesting problem with fields of a structure. Incidentally, MASM6 allows nested structures, which previous versions didn’t. Nesting is vital for OOP, though MASM6 is still nothing like OOP-aware.

The problem is that the program of this chapter has a couple of lines like this:

Which one?

clslpszmenuname is a 32-bit field of ;structure-instance sl..

mov WORD PTR mov WORD PTR

I loaded each half of the field with separate instructions. MASM objects to a field being accessed in halves, so I had to resort to:

solution . . . lea di,

mov mov

Oh, and make sure that your callback procedure name is all capital letters.

L a b e l s c o p e d i f f e r e n c e s

W h i c h o n e ?

Another major difference is in the scope of labels. I have covered that topic beginning on page 120. This is one aspect of

move toward the code integrity we expect from a high-level compiler. Prototyping is another. I think that many serious programmers will choose MASM on this basis, and it is an area where Borland had to play catch up, with

All of these comments are, of course, my personal opinion, not the final truth engraved in stone, and I suggest that potential buyers consider most carefully what features are most important. Have a look at reviews in magazines. If OOP is your thing, then look closely at TASM. Do bear in mind that my comments are based upon particular versions, and even “maintenance releases” of the same version number can have significant improvements. Therefore, take all of the above comments with a pinch of salt, and check out the features for yourself before buying.

One interesting point is that MASM6 comes with Programmer’s Workbench (PWB), an editor and IDE, as well as

debugger. Borland does not provide an editor or IDE, but the Turbo Debugger is very nice.

I have made some further comments on this on page 309.

MASM Assembling and Linking

Resource compiling and linking are as per Chapter 4, though you can use the Borland TLINK and COWS.OBJ, CWS.LIB and IMPORT.LIB library files, instead of the Microsoft equivalents(if you wish).

You only need to change one line in the Make tile, that of the assembly process:

ML .ASM

where suppresses linking (ML normally automatically invokes the linker), and $(fn) is the macro for the filename.

If you want debugging information so the source file can be traced by the debugger, then you will need the switch and you will need to use Microsoft’s LINK, with the /CO switch- the example Make tile on the Companion Disk to show this is named This is the command line I used to generate from