⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 swtch.s

📁 美国mit操作系统课程所用的一个教学操作系统xv6
💻 S
字号:
#   void swtch(struct context *old, struct context *new);#  # Save current register context in old# and then load register context from new..globl swtchswtch:  # Save old registers  movl 4(%esp), %eax  popl 0(%eax)  # %eip  movl %esp, 4(%eax)  movl %ebx, 8(%eax)  movl %ecx, 12(%eax)  movl %edx, 16(%eax)  movl %esi, 20(%eax)  movl %edi, 24(%eax)  movl %ebp, 28(%eax)  # Load new registers  movl 4(%esp), %eax  # not 8(%esp) - popped return address above  movl 28(%eax), %ebp  movl 24(%eax), %edi  movl 20(%eax), %esi  movl 16(%eax), %edx  movl 12(%eax), %ecx  movl 8(%eax), %ebx  movl 4(%eax), %esp  pushl 0(%eax)  # %eip  ret

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -