How can I use asm in line instructions in the Watcom compiler ?
Like
//
asm {
mov bx, 0
mov ax, 0x12
}
How can I use asm in line instructions in the Watcom compiler ?
Like
//
asm {
mov bx, 0
mov ax, 0x12
}
look at “#pragma aux” documentation in watcom documentation
Watcom C 10.6 → Compiller and tooks user guide → In-line assembly
language
“Az” <ricardoaz@uol.com.br> wrote in message
news:96ecpd$5mk$1@inn.qnx.com…
How can I use asm in line instructions in the Watcom compiler ?
Like
//
asm {
mov bx, 0
mov ax, 0x12
}
#pragma aux test_fnc =
“mov bx,0”
“mov ax,12h”
extern test_fnc(void);
main() {
test_fnc();
}
Ian Zagorskih
Novosoft CyBearNet Department
Custom software development and web design since 1992
E-mail: ianzag@novosoft.ru
Phone: +7 (3832) 39-72-60, 39-72-61
Fax: +7 (3832) 39-63-58
For more visit www.novosoft-us.com
Ian M. Zagorskih <ianzag@novosoft.ru> wrote:
look at “#pragma aux” documentation in watcom documentation
Watcom C 10.6 → Compiller and tooks user guide → In-line assembly
language
Also, take a look at /usr/include/sys/inline.h for a bunch of examples
of inline assembly functions.
-David
“Az” <> ricardoaz@uol.com.br> > wrote in message
news:96ecpd$5mk$> 1@inn.qnx.com> …
How can I use asm in line instructions in the Watcom compiler ?Like
//
asm {
mov bx, 0
mov ax, 0x12
}
#pragma aux test_fnc =
“mov bx,0”
“mov ax,12h”extern test_fnc(void);
main() {
test_fnc();
}
Ian Zagorskih
Novosoft CyBearNet Department
Custom software development and web design since 1992
E-mail: > ianzag@novosoft.ru
Phone: +7 (3832) 39-72-60, 39-72-61
Fax: +7 (3832) 39-63-58
For more visit > www.novosoft-us.com
–
QNX Training Services
dagibbs@qnx.com
Also, be aware that pragmas have some sort of limitation on how many
characters you can use in them (so style counts). Perhaps David knows off
the top of his noggin what that limit is… I hit it before, but don’t
remember what it was.
-Warren “been there, broke that” Peece
“David Gibbs” <dagibbs@qnx.com> wrote in message
news:96ef9u$bv$2@nntp.qnx.com…
Ian M. Zagorskih <> ianzag@novosoft.ru> > wrote:
look at “#pragma aux” documentation in watcom documentation
Watcom C 10.6 → Compiller and tooks user guide → In-line assembly
languageAlso, take a look at /usr/include/sys/inline.h for a bunch of examples
of inline assembly functions.-David
“Az” <> ricardoaz@uol.com.br> > wrote in message
news:96ecpd$5mk$> 1@inn.qnx.com> …
How can I use asm in line instructions in the Watcom compiler ?Like
//
asm {
mov bx, 0
mov ax, 0x12
}
#pragma aux test_fnc =
“mov bx,0”
“mov ax,12h”extern test_fnc(void);
main() {
test_fnc();
}
Ian Zagorskih
Novosoft CyBearNet Department
Custom software development and web design since 1992
E-mail: > ianzag@novosoft.ru
Phone: +7 (3832) 39-72-60, 39-72-61
Fax: +7 (3832) 39-63-58
For more visit > www.novosoft-us.com
\QNX Training Services
dagibbs@qnx.com
Warren Peece <warren@nospam.com> wrote:
Also, be aware that pragmas have some sort of limitation on how many
characters you can use in them (so style counts). Perhaps David knows off
the top of his noggin what that limit is… I hit it before, but don’t
remember what it was.
Nope, sorry don’t know the limit.
-David
–
QNX Training Services
dagibbs@qnx.com
The limit is at exactly 128 bytes of machine code. I found this out when I tried to implement a somewhat larger function using inline assembly.
127 bytes of opcode is the maximum that will work; for anything above that, You will have to employ the regular assembler.
David Gibbs wrote:
Warren Peece <> warren@nospam.com> > wrote:
Also, be aware that pragmas have some sort of limitation on how many
characters you can use in them (so style counts). Perhaps David knows off
the top of his noggin what that limit is… I hit it before, but don’t
remember what it was.Nope, sorry don’t know the limit.
-David
–
QNX Training Services
dagibbs@qnx.com
–
T. Haupt
BitCtrl Systems GmbH
Weissenfelser Str. 67
04229 Leipzig
Phone: +49 (0)341 49067 0
Phax: +49 (0)341 49067 15
eMail: frk@bitctrl.de