home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / historic / v941.tgz / icon.v941src.tar / icon.v941src / config / unix / linux / i686.s < prev    next >
Text File  |  2002-01-25  |  742b  |  45 lines

  1. #
  2. #  Assembler source for context switch using gas 1.38.1 + gcc 1.40 on
  3. #  Xenix/386, revamped slightly for use with Linux by me (Richard Goer-
  4. #  witz) on 7/25/94.
  5. #
  6.  
  7. .file    "rswitch.s"
  8. .data 1
  9. .LC0:
  10.     .byte 0x6e,0x65,0x77,0x5f,0x63,0x6f,0x6e,0x74,0x65,0x78
  11.     .byte 0x74,0x28,0x29,0x20,0x72,0x65,0x74,0x75,0x72,0x6e
  12.     .byte 0x65,0x64,0x20,0x69,0x6e,0x20,0x63,0x6f,0x73,0x77
  13.     .byte 0x69,0x74,0x63,0x68,0x0
  14. .text
  15.     .align 4
  16. .globl coswitch
  17.  
  18.  
  19. coswitch:
  20.     pushl %ebp
  21.     movl %esp,%ebp
  22.     movl 8(%ebp),%eax
  23.     movl %esp,0(%eax)
  24.     movl %ebp,4(%eax)
  25.     movl 12(%ebp),%eax
  26.     cmpl $0,16(%ebp)
  27.     movl 0(%eax),%esp
  28.     je .L2
  29.  
  30.     movl 4(%eax),%ebp
  31.     jmp .L1
  32.  
  33. .L2:
  34.     movl $0,%ebp
  35.     pushl $0
  36.     pushl $0
  37.     call new_context
  38.     pushl $.LC0
  39.     call syserr
  40.     addl $12,%esp
  41.  
  42. .L1:
  43.     leave
  44.     ret
  45.