Thread: malloc() under DOS

  1. #16
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Code:
    __inton proc
            sti                      ;enables interrupts            
            ret                     ;return to caller
    __inton endp
    
    
    __intoff proc
            pushf                 ;push flags onto stack
            pop ax               ;pop ax off stack
            cli                       ;disable interrupts
            ret                     ;return to caller
    __intoff endp
    
    __intrst proc flag:word
            mov ax,flag        ;place flag(passed value) in ax
            push ax             ;push ax(flag) onto stack
            popf                   ;pop flags off of stack
            ret                      ;return to caller
    __intrst endp
    
    __nop proc
            ret                      ;return to caller
    __nop endp
    Wow. Bubba must have been asleep when he wrote this.
    Should be:

    Code:
    __inton proc
            sti                      ;enables interrupts            
            ret                     ;return to caller
    __inton endp
    
    
    __intoff proc
            pushf                 ;push flags onto stack
            pop ax               ;pop VALUE OFF OF STACK INTO AX
            cli                       ;disable interrupts
            ret                     ;return to caller
    __intoff endp
    
    __intrst proc flag:word
            mov ax,flag        ;place flag(passed value) in ax
            push ax             ;push ax(flag) onto stack
            popf                   ;pop flags off of stack
            ret                      ;return to caller
    __intrst endp
    
    __nop proc
            ret                      ;return to caller
    __nop endp
    Sorry, that was really bugging me.


  2. #17
    Registered User
    Join Date
    Feb 2002
    Posts
    329
    Thanks Bubba.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Is there a limit on the number of malloc calls ?
    By krissy in forum Windows Programming
    Replies: 3
    Last Post: 03-19-2006, 12:26 PM
  2. malloc() & address allocation
    By santechz in forum C Programming
    Replies: 6
    Last Post: 03-21-2005, 09:08 AM
  3. File systems?? (Winxp -> DOS)
    By Shadow in forum Tech Board
    Replies: 4
    Last Post: 01-06-2003, 09:08 PM
  4. DOS program versus DOS console program
    By scromer in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 01-10-2002, 01:42 PM
  5. Shut off DOS screen automatically to Windows
    By Unregistered in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 11-08-2001, 07:14 PM