delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1993/08/09/00:28:01

Date: Sun, 8 Aug 93 21:18:26 PDT
From: akrause AT saturn DOT SDSU DOT Edu (Alan Krause)
To: djgpp AT sun DOT soe DOT clarkson DOT edu

  I wish to write some functions for my C/C++ programs in assembly language,
but am not sure how to do this with djgpp.  For example, I wish to make a
function called setmode(int mode) which looks the following way in borland C++
v3.1 terms:

; setgmode(int mode)
;       Set VGA adapter to BIOS mode MODE
 
_setgmode proc far
        ARG     mode:WORD 
        push    bp
        mov     bp,sp
        move    ax,mode
        mov     ah,0
        int     10h
        pop     bp
        ret
_setgmode endp
 
  So, how do I 'transloate' this into a form which gcc/as will recognize>>??
Is the proper suffix for my filename a .s or .asm??  And, how do I compile it
into an object (and therefore linkable) file??
      Thanx for any help,
        Alan Krause

P.S. I know libgrx already has a function like this, but I will be using some
other assembly functions not in libgrx, and this was a very simple example
which I hope to learn by..

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019