malloc() under DOS

This is a discussion on malloc() under DOS within the A Brief History of Cprogramming.com forums, part of the Community Boards category; Code: __inton proc sti ;enables interrupts ret ;return to caller __inton endp __intoff proc pushf ;push flags onto stack pop ...

  1. #16
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,586
    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.

Page 2 of 2 FirstFirst 12
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, 11:26 AM
  2. malloc() & address allocation
    By santechz in forum C Programming
    Replies: 6
    Last Post: 03-21-2005, 08:08 AM
  3. File systems?? (Winxp -> DOS)
    By Shadow in forum Tech Board
    Replies: 4
    Last Post: 01-06-2003, 08: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, 12: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, 06:14 PM

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