using borland headers in dev?!

This is a discussion on using borland headers in dev?! within the C++ Programming forums, part of the General Programming Boards category; um, for MASM 32 bit, found a sample for you although it's not really "super optimized" or anything but does ...

  1. #16
    Registered User toaster's Avatar
    Join Date
    Apr 2002
    Posts
    161

    Angry

    um, for MASM 32 bit, found a sample for you although it's not really "super optimized" or anything but does it quick.

    if you actually do a comparison between the two using a slow microprocessor and low memory, you will see a difference where the c++ version will have a slight lag.

    anyway, here is the sample (it's on a 32 bit compatible console):

    Code:
    ; ########################################
    
          .386
          .model flat, stdcall
          option casemap :none   ; case sensitive
    
    ; ########################################
    
          include \masm32\include\windows.inc
    
          include \masm32\include\user32.inc
          include \masm32\include\kernel32.inc
          include \masm32\include\masm32.inc
    
          includelib \masm32\lib\user32.lib
          includelib \masm32\lib\kernel32.lib
          includelib \masm32\lib\masm32.lib
    
        ; ------------
        ; Local macros
        ; ------------
          print MACRO Quoted_Text:VARARG
            LOCAL Txt
              .data
                Txt db Quoted_Text,0
              .code
            invoke StdOut,ADDR Txt
          ENDM
    
          input MACRO Quoted_Prompt_Text:VARARG
            LOCAL Txt
            LOCAL Buffer
              .data
                Txt db Quoted_Prompt_Text,0
                Buffer db 128 dup(?)
              .code
            invoke StdOut,ADDR Txt
            invoke StdIn,ADDR Buffer,LENGTHOF Buffer
            mov eax, offset Buffer
          ENDM
    
          cls MACRO
            invoke ClearScreen
          ENDM
    
          Main   PROTO
    
    ; ########################################
    
        .data
          Msg1        db "Type something > ",0
          Msg2        db "You typed > ",0
    
    ; ########################################
    
        .code
    
        start:
          invoke Main
          invoke ExitProcess,0
    
    ; ########################################
    
    Main proc
    
        LOCAL InputBuffer[128]:BYTE
    
      ; -------------------------------
      ; console mode library procedures
      ; -------------------------------
    
      ; ------------
      ; using macros
      ; ------------
    
        cls
        print "Console function test",13,10,13,10
    
        input "Enter Some Text > "
        invoke StdOut,eax           ; return address in eax
    
      ; ----------------
      ; using procedures
      ; ----------------
      
        invoke locate,10,10 ; <------------------- LOOK HERE
        invoke StdOut,ADDR Msg1 
        invoke StdIn,ADDR InputBuffer,LENGTHOF InputBuffer
    
        invoke locate,10,11 ; <------------------- LOOK HERE
        invoke StdOut,ADDR Msg2
        invoke StdOut,ADDR InputBuffer
    
        ret
    
    Main endp
    
    ; ########################################
    
        end start
    here is the executable (after compiling this):

    oh yeah, i converted the file to type ".zip"
    just change the extension to ".exe" (".exe" files are invalid) or else it the computer will claim that the file is corrupted or something.

    and honestly, this is a fresh copy (no anything but the program itself). if you don't believe me, don't download it. you can even try every single virus scanner ever developed on earth. otherwise, the source is available for viewing above. lastly, stop this arguing already (if it is an arguement).
    Attached Files Attached Files
    Last edited by toaster; 04-20-2002 at 07:09 PM.
    think only with code.
    write only with source.

  2. #17
    S­énior Member
    Join Date
    Jan 2002
    Posts
    982
    All your asm is doing is calling win32 Api C functions. masm32.inc is providing the declarations for conio type functions which are implemented in calls to the Win32 aip in masm32.lib. If your C/C++ compiler is generating slower code to call SetConsoleCursorPosition(), then I suggest you change your C/C++ compiler.

  3. #18
    Rebooted Inquirer's Avatar
    Join Date
    Apr 2002
    Posts
    281
    look at the libs included with dev! i found a multitude of stuph that handled cursors or text and stuff both in console and windows! it is in /[dev-C++ folder path here]/includes/
    Compilers:
    GCC on Red Hat 8.1 (Primary)
    GCC on Mac OS X 10.2.4 (Secondary)

    Others:
    MinGW on XP

  4. #19
    Registered User Sekti's Avatar
    Join Date
    Feb 2002
    Posts
    163

    ok...

    im pretty sure gotoxy is in something like mingw_conio.h in dev and hey dev sucks get a better compiler
    +++
    ++
    + Sekti
    ++
    +++

  5. #20

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. New to Dev C++/<windows.h>...
    By Cilius in forum C++ Programming
    Replies: 3
    Last Post: 02-23-2005, 01:05 AM
  2. Glut and Dev C++, Programs not Quitting?
    By Zeusbwr in forum Game Programming
    Replies: 13
    Last Post: 11-29-2004, 08:43 PM
  3. openGL programming - From MSVC++ to Dev C++
    By WDT in forum Game Programming
    Replies: 3
    Last Post: 03-08-2004, 08:47 PM
  4. openGL programming - From MSVC++ to Dev C++
    By WDT in forum Game Programming
    Replies: 1
    Last Post: 03-08-2004, 05:19 PM
  5. DEV C++ Limitations?
    By Kirdra in forum Game Programming
    Replies: 3
    Last Post: 09-09-2002, 10:40 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21