Thread overview | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
May 05, 2003 int86 | ||||
---|---|---|---|---|
| ||||
Hi, I'm trying to translate some of the snippets from snippets.org to d. I downloaded some snippets and tried them with dmc, and basically they worked. However I couldn't get int86 to work (I have WinXP). I thought maybe I could get it to work in D, but it didn't anyway (I did translate part of dos.h). Any idea of how I could do it? ------------------------- Carlos Santander Hi, I'm trying to translate some of the snippets from snippets.org to d. I downloaded some snippets and tried them with dmc, and basically they worked. However I couldn't get int86 to work (I have WinXP). I thought maybe I could get it to work in D, but it didn't anyway (I did translate part of dos.h). Any idea of how I could do it? ------------------------- Carlos Santander |
May 05, 2003 Re: int86 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Carlos Santander B. | All you really need to do is replace the C calling convention with the D calling convention in it. Or I'm misunderstanding the problem. "Carlos Santander B." <carlos8294@msn.com> wrote in message news:b962ui$hlk$1@digitaldaemon.com... > Hi, I'm trying to translate some of the snippets from snippets.org to d. I downloaded some snippets and tried them with dmc, and basically they worked. > However I couldn't get int86 to work (I have WinXP). I thought maybe I could > get it to work in D, but it didn't anyway (I did translate part of dos.h). Any idea of how I could do it? |
May 05, 2003 Re: int86 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | "Walter" <walter@digitalmars.com> escribió en el mensaje news:b967pl$mn1$1@digitaldaemon.com... | All you really need to do is replace the C calling convention with the D | calling convention in it. Or I'm misunderstanding the problem. | | "Carlos Santander B." <carlos8294@msn.com> wrote in message | news:b962ui$hlk$1@digitaldaemon.com... | > Hi, I'm trying to translate some of the snippets from snippets.org to d. I | > downloaded some snippets and tried them with dmc, and basically they | worked. | > However I couldn't get int86 to work (I have WinXP). I thought maybe I | could | > get it to work in D, but it didn't anyway (I did translate part of dos.h). | > Any idea of how I could do it? | Maybe you are. I created dos.d with a line extern (C) int int86(int,REGS *,REGS *); and I previously defined REGS, but when I compile the program, I get "Error 42: Symbol Undefined _int86". The same happens when I try to compile a similar program using dmc. ————————————————————————— Carlos Santander --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.476 / Virus Database: 273 - Release Date: 2003-04-24 |
May 05, 2003 Re: int86 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Carlos Santander B. | "Carlos Santander B." <carlos8294@msn.com> wrote in message news:b969gp$ocr$1@digitaldaemon.com... > Maybe you are. I created dos.d with a line > extern (C) int int86(int,REGS *,REGS *); > and I previously defined REGS, but when I compile the program, I get "Error > 42: Symbol Undefined _int86". The same happens when I try to compile a similar program using dmc. Error 42 is not a compiler error, it's a linker error. I suspect you haven't supplied the body of the function int86() to the linker. |
May 06, 2003 Re: int86 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | "Walter" <walter@digitalmars.com> escribió en el mensaje news:b96su0$1buk$1@digitaldaemon.com... | | "Carlos Santander B." <carlos8294@msn.com> wrote in message | news:b969gp$ocr$1@digitaldaemon.com... | > Maybe you are. I created dos.d with a line | > extern (C) int int86(int,REGS *,REGS *); | > and I previously defined REGS, but when I compile the program, I get | "Error | > 42: Symbol Undefined _int86". The same happens when I try to compile a | > similar program using dmc. | | Error 42 is not a compiler error, it's a linker error. I suspect you haven't | supplied the body of the function int86() to the linker. | | [I admit this should've been in some c++ forum, but now that we're at it...] Yes, my mistake: I should've said "... when I link...". int86() is declared in dos.h, however I can't use it not even with dmc. Yes, it's right below a "#ifndef __NT__" and I have XP, but I expected that it would be fully supported in some library. ————————————————————————— Carlos Santander --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.476 / Virus Database: 273 - Release Date: 2003-04-24 |
May 06, 2003 Re: int86 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Carlos Santander B. | "Carlos Santander B." <carlos8294@msn.com> wrote in message news:b972i3$1gtn$1@digitaldaemon.com... > "Walter" <walter@digitalmars.com> escribió en el mensaje > news:b96su0$1buk$1@digitaldaemon.com... > | > | "Carlos Santander B." <carlos8294@msn.com> wrote in message > | news:b969gp$ocr$1@digitaldaemon.com... > | > Maybe you are. I created dos.d with a line > | > extern (C) int int86(int,REGS *,REGS *); > | > and I previously defined REGS, but when I compile the program, I get > | "Error > | > 42: Symbol Undefined _int86". The same happens when I try to compile a > | > similar program using dmc. > | > | Error 42 is not a compiler error, it's a linker error. I suspect you > haven't > | supplied the body of the function int86() to the linker. > [I admit this should've been in some c++ forum, but now that we're at it...] > Yes, my mistake: I should've said "... when I link...". int86() is declared > in dos.h, however I can't use it not even with dmc. Yes, it's right below a > "#ifndef __NT__" and I have XP, but I expected that it would be fully supported in some library. What memory model are you using? int86() accesses interrupts, which is not available to Win32 memory model programming. |
May 06, 2003 Re: int86 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | "Walter" <walter@digitalmars.com> escribió en el mensaje news:b97aiu$1o5n$1@digitaldaemon.com... | | | What memory model are you using? int86() accesses interrupts, which is not | available to Win32 memory model programming. | You lost me there... hehe... I don't know, I really don't. Well, I guess I'll leave it there. I wanted int86() because I wanted to implement some (portable) functions for the console. But if int86() is not available, is there any other option? ————————————————————————— Carlos Santander --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.476 / Virus Database: 273 - Release Date: 2003-04-24 |
May 06, 2003 Re: int86 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Carlos Santander B. | "Carlos Santander B." <carlos8294@msn.com> wrote in message news:b98c86$2nkb$1@digitaldaemon.com... > "Walter" <walter@digitalmars.com> escribió en el mensaje > news:b97aiu$1o5n$1@digitaldaemon.com... > | > | > | What memory model are you using? int86() accesses interrupts, which is not > | available to Win32 memory model programming. > | > > You lost me there... hehe... I don't know, I really don't. Well, I guess I'll leave it there. > > I wanted int86() because I wanted to implement some (portable) functions for > the console. But if int86() is not available, is there any other option? Win32 has a whole slew of functions to manipulate the console - but none of it is portable. But you can use the DMC portable shell around them, www.digitalmars.com/rtl/disp.html |
May 07, 2003 Re: int86 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Carlos Santander B. | Carlos Santander B. wrote:
> Hi, I'm trying to translate some of the snippets from snippets.org to d. I
> downloaded some snippets and tried them with dmc, and basically they worked.
> However I couldn't get int86 to work (I have WinXP). I thought maybe I could
> get it to work in D, but it didn't anyway (I did translate part of dos.h).
> Any idea of how I could do it?
No platform that D supports will ever have access to the bad-old-days DOS int86 functions. You'll have to figure out what the particular int86 function calls are supposed to do, and re-write them using standard functions.
|
Copyright © 1999-2021 by the D Language Foundation