Source

mutated_ocaml / asmrun / i386nt.asm

Diff from to

File asmrun/i386nt.asm

 ;*                                                                     *
 ;***********************************************************************
 
-; $Id: i386nt.asm 12149 2012-02-10 16:15:24Z doligez $
+; $Id: i386nt.asm 12800 2012-07-30 18:59:07Z doligez $
 
 ; Asm part of the runtime system, Intel 386 processor, Intel syntax
 
-	.386
-	.MODEL FLAT
+        .386
+        .MODEL FLAT
 
         EXTERN  _caml_garbage_collection: PROC
         EXTERN  _caml_apply2: PROC
         EXTERN  _caml_array_bound_error: PROC
         EXTERN  _caml_young_limit: DWORD
         EXTERN  _caml_young_ptr: DWORD
-        EXTERN	_caml_bottom_of_stack: DWORD
-        EXTERN	_caml_last_return_address: DWORD
-        EXTERN	_caml_gc_regs: DWORD
-	EXTERN	_caml_exception_pointer: DWORD
+        EXTERN  _caml_bottom_of_stack: DWORD
+        EXTERN  _caml_last_return_address: DWORD
+        EXTERN  _caml_gc_regs: DWORD
+        EXTERN  _caml_exception_pointer: DWORD
         EXTERN  _caml_backtrace_active: DWORD
         EXTERN  _caml_stash_backtrace: PROC
 
         PUBLIC  _caml_alloc2
         PUBLIC  _caml_alloc3
         PUBLIC  _caml_allocN
-	PUBLIC  _caml_call_gc
+        PUBLIC  _caml_call_gc
 
 _caml_call_gc:
     ; Record lowest stack address and return address
-        mov	eax, [esp]
+        mov     eax, [esp]
         mov     _caml_last_return_address, eax
         lea     eax, [esp+4]
         mov     _caml_bottom_of_stack, eax
         push    eax
         mov     _caml_gc_regs, esp
     ; Call the garbage collector
-        call	_caml_garbage_collection
+        call    _caml_garbage_collection
     ; Restore all regs used by the code generator
-	pop     eax
+        pop     eax
         pop     ebx
         pop     ecx
         pop     edx
 
         ALIGN  4
 _caml_alloc1:
-        mov	eax, _caml_young_ptr
-        sub	eax, 8
-        mov	_caml_young_ptr, eax
-        cmp	eax, _caml_young_limit
-        jb	L100
+        mov     eax, _caml_young_ptr
+        sub     eax, 8
+        mov     _caml_young_ptr, eax
+        cmp     eax, _caml_young_limit
+        jb      L100
         ret
-L100:   mov	eax, [esp]
+L100:   mov     eax, [esp]
         mov     _caml_last_return_address, eax
         lea     eax, [esp+4]
         mov     _caml_bottom_of_stack, eax
 
         ALIGN  4
 _caml_alloc2:
-        mov	eax, _caml_young_ptr
-        sub	eax, 12
-        mov	_caml_young_ptr, eax
-        cmp	eax, _caml_young_limit
-        jb	L101
+        mov     eax, _caml_young_ptr
+        sub     eax, 12
+        mov     _caml_young_ptr, eax
+        cmp     eax, _caml_young_limit
+        jb      L101
         ret
-L101:   mov	eax, [esp]
+L101:   mov     eax, [esp]
         mov     _caml_last_return_address, eax
         lea     eax, [esp+4]
         mov     _caml_bottom_of_stack, eax
 
         ALIGN  4
 _caml_alloc3:
-        mov	eax, _caml_young_ptr
-        sub	eax, 16
-        mov	_caml_young_ptr, eax
-        cmp	eax, _caml_young_limit
-        jb	L102
+        mov     eax, _caml_young_ptr
+        sub     eax, 16
+        mov     _caml_young_ptr, eax
+        cmp     eax, _caml_young_limit
+        jb      L102
         ret
-L102:   mov	eax, [esp]
+L102:   mov     eax, [esp]
         mov     _caml_last_return_address, eax
         lea     eax, [esp+4]
         mov     _caml_bottom_of_stack, eax
         neg     eax                     ; eax = size
         push    eax                     ; save desired size
         sub     _caml_young_ptr, eax         ; must update young_ptr
-        mov	eax, [esp+4]
+        mov     eax, [esp+4]
         mov     _caml_last_return_address, eax
         lea     eax, [esp+8]
         mov     _caml_bottom_of_stack, eax
         ALIGN  4
 _caml_c_call:
     ; Record lowest stack address and return address
-        mov	edx, [esp]
-        mov	_caml_last_return_address, edx
-        lea	edx, [esp+4]
-        mov	_caml_bottom_of_stack, edx
+        mov     edx, [esp]
+        mov     _caml_last_return_address, edx
+        lea     edx, [esp+4]
+        mov     _caml_bottom_of_stack, edx
     ; Call the function (address in %eax)
-        jmp	eax
+        jmp     eax
 
 ; Start the OCaml program
 
         ALIGN  4
 _caml_start_program:
     ; Save callee-save registers
-        push	ebx
-        push	esi
-        push	edi
-        push	ebp
+        push    ebx
+        push    esi
+        push    edi
+        push    ebp
     ; Initial code pointer is caml_program
         mov     esi, offset _caml_program
 
 L106:
     ; Build a callback link
         push    _caml_gc_regs
-        push	_caml_last_return_address
-        push	_caml_bottom_of_stack
+        push    _caml_last_return_address
+        push    _caml_bottom_of_stack
     ; Build an exception handler
-        push	L108
-        push	_caml_exception_pointer
-        mov	_caml_exception_pointer, esp
+        push    L108
+        push    _caml_exception_pointer
+        mov     _caml_exception_pointer, esp
     ; Call the OCaml code
-        call	esi
+        call    esi
 L107:
     ; Pop the exception handler
-        pop	_caml_exception_pointer
-        pop	esi             ; dummy register
+        pop     _caml_exception_pointer
+        pop     esi             ; dummy register
 L109:
     ; Pop the callback link, restoring the global variables
     ; used by caml_c_call
-        pop	_caml_bottom_of_stack
-        pop	_caml_last_return_address
+        pop     _caml_bottom_of_stack
+        pop     _caml_last_return_address
         pop     _caml_gc_regs
     ; Restore callee-save registers.
-        pop	ebp
-        pop	edi
-        pop	esi
-        pop	ebx
+        pop     ebp
+        pop     edi
+        pop     esi
+        pop     ebx
     ; Return to caller.
         ret
 L108:
 _caml_raise_exn:
         test    _caml_backtrace_active, 1
         jne     L110
-        mov	esp, _caml_exception_pointer
-        pop	_caml_exception_pointer
+        mov     esp, _caml_exception_pointer
+        pop     _caml_exception_pointer
         ret
 L110:
         mov     esi, eax                ; Save exception bucket in esi
 _caml_raise_exception:
         test    _caml_backtrace_active, 1
         jne     L111
-        mov	eax, [esp+4]
-        mov	esp, _caml_exception_pointer
-        pop	_caml_exception_pointer
+        mov     eax, [esp+4]
+        mov     esp, _caml_exception_pointer
+        pop     _caml_exception_pointer
         ret
 L111:
         mov     esi, [esp+4]            ; Save exception bucket in esi
         ALIGN  4
 _caml_callback_exn:
     ; Save callee-save registers
-        push	ebx
-        push	esi
-        push	edi
-        push	ebp
+        push    ebx
+        push    esi
+        push    edi
+        push    ebp
     ; Initial loading of arguments
-        mov	ebx, [esp+20]   ; closure
-        mov	eax, [esp+24]   ; argument
-        mov	esi, [ebx]      ; code pointer
+        mov     ebx, [esp+20]   ; closure
+        mov     eax, [esp+24]   ; argument
+        mov     esi, [ebx]      ; code pointer
         jmp     L106
 
         PUBLIC  _caml_callback2_exn
         ALIGN  4
 _caml_callback2_exn:
     ; Save callee-save registers
-        push	ebx
-        push	esi
-        push	edi
-        push	ebp
+        push    ebx
+        push    esi
+        push    edi
+        push    ebp
     ; Initial loading of arguments
-        mov	ecx, [esp+20]   ; closure
-        mov	eax, [esp+24]   ; first argument
-        mov	ebx, [esp+28]   ; second argument
-        mov	esi, offset _caml_apply2   ; code pointer
-        jmp	L106
+        mov     ecx, [esp+20]   ; closure
+        mov     eax, [esp+24]   ; first argument
+        mov     ebx, [esp+28]   ; second argument
+        mov     esi, offset _caml_apply2   ; code pointer
+        jmp     L106
 
         PUBLIC  _caml_callback3_exn
-        ALIGN	4
+        ALIGN   4
 _caml_callback3_exn:
     ; Save callee-save registers
-        push	ebx
-        push	esi
-        push	edi
-        push	ebp
+        push    ebx
+        push    esi
+        push    edi
+        push    ebp
     ; Initial loading of arguments
-        mov	edx, [esp+20]   ; closure
-        mov	eax, [esp+24]   ; first argument
-        mov	ebx, [esp+28]   ; second argument
-        mov	ecx, [esp+32]   ; third argument
-        mov	esi, offset _caml_apply3   ; code pointer
-        jmp	L106
+        mov     edx, [esp+20]   ; closure
+        mov     eax, [esp+24]   ; first argument
+        mov     ebx, [esp+28]   ; second argument
+        mov     ecx, [esp+32]   ; third argument
+        mov     esi, offset _caml_apply3   ; code pointer
+        jmp     L106
 
         PUBLIC  _caml_ml_array_bound_error
         ALIGN   4