2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
26 * Copyright 1993 NeXT Computer, Inc.
27 * All rights reserved.
29 * Harness for calling real-mode BIOS functions.
32 #include <architecture/i386/asm_help.h>
35 #define data32 .byte 0x66
36 #define addr32 .byte 0x67
62 /*============================================================================
63 * Call real-mode BIOS INT functions.
70 movl 8(%ebp), %edx // address of save area
71 movb O_INT(%edx), %al // save int number
74 movl O_EBX(%edx), %ebx
75 movl O_ECX(%edx), %ecx
76 movl O_EDI(%edx), %edi
77 movl O_ESI(%edx), %esi
78 movl O_EBP(%edx), %ebp
80 movl O_EAX(%edx), %eax
82 movl O_EDX(%edx), %eax
91 mov OFFSET16(new_eax), %eax
94 mov OFFSET16(new_edx), %edx
97 mov OFFSET16(new_es), %es
104 movl %eax, OFFSET16(save_eax)
105 popl %eax // actually pop %ax
107 movl %eax, OFFSET16(save_flag) // actually movw
110 movl %eax, OFFSET16(save_es) // actually movw
114 movl %edx, new_edx // save new edx before clobbering
116 movl new_edx, %eax // now move it into buffer
117 movl %eax, O_EDX(%edx)
119 movl %eax, O_EAX(%edx)
123 movw %ax, O_FLG(%edx)
124 movl %ebx, O_EBX(%edx)
125 movl %ecx, O_ECX(%edx)
126 movl %edi, O_EDI(%edx)
127 movl %esi, O_ESI(%edx)
128 movl %ebp, O_EBP(%edx)