| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Assembler in OS/2 |
On Monday, 1994-11-07 Magnus Eriksson wrote to All about "Assembler in OS/2" as follows: ME> Is there something special you must think of when you code ME> in ASM for OS/2 (for multitasking purposes & PM) ? Hi Magnus, When coding for command-line applications, there is very little difference in program design from DOS, unless you want to exploit multiple threads - which are advantageous in many situations. However, the code design is a lot more straightforward if you use the 0:32 flat memory model instead of the 16:16 segmented model. No more fiddling around with segment selectors every 64K when handling large chunks of data; just access whatever field you need. But when you need to call a module that uses 16:16 addressing, any pointers you pass must be "thunked" down from 0:32 to 16:16 and any you receive back must be "thunked" up to 0:32. The DosFlatToSel() and DosSelToFlat() API calls can be used for pointer thunking or you can use inline code. For PM programming, the cardinal rule is: DON'T HOG THE MESSAGE QUEUE!! Whenever your program has any large volume of work to do (more than 100 milliseconds) then a background thread should do that work and the foreground thread should release the message queue. The background thread can post a message to the foreground thread when the chore is complete. The most significant difference that applies exclusively to assembler coding is no more INTs. The system services are supplied by API calls, not by INT instructions branching into the operating system. You will also find addressing bugs easier to find because of the protected mode execution being used for all OS/2 applications. Regards Dave * KWQ/2 1.2g * "Well, Mr. Gates, there is a reason suppositories taste bad" --- Maximus/2 2.02* Origin: OS/2 Shareware BBS, Fairfax, VA: 703-385-4325 (1:109/347) SEEN-BY: 12/2442 54/54 620/243 624/50 632/348 640/820 690/660 711/409 410 413 SEEN-BY: 711/430 807 808 809 934 942 949 712/353 623 713/888 800/1 @PATH: 109/347 2 7 3615/50 229/2 12/2442 711/409 54/54 711/808 809 934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.