TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: Toby Corkindale
from: david nugent
date: 1996-03-27 02:07:20
subject: ASM functions in Watcom

TC> If I write a #pragma aux "asm stuff here" caller [blah]
 TC> modify [blah]; in Watcom (ver 10), how can I return a
 TC> value?

 dn> The return value is specified as part of the #pragma.
 dn> Unfortunately I don't have docs handy right now (or

The example in the help file shows:

extern unsigned short far *dbcs_table();
#pragma aux dbcs_table = \
    "push ds"      \
    "mov ax,6300h" \
    "int 21h"      \
    "mov di,ds"    \
    "pop ds"       \
    value [di si]  \
    modify [ax];

the 'value' line defines the registers that return the value.

--- MaltEd/2 1.0.b6
* Origin: Unique Computing Pty Limited (3:632/348)
SEEN-BY: 50/99 78/0 620/243 623/630 632/103 348 360 998 633/371 634/384 388
SEEN-BY: 635/301 502 503 544 639/252 711/401 409 410 413 430 510 808 809 932
SEEN-BY: 711/934 712/515 713/888 714/906 800/1 7877/2809
@PATH: 632/348 635/503 50/99 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™.