Which visual c++ is consitent with MK_FP()

Which visual c++ is consitent with MK_FP()?

Comments

  • [b][red]This message was edited by stober at 2004-8-24 4:3:13[/red][/b][hr]
    : Which visual c++ is consitent with MK_FP()?
    :

    That is old 16-bit MS-DOS maco to create a far pointer. It is obsolete and not supported by 32-bit compilers such as MS Vicual C++ compilers because all pointers are near pointers (flat memory model programs)


  • So how do I write a char to the screen on MSVC/DEV C++ without any compiler functions.
    I want to do something like this on WINDOWS:

    [code]

    void print(char* s)
    {

    char far* x = (char far*)MK_FP( 0 , 0xB800 );

    while( *s && x != (char far*)MK_FP( 4000 , 0xB800 ) )
    {

    *x++ = *s++;
    *x++ = 0x01;

    }

    }

    [/code]

    (This is the DOS function)
    I need a function that would work both on windows and DOS
  • [b][red]This message was edited by stober at 2004-8-24 8:37:16[/red][/b][hr]
    for Windows console programs you need to use win32 api functions. AsmGuru has some examples on his site that you can download. Its a lot more complicated than it was with old 16-bit MS-DOS compilers such as Turbo C. You can't write directly to the screen as you did because (1) you have no clue what the address of the screen is (its different for every console window) and (2) the 32-bit compiler and os doesn't allow direct hardware manipulation.

    http://www.codexxi.com/


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories