2 * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights
7 * Reserved. This file contains Original Code and/or Modifications of
8 * Original Code as defined in and that are subject to the Apple Public
9 * Source License Version 2.0 (the "License"). You may not use this file
10 * except in compliance with the License. Please obtain a copy of the
11 * License at http://www.apple.com/publicsource and read it before using
14 * The Original Code and all software distributed under the License are
15 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
19 * License for the specific language governing rights and limitations
22 * @APPLE_LICENSE_HEADER_END@
25 * Copyright 1993 NeXT Computer, Inc.
26 * All rights reserved.
28 * Harness for calling real-mode BIOS functions.
31 #include <architecture/i386/asm_help.h>
34 #define data32 .byte 0x66
35 #define addr32 .byte 0x67
61 /*============================================================================
62 * Call real-mode BIOS INT functions.
69 movl 8(%ebp), %edx // address of save area
70 movb O_INT(%edx), %al // save int number
73 movl O_EBX(%edx), %ebx
74 movl O_ECX(%edx), %ecx
75 movl O_EDI(%edx), %edi
76 movl O_ESI(%edx), %esi
77 movl O_EBP(%edx), %ebp
79 movl O_EAX(%edx), %eax
81 movl O_EDX(%edx), %eax
90 mov OFFSET1U16(new_eax), %eax
93 mov OFFSET1U16(new_edx), %edx
96 mov OFFSET1U16(new_es), %es
103 movl %eax, OFFSET1U16(save_eax)
104 popl %eax // actually pop %ax
106 movl %eax, OFFSET1U16(save_flag) // actually movw
109 movl %eax, OFFSET1U16(save_es) // actually movw
113 movl %edx, new_edx // save new edx before clobbering
115 movl new_edx, %eax // now move it into buffer
116 movl %eax, O_EDX(%edx)
118 movl %eax, O_EAX(%edx)
122 movw %ax, O_FLG(%edx)
123 movl %ebx, O_EBX(%edx)
124 movl %ecx, O_ECX(%edx)
125 movl %edi, O_EDI(%edx)
126 movl %esi, O_ESI(%edx)
127 movl %ebp, O_EBP(%edx)