code stringlengths 2 1.05M | repo_name stringlengths 5 101 | path stringlengths 4 991 | language stringclasses 3 values | license stringclasses 5 values | size int64 2 1.05M |
|---|---|---|---|---|---|
; The MIT License (MIT)
;
; Copyright (c) 2014 Microsoft
;
; Permission is hereby granted, free of charge, to any person obtaining a copy
; of this software and associated documentation files (the "Software"), to deal
; in the Software without restriction, including without limitation the rights
; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
; copies of the Software, and to permit persons to whom the Software is
; furnished to do so, subject to the following conditions:
;
; The above copyright notice and this permission notice shall be included in all
; copies or substantial portions of the Software.
;
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
; SOFTWARE.
;
; Author: Mark Gottscho <mgottscho@ucla.edu>
.code
win_x86_64_asm_forwSequentialRead_Word256 proc
; Arguments:
; rcx is address of the first 256-bit word in the array
; rdx is address of the last 256-bit word in the array
; rax holds current 256-bit word address
; ymm0 holds result from reading the memory 256-bit wide
mov rax,rcx ; initialize current word address to start of the array
cmp rax,rdx ; have we reached the last word yet?
jae done ; if current word address is >= last word address, jump to done
myloop:
vmovdqa ymm0, ymmword ptr [rax] ; Unroll 128 loads of 256-bit words (32 bytes is 20h) before checking loop condition.
vmovdqa ymm0, ymmword ptr [rax+0020h]
vmovdqa ymm0, ymmword ptr [rax+0040h]
vmovdqa ymm0, ymmword ptr [rax+0060h]
vmovdqa ymm0, ymmword ptr [rax+0080h]
vmovdqa ymm0, ymmword ptr [rax+00A0h]
vmovdqa ymm0, ymmword ptr [rax+00C0h]
vmovdqa ymm0, ymmword ptr [rax+00E0h]
vmovdqa ymm0, ymmword ptr [rax+0100h]
vmovdqa ymm0, ymmword ptr [rax+0120h]
vmovdqa ymm0, ymmword ptr [rax+0140h]
vmovdqa ymm0, ymmword ptr [rax+0160h]
vmovdqa ymm0, ymmword ptr [rax+0180h]
vmovdqa ymm0, ymmword ptr [rax+01A0h]
vmovdqa ymm0, ymmword ptr [rax+01C0h]
vmovdqa ymm0, ymmword ptr [rax+01E0h]
vmovdqa ymm0, ymmword ptr [rax+0200h]
vmovdqa ymm0, ymmword ptr [rax+0220h]
vmovdqa ymm0, ymmword ptr [rax+0240h]
vmovdqa ymm0, ymmword ptr [rax+0260h]
vmovdqa ymm0, ymmword ptr [rax+0280h]
vmovdqa ymm0, ymmword ptr [rax+02A0h]
vmovdqa ymm0, ymmword ptr [rax+02C0h]
vmovdqa ymm0, ymmword ptr [rax+02E0h]
vmovdqa ymm0, ymmword ptr [rax+0300h]
vmovdqa ymm0, ymmword ptr [rax+0320h]
vmovdqa ymm0, ymmword ptr [rax+0340h]
vmovdqa ymm0, ymmword ptr [rax+0360h]
vmovdqa ymm0, ymmword ptr [rax+0380h]
vmovdqa ymm0, ymmword ptr [rax+03A0h]
vmovdqa ymm0, ymmword ptr [rax+03C0h]
vmovdqa ymm0, ymmword ptr [rax+03E0h]
vmovdqa ymm0, ymmword ptr [rax+0400h]
vmovdqa ymm0, ymmword ptr [rax+0420h]
vmovdqa ymm0, ymmword ptr [rax+0440h]
vmovdqa ymm0, ymmword ptr [rax+0460h]
vmovdqa ymm0, ymmword ptr [rax+0480h]
vmovdqa ymm0, ymmword ptr [rax+04A0h]
vmovdqa ymm0, ymmword ptr [rax+04C0h]
vmovdqa ymm0, ymmword ptr [rax+04E0h]
vmovdqa ymm0, ymmword ptr [rax+0500h]
vmovdqa ymm0, ymmword ptr [rax+0520h]
vmovdqa ymm0, ymmword ptr [rax+0540h]
vmovdqa ymm0, ymmword ptr [rax+0560h]
vmovdqa ymm0, ymmword ptr [rax+0580h]
vmovdqa ymm0, ymmword ptr [rax+05A0h]
vmovdqa ymm0, ymmword ptr [rax+05C0h]
vmovdqa ymm0, ymmword ptr [rax+05E0h]
vmovdqa ymm0, ymmword ptr [rax+0600h]
vmovdqa ymm0, ymmword ptr [rax+0620h]
vmovdqa ymm0, ymmword ptr [rax+0640h]
vmovdqa ymm0, ymmword ptr [rax+0660h]
vmovdqa ymm0, ymmword ptr [rax+0680h]
vmovdqa ymm0, ymmword ptr [rax+06A0h]
vmovdqa ymm0, ymmword ptr [rax+06C0h]
vmovdqa ymm0, ymmword ptr [rax+06E0h]
vmovdqa ymm0, ymmword ptr [rax+0700h]
vmovdqa ymm0, ymmword ptr [rax+0720h]
vmovdqa ymm0, ymmword ptr [rax+0740h]
vmovdqa ymm0, ymmword ptr [rax+0760h]
vmovdqa ymm0, ymmword ptr [rax+0780h]
vmovdqa ymm0, ymmword ptr [rax+07A0h]
vmovdqa ymm0, ymmword ptr [rax+07C0h]
vmovdqa ymm0, ymmword ptr [rax+07E0h]
vmovdqa ymm0, ymmword ptr [rax+0800h]
vmovdqa ymm0, ymmword ptr [rax+0820h]
vmovdqa ymm0, ymmword ptr [rax+0840h]
vmovdqa ymm0, ymmword ptr [rax+0860h]
vmovdqa ymm0, ymmword ptr [rax+0880h]
vmovdqa ymm0, ymmword ptr [rax+08A0h]
vmovdqa ymm0, ymmword ptr [rax+08C0h]
vmovdqa ymm0, ymmword ptr [rax+08E0h]
vmovdqa ymm0, ymmword ptr [rax+0900h]
vmovdqa ymm0, ymmword ptr [rax+0920h]
vmovdqa ymm0, ymmword ptr [rax+0940h]
vmovdqa ymm0, ymmword ptr [rax+0960h]
vmovdqa ymm0, ymmword ptr [rax+0980h]
vmovdqa ymm0, ymmword ptr [rax+09A0h]
vmovdqa ymm0, ymmword ptr [rax+09C0h]
vmovdqa ymm0, ymmword ptr [rax+09E0h]
vmovdqa ymm0, ymmword ptr [rax+0A00h]
vmovdqa ymm0, ymmword ptr [rax+0A20h]
vmovdqa ymm0, ymmword ptr [rax+0A40h]
vmovdqa ymm0, ymmword ptr [rax+0A60h]
vmovdqa ymm0, ymmword ptr [rax+0A80h]
vmovdqa ymm0, ymmword ptr [rax+0AA0h]
vmovdqa ymm0, ymmword ptr [rax+0AC0h]
vmovdqa ymm0, ymmword ptr [rax+0AE0h]
vmovdqa ymm0, ymmword ptr [rax+0B00h]
vmovdqa ymm0, ymmword ptr [rax+0B20h]
vmovdqa ymm0, ymmword ptr [rax+0B40h]
vmovdqa ymm0, ymmword ptr [rax+0B60h]
vmovdqa ymm0, ymmword ptr [rax+0B80h]
vmovdqa ymm0, ymmword ptr [rax+0BA0h]
vmovdqa ymm0, ymmword ptr [rax+0BC0h]
vmovdqa ymm0, ymmword ptr [rax+0BE0h]
vmovdqa ymm0, ymmword ptr [rax+0C00h]
vmovdqa ymm0, ymmword ptr [rax+0C20h]
vmovdqa ymm0, ymmword ptr [rax+0C40h]
vmovdqa ymm0, ymmword ptr [rax+0C60h]
vmovdqa ymm0, ymmword ptr [rax+0C80h]
vmovdqa ymm0, ymmword ptr [rax+0CA0h]
vmovdqa ymm0, ymmword ptr [rax+0CC0h]
vmovdqa ymm0, ymmword ptr [rax+0CE0h]
vmovdqa ymm0, ymmword ptr [rax+0D00h]
vmovdqa ymm0, ymmword ptr [rax+0D20h]
vmovdqa ymm0, ymmword ptr [rax+0D40h]
vmovdqa ymm0, ymmword ptr [rax+0D60h]
vmovdqa ymm0, ymmword ptr [rax+0D80h]
vmovdqa ymm0, ymmword ptr [rax+0DA0h]
vmovdqa ymm0, ymmword ptr [rax+0DC0h]
vmovdqa ymm0, ymmword ptr [rax+0DE0h]
vmovdqa ymm0, ymmword ptr [rax+0E00h]
vmovdqa ymm0, ymmword ptr [rax+0E20h]
vmovdqa ymm0, ymmword ptr [rax+0E40h]
vmovdqa ymm0, ymmword ptr [rax+0E60h]
vmovdqa ymm0, ymmword ptr [rax+0E80h]
vmovdqa ymm0, ymmword ptr [rax+0EA0h]
vmovdqa ymm0, ymmword ptr [rax+0EC0h]
vmovdqa ymm0, ymmword ptr [rax+0EE0h]
vmovdqa ymm0, ymmword ptr [rax+0F00h]
vmovdqa ymm0, ymmword ptr [rax+0F20h]
vmovdqa ymm0, ymmword ptr [rax+0F40h]
vmovdqa ymm0, ymmword ptr [rax+0F60h]
vmovdqa ymm0, ymmword ptr [rax+0F80h]
vmovdqa ymm0, ymmword ptr [rax+0FA0h]
vmovdqa ymm0, ymmword ptr [rax+0FC0h]
vmovdqa ymm0, ymmword ptr [rax+0FE0h]
add rax,1000h ; End of one unrolled loop iteration. Increment pointer by 128 words of size 32 bytes, which is 4096 bytes.
cmp rax,rdx ; have we reached the last word yet?
jae done ; if current word address is >= last word address, jump to done
jmp myloop ; continue loop
done:
xor eax,eax ; return 0
ret
win_x86_64_asm_forwSequentialRead_Word256 endp
end
| Microsoft/X-Mem | src/win/x86_64/win_x86_64_asm_forwSequentialRead_Word256.asm | Assembly | mit | 7,564 |
;******************************************************************************
;* SIMD-optimized fullpel functions
;* Copyright (c) 2008 Loren Merritt
;* Copyright (c) 2003-2013 Michael Niedermayer
;* Copyright (c) 2013 Daniel Kang
;*
;* This file is part of FFmpeg.
;*
;* FFmpeg is free software; you can redistribute it and/or
;* modify it under the terms of the GNU Lesser General Public
;* License as published by the Free Software Foundation; either
;* version 2.1 of the License, or (at your option) any later version.
;*
;* FFmpeg is distributed in the hope that it will be useful,
;* but WITHOUT ANY WARRANTY; without even the implied warranty of
;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;* Lesser General Public License for more details.
;*
;* You should have received a copy of the GNU Lesser General Public
;* License along with FFmpeg; if not, write to the Free Software
;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
;******************************************************************************
%include "libavutil/x86/x86util.asm"
SECTION .text
%macro PAVGB_MMX 4
LOAD %3, %1
por %3, %2
pxor %2, %1
pand %2, %4
psrlq %2, 1
psubb %3, %2
SWAP %2, %3
%endmacro
; void ff_put/avg_pixels(uint8_t *block, const uint8_t *pixels,
; ptrdiff_t line_size, int h)
%macro OP_PIXELS 2
%if %2 == mmsize/2
%define LOAD movh
%define SAVE movh
%define LEN mmsize
%else
%define LOAD movu
%define SAVE mova
%define LEN %2
%endif
cglobal %1_pixels%2, 4,5,4
lea r4, [r2*3]
%ifidn %1, avg
%if notcpuflag(mmxext)
pcmpeqd m6, m6
paddb m6, m6
%endif
%endif
.loop:
%assign %%i 0
%rep LEN/mmsize
LOAD m0, [r1 + %%i]
LOAD m1, [r1+r2 + %%i]
LOAD m2, [r1+r2*2 + %%i]
LOAD m3, [r1+r4 + %%i]
%ifidn %1, avg
%if notcpuflag(mmxext)
PAVGB_MMX [r0 + %%i], m0, m4, m6
PAVGB_MMX [r0+r2 + %%i], m1, m5, m6
PAVGB_MMX [r0+r2*2 + %%i], m2, m4, m6
PAVGB_MMX [r0+r4 + %%i], m3, m5, m6
%else
pavgb m0, [r0 + %%i]
pavgb m1, [r0+r2 + %%i]
pavgb m2, [r0+r2*2 + %%i]
pavgb m3, [r0+r4 + %%i]
%endif
%endif
SAVE [r0 + %%i], m0
SAVE [r0+r2 + %%i], m1
SAVE [r0+r2*2 + %%i], m2
SAVE [r0+r4 + %%i], m3
%assign %%i %%i+mmsize
%endrep
sub r3d, 4
lea r1, [r1+r2*4]
lea r0, [r0+r2*4]
jne .loop
RET
%endmacro
INIT_MMX mmx
OP_PIXELS put, 4
OP_PIXELS avg, 4
OP_PIXELS put, 8
OP_PIXELS avg, 8
OP_PIXELS put, 16
OP_PIXELS avg, 16
INIT_MMX mmxext
OP_PIXELS avg, 4
OP_PIXELS avg, 8
OP_PIXELS avg, 16
INIT_XMM sse2
OP_PIXELS put, 16
OP_PIXELS avg, 16
| endlessm/chromium-browser | third_party/ffmpeg/libavcodec/x86/fpel.asm | Assembly | bsd-3-clause | 2,768 |
; Game code
; Linux 32 bit
;-----------------------------------
; int nameEasterEgg()
;-----------------------------------
;nameEasterEgg:
;mov eax, name
;mov ebx, egg_name
;call strcmp
;ret | amittaigames/asmgame | linux32/libs/game.asm | Assembly | mit | 214 |
TITLE Linear/Sequential search implemented in x86 assembly (MASM)
; Search for a value in an array of bytes by comparing each value with a key
; return the position of the key
; O(n) time complexity
; the address of the first element in the array must be in the edx
; and the arrays length in the ecx register
; the index of the key is returned in the eax register
.386 ; minimum CPU required to run the program
.model flat, stdcall ; identifies the memory model for the program,
; in this case its protected mode. It also tells which
; calling convention to use for procedures
.stack 4096
.data
data db 42, 40, 70, 90, 62, 70, 40 ; our array of data
.code
; implementation of sequential search
SequentialSearch PROC
xor eax, eax ; clear eax register just in case
BEGIN_LOOP:
cmp BYTE PTR[edx], bl ; if [edx] == bl
je FOUND ; then goto FOUND
inc eax ; else increment eax
inc edx ; increment edx
loop BEGIN_LOOP ; automatically decrements ecx register
FOUND:
ret
SequentialSearch ENDP
; entry point
main PROC
mov bl, 90 ; search for 92 in array
mov edx, OFFSET data
mov ecx, LENGTHOF data
call SequentialSearch
main ENDP
END main
| kennyledet/Algorithm-Implementations | Linear_Search/x86_Asm/mike168m/linear_search.asm | Assembly | mit | 1,206 |
.386p
descriptor struc
limit_1 dw 0 ; Limit (0 - 15).
base_1 dw 0 ; Base (0 - 15).
base_2 db 0 ; Base (16 - 23).
attr db 0 ; Attributes.
bt6 db 0 ; Limit_2 (0 - 3), Attributes (4 - 7).
base_3 db 0 ; Base (24 - 31).
descriptor ends
;----------------------------------------------------------------------
dt_pointer struc
limit dw 0
address dd 0
dt_pointer ends
;----------------------------------------------------------------------
attr_code_seg equ 10011010b
attr_data_seg equ 10010010b
attr_ro_data_seg equ 10010000b
attr_data_dpl equ 10110010b
S_sw0 equ 10010110b ; Writable stack segment
;----------------------------------------------------------------------
_ST segment use16
db 1000 dup (0)
Top_stp equ $
_ST ends
;----------------------------------------------------------------------
gdt segment para public 'data' use16
assume ds: gdt
selector0 descriptor <>
descriptor_gdt descriptor <> ; global descriptors
descriptor_ds descriptor <> ; _data
descriptor_es descriptor <> ; 0b8000h
descr_ss descriptor <>
descriptor_undefined descriptor <>
descriptor_cs descriptor <> ;code
descriptor_int_code descriptor <> ; int code
descriptor_absent descriptor <>
descriptor_fs descriptor <> ; try
descriptor_gs descriptor <> ; try
descr_t7 descriptor <>
descr_t14 descriptor <>
gdt_size equ $ - selector0 - 1
gdt ends
;----------------------------------------------------------------------
idt segment para public 'data' use16
vector = 0
rept 256
dw vector * proc_int_size ; çì³ùåííÿ ïðîöåäóðè
dw offset descriptor_int_code ; ñåëåêòîð äåñêðèïòîðà â GDT
db 0 ; çàâæäè 0
db 10001111b ; áàéò àòðèáóò³â - øëþç ïàñòêè; change dpl=1
dw 0 ; âñ³ ïðîöåäóðè ðîçì³ùóþòüñÿ â ïåðøèõ 64Ê
vector = vector + 1
endm
idt ends
;----------------------------------------------------------------------
_readonly_data segment public 'data' use16
assume fs: _readonly_data
val dd 0
readonly_data_size = 4
_readonly_data ends
;----------------------------------------------------------------------
_dpl1_data segment public 'data' use16
assume gs:_dpl1_data
just_something dd ?
dpl_size = $ - _dpl1_data
_dpl1_data ends
;----------------------------------------------------------------------
_data segment public 'data' use16
assume ds: _data
data_start label dt_pointer
gdt_pointer dt_pointer <>
idt_pointer dt_pointer <>
Top_real_mode dd 0
message db "Hello from protected mode!"
message_len = $ - message
data_size = $ - data_start
_data ends
;----------------------------------------------------------------------
_interrupt_code segment para public 'code' use16
assume cs: _interrupt_code
vector = 0
int_begin:
pusha
push bx
push 2480
call show
mov ax, vector
jmp common_int
int_end:
proc_int_size = int_end - int_begin
vector = 1
rept 255
pusha
push bx
push 2480
call show
mov ax, vector
jmp common_int
vector = vector + 1
endm
int_msg db 'INTERRUPT N'
common_int:
cld
mov cl, 10
div cl ; ìîëîäøà öèôðà â ah
or ah, 30h ; ôîðìóâàííÿ òåêñòîâîãî êîäó öèôðè
mov bh, ah
xor ah, ah
div cl ; ñåðåäíÿ öèôðà â ah, ñòàðøà - â al
or ax, 3030h ; ôîðìóâàííÿ òåêñòîâîãî êîäó öèôð
mov dx, ax
; âèâåäåííÿ ïîâ³äîìëåííÿ íà åêðàí
push offset descriptor_es ; ñåëåêòîð äåñêðèïòîðà ³ç 1-ãî åòàïó
pop es
mov si, offset int_msg
mov cx, 11
mov di, 2620 ;ïî÷àòêîâà àäðåñà äëÿ âèâåäåííÿ
mov ah, 07h ;àòðèáóò ñèìâîë³â
outstr:
mov al, cs:[si]
stosw
inc si
loop outstr
mov al, ' '
stosw
mov al, dl ;ñòàðøà äåñÿòêîâà öèôðà íîìåðà âåêòîðà
stosw
mov al, dh ;ñåðåäíÿ äåñÿòêîâà öèôðà íîìåðà âåêòîðà
stosw
mov al, bh ;ìîëîäøà äåñÿòêîâà öèôðà íîìåðà âåêòîðà
stosw
; ï³ñëÿ âèâåäåííÿ ïîâ³äîìëåííÿ îðãàí³çóºìî ïåðåäà÷ó óïðàâë³ííÿ
; â îñíîâíèé ñåãìåíò äëÿ ïåðåêëþ÷åííÿ â ðåæèì ðåàëüíèõ àäðåñ
; Äëÿ öüîãî âèêîðèñòàºìî êîìàíäó IRET
;  äàí³é òî÷ö³ ïðîãðàìè â ñòåê çàïèñàíî âì³ñò âñ³õ ðåã³ñòð³â, àäðåñà
; êîìàíäè, ÿêà âèçâàëà âèêëþ÷åííÿ, òà âì³ñò ðåã³ñòðà îçíàê.
; Ìè âñå öå ïðî³ãíîðóºìî ³ çàïèøåìî â ñòåê íîâ³ äàí³
pushf
push offset descriptor_cs ; ñåëåêòîð äåñêðèïòîðà ñåãìåíòà
; êîä³â ³ç 1-ãî åòàïó
push offset dos_return
iret ; ïåðåäà÷à óïðàâë³ííÿ ïî àäðåñ³ return_dos îñíîâíîãî ñåãìåíòà êîä³â
show proc near
push bp
mov bp,sp
pusha
push es
mov ax,offset descriptor_es
mov es,ax
std
ls20:
mov di,[bp+4]
mov bx,[bp+6]
mov cx,4
mov ah,0ah
ls40:
mov al,bl
and al,00001111b
cmp al,10
jl ls100
add al,7
ls100:
add al,30h
stosw
shr bx,4
loop ls40
pop es
popa
pop bp
ret 4
show endp
common_int_end:
int_code_size = common_int_end - int_begin
_interrupt_code ends
;----------------------------------------------------------------------
_code segment byte public 'code' use16
assume cs: _code
main:
mov ax, _data
mov ds,ax
mov ax,3h
int 10h
mov eax, cr0
test al, 1
jnz already_protected
; Create descriptors.
mov ax, gdt
mov ds, ax
assume ds: gdt
; GDT descriptor.
mov word ptr [descriptor_gdt.limit_1], gdt_size
xor eax, eax
mov ax, gdt
shl eax, 4
mov dword ptr [descriptor_gdt.base_1], eax
mov byte ptr [descriptor_gdt.attr], attr_data_seg
; Code descriptor.
mov word ptr [descriptor_cs.limit_1], code_size
xor eax, eax
mov ax, _code
shl eax, 4
mov dword ptr [descriptor_cs.base_1], eax
mov byte ptr [descriptor_cs.attr], attr_code_seg
; DS descriptor.
mov word ptr [descriptor_ds.limit_1], data_size
xor eax, eax
mov ax, _data
shl eax, 4
mov dword ptr [descriptor_ds.base_1], eax
mov byte ptr [descriptor_ds.attr], attr_data_seg
; _ST segment descr
mov descr_ss.limit_1, 10
xor eax, eax
mov ax, _ST
shl eax, 4
mov dword ptr descr_ss.base_1, eax
mov descr_ss.attr, S_sw0
; absent descriptor.
mov word ptr [descriptor_absent.limit_1], data_size
xor eax, eax
mov ax, _data
shl eax, 4
mov dword ptr [descriptor_absent.base_1], eax
mov byte ptr [descriptor_absent.attr], attr_data_seg
and byte ptr [descriptor_absent.attr], 01111111b
; GS descriptor.
mov word ptr [descriptor_gs.limit_1], dpl_size
xor eax, eax
mov ax, _dpl1_data
shl eax, 4
mov dword ptr [descriptor_gs.base_1], eax
mov byte ptr [descriptor_gs.attr], attr_data_dpl
; ES descriptor.
mov word ptr [descriptor_es.limit_1], 0ffffh
mov dword ptr [descriptor_es.base_1], 0b8000h
mov byte ptr [descriptor_es.attr], attr_data_seg
; Interrupt descriptor
mov word ptr [descriptor_int_code.limit_1], int_code_size
xor eax, eax
mov ax, _interrupt_code
shl eax, 4
mov dword ptr [descriptor_int_code.base_1], eax
mov byte ptr [descriptor_int_code.attr], attr_code_seg
; FS descriptor
mov word ptr [descriptor_fs.limit_1], readonly_data_size
xor eax, eax
mov ax, _readonly_data
shl eax, 4
mov dword ptr [descriptor_fs.base_1], eax
mov byte ptr [descriptor_fs.attr], attr_ro_data_seg
and descriptor_fs.attr, 11111000b
;----------------------------------
mov descr_t7.attr, 00011010b
mov descr_t14.limit_1, data_size
xor eax, eax
mov ax, _data
shr eax, 4
mov dword ptr descr_t14.base_1, eax
mov descr_t14. attr, attr_ro_data_seg
;------------------------------------
; Load GDTR.
mov ax, _data
mov ds, ax
assume ds: _data
; Create gdt pointer.
xor eax, eax
mov ax, gdt
shl eax, 4
mov dword ptr ds:[gdt_pointer.address], eax
mov ax, gdt_size
mov word ptr ds:[gdt_pointer.limit], ax
lgdt gdt_pointer
; Create idt pointer.
xor eax, eax
mov ax, idt
shl eax, 4
mov dword ptr [idt_pointer.address], eax
mov word ptr [idt_pointer.limit], 8 * 256
lidt idt_pointer
cli
; Go to protected mode.
mov word ptr Top_real_mode, sp
mov word ptr Top_real_mode+2, ss
mov eax, cr0
or eax, 1
mov cr0, eax
; Long jmp to protected.
db 0eah
dw offset protected
dw offset descriptor_cs
protected:
; Load other segment registers.
mov ax,offset descr_ss
mov ss,ax
mov sp,Top_stp
; ds.
mov ax, offset descriptor_ds
mov ds, ax
; es.
mov ax, offset descriptor_es
mov es, ax
; fs.
mov ax, offset descriptor_fs
mov fs, ax
; gs.
mov ax, offset descriptor_gs
mov gs, ax
;jmp dos_return
; Print message.
mov cx, message_len
mov si, offset message
mov di, 0
mov ah, 07h
message_printing:
mov al, byte ptr ds:[si]
mov word ptr es:[di], ax
inc si
add di, 2
loop message_printing
;=================================================================================
;test 1
;mov bx, data_size+1
;mov al, [bx]
;test 7
;mov ax, offset descr_t7
;mov ds, ax
;test 8
mov ax, offset descriptor_ds
mov gs, ax
;test 14
;assume ds: gdt
;mov ax, offset decr_gdt
;mov ds, ax
;mov al, descr_t14.attr
;or al, 1
;mov descr.attr, al
;mov ax, offset_t14
;mov ds, ax
;===================================================================================
dos_return:
cli
; Return to dos.
assume ds:gdt
mov ax, offset descriptor_gdt
mov ds, ax
mov descriptor_cs.limit_1, 0ffffh
mov descriptor_ds.limit_1, 0ffffh
mov descriptor_es.limit_1, 0ffffh
mov descriptor_fs.limit_1, 0ffffh
mov descriptor_fs.attr, attr_data_seg
mov descr_ss.limit_1, 0ffffh
mov descr_ss.attr, attr_data_seg
mov descriptor_gs.limit_1, 0ffffh
; Reload segment registers.
mov ax, offset descriptor_ds
mov ax, ds
mov ax, offset descriptor_es
mov es, ax
mov ax, offset descriptor_fs
mov fs, ax
mov ax, offset descriptor_gs
mov gs, ax
mov ax, offset descr_ss
mov ss, ax
; Restore old interrupt table.
mov ax, offset descriptor_ds
mov ds, ax
assume ds: _data
xor eax, eax
mov dword ptr ds:[idt_pointer.address], eax
mov word ptr ds:[idt_pointer.limit], 3ffh
lidt ds:[idt_pointer]
db 0eah
dw offset descriptor_cs_reload
dw offset descriptor_cs
descriptor_cs_reload:
mov eax, cr0
and al, 0feh
mov cr0, eax
db 0eah
dw offset real_mode
dw _code
real_mode:
mov ax, _data
mov ds, ax
assume ds: _data
lss sp, Top_real_mode
mov ax, _data
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
sti
mov ah, 0
int 16h
mov ax, 3
int 10h
already_protected:
mov ax, 4c00h
int 21h
code_end:
code_size = code_end - main
_code ends
end main
| vimikeva/kpi_study | sys_prog/lab_7/test_8.asm | Assembly | mit | 12,347 |
.text
.globl main
main:
beq $t6,$t8, main | ruseman/csc211 | beq.asm | Assembly | mit | 43 |
.globl main
.data
str: .asciiz "Ah!"
.text
break 0
main:
la $t0, gdt
add $t1, $t0, 32
li $t2, 0xff
inc:
sb $t2, 0($t0)
add $t0, $t0, 1
bne $t0, $t1, inc
li $v0, 4
la $a0, str
syscall
| lczx/rijndael-mips | _dev_misc/mars_unattended_test/src/a.asm | Assembly | mit | 208 |
;Este es un comentario
;Plantilla hecha por Kalun Lau
;Micontroladores 2019 UPC San Miguel
list p=18f4550 ;Modelo de microcontrolador a usar
#include <p18f4550.inc>
;Aquí van las directivas de preprocesador (bits de configuracion)
CONFIG FOSC = XT_XT ; Oscillator Selection bits (XT oscillator (XT))
CONFIG PWRT = ON ; Power-up Timer Enable bit (PWRT enabled)
CONFIG BOR = OFF ; Brown-out Reset Enable bits (Brown-out Reset disabled in hardware and software)
CONFIG WDT = OFF ; Watchdog Timer Enable bit (WDT disabled (control is placed on the SWDTEN bit))
CONFIG PBADEN = OFF ; PORTB A/D Enable bit (PORTB<4:0> pins are configured as digital I/O on Reset)
CONFIG LVP = OFF ; Single-Supply ICSP Enable bit (Single-Supply ICSP disabled)
org 0x0000 ;Vector de RESET
goto papanatas
org 0x0020 ;Zona de programa de usuario
papanatas:
bcf TRISD, 0 ;Puertos RD0 como salida
looper:
btfsc PORTB, 0
goto siii
btfsc PORTB, 1
goto siii
btfsc PORTB, 2
goto siii
bcf LATD, 0
goto looper
siii:
bsf LATD, 0
goto looper
end | tocache/picomones | UPC Microcontroladores 2019-1/Semana 1/orgate3.X/compuertaor3.asm | Assembly | cc0-1.0 | 1,155 |
;Copyright 2015 Sergey Ilmukhin
;
;Licensed under the Apache License, Version 2.0 (the "License");
;you may not use this file except in compliance with the License.
;You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
;Unless required by applicable law or agreed to in writing, software
;distributed under the License is distributed on an "AS IS" BASIS,
;WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
;See the License for the specific language governing permissions and
;limitations under the License.
;------------------------------;
;---- CR1(socket command)
SockOpenCmd = 01h
SockListenCmd = 02h
SockConnectCmd = 04h
SockDisconCmd = 08h
SockCloseCmd = 10h
SockSendCmd = 20h
SockSendKeepCmd = 22h
SockRecvCmd = 40h
;---- SIR1(socket interrupt)
SockConIr = 01h
SockDisconIr = 02h
SockRecvIr = 04h
SockTimeoutIr = 08h
SockSendOkIr = 10h
;---- SR1(socket status)
SockClosedSt = 00h
SockInitSt = 13h
SockListenSt = 14h
SockEstblshdSt = 17h
SockCloseWaitSt = 1Ch
SockUDPSt = 22h
SockMacRawSt = 42h
SockSynSentSt = 15h
SockSynRecvSt = 16h
SockFinWaitSt = 18h
SockTimeWaitSt = 1Bh
SockLastAckSt = 1Dh
SockArpSt = 01h
;------------------------------;
Init: ;init socket
; Input:
; bp = channel memory
; es = device address
; bx = socket address
pushs <es,ds,cx>
mov [bp+ActCnt],0 ;
mov [SIMR1+bx],00000000b ;disable all
mov al,[SIR1+bx]
mov [SIR1+bx],al ;clear
cmp [bp+Mode],2000h ; is MACRAW?
jnz UDP
call MACRAWInit
call ARPAnnounce
jmp i8
UDP:
cmp [bp+Mode],3000h ; is UDP?
jnz TCP
call UDPInit
jmp i8
TCP:
mov [SIMR1+bx],00001111b ;enable Tot,Recv,Discn,Con
mov [CR1+bx],SockCloseCmd
mov [SMR1+bx],01h ;TCP
mov ax,[bp+SourcePort]
mov [PORT0+bx],aH ;Source Port No.
mov [PORT1+bx],aL ;Source Port No.
i4: mov [CR1+bx],SockOpenCmd ;Open
cmp [SR1+bx],SockInitSt
jnz i4
cmp [bp+Mode],1234h ;is master?
jz i8 ;yes, master
call Listen ;no, slave
i8:
pops <cx,ds,es>
ret
;------------------------------;
; MACRAW Init
MACRAWInit:
; Input:
; bp = channel memory
; es = device address
; bx = socket address
mov [CR1+bx],SockCloseCmd
mov [SMR1+bx],04h ;MACRAW
mov [bp+Mode],2000h ;MACRAW_mode
mraw_init_wait:
mov [CR1+bx],SockOpenCmd ;Open
cmp [SR1+bx],SockMacRawSt
jnz mraw_init_wait
ret
;------------------------------;
;------------------------------;
; UDP Init
UDPInit:
; Input:
; bp = channel memory
; es = device address
; bx = socket address
push ax
;mov [SIMR1+bx],00011100b ;enable SendOk,Tot,Recv
mov [SIMR1+bx],00000100b ;enable Recv
mov [CR1+bx],SockCloseCmd
mov [SMR1+bx],02h ;UDP
mov ax,[bp+SourcePort]
mov [PORT0+bx],aH ;Source Port No.
mov [PORT1+bx],aL ;Source Port No
udp_init_wait:
mov [CR1+bx],SockOpenCmd ;Open
cmp [SR1+bx],SockUDPSt
jnz udp_init_wait
pop ax
ret
;------------------------------;
;------------------------------;
; NTP Send
NTPSend:
; Input:
; bp = channel memory
; es = device address
; bx = socket address
; es = device address
pushs<ax,bx,cx,si>
; Assigning NTP-server IP-address
mov al, [NTPServerIp+0] ; 1 byte of NTP-server IP
mov [DIPR0+bx], al
mov al, [NTPServerIp+1] ; 2 byte of NTP-server IP
mov [DIPR1+bx], al
mov al, [NTPServerIp+2] ; 3 byte of NTP-server IP
mov [DIPR2+bx], al
mov al, [NTPServerIp+3] ; 4 byte of NTP-server IP
mov [DIPR3+bx], al
; Assigning NTP-server port(123)
mov al, 0h
mov [DPORT0+bx], al
mov al, 7bh
mov [DPORT1+bx], al
; Assigning NTP-version and client-mode
mov ax, 2300h
mov [TX_FIFO0+bx],ah
mov [TX_FIFO1+bx],al
mov cx, 23
ntpsend_fill:
mov [TX_FIFO0+bx],al
mov [TX_FIFO1+bx],al
loop ntpsend_fill
; ;!!!!!!!! TEEEESTING !!!!!!!
; mov cx, 7
;ntpsend_1:
; mov [TX_FIFO0+bx],al
; mov [TX_FIFO1+bx],al
; loop ntpsend_1
;
; mov cx, 4
; xor si, si
;ntpsend_2:
; mov ax, word ptr [NTPLastTime+si]
; mov [TX_FIFO0+bx],ah
; mov [TX_FIFO1+bx],al
;
; inc si
; inc si
; loop ntpsend_2
;
; xor ax, ax
; mov cx, 12
;ntpsend_3:
; mov [TX_FIFO0+bx],al
; mov [TX_FIFO1+bx],al
; loop ntpsend_3
; ;!!!!!!!! TEEEESTING !!!!!!!
mov cx, 48
mov [TX_WRS0+bx],0
mov [TX_WRS1+bx],0
mov [TX_WRS2+bx],ch
mov [TX_WRS3+bx],cl
mov [CR1+bx],SockSendCmd
pops<si,cx,bx,ax>
ret
;------------------------------;
; NTP receive handler
NTPReceiveHnd:
; Input:
; bp = channel memory
; es = device address
; bx = socket address
; ds = dual memory
pushs<ax,cx,dx,di>
; dl will be summary flag of packet correctness, if 0 then packet is bad
mov dl, 1
;extract source IP address
mov al,[RX_FIFO0+bx] ;get 1-st byte of IP
mov ah,[RX_FIFO1+bx] ;get 2-nd byte of IP
;check first two bytes of ip
cmp ax, word ptr [NTPServerIp+0]
jz ntprcv1
and dl, 0
ntprcv1:
mov al,[RX_FIFO0+bx] ;get 3-rd byte of IP
mov ah,[RX_FIFO1+bx] ;get 4-th byte of IP
;check second two bytes of ip
cmp ax, word ptr [NTPServerIp+2]
jz ntprcv2
and dl, 0
ntprcv2:
;extract source port
mov ah,[RX_FIFO0+bx] ;get 1-st byte of port
mov al,[RX_FIFO1+bx] ;get 2-nd byte of port
;check source port, if not 123, then isn't NTP
cmp ax, 123
jz ntprcv3
and dl, 0
ntprcv3:
;extract DATA size
mov ch,[RX_FIFO0+bx] ;get received size (hi)
mov cl,[RX_FIFO1+bx] ;get received size (lo)
;check length of DATA, if not 48 - packet is bad
cmp cx, 48
jz ntprcv4
and dl, 0
ntprcv4:
test cx,0001h ;is cx odd?
jz ntprcv5 ;no, cx is even
inc cx ;yes, cx is odd, make it even
ntprcv5:
shr cx, 1
xor di, di
ntprcv6:
mov ah,[RX_FIFO0+bx]
mov al,[RX_FIFO1+bx]
cmp dl, 0
jz ntprcv7
cmp di, 40
jb ntprcv7
cmp di, 46
ja ntprcv7
;mov word ptr ds:[di], ax ;testing
mov byte ptr [di-40+NTPLastTime], al
mov byte ptr [di-40+1+NTPLastTime], ah
ntprcv7:
inc di
inc di
loop ntprcv6
mov [CR1+bx],SockRecvCmd
cmp dl, 0
jz ntprcvend
mov [TimeSyncFlag], 1
; ;----Copy time to Dual Memory for CPU
;ntprcv8:
; cmp [XicbInt],0 ;Is Dual free?
; jnz ntprcv8 ;no, exit
;
; call CopyTimeToDual
;
; mov [XicbInt],1 ;int
; ;----Copy time to Dual Memory for CPU
ntprcvend:
pops<di,dx,cx,ax>
ret
;------------------------------;
CopyTimeToDual:
pushs<ds,ax,cx,di,si>
mov ax, seg DualRam
mov ds, ax
mov [XicbLen], 0Bh
mov [XicbAddr],offset DualBufferX
mov [XicbCtrl],08h ;data
mov al, byte ptr [NTPSocketNum]
mov [XicbChnl],al
cli
mov di,offset DualBufferX
;first 3 bytes for CPU to recognize timesync
mov byte ptr ds:[di], 00h
inc di
mov byte ptr ds:[di], 19h
inc di
mov byte ptr ds:[di], 08h
inc di
mov cx, 4
xor si, si
;time from NTP-server
cptime1:
mov ax, word ptr [NTPLastTime+si]
mov word ptr ds:[di], ax
inc di
inc di
inc si
inc si
loop cptime1
sti
pops<si,di,cx,ax,ds>
ret
;------------------------------;
; ARP Announcement
ARPAnnounce:
pushs <ax,cx>
mov ax, 0
; assigning destination broadcast DHAR
mov al, 0FFh
mov [DHAR0+bx], al
mov [DHAR1+bx], al
mov [DHAR2+bx], al
mov [DHAR3+bx], al
mov [DHAR4+bx], al
mov [DHAR5+bx], al
; destination MAC-address
mov cx, 3
aa_dst_mac_fill:
mov [TX_FIFO0+bx],al
mov [TX_FIFO1+bx],al
loop aa_dst_mac_fill
; source MAC-address
mov al, [bp+Mac+0]
mov [TX_FIFO0+bx],al
mov al, [bp+Mac+1]
mov [TX_FIFO1+bx],al
mov al, [bp+Mac+2]
mov [TX_FIFO0+bx],al
mov al, [bp+Mac+3]
mov [TX_FIFO1+bx],al
mov al, [bp+Mac+4]
mov [TX_FIFO0+bx],al
mov al, [bp+Mac+5]
mov [TX_FIFO1+bx],al
; Ethernet type - ARP(0x0806)
mov al, 08h
mov [TX_FIFO0+bx],al
mov al, 06h
mov [TX_FIFO1+bx],al
; ====== Begin generating ARP Payload =======
; HTYPE(Hardware Type) field, Ethernet code
mov al, 00h
mov [TX_FIFO0+bx],al
mov al, 01h
mov [TX_FIFO1+bx],al
; PTYPE(Protocol Type) field, IPv4 code
mov al, 08h
mov [TX_FIFO0+bx],al
mov al, 00h
mov [TX_FIFO1+bx],al
; HLEN(Hardware Length) field, MAC-address length
mov al, 06h
mov [TX_FIFO0+bx],al
; PLEN(Protocol Length) field, IPv4-address length
mov al, 04h
mov [TX_FIFO1+bx],al
; OPER(Operation) field, Opertaion Code(1 - request)
mov al, 00h
mov [TX_FIFO0+bx],al
mov al, 01h
mov [TX_FIFO1+bx],al
; Sender hardware address (SHA) field
mov al, [bp+Mac+0]
mov [TX_FIFO0+bx],al
mov al, [bp+Mac+1]
mov [TX_FIFO1+bx],al
mov al, [bp+Mac+2]
mov [TX_FIFO0+bx],al
mov al, [bp+Mac+3]
mov [TX_FIFO1+bx],al
mov al, [bp+Mac+4]
mov [TX_FIFO0+bx],al
mov al, [bp+Mac+5]
mov [TX_FIFO1+bx],al
; Sender protocol address (SPA) field
mov al, [bp+Ip+0]
mov [TX_FIFO0+bx],al
mov al, [bp+Ip+1]
mov [TX_FIFO1+bx],al
mov al, [bp+Ip+2]
mov [TX_FIFO0+bx],al
mov al, [bp+Ip+3]
mov [TX_FIFO1+bx],al
; Target hardware address (THA) field
mov al, 00h
mov cx, 3
aa_tha_fill:
mov [TX_FIFO0+bx],al
mov [TX_FIFO1+bx],al
loop aa_tha_fill
; Target protocol address (TPA) field
mov al, [bp+Ip+0]
mov [TX_FIFO0+bx],al
mov al, [bp+Ip+1]
mov [TX_FIFO1+bx],al
mov al, [bp+Ip+2]
mov [TX_FIFO0+bx],al
mov al, [bp+Ip+3]
mov [TX_FIFO1+bx],al
; ====== End generating ARP Payload =========
mov ax, 48
mov [TX_WRS0+bx],0
mov [TX_WRS1+bx],0
mov [TX_WRS2+bx],ah
mov [TX_WRS3+bx],al
mov [CR1+bx],SockSendCmd
pops <cx,ax>
ret
;------------------------------;
;------------------------------;
ChkAct:
cmp [bp+Mode],1234h ;
jz wa2 ; ;master, goto
cmp [bp+Mode],3000h ;
jz wa2 ; ;UDP, goto
cmp [bp+Mode],2000h ;
jz wa_mraw ;MACRAW, goto
jmp wa_mbslave
wa_mraw:
inc [bp+ActCnt]
cmp [bp+ActCnt],2*100+10
jb wa2
call Init
mov [bp+Mode], 0 ;slave
call Init
jmp wa2
wa_mbslave:
inc [bp+ActCnt]
cmp [bp+ActCnt],5*100 ;5s
jb wa2
cmp [bx+SR1], SockListenSt ;if in Listen mode - do not reinitialise
je wa2
mov [bp+ActCnt],0 ;[]
call Init
wa2:
ret
;------------------------------;
;------------------------------;
;Checking Link LED's state of Wiznets
ChkLink:
pushs<ax,bx,cx,ds,si>
xor bx, bx
mov ax, seg DualRam
mov ds, ax
cmp [ChkLinkCounter], 1*100 ; 1s
jae chklink01
jmp chklinkend
chklink01:
mov [ChkLinkCounter], 0
; Wiznet0
rd_ PIODATA1
and ax, Wiznet0_Link
shr ax, 1
or bx, ax
; Wiznet1
rd_ PIODATA1
and ax, Wiznet1_Link
shr ax, 1
or bx, ax
mov byte ptr ds:[0EFFEh], bl
mov cx, 2
xor si, si
mov bh, 1
chklink05:
test bl, bh
jnz chklink10
jmp chklink12
chklink10:
inc byte ptr [WizLinkTimer+si]
jmp chklink19
chklink12:
cmp byte ptr [WizLinkTimer+si], 0
jz chklink19
cmp byte ptr [WizLinkTimer+si], 5
jb chklink18
pushs<bp,bx,es>
cmp si, 0
jnz chklink13
lea bp,ChnlMem_0
jmp chklink14
chklink13:
lea bp,ChnlMem_8
chklink14:
mov [bp+Mode],2000h ;MACRAW-mode for initialization(Socket0 only!!!)
mov ax,[bp+DeviceBase]
mov es,ax
mov bx,[bp+SocketBase]
call Init ;init socket
pops<es,bx,bp>
chklink18:
mov byte ptr [WizLinkTimer+si], 0
chklink19:
cmp [WizLinkTimer+si], 254
jb chklink20
mov [WizLinkTimer+si], 5
chklink20:
inc si
shl bh, 1
loop chklink05
;mov al, [WizLinkTimer+0] ;for testing
;mov byte ptr ds:[200+0], al
;mov al, [WizLinkTimer+1] ;for testing
;mov byte ptr ds:[200+1], al
;
chklinkend:
inc [ChkLinkCounter]
pops<si,ds,cx,bx,ax>
ret
;------------------------------;
;------------------------------;
;Get states of sockets, of Wiznet
GetSocketStates:
;input:
;bl - number of wiznet
;bp - starting channel memory(ChnlMem_0 or ChnlMem_8)
pushs<ax,bx,cx,ds,es,di,bp>
mov ax,[bp+DeviceBase]
mov es,ax
;getting buffer
push bx
mov bx,1 ;bx = # of parags
mov ah,1 ;get mem
int 1Fh ;ax = addr of user seg
pop bx
jnc gss1 ;ok
jmp gssend ;ng
gss1:
mov ds,ax ;ds = addr of buff
mov byte ptr ds:[2], 09h
mov byte ptr ds:[4], bl
mov byte ptr ds:[5], 8 ;len
push bx
mov di, 6
mov cx, NumOfSock
gss5:
mov bx,[bp+SocketBase]
mov al, byte ptr[SR1+bx]
mov byte ptr ds:[di], al
inc di
add bp,size ChnlMem
loop gss5
pop bx
gss10:
mov ax, ds
call PutIn ;Put the buffer addr (ds) into fifo
jnc gssend
gss15:
push es
push ds
pop es
mov ah,2 ;free mem
int 1Fh
pop es ;JC??
gssend:
pops <bp,di,es,ds,cx,bx,ax>
ret
;------------------------------;
;------------------------------;
;Get states of sockets, of Wiznet
GetSocketStates2:
;input:
;bl - number of wiznet
;bp - starting channel memory(ChnlMem_0 or ChnlMem_8)
pushs<ax,bx,cx,ds,es,di,bp>
mov ax, seg DualRam
mov ds, ax
mov ax,[bp+DeviceBase]
mov es,ax
cmp bl, 0
jz gss2_1
cmp bl, 1
jz gss2_2
jmp gss2_end
gss2_1:
mov di, 0EFEEh
xor si, si ; debug
jmp gss2_3
gss2_2:
mov di, 0EFF6h
mov si, 20 ; debug
gss2_3:
mov cx, NumOfSock
gss2_4:
mov bx,[bp+SocketBase]
mov al, byte ptr[SR1+bx]
mov byte ptr ds:[di], al
mov byte ptr ds:[60020+si], al ; debug
inc si ;debug
inc di
add bp,size ChnlMem
loop gss2_4
gss2_end:
pops <bp,di,es,ds,cx,bx,ax>
ret
;------------------------------;
| sindar/C41_snippets | c41_snippets.asm | Assembly | apache-2.0 | 14,167 |
OPTION DOTNAME
.text$ SEGMENT ALIGN(256) 'CODE'
EXTERN OPENSSL_ia32cap_P:NEAR
ALIGN 64
$L$poly::
DQ 0ffffffffffffffffh,000000000ffffffffh,00000000000000000h,0ffffffff00000001h
$L$RR::
DQ 00000000000000003h,0fffffffbffffffffh,0fffffffffffffffeh,000000004fffffffdh
$L$One::
DD 1,1,1,1,1,1,1,1
$L$Two::
DD 2,2,2,2,2,2,2,2
$L$Three::
DD 3,3,3,3,3,3,3,3
$L$ONE_mont::
DQ 00000000000000001h,0ffffffff00000000h,0ffffffffffffffffh,000000000fffffffeh
PUBLIC ecp_nistz256_mul_by_2
ALIGN 64
ecp_nistz256_mul_by_2 PROC PUBLIC
mov QWORD PTR[8+rsp],rdi ;WIN64 prologue
mov QWORD PTR[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_ecp_nistz256_mul_by_2::
mov rdi,rcx
mov rsi,rdx
push r12
push r13
mov r8,QWORD PTR[rsi]
mov r9,QWORD PTR[8+rsi]
add r8,r8
mov r10,QWORD PTR[16+rsi]
adc r9,r9
mov r11,QWORD PTR[24+rsi]
lea rsi,QWORD PTR[$L$poly]
mov rax,r8
adc r10,r10
adc r11,r11
mov rdx,r9
sbb r13,r13
sub r8,QWORD PTR[rsi]
mov rcx,r10
sbb r9,QWORD PTR[8+rsi]
sbb r10,QWORD PTR[16+rsi]
mov r12,r11
sbb r11,QWORD PTR[24+rsi]
test r13,r13
cmovz r8,rax
cmovz r9,rdx
mov QWORD PTR[rdi],r8
cmovz r10,rcx
mov QWORD PTR[8+rdi],r9
cmovz r11,r12
mov QWORD PTR[16+rdi],r10
mov QWORD PTR[24+rdi],r11
pop r13
pop r12
mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue
mov rsi,QWORD PTR[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_ecp_nistz256_mul_by_2::
ecp_nistz256_mul_by_2 ENDP
PUBLIC ecp_nistz256_div_by_2
ALIGN 32
ecp_nistz256_div_by_2 PROC PUBLIC
mov QWORD PTR[8+rsp],rdi ;WIN64 prologue
mov QWORD PTR[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_ecp_nistz256_div_by_2::
mov rdi,rcx
mov rsi,rdx
push r12
push r13
mov r8,QWORD PTR[rsi]
mov r9,QWORD PTR[8+rsi]
mov r10,QWORD PTR[16+rsi]
mov rax,r8
mov r11,QWORD PTR[24+rsi]
lea rsi,QWORD PTR[$L$poly]
mov rdx,r9
xor r13,r13
add r8,QWORD PTR[rsi]
mov rcx,r10
adc r9,QWORD PTR[8+rsi]
adc r10,QWORD PTR[16+rsi]
mov r12,r11
adc r11,QWORD PTR[24+rsi]
adc r13,0
xor rsi,rsi
test rax,1
cmovz r8,rax
cmovz r9,rdx
cmovz r10,rcx
cmovz r11,r12
cmovz r13,rsi
mov rax,r9
shr r8,1
shl rax,63
mov rdx,r10
shr r9,1
or r8,rax
shl rdx,63
mov rcx,r11
shr r10,1
or r9,rdx
shl rcx,63
shr r11,1
shl r13,63
or r10,rcx
or r11,r13
mov QWORD PTR[rdi],r8
mov QWORD PTR[8+rdi],r9
mov QWORD PTR[16+rdi],r10
mov QWORD PTR[24+rdi],r11
pop r13
pop r12
mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue
mov rsi,QWORD PTR[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_ecp_nistz256_div_by_2::
ecp_nistz256_div_by_2 ENDP
PUBLIC ecp_nistz256_mul_by_3
ALIGN 32
ecp_nistz256_mul_by_3 PROC PUBLIC
mov QWORD PTR[8+rsp],rdi ;WIN64 prologue
mov QWORD PTR[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_ecp_nistz256_mul_by_3::
mov rdi,rcx
mov rsi,rdx
push r12
push r13
mov r8,QWORD PTR[rsi]
xor r13,r13
mov r9,QWORD PTR[8+rsi]
add r8,r8
mov r10,QWORD PTR[16+rsi]
adc r9,r9
mov r11,QWORD PTR[24+rsi]
mov rax,r8
adc r10,r10
adc r11,r11
mov rdx,r9
adc r13,0
sub r8,-1
mov rcx,r10
sbb r9,QWORD PTR[(($L$poly+8))]
sbb r10,0
mov r12,r11
sbb r11,QWORD PTR[(($L$poly+24))]
test r13,r13
cmovz r8,rax
cmovz r9,rdx
cmovz r10,rcx
cmovz r11,r12
xor r13,r13
add r8,QWORD PTR[rsi]
adc r9,QWORD PTR[8+rsi]
mov rax,r8
adc r10,QWORD PTR[16+rsi]
adc r11,QWORD PTR[24+rsi]
mov rdx,r9
adc r13,0
sub r8,-1
mov rcx,r10
sbb r9,QWORD PTR[(($L$poly+8))]
sbb r10,0
mov r12,r11
sbb r11,QWORD PTR[(($L$poly+24))]
test r13,r13
cmovz r8,rax
cmovz r9,rdx
mov QWORD PTR[rdi],r8
cmovz r10,rcx
mov QWORD PTR[8+rdi],r9
cmovz r11,r12
mov QWORD PTR[16+rdi],r10
mov QWORD PTR[24+rdi],r11
pop r13
pop r12
mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue
mov rsi,QWORD PTR[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_ecp_nistz256_mul_by_3::
ecp_nistz256_mul_by_3 ENDP
PUBLIC ecp_nistz256_add
ALIGN 32
ecp_nistz256_add PROC PUBLIC
mov QWORD PTR[8+rsp],rdi ;WIN64 prologue
mov QWORD PTR[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_ecp_nistz256_add::
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
push r12
push r13
mov r8,QWORD PTR[rsi]
xor r13,r13
mov r9,QWORD PTR[8+rsi]
mov r10,QWORD PTR[16+rsi]
mov r11,QWORD PTR[24+rsi]
lea rsi,QWORD PTR[$L$poly]
add r8,QWORD PTR[rdx]
adc r9,QWORD PTR[8+rdx]
mov rax,r8
adc r10,QWORD PTR[16+rdx]
adc r11,QWORD PTR[24+rdx]
mov rdx,r9
adc r13,0
sub r8,QWORD PTR[rsi]
mov rcx,r10
sbb r9,QWORD PTR[8+rsi]
sbb r10,QWORD PTR[16+rsi]
mov r12,r11
sbb r11,QWORD PTR[24+rsi]
test r13,r13
cmovz r8,rax
cmovz r9,rdx
mov QWORD PTR[rdi],r8
cmovz r10,rcx
mov QWORD PTR[8+rdi],r9
cmovz r11,r12
mov QWORD PTR[16+rdi],r10
mov QWORD PTR[24+rdi],r11
pop r13
pop r12
mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue
mov rsi,QWORD PTR[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_ecp_nistz256_add::
ecp_nistz256_add ENDP
PUBLIC ecp_nistz256_sub
ALIGN 32
ecp_nistz256_sub PROC PUBLIC
mov QWORD PTR[8+rsp],rdi ;WIN64 prologue
mov QWORD PTR[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_ecp_nistz256_sub::
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
push r12
push r13
mov r8,QWORD PTR[rsi]
xor r13,r13
mov r9,QWORD PTR[8+rsi]
mov r10,QWORD PTR[16+rsi]
mov r11,QWORD PTR[24+rsi]
lea rsi,QWORD PTR[$L$poly]
sub r8,QWORD PTR[rdx]
sbb r9,QWORD PTR[8+rdx]
mov rax,r8
sbb r10,QWORD PTR[16+rdx]
sbb r11,QWORD PTR[24+rdx]
mov rdx,r9
sbb r13,0
add r8,QWORD PTR[rsi]
mov rcx,r10
adc r9,QWORD PTR[8+rsi]
adc r10,QWORD PTR[16+rsi]
mov r12,r11
adc r11,QWORD PTR[24+rsi]
test r13,r13
cmovz r8,rax
cmovz r9,rdx
mov QWORD PTR[rdi],r8
cmovz r10,rcx
mov QWORD PTR[8+rdi],r9
cmovz r11,r12
mov QWORD PTR[16+rdi],r10
mov QWORD PTR[24+rdi],r11
pop r13
pop r12
mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue
mov rsi,QWORD PTR[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_ecp_nistz256_sub::
ecp_nistz256_sub ENDP
PUBLIC ecp_nistz256_neg
ALIGN 32
ecp_nistz256_neg PROC PUBLIC
mov QWORD PTR[8+rsp],rdi ;WIN64 prologue
mov QWORD PTR[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_ecp_nistz256_neg::
mov rdi,rcx
mov rsi,rdx
push r12
push r13
xor r8,r8
xor r9,r9
xor r10,r10
xor r11,r11
xor r13,r13
sub r8,QWORD PTR[rsi]
sbb r9,QWORD PTR[8+rsi]
sbb r10,QWORD PTR[16+rsi]
mov rax,r8
sbb r11,QWORD PTR[24+rsi]
lea rsi,QWORD PTR[$L$poly]
mov rdx,r9
sbb r13,0
add r8,QWORD PTR[rsi]
mov rcx,r10
adc r9,QWORD PTR[8+rsi]
adc r10,QWORD PTR[16+rsi]
mov r12,r11
adc r11,QWORD PTR[24+rsi]
test r13,r13
cmovz r8,rax
cmovz r9,rdx
mov QWORD PTR[rdi],r8
cmovz r10,rcx
mov QWORD PTR[8+rdi],r9
cmovz r11,r12
mov QWORD PTR[16+rdi],r10
mov QWORD PTR[24+rdi],r11
pop r13
pop r12
mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue
mov rsi,QWORD PTR[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_ecp_nistz256_neg::
ecp_nistz256_neg ENDP
PUBLIC ecp_nistz256_to_mont
ALIGN 32
ecp_nistz256_to_mont PROC PUBLIC
mov QWORD PTR[8+rsp],rdi ;WIN64 prologue
mov QWORD PTR[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_ecp_nistz256_to_mont::
mov rdi,rcx
mov rsi,rdx
lea rdx,QWORD PTR[$L$RR]
jmp $L$mul_mont
$L$SEH_end_ecp_nistz256_to_mont::
ecp_nistz256_to_mont ENDP
PUBLIC ecp_nistz256_mul_mont
ALIGN 32
ecp_nistz256_mul_mont PROC PUBLIC
mov QWORD PTR[8+rsp],rdi ;WIN64 prologue
mov QWORD PTR[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_ecp_nistz256_mul_mont::
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
$L$mul_mont::
push rbp
push rbx
push r12
push r13
push r14
push r15
mov rbx,rdx
mov rax,QWORD PTR[rdx]
mov r9,QWORD PTR[rsi]
mov r10,QWORD PTR[8+rsi]
mov r11,QWORD PTR[16+rsi]
mov r12,QWORD PTR[24+rsi]
call __ecp_nistz256_mul_montq
$L$mul_mont_done::
pop r15
pop r14
pop r13
pop r12
pop rbx
pop rbp
mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue
mov rsi,QWORD PTR[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_ecp_nistz256_mul_mont::
ecp_nistz256_mul_mont ENDP
ALIGN 32
__ecp_nistz256_mul_montq PROC PRIVATE
mov rbp,rax
mul r9
mov r14,QWORD PTR[(($L$poly+8))]
mov r8,rax
mov rax,rbp
mov r9,rdx
mul r10
mov r15,QWORD PTR[(($L$poly+24))]
add r9,rax
mov rax,rbp
adc rdx,0
mov r10,rdx
mul r11
add r10,rax
mov rax,rbp
adc rdx,0
mov r11,rdx
mul r12
add r11,rax
mov rax,r8
adc rdx,0
xor r13,r13
mov r12,rdx
mov rbp,r8
shl r8,32
mul r15
shr rbp,32
add r9,r8
adc r10,rbp
adc r11,rax
mov rax,QWORD PTR[8+rbx]
adc r12,rdx
adc r13,0
xor r8,r8
mov rbp,rax
mul QWORD PTR[rsi]
add r9,rax
mov rax,rbp
adc rdx,0
mov rcx,rdx
mul QWORD PTR[8+rsi]
add r10,rcx
adc rdx,0
add r10,rax
mov rax,rbp
adc rdx,0
mov rcx,rdx
mul QWORD PTR[16+rsi]
add r11,rcx
adc rdx,0
add r11,rax
mov rax,rbp
adc rdx,0
mov rcx,rdx
mul QWORD PTR[24+rsi]
add r12,rcx
adc rdx,0
add r12,rax
mov rax,r9
adc r13,rdx
adc r8,0
mov rbp,r9
shl r9,32
mul r15
shr rbp,32
add r10,r9
adc r11,rbp
adc r12,rax
mov rax,QWORD PTR[16+rbx]
adc r13,rdx
adc r8,0
xor r9,r9
mov rbp,rax
mul QWORD PTR[rsi]
add r10,rax
mov rax,rbp
adc rdx,0
mov rcx,rdx
mul QWORD PTR[8+rsi]
add r11,rcx
adc rdx,0
add r11,rax
mov rax,rbp
adc rdx,0
mov rcx,rdx
mul QWORD PTR[16+rsi]
add r12,rcx
adc rdx,0
add r12,rax
mov rax,rbp
adc rdx,0
mov rcx,rdx
mul QWORD PTR[24+rsi]
add r13,rcx
adc rdx,0
add r13,rax
mov rax,r10
adc r8,rdx
adc r9,0
mov rbp,r10
shl r10,32
mul r15
shr rbp,32
add r11,r10
adc r12,rbp
adc r13,rax
mov rax,QWORD PTR[24+rbx]
adc r8,rdx
adc r9,0
xor r10,r10
mov rbp,rax
mul QWORD PTR[rsi]
add r11,rax
mov rax,rbp
adc rdx,0
mov rcx,rdx
mul QWORD PTR[8+rsi]
add r12,rcx
adc rdx,0
add r12,rax
mov rax,rbp
adc rdx,0
mov rcx,rdx
mul QWORD PTR[16+rsi]
add r13,rcx
adc rdx,0
add r13,rax
mov rax,rbp
adc rdx,0
mov rcx,rdx
mul QWORD PTR[24+rsi]
add r8,rcx
adc rdx,0
add r8,rax
mov rax,r11
adc r9,rdx
adc r10,0
mov rbp,r11
shl r11,32
mul r15
shr rbp,32
add r12,r11
adc r13,rbp
mov rcx,r12
adc r8,rax
adc r9,rdx
mov rbp,r13
adc r10,0
sub r12,-1
mov rbx,r8
sbb r13,r14
sbb r8,0
mov rdx,r9
sbb r9,r15
sbb r10,0
cmovc r12,rcx
cmovc r13,rbp
mov QWORD PTR[rdi],r12
cmovc r8,rbx
mov QWORD PTR[8+rdi],r13
cmovc r9,rdx
mov QWORD PTR[16+rdi],r8
mov QWORD PTR[24+rdi],r9
DB 0F3h,0C3h ;repret
__ecp_nistz256_mul_montq ENDP
PUBLIC ecp_nistz256_sqr_mont
ALIGN 32
ecp_nistz256_sqr_mont PROC PUBLIC
mov QWORD PTR[8+rsp],rdi ;WIN64 prologue
mov QWORD PTR[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_ecp_nistz256_sqr_mont::
mov rdi,rcx
mov rsi,rdx
push rbp
push rbx
push r12
push r13
push r14
push r15
mov rax,QWORD PTR[rsi]
mov r14,QWORD PTR[8+rsi]
mov r15,QWORD PTR[16+rsi]
mov r8,QWORD PTR[24+rsi]
call __ecp_nistz256_sqr_montq
$L$sqr_mont_done::
pop r15
pop r14
pop r13
pop r12
pop rbx
pop rbp
mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue
mov rsi,QWORD PTR[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_ecp_nistz256_sqr_mont::
ecp_nistz256_sqr_mont ENDP
ALIGN 32
__ecp_nistz256_sqr_montq PROC PRIVATE
mov r13,rax
mul r14
mov r9,rax
mov rax,r15
mov r10,rdx
mul r13
add r10,rax
mov rax,r8
adc rdx,0
mov r11,rdx
mul r13
add r11,rax
mov rax,r15
adc rdx,0
mov r12,rdx
mul r14
add r11,rax
mov rax,r8
adc rdx,0
mov rbp,rdx
mul r14
add r12,rax
mov rax,r8
adc rdx,0
add r12,rbp
mov r13,rdx
adc r13,0
mul r15
xor r15,r15
add r13,rax
mov rax,QWORD PTR[rsi]
mov r14,rdx
adc r14,0
add r9,r9
adc r10,r10
adc r11,r11
adc r12,r12
adc r13,r13
adc r14,r14
adc r15,0
mul rax
mov r8,rax
mov rax,QWORD PTR[8+rsi]
mov rcx,rdx
mul rax
add r9,rcx
adc r10,rax
mov rax,QWORD PTR[16+rsi]
adc rdx,0
mov rcx,rdx
mul rax
add r11,rcx
adc r12,rax
mov rax,QWORD PTR[24+rsi]
adc rdx,0
mov rcx,rdx
mul rax
add r13,rcx
adc r14,rax
mov rax,r8
adc r15,rdx
mov rsi,QWORD PTR[(($L$poly+8))]
mov rbp,QWORD PTR[(($L$poly+24))]
mov rcx,r8
shl r8,32
mul rbp
shr rcx,32
add r9,r8
adc r10,rcx
adc r11,rax
mov rax,r9
adc rdx,0
mov rcx,r9
shl r9,32
mov r8,rdx
mul rbp
shr rcx,32
add r10,r9
adc r11,rcx
adc r8,rax
mov rax,r10
adc rdx,0
mov rcx,r10
shl r10,32
mov r9,rdx
mul rbp
shr rcx,32
add r11,r10
adc r8,rcx
adc r9,rax
mov rax,r11
adc rdx,0
mov rcx,r11
shl r11,32
mov r10,rdx
mul rbp
shr rcx,32
add r8,r11
adc r9,rcx
adc r10,rax
adc rdx,0
xor r11,r11
add r12,r8
adc r13,r9
mov r8,r12
adc r14,r10
adc r15,rdx
mov r9,r13
adc r11,0
sub r12,-1
mov r10,r14
sbb r13,rsi
sbb r14,0
mov rcx,r15
sbb r15,rbp
sbb r11,0
cmovc r12,r8
cmovc r13,r9
mov QWORD PTR[rdi],r12
cmovc r14,r10
mov QWORD PTR[8+rdi],r13
cmovc r15,rcx
mov QWORD PTR[16+rdi],r14
mov QWORD PTR[24+rdi],r15
DB 0F3h,0C3h ;repret
__ecp_nistz256_sqr_montq ENDP
PUBLIC ecp_nistz256_from_mont
ALIGN 32
ecp_nistz256_from_mont PROC PUBLIC
mov QWORD PTR[8+rsp],rdi ;WIN64 prologue
mov QWORD PTR[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_ecp_nistz256_from_mont::
mov rdi,rcx
mov rsi,rdx
push r12
push r13
mov rax,QWORD PTR[rsi]
mov r13,QWORD PTR[(($L$poly+24))]
mov r9,QWORD PTR[8+rsi]
mov r10,QWORD PTR[16+rsi]
mov r11,QWORD PTR[24+rsi]
mov r8,rax
mov r12,QWORD PTR[(($L$poly+8))]
mov rcx,rax
shl r8,32
mul r13
shr rcx,32
add r9,r8
adc r10,rcx
adc r11,rax
mov rax,r9
adc rdx,0
mov rcx,r9
shl r9,32
mov r8,rdx
mul r13
shr rcx,32
add r10,r9
adc r11,rcx
adc r8,rax
mov rax,r10
adc rdx,0
mov rcx,r10
shl r10,32
mov r9,rdx
mul r13
shr rcx,32
add r11,r10
adc r8,rcx
adc r9,rax
mov rax,r11
adc rdx,0
mov rcx,r11
shl r11,32
mov r10,rdx
mul r13
shr rcx,32
add r8,r11
adc r9,rcx
mov rcx,r8
adc r10,rax
mov rsi,r9
adc rdx,0
sub r8,-1
mov rax,r10
sbb r9,r12
sbb r10,0
mov r11,rdx
sbb rdx,r13
sbb r13,r13
cmovnz r8,rcx
cmovnz r9,rsi
mov QWORD PTR[rdi],r8
cmovnz r10,rax
mov QWORD PTR[8+rdi],r9
cmovz r11,rdx
mov QWORD PTR[16+rdi],r10
mov QWORD PTR[24+rdi],r11
pop r13
pop r12
mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue
mov rsi,QWORD PTR[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_ecp_nistz256_from_mont::
ecp_nistz256_from_mont ENDP
PUBLIC ecp_nistz256_select_w5
ALIGN 32
ecp_nistz256_select_w5 PROC PUBLIC
lea rax,QWORD PTR[((-136))+rsp]
$L$SEH_begin_ecp_nistz256_select_w5::
DB 048h,08dh,060h,0e0h
DB 00fh,029h,070h,0e0h
DB 00fh,029h,078h,0f0h
DB 044h,00fh,029h,000h
DB 044h,00fh,029h,048h,010h
DB 044h,00fh,029h,050h,020h
DB 044h,00fh,029h,058h,030h
DB 044h,00fh,029h,060h,040h
DB 044h,00fh,029h,068h,050h
DB 044h,00fh,029h,070h,060h
DB 044h,00fh,029h,078h,070h
movdqa xmm0,XMMWORD PTR[$L$One]
movd xmm1,r8d
pxor xmm2,xmm2
pxor xmm3,xmm3
pxor xmm4,xmm4
pxor xmm5,xmm5
pxor xmm6,xmm6
pxor xmm7,xmm7
movdqa xmm8,xmm0
pshufd xmm1,xmm1,0
mov rax,16
$L$select_loop_sse_w5::
movdqa xmm15,xmm8
paddd xmm8,xmm0
pcmpeqd xmm15,xmm1
movdqa xmm9,XMMWORD PTR[rdx]
movdqa xmm10,XMMWORD PTR[16+rdx]
movdqa xmm11,XMMWORD PTR[32+rdx]
movdqa xmm12,XMMWORD PTR[48+rdx]
movdqa xmm13,XMMWORD PTR[64+rdx]
movdqa xmm14,XMMWORD PTR[80+rdx]
lea rdx,QWORD PTR[96+rdx]
pand xmm9,xmm15
pand xmm10,xmm15
por xmm2,xmm9
pand xmm11,xmm15
por xmm3,xmm10
pand xmm12,xmm15
por xmm4,xmm11
pand xmm13,xmm15
por xmm5,xmm12
pand xmm14,xmm15
por xmm6,xmm13
por xmm7,xmm14
dec rax
jnz $L$select_loop_sse_w5
movdqu XMMWORD PTR[rcx],xmm2
movdqu XMMWORD PTR[16+rcx],xmm3
movdqu XMMWORD PTR[32+rcx],xmm4
movdqu XMMWORD PTR[48+rcx],xmm5
movdqu XMMWORD PTR[64+rcx],xmm6
movdqu XMMWORD PTR[80+rcx],xmm7
movaps xmm6,XMMWORD PTR[rsp]
movaps xmm7,XMMWORD PTR[16+rsp]
movaps xmm8,XMMWORD PTR[32+rsp]
movaps xmm9,XMMWORD PTR[48+rsp]
movaps xmm10,XMMWORD PTR[64+rsp]
movaps xmm11,XMMWORD PTR[80+rsp]
movaps xmm12,XMMWORD PTR[96+rsp]
movaps xmm13,XMMWORD PTR[112+rsp]
movaps xmm14,XMMWORD PTR[128+rsp]
movaps xmm15,XMMWORD PTR[144+rsp]
lea rsp,QWORD PTR[168+rsp]
$L$SEH_end_ecp_nistz256_select_w5::
DB 0F3h,0C3h ;repret
ecp_nistz256_select_w5 ENDP
PUBLIC ecp_nistz256_select_w7
ALIGN 32
ecp_nistz256_select_w7 PROC PUBLIC
lea rax,QWORD PTR[((-136))+rsp]
$L$SEH_begin_ecp_nistz256_select_w7::
DB 048h,08dh,060h,0e0h
DB 00fh,029h,070h,0e0h
DB 00fh,029h,078h,0f0h
DB 044h,00fh,029h,000h
DB 044h,00fh,029h,048h,010h
DB 044h,00fh,029h,050h,020h
DB 044h,00fh,029h,058h,030h
DB 044h,00fh,029h,060h,040h
DB 044h,00fh,029h,068h,050h
DB 044h,00fh,029h,070h,060h
DB 044h,00fh,029h,078h,070h
movdqa xmm8,XMMWORD PTR[$L$One]
movd xmm1,r8d
pxor xmm2,xmm2
pxor xmm3,xmm3
pxor xmm4,xmm4
pxor xmm5,xmm5
movdqa xmm0,xmm8
pshufd xmm1,xmm1,0
mov rax,64
$L$select_loop_sse_w7::
movdqa xmm15,xmm8
paddd xmm8,xmm0
movdqa xmm9,XMMWORD PTR[rdx]
movdqa xmm10,XMMWORD PTR[16+rdx]
pcmpeqd xmm15,xmm1
movdqa xmm11,XMMWORD PTR[32+rdx]
movdqa xmm12,XMMWORD PTR[48+rdx]
lea rdx,QWORD PTR[64+rdx]
pand xmm9,xmm15
pand xmm10,xmm15
por xmm2,xmm9
pand xmm11,xmm15
por xmm3,xmm10
pand xmm12,xmm15
por xmm4,xmm11
prefetcht0 [255+rdx]
por xmm5,xmm12
dec rax
jnz $L$select_loop_sse_w7
movdqu XMMWORD PTR[rcx],xmm2
movdqu XMMWORD PTR[16+rcx],xmm3
movdqu XMMWORD PTR[32+rcx],xmm4
movdqu XMMWORD PTR[48+rcx],xmm5
movaps xmm6,XMMWORD PTR[rsp]
movaps xmm7,XMMWORD PTR[16+rsp]
movaps xmm8,XMMWORD PTR[32+rsp]
movaps xmm9,XMMWORD PTR[48+rsp]
movaps xmm10,XMMWORD PTR[64+rsp]
movaps xmm11,XMMWORD PTR[80+rsp]
movaps xmm12,XMMWORD PTR[96+rsp]
movaps xmm13,XMMWORD PTR[112+rsp]
movaps xmm14,XMMWORD PTR[128+rsp]
movaps xmm15,XMMWORD PTR[144+rsp]
lea rsp,QWORD PTR[168+rsp]
$L$SEH_end_ecp_nistz256_select_w7::
DB 0F3h,0C3h ;repret
ecp_nistz256_select_w7 ENDP
PUBLIC ecp_nistz256_avx2_select_w7
ALIGN 32
ecp_nistz256_avx2_select_w7 PROC PUBLIC
mov QWORD PTR[8+rsp],rdi ;WIN64 prologue
mov QWORD PTR[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_ecp_nistz256_avx2_select_w7::
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
DB 00fh,00bh
mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue
mov rsi,QWORD PTR[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_ecp_nistz256_avx2_select_w7::
ecp_nistz256_avx2_select_w7 ENDP
ALIGN 32
__ecp_nistz256_add_toq PROC PRIVATE
add r12,QWORD PTR[rbx]
adc r13,QWORD PTR[8+rbx]
mov rax,r12
adc r8,QWORD PTR[16+rbx]
adc r9,QWORD PTR[24+rbx]
mov rbp,r13
sbb r11,r11
sub r12,-1
mov rcx,r8
sbb r13,r14
sbb r8,0
mov r10,r9
sbb r9,r15
test r11,r11
cmovz r12,rax
cmovz r13,rbp
mov QWORD PTR[rdi],r12
cmovz r8,rcx
mov QWORD PTR[8+rdi],r13
cmovz r9,r10
mov QWORD PTR[16+rdi],r8
mov QWORD PTR[24+rdi],r9
DB 0F3h,0C3h ;repret
__ecp_nistz256_add_toq ENDP
ALIGN 32
__ecp_nistz256_sub_fromq PROC PRIVATE
sub r12,QWORD PTR[rbx]
sbb r13,QWORD PTR[8+rbx]
mov rax,r12
sbb r8,QWORD PTR[16+rbx]
sbb r9,QWORD PTR[24+rbx]
mov rbp,r13
sbb r11,r11
add r12,-1
mov rcx,r8
adc r13,r14
adc r8,0
mov r10,r9
adc r9,r15
test r11,r11
cmovz r12,rax
cmovz r13,rbp
mov QWORD PTR[rdi],r12
cmovz r8,rcx
mov QWORD PTR[8+rdi],r13
cmovz r9,r10
mov QWORD PTR[16+rdi],r8
mov QWORD PTR[24+rdi],r9
DB 0F3h,0C3h ;repret
__ecp_nistz256_sub_fromq ENDP
ALIGN 32
__ecp_nistz256_subq PROC PRIVATE
sub rax,r12
sbb rbp,r13
mov r12,rax
sbb rcx,r8
sbb r10,r9
mov r13,rbp
sbb r11,r11
add rax,-1
mov r8,rcx
adc rbp,r14
adc rcx,0
mov r9,r10
adc r10,r15
test r11,r11
cmovnz r12,rax
cmovnz r13,rbp
cmovnz r8,rcx
cmovnz r9,r10
DB 0F3h,0C3h ;repret
__ecp_nistz256_subq ENDP
ALIGN 32
__ecp_nistz256_mul_by_2q PROC PRIVATE
add r12,r12
adc r13,r13
mov rax,r12
adc r8,r8
adc r9,r9
mov rbp,r13
sbb r11,r11
sub r12,-1
mov rcx,r8
sbb r13,r14
sbb r8,0
mov r10,r9
sbb r9,r15
test r11,r11
cmovz r12,rax
cmovz r13,rbp
mov QWORD PTR[rdi],r12
cmovz r8,rcx
mov QWORD PTR[8+rdi],r13
cmovz r9,r10
mov QWORD PTR[16+rdi],r8
mov QWORD PTR[24+rdi],r9
DB 0F3h,0C3h ;repret
__ecp_nistz256_mul_by_2q ENDP
PUBLIC ecp_nistz256_point_double
ALIGN 32
ecp_nistz256_point_double PROC PUBLIC
mov QWORD PTR[8+rsp],rdi ;WIN64 prologue
mov QWORD PTR[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_ecp_nistz256_point_double::
mov rdi,rcx
mov rsi,rdx
push rbp
push rbx
push r12
push r13
push r14
push r15
sub rsp,32*5+8
movdqu xmm0,XMMWORD PTR[rsi]
mov rbx,rsi
movdqu xmm1,XMMWORD PTR[16+rsi]
mov r12,QWORD PTR[((32+0))+rsi]
mov r13,QWORD PTR[((32+8))+rsi]
mov r8,QWORD PTR[((32+16))+rsi]
mov r9,QWORD PTR[((32+24))+rsi]
mov r14,QWORD PTR[(($L$poly+8))]
mov r15,QWORD PTR[(($L$poly+24))]
movdqa XMMWORD PTR[96+rsp],xmm0
movdqa XMMWORD PTR[(96+16)+rsp],xmm1
lea r10,QWORD PTR[32+rdi]
lea r11,QWORD PTR[64+rdi]
DB 102,72,15,110,199
DB 102,73,15,110,202
DB 102,73,15,110,211
lea rdi,QWORD PTR[rsp]
call __ecp_nistz256_mul_by_2q
mov rax,QWORD PTR[((64+0))+rsi]
mov r14,QWORD PTR[((64+8))+rsi]
mov r15,QWORD PTR[((64+16))+rsi]
mov r8,QWORD PTR[((64+24))+rsi]
lea rsi,QWORD PTR[((64-0))+rsi]
lea rdi,QWORD PTR[64+rsp]
call __ecp_nistz256_sqr_montq
mov rax,QWORD PTR[((0+0))+rsp]
mov r14,QWORD PTR[((8+0))+rsp]
lea rsi,QWORD PTR[((0+0))+rsp]
mov r15,QWORD PTR[((16+0))+rsp]
mov r8,QWORD PTR[((24+0))+rsp]
lea rdi,QWORD PTR[rsp]
call __ecp_nistz256_sqr_montq
mov rax,QWORD PTR[32+rbx]
mov r9,QWORD PTR[((64+0))+rbx]
mov r10,QWORD PTR[((64+8))+rbx]
mov r11,QWORD PTR[((64+16))+rbx]
mov r12,QWORD PTR[((64+24))+rbx]
lea rsi,QWORD PTR[((64-0))+rbx]
lea rbx,QWORD PTR[32+rbx]
DB 102,72,15,126,215
call __ecp_nistz256_mul_montq
call __ecp_nistz256_mul_by_2q
mov r12,QWORD PTR[((96+0))+rsp]
mov r13,QWORD PTR[((96+8))+rsp]
lea rbx,QWORD PTR[64+rsp]
mov r8,QWORD PTR[((96+16))+rsp]
mov r9,QWORD PTR[((96+24))+rsp]
lea rdi,QWORD PTR[32+rsp]
call __ecp_nistz256_add_toq
mov r12,QWORD PTR[((96+0))+rsp]
mov r13,QWORD PTR[((96+8))+rsp]
lea rbx,QWORD PTR[64+rsp]
mov r8,QWORD PTR[((96+16))+rsp]
mov r9,QWORD PTR[((96+24))+rsp]
lea rdi,QWORD PTR[64+rsp]
call __ecp_nistz256_sub_fromq
mov rax,QWORD PTR[((0+0))+rsp]
mov r14,QWORD PTR[((8+0))+rsp]
lea rsi,QWORD PTR[((0+0))+rsp]
mov r15,QWORD PTR[((16+0))+rsp]
mov r8,QWORD PTR[((24+0))+rsp]
DB 102,72,15,126,207
call __ecp_nistz256_sqr_montq
xor r9,r9
mov rax,r12
add r12,-1
mov r10,r13
adc r13,rsi
mov rcx,r14
adc r14,0
mov r8,r15
adc r15,rbp
adc r9,0
xor rsi,rsi
test rax,1
cmovz r12,rax
cmovz r13,r10
cmovz r14,rcx
cmovz r15,r8
cmovz r9,rsi
mov rax,r13
shr r12,1
shl rax,63
mov r10,r14
shr r13,1
or r12,rax
shl r10,63
mov rcx,r15
shr r14,1
or r13,r10
shl rcx,63
mov QWORD PTR[rdi],r12
shr r15,1
mov QWORD PTR[8+rdi],r13
shl r9,63
or r14,rcx
or r15,r9
mov QWORD PTR[16+rdi],r14
mov QWORD PTR[24+rdi],r15
mov rax,QWORD PTR[64+rsp]
lea rbx,QWORD PTR[64+rsp]
mov r9,QWORD PTR[((0+32))+rsp]
mov r10,QWORD PTR[((8+32))+rsp]
lea rsi,QWORD PTR[((0+32))+rsp]
mov r11,QWORD PTR[((16+32))+rsp]
mov r12,QWORD PTR[((24+32))+rsp]
lea rdi,QWORD PTR[32+rsp]
call __ecp_nistz256_mul_montq
lea rdi,QWORD PTR[128+rsp]
call __ecp_nistz256_mul_by_2q
lea rbx,QWORD PTR[32+rsp]
lea rdi,QWORD PTR[32+rsp]
call __ecp_nistz256_add_toq
mov rax,QWORD PTR[96+rsp]
lea rbx,QWORD PTR[96+rsp]
mov r9,QWORD PTR[((0+0))+rsp]
mov r10,QWORD PTR[((8+0))+rsp]
lea rsi,QWORD PTR[((0+0))+rsp]
mov r11,QWORD PTR[((16+0))+rsp]
mov r12,QWORD PTR[((24+0))+rsp]
lea rdi,QWORD PTR[rsp]
call __ecp_nistz256_mul_montq
lea rdi,QWORD PTR[128+rsp]
call __ecp_nistz256_mul_by_2q
mov rax,QWORD PTR[((0+32))+rsp]
mov r14,QWORD PTR[((8+32))+rsp]
lea rsi,QWORD PTR[((0+32))+rsp]
mov r15,QWORD PTR[((16+32))+rsp]
mov r8,QWORD PTR[((24+32))+rsp]
DB 102,72,15,126,199
call __ecp_nistz256_sqr_montq
lea rbx,QWORD PTR[128+rsp]
mov r8,r14
mov r9,r15
mov r14,rsi
mov r15,rbp
call __ecp_nistz256_sub_fromq
mov rax,QWORD PTR[((0+0))+rsp]
mov rbp,QWORD PTR[((0+8))+rsp]
mov rcx,QWORD PTR[((0+16))+rsp]
mov r10,QWORD PTR[((0+24))+rsp]
lea rdi,QWORD PTR[rsp]
call __ecp_nistz256_subq
mov rax,QWORD PTR[32+rsp]
lea rbx,QWORD PTR[32+rsp]
mov r14,r12
xor ecx,ecx
mov QWORD PTR[((0+0))+rsp],r12
mov r10,r13
mov QWORD PTR[((0+8))+rsp],r13
cmovz r11,r8
mov QWORD PTR[((0+16))+rsp],r8
lea rsi,QWORD PTR[((0-0))+rsp]
cmovz r12,r9
mov QWORD PTR[((0+24))+rsp],r9
mov r9,r14
lea rdi,QWORD PTR[rsp]
call __ecp_nistz256_mul_montq
DB 102,72,15,126,203
DB 102,72,15,126,207
call __ecp_nistz256_sub_fromq
add rsp,32*5+8
pop r15
pop r14
pop r13
pop r12
pop rbx
pop rbp
mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue
mov rsi,QWORD PTR[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_ecp_nistz256_point_double::
ecp_nistz256_point_double ENDP
PUBLIC ecp_nistz256_point_add
ALIGN 32
ecp_nistz256_point_add PROC PUBLIC
mov QWORD PTR[8+rsp],rdi ;WIN64 prologue
mov QWORD PTR[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_ecp_nistz256_point_add::
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
push rbp
push rbx
push r12
push r13
push r14
push r15
sub rsp,32*18+8
movdqu xmm0,XMMWORD PTR[rsi]
movdqu xmm1,XMMWORD PTR[16+rsi]
movdqu xmm2,XMMWORD PTR[32+rsi]
movdqu xmm3,XMMWORD PTR[48+rsi]
movdqu xmm4,XMMWORD PTR[64+rsi]
movdqu xmm5,XMMWORD PTR[80+rsi]
mov rbx,rsi
mov rsi,rdx
movdqa XMMWORD PTR[384+rsp],xmm0
movdqa XMMWORD PTR[(384+16)+rsp],xmm1
por xmm1,xmm0
movdqa XMMWORD PTR[416+rsp],xmm2
movdqa XMMWORD PTR[(416+16)+rsp],xmm3
por xmm3,xmm2
movdqa XMMWORD PTR[448+rsp],xmm4
movdqa XMMWORD PTR[(448+16)+rsp],xmm5
por xmm3,xmm1
movdqu xmm0,XMMWORD PTR[rsi]
pshufd xmm5,xmm3,1h
movdqu xmm1,XMMWORD PTR[16+rsi]
movdqu xmm2,XMMWORD PTR[32+rsi]
por xmm5,xmm3
movdqu xmm3,XMMWORD PTR[48+rsi]
mov rax,QWORD PTR[((64+0))+rsi]
mov r14,QWORD PTR[((64+8))+rsi]
mov r15,QWORD PTR[((64+16))+rsi]
mov r8,QWORD PTR[((64+24))+rsi]
movdqa XMMWORD PTR[480+rsp],xmm0
pshufd xmm4,xmm5,01eh
movdqa XMMWORD PTR[(480+16)+rsp],xmm1
por xmm1,xmm0
DB 102,72,15,110,199
movdqa XMMWORD PTR[512+rsp],xmm2
movdqa XMMWORD PTR[(512+16)+rsp],xmm3
por xmm3,xmm2
por xmm5,xmm4
pxor xmm4,xmm4
por xmm3,xmm1
lea rsi,QWORD PTR[((64-0))+rsi]
mov QWORD PTR[((544+0))+rsp],rax
mov QWORD PTR[((544+8))+rsp],r14
mov QWORD PTR[((544+16))+rsp],r15
mov QWORD PTR[((544+24))+rsp],r8
lea rdi,QWORD PTR[96+rsp]
call __ecp_nistz256_sqr_montq
pcmpeqd xmm5,xmm4
pshufd xmm4,xmm3,1h
por xmm4,xmm3
pshufd xmm5,xmm5,0
pshufd xmm3,xmm4,01eh
por xmm4,xmm3
pxor xmm3,xmm3
pcmpeqd xmm4,xmm3
pshufd xmm4,xmm4,0
mov rax,QWORD PTR[((64+0))+rbx]
mov r14,QWORD PTR[((64+8))+rbx]
mov r15,QWORD PTR[((64+16))+rbx]
mov r8,QWORD PTR[((64+24))+rbx]
lea rsi,QWORD PTR[((64-0))+rbx]
lea rdi,QWORD PTR[32+rsp]
call __ecp_nistz256_sqr_montq
mov rax,QWORD PTR[544+rsp]
lea rbx,QWORD PTR[544+rsp]
mov r9,QWORD PTR[((0+96))+rsp]
mov r10,QWORD PTR[((8+96))+rsp]
lea rsi,QWORD PTR[((0+96))+rsp]
mov r11,QWORD PTR[((16+96))+rsp]
mov r12,QWORD PTR[((24+96))+rsp]
lea rdi,QWORD PTR[224+rsp]
call __ecp_nistz256_mul_montq
mov rax,QWORD PTR[448+rsp]
lea rbx,QWORD PTR[448+rsp]
mov r9,QWORD PTR[((0+32))+rsp]
mov r10,QWORD PTR[((8+32))+rsp]
lea rsi,QWORD PTR[((0+32))+rsp]
mov r11,QWORD PTR[((16+32))+rsp]
mov r12,QWORD PTR[((24+32))+rsp]
lea rdi,QWORD PTR[256+rsp]
call __ecp_nistz256_mul_montq
mov rax,QWORD PTR[416+rsp]
lea rbx,QWORD PTR[416+rsp]
mov r9,QWORD PTR[((0+224))+rsp]
mov r10,QWORD PTR[((8+224))+rsp]
lea rsi,QWORD PTR[((0+224))+rsp]
mov r11,QWORD PTR[((16+224))+rsp]
mov r12,QWORD PTR[((24+224))+rsp]
lea rdi,QWORD PTR[224+rsp]
call __ecp_nistz256_mul_montq
mov rax,QWORD PTR[512+rsp]
lea rbx,QWORD PTR[512+rsp]
mov r9,QWORD PTR[((0+256))+rsp]
mov r10,QWORD PTR[((8+256))+rsp]
lea rsi,QWORD PTR[((0+256))+rsp]
mov r11,QWORD PTR[((16+256))+rsp]
mov r12,QWORD PTR[((24+256))+rsp]
lea rdi,QWORD PTR[256+rsp]
call __ecp_nistz256_mul_montq
lea rbx,QWORD PTR[224+rsp]
lea rdi,QWORD PTR[64+rsp]
call __ecp_nistz256_sub_fromq
or r12,r13
movdqa xmm2,xmm4
or r12,r8
or r12,r9
por xmm2,xmm5
DB 102,73,15,110,220
mov rax,QWORD PTR[384+rsp]
lea rbx,QWORD PTR[384+rsp]
mov r9,QWORD PTR[((0+96))+rsp]
mov r10,QWORD PTR[((8+96))+rsp]
lea rsi,QWORD PTR[((0+96))+rsp]
mov r11,QWORD PTR[((16+96))+rsp]
mov r12,QWORD PTR[((24+96))+rsp]
lea rdi,QWORD PTR[160+rsp]
call __ecp_nistz256_mul_montq
mov rax,QWORD PTR[480+rsp]
lea rbx,QWORD PTR[480+rsp]
mov r9,QWORD PTR[((0+32))+rsp]
mov r10,QWORD PTR[((8+32))+rsp]
lea rsi,QWORD PTR[((0+32))+rsp]
mov r11,QWORD PTR[((16+32))+rsp]
mov r12,QWORD PTR[((24+32))+rsp]
lea rdi,QWORD PTR[192+rsp]
call __ecp_nistz256_mul_montq
lea rbx,QWORD PTR[160+rsp]
lea rdi,QWORD PTR[rsp]
call __ecp_nistz256_sub_fromq
or r12,r13
or r12,r8
or r12,r9
DB 03eh
jnz $L$add_proceedq
DB 102,73,15,126,208
DB 102,73,15,126,217
test r8,r8
jnz $L$add_proceedq
test r9,r9
jz $L$add_proceedq
DB 102,72,15,126,199
pxor xmm0,xmm0
movdqu XMMWORD PTR[rdi],xmm0
movdqu XMMWORD PTR[16+rdi],xmm0
movdqu XMMWORD PTR[32+rdi],xmm0
movdqu XMMWORD PTR[48+rdi],xmm0
movdqu XMMWORD PTR[64+rdi],xmm0
movdqu XMMWORD PTR[80+rdi],xmm0
jmp $L$add_doneq
ALIGN 32
$L$add_proceedq::
mov rax,QWORD PTR[((0+64))+rsp]
mov r14,QWORD PTR[((8+64))+rsp]
lea rsi,QWORD PTR[((0+64))+rsp]
mov r15,QWORD PTR[((16+64))+rsp]
mov r8,QWORD PTR[((24+64))+rsp]
lea rdi,QWORD PTR[96+rsp]
call __ecp_nistz256_sqr_montq
mov rax,QWORD PTR[448+rsp]
lea rbx,QWORD PTR[448+rsp]
mov r9,QWORD PTR[((0+0))+rsp]
mov r10,QWORD PTR[((8+0))+rsp]
lea rsi,QWORD PTR[((0+0))+rsp]
mov r11,QWORD PTR[((16+0))+rsp]
mov r12,QWORD PTR[((24+0))+rsp]
lea rdi,QWORD PTR[352+rsp]
call __ecp_nistz256_mul_montq
mov rax,QWORD PTR[((0+0))+rsp]
mov r14,QWORD PTR[((8+0))+rsp]
lea rsi,QWORD PTR[((0+0))+rsp]
mov r15,QWORD PTR[((16+0))+rsp]
mov r8,QWORD PTR[((24+0))+rsp]
lea rdi,QWORD PTR[32+rsp]
call __ecp_nistz256_sqr_montq
mov rax,QWORD PTR[544+rsp]
lea rbx,QWORD PTR[544+rsp]
mov r9,QWORD PTR[((0+352))+rsp]
mov r10,QWORD PTR[((8+352))+rsp]
lea rsi,QWORD PTR[((0+352))+rsp]
mov r11,QWORD PTR[((16+352))+rsp]
mov r12,QWORD PTR[((24+352))+rsp]
lea rdi,QWORD PTR[352+rsp]
call __ecp_nistz256_mul_montq
mov rax,QWORD PTR[rsp]
lea rbx,QWORD PTR[rsp]
mov r9,QWORD PTR[((0+32))+rsp]
mov r10,QWORD PTR[((8+32))+rsp]
lea rsi,QWORD PTR[((0+32))+rsp]
mov r11,QWORD PTR[((16+32))+rsp]
mov r12,QWORD PTR[((24+32))+rsp]
lea rdi,QWORD PTR[128+rsp]
call __ecp_nistz256_mul_montq
mov rax,QWORD PTR[160+rsp]
lea rbx,QWORD PTR[160+rsp]
mov r9,QWORD PTR[((0+32))+rsp]
mov r10,QWORD PTR[((8+32))+rsp]
lea rsi,QWORD PTR[((0+32))+rsp]
mov r11,QWORD PTR[((16+32))+rsp]
mov r12,QWORD PTR[((24+32))+rsp]
lea rdi,QWORD PTR[192+rsp]
call __ecp_nistz256_mul_montq
add r12,r12
lea rsi,QWORD PTR[96+rsp]
adc r13,r13
mov rax,r12
adc r8,r8
adc r9,r9
mov rbp,r13
sbb r11,r11
sub r12,-1
mov rcx,r8
sbb r13,r14
sbb r8,0
mov r10,r9
sbb r9,r15
test r11,r11
cmovz r12,rax
mov rax,QWORD PTR[rsi]
cmovz r13,rbp
mov rbp,QWORD PTR[8+rsi]
cmovz r8,rcx
mov rcx,QWORD PTR[16+rsi]
cmovz r9,r10
mov r10,QWORD PTR[24+rsi]
call __ecp_nistz256_subq
lea rbx,QWORD PTR[128+rsp]
lea rdi,QWORD PTR[288+rsp]
call __ecp_nistz256_sub_fromq
mov rax,QWORD PTR[((192+0))+rsp]
mov rbp,QWORD PTR[((192+8))+rsp]
mov rcx,QWORD PTR[((192+16))+rsp]
mov r10,QWORD PTR[((192+24))+rsp]
lea rdi,QWORD PTR[320+rsp]
call __ecp_nistz256_subq
mov QWORD PTR[rdi],r12
mov QWORD PTR[8+rdi],r13
mov QWORD PTR[16+rdi],r8
mov QWORD PTR[24+rdi],r9
mov rax,QWORD PTR[128+rsp]
lea rbx,QWORD PTR[128+rsp]
mov r9,QWORD PTR[((0+224))+rsp]
mov r10,QWORD PTR[((8+224))+rsp]
lea rsi,QWORD PTR[((0+224))+rsp]
mov r11,QWORD PTR[((16+224))+rsp]
mov r12,QWORD PTR[((24+224))+rsp]
lea rdi,QWORD PTR[256+rsp]
call __ecp_nistz256_mul_montq
mov rax,QWORD PTR[320+rsp]
lea rbx,QWORD PTR[320+rsp]
mov r9,QWORD PTR[((0+64))+rsp]
mov r10,QWORD PTR[((8+64))+rsp]
lea rsi,QWORD PTR[((0+64))+rsp]
mov r11,QWORD PTR[((16+64))+rsp]
mov r12,QWORD PTR[((24+64))+rsp]
lea rdi,QWORD PTR[320+rsp]
call __ecp_nistz256_mul_montq
lea rbx,QWORD PTR[256+rsp]
lea rdi,QWORD PTR[320+rsp]
call __ecp_nistz256_sub_fromq
DB 102,72,15,126,199
movdqa xmm0,xmm5
movdqa xmm1,xmm5
pandn xmm0,XMMWORD PTR[352+rsp]
movdqa xmm2,xmm5
pandn xmm1,XMMWORD PTR[((352+16))+rsp]
movdqa xmm3,xmm5
pand xmm2,XMMWORD PTR[544+rsp]
pand xmm3,XMMWORD PTR[((544+16))+rsp]
por xmm2,xmm0
por xmm3,xmm1
movdqa xmm0,xmm4
movdqa xmm1,xmm4
pandn xmm0,xmm2
movdqa xmm2,xmm4
pandn xmm1,xmm3
movdqa xmm3,xmm4
pand xmm2,XMMWORD PTR[448+rsp]
pand xmm3,XMMWORD PTR[((448+16))+rsp]
por xmm2,xmm0
por xmm3,xmm1
movdqu XMMWORD PTR[64+rdi],xmm2
movdqu XMMWORD PTR[80+rdi],xmm3
movdqa xmm0,xmm5
movdqa xmm1,xmm5
pandn xmm0,XMMWORD PTR[288+rsp]
movdqa xmm2,xmm5
pandn xmm1,XMMWORD PTR[((288+16))+rsp]
movdqa xmm3,xmm5
pand xmm2,XMMWORD PTR[480+rsp]
pand xmm3,XMMWORD PTR[((480+16))+rsp]
por xmm2,xmm0
por xmm3,xmm1
movdqa xmm0,xmm4
movdqa xmm1,xmm4
pandn xmm0,xmm2
movdqa xmm2,xmm4
pandn xmm1,xmm3
movdqa xmm3,xmm4
pand xmm2,XMMWORD PTR[384+rsp]
pand xmm3,XMMWORD PTR[((384+16))+rsp]
por xmm2,xmm0
por xmm3,xmm1
movdqu XMMWORD PTR[rdi],xmm2
movdqu XMMWORD PTR[16+rdi],xmm3
movdqa xmm0,xmm5
movdqa xmm1,xmm5
pandn xmm0,XMMWORD PTR[320+rsp]
movdqa xmm2,xmm5
pandn xmm1,XMMWORD PTR[((320+16))+rsp]
movdqa xmm3,xmm5
pand xmm2,XMMWORD PTR[512+rsp]
pand xmm3,XMMWORD PTR[((512+16))+rsp]
por xmm2,xmm0
por xmm3,xmm1
movdqa xmm0,xmm4
movdqa xmm1,xmm4
pandn xmm0,xmm2
movdqa xmm2,xmm4
pandn xmm1,xmm3
movdqa xmm3,xmm4
pand xmm2,XMMWORD PTR[416+rsp]
pand xmm3,XMMWORD PTR[((416+16))+rsp]
por xmm2,xmm0
por xmm3,xmm1
movdqu XMMWORD PTR[32+rdi],xmm2
movdqu XMMWORD PTR[48+rdi],xmm3
$L$add_doneq::
add rsp,32*18+8
pop r15
pop r14
pop r13
pop r12
pop rbx
pop rbp
mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue
mov rsi,QWORD PTR[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_ecp_nistz256_point_add::
ecp_nistz256_point_add ENDP
PUBLIC ecp_nistz256_point_add_affine
ALIGN 32
ecp_nistz256_point_add_affine PROC PUBLIC
mov QWORD PTR[8+rsp],rdi ;WIN64 prologue
mov QWORD PTR[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_ecp_nistz256_point_add_affine::
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
push rbp
push rbx
push r12
push r13
push r14
push r15
sub rsp,32*15+8
movdqu xmm0,XMMWORD PTR[rsi]
mov rbx,rdx
movdqu xmm1,XMMWORD PTR[16+rsi]
movdqu xmm2,XMMWORD PTR[32+rsi]
movdqu xmm3,XMMWORD PTR[48+rsi]
movdqu xmm4,XMMWORD PTR[64+rsi]
movdqu xmm5,XMMWORD PTR[80+rsi]
mov rax,QWORD PTR[((64+0))+rsi]
mov r14,QWORD PTR[((64+8))+rsi]
mov r15,QWORD PTR[((64+16))+rsi]
mov r8,QWORD PTR[((64+24))+rsi]
movdqa XMMWORD PTR[320+rsp],xmm0
movdqa XMMWORD PTR[(320+16)+rsp],xmm1
por xmm1,xmm0
movdqa XMMWORD PTR[352+rsp],xmm2
movdqa XMMWORD PTR[(352+16)+rsp],xmm3
por xmm3,xmm2
movdqa XMMWORD PTR[384+rsp],xmm4
movdqa XMMWORD PTR[(384+16)+rsp],xmm5
por xmm3,xmm1
movdqu xmm0,XMMWORD PTR[rbx]
pshufd xmm5,xmm3,1h
movdqu xmm1,XMMWORD PTR[16+rbx]
movdqu xmm2,XMMWORD PTR[32+rbx]
por xmm5,xmm3
movdqu xmm3,XMMWORD PTR[48+rbx]
movdqa XMMWORD PTR[416+rsp],xmm0
pshufd xmm4,xmm5,01eh
movdqa XMMWORD PTR[(416+16)+rsp],xmm1
por xmm1,xmm0
DB 102,72,15,110,199
movdqa XMMWORD PTR[448+rsp],xmm2
movdqa XMMWORD PTR[(448+16)+rsp],xmm3
por xmm3,xmm2
por xmm5,xmm4
pxor xmm4,xmm4
por xmm3,xmm1
lea rsi,QWORD PTR[((64-0))+rsi]
lea rdi,QWORD PTR[32+rsp]
call __ecp_nistz256_sqr_montq
pcmpeqd xmm5,xmm4
pshufd xmm4,xmm3,1h
mov rax,QWORD PTR[rbx]
mov r9,r12
por xmm4,xmm3
pshufd xmm5,xmm5,0
pshufd xmm3,xmm4,01eh
mov r10,r13
por xmm4,xmm3
pxor xmm3,xmm3
mov r11,r14
pcmpeqd xmm4,xmm3
pshufd xmm4,xmm4,0
lea rsi,QWORD PTR[((32-0))+rsp]
mov r12,r15
lea rdi,QWORD PTR[rsp]
call __ecp_nistz256_mul_montq
lea rbx,QWORD PTR[320+rsp]
lea rdi,QWORD PTR[64+rsp]
call __ecp_nistz256_sub_fromq
mov rax,QWORD PTR[384+rsp]
lea rbx,QWORD PTR[384+rsp]
mov r9,QWORD PTR[((0+32))+rsp]
mov r10,QWORD PTR[((8+32))+rsp]
lea rsi,QWORD PTR[((0+32))+rsp]
mov r11,QWORD PTR[((16+32))+rsp]
mov r12,QWORD PTR[((24+32))+rsp]
lea rdi,QWORD PTR[32+rsp]
call __ecp_nistz256_mul_montq
mov rax,QWORD PTR[384+rsp]
lea rbx,QWORD PTR[384+rsp]
mov r9,QWORD PTR[((0+64))+rsp]
mov r10,QWORD PTR[((8+64))+rsp]
lea rsi,QWORD PTR[((0+64))+rsp]
mov r11,QWORD PTR[((16+64))+rsp]
mov r12,QWORD PTR[((24+64))+rsp]
lea rdi,QWORD PTR[288+rsp]
call __ecp_nistz256_mul_montq
mov rax,QWORD PTR[448+rsp]
lea rbx,QWORD PTR[448+rsp]
mov r9,QWORD PTR[((0+32))+rsp]
mov r10,QWORD PTR[((8+32))+rsp]
lea rsi,QWORD PTR[((0+32))+rsp]
mov r11,QWORD PTR[((16+32))+rsp]
mov r12,QWORD PTR[((24+32))+rsp]
lea rdi,QWORD PTR[32+rsp]
call __ecp_nistz256_mul_montq
lea rbx,QWORD PTR[352+rsp]
lea rdi,QWORD PTR[96+rsp]
call __ecp_nistz256_sub_fromq
mov rax,QWORD PTR[((0+64))+rsp]
mov r14,QWORD PTR[((8+64))+rsp]
lea rsi,QWORD PTR[((0+64))+rsp]
mov r15,QWORD PTR[((16+64))+rsp]
mov r8,QWORD PTR[((24+64))+rsp]
lea rdi,QWORD PTR[128+rsp]
call __ecp_nistz256_sqr_montq
mov rax,QWORD PTR[((0+96))+rsp]
mov r14,QWORD PTR[((8+96))+rsp]
lea rsi,QWORD PTR[((0+96))+rsp]
mov r15,QWORD PTR[((16+96))+rsp]
mov r8,QWORD PTR[((24+96))+rsp]
lea rdi,QWORD PTR[192+rsp]
call __ecp_nistz256_sqr_montq
mov rax,QWORD PTR[128+rsp]
lea rbx,QWORD PTR[128+rsp]
mov r9,QWORD PTR[((0+64))+rsp]
mov r10,QWORD PTR[((8+64))+rsp]
lea rsi,QWORD PTR[((0+64))+rsp]
mov r11,QWORD PTR[((16+64))+rsp]
mov r12,QWORD PTR[((24+64))+rsp]
lea rdi,QWORD PTR[160+rsp]
call __ecp_nistz256_mul_montq
mov rax,QWORD PTR[320+rsp]
lea rbx,QWORD PTR[320+rsp]
mov r9,QWORD PTR[((0+128))+rsp]
mov r10,QWORD PTR[((8+128))+rsp]
lea rsi,QWORD PTR[((0+128))+rsp]
mov r11,QWORD PTR[((16+128))+rsp]
mov r12,QWORD PTR[((24+128))+rsp]
lea rdi,QWORD PTR[rsp]
call __ecp_nistz256_mul_montq
add r12,r12
lea rsi,QWORD PTR[192+rsp]
adc r13,r13
mov rax,r12
adc r8,r8
adc r9,r9
mov rbp,r13
sbb r11,r11
sub r12,-1
mov rcx,r8
sbb r13,r14
sbb r8,0
mov r10,r9
sbb r9,r15
test r11,r11
cmovz r12,rax
mov rax,QWORD PTR[rsi]
cmovz r13,rbp
mov rbp,QWORD PTR[8+rsi]
cmovz r8,rcx
mov rcx,QWORD PTR[16+rsi]
cmovz r9,r10
mov r10,QWORD PTR[24+rsi]
call __ecp_nistz256_subq
lea rbx,QWORD PTR[160+rsp]
lea rdi,QWORD PTR[224+rsp]
call __ecp_nistz256_sub_fromq
mov rax,QWORD PTR[((0+0))+rsp]
mov rbp,QWORD PTR[((0+8))+rsp]
mov rcx,QWORD PTR[((0+16))+rsp]
mov r10,QWORD PTR[((0+24))+rsp]
lea rdi,QWORD PTR[64+rsp]
call __ecp_nistz256_subq
mov QWORD PTR[rdi],r12
mov QWORD PTR[8+rdi],r13
mov QWORD PTR[16+rdi],r8
mov QWORD PTR[24+rdi],r9
mov rax,QWORD PTR[352+rsp]
lea rbx,QWORD PTR[352+rsp]
mov r9,QWORD PTR[((0+160))+rsp]
mov r10,QWORD PTR[((8+160))+rsp]
lea rsi,QWORD PTR[((0+160))+rsp]
mov r11,QWORD PTR[((16+160))+rsp]
mov r12,QWORD PTR[((24+160))+rsp]
lea rdi,QWORD PTR[32+rsp]
call __ecp_nistz256_mul_montq
mov rax,QWORD PTR[96+rsp]
lea rbx,QWORD PTR[96+rsp]
mov r9,QWORD PTR[((0+64))+rsp]
mov r10,QWORD PTR[((8+64))+rsp]
lea rsi,QWORD PTR[((0+64))+rsp]
mov r11,QWORD PTR[((16+64))+rsp]
mov r12,QWORD PTR[((24+64))+rsp]
lea rdi,QWORD PTR[64+rsp]
call __ecp_nistz256_mul_montq
lea rbx,QWORD PTR[32+rsp]
lea rdi,QWORD PTR[256+rsp]
call __ecp_nistz256_sub_fromq
DB 102,72,15,126,199
movdqa xmm0,xmm5
movdqa xmm1,xmm5
pandn xmm0,XMMWORD PTR[288+rsp]
movdqa xmm2,xmm5
pandn xmm1,XMMWORD PTR[((288+16))+rsp]
movdqa xmm3,xmm5
pand xmm2,XMMWORD PTR[$L$ONE_mont]
pand xmm3,XMMWORD PTR[(($L$ONE_mont+16))]
por xmm2,xmm0
por xmm3,xmm1
movdqa xmm0,xmm4
movdqa xmm1,xmm4
pandn xmm0,xmm2
movdqa xmm2,xmm4
pandn xmm1,xmm3
movdqa xmm3,xmm4
pand xmm2,XMMWORD PTR[384+rsp]
pand xmm3,XMMWORD PTR[((384+16))+rsp]
por xmm2,xmm0
por xmm3,xmm1
movdqu XMMWORD PTR[64+rdi],xmm2
movdqu XMMWORD PTR[80+rdi],xmm3
movdqa xmm0,xmm5
movdqa xmm1,xmm5
pandn xmm0,XMMWORD PTR[224+rsp]
movdqa xmm2,xmm5
pandn xmm1,XMMWORD PTR[((224+16))+rsp]
movdqa xmm3,xmm5
pand xmm2,XMMWORD PTR[416+rsp]
pand xmm3,XMMWORD PTR[((416+16))+rsp]
por xmm2,xmm0
por xmm3,xmm1
movdqa xmm0,xmm4
movdqa xmm1,xmm4
pandn xmm0,xmm2
movdqa xmm2,xmm4
pandn xmm1,xmm3
movdqa xmm3,xmm4
pand xmm2,XMMWORD PTR[320+rsp]
pand xmm3,XMMWORD PTR[((320+16))+rsp]
por xmm2,xmm0
por xmm3,xmm1
movdqu XMMWORD PTR[rdi],xmm2
movdqu XMMWORD PTR[16+rdi],xmm3
movdqa xmm0,xmm5
movdqa xmm1,xmm5
pandn xmm0,XMMWORD PTR[256+rsp]
movdqa xmm2,xmm5
pandn xmm1,XMMWORD PTR[((256+16))+rsp]
movdqa xmm3,xmm5
pand xmm2,XMMWORD PTR[448+rsp]
pand xmm3,XMMWORD PTR[((448+16))+rsp]
por xmm2,xmm0
por xmm3,xmm1
movdqa xmm0,xmm4
movdqa xmm1,xmm4
pandn xmm0,xmm2
movdqa xmm2,xmm4
pandn xmm1,xmm3
movdqa xmm3,xmm4
pand xmm2,XMMWORD PTR[352+rsp]
pand xmm3,XMMWORD PTR[((352+16))+rsp]
por xmm2,xmm0
por xmm3,xmm1
movdqu XMMWORD PTR[32+rdi],xmm2
movdqu XMMWORD PTR[48+rdi],xmm3
add rsp,32*15+8
pop r15
pop r14
pop r13
pop r12
pop rbx
pop rbp
mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue
mov rsi,QWORD PTR[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_ecp_nistz256_point_add_affine::
ecp_nistz256_point_add_affine ENDP
.text$ ENDS
END
| dkoontz/nodegit | vendor/openssl/asm_obsolete/x64-win32-masm/ec/ecp_nistz256-x86_64.asm | Assembly | mit | 40,417 |
; Licensed to the .NET Foundation under one or more agreements.
; The .NET Foundation licenses this file to you under the MIT license.
; See the LICENSE file in the project root for more information.
; ==++==
;
;
; ==--==
; ***********************************************************************
; File: JitHelpers_InlineGetThread.asm, see history in jithelp.asm
;
; Notes: These routinues will be patched at runtime with the location in
; the TLS to find the Thread* and are the fastest implementation
; of their specific functionality.
; ***********************************************************************
include AsmMacros.inc
include asmconstants.inc
; Min amount of stack space that a nested function should allocate.
MIN_SIZE equ 28h
; Macro to create a patchable inline GetAppdomain, if we decide to create patchable
; high TLS inline versions then just change this macro to make sure to create enough
; space in the asm to patch the high TLS getter instructions.
PATCHABLE_INLINE_GETTHREAD macro Reg, PatchLabel
PATCH_LABEL PatchLabel
mov Reg, gs:[OFFSET__TEB__TlsSlots]
endm
JIT_NEW equ ?JIT_New@@YAPEAVObject@@PEAUCORINFO_CLASS_STRUCT_@@@Z
Object__DEBUG_SetAppDomain equ ?DEBUG_SetAppDomain@Object@@QEAAXPEAVAppDomain@@@Z
CopyValueClassUnchecked equ ?CopyValueClassUnchecked@@YAXPEAX0PEAVMethodTable@@@Z
JIT_Box equ ?JIT_Box@@YAPEAVObject@@PEAUCORINFO_CLASS_STRUCT_@@PEAX@Z
g_pStringClass equ ?g_pStringClass@@3PEAVMethodTable@@EA
FramedAllocateString equ ?FramedAllocateString@@YAPEAVStringObject@@K@Z
JIT_NewArr1 equ ?JIT_NewArr1@@YAPEAVObject@@PEAUCORINFO_CLASS_STRUCT_@@_J@Z
INVALIDGCVALUE equ 0CCCCCCCDh
extern JIT_NEW:proc
extern CopyValueClassUnchecked:proc
extern JIT_Box:proc
extern g_pStringClass:QWORD
extern FramedAllocateString:proc
extern JIT_NewArr1:proc
extern JIT_InternalThrow:proc
ifdef _DEBUG
extern DEBUG_TrialAllocSetAppDomain:proc
extern DEBUG_TrialAllocSetAppDomain_NoScratchArea:proc
endif
; IN: rcx: MethodTable*
; OUT: rax: new object
LEAF_ENTRY JIT_TrialAllocSFastMP_InlineGetThread, _TEXT
mov edx, [rcx + OFFSET__MethodTable__m_BaseSize]
; m_BaseSize is guaranteed to be a multiple of 8.
PATCHABLE_INLINE_GETTHREAD r11, JIT_TrialAllocSFastMP_InlineGetThread__PatchTLSOffset
mov r10, [r11 + OFFSET__Thread__m_alloc_context__alloc_limit]
mov rax, [r11 + OFFSET__Thread__m_alloc_context__alloc_ptr]
add rdx, rax
cmp rdx, r10
ja AllocFailed
mov [r11 + OFFSET__Thread__m_alloc_context__alloc_ptr], rdx
mov [rax], rcx
ifdef _DEBUG
call DEBUG_TrialAllocSetAppDomain_NoScratchArea
endif ; _DEBUG
ret
AllocFailed:
jmp JIT_NEW
LEAF_END JIT_TrialAllocSFastMP_InlineGetThread, _TEXT
; HCIMPL2(Object*, JIT_Box, CORINFO_CLASS_HANDLE type, void* unboxedData)
NESTED_ENTRY JIT_BoxFastMP_InlineGetThread, _TEXT
mov rax, [rcx + OFFSETOF__MethodTable__m_pWriteableData]
; Check whether the class has not been initialized
test dword ptr [rax + OFFSETOF__MethodTableWriteableData__m_dwFlags], MethodTableWriteableData__enum_flag_Unrestored
jnz ClassNotInited
mov r8d, [rcx + OFFSET__MethodTable__m_BaseSize]
; m_BaseSize is guaranteed to be a multiple of 8.
PATCHABLE_INLINE_GETTHREAD r11, JIT_BoxFastMPIGT__PatchTLSLabel
mov r10, [r11 + OFFSET__Thread__m_alloc_context__alloc_limit]
mov rax, [r11 + OFFSET__Thread__m_alloc_context__alloc_ptr]
add r8, rax
cmp r8, r10
ja AllocFailed
mov [r11 + OFFSET__Thread__m_alloc_context__alloc_ptr], r8
mov [rax], rcx
ifdef _DEBUG
call DEBUG_TrialAllocSetAppDomain_NoScratchArea
endif ; _DEBUG
; Check whether the object contains pointers
test dword ptr [rcx + OFFSETOF__MethodTable__m_dwFlags], MethodTable__enum_flag_ContainsPointers
jnz ContainsPointers
; We have no pointers - emit a simple inline copy loop
; Copy the contents from the end
mov ecx, [rcx + OFFSET__MethodTable__m_BaseSize]
sub ecx, 18h ; sizeof(ObjHeader) + sizeof(Object) + last slot
align 16
CopyLoop:
mov r8, [rdx+rcx]
mov [rax+rcx+8], r8
sub ecx, 8
jge CopyLoop
REPRET
ContainsPointers:
; Do call to CopyValueClassUnchecked(object, data, pMT)
push_vol_reg rax
alloc_stack 20h
END_PROLOGUE
mov r8, rcx
lea rcx, [rax + 8]
call CopyValueClassUnchecked
add rsp, 20h
pop rax
ret
ClassNotInited:
AllocFailed:
jmp JIT_Box
NESTED_END JIT_BoxFastMP_InlineGetThread, _TEXT
LEAF_ENTRY AllocateStringFastMP_InlineGetThread, _TEXT
; We were passed the number of characters in ECX
; we need to load the method table for string from the global
mov r9, [g_pStringClass]
; Instead of doing elaborate overflow checks, we just limit the number of elements
; to (LARGE_OBJECT_SIZE - 256)/sizeof(WCHAR) or less.
; This will avoid all overflow problems, as well as making sure
; big string objects are correctly allocated in the big object heap.
cmp ecx, (ASM_LARGE_OBJECT_SIZE - 256)/2
jae OversizedString
mov edx, [r9 + OFFSET__MethodTable__m_BaseSize]
; Calculate the final size to allocate.
; We need to calculate baseSize + cnt*2, then round that up by adding 7 and anding ~7.
lea edx, [edx + ecx*2 + 7]
and edx, -8
PATCHABLE_INLINE_GETTHREAD r11, AllocateStringFastMP_InlineGetThread__PatchTLSOffset
mov r10, [r11 + OFFSET__Thread__m_alloc_context__alloc_limit]
mov rax, [r11 + OFFSET__Thread__m_alloc_context__alloc_ptr]
add rdx, rax
cmp rdx, r10
ja AllocFailed
mov [r11 + OFFSET__Thread__m_alloc_context__alloc_ptr], rdx
mov [rax], r9
mov [rax + OFFSETOF__StringObject__m_StringLength], ecx
ifdef _DEBUG
call DEBUG_TrialAllocSetAppDomain_NoScratchArea
endif ; _DEBUG
ret
OversizedString:
AllocFailed:
jmp FramedAllocateString
LEAF_END AllocateStringFastMP_InlineGetThread, _TEXT
; HCIMPL2(Object*, JIT_NewArr1VC_MP_InlineGetThread, CORINFO_CLASS_HANDLE arrayMT, INT_PTR size)
LEAF_ENTRY JIT_NewArr1VC_MP_InlineGetThread, _TEXT
; We were passed a (shared) method table in RCX, which contains the element type.
; The element count is in RDX
; NOTE: if this code is ported for CORINFO_HELP_NEWSFAST_ALIGN8, it will need
; to emulate the double-specific behavior of JIT_TrialAlloc::GenAllocArray.
; Do a conservative check here. This is to avoid overflow while doing the calculations. We don't
; have to worry about "large" objects, since the allocation quantum is never big enough for
; LARGE_OBJECT_SIZE.
; For Value Classes, this needs to be 2^16 - slack (2^32 / max component size),
; The slack includes the size for the array header and round-up ; for alignment. Use 256 for the
; slack value out of laziness.
; In both cases we do a final overflow check after adding to the alloc_ptr.
cmp rdx, (65535 - 256)
jae OversizedArray
movzx r8d, word ptr [rcx + OFFSETOF__MethodTable__m_dwFlags] ; component size is low 16 bits
imul r8d, edx
add r8d, dword ptr [rcx + OFFSET__MethodTable__m_BaseSize]
; round the size to a multiple of 8
add r8d, 7
and r8d, -8
PATCHABLE_INLINE_GETTHREAD r11, JIT_NewArr1VC_MP_InlineGetThread__PatchTLSOffset
mov r10, [r11 + OFFSET__Thread__m_alloc_context__alloc_limit]
mov rax, [r11 + OFFSET__Thread__m_alloc_context__alloc_ptr]
add r8, rax
jc AllocFailed
cmp r8, r10
ja AllocFailed
mov [r11 + OFFSET__Thread__m_alloc_context__alloc_ptr], r8
mov [rax], rcx
mov dword ptr [rax + OFFSETOF__ArrayBase__m_NumComponents], edx
ifdef _DEBUG
call DEBUG_TrialAllocSetAppDomain_NoScratchArea
endif ; _DEBUG
ret
OversizedArray:
AllocFailed:
jmp JIT_NewArr1
LEAF_END JIT_NewArr1VC_MP_InlineGetThread, _TEXT
; HCIMPL2(Object*, JIT_NewArr1OBJ_MP_InlineGetThread, CORINFO_CLASS_HANDLE arrayMT, INT_PTR size)
LEAF_ENTRY JIT_NewArr1OBJ_MP_InlineGetThread, _TEXT
; We were passed a (shared) method table in RCX, which contains the element type.
; The element count is in RDX
; NOTE: if this code is ported for CORINFO_HELP_NEWSFAST_ALIGN8, it will need
; to emulate the double-specific behavior of JIT_TrialAlloc::GenAllocArray.
; Verifies that LARGE_OBJECT_SIZE fits in 32-bit. This allows us to do array size
; arithmetic using 32-bit registers.
.erre ASM_LARGE_OBJECT_SIZE lt 100000000h
cmp rdx, (ASM_LARGE_OBJECT_SIZE - 256)/8 ; sizeof(void*)
jae OversizedArray
; In this case we know the element size is sizeof(void *), or 8 for x64
; This helps us in two ways - we can shift instead of multiplying, and
; there's no need to align the size either
mov r8d, dword ptr [rcx + OFFSET__MethodTable__m_BaseSize]
lea r8d, [r8d + edx * 8]
; No need for rounding in this case - element size is 8, and m_BaseSize is guaranteed
; to be a multiple of 8.
PATCHABLE_INLINE_GETTHREAD r11, JIT_NewArr1OBJ_MP_InlineGetThread__PatchTLSOffset
mov r10, [r11 + OFFSET__Thread__m_alloc_context__alloc_limit]
mov rax, [r11 + OFFSET__Thread__m_alloc_context__alloc_ptr]
add r8, rax
cmp r8, r10
ja AllocFailed
mov [r11 + OFFSET__Thread__m_alloc_context__alloc_ptr], r8
mov [rax], rcx
mov dword ptr [rax + OFFSETOF__ArrayBase__m_NumComponents], edx
ifdef _DEBUG
call DEBUG_TrialAllocSetAppDomain_NoScratchArea
endif ; _DEBUG
ret
OversizedArray:
AllocFailed:
jmp JIT_NewArr1
LEAF_END JIT_NewArr1OBJ_MP_InlineGetThread, _TEXT
MON_ENTER_STACK_SIZE equ 00000020h
MON_EXIT_STACK_SIZE equ 00000068h
ifdef MON_DEBUG
ifdef TRACK_SYNC
MON_ENTER_STACK_SIZE_INLINEGETTHREAD equ 00000020h
MON_EXIT_STACK_SIZE_INLINEGETTHREAD equ 00000068h
endif
endif
BIT_SBLK_IS_HASH_OR_SYNCBLKINDEX equ 08000000h ; syncblk.h
BIT_SBLK_IS_HASHCODE equ 04000000h ; syncblk.h
BIT_SBLK_SPIN_LOCK equ 10000000h ; syncblk.h
SBLK_MASK_LOCK_THREADID equ 000003FFh ; syncblk.h
SBLK_LOCK_RECLEVEL_INC equ 00000400h ; syncblk.h
SBLK_MASK_LOCK_RECLEVEL equ 0000FC00h ; syncblk.h
MASK_SYNCBLOCKINDEX equ 03FFFFFFh ; syncblk.h
STATE_CHECK equ 0FFFFFFFEh
MT_CTX_PROXY_FLAG equ 10000000h
g_pSyncTable equ ?g_pSyncTable@@3PEAVSyncTableEntry@@EA
g_SystemInfo equ ?g_SystemInfo@@3U_SYSTEM_INFO@@A
g_SpinConstants equ ?g_SpinConstants@@3USpinConstants@@A
extern g_pSyncTable:QWORD
extern g_SystemInfo:QWORD
extern g_SpinConstants:QWORD
; JITutil_MonEnterWorker(Object* obj, BYTE* pbLockTaken)
extern JITutil_MonEnterWorker:proc
; JITutil_MonTryEnter(Object* obj, INT32 timeout, BYTE* pbLockTaken)
extern JITutil_MonTryEnter:proc
; JITutil_MonExitWorker(Object* obj, BYTE* pbLockTaken)
extern JITutil_MonExitWorker:proc
; JITutil_MonSignal(AwareLock* lock, BYTE* pbLockTaken)
extern JITutil_MonSignal:proc
; JITutil_MonContention(AwareLock* lock, BYTE* pbLockTaken)
extern JITutil_MonContention:proc
ifdef _DEBUG
MON_DEBUG equ 1
endif
ifdef MON_DEBUG
ifdef TRACK_SYNC
extern EnterSyncHelper:proc
extern LeaveSyncHelper:proc
endif
endif
MON_ENTER_EPILOG_ADJUST_STACK macro
ifdef MON_DEBUG
ifdef TRACK_SYNC
add rsp, MON_ENTER_STACK_SIZE_INLINEGETTHREAD
endif
endif
endm
MON_ENTER_RETURN_SUCCESS macro
; This is sensitive to the potential that pbLockTaken is NULL
test rsi, rsi
jz @F
mov byte ptr [rsi], 1
@@:
MON_ENTER_EPILOG_ADJUST_STACK
pop rsi
ret
endm
; The worker versions of these functions are smart about the potential for pbLockTaken
; to be NULL, and if it is then they treat it as if they don't have a state variable.
; This is because when locking is not inserted by the JIT (instead by explicit calls to
; Monitor.Enter() and Monitor.Exit()) we will call these guys.
;
; This is a frameless helper for entering a monitor on a object.
; The object is in ARGUMENT_REG1. This tries the normal case (no
; blocking or object allocation) in line and calls a framed helper
; for the other cases.
;
; EXTERN_C void JIT_MonEnterWorker_InlineGetThread(Object* obj, /*OUT*/ BYTE* pbLockTaken)
JIT_HELPER_MONITOR_THUNK JIT_MonEnter, _TEXT
NESTED_ENTRY JIT_MonEnterWorker_InlineGetThread, _TEXT
push_nonvol_reg rsi
ifdef MON_DEBUG
ifdef TRACK_SYNC
alloc_stack MON_ENTER_STACK_SIZE_INLINEGETTHREAD
save_reg_postrsp rcx, MON_ENTER_STACK_SIZE_INLINEGETTHREAD + 10h + 0h
save_reg_postrsp rdx, MON_ENTER_STACK_SIZE_INLINEGETTHREAD + 10h + 8h
save_reg_postrsp r8, MON_ENTER_STACK_SIZE_INLINEGETTHREAD + 10h + 10h
save_reg_postrsp r9, MON_ENTER_STACK_SIZE_INLINEGETTHREAD + 10h + 18h
endif
endif
END_PROLOGUE
; Put pbLockTaken in rsi, this can be null
mov rsi, rdx
; Check if the instance is NULL
test rcx, rcx
jz FramedLockHelper
PATCHABLE_INLINE_GETTHREAD r11, JIT_MonEnterWorker_InlineGetThread_GetThread_PatchLabel
; Initialize delay value for retry with exponential backoff
mov r10d, dword ptr [g_SpinConstants + OFFSETOF__g_SpinConstants__dwInitialDuration]
; Check if we can abort here
mov eax, dword ptr [r11 + OFFSETOF__Thread__m_State]
and eax, THREAD_CATCHATSAFEPOINT_BITS
; Go through the slow code path to initiate ThreadAbort
jnz FramedLockHelper
; r8 will hold the syncblockindex address
lea r8, [rcx - OFFSETOF__ObjHeader__SyncBlkIndex]
RetryThinLock:
; Fetch the syncblock dword
mov eax, dword ptr [r8]
; Check whether we have the "thin lock" layout, the lock is free and the spin lock bit is not set
test eax, BIT_SBLK_IS_HASH_OR_SYNCBLKINDEX + BIT_SBLK_SPIN_LOCK + SBLK_MASK_LOCK_THREADID + SBLK_MASK_LOCK_RECLEVEL
jnz NeedMoreTests
; Everything is fine - get the thread id to store in the lock
mov edx, dword ptr [r11 + OFFSETOF__Thread__m_ThreadId]
; If the thread id is too large, we need a syncblock for sure
cmp edx, SBLK_MASK_LOCK_THREADID
ja FramedLockHelper
; We want to store a new value with the current thread id set in the low 10 bits
or edx, eax
lock cmpxchg dword ptr [r8], edx
jnz PrepareToWaitThinLock
; Everything went fine and we're done
add dword ptr [r11 + OFFSETOF__Thread__m_dwLockCount], 1
; Done, leave and set pbLockTaken if we have it
MON_ENTER_RETURN_SUCCESS
NeedMoreTests:
; OK, not the simple case, find out which case it is
test eax, BIT_SBLK_IS_HASH_OR_SYNCBLKINDEX
jnz HaveHashOrSyncBlockIndex
; The header is transitioning or the lock, treat this as if the lock was taken
test eax, BIT_SBLK_SPIN_LOCK
jnz PrepareToWaitThinLock
; Here we know we have the "thin lock" layout, but the lock is not free.
; It could still be the recursion case, compare the thread id to check
mov edx, eax
and edx, SBLK_MASK_LOCK_THREADID
cmp edx, dword ptr [r11 + OFFSETOF__Thread__m_ThreadId]
jne PrepareToWaitThinLock
; Ok, the thread id matches, it's the recursion case.
; Bump up the recursion level and check for overflow
lea edx, [eax + SBLK_LOCK_RECLEVEL_INC]
test edx, SBLK_MASK_LOCK_RECLEVEL
jz FramedLockHelper
; Try to put the new recursion level back. If the header was changed in the meantime
; we need a full retry, because the layout could have changed
lock cmpxchg dword ptr [r8], edx
jnz RetryHelperThinLock
; Done, leave and set pbLockTaken if we have it
MON_ENTER_RETURN_SUCCESS
PrepareToWaitThinLock:
; If we are on an MP system, we try spinning for a certain number of iterations
cmp dword ptr [g_SystemInfo + OFFSETOF__g_SystemInfo__dwNumberOfProcessors], 1
jle FramedLockHelper
; Exponential backoff; delay by approximately 2*r10 clock cycles
mov eax, r10d
delayLoopThinLock:
pause ; indicate to the CPU that we are spin waiting
sub eax, 1
jnz delayLoopThinLock
; Next time, wait a factor longer
imul r10d, dword ptr [g_SpinConstants + OFFSETOF__g_SpinConstants__dwBackoffFactor]
cmp r10d, dword ptr [g_SpinConstants + OFFSETOF__g_SpinConstants__dwMaximumDuration]
jle RetryHelperThinLock
jmp FramedLockHelper
RetryHelperThinLock:
jmp RetryThinLock
HaveHashOrSyncBlockIndex:
; If we have a hash code already, we need to create a sync block
test eax, BIT_SBLK_IS_HASHCODE
jnz FramedLockHelper
; OK, we have a sync block index, just and out the top bits and grab the synblock index
and eax, MASK_SYNCBLOCKINDEX
; Get the sync block pointer
mov rdx, qword ptr [g_pSyncTable]
shl eax, 4h
mov rdx, [rdx + rax + OFFSETOF__SyncTableEntry__m_SyncBlock]
; Check if the sync block has been allocated
test rdx, rdx
jz FramedLockHelper
; Get a pointer to the lock object
lea rdx, [rdx + OFFSETOF__SyncBlock__m_Monitor]
; Attempt to acquire the lock
RetrySyncBlock:
mov eax, dword ptr [rdx + OFFSETOF__AwareLock__m_MonitorHeld]
test eax, eax
jne HaveWaiters
; Common case, lock isn't held and there are no waiters. Attempt to
; gain ownership ourselves
xor ecx, ecx
inc ecx
lock cmpxchg dword ptr [rdx + OFFSETOF__AwareLock__m_MonitorHeld], ecx
jnz RetryHelperSyncBlock
; Success. Save the thread object in the lock and increment the use count
mov qword ptr [rdx + OFFSETOF__AwareLock__m_HoldingThread], r11
add dword ptr [rdx + OFFSETOF__AwareLock__m_Recursion], 1
add dword ptr [r11 + OFFSETOF__Thread__m_dwLockCount], 1
ifdef MON_DEBUG
ifdef TRACK_SYNC
mov rcx, [rsp + MON_ENTER_STACK_SIZE_INLINEGETTHREAD + 8h] ; return address
; void EnterSyncHelper(UINT_PTR caller, AwareLock* lock)
call EnterSyncHelper
endif
endif
; Done, leave and set pbLockTaken if we have it
MON_ENTER_RETURN_SUCCESS
; It's possible to get here with waiters by no lock held, but in this
; case a signal is about to be fired which will wake up the waiter. So
; for fairness sake we should wait too.
; Check first for recur11ve lock attempts on the same thread.
HaveWaiters:
; Is mutex already owned by current thread?
cmp [rdx + OFFSETOF__AwareLock__m_HoldingThread], r11
jne PrepareToWait
; Yes, bump our use count.
add dword ptr [rdx + OFFSETOF__AwareLock__m_Recursion], 1
ifdef MON_DEBUG
ifdef TRACK_SYNC
mov rcx, [rsp + MON_ENTER_STACK_SIZE_INLINEGETTHREAD + 8h] ; return address
; void EnterSyncHelper(UINT_PTR caller, AwareLock* lock)
call EnterSyncHelper
endif
endif
; Done, leave and set pbLockTaken if we have it
MON_ENTER_RETURN_SUCCESS
PrepareToWait:
; If we are on a MP system we try spinning for a certain number of iterations
cmp dword ptr [g_SystemInfo + OFFSETOF__g_SystemInfo__dwNumberOfProcessors], 1
jle HaveWaiters1
; Exponential backoff: delay by approximately 2*r10 clock cycles
mov eax, r10d
delayLoop:
pause ; indicate to the CPU that we are spin waiting
sub eax, 1
jnz delayLoop
; Next time, wait a factor longer
imul r10d, dword ptr [g_SpinConstants + OFFSETOF__g_SpinConstants__dwBackoffFactor]
cmp r10d, dword ptr [g_SpinConstants + OFFSETOF__g_SpinConstants__dwMaximumDuration]
jle RetrySyncBlock
HaveWaiters1:
mov rcx, rdx
mov rdx, rsi
MON_ENTER_EPILOG_ADJUST_STACK
pop rsi
; void JITutil_MonContention(AwareLock* lock, BYTE* pbLockTaken)
jmp JITutil_MonContention
RetryHelperSyncBlock:
jmp RetrySyncBlock
FramedLockHelper:
mov rdx, rsi
MON_ENTER_EPILOG_ADJUST_STACK
pop rsi
; void JITutil_MonEnterWorker(Object* obj, BYTE* pbLockTaken)
jmp JITutil_MonEnterWorker
NESTED_END JIT_MonEnterWorker_InlineGetThread, _TEXT
MON_EXIT_EPILOG_ADJUST_STACK macro
ifdef MON_DEBUG
ifdef TRACK_SYNC
add rsp, MON_EXIT_STACK_SIZE_INLINEGETTHREAD
endif
endif
endm
MON_EXIT_RETURN_SUCCESS macro
; This is sensitive to the potential that pbLockTaken is null
test r10, r10
jz @F
mov byte ptr [r10], 0
@@:
MON_EXIT_EPILOG_ADJUST_STACK
ret
endm
; The worker versions of these functions are smart about the potential for pbLockTaken
; to be NULL, and if it is then they treat it as if they don't have a state variable.
; This is because when locking is not inserted by the JIT (instead by explicit calls to
; Monitor.Enter() and Monitor.Exit()) we will call these guys.
;
; This is a frameless helper for exiting a monitor on a object.
; The object is in ARGUMENT_REG1. This tries the normal case (no
; blocking or object allocation) in line and calls a framed helper
; for the other cases.
;
; void JIT_MonExitWorker_InlineGetThread(Object* obj, BYTE* pbLockTaken)
JIT_HELPER_MONITOR_THUNK JIT_MonExit, _TEXT
NESTED_ENTRY JIT_MonExitWorker_InlineGetThread, _TEXT
.savereg rcx, 0
ifdef MON_DEBUG
ifdef TRACK_SYNC
alloc_stack MON_EXIT_STACK_SIZE_INLINEGETTHREAD
save_reg_postrsp rcx, MON_EXIT_STACK_SIZE_INLINEGETTHREAD + 8h + 0h
save_reg_postrsp rdx, MON_EXIT_STACK_SIZE_INLINEGETTHREAD + 8h + 8h
save_reg_postrsp r8, MON_EXIT_STACK_SIZE_INLINEGETTHREAD + 8h + 10h
save_reg_postrsp r9, MON_EXIT_STACK_SIZE_INLINEGETTHREAD + 8h + 18h
endif
endif
END_PROLOGUE
; pbLockTaken is stored in r10, this can be null
mov r10, rdx
; if pbLockTaken is NULL then we got here without a state variable, avoid the
; next comparison in that case as it will AV
test rdx, rdx
jz Null_pbLockTaken
; If the lock wasn't taken then we bail quickly without doing anything
cmp byte ptr [rdx], 0
je LockNotTaken
Null_pbLockTaken:
; Check is the instance is null
test rcx, rcx
jz FramedLockHelper
PATCHABLE_INLINE_GETTHREAD r11, JIT_MonExitWorker_InlineGetThread_GetThread_PatchLabel
; r8 will hold the syncblockindex address
lea r8, [rcx - OFFSETOF__ObjHeader__SyncBlkIndex]
RetryThinLock:
; Fetch the syncblock dword
mov eax, dword ptr [r8]
test eax, BIT_SBLK_IS_HASH_OR_SYNCBLKINDEX + BIT_SBLK_SPIN_LOCK
jnz NeedMoreTests
; Ok, we have a "thin lock" layout - check whether the thread id matches
mov edx, eax
and edx, SBLK_MASK_LOCK_THREADID
cmp edx, dword ptr [r11 + OFFSETOF__Thread__m_ThreadId]
jne FramedLockHelper
; check the recursion level
test eax, SBLK_MASK_LOCK_RECLEVEL
jne DecRecursionLevel
; It's zero -- we're leaving the lock.
; So try to put back a zero thread id.
; edx and eax match in the thread id bits, and edx is zero else where, so the xor is sufficient
xor edx, eax
lock cmpxchg dword ptr [r8], edx
jnz RetryThinLockHelper1 ; forward jump to avoid mispredict on success
; Dec the dwLockCount on the thread
sub dword ptr [r11 + OFFSETOF__Thread__m_dwLockCount], 1
; Done, leave and set pbLockTaken if we have it
MON_EXIT_RETURN_SUCCESS
RetryThinLockHelper1:
jmp RetryThinLock
DecRecursionLevel:
lea edx, [eax - SBLK_LOCK_RECLEVEL_INC]
lock cmpxchg dword ptr [r8], edx
jnz RetryThinLockHelper2 ; forward jump to avoid mispredict on success
; We're done, leave and set pbLockTaken if we have it
MON_EXIT_RETURN_SUCCESS
RetryThinLockHelper2:
jmp RetryThinLock
NeedMoreTests:
; Forward all special cases to the slow helper
test eax, BIT_SBLK_IS_HASHCODE + BIT_SBLK_SPIN_LOCK
jnz FramedLockHelper
; Get the sync block index and use it to compute the sync block pointer
mov rdx, qword ptr [g_pSyncTable]
and eax, MASK_SYNCBLOCKINDEX
shl eax, 4
mov rdx, [rdx + rax + OFFSETOF__SyncTableEntry__m_SyncBlock]
; Was there a sync block?
test rdx, rdx
jz FramedLockHelper
; Get a pointer to the lock object.
lea rdx, [rdx + OFFSETOF__SyncBlock__m_Monitor]
; Check if the lock is held.
cmp qword ptr [rdx + OFFSETOF__AwareLock__m_HoldingThread], r11
jne FramedLockHelper
ifdef MON_DEBUG
ifdef TRACK_SYNC
mov [rsp + 28h], rcx
mov [rsp + 30h], rdx
mov [rsp + 38h], r10
mov [rsp + 40h], r11
mov rcx, [rsp + MON_EXIT_STACK_SIZE_INLINEGETTHREAD ] ; return address
; void LeaveSyncHelper(UINT_PTR caller, AwareLock* lock)
call LeaveSyncHelper
mov rcx, [rsp + 28h]
mov rdx, [rsp + 30h]
mov r10, [rsp + 38h]
mov r11, [rsp + 40h]
endif
endif
; Reduce our recursion count
sub dword ptr [rdx + OFFSETOF__AwareLock__m_Recursion], 1
jz LastRecursion
; Done, leave and set pbLockTaken if we have it
MON_EXIT_RETURN_SUCCESS
RetryHelperThinLock:
jmp RetryThinLock
FramedLockHelper:
mov rdx, r10
MON_EXIT_EPILOG_ADJUST_STACK
; void JITutil_MonExitWorker(Object* obj, BYTE* pbLockTaken)
jmp JITutil_MonExitWorker
LastRecursion:
ifdef MON_DEBUG
ifdef TRACK_SYNC
mov rax, [rdx + OFFSETOF__AwareLock__m_HoldingThread]
endif
endif
sub dword ptr [r11 + OFFSETOF__Thread__m_dwLockCount], 1
mov qword ptr [rdx + OFFSETOF__AwareLock__m_HoldingThread], 0
Retry:
mov eax, dword ptr [rdx + OFFSETOF__AwareLock__m_MonitorHeld]
lea r9d, [eax - 1]
lock cmpxchg dword ptr [rdx + OFFSETOF__AwareLock__m_MonitorHeld], r9d
jne RetryHelper
test eax, STATE_CHECK
jne MustSignal
; Done, leave and set pbLockTaken if we have it
MON_EXIT_RETURN_SUCCESS
MustSignal:
mov rcx, rdx
mov rdx, r10
MON_EXIT_EPILOG_ADJUST_STACK
; void JITutil_MonSignal(AwareLock* lock, BYTE* pbLockTaken)
jmp JITutil_MonSignal
RetryHelper:
jmp Retry
LockNotTaken:
MON_EXIT_EPILOG_ADJUST_STACK
REPRET
NESTED_END JIT_MonExitWorker_InlineGetThread, _TEXT
; This is a frameless helper for trying to enter a monitor on a object.
; The object is in ARGUMENT_REG1 and a timeout in ARGUMENT_REG2. This tries the
; normal case (no object allocation) in line and calls a framed helper for the
; other cases.
;
; void JIT_MonTryEnter_InlineGetThread(Object* obj, INT32 timeOut, BYTE* pbLockTaken)
NESTED_ENTRY JIT_MonTryEnter_InlineGetThread, _TEXT
; save rcx, rdx (timeout) in the shadow space
.savereg rcx, 8h
mov [rsp + 8h], rcx
.savereg rdx, 10h
mov [rsp + 10h], rdx
ifdef MON_DEBUG
ifdef TRACK_SYNC
alloc_stack MON_ENTER_STACK_SIZE_INLINEGETTHREAD
; rcx has already been saved
; save_reg_postrsp rcx, MON_ENTER_STACK_SIZE_INLINEGETTHREAD + 8h + 0h
; rdx has already been saved
; save_reg_postrsp rdx, MON_ENTER_STACK_SIZE + 8h + 8h
save_reg_postrsp r8, MON_ENTER_STACK_SIZE_INLINEGETTHREAD + 8h + 10h
save_reg_postrsp r9, MON_ENTER_STACK_SIZE_INLINEGETTHREAD + 8h + 18h
endif
endif
END_PROLOGUE
; Check if the instance is NULL
test rcx, rcx
jz FramedLockHelper
; Check if the timeout looks valid
cmp edx, -1
jl FramedLockHelper
PATCHABLE_INLINE_GETTHREAD r11, JIT_MonTryEnter_GetThread_PatchLabel
; Initialize delay value for retry with exponential backoff
mov r10d, dword ptr [g_SpinConstants + OFFSETOF__g_SpinConstants__dwInitialDuration]
; Check if we can abort here
mov eax, dword ptr [r11 + OFFSETOF__Thread__m_State]
and eax, THREAD_CATCHATSAFEPOINT_BITS
; Go through the slow code path to initiate THreadAbort
jnz FramedLockHelper
; r9 will hold the syncblockindex address
lea r9, [rcx - OFFSETOF__ObjHeader__SyncBlkIndex]
RetryThinLock:
; Fetch the syncblock dword
mov eax, dword ptr [r9]
; Check whether we have the "thin lock" layout, the lock is free and the spin lock bit is not set
test eax, BIT_SBLK_IS_HASH_OR_SYNCBLKINDEX + BIT_SBLK_SPIN_LOCK + SBLK_MASK_LOCK_THREADID + SBLK_MASK_LOCK_RECLEVEL
jne NeedMoreTests
; Everything is fine - get the thread id to store in the lock
mov edx, dword ptr [r11 + OFFSETOF__Thread__m_ThreadId]
; If the thread id is too large, we need a syncblock for sure
cmp edx, SBLK_MASK_LOCK_THREADID
ja FramedLockHelper
; We want to store a new value with the current thread id set in the low 10 bits
or edx, eax
lock cmpxchg dword ptr [r9], edx
jnz RetryHelperThinLock
; Got the lock, everything is fine
add dword ptr [r11 + OFFSETOF__Thread__m_dwLockCount], 1
; Return TRUE
mov byte ptr [r8], 1
ifdef MON_DEBUG
ifdef TRACK_SYNC
add rsp, MON_ENTER_STACK_SIZE_INLINEGETTHREAD
endif
endif
ret
NeedMoreTests:
; OK, not the simple case, find out which case it is
test eax, BIT_SBLK_IS_HASH_OR_SYNCBLKINDEX
jnz HaveHashOrSyncBlockIndex
; The header is transitioning or the lock
test eax, BIT_SBLK_SPIN_LOCK
jnz RetryHelperThinLock
; Here we know we have the "thin lock" layout, but the lock is not free.
; It could still be the recursion case, compare the thread id to check
mov edx, eax
and edx, SBLK_MASK_LOCK_THREADID
cmp edx, dword ptr [r11 + OFFSETOF__Thread__m_ThreadId]
jne PrepareToWaitThinLock
; Ok, the thread id matches, it's the recursion case.
; Dump up the recursion level and check for overflow
lea edx, [eax + SBLK_LOCK_RECLEVEL_INC]
test edx, SBLK_MASK_LOCK_RECLEVEL
jz FramedLockHelper
; Try to put the new recursion level back. If the header was changed in the meantime
; we need a full retry, because the layout could have changed
lock cmpxchg dword ptr [r9], edx
jnz RetryHelperThinLock
; Everything went fine and we're done, return TRUE
mov byte ptr [r8], 1
ifdef MON_DEBUG
ifdef TRACK_SYNC
add rsp, MON_ENTER_STACK_SIZE_INLINEGETTHREAD
endif
endif
ret
PrepareToWaitThinLock:
; Return failure if timeout is zero
cmp dword ptr [rsp + 10h], 0
je TimeoutZero
; If we are on an MP system, we try spinning for a certain number of iterations
cmp dword ptr [g_SystemInfo + OFFSETOF__g_SystemInfo__dwNumberOfProcessors], 1
jle FramedLockHelper
; Exponential backoff; delay by approximately 2*r10d clock cycles
mov eax, r10d
DelayLoopThinLock:
pause ; indicate to the CPU that we are spin waiting
sub eax, 1
jnz DelayLoopThinLock
; Next time, wait a factor longer
imul r10d, dword ptr [g_SpinConstants + OFFSETOF__g_SpinConstants__dwBackoffFactor]
cmp r10d, dword ptr [g_SpinConstants + OFFSETOF__g_SpinConstants__dwMaximumDuration]
jle RetryHelperThinLock
jmp FramedLockHelper
RetryHelperThinLock:
jmp RetryThinLock
TimeoutZero:
; Did not acquire, return FALSE
mov byte ptr [r8], 0
ifdef MON_DEBUG
ifdef TRACK_SYNC
add rsp, MON_ENTER_STACK_SIZE_INLINEGETTHREAD
endif
endif
ret
HaveHashOrSyncBlockIndex:
; If we have a hash code already, we need to create a sync block
test eax, BIT_SBLK_IS_HASHCODE
jnz FramedLockHelper
; OK, we have a sync block index, just and out the top bits and grab the synblock index
and eax, MASK_SYNCBLOCKINDEX
; Get the sync block pointer
mov rdx, qword ptr [g_pSyncTable]
shl eax, 4
mov rdx, [rdx + rax + OFFSETOF__SyncTableEntry__m_SyncBlock]
; Check if the sync block has been allocated
test rdx, rdx
jz FramedLockHelper
; Get a pointer to the lock object
lea rdx, [rdx + OFFSETOF__SyncBlock__m_Monitor]
RetrySyncBlock:
; Attempt to acuire the lock
mov eax, dword ptr [rdx + OFFSETOF__AwareLock__m_MonitorHeld]
test eax, eax
jne HaveWaiters
; Common case, lock isn't held and there are no waiters. Attempt to
; gain ownership ourselves
xor ecx, ecx
inc ecx
lock cmpxchg dword ptr [rdx + OFFSETOF__AwareLock__m_MonitorHeld], ecx
jnz RetryHelperSyncBlock
; Success. Save the thread object in the lock and increment the use count
mov qword ptr [rdx + OFFSETOF__AwareLock__m_HoldingThread], r11
add dword ptr [rdx + OFFSETOF__AwareLock__m_Recursion], 1
add dword ptr [r11 + OFFSETOF__Thread__m_dwLockCount], 1
ifdef MON_DEBUG
ifdef TRACK_SYNC
mov rcx, [rsp + MON_ENTER_STACK_SIZE_INLINEGETTHREAD] ; return address
; void EnterSyncHelper(UINT_PTR caller, AwareLock* lock)
call EnterSyncHelper
endif
endif
; Return TRUE
mov byte ptr [r8], 1
ifdef MON_DEBUG
ifdef TRACK_SYNC
add rsp, MON_ENTER_STACK_SIZE_INLINEGETTHREAD
endif
endif
ret
; It's possible to get here with waiters by no lock held, but in this
; case a signal is about to be fired which will wake up the waiter. So
; for fairness sake we should wait too.
; Check first for recur11ve lock attempts on the same thread.
HaveWaiters:
; Is mutex already owned by current thread?
cmp [rdx + OFFSETOF__AwareLock__m_HoldingThread], r11
jne PrepareToWait
; Yes, bump our use count.
add dword ptr [rdx + OFFSETOF__AwareLock__m_Recursion], 1
ifdef MON_DEBUG
ifdef TRACK_SYNC
mov rcx, [rsp + MON_ENTER_STACK_SIZE_INLINEGETTHREAD] ; return address
; void EnterSyncHelper(UINT_PTR caller, AwareLock* lock)
call EnterSyncHelper
endif
endif
; Return TRUE
mov byte ptr [r8], 1
ifdef MON_DEBUG
ifdef TRACK_SYNC
add rsp, MON_ENTER_STACK_SIZE_INLINEGETTHREAD
endif
endif
ret
PrepareToWait:
; Return failure if timeout is zero
cmp dword ptr [rsp + 10h], 0
ifdef MON_DEBUG
ifdef TRACK_SYNC
; if we are using the _DEBUG stuff then rsp has been adjusted
; so compare the value at the adjusted position
; there's really little harm in the extra stack read
cmp dword ptr [rsp + MON_ENTER_STACK_SIZE_INLINEGETTHREAD + 10h]
endif
endif
je TimeoutZero
; If we are on an MP system, we try spinning for a certain number of iterations
cmp dword ptr [g_SystemInfo + OFFSETOF__g_SystemInfo__dwNumberOfProcessors], 1
jle Block
; Exponential backoff; delay by approximately 2*r10d clock cycles
mov eax, r10d
DelayLoop:
pause ; indicate to the CPU that we are spin waiting
sub eax, 1
jnz DelayLoop
; Next time, wait a factor longer
imul r10d, dword ptr [g_SpinConstants + OFFSETOF__g_SpinConstants__dwBackoffFactor]
cmp r10d, dword ptr [g_SpinConstants + OFFSETOF__g_SpinConstants__dwMaximumDuration]
jle RetrySyncBlock
jmp Block
RetryHelperSyncBlock:
jmp RetrySyncBlock
Block:
; In the Block case we've trashed RCX, restore it
mov rcx, [rsp + 8h]
ifdef MON_DEBUG
ifdef TRACK_SYNC
; if we're tracking this stuff then rcx is at a different offset to RSP, we just
; overwrite the wrong value which we just got... this is for debug purposes only
; so there's really no performance issue here
mov rcx, [rsp + MON_ENTER_STACK_SIZE_INLINEGETTHREAD + 8h]
endif
endif
FramedLockHelper:
ifdef MON_DEBUG
ifdef TRACK_SYNC
add rsp, MON_ENTER_STACK_SIZE_INLINEGETTHREAD
endif
endif
mov rdx, [rsp + 10h]
; void JITutil_MonTryEnter(Object* obj, INT32 timeout)
jmp JITutil_MonTryEnter
NESTED_END JIT_MonTryEnter_InlineGetThread, _TEXT
MON_ENTER_STATIC_RETURN_SUCCESS macro
; pbLockTaken is never null for static helpers
test rdx, rdx
mov byte ptr [rdx], 1
REPRET
endm
MON_EXIT_STATIC_RETURN_SUCCESS macro
; pbLockTaken is never null for static helpers
mov byte ptr [rdx], 0
REPRET
endm
; This is a frameless helper for entering a static monitor on a class.
; The methoddesc is in ARGUMENT_REG1. This tries the normal case (no
; blocking or object allocation) in line and calls a framed helper
; for the other cases.
;
; void JIT_MonEnterStatic_InlineGetThread(AwareLock *lock, BYTE *pbLockTaken)
NESTED_ENTRY JIT_MonEnterStatic_InlineGetThread, _TEXT
.savereg rcx, 0
ifdef MON_DEBUG
ifdef TRACK_SYNC
alloc_stack MIN_SIZE
save_reg_postrsp rcx, MIN_SIZE + 8h + 0h
endif
endif
END_PROLOGUE
; Attempt to acquire the lock
Retry:
mov eax, dword ptr [rcx + OFFSETOF__AwareLock__m_MonitorHeld]
test eax, eax
jne HaveWaiters
; Common case; lock isn't held and there are no waiters. Attempt to
; gain ownership by ourselves.
mov r10d, 1
lock cmpxchg dword ptr [rcx + OFFSETOF__AwareLock__m_MonitorHeld], r10d
jnz RetryHelper
PATCHABLE_INLINE_GETTHREAD rax, JIT_MonEnterStaticWorker_InlineGetThread_GetThread_PatchLabel_1
mov qword ptr [rcx + OFFSETOF__AwareLock__m_HoldingThread], rax
add dword ptr [rcx + OFFSETOF__AwareLock__m_Recursion], 1
add dword ptr [rax + OFFSETOF__Thread__m_dwLockCount], 1
ifdef MON_DEBUG
ifdef TRACK_SYNC
mov rdx, rcx
mov rcx, [rsp]
add rsp, MIN_SIZE
; void EnterSyncHelper(UINT_PTR caller, AwareLock* lock)
jmp EnterSyncHelper
endif
endif
MON_ENTER_STATIC_RETURN_SUCCESS
; It's possible to get here with waiters by with no lock held, in this
; case a signal is about to be fired which will wake up a waiter. So
; for fairness sake we should wait too.
; Check first for recursive lock attempts on the same thread.
HaveWaiters:
PATCHABLE_INLINE_GETTHREAD rax, JIT_MonEnterStaticWorker_InlineGetThread_GetThread_PatchLabel_2
; Is mutex alread owned by current thread?
cmp [rcx + OFFSETOF__AwareLock__m_HoldingThread], rax
jne PrepareToWait
; Yes, bump our use count.
add dword ptr [rcx + OFFSETOF__AwareLock__m_Recursion], 1
ifdef MON_DEBUG
ifdef TRACK_SYNC
mov rdx, rcx
mov rcx, [rsp + MIN_SIZE]
add rsp, MIN_SIZE
; void EnterSyncHelper(UINT_PTR caller, AwareLock* lock)
jmp EnterSyncHelper
endif
endif
ret
PrepareToWait:
ifdef MON_DEBUG
ifdef TRACK_SYNC
add rsp, MIN_SIZE
endif
endif
; void JITutil_MonContention(AwareLock* obj, BYTE* pbLockTaken)
jmp JITutil_MonContention
RetryHelper:
jmp Retry
NESTED_END JIT_MonEnterStatic_InlineGetThread, _TEXT
; A frameless helper for exiting a static monitor on a class.
; The methoddesc is in ARGUMENT_REG1. This tries the normal case (no
; blocking or object allocation) in line and calls a framed helper
; for the other cases.
;
; void JIT_MonExitStatic_InlineGetThread(AwareLock *lock, BYTE *pbLockTaken)
NESTED_ENTRY JIT_MonExitStatic_InlineGetThread, _TEXT
.savereg rcx, 0
ifdef MON_DEBUG
ifdef TRACK_SYNC
alloc_stack MIN_SIZE
save_reg_postrsp rcx, MIN_SIZE + 8h + 0h
endif
endif
END_PROLOGUE
ifdef MON_DEBUG
ifdef TRACK_SYNC
push rsi
push rdi
mov rsi, rcx
mov rdi, rdx
mov rdx, [rsp + 8]
call LeaveSyncHelper
mov rcx, rsi
mov rdx, rdi
pop rdi
pop rsi
endif
endif
PATCHABLE_INLINE_GETTHREAD rax, JIT_MonExitStaticWorker_InlineGetThread_GetThread_PatchLabel
; Check if lock is held
cmp [rcx + OFFSETOF__AwareLock__m_HoldingThread], rax
jne LockError
; Reduce our recursion count
sub dword ptr [rcx + OFFSETOF__AwareLock__m_Recursion], 1
jz LastRecursion
ifdef MON_DEBUG
ifdef TRACK_SYNC
add rsp, MIN_SIZE
ret
endif
endif
REPRET
; This is the last count we held on this lock, so release the lock
LastRecursion:
; Thead* is in rax
sub dword ptr [rax + OFFSETOF__Thread__m_dwLockCount], 1
mov qword ptr [rcx + OFFSETOF__AwareLock__m_HoldingThread], 0
Retry:
mov eax, dword ptr [rcx + OFFSETOF__AwareLock__m_MonitorHeld]
lea r10d, [eax - 1]
lock cmpxchg dword ptr [rcx + OFFSETOF__AwareLock__m_MonitorHeld], r10d
jne RetryHelper
test eax, STATE_CHECK
jne MustSignal
ifdef MON_DEBUG
ifdef TRACK_SYNC
add rsp, MIN_SIZE
ret
endif
endif
MON_EXIT_STATIC_RETURN_SUCCESS
MustSignal:
ifdef MON_DEBUG
ifdef TRACK_SYNC
add rsp, MIN_SIZE
endif
endif
; void JITutil_MonSignal(AwareLock* lock, BYTE* pbLockTaken)
jmp JITutil_MonSignal
RetryHelper:
jmp Retry
LockError:
mov rcx, CORINFO_SynchronizationLockException_ASM
ifdef MON_DEBUG
ifdef TRACK_SYNC
add rsp, MIN_SIZE
endif
endif
; void JIT_InternalThrow(unsigned exceptNum)
jmp JIT_InternalThrow
NESTED_END JIT_MonExitStatic_InlineGetThread, _TEXT
end
| ragmani/coreclr | src/vm/amd64/JitHelpers_InlineGetThread.asm | Assembly | mit | 44,438 |
;Cannot be automatically tested because it differs every time,
;I guess because of a date/time field.
; test source file for assembling to COFF
; build with (under DJGPP, for example):
; nasm -f coff cofftest.asm
; gcc -o cofftest cofftest.c cofftest.o
; This file should test the following:
; [1] Define and export a global text-section symbol
; [2] Define and export a global data-section symbol
; [3] Define and export a global BSS-section symbol
; [4] Define a non-global text-section symbol
; [5] Define a non-global data-section symbol
; [6] Define a non-global BSS-section symbol
; [7] Define a COMMON symbol
; [8] Define a NASM local label
; [9] Reference a NASM local label
; [10] Import an external symbol
; [11] Make a PC-relative call to an external symbol
; [12] Reference a text-section symbol in the text section
; [13] Reference a data-section symbol in the text section
; [14] Reference a BSS-section symbol in the text section
; [15] Reference a text-section symbol in the data section
; [16] Reference a data-section symbol in the data section
; [17] Reference a BSS-section symbol in the data section
BITS 32
GLOBAL _lrotate ; [1]
GLOBAL _greet ; [1]
GLOBAL _asmstr ; [2]
GLOBAL _textptr ; [2]
GLOBAL _selfptr ; [2]
GLOBAL _integer ; [3]
EXTERN _printf ; [10]
COMMON _commvar 4 ; [7]
SECTION .text
; prototype: long lrotate(long x, int num);
_lrotate: ; [1]
push ebp
mov ebp,esp
mov eax,[ebp+8]
mov ecx,[ebp+12]
.label rol eax,1 ; [4] [8]
loop .label ; [9] [12]
mov esp,ebp
pop ebp
ret
; prototype: void greet(void);
_greet mov eax,[_integer] ; [14]
inc eax
mov [localint],eax ; [14]
push dword [_commvar]
mov eax,[localptr] ; [13]
push dword [eax]
push dword [_integer] ; [1] [14]
push dword _printfstr ; [13]
call _printf ; [11]
add esp,16
ret
SECTION .data
; a string
_asmstr db 'hello, world', 0 ; [2]
; a string for Printf
_printfstr db "integer==%d, localint==%d, commvar=%d"
db 10, 0
; some pointers
localptr dd localint ; [5] [17]
_textptr dd _greet ; [15]
_selfptr dd _selfptr ; [16]
SECTION .bss
; an integer
_integer resd 1 ; [3]
; a local integer
localint resd 1 ; [6]
| techkey/nasm | travis/test/cofftest.asm | Assembly | bsd-2-clause | 2,235 |
.cpu "6502"
.format "flat"
* = $F000
COLUBK = $09
INT_RESERVED_0 = $80
BackgroundColor = $81
TYPE_VCSFramework_V2_Nothing = 0
SIZE_VCSFramework_V2_Nothing = 0
TYPE_System_Byte = 100
SIZE_System_Byte = 1
.include "../../../VCSCompiler/vil.h"
// Repeatedly increments COLUBK without making any effort to handle scanlines, perform VSYNC,
// etc. Result is a rapidly scrolling screen that changes color multiple times mid-scanline.
// Only tested on emulator, not on TVs.
// This is not a proper VCS program. It's just meant to see how stripped down of a program
// we can make that still displays something on the screen.
Start
SEI
CLD
// Not doing any scanline/VSYNC/VBLANK/anything handling messes up the NTSC/PAL/SECAM
// detection, so use $0E, which shows up as white for all of them.
LDA #0
STA BackgroundColor
MainLoop
.let STACK_TYPEOF = [TYPE_VCSFramework_V2_Nothing, TYPE_VCSFramework_V2_Nothing]
.let STACK_SIZEOF = [SIZE_VCSFramework_V2_Nothing, SIZE_VCSFramework_V2_Nothing]
.pushGlobal BackgroundColor, TYPE_System_Byte, SIZE_System_Byte
.let STACK_TYPEOF = [TYPE_System_Byte, STACK_TYPEOF[0]]
.let STACK_SIZEOF = [SIZE_System_Byte, STACK_SIZEOF[0]]
.pushConstant 1, TYPE_System_Byte, SIZE_System_Byte
.let STACK_TYPEOF = [TYPE_System_Byte, STACK_TYPEOF[0]]
.let STACK_SIZEOF = [SIZE_System_Byte, STACK_SIZEOF[0]]
.addFromStack STACK_TYPEOF[0], STACK_SIZEOF[0], STACK_TYPEOF[1], STACK_SIZEOF[1]
.let STACK_TYPEOF = [getAddResultType(STACK_TYPEOF[0], STACK_TYPEOF[1]), TYPE_VCSFramework_V2_Nothing]
.let STACK_SIZEOF = [getSizeFromBuiltInType(STACK_TYPEOF[0]), SIZE_VCSFramework_V2_Nothing]
PLA
STA BackgroundColor
STA COLUBK
JMP MainLoop
// Special memory locations. Tells the 6502 where to go.
* = $FFFC
.word Start
.word Start | Yttrmin/CSharpTo2600 | 6502DotNet/Examples/vcs/pocincrementbackground.asm | Assembly | mit | 1,767 |
;===============================================================================
; Copyright 2015-2020 Intel Corporation
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
;===============================================================================
;
;
; Purpose: Cryptography Primitive.
; Rijndael Cipher function
;
; Content:
; EncryptCTR_RIJ128pipe_AES_NI()
;
;
%include "asmdefs.inc"
%include "ia_32e.inc"
%include "ia_32e_regs.inc"
%include "pcpvariant.inc"
%if (_AES_NI_ENABLING_ == _FEATURE_ON_) || (_AES_NI_ENABLING_ == _FEATURE_TICKTOCK_)
%if (_IPP32E >= _IPP32E_Y8)
segment .text align=IPP_ALIGN_FACTOR
align IPP_ALIGN_FACTOR
u128_str DB 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0
;***************************************************************
;* Purpose: pipelined RIJ128 CTR encryption/decryption
;*
;* void EncryptCTR_RIJ128pipe_AES_NI(const Ipp32u* inpBlk,
;* Ipp32u* outBlk,
;* int nr,
;* const Ipp32u* pRKey,
;* int length,
;* Ipp8u* pCtrValue,
;* Ipp8u* pCtrBitMask)
;***************************************************************
;;
;; Lib = Y8
;;
;; Caller = ippsAESEncryptCTR
;;
align IPP_ALIGN_FACTOR
IPPASM EncryptCTR_RIJ128pipe_AES_NI,PUBLIC
%assign LOCAL_FRAME 0
USES_GPR rsi,rdi,rbx
USES_XMM xmm6,xmm7,xmm8,xmm9
COMP_ABI 7
;; rdi: pInpBlk: DWORD, ; pointer to the input
;; rsi: pOutBlk: DWORD, ; pointer to the output
;; rdx: nr: DWORD, ; number of rounds
;; rcx pKey: DWORD ; key material address
;; r8d length: DWORD ; length of the input
;; r9 pCtrValue: BYTED ; pointer to the Counter
;; [rsp+ARG_7] pCtrBitMask: BYTE ; pointer to the Counter Bit Mask
%xdefine SC (4)
%assign BLKS_PER_LOOP (4)
%assign BYTES_PER_BLK (16)
%assign BYTES_PER_LOOP (BYTES_PER_BLK*BLKS_PER_LOOP)
mov rax, [rsp+ARG_7]
movdqu xmm8, oword [rax] ; counter bit mask
movdqu xmm0, oword [r9] ; initial counter
movdqa xmm9, xmm8
pandn xmm9, xmm0 ; counter template
;;
;; init counter
;;
mov rbx, qword [r9] ; initial counter (BE)
mov rax, qword [r9+8]
bswap rbx
bswap rax
movsxd r8, r8d
sub r8, BYTES_PER_LOOP
jl .short_input
;;
;; pipelined processing
;;
.blks_loop:
movdqa xmm4,oword [rel u128_str]
pinsrq xmm0, rax, 0 ; get counter value
pinsrq xmm0, rbx, 1
pshufb xmm0, xmm4 ; convert int the octet string
pand xmm0, xmm8 ; select counter bits
por xmm0, xmm9 ; add unchanged bits
add rax, 1
adc rbx, 0
pinsrq xmm1, rax, 0
pinsrq xmm1, rbx, 1
pshufb xmm1, xmm4
pand xmm1, xmm8
por xmm1, xmm9
add rax, 1
adc rbx, 0
pinsrq xmm2, rax, 0
pinsrq xmm2, rbx, 1
pshufb xmm2, xmm4
pand xmm2, xmm8
por xmm2, xmm9
add rax, 1
adc rbx, 0
pinsrq xmm3, rax, 0
pinsrq xmm3, rbx, 1
pshufb xmm3, xmm4
pand xmm3, xmm8
por xmm3, xmm9
movdqa xmm4, oword [rcx]
mov r10, rcx ; set pointer to the key material
pxor xmm0, xmm4 ; whitening
pxor xmm1, xmm4
pxor xmm2, xmm4
pxor xmm3, xmm4
movdqa xmm4, oword [r10+16]
add r10, 16
mov r11, rdx ; counter depending on key length
sub r11, 1
.cipher_loop:
aesenc xmm0, xmm4 ; regular round
aesenc xmm1, xmm4
aesenc xmm2, xmm4
aesenc xmm3, xmm4
movdqa xmm4, oword [r10+16]
add r10, 16
dec r11
jnz .cipher_loop
aesenclast xmm0, xmm4 ; irregular round
aesenclast xmm1, xmm4
aesenclast xmm2, xmm4
aesenclast xmm3, xmm4
movdqu xmm4, oword [rdi+0*BYTES_PER_BLK] ; 4 input blocks
movdqu xmm5, oword [rdi+1*BYTES_PER_BLK]
movdqu xmm6, oword [rdi+2*BYTES_PER_BLK]
movdqu xmm7, oword [rdi+3*BYTES_PER_BLK]
add rdi, BYTES_PER_LOOP
pxor xmm0, xmm4 ; 4 output blocks
movdqu oword [rsi+0*BYTES_PER_BLK], xmm0
pxor xmm1, xmm5
movdqu oword [rsi+1*BYTES_PER_BLK], xmm1
pxor xmm2, xmm6
movdqu oword [rsi+2*BYTES_PER_BLK], xmm2
pxor xmm3, xmm7
movdqu oword [rsi+3*BYTES_PER_BLK], xmm3
add rax, 1 ; advance counter
adc rbx, 0
add rsi, BYTES_PER_LOOP
sub r8, BYTES_PER_LOOP
jge .blks_loop
;;
;; block-by-block processing
;;
.short_input:
add r8, BYTES_PER_LOOP
jz .quit
; get actual address of key material: pRKeys += (nr-9) * SC
lea r10,[rdx*4]
lea r10, [rcx+r10*4-9*(SC)*4] ; AES-128 round keys
.single_blk_loop:
pinsrq xmm0, rax, 0 ; get counter value
pinsrq xmm0, rbx, 1
pshufb xmm0, [rel u128_str] ; convert int the octet string
pand xmm0, xmm8 ; select counter bits
por xmm0, xmm9 ; add unchanged bits
pxor xmm0, oword [rcx] ; whitening
cmp rdx,12 ; switch according to number of rounds
jl .key_128_s
jz .key_192_s
.key_256_s:
aesenc xmm0,oword [r10-4*4*SC]
aesenc xmm0,oword [r10-3*4*SC]
.key_192_s:
aesenc xmm0,oword [r10-2*4*SC]
aesenc xmm0,oword [r10-1*4*SC]
.key_128_s:
aesenc xmm0,oword [r10+0*4*SC]
aesenc xmm0,oword [r10+1*4*SC]
aesenc xmm0,oword [r10+2*4*SC]
aesenc xmm0,oword [r10+3*4*SC]
aesenc xmm0,oword [r10+4*4*SC]
aesenc xmm0,oword [r10+5*4*SC]
aesenc xmm0,oword [r10+6*4*SC]
aesenc xmm0,oword [r10+7*4*SC]
aesenc xmm0,oword [r10+8*4*SC]
aesenclast xmm0,oword [r10+9*4*SC]
add rax, 1 ; update counter
adc rbx, 0
sub r8, BYTES_PER_BLK
jl .partial_block
movdqu xmm4, oword [rdi] ; input block
pxor xmm0, xmm4 ; output block
movdqu oword [rsi], xmm0 ; save output block
add rdi, BYTES_PER_BLK
add rsi, BYTES_PER_BLK
cmp r8, 0
jz .quit
jmp .single_blk_loop
.partial_block:
add r8, BYTES_PER_BLK
.partial_block_loop:
pextrb r10d, xmm0, 0
psrldq xmm0, 1
movzx r11d, byte [rdi]
xor r10, r11
mov byte [rsi], r10b
inc rdi
inc rsi
dec r8
jnz .partial_block_loop
.quit:
pinsrq xmm0, rax, 0 ; get counter value
pinsrq xmm0, rbx, 1
pshufb xmm0, [rel u128_str] ; convert int the octet string
pand xmm0, xmm8 ; select counter bits
por xmm0, xmm9 ; add unchanged bits
movdqu oword [r9], xmm0 ; return updated counter
REST_XMM
REST_GPR
ret
ENDFUNC EncryptCTR_RIJ128pipe_AES_NI
%endif
%endif ;; _AES_NI_ENABLING_
| Intel-EPID-SDK/epid-sdk | ext/ipp-crypto/sources/ippcp/asm_intel64/pcprij128encryptctrpipee9as.asm | Assembly | apache-2.0 | 7,940 |
;; Kernel-specific mm-stuff.
;; TODO: SLAB, reference counting of pages, complete rewrite...
append TO_INIT_16, mm.init_16
macro mm.init_16 {
; TODO: Detect memory here.
}
append TO_INIT_32, mm.init_32
macro mm.init_32 {
mov edi, PAGE_ORIG
mov ecx, 6000h
xor eax, eax
rep stosd
; 2MB pages
.PDE = PDE.P + PDE.W + PDE.G
; PML4
mov dword [PAGE_ORIG ], PAGE_ORIG + 1000h + .PDE ; TMP
mov dword [PAGE_ORIG + 0800h], PAGE_ORIG + 1000h + .PDE ; -> Kernel PDPE
mov dword [PAGE_ORIG + 0F00h], PAGE_ORIG + 3000h + .PDE ; -> Ident PDPE
; Kernel PDPE
mov dword [PAGE_ORIG + 1000h], PAGE_ORIG + 2000h + .PDE ; -> Kernel PDE
; Kernel PDE, 4 MiB total
mov dword [PAGE_ORIG + 2000h], 000000h + .PDE + PDE.PS ; 1
mov dword [PAGE_ORIG + 2008h], 200000h + .PDE + PDE.PS ; 2
; Ident PDPE
mov dword [PAGE_ORIG + 3000h], PAGE_ORIG + 4000h + .PDE ; -> Ident PDE
; Ident PDE, 1 GiB total
xor ecx, ecx
mov edi, .PDE + PDE.PS
@@: mov dword [PAGE_ORIG + 4000h + ecx*4], edi
add edi, 200000h
add ecx, 2
cmp ecx, 1024
jne @b
.PDE = PDE.P + PDE.W + PDE.U
; Lusermode PDPE
mov dword [PAGE_ORIG + 5000h], PAGE_ORIG + 6000h + .PDE
; Lusermode PDE, 2 MiB
mov dword [PAGE_ORIG + 6008h], 600000h + .PDE + PDE.PS
mov eax, PAGE_ORIG
mov cr3, eax
}
append TO_INIT_64, mm.init_64
macro mm.init_64 {
xor rax, rax
mov [PAGE_ORIG], rax ; Unhook the lower.
mov rax, cr4
bts rax, CR4.PGE ; Enable global pages.
mov cr4, rax
mov rdi, 64 + 8 ; 64*8=512 pages, Int for the offset, and *Mem for the next.
call preinit_malloc
mov [mm.phead], rax
mov rdi, rax
mov rsi, -1
mov edx, 64
call memset
mov qword [rdi + 64], 0
}
class mm
ivar phead, 0
;! Allocate and map a page into a page table
;: *Mem loc -> (PML4|0) -> *Mem page
;. this.paddr_get
;- rax, rdi, rsi, r10, r11, r8
proc 0, palloc
assert rdi, ne, 0, "mm.palloc: page at 0 requested..."
push rbx
mov rbx, IDENT_MAP
xchg rdi, rsi
cmp rdi, 0
jne .got_it
mov rdi, cr3
.got_it:
add rdi, rbx
call mm.pdp_get
mov rdi, rax
add rdi, rbx
call mm.pd_get
mov rdi, rax
add rdi, rbx
call mm.pt_get
mov rdi, rax
add rdi, rbx
call mm.pageloc_get
add rax, rbx
pop rbx
ret
endproc
;! Get the pdp address of the provided pml4 and address
;: *PML4 -> *Mem fin_loc -> *PDP
;- rdx, r10
;. mm.paddr_hook
proc 0, pdp_get
mov rdx, rsi
mov r10, 1FFh shl 39
and rdx, r10
shr rdx, 39 - 3
mov rax, [rdi + rdx]
bt rax, 0
jc .over
call mm.paddr_hook
.over: and rax, not 7FFh ; Clear the priviledge bits.
ret
endproc
;! Get the PD address of the provided PDP and address
;: *PDP -> *Mem fin_loc -> *PD
;- rdx, r10
;. mm.paddr_hook
proc 0, pd_get
mov rdx, rsi
mov r10, 1FFh shl 30
and rdx, r10
shr rdx, 30 - 3
mov rax, [rdi + rdx]
bt rax, 0
jc .over
call mm.paddr_hook
.over: and rax, not 7FFh
ret
endproc
;! Get the PT address of the provided PD and address
;: *PD -> *Mem fin_loc -> *PT
;- rdx, r10
;. mm.paddr_hook
proc 0, pt_get
mov rdx, rsi
mov r10, 1FFh shl 21
and rdx, r10
shr rdx, 21 - 3
mov rax, [rdi + rdx]
bt rax, 0
jc .over
call mm.paddr_hook
.over: and rax, not 7FFh
ret
endproc
;! Get the final physical page location of the provided PT and address
;: *PT -> *Mem fin_loc -> *Page
;- rdx, r10
;. mm.paddr_hook
proc 0, pageloc_get
mov rdx, rsi
mov r10, 1ffh shl 12
and rdx, r10
shr rdx, 12 - 3
mov rax, [rdi + rdx]
jc .over
call mm.paddr_hook
.over: and rax, not 7FFh
ret
endproc
;! Allocate a page and hook it into the provided table, returning the allocated
;: *PTable tbl -> *Mem fin_loc -> Int (offset * 8) -> *PhysPage allocated_page
;. mm.paddr_get, mm.pclear
;+ rdi, rsi, rdx
; TODO: cmpxchg the switcharoo to test if a different
; thread has hooked it, if it prooves needed.
proc 0, paddr_hook
push rdi, rsi, rdx
call mm.paddr_get
mov rdi, rax
mov rax, IDENT_MAP
add rdi, rax
call mm.pclear
mov rax, IDENT_MAP
sub rdi, rax
mov rax, rdi
pop rdi, rsi, rdx
or rax, 3
bt rsi, 63
jc @f
bts rax, 2 ; PDE.U
@@: mov [rdi + rdx], rax
ret
endproc
;! Clear a page
;: *Page -> IO ()
;- rax, rcx
proc 0, pclear
xor eax, eax
mov ecx, 40h
.loop: prefetchnta [rdi + 100h]
movnti [rdi ], rax
movnti [rdi + 8 ], rax
movnti [rdi + 10h], rax
movnti [rdi + 18h], rax
movnti [rdi + 20h], rax
movnti [rdi + 28h], rax
movnti [rdi + 30h], rax
movnti [rdi + 38h], rax
add rdi, 40h
dec ecx
jnz .loop
sub rdi, 1000h ; Free considering the wait of the sfence?
sfence
ret
endproc
;! Copy a page
;: *Page dest -> *Page src -> IO ()
;- rax, rdx, rcx
proc 0, pcopy
mov ecx, 40h
.loop:
prefetch [rsi + 100h]
prefetchw [rdi + 100h]
mov rax, [rsi ]
mov rdx, [rsi + 8h ]
mov [rdi ], rax
mov [rdi + 8h ], rdx
mov rax, [rsi + 10h]
mov rdx, [rsi + 18h]
mov [rdi + 10h], rax
mov [rdi + 18h], rdx
mov rax, [rsi + 20h]
mov rdx, [rsi + 28h]
mov [rdi + 20h], rax
mov [rdi + 28h], rdx
mov rax, [rsi + 30h]
mov rdx, [rsi + 38h]
mov [rdi + 30h], rax
mov [rdi + 38h], rdx
add rdi, 40h
add rsi, 40h
dec ecx
jnz .loop
sub rdi, 1000h
sub rsi, 1000h
ret
endproc
;! Get the physical location of a free page
;: *Mem
;- rdi, rsi, rcx, rdx
; O(num_pages)
; TODO: Fail if OOM. Better algorithm. SMP-ify.
proc 0, paddr_get
mov rdi, [this.phead] ; *Mem with space for 512 pages
xor rsi, rsi ; Accumulator
xor rcx, rcx ; Counter.
jmp .in
.loopy:
inc rcx ; Search for the first clear bit.
cmp rcx, 8
je .next
.in: bsf rax, [rdi + rcx*8]
jz .loopy
.win:
btr [rdi + rcx*8], rax
; Calculate physical adress:
shl rax, 12
shl rcx, 18
shl rsi, 21
add rax, rcx
add rax, rsi ; rax = rax*1000h + rcx*40000h + rsi*200000h
add rax, 400000h ; And the first 4MiB are taken anyway.
ret
.next:
inc rsi ; The next in the list
xor rcx, rcx
mov rdx, rdi
mov rdi, [rdx + 64]
or rdi, rdi
jnz .in
.alloc:
push rsi
push rdx ; We're at the end of the list, get a new one.
mov rdi, 64 + 8
call malloc
mov rdi, rax
mov rsi, -1
mov rdx, 64
;*+ rdi
call memset
pop rdx
mov qword [rdi + 64], 0
mov [rdx + 64], rdi
xor rcx, rcx
pop rsi
jmp .in
endproc
;! Free the physical location of a free page
;: *Mem -> ()
;- rdi, rsi, rdx
proc 0, paddr_free
mov rsi, rdi ; rcx: How many steps out
shr rsi, 21
mov rdx, [this.phead]
test rsi, rsi
jz .over
.loop:
mov rdx, [rdx + 64]
dec rsi
jnz .loop
.over:
mov rsi, rdi
and rdi, 3F000h
and rsi, 1C0000h
shr rdi, 12
shr rsi, 18
bts [rdx + rsi*8], rdi
ret
endproc
endclass
; vim: ts=8 sw=8 syn=fasm
| lodvaer/YHBT | kernel/mm.asm | Assembly | bsd-3-clause | 6,681 |
;---------------------------------------
; CLi² (Command Line Interface) API
; 2013,2016 © breeze/fishbone crew
;---------------------------------------
; MODULE: #2E checkFileExist
;---------------------------------------
; Проверить существует ли файл в активной директории
; i:HL - имя файла(1-12),#00
; o:NZ - файл существует
; Z - файл не найден
;---------------------------------------
_checkFileExist ld a,flagFile ; file
jr _checkDirExist_
;---------------------------------------
| LessNick/cli2 | src/system/api/checkFileExist.asm | Assembly | bsd-3-clause | 591 |
;
; Copyright (c) 2010 The WebM project authors. All Rights Reserved.
;
; Use of this source code is governed by a BSD-style license
; that can be found in the LICENSE file in the root of the source
; tree. An additional intellectual property rights grant can be found
; in the file PATENTS. All contributing project authors may
; be found in the AUTHORS file in the root of the source tree.
;
.globl vp8_get8x8var_ppc
.globl vp8_get16x16var_ppc
.globl vp8_mse16x16_ppc
.globl vp9_variance16x16_ppc
.globl vp9_variance16x8_ppc
.globl vp9_variance8x16_ppc
.globl vp9_variance8x8_ppc
.globl vp9_variance4x4_ppc
.macro load_aligned_16 V R O
lvsl v3, 0, \R ;# permutate value for alignment
lvx v1, 0, \R
lvx v2, \O, \R
vperm \V, v1, v2, v3
.endm
.macro prologue
mfspr r11, 256 ;# get old VRSAVE
oris r12, r11, 0xffc0
mtspr 256, r12 ;# set VRSAVE
stwu r1, -32(r1) ;# create space on the stack
li r10, 16 ;# load offset and loop counter
vspltisw v7, 0 ;# zero for merging
vspltisw v8, 0 ;# zero out total to start
vspltisw v9, 0 ;# zero out total for dif^2
.endm
.macro epilogue
addi r1, r1, 32 ;# recover stack
mtspr 256, r11 ;# reset old VRSAVE
.endm
.macro compute_sum_sse
;# Compute sum first. Unpack to so signed subract
;# can be used. Only have a half word signed
;# subract. Do high, then low.
vmrghb v2, v7, v4
vmrghb v3, v7, v5
vsubshs v2, v2, v3
vsum4shs v8, v2, v8
vmrglb v2, v7, v4
vmrglb v3, v7, v5
vsubshs v2, v2, v3
vsum4shs v8, v2, v8
;# Now compute sse.
vsububs v2, v4, v5
vsububs v3, v5, v4
vor v2, v2, v3
vmsumubm v9, v2, v2, v9
.endm
.macro variance_16 DS loop_label store_sum
\loop_label:
;# only one of the inputs should need to be aligned.
load_aligned_16 v4, r3, r10
load_aligned_16 v5, r5, r10
;# move onto the next line
add r3, r3, r4
add r5, r5, r6
compute_sum_sse
bdnz \loop_label
vsumsws v8, v8, v7
vsumsws v9, v9, v7
stvx v8, 0, r1
lwz r3, 12(r1)
stvx v9, 0, r1
lwz r4, 12(r1)
.if \store_sum
stw r3, 0(r8) ;# sum
.endif
stw r4, 0(r7) ;# sse
mullw r3, r3, r3 ;# sum*sum
srawi r3, r3, \DS ;# (sum*sum) >> DS
subf r3, r3, r4 ;# sse - ((sum*sum) >> DS)
.endm
.macro variance_8 DS loop_label store_sum
\loop_label:
;# only one of the inputs should need to be aligned.
load_aligned_16 v4, r3, r10
load_aligned_16 v5, r5, r10
;# move onto the next line
add r3, r3, r4
add r5, r5, r6
;# only one of the inputs should need to be aligned.
load_aligned_16 v6, r3, r10
load_aligned_16 v0, r5, r10
;# move onto the next line
add r3, r3, r4
add r5, r5, r6
vmrghb v4, v4, v6
vmrghb v5, v5, v0
compute_sum_sse
bdnz \loop_label
vsumsws v8, v8, v7
vsumsws v9, v9, v7
stvx v8, 0, r1
lwz r3, 12(r1)
stvx v9, 0, r1
lwz r4, 12(r1)
.if \store_sum
stw r3, 0(r8) ;# sum
.endif
stw r4, 0(r7) ;# sse
mullw r3, r3, r3 ;# sum*sum
srawi r3, r3, \DS ;# (sum*sum) >> 8
subf r3, r3, r4 ;# sse - ((sum*sum) >> 8)
.endm
.align 2
;# r3 unsigned char *src_ptr
;# r4 int source_stride
;# r5 unsigned char *ref_ptr
;# r6 int recon_stride
;# r7 unsigned int *SSE
;# r8 int *Sum
;#
;# r3 return value
vp8_get8x8var_ppc:
prologue
li r9, 4
mtctr r9
variance_8 6, get8x8var_loop, 1
epilogue
blr
.align 2
;# r3 unsigned char *src_ptr
;# r4 int source_stride
;# r5 unsigned char *ref_ptr
;# r6 int recon_stride
;# r7 unsigned int *SSE
;# r8 int *Sum
;#
;# r3 return value
vp8_get16x16var_ppc:
prologue
mtctr r10
variance_16 8, get16x16var_loop, 1
epilogue
blr
.align 2
;# r3 unsigned char *src_ptr
;# r4 int source_stride
;# r5 unsigned char *ref_ptr
;# r6 int recon_stride
;# r7 unsigned int *sse
;#
;# r 3 return value
vp8_mse16x16_ppc:
prologue
mtctr r10
mse16x16_loop:
;# only one of the inputs should need to be aligned.
load_aligned_16 v4, r3, r10
load_aligned_16 v5, r5, r10
;# move onto the next line
add r3, r3, r4
add r5, r5, r6
;# Now compute sse.
vsububs v2, v4, v5
vsububs v3, v5, v4
vor v2, v2, v3
vmsumubm v9, v2, v2, v9
bdnz mse16x16_loop
vsumsws v9, v9, v7
stvx v9, 0, r1
lwz r3, 12(r1)
stvx v9, 0, r1
lwz r3, 12(r1)
stw r3, 0(r7) ;# sse
epilogue
blr
.align 2
;# r3 unsigned char *src_ptr
;# r4 int source_stride
;# r5 unsigned char *ref_ptr
;# r6 int recon_stride
;# r7 unsigned int *sse
;#
;# r3 return value
vp9_variance16x16_ppc:
prologue
mtctr r10
variance_16 8, variance16x16_loop, 0
epilogue
blr
.align 2
;# r3 unsigned char *src_ptr
;# r4 int source_stride
;# r5 unsigned char *ref_ptr
;# r6 int recon_stride
;# r7 unsigned int *sse
;#
;# r3 return value
vp9_variance16x8_ppc:
prologue
li r9, 8
mtctr r9
variance_16 7, variance16x8_loop, 0
epilogue
blr
.align 2
;# r3 unsigned char *src_ptr
;# r4 int source_stride
;# r5 unsigned char *ref_ptr
;# r6 int recon_stride
;# r7 unsigned int *sse
;#
;# r3 return value
vp9_variance8x16_ppc:
prologue
li r9, 8
mtctr r9
variance_8 7, variance8x16_loop, 0
epilogue
blr
.align 2
;# r3 unsigned char *src_ptr
;# r4 int source_stride
;# r5 unsigned char *ref_ptr
;# r6 int recon_stride
;# r7 unsigned int *sse
;#
;# r3 return value
vp9_variance8x8_ppc:
prologue
li r9, 4
mtctr r9
variance_8 6, variance8x8_loop, 0
epilogue
blr
.macro transfer_4x4 I P
lwz r0, 0(\I)
add \I, \I, \P
lwz r10,0(\I)
add \I, \I, \P
lwz r8, 0(\I)
add \I, \I, \P
lwz r9, 0(\I)
stw r0, 0(r1)
stw r10, 4(r1)
stw r8, 8(r1)
stw r9, 12(r1)
.endm
.align 2
;# r3 unsigned char *src_ptr
;# r4 int source_stride
;# r5 unsigned char *ref_ptr
;# r6 int recon_stride
;# r7 unsigned int *sse
;#
;# r3 return value
vp9_variance4x4_ppc:
prologue
transfer_4x4 r3, r4
lvx v4, 0, r1
transfer_4x4 r5, r6
lvx v5, 0, r1
compute_sum_sse
vsumsws v8, v8, v7
vsumsws v9, v9, v7
stvx v8, 0, r1
lwz r3, 12(r1)
stvx v9, 0, r1
lwz r4, 12(r1)
stw r4, 0(r7) ;# sse
mullw r3, r3, r3 ;# sum*sum
srawi r3, r3, 4 ;# (sum*sum) >> 4
subf r3, r3, r4 ;# sse - ((sum*sum) >> 4)
epilogue
blr
| vasilvv/esvp8 | vp9/encoder/ppc/vp9_variance_altivec.asm | Assembly | bsd-3-clause | 7,035 |
DIM EQU 15
.MODEL small
.STACK
.data
.CODE
.STARTUP
MOV AX, DIM
.EXIT
END | neskov7/AssemblyProgramsCE | lab0/scritturaValoreInReg.asm | Assembly | mit | 74 |
;--------------------------------------------------------------------
; Praktikum SMD 2015
; M.Wahyudin (140310120031)
;
; Name : LATIH15.ASM Penyesuaian Rangkaian Proteus
; Desc : Menampilkan karakter A ke display matriks 7x5
; Input : -
; Output: Display matriks 7x5
;--------------------------------------------------------------------
cseg at 0
mulai:
mov P1,#00001b ; mengaktifkan kolom ke-1
mov a,#0 ; pilih baris ke- 1
call ambilbaris ; mengambil data baris ke-1
mov p2,a ; menyalakan baris-1 ke port-2
call tunda ; tahan tampilan
mov p2,#0 ; padamkan baris ke 1
mov P1,#00010b ; mengaktifkan kolom ke-2
mov a,#1 ; pilih baris ke- 2
call ambilbaris ; mengambil data baris ke-2
mov p2,a ; menyalakan baris-2 ke port-2
call tunda ; tahan tampilan
mov p2,#0 ; padamkan baris ke 2
mov P1,#00100b ; mengaktifkan kolom ke-3
mov a,#2 ; pilih baris ke- 3
call ambilbaris ; mengambil data baris ke-3
mov p2,a ; menyalakan baris-3 ke port-2
call tunda ; tahan tampilan
mov p2,#0 ; padamkan baris ke 3
mov P1,#01000b ; mengaktifkan kolom ke-4
mov a,#3 ; pilih baris ke-4
call ambilbaris ; mengambil data baris ke-4
mov p2,a ; menyalakan baris-4 ke port-2
call tunda ; tahan tampilan
mov p2,#0 ; padamkan baris ke 4
mov P1,#10000b ; mengaktifkan kolom ke-5
mov a,#4 ; pilih baris ke- 5
call ambilbaris ; mengambil data baris ke-5
mov p2,a ; menyalakan baris-5 ke port-2
call tunda ; tahan tampilan
mov p2,#0 ; padamkan baris ke 5
jmp mulai
tunda: mov r1,#0
mov r2,#35
wait: djnz r1,wait
djnz r2,wait
ret
ambilbaris:
add a,#2d
movc a,@a+pc
cpl a
ret
db 7ch, 12h, 11h, 12h, 7ch
end
| hyuwah/fu-praktikum-smd | Modul 3/latih15proteus.asm | Assembly | mit | 1,627 |
/*
* Check that there are no pipeline hazards
*/
lc r100, 0x10000000 // test result output pointer
lcs r101, halt
lcs r102, failure
lcs r103, success
add r0, 100, 50 // r0:=150
add r1, r0, 3 // r1:=153, potential RAW hazard
mul r2, r1, 109 // r2:=16677, potential RAW hazard
mul r3, r2, r0 // r3:=2501550, potential RAW hazard
sub r4, r3, 15 // r4:=2501535, potential RAW hazard
mul r5, 50, 117 // r2:=5850
sub r5, 100, 9 // r2:=91, overwrites previous result, potential WAW hazard
lc r6, 1800
mul r7, r6, 49 // r7:=88200, potential RAW hazard
mov r6, 1 // r6:=1, potential WAR hazard
lc r0, 2501535
cjmpne r102, r4, r0 // failure
cjmpne r102, r5, 91 // failure
lcs r0, 88200
cjmpne r102, r7, r0 // failure
jmp r103 // success
failure:
sw r100, 2
jmp r101 // halt
success:
sw r100, 1 // success
halt:
hlt
jmp r101 // halt
| lxp32/lxp32-cpu | verify/lxp32/src/firmware/test020.asm | Assembly | mit | 864 |
;; xOS Kernel API Reference
;; As of API version 1
XOS_WM_CREATE_WINDOW = 0x0000
XOS_YIELD = 0x0001
XOS_WM_PIXEL_OFFSET = 0x0002
XOS_WM_REDRAW = 0x0003
XOS_WM_READ_EVENT = 0x0004
XOS_WM_READ_MOUSE = 0x0005
XOS_WM_GET_WINDOW = 0x0006
XOS_WM_DRAW_TEXT = 0x0007
XOS_WM_CLEAR = 0x0008
XOS_MALLOC = 0x0009
XOS_FREE = 0x000A
XOS_OPEN = 0x000B
XOS_CLOSE = 0x000C
XOS_SEEK = 0x000D
XOS_TELL = 0x000E
XOS_READ = 0x000F
XOS_WRITE = 0x0010
XOS_WM_RENDER_CHAR = 0x0011
XOS_WM_KILL = 0x0012
XOS_GET_SCREEN_INFO = 0x0013
XOS_READ_KEY = 0x0014
XOS_TERMINATE = 0x0015
XOS_CREATE_TASK = 0x0016
XOS_GET_TIME = 0x0017
XOS_SHUTDOWN = 0x0018
XOS_REBOOT = 0x0019
XOS_GET_MEMORY_USAGE = 0x001A
XOS_ENUM_TASKS = 0x001B
XOS_GET_UPTIME = 0x001C
XOS_NET_GET_CONNECTION = 0x001D
XOS_NET_SEND = 0x001E
XOS_NET_RECEIVE = 0x001F
XOS_HTTP_HEAD = 0x0020
XOS_HTTP_GET = 0x0021
XOS_SOCKET_OPEN = 0x0022
XOS_SOCKET_CLOSE = 0x0023
XOS_SOCKET_READ = 0x0024
XOS_SOCKET_WRITE = 0x0025
XOS_REALLOC = 0x0026
XOS_KPRINT = 0x0027
| omarrx024/xos | libxos/src/xos.asm | Assembly | mit | 1,068 |
DIM EQU 5
LF EQU 10
CR EQU 13
.MODEL SMALL
.STACK
.DATA
RIS DW 0
errore1 db 'ERRORE: Caratteri non numerici introdotti!!!!!', CR, LF
errore2 db 'ERRORE: Intero introdotto troppo grande!!!!!!!', CR, LF
BASE DB 10
.CODE
.STARTUP
MOV AX,0
MOV DI,0
MOV CX,0
LETTURA:
MOV AH , 01H
INT 21H
CMP AL,CR
JZ FIN
CMP AL, '0' ; VERIFICO CHE ASCII NON MINORE
JL ERR1
CMP AL ,'9' ; VERIFICO CHE ASCII NON MAGGIORE
JG ERR1
SUB AL, '0' ; CONVERTO IN BINARIO
MOV AH,0
MOV BX, AX
MOV AX, RIS
MUL BASE
ADD AX, BX
MOV RIS,AX
JNZ LETTURA
ERR1:
MOV AH,02H
LEA SI, ERRORE1
MOV CX , 50
STAMPA1:
INT 21H
INC SI
LOOP STAMPA1
JMP FIN
ERR2:
MOV AH, 02H
LEA SI , ERRORE2
MOV CX , 50
STAMPA2:
INT 21H
INC SI
LOOP STAMPA2
JMP FIN
FIN:
.EXIT
END | neskov7/AssemblyProgramsCE | lab2/es3.asm | Assembly | mit | 889 |
/*
* registerSwap.asm
*
* Created: 9/16/2014
* Author: audihurrr
* Chip : Atmega169P
*/
ldi r17,0xa3 ;
ldi r18,4 ;
sts 0x0102,r17 ;
sts 0x0103,r18 ;
lds r0,0x0102 ;
lds r1,0x0103 ;
/* Use EOR (exclusive or) operations in order to minimize RAM usage! */
eor r0, r1 ;
eor r1, r0 ;
eor r0, r1 ;
here: jmp here
| audihurrr/micro | registerSwap.asm | Assembly | mit | 360 |
list p=18f4550 ;directiva para decirle al programa el modelo de microcontrolador que se va a usar
#include <p18f4550.inc> ;llamada a la librería de nombre de los registros del PIC18F4550
;A continuación las directivas de configuración del microcontrolador
CONFIG FOSC = INTOSCIO_EC ; Oscillator Selection bits (Internal oscillator, port function on RA6, EC used by USB (INTIO))
CONFIG PWRT = ON ; Power-up Timer Enable bit (PWRT enabled)
CONFIG BOR = OFF ; Brown-out Reset Enable bits (Brown-out Reset disabled in hardware and software)
CONFIG WDT = OFF ; Watchdog Timer Enable bit (WDT disabled (control is placed on the SWDTEN bit))
CONFIG CCP2MX = ON ; CCP2 MUX bit (CCP2 input/output is multiplexed with RC1)
CONFIG PBADEN = OFF ; PORTB A/D Enable bit (PORTB<4:0> pins are configured as digital I/O on Reset)
CONFIG MCLRE = ON ; MCLR Pin Enable bit (MCLR pin enabled; RE3 input pin disabled)
CONFIG LVP = OFF ; Single-Supply ICSP Enable bit (Single-Supply ICSP disabled)
org 0x0000 ;vector de RESET
goto programa
org 0x0600
mensaje db 0x76, 0x3f, 0x38, 0x77
org 0x0020
programa:
clrf TRISD ;ponemos todo el puerto D como salida
movlw 0xF0
movwf TRISB ;ponemos la mitad del puerto B como salida
movlw UPPER mensaje ;Dirijo la dirección del puntero de tabla a mensaje
movwf TBLPTRU
movlw HIGH mensaje
movwf TBLPTRH
movlw LOW mensaje
movwf TBLPTRL
movlw 0x0F
movwf LATB ;Los cuatro displays deshabilitados
inicio:
TBLRD*+ ;Acción de lectura e incremento del puntero de tabla
movff TABLAT, LATD
bcf LATB, 3 ;Habilito display 3
call retardito
bsf LATB, 3 ;Deshabilito display 3
TBLRD*+ ;Acción de lectura e incremento del puntero de tabla
movff TABLAT, LATD
bcf LATB, 2 ;Habilito display 2
call retardito
bsf LATB, 2 ;Deshabilito display 2
TBLRD*+ ;Acción de lectura e incremento del puntero de tabla
movff TABLAT, LATD
bcf LATB, 1 ;Habilito display 1
call retardito
bsf LATB, 1 ;Deshabilito display 1
TBLRD*+ ;Acción de lectura e incremento del puntero de tabla
movff TABLAT, LATD
bcf LATB, 0 ;Habilito display 0
call retardito
bsf LATB, 0 ;Deshabilito display 0
movlw LOW mensaje
movwf TBLPTRL ;mandamos el puntero de tabla al inicio
goto inicio
retardito:
return
end | tocache/picomones | UPC Microcontroladores 2018-0/006 mux7shola.X/maincode.asm | Assembly | cc0-1.0 | 2,553 |
;
; Copyright (c) 2010 The WebM project authors. All Rights Reserved.
;
; Use of this source code is governed by a BSD-style license
; that can be found in the LICENSE file in the root of the source
; tree. An additional intellectual property rights grant can be found
; in the file PATENTS. All contributing project authors may
; be found in the AUTHORS file in the root of the source tree.
;
%include "vpx_ports/x86_abi_support.asm"
%macro STACK_FRAME_CREATE_X3 0
%if ABI_IS_32BIT
%define src_ptr rsi
%define src_stride rax
%define ref_ptr rdi
%define ref_stride rdx
%define end_ptr rcx
%define ret_var rbx
%define result_ptr arg(4)
%define max_err arg(4)
%define height dword ptr arg(4)
push rbp
mov rbp, rsp
push rsi
push rdi
push rbx
mov rsi, arg(0) ; src_ptr
mov rdi, arg(2) ; ref_ptr
movsxd rax, dword ptr arg(1) ; src_stride
movsxd rdx, dword ptr arg(3) ; ref_stride
%else
%if LIBVPX_YASM_WIN64
SAVE_XMM 7, u
%define src_ptr rcx
%define src_stride rdx
%define ref_ptr r8
%define ref_stride r9
%define end_ptr r10
%define ret_var r11
%define result_ptr [rsp+xmm_stack_space+8+4*8]
%define max_err [rsp+xmm_stack_space+8+4*8]
%define height dword ptr [rsp+xmm_stack_space+8+4*8]
%else
%define src_ptr rdi
%define src_stride rsi
%define ref_ptr rdx
%define ref_stride rcx
%define end_ptr r9
%define ret_var r10
%define result_ptr r8
%define max_err r8
%define height r8
%endif
%endif
%endmacro
%macro STACK_FRAME_DESTROY_X3 0
%define src_ptr
%define src_stride
%define ref_ptr
%define ref_stride
%define end_ptr
%define ret_var
%define result_ptr
%define max_err
%define height
%if ABI_IS_32BIT
pop rbx
pop rdi
pop rsi
pop rbp
%else
%if LIBVPX_YASM_WIN64
RESTORE_XMM
%endif
%endif
ret
%endmacro
%macro STACK_FRAME_CREATE_X4 0
%if ABI_IS_32BIT
%define src_ptr rsi
%define src_stride rax
%define r0_ptr rcx
%define r1_ptr rdx
%define r2_ptr rbx
%define r3_ptr rdi
%define ref_stride rbp
%define result_ptr arg(4)
push rbp
mov rbp, rsp
push rsi
push rdi
push rbx
push rbp
mov rdi, arg(2) ; ref_ptr_base
LOAD_X4_ADDRESSES rdi, rcx, rdx, rax, rdi
mov rsi, arg(0) ; src_ptr
movsxd rbx, dword ptr arg(1) ; src_stride
movsxd rbp, dword ptr arg(3) ; ref_stride
xchg rbx, rax
%else
%if LIBVPX_YASM_WIN64
SAVE_XMM 7, u
%define src_ptr rcx
%define src_stride rdx
%define r0_ptr rsi
%define r1_ptr r10
%define r2_ptr r11
%define r3_ptr r8
%define ref_stride r9
%define result_ptr [rsp+xmm_stack_space+16+4*8]
push rsi
LOAD_X4_ADDRESSES r8, r0_ptr, r1_ptr, r2_ptr, r3_ptr
%else
%define src_ptr rdi
%define src_stride rsi
%define r0_ptr r9
%define r1_ptr r10
%define r2_ptr r11
%define r3_ptr rdx
%define ref_stride rcx
%define result_ptr r8
LOAD_X4_ADDRESSES rdx, r0_ptr, r1_ptr, r2_ptr, r3_ptr
%endif
%endif
%endmacro
%macro STACK_FRAME_DESTROY_X4 0
%define src_ptr
%define src_stride
%define r0_ptr
%define r1_ptr
%define r2_ptr
%define r3_ptr
%define ref_stride
%define result_ptr
%if ABI_IS_32BIT
pop rbx
pop rdi
pop rsi
pop rbp
%else
%if LIBVPX_YASM_WIN64
pop rsi
RESTORE_XMM
%endif
%endif
ret
%endmacro
%macro PROCESS_16X2X3 5
%if %1==0
movdqa xmm0, XMMWORD PTR [%2]
lddqu xmm5, XMMWORD PTR [%3]
lddqu xmm6, XMMWORD PTR [%3+1]
lddqu xmm7, XMMWORD PTR [%3+2]
psadbw xmm5, xmm0
psadbw xmm6, xmm0
psadbw xmm7, xmm0
%else
movdqa xmm0, XMMWORD PTR [%2]
lddqu xmm1, XMMWORD PTR [%3]
lddqu xmm2, XMMWORD PTR [%3+1]
lddqu xmm3, XMMWORD PTR [%3+2]
psadbw xmm1, xmm0
psadbw xmm2, xmm0
psadbw xmm3, xmm0
paddw xmm5, xmm1
paddw xmm6, xmm2
paddw xmm7, xmm3
%endif
movdqa xmm0, XMMWORD PTR [%2+%4]
lddqu xmm1, XMMWORD PTR [%3+%5]
lddqu xmm2, XMMWORD PTR [%3+%5+1]
lddqu xmm3, XMMWORD PTR [%3+%5+2]
%if %1==0 || %1==1
lea %2, [%2+%4*2]
lea %3, [%3+%5*2]
%endif
psadbw xmm1, xmm0
psadbw xmm2, xmm0
psadbw xmm3, xmm0
paddw xmm5, xmm1
paddw xmm6, xmm2
paddw xmm7, xmm3
%endmacro
%macro PROCESS_8X2X3 5
%if %1==0
movq mm0, QWORD PTR [%2]
movq mm5, QWORD PTR [%3]
movq mm6, QWORD PTR [%3+1]
movq mm7, QWORD PTR [%3+2]
psadbw mm5, mm0
psadbw mm6, mm0
psadbw mm7, mm0
%else
movq mm0, QWORD PTR [%2]
movq mm1, QWORD PTR [%3]
movq mm2, QWORD PTR [%3+1]
movq mm3, QWORD PTR [%3+2]
psadbw mm1, mm0
psadbw mm2, mm0
psadbw mm3, mm0
paddw mm5, mm1
paddw mm6, mm2
paddw mm7, mm3
%endif
movq mm0, QWORD PTR [%2+%4]
movq mm1, QWORD PTR [%3+%5]
movq mm2, QWORD PTR [%3+%5+1]
movq mm3, QWORD PTR [%3+%5+2]
%if %1==0 || %1==1
lea %2, [%2+%4*2]
lea %3, [%3+%5*2]
%endif
psadbw mm1, mm0
psadbw mm2, mm0
psadbw mm3, mm0
paddw mm5, mm1
paddw mm6, mm2
paddw mm7, mm3
%endmacro
%macro LOAD_X4_ADDRESSES 5
mov %2, [%1+REG_SZ_BYTES*0]
mov %3, [%1+REG_SZ_BYTES*1]
mov %4, [%1+REG_SZ_BYTES*2]
mov %5, [%1+REG_SZ_BYTES*3]
%endmacro
%macro PROCESS_16X2X4 8
%if %1==0
movdqa xmm0, XMMWORD PTR [%2]
lddqu xmm4, XMMWORD PTR [%3]
lddqu xmm5, XMMWORD PTR [%4]
lddqu xmm6, XMMWORD PTR [%5]
lddqu xmm7, XMMWORD PTR [%6]
psadbw xmm4, xmm0
psadbw xmm5, xmm0
psadbw xmm6, xmm0
psadbw xmm7, xmm0
%else
movdqa xmm0, XMMWORD PTR [%2]
lddqu xmm1, XMMWORD PTR [%3]
lddqu xmm2, XMMWORD PTR [%4]
lddqu xmm3, XMMWORD PTR [%5]
psadbw xmm1, xmm0
psadbw xmm2, xmm0
psadbw xmm3, xmm0
paddw xmm4, xmm1
lddqu xmm1, XMMWORD PTR [%6]
paddw xmm5, xmm2
paddw xmm6, xmm3
psadbw xmm1, xmm0
paddw xmm7, xmm1
%endif
movdqa xmm0, XMMWORD PTR [%2+%7]
lddqu xmm1, XMMWORD PTR [%3+%8]
lddqu xmm2, XMMWORD PTR [%4+%8]
lddqu xmm3, XMMWORD PTR [%5+%8]
psadbw xmm1, xmm0
psadbw xmm2, xmm0
psadbw xmm3, xmm0
paddw xmm4, xmm1
lddqu xmm1, XMMWORD PTR [%6+%8]
paddw xmm5, xmm2
paddw xmm6, xmm3
%if %1==0 || %1==1
lea %2, [%2+%7*2]
lea %3, [%3+%8*2]
lea %4, [%4+%8*2]
lea %5, [%5+%8*2]
lea %6, [%6+%8*2]
%endif
psadbw xmm1, xmm0
paddw xmm7, xmm1
%endmacro
%macro PROCESS_8X2X4 8
%if %1==0
movq mm0, QWORD PTR [%2]
movq mm4, QWORD PTR [%3]
movq mm5, QWORD PTR [%4]
movq mm6, QWORD PTR [%5]
movq mm7, QWORD PTR [%6]
psadbw mm4, mm0
psadbw mm5, mm0
psadbw mm6, mm0
psadbw mm7, mm0
%else
movq mm0, QWORD PTR [%2]
movq mm1, QWORD PTR [%3]
movq mm2, QWORD PTR [%4]
movq mm3, QWORD PTR [%5]
psadbw mm1, mm0
psadbw mm2, mm0
psadbw mm3, mm0
paddw mm4, mm1
movq mm1, QWORD PTR [%6]
paddw mm5, mm2
paddw mm6, mm3
psadbw mm1, mm0
paddw mm7, mm1
%endif
movq mm0, QWORD PTR [%2+%7]
movq mm1, QWORD PTR [%3+%8]
movq mm2, QWORD PTR [%4+%8]
movq mm3, QWORD PTR [%5+%8]
psadbw mm1, mm0
psadbw mm2, mm0
psadbw mm3, mm0
paddw mm4, mm1
movq mm1, QWORD PTR [%6+%8]
paddw mm5, mm2
paddw mm6, mm3
%if %1==0 || %1==1
lea %2, [%2+%7*2]
lea %3, [%3+%8*2]
lea %4, [%4+%8*2]
lea %5, [%5+%8*2]
lea %6, [%6+%8*2]
%endif
psadbw mm1, mm0
paddw mm7, mm1
%endmacro
;void int vp9_sad16x16x3_sse3(
; unsigned char *src_ptr,
; int src_stride,
; unsigned char *ref_ptr,
; int ref_stride,
; int *results)
global sym(vp9_sad16x16x3_sse3) PRIVATE
sym(vp9_sad16x16x3_sse3):
STACK_FRAME_CREATE_X3
PROCESS_16X2X3 0, src_ptr, ref_ptr, src_stride, ref_stride
PROCESS_16X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride
PROCESS_16X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride
PROCESS_16X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride
PROCESS_16X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride
PROCESS_16X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride
PROCESS_16X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride
PROCESS_16X2X3 2, src_ptr, ref_ptr, src_stride, ref_stride
mov rcx, result_ptr
movq xmm0, xmm5
psrldq xmm5, 8
paddw xmm0, xmm5
movd [rcx], xmm0
;-
movq xmm0, xmm6
psrldq xmm6, 8
paddw xmm0, xmm6
movd [rcx+4], xmm0
;-
movq xmm0, xmm7
psrldq xmm7, 8
paddw xmm0, xmm7
movd [rcx+8], xmm0
STACK_FRAME_DESTROY_X3
;void int vp9_sad16x8x3_sse3(
; unsigned char *src_ptr,
; int src_stride,
; unsigned char *ref_ptr,
; int ref_stride,
; int *results)
global sym(vp9_sad16x8x3_sse3) PRIVATE
sym(vp9_sad16x8x3_sse3):
STACK_FRAME_CREATE_X3
PROCESS_16X2X3 0, src_ptr, ref_ptr, src_stride, ref_stride
PROCESS_16X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride
PROCESS_16X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride
PROCESS_16X2X3 2, src_ptr, ref_ptr, src_stride, ref_stride
mov rcx, result_ptr
movq xmm0, xmm5
psrldq xmm5, 8
paddw xmm0, xmm5
movd [rcx], xmm0
;-
movq xmm0, xmm6
psrldq xmm6, 8
paddw xmm0, xmm6
movd [rcx+4], xmm0
;-
movq xmm0, xmm7
psrldq xmm7, 8
paddw xmm0, xmm7
movd [rcx+8], xmm0
STACK_FRAME_DESTROY_X3
;void int vp9_sad8x16x3_sse3(
; unsigned char *src_ptr,
; int src_stride,
; unsigned char *ref_ptr,
; int ref_stride,
; int *results)
global sym(vp9_sad8x16x3_sse3) PRIVATE
sym(vp9_sad8x16x3_sse3):
STACK_FRAME_CREATE_X3
PROCESS_8X2X3 0, src_ptr, ref_ptr, src_stride, ref_stride
PROCESS_8X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride
PROCESS_8X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride
PROCESS_8X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride
PROCESS_8X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride
PROCESS_8X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride
PROCESS_8X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride
PROCESS_8X2X3 2, src_ptr, ref_ptr, src_stride, ref_stride
mov rcx, result_ptr
punpckldq mm5, mm6
movq [rcx], mm5
movd [rcx+8], mm7
STACK_FRAME_DESTROY_X3
;void int vp9_sad8x8x3_sse3(
; unsigned char *src_ptr,
; int src_stride,
; unsigned char *ref_ptr,
; int ref_stride,
; int *results)
global sym(vp9_sad8x8x3_sse3) PRIVATE
sym(vp9_sad8x8x3_sse3):
STACK_FRAME_CREATE_X3
PROCESS_8X2X3 0, src_ptr, ref_ptr, src_stride, ref_stride
PROCESS_8X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride
PROCESS_8X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride
PROCESS_8X2X3 2, src_ptr, ref_ptr, src_stride, ref_stride
mov rcx, result_ptr
punpckldq mm5, mm6
movq [rcx], mm5
movd [rcx+8], mm7
STACK_FRAME_DESTROY_X3
;void int vp9_sad4x4x3_sse3(
; unsigned char *src_ptr,
; int src_stride,
; unsigned char *ref_ptr,
; int ref_stride,
; int *results)
global sym(vp9_sad4x4x3_sse3) PRIVATE
sym(vp9_sad4x4x3_sse3):
STACK_FRAME_CREATE_X3
movd mm0, DWORD PTR [src_ptr]
movd mm1, DWORD PTR [ref_ptr]
movd mm2, DWORD PTR [src_ptr+src_stride]
movd mm3, DWORD PTR [ref_ptr+ref_stride]
punpcklbw mm0, mm2
punpcklbw mm1, mm3
movd mm4, DWORD PTR [ref_ptr+1]
movd mm5, DWORD PTR [ref_ptr+2]
movd mm2, DWORD PTR [ref_ptr+ref_stride+1]
movd mm3, DWORD PTR [ref_ptr+ref_stride+2]
psadbw mm1, mm0
punpcklbw mm4, mm2
punpcklbw mm5, mm3
psadbw mm4, mm0
psadbw mm5, mm0
lea src_ptr, [src_ptr+src_stride*2]
lea ref_ptr, [ref_ptr+ref_stride*2]
movd mm0, DWORD PTR [src_ptr]
movd mm2, DWORD PTR [ref_ptr]
movd mm3, DWORD PTR [src_ptr+src_stride]
movd mm6, DWORD PTR [ref_ptr+ref_stride]
punpcklbw mm0, mm3
punpcklbw mm2, mm6
movd mm3, DWORD PTR [ref_ptr+1]
movd mm7, DWORD PTR [ref_ptr+2]
psadbw mm2, mm0
paddw mm1, mm2
movd mm2, DWORD PTR [ref_ptr+ref_stride+1]
movd mm6, DWORD PTR [ref_ptr+ref_stride+2]
punpcklbw mm3, mm2
punpcklbw mm7, mm6
psadbw mm3, mm0
psadbw mm7, mm0
paddw mm3, mm4
paddw mm7, mm5
mov rcx, result_ptr
punpckldq mm1, mm3
movq [rcx], mm1
movd [rcx+8], mm7
STACK_FRAME_DESTROY_X3
;unsigned int vp9_sad16x16_sse3(
; unsigned char *src_ptr,
; int src_stride,
; unsigned char *ref_ptr,
; int ref_stride,
; int max_err)
;%define lddqu movdqu
global sym(vp9_sad16x16_sse3) PRIVATE
sym(vp9_sad16x16_sse3):
STACK_FRAME_CREATE_X3
mov end_ptr, 4
pxor xmm7, xmm7
.vp9_sad16x16_sse3_loop:
movdqa xmm0, XMMWORD PTR [src_ptr]
movdqu xmm1, XMMWORD PTR [ref_ptr]
movdqa xmm2, XMMWORD PTR [src_ptr+src_stride]
movdqu xmm3, XMMWORD PTR [ref_ptr+ref_stride]
lea src_ptr, [src_ptr+src_stride*2]
lea ref_ptr, [ref_ptr+ref_stride*2]
movdqa xmm4, XMMWORD PTR [src_ptr]
movdqu xmm5, XMMWORD PTR [ref_ptr]
movdqa xmm6, XMMWORD PTR [src_ptr+src_stride]
psadbw xmm0, xmm1
movdqu xmm1, XMMWORD PTR [ref_ptr+ref_stride]
psadbw xmm2, xmm3
psadbw xmm4, xmm5
psadbw xmm6, xmm1
lea src_ptr, [src_ptr+src_stride*2]
lea ref_ptr, [ref_ptr+ref_stride*2]
paddw xmm7, xmm0
paddw xmm7, xmm2
paddw xmm7, xmm4
paddw xmm7, xmm6
sub end_ptr, 1
jne .vp9_sad16x16_sse3_loop
movq xmm0, xmm7
psrldq xmm7, 8
paddw xmm0, xmm7
movq rax, xmm0
STACK_FRAME_DESTROY_X3
;void vp9_copy32xn_sse3(
; unsigned char *src_ptr,
; int src_stride,
; unsigned char *dst_ptr,
; int dst_stride,
; int height);
global sym(vp9_copy32xn_sse3) PRIVATE
sym(vp9_copy32xn_sse3):
STACK_FRAME_CREATE_X3
.block_copy_sse3_loopx4:
lea end_ptr, [src_ptr+src_stride*2]
movdqu xmm0, XMMWORD PTR [src_ptr]
movdqu xmm1, XMMWORD PTR [src_ptr + 16]
movdqu xmm2, XMMWORD PTR [src_ptr + src_stride]
movdqu xmm3, XMMWORD PTR [src_ptr + src_stride + 16]
movdqu xmm4, XMMWORD PTR [end_ptr]
movdqu xmm5, XMMWORD PTR [end_ptr + 16]
movdqu xmm6, XMMWORD PTR [end_ptr + src_stride]
movdqu xmm7, XMMWORD PTR [end_ptr + src_stride + 16]
lea src_ptr, [src_ptr+src_stride*4]
lea end_ptr, [ref_ptr+ref_stride*2]
movdqa XMMWORD PTR [ref_ptr], xmm0
movdqa XMMWORD PTR [ref_ptr + 16], xmm1
movdqa XMMWORD PTR [ref_ptr + ref_stride], xmm2
movdqa XMMWORD PTR [ref_ptr + ref_stride + 16], xmm3
movdqa XMMWORD PTR [end_ptr], xmm4
movdqa XMMWORD PTR [end_ptr + 16], xmm5
movdqa XMMWORD PTR [end_ptr + ref_stride], xmm6
movdqa XMMWORD PTR [end_ptr + ref_stride + 16], xmm7
lea ref_ptr, [ref_ptr+ref_stride*4]
sub height, 4
cmp height, 4
jge .block_copy_sse3_loopx4
;Check to see if there is more rows need to be copied.
cmp height, 0
je .copy_is_done
.block_copy_sse3_loop:
movdqu xmm0, XMMWORD PTR [src_ptr]
movdqu xmm1, XMMWORD PTR [src_ptr + 16]
lea src_ptr, [src_ptr+src_stride]
movdqa XMMWORD PTR [ref_ptr], xmm0
movdqa XMMWORD PTR [ref_ptr + 16], xmm1
lea ref_ptr, [ref_ptr+ref_stride]
sub height, 1
jne .block_copy_sse3_loop
.copy_is_done:
STACK_FRAME_DESTROY_X3
;void vp9_sad16x16x4d_sse3(
; unsigned char *src_ptr,
; int src_stride,
; unsigned char *ref_ptr_base,
; int ref_stride,
; int *results)
global sym(vp9_sad16x16x4d_sse3) PRIVATE
sym(vp9_sad16x16x4d_sse3):
STACK_FRAME_CREATE_X4
PROCESS_16X2X4 0, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride
PROCESS_16X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride
PROCESS_16X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride
PROCESS_16X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride
PROCESS_16X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride
PROCESS_16X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride
PROCESS_16X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride
PROCESS_16X2X4 2, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride
%if ABI_IS_32BIT
pop rbp
%endif
mov rcx, result_ptr
movq xmm0, xmm4
psrldq xmm4, 8
paddw xmm0, xmm4
movd [rcx], xmm0
;-
movq xmm0, xmm5
psrldq xmm5, 8
paddw xmm0, xmm5
movd [rcx+4], xmm0
;-
movq xmm0, xmm6
psrldq xmm6, 8
paddw xmm0, xmm6
movd [rcx+8], xmm0
;-
movq xmm0, xmm7
psrldq xmm7, 8
paddw xmm0, xmm7
movd [rcx+12], xmm0
STACK_FRAME_DESTROY_X4
;void vp9_sad16x8x4d_sse3(
; unsigned char *src_ptr,
; int src_stride,
; unsigned char *ref_ptr_base,
; int ref_stride,
; int *results)
global sym(vp9_sad16x8x4d_sse3) PRIVATE
sym(vp9_sad16x8x4d_sse3):
STACK_FRAME_CREATE_X4
PROCESS_16X2X4 0, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride
PROCESS_16X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride
PROCESS_16X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride
PROCESS_16X2X4 2, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride
%if ABI_IS_32BIT
pop rbp
%endif
mov rcx, result_ptr
movq xmm0, xmm4
psrldq xmm4, 8
paddw xmm0, xmm4
movd [rcx], xmm0
;-
movq xmm0, xmm5
psrldq xmm5, 8
paddw xmm0, xmm5
movd [rcx+4], xmm0
;-
movq xmm0, xmm6
psrldq xmm6, 8
paddw xmm0, xmm6
movd [rcx+8], xmm0
;-
movq xmm0, xmm7
psrldq xmm7, 8
paddw xmm0, xmm7
movd [rcx+12], xmm0
STACK_FRAME_DESTROY_X4
;void int vp9_sad8x16x4d_sse3(
; unsigned char *src_ptr,
; int src_stride,
; unsigned char *ref_ptr,
; int ref_stride,
; int *results)
global sym(vp9_sad8x16x4d_sse3) PRIVATE
sym(vp9_sad8x16x4d_sse3):
STACK_FRAME_CREATE_X4
PROCESS_8X2X4 0, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride
PROCESS_8X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride
PROCESS_8X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride
PROCESS_8X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride
PROCESS_8X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride
PROCESS_8X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride
PROCESS_8X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride
PROCESS_8X2X4 2, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride
%if ABI_IS_32BIT
pop rbp
%endif
mov rcx, result_ptr
punpckldq mm4, mm5
punpckldq mm6, mm7
movq [rcx], mm4
movq [rcx+8], mm6
STACK_FRAME_DESTROY_X4
;void int vp9_sad8x8x4d_sse3(
; unsigned char *src_ptr,
; int src_stride,
; unsigned char *ref_ptr,
; int ref_stride,
; int *results)
global sym(vp9_sad8x8x4d_sse3) PRIVATE
sym(vp9_sad8x8x4d_sse3):
STACK_FRAME_CREATE_X4
PROCESS_8X2X4 0, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride
PROCESS_8X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride
PROCESS_8X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride
PROCESS_8X2X4 2, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride
%if ABI_IS_32BIT
pop rbp
%endif
mov rcx, result_ptr
punpckldq mm4, mm5
punpckldq mm6, mm7
movq [rcx], mm4
movq [rcx+8], mm6
STACK_FRAME_DESTROY_X4
;void int vp9_sad4x4x4d_sse3(
; unsigned char *src_ptr,
; int src_stride,
; unsigned char *ref_ptr,
; int ref_stride,
; int *results)
global sym(vp9_sad4x4x4d_sse3) PRIVATE
sym(vp9_sad4x4x4d_sse3):
STACK_FRAME_CREATE_X4
movd mm0, DWORD PTR [src_ptr]
movd mm1, DWORD PTR [r0_ptr]
movd mm2, DWORD PTR [src_ptr+src_stride]
movd mm3, DWORD PTR [r0_ptr+ref_stride]
punpcklbw mm0, mm2
punpcklbw mm1, mm3
movd mm4, DWORD PTR [r1_ptr]
movd mm5, DWORD PTR [r2_ptr]
movd mm6, DWORD PTR [r3_ptr]
movd mm2, DWORD PTR [r1_ptr+ref_stride]
movd mm3, DWORD PTR [r2_ptr+ref_stride]
movd mm7, DWORD PTR [r3_ptr+ref_stride]
psadbw mm1, mm0
punpcklbw mm4, mm2
punpcklbw mm5, mm3
punpcklbw mm6, mm7
psadbw mm4, mm0
psadbw mm5, mm0
psadbw mm6, mm0
lea src_ptr, [src_ptr+src_stride*2]
lea r0_ptr, [r0_ptr+ref_stride*2]
lea r1_ptr, [r1_ptr+ref_stride*2]
lea r2_ptr, [r2_ptr+ref_stride*2]
lea r3_ptr, [r3_ptr+ref_stride*2]
movd mm0, DWORD PTR [src_ptr]
movd mm2, DWORD PTR [r0_ptr]
movd mm3, DWORD PTR [src_ptr+src_stride]
movd mm7, DWORD PTR [r0_ptr+ref_stride]
punpcklbw mm0, mm3
punpcklbw mm2, mm7
movd mm3, DWORD PTR [r1_ptr]
movd mm7, DWORD PTR [r2_ptr]
psadbw mm2, mm0
%if ABI_IS_32BIT
mov rax, rbp
pop rbp
%define ref_stride rax
%endif
mov rsi, result_ptr
paddw mm1, mm2
movd [rsi], mm1
movd mm2, DWORD PTR [r1_ptr+ref_stride]
movd mm1, DWORD PTR [r2_ptr+ref_stride]
punpcklbw mm3, mm2
punpcklbw mm7, mm1
psadbw mm3, mm0
psadbw mm7, mm0
movd mm2, DWORD PTR [r3_ptr]
movd mm1, DWORD PTR [r3_ptr+ref_stride]
paddw mm3, mm4
paddw mm7, mm5
movd [rsi+4], mm3
punpcklbw mm2, mm1
movd [rsi+8], mm7
psadbw mm2, mm0
paddw mm2, mm6
movd [rsi+12], mm2
STACK_FRAME_DESTROY_X4
| matsumoto-r/synciga | src/third_party/libvpx/source/libvpx/vp9/encoder/x86/vp9_sad_sse3.asm | Assembly | bsd-3-clause | 29,895 |
;*********************************************************************
; DESCRIPTION : Include bestand voor embedded systems
; bevat standaard-routines
; FILE NAME : INCLUDE.ASM
; COMPILER : M-IDE Studio
; SUPPORT : AT89C5131
; DATE : 28 oktober 2010
; AUTEUR : E.R. van den Berg
;*********************************************************************
;***********************************
; Definieer Standaard Function Registers
;***********************************
AUXR EQU 08EH
CKCON0 EQU 08FH
BRL EQU 09AH
BDRCON EQU 09BH
KBLS EQU 09CH
KBE EQU 09DH
KBF EQU 09EH
;***********************************
; Definieer gebruikte variabelen
;***********************************
ER_buffer EQU 070H ; ontvangst-buffer
;***********************************
ORG 0000H ; Reset vector
LJMP ER_init
;***********************************
; Definieer Interrupt vectoren
;***********************************
;***********************************
ORG 0100H ; start user routines en initialisatie
ER_init:
ANL CKCON0,#11111110B ; SYSTEM CLOCK = 12CLK/MACHINE
ORL CKCON0,#00000001B ; SYSTEM CLOCK = 6CLK/MACHINE
ORL PCON,#11000000B ;
ORL BDRCON,#00001110B ; init baudrate generator
MOV SCON,#01010000B ; mode=1 (8 bits data)
; MOV BRL,#243 ; baudrate = 115200
MOV BRL,#100 ; baudrate = 9600
ORL BDRCON,#00010000B ; start baudrate generator
SETB REN ; zet de ontvanger aan
MOV P0,#0FFH ; zet Port 0 als input
MOV P1,#0 ; zet Port 1 output op 0
;*******************************
; verzend reset-melding via serial Port
;*******************************
MOV DPTR,#ER_welkom
ACALL ER_transmit_string
CLR P2.7 ; zet buzzer aan
ACALL ER_delay05 ; wacht 0,5 sec
SETB P2.7 ; zet buzzer uit
LJMP ER_start
;**************************************
; ---- GEBRUIKTE SUBROUTINES ----
;**************************************
; transmit rs232 string:
; string start-adres in DPTR
; einde string markering = 0FF
; gebruikt: DPTR, A
;**************************************
ER_transmit_string:
CLR TI ; reset de transmit-vlag
ER_loop1:
CLR A
MOVC A,@A+DPTR ; haal string-char op in A
INC DPTR
CJNE A,#0FFH,ER_verder ; einde string bereikt?
RET ; ja --> return
ER_verder:
CALL ER_transmit_char
JMP ER_loop1
;*************************************
; transmit rs232 character:
; char (ascii) in A
;*************************************
ER_transmit_char:
MOV SBUF,A ; zet char in verzendbuffer
JNB TI,$ ; wacht tot TI geset is --> char verzonden
CLR TI ; maak TI weer 0
RET
;*************************************
; receive RS232 character:
; char (ascii) in A
;*************************************
ER_receive_char:
JNB RI,$ ; wacht tot char ontvangen is
CLR RI ; clear onvangen-vlag status
MOV A,SCON ; haal frame-error bit in A
CLR SCON.7 ; clear Frame-error
JB ACC.7, ER_receive_char ; als frame-error: haal opnieuw char op
MOV A,SBUF ; anders: haal ontvangen char in A
RET
;*************************************
; get rs232 character
; char (ascii) in A als ontvangen
; anders A=0
;*************************************
ER_get_char:
JNB RI,ER_verder2 ; geen char binnengekomen
CLR RI ; clear onvangen-vlag status
MOV A,SBUF ; haal char op in A
RET
ER_verder2:
CLR A ; status A op 0 (= geen char binnen)
RET
;*************************************
; receive 8 bits van uitbreiding
; A bevat de 8 ingelezen bits
;*************************************
ER_input:
MOV A,P0
RET
;*************************************
; transmit 8 bits naar uitbreiding
; A bevat de 8 te versturen bits
;*************************************
ER_output:
MOV P1,A
RET
;*************************************
; delay 0,5 seconden
;*************************************
ER_delay05:
MOV R4,#5
ER_del2:
MOV R2,#0FFH
ER_del1:
MOV R3,#0FFH
DJNZ R3,$
DJNZ R2,ER_del1
DJNZ R4,ER_del2
RET
;*************************************
; delay 1 milliseconden
;*************************************
ER_delay001:
MOV R2,#0FFH
DJNZ R2,$
RET
;*************************************
; Gebruikte Teksten
;*************************************
ER_welkom: DB 0DH,0AH,0DH,0AH
DB "Embedded systems Ontwikkelboard v1.0",0DH,0AH
DB "(c) 2010 E.R. van den Berg",0DH,0AH,0DH,0AH,0FFH
ER_error: DB 0DH, 0AH
DB "No, syntax error!!",0DH,0AH,0DH,0AH,0FFH
ER_prompt: DB 0DH, 0AH,"Command>",0FFH
ER_help: DB 0DH,0AH
DB "*******************************************",0DH,0AH
DB "* Beschikbare commando's: *",0DH,0AH
DB "* ----------------------- *",0DH,0AH
DB "* OUT w : schrijft w naar port P1 *",0DH,0AH
DB "* w in 8 bits binair formaat *",0DH,0AH
DB "* IN : leest port P0 en geeft *",0DH,0AH
DB "* waarde binair weer *",0DH,0AH
DB "* SBn : set output-bit n *",0DH,0AH
DB "* CBn : clear output-bit n *",0DH,0AH
DB "* PBn : pulse output-bit n *",0DH,0AH
DB "* RUN : start user programma *",0DH,0AH
DB "* ? : deze help-tekst *",0DH,0AH
DB "* [NB: keer terug naar command-mode *",0DH,0AH
DB "* door de reset in te drukken.] *",0DH,0AH
DB "*******************************************",0DH,0AH,0DH,0AH,0FFH
ER_in_tekst: DB 0DH,0AH,"Waarde Port0: ",0FFH
ER_set_tekst: DB 0DH,0AH,"Waarde Port1: ",0FFH
ER_run_tekst: DB 0DH,0AH,"[keer terug naar command-mode door reset in te drukken]",0DH,0AH,0DH,0AH,"running......",0FFH
ER_toggle_tekst1: DB 0DH,0AH,"Pulse 0-1-0 op Port1 Bit",0FFH
ER_toggle_tekst2: DB 0DH,0AH,"Pulse 1-0-1 op Port1 Bit",0FFH
;***********************************
; EINDE SUBROUTINES
;***********************************
ER_start:
;***********************************
; command mode hoofdprogramma
; - handelt BS, BELL en CR af
; - converteert ontvangen
; karakters naar uppercase
;***********************************
MOV DPTR,#ER_prompt
ACALL ER_transmit_string ; toon prompt aan gebruiker
MOV R0,#ER_buffer ; clear buffer-pointer
ER_loop2:
ACALL ER_receive_char ; wacht op invoer
MOV R1,A
CLR C
SUBB A, #97
JC ER_v5 ; is het een lowercase karakter?
SUBB A, #26
JNC ER_v5
MOV A,R1
ADD A, #224 ; convert naar uppercase
MOV R1,A
ER_v5:
MOV A,R1
ACALL ER_transmit_char ; echo de invoer
CJNE A,#08,ER_v6 ; backspace?
DEC R0 ; ja: verlaag bufferpointer
CLR C ; en echo BS+spatie+BS
MOV A,R0
SUBB A,#ER_buffer
JC ER_start ; begin commando --> start opnieuw
MOV A,#' '
ACALL ER_transmit_char ; wis beeld met spatie
MOV A,#08
ACALL ER_transmit_char ; zet cursor 1 terug
JMP ER_loop2
ER_v6:
CJNE A,#07,ER_d1 ; beep?
SETB P2.7 ; zet buzzer aan
ACALL ER_delay05 ; wacht 0,5 sec
CLR P2.7 ; zet buzzer uit
JMP ER_start
ER_d1:
MOV @R0,A ; plaats karakter in buffer
CJNE A,#0DH,ER_v1 ; karakter = return?
JMP ER_check1 ; return ontvangen --> check syntax
ER_v1: INC R0 ; verhoog pointer
CJNE R0,#ER_buffer + 018,ER_loop2 ; pointer op einde buffer?
MOV DPTR,#ER_error
ACALL ER_transmit_string ; ja --> geef error
JMP ER_start
;******************************************
ER_check1:
MOV R0,#ER_buffer ; begin bij 1e karakter
; lees karakter in....
ER_check_?:
CJNE @R0,#'?',ER_check_out ; '?' getypt?
MOV DPTR,#ER_help ; ja --> toon help
ACALL ER_Transmit_string
JMP ER_start ; restart
ER_check_out:
CJNE @R0,#'O',ER_check_in
INC R0
; haal volgende karakter op
CJNE @R0,#'U',ER_check_in
INC R0
; haal volgende karakter op
CJNE @R0,#'T',ER_check_in
INC R0
; haal volgende karakter op
CJNE @R0,#' ',ER_check_in
; commando = 'OUT ', haal nu 8 bits op....
MOV R1,#8 ; lus-teller
MOV R7,#0 ; komt waarde in
ER_loop4:
INC R0
; haal waarde op
CJNE @R0,#'1',ER_v4
SETB C ; carry -> 1
ER_t1:
MOV A,R7
RLC A ; schuif carry in A
MOV R7,A ; bewaar in R7
DJNZ R1, ER_loop4
MOV P1,R7 ; output -> port 1
JMP ER_start
ER_v4: CLR C ; carry -> 0
JMP ER_t1
ER_check_in:
MOV R0,#ER_buffer ; begin opnieuw bij 1e karakter
; lees karakter in....
CJNE @R0,#'I',ER_check_run
INC R0
; lees karakter in....
CJNE @R0,#'N',ER_check_run
MOV A,P0 ; commando = IN, lees P0 in
MOV R7,A ; sla 8 bits op in R7
MOV R1,#8 ; lus-teller
CLR C
MOV DPTR,#ER_in_tekst
ACALL ER_transmit_string
ER_loop3:
MOV A,R7
RLC A ; haal bit uit R7 op
MOV R7,A
JC ER_display_1
MOV A,#'0'
ACALL ER_transmit_char
JMP ER_v3
ER_display_1:
MOV A,#'1'
ACALL ER_transmit_char
ER_v3:
DJNZ R1,ER_loop3
LJMP ER_start
ER_check_run:
MOV R0,#ER_buffer ; begin opnieuw bij 1e karakter
CJNE @R0,#'R',ER_check_set; lees karakter in....
INC R0 ; lees karakter in....
CJNE @R0,#'U',ER_check_set
INC R0 ; lees karakter in....
CJNE @R0,#'N',ER_check_set
MOV DPTR,#ER_run_tekst
ACALL ER_transmit_string
LJMP ER_start_user ; RUN --> start user programma
;*****************************************
ER_check_set:
MOV R0,#ER_buffer ; begin opnieuw
CJNE @R0,#'S',ER_check_clr
INC R0
CJNE @R0,#'B',ER_check_clr
INC R0
CJNE @R0,#'0',ER_check_set1
SETB P1.0 ; set bit 0
LJMP ER_set_end
ER_check_set1:
CJNE @R0,#'1',ER_check_set2
SETB P1.1 ; set bit 1
LJMP ER_set_end
ER_check_set2:
CJNE @R0,#'2',ER_check_set3
SETB P1.2 ; set bit 2
LJMP ER_set_end
ER_check_set3:
CJNE @R0,#'3',ER_check_set4
SETB P1.3 ; set bit 3
LJMP ER_set_end
ER_check_set4:
CJNE @R0,#'4',ER_check_set5
SETB P1.4 ; set bit 4
LJMP ER_set_end
ER_check_set5:
CJNE @R0,#'5',ER_check_set6
SETB P1.5 ; set bit 5
LJMP ER_set_end
ER_check_set6:
CJNE @R0,#'6',ER_check_set7
SETB P1.6 ; set bit 6
LJMP ER_set_end
ER_check_set7:
CJNE @R0,#'7',ER_check_clr
SETB P1.7 ; set bit 7
ER_set_end:
MOV DPTR,#ER_set_tekst
ACALL ER_transmit_string
CLR C
MOV R1,#8
MOV R7,P1
LJMP ER_loop3
;***************************************
ER_check_clr:
MOV R0,#ER_buffer ; begin opnieuw
CJNE @R0,#'C',ER_check_toggle
INC R0
CJNE @R0,#'B',ER_check_toggle
INC R0
CJNE @R0,#'0',ER_check_clr1
CLR P1.0 ; set bit 0
LJMP ER_set_end
ER_check_clr1:
CJNE @R0,#'1',ER_check_clr2
CLR P1.1 ; set bit 1
LJMP ER_set_end
ER_check_clr2:
CJNE @R0,#'2',ER_check_clr3
CLR P1.2 ; set bit 2
LJMP ER_set_end
ER_check_clr3:
CJNE @R0,#'3',ER_check_clr4
CLR P1.3 ; set bit 3
LJMP ER_set_end
ER_check_clr4:
CJNE @R0,#'4',ER_check_clr5
CLR P1.4 ; set bit 4
LJMP ER_set_end
ER_check_clr5:
CJNE @R0,#'5',ER_check_clr6
CLR P1.5 ; set bit 5
LJMP ER_set_end
ER_check_clr6:
CJNE @R0,#'6',ER_check_clr7
CLR P1.6 ; set bit 6
LJMP ER_set_end
ER_check_clr7:
CJNE @R0,#'7',ER_check_toggle
CLR P1.7 ; set bit 7
LJMP ER_set_end
ER_go_return:
LJMP ER_check_return
ER_check_toggle:
MOV R0,#ER_buffer ; begin opnieuw
CJNE @R0,#'P',ER_go_return
INC R0
CJNE @R0,#'B',ER_go_return
INC R0
CJNE @R0,#'0',ER_check_toggle1
CPL P1.0 ; toggle bit 0
ACALL ER_delay001 ; wacht 1 msec.
CPL P1.0 ; toggle bit 0
JB P1.0,ER_toggle1_1
JMP ER_toggle1_0
ER_check_toggle1:
CJNE @R0,#'1',ER_check_toggle2
CPL P1.1 ; toggle bit 1
ACALL ER_delay001 ; wacht 1 msec.
CPL P1.1 ; toggle bit 1
JB P1.1,ER_toggle1_1
JMP ER_toggle1_0
ER_check_toggle2:
CJNE @R0,#'2',ER_check_toggle3
CPL P1.2 ; toggle bit 2
ACALL ER_delay001 ; wacht 1 msec.
CPL P1.2 ; toggle bit 2
JB P1.2,ER_toggle1_1
JMP ER_toggle1_0
ER_check_toggle3:
CJNE @R0,#'3',ER_check_toggle4
CPL P1.3 ; toggle bit 3
ACALL ER_delay001 ; wacht 1 msec.
CPL P1.3 ; toggle bit 3
JB P1.3,ER_toggle1_1
JMP ER_toggle1_0
ER_check_toggle4:
CJNE @R0,#'4',ER_check_toggle5
CPL P1.4 ; toggle bit 4
ACALL ER_delay001 ; wacht 1 msec.
CPL P1.4 ; toggle bit 4
JB P1.4,ER_toggle1_1
JMP ER_toggle1_0
ER_check_toggle5:
CJNE @R0,#'5',ER_check_toggle6
CPL P1.5 ; toggle bit 5
ACALL ER_delay001 ; wacht 1 msec.
CPL P1.5 ; toggle bit 5
JB P1.5,ER_toggle1_1
JMP ER_toggle1_0
ER_check_toggle6:
CJNE @R0,#'6',ER_check_toggle7
CPL P1.6 ; toggle bit 6
ACALL ER_delay001 ; wacht 1 msec.
CPL P1.6 ; toggle bit 6
JB P1.6,ER_toggle1_1
JMP ER_toggle1_0
ER_check_toggle7:
CJNE @R0,#'7',ER_check_return
CPL P1.7 ; toggle bit 7
ACALL ER_delay001 ; wacht 1 msec.
CPL P1.7 ; toggle bit 7
JB P1.7,ER_toggle1_1
JMP ER_toggle1_0
;********************************************
ER_toggle1_0:
MOV DPTR,#ER_toggle_tekst1
JMP ER_toggle_v1
ER_toggle1_1:
MOV DPTR,#ER_toggle_tekst2
ER_toggle_v1:
ACALL ER_transmit_string
MOV A,@R0
ACALL ER_transmit_char
LJMP ER_start
;********************************************
ER_check_return:
MOV R0,#ER_buffer ; start buffer
CJNE @R0,#0DH,ER_cr_error
LJMP ER_start
ER_cr_error:
MOV DPTR,#ER_error
ACALL ER_transmit_string
LJMP ER_start
ER_start_user:
| Zarthus/School | Year 3 (2014-09 to 2015-02)/Assembly/system_includes.asm | Assembly | mit | 12,658 |
0;JGE
| OwenDavison/nand2tetris_grading | ASMBLR/TestJumps03.asm | Assembly | cc0-1.0 | 6 |
use64
include 'common.inc'
; decoding routine
decode:
virtual at rdx
.out fde64s
end virtual
push rbx rsi rdi
; prepare stuff
mov rsi,rcx
mov r8,rcx
; zero-out result
xor ecx,ecx
xor al,al
mov rdi,rdx
mov cl,sizeof.fde64s
rep stosb
; process prefixes
.prefix:
lodsb
.restart:
mov cl,al
mov ch,al
and cl,0FEh
and ch,0E7h
cmp al,PREFIX_LOCK
je .lock
cmp cl,PREFIX_REPNZ
je .rep
cmp al,PREFIX_OPERAND_SIZE
je .66
cmp al,PREFIX_ADDRESS_SIZE
je .67
cmp cl,PREFIX_SEGMENT_FS
je .seg
cmp ch,PREFIX_SEGMENT_CS
jnz .rex
.seg:
or [.out.prefix],PRE_SEG
mov [.out.prefix.seg],al
jmp .prefix
.lock:
or [.out.prefix],PRE_LOCK
mov [.out.prefix.lock],al
jmp .prefix
.rep:
or [.out.prefix],PRE_REP
mov [.out.prefix.rep],al
jmp .prefix
.66:
or [.out.prefix],PRE_66
mov [.out.prefix.66],al
jmp .prefix
.67:
or [.out.prefix],PRE_67
mov [.out.prefix.67],al
jmp .prefix
; process rex prefix
.rex:
mov cl,al
and cl,0F0h
cmp cl,PREFIX_REX_START
jnz .vex
or [.out.prefix],PRE_REX
mov [.out.rex],al
mov ah,al
mov cl,al
mov ch,al
shr al,3
shr ah,2
shr cl,1
and al,1
and ah,1
and cl,1
and ch,1
mov word [.out.rex.w],ax
mov word [.out.rex.x],cx
lodsb
; process vex prefix
.vex:
mov cl,al
and cl,0FEh
cmp cl,PREFIX_VEX_3_BYTE
jnz .opcode
mov [.out.opcode],0Fh
or [.out.prefix],PRE_VEX
mov [.out.vex],al
mov cl,al
lodsb
mov [.out.vex2],al
test [.out.prefix],PRE_LOCK+PRE_REP+PRE_66+PRE_REX
je .vex_2_byte
or [.out.flags],F_VEX_BAD_PREFIX
.vex_2_byte:
cmp cl,PREFIX_VEX_2_BYTE
jnz .vex_3_byte
mov ah,al
mov cl,al
mov ch,al
shl ah,1
shl cl,5
shr al,7
shr ah,4
shr cl,7
and ch,3
or al,0FEh
or ah,0F0h
not al
not ah
mov [.out.vex.r],al
mov [.out.vex.vvvv],ah
mov word [.out.vex.l],cx
jmp .vex_0F
.vex_3_byte:
mov ah,al
mov cl,al
mov ch,al
shl ah,1
shl cl,2
shr al,7
shr ah,7
shr cl,7
and ch,01Fh
or al,0FEh
or ah,0FEh
or cl,0FEh
not al
not ah
not cl
mov word [.out.vex.r],ax
mov word [.out.vex.b],cx
lodsb
mov [.out.vex3],al
mov ah,al
mov cl,al
mov bl,al
shl ah,1
shl cl,5
shr al,7
shr ah,4
shr cl,7
and bl,3
or ah,0F0h
not ah
mov word [.out.vex.w],ax
mov [.out.vex.l],cl
mov [.out.vex.pp],bl
cmp ch,M_MMMM_0F
jnz .vex_0F_38_3A
.vex_0F:
mov bl,C_0F
jmp .2_byte
.vex_0F_38_3A:
mov bl,C_3BYTE
mov bh,38h
mov [.out.opcode2],bh
cmp ch,M_MMMM_0F_38
je .3_byte
mov bh,3Ah
mov [.out.opcode2],bh
jmp .3_byte
; process opcode
.opcode:
mov [.out.opcode.len],1
mov [.out.opcode],al
lea rbx,[opcode_table]
.next_opcode:
mov ah,al
xlatb
xchg eax,ebx
; unable to handle opcode
cmp bl,C_UNDEFINED
jnz .prefix_error
.undefined:
or [.out.flags],F_ERROR_OPCODE
.exit:
xor bl,bl
jmp .check_if_lock_is_valid
; process prefix errors
.prefix_error:
cmp bl,C_PREFIX
jnz .2_byte
or [.out.flags],F_REX_IGNORED
and [.out.prefix],not PRE_REX
xor eax,eax
mov dword [.out.rex],eax
mov [.out.rex.b],al
mov al,bh
jmp .restart
; process 2-byte opcodes
.2_byte:
cmp bl,C_0F
jnz .3_byte
lodsb
mov [.out.opcode.len],2
mov [.out.opcode2],al
lea rbx,[opcode_table_0F]
jmp .next_opcode
; process 3-byte opcodes
.3_byte:
cmp bl,C_3BYTE
jnz .moffs
lodsb
mov [.out.opcode.len],3
mov [.out.opcode3],al
xor ecx,ecx
mov ah,sizeof.opcode_table_0F_38_V
mov cl,sizeof.opcode_table_0F_38
test [.out.prefix],PRE_VEX
je .skip_0F_38_V
mov cl,ah
.skip_0F_38_V:
lea rdi,[opcode_table_0F_38]
mov bl,C_MODRM
cmp bh,38h
je .lookup
mov ah,sizeof.opcode_table_0F_3A_V
mov cl,sizeof.opcode_table_0F_3A
test [.out.prefix],PRE_VEX
je .skip_0F_3A_V
mov cl,ah
.skip_0F_3A_V:
lea rdi,[opcode_table_0F_3A]
mov bl,C_MODRM+C_IMM8
.lookup:
repnz scasb
jnz .undefined
mov bh,al
jmp .modrm
; process direct memory-offsets
.moffs:
cmp bl,C_MOFFS
jnz .modrm
lea rdi,[.out.disp8]
test [.out.prefix],PRE_67
je .disp64
or [.out.flags],F_DISP32
movsd
jmp .exit
.disp64:
or [.out.flags],F_DISP64
movsq
jmp .exit
; process modr/m-byte
.modrm:
test bl,C_MODRM
je .imm
lodsb
or [.out.flags],F_MODRM
mov [.out.modrm],al
mov cl,al
mov ch,al
shl ch,2
shr cl,6
shr ch,5
and al,7
mov word [.out.modrm.mod],cx
mov [.out.modrm.rm],al
; F6/F7 have immediate-bytes only if modrm.reg=0 (test)
mov ah,[.out.opcode]
and ah,0FEh
cmp ah,0F6h
jnz .no_F6_F7
test ch,ch
je .no_F6_F7
and bl,not (C_IMM8+C_IMM32)
.no_F6_F7:
; any displacement?
cmp cl,MOD_DISP32
je .modrm_disp32
cmp cl,MOD_DISP8
je .modrm_disp8
test cl,cl
jnz .sib
cmp al,RM_DISP32
jnz .sib
or [.out.flags],F_RELATIVE+F_RIPDISP32
.modrm_disp32:
or [.out.flags],F_DISP32
jmp .sib
.modrm_disp8:
or [.out.flags],F_DISP8
; process sib-byte
.sib:
cmp cl,MOD_REG
je .disp
cmp al,RM_SIB
jnz .disp
lodsb
or [.out.flags],F_SIB
mov [.out.sib],al
mov ah,al
mov ch,al
shl ah,2
shr al,6
shr ah,5
and ch,7
mov word [.out.sib.scale],ax
mov [.out.sib.base],ch
; any displacement?
test cl,cl
jnz .disp
cmp ch,REG_RBP
jnz .disp
or [.out.flags],F_DISP32 ; scale with disp32 but w/o base if modrm.mod=0 and sib.base=5
; process displacement
.disp:
lea rdi,[.out.disp8]
test [.out.flags],F_DISP32
je .disp8
movsd
.disp8:
test [.out.flags],F_DISP8
je .imm
movsb
; process immediate-bytes
.imm:
lea rdi,[.out.imm8]
test bl,C_IMM32
je .imm16
; B8-BF have a 64bit immediate if rex.w=1
mov al,[.out.opcode]
and al,0F8h
cmp al,0B8h
jnz .no_B8_BF
cmp [.out.rex.w],1
jnz .no_B8_BF
or [.out.flags],F_IMM64
movsq
jmp .exit
.no_B8_BF:
test bl,C_REL ; ignore operand-override if rel32
jnz .imm32
cmp [.out.rex.w],1 ; or if rex.w=1
je .imm32
test [.out.prefix],PRE_66
je .imm32
or [.out.flags],F_IMM16
movsw
jmp .got_either_32_or_16
.imm32:
or [.out.flags],F_IMM32
movsd
.got_either_32_or_16:
lea rdi,[.out.imm8_2]
.imm16:
test bl,C_IMM16
je .imm8
or [.out.flags],F_IMM16
movsw
lea rdi,[.out.imm8_2]
.imm8:
test bl,C_IMM8
je .check_if_lock_is_valid
or [.out.flags],F_IMM8
movsb
; guess what
.check_if_lock_is_valid:
test [.out.prefix],PRE_LOCK
je .check_if_erroneous
test bl,C_MODRM
je .lock_error
cmp cl,3
je .lock_error
mov ecx,sizeof.lock_table_0F
lea rdi,[lock_table_0F]
cmp [.out.opcode],0Fh
je .search_for_opcode
and bh,0FEh
mov ecx,sizeof.lock_table
lea rdi,[lock_table]
.search_for_opcode:
cmp [rdi],bh
lea rdi,[rdi+2]
loopnz .search_for_opcode
jnz .lock_error
mov cl,[.out.modrm.reg]
mov al,[rdi-1]
inc cl
shr al,cl
jnc .check_if_erroneous
.lock_error:
or [.out.flags],F_ERROR_LOCK
; set F_ERROR_X86_64, F_RELATIVE and F_GROUP
.check_if_erroneous:
test bl,C_ERROR
je .check_if_relative
or [.out.flags],F_ERROR_X86_64
.check_if_relative:
test bl,C_REL
je .check_if_group
or [.out.flags],F_RELATIVE
.check_if_group:
test bl,C_GROUP
je .fin
or [.out.flags],F_GROUP
; finish stuff
.fin:
sub rsi,r8
mov [.out.len],sil
cmp sil,15
jb .15
or [.out.flags],F_ERROR_LENGTH
.15:
xor eax,eax
test [.out.flags],F_ERROR_OPCODE+F_ERROR_LENGTH+F_ERROR_X86_64+F_ERROR_LOCK+F_VEX_BAD_PREFIX
sete al ; return zero if any error-flag is set, otherwise nonzero
pop rdi rsi rbx
retn
; opcode table flags
C_NONE = 000h
C_MODRM = 001h
C_IMM8 = 002h
C_IMM16 = 004h
C_IMM32 = 008h
C_REL = 010h
C_GROUP = 020h
C_ERROR = 040h
; special encodings
C_MOFFS = 0FBh
C_PREFIX = 0FCh
C_0F = 0FDh
C_3BYTE = 0FEh
C_UNDEFINED = 0FFh
; opcode table obviously
opcode_table:
db C_MODRM ; 00h - add r/m8, r8
db C_MODRM ; 01h - add r/m32, r32
db C_MODRM ; 02h - add r8, r/m8
db C_MODRM ; 03h - add r32, r/m32
db C_IMM8 ; 04h - add al, imm8
db C_IMM32 ; 05h - add eax, imm32
db C_ERROR+C_NONE ; 06h - push es
db C_ERROR+C_NONE ; 07h - pop es
db C_MODRM ; 08h - or r/m8, r8
db C_MODRM ; 09h - or r/m32, r32
db C_MODRM ; 0Ah - or r8, r/m8
db C_MODRM ; 0Bh - or r32, r/m32
db C_IMM8 ; 0Ch - or al, imm8
db C_IMM32 ; 0Dh - or eax, imm32
db C_ERROR+C_NONE ; 0Eh - push cs
db C_0F ; 0Fh - escape opcode
db C_MODRM ; 10h - adc r/m8, r8
db C_MODRM ; 11h - adc r/m32, r32
db C_MODRM ; 12h - adc r8, r/m8
db C_MODRM ; 13h - adc r32, r/m32
db C_IMM8 ; 14h - adc al, imm8
db C_IMM32 ; 15h - adc eax, imm32
db C_ERROR+C_NONE ; 16h - push ss
db C_ERROR+C_NONE ; 17h - pop ss
db C_MODRM ; 18h - sbb r/m8, r8
db C_MODRM ; 19h - sbb r/m32, r32
db C_MODRM ; 1Ah - sbb r8, r/m8
db C_MODRM ; 1Bh - sbb r32, r/m32
db C_IMM8 ; 1Ch - sbb al, imm8
db C_IMM32 ; 1Dh - sbb eax, imm32
db C_ERROR+C_NONE ; 1Eh - push ds
db C_ERROR+C_NONE ; 1Fh - pop ds
db C_MODRM ; 20h - and r/m8, r8
db C_MODRM ; 21h - and r/m32, r32
db C_MODRM ; 22h - and r8, r/m8
db C_MODRM ; 23h - and r32, r/m32
db C_IMM8 ; 24h - and al, imm8
db C_IMM32 ; 25h - and eax, imm32
db C_PREFIX ; 26h - es:
db C_ERROR+C_NONE ; 27h - daa
db C_MODRM ; 28h - sub r/m8, r8
db C_MODRM ; 29h - sub r/m32, r32
db C_MODRM ; 2Ah - sub r8, r/m8
db C_MODRM ; 2Bh - sub r32, r/m32
db C_IMM8 ; 2Ch - sub al, imm8
db C_IMM32 ; 2Dh - sub eax, imm32
db C_PREFIX ; 2Eh - cs:
db C_ERROR+C_NONE ; 2Fh - das
db C_MODRM ; 30h - xor r/m8, r8
db C_MODRM ; 31h - xor r/m32, r32
db C_MODRM ; 32h - xor r8, r/m8
db C_MODRM ; 33h - xor r32, r/m32
db C_IMM8 ; 34h - xor al, imm8
db C_IMM32 ; 35h - xor eax, imm32
db C_PREFIX ; 36h - ss:
db C_ERROR+C_NONE ; 37h - aaa
db C_MODRM ; 38h - cmp r/m8, r8
db C_MODRM ; 39h - cmp r/m32, r32
db C_MODRM ; 3Ah - cmp r8, r/m8
db C_MODRM ; 3Bh - cmp r32, r/m32
db C_IMM8 ; 3Ch - cmp al, imm8
db C_IMM32 ; 3Dh - cmp eax, imm32
db C_PREFIX ; 3Eh - ds:
db C_ERROR+C_NONE ; 3Fh - aas
db C_PREFIX ; 40h - inc eax (rex-prefix under x64)
db C_PREFIX ; 41h - inc ecx (^)
db C_PREFIX ; 42h - inc edx (^)
db C_PREFIX ; 43h - inc ebx (^)
db C_PREFIX ; 44h - inc esp (^)
db C_PREFIX ; 45h - inc ebp (^)
db C_PREFIX ; 46h - inc esi (^)
db C_PREFIX ; 47h - inc edi (^)
db C_PREFIX ; 48h - dec eax (^)
db C_PREFIX ; 49h - dec ecx (^)
db C_PREFIX ; 4Ah - dec edx (^)
db C_PREFIX ; 4Bh - dec ebx (^)
db C_PREFIX ; 4Ch - dec esp (^)
db C_PREFIX ; 4Dh - dec ebp (^)
db C_PREFIX ; 4Eh - dec esi (^)
db C_PREFIX ; 4Fh - dec edi (^)
db C_NONE ; 50h - push rax
db C_NONE ; 51h - push rcx
db C_NONE ; 52h - push rdx
db C_NONE ; 53h - push rbx
db C_NONE ; 54h - push rsp
db C_NONE ; 55h - push rbp
db C_NONE ; 56h - push rsi
db C_NONE ; 57h - push rdi
db C_NONE ; 58h - pop rax
db C_NONE ; 59h - pop rcx
db C_NONE ; 5Ah - pop rdx
db C_NONE ; 5Bh - pop rbx
db C_NONE ; 5Ch - pop rsp
db C_NONE ; 5Dh - pop rbp
db C_NONE ; 5Eh - pop rsi
db C_NONE ; 5Fh - pop rdi
db C_ERROR+C_NONE ; 60h - pushad|pusha
db C_ERROR+C_NONE ; 61h - popad|popa
db C_ERROR+C_MODRM ; 62h - bound r32, m32&32
db C_MODRM ; 63h - movsxd r32, r/m32 (arpl r/m16, r16 under x86)
db C_PREFIX ; 64h - fs:
db C_PREFIX ; 65h - gs:
db C_PREFIX ; 66h - operand-size override
db C_PREFIX ; 67h - address-size override
db C_IMM32 ; 68h - push imm32
db C_MODRM+C_IMM32 ; 69h - imul r32, r/m32, imm32
db C_IMM8 ; 6Ah - push imm8
db C_MODRM+C_IMM8 ; 6Bh - imul r32, r/m32, imm8
db C_NONE ; 6Ch - insb
db C_NONE ; 6Dh - insd|insw
db C_NONE ; 6Eh - outsb
db C_NONE ; 6Fh - outsd|outsw
db C_REL+C_IMM8 ; 70h - jo rel8
db C_REL+C_IMM8 ; 71h - jno rel8
db C_REL+C_IMM8 ; 72h - jb rel8
db C_REL+C_IMM8 ; 73h - jnb rel8
db C_REL+C_IMM8 ; 74h - je rel8
db C_REL+C_IMM8 ; 75h - jnz rel8
db C_REL+C_IMM8 ; 76h - jna rel8
db C_REL+C_IMM8 ; 77h - ja rel8
db C_REL+C_IMM8 ; 78h - js rel8
db C_REL+C_IMM8 ; 79h - jns rel8
db C_REL+C_IMM8 ; 7Ah - jp rel8
db C_REL+C_IMM8 ; 7Bh - jnp rel8
db C_REL+C_IMM8 ; 7Ch - jl rel8
db C_REL+C_IMM8 ; 7Dh - jnl rel8
db C_REL+C_IMM8 ; 7Eh - jng rel8
db C_REL+C_IMM8 ; 7Fh - jg rel8
db C_GROUP+C_MODRM+C_IMM8 ; 80h - add r/m8, imm8 (also or, adc, sbb, and, sub, xor, cmp)
db C_GROUP+C_MODRM+C_IMM32 ; 81h - add r/m32, imm32 (also ^)
db C_GROUP+C_MODRM+C_IMM8 ; 82h - same as 80h (also ^)
db C_GROUP+C_MODRM+C_IMM8 ; 83h - add r/m32, imm8 (also ^)
db C_MODRM ; 84h - test r/m8, r8
db C_MODRM ; 85h - test r/m32, r32
db C_MODRM ; 86h - xchg r/m8, r8
db C_MODRM ; 87h - xchg r/m32, r32
db C_MODRM ; 88h - mov r/m8, r8
db C_MODRM ; 89h - mov r/m32, r32
db C_MODRM ; 8Ah - mov r8, r/m8
db C_MODRM ; 8Bh - mov r32, r/m32
db C_MODRM ; 8Ch - mov r/m16, Sreg
db C_MODRM ; 8Dh - lea r32, m
db C_MODRM ; 8Eh - mov Sreg, r/m16
db C_MODRM ; 8Fh - pop r/m64 (if modrm.reg is not zero, xop coding scheme is used)
db C_NONE ; 90h - xchg eax, eax aka nop [F3] pause
db C_NONE ; 91h - xchg eax, ecx
db C_NONE ; 92h - xchg eax, edx
db C_NONE ; 93h - xchg eax, ebx
db C_NONE ; 94h - xchg eax, esp
db C_NONE ; 95h - xchg eax, ebp
db C_NONE ; 96h - xchg eax, esi
db C_NONE ; 97h - xchg eax, edi
db C_NONE ; 98h - cdqe|cwde|cbw
db C_NONE ; 99h - cqo|cdq|cwd
db C_ERROR+C_IMM32+C_IMM16 ; 9Ah - call ptr16:32
db C_NONE ; 9Bh - fwait (used as prefix for fstcw, fstenv, fsave, fstsw, flcex and finit)
db C_NONE ; 9Ch - pushfq|pushfd|pushf
db C_NONE ; 9Dh - popfq|popfd|popf
db C_NONE ; 9Eh - sahf (only valid if cpuid.80000001h:ecx.lahf-sahf[bit0]=1)
db C_NONE ; 9Fh - lahf (^)
db C_MOFFS ; A0h - mov al, moffs8
db C_MOFFS ; A1h - mov eax, moffs64
db C_MOFFS ; A2h - mov moffs8, al
db C_MOFFS ; A3h - mov moffs64, eax
db C_NONE ; A4h - movsb
db C_NONE ; A5h - movsq|movsd|movsw
db C_NONE ; A6h - cmpsb
db C_NONE ; A7h - cmpsq|cmpsd|cmpsw
db C_IMM8 ; A8h - test al, imm8
db C_IMM32 ; A9h - test eax, imm32
db C_NONE ; AAh - stosb
db C_NONE ; ABh - stosq|stosd|stosw
db C_NONE ; ACh - lodsb
db C_NONE ; ADh - lodsq|lodsd|lodsw
db C_NONE ; AEh - scasb
db C_NONE ; AFh - scasq|scasd|scasw
db C_IMM8 ; B0h - mov al, imm8
db C_IMM8 ; B1h - mov cl, imm8
db C_IMM8 ; B2h - mov dl, imm8
db C_IMM8 ; B3h - mov bl, imm8
db C_IMM8 ; B4h - mov ah, imm8
db C_IMM8 ; B5h - mov ch, imm8
db C_IMM8 ; B6h - mov dh, imm8
db C_IMM8 ; B7h - mov bh, imm8
db C_IMM32 ; B8h - mov eax, imm32
db C_IMM32 ; B9h - mov ecx, imm32
db C_IMM32 ; BAh - mov edx, imm32
db C_IMM32 ; BBh - mov ebx, imm32
db C_IMM32 ; BCh - mov esp, imm32
db C_IMM32 ; BDh - mov ebp, imm32
db C_IMM32 ; BEh - mov esi, imm32
db C_IMM32 ; BFh - mov edi, imm32
db C_GROUP+C_MODRM+C_IMM8 ; C0h - rol r/m8, imm8 (also ror, rcl, rcr, shl, shr, <sal>, sar)
db C_GROUP+C_MODRM+C_IMM8 ; C1h - rol r/m32, imm8 (also ^)
db C_IMM16 ; C2h - retn imm16
db C_NONE ; C3h - retn
db C_ERROR+C_MODRM ; C4h - les r32, m16:32 (always vex-prefix under x64)
db C_ERROR+C_MODRM ; C5h - lds r32, m16:32 (^)
db C_MODRM+C_IMM8 ; C6h - mov r/m8, imm8 (modrm.reg must be zero)
db C_MODRM+C_IMM32 ; C7h - mov r/m32, imm32 (^)
db C_IMM16+C_IMM8 ; C8h - enter imm16, imm8
db C_NONE ; C9h - leave
db C_IMM16 ; CAh - retf imm16
db C_NONE ; CBh - retf
db C_NONE ; CCh - int3
db C_IMM8 ; CDh - int imm8
db C_ERROR+C_NONE ; CEh - into
db C_NONE ; CFh - iretq|iretd|iret
db C_GROUP+C_MODRM ; D0h - rol r/m8, 1 (also ror, rcl, rcr, shl, shr, <sal>, sar)
db C_GROUP+C_MODRM ; D1h - rol r/m32, 1 (also ^)
db C_GROUP+C_MODRM ; D2h - rol r/m8, cl (also ^)
db C_GROUP+C_MODRM ; D3h - rol r/m32, cl (also ^)
db C_ERROR+C_IMM8 ; D4h - aam (imm8=0Ah)
db C_ERROR+C_IMM8 ; D5h - aad (^)
db C_NONE ; D6h - salc (set al=-1 if carry flag else al=0) ; || means "or X if modrm.mod=3"
db C_NONE ; D7h - xlatb
db C_GROUP+C_MODRM ; D8h - fadd m32fp (also fmul, fcom, fcomp, fsub, fsubr, fdiv, fdivr) || fadd st0, st (also fmul, fcom, fcomp, fsub, fsubr, fdiv, fdivr)
db C_GROUP+C_MODRM ; D9h - fld m32fp (also <>, fst, fstp, fldenv m14/28byte, fldcw m2byte, fnstenv m14/28byte, fnstcw m2byte) || fld st (also fxch, {*})
db C_GROUP+C_MODRM ; DAh - fiadd m32int (also fimul, ficom, ficomp, fisub, fisubr, fidiv, fidivr) || fcmovb st0, st (also fcmove, fcmovbe, fcmovu, <>, [modrm.rm=1] fucompp, <>, <>)
db C_GROUP+C_MODRM ; DBh - fild m32int (also fisttp, fist, fistp, <>, fld m80fp, <>, fstp m80fp) || fcmovnb st0, st (also fcmovne, fcmovnbe, fcmovnu, [modrm.rm=2|3] fnclex|fninit, fucomi, fcomi)
db C_GROUP+C_MODRM ; DCh - fadd m64fp (also fmul, fcom, fcomp, fsub, fsubr, fdiv, fdivr) || fadd st, st0 (also fmul, fcom, fcomp, fsubr, fsub, fdivr, fdiv)
db C_GROUP+C_MODRM ; DDh - fld m64fp (also fisttp m64int, fst, fstp, frstor m94/108byte, <>, fnsave m94/108byte, fnstsw m2byte) || ffree st (also <>, fst, fstp, fucom, fucomp, <>, <>)
db C_GROUP+C_MODRM ; DEh - fiadd m16int (also fimul, ficom, ficomp, fisub, fisubr, fidiv, fidivr) || faddp st, st0 (also fmulp, <>, [modrm.rm=1] fcompp, fsubrp, fsubp, fdivrp, fdivp)
db C_GROUP+C_MODRM ; DFh - fild m16int (also fisttp, fist, fistp, fbld m80bcd, fild m64int, fbstp m80bcd, fistp m64int) || ffreep st (also <>, <>, <>, [modrm.rm=0] fnstsw ax, fucomip, fcomip, <>)
db C_REL+C_IMM8 ; E0h - loopnz rel8
db C_REL+C_IMM8 ; E1h - loope rel8
db C_REL+C_IMM8 ; E2h - loop rel8
db C_REL+C_IMM8 ; E3h - jecxz rel8
db C_IMM8 ; E4h - in al, imm8
db C_IMM8 ; E5h - in eax, imm8
db C_IMM8 ; E6h - out imm8, al
db C_IMM8 ; E7h - out imm8, eax
db C_REL+C_IMM32 ; E8h - call rel32
db C_REL+C_IMM32 ; E9h - jmp rel32
db C_ERROR+C_IMM32+C_IMM16 ; EAh - jmp ptr16:32
db C_REL+C_IMM8 ; EBh - jmp rel8
db C_NONE ; ECh - in al, dx
db C_NONE ; EDh - in eax, dx
db C_NONE ; EEh - out dx, al
db C_NONE ; EFh - out dx, eax
db C_PREFIX ; F0h - lock
db C_NONE ; F1h - int 1
db C_PREFIX ; F2h - repnz
db C_PREFIX ; F3h - rep
db C_NONE ; F4h - hlt
db C_NONE ; F5h - cmc
db C_GROUP+C_MODRM+C_IMM8 ; F6h - test r/m8, imm8 (also <test>, {no immediate->} not, neg, mul, imul, div, idiv)
db C_GROUP+C_MODRM+C_IMM32 ; F7h - test r/m32, imm32 (also ^)
db C_NONE ; F8h - clc
db C_NONE ; F9h - stc
db C_NONE ; FAh - cli
db C_NONE ; FBh - sti
db C_NONE ; FCh - cld
db C_NONE ; FDh - std
db C_GROUP+C_MODRM ; FEh - inc r/m8 (also dec, <>, <>, <>, <>, <>, <>)
db C_GROUP+C_MODRM ; FFh - inc r/m32 (also dec, call, call m16:32, jmp, jmp m16:32, push, <>)
;
; * fnop 11'010'000b D0
; fchs 11'100'000b E0
; fabs 11'100'001b E1
; ftst 11'100'100b E4
; fxam 11'100'101b E5
; fld1 11'101'000b E8
; fldl2t 11'101'001b E9
; fldl2e 11'101'010b EA
; fldpi 11'101'011b EB
; fldlg2 11'101'100b EC
; fldln2 11'101'101b ED
; fldz 11'101'110b EE
; f2xm1 11'110'000b F0
; fyl2x 11'110'001b F1
; fptan 11'110'010b F2
; fpatan 11'110'011b F3
; fxtract 11'110'100b F4
; fprem1 11'110'101b F5
; fdecstp 11'110'110b F6
; fincstp 11'110'111b F7
; fprem 11'111'000b F8
; fyl2xp1 11'111'001b F9
; fsqrt 11'111'010b FA
; fsincos 11'111'011b FB
; frndint 11'111'100b FC
; fscale 11'111'101b FD
; fsin 11'111'110b FE
; fcos 11'111'111b FF
; escaped opcode table
opcode_table_0F:
db C_GROUP+C_MODRM ; 00h - sldt r/m16 (also str, lldt, ltr, verr, verw, <>, <>)
db C_GROUP+C_MODRM ; 01h - sgdt m || vm* (also sidt || [modrm.rm=0|1|2|3] monitor|mwait|clac|stac, lgdt m16&64 || [modrm.rm=0|1|4|5|6] xgetbv|xsetbv|vmfunc|xend|xtest, lidt m16&64, smsw r32/m16, <>, lmsw r/m16, invlpg m || [modrm.rm=0|1] swapgs|rdtscp) *[modrm.rm=1|2|3|4] vmcall|vmlaunch|vmresume|vmxoff
db C_MODRM ; 02h - lar r32, r32/m16
db C_MODRM ; 03h - lsl r32, r32/m16
db C_UNDEFINED ; 04h
db C_NONE ; 05h - syscall
db C_NONE ; 06h - clts
db C_NONE ; 07h - sysretq|sysret
db C_NONE ; 08h - invd
db C_NONE ; 09h - wbinvd
db C_UNDEFINED ; 0Ah
db C_NONE ; 0Bh - ud2
db C_UNDEFINED ; 0Ch
db C_GROUP+C_MODRM ; 0Dh - prefetch m8 (also prefetchw, <>, <>, <>, <>, <>, <>)
db C_NONE ; 0Eh - femms
db C_MODRM+C_IMM8 ; 0Fh - 3DNow!
db C_MODRM ; 10h - movups xmm1, xmm2/m128 [66] movupd xmm1, xmm2/m128 [F2] movsd xmm1, xmm2/m64 [F3] movss xmm1, xmm2/m32
db C_MODRM ; 11h - movups xmm2/m128, xmm1 [66] movupd xmm2/m128, xmm1 [F2] movsd xmm2/m64, xmm1 [F3] movss xmm2/m32, xmm1
db C_MODRM ; 12h - movlps xmm, m64 [66] movlpd xmm, m64 [F2] movddup xmm1, xmm2/m64 [F3] movsldup xmm1, xmm2/m128 || movhlps xmm1, xmm2
db C_MODRM ; 13h - movlps m64, xmm [66] movlpd m64, xmm
db C_MODRM ; 14h - unpcklps xmm1, xmm2/m128 [66] unpcklpd xmm1, xmm2/m128
db C_MODRM ; 15h - unpckhps xmm1, xmm2/m128 [66] unpckhpd xmm1, xmm2/m128
db C_MODRM ; 16h - movhps xmm, m64 [66] movhpd xmm, m64 || movlhps xmm1, xmm2
db C_MODRM ; 17h - movhps m64, xmm [66] movhpd m64, xmm
db C_NONE ; 18h - prefetchnta m8 (also prefetcht0, prefetcht1, prefetcht2, {->} hint_nop)
db C_MODRM ; 19h - hint_nop
db C_MODRM ; 1Ah - ^
db C_MODRM ; 1Bh - ^
db C_MODRM ; 1Ch - ^
db C_MODRM ; 1Dh - ^
db C_MODRM ; 1Eh - ^
db C_MODRM ; 1Fh - nop r/m32
db C_MODRM ; 20h - mov r64, cr0-cr7
db C_MODRM ; 21h - mov r64, dr0-dr7
db C_MODRM ; 22h - mov cr0-cr7, r64
db C_MODRM ; 23h - mov dr0-dr7, r64
db C_UNDEFINED ; 24h
db C_UNDEFINED ; 25h
db C_UNDEFINED ; 26h
db C_UNDEFINED ; 27h
db C_MODRM ; 28h - movaps xmm1, xmm2/m128 [66] movapd xmm1, xmm2/m128
db C_MODRM ; 29h - movaps xmm2/m128, xmm1 [66] movapd xmm2/m128, xmm1
db C_MODRM ; 2Ah - cvtpi2ps xmm, mm/m64 [66] cvtpi2pd xmm, mm/m64 [F2] cvtsi2sd xmm, r/m32 [F3] cvtsi2ss xmm, r/m32
db C_MODRM ; 2Bh - movntps m128, xmm [66] movntpd m128, xmm
db C_MODRM ; 2Ch - cvttps2pi mm, xmm/m64 [66] cvttpd2pi mm, xmm/m128 [F2] cvttsd2si r32, xmm/m64 [F3] cvttss2si r32, xmm/m32
db C_MODRM ; 2Dh - cvtps2pi mm, xmm/m64 [66] cvtpd2pi mm, xmm/m128 [F2] cvtsd2si r32, xmm/m64 [F3] cvtss2si r32, xmm/m32
db C_MODRM ; 2Eh - ucomiss xmm1, xmm2/m32 [66] ucomisd xmm1, xmm2/m64
db C_MODRM ; 2Fh - comiss xmm1, xmm2/m32 [66] comisd xmm1, xmm2/m64
db C_NONE ; 30h - wrmsr
db C_NONE ; 31h - rdtsc
db C_NONE ; 32h - rdmsr
db C_NONE ; 33h - rdpmc
db C_NONE ; 34h - sysenter
db C_NONE ; 35h - sysexitq|sysexit
db C_UNDEFINED ; 36h
db C_NONE ; 37h - getsec ({eax=0-8->} capabilities, <>, enteraccs, exitac, senter, sexit, parameters, smctrl, wakeup)
db C_3BYTE ; 38h - 3-byte opcode
db C_UNDEFINED ; 39h
db C_3BYTE ; 3Ah - 3-byte opcode
db C_UNDEFINED ; 3Bh
db C_UNDEFINED ; 3Ch
db C_UNDEFINED ; 3Dh
db C_UNDEFINED ; 3Eh
db C_UNDEFINED ; 3Fh
db C_MODRM ; 40h - cmovo r32, r/m32
db C_MODRM ; 41h - cmovno r32, r/m32
db C_MODRM ; 42h - cmovb r32, r/m32
db C_MODRM ; 43h - cmovnb r32, r/m32
db C_MODRM ; 44h - cmove r32, r/m32
db C_MODRM ; 45h - cmovnz r32, r/m32
db C_MODRM ; 46h - cmovna r32, r/m32
db C_MODRM ; 47h - cmova r32, r/m32
db C_MODRM ; 48h - cmovs r32, r/m32
db C_MODRM ; 49h - cmovns r32, r/m32
db C_MODRM ; 4Ah - cmovpe r32, r/m32
db C_MODRM ; 4Bh - cmovpo r32, r/m32
db C_MODRM ; 4Ch - cmovl r32, r/m32
db C_MODRM ; 4Dh - cmovnl r32, r/m32
db C_MODRM ; 4Eh - cmovng r32, r/m32
db C_MODRM ; 4Fh - cmovg r32, r/m32
db C_MODRM ; 50h - movmskps r32, xmm [66] movmskpd r32, xmm
db C_MODRM ; 51h - sqrtps xmm1, xmm2/m128 [66] sqrtpd xmm1, xmm2/m128 [F2] sqrtsd xmm1, xmm2/m64 [F3] sqrtss xmm1, xmm2/m32
db C_MODRM ; 52h - rsqrtps xmm1, xmm2/m128 [F3] rsqrtss xmm1, xmm2/m32
db C_MODRM ; 53h - rcpps xmm, xmm2/m128 [F3] rcpss xmm1, xmm2/m32
db C_MODRM ; 54h - andps xmm1, xmm2/m128 [66] andpd xmm1, xmm2/m128
db C_MODRM ; 55h - andnps xmm1, xmm2/m128 [66] andnpd xmm1, xmm2/m128
db C_MODRM ; 56h - orps xmm1, xmm2/m128 [66] orpd xmm1, xmm2/m128
db C_MODRM ; 57h - xorps xmm1, xmm2/m128 [66] xorpd xmm1, xmm2/m128
db C_MODRM ; 58h - addps xmm1, xmm2/m128 [66] addpd xmm1, xmm2/m128 [F2] addsd xmm1, xmm2/m64 [F3] addss xmm1, xmm2/m32
db C_MODRM ; 59h - mulps xmm1, xmm2/m128 [66] mulpd xmm1, xmm2/m128 [F2] mulsd xmm1, xmm2/m64 [F3] mulss xmm1, xmm2/m32
db C_MODRM ; 5Ah - cvtps2pd xmm1, xmm2/64 [66] cvtpd2ps xmm1, xmm2/m128 [F2] cvtsd2ss xmm1, xmm2/m64 [F3] cvtss2sd xmm1, xmm2/m32
db C_MODRM ; 5Bh - cvtdq2ps xmm1, xmm2/m128 [66] cvtps2dq xmm1, xmm2/m128
db C_MODRM ; 5Ch - subps xmm1, xmm2/m128 [66] subpd xmm1, xmm2/m128 [F2] subsd xmm1, xmm2/m64 [F3] subss xmm1, xmm2/m32
db C_MODRM ; 5Dh - minps xmm1, xmm2/m128 [66] minpd xmm1, xmm2/m128 [F2] minsd xmm1, xmm2/m64 [F3] minss xmm1, xmm2/m32
db C_MODRM ; 5Eh - divps xmm1, xmm2/m128 [66] divpd xmm1, xmm2/m128 [F2] divsd xmm1, xmm2/m64 [F3] divss xmm1, xmm2/m32
db C_MODRM ; 5Fh - maxps xmm1, xmm2/m128 [66] maxpd xmm1, xmm2/m128 [F2] maxsd xmm1, xmm2/m64 [F3] maxss xmm1, xmm2/m32
db C_MODRM ; 60h - punpcklbw mm1, mm2/m32 [66] punpcklbw xmm1, xmm2/m128
db C_MODRM ; 61h - punpcklwd mm1, mm2/m32 [66] punpcklwd xmm1, xmm2/m128
db C_MODRM ; 62h - punpckldq mm1, mm2/m32 [66] punpckldq xmm1, xmm2/m128
db C_MODRM ; 63h - packsswb mm1, mm2/m64 [66] packsswb xmm1, xmm2/m128
db C_MODRM ; 64h - pcmpgtb mm1, mm2/m64 [66] pcmpgtb xmm1, xmm2/m128
db C_MODRM ; 65h - pcmpgtw mm1, mm2/m64 [66] pcmpgtw xmm1, xmm2/m128
db C_MODRM ; 66h - pcmpgtd mm1, mm2/m64 [66] pcmpgtd xmm1, xmm2/m128
db C_MODRM ; 67h - packuswb mm1, mm2/m64 [66] packuswb xmm1, xmm2/m128
db C_MODRM ; 68h - punpckhbw mm1, mm2/m64 [66] punpckhbw xmm1, xmm2/m128
db C_MODRM ; 69h - punpckhwd mm1, mm2/m64 [66] punpckhwd xmm1, xmm2/m128
db C_MODRM ; 6Ah - punpckhdq mm1, mm2/m64 [66] punpckhdq xmm1, xmm2/m128
db C_MODRM ; 6Bh - packssdw mm1, mm2/m64 [66] packssdw xmm1, xmm2/m128
db C_MODRM ; 6Ch -> [66] punpcklqdq xmm1, xmm2/m128
db C_MODRM ; 6Dh -> [66] punpckhqdq xmm1, xmm2/m128
db C_MODRM ; 6Eh - movq|movd mm, r/m32 [66] movq|movd xmm, r/m32
db C_MODRM ; 6Fh - movq mm1, mm2/m64 [66] movdqa xmm1, xmm2/m128 [F3] movdqu xmm1, xmm2/m128
db C_MODRM+C_IMM8 ; 70h - pshufw mm1, mm2/m64, imm8 [66] pshufd xmm1, xmm2/m128, imm8 [F2] pshuflw xmm1, xmm2/m128, imm8 [F3] pshufhw xmm1, xmm2/m128, imm8
db C_GROUP+C_MODRM+C_IMM8 ; 71h - <> mm, imm8 [66] <> xmm, imm8 (also <>, psrlw, <>, psraw, <>, psllw, <>)
db C_GROUP+C_MODRM+C_IMM8 ; 72h - <> mm, imm8 [66] <> xmm, imm8 (also <>, psrld, <>, psrad, <>, pslld, <>)
db C_GROUP+C_MODRM+C_IMM8 ; 73h - <> mm, imm8 [66] <> xmm, imm8 (also <>, psrlq, psrldq*, psraq, <>, psllq, pslldq*) *[66]-only
db C_MODRM ; 74h - pcmpeqb mm1, mm2/m64 [66] pcmpeqb mm1, mm2/m128
db C_MODRM ; 75h - pcmpeqw mm1, mm2/m64 [66] pcmpeqw mm1, mm2/m128
db C_MODRM ; 76h - pcmpeqd mm1, mm2/m64 [66] pcmpeqd mm1, mm2/m128
db C_NONE ; 77h - emms ([vex.l=128|256] vzeroupper|vzeroall)
db C_MODRM ; 78h - vmread r/m64, r64
db C_MODRM ; 79h - vmwrite r64, r/m64
db C_UNDEFINED ; 7Ah
db C_UNDEFINED ; 7Bh
db C_MODRM ; 7Ch -> [66] haddpd xmm1, xmm2/m128 [F2] haddps xmm1, xmm2/m128
db C_MODRM ; 7Dh -> [66] hsubpd xmm1, xmm2/m128 [F2] hsubps xmm1, xmm2/m128
db C_MODRM ; 7Eh - movq|movd r/m32, mm [66] movq|movd r/m32, xmm [F3] movq xmm1, xmm2/m64
db C_MODRM ; 7Fh - movq mm2/m64, mm1 [66] movdqa xmm2/m128, xmm1 [F3] movdqu xmm2/m128, xmm1
db C_REL+C_IMM32 ; 80h - jo rel32
db C_REL+C_IMM32 ; 81h - jno rel32
db C_REL+C_IMM32 ; 82h - jb rel32
db C_REL+C_IMM32 ; 83h - jnb rel32
db C_REL+C_IMM32 ; 84h - je rel32
db C_REL+C_IMM32 ; 85h - jnz rel32
db C_REL+C_IMM32 ; 86h - jna rel32
db C_REL+C_IMM32 ; 87h - ja rel32
db C_REL+C_IMM32 ; 88h - js rel32
db C_REL+C_IMM32 ; 89h - jns rel32
db C_REL+C_IMM32 ; 8Ah - jpe rel32
db C_REL+C_IMM32 ; 8Bh - jpo rel32
db C_REL+C_IMM32 ; 8Ch - jl rel32
db C_REL+C_IMM32 ; 8Dh - jnl rel32
db C_REL+C_IMM32 ; 8Eh - jng rel32
db C_REL+C_IMM32 ; 8Fh - jg rel32
db C_MODRM ; 90h - seto r/m8
db C_MODRM ; 91h - setno r/m8
db C_MODRM ; 92h - setb r/m8
db C_MODRM ; 93h - setnb r/m8
db C_MODRM ; 94h - sete r/m8
db C_MODRM ; 95h - setnz r/m8
db C_MODRM ; 96h - setna r/m8
db C_MODRM ; 97h - seta r/m8
db C_MODRM ; 98h - sets r/m8
db C_MODRM ; 99h - setns r/m8
db C_MODRM ; 9Ah - setpe r/m8
db C_MODRM ; 9Bh - setpo r/m8
db C_MODRM ; 9Ch - setl r/m8
db C_MODRM ; 9Dh - setnl r/m8
db C_MODRM ; 9Eh - setng r/m8
db C_MODRM ; 9Fh - setg r/m8
db C_NONE ; A0h - push fs
db C_NONE ; A1h - pop fs
db C_NONE ; A2h - cpuid
db C_MODRM ; A3h - bt r/m32, r32
db C_MODRM+C_IMM8 ; A4h - shld r/m32, r32, imm8
db C_MODRM ; A5h - shld r/m32, r32, cl
db C_UNDEFINED ; A6h
db C_UNDEFINED ; A7h
db C_NONE ; A8h - push gs
db C_NONE ; A9h - pop gs
db C_ERROR+C_NONE ; AAh - rsm
db C_MODRM ; ABh - bts r/m32, r32
db C_MODRM+C_IMM8 ; ACh - shrd r/m32, r32, imm8
db C_MODRM ; ADh - shrd r/m32, r32, cl
db C_GROUP+C_MODRM ; AEh - fxsave64|fxsave m512byte (also fxrstor64|fxrstor, ldmxcsr m32, stmxcsr m32, xsave64|xsave, xrstor64|xrstor, xsaveopt64|xsaveopt, clflush m8) || [F3] rdfsbase (also rdgsbase, wrfsbase, wrgsbase, <>, {no prefix->} lfence, mfence, sfence)
db C_MODRM ; AFh - imul r32, r/m32
db C_MODRM ; B0h - cmpxchg r/m8, r8
db C_MODRM ; B1h - cmpxchg r/m32, r32
db C_MODRM ; B2h - lss r32, m16:32
db C_MODRM ; B3h - btr r/m32, r32
db C_MODRM ; B4h - lfs r32, m16:32
db C_MODRM ; B5h - lgs r32, m16:32
db C_MODRM ; B6h - movzx r32, r/m8
db C_MODRM ; B7h - movzx r32, r/m16
db C_MODRM ; B8h -> [F3] popcnt r32, r/m32 (only valid if cpuid.01h:ecx.popcnt[bit23]=1)
db C_MODRM ; B9h - ud1
db C_GROUP+C_MODRM+C_IMM8 ; BAh - <> r/m32, imm8 (also <>, <>, <>, bt, bts, btr, btc)
db C_MODRM ; BBh - btc r/m32, r32
db C_MODRM ; BCh - bsf r32, r/m32 [F3] tzcnt r32, r/m32
db C_MODRM ; BDh - bsr r32, r/m32 [F3] lzcnt r32, r/m32
db C_MODRM ; BEh - movsx r32, r/m8
db C_MODRM ; BFh - movsx r32, r/m16
db C_MODRM ; C0h - xadd r/m8, r8
db C_MODRM ; C1h - xadd r/m32, r32
db C_MODRM+C_IMM8 ; C2h - cmpps xmm1, xmm2/m128, imm8 [66] cmppd xmm1, xmm2/m128, imm8 [F2] cmpsd xmm1, xmm2/m64, imm8 [F3] cmpss xmm1, xmm2/m32, imm8
db C_MODRM ; C3h - movnti m32, r32
db C_MODRM+C_IMM8 ; C4h - pinsrw mm, r32/m16, imm8 [66] pinsrw xmm, r32/m16, imm8
db C_MODRM+C_IMM8 ; C5h - pextrw r32, mm, imm8 [66] pextrw r32, xmm, imm8
db C_MODRM+C_IMM8 ; C6h - shufps xmm1, xmm2/m128, imm8 [66] shufpd xmm1, xmm2/m128, imm8
db C_GROUP+C_MODRM ; C7h - <> (also cmpxchg16b m128|cmpxchg8b m64, <>, <>, <>, <>, vmptrld m64|[66] vmclear m64|[F3] vmxon m64 || rdrand r32, vmptrst m64|[F3] vmptrst m64 || rdseed r32)
db C_NONE ; C8h - bswap eax
db C_NONE ; C9h - bswap ecx
db C_NONE ; CAh - bswap edx
db C_NONE ; CBh - bswap ebx
db C_NONE ; CCh - bswap esp
db C_NONE ; CDh - bswap ebp
db C_NONE ; CEh - bswap esi
db C_NONE ; CFh - bswap edi
db C_MODRM ; D0h -> [66] addsubpd xmm1, xmm2/m128 [F2] addsubps xmm1, xmm2/m128
db C_MODRM ; D1h - psrlw mm1, mm2/m64 [66] psrlw xmm1, xmm2/m128
db C_MODRM ; D2h - psrld mm1, mm2/m64 [66] psrld xmm1, xmm2/m128
db C_MODRM ; D3h - psrlq mm1, mm2/m64 [66] psrlq xmm1, xmm2/m128
db C_MODRM ; D4h - paddq mm1, mm2/m64 [66] paddq xmm1, xmm2/m128
db C_MODRM ; D5h - pmullw mm1, mm2/m64 [66] pmullw xmm1, xmm2/m128
db C_MODRM ; D6h -> [66] movq xmm2/m64, xmm1 [F2] movdq2q mm, xmm [F3] movq2dq xmm, mm
db C_MODRM ; D7h - pmovmskb r32, mm [66] pmovmskb r32, xmm
db C_MODRM ; D8h - psubusb mm1, mm2/m64 [66] psubusb xmm1, xmm2/m128
db C_MODRM ; D9h - psubusw mm1, mm2/m64 [66] psubusw xmm1, xmm2/m128
db C_MODRM ; DAh - pminub mm1, mm2/m64 [66] pminub xmm1, xmm2/m128
db C_MODRM ; DBh - pand mm1, mm2/m64 [66] pand xmm1, xmm2/m128
db C_MODRM ; DCh - paddusb mm1, mm2/m64 [66] paddusb xmm1, xmm2/m128
db C_MODRM ; DDh - paddusw mm1, mm2/m64 [66] paddusw xmm1, xmm2/m128
db C_MODRM ; DEh - pmaxub mm1, mm2/m64 [66] pmaxub xmm1, xmm2/m128
db C_MODRM ; DFh - pandn mm1, mm2/m64 [66] pandn xmm1, xmm2/m128
db C_MODRM ; E0h - pavgb mm1, mm2/m64 [66] pavgb xmm1, xmm2/m128
db C_MODRM ; E1h - psraw mm1, mm2/m64 [66] psraw xmm1, xmm2/m128
db C_MODRM ; E2h - psrad mm1, mm2/m64 [66] psrad xmm1, xmm2/m128
db C_MODRM ; E3h - pavgw mm1, mm2/m64 [66] pavgw xmm1, xmm2/m128
db C_MODRM ; E4h - pmulhuw mm1, mm2/m64 [66] pmulhuw xmm1, xmm2/m128
db C_MODRM ; E5h - pmulhw mm1, mm2/m64 [66] pmulhw xmm1, xmm2/m128
db C_MODRM ; E6h -> [66] cvttpd2dq xmm1, xmm2/m128 [F2] cvtpd2dq xmm1, xmm2/m128 [F3] cvtdq2pd xmm1, xmm2/m64
db C_MODRM ; E7h - movntq m64, mm [66] movntdq m128, xmm
db C_MODRM ; E8h - psubsb mm1, mm2/m64 [66] psubsb xmm1, xmm2/m128
db C_MODRM ; E9h - psubsw mm1, mm2/m64 [66] psubsw xmm1, xmm2/m128
db C_MODRM ; EAh - pminsw mm1, mm2/m64 [66] pminsw xmm1, xmm2/m128
db C_MODRM ; EBh - por mm1, mm2/m64 [66] por xmm1, xmm2/m128
db C_MODRM ; ECh - paddsb mm1, mm2/m64 [66] paddsb xmm1, xmm2/m128
db C_MODRM ; EDh - paddsw mm1, mm1/m64 [66] paddsw xmm1, xmm2/m128
db C_MODRM ; EEh - pmaxsw mm1, mm2/m64 [66] pmaxsw xmm1, xmm2/m128
db C_MODRM ; EFh - pxor mm1, mm2/m64 [66] pxor xmm1, xmm2/m128
db C_MODRM ; F0h -> [F2] lddqu xmm1, m128
db C_MODRM ; F1h - psllw mm1, mm2/m64 [66] psllw xmm1, xmm2/m128
db C_MODRM ; F2h - pslld mm1, mm2/m64 [66] pslld xmm1, xmm2/m128
db C_MODRM ; F3h - psllq mm1, mm2/m64 [66] psllq xmm1, xmm2/m128
db C_MODRM ; F4h - pmuludq mm1, mm2/m64 [66] pmuludq xmm1, xmm2/m128
db C_MODRM ; F5h - pmaddwd mm1, mm2/m64 [66] pmaddwd xmm1, xmm2/m128
db C_MODRM ; F6h - psadbw mm1, mm2/m64 [66] psadbw xmm1, xmm2/m128
db C_MODRM ; F7h - maskmovq mm1, mm2 [66] maskmovdqu xmm1, xmm2
db C_MODRM ; F8h - psubb mm1, mm2/m64 [66] psubb xmm1, xmm2/m128
db C_MODRM ; F9h - psubw mm1, mm2/m64 [66] psubw xmm1, xmm2/m128
db C_MODRM ; FAh - psubd mm1, mm2/m64 [66] psubd xmm1, xmm2/m128
db C_MODRM ; FBh - psubq mm1, mm2/m64 [66] psubq xmm1, xmm2/m128
db C_MODRM ; FCh - paddb mm1, mm2/m64 [66] paddb xmm1, xmm2/m128
db C_MODRM ; FDh - paddw mm1, mm2/m64 [66] paddw xmm1, xmm2/m128
db C_MODRM ; FEh - paddd mm1, mm2/m64 [66] paddd xmm1, xmm2/m128
db C_NONE ; FFh - ud
; 3-byte opcode table for 0F 38
opcode_table_0F_38: ; C_MODRM
db 000h ; 00h - pshufb mm1, mm2/m64 [66] pshufb xmm1, xmm2/m128
db 001h ; 01h - phaddw mm1, mm2/m64 [66] phaddw xmm1, xmm2/m128
db 002h ; 02h - phaddd mm1, mm2/m64 [66] phaddd xmm1, xmm2/m128
db 003h ; 03h - phaddsw mm1, mm2/m64 [66] phaddsw xmm1, xmm2/m128
db 004h ; 04h - pmaddubsw mm1, mm2/m64 [66] pmaddubsw xmm1, xmm2/m128
db 005h ; 05h - phsubw mm1, mm2/m64 [66] phsubw xmm1, xmm2/m128
db 006h ; 06h - phsubd mm1, mm2/m64 [66] phsubd xmm1, xmm2/m128
db 007h ; 07h - phsubsw mm1, mm2/m64 [66] phsubsw xmm1, xmm2/m128
db 008h ; 08h - psignb mm1, mm2/m64 [66] psignb xmm1, xmm2/m128
db 009h ; 09h - psignw mm1, mm2/m64 [66] psignw xmm1, xmm2/m128
db 00Ah ; 0Ah - psignd mm1, mm2/m64 [66] psignd xmm1, xmm2/m128
db 00Bh ; 0Bh - pmulhrsw mm1, mm2/m64 [66] pmulhrsw xmm1, xmm2/m128
db 010h ; 10h -> [66] pblendvb xmm1, xmm2/m128, <xmm0>
db 014h ; 14h -> [66] blendvps xmm1, xmm2/m128, <xmm0>
db 015h ; 15h -> [66] blendvpd xmm1, xmm2/m128, <xmm0>
db 017h ; 17h -> [66] ptest xmm1, xmm2/m128
db 01Ch ; 1Ch - pabsb mm1, mm2/m64 [66] pabsb xmm1, xmm2/m128
db 01Dh ; 1Dh - pabsw mm1, mm2/m64 [66] pabsw xmm1, xmm2/m128
db 01Eh ; 1Eh - pabsd mm1, mm2/m64 [66] pabsd xmm1, xmm2/m128
db 020h ; 20h -> [66] pmovsxbw xmm1, xmm2/m64
db 021h ; 21h -> [66] pmovsxbd xmm1, xmm2/m32
db 022h ; 22h -> [66] pmovsxbq xmm1, xmm2/m16
db 023h ; 23h -> [66] pmovsxwd xmm1, xmm2/m64
db 024h ; 24h -> [66] pmovsxwq xmm1, xmm2/m32
db 025h ; 25h -> [66] pmovsxdq xmm1, xmm2/m64
db 028h ; 28h -> [66] pmuldq xmm1, xmm2/m128
db 029h ; 29h -> [66] pcmpeqq xmm1, xmm2/m128
db 02Ah ; 2Ah -> [66] movntdqa xmm1, m128
db 02Bh ; 2Bh -> [66] packusdw xmm1, xmm2/m128
db 030h ; 30h -> [66] pmovzxbw xmm1, xmm2/m64
db 031h ; 31h -> [66] pmovzxbd xmm1, xmm2/m32
db 032h ; 32h -> [66] pmovzxbq xmm1, xmm2/m16
db 033h ; 33h -> [66] pmovzxwd xmm1, xmm2/m64
db 034h ; 34h -> [66] pmovzxwq xmm1, xmm2/m32
db 035h ; 35h -> [66] pmovzxdq xmm1, xmm2/m64
db 037h ; 37h -> [66] pcmpgtq xmm1, xmm2/m128
db 038h ; 38h -> [66] pminsb xmm1, xmm2/m128
db 039h ; 39h -> [66] pminsd xmm1, xmm2/m128
db 03Ah ; 3Ah -> [66] pminuw xmm1, xmm2/m128
db 03Bh ; 3Bh -> [66] pminud xmm1, xmm2/m128
db 03Ch ; 3Ch -> [66] pmaxsb xmm1, xmm2/m128
db 03Dh ; 3Dh -> [66] pmaxsd xmm1, xmm2/m128
db 03Eh ; 3Eh -> [66] pmaxuw xmm1, xmm2/m128
db 03Fh ; 3Fh -> [66] pmaxud xmm1, xmm2/m128
db 040h ; 40h -> [66] pmulld xmm1, xmm2/m128
db 041h ; 41h -> [66] phminposuw xmm1, xmm2/m128
db 080h ; 80h -> [66] invept r64, m128
db 081h ; 81h -> [66] invvpid r64, m128
db 082h ; 82h -> [66] invpcid r64, m128
db 0DBh ; DBh -> [66] aesimc xmm1, xmm2/m128
db 0DCh ; DCh -> [66] aesenc xmm1, xmm2/m128
db 0DDh ; DDh -> [66] aesenclast xmm1, xmm2/m128
db 0DEh ; DEh -> [66] aesdec xmm1, xmm2/m128
db 0DFh ; DFh -> [66] aesdeclast xmm1, xmm2/m128
db 0F0h ; F0h - movbe r32, m32 [F2] crc32 r32, r/m8
db 0F1h ; F1h - movbe m32, r32 [F2] crc32 r32, r/m32
sizeof.opcode_table_0F_38 = $-opcode_table_0F_38
db 00Ch ; 0Ch -> [66] vpermilps xmm1, xmm2, xmm3/m128
db 00Dh ; 0Dh -> [66] vpermilpd xmm1, xmm2, xmm3/m128
db 00Eh ; 0Eh -> [66] vtestps xmm1, xmm2/m128
db 00Fh ; 0Fh -> [66] vtestpd xmm1, xmm2/m128
db 018h ; 18h -> [66] vbroadcastss xmm1, m32
db 019h ; 19h -> [66] vbroadcastsd xmm1, m64
db 01Ah ; 1Ah -> [66] vbroadcastf128 ymm1, m128
db 02Ch ; 2Ch -> [66] vmaskmovps xmm1, xmm2, m128
db 02Dh ; 2Dh -> [66] vmaskmovpd xmm1, xmm2, m128
db 02Eh ; 2Eh -> [66] vmaskmovps m128, xmm1, xmm2
db 02Fh ; 2Fh -> [66] vmaskmovpd m128, xmm1, xmm2
sizeof.opcode_table_0F_38_V = $-opcode_table_0F_38
; 3-byte opcode table for 0F 3A
opcode_table_0F_3A: ; C_MODRM+C_IMM8
db 008h ; 08h -> [66] roundps xmm1, xmm2/m128, imm8
db 009h ; 09h -> [66] roundpd xmm1, xmm2/m128, imm8
db 00Ah ; 0Ah -> [66] roundss xmm1, xmm2/m128, imm8
db 00Bh ; 0Bh -> [66] roundsd xmm1, xmm2/m128, imm8
db 00Ch ; 0Ch -> [66] blendps xmm1, xmm2/m128, imm8
db 00Dh ; 0Dh -> [66] blendpd xmm1, xmm2/m128, imm8
db 00Eh ; 0Eh -> [66] pblendw xmm1, xmm2/m128, imm8
db 00Fh ; 0Fh - palignr mm1, mm2/m64, imm8 [66] palignr xmm1, xmm2/m128, imm8
db 014h ; 14h -> [66] pextrb r32/m8, xmm2, imm8
db 015h ; 15h -> [66] pextrw r32/m16, xmm2, imm8
db 016h ; 16h -> [66] pextrd r32/m32, xmm2, imm8
db 017h ; 17h -> [66] extractps r32/m32, xmm2, imm8
db 020h ; 20h -> [66] pinsrb xmm1, r32/m8, imm8
db 021h ; 21h -> [66] insertps xmm1, xmm2/m32, imm8
db 022h ; 22h -> [66] pinsrd xmm1, r/m32, imm8
db 040h ; 40h -> [66] dpps xmm1, xmm2/m128, imm8
db 041h ; 41h -> [66] dppd xmm1, xmm2/m128, imm8
db 042h ; 42h -> [66] mpsadbw xmm1, xmm2/m128, imm8
db 044h ; 44h -> [66] pclmulqdq xmm1, xmm2/m128, imm8
db 060h ; 60h -> [66] pcmpestrm xmm1, xmm2/m128, imm8
db 061h ; 61h -> [66] pcmpestri xmm1, xmm2/m128, imm8
db 062h ; 62h -> [66] pcmpistrm xmm1, xmm2/m128, imm8
db 063h ; 63h -> [66] pcmpistri xmm1, xmm2/m128, imm8
db 0DFh ; DFh -> [66] aeskeygenassist xmm1, xmm2/m128, imm8
sizeof.opcode_table_0F_3A = $-opcode_table_0F_3A
db 004h ; 04h -> [66] vpermilps xmm1, xmm2/m128, imm8
db 005h ; 05h -> [66] vpermilpd xmm1, xmm2/m128, imm8
db 006h ; 06h -> [66] vperm2f128 ymm1, ymm2, ymm3/m256, imm8
db 018h ; 18h -> [66] vinsertf128 ymm1, ymm2, xmm3/m128, imm8
db 019h ; 19h -> [66] vextractf128 xmm1/m128, ymm2, imm8
db 04Ah ; 4Ah -> [66] vblendvps xmm1, xmm2, xmm3/m128, xmm4
db 04Bh ; 4Bh -> [66] vblendvpd xmm1, xmm2, xmm3/m128, xmm4
db 04Ch ; 4Ch -> [66] vpblendvb xmm1, xmm2, xmm3/m128, xmm4
sizeof.opcode_table_0F_3A_V = $-opcode_table_0F_3A
; opcodes with possible LOCK-prefix
lock_table:
db 000h, 0 ; add
db 008h, 0 ; or
db 010h, 0 ; adc
db 018h, 0 ; sbb
db 020h, 0 ; and
db 028h, 0 ; sub
db 030h, 0 ; xor
db 080h, 10000000b ; add|or|adc|sbb|and|sub|xor reg=0-6
db 082h, 10000000b ; ^
db 086h, 0 ; xchg
db 0F6h, 11110011b ; not|neg reg=2|3
db 0FEh, 11111100b ; inc|dec reg=0|1
sizeof.lock_table = $-lock_table
; escaped opcodes with possible LOCK-prefix
lock_table_0F:
db 0ABh, 0 ; bts
db 0B0h, 0 ; cmpxchg
db 0B1h, 0 ; ^
db 0B3h, 0 ; btr
db 0BAh, 00011111b ; bts|btr|btc reg=5-7
db 0BBh, 0 ; btc
db 0C0h, 0 ; xadd
db 0C1h, 0 ; ^
db 0C7h, 11111101b ; cmpxchg16b|cmpxchg8b reg=1
sizeof.lock_table_0F = $-lock_table_0F
| xwanderer/fde64 | decode.asm | Assembly | bsd-2-clause | 44,006 |
; Copyright (c) 2004, Intel Corporation
; All rights reserved. This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at
; http://opensource.org/licenses/bsd-license.php
;
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
;
; Module Name:
;
; WriteMm0.Asm
;
; Abstract:
;
; AsmWriteMm0 function
;
; Notes:
;
;------------------------------------------------------------------------------
.code
;------------------------------------------------------------------------------
; VOID
; EFIAPI
; AsmWriteMm0 (
; IN UINT64 Value
; );
;------------------------------------------------------------------------------
AsmWriteMm0 PROC
;
; 64-bit MASM doesn't support MMX instructions, so use opcode here
;
DB 48h, 0fh, 6eh, 0c1h
ret
AsmWriteMm0 ENDP
END
| tianocore/edk | Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm0.asm | Assembly | bsd-3-clause | 1,308 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Copyright(c) 2011-2015 Intel Corporation All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions
; are met:
; * Redistributions of source code must retain the above copyright
; notice, this list of conditions and the following disclaimer.
; * Redistributions in binary form must reproduce the above copyright
; notice, this list of conditions and the following disclaimer in
; the documentation and/or other materials provided with the
; distribution.
; * Neither the name of Intel Corporation nor the names of its
; contributors may be used to endorse or promote products derived
; from this software without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; gf_4vect_dot_prod_avx2(len, vec, *g_tbls, **buffs, **dests);
;;;
%ifidn __OUTPUT_FORMAT__, elf64
%define arg0 rdi
%define arg1 rsi
%define arg2 rdx
%define arg3 rcx
%define arg4 r8
%define arg5 r9
%define tmp r11
%define tmp.w r11d
%define tmp.b r11b
%define tmp2 r10
%define tmp3 r13 ; must be saved and restored
%define tmp4 r12 ; must be saved and restored
%define tmp5 r14 ; must be saved and restored
%define tmp6 r15 ; must be saved and restored
%define return rax
%macro SLDR 2
%endmacro
%define SSTR SLDR
%define PS 8
%define LOG_PS 3
%define func(x) x:
%macro FUNC_SAVE 0
push r12
push r13
push r14
push r15
%endmacro
%macro FUNC_RESTORE 0
pop r15
pop r14
pop r13
pop r12
%endmacro
%endif
%ifidn __OUTPUT_FORMAT__, macho64
%define arg0 rdi
%define arg1 rsi
%define arg2 rdx
%define arg3 rcx
%define arg4 r8
%define arg5 r9
%define tmp r11
%define tmp.w r11d
%define tmp.b r11b
%define tmp2 r10
%define tmp3 r13 ; must be saved and restored
%define tmp4 r12 ; must be saved and restored
%define tmp5 r14 ; must be saved and restored
%define tmp6 r15 ; must be saved and restored
%define return rax
%macro SLDR 2
%endmacro
%define SSTR SLDR
%define PS 8
%define LOG_PS 3
%define func(x) x:
%macro FUNC_SAVE 0
push r12
push r13
push r14
push r15
%endmacro
%macro FUNC_RESTORE 0
pop r15
pop r14
pop r13
pop r12
%endmacro
%endif
%ifidn __OUTPUT_FORMAT__, win64
%define arg0 rcx
%define arg1 rdx
%define arg2 r8
%define arg3 r9
%define arg4 r12 ; must be saved, loaded and restored
%define arg5 r15 ; must be saved and restored
%define tmp r11
%define tmp.w r11d
%define tmp.b r11b
%define tmp2 r10
%define tmp3 r13 ; must be saved and restored
%define tmp4 r14 ; must be saved and restored
%define tmp5 rdi ; must be saved and restored
%define tmp6 rsi ; must be saved and restored
%define return rax
%macro SLDR 2
%endmacro
%define SSTR SLDR
%define PS 8
%define LOG_PS 3
%define stack_size 9*16 + 7*8 ; must be an odd multiple of 8
%define arg(x) [rsp + stack_size + PS + PS*x]
%define func(x) proc_frame x
%macro FUNC_SAVE 0
alloc_stack stack_size
vmovdqa [rsp + 0*16], xmm6
vmovdqa [rsp + 1*16], xmm7
vmovdqa [rsp + 2*16], xmm8
vmovdqa [rsp + 3*16], xmm9
vmovdqa [rsp + 4*16], xmm10
vmovdqa [rsp + 5*16], xmm11
vmovdqa [rsp + 6*16], xmm12
vmovdqa [rsp + 7*16], xmm13
vmovdqa [rsp + 8*16], xmm14
save_reg r12, 9*16 + 0*8
save_reg r13, 9*16 + 1*8
save_reg r14, 9*16 + 2*8
save_reg r15, 9*16 + 3*8
save_reg rdi, 9*16 + 4*8
save_reg rsi, 9*16 + 5*8
end_prolog
mov arg4, arg(4)
%endmacro
%macro FUNC_RESTORE 0
vmovdqa xmm6, [rsp + 0*16]
vmovdqa xmm7, [rsp + 1*16]
vmovdqa xmm8, [rsp + 2*16]
vmovdqa xmm9, [rsp + 3*16]
vmovdqa xmm10, [rsp + 4*16]
vmovdqa xmm11, [rsp + 5*16]
vmovdqa xmm12, [rsp + 6*16]
vmovdqa xmm13, [rsp + 7*16]
vmovdqa xmm14, [rsp + 8*16]
mov r12, [rsp + 9*16 + 0*8]
mov r13, [rsp + 9*16 + 1*8]
mov r14, [rsp + 9*16 + 2*8]
mov r15, [rsp + 9*16 + 3*8]
mov rdi, [rsp + 9*16 + 4*8]
mov rsi, [rsp + 9*16 + 5*8]
add rsp, stack_size
%endmacro
%endif
%ifidn __OUTPUT_FORMAT__, elf32
;;;================== High Address;
;;; arg4
;;; arg3
;;; arg2
;;; arg1
;;; arg0
;;; return
;;;<================= esp of caller
;;; ebp
;;;<================= ebp = esp
;;; var0
;;; var1
;;; var2
;;; var3
;;; esi
;;; edi
;;; ebx
;;;<================= esp of callee
;;;
;;;================== Low Address;
%define PS 4
%define LOG_PS 2
%define func(x) x:
%define arg(x) [ebp + PS*2 + PS*x]
%define var(x) [ebp - PS - PS*x]
%define trans ecx
%define trans2 esi
%define arg0 trans ;trans and trans2 are for the variables in stack
%define arg0_m arg(0)
%define arg1 ebx
%define arg2 arg2_m
%define arg2_m arg(2)
%define arg3 trans
%define arg3_m arg(3)
%define arg4 trans
%define arg4_m arg(4)
%define arg5 trans2
%define tmp edx
%define tmp.w edx
%define tmp.b dl
%define tmp2 edi
%define tmp3 trans2
%define tmp3_m var(0)
%define tmp4 trans2
%define tmp4_m var(1)
%define tmp5 trans2
%define tmp5_m var(2)
%define tmp6 trans2
%define tmp6_m var(3)
%define return eax
%macro SLDR 2 ;stack load/restore
mov %1, %2
%endmacro
%define SSTR SLDR
%macro FUNC_SAVE 0
push ebp
mov ebp, esp
sub esp, PS*4 ;4 local variables
push esi
push edi
push ebx
mov arg1, arg(1)
%endmacro
%macro FUNC_RESTORE 0
pop ebx
pop edi
pop esi
add esp, PS*4 ;4 local variables
pop ebp
%endmacro
%endif ; output formats
%define len arg0
%define vec arg1
%define mul_array arg2
%define src arg3
%define dest1 arg4
%define ptr arg5
%define vec_i tmp2
%define dest2 tmp3
%define dest3 tmp4
%define dest4 tmp5
%define vskip3 tmp6
%define pos return
%ifidn PS,4 ;32-bit code
%define len_m arg0_m
%define src_m arg3_m
%define dest1_m arg4_m
%define dest2_m tmp3_m
%define dest3_m tmp4_m
%define dest4_m tmp5_m
%define vskip3_m tmp6_m
%endif
%ifndef EC_ALIGNED_ADDR
;;; Use Un-aligned load/store
%define XLDR vmovdqu
%define XSTR vmovdqu
%else
;;; Use Non-temporal load/stor
%ifdef NO_NT_LDST
%define XLDR vmovdqa
%define XSTR vmovdqa
%else
%define XLDR vmovntdqa
%define XSTR vmovntdq
%endif
%endif
%ifidn PS,8 ;64-bit code
default rel
[bits 64]
%endif
section .text
%ifidn PS,8 ;64-bit code
%define xmask0f ymm14
%define xmask0fx xmm14
%define xgft1_lo ymm13
%define xgft1_hi ymm12
%define xgft2_lo ymm11
%define xgft2_hi ymm10
%define xgft3_lo ymm9
%define xgft3_hi ymm8
%define xgft4_lo ymm7
%define xgft4_hi ymm6
%define x0 ymm0
%define xtmpa ymm1
%define xp1 ymm2
%define xp2 ymm3
%define xp3 ymm4
%define xp4 ymm5
%else
%define ymm_trans ymm7 ;reuse xmask0f and xgft1_hi
%define xmask0f ymm_trans
%define xmask0fx xmm7
%define xgft1_lo ymm6
%define xgft1_hi ymm_trans
%define xgft2_lo xgft1_lo
%define xgft2_hi xgft1_hi
%define xgft3_lo xgft1_lo
%define xgft3_hi xgft1_hi
%define xgft4_lo xgft1_lo
%define xgft4_hi xgft1_hi
%define x0 ymm0
%define xtmpa ymm1
%define xp1 ymm2
%define xp2 ymm3
%define xp3 ymm4
%define xp4 ymm5
%endif
align 16
global gf_4vect_dot_prod_avx2:function
func(gf_4vect_dot_prod_avx2)
FUNC_SAVE
SLDR len, len_m
sub len, 32
SSTR len_m, len
jl .return_fail
xor pos, pos
mov tmp.b, 0x0f
vpinsrb xmask0fx, xmask0fx, tmp.w, 0
vpbroadcastb xmask0f, xmask0fx ;Construct mask 0x0f0f0f...
mov vskip3, vec
imul vskip3, 96
SSTR vskip3_m, vskip3
sal vec, LOG_PS ;vec *= PS. Make vec_i count by PS
SLDR dest1, dest1_m
mov dest2, [dest1+PS]
SSTR dest2_m, dest2
mov dest3, [dest1+2*PS]
SSTR dest3_m, dest3
mov dest4, [dest1+3*PS]
SSTR dest4_m, dest4
mov dest1, [dest1]
SSTR dest1_m, dest1
.loop32:
vpxor xp1, xp1
vpxor xp2, xp2
vpxor xp3, xp3
vpxor xp4, xp4
mov tmp, mul_array
xor vec_i, vec_i
.next_vect:
SLDR src, src_m
mov ptr, [src+vec_i]
XLDR x0, [ptr+pos] ;Get next source vector
add vec_i, PS
%ifidn PS,8 ;64-bit code
vpand xgft4_lo, x0, xmask0f ;Mask low src nibble in bits 4-0
vpsraw x0, x0, 4 ;Shift to put high nibble into bits 4-0
vpand x0, x0, xmask0f ;Mask high src nibble in bits 4-0
vperm2i128 xtmpa, xgft4_lo, x0, 0x30 ;swap xtmpa from 1lo|2lo to 1lo|2hi
vperm2i128 x0, xgft4_lo, x0, 0x12 ;swap x0 from 1hi|2hi to 1hi|2lo
vmovdqu xgft1_lo, [tmp] ;Load array Ax{00}, Ax{01}, ..., Ax{0f}
; " Ax{00}, Ax{10}, ..., Ax{f0}
vmovdqu xgft2_lo, [tmp+vec*(32/PS)] ;Load array Bx{00}, Bx{01}, ..., Bx{0f}
; " Bx{00}, Bx{10}, ..., Bx{f0}
vmovdqu xgft3_lo, [tmp+vec*(64/PS)] ;Load array Cx{00}, Cx{01}, ..., Cx{0f}
; " Cx{00}, Cx{10}, ..., Cx{f0}
vmovdqu xgft4_lo, [tmp+vskip3] ;Load array Dx{00}, Dx{01}, ..., Dx{0f}
; " Dx{00}, Dx{10}, ..., Dx{f0}
vperm2i128 xgft1_hi, xgft1_lo, xgft1_lo, 0x01 ; swapped to hi | lo
vperm2i128 xgft2_hi, xgft2_lo, xgft2_lo, 0x01 ; swapped to hi | lo
vperm2i128 xgft3_hi, xgft3_lo, xgft3_lo, 0x01 ; swapped to hi | lo
vperm2i128 xgft4_hi, xgft4_lo, xgft4_lo, 0x01 ; swapped to hi | lo
add tmp, 32
%else ;32-bit code
mov cl, 0x0f ;use ecx as a temp variable
vpinsrb xmask0fx, xmask0fx, ecx, 0
vpbroadcastb xmask0f, xmask0fx ;Construct mask 0x0f0f0f...
vpand xgft4_lo, x0, xmask0f ;Mask low src nibble in bits 4-0
vpsraw x0, x0, 4 ;Shift to put high nibble into bits 4-0
vpand x0, x0, xmask0f ;Mask high src nibble in bits 4-0
vperm2i128 xtmpa, xgft4_lo, x0, 0x30 ;swap xtmpa from 1lo|2lo to 1lo|2hi
vperm2i128 x0, xgft4_lo, x0, 0x12 ;swap x0 from 1hi|2hi to 1hi|2lo
vmovdqu xgft1_lo, [tmp] ;Load array Ax{00}, Ax{01}, ..., Ax{0f}
; " Ax{00}, Ax{10}, ..., Ax{f0}
vperm2i128 xgft1_hi, xgft1_lo, xgft1_lo, 0x01 ; swapped to hi | lo
%endif
vpshufb xgft1_hi, x0 ;Lookup mul table of high nibble
vpshufb xgft1_lo, xtmpa ;Lookup mul table of low nibble
vpxor xgft1_hi, xgft1_lo ;GF add high and low partials
vpxor xp1, xgft1_hi ;xp1 += partial
%ifidn PS,4 ; 32-bit code
vmovdqu xgft2_lo, [tmp+vec*(32/PS)] ;Load array Bx{00}, Bx{01}, ..., Bx{0f}
; " Bx{00}, Bx{10}, ..., Bx{f0}
vperm2i128 xgft2_hi, xgft2_lo, xgft2_lo, 0x01 ; swapped to hi | lo
%endif
vpshufb xgft2_hi, x0 ;Lookup mul table of high nibble
vpshufb xgft2_lo, xtmpa ;Lookup mul table of low nibble
vpxor xgft2_hi, xgft2_lo ;GF add high and low partials
vpxor xp2, xgft2_hi ;xp2 += partial
%ifidn PS,4 ; 32-bit code
sal vec, 1
vmovdqu xgft3_lo, [tmp+vec*(32/PS)] ;Load array Cx{00}, Cx{01}, ..., Cx{0f}
; " Cx{00}, Cx{10}, ..., Cx{f0}
vperm2i128 xgft3_hi, xgft3_lo, xgft3_lo, 0x01 ; swapped to hi | lo
sar vec, 1
%endif
vpshufb xgft3_hi, x0 ;Lookup mul table of high nibble
vpshufb xgft3_lo, xtmpa ;Lookup mul table of low nibble
vpxor xgft3_hi, xgft3_lo ;GF add high and low partials
vpxor xp3, xgft3_hi ;xp3 += partial
%ifidn PS,4 ; 32-bit code
SLDR vskip3, vskip3_m
vmovdqu xgft4_lo, [tmp+vskip3] ;Load array Dx{00}, Dx{01}, ..., Dx{0f}
; " DX{00}, Dx{10}, ..., Dx{f0}
vperm2i128 xgft4_hi, xgft4_lo, xgft4_lo, 0x01 ; swapped to hi | lo
add tmp, 32
%endif
vpshufb xgft4_hi, x0 ;Lookup mul table of high nibble
vpshufb xgft4_lo, xtmpa ;Lookup mul table of low nibble
vpxor xgft4_hi, xgft4_lo ;GF add high and low partials
vpxor xp4, xgft4_hi ;xp4 += partial
cmp vec_i, vec
jl .next_vect
SLDR dest1, dest1_m
SLDR dest2, dest2_m
XSTR [dest1+pos], xp1
XSTR [dest2+pos], xp2
SLDR dest3, dest3_m
XSTR [dest3+pos], xp3
SLDR dest4, dest4_m
XSTR [dest4+pos], xp4
SLDR len, len_m
add pos, 32 ;Loop on 32 bytes at a time
cmp pos, len
jle .loop32
lea tmp, [len + 32]
cmp pos, tmp
je .return_pass
;; Tail len
mov pos, len ;Overlapped offset length-32
jmp .loop32 ;Do one more overlap pass
.return_pass:
mov return, 0
FUNC_RESTORE
ret
.return_fail:
mov return, 1
FUNC_RESTORE
ret
endproc_frame
section .data
%macro slversion 4
global %1_slver_%2%3%4
global %1_slver
%1_slver:
%1_slver_%2%3%4:
dw 0x%4
db 0x%3, 0x%2
%endmacro
;;; func core, ver, snum
slversion gf_4vect_dot_prod_avx2, 04, 04, 0198
| abperiasamy/minio-xl | pkg/erasure/gf_4vect_dot_prod_avx2.asm | Assembly | apache-2.0 | 13,034 |
;*******************************************************************************
; @INSTITUTION
; University of Sao Paulo | Sao Carlos School of Engineering | SEL
;------------------------------------------------------------------------------
; @DISCIPLINE
; Name: SEL0433 | Applications of Microprocessors I
; Professor: Evandro Luis Linhari Rodrigues
; Semester: 2017\01
;------------------------------------------------------------------------------
; @DEVELOPMENT
; MCU: Intel 8052
; IDE: MCU 8051 v1.5.7
; Compiler: IDE native assembler
;------------------------------------------------------------------------------
; @WARRANTY
; Copyright (c) 2017 Andre Marcos Perez
; The software is provided by "as is", without warranty of any kind, express or
; implied, including but not limited to the warranties of merchantability,
; fitness for a particular purpose and noninfringement. In no event shall the
; authors or copyright holders be liable for any claim, damages or other
; liability, whether in an action of contract, tort or otherwise, arising from,
; out of or in connection with the software or the use or other dealings in the
; software.
;------------------------------------------------------------------------------
; @EXERCISE
; List: #2
; Ex. : #4
;------------------------------------------------------------------------------
; @AUTHOR
; Name: Andre Marcos Perez
; Email: andre.marcos.perez@usp.br
; #USP: 8006891
;*******************************************************************************
;*******************************************************************************
; @CONSTANT
; Code's constants
;------------------------------------------------------------------------------
STRING_TERMINATOR EQU '$'
;*******************************************************************************
;*******************************************************************************
; @VARIABLE
; Code's variables
;------------------------------------------------------------------------------
STRING_MSG EQU 30H
STRING_STR EQU 48H
MSG1_SIZE EQU 60H
MSG2_SIZE EQU 61H
STR1_SIZE EQU 62H
STR2_SIZE EQU 63H
;*******************************************************************************
;*******************************************************************************
; @CODE
; Main code
;------------------------------------------------------------------------------
ORG 0
MOV R0,#STRING_MSG
MOV R1,#MSG1_SIZE
MOV DPTR,#MSG1
LCALL READ_STRING
MOV R0,#STRING_STR
MOV R1,#STR1_SIZE
MOV DPTR,#STR1
LCALL READ_STRING
MOV R4,#STRING_MSG
MOV R5,#MSG1_SIZE
MOV R6,#STRING_STR
MOV R7,#STR1_SIZE
LCALL EQUALS
SETB P1.0
JB F0,MSG1_EQUALS_STR1
CLR P1.0
MSG1_EQUALS_STR1:
MOV R0,#STRING_MSG
MOV R1,#MSG2_SIZE
MOV DPTR,#MSG2
LCALL READ_STRING
MOV R0,#STRING_STR
MOV R1,#STR2_SIZE
MOV DPTR,#STR2
LCALL READ_STRING
MOV R4,#STRING_MSG
MOV R5,#MSG2_SIZE
MOV R6,#STRING_STR
MOV R7,#STR2_SIZE
LCALL EQUALS
SETB P1.7
JB F0,MSG2_EQUALS_STR2
CLR P1.7
MSG2_EQUALS_STR2:
SJMP $
MSG1: DB 'WRONG_STRING','$'
MSG2: DB 'WRONG_STRING',24h
STR1: DB 'MCU8051','$'
STR2: DB 'SEL0433-2017',24h
;*******************************************************************************
;*******************************************************************************
; @ROUTINE
; READ_STRING
;------------------------------------------------------------------------------
; @Description
; Moves sequence os characters stored on the rom address pointed by DPTR to the
; internal ram address pointed by R0. Also, stores its size on the internal ram
; address pointed by R1.
;------------------------------------------------------------------------------
; @Precondition
; STRING_TERMINATOR: The string terminator must be defined on this constant.
;------------------------------------------------------------------------------
; @Param
; DPTR: Pointer for the rom address where the string's first character is stored
; R0 : Pointer for the internal ram address where the string's first character
; will be stored
; R1 : Pointer for the internal ram address where the string size will be stored
;------------------------------------------------------------------------------
; @Returns
; Void
;------------------------------------------------------------------------------
READ_STRING:
CLR A
MOVC A,@A+DPTR
MOV @R0,A
INC DPTR
INC R0
INC @R1
CJNE A,#STRING_TERMINATOR,READ_STRING
RET
;*******************************************************************************
;*******************************************************************************
; @ROUTINE
; EQUALS
;------------------------------------------------------------------------------
; @Description
; Compares a strings with a reference string and returns whether they are equal
; or not.
;------------------------------------------------------------------------------
; @Precondition
; R0: Must be free to be used
; R1: Must be free to be used
; F0: Must be free to be used
;------------------------------------------------------------------------------
; @Param
; R4: The internal ram address of the first character of the string to be compared
; R5: The size of the string to be compared
; R6: The internal ram address of the first character of the reference string
; R7: The size of the reference string
;------------------------------------------------------------------------------
; @Returns
; F0: Returns 1 if the string is equal to the reference string, otherwise,
; returns 0
;------------------------------------------------------------------------------
EQUALS:
MOV A,R5
MOV R0,A
MOV A,R7
MOV R1,A
MOV A,@R0
SUBB A,@R1
CJNE A,#00H,STRINGS_ARENT_EQUAL
SETB F0
MOV A,R4
MOV R0,A
MOV A,R6
MOV R1,A
LOOP: CLR C
MOV A,@R0
SUBB A,@R1
CJNE A,#00H,STRINGS_ARENT_EQUAL
MOV A,@R0
INC R0
INC R1
CJNE A,#STRING_TERMINATOR,LOOP
RET
STRINGS_ARENT_EQUAL:
CLR F0
RET
;*******************************************************************************
END
| andreMarcosPerez/SEL0433_microprocessorAplications | List_2/exercise4.asm | Assembly | mit | 6,014 |
;================================================================================
; Spawn Zelda (or not)
;--------------------------------------------------------------------------------
SpawnZelda:
LDA.l $7EF3CC : CMP #$08 : BEQ + ; don't spawn if dwarf is present
CMP #$07 : BEQ + ; don't spawn if frog is present
CMP #$0C : BEQ + ; don't spawn if purple chest is present
CLC : RTL
+
SEC
RTL
;--------------------------------------------------------------------------------
EndRainState:
LDA $7EF3C5 : CMP.b #$02 : !BGE + ; skip if past escape already
LDA.b #$00 : STA !INFINITE_ARROWS : STA !INFINITE_BOMBS : STA !INFINITE_MAGIC
LDA.b #$02 : STA $7EF3C5 ; end rain state
+
RTL
;--------------------------------------------------------------------------------
| mmxbass/z3randomizer | zelda.asm | Assembly | mit | 775 |
.MODEL SMALL
.STACK 100H
.CODE
MAIN PROC
CALL INDEC
PUSH AX
MOV AH,2
MOV DL,0DH
INT 21H
MOV DL,0AH
INT 21H
POP AX
CALL OUTDEC
MOV AH, 4CH
INT 21H
MAIN ENDP
INCLUDE outdec.asm
INCLUDE indec.asm
END MAIN
| nasim-aust/AUST_CSE_2214_ASSEMBLY_LAB | Input-output with indec outdec/mycode.asm | Assembly | mit | 266 |
aseg
org 3000h
aMayuscula macro letra
ld (aux), A
ld A, letra
cp 'a'
jp M, paso
cp 'z'+1
jp P, paso
add A,'A'-'a'
ld letra, A
paso: ld A, (aux)
jr aux+1
aux: ds 1
endm
start: ld IX, cadena
ld B, largo+1
jp djnz1
ciclo: aMayuscula (IX)
inc IX
djnz1: djnz ciclo
rst 38h
cadena: defm ""
largo: equ $-cadena
end start
| scoffey/jz80sim | test/jzas/sintactic/valid/success56.asm | Assembly | mit | 358 |
;********** PVM player ***********
; 19-08-2015 v0.01: Beat display at logo.
; v0.02: Raster bars added - Stable raster from Ricardo's code
; xx-09-2015 v0.10: VUMeter added
; 02-09-2015 v0.15: Playtime timer added
; 04-09-2015 v0.16: Code cleanup
!to "mp_sw.prg"
!sl "labels.txt"
!source "src/macros.asm"
; ***** CONFIG SECTION *****
NTSC = 0 ;Compile as NTSC? 1 = true
; ***** variables *****
_charcount = $FB ;16-bit char counter
_topline = $05 ;closing borders top raster
_bottomline = $06 ;closing borders bottom raster
_framecnt = $07 ;frameskip counter
_flag = $23 ;generic flag
_beat = $02 ;beat color cycle counter
_vucnt = $10 ;VU Meter frame skip counter $10, $11, $12
_vunote = $13 ;VU Meter note played previous frame (for sustain effect) $13, $14, $15
_vufrm = $16 ;VU Meter current animframe $16, $17, $18
_vustat = $19 ;VU Meter state machine status $19, $1a, $1b (0 = idle, 4 = attack, 3 = decay, 2 = sustain, 1 = release)
_vugate = $1c ;Gate status for previous frame $1c, $1d, $1e
_tframe = $30 ;playtime frame count
_tsecs = $31 ;playtime seconds
_tmins = $32 ;playtime minutes
_tpos = $33 ;playtime digit screen address $33,$34
; ***** Constants *****
BEATINST = $02 ;Instrument to use for beat effect
VUMETERS = $7f8 ;VU Meters sprite pointers
!source "src/sidwizard_labels.asm" ;SID-Wizard labels
;**********************
*= $0801
!zone
start
!word $080B,2015
!raw $9e,"2061",0,0,0
lda #$00
sta _flag
sta _beat
jsr initmem
.xx06 bit _flag
bpl .xx06
lda #$6b
sta $d011 ;disable screen
;color fade
ldx #$04
.xx07 lda _framecnt
bne .xx07
lda #$04
sta _framecnt
lda _colortable1,x
sta $d020
dex
bpl .xx07
;set main irq
sei
lda #$fb ;this is how to tell at which rasterline we want the irq to be triggered
sta $d012
inc _flag ;make music wait for us to be ready
lda #<mainirq ;this is how we set up
sta $fffe ;the address of our interrupt code
lda #>mainirq
sta $ffff
cli
;---
jsr initscr ;Init screen
lda #$1b
sta $d011 ; enable screen
dec _flag ;signal IRQ we're ready
;**** Main Loop ****
;Print Playtime
.pp0 lda _tframe
cmp #$31 ;wait for tframe reset
bne .cc0 ;if not go check BEATINST
lda _tsecs
ldy #$04
jsr printbcd ;print seconds
dey
lda _tmins
jsr printbcd ;print minutes
;Color cycle logo bars when BEATINST is played
.cc0 ldy #$02
.cc2 lda shinst,y
cmp _tinst,y ;check instrument playing changed
beq .cc1
sta _tinst,y
cmp #BEATINST ;changed, now check that is BEATINST
bne .cc1
; trigger color cycle
lda #$03
sta _beat
;
.cc1 dey
bpl .cc2
bmi .pp0
.end jmp .end
;**** Print BCD ****
printbcd:
tax
and #$0f
jsr .pbcd
txa
lsr
lsr
lsr
lsr
.pbcd
ora #$30
sta (_tpos),y
dey
rts
;***** White flash color cyble after initial screen close effect *****
_colortable1:
!byte $00,$0b,$0c,$0f,$01
;***** Color cycle for the beat effect *****
_colortable2:
!byte $09,$08,$01
;***** temp inst status *****
_tinst:
!byte $00, $00, $00
;***** sprite block table *****
_sustainmap:
_spblock:
!byte $00,$01,$01,$02,$03,$03,$04,$05,$05,$06,$07,$07,$08,$09,$09,$0a
;***** Attack frame skip *****
_attackframes:
!byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$01,$02,$03,$04,$0e,$18,$27
;***** Attack sprite frame increase
_attackinc:
!byte $0a,$0a,$0a,$0a,$05,$04,$04,$03,$02,$02,$02,$01,$01,$01,$01,$01
;***** Decay/Release frame skip *****
_drframes:
!byte $01,$01,$01,$01,$01,$01,$00,$01,$02,$03,$06,$0b,$0e,$2c,$4a,$77
; !byte $00,$00,$00,$00,$00,$01,$00,$01,$02,$03,$06,$0b,$0e,$2c,$4a,$77
;***** Decay/Release sprite frame decrease *****
_drinc:
!byte $01,$01,$01,$01,$01,$01,$01,$02,$02,$01,$01,$01,$01,$01,$01,$01
; !byte $0a,$0a,$05,$03,$02,$03,$01,$02,$02,$01,$01,$01,$01,$01,$01,$01
;********* Init Screen *********
initscr:
ldx #$00
stx $D021
;clear screen
lda #$20
ldx #$00
.ic1 sta $0400,x
sta $0500,x
sta $0600,x
sta $0700,x
inx
bne .ic1
;set color ram
lda #$03
ldx #$00
.ic0
sta $D900,x
sta $DA00,x
sta $DB00,x
inx
bne .ic0
;set color for logo - 10 rows unrolled
ldx #$27 ;40 columns
.lx1
!set lrow = 0
!do {
lda map_data+lrow,x
tay
lda charset_attrib_data,y
sta $d800+lrow,x
!set lrow = lrow + 40
} while lrow < 400
dex
bpl .lx1
;Init sprites
lda #$d3
sta VUMETERS ;set block
sta VUMETERS+1
sta VUMETERS+2
ldx #$07
stx $d01c ;set multicolor
stx $d015 ;enable
ldx #$05 ;colors
stx $d027
stx $d028
stx $d029
ldx #$0d
stx $d025
ldx #$0b
stx $d026
lda #$a8 ;Y-coordinates
sta $d001
sta $d003
sta $d005
ldx #$ff ;X-coordinates
stx $d010
stx $d017
stx $d01d ;expand
lda #$04
sta $d000
lda #$17
sta $d002
lda #$2A
sta $d004
;print data fields labels
;Changed from single routine + init for each string, to dedicated hardcoded routine for each string, shorter and easier to read.
;Name 1x2 charset
+PRINT1X2 _SNameLabel, $12, 10, 11, $400, $08
;Author 1x1 charset
+PRINT1X1 _SAuthorLabel, $0d, 1, 17, $400, $0f
;Date 1x1 charset
+PRINT1X1 _SDateLabel, $11, 1, 19, $400, $0f
;Playtime 1x1 charset
+PRINT1X1 _SPlayLabel, $0e, 1, 15, $400, $0f
;Credits 1x1 charset
+PRINT1X1 _SCodeLabel, 18, 13, 24, $400, $0b
+PRINT1X1 _SCharLabel, $11, 11, 23, $400, $0b
+PRINT1X1 _SGFXLabel, $0d, 13, 22, $400, $0b
;VUMeter label
; +PRINT1X1 _SVULabel, $04, 31, 18, $400, $0f
rts
; **** Configure memory, set IRQ routine ****
initmem:
sei ;disable maskable IRQs
lda #$7f
sta $dc0d ;disable timer interrupts which can be generated by the two CIA chips
sta $dd0d ;the kernal uses such an interrupt to flash the cursor and scan the keyboard, so we better
;stop it.
lda $dc0d ;by reading this two registers we negate any pending CIA irqs.
lda $dd0d ;if we don't do this, a pending CIA irq might occur after we finish setting up our irq.
;we don't want that to happen.
lda #COLR_CHAR_MC1
sta $d022 ;Multi color 1
lda #COLR_CHAR_MC2
sta $d023 ;Multi color 2
lda #$01 ;this is how to tell the VICII to generate a raster interrupt
sta $d01a
lda #$33
sta _topline
lda #$fa ;this is how to tell at which rasterline we want the irq to be triggered
sta _bottomline
sta $d012
lda $D020
sta _charcount ;temp
lda #$1b ;as there are more than 256 rasterlines, the topmost bit of $d011 serves as
sta $d011 ;the 8th bit for the rasterline we want our irq to be triggered.
;here we simply set up a character screen, leaving the topmost bit 0.
lda #$35 ;we turn off the BASIC and KERNAL rom here
sta $01 ;the cpu now sees RAM everywhere except at $d000-$e000, where still the registers of
;SID/VICII/etc are visible
lda #<bottom_irq ;this is how we set up
sta $fffe ;the address of our interrupt code
lda #>bottom_irq
sta $ffff
; Init VU Meters variables
ldx #$0c
lda #$00
.im1 sta _vucnt,x
dex
bpl .im1
sta _tsecs ; Init playtime
sta _tmins
lda #$fe
sta _vugate
sta _vugate+1
sta _vugate+2
lda #$03
sta _framecnt ; Init frame counter
lda #$31 ; Init playtime frame counter (for 50Hz)
sta _tframe
lda #$63
ldx #$06
sta _tpos
stx _tpos+1
lda #$00
jsr inisub ; Init music
cli ;enable maskable interrupts again
rts
; ******** IRQ Routine ********
; *main irq, play music (1x speed)
mainirq:
pha
txa
pha
tya
pha
lda #$3d ;set up next raster irq at line $40 (for raster bars)
sta $d012
lda #<irq_rasterbars ;this is how we set up
sta $fffe ;the address of our interrupt code
lda #>irq_rasterbars
sta $ffff
lda #%10111101 ;chargen at $3000 - matrix at $2c00
sta $d018
lda $d016
ora #%00010000 ;set multicolor mode
sta $d016
;-----
dec _framecnt
bpl .ir01
;----
;**** Beat color cycle ****
ldy _beat ;check if color cycle is in progress
beq .ir03
dey
sty _beat
lda _colortable2,y
sta $d022
sta rr1+1 ;modify code for raster bars
.ir03
lda #$03
sta _framecnt
.ir01
bit _flag ;Wait until main program flags us to start playing music.
bpl .ir02
;inc $d020
jsr playsub ;Play music
;dec $d020
jsr SUpdate ;Update variables
jsr VUpdate ;Update VU Meters
jsr PTUpdate ;Update Playtime
.ir02
;-----
asl $d019
pla
tay
pla
tax
pla
rti
; *raster bars IRQ - for logo bars
irq_rasterbars:
pha ; saves A, X, Y
txa
pha
tya
pha
+STABILIZE_RASTER
sei
jsr tworeds
ldy #$01
jsr blacks1 ;two blacks - bad line
jsr tworeds
!if NTSC = 1 {
ldy #$34
nop
} else {
ldy #$33
}
jsr blacks1 ;six blacks
jsr tworeds
ldy #$08
jsr blacks1 ;two blacks
jsr tworeds
!if NTSC = 1 {
ldy #$35
} else {
ldy #$33
}
jsr blacks1 ;six blacks
jsr tworeds
ldy #$01 ;two blacks - bad line
jsr blacks1
jsr tworeds
!if NTSC = 1 {
ldy #$33
} else {
ldy #$32
}
jsr blacks1 ;six blacks
jsr tworeds
ldy#$08
jsr blacks1 ;two blacks
!if NTSC = 1 {
nop
}
jsr tworeds
asl $d019
cli
lda #$82 ;set up next raster irq at line $82 (just before 10th text row)
sta $d012
lda #<secirq ;this is how we set up
sta $fffe ;the address of our interrupt code
lda #>secirq
sta $ffff
pla ; restores A, X, Y
tay
pla
tax
pla
rti ; restores previous PC, status
tworeds:
ldy #$09 ;+2
.rra dey ;+2
bne .rra ;+2 +1
bit $00 ;+3
rr1 lda#$09 ;+2
sta$d020 ;+4
ldy #$17 ;+2
.rrb dey ;+2
bne .rrb ;+2 +1
bit $00 ;+3
!if NTSC = 1 {
nop ;+2
nop ;+2
}
lda #$00
sta $d020
rts
blacks1:
;ldy #$01 ;+2
.rrc dey ;+2
bne .rrc ;+2 +1
bit $00 ;+3
!if NTSC = 1 {
nop ;+2
nop ;+2
}
rts
; *secondary IRQ - switchs from logo charset to 'normal' one
secirq:
pha
txa
pha
tya
pha
lda #$fb ;set up next raster irq at line $fb (just after start of bottom border)
sta $d012
lda #<mainirq ;this is how we set up
sta $fffe ;the address of our interrupt code
lda #>mainirq
sta $ffff
lda #%00011111 ;chargen at $3800 - matrix at $0400
sta $d018
lda $d016
and #%11101111 ;disable multicolor mode
sta $d016
asl $d019
pla
tay
pla
tax
pla
rti
; ******* subs IRQ *******
bottom_irq:
pha
txa
pha
tya
pha
;-----
lda _bottomline
and #$07
cmp #$03
bne .bi01
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
.bi01 nop
nop
nop
nop
nop
nop
nop
; nop
; nop
lda #$00
sta $d020
lda #$7b ;0b
sta $d011
lda _topline
sta $d012
lda #<top_irq ;this is how we set up
sta $fffe ;the address of our interrupt code
lda #>top_irq
sta $ffff
;-----
asl $d019
pla
tay
pla
tax
pla
rti
top_irq:
pha
txa
pha
tya
pha
;-----
ldx _topline
inx
cpx _bottomline
bne .tpi01
;center reached
lda #$04
sta _framecnt
lda #$0f ;this is how to tell at which rasterline we want the irq to be triggered
sta $d012
dec _flag ;flag main routine, we're ready for next part
lda #<idle_irq
sta $fffe
lda #>idle_irq
bne .tpi02 ;sta $ffff
.tpi01
lda _topline
and #$07
cmp #$03
bne .ti01 ;bad line
; nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
; nop
; nop
; nop
; nop
; nop
.ti01 nop
nop
nop
nop
lda #$1b
sta $d011
lda _charcount
sta $d020
stx _topline
dec _bottomline
lda _bottomline
sta $d012
lda #<bottom_irq ;this is how we set up
sta $fffe ;the address of our interrupt code
lda #>bottom_irq
.tpi02 sta $ffff
;-----
asl $d019
pla
tay
pla
tax
pla
rti
idle_irq:
pha
txa
pha
tya
pha
;-----
dec _framecnt
;-----
asl $d019
pla
tay
pla
tax
pla
rti
;****
;***** VUMeters code
VUpdate:
;first check if gate status changed
ldx #$03
.vu1 lda gate,x
cmp _vugate,x
beq .vu2 ;no change
sta _vugate,x
bcs .vu3 ;change to gate set -> attack
;change to gate clear -> release
lda shad,x ;get Attack value
lsr
lsr
lsr
lsr
tay
lda _attackframes,y ;load frameskip counter
sta _vucnt,x
lda #$01
bne .vu4
.vu3 lda shsr ;ger Release value
and #$15
tay
lda _drframes,y ;load frameskip counter
sta _vucnt,x
lda #$04
.vu4 sta _vustat,x
.vu2 dex
bpl .vu1
;state machine
ldx #$02
.vu5 lda _vustat,x
;sta $720,x ;<-debug
bne .vu0
jmp .vu6 ;idle
.vu0 cmp #$04
bcc .vu7
;-----attack
;check if frameskip reached 0
lda _vucnt,x
beq .vu8b
jmp .vu8 ;no
.vu8b lda shnote,x ;get note
;sta $6f8,x ;Debug
sta _vunote,x ;save for later
lda shad,x ;get Attack value
lsr
lsr
lsr
lsr
tay ;Yreg = Attack
;sta $748,x ;<-debug
lda _attackframes,y ;reload frame skip counter
sta _vucnt,x
lda _attackinc,y ;get by how much we got to change sprite animation
clc
adc _vufrm,x ;and add to animation frame
cmp #$0a
bcc .vu9
lda #$0a ;reached full volume
dec _vustat,x ;go to decay state
pha
lda _drframes,y ;set new frameskip
sta _vucnt,x
pla
.vu9 sta _vufrm,x
jmp .vu6
.vu7 cmp #$03
bcc .vu10
;-----decay
;check if frameskip reached 0
lda _vucnt,x
beq .vu8a
jmp .vu8 ;no
.vu8a lda shad,x ;get Delay value
and #$0f
;sta $770,x ;<-debug
tay ;Yreg = Decay
lda _drframes,y ;reload frame skip counter
sta _vucnt,x
lda _vufrm,x ;get animation frame
sec
sbc _drinc,y ;and subtract appropriate value
pha
;sta _vufrm,x
lda shsr,x ;get curret sustain level
lsr
lsr
lsr
lsr
tay
pla
clc
cmp _sustainmap,y ;map sustain level to animation frame
;cmp _vufrm,x
beq .vu11 ;reached sustain level
bcs .vu14 ;not yet
lda _sustainmap,y ;sta _vufrm,x ;we were below sustain level
.vu11 dec _vustat,x ;go to sustain state
.vu14 sta _vufrm,x
bne .vu6
.vu10 cmp #$02
bcc .vu12
;-----sustain
lda _vucnt,x
bne .vu8 ;no
lda #$02
sta _vucnt,x
lda shsr,x ;get Sustain value
lsr
lsr
lsr
lsr
;sta $798,x ;<-debug
tay ;Yreg = Sustain
lda _sustainmap,y ;map sustain level to animation frame
cmp _vufrm,x
bcs .vu15 ;sustain level is greater or equal than current animation frame, nothing to do
sta _vufrm,x ;update frame only if sustain level decreases
.vu15 cmp #$0a ;animate it a little if note changes while in sustain
beq .vu6 ;if full volume, continue
lda shnote,x ;otherwise
cmp _vunote,x ;check if note changed
beq .vu6
inc _vufrm,x ;increase frame if so
sta _vunote,x
bpl .vu6
.vu12 ;-----release
;check if frameskip reached 0
lda _vucnt,x
bne .vu8 ;no
lda shsr,x ;get Release value
and #$0f
;sta $7c0,x ;<-debug
tay ;Yreg = Release
lda _drframes,y ;reload frame skip counter
sta _vucnt,x
lda _vufrm,x ;get animation frame
sec
sbc _drinc,y ;and subtract appropriate value
sta _vufrm,x
beq .vu13 ;reached 0
bpl .vu6 ;not yet
lda #$00
sta _vufrm,x ;we were below 0
.vu13 dec _vustat,x ;go to idle state
beq .vu6
.vu8 dec _vucnt,x
.vu6 lda _vufrm,x
clc
adc #$d3
sta VUMETERS,x ;update sprite pointers
dex
bmi .vue
jmp .vu5
.vue rts
;**** Update Playtime
PTUpdate:
dec _tframe
bpl .pte
lda #$31 ;Reset _tframe
sta _tframe
sed
clc
lda #$01
adc _tsecs
cmp #$60
bne .ptu0
clc
lda #$01
adc _tmins
sta _tmins
lda #$00
.ptu0 sta _tsecs
cld
.pte
rts
;****
;**** Update variables
SUpdate:
ldy #$02
.su1 ldx voffset,y
lda CURNOT1,x
sta shnote,y
lda CURINS1,x
sta shinst,y
lda AD1,x
sta shad,y
lda SR1,x
sta shsr,y
lda PTNGATE1,x
sta gate,y
eor #$ff
;sta $7a8,y ;<-debug
dey
bpl .su1
; lda CURNOT1
; sta shnote
; lda CURNOT2
; sta shnote+1
; lda CURNOT3
; sta shnote+2
; lda CURINS1
; sta shinst
; lda CURINS2
; sta shinst+1
; lda CURINS3
; sta shinst+2
; lda AD1
; sta shad
; lda AD2
; sta shad+1
; lda AD3
; sta shad+2
; lda SR1
; sta shsr
; lda SR2
; sta shsr+1
; lda SR3
; sta shsr+2
; lda PTNGATE1
; sta gate
; lda PTNGATE1
; sta gate
; lda PTNGATE1
; sta gate
codeend:
rts
;**** SID Variables (use only with SID-Wizard)
shinst: !8 0,0,0
shad: !8 0,0,0
shsr: !8 0,0,0
shnote: !8 0,0,0
gate: !8 0,0,0
voffset: !8 0,7,14 ;index offset
varsend:
;***** MUSIC *****
*=$1000
!bin "src/song.bin"
;*=$1000
;!bin "src/test.bin.seq"
musicend:
;***** Logo charset *****
!source "src/logo2_rosa.asm"
;***** Sprites *****
*=$34C0
!bin "src/sprites2.bin"
;***** Main charset *****
*=$3800
!bin "src/charset.bin" ;"charset2.bin"
;***** Text *****
_SNameLabel:
!scrxor $80,"4516 "
!scrxor $80,"leet it ["
!scrxor $80," 0123"
_SAuthorLabel:
!scr "author: "
!scr "comu"
_SDateLabel:
!scr "released: "
!scr "21/05/16"
_SPlayLabel:
!scr "playtime: 00:00"
_SGFXLabel:
!scr "gfx: alakran"
_SCharLabel:
!scr "charset: arlequin"
_SCodeLabel:
!scr "code: the"
!8 95
!scr "woz, nox"
;_SVULabel:
; !scrxor $80,"1 2 3"
| c64scene-ar/sid-player | player-prototype-sidwizard/src/mp_sw.asm | Assembly | apache-2.0 | 16,719 |
_start:
sub sp, sp, #0x20
stp x29, x30, [sp, #0x10]
add x29, sp, #0x10
split:
cbz x0, split
ret | googleprojectzero/reil | disassembler/test_data/block_split.asm | Assembly | apache-2.0 | 105 |
;
; Copyright (c) 2013 The WebM project authors. All Rights Reserved.
;
; Use of this source code is governed by a BSD-style license
; that can be found in the LICENSE file in the root of the source
; tree. An additional intellectual property rights grant can be found
; in the file PATENTS. All contributing project authors may
; be found in the AUTHORS file in the root of the source tree.
;
EXPORT |vpx_idct8x8_64_add_neon|
EXPORT |vpx_idct8x8_12_add_neon|
ARM
REQUIRE8
PRESERVE8
AREA ||.text||, CODE, READONLY, ALIGN=2
INCLUDE vpx_dsp/arm/idct_neon.asm.S
; Parallel 1D IDCT on all the columns of a 8x8 16bit data matrix which are
; loaded in q8-q15. The output will be stored back into q8-q15 registers.
; This macro will touch q0-q7 registers and use them as buffer during
; calculation.
MACRO
IDCT8x8_1D
; stage 1
vdup.16 d0, r3 ; duplicate cospi_28_64
vdup.16 d1, r4 ; duplicate cospi_4_64
vdup.16 d2, r5 ; duplicate cospi_12_64
vdup.16 d3, r6 ; duplicate cospi_20_64
; input[1] * cospi_28_64
vmull.s16 q2, d18, d0
vmull.s16 q3, d19, d0
; input[5] * cospi_12_64
vmull.s16 q5, d26, d2
vmull.s16 q6, d27, d2
; input[1]*cospi_28_64-input[7]*cospi_4_64
vmlsl.s16 q2, d30, d1
vmlsl.s16 q3, d31, d1
; input[5] * cospi_12_64 - input[3] * cospi_20_64
vmlsl.s16 q5, d22, d3
vmlsl.s16 q6, d23, d3
; dct_const_round_shift(input_dc * cospi_16_64)
vqrshrn.s32 d8, q2, #14 ; >> 14
vqrshrn.s32 d9, q3, #14 ; >> 14
; dct_const_round_shift(input_dc * cospi_16_64)
vqrshrn.s32 d10, q5, #14 ; >> 14
vqrshrn.s32 d11, q6, #14 ; >> 14
; input[1] * cospi_4_64
vmull.s16 q2, d18, d1
vmull.s16 q3, d19, d1
; input[5] * cospi_20_64
vmull.s16 q9, d26, d3
vmull.s16 q13, d27, d3
; input[1]*cospi_4_64+input[7]*cospi_28_64
vmlal.s16 q2, d30, d0
vmlal.s16 q3, d31, d0
; input[5] * cospi_20_64 + input[3] * cospi_12_64
vmlal.s16 q9, d22, d2
vmlal.s16 q13, d23, d2
; dct_const_round_shift(input_dc * cospi_16_64)
vqrshrn.s32 d14, q2, #14 ; >> 14
vqrshrn.s32 d15, q3, #14 ; >> 14
; stage 2 & stage 3 - even half
vdup.16 d0, r7 ; duplicate cospi_16_64
; dct_const_round_shift(input_dc * cospi_16_64)
vqrshrn.s32 d12, q9, #14 ; >> 14
vqrshrn.s32 d13, q13, #14 ; >> 14
; input[0] * cospi_16_64
vmull.s16 q2, d16, d0
vmull.s16 q3, d17, d0
; input[0] * cospi_16_64
vmull.s16 q13, d16, d0
vmull.s16 q15, d17, d0
; (input[0] + input[2]) * cospi_16_64
vmlal.s16 q2, d24, d0
vmlal.s16 q3, d25, d0
; (input[0] - input[2]) * cospi_16_64
vmlsl.s16 q13, d24, d0
vmlsl.s16 q15, d25, d0
vdup.16 d0, r8 ; duplicate cospi_24_64
vdup.16 d1, r9 ; duplicate cospi_8_64
; dct_const_round_shift(input_dc * cospi_16_64)
vqrshrn.s32 d18, q2, #14 ; >> 14
vqrshrn.s32 d19, q3, #14 ; >> 14
; dct_const_round_shift(input_dc * cospi_16_64)
vqrshrn.s32 d22, q13, #14 ; >> 14
vqrshrn.s32 d23, q15, #14 ; >> 14
; input[1] * cospi_24_64 - input[3] * cospi_8_64
; input[1] * cospi_24_64
vmull.s16 q2, d20, d0
vmull.s16 q3, d21, d0
; input[1] * cospi_8_64
vmull.s16 q8, d20, d1
vmull.s16 q12, d21, d1
; input[1] * cospi_24_64 - input[3] * cospi_8_64
vmlsl.s16 q2, d28, d1
vmlsl.s16 q3, d29, d1
; input[1] * cospi_8_64 + input[3] * cospi_24_64
vmlal.s16 q8, d28, d0
vmlal.s16 q12, d29, d0
; dct_const_round_shift(input_dc * cospi_16_64)
vqrshrn.s32 d26, q2, #14 ; >> 14
vqrshrn.s32 d27, q3, #14 ; >> 14
; dct_const_round_shift(input_dc * cospi_16_64)
vqrshrn.s32 d30, q8, #14 ; >> 14
vqrshrn.s32 d31, q12, #14 ; >> 14
vadd.s16 q0, q9, q15 ; output[0] = step[0] + step[3]
vadd.s16 q1, q11, q13 ; output[1] = step[1] + step[2]
vsub.s16 q2, q11, q13 ; output[2] = step[1] - step[2]
vsub.s16 q3, q9, q15 ; output[3] = step[0] - step[3]
; stage 3 -odd half
vdup.16 d16, r7 ; duplicate cospi_16_64
; stage 2 - odd half
vsub.s16 q13, q4, q5 ; step2[5] = step1[4] - step1[5]
vadd.s16 q4, q4, q5 ; step2[4] = step1[4] + step1[5]
vsub.s16 q14, q7, q6 ; step2[6] = -step1[6] + step1[7]
vadd.s16 q7, q7, q6 ; step2[7] = step1[6] + step1[7]
; step2[6] * cospi_16_64
vmull.s16 q9, d28, d16
vmull.s16 q10, d29, d16
; step2[6] * cospi_16_64
vmull.s16 q11, d28, d16
vmull.s16 q12, d29, d16
; (step2[6] - step2[5]) * cospi_16_64
vmlsl.s16 q9, d26, d16
vmlsl.s16 q10, d27, d16
; (step2[5] + step2[6]) * cospi_16_64
vmlal.s16 q11, d26, d16
vmlal.s16 q12, d27, d16
; dct_const_round_shift(input_dc * cospi_16_64)
vqrshrn.s32 d10, q9, #14 ; >> 14
vqrshrn.s32 d11, q10, #14 ; >> 14
; dct_const_round_shift(input_dc * cospi_16_64)
vqrshrn.s32 d12, q11, #14 ; >> 14
vqrshrn.s32 d13, q12, #14 ; >> 14
; stage 4
vadd.s16 q8, q0, q7 ; output[0] = step1[0] + step1[7];
vadd.s16 q9, q1, q6 ; output[1] = step1[1] + step1[6];
vadd.s16 q10, q2, q5 ; output[2] = step1[2] + step1[5];
vadd.s16 q11, q3, q4 ; output[3] = step1[3] + step1[4];
vsub.s16 q12, q3, q4 ; output[4] = step1[3] - step1[4];
vsub.s16 q13, q2, q5 ; output[5] = step1[2] - step1[5];
vsub.s16 q14, q1, q6 ; output[6] = step1[1] - step1[6];
vsub.s16 q15, q0, q7 ; output[7] = step1[0] - step1[7];
MEND
; Transpose a 8x8 16bit data matrix. Datas are loaded in q8-q15.
MACRO
TRANSPOSE8X8
vswp d17, d24
vswp d23, d30
vswp d21, d28
vswp d19, d26
vtrn.32 q8, q10
vtrn.32 q9, q11
vtrn.32 q12, q14
vtrn.32 q13, q15
vtrn.16 q8, q9
vtrn.16 q10, q11
vtrn.16 q12, q13
vtrn.16 q14, q15
MEND
AREA Block, CODE, READONLY ; name this block of code
;void vpx_idct8x8_64_add_neon(int16_t *input, uint8_t *dest, int dest_stride)
;
; r0 int16_t input
; r1 uint8_t *dest
; r2 int dest_stride)
|vpx_idct8x8_64_add_neon| PROC
push {r4-r9}
vpush {d8-d15}
LOAD_TRAN_LOW_TO_S16 d16, d17, d18, d19, r0
LOAD_TRAN_LOW_TO_S16 d20, d21, d22, d23, r0
LOAD_TRAN_LOW_TO_S16 d24, d25, d26, d27, r0
LOAD_TRAN_LOW_TO_S16 d28, d29, d30, d31, r0
; transpose the input data
TRANSPOSE8X8
; cospi_28_64 = 3196
movw r3, #0x0c7c
; cospi_4_64 = 16069
movw r4, #0x3ec5
; cospi_12_64 = 13623
movw r5, #0x3537
; cospi_20_64 = 9102
movw r6, #0x238e
; cospi_16_64 = 11585
movw r7, #0x2d41
; cospi_24_64 = 6270
movw r8, #0x187e
; cospi_8_64 = 15137
movw r9, #0x3b21
; First transform rows
IDCT8x8_1D
; Transpose the matrix
TRANSPOSE8X8
; Then transform columns
IDCT8x8_1D
; ROUND_POWER_OF_TWO(temp_out[j], 5)
vrshr.s16 q8, q8, #5
vrshr.s16 q9, q9, #5
vrshr.s16 q10, q10, #5
vrshr.s16 q11, q11, #5
vrshr.s16 q12, q12, #5
vrshr.s16 q13, q13, #5
vrshr.s16 q14, q14, #5
vrshr.s16 q15, q15, #5
; save dest pointer
mov r0, r1
; load destination data
vld1.64 {d0}, [r1], r2
vld1.64 {d1}, [r1], r2
vld1.64 {d2}, [r1], r2
vld1.64 {d3}, [r1], r2
vld1.64 {d4}, [r1], r2
vld1.64 {d5}, [r1], r2
vld1.64 {d6}, [r1], r2
vld1.64 {d7}, [r1]
; ROUND_POWER_OF_TWO(temp_out[j], 5) + dest[j * dest_stride + i]
vaddw.u8 q8, q8, d0
vaddw.u8 q9, q9, d1
vaddw.u8 q10, q10, d2
vaddw.u8 q11, q11, d3
vaddw.u8 q12, q12, d4
vaddw.u8 q13, q13, d5
vaddw.u8 q14, q14, d6
vaddw.u8 q15, q15, d7
; clip_pixel
vqmovun.s16 d0, q8
vqmovun.s16 d1, q9
vqmovun.s16 d2, q10
vqmovun.s16 d3, q11
vqmovun.s16 d4, q12
vqmovun.s16 d5, q13
vqmovun.s16 d6, q14
vqmovun.s16 d7, q15
; store the data
vst1.64 {d0}, [r0], r2
vst1.64 {d1}, [r0], r2
vst1.64 {d2}, [r0], r2
vst1.64 {d3}, [r0], r2
vst1.64 {d4}, [r0], r2
vst1.64 {d5}, [r0], r2
vst1.64 {d6}, [r0], r2
vst1.64 {d7}, [r0], r2
vpop {d8-d15}
pop {r4-r9}
bx lr
ENDP ; |vpx_idct8x8_64_add_neon|
;void vpx_idct8x8_12_add_neon(int16_t *input, uint8_t *dest, int dest_stride)
;
; r0 int16_t input
; r1 uint8_t *dest
; r2 int dest_stride)
|vpx_idct8x8_12_add_neon| PROC
push {r4-r9}
vpush {d8-d15}
LOAD_TRAN_LOW_TO_S16 d16, d17, d18, d19, r0
LOAD_TRAN_LOW_TO_S16 d20, d21, d22, d23, r0
LOAD_TRAN_LOW_TO_S16 d24, d25, d26, d27, r0
LOAD_TRAN_LOW_TO_S16 d28, d29, d30, d31, r0
; transpose the input data
TRANSPOSE8X8
; cospi_28_64 = 3196
movw r3, #0x0c7c
; cospi_4_64 = 16069
movw r4, #0x3ec5
; cospi_12_64 = 13623
movw r5, #0x3537
; cospi_20_64 = 9102
movw r6, #0x238e
; cospi_16_64 = 11585
movw r7, #0x2d41
; cospi_24_64 = 6270
movw r8, #0x187e
; cospi_8_64 = 15137
movw r9, #0x3b21
; First transform rows
; stage 1
; The following instructions use vqrdmulh to do the
; dct_const_round_shift(input[1] * cospi_28_64). vqrdmulh will do doubling
; multiply and shift the result by 16 bits instead of 14 bits. So we need
; to double the constants before multiplying to compensate this.
mov r12, r3, lsl #1
vdup.16 q0, r12 ; duplicate cospi_28_64*2
mov r12, r4, lsl #1
vdup.16 q1, r12 ; duplicate cospi_4_64*2
; dct_const_round_shift(input[1] * cospi_28_64)
vqrdmulh.s16 q4, q9, q0
mov r12, r6, lsl #1
rsb r12, #0
vdup.16 q0, r12 ; duplicate -cospi_20_64*2
; dct_const_round_shift(input[1] * cospi_4_64)
vqrdmulh.s16 q7, q9, q1
mov r12, r5, lsl #1
vdup.16 q1, r12 ; duplicate cospi_12_64*2
; dct_const_round_shift(- input[3] * cospi_20_64)
vqrdmulh.s16 q5, q11, q0
mov r12, r7, lsl #1
vdup.16 q0, r12 ; duplicate cospi_16_64*2
; dct_const_round_shift(input[3] * cospi_12_64)
vqrdmulh.s16 q6, q11, q1
; stage 2 & stage 3 - even half
mov r12, r8, lsl #1
vdup.16 q1, r12 ; duplicate cospi_24_64*2
; dct_const_round_shift(input_dc * cospi_16_64)
vqrdmulh.s16 q9, q8, q0
mov r12, r9, lsl #1
vdup.16 q0, r12 ; duplicate cospi_8_64*2
; dct_const_round_shift(input[1] * cospi_24_64)
vqrdmulh.s16 q13, q10, q1
; dct_const_round_shift(input[1] * cospi_8_64)
vqrdmulh.s16 q15, q10, q0
; stage 3 -odd half
vdup.16 d16, r7 ; duplicate cospi_16_64
vadd.s16 q0, q9, q15 ; output[0] = step[0] + step[3]
vadd.s16 q1, q9, q13 ; output[1] = step[1] + step[2]
vsub.s16 q2, q9, q13 ; output[2] = step[1] - step[2]
vsub.s16 q3, q9, q15 ; output[3] = step[0] - step[3]
; stage 2 - odd half
vsub.s16 q13, q4, q5 ; step2[5] = step1[4] - step1[5]
vadd.s16 q4, q4, q5 ; step2[4] = step1[4] + step1[5]
vsub.s16 q14, q7, q6 ; step2[6] = -step1[6] + step1[7]
vadd.s16 q7, q7, q6 ; step2[7] = step1[6] + step1[7]
; step2[6] * cospi_16_64
vmull.s16 q9, d28, d16
vmull.s16 q10, d29, d16
; step2[6] * cospi_16_64
vmull.s16 q11, d28, d16
vmull.s16 q12, d29, d16
; (step2[6] - step2[5]) * cospi_16_64
vmlsl.s16 q9, d26, d16
vmlsl.s16 q10, d27, d16
; (step2[5] + step2[6]) * cospi_16_64
vmlal.s16 q11, d26, d16
vmlal.s16 q12, d27, d16
; dct_const_round_shift(input_dc * cospi_16_64)
vqrshrn.s32 d10, q9, #14 ; >> 14
vqrshrn.s32 d11, q10, #14 ; >> 14
; dct_const_round_shift(input_dc * cospi_16_64)
vqrshrn.s32 d12, q11, #14 ; >> 14
vqrshrn.s32 d13, q12, #14 ; >> 14
; stage 4
vadd.s16 q8, q0, q7 ; output[0] = step1[0] + step1[7];
vadd.s16 q9, q1, q6 ; output[1] = step1[1] + step1[6];
vadd.s16 q10, q2, q5 ; output[2] = step1[2] + step1[5];
vadd.s16 q11, q3, q4 ; output[3] = step1[3] + step1[4];
vsub.s16 q12, q3, q4 ; output[4] = step1[3] - step1[4];
vsub.s16 q13, q2, q5 ; output[5] = step1[2] - step1[5];
vsub.s16 q14, q1, q6 ; output[6] = step1[1] - step1[6];
vsub.s16 q15, q0, q7 ; output[7] = step1[0] - step1[7];
; Transpose the matrix
TRANSPOSE8X8
; Then transform columns
IDCT8x8_1D
; ROUND_POWER_OF_TWO(temp_out[j], 5)
vrshr.s16 q8, q8, #5
vrshr.s16 q9, q9, #5
vrshr.s16 q10, q10, #5
vrshr.s16 q11, q11, #5
vrshr.s16 q12, q12, #5
vrshr.s16 q13, q13, #5
vrshr.s16 q14, q14, #5
vrshr.s16 q15, q15, #5
; save dest pointer
mov r0, r1
; load destination data
vld1.64 {d0}, [r1], r2
vld1.64 {d1}, [r1], r2
vld1.64 {d2}, [r1], r2
vld1.64 {d3}, [r1], r2
vld1.64 {d4}, [r1], r2
vld1.64 {d5}, [r1], r2
vld1.64 {d6}, [r1], r2
vld1.64 {d7}, [r1]
; ROUND_POWER_OF_TWO(temp_out[j], 5) + dest[j * dest_stride + i]
vaddw.u8 q8, q8, d0
vaddw.u8 q9, q9, d1
vaddw.u8 q10, q10, d2
vaddw.u8 q11, q11, d3
vaddw.u8 q12, q12, d4
vaddw.u8 q13, q13, d5
vaddw.u8 q14, q14, d6
vaddw.u8 q15, q15, d7
; clip_pixel
vqmovun.s16 d0, q8
vqmovun.s16 d1, q9
vqmovun.s16 d2, q10
vqmovun.s16 d3, q11
vqmovun.s16 d4, q12
vqmovun.s16 d5, q13
vqmovun.s16 d6, q14
vqmovun.s16 d7, q15
; store the data
vst1.64 {d0}, [r0], r2
vst1.64 {d1}, [r0], r2
vst1.64 {d2}, [r0], r2
vst1.64 {d3}, [r0], r2
vst1.64 {d4}, [r0], r2
vst1.64 {d5}, [r0], r2
vst1.64 {d6}, [r0], r2
vst1.64 {d7}, [r0], r2
vpop {d8-d15}
pop {r4-r9}
bx lr
ENDP ; |vpx_idct8x8_12_add_neon|
END
| Topopiccione/libvpx | vpx_dsp/arm/idct8x8_add_neon.asm | Assembly | bsd-3-clause | 16,296 |
; The MIT License (MIT)
;
; Copyright (c) 2014 Microsoft
;
; Permission is hereby granted, free of charge, to any person obtaining a copy
; of this software and associated documentation files (the "Software"), to deal
; in the Software without restriction, including without limitation the rights
; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
; copies of the Software, and to permit persons to whom the Software is
; furnished to do so, subject to the following conditions:
;
; The above copyright notice and this permission notice shall be included in all
; copies or substantial portions of the Software.
;
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
; SOFTWARE.
;
; Author: Mark Gottscho <mgottscho@ucla.edu>
.code
win_x86_64_asm_revSequentialRead_Word128 proc
; Arguments:
; rcx is address of the last 128-bit word in the array
; rdx is address of the first 128-bit word in the array
; rax holds current 128-bit word address
; xmm0 holds result from reading the memory 128-bit wide
mov rax,rcx ; initialize current word address to start of the array
cmp rax,rdx ; have we reached the first word yet?
jbe done ; if current word address is <= first word address, jump to done
myloop:
; Unroll 256 loads of 128-bit words (16 bytes is 10h) before checking loop condition.
vmovdqa xmm0, xmmword ptr [rax-0000h]
vmovdqa xmm0, xmmword ptr [rax-0010h]
vmovdqa xmm0, xmmword ptr [rax-0020h]
vmovdqa xmm0, xmmword ptr [rax-0030h]
vmovdqa xmm0, xmmword ptr [rax-0040h]
vmovdqa xmm0, xmmword ptr [rax-0050h]
vmovdqa xmm0, xmmword ptr [rax-0060h]
vmovdqa xmm0, xmmword ptr [rax-0070h]
vmovdqa xmm0, xmmword ptr [rax-0080h]
vmovdqa xmm0, xmmword ptr [rax-0090h]
vmovdqa xmm0, xmmword ptr [rax-00A0h]
vmovdqa xmm0, xmmword ptr [rax-00B0h]
vmovdqa xmm0, xmmword ptr [rax-00C0h]
vmovdqa xmm0, xmmword ptr [rax-00D0h]
vmovdqa xmm0, xmmword ptr [rax-00E0h]
vmovdqa xmm0, xmmword ptr [rax-00F0h]
vmovdqa xmm0, xmmword ptr [rax-0100h]
vmovdqa xmm0, xmmword ptr [rax-0110h]
vmovdqa xmm0, xmmword ptr [rax-0120h]
vmovdqa xmm0, xmmword ptr [rax-0130h]
vmovdqa xmm0, xmmword ptr [rax-0140h]
vmovdqa xmm0, xmmword ptr [rax-0150h]
vmovdqa xmm0, xmmword ptr [rax-0160h]
vmovdqa xmm0, xmmword ptr [rax-0170h]
vmovdqa xmm0, xmmword ptr [rax-0180h]
vmovdqa xmm0, xmmword ptr [rax-0190h]
vmovdqa xmm0, xmmword ptr [rax-01A0h]
vmovdqa xmm0, xmmword ptr [rax-01B0h]
vmovdqa xmm0, xmmword ptr [rax-01C0h]
vmovdqa xmm0, xmmword ptr [rax-01D0h]
vmovdqa xmm0, xmmword ptr [rax-01E0h]
vmovdqa xmm0, xmmword ptr [rax-01F0h]
vmovdqa xmm0, xmmword ptr [rax-0200h]
vmovdqa xmm0, xmmword ptr [rax-0210h]
vmovdqa xmm0, xmmword ptr [rax-0220h]
vmovdqa xmm0, xmmword ptr [rax-0230h]
vmovdqa xmm0, xmmword ptr [rax-0240h]
vmovdqa xmm0, xmmword ptr [rax-0250h]
vmovdqa xmm0, xmmword ptr [rax-0260h]
vmovdqa xmm0, xmmword ptr [rax-0270h]
vmovdqa xmm0, xmmword ptr [rax-0280h]
vmovdqa xmm0, xmmword ptr [rax-0290h]
vmovdqa xmm0, xmmword ptr [rax-02A0h]
vmovdqa xmm0, xmmword ptr [rax-02B0h]
vmovdqa xmm0, xmmword ptr [rax-02C0h]
vmovdqa xmm0, xmmword ptr [rax-02D0h]
vmovdqa xmm0, xmmword ptr [rax-02E0h]
vmovdqa xmm0, xmmword ptr [rax-02F0h]
vmovdqa xmm0, xmmword ptr [rax-0300h]
vmovdqa xmm0, xmmword ptr [rax-0310h]
vmovdqa xmm0, xmmword ptr [rax-0320h]
vmovdqa xmm0, xmmword ptr [rax-0330h]
vmovdqa xmm0, xmmword ptr [rax-0340h]
vmovdqa xmm0, xmmword ptr [rax-0350h]
vmovdqa xmm0, xmmword ptr [rax-0360h]
vmovdqa xmm0, xmmword ptr [rax-0370h]
vmovdqa xmm0, xmmword ptr [rax-0380h]
vmovdqa xmm0, xmmword ptr [rax-0390h]
vmovdqa xmm0, xmmword ptr [rax-03A0h]
vmovdqa xmm0, xmmword ptr [rax-03B0h]
vmovdqa xmm0, xmmword ptr [rax-03C0h]
vmovdqa xmm0, xmmword ptr [rax-03D0h]
vmovdqa xmm0, xmmword ptr [rax-03E0h]
vmovdqa xmm0, xmmword ptr [rax-03F0h]
vmovdqa xmm0, xmmword ptr [rax-0400h]
vmovdqa xmm0, xmmword ptr [rax-0410h]
vmovdqa xmm0, xmmword ptr [rax-0420h]
vmovdqa xmm0, xmmword ptr [rax-0430h]
vmovdqa xmm0, xmmword ptr [rax-0440h]
vmovdqa xmm0, xmmword ptr [rax-0450h]
vmovdqa xmm0, xmmword ptr [rax-0460h]
vmovdqa xmm0, xmmword ptr [rax-0470h]
vmovdqa xmm0, xmmword ptr [rax-0480h]
vmovdqa xmm0, xmmword ptr [rax-0490h]
vmovdqa xmm0, xmmword ptr [rax-04A0h]
vmovdqa xmm0, xmmword ptr [rax-04B0h]
vmovdqa xmm0, xmmword ptr [rax-04C0h]
vmovdqa xmm0, xmmword ptr [rax-04D0h]
vmovdqa xmm0, xmmword ptr [rax-04E0h]
vmovdqa xmm0, xmmword ptr [rax-04F0h]
vmovdqa xmm0, xmmword ptr [rax-0500h]
vmovdqa xmm0, xmmword ptr [rax-0510h]
vmovdqa xmm0, xmmword ptr [rax-0520h]
vmovdqa xmm0, xmmword ptr [rax-0530h]
vmovdqa xmm0, xmmword ptr [rax-0540h]
vmovdqa xmm0, xmmword ptr [rax-0550h]
vmovdqa xmm0, xmmword ptr [rax-0560h]
vmovdqa xmm0, xmmword ptr [rax-0570h]
vmovdqa xmm0, xmmword ptr [rax-0580h]
vmovdqa xmm0, xmmword ptr [rax-0590h]
vmovdqa xmm0, xmmword ptr [rax-05A0h]
vmovdqa xmm0, xmmword ptr [rax-05B0h]
vmovdqa xmm0, xmmword ptr [rax-05C0h]
vmovdqa xmm0, xmmword ptr [rax-05D0h]
vmovdqa xmm0, xmmword ptr [rax-05E0h]
vmovdqa xmm0, xmmword ptr [rax-05F0h]
vmovdqa xmm0, xmmword ptr [rax-0600h]
vmovdqa xmm0, xmmword ptr [rax-0610h]
vmovdqa xmm0, xmmword ptr [rax-0620h]
vmovdqa xmm0, xmmword ptr [rax-0630h]
vmovdqa xmm0, xmmword ptr [rax-0640h]
vmovdqa xmm0, xmmword ptr [rax-0650h]
vmovdqa xmm0, xmmword ptr [rax-0660h]
vmovdqa xmm0, xmmword ptr [rax-0670h]
vmovdqa xmm0, xmmword ptr [rax-0680h]
vmovdqa xmm0, xmmword ptr [rax-0690h]
vmovdqa xmm0, xmmword ptr [rax-06A0h]
vmovdqa xmm0, xmmword ptr [rax-06B0h]
vmovdqa xmm0, xmmword ptr [rax-06C0h]
vmovdqa xmm0, xmmword ptr [rax-06D0h]
vmovdqa xmm0, xmmword ptr [rax-06E0h]
vmovdqa xmm0, xmmword ptr [rax-06F0h]
vmovdqa xmm0, xmmword ptr [rax-0700h]
vmovdqa xmm0, xmmword ptr [rax-0710h]
vmovdqa xmm0, xmmword ptr [rax-0720h]
vmovdqa xmm0, xmmword ptr [rax-0730h]
vmovdqa xmm0, xmmword ptr [rax-0740h]
vmovdqa xmm0, xmmword ptr [rax-0750h]
vmovdqa xmm0, xmmword ptr [rax-0760h]
vmovdqa xmm0, xmmword ptr [rax-0770h]
vmovdqa xmm0, xmmword ptr [rax-0780h]
vmovdqa xmm0, xmmword ptr [rax-0790h]
vmovdqa xmm0, xmmword ptr [rax-07A0h]
vmovdqa xmm0, xmmword ptr [rax-07B0h]
vmovdqa xmm0, xmmword ptr [rax-07C0h]
vmovdqa xmm0, xmmword ptr [rax-07D0h]
vmovdqa xmm0, xmmword ptr [rax-07E0h]
vmovdqa xmm0, xmmword ptr [rax-07F0h]
vmovdqa xmm0, xmmword ptr [rax-0800h]
vmovdqa xmm0, xmmword ptr [rax-0810h]
vmovdqa xmm0, xmmword ptr [rax-0820h]
vmovdqa xmm0, xmmword ptr [rax-0830h]
vmovdqa xmm0, xmmword ptr [rax-0840h]
vmovdqa xmm0, xmmword ptr [rax-0850h]
vmovdqa xmm0, xmmword ptr [rax-0860h]
vmovdqa xmm0, xmmword ptr [rax-0870h]
vmovdqa xmm0, xmmword ptr [rax-0880h]
vmovdqa xmm0, xmmword ptr [rax-0890h]
vmovdqa xmm0, xmmword ptr [rax-08A0h]
vmovdqa xmm0, xmmword ptr [rax-08B0h]
vmovdqa xmm0, xmmword ptr [rax-08C0h]
vmovdqa xmm0, xmmword ptr [rax-08D0h]
vmovdqa xmm0, xmmword ptr [rax-08E0h]
vmovdqa xmm0, xmmword ptr [rax-08F0h]
vmovdqa xmm0, xmmword ptr [rax-0900h]
vmovdqa xmm0, xmmword ptr [rax-0910h]
vmovdqa xmm0, xmmword ptr [rax-0920h]
vmovdqa xmm0, xmmword ptr [rax-0930h]
vmovdqa xmm0, xmmword ptr [rax-0940h]
vmovdqa xmm0, xmmword ptr [rax-0950h]
vmovdqa xmm0, xmmword ptr [rax-0960h]
vmovdqa xmm0, xmmword ptr [rax-0970h]
vmovdqa xmm0, xmmword ptr [rax-0980h]
vmovdqa xmm0, xmmword ptr [rax-0990h]
vmovdqa xmm0, xmmword ptr [rax-09A0h]
vmovdqa xmm0, xmmword ptr [rax-09B0h]
vmovdqa xmm0, xmmword ptr [rax-09C0h]
vmovdqa xmm0, xmmword ptr [rax-09D0h]
vmovdqa xmm0, xmmword ptr [rax-09E0h]
vmovdqa xmm0, xmmword ptr [rax-09F0h]
vmovdqa xmm0, xmmword ptr [rax-0A00h]
vmovdqa xmm0, xmmword ptr [rax-0A10h]
vmovdqa xmm0, xmmword ptr [rax-0A20h]
vmovdqa xmm0, xmmword ptr [rax-0A30h]
vmovdqa xmm0, xmmword ptr [rax-0A40h]
vmovdqa xmm0, xmmword ptr [rax-0A50h]
vmovdqa xmm0, xmmword ptr [rax-0A60h]
vmovdqa xmm0, xmmword ptr [rax-0A70h]
vmovdqa xmm0, xmmword ptr [rax-0A80h]
vmovdqa xmm0, xmmword ptr [rax-0A90h]
vmovdqa xmm0, xmmword ptr [rax-0AA0h]
vmovdqa xmm0, xmmword ptr [rax-0AB0h]
vmovdqa xmm0, xmmword ptr [rax-0AC0h]
vmovdqa xmm0, xmmword ptr [rax-0AD0h]
vmovdqa xmm0, xmmword ptr [rax-0AE0h]
vmovdqa xmm0, xmmword ptr [rax-0AF0h]
vmovdqa xmm0, xmmword ptr [rax-0B00h]
vmovdqa xmm0, xmmword ptr [rax-0B10h]
vmovdqa xmm0, xmmword ptr [rax-0B20h]
vmovdqa xmm0, xmmword ptr [rax-0B30h]
vmovdqa xmm0, xmmword ptr [rax-0B40h]
vmovdqa xmm0, xmmword ptr [rax-0B50h]
vmovdqa xmm0, xmmword ptr [rax-0B60h]
vmovdqa xmm0, xmmword ptr [rax-0B70h]
vmovdqa xmm0, xmmword ptr [rax-0B80h]
vmovdqa xmm0, xmmword ptr [rax-0B90h]
vmovdqa xmm0, xmmword ptr [rax-0BA0h]
vmovdqa xmm0, xmmword ptr [rax-0BB0h]
vmovdqa xmm0, xmmword ptr [rax-0BC0h]
vmovdqa xmm0, xmmword ptr [rax-0BD0h]
vmovdqa xmm0, xmmword ptr [rax-0BE0h]
vmovdqa xmm0, xmmword ptr [rax-0BF0h]
vmovdqa xmm0, xmmword ptr [rax-0C00h]
vmovdqa xmm0, xmmword ptr [rax-0C10h]
vmovdqa xmm0, xmmword ptr [rax-0C20h]
vmovdqa xmm0, xmmword ptr [rax-0C30h]
vmovdqa xmm0, xmmword ptr [rax-0C40h]
vmovdqa xmm0, xmmword ptr [rax-0C50h]
vmovdqa xmm0, xmmword ptr [rax-0C60h]
vmovdqa xmm0, xmmword ptr [rax-0C70h]
vmovdqa xmm0, xmmword ptr [rax-0C80h]
vmovdqa xmm0, xmmword ptr [rax-0C90h]
vmovdqa xmm0, xmmword ptr [rax-0CA0h]
vmovdqa xmm0, xmmword ptr [rax-0CB0h]
vmovdqa xmm0, xmmword ptr [rax-0CC0h]
vmovdqa xmm0, xmmword ptr [rax-0CD0h]
vmovdqa xmm0, xmmword ptr [rax-0CE0h]
vmovdqa xmm0, xmmword ptr [rax-0CF0h]
vmovdqa xmm0, xmmword ptr [rax-0D00h]
vmovdqa xmm0, xmmword ptr [rax-0D10h]
vmovdqa xmm0, xmmword ptr [rax-0D20h]
vmovdqa xmm0, xmmword ptr [rax-0D30h]
vmovdqa xmm0, xmmword ptr [rax-0D40h]
vmovdqa xmm0, xmmword ptr [rax-0D50h]
vmovdqa xmm0, xmmword ptr [rax-0D60h]
vmovdqa xmm0, xmmword ptr [rax-0D70h]
vmovdqa xmm0, xmmword ptr [rax-0D80h]
vmovdqa xmm0, xmmword ptr [rax-0D90h]
vmovdqa xmm0, xmmword ptr [rax-0DA0h]
vmovdqa xmm0, xmmword ptr [rax-0DB0h]
vmovdqa xmm0, xmmword ptr [rax-0DC0h]
vmovdqa xmm0, xmmword ptr [rax-0DD0h]
vmovdqa xmm0, xmmword ptr [rax-0DE0h]
vmovdqa xmm0, xmmword ptr [rax-0DF0h]
vmovdqa xmm0, xmmword ptr [rax-0E00h]
vmovdqa xmm0, xmmword ptr [rax-0E10h]
vmovdqa xmm0, xmmword ptr [rax-0E20h]
vmovdqa xmm0, xmmword ptr [rax-0E30h]
vmovdqa xmm0, xmmword ptr [rax-0E40h]
vmovdqa xmm0, xmmword ptr [rax-0E50h]
vmovdqa xmm0, xmmword ptr [rax-0E60h]
vmovdqa xmm0, xmmword ptr [rax-0E70h]
vmovdqa xmm0, xmmword ptr [rax-0E80h]
vmovdqa xmm0, xmmword ptr [rax-0E90h]
vmovdqa xmm0, xmmword ptr [rax-0EA0h]
vmovdqa xmm0, xmmword ptr [rax-0EB0h]
vmovdqa xmm0, xmmword ptr [rax-0EC0h]
vmovdqa xmm0, xmmword ptr [rax-0ED0h]
vmovdqa xmm0, xmmword ptr [rax-0EE0h]
vmovdqa xmm0, xmmword ptr [rax-0EF0h]
vmovdqa xmm0, xmmword ptr [rax-0F00h]
vmovdqa xmm0, xmmword ptr [rax-0F10h]
vmovdqa xmm0, xmmword ptr [rax-0F20h]
vmovdqa xmm0, xmmword ptr [rax-0F30h]
vmovdqa xmm0, xmmword ptr [rax-0F40h]
vmovdqa xmm0, xmmword ptr [rax-0F50h]
vmovdqa xmm0, xmmword ptr [rax-0F60h]
vmovdqa xmm0, xmmword ptr [rax-0F70h]
vmovdqa xmm0, xmmword ptr [rax-0F80h]
vmovdqa xmm0, xmmword ptr [rax-0F90h]
vmovdqa xmm0, xmmword ptr [rax-0FA0h]
vmovdqa xmm0, xmmword ptr [rax-0FB0h]
vmovdqa xmm0, xmmword ptr [rax-0FC0h]
vmovdqa xmm0, xmmword ptr [rax-0FD0h]
vmovdqa xmm0, xmmword ptr [rax-0FE0h]
vmovdqa xmm0, xmmword ptr [rax-0FF0h]
sub rax,1000h ; End of one unrolled loop iteration. Decrement pointer by 256 words of size 16 bytes, which is 4096 bytes.
cmp rax,rdx ; have we reached the first word yet?
jbe done ; if current word address is <= first word address, jump to done
jmp myloop ; continue loop
done:
xor eax,eax ; return 0
ret
win_x86_64_asm_revSequentialRead_Word128 endp
end
| mgottscho/X-Mem | src/win/x86_64/win_x86_64_asm_revSequentialRead_Word128.asm | Assembly | mit | 12,141 |
; Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at
; http://opensource.org/licenses/bsd-license.php
;
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
;
; Module Name:
;
; WriteDr0.Asm
;
; Abstract:
;
; AsmWriteDr0 function
;
; Notes:
;
;------------------------------------------------------------------------------
.code
;------------------------------------------------------------------------------
; UINTN
; EFIAPI
; AsmWriteDr0 (
; IN UINTN Value
; );
;------------------------------------------------------------------------------
AsmWriteDr0 PROC
mov dr0, rcx
mov rax, rcx
ret
AsmWriteDr0 ENDP
END
| google/google-ctf | third_party/edk2/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr0.asm | Assembly | apache-2.0 | 1,218 |
;**************************************************************************
; arch/z80/src/ez80/ez80_restorcontext.asm
;
; Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
; Author: Gregory Nutt <gnutt@nuttx.org>
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions
; are met:
;
; 1. Redistributions of source code must retain the above copyright
; notice, this list of conditions and the following disclaimer.
; 2. Redistributions in binary form must reproduce the above copyright
; notice, this list of conditions and the following disclaimer in
; the documentation and/or other materials provided with the
; distribution.
; 3. Neither the name NuttX nor the names of its contributors may be
; used to endorse or promote products derived from this software
; without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
; FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
; COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
; BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
; OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
; AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
; ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
; POSSIBILITY OF SUCH DAMAGE.
;
;**************************************************************************
;**************************************************************************
; Global Symbols Imported
;**************************************************************************
;**************************************************************************
; Global Symbols Expported
;**************************************************************************
xdef _ez80_restorecontext
;**************************************************************************
; Code
;**************************************************************************
segment CODE
.assume ADL=1
;**************************************************************************
; ez80_restorecontext
;**************************************************************************
_ez80_restorecontext:
; On entry, stack contains return address (not used), then address
; of the register save structure
; Discard the return address, we won't be returning
pop hl
; Get the address of the beginning of the state save area. Each
; pop will increment to the next element of the structure
pop hl ; BC = Address of save structure
ld sp, hl ; SP points to top of storage area
; Disable interrupts while we muck with the alternative registers. The
; Correct interrupt state will be restore below
di
; Restore registers. HL points to the beginning of the reg structure to restore
ex af, af' ; Select alternate AF
pop af ; Offset 0: AF' = I with interrupt state in parity
ex af, af' ; Restore original AF
pop bc ; Offset 1: BC
pop de ; Offset 2: DE
pop ix ; Offset 3: IX
pop iy ; Offset 4: IY
exx ; Use alternate BC/DE/HL
pop hl ; Offset 5: HL' = Stack pointer after return
exx ; Restore original BC/DE/HL
pop hl ; Offset 6: HL
pop af ; Offset 7: AF
; Restore the stack pointer
exx ; Use alternate BC/DE/HL
pop de ; DE' = return address
ld sp, hl ; Set SP = saved stack pointer value before return
push de ; Save return address for ret instruction
exx ; Restore original BC/DE/HL
; Restore interrupt state
ex af, af' ; Recover interrupt state
jp po, noinrestore ; Odd parity, IFF2=0, means disabled
ex af, af' ; Restore AF (before enabling interrupts)
ei ; yes.. Enable interrupts
ret ; and return
noinrestore:
ex af, af' ; Restore AF
ret ; Return with interrupts disabled
end
| gcds/project_xxx | nuttx/arch/z80/src/ez80/ez80_restorecontext.asm | Assembly | bsd-3-clause | 4,138 |
.686
.model flat,stdcall
option casemap:none
include .\bnlib.inc
include .\bignum.inc
.code
bnSub proc uses edi esi ebx bnX:DWORD,bnY:DWORD
;----------------------;
; +x - +y = x-y ;
; +x - -y = +(x+y) ;
; -x - +y = -(x+y) ;
; -x - -y = y-x ;
;----------------------;
mov edi,bnX
mov esi,bnY
mov ebx,[edi].BN.bSigned
mov eax,[esi].BN.bSigned
.if eax == ebx
bnSCreateX edi,esi
invoke bnMov,edi,bnX
invoke bnMov,esi,bnY
call _bn_cmp_array
test eax,eax
.if sign?
xchg esi,edi
xor ebx,1
.endif
mov [edi].BN.bSigned,ebx
call _bn_sub_ignoresign
invoke bnMov,bnX,edi
bnSDestroyX
ret
.endif
call _bn_add_ignoresign
ret
bnSub endp
end | FloydZ/Crypto-Hash | BigNum/Mod/Base/bnSub.asm | Assembly | mit | 680 |
dc.w word_3D9B6-Map_FBZMagneticPendulum
dc.w word_3D9D0-Map_FBZMagneticPendulum
dc.w word_3D9EA-Map_FBZMagneticPendulum
dc.w word_3D9F2-Map_FBZMagneticPendulum
word_3D9B6: dc.w 4 ; DATA XREF: ROM:0003D9AEo
dc.b $F0, 7, 0, 0, $FF, $F0
dc.b $F0, 7, 8, 0, 0, 0
dc.b 0, 1, 0, $14, $FF, $F8
dc.b 0, 1, 8, $14, 0, 0
word_3D9D0: dc.w 4 ; DATA XREF: ROM:0003D9AEo
dc.b $F0, 7, 0, 0, $FF, $F0
dc.b $F0, 7, 8, 0, 0, 0
dc.b $F8, 1, 0, $14, $FF, $F0
dc.b $F8, 1, 8, $14, $FF, $F8
word_3D9EA: dc.w 1 ; DATA XREF: ROM:0003D9AEo
dc.b $F8, 5, 0, 8, $FF, $F8
word_3D9F2: dc.w 2 ; DATA XREF: ROM:0003D9AEo
dc.b $F0, 7, 0, $C, $FF, $F0
dc.b $F0, 7, 8, $C, 0, 0
| TeamASM-Blur/Sonic-3-Blue-Balls-Edition | Working Disassembly/Levels/FBZ/Misc Object Data/Map - Magnetic Pendulum.asm | Assembly | apache-2.0 | 761 |
;;; NASM solution to the 'Reversed Binary Numbers' programming puzzle
;;;
;;; The program expects to read a decimal integer from stdin, reverse the
;;; order of the bits in it, and write the resulting number back to stdout.
;;; It's required to handle integers in the range [1, 1e9], but is designed to
;;; handled the range [0, (1<<32)-1]. However, it's not designed to handle
;;; long lines (e.g. an exaggerated amount of leading zeros) or any non-digit
;;; characters except for newline in the input.
;;;
;;; Main layout of the program:
;;; 1. Read from stdin to a buffer.
;;; 2. Parse the buffer by multiplying the previous result by 10 and adding
;;; the new digit until an ASCII character < '0' is found.
;;; 3. Reverse the integer looping over the bits and adding them to another
;;; register in the reverse order.
;;; 4. Write the result back to the buffer, writing from the end of the
;;; buffer towards the beginning and diving by 10 after each iteration.
;;; 5. Print the contents of the buffer to stdout.
;;; 6. Exit with status code 0 (success).
;;;
;;; Regarding optimizations: To save space, `xor` is used to clear registers
;;; and `test` to compare with zero. Sometimes, instructions might seem out of
;;; order. This is usually done in the hopes of improving performance by
;;; utilizing the CPU pipelines better. Also, at one point a value is saved on
;;; the stack for use in a different part of the program. This is marked (*).
section .text
global _start
_start:
;; eax == 0 and edx == 0 (for Linux >= 2.0)
;; other registers are unpredictable and differ between versions
read_stdin:
;; Read from stdin to the buffer
mov ecx, buffer ; arg: char __user *buf
xor ebx, ebx ; arg: file descriptor 0 (stdin)
mov al, 3 ; syscall: sys_read
mov dl, buf_len-1 ; arg: size_t count, with null-termination
mov edi, ecx ; store address of last byte of the buffer
mov esi, ecx
add edi, edx ; add buffer length - 1 to reach last byte
int 0x80
;; syscalls should preserve everything but eax, hence:
;; ebx == 0
;; edi == &buffer[buf_len-1]
;; esi == &buffer[0]
parse_integer:
;; Parse number in buffer, from left to right, and place it in ebx
cld ; loop in positive direction (left to right)
xor eax, eax
.loop:
shl ebx, 1 ; quick multiplication: x*10 == (x<<1)+(x<<3)
mov edx, ebx
shl edx, 2
add ebx, edx
add ebx, eax ; add recently parsed digit
lodsb
sub al, '0' ; make an integer out of the ASCII digit
jae .loop ; continue for as long as ASCII code is >= '0'
;; eax & (0xffffff00) == 0
;; ebx == parsed number
;; edi == &buffer[buf_len - 1]
write_newline:
;; Write newline character, and prepare for writing the reverse number
mov al, 0x0a ; newline character
std ; loop in negative direction (right to left)
mov ecx, eax ; set denominator to 10 for division later
push edi ; (*) save buffer termination address
stosb
;; eax == 0x0a
;; ebx == parsed number
;; ecx == 0x0a
;; edi == &buffer[buf_len - 2]
reverse:
;; Reverse ebx and place it in eax, by shifting ebx to the right and
;; eax to the left, copying one bit at a time
xor eax, eax
.loop:
shr ebx, 1 ; shift with LSB going into CF (affects ZF)
rcl eax, 1 ; rotate with LSB from CF (doesn't affect ZF)
jnz .loop ; continue while ebx is non-zero
;; eax == reversed number
;; ebx == 0
;; ecx == 0x0a
;; edi == &buffer[buf_len - 2]
write_integer:
;; Write a decimal representation of eax, from right to left
.loop:
xor edx, edx ; clear top half of the numerator (edx:eax)
div ecx
push ax ; save ax while writing the remainder
mov al, dl
add al, '0' ; write ASCII representation of the remainder
stosb
pop ax ; restore ax
test eax, eax
jnz .loop ; loop while quotient is non-zero
;; eax == 0
;; ebx == 0
;; edi == &buffer[(start of output string) - 1]
print_stdout:
;; Print the number to stdout
mov ecx, edi
pop edx ; (*) get buffer termination address
sub edx, ecx ; arg: size_t count (end-start address diff)
inc ecx ; arg: char __user *buf (first digit char)
mov al, 4 ; syscall: sys_write
inc ebx ; arg: file descriptor 1 (stdout)
int 0x80
;; ebx == 1
exit:
;; Exit
mov eax, ebx ; syscall: sys_exit
dec ebx ; arg: status code 0
int 0x80
section .bss
;; This section is zeroed out at startup
buffer resb 64 ; reserving >256 bytes breaks the code
buf_len equ $-buffer
| aliquis/nasm-reversebinary | reversebinary.asm | Assembly | mit | 4,825 |
global _start
section .text
_start: ; for gcc, this should be main() instead
mov eax, 0x4 ; syscall handle for write() - see unistd.h
mov ebx, 0x1 ; first write() parameter - 1 stands for stdout (and 0 is stdin, 2 is stderr, just like in bash)
mov ecx, message ; second write() parameter - pointer to the buffer
mov edx, 0x6 ; third write() parameter - the buffer len
int 0x80 ; interrupt 80 indicates a syscall
mov eax, 0x1 ; syscall handle for exit()
mov ebx, 0x5 ; exit() parameter - the exit code. if you run this app and then go echo $? from a terminal you should see 5 printed
int 0x80 ; syscall
section .data
message: db "foobar" ; db means define byte, i think
| mvendra/sandboxes | asm/asmhellow/helloworld.asm | Assembly | mit | 687 |
; -----------------------------------------------------------------------------
;
; The MIT License (MIT)
;
; Copyright (c) 2014 Jack Maloney
;
; Permission is hereby granted, free of charge, to any person obtaining a copy
; of this software and associated documentation files (the "Software"), to deal
; in the Software without restriction, including without limitation the rights
; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
; copies of the Software, and to permit persons to whom the Software is
; furnished to do so, subject to the following conditions:
;
; The above copyright notice and this permission notice shall be included in all
; copies or substantial portions of the Software.
;
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
; SOFTWARE.
;
; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------
;
; Steel Bootloader
;
; -----------------------------------------------------------------------------
[bits 16]
[org 0x7c00]
start:
mov [BOOT_DRIVE], dl ; Store Boot Drive Info
mov bp, 0xa000 ; Set Stack At Safe Position
mov sp, bp ;
;call enableA20 ; enable the A20 gate
; Notify BIOS of our intent to run in 64-bit long mode
mov ax, 0xec00
mov bl, 2
int 0x15
mov bx, MSG_INIT
call print_string_16
; Load Kernel
mov dh, 20 ; load 20 segments for out kernel
mov bx, 0x0 ; set es indirectly
mov es, bx
mov bx, KERNEL_POS ; (20 x 512) + 1000 is 10,240 and 0x7c00 is 31,744, so we still have some space
mov dl, [BOOT_DRIVE] ; set drive to read from
call disk_load_16 ; read the kernel
call enter_32_bit_pm
jmp $ ; hang
BOOT_DRIVE: db 0
KERNEL_POS: equ 0x1000
MSG_INIT: db 'Initializing...', 0
; load dh number of sectors
; buffer at es:bx
; dl = drive to read from
; reads from second sector = sector after boot sector
disk_load_16:
pusha
;push dh ; save number of sectors
mov ah, 0x02 ; read sectors
mov al, dh ; dh sectors
mov ch, 0x00 ; cylinder 0
mov dh, 0x00 ; head 0
mov cl, 0x02 ; read from second sector (sectors are 1-based)
int 0x13 ; do read
jc .error
popa
ret
.error:
mov bx, .error_msg
call print_string_16
.error_msg:
db 'Error Reading From Disk', 0
; print string in refrenced by bx
print_string_16:
pusha
mov ah, 0x0e ; teletype mode
.loop:
mov al, [bx] ; load char to print
add bx, 1 ; increment address of char
cmp al, 0 ; check if we are done
je .done ;
int 0x10
jmp .loop ; loop
.done:
popa
ret
enter_32_bit_pm:
cli ; disable interupts - no interupt table
lgdt [GDT32.Ptr] ; Load the descriptor table
mov eax, cr0
or eax, 00000001b
mov cr0, eax
jmp GDT32.Code:protected_mode ; clear the pipline by doing a far jump
; GDT - Global Descriptor Table
GDT32:
.Null: equ $ - GDT32
dq 0x0 ; 8 bytes of zeros
dq 0x0 ; each dd (double word) is 4 bytes
.Code: equ $ - GDT32
dw 0xffff ; Limit - part 1
dw 0x0 ; Base which is 0
db 0x0 ; Base - part 2
db 10011010b ; Flags - part 1
db 11001111b ; Flags - part 2 and Limit part 2 xxxx|xxxx
db 0x0 ; Base - part 3
; same as gdt_code except for code byte in flags
.Data: equ $ - GDT32
dw 0xffff ; Limit - part 1
dw 0x0 ; Base which is 0
db 0x0 ; Base - part 2
db 10010010b ; Flags - part 1
db 11001111b ; Flags - part 2 and Limit part 2 xxxx|xxxx
db 0x0 ; Base - part 3
.End: ; To calculate the size of the gdt
.Ptr:
dw $ - GDT32 - 1 ; size of GDT
dq GDT32 ; GDT Refrence
; Enable the A20 gate
enableA20:
in al, 0x64
test al, 0x02
jnz enableA20
mov al, 0xD1
out 0x64, al
.check:
in al, 0x64
test al, 0x02
jnz .check
mov al, 0xDF
out 0x60, al
; -----------------------------------------------------------------------------
; 32-Bit PROTECTED MODE
[bits 32]
protected_mode:
call enter_64_bit_lm ; go into long mode
jmp $ ; hang
enter_64_bit_lm:
mov ecx, 0xC0000080 ; Set the C-register to 0xC0000080, which is the EFER MSR.
rdmsr ; Read from the model-specific register.
or eax, 1 << 8 ; Set the LM-bit which is the 9th bit (bit 8).
wrmsr ; Write to the model-specific register.
mov eax, cr0 ; Set the A-register to control register 0.
or eax, 1 << 31 ; Set the PG-bit, which is the 32nd bit (bit 31).
mov cr0, eax ; Set control register 0 to the A-register.
jmp long_mode ; jump to long mode
; -----------------------------------------------------------------------------
; 32-Bit LONG MODE
long_mode:
lgdt [GDT64.Ptr] ; Load 64-Bit Descriptor Table
jmp GDT64.Code:long_mode_64
; -----------------------------------------------------------------------------
; 64-Bit LONG MODE
[bits 64]
; Launch The Kernel
long_mode_64:
; Fall Through
launch_kernel_64:
call KERNEL_POS ; where we loaded our kernel in memory
jmp $ ; hang
GDT64:
.Null: equ $ - GDT64
dq 0x0
dq 0x0
.Code: equ $ - GDT64
dw 0x0
dw 0x0
db 0x0
db 10011000b
db 00100000b
db 0x0
.Data: equ $ - GDT64
dw 0x0
dw 0x0
db 0x0
db 10010000b
db 00000000b
db 0x0
.End:
.Ptr:
dw $ - GDT64 - 1
dq GDT64
; Padding and magic number.
times 510 - ($-$$) db 0
dw 0xaa55
| jmmaloney4/steel-os | boot/boot.asm | Assembly | mit | 6,130 |
org 00h
mov p1,#0ffh
mov a,#0Eh
rs bit p2.0
rw bit p2.1
en bit p2.2
start:
mov a, #38h
acall command
call delay
call delay
mov a,#0Eh
acall command
call delay
call delay
mov a,#01h
acall command
call delay
call delay
mov a,#06h
acall command
call delay
call delay
mov a,#80h
acall command
call delay
call delay
mov a,#'T'
acall DataRead
call delay
mov a,#'H'
acall DataRead
call delay
mov a,#'I'
acall DataRead
call delay
mov a,#'S'
acall DataRead
call delay
mov a,#14h
acall command
call delay
mov a,#'I'
acall DataRead
call delay
mov a,#'S'
acall DataRead
call delay
mov a,#14h
acall command
call delay
mov a,#'E'
acall DataRead
call delay
mov a,#'L'
acall DataRead
call delay
mov a,#'D'
acall DataRead
call delay
mov a,#'I'
acall DataRead
call delay
mov a,#01h
acall command
call delay
mov a, #0C0h
acall command
call delay
call delay
mov a,#'U'
acall DataRead
call delay
mov a,#14h
acall command
call delay
mov a,#'A'
acall DataRead
call delay
mov a,#'R'
acall DataRead
call delay
mov a,#'E'
acall DataRead
call delay
mov a,#14h
acall command
call delay
mov a,#'W'
acall DataRead
call delay
mov a,#'E'
acall DataRead
call delay
mov a,#'L'
acall DataRead
call delay
mov a,#'C'
acall DataRead
call delay
mov a,#'O'
acall DataRead
call delay
mov a,#'M'
acall DataRead
call delay
mov a,#'E'
acall DataRead
call delay
jmp start
command:
acall ready
mov p1,a
clr p2.0
clr p2.1
setb p2.2
clr p2.2
ret
DataRead:
acall ready
mov p1,a
setb p2.0
clr p2.1
setb p2.2
clr p2.2
ret
ready:
setb p1.7
clr p2.0
setb p2.1
here:
setb p2.2
clr p2.2
Jz here
jnb p1.7,here
ret
delay: mov r0,#255
delay1: mov r1,#255
delay2:nop
djnz r1,delay2
djnz r0,delay1
ret
end
| chudimercy/digital-timer | assembly lan_code_3/lcd2.asm | Assembly | mit | 1,649 |
.ORIG x3400
;Simple 4-bit LFSR Based Pseudo-random number generator
;Checkout wikipedia for a visual:
; en.wikipedia.org/wiki/Linear_feedback_shift_register
;Note: I am implementing it backwards from wikipedia.
; i.e. the taps (inputs to xor) are the msbs and I shift left rather
; than right
;==================================
; R6 = Stack Pointer (software support)
; R7 = Return Address (hardware support)
; [IN] Nothing
; [OUT] R0 = some pseudo random number
;-----------------------
;prologue; Saves state of machine to stack
;-----------------------
;Stack 'grows' down towards lower addresses (pushing)
;Return Address (R7) saved by caller BEFORE jumping to subroutine,
;since hardware will overwrite the previous (and probably important)
; Value in R7 during a JSR or JSRR instructions
;@ STR R7, R6, #0
;@ ADD R6, R6, #-1
;------------------
;Push R1
STR R1, R6, #0
ADD R6, R6, #-1 ; ------------------
; The Stack Frame
;Push R2 ;--------------------
STR R2, R6, #0 ; NOTE: SP == stack pointer
ADD R6, R6, #-1 ;
;
;Push R3 ; <- Lower Addresses
STR R3, R6, #0 ; |____| <- "Top" of stack (SP after pushing registers)
ADD R6, R6, #-1 ; | R4 |
; | R3 |
;Push R4 ; | R2 |
STR R4, R6, #0 ; | R1 |
ADD R6, R6, #-1 ; | R7 | <- "Bottom" Of Stack
; <- High Addresses
;---INIT---------------
LEA R0, SEED
LDR R0, R0, #0
AND R1, R0, #8 ;Mask msb (first tap) ; A
AND R2, R0, #4 ;Mask second tap ; B
ADD R2, R2, R2 ;Align taps (B = B << 1)
;Shift and Mask low bits of random num
ADD R0, R0, R0 ;rng = rng << 1
AND R0, R0, xF ;rng = rng & 0x000F
;-----------------------
;XOR Bits
;-----------------------
NOT R3, R1 ;!A
AND R3, R3, R2 ;!AB
NOT R4, R2 ;!B
AND R4, R4, R1 ;A!B
;Whoever thought it was a good idea to leave
;out XOR and OR is evil
;OR = !(!x!y)
;OR R2, R3, R4 ;R2 = !AB + A!B
NOT R3, R3 ;!x
NOT R4, R4 ;!y
AND R2, R3, R4 ;!(!x!y) = !(!x) + !(!y) = !!x + !!y = x + y
BRz RngEpilogue ;If 0 then 'make lsb 0'
ADD R0, R0, #1 ;Else Add a 1
;-----------------------
;Epilogue
;-----------------------
RngEpilogue
LEA R1, SEED
STR R0, R1, #0 ;Save our random number for next time
;Pop R4
ADD R6, R6, #1 ; ------------------
LDR R4, R6, #0 ; The Stack Frame
;--------------------
;Pop R3 ; NOTE: SP == stack pointer
ADD R6, R6, #1 ;
LDR R3, R6, #0 ;
; <- Lower Addresses
;Pop R2 ; |____|
ADD R6, R6, #1 ; |____|
LDR R2, R6, #0 ; |____|
; |____|
;Pop R1 ; |____|
ADD R6, R6, #1 ; |____| <- SP after popping registers
LDR R1, R6, #0 ; <- High Addresses
;Return Address Popped by caller (R7) otherwise
; RET will jump to wrong address
; FYI RET = JMP R7
;@ ADD R6, R6, #1
;@ LDR R7, R6, #0
RET ;Return R0 = Random Number
;=====================
;Constants
;=====================
SEED .FILL x0003 ;Uses the bottom 4 bits for number
;Note: we will overwrite the seed value after we are done so that
;each call to R0 = rand() gives a different number
.END
| mbartling/lc3Game | rng.asm | Assembly | mit | 3,196 |
global start
section .text
bits 32 ;32-bit instructions in protected mode
;64-bit in long mode
start:
;print `Hello, World!` to screen
mov dword [0xB8000], 0x2F652F48
mov dword [0xB8004], 0x2F6C2F6C
mov dword [0xB8008], 0x2F2C2F6F
mov dword [0xB800C], 0x2F572F20
mov dword [0xB8010], 0x2F722F6F
mov dword [0xB8014], 0x2F642F6C
mov word [0xB8018], 0x2F21
hlt ;halt the CPU
| yuhc/min-kernel-x86 | src/arch/x86_64/boot_simple.asm | Assembly | mit | 445 |
//; ---------------------------------------------------------------------------
//; General ingame variables and stuff
//; ---------------------------------------------------------------------------
define Bank8Num $48
define BankANum $49
define PlayerXLo $83
define PlayerXHi $95
define PlayerYLo $b9
define PlayerYHi $cb
define ExitToScreen $0568
define ExitToPos $0569
define MapHeader $67ee
define MapWidth {MapHeader}+0
| devinacker/kale | src/patches/vars.asm | Assembly | mit | 470 |
; Listing generated by Microsoft (R) Optimizing Compiler Version 19.00.23506.0
TITLE D:\Projects\TaintAnalysis\AntiTaint\Epilog\src\func.c
.686P
.XMM
include listing.inc
.model flat
INCLUDELIB MSVCRT
INCLUDELIB OLDNAMES
PUBLIC ___local_stdio_printf_options
PUBLIC __vfprintf_l
PUBLIC _printf
PUBLIC _func
PUBLIC _main
EXTRN __imp____acrt_iob_func:PROC
EXTRN __imp____stdio_common_vfprintf:PROC
EXTRN _gets:PROC
_DATA SEGMENT
COMM ?_OptionsStorage@?1??__local_stdio_printf_options@@9@9:QWORD ; `__local_stdio_printf_options'::`2'::_OptionsStorage
_DATA ENDS
; Function compile flags: /Odtpy
; File d:\projects\taintanalysis\antitaint\epilog\src\func.c
_TEXT SEGMENT
_main PROC
; 17 : {
push ebp
mov ebp, esp
; 18 : func();
call _func
; 19 : return 0;
xor eax, eax
; 20 : }
pop ebp
ret 0
_main ENDP
_TEXT ENDS
; Function compile flags: /Odtpy
; File d:\projects\taintanalysis\antitaint\epilog\src\func.c
_TEXT SEGMENT
_buf$ = -8 ; size = 8
_func PROC
; 10 : {
push ebp
mov ebp, esp
sub esp, 8
; 11 : char buf[8];
; 12 : gets(buf);
lea eax, DWORD PTR _buf$[ebp]
push eax
call _gets
add esp, 4
; 13 : printf(buf);
lea ecx, DWORD PTR _buf$[ebp]
push ecx
call _printf
add esp, 4
; 14 : }
mov esp, ebp
pop ebp
ret 0
_func ENDP
_TEXT ENDS
; Function compile flags: /Odtpy
; File c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h
; COMDAT _printf
_TEXT SEGMENT
__Result$ = -8 ; size = 4
__ArgList$ = -4 ; size = 4
__Format$ = 8 ; size = 4
_printf PROC ; COMDAT
; 950 : {
push ebp
mov ebp, esp
sub esp, 8
; 951 : int _Result;
; 952 : va_list _ArgList;
; 953 : __crt_va_start(_ArgList, _Format);
lea eax, DWORD PTR __Format$[ebp+4]
mov DWORD PTR __ArgList$[ebp], eax
; 954 : _Result = _vfprintf_l(stdout, _Format, NULL, _ArgList);
mov ecx, DWORD PTR __ArgList$[ebp]
push ecx
push 0
mov edx, DWORD PTR __Format$[ebp]
push edx
push 1
call DWORD PTR __imp____acrt_iob_func
add esp, 4
push eax
call __vfprintf_l
add esp, 16 ; 00000010H
mov DWORD PTR __Result$[ebp], eax
; 955 : __crt_va_end(_ArgList);
mov DWORD PTR __ArgList$[ebp], 0
; 956 : return _Result;
mov eax, DWORD PTR __Result$[ebp]
; 957 : }
mov esp, ebp
pop ebp
ret 0
_printf ENDP
_TEXT ENDS
; Function compile flags: /Odtpy
; File c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h
; COMDAT __vfprintf_l
_TEXT SEGMENT
__Stream$ = 8 ; size = 4
__Format$ = 12 ; size = 4
__Locale$ = 16 ; size = 4
__ArgList$ = 20 ; size = 4
__vfprintf_l PROC ; COMDAT
; 638 : {
push ebp
mov ebp, esp
; 639 : return __stdio_common_vfprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, _Stream, _Format, _Locale, _ArgList);
mov eax, DWORD PTR __ArgList$[ebp]
push eax
mov ecx, DWORD PTR __Locale$[ebp]
push ecx
mov edx, DWORD PTR __Format$[ebp]
push edx
mov eax, DWORD PTR __Stream$[ebp]
push eax
call ___local_stdio_printf_options
mov ecx, DWORD PTR [eax+4]
push ecx
mov edx, DWORD PTR [eax]
push edx
call DWORD PTR __imp____stdio_common_vfprintf
add esp, 24 ; 00000018H
; 640 : }
pop ebp
ret 0
__vfprintf_l ENDP
_TEXT ENDS
; Function compile flags: /Odtpy
; File c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\corecrt_stdio_config.h
; COMDAT ___local_stdio_printf_options
_TEXT SEGMENT
___local_stdio_printf_options PROC ; COMDAT
; 73 : {
push ebp
mov ebp, esp
; 74 : static unsigned __int64 _OptionsStorage;
; 75 : return &_OptionsStorage;
mov eax, OFFSET ?_OptionsStorage@?1??__local_stdio_printf_options@@9@9 ; `__local_stdio_printf_options'::`2'::_OptionsStorage
; 76 : }
pop ebp
ret 0
___local_stdio_printf_options ENDP
_TEXT ENDS
END
| Dovgalyuk/AntiTaint | Epilog/asm/MSVC2015/func-omitfp.asm | Assembly | apache-2.0 | 3,980 |
bits 16
; glb intptr_t : int
; glb uintptr_t : unsigned
; glb intmax_t : int
; glb uintmax_t : unsigned
; glb int8_t : signed char
; glb int_least8_t : signed char
; glb int_fast8_t : signed char
; glb uint8_t : unsigned char
; glb uint_least8_t : unsigned char
; glb uint_fast8_t : unsigned char
; glb int16_t : short
; glb int_least16_t : short
; glb int_fast16_t : short
; glb uint16_t : unsigned short
; glb uint_least16_t : unsigned short
; glb uint_fast16_t : unsigned short
; glb int32_t : int
; glb int_least32_t : int
; glb int_fast32_t : int
; glb uint32_t : unsigned
; glb uint_least32_t : unsigned
; glb uint_fast32_t : unsigned
; glb imaxdiv_t : struct <something>
; glb bool_t : int
; glb pointer_t : * unsigned char
; glb funcion_t : * (
; prm <something> : * void
; ) * void
; glb manejador_t : * (void) void
; glb rti_t : * (void) void
; glb isr_t : * (void) void
; glb handler_t : * (void) void
; glb retardarThread_t : * (void) int
; glb ptrTVI_t : * * (void) void
; glb modoSO1_t : int
; glb lh_t : struct <something>
; glb address_t : struct <something>
; glb uPtrAdr_t : union <something>
; glb pid_t : int
; glb tid_t : int
; glb uid_t : int
; glb gid_t : int
; glb pindx_t : int
; glb tindx_t : int
; glb df_t : int
; glb dfs_t : int
; glb rindx_t : int
; glb HWLIST_t : unsigned short
; glb KBDFLAGS_t : unsigned short
; glb KBDSTATUS_t : unsigned short
; glb VIDEOCONTROL_t : unsigned char
; glb DRECSTATUS_t : unsigned char
; glb DMOTORSTATUS_t : unsigned char
; glb FDOPSTATUS_t : unsigned char
; glb VIDEOSWITCHES_t : unsigned char
; glb VGAOPTIONS_t : unsigned char
; glb VIDEOSAVETBL_t : struct <something>
; RPN'ized expression: "4 "
; Expanded expression: "4 "
; Expression value: 4
; RPN'ized expression: "25 "
; Expanded expression: "25 "
; Expression value: 25
; RPN'ized expression: "20 "
; Expanded expression: "20 "
; Expression value: 20
; RPN'ized expression: "9 "
; Expanded expression: "9 "
; Expression value: 9
; glb VIDEOPARAM_t : struct <something>
; RPN'ized expression: "256 "
; Expanded expression: "256 "
; Expression value: 256
; RPN'ized expression: "4 "
; Expanded expression: "4 "
; Expression value: 4
; RPN'ized expression: "3 "
; Expanded expression: "3 "
; Expression value: 3
; RPN'ized expression: "16 "
; Expanded expression: "16 "
; Expression value: 16
; RPN'ized expression: "7 "
; Expanded expression: "7 "
; Expression value: 7
; RPN'ized expression: "8 "
; Expanded expression: "8 "
; Expression value: 8
; RPN'ized expression: "2 "
; Expanded expression: "2 "
; Expression value: 2
; RPN'ized expression: "2 "
; Expanded expression: "2 "
; Expression value: 2
; RPN'ized expression: "5 "
; Expanded expression: "5 "
; Expression value: 5
; RPN'ized expression: "2 "
; Expanded expression: "2 "
; Expression value: 2
; RPN'ized expression: "3 "
; Expanded expression: "3 "
; Expression value: 3
; RPN'ized expression: "4 "
; Expanded expression: "4 "
; Expression value: 4
; RPN'ized expression: "11 "
; Expanded expression: "11 "
; Expression value: 11
; RPN'ized expression: "7 "
; Expanded expression: "7 "
; Expression value: 7
; RPN'ized expression: "68 "
; Expanded expression: "68 "
; Expression value: 68
; RPN'ized expression: "16 "
; Expanded expression: "16 "
; Expression value: 16
; glb BIOSAREA_t : struct <something>
; glb ptrBiosArea : * struct <something>
; glb ptrFechaBios : * unsigned char
; glb ptrBiosArea : * struct <something>
section .data
align 4
global _ptrBiosArea
_ptrBiosArea:
; =
; RPN'ized expression: "0 "
; Expanded expression: "0 "
; Expression value: 0
dd 0
; glb ptrFechaBios : * unsigned char
section .data
align 4
global _ptrFechaBios
_ptrFechaBios:
; =
; glb <something> : * unsigned char
; RPN'ized expression: "1048565 (something1) "
; Expanded expression: "1048565 "
dd 1048565
; Syntax/declaration table/stack:
; Bytes used: 2655/40960
; Macro table:
; Macro __SMALLER_C__ = `0x0100`
; Macro __SMALLER_C_32__ = ``
; Macro __HUGE__ = ``
; Macro __SMALLER_C_SCHAR__ = ``
; Bytes used: 74/5120
; Identifier table:
; Ident __floatsisf
; Ident __floatunsisf
; Ident __fixsfsi
; Ident __fixunssfsi
; Ident __addsf3
; Ident __subsf3
; Ident __negsf2
; Ident __mulsf3
; Ident __divsf3
; Ident __lesf2
; Ident __gesf2
; Ident intptr_t
; Ident uintptr_t
; Ident intmax_t
; Ident uintmax_t
; Ident int8_t
; Ident int_least8_t
; Ident int_fast8_t
; Ident uint8_t
; Ident uint_least8_t
; Ident uint_fast8_t
; Ident int16_t
; Ident int_least16_t
; Ident int_fast16_t
; Ident uint16_t
; Ident uint_least16_t
; Ident uint_fast16_t
; Ident int32_t
; Ident int_least32_t
; Ident int_fast32_t
; Ident uint32_t
; Ident uint_least32_t
; Ident uint_fast32_t
; Ident <something>
; Ident quot
; Ident rem
; Ident imaxdiv_t
; Ident FALSE
; Ident TRUE
; Ident bool_t
; Ident pointer_t
; Ident funcion_t
; Ident manejador_t
; Ident rti_t
; Ident isr_t
; Ident handler_t
; Ident retardarThread_t
; Ident ptrTVI_t
; Ident modoSO1_Bin
; Ident modoSO1_Exe
; Ident modoSO1_Bs
; Ident modoSO1_t
; Ident lo
; Ident hi
; Ident lh_t
; Ident offset
; Ident segment
; Ident address_t
; Ident ptr
; Ident adr
; Ident uPtrAdr_t
; Ident pid_t
; Ident tid_t
; Ident uid_t
; Ident gid_t
; Ident pindx_t
; Ident tindx_t
; Ident df_t
; Ident dfs_t
; Ident rindx_t
; Ident HWLIST_t
; Ident KBDFLAGS_t
; Ident KBDSTATUS_t
; Ident VIDEOCONTROL_t
; Ident DRECSTATUS_t
; Ident DMOTORSTATUS_t
; Ident FDOPSTATUS_t
; Ident VIDEOSWITCHES_t
; Ident VGAOPTIONS_t
; Ident VIDEO_paramtbl
; Ident VIDEO_dynsavearea
; Ident VIDEO_text_charset
; Ident VIDEO_graph_charset
; Ident VIDEO_savetbl2
; Ident VIDEOSAVETBL_t
; Ident VPARAM_width
; Ident VPARAM_height
; Ident VPARAM_hchar
; Ident VPARAM_pagesize
; Ident VPARAM_SEQC
; Ident VPARAM_MISC
; Ident VPARAM_CRTC
; Ident VPARAM_ATC
; Ident VPARAM_GRC
; Ident VIDEOPARAM_t
; Ident IVT
; Ident COM_base
; Ident LPT_base
; Ident XBDA_seg
; Ident HW_list
; Ident relleno1
; Ident basemem_K
; Ident relleno2
; Ident KBD_flags
; Ident relleno3
; Ident KBD_bufhead
; Ident KBD_buftail
; Ident KBD_buffer
; Ident dRecStatus
; Ident dMotorStatus
; Ident motorShutoffCounter
; Ident fdOpStatus
; Ident relleno4
; Ident VIDEO_mode
; Ident VIDEO_width
; Ident VIDEO_pagesize
; Ident VIDEO_pageoff
; Ident CURSOR_pos
; Ident CURSOR_shape
; Ident VIDEO_pagActiva
; Ident CRTC_base
; Ident CRT_MODE
; Ident CRT_PALETTE
; Ident relleno5
; Ident BIOS_timer
; Ident BIOS_overflow
; Ident BIOS_ctrlbreak
; Ident BIOS_POSTreset
; Ident relleno6
; Ident BIOS_HD_cnt
; Ident relleno7
; Ident LPT_timeout
; Ident BIOS_4B_flags
; Ident COM_timeout
; Ident KBD_start
; Ident KBD_end1
; Ident VIDEO_lastrow
; Ident VIDEO_hchar
; Ident VIDEO_control
; Ident VIDEO_switches
; Ident VGA_options
; Ident VGA_DCC_index
; Ident relleno8
; Ident KBD_status
; Ident TIMER_waitflag
; Ident TIMER_waitmks
; Ident TIMER_active
; Ident relleno9
; Ident VIDEO_ptrtable
; Ident relleno10
; Ident IAC
; Ident BIOSAREA_t
; Ident ptrBiosArea
; Ident ptrFechaBios
; Bytes used: 1824/16384
; Next label number: 2
; Compilation succeeded.
| so1h/so1h | PRACT0/SO1HPUB/asm/biosdata.asm | Assembly | bsd-2-clause | 7,022 |
; (tentative of) multi-subsystem PE
; would display Hello World no matter what the subsystem.
; not working, need work on imports loading
%include '..\..\standard_hdr.asm'
SUBSYSTEM equ IMAGE_SUBSYSTEM_WINDOWS_CUI
;CARACTERISTICS EQU IMAGE_FILE_EXECUTABLE_IMAGE | IMAGE_FILE_32BIT_MACHINE
STD_OUTPUT_HANDLE equ -11
EntryPoint:
pushad
push cs
pop eax
cmp ax, 01bh ; XP user mode ?
jz not_driver
cmp ax, 023h ; Win7 user mode
jz not_driver
jmp driver
nop
not_driver:
popad
mov eax, [OPTIONAL_HEADER.Subsystem]
cmp eax, 3
jz console
cmp eax, 2
jz gui
jmp end_
nop
console:
push STD_OUTPUT_HANDLE ; DWORD nStdHandle
call GetStdHandle
mov [hConsoleOutput], eax
push 0 ; LPVOID lpReserved
push lpNumbersOfCharsWritten ; LPWORD lpNumbersOfCharsWritten
push HELLOWORLD_LEN ; DWORD nNumbersOfCharsToWrite
push helloworld ; VOID *lpBuffer
push dword [hConsoleOutput] ; HANDLE hConsoleOutput
call WriteConsoleA
jmp end_
align 16, int3
nop
driver:
;%reloc 1
push helloworld ; PCHAR Format
; call DbgPrint
add esp, 4
popad
mov eax, STATUS_DEVICE_CONFIGURATION_ERROR
retn 8
align 16, int3
;%reloc 2
;IMPORT ntoskrnl.exe!DbgPrint
align 16, int3
;%reloc 2
;%IMPORT kernel32.dll!GetStdHandle
;%reloc 2
;%IMPORT kernel32.dll!WriteConsoleA
align 16, int3
gui:
push MB_ICONINFORMATION ; UINT uType
push tada ; LPCTSTR lpCaption
push helloworld ; LPCTSTR lpText
push 0 ; HWND hWnd
call MessageBoxA
jmp end_
align 16, int3
;%reloc 2
;%IMPORT user32.dll!MessageBoxA
align 16, int3
end_:
push 0 ; UINT uExitCode
call ExitProcess
retn
align 16, int3
;%reloc 2
;%IMPORT kernel32.dll!ExitProcess
align 16, int3
lpNumbersOfCharsWritten dd 0
hConsoleOutput dd 0
align 16, db 0
tada db "Tada!", 0
helloworld db "Hello World!"
HELLOWORLD_LEN equ $ - helloworld
db 0
align 16, db 0
;%IMPORTS
align 16, db 0
;%relocs
%include '..\..\standard_ftr.asm'
; Ange Albertini, BSD Licence 2011 | angea/corkami | wip/MakePE/examples/PE/multisub.asm | Assembly | bsd-2-clause | 2,302 |
@ This file was created from a .asm file
@ using the ads2gas.pl script.
.equ DO1STROUNDING, 0
.equ ARCH_ARM , 1
.equ ARCH_MIPS , 0
.equ ARCH_X86 , 0
.equ ARCH_X86_64 , 0
.equ ARCH_PPC32 , 0
.equ ARCH_PPC64 , 0
.equ HAVE_EDSP , 1
.equ HAVE_MEDIA , 1
.equ HAVE_NEON , 0
.equ HAVE_MIPS32 , 0
.equ HAVE_DSPR2 , 0
.equ HAVE_MMX , 0
.equ HAVE_SSE , 0
.equ HAVE_SSE2 , 0
.equ HAVE_SSE3 , 0
.equ HAVE_SSSE3 , 0
.equ HAVE_SSE4_1 , 0
.equ HAVE_ALTIVEC , 0
.equ HAVE_VPX_PORTS , 1
.equ HAVE_STDINT_H , 1
.equ HAVE_ALT_TREE_LAYOUT , 0
.equ HAVE_PTHREAD_H , 1
.equ HAVE_SYS_MMAN_H , 1
.equ HAVE_UNISTD_H , 1
.equ CONFIG_EXTERNAL_BUILD , 1
.equ CONFIG_INSTALL_DOCS , 0
.equ CONFIG_INSTALL_BINS , 0
.equ CONFIG_INSTALL_LIBS , 0
.equ CONFIG_INSTALL_SRCS , 0
.equ CONFIG_DEBUG , 0
.equ CONFIG_GPROF , 0
.equ CONFIG_GCOV , 0
.equ CONFIG_RVCT , 0
.equ CONFIG_GCC , 1
.equ CONFIG_MSVS , 0
.equ CONFIG_PIC , 1
.equ CONFIG_BIG_ENDIAN , 0
.equ CONFIG_CODEC_SRCS , 0
.equ CONFIG_DEBUG_LIBS , 0
.equ CONFIG_FAST_UNALIGNED , 1
.equ CONFIG_MEM_MANAGER , 0
.equ CONFIG_MEM_TRACKER , 0
.equ CONFIG_MEM_CHECKS , 0
.equ CONFIG_MD5 , 1
.equ CONFIG_DEQUANT_TOKENS , 0
.equ CONFIG_DC_RECON , 0
.equ CONFIG_RUNTIME_CPU_DETECT , 0
.equ CONFIG_POSTPROC , 1
.equ CONFIG_MULTITHREAD , 1
.equ CONFIG_INTERNAL_STATS , 0
.equ CONFIG_VP8_ENCODER , 1
.equ CONFIG_VP8_DECODER , 1
.equ CONFIG_VP9_ENCODER , 0
.equ CONFIG_VP9_DECODER , 1
.equ CONFIG_VP8 , 1
.equ CONFIG_VP9 , 1
.equ CONFIG_ENCODERS , 1
.equ CONFIG_DECODERS , 1
.equ CONFIG_STATIC_MSVCRT , 0
.equ CONFIG_SPATIAL_RESAMPLING , 1
.equ CONFIG_REALTIME_ONLY , 1
.equ CONFIG_ONTHEFLY_BITPACKING , 0
.equ CONFIG_ERROR_CONCEALMENT , 0
.equ CONFIG_SHARED , 0
.equ CONFIG_STATIC , 1
.equ CONFIG_SMALL , 0
.equ CONFIG_POSTPROC_VISUALIZER , 0
.equ CONFIG_OS_SUPPORT , 1
.equ CONFIG_UNIT_TESTS , 0
.equ CONFIG_MULTI_RES_ENCODING , 1
.equ CONFIG_TEMPORAL_DENOISING , 1
.equ CONFIG_EXPERIMENTAL , 0
.equ CONFIG_CSM , 0
.equ CONFIG_LOSSLESS , 0
.equ CONFIG_NEW_MVREF , 0
.equ CONFIG_IMPLICIT_SEGMENTATION , 0
.equ CONFIG_NEWBINTRAMODES , 0
.equ CONFIG_COMP_INTERINTRA_PRED , 0
.equ CONFIG_TX64X64 , 0
.equ CONFIG_DWTDCTHYBRID , 0
.equ CONFIG_CNVCONTEXT , 0
.equ CONFIG_NEWCOEFCONTEXT , 0
.equ CONFIG_ENABLE_6TAP , 0
.equ CONFIG_ABOVESPREFMV , 0
.section .note.GNU-stack,"",%progbits
| matsumoto-r/synciga | src/third_party/libvpx/source/config/linux/arm/vpx_config.asm | Assembly | bsd-3-clause | 2,373 |
;--------------------------------------------------------
; File Created by SDCC : free open source ANSI-C Compiler
; Version 3.3.0 #8604 (Dec 30 2013) (Linux)
; This file was generated Tue Jul 7 11:41:13 2015
;--------------------------------------------------------
.module crc
.optsdcc -mmcs51 --model-large
;--------------------------------------------------------
; Public variables in this module
;--------------------------------------------------------
.globl _SDN
.globl _NSS1
.globl _IRQ
.globl _BUTTON_DOWN
.globl _BUTTON_UP
.globl _BUTTON_ENTER
.globl _LED_GREEN
.globl _LED_RED
.globl _SPI0EN
.globl _TXBMT0
.globl _NSS0MD0
.globl _NSS0MD1
.globl _RXOVRN0
.globl _MODF0
.globl _WCOL0
.globl _SPIF0
.globl _AD0CM0
.globl _AD0CM1
.globl _AD0CM2
.globl _AD0WINT
.globl _AD0BUSY
.globl _AD0INT
.globl _BURSTEN
.globl _AD0EN
.globl _CCF0
.globl _CCF1
.globl _CCF2
.globl _CCF3
.globl _CCF4
.globl _CCF5
.globl _CR
.globl _CF
.globl _P
.globl _F1
.globl _OV
.globl _RS0
.globl _RS1
.globl _F0
.globl _AC
.globl _CY
.globl _T2XCLK
.globl _T2RCLK
.globl _TR2
.globl _T2SPLIT
.globl _TF2CEN
.globl _TF2LEN
.globl _TF2L
.globl _TF2H
.globl _SI
.globl _ACK
.globl _ARBLOST
.globl _ACKRQ
.globl _STO
.globl _STA
.globl _TXMODE
.globl _MASTER
.globl _PX0
.globl _PT0
.globl _PX1
.globl _PT1
.globl _PS0
.globl _PT2
.globl _PSPI0
.globl _SPI1EN
.globl _TXBMT1
.globl _NSS1MD0
.globl _NSS1MD1
.globl _RXOVRN1
.globl _MODF1
.globl _WCOL1
.globl _SPIF1
.globl _EX0
.globl _ET0
.globl _EX1
.globl _ET1
.globl _ES0
.globl _ET2
.globl _ESPI0
.globl _EA
.globl _RI0
.globl _TI0
.globl _RB80
.globl _TB80
.globl _REN0
.globl _MCE0
.globl _S0MODE
.globl _CRC0VAL
.globl _CRC0INIT
.globl _CRC0SEL
.globl _IT0
.globl _IE0
.globl _IT1
.globl _IE1
.globl _TR0
.globl _TF0
.globl _TR1
.globl _TF1
.globl _PCA0CP4
.globl _PCA0CP0
.globl _PCA0
.globl _PCA0CP3
.globl _PCA0CP2
.globl _PCA0CP1
.globl _PCA0CP5
.globl _TMR2
.globl _TMR2RL
.globl _ADC0LT
.globl _ADC0GT
.globl _ADC0
.globl _TMR3
.globl _TMR3RL
.globl _TOFF
.globl _DP
.globl _VDM0CN
.globl _PCA0CPH4
.globl _PCA0CPL4
.globl _PCA0CPH0
.globl _PCA0CPL0
.globl _PCA0H
.globl _PCA0L
.globl _SPI0CN
.globl _EIP2
.globl _EIP1
.globl _SMB0ADM
.globl _SMB0ADR
.globl _P2MDIN
.globl _P1MDIN
.globl _P0MDIN
.globl _B
.globl _RSTSRC
.globl _PCA0CPH3
.globl _PCA0CPL3
.globl _PCA0CPH2
.globl _PCA0CPL2
.globl _PCA0CPH1
.globl _PCA0CPL1
.globl _ADC0CN
.globl _EIE2
.globl _EIE1
.globl _FLWR
.globl _IT01CF
.globl _XBR2
.globl _XBR1
.globl _XBR0
.globl _ACC
.globl _PCA0PWM
.globl _PCA0CPM4
.globl _PCA0CPM3
.globl _PCA0CPM2
.globl _PCA0CPM1
.globl _PCA0CPM0
.globl _PCA0MD
.globl _PCA0CN
.globl _P0MAT
.globl _P2SKIP
.globl _P1SKIP
.globl _P0SKIP
.globl _PCA0CPH5
.globl _PCA0CPL5
.globl _REF0CN
.globl _PSW
.globl _P1MAT
.globl _PCA0CPM5
.globl _TMR2H
.globl _TMR2L
.globl _TMR2RLH
.globl _TMR2RLL
.globl _REG0CN
.globl _TMR2CN
.globl _P0MASK
.globl _ADC0LTH
.globl _ADC0LTL
.globl _ADC0GTH
.globl _ADC0GTL
.globl _SMB0DAT
.globl _SMB0CF
.globl _SMB0CN
.globl _P1MASK
.globl _ADC0H
.globl _ADC0L
.globl _ADC0TK
.globl _ADC0CF
.globl _ADC0MX
.globl _ADC0PWR
.globl _ADC0AC
.globl _IREF0CN
.globl _IP
.globl _FLKEY
.globl _FLSCL
.globl _PMU0CF
.globl _OSCICL
.globl _OSCICN
.globl _OSCXCN
.globl _SPI1CN
.globl _ONESHOT
.globl _EMI0TC
.globl _RTC0KEY
.globl _RTC0DAT
.globl _RTC0ADR
.globl _EMI0CF
.globl _EMI0CN
.globl _CLKSEL
.globl _IE
.globl _SFRPAGE
.globl _P2DRV
.globl _P2MDOUT
.globl _P1DRV
.globl _P1MDOUT
.globl _P0DRV
.globl _P0MDOUT
.globl _SPI0DAT
.globl _SPI0CKR
.globl _SPI0CFG
.globl _P2
.globl _CPT0MX
.globl _CPT1MX
.globl _CPT0MD
.globl _CPT1MD
.globl _CPT0CN
.globl _CPT1CN
.globl _SBUF0
.globl _SCON0
.globl _CRC0CNT
.globl _DC0CN
.globl _CRC0AUTO
.globl _DC0CF
.globl _TMR3H
.globl _CRC0FLIP
.globl _TMR3L
.globl _CRC0IN
.globl _TMR3RLH
.globl _CRC0CN
.globl _TMR3RLL
.globl _CRC0DAT
.globl _TMR3CN
.globl _P1
.globl _PSCTL
.globl _CKCON
.globl _TH1
.globl _TH0
.globl _TL1
.globl _TL0
.globl _TMOD
.globl _TCON
.globl _PCON
.globl _TOFFH
.globl _SPI1DAT
.globl _TOFFL
.globl _SPI1CKR
.globl _SPI1CFG
.globl _DPH
.globl _DPL
.globl _SP
.globl _P0
.globl _crc16_PARM_2
.globl _crc16
;--------------------------------------------------------
; special function registers
;--------------------------------------------------------
.area RSEG (ABS,DATA)
.org 0x0000
_P0 = 0x0080
_SP = 0x0081
_DPL = 0x0082
_DPH = 0x0083
_SPI1CFG = 0x0084
_SPI1CKR = 0x0085
_TOFFL = 0x0085
_SPI1DAT = 0x0086
_TOFFH = 0x0086
_PCON = 0x0087
_TCON = 0x0088
_TMOD = 0x0089
_TL0 = 0x008a
_TL1 = 0x008b
_TH0 = 0x008c
_TH1 = 0x008d
_CKCON = 0x008e
_PSCTL = 0x008f
_P1 = 0x0090
_TMR3CN = 0x0091
_CRC0DAT = 0x0091
_TMR3RLL = 0x0092
_CRC0CN = 0x0092
_TMR3RLH = 0x0093
_CRC0IN = 0x0093
_TMR3L = 0x0094
_CRC0FLIP = 0x0095
_TMR3H = 0x0095
_DC0CF = 0x0096
_CRC0AUTO = 0x0096
_DC0CN = 0x0097
_CRC0CNT = 0x0097
_SCON0 = 0x0098
_SBUF0 = 0x0099
_CPT1CN = 0x009a
_CPT0CN = 0x009b
_CPT1MD = 0x009c
_CPT0MD = 0x009d
_CPT1MX = 0x009e
_CPT0MX = 0x009f
_P2 = 0x00a0
_SPI0CFG = 0x00a1
_SPI0CKR = 0x00a2
_SPI0DAT = 0x00a3
_P0MDOUT = 0x00a4
_P0DRV = 0x00a4
_P1MDOUT = 0x00a5
_P1DRV = 0x00a5
_P2MDOUT = 0x00a6
_P2DRV = 0x00a6
_SFRPAGE = 0x00a7
_IE = 0x00a8
_CLKSEL = 0x00a9
_EMI0CN = 0x00aa
_EMI0CF = 0x00ab
_RTC0ADR = 0x00ac
_RTC0DAT = 0x00ad
_RTC0KEY = 0x00ae
_EMI0TC = 0x00af
_ONESHOT = 0x00af
_SPI1CN = 0x00b0
_OSCXCN = 0x00b1
_OSCICN = 0x00b2
_OSCICL = 0x00b3
_PMU0CF = 0x00b5
_FLSCL = 0x00b6
_FLKEY = 0x00b7
_IP = 0x00b8
_IREF0CN = 0x00b9
_ADC0AC = 0x00ba
_ADC0PWR = 0x00ba
_ADC0MX = 0x00bb
_ADC0CF = 0x00bc
_ADC0TK = 0x00bd
_ADC0L = 0x00bd
_ADC0H = 0x00be
_P1MASK = 0x00bf
_SMB0CN = 0x00c0
_SMB0CF = 0x00c1
_SMB0DAT = 0x00c2
_ADC0GTL = 0x00c3
_ADC0GTH = 0x00c4
_ADC0LTL = 0x00c5
_ADC0LTH = 0x00c6
_P0MASK = 0x00c7
_TMR2CN = 0x00c8
_REG0CN = 0x00c9
_TMR2RLL = 0x00ca
_TMR2RLH = 0x00cb
_TMR2L = 0x00cc
_TMR2H = 0x00cd
_PCA0CPM5 = 0x00ce
_P1MAT = 0x00cf
_PSW = 0x00d0
_REF0CN = 0x00d1
_PCA0CPL5 = 0x00d2
_PCA0CPH5 = 0x00d3
_P0SKIP = 0x00d4
_P1SKIP = 0x00d5
_P2SKIP = 0x00d6
_P0MAT = 0x00d7
_PCA0CN = 0x00d8
_PCA0MD = 0x00d9
_PCA0CPM0 = 0x00da
_PCA0CPM1 = 0x00db
_PCA0CPM2 = 0x00dc
_PCA0CPM3 = 0x00dd
_PCA0CPM4 = 0x00de
_PCA0PWM = 0x00df
_ACC = 0x00e0
_XBR0 = 0x00e1
_XBR1 = 0x00e2
_XBR2 = 0x00e3
_IT01CF = 0x00e4
_FLWR = 0x00e5
_EIE1 = 0x00e6
_EIE2 = 0x00e7
_ADC0CN = 0x00e8
_PCA0CPL1 = 0x00e9
_PCA0CPH1 = 0x00ea
_PCA0CPL2 = 0x00eb
_PCA0CPH2 = 0x00ec
_PCA0CPL3 = 0x00ed
_PCA0CPH3 = 0x00ee
_RSTSRC = 0x00ef
_B = 0x00f0
_P0MDIN = 0x00f1
_P1MDIN = 0x00f2
_P2MDIN = 0x00f3
_SMB0ADR = 0x00f4
_SMB0ADM = 0x00f5
_EIP1 = 0x00f6
_EIP2 = 0x00f7
_SPI0CN = 0x00f8
_PCA0L = 0x00f9
_PCA0H = 0x00fa
_PCA0CPL0 = 0x00fb
_PCA0CPH0 = 0x00fc
_PCA0CPL4 = 0x00fd
_PCA0CPH4 = 0x00fe
_VDM0CN = 0x00ff
_DP = 0x8382
_TOFF = 0x8685
_TMR3RL = 0x9392
_TMR3 = 0x9594
_ADC0 = 0xbebd
_ADC0GT = 0xc4c3
_ADC0LT = 0xc6c5
_TMR2RL = 0xcbca
_TMR2 = 0xcdcc
_PCA0CP5 = 0xd3d2
_PCA0CP1 = 0xeae9
_PCA0CP2 = 0xeceb
_PCA0CP3 = 0xeeed
_PCA0 = 0xfaf9
_PCA0CP0 = 0xfcfb
_PCA0CP4 = 0xfefd
;--------------------------------------------------------
; special function bits
;--------------------------------------------------------
.area RSEG (ABS,DATA)
.org 0x0000
_TF1 = 0x008f
_TR1 = 0x008e
_TF0 = 0x008d
_TR0 = 0x008c
_IE1 = 0x008b
_IT1 = 0x008a
_IE0 = 0x0089
_IT0 = 0x0088
_CRC0SEL = 0x0096
_CRC0INIT = 0x0095
_CRC0VAL = 0x0094
_S0MODE = 0x009f
_MCE0 = 0x009d
_REN0 = 0x009c
_TB80 = 0x009b
_RB80 = 0x009a
_TI0 = 0x0099
_RI0 = 0x0098
_EA = 0x00af
_ESPI0 = 0x00ae
_ET2 = 0x00ad
_ES0 = 0x00ac
_ET1 = 0x00ab
_EX1 = 0x00aa
_ET0 = 0x00a9
_EX0 = 0x00a8
_SPIF1 = 0x00b7
_WCOL1 = 0x00b6
_MODF1 = 0x00b5
_RXOVRN1 = 0x00b4
_NSS1MD1 = 0x00b3
_NSS1MD0 = 0x00b2
_TXBMT1 = 0x00b1
_SPI1EN = 0x00b0
_PSPI0 = 0x00be
_PT2 = 0x00bd
_PS0 = 0x00bc
_PT1 = 0x00bb
_PX1 = 0x00ba
_PT0 = 0x00b9
_PX0 = 0x00b8
_MASTER = 0x00c7
_TXMODE = 0x00c6
_STA = 0x00c5
_STO = 0x00c4
_ACKRQ = 0x00c3
_ARBLOST = 0x00c2
_ACK = 0x00c1
_SI = 0x00c0
_TF2H = 0x00cf
_TF2L = 0x00ce
_TF2LEN = 0x00cd
_TF2CEN = 0x00cc
_T2SPLIT = 0x00cb
_TR2 = 0x00ca
_T2RCLK = 0x00c9
_T2XCLK = 0x00c8
_CY = 0x00d7
_AC = 0x00d6
_F0 = 0x00d5
_RS1 = 0x00d4
_RS0 = 0x00d3
_OV = 0x00d2
_F1 = 0x00d1
_P = 0x00d0
_CF = 0x00df
_CR = 0x00de
_CCF5 = 0x00dd
_CCF4 = 0x00dc
_CCF3 = 0x00db
_CCF2 = 0x00da
_CCF1 = 0x00d9
_CCF0 = 0x00d8
_AD0EN = 0x00ef
_BURSTEN = 0x00ee
_AD0INT = 0x00ed
_AD0BUSY = 0x00ec
_AD0WINT = 0x00eb
_AD0CM2 = 0x00ea
_AD0CM1 = 0x00e9
_AD0CM0 = 0x00e8
_SPIF0 = 0x00ff
_WCOL0 = 0x00fe
_MODF0 = 0x00fd
_RXOVRN0 = 0x00fc
_NSS0MD1 = 0x00fb
_NSS0MD0 = 0x00fa
_TXBMT0 = 0x00f9
_SPI0EN = 0x00f8
_LED_RED = 0x00a0
_LED_GREEN = 0x00a5
_BUTTON_ENTER = 0x0086
_BUTTON_UP = 0x0095
_BUTTON_DOWN = 0x0096
_IRQ = 0x0087
_NSS1 = 0x0094
_SDN = 0x00a6
;--------------------------------------------------------
; overlayable register banks
;--------------------------------------------------------
.area REG_BANK_0 (REL,OVR,DATA)
.ds 8
;--------------------------------------------------------
; internal ram data
;--------------------------------------------------------
.area DSEG (DATA)
_crc16_PARM_2:
.ds 2
;--------------------------------------------------------
; overlayable items in internal ram
;--------------------------------------------------------
.area OSEG (OVR,DATA)
;--------------------------------------------------------
; indirectly addressable internal ram data
;--------------------------------------------------------
.area ISEG (DATA)
;--------------------------------------------------------
; absolute internal ram data
;--------------------------------------------------------
.area IABS (ABS,DATA)
.area IABS (ABS,DATA)
;--------------------------------------------------------
; bit data
;--------------------------------------------------------
.area BSEG (BIT)
;--------------------------------------------------------
; paged external ram data
;--------------------------------------------------------
.area PSEG (PAG,XDATA)
;--------------------------------------------------------
; external ram data
;--------------------------------------------------------
.area XSEG (XDATA)
;--------------------------------------------------------
; absolute external ram data
;--------------------------------------------------------
.area XABS (ABS,XDATA)
;--------------------------------------------------------
; external initialized ram data
;--------------------------------------------------------
.area XISEG (XDATA)
.area HOME (CODE)
.area GSINIT0 (CODE)
.area GSINIT1 (CODE)
.area GSINIT2 (CODE)
.area GSINIT3 (CODE)
.area GSINIT4 (CODE)
.area GSINIT5 (CODE)
.area GSINIT (CODE)
.area GSFINAL (CODE)
.area CSEG (CODE)
;--------------------------------------------------------
; global & static initialisations
;--------------------------------------------------------
.area HOME (CODE)
.area GSINIT (CODE)
.area GSFINAL (CODE)
.area GSINIT (CODE)
;--------------------------------------------------------
; Home
;--------------------------------------------------------
.area HOME (CODE)
.area HOME (CODE)
;--------------------------------------------------------
; code
;--------------------------------------------------------
.area CSEG (CODE)
;------------------------------------------------------------
;Allocation info for local variables in function 'crc16'
;------------------------------------------------------------
;buf Allocated with name '_crc16_PARM_2'
;n Allocated to registers
;k Allocated to registers r1
;high Allocated to registers r5
;low Allocated to registers r6
;b Allocated to registers r2
;------------------------------------------------------------
; radio/crc.c:85: crc16(__data uint8_t n, __xdata uint8_t * __data buf)
; -----------------------------------------
; function crc16
; -----------------------------------------
_crc16:
ar7 = 0x07
ar6 = 0x06
ar5 = 0x05
ar4 = 0x04
ar3 = 0x03
ar2 = 0x02
ar1 = 0x01
ar0 = 0x00
mov r7,dpl
; radio/crc.c:90: high = low = 0;
mov r6,#0x00
mov r5,#0x00
; radio/crc.c:92: while (n--) {
mov r3,_crc16_PARM_2
mov r4,(_crc16_PARM_2 + 1)
00104$:
mov ar2,r7
dec r7
mov a,r2
jz 00106$
; radio/crc.c:93: register uint8_t b = *buf++;
mov dpl,r3
mov dph,r4
movx a,@dptr
mov r2,a
inc dptr
mov r3,dpl
mov r4,dph
; radio/crc.c:94: k = high << 1;
mov a,r5
add a,r5
mov r1,a
; radio/crc.c:95: if (high & 0x80) {
mov a,r5
jnb acc.7,00102$
; radio/crc.c:96: high = low ^ crc_tab2[k++];
mov ar0,r1
inc r1
mov a,r0
mov dptr,#_crc_tab2
movc a,@a+dptr
xrl a,r6
mov r5,a
; radio/crc.c:97: low = b ^ crc_tab2[k];
mov a,r1
mov dptr,#_crc_tab2
movc a,@a+dptr
mov r0,a
xrl a,r2
mov r6,a
sjmp 00104$
00102$:
; radio/crc.c:99: high = low ^ crc_tab1[k++];
mov ar0,r1
inc r1
mov a,r0
mov dptr,#_crc_tab1
movc a,@a+dptr
mov r0,a
xrl a,r6
mov r5,a
; radio/crc.c:100: low = b ^ crc_tab1[k];
mov a,r1
mov dptr,#_crc_tab1
movc a,@a+dptr
mov r1,a
xrl a,r2
mov r6,a
sjmp 00104$
00106$:
; radio/crc.c:103: return (((uint16_t)high)<<8) | low;
mov ar7,r5
clr a
mov r5,a
mov r4,a
mov a,r6
orl ar5,a
mov a,r4
orl ar7,a
mov dpl,r5
mov dph,r7
ret
.area CSEG (CODE)
.area CONST (CODE)
_crc_tab1:
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x10 ; 16
.db #0x21 ; 33
.db #0x20 ; 32
.db #0x42 ; 66 'B'
.db #0x30 ; 48 '0'
.db #0x63 ; 99 'c'
.db #0x40 ; 64
.db #0x84 ; 132
.db #0x50 ; 80 'P'
.db #0xA5 ; 165
.db #0x60 ; 96
.db #0xC6 ; 198
.db #0x70 ; 112 'p'
.db #0xE7 ; 231
.db #0x81 ; 129
.db #0x08 ; 8
.db #0x91 ; 145
.db #0x29 ; 41
.db #0xA1 ; 161
.db #0x4A ; 74 'J'
.db #0xB1 ; 177
.db #0x6B ; 107 'k'
.db #0xC1 ; 193
.db #0x8C ; 140
.db #0xD1 ; 209
.db #0xAD ; 173
.db #0xE1 ; 225
.db #0xCE ; 206
.db #0xF1 ; 241
.db #0xEF ; 239
.db #0x12 ; 18
.db #0x31 ; 49 '1'
.db #0x02 ; 2
.db #0x10 ; 16
.db #0x32 ; 50 '2'
.db #0x73 ; 115 's'
.db #0x22 ; 34
.db #0x52 ; 82 'R'
.db #0x52 ; 82 'R'
.db #0xB5 ; 181
.db #0x42 ; 66 'B'
.db #0x94 ; 148
.db #0x72 ; 114 'r'
.db #0xF7 ; 247
.db #0x62 ; 98 'b'
.db #0xD6 ; 214
.db #0x93 ; 147
.db #0x39 ; 57 '9'
.db #0x83 ; 131
.db #0x18 ; 24
.db #0xB3 ; 179
.db #0x7B ; 123
.db #0xA3 ; 163
.db #0x5A ; 90 'Z'
.db #0xD3 ; 211
.db #0xBD ; 189
.db #0xC3 ; 195
.db #0x9C ; 156
.db #0xF3 ; 243
.db #0xFF ; 255
.db #0xE3 ; 227
.db #0xDE ; 222
.db #0x24 ; 36
.db #0x62 ; 98 'b'
.db #0x34 ; 52 '4'
.db #0x43 ; 67 'C'
.db #0x04 ; 4
.db #0x20 ; 32
.db #0x14 ; 20
.db #0x01 ; 1
.db #0x64 ; 100 'd'
.db #0xE6 ; 230
.db #0x74 ; 116 't'
.db #0xC7 ; 199
.db #0x44 ; 68 'D'
.db #0xA4 ; 164
.db #0x54 ; 84 'T'
.db #0x85 ; 133
.db #0xA5 ; 165
.db #0x6A ; 106 'j'
.db #0xB5 ; 181
.db #0x4B ; 75 'K'
.db #0x85 ; 133
.db #0x28 ; 40
.db #0x95 ; 149
.db #0x09 ; 9
.db #0xE5 ; 229
.db #0xEE ; 238
.db #0xF5 ; 245
.db #0xCF ; 207
.db #0xC5 ; 197
.db #0xAC ; 172
.db #0xD5 ; 213
.db #0x8D ; 141
.db #0x36 ; 54 '6'
.db #0x53 ; 83 'S'
.db #0x26 ; 38
.db #0x72 ; 114 'r'
.db #0x16 ; 22
.db #0x11 ; 17
.db #0x06 ; 6
.db #0x30 ; 48 '0'
.db #0x76 ; 118 'v'
.db #0xD7 ; 215
.db #0x66 ; 102 'f'
.db #0xF6 ; 246
.db #0x56 ; 86 'V'
.db #0x95 ; 149
.db #0x46 ; 70 'F'
.db #0xB4 ; 180
.db #0xB7 ; 183
.db #0x5B ; 91
.db #0xA7 ; 167
.db #0x7A ; 122 'z'
.db #0x97 ; 151
.db #0x19 ; 25
.db #0x87 ; 135
.db #0x38 ; 56 '8'
.db #0xF7 ; 247
.db #0xDF ; 223
.db #0xE7 ; 231
.db #0xFE ; 254
.db #0xD7 ; 215
.db #0x9D ; 157
.db #0xC7 ; 199
.db #0xBC ; 188
.db #0x48 ; 72 'H'
.db #0xC4 ; 196
.db #0x58 ; 88 'X'
.db #0xE5 ; 229
.db #0x68 ; 104 'h'
.db #0x86 ; 134
.db #0x78 ; 120 'x'
.db #0xA7 ; 167
.db #0x08 ; 8
.db #0x40 ; 64
.db #0x18 ; 24
.db #0x61 ; 97 'a'
.db #0x28 ; 40
.db #0x02 ; 2
.db #0x38 ; 56 '8'
.db #0x23 ; 35
.db #0xC9 ; 201
.db #0xCC ; 204
.db #0xD9 ; 217
.db #0xED ; 237
.db #0xE9 ; 233
.db #0x8E ; 142
.db #0xF9 ; 249
.db #0xAF ; 175
.db #0x89 ; 137
.db #0x48 ; 72 'H'
.db #0x99 ; 153
.db #0x69 ; 105 'i'
.db #0xA9 ; 169
.db #0x0A ; 10
.db #0xB9 ; 185
.db #0x2B ; 43
.db #0x5A ; 90 'Z'
.db #0xF5 ; 245
.db #0x4A ; 74 'J'
.db #0xD4 ; 212
.db #0x7A ; 122 'z'
.db #0xB7 ; 183
.db #0x6A ; 106 'j'
.db #0x96 ; 150
.db #0x1A ; 26
.db #0x71 ; 113 'q'
.db #0x0A ; 10
.db #0x50 ; 80 'P'
.db #0x3A ; 58
.db #0x33 ; 51 '3'
.db #0x2A ; 42
.db #0x12 ; 18
.db #0xDB ; 219
.db #0xFD ; 253
.db #0xCB ; 203
.db #0xDC ; 220
.db #0xFB ; 251
.db #0xBF ; 191
.db #0xEB ; 235
.db #0x9E ; 158
.db #0x9B ; 155
.db #0x79 ; 121 'y'
.db #0x8B ; 139
.db #0x58 ; 88 'X'
.db #0xBB ; 187
.db #0x3B ; 59
.db #0xAB ; 171
.db #0x1A ; 26
.db #0x6C ; 108 'l'
.db #0xA6 ; 166
.db #0x7C ; 124
.db #0x87 ; 135
.db #0x4C ; 76 'L'
.db #0xE4 ; 228
.db #0x5C ; 92
.db #0xC5 ; 197
.db #0x2C ; 44
.db #0x22 ; 34
.db #0x3C ; 60
.db #0x03 ; 3
.db #0x0C ; 12
.db #0x60 ; 96
.db #0x1C ; 28
.db #0x41 ; 65 'A'
.db #0xED ; 237
.db #0xAE ; 174
.db #0xFD ; 253
.db #0x8F ; 143
.db #0xCD ; 205
.db #0xEC ; 236
.db #0xDD ; 221
.db #0xCD ; 205
.db #0xAD ; 173
.db #0x2A ; 42
.db #0xBD ; 189
.db #0x0B ; 11
.db #0x8D ; 141
.db #0x68 ; 104 'h'
.db #0x9D ; 157
.db #0x49 ; 73 'I'
.db #0x7E ; 126
.db #0x97 ; 151
.db #0x6E ; 110 'n'
.db #0xB6 ; 182
.db #0x5E ; 94
.db #0xD5 ; 213
.db #0x4E ; 78 'N'
.db #0xF4 ; 244
.db #0x3E ; 62
.db #0x13 ; 19
.db #0x2E ; 46
.db #0x32 ; 50 '2'
.db #0x1E ; 30
.db #0x51 ; 81 'Q'
.db #0x0E ; 14
.db #0x70 ; 112 'p'
.db #0xFF ; 255
.db #0x9F ; 159
.db #0xEF ; 239
.db #0xBE ; 190
.db #0xDF ; 223
.db #0xDD ; 221
.db #0xCF ; 207
.db #0xFC ; 252
.db #0xBF ; 191
.db #0x1B ; 27
.db #0xAF ; 175
.db #0x3A ; 58
.db #0x9F ; 159
.db #0x59 ; 89 'Y'
.db #0x8F ; 143
.db #0x78 ; 120 'x'
_crc_tab2:
.db #0x91 ; 145
.db #0x88 ; 136
.db #0x81 ; 129
.db #0xA9 ; 169
.db #0xB1 ; 177
.db #0xCA ; 202
.db #0xA1 ; 161
.db #0xEB ; 235
.db #0xD1 ; 209
.db #0x0C ; 12
.db #0xC1 ; 193
.db #0x2D ; 45
.db #0xF1 ; 241
.db #0x4E ; 78 'N'
.db #0xE1 ; 225
.db #0x6F ; 111 'o'
.db #0x10 ; 16
.db #0x80 ; 128
.db #0x00 ; 0
.db #0xA1 ; 161
.db #0x30 ; 48 '0'
.db #0xC2 ; 194
.db #0x20 ; 32
.db #0xE3 ; 227
.db #0x50 ; 80 'P'
.db #0x04 ; 4
.db #0x40 ; 64
.db #0x25 ; 37
.db #0x70 ; 112 'p'
.db #0x46 ; 70 'F'
.db #0x60 ; 96
.db #0x67 ; 103 'g'
.db #0x83 ; 131
.db #0xB9 ; 185
.db #0x93 ; 147
.db #0x98 ; 152
.db #0xA3 ; 163
.db #0xFB ; 251
.db #0xB3 ; 179
.db #0xDA ; 218
.db #0xC3 ; 195
.db #0x3D ; 61
.db #0xD3 ; 211
.db #0x1C ; 28
.db #0xE3 ; 227
.db #0x7F ; 127
.db #0xF3 ; 243
.db #0x5E ; 94
.db #0x02 ; 2
.db #0xB1 ; 177
.db #0x12 ; 18
.db #0x90 ; 144
.db #0x22 ; 34
.db #0xF3 ; 243
.db #0x32 ; 50 '2'
.db #0xD2 ; 210
.db #0x42 ; 66 'B'
.db #0x35 ; 53 '5'
.db #0x52 ; 82 'R'
.db #0x14 ; 20
.db #0x62 ; 98 'b'
.db #0x77 ; 119 'w'
.db #0x72 ; 114 'r'
.db #0x56 ; 86 'V'
.db #0xB5 ; 181
.db #0xEA ; 234
.db #0xA5 ; 165
.db #0xCB ; 203
.db #0x95 ; 149
.db #0xA8 ; 168
.db #0x85 ; 133
.db #0x89 ; 137
.db #0xF5 ; 245
.db #0x6E ; 110 'n'
.db #0xE5 ; 229
.db #0x4F ; 79 'O'
.db #0xD5 ; 213
.db #0x2C ; 44
.db #0xC5 ; 197
.db #0x0D ; 13
.db #0x34 ; 52 '4'
.db #0xE2 ; 226
.db #0x24 ; 36
.db #0xC3 ; 195
.db #0x14 ; 20
.db #0xA0 ; 160
.db #0x04 ; 4
.db #0x81 ; 129
.db #0x74 ; 116 't'
.db #0x66 ; 102 'f'
.db #0x64 ; 100 'd'
.db #0x47 ; 71 'G'
.db #0x54 ; 84 'T'
.db #0x24 ; 36
.db #0x44 ; 68 'D'
.db #0x05 ; 5
.db #0xA7 ; 167
.db #0xDB ; 219
.db #0xB7 ; 183
.db #0xFA ; 250
.db #0x87 ; 135
.db #0x99 ; 153
.db #0x97 ; 151
.db #0xB8 ; 184
.db #0xE7 ; 231
.db #0x5F ; 95
.db #0xF7 ; 247
.db #0x7E ; 126
.db #0xC7 ; 199
.db #0x1D ; 29
.db #0xD7 ; 215
.db #0x3C ; 60
.db #0x26 ; 38
.db #0xD3 ; 211
.db #0x36 ; 54 '6'
.db #0xF2 ; 242
.db #0x06 ; 6
.db #0x91 ; 145
.db #0x16 ; 22
.db #0xB0 ; 176
.db #0x66 ; 102 'f'
.db #0x57 ; 87 'W'
.db #0x76 ; 118 'v'
.db #0x76 ; 118 'v'
.db #0x46 ; 70 'F'
.db #0x15 ; 21
.db #0x56 ; 86 'V'
.db #0x34 ; 52 '4'
.db #0xD9 ; 217
.db #0x4C ; 76 'L'
.db #0xC9 ; 201
.db #0x6D ; 109 'm'
.db #0xF9 ; 249
.db #0x0E ; 14
.db #0xE9 ; 233
.db #0x2F ; 47
.db #0x99 ; 153
.db #0xC8 ; 200
.db #0x89 ; 137
.db #0xE9 ; 233
.db #0xB9 ; 185
.db #0x8A ; 138
.db #0xA9 ; 169
.db #0xAB ; 171
.db #0x58 ; 88 'X'
.db #0x44 ; 68 'D'
.db #0x48 ; 72 'H'
.db #0x65 ; 101 'e'
.db #0x78 ; 120 'x'
.db #0x06 ; 6
.db #0x68 ; 104 'h'
.db #0x27 ; 39
.db #0x18 ; 24
.db #0xC0 ; 192
.db #0x08 ; 8
.db #0xE1 ; 225
.db #0x38 ; 56 '8'
.db #0x82 ; 130
.db #0x28 ; 40
.db #0xA3 ; 163
.db #0xCB ; 203
.db #0x7D ; 125
.db #0xDB ; 219
.db #0x5C ; 92
.db #0xEB ; 235
.db #0x3F ; 63
.db #0xFB ; 251
.db #0x1E ; 30
.db #0x8B ; 139
.db #0xF9 ; 249
.db #0x9B ; 155
.db #0xD8 ; 216
.db #0xAB ; 171
.db #0xBB ; 187
.db #0xBB ; 187
.db #0x9A ; 154
.db #0x4A ; 74 'J'
.db #0x75 ; 117 'u'
.db #0x5A ; 90 'Z'
.db #0x54 ; 84 'T'
.db #0x6A ; 106 'j'
.db #0x37 ; 55 '7'
.db #0x7A ; 122 'z'
.db #0x16 ; 22
.db #0x0A ; 10
.db #0xF1 ; 241
.db #0x1A ; 26
.db #0xD0 ; 208
.db #0x2A ; 42
.db #0xB3 ; 179
.db #0x3A ; 58
.db #0x92 ; 146
.db #0xFD ; 253
.db #0x2E ; 46
.db #0xED ; 237
.db #0x0F ; 15
.db #0xDD ; 221
.db #0x6C ; 108 'l'
.db #0xCD ; 205
.db #0x4D ; 77 'M'
.db #0xBD ; 189
.db #0xAA ; 170
.db #0xAD ; 173
.db #0x8B ; 139
.db #0x9D ; 157
.db #0xE8 ; 232
.db #0x8D ; 141
.db #0xC9 ; 201
.db #0x7C ; 124
.db #0x26 ; 38
.db #0x6C ; 108 'l'
.db #0x07 ; 7
.db #0x5C ; 92
.db #0x64 ; 100 'd'
.db #0x4C ; 76 'L'
.db #0x45 ; 69 'E'
.db #0x3C ; 60
.db #0xA2 ; 162
.db #0x2C ; 44
.db #0x83 ; 131
.db #0x1C ; 28
.db #0xE0 ; 224
.db #0x0C ; 12
.db #0xC1 ; 193
.db #0xEF ; 239
.db #0x1F ; 31
.db #0xFF ; 255
.db #0x3E ; 62
.db #0xCF ; 207
.db #0x5D ; 93
.db #0xDF ; 223
.db #0x7C ; 124
.db #0xAF ; 175
.db #0x9B ; 155
.db #0xBF ; 191
.db #0xBA ; 186
.db #0x8F ; 143
.db #0xD9 ; 217
.db #0x9F ; 159
.db #0xF8 ; 248
.db #0x6E ; 110 'n'
.db #0x17 ; 23
.db #0x7E ; 126
.db #0x36 ; 54 '6'
.db #0x4E ; 78 'N'
.db #0x55 ; 85 'U'
.db #0x5E ; 94
.db #0x74 ; 116 't'
.db #0x2E ; 46
.db #0x93 ; 147
.db #0x3E ; 62
.db #0xB2 ; 178
.db #0x0E ; 14
.db #0xD1 ; 209
.db #0x1E ; 30
.db #0xF0 ; 240
.area XINIT (CODE)
.area CABS (ABS,CODE)
| YifanJiangPolyU/SiK-master-Yifan-TDMA | Firmware-bk/obj/rf50/radio~rf50/crc.asm | Assembly | bsd-2-clause | 22,550 |
ldl $123
and r7,r7,r6
lsr r6,r7,r0
hlt
| mgohde/MiniMicroII | demoprgs/lsrtest.asm | Assembly | bsd-2-clause | 39 |
;******************************************************************************
;* MMX/SSE2-optimized functions for the RV40 decoder
;* Copyright (c) 2010 Ronald S. Bultje <rsbultje@gmail.com>
;* Copyright (c) 2010 Jason Garrett-Glaser <darkshikari@gmail.com>
;* Copyright (C) 2012 Christophe Gisquet <christophe.gisquet@gmail.com>
;*
;* This file is part of FFmpeg.
;*
;* FFmpeg is free software; you can redistribute it and/or
;* modify it under the terms of the GNU Lesser General Public
;* License as published by the Free Software Foundation; either
;* version 2.1 of the License, or (at your option) any later version.
;*
;* FFmpeg is distributed in the hope that it will be useful,
;* but WITHOUT ANY WARRANTY; without even the implied warranty of
;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;* Lesser General Public License for more details.
;*
;* You should have received a copy of the GNU Lesser General Public
;* License along with FFmpeg; if not, write to the Free Software
;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
;******************************************************************************
%include "libavutil/x86/x86util.asm"
SECTION_RODATA
align 16
pw_1024: times 8 dw 1 << (16 - 6) ; pw_1024
sixtap_filter_hb_m: times 8 db 1, -5
times 8 db 52, 20
; multiplied by 2 to have the same shift
times 8 db 2, -10
times 8 db 40, 40
; back to normal
times 8 db 1, -5
times 8 db 20, 52
sixtap_filter_v_m: times 8 dw 1
times 8 dw -5
times 8 dw 52
times 8 dw 20
; multiplied by 2 to have the same shift
times 8 dw 2
times 8 dw -10
times 8 dw 40
times 8 dw 40
; back to normal
times 8 dw 1
times 8 dw -5
times 8 dw 20
times 8 dw 52
%ifdef PIC
%define sixtap_filter_hw picregq
%define sixtap_filter_hb picregq
%define sixtap_filter_v picregq
%define npicregs 1
%else
%define sixtap_filter_hw sixtap_filter_hw_m
%define sixtap_filter_hb sixtap_filter_hb_m
%define sixtap_filter_v sixtap_filter_v_m
%define npicregs 0
%endif
filter_h6_shuf1: db 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8
filter_h6_shuf2: db 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10
filter_h6_shuf3: db 5, 4, 6, 5, 7, 6, 8, 7, 9, 8, 10, 9, 11, 10, 12, 11
cextern pw_32
cextern pw_16
cextern pw_512
SECTION .text
;-----------------------------------------------------------------------------
; subpel MC functions:
;
; void [put|rv40]_rv40_qpel_[h|v]_<opt>(uint8_t *dst, int deststride,
; uint8_t *src, int srcstride,
; int len, int m);
;----------------------------------------------------------------------
%macro LOAD 2
%if WIN64
movsxd %1q, %1d
%endif
%ifdef PIC
add %1q, picregq
%else
add %1q, %2
%endif
%endmacro
%macro STORE 3
%ifidn %3, avg
movh %2, [dstq]
%endif
packuswb %1, %1
%ifidn %3, avg
PAVGB %1, %2
%endif
movh [dstq], %1
%endmacro
%macro FILTER_V 1
cglobal %1_rv40_qpel_v, 6,6+npicregs,12, dst, dststride, src, srcstride, height, my, picreg
%ifdef PIC
lea picregq, [sixtap_filter_v_m]
%endif
pxor m7, m7
LOAD my, sixtap_filter_v
; read 5 lines
sub srcq, srcstrideq
sub srcq, srcstrideq
movh m0, [srcq]
movh m1, [srcq+srcstrideq]
movh m2, [srcq+srcstrideq*2]
lea srcq, [srcq+srcstrideq*2]
add srcq, srcstrideq
movh m3, [srcq]
movh m4, [srcq+srcstrideq]
punpcklbw m0, m7
punpcklbw m1, m7
punpcklbw m2, m7
punpcklbw m3, m7
punpcklbw m4, m7
%ifdef m8
mova m8, [myq+ 0]
mova m9, [myq+16]
mova m10, [myq+32]
mova m11, [myq+48]
%define COEFF05 m8
%define COEFF14 m9
%define COEFF2 m10
%define COEFF3 m11
%else
%define COEFF05 [myq+ 0]
%define COEFF14 [myq+16]
%define COEFF2 [myq+32]
%define COEFF3 [myq+48]
%endif
.nextrow:
mova m6, m1
movh m5, [srcq+2*srcstrideq] ; read new row
paddw m6, m4
punpcklbw m5, m7
pmullw m6, COEFF14
paddw m0, m5
pmullw m0, COEFF05
paddw m6, m0
mova m0, m1
paddw m6, [pw_32]
mova m1, m2
pmullw m2, COEFF2
paddw m6, m2
mova m2, m3
pmullw m3, COEFF3
paddw m6, m3
; round/clip/store
mova m3, m4
psraw m6, 6
mova m4, m5
STORE m6, m5, %1
; go to next line
add dstq, dststrideq
add srcq, srcstrideq
dec heightd ; next row
jg .nextrow
REP_RET
%endmacro
%macro FILTER_H 1
cglobal %1_rv40_qpel_h, 6, 6+npicregs, 12, dst, dststride, src, srcstride, height, mx, picreg
%ifdef PIC
lea picregq, [sixtap_filter_v_m]
%endif
pxor m7, m7
LOAD mx, sixtap_filter_v
mova m6, [pw_32]
%ifdef m8
mova m8, [mxq+ 0]
mova m9, [mxq+16]
mova m10, [mxq+32]
mova m11, [mxq+48]
%define COEFF05 m8
%define COEFF14 m9
%define COEFF2 m10
%define COEFF3 m11
%else
%define COEFF05 [mxq+ 0]
%define COEFF14 [mxq+16]
%define COEFF2 [mxq+32]
%define COEFF3 [mxq+48]
%endif
.nextrow:
movq m0, [srcq-2]
movq m5, [srcq+3]
movq m1, [srcq-1]
movq m4, [srcq+2]
punpcklbw m0, m7
punpcklbw m5, m7
punpcklbw m1, m7
punpcklbw m4, m7
movq m2, [srcq-0]
movq m3, [srcq+1]
paddw m0, m5
paddw m1, m4
punpcklbw m2, m7
punpcklbw m3, m7
pmullw m0, COEFF05
pmullw m1, COEFF14
pmullw m2, COEFF2
pmullw m3, COEFF3
paddw m0, m6
paddw m1, m2
paddw m0, m3
paddw m0, m1
psraw m0, 6
STORE m0, m1, %1
; go to next line
add dstq, dststrideq
add srcq, srcstrideq
dec heightd ; next row
jg .nextrow
REP_RET
%endmacro
%if ARCH_X86_32
INIT_MMX mmx
FILTER_V put
FILTER_H put
INIT_MMX mmxext
FILTER_V avg
FILTER_H avg
INIT_MMX 3dnow
FILTER_V avg
FILTER_H avg
%endif
INIT_XMM sse2
FILTER_H put
FILTER_H avg
FILTER_V put
FILTER_V avg
%macro FILTER_SSSE3 1
cglobal %1_rv40_qpel_v, 6,6+npicregs,8, dst, dststride, src, srcstride, height, my, picreg
%ifdef PIC
lea picregq, [sixtap_filter_hb_m]
%endif
; read 5 lines
sub srcq, srcstrideq
LOAD my, sixtap_filter_hb
sub srcq, srcstrideq
movh m0, [srcq]
movh m1, [srcq+srcstrideq]
movh m2, [srcq+srcstrideq*2]
lea srcq, [srcq+srcstrideq*2]
add srcq, srcstrideq
mova m5, [myq]
movh m3, [srcq]
movh m4, [srcq+srcstrideq]
lea srcq, [srcq+2*srcstrideq]
.nextrow:
mova m6, m2
punpcklbw m0, m1
punpcklbw m6, m3
pmaddubsw m0, m5
pmaddubsw m6, [myq+16]
movh m7, [srcq] ; read new row
paddw m6, m0
mova m0, m1
mova m1, m2
mova m2, m3
mova m3, m4
mova m4, m7
punpcklbw m7, m3
pmaddubsw m7, m5
paddw m6, m7
pmulhrsw m6, [pw_512]
STORE m6, m7, %1
; go to next line
add dstq, dststrideq
add srcq, srcstrideq
dec heightd ; next row
jg .nextrow
REP_RET
cglobal %1_rv40_qpel_h, 6,6+npicregs,8, dst, dststride, src, srcstride, height, mx, picreg
%ifdef PIC
lea picregq, [sixtap_filter_hb_m]
%endif
mova m3, [filter_h6_shuf2]
mova m4, [filter_h6_shuf3]
LOAD mx, sixtap_filter_hb
mova m5, [mxq] ; set up 6tap filter in bytes
mova m6, [mxq+16]
mova m7, [filter_h6_shuf1]
.nextrow:
movu m0, [srcq-2]
mova m1, m0
mova m2, m0
pshufb m0, m7
pshufb m1, m3
pshufb m2, m4
pmaddubsw m0, m5
pmaddubsw m1, m6
pmaddubsw m2, m5
paddw m0, m1
paddw m0, m2
pmulhrsw m0, [pw_512]
STORE m0, m1, %1
; go to next line
add dstq, dststrideq
add srcq, srcstrideq
dec heightd ; next row
jg .nextrow
REP_RET
%endmacro
INIT_XMM ssse3
FILTER_SSSE3 put
FILTER_SSSE3 avg
; %1=5bits weights?, %2=dst %3=src1 %4=src3 %5=stride if sse2
%macro RV40_WCORE 4-5
movh m4, [%3 + r6 + 0]
movh m5, [%4 + r6 + 0]
%if %0 == 4
%define OFFSET r6 + mmsize / 2
%else
; 8x8 block and sse2, stride was provided
%define OFFSET r6
add r6, r5
%endif
movh m6, [%3 + OFFSET]
movh m7, [%4 + OFFSET]
%if %1 == 0
; 14bits weights
punpcklbw m4, m0
punpcklbw m5, m0
punpcklbw m6, m0
punpcklbw m7, m0
psllw m4, 7
psllw m5, 7
psllw m6, 7
psllw m7, 7
pmulhw m4, m3
pmulhw m5, m2
pmulhw m6, m3
pmulhw m7, m2
paddw m4, m5
paddw m6, m7
%else
; 5bits weights
%if cpuflag(ssse3)
punpcklbw m4, m5
punpcklbw m6, m7
pmaddubsw m4, m3
pmaddubsw m6, m3
%else
punpcklbw m4, m0
punpcklbw m5, m0
punpcklbw m6, m0
punpcklbw m7, m0
pmullw m4, m3
pmullw m5, m2
pmullw m6, m3
pmullw m7, m2
paddw m4, m5
paddw m6, m7
%endif
%endif
; bias and shift down
%if cpuflag(ssse3)
pmulhrsw m4, m1
pmulhrsw m6, m1
%else
paddw m4, m1
paddw m6, m1
psrlw m4, 5
psrlw m6, 5
%endif
packuswb m4, m6
%if %0 == 5
; Only called for 8x8 blocks and sse2
sub r6, r5
movh [%2 + r6], m4
add r6, r5
movhps [%2 + r6], m4
%else
mova [%2 + r6], m4
%endif
%endmacro
%macro MAIN_LOOP 2
%if mmsize == 8
RV40_WCORE %2, r0, r1, r2
%if %1 == 16
RV40_WCORE %2, r0 + 8, r1 + 8, r2 + 8
%endif
; Prepare for next loop
add r6, r5
%else
%ifidn %1, 8
RV40_WCORE %2, r0, r1, r2, r5
; Prepare 2 next lines
add r6, r5
%else
RV40_WCORE %2, r0, r1, r2
; Prepare single next line
add r6, r5
%endif
%endif
%endmacro
; rv40_weight_func_%1(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w1, int w2, int stride)
; %1=size %2=num of xmm regs
; The weights are FP0.14 notation of fractions depending on pts.
; For timebases without rounding error (i.e. PAL), the fractions
; can be simplified, and several operations can be avoided.
; Therefore, we check here whether they are multiples of 2^9 for
; those simplifications to occur.
%macro RV40_WEIGHT 3
cglobal rv40_weight_func_%1_%2, 6, 7, 8
%if cpuflag(ssse3)
mova m1, [pw_1024]
%else
mova m1, [pw_16]
%endif
pxor m0, m0
; Set loop counter and increments
mov r6, r5
shl r6, %3
add r0, r6
add r1, r6
add r2, r6
neg r6
movd m2, r3d
movd m3, r4d
%ifidn %1,rnd
%define RND 0
SPLATW m2, m2
%else
%define RND 1
%if cpuflag(ssse3)
punpcklbw m3, m2
%else
SPLATW m2, m2
%endif
%endif
SPLATW m3, m3
.loop:
MAIN_LOOP %2, RND
jnz .loop
REP_RET
%endmacro
INIT_MMX mmxext
RV40_WEIGHT rnd, 8, 3
RV40_WEIGHT rnd, 16, 4
RV40_WEIGHT nornd, 8, 3
RV40_WEIGHT nornd, 16, 4
INIT_XMM sse2
RV40_WEIGHT rnd, 8, 3
RV40_WEIGHT rnd, 16, 4
RV40_WEIGHT nornd, 8, 3
RV40_WEIGHT nornd, 16, 4
INIT_XMM ssse3
RV40_WEIGHT rnd, 8, 3
RV40_WEIGHT rnd, 16, 4
RV40_WEIGHT nornd, 8, 3
RV40_WEIGHT nornd, 16, 4
| retsu0/FFmepg-Android | jni/ffmpeg/libavcodec/x86/rv40dsp.asm | Assembly | mit | 11,927 |
/*
* Copyright © 2012 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*
* Authors:
* Xiang Haihao <haihao.xiang@intel.com>
*/
__PAK_OBJECT:
mul (1) tmp_vme_output.8<1>:ud width_in_mb<0,1,0>:uw mb_y<0,1,0>:ub {align1};
add (1) tmp_vme_output.8<1>:ud tmp_vme_output.8<0,1,0>:ud mb_x<0,1,0>:ub {align1};
mov (16) pak_object_ud<1>:ud 0x0:ud {align1} ;
mov (1) pak_object0_ud<1>:ud MFC_AVC_PAK_OBJECT_INTRA_DW0 ;
mov (1) pak_object5_ud<1>:ud MFC_AVC_PAK_OBJECT_INTRA_DW5 ;
and.z.f0.1 (1) null<1>:uw flags<0,1,0>:uw FLAG_MASK_LAST_OBJECT {align1};
__PAK_OBJECT_LOOP:
mov (8) msg_reg0.0<1>:ud tmp_vme_output<8,8,1>:ud {align1} ;
send (16)
msg_ind
ob_read_wb
null
data_port(
OB_CACHE_TYPE,
OB_READ,
OB_CONTROL_0,
BIND_IDX_VME_OUTPUT,
OB_WRITE_COMMIT_CATEGORY,
OB_HEADER_PRESENT
)
mlen 1
rlen ob_read_wb_len_vme_intra
{align1};
/* DW4 */
add (1) pak_object4_ud<1>:ud mb_xy<0,1,0>:uw MFC_AVC_PAK_OBJECT_INTRA_DW4 {align1} ;
add (1) mb_x<1>:ub mb_x<0,1,0>:ub 1:uw {align1};
cmp.e.f0.0 (1) null<1>:uw width_in_mb<0,1,0>:uw mb_x<0,1,0>:ub {align1};
(f0.0)mov (1) mb_x<1>:ub 0:uw {align1} ;
(f0.0)add (1) mb_y<1>:ub mb_y<0,1,0>:ub 1:uw {align1} ;
/* DW6 */
mov (1) pak_object6_ud<1>:ud 0x0:ud {align1} ;
(-f0.1)mov (1) pak_object6_ud<1>:ud MFC_AVC_PAK_OBJECT_INTRA_DW6 {align1} ;
cmp.e.f0.0 (1) null<1>:uw total_mbs<0,1,0>:uw 1:uw {align1};
(-f0.0)mov (1) pak_object6_ud<1>:ud 0x0:ud {align1} ;
add (1) pak_object6_ud<1>:ud pak_object6_ud<0,1,0>:ud qp<0,1,0>:ub {align1} ;
/* DW3 */
and (1) pak_object3_ud<1>:ud ob_read_wb0.0<0,1,0>:ud 0xFFFF {align1} ;
add (1) pak_object3_ud<1>:ud pak_object3_ud<0,1,0>:ud MFC_AVC_PAK_OBJECT_INTRA_DW3 {align1} ;
/* DW7 */
mov (1) pak_object7_ud<1>:ud ob_read_wb0.4<0,1,0>:ud {align1} ;
/* DW8 */
mov (1) pak_object8_ud<1>:ud ob_read_wb0.8<0,1,0>:ud {align1} ;
/* DW9 */
and (1) pak_object9_ud<1>:ud ob_read_wb0.12<0,1,0>:ud 0xFC:ud {align1} ;
mov (8) msg_reg0.0<1>:ud tmp_mfc_batchbuffer<8,8,1>:ud {align1} ;
mov (8) msg_reg1.0<1>:ud pak_object_ud<8,8,1>:ud {align1} ;
mov (8) msg_reg2.0<1>:ud pak_object8_ud<8,8,1>:ud {align1} ;
/* the new offset */
add (1) tmp_vme_output.8<1>:ud tmp_vme_output.8<0,1,0>:ud 1:ud {align1} ;
send (16)
msg_ind
ob_write_wb
null
data_port(
OB_CACHE_TYPE,
OB_WRITE,
OB_CONTROL_3,
BIND_IDX_MFC_BATCHBUFFER,
OB_WRITE_COMMIT_CATEGORY,
OB_HEADER_PRESENT
)
mlen 3
rlen ob_write_wb_length
{align1};
/* the new offset */
add (1) tmp_mfc_batchbuffer.8<1>:ud tmp_mfc_batchbuffer.8<0,1,0>:ud 4:ud {align1} ;
add.z.f0.0 (1) total_mbs<1>:w total_mbs<0,1,0>:w -1:w {align1};
(-f0.0)jmpi (1) __PAK_OBJECT_LOOP ;
| BtbN/intel-hybrid-driver | src/shaders/utils/mfc_batchbuffer_avc_intra.asm | Assembly | mit | 5,256 |
;*****************************************************************************
;* x86-optimized functions for volume filter
;* Copyright (c) 2012 Justin Ruggles <justin.ruggles@gmail.com>
;*
;* This file is part of FFmpeg.
;*
;* FFmpeg is free software; you can redistribute it and/or
;* modify it under the terms of the GNU Lesser General Public
;* License as published by the Free Software Foundation; either
;* version 2.1 of the License, or (at your option) any later version.
;*
;* FFmpeg is distributed in the hope that it will be useful,
;* but WITHOUT ANY WARRANTY; without even the implied warranty of
;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;* Lesser General Public License for more details.
;*
;* You should have received a copy of the GNU Lesser General Public
;* License along with FFmpeg; if not, write to the Free Software
;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
;******************************************************************************
%include "libavutil/x86/x86util.asm"
SECTION_RODATA 32
pd_1_256: times 4 dq 0x3F70000000000000
pd_int32_max: times 4 dq 0x41DFFFFFFFC00000
pw_1: times 8 dw 1
pw_128: times 8 dw 128
pq_128: times 2 dq 128
SECTION .text
;------------------------------------------------------------------------------
; void ff_scale_samples_s16(uint8_t *dst, const uint8_t *src, int len,
; int volume)
;------------------------------------------------------------------------------
INIT_XMM sse2
cglobal scale_samples_s16, 4,4,4, dst, src, len, volume
movd m0, volumem
pshuflw m0, m0, 0
punpcklwd m0, [pw_1]
mova m1, [pw_128]
lea lenq, [lend*2-mmsize]
.loop:
; dst[i] = av_clip_int16((src[i] * volume + 128) >> 8);
mova m2, [srcq+lenq]
punpcklwd m3, m2, m1
punpckhwd m2, m1
pmaddwd m3, m0
pmaddwd m2, m0
psrad m3, 8
psrad m2, 8
packssdw m3, m2
mova [dstq+lenq], m3
sub lenq, mmsize
jge .loop
REP_RET
;------------------------------------------------------------------------------
; void ff_scale_samples_s32(uint8_t *dst, const uint8_t *src, int len,
; int volume)
;------------------------------------------------------------------------------
%macro SCALE_SAMPLES_S32 0
cglobal scale_samples_s32, 4,4,4, dst, src, len, volume
%if ARCH_X86_32 && cpuflag(avx)
vbroadcastss xmm2, volumem
%else
movd xmm2, volumed
pshufd xmm2, xmm2, 0
%endif
CVTDQ2PD m2, xmm2
mulpd m2, m2, [pd_1_256]
mova m3, [pd_int32_max]
lea lenq, [lend*4-mmsize]
.loop:
CVTDQ2PD m0, [srcq+lenq ]
CVTDQ2PD m1, [srcq+lenq+mmsize/2]
mulpd m0, m0, m2
mulpd m1, m1, m2
minpd m0, m0, m3
minpd m1, m1, m3
cvtpd2dq xmm0, m0
cvtpd2dq xmm1, m1
%if cpuflag(avx)
vmovdqa [dstq+lenq ], xmm0
vmovdqa [dstq+lenq+mmsize/2], xmm1
%else
movq [dstq+lenq ], xmm0
movq [dstq+lenq+mmsize/2], xmm1
%endif
sub lenq, mmsize
jge .loop
REP_RET
%endmacro
INIT_XMM sse2
%define CVTDQ2PD cvtdq2pd
SCALE_SAMPLES_S32
%if HAVE_AVX_EXTERNAL
%define CVTDQ2PD vcvtdq2pd
INIT_YMM avx
SCALE_SAMPLES_S32
%endif
%undef CVTDQ2PD
; NOTE: This is not bit-identical with the C version because it clips to
; [-INT_MAX, INT_MAX] instead of [INT_MIN, INT_MAX]
INIT_XMM ssse3, atom
cglobal scale_samples_s32, 4,4,8, dst, src, len, volume
movd m4, volumem
pshufd m4, m4, 0
mova m5, [pq_128]
pxor m6, m6
lea lenq, [lend*4-mmsize]
.loop:
; src[i] = av_clipl_int32((src[i] * volume + 128) >> 8);
mova m7, [srcq+lenq]
pabsd m3, m7
pshufd m0, m3, q0100
pshufd m1, m3, q0302
pmuludq m0, m4
pmuludq m1, m4
paddq m0, m5
paddq m1, m5
psrlq m0, 7
psrlq m1, 7
shufps m2, m0, m1, q3131
shufps m0, m0, m1, q2020
pcmpgtd m2, m6
por m0, m2
psrld m0, 1
psignd m0, m7
mova [dstq+lenq], m0
sub lenq, mmsize
jge .loop
REP_RET
| endlessm/chromium-browser | third_party/ffmpeg/libavfilter/x86/af_volume.asm | Assembly | bsd-3-clause | 4,362 |
; enter with b = frame count/2
attrfuzz
ld hl,0
ld (attrfuzz_src+1),hl
attrfuzz_frmlp
halt
halt
push bc
call attrfuzz_frame
pop bc
djnz attrfuzz_frmlp
ret
attrfuzz_frame
attrfuzz_src
ld hl,0
ld de,0x5800
ld b,0
attrfuzz_lp
rept 3
ld c,(hl)
srl c
sbc a,a
and c
ld (de),a
inc de
inc hl
endm
djnz attrfuzz_lp
ld (attrfuzz_src+1),hl
ret
| gasman/kisskill | attrfuzz.asm | Assembly | mit | 360 |
include mpcp.inc
.data
text BYTE "abcdEfGhiJk",0
find_str BYTE "k",0
output BYTE "Resultado : %d",13,10,0
.code
; proto
stringLength PROTO C string:PTR BYTE
BUSCA PROTO C string: PTR BYTE, subString : PTR BYTE
; main
main PROC C
invoke BUSCA, OFFSET text, OFFSET find_str
invoke printf, OFFSET output, EAX
_end:
invoke _getch
invoke ExitProcess, 0
main ENDP
;; -----------------------------
;; other procedures
; returns on EAX the length of string, excluding \0
stringLength PROC C USES ESI string:PTR BYTE
xor EAX, EAX
mov ESI, string
@@:
inc EAX
inc ESI
cmp BYTE PTR [ESI - 1], 0
loopne @B
; acerta valor EAX
dec EAX
ret
stringLength ENDP
BUSCA PROC C USES ESI EDI string: PTR BYTE, subString : PTR BYTE
LOCAL string_len : DWORD , subString_len : DWORD
; calcular tamanho do texto
invoke stringLength, string
mov string_len, EAX
; calcular tamanho do texto a encontrar
invoke stringLength, subString
mov subString_len, EAX
; Comparar char a char
mov ESI, string
mov EDI, subString
mov ECX, string_len
@@:
mov EBX, ESI
push ECX
mov ECX, subString_len
repe cmpsb
je found
; Se a flag Z não está ativa e o ciclo terminou, a substring não foi encontrada
mov EDI, subString
mov ESI, EBX
inc ESI ; ESI fica a apontar para o proximo char
pop ECX
loop @B
fim:
mov EAX, -1
ret
found:
; Se Z=1 e o ciclo acabou, é garantido que a string foi encontradp
mov EAX, ESI
sub EAX, subString_len
sub EAX, string
ret
BUSCA ENDP
end | FEUP-MIEIC/MPCP | Ficha 6 - Tratamento de sequencias/7.asm | Assembly | mit | 1,617 |
;Rusu Cosmin, gr. 917, 14.10.2015, homework for lab 3, problem 13
assume cs:code, ds:data
;;m - [0, 100]
;h - [100, 300]
;yy - [0, 256]
;d - [-3, 15]
;
;(h+128)-(y+m+d) = h + 128 - y - m - d
;
;
; Solution for Signed representation
;
;
data segment
m db 10
h dw 150
yy dw 212
d db -3
x dw ?
data ends
code segment
start:
mov ax, data
mov ds,ax
;signed representation
mov bx,h ; bx = h
mov ax,128 ; a = 128
add bx,ax ; bx = h + ax = h + 128
mov ax, yy ; ax = yy
sub bx,ax ; bx = bx - ax = bx - yy
mov al,m ; al = m, converts m into word
cbw
sub bx,ax ; bx = bx - ax = bx - m
mov al,d ; al = d, converts d into work
cbw
sub bx,ax
mov x,bx
mov ax,4C00h
int 21h
code ends
end start
| rusucosmin/courses | ubb/asc/lab02_30092015/CosminRusu_homework3_13_signed.asm | Assembly | mit | 712 |
; ******************************************************************************************************************
; ******************************************************************************************************************
;
; Machine Language Monitor
;
; ******************************************************************************************************************
; ******************************************************************************************************************
cpu sc/mp
labels = 0xC00 ; labels, 1 byte each
labelCount = 24 ; number of labels.
varBase = labels+labelCount ; variables after labels start here.
cursor = varBase ; cursor position ($00-$7F)
current = varBase+1 ; current address (lo,hi)
isInit = varBase+3 ; if already initialised, this is $A7.
parPosn = varBase+4 ; current param offset in buffer (low addr)
modifier = varBase+5 ; instruction modifier (@,Pn) when assembling.
kbdBuffer = varBase+6 ; 16 character keyboard buffer
kbdBufferLn = 16
codeStart = kbdBuffer+kbdBufferLn ; user code starts here after the keyboard buffer.
tapeDelay = 4 ; DLY parameter for 1 tape bit width.
; (smaller = faster tape I/O - see file end.)
org 0x0000
nop ; mandatory pre-increment NOP
; ******************************************************************************************************************
;
; Screen Handler (scrolling type) now in ROM Monitor
;
; ******************************************************************************************************************
include macros.asm
include screen.asm
; ******************************************************************************************************************
;
; Boot Up. First we check for a ROM @ $9000 and if it is 0x68 we boot there instead
;
; ******************************************************************************************************************
BootMonitor:
ldi 0x90 ; point P1 to $9000 which is the first ROM.
xpah p1
ld 0(p1) ; if that byte is $68, go straight there.
xri 0x68 ; we can boot into VTL-2 or whatever.
jnz __BootMonitor
xppc p1 ; e.g. JMP $9001
__BootMonitor:
; ******************************************************************************************************************
;
; Find Top of Memory to initialise the stack.
;
; (slightly tweaked to work round 4+12 emulator limitations - will work on real chip)
; ******************************************************************************************************************
ldi 0x0F ; point P2 to theoretical top of RAM on basic m/c
xpah p2 ; e.g. 0xFFF
ldi 0xFF ; ideally you'd make this 0x003F and remove the ld
xpal p2 ; but the emulators don't do 4+12 math. Only matters here.
ld @64(p2) ; fix the predecrement (wrap around not emulated)
FindTopMemory:
ldi 0xA5 ; try to write this to memory
st @-64(p2) ; predecrementing by 64.
xor (p2) ; did it write correctly.
jnz FindTopMemory ; now P2 points to top of memory.
; ******************************************************************************************************************
;
; Clear the screen
;
; ******************************************************************************************************************
ClearScreen_Command:
ldi 0 ; set P1 to zero to access VRAM via write.
xpah p1
ldi 0
ClearScreenLoop:
xpal p1 ; clear screen
ldi ' '
st @1(p1)
xpal p1
jp ClearScreenLoop
ldi Cursor/256 ; reset the cursor position to TOS
xpah p1
ldi Cursor&255
xpal p1
ldi 0 ; Note: could save 2 bytes here, P1.H is 0.
st 0(p1)
; ****************************************************************************************************************
;
; Check if initialised.
;
; ****************************************************************************************************************
ld isInit-Cursor(p1) ; have we initialised ?
xri 0xA7 ; if so this byte should be $A7
jz CommandMainLoop
ldi 0xA7 ; set the initialised byte
st isInit-Cursor(p1)
ldi codeStart/256 ; set the initial work address
st Current-Cursor+1(p1)
ldi codeStart&255
st Current-Cursor(p1)
; print boot message - can lose this if required.
ldi (PrintCharacter-1)/256 ; set P3 = print character.
xpah p3
ldi (PrintCharacter-1)&255
xpal p3
ldi Message / 256 ; set P1 = boot message
xpah p1
ldi Message & 255
xpal p1
MessageLoop:
ld @1(p1) ; read character
jz InitialBeep ; end of message
xppc p3 ; print it
jmp MessageLoop
Message:
db "** SC/MP OS **",13 ; short boot message
db "V0.94 PSR 2016",13
db 0
InitialBeep:
ldi 1 ; Beep on booting.
cas ; play low tone
dly 0xFF
ldi 5 ; play high tone.
cas
dly 0xFF
ldi 0 ; sound off.
cas
; ****************************************************************************************************************
;
; Main Loop
;
; ****************************************************************************************************************
CommandMainLoop:
ldi (PrintAddressData-1)/256 ; print Address only
xpah p3
ldi (PrintAddressData-1)&255
xpal p3
ldi 0 ; no data elements
xppc p3
ldi (PrintCharacter-1)/256 ; set P3 = print character.
xpah p3
ldi (PrintCharacter-1)&255
xpal p3
ldi ']' ; print the prompt.
xppc p3
; ****************************************************************************************************************
;
; Keyboard Line Input
;
; ****************************************************************************************************************
ldi 0 ; set E = character position.
xae
KeyboardLoop:
ldi 0x8 ; set P1 to point to keyboard latch
xpah p1
_KBDWaitRelease:
ld 0(p1) ; wait for strobe to clear
jp _KBDWaitKey
jmp _KBDWaitRelease
_KBDWaitKey:
ld 0(p1) ; wait for strobe, i.e. new key
jp _KBDWaitKey
ani 0x7F ; throw away bit 7
st -1(p2) ; save key.
ldi kbdBuffer/256 ; set P1 = keyboard buffer
xpah p1
ldi kbdBuffer&255
xpal p1
ld -1(p2) ; read key
xri 8 ; is it backspace
jz __KBDBackSpace
xri 8!13 ; is it CR, then exit
jz __KBDExit
lde ; have we a full buffer.
xri kbdBufferLn ; if so, ignore the key.
jz KeyboardLoop
ld -1(p2) ; restore the key.
ccl
adi 0x20 ; will make lower case -ve
jp __KBDNotLower
cai 0x20 ; capitalise
__KBDNotLower:
adi 0xE0 ; fix up.
st -0x80(p1) ; save in the buffer using E as index.
xppc p3 ; print the character
xae ; increment E
ccl
adi 1
xae
jmp KeyboardLoop ; and get the next key.
__KBDBackSpace:
lde ; get position
jz KeyboardLoop ; can't go back if at beginning
scl ; go back 1 from E
cai 1
xae
ldi 8 ; print a backspace
xppc p3
jmp KeyboardLoop ; and go round again.
__CmdMainLoop1:
jmp CommandMainLoop
__KBDExit:
st -0x80(p1) ; add the ASCIIZ terminator.
ldi 13 ; print a new line.
xppc p3
; ****************************************************************************************************************
;
; Extract the 5 bit 3 letter (max command value). P1 points to buffer
;
; ****************************************************************************************************************
ldi 0
xae ; E contains the LSB of the 5 bit shift
lde
st -1(p2) ; -1(P2) contains the MSB
st modifier-kbdBuffer(p1) ; clear the modifier.
Extract5Bit:
ld (p1) ; look at character
ccl ; add 128-65, will be +ve if < 64
adi 128-65
jp __ExtractEnd
ldi 5 ; shift current value left 5 times using -2(p2)
st -2(p2)
__Ex5Shift:
lde ; shift E left into CY/L
ccl
ade
xae
ld -1(p2) ; shift CY/L into -1(p2) and carry/link
add -1(p2)
st -1(p2)
dld -2(p2) ; done it 5 times ?
jnz __Ex5Shift
ld @1(p1) ; re-read character.
ani 0x1F ; lower 5 bits only.
ore ; OR into E
xae
jmp Extract5Bit ; go and get the next one.
__ExtractEnd:
ldi parPosn & 255 ; P1.L = Parameter Position, A = first non cmd char
xpal p1
st (p1) ; write to parameter position.
; ****************************************************************************************************************
;
; Find command in -1 (P2) (High) E (Low) in Command table
;
; ****************************************************************************************************************
ldi __commandList & 255 ; point P1 to the command list
xpal p1
ldi __commandList / 256
xpah p1
__FindCommandLoop:
ld 0(p1) ; reached the end of the table ?
or 1(p1) ; which is marked by word 0000
jz __CommandError
ld @3(p1) ; read low byte, and point to next
xre
jnz __FindCommandLoop ; if different to LSB loop back.
ld -2(p1) ; read the high byte
xor -1(p2) ; if different to the MSB loop back.
jnz __FindCommandLoop
; ****************************************************************************************************************
;
; Found command, figure out if ASM or Command, if Command go to that routine
;
; ****************************************************************************************************************
ldi (GetParameter-1) & 255 ; point P3 to the get parameter code.
xpal p3
ldi (GetParameter-1) / 256
xpah p3
ld -1(p1) ; read the operation code.
ani 0xF0 ; look at the m-s-nibble - commands are 0x20.
xri 0x20
jnz __Assembler
ld -1(p1) ; re-read it
ccl
add -1(p1) ; double it
ani 0x1F ; lower 5 bits only.
adi __CommandTable & 255 ; make P1 point to the command table entry
xpal p1
ldi __CommandTable / 256
xpah p1
ld 0(p1) ; read low address
xae
ld 1(p1) ; read high address
xpah p1 ; put in P1.H
lde ; get low address
xpal p1 ; put in P1.L
ld @-1(p1) ; fix up for the pre-increment
xppc p1 ; and go there.
__CommandError: ; unknown command.
ldi 3 ; set the beeper on
cas
dly 0xFF ; short delay
ldi 0 ; set the beeper off
cas
jmp __CmdMainLoop1
; ****************************************************************************************************************
; In line Assembler
; ****************************************************************************************************************
__Assembler:
ld -1(p1) ; this is the operation code to use.
st @-1(p2) ; push on the stack.
xppc p3 ; evaluate (any) parameter if present
csa ; check carry flag set
jp __ASMNoParameter ; if clear, no parameter was provided.
ldi parPosn & 255
xpal p1 ; get the parameter LSB
st @-1(p2) ; push that on the stack, set P1 to parPosn
ldi parPosn / 256
xpah p1
ld (p1) ; read current position
xpal p1 ; P1 now points to character.
ld (p1) ; read character
xri '!' ; is it the label pling ?
jnz __ASMContinue ; we don't need to change this pointer , we should technically.
ld (p2) ; read the value, which is the label number
scl
cai labelCount ; is it a valid label number
jp __CommandError ; no, beep.
ld (p2) ; re-read the label number
xae ; put in E
ldi Labels/256 ; point p1 to labels
xpah p1
ldi Labels&255
xpal p1
ld -0x80(p1) ; read label indexed using E.
st (p2) ; save as the operand
jmp __ASMContinue ; and continue
__ASMNoParameter:
ld (p2) ; read the pushed operation code
ani 0x80 ; is bit 7 set ?
jnz __CommandError ; if it is, we need a parameter
st @-1(p2) ; push zero on the stack as a dummy parameter.
__ASMContinue:
ldi Current/256 ; p3 = &Current Address
xpah p3
ldi Current&255
xpal p3
ld modifier-Current(p3) ; get the modifier (e.g. @,Pn etc.)
ccl
add 1(p2) ; add to the opcode and write it back
st 1(p2)
ld (p3) ; read current address into P1
xpal p1
ld 1(p3)
xpah p1
ld 1(p2) ; read opcode.
st @1(p1) ; write out to current address and bump it.
jp __ASMExit ; if +ve then no operand byte, exit.
ld (p2) ; read the operand byte
st @1(p1) ; write that out as well.
ld modifier-Current(p3) ; look at the modifier
jnz __ASMExit ; if non zero we don't need to do anything P0 = 00
ld 1(p2) ; DLY is a special case
xri 0x8F ; where the modifier is zero but not PC relative.
jz __ASMExit
ld -1(p1) ; read operand
ccl ; one fewer because we want the current addr+1 low
cad (p3) ; subtract the current address low.
st -1(p1) ; write it back
ld 1(p2) ; read opcode again
ani 0xF0 ; is it 9x (a JMP command)
xri 0x90
jnz __ASMExit ; if not, we are done
dld -1(p1) ; one fewer because of the pre-increment
__ASMExit:
xpal p1 ; write current address back out
st (p3)
xpah p1
st 1(p3)
ld @2(p2) ; drop stack values.
jmp __CmdMainLoop2 ; back to command loop
; ****************************************************************************************************************
; ****************************************************************************************************************
;
; Commands Section
;
; ****************************************************************************************************************
; ****************************************************************************************************************
; ****************************************************************************************************************
; A : Set Current address
; ****************************************************************************************************************
Address_Command:
xppc p3 ; get parameter if exists
xppc p3 ; update current if exists.
jmp __CmdMainLoop2
__CmdParameterFail:
ldi 2 ; set the beeper on
cas
dly 0xFF ; short delay
ldi 0 ; set the beeper off
cas
__CmdMainLoop2: ; and go back to the start.
ldi (CommandMainLoop-1) & 255
xpal p3
ldi (CommandMainLoop-1) / 256
xpah p3
xppc p3
; ****************************************************************************************************************
; G : Go (Address must be specified.)
; ****************************************************************************************************************
Go_Command:
xppc p3 ; get parameter, which should exist.
csa ; look at CY/L which is set if it was.
jp __CmdParameterFail ; if it is clear, beep an error.
xpal p1 ; copy P1 to P3
xpal p3
xpah p1
xpah p3
ld @-1(p3) ; fix up for pre increment
xppc p3 ; call the routine.
__CmdMainLoop3:
jmp __CmdMainLoop2 ; re-enter monitor.
; ****************************************************************************************************************
; PUT Write to tape : data mandatory, it is the byte count from the current address.
; ****************************************************************************************************************
PutTape_Command:
xppc p3 ; get the bytes to write.
csa ; if CC, no value was provided
jp __CmdParameterFail ; which is an error.
xpal p1 ; store low byte count in -1(P2)
st -1(p2)
xpah p1 ; store high byte count in -2(P2)
st -2(p2)
ccl ; skip over the update current address
xppc p3 ; this won't update current address as CY/L = 0
xppc p3 ; and load the current address into P1.
ldi 0 ; set the output tape bit low
xae
sio
ldi 32 ; tape leader
st -3(p2)
_PutTapeLeader:
dly 0xFF
dld -3(p2)
jnz _PutTapeLeader
_PutTapeByte: ; output byte at P1
ldi 0 ; set output bit to 0
xae
sio
dly tapeDelay * 4 ; 0 continuation bit + gap between tapes with no signal
ldi 0x1 ; set bit high
xae
sio
ldi 0
dly tapeDelay ; output the start bit.
ld @1(p1) ; read the byte and put it in E.
xae
ldi 8 ; output 8 bits
st -3(p2)
_PutTapeBit:
sio ; output MSB and shift
ldi 0
dly tapeDelay
dld -3(p2) ; do all 8 bits.
jnz _PutTapeBit
dld -1(p2) ; decrement counter
jnz _PutTapeByte
dld -2(p2) ; note MSB goes 0 to -1 when finished.
jp _PutTapeByte
ldi 0x01 ; add the termination bit.
xae
sio
ldi 0 ; put that out.
dly TapeDelay
ldi 0 ; and set the leve back to 0
xae
sio
__CmdMainLoop4:
jmp __CmdMainLoop3
__CmdParameterFail1:
jmp __CmdParameterFail
; ****************************************************************************************************************
; GET [addr] load tape to current position or given address.
; ****************************************************************************************************************
LoadTape_Command:
xppc p3 ; get parameter
xppc p3 ; update current address
xppc p3 ; current address to P1.
ldi 0x8 ; point P3 to the keyboard.
xpah p3
__GetTapeWait:
ld 0(p3) ; check keyboard break
ani 0x80
jnz __CmdParameterFail1
sio ; wait for the start bit, examine tape in.
lde
jp __GetTapeWait
dly tapeDelay * 3 / 2 ; half way into the first bit.
ldi 8 ; read in 8 bits.
st -1(p2)
__GetTapeBits:
sio ; read in one bit
ldi 0
dly tapeDelay ; delay to next bit
dld -1(p2) ; read 8 bits.
jnz __GetTapeBits
lde ; store byte at current address
st @1(p1)
sio ; read in the byte, which is zero if continuing.
lde ; examine bit 7 shifted in.
jp __GetTapeWait ; if zero, wait for the next start bit.
__CmdMainLoop5:
jmp __CmdMainLoop4
; ****************************************************************************************************************
; L : nn Set Label to current address
; ****************************************************************************************************************
Label_Command:
xppc p3 ; get parameter
csa ; check it exists, CY/L must be set
jp __CmdParameterFail1
xpal p1 ; get into A
xae ; put into E
lde ; get back
scl
cai labelCount ; check is < number of labels
jp __CmdParameterFail1
ldi Current/256 ; point P1 to current address
xpah p1
ldi Current&255
xpal p1
ld (p1) ; read current address
xpal p1 ; save in P1.Low
ldi Labels&255 ; get labels low byte in same page as current address
ccl
ade ; add label # to it
xpal p1 ; put in P1.L and restore current address low
st (p1) ; store current address low in label space.
jmp __CmdMainLoop5 ; and exit.
; ****************************************************************************************************************
; M : Dump Memory
; ****************************************************************************************************************
MemoryDump_Command:
xppc p3 ; get parameter if exists
xppc p3 ; update current if exists.
ldi 7 ; print seven rows
st @-1(p2)
__DCLoop:
ldi (PrintAddressData-1)/256 ; print one row of address and data.
xpah p3
ldi (PrintAddressData-1)&255
xpal p3
ldi 4
xppc p3
ldi Current/256 ; point P1 to current
xpah p1
ldi Current&255
xpal p1
ld 0(p1) ; add 4 to current address
ccl
adi 4
st 0(p1)
ld 1(p1)
adi 0
st 1(p1)
dld (p2) ; do it 7 times
jnz __DCLoop
ld @1(p2) ; fix up stack.
__CmdMainLoop6:
jmp __CmdMainLoop5
; ****************************************************************************************************************
; B: Enter Bytes (no address, sequence of byte data)
; ****************************************************************************************************************
EnterBytes_Command:
ldi (GetParameter-1) & 255 ; P3 = Get Parameter routine
xpal p3
ldi (GetParameter-1) / 256
xpah p3
xppc p3 ; get the parameter.
csa ; look at carry
jp __CmdMainLoop5 ; carry clear, no value.
ldi Current/256 ; make P1 point to current
xpah p1
ldi Current&255
xpal p1 ; this pulls the byte value into A
xae ; save it in E
ld 0(p1) ; copy address to save to into P3
xpal p3
ld 1(p1)
xpah p3
lde ; get byte back
st (p3) ; save it in that location
ild 0(p1) ; bump current address and go back and try again.
jnz EnterBytes_Command
ild 1(p1)
jmp EnterBytes_Command
; ****************************************************************************************************************
; D [aaaa] Disassembler
; ****************************************************************************************************************
Disassemble_Command:
xppc p3 ; evaluate
xppc p3 ; update current if new value
ldi 7 ; instructions to disassemble counter
st @-4(p2) ; p2 + 0 = counter p2 + 1 = opcode p2 + 2 = operand
__DAssLoop: ; p2 + 3 = opcode - base opcode.
ldi (PrintAddressData-1)/256 ; print Address only
xpah p3
ldi (PrintAddressData-1)&255
xpal p3
ldi 0
xppc p3
ldi Current / 256 ; point P1 to current address
xpah p1
ldi Current & 255
xpal p1
ld 0(p1) ; load current address into P3
xpal p3
ld 1(p1)
xpah p3
ld @1(p3) ; read opcode
st 1(p2) ; save it
jp __DAssNoOperand ; if +ve no operand
ld @1(p3) ; read operand
st 2(p2) ; save it
__DAssNoOperand:
ldi (__CommandListEnd-3) & 255
xpal p3 ; update current position, setting P3 to last entry
st 0(p1) ; in command table.
ldi (__CommandListEnd-3) / 256
xpah p3
st 1(p1)
__DAssFindOpcode: ; the table is : text (word) opcode (byte)
ld 1(p2) ; get opcode
xor 2(p3) ; check in the same 8 byte page.
ani 0xF0
jnz __DAssNextOpcode
ld 1(p2) ; get opcode
scl
cad 2(p3) ; subtract the base opcode.
st 3(p2) ; save a the offset (possible)
ani 0xE0 ; it needs to be 0x20 or less
jz __DAssFoundOpcode ; if >= 0 then found the correct opcode.
__DAssNextOpcode:
ld @-3(p3) ; go to previous entry in table
jmp __DAssFindOpcode
__DAssLoop2:
jmp __DAssLoop
__CmdMainLoop7:
jmp __CmdMainLoop6
__DAssFoundOpcode:
ld 2(p3) ; look at opcode that matched.
ani 0x87 ; match with 1xxx x100
xri 0x84 ; which is all the immediate instructions.
jnz __DAssNotImmediate
ld 3(p2) ; only do immediate if base offset is zero
jnz __DAssNextOpcode ; fixes C0-C7 being LD, but C4 being LDI.
__DAssNotImmediate:
ld 0(p3) ; save LSB of text on stack
st @-1(p2)
ld 1(p3) ; and the MSB of text on stack
st @-1(p2)
ldi (PrintCharacter-1) / 256 ; set P3 up to print characters
xpah p3
ldi (PrintCharacter-1) & 255
xpal p3
ldi ' ' ; print a space.
xppc p3
ldi 3 ; print 3 characters
st @-1(p2) ; so +0 is count, +1 = text MSB, +2 = text LSB
__DAssPrintMnemonic:
ld 1(p2) ; get text MSB which is in bits .xxxxx..
sr ; shift right twice.
sr
ani 0x1F ; lower 5 bits only
jz __DAssSkipSpace ; don't print spaces (00000)
ccl ; make it 7 bit ASCII code.
adi 64
xppc p3 ; display the character
__DAssSkipSpace:
ldi 5 ; now shift the encoded data left 5 times
st -1(p2)
__DAssShiftEncode:
ccl
ld 2(p2)
add 2(p2)
st 2(p2)
ld 1(p2)
add 1(p2)
st 1(p2)
dld -1(p2)
jnz __DAssShiftEncode
dld 0(p2) ; done all three characters
jnz __DAssPrintMnemonic ; if not keep going.
ld @3(p2) ; remove mnemonic stuff off the stack.
ld 3(p2) ; print instruction modifier if required.
jnz __DAssPrintModifier
__DAssPrintOperand:
ld 1(p2) ; get original opcode
jp __DAssNext ; if no operand go to next line of disassembly.
ldi (PrintHexByte-1) / 256 ; set P3 to point to the hex printer
xpah p3
ldi (PrintHexByte-1) & 255
xpal p3
ld 2(p2) ; get operand
scl
xppc p3 ; print it out with a leading space.
__DAssNext:
ldi (PrintCharacter-1) / 256 ; set P3 up to print characters
xpah p3
ldi (PrintCharacter-1) & 255
xpal p3
ldi 13 ; print a newline.
xppc p3
dld 0(p2) ; done all 6 lines
jnz __DAssLoop2 ; no, go round again.
ld @4(p2) ; fix up the stack.
jmp __CmdMainLoop7 ; and time to exit.
__DAssPrintModifier:
ldi ' ' ; print leading space
xppc p3
ld 3(p2) ; read modifier
ani 0x04 ; is @ bit set
jz __DAssNotAutoIndexed
ldi '@' ; print '@'
xppc p3
__DAssNotAutoIndexed:
ldi 'P' ; print 'P'
xppc p3
ld 3(p2) ; print pointer register
ani 3
ori '0'
xppc p3
jmp __DAssPrintOperand ; and print operand.
; ****************************************************************************************************************
; ****************************************************************************************************************
;
; Print A as a hexadecimal 2 digit value. If CY/L set precede with space
;
; ****************************************************************************************************************
; ****************************************************************************************************************
PrintHexByte:
st @-1(p2) ; push A and P3, set P3 up to print character
ldi (PrintCharacter-1)/256
xpah p3
st @-1(p2)
ldi (PrintCharacter-1)&255
xpal p3
st @-1(p2)
csa ; check carry
jp __PHBNoSpace ; if clear, no space.
ldi ' ' ; print leading space
xppc p3
__PHBNoSpace:
ld 2(p2) ; read digit
sr ; convert MSB
sr
sr
sr
ccl
dai 0x90
dai 0x40
xppc p3 ; print
ld 2(p2) ; read digit
ani 0x0F ; convert LSB
ccl
dai 0x90
dai 0x40
xppc p3 ; print
ld @1(p2) ; restore P3 & A and Return
xpal p3
ld @1(p2)
xpah p3
ld @1(p2)
xppc p3
jmp PrintHexByte
; ****************************************************************************************************************
; ****************************************************************************************************************
;
; Print Character in A, preserves all registers, re-entrant. Handles 13 (New Line), 8 (Backspace)
; Characters 32 - 95 only.
;
; Rolls to screen top rather than scrolling.
;
; ****************************************************************************************************************
; ****************************************************************************************************************
PrintCharacter:
st @-1(p2) ; save A
ldi Cursor/256 ; save P1, setting up P1 -> Cursor at same time.
xpah p1
st @-1(p2)
ldi Cursor&255
xpal p1
st @-1(p2)
ldi 0 ; save P3, setting up P3 -> Page 0 (Video RAM Write)
xpah p3
st @-1(p2)
xpal p3
st @-1(p2)
ld (p1) ; read cursor position
xpal p3 ; put in P3.Low
ldi ' ' ; erase the cursor.
st 0(p3)
ld 4(p2) ; read character to print.
xri 13 ; is it CR ?
jz __PCNewLine ; if so, go to new line.
xri 13!8 ; is it Backspace ?
jz __PCBackSpace
ld 4(p2) ; get character to print
ani 0x3F ; make 6 bit ASCII
st @1(p3) ; write into P3, e.g. the screen and bump it.
ild (p1) ; increment cursor position and load
ani 15 ; are we at line start ?
jnz __PCExit ; if so, erase the current line.
__PCBlankNewLine:
ldi 16 ; count to 16, the number of spaces to write out.
st -1(p2)
__PCBlankNewLineLoop:
ldi ' '
st @1(p3)
dld -1(p2)
jnz __PCBlankNewLineLoop
__PCExit:
ld (p1) ; read cursor
xpal p3 ; put in P3.L
ldi 0x9B ; shaded block cursor on screen
st (p3)
ld @1(p2) ; restore P3
xpal p3
ld @1(p2)
xpah p3
ld @1(p2) ; restore P1
xpal p1
ld @1(p2)
xpah p1
ld @1(p2) ; restore A and Return.
xppc p3
jmp PrintCharacter ; and it is re-entrant.
__PCBackSpace:
xpal p3 ; get current cursor position
jz __PCExit ; if top of screen then exit.
dld (p1) ; backspace and load cursor
xpal p3 ; put in P3
ldi ' ' ; erase character there
st (p3)
jmp __PCExit ; and exit.
__PCNewLine:
ld (p1) ; read cursor position
ani 0x70 ; line
ccl ; next line
adi 0x10
st (p1) ; write back
xpal p3 ; put in P3.L
jmp __PCBlankNewLine
; ****************************************************************************************************************
; ****************************************************************************************************************
;
; Print current address followed by A data bytes. Doesn't update current address
;
; ****************************************************************************************************************
; ****************************************************************************************************************
PrintAddressData:
st @-1(p2) ; save count, we don't restore this.
ldi (PrintHexByte-1)/256 ; save and set up P3
xpah p3
st @-1(p2)
ldi (PrintHexByte-1)&255
xpal p3
st @-1(p2)
ldi current / 256 ; point P1 to current address
xpah p1
ldi current & 255
xpal p1
ld 1(p1) ; read high byte of address
ccl
xppc p3 ; print w/o leading space
ld 0(p1) ; read low byte of address
ccl
xppc p3 ; print w/o leading space.
xae ; put in E
ld 1(p1) ; high byte to P1.H
xpah p1
lde ; low byte to P1.H
xpal p1
_PADLoop:
dld 2(p2) ; decrement counter
jp _PADPrint ; if +ve print another byte
ld @1(p2) ; restore P3, skipping A hence @2
xpal p3
ld @2(p2)
xpah p3
xppc p3
jmp PrintAddressData
_PADPrint:
ld @1(p1) ; read byte advance pointer
scl
xppc p3 ; print with space.
jmp _PADLoop
; ****************************************************************************************************************
;
; Look at the parameter string for a parameter, processing @ and Pn as you go, CS if parameter found
; CC otherwise. Return parameter value in P1. Falls through
;
; ****************************************************************************************************************
GetParameter:
ldi parPosn/256 ; current position into P1
xpah p1
ldi parPosn&255
xpal p1
ldi 0 ; -1(p2) is the low byte result
st -1(p2) ; -2(p2) is the high byte result
st -2(p2)
ld (p1) ; read the current position,P1 points to character
xpal p1 ; when we put it in P1.L
__GPASkip: ; skip over spaces to first alphanumeric.
ld (p1) ; read character
jz __GPAExitFail ; if zero, then end of the input string.
ld @1(p1) ; read it, advancing.
xri 32 ; is it space ?
jz __GPASkip
xri 32!'@' ; is it @ ?
jz __GPAAtModifier
xri '@'!'P' ; is it P ?
jz __GPAPointerModifier
__GPANextCharacter:
ld -1(p1) ; get value back after post increment.
ccl
adi 128-48 ; this will be +ve if A < '0'
jp __GPAExitFail
cai 9 ; will be +ve if A < '9', CY/L was clear.
jp __GPAFoundHex
cai 7 ; will be +ve if A < 'A', CY/L was set
jp __GPAExitFail
adi 0xFF-0x85-1 ; will be +ve if A > 'F', CY/L was set.
jp __GPAExitFail
adi (0x70-0xFA) & 0xFF ; make the range as below, CY/L was clear
__GPAFoundHex: ; enter here 0-9 = $76..$7F, A-F = $70..$75
ccl ; convert that to a hex nibble.
adi 10
ani 0xF
xae ; save in E, temporarily
ldi 4 ; now shift the result 4 bits to the left.
st -3(p2) ; -3(p2) is the counter
__GPAShift:
ccl
ld -1(p2) ; shift 16 bit result 1 bit to the left.
add -1(p2)
st -1(p2)
ld -2(p2)
add -2(p2)
st -2(p2)
dld -3(p2) ; do it four times
jnz __GPAShift
ld -1(p2) ; Or E into the LSB
ore
st -1(p2)
ld @1(p1) ; look at next character, post incrementing.
scl
cai 34 ; if it is after space and ! (label marker)
jp __GPANextCharacter ; go back and put it in place.
ld @-1(p1) ; undo the increment, incase we've just read zero.
ldi parPosn & 255 ; put the parPosn address in P1.L, new posn into A
xpal p1
st (p1) ; and write it back
ld -1(p2) ; put the result into P1
xpal p1
ld -2(p2)
xpah p1
scl ; set CY/L to indicate okay
jmp __GPAExit
__GPAPointerModifier:
ld (p1) ; read P<something> ?
ani 0xFC ; is it '0' .. '3'?
xri '0'
jnz __GPAExitFail ; it didn't work, not 0..3
ld @1(p1) ; re-read it and advance
ani 3 ; lower 2 bits only
jmp __GPAAdjustModifier
__GPAAtModifier:
ldi 4 ; set modifier adjustment to +4
__GPAAdjustModifier:
st -3(p2)
ldi modifier & 255 ; point P1 to modifier, save current address in E
xpal p1
xae
ld (p1) ; read modifier
ccl
add -3(p2) ; add the modifying value to it.
st (p1) ; write modifier.
lde ; restore current address to P1.L
xpal p1
jmp __GPASkip ; go back to skip over.
__GPAExitFail:
ccl ; carry clear, e.g. nothing read in / error.
__GPAExit:
xppc p3
; ****************************************************************************************************************
;
; Store parameter value in P1 in the current address, if CS. Falls through.
;
; ****************************************************************************************************************
UpdateCurrentAddress:
csa ; get status reg
jp __UCAExit ; if carry flag clear then exit.
ldi current & 255 ; current address to P1.L, acquired address to E
xpal p1
xae
ldi current / 256 ; current address to P1.H, acquired to A
xpah p1
st 1(p1) ; store address back
lde
st 0(p1)
__UCAExit:
xppc p3
; ****************************************************************************************************************
;
; Get current address into P1.
;
; ****************************************************************************************************************
GetCurrentAddress:
ldi current/256 ; current address ptr in P1
xpah p1
ldi current&255
xpal p1
ld 0(p1) ; low byte to E
xae
ld 1(p1) ; high byte to A
xpah p1 ; then to P1.H
lde ; low byte to P1.L
xpal p1
xppc p3
; ****************************************************************************************************************
;
; List of commands and Jump Table
;
; ****************************************************************************************************************
include commands.inc ; must be at the end, so the command table is in
; the same page.
; ****************************************************************************************************************
;
; Tape Format.
;
; ****************************************************************************************************************
;
; 1 x start bit '1' value is held for period of time.
; 8 x data bits '0 or 1' value is held for a period of time.
; 1 x continuation '0' if another bit follows, '1' if end.
; at least 2 bit times between bytes.
;
; Use DLY 4 with A = 0 (DLY 6 to skip half-start)
; = 13 + 2 * 0 + 514 * 4 microcycles
; = 2,069 microcycles
;
; which is about 240 bits per second.
;
; ****************************************************************************************************************
;
; Monitor Commands
;
; ****************************************************************************************************************
;
; A [aaaa] Set current address to aaaa
; B [cc] [dd] [ee].. Put Bytes cc dd ee etc. in memory from current address onwards.
; C Clear screen
; D [aaaa] Disassemble from aaaa (7 lines of disassembly)
; G aaaa Run from address - address must be given - return with XPPC P3
; L n Set label n to the current address (up to 24 labels 00-17)
; M [aaaa] Memory dump from current address/aaaa (7 lines, 4 bytes per line)
; GET [aaaa] Load tape to current address/aaa
; PUT [nnnn] Write nnnn bytes from current address onwards to tape.
;
; Command Line Assembler:
;
; Standard SC/MP mnemonics, except for XPAH, XPAL, XPPC, HALT and DINT which are XPH XPL XPC HLT DIN
; respectively (4 character mnemonics not supported)
;
; Address modes are written as such:
;
; Direct: LD address (offset auto calculated, also for jump)
; Indexed: LD P1 7 (normally ld 7(p1))
; Immediate: DLY 42
; AutoIndexed: LD @P1 4 (normally ld @4(p1))
;
; Labels are accessed via the pling, so to jump to label 4 rather than address 4 you write
;
; JMP 4!
;
; Documentation of the Mathematics functions are in the included file maths.asm. Sort of.
;
; ****************************************************************************************************************
| paulscottrobson/wallpaper-one | software/monitor_rom/monitor.asm | Assembly | mit | 41,050 |
.686
.model flat,stdcall
option casemap:none
include .\bnlib.inc
include .\bignum.inc
.code
bnFermatpt proc uses esi edi ebx bn:dword
LOCAL cnt
xor ecx,ecx; FALSE
push ecx
mov cnt,ecx
bnCreateX edi,esi,ebx; tmp's
invoke bnMov,edi,bn
invoke bnDec,edi
; test a^(m-1) = 1 (mod m)
mov eax,cnt
.repeat
movzx eax,[BN_FIRST13PRIMES+eax]
mov [esi].BN.dwArray[0],eax
invoke bnModExp,esi,edi,bn,ebx
.if !ABS_BN_IS_ONE(ebx)
jmp @@NotPrime
.endif
mov eax,cnt
inc eax
mov cnt,eax
.until eax == BN_FIRST13PRIMES_SIZE
inc dword ptr [esp];,TRUE
; mov [esi].BN.dwArray[0],2
; invoke bnModExp,esi,edi,bn,ebx
; .if ABS_BN_IS_ONE(ebx)
; mov [esi].BN.dwArray[0],3
; invoke bnModExp,esi,edi,bn,ebx
; .if ABS_BN_IS_ONE(ebx)
; mov [esi].BN.dwArray[0],5
; invoke bnModExp,esi,edi,bn,ebx
; .if ABS_BN_IS_ONE(ebx)
; mov [esi].BN.dwArray[0],7
; invoke bnModExp,esi,edi,bn,ebx
; .if ABS_BN_IS_ONE(ebx)
; mov dword ptr [esp],TRUE
; .endif
; .endif
; .endif
; .endif
@@NotPrime:
bnDestroyX
pop eax
ret
bnFermatpt endp
end
| FloydZ/Crypto-Hash | BigNum/Mod/Primes/bnFermatpt.asm | Assembly | mit | 1,059 |
;******************************************************************************
;* be_blur.asm: SSE2 \be blur
;******************************************************************************
;* Copyright (C) 2013 Rodger Combs <rcombs@rcombs.me>
;*
;* This file is part of libass.
;*
;* Permission to use, copy, modify, and distribute this software for any
;* purpose with or without fee is hereby granted, provided that the above
;* copyright notice and this permission notice appear in all copies.
;*
;* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
;* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
;* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
;* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
;* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
;* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
;* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
;******************************************************************************
%include "x86/x86inc.asm"
SECTION_RODATA 32
low_word_zero: dd 0xFFFF0000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF
SECTION .text
;------------------------------------------------------------------------------
; void be_blur_pass( uint8_t *buf, unsigned width,
; unsigned height, unsigned stride,
; uint16_t *tmp);
;------------------------------------------------------------------------------
INIT_XMM sse2
cglobal be_blur, 5,15,9
.skip_prologue:
mov r6, 2 ; int x = 2;
pxor xmm6, xmm6 ; __m128i temp3 = 0;
mov r7, r0 ; unsigned char *src=buf;
movzx r8, byte [r7 + 1] ; int old_pix = src[1];
movzx r9, byte [r7] ; int old_sum = src[0];
add r9, r8 ; old_sum += old_pix;
lea r12, [r4 + r3 * 2] ; unsigned char *col_sum_buf = tmp + stride * 2;
lea r14, [r1 - 2] ; tmpreg = (w-2);
and r14, -8 ; tmpreg &= (~7);
.first_loop:
movzx r10, byte [r7 + r6] ; int temp1 = src[x];
lea r11, [r8 + r10] ; int temp2 = old_pix + temp1;
mov r8, r10 ; old_pix = temp1;
lea r10, [r9 + r11] ; temp1 = old_sum + temp2;
mov r9, r11 ; old_sum = temp2;
mov word [r4 + r6 * 2], r10w ; col_pix_buf[x] = temp1;
inc r6 ; x++
cmp r6, r1 ; x < w
jl .first_loop
mov r6, 2 ; int x = 2;
lea r7, [r0 + r3] ; unsigned char *src=buf+stride;
movzx r8, byte [r7 + 1] ; int old_pix = src[1];
movzx r9, byte [r7] ; int old_sum = src[0];
add r9, r8 ; old_sum += old_pix
.second_loop:
movzx r10, byte [r7 + r6] ; int temp1 = src[x];
lea r11, [r8 + r10] ; int temp2 = old_pix + temp1;
mov r8, r10 ; old_pix = temp1;
lea r10, [r9 + r11] ; temp1 = old_sum + temp2;
mov r9, r11 ; old_sum = temp2;
movzx r11, word [r4 + r6 * 2] ; temp2 = col_pix_buf[x];
add r11, r10 ; temp2 += temp1;
mov word [r4 + r6 * 2], r10w ; col_pix_buf[x] = temp1;
mov word [r12 + r6 * 2], r11w ; col_sum_buf[x] = temp2;
inc r6 ; x++
cmp r6, r1 ; x < w
jl .second_loop
mov r5, 2 ; int y = 2;
.height_loop:
mov r10, r5; int tmpreg = y;
imul r10, r3; tmpreg *= stride;
lea r7, [r0 + r10] ; unsigned char *src=buf+y*stride;
sub r10, r3 ; tmpreg -= stride;
lea r13, [r0 + r10]; unsigned char *dst=buf+(y-1)*stride;
mov r6, 2 ; int x = 2;
movzx r10, byte [r7] ; temp1 = src[0];
movzx r11, byte [r7 + 1] ; temp2 = src[1];
add r10, r11; temp1 += temp2
movd xm0, r10d; __m128i old_pix_128 = temp2;
movd xm1, r11d; __m128i old_sum_128 = temp1;
.width_loop:
movq xmm2, [r7 + r6]; __m128i new_pix = (src+x);
punpcklbw xmm2, xmm6 ; new_pix = _mm_unpacklo_epi8(new_pix, temp3);
movdqa xmm3, xmm2 ; __m128i temp = new_pix;
pslldq xmm3, 2 ; temp = temp << 2 * 8;
paddw xmm3, xmm0 ; temp = _mm_add_epi16(temp, old_pix_128);
paddw xmm3, xmm2 ; temp = _mm_add_epi16(temp, new_pix);
movdqa xmm0, xmm2 ; old_pix_128 = new_pix;
psrldq xmm0, 14 ; old_pix_128 = old_pix_128 >> 14 * 8;
movdqa xmm2, xmm3 ; new_pix = temp;
pslldq xmm2, 2 ; new_pix = new_pix << 2 * 8;
paddw xmm2, xmm1 ; new_pix = _mm_add_epi16(new_pix, old_sum_128);
paddw xmm2, xmm3 ; new_pix = _mm_add_epi16(new_pix, temp);
movdqa xmm1, xmm3 ; old_sum_128 = temp;
psrldq xmm1, 14 ; old_sum_128 = old_sum_128 >> 14 * 8;
movdqu xmm4, [r4 + r6 * 2] ; __m128i old_col_pix = *(col_pix_buf+x);
movdqu [r4 + r6 * 2], xmm2 ; *(col_pix_buf+x) = new_pix ;
movdqu xmm5, [r12 + r6 * 2] ; __m128i old_col_sum = *(col_pix_sum+x);
movdqa xmm3, xmm2 ; temp = new_pix;
paddw xmm3, xmm4 ; temp = _mm_add_epi16(temp, old_col_pix);
movdqu [r12 + r6 * 2], xmm3 ; *(col_sum_buf+x) = temp;
paddw xmm5, xmm3 ; old_col_sum = _mm_add_epi16(old_col_sum, temp);
psrlw xmm5, 4 ; old_col_sum = old_col_sum >> 4;
packuswb xmm5, xmm5 ; old_col_sum = _mm_packus_epi16(old_col_sum, old_col_sum);
movq qword [r13 + r6 - 1], xmm5 ; *(dst+x-1) = old_col_sum;
add r6, 8; x += 8;
cmp r6, r14; x < ((w - 2) & (~7));
jl .width_loop
movzx r8, byte [r7 + r6 - 1] ; old_pix = src[x-1];
movzx r9, byte [r7 + r6 - 2] ; old_sum = old_pix + src[x-2];
add r9, r8
jmp .final_width_check
.final_width_loop:
movzx r10, byte [r7 + r6] ; temp1 = src[x];
lea r11, [r8 + r10] ; temp2 = old_pix + temp1;
mov r8, r10 ; old_pix = temp1;
lea r10, [r9 + r11] ; temp1 = old_sum + temp2;
mov r9, r11 ; old_sum = temp2;
movzx r11, word [r4 + r6 * 2] ; temp2 = col_pix_buf[x];
add r11, r10 ; temp2 += temp1;
mov word [r4 + r6 * 2], r10w ; col_pix_buf[x] = temp1;
movzx r10, word [r12 + r6 * 2] ; temp1 = col_sum_buf[x];
add r10, r11 ; temp1 += temp2;
shr r10, 4 ; temp1 >>= 4;
mov byte [r13 + r6 - 1], r10b ; dst[x-1] = temp1
mov [r12 + r6 * 2], r11w ; col_sum_buf[x] = temp2;
inc r6 ; x++
.final_width_check:
cmp r6, r1 ; x < w
jl .final_width_loop
inc r5 ; y++;
cmp r5, r2 ; y < h;
jl .height_loop
RET
INIT_YMM avx2
cglobal be_blur, 5,15,9
cmp r1, 32
jl be_blur_sse2.skip_prologue
mov r6, 2 ; int x = 2;
vpxor ymm6, ymm6 ; __m128i temp3 = 0;
mov r7, r0 ; unsigned char *src=buf;
movzx r8, byte [r7 + 1] ; int old_pix = src[1];
movzx r9, byte [r7] ; int old_sum = src[0];
add r9, r8 ; old_sum += old_pix;
lea r12, [r4 + r3 * 2] ; unsigned char *col_sum_buf = tmp + stride * 2;
lea r14, [r1 - 2] ; tmpreg = (w-2);
and r14, -16 ; tmpreg &= (~15);
vmovdqa ymm7, [low_word_zero]
.first_loop:
movzx r10, byte [r7 + r6] ; int temp1 = src[x];
lea r11, [r8 + r10] ; int temp2 = old_pix + temp1;
mov r8, r10 ; old_pix = temp1;
lea r10, [r9 + r11] ; temp1 = old_sum + temp2;
mov r9, r11 ; old_sum = temp2;
mov word [r4 + r6 * 2], r10w ; col_pix_buf[x] = temp1;
inc r6 ; x++
cmp r6, r1 ; x < w
jl .first_loop
mov r6, 2 ; int x = 2;
lea r7, [r0 + r3] ; unsigned char *src=buf+stride;
movzx r8, byte [r7 + 1] ; int old_pix = src[1];
movzx r9, byte [r7] ; int old_sum = src[0];
add r9, r8 ; old_sum += old_pix
.second_loop:
movzx r10, byte [r7 + r6] ; int temp1 = src[x];
lea r11, [r8 + r10] ; int temp2 = old_pix + temp1;
mov r8, r10 ; old_pix = temp1;
lea r10, [r9 + r11] ; temp1 = old_sum + temp2;
mov r9, r11 ; old_sum = temp2;
movzx r11, word [r4 + r6 * 2] ; temp2 = col_pix_buf[x];
add r11, r10 ; temp2 += temp1;
mov word [r4 + r6 * 2], r10w ; col_pix_buf[x] = temp1;
mov word [r12 + r6 * 2], r11w ; col_sum_buf[x] = temp2;
inc r6 ; x++
cmp r6, r1 ; x < w
jl .second_loop
mov r5, 2 ; int y = 2;
.height_loop:
mov r10, r5; int tmpreg = y;
imul r10, r3; tmpreg *= stride;
lea r7, [r0 + r10] ; unsigned char *src=buf+y*stride;
sub r10, r3 ; tmpreg -= stride;
lea r13, [r0 + r10]; unsigned char *dst=buf+(y-1)*stride;
mov r6, 2 ; int x = 2;
movzx r10, byte [r7] ; temp1 = src[0];
movzx r11, byte [r7 + 1] ; temp2 = src[1];
add r10, r11; temp1 += temp2
vmovd xmm0, r10d; __m128i old_pix_128 = temp2;
vmovd xmm1, r11d; __m128i old_sum_128 = temp1;
.width_loop:
vpermq ymm2, [r7 + r6], 0x10
vpunpcklbw ymm2, ymm2, ymm6 ; new_pix = _mm_unpacklo_epi8(new_pix, temp3);
vpermq ymm8, ymm2, 0x4e
vpalignr ymm3, ymm2, ymm8, 14
vpand ymm3, ymm3, ymm7
vpaddw ymm3, ymm0 ; temp = _mm_add_epi16(temp, old_pix_128);
vpaddw ymm3, ymm2 ; temp = _mm_add_epi16(temp, new_pix);
vperm2i128 ymm0, ymm2, ymm6, 0x21
vpsrldq ymm0, ymm0, 14; temp = temp >> 14 * 8;
vpermq ymm8, ymm3, 0x4e
vpand ymm8, ymm8, ymm7;
vpalignr ymm2, ymm3, ymm8, 14
vpand ymm2, ymm2, ymm7
vpaddw ymm2, ymm1 ; new_pix = _mm_add_epi16(new_pix, old_sum_128);
vpaddw ymm2, ymm3 ; new_pix = _mm_add_epi16(new_pix, temp);
vperm2i128 ymm1, ymm3, ymm6, 0x21
vpsrldq ymm1, ymm1, 14; temp = temp << 2 * 8;
vmovdqu ymm4, [r4 + r6 * 2] ; __m128i old_col_pix = *(col_pix_buf+x);
vmovdqu [r4 + r6 * 2], ymm2 ; *(col_pix_buf+x) = new_pix ;
vmovdqu ymm5, [r12 + r6 * 2] ; __m128i old_col_sum = *(col_pix_sum+x);
vpaddw ymm3, ymm2, ymm4
vmovdqu [r12 + r6 * 2], ymm3 ; *(col_sum_buf+x) = temp;
vpaddw ymm5, ymm3 ; old_col_sum = _mm_add_epi16(old_col_sum, temp);
vpsrlw ymm5, 4 ; old_col_sum = old_col_sum >> 4;
vpackuswb ymm5, ymm5 ; old_col_sum = _mm_packus_epi16(old_col_sum, old_col_sum);
vpermq ymm5, ymm5, 11_01_10_00b
vmovdqu [r13 + r6 - 1], xmm5 ; *(dst+x-1) = old_col_sum;
add r6, 16; x += 16;
cmp r6, r14; x < ((w - 2) & (~15));
jl .width_loop
movzx r8, byte [r7 + r6 - 1] ; old_pix = src[x-1];
movzx r9, byte [r7 + r6 - 2] ; old_sum = old_pix + src[x-2];
add r9, r8
jmp .final_width_check
.final_width_loop:
movzx r10, byte [r7 + r6] ; temp1 = src[x];
lea r11, [r8 + r10] ; temp2 = old_pix + temp1;
mov r8, r10 ; old_pix = temp1;
lea r10, [r9 + r11] ; temp1 = old_sum + temp2;
mov r9, r11 ; old_sum = temp2;
movzx r11, word [r4 + r6 * 2] ; temp2 = col_pix_buf[x];
add r11, r10 ; temp2 += temp1;
mov word [r4 + r6 * 2], r10w ; col_pix_buf[x] = temp1;
movzx r10, word [r12 + r6 * 2] ; temp1 = col_sum_buf[x];
add r10, r11 ; temp1 += temp2;
shr r10, 4 ; temp1 >>= 4;
mov byte [r13 + r6 - 1], r10b ; dst[x-1] = temp1
mov [r12 + r6 * 2], r11w ; col_sum_buf[x] = temp2;
inc r6 ; x++
.final_width_check:
cmp r6, r1 ; x < w
jl .final_width_loop
inc r5 ; y++;
cmp r5, r2 ; y < h;
jl .height_loop
RET
| ninetian/ffmpeginstaller | libass-0.14.0/libass/x86/be_blur.asm | Assembly | apache-2.0 | 10,613 |
%define ARCH_ARM 0
%define ARCH_MIPS 0
%define ARCH_X86 0
%define ARCH_X86_64 1
%define ARCH_PPC32 0
%define ARCH_PPC64 0
%define HAVE_EDSP 0
%define HAVE_MEDIA 0
%define HAVE_NEON 0
%define HAVE_NEON_ASM 0
%define HAVE_MIPS32 0
%define HAVE_DSPR2 0
%define HAVE_MIPS64 0
%define HAVE_MMX 1
%define HAVE_SSE 1
%define HAVE_SSE2 1
%define HAVE_SSE3 1
%define HAVE_SSSE3 1
%define HAVE_SSE4_1 1
%define HAVE_AVX 1
%define HAVE_AVX2 1
%define HAVE_ALTIVEC 0
%define HAVE_VPX_PORTS 1
%define HAVE_STDINT_H 0
%define HAVE_ALT_TREE_LAYOUT 0
%define HAVE_PTHREAD_H 0
%define HAVE_SYS_MMAN_H 0
%define HAVE_UNISTD_H 0
%define CONFIG_EXTERNAL_BUILD 1
%define CONFIG_INSTALL_DOCS 0
%define CONFIG_INSTALL_BINS 1
%define CONFIG_INSTALL_LIBS 1
%define CONFIG_INSTALL_SRCS 0
%define CONFIG_USE_X86INC 1
%define CONFIG_DEBUG 0
%define CONFIG_GPROF 0
%define CONFIG_GCOV 0
%define CONFIG_RVCT 0
%define CONFIG_GCC 0
%define CONFIG_MSVS 1
%define CONFIG_PIC 0
%define CONFIG_BIG_ENDIAN 0
%define CONFIG_CODEC_SRCS 0
%define CONFIG_DEBUG_LIBS 0
%define CONFIG_FAST_UNALIGNED 1
%define CONFIG_MEM_MANAGER 0
%define CONFIG_MEM_TRACKER 0
%define CONFIG_MEM_CHECKS 0
%define CONFIG_DEQUANT_TOKENS 0
%define CONFIG_DC_RECON 0
%define CONFIG_RUNTIME_CPU_DETECT 1
%define CONFIG_POSTPROC 1
%define CONFIG_VP9_POSTPROC 0
%define CONFIG_MULTITHREAD 1
%define CONFIG_INTERNAL_STATS 0
%define CONFIG_VP8_ENCODER 1
%define CONFIG_VP8_DECODER 1
%define CONFIG_VP9_ENCODER 1
%define CONFIG_VP9_DECODER 1
%define CONFIG_VP8 1
%define CONFIG_VP9 1
%define CONFIG_ENCODERS 1
%define CONFIG_DECODERS 1
%define CONFIG_STATIC_MSVCRT 0
%define CONFIG_SPATIAL_RESAMPLING 1
%define CONFIG_REALTIME_ONLY 1
%define CONFIG_ONTHEFLY_BITPACKING 0
%define CONFIG_ERROR_CONCEALMENT 0
%define CONFIG_SHARED 0
%define CONFIG_STATIC 1
%define CONFIG_SMALL 0
%define CONFIG_POSTPROC_VISUALIZER 0
%define CONFIG_OS_SUPPORT 1
%define CONFIG_UNIT_TESTS 0
%define CONFIG_WEBM_IO 1
%define CONFIG_LIBYUV 1
%define CONFIG_DECODE_PERF_TESTS 0
%define CONFIG_ENCODE_PERF_TESTS 0
%define CONFIG_MULTI_RES_ENCODING 1
%define CONFIG_TEMPORAL_DENOISING 1
%define CONFIG_VP9_TEMPORAL_DENOISING 1
%define CONFIG_COEFFICIENT_RANGE_CHECKING 0
%define CONFIG_VP9_HIGHBITDEPTH 0
%define CONFIG_EXPERIMENTAL 0
%define CONFIG_SIZE_LIMIT 0
%define CONFIG_SPATIAL_SVC 0
%define CONFIG_FP_MB_STATS 0
%define CONFIG_EMULATE_HARDWARE 0
| CTSRD-SOAAP/chromium-42.0.2311.135 | third_party/libvpx/source/config/win/x64/vpx_config.asm | Assembly | bsd-3-clause | 2,360 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2014. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;; Realtek 8139 driver for KolibriOS ;;
;; ;;
;; based on RTL8139.asm driver for menuetos ;;
;; and realtek8139.asm for SolarOS by Eugen Brasoveanu ;;
;; ;;
;; Written by hidnplayr@kolibrios.org ;;
;; ;;
;; GNU GENERAL PUBLIC LICENSE ;;
;; Version 2, June 1991 ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
format MS COFF
API_VERSION = 0x01000100
DRIVER_VERSION = 5
MAX_DEVICES = 16
RBLEN = 3 ; Receive buffer size: 0==8K 1==16k 2==32k 3==64k
TXRR = 8 ; total retries = 16+(TXRR*16)
TX_MXDMA = 6 ; 0=16 1=32 2=64 3=128 4=256 5=512 6=1024 7=2048
ERTXTH = 8 ; in unit of 32 bytes e.g:(8*32)=256
RX_MXDMA = 7 ; 0=16 1=32 2=64 3=128 4=256 5=512 6=1024 7=unlimited
RXFTH = 7 ; 0=16 1=32 2=64 3=128 4=256 5=512 6=1024 7=no threshold
DEBUG = 1
__DEBUG__ = 1
__DEBUG_LEVEL__ = 2 ; 1 = verbose, 2 = errors only
include '../struct.inc'
include '../macros.inc'
include '../proc32.inc'
include '../imports.inc'
include '../fdo.inc'
include '../netdrv.inc'
public START
public service_proc
public version
REG_IDR0 = 0x00
REG_MAR0 = 0x08 ; multicast filter register 0
REG_MAR4 = 0x0c ; multicast filter register 4
REG_TSD0 = 0x10 ; transmit status of descriptor
REG_TSAD0 = 0x20 ; transmit start address of descriptor
REG_RBSTART = 0x30 ; RxBuffer start address
REG_COMMAND = 0x37 ; command register
REG_CAPR = 0x38 ; current address of packet read (word) R/W
REG_IMR = 0x3c ; interrupt mask register
REG_ISR = 0x3e ; interrupt status register
REG_TXCONFIG = 0x40 ; transmit configuration register
REG_RXCONFIG = 0x44 ; receive configuration register 0
REG_MPC = 0x4c ; missed packet counter
REG_9346CR = 0x50 ; serial eeprom 93C46 command register
REG_CONFIG1 = 0x52 ; configuration register 1
REG_MSR = 0x58
REG_CONFIG4 = 0x5a ; configuration register 4
REG_HLTCLK = 0x5b ; undocumented halt clock register
REG_BMCR = 0x62 ; basic mode control register
REG_ANAR = 0x66 ; auto negotiation advertisement register
REG_9346CR_WE = 11b shl 6
BIT_RUNT = 4 ; total packet length < 64 bytes
BIT_LONG = 3 ; total packet length > 4k
BIT_CRC = 2 ; crc error occured
BIT_FAE = 1 ; frame alignment error occured
BIT_ROK = 0 ; received packet is ok
BIT_RST = 4 ; reset bit
BIT_RE = 3 ; receiver enabled
BIT_TE = 2 ; transmitter enabled
BUFE = 1 ; rx buffer is empty, no packet stored
BIT_ISR_TOK = 2 ; transmit ok
BIT_ISR_RER = 1 ; receive error interrupt
BIT_ISR_ROK = 0 ; receive ok
BIT_TX_MXDMA = 8 ; Max DMA burst size per Tx DMA burst
BIT_TXRR = 4 ; Tx Retry count 16+(TXRR*16)
BIT_RXFTH = 13 ; Rx fifo threshold
BIT_RBLEN = 11 ; Ring buffer length indicator
BIT_RX_MXDMA = 8 ; Max DMA burst size per Rx DMA burst
BIT_NOWRAP = 7 ; transfered data wrapping
BIT_9356SEL = 6 ; eeprom selector 9346/9356
BIT_AER = 5 ; accept error packets
BIT_AR = 4 ; accept runt packets
BIT_AB = 3 ; accept broadcast packets
BIT_AM = 2 ; accept multicast packets
BIT_APM = 1 ; accept physical match packets
BIT_AAP = 0 ; accept all packets
BIT_93C46_EEM1 = 7 ; RTL8139 eeprom operating mode1
BIT_93C46_EEM0 = 6 ; RTL8139 eeprom operating mode0
BIT_93C46_EECS = 3 ; chip select
BIT_93C46_EESK = 2 ; serial data clock
BIT_93C46_EEDI = 1 ; serial data input
BIT_93C46_EEDO = 0 ; serial data output
BIT_LWACT = 4 ; see REG_CONFIG1
BIT_SLEEP = 1 ; sleep bit at older chips
BIT_PWRDWN = 0 ; power down bit at older chips
BIT_PMEn = 0 ; power management enabled
BIT_LWPTN = 2 ; see REG_CONFIG4
BIT_ERTXTH = 16 ; early TX threshold
BIT_TOK = 15 ; transmit ok
BIT_OWN = 13 ; tx DMA operation is completed
BIT_ANE = 12 ; auto negotiation enable
BIT_TXFD = 8 ; 100base-T full duplex
BIT_TX = 7 ; 100base-T
BIT_10FD = 6 ; 10base-T full duplex
BIT_10 = 5 ; 10base-T
BIT_SELECTOR = 0 ; binary encoded selector CSMA/CD=00001
BIT_IFG1 = 25
BIT_IFG0 = 24
RX_CONFIG = (RBLEN shl BIT_RBLEN) or \
(RX_MXDMA shl BIT_RX_MXDMA) or \
(1 shl BIT_NOWRAP) or \
(RXFTH shl BIT_RXFTH) or\
(1 shl BIT_AB) or \ ; Accept broadcast packets
(1 shl BIT_APM) or \ ; Accept physical match packets
(1 shl BIT_AER) or \ ; Accept error packets
(1 shl BIT_AR) or \ ; Accept Runt packets (smaller then 64 bytes)
(1 shl BIT_AM) ; Accept multicast packets
RX_BUFFER_SIZE = (8192 shl RBLEN);+16+1500
MAX_ETH_FRAME_SIZE = 1514
NUM_TX_DESC = 4 ; not user selectable
EE_93C46_REG_ETH_ID = 7 ; MAC offset
EE_93C46_READ_CMD = (6 shl 6) ; 110b + 6bit address
EE_93C56_READ_CMD = (6 shl 8) ; 110b + 8bit address
EE_93C46_CMD_LENGTH = 9 ; start bit + cmd + 6bit address
EE_93C56_CMD_LENGTH = 11 ; start bit + cmd + 8bit ddress
VER_RTL8139 = 1100000b
VER_RTL8139A = 1110000b
VER_RTL8139AG = 1110100b
VER_RTL8139B = 1111000b
VER_RTL8130 = VER_RTL8139B
VER_RTL8139C = 1110100b
VER_RTL8100 = 1111010b
VER_RTL8100B = 1110101b
VER_RTL8139D = VER_RTL8100B
VER_RTL8139CP = 1110110b
VER_RTL8101 = 1110111b
IDX_RTL8139 = 0
IDX_RTL8139A = 1
IDX_RTL8139B = 2
IDX_RTL8139C = 3
IDX_RTL8100 = 4
IDX_RTL8139D = 5
IDX_RTL8139D = 6
IDX_RTL8101 = 7
ISR_SERR = 1 shl 15
ISR_TIMEOUT = 1 shl 14
ISR_LENCHG = 1 shl 13
ISR_FIFOOVW = 1 shl 6
ISR_PUN = 1 shl 5
ISR_RXOVW = 1 shl 4
ISR_TER = 1 shl 3
ISR_TOK = 1 shl 2
ISR_RER = 1 shl 1
ISR_ROK = 1 shl 0
INTERRUPT_MASK = ISR_ROK or \
ISR_RER or \
ISR_TOK or \
ISR_TER or \
ISR_RXOVW or \
ISR_PUN or \
ISR_FIFOOVW or \
ISR_LENCHG or \
ISR_TIMEOUT or \
ISR_SERR
TSR_OWN = 1 shl 13
TSR_TUN = 1 shl 14
TSR_TOK = 1 shl 15
TSR_CDH = 1 shl 28
TSR_OWC = 1 shl 29
TSR_TABT = 1 shl 30
TSR_CRS = 1 shl 31
virtual at ebx
device:
ETH_DEVICE
.rx_buffer dd ?
.rx_data_offset dd ?
.io_addr dd ?
.curr_tx_desc db ?
.pci_bus dd ?
.pci_dev dd ?
.irq_line db ?
.hw_ver_id db ?
db ? ; align 4
.TX_DESC rd NUM_TX_DESC
.size = $ - device
end virtual
section '.flat' code readable align 16
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; proc START ;;
;; ;;
;; (standard driver proc) ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
align 4
proc START stdcall, state:dword
cmp [state], 1
jne .exit
.entry:
DEBUGF 2, "Loading driver\n"
stdcall RegService, my_service, service_proc
ret
.fail:
.exit:
xor eax, eax
ret
endp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; proc SERVICE_PROC ;;
;; ;;
;; (standard driver proc) ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
align 4
proc service_proc stdcall, ioctl:dword
mov edx, [ioctl]
mov eax, [edx + IOCTL.io_code]
;------------------------------------------------------
cmp eax, 0 ;SRV_GETVERSION
jne @F
cmp [edx + IOCTL.out_size], 4
jb .fail
mov eax, [edx + IOCTL.output]
mov [eax], dword API_VERSION
xor eax, eax
ret
;------------------------------------------------------
@@:
cmp eax, 1 ;SRV_HOOK
jne .fail
cmp [edx + IOCTL.inp_size], 3 ; Data input must be at least 3 bytes
jb .fail
mov eax, [edx + IOCTL.input]
cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given
jne .fail ; other types arent supported for this card yet
; check if the device is already listed
mov esi, device_list
mov ecx, [devices]
test ecx, ecx
jz .firstdevice
mov ax, [eax+1] ; get the pci bus and device numbers
.nextdevice:
mov ebx, [esi]
cmp al, byte[device.pci_bus]
jne @f
cmp ah, byte[device.pci_dev]
je .find_devicenum ; Device is already loaded, let's find it's device number
@@:
add esi, 4
loop .nextdevice
; This device doesnt have its own eth_device structure yet, lets create one
.firstdevice:
cmp [devices], MAX_DEVICES ; First check if the driver can handle one more card
jae .fail
allocate_and_clear ebx, device.size, .fail ; Allocate the buffer for device structure
; Fill in the direct call addresses into the struct
mov [device.reset], reset
mov [device.transmit], transmit
mov [device.unload], unload
mov [device.name], my_service
; save the pci bus and device numbers
mov eax, [edx + IOCTL.input]
movzx ecx, byte[eax+1]
mov [device.pci_bus], ecx
movzx ecx, byte[eax+2]
mov [device.pci_dev], ecx
; Now, it's time to find the base io addres of the PCI device
PCI_find_io
; We've found the io address, find IRQ now
PCI_find_irq
DEBUGF 1, "Hooking into device, dev:%x, bus:%x, irq:%x, I/O addr:%x\n",\
[device.pci_dev]:1,[device.pci_bus]:1,[device.irq_line]:1,[device.io_addr]:4
; Allocate the receive buffer
stdcall CreateRingBuffer, dword (RX_BUFFER_SIZE), dword PG_SW
test eax, eax
jz .err
mov [device.rx_buffer], eax
; Ok, the eth_device structure is ready, let's probe the device
call probe ; this function will output in eax
test eax, eax
jnz .err ; If an error occured, exit
mov eax, [devices] ; Add the device structure to our device list
mov [device_list+4*eax], ebx ; (IRQ handler uses this list to find device)
inc [devices] ;
call reset
test eax, eax
jnz .destroy
mov [device.type], NET_TYPE_ETH
call NetRegDev
cmp eax, -1
je .destroy
ret
; If the device was already loaded, find the device number and return it in eax
.find_devicenum:
DEBUGF 1, "Trying to find device number of already registered device\n"
call NetPtrToNum ; This kernel procedure converts a pointer to device struct in ebx
; into a device number in edi
mov eax, edi ; Application wants it in eax instead
DEBUGF 1, "Kernel says: %u\n", eax
ret
; If an error occured, remove all allocated data and exit (returning -1 in eax)
.destroy:
; todo: unregister device from device_list
; todo: reset device into virgin state
.err:
DEBUGF 2, "Error, removing all data !\n"
stdcall KernelFree, [device.rx_buffer]
stdcall KernelFree, ebx
.fail:
or eax, -1
ret
;------------------------------------------------------
endp
;;/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\;;
;; ;;
;; Actual Hardware dependent code starts here ;;
;; ;;
;;/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\;;
align 4
unload:
; TODO: (in this particular order)
;
; - Stop the device
; - Detach int handler
; - Remove device from local list (RTL8139_LIST)
; - call unregister function in kernel
; - Remove all allocated structures and buffers the card used
or eax, -1
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; probe: enables the device (if it really is RTL8139)
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
align 4
probe:
DEBUGF 1, "Probing\n"
PCI_make_bus_master
; get chip version
set_io 0
set_io REG_TXCONFIG + 2
in ax, dx
shr ah, 2
shr ax, 6
and al, 01111111b
; now find it in our array
mov ecx, HW_VER_ARRAY_SIZE-1
.chip_ver_loop:
cmp al, [hw_ver_array + ecx]
je .chip_ver_found
dec ecx
jns .chip_ver_loop
.unknown:
mov ecx, 8
.chip_ver_found:
cmp ecx, 8
ja .unknown
mov [device.hw_ver_id], cl
mov ecx, [crosslist+ecx*4]
mov [device.name], ecx
DEBUGF 1, "Chip version: %s\n", ecx
; wake up the chip
set_io 0
set_io REG_HLTCLK
mov al, 'R' ; run the clock
out dx, al
; unlock config and BMCR registers
set_io REG_9346CR
mov al, (1 shl BIT_93C46_EEM1) or (1 shl BIT_93C46_EEM0)
out dx, al
; enable power management
set_io REG_CONFIG1
in al, dx
cmp [device.hw_ver_id], IDX_RTL8139B
jae .new_chip
; wake up older chips
and al, not ((1 shl BIT_SLEEP) or (1 shl BIT_PWRDWN))
out dx, al
jmp .finish_wake_up
; set LWAKE pin to active high (default value).
; it is for Wake-On-LAN functionality of some motherboards.
; this signal is used to inform the motherboard to execute a wake-up process.
; only at newer chips.
.new_chip:
or al, (1 shl BIT_PMEn)
and al, not (1 shl BIT_LWACT)
out dx, al
set_io REG_CONFIG4
in al, dx
and al, not (1 shl BIT_LWPTN)
out dx, al
; lock config and BMCR registers
.finish_wake_up:
xor al, al
set_io 0
set_io REG_9346CR
out dx, al
DEBUGF 1, "probing done!\n"
xor eax, eax
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; reset: Set up all registers and descriptors, clear some values
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
reset:
DEBUGF 1, "Reset\n"
; attach int handler
movzx eax, [device.irq_line]
DEBUGF 1, "Attaching int handler to irq %x\n", eax:1
stdcall AttachIntHandler, eax, int_handler, dword 0
test eax, eax
jnz @f
DEBUGF 2, "Could not attach int handler!\n"
; or eax, -1
; ret
@@:
; reset chip
DEBUGF 1, "Resetting chip\n"
set_io 0
set_io REG_COMMAND
mov al, 1 shl BIT_RST
out dx, al
mov cx, 1000 ; wait no longer for the reset
.wait_for_reset:
in al, dx
test al, 1 shl BIT_RST
jz .reset_completed ; RST remains 1 during reset
dec cx
jns .wait_for_reset
DEBUGF 2, "Reset timeout!\n"
.reset_completed:
; Read MAC address
call read_mac
; unlock config and BMCR registers
set_io 0
set_io REG_9346CR
mov al, (1 shl BIT_93C46_EEM1) or (1 shl BIT_93C46_EEM0)
out dx, al
; initialize multicast registers (no filtering)
mov eax, 0xffffffff
set_io REG_MAR0
out dx, eax
set_io REG_MAR4
out dx, eax
; enable Rx/Tx
mov al, (1 shl BIT_RE) or (1 shl BIT_TE)
set_io REG_COMMAND
out dx, al
; Rxbuffer size, unlimited dma burst, no wrapping, no rx threshold
; accept broadcast packets, accept physical match packets
mov eax, RX_CONFIG
set_io REG_RXCONFIG
out dx, eax
; 1024 bytes DMA burst, total retries = 16 + 8 * 16 = 144
mov eax, (TX_MXDMA shl BIT_TX_MXDMA) or (TXRR shl BIT_TXRR) or BIT_IFG1 or BIT_IFG0
set_io REG_TXCONFIG
out dx, eax
; enable auto negotiation
set_io REG_BMCR
in ax, dx
or ax, (1 shl BIT_ANE)
out dx, ax
; set auto negotiation advertisement
set_io REG_ANAR
in ax, dx
or ax, (1 shl BIT_SELECTOR) or (1 shl BIT_10) or (1 shl BIT_10FD) or (1 shl BIT_TX) or (1 shl BIT_TXFD)
out dx, ax
; lock config and BMCR registers
xor eax, eax
set_io REG_9346CR
out dx, al
; init RX/TX pointers
mov [device.rx_data_offset], eax
mov [device.curr_tx_desc], al
; set_io REG_CAPR
; out dx, ax
; clear packet/byte counters
lea edi, [device.bytes_tx]
mov ecx, 6
rep stosd
; clear missing packet counter
set_io REG_MPC
out dx, eax
; set RxBuffer address, init RX buffer offset
mov eax, [device.rx_buffer]
mov dword[eax], 0 ; clear receive flags for first packet (really needed??)
DEBUGF 1, "RX buffer virtual addr=0x%x\n", eax
GetRealAddr
DEBUGF 1, "RX buffer physical addr=0x%x\n", eax
set_io REG_RBSTART
out dx, eax
; enable interrupts
set_io 0
set_io REG_IMR
mov ax, INTERRUPT_MASK
out dx, ax
; Set the mtu, kernel will be able to send now
mov [device.mtu], 1514
call cable
; Indicate that we have successfully reset the card
xor eax, eax
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Transmit ;;
;; ;;
;; In: buffer pointer in [esp+4] ;;
;; size of buffer in [esp+8] ;;
;; pointer to device structure in ebx ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
align 4
transmit:
DEBUGF 1, "Transmitting packet, buffer:%x, size:%u\n", [esp+4], [esp+8]
mov eax, [esp+4]
DEBUGF 1, "To: %x-%x-%x-%x-%x-%x From: %x-%x-%x-%x-%x-%x Type:%x%x\n",\
[eax+00]:2,[eax+01]:2,[eax+02]:2,[eax+03]:2,[eax+04]:2,[eax+05]:2,\
[eax+06]:2,[eax+07]:2,[eax+08]:2,[eax+09]:2,[eax+10]:2,[eax+11]:2,\
[eax+13]:2,[eax+12]:2
cmp dword [esp+8], MAX_ETH_FRAME_SIZE
ja .fail
cmp dword [esp+8], 60
jb .fail
; check if we own the current discriptor
set_io 0
set_io REG_TSD0
movzx ecx, [device.curr_tx_desc]
shl ecx, 2
add edx, ecx
in eax, dx
test eax, (1 shl BIT_OWN)
jz .wait_to_send
.send_packet:
; get next descriptor
inc [device.curr_tx_desc]
and [device.curr_tx_desc], NUM_TX_DESC-1
; Update stats
inc [device.packets_tx]
mov eax, [esp+8]
add dword [device.bytes_tx], eax
adc dword [device.bytes_tx+4], 0
; Set the buffer address
set_io REG_TSAD0
mov eax, [esp+4]
mov [device.TX_DESC+ecx], eax
GetRealAddr
out dx, eax
; And the size of the buffer
set_io REG_TSD0
mov eax, [esp+8]
or eax, (ERTXTH shl BIT_ERTXTH) ; Early threshold
out dx, eax
DEBUGF 1, "Packet Sent!\n"
xor eax, eax
ret 8
.wait_to_send:
DEBUGF 1, "Waiting for timeout\n"
push edx
mov esi, 30
stdcall Sleep
pop edx
in ax, dx
test ax, (1 shl BIT_OWN)
jnz .send_packet
pusha
call reset ; if chip hung, reset it
popa
jmp .send_packet
.fail:
DEBUGF 2, "transmit failed!\n"
stdcall KernelFree, [esp+4]
or eax, -1
ret 8
;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Interrupt handler ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;
align 4
int_handler:
push ebx esi edi
DEBUGF 1, "INT\n"
; find pointer of device wich made IRQ occur
mov ecx, [devices]
test ecx, ecx
jz .nothing
mov esi, device_list
.nextdevice:
mov ebx, [esi]
set_io 0
set_io REG_ISR
in ax, dx ; Get interrupt status
out dx, ax ; send it back to ACK
test ax, ax
jnz .got_it
.continue:
add esi, 4
dec ecx
jnz .nextdevice
.nothing:
pop edi esi ebx
xor eax, eax
ret ; If no device was found, abort (The irq was probably for a device, not registered to this driver)
.got_it:
DEBUGF 1, "Device: %x Status: %x\n", ebx, ax
;----------------------------------------------------
; Received packet ok?
test ax, ISR_ROK
jz @f
push ax
.receive:
set_io 0
set_io REG_COMMAND
in al, dx
test al, BUFE ; test if RX buffer is empty
jnz .finish
DEBUGF 1, "RX:\n"
mov eax, [device.rx_buffer]
add eax, [device.rx_data_offset]
test byte [eax], (1 shl BIT_ROK) ; check if packet is ok
jz .reset_rx
; packet is ok, copy it
movzx ecx, word [eax+2] ; packet length
sub cx, 4 ; don't copy CRC
; Update stats
add dword [device.bytes_rx], ecx
adc dword [device.bytes_rx + 4], 0
inc [device.packets_rx]
DEBUGF 1, "Received %u bytes\n", ecx
push ebx eax ecx
stdcall KernelAlloc, ecx ; Allocate a buffer to put packet into
pop ecx
test eax, eax ; Test if we allocated succesfully
jz .abort
mov edi, eax ; Where we will copy too
mov esi, [esp] ; The buffer we will copy from
add esi, 4 ; Dont copy CRC
push dword .abort ; Kernel will return to this address after EthReceiver
push ecx edi ; Save buffer pointer and size, to pass to kernel
.copy:
shr ecx, 1
jnc .nb
movsb
.nb:
shr ecx, 1
jnc .nw
movsw
.nw:
jz .nd
rep movsd
.nd:
jmp Eth_input ; Send it to kernel
.abort:
pop eax ebx
; update eth_data_start_offset
movzx eax, word [eax+2] ; packet length
add eax, [device.rx_data_offset]
add eax, 4+3 ; packet header is 4 bytes long + dword alignment
and eax, not 3 ; dword alignment
cmp eax, RX_BUFFER_SIZE
jb .no_wrap
DEBUGF 1, "Wrapping\n"
sub eax, RX_BUFFER_SIZE
.no_wrap:
mov [device.rx_data_offset], eax
DEBUGF 1, "New RX ptr: %d\n", eax
set_io 0
set_io REG_CAPR ; update 'Current Address of Packet Read register'
sub eax, 0x10 ; value 0x10 is a constant for CAPR
out dx, ax
jmp .receive ; check for multiple packets
.reset_rx:
test byte [eax], (1 shl BIT_CRC)
jz .no_crc_error
DEBUGF 2, "RX: CRC error!\n"
.no_crc_error:
test byte [eax], (1 shl BIT_FAE)
jz .no_fae_error
DEBUGF 2, "RX: Frame alignment error!\n"
.no_fae_error:
DEBUGF 1, "Reset RX\n"
in al, dx ; read command register
push ax
and al, not (1 shl BIT_RE) ; Clear the RE bit
out dx, al
pop ax
out dx, al ; write original command back
add edx, REG_RXCONFIG - REG_COMMAND ; Restore RX configuration
mov ax, RX_CONFIG
out dx, ax
.finish:
pop ax
;----------------------------------------------------
; Transmit ok / Transmit error
@@:
test ax, ISR_TOK + ISR_TER
jz @f
DEBUGF 1, "Transmit done!\n"
push ax
mov ecx, (NUM_TX_DESC-1)*4
.txdescloop:
set_io 0
set_io REG_TSD0
add edx, ecx
in eax, dx
test eax, TSR_OWN ; DMA operation completed
jz .notthisone
cmp [device.TX_DESC+ecx], 0
je .notthisone
DEBUGF 1, "TSD: 0x%x\n", eax
test eax, TSR_TUN
jz .no_bun
DEBUGF 2, "TX: FIFO Buffer underrun!\n"
.no_bun:
test eax, TSR_OWC
jz .no_owc
DEBUGF 2, "TX: OWC!\n"
.no_owc:
test eax, TSR_TABT
jz .no_tabt
DEBUGF 2, "TX: TABT!\n"
.no_tabt:
test eax, TSR_CRS
jz .no_csl
DEBUGF 2, "TX: Carrier Sense Lost!\n"
.no_csl:
test eax, TSR_TOK
jz .no_tok
DEBUGF 1, "TX: Transmit OK!\n"
.no_tok:
DEBUGF 1, "free transmit buffer 0x%x\n", [device.TX_DESC+ecx]:8
push ecx ebx
stdcall KernelFree, [device.TX_DESC+ecx]
pop ebx ecx
mov [device.TX_DESC+ecx], 0
.notthisone:
sub ecx, 4
jae .txdescloop
pop ax
;----------------------------------------------------
; Rx buffer overflow ?
@@:
test ax, ISR_RXOVW
jz @f
push ax
DEBUGF 2, "RX:buffer overflow!\n"
set_io 0
set_io REG_ISR
mov ax, ISR_FIFOOVW or ISR_RXOVW
out dx, ax
pop ax
;----------------------------------------------------
; Packet underrun?
@@:
test ax, ISR_PUN
jz @f
DEBUGF 1, "Packet underrun or link changed!\n"
call cable
;----------------------------------------------------
; Receive FIFO overflow ?
@@:
test ax, ISR_FIFOOVW
jz @f
push ax
DEBUGF 2, "RX fifo overflow!\n"
set_io 0
set_io REG_ISR
mov ax, ISR_FIFOOVW or ISR_RXOVW
out dx, ax
pop ax
;----------------------------------------------------
; cable length changed ?
@@:
test ax, ISR_LENCHG
jz .fail
DEBUGF 2, "Cable length changed!\n"
call cable
.fail:
pop edi esi ebx
xor eax, eax
inc eax
ret
;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Update Cable status ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;
align 4
cable:
DEBUGF 1, "Checking link status:\n"
set_io 0
set_io REG_MSR
in al, dx
test al, 1 shl 2 ; 0 = link ok 1 = link fail
jnz .notconnected
test al, 1 shl 3 ; 0 = 100 Mbps 1 = 10 Mbps
jnz .10mbps
.100mbps:
mov [device.state], ETH_LINK_100M
call NetLinkChanged
DEBUGF 2, "link changed to 100 mbit\n"
ret
.10mbps:
mov [device.state], ETH_LINK_10M
call NetLinkChanged
DEBUGF 2, "link changed to 10 mbit\n"
ret
.notconnected:
mov [device.state], ETH_LINK_DOWN
call NetLinkChanged
DEBUGF 2, "no link\n"
ret
;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Write MAC address ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;
align 4
write_mac: ; in: mac pushed onto stack (as 3 words)
DEBUGF 1, "Writing MAC\n"
; disable all in command registers
set_io 0
set_io REG_9346CR
xor eax, eax
out dx, al
set_io REG_IMR
xor eax, eax
out dx, ax
set_io REG_ISR
mov eax, -1
out dx, ax
; enable writing
set_io REG_9346CR
mov eax, REG_9346CR_WE
out dx, al
; write the mac ...
set_io REG_IDR0
pop eax
out dx, eax
set_io REG_IDR0+4
xor eax, eax
pop ax
out dx, eax
; disable writing
set_io REG_9346CR
xor eax, eax
out dx, al
DEBUGF 1, "MAC write ok!\n"
; Notice this procedure does not ret, but continues to read_mac instead.
;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Read MAC address ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;
read_mac:
DEBUGF 1, "Reading MAC:\n"
set_io 0
lea edi, [device.mac]
in eax, dx
stosd
add edx, 4
in ax, dx
stosw
DEBUGF 1, "%x-%x-%x-%x-%x-%x\n",[edi-6]:2,[edi-5]:2,[edi-4]:2,[edi-3]:2,[edi-2]:2,[edi-1]:2
ret
; End of code
section '.data' data readable writable align 16 ; place all uninitialized data place here
align 4 ; Place all initialised data here
devices dd 0
version dd (DRIVER_VERSION shl 16) or (API_VERSION and 0xFFFF)
my_service db 'RTL8139',0 ; max 16 chars include zero
device_1 db 'Realtek 8139',0
device_2 db 'Realtek 8139A',0
device_3 db 'Realtek 8139B',0
device_4 db 'Realtek 8139C',0
device_5 db 'Realtek 8100',0
device_6 db 'Realtek 8139D',0
device_7 db 'Realtek 8139CP',0
device_8 db 'Realtek 8101',0
device_unknown db 'Unknown RTL8139 clone', 0
crosslist:
dd device_1
dd device_2
dd device_3
dd device_4
dd device_5
dd device_6
dd device_7
dd device_8
dd device_unknown
hw_ver_array: ; This array is used by the probe routine to find out wich version of the RTL8139 we are working with
db VER_RTL8139
db VER_RTL8139A
db VER_RTL8139B
db VER_RTL8139C
db VER_RTL8100
db VER_RTL8139D
db VER_RTL8139CP
db VER_RTL8101
db 0
HW_VER_ARRAY_SIZE = $-hw_ver_array
include_debug_strings ; All data wich FDO uses will be included here
device_list rd MAX_DEVICES ; This list contains all pointers to device structures the driver is handling
| devlato/kolibrios-llvm | drivers/ethernet/RTL8139.asm | Assembly | mit | 34,960 |
kernel: file format elf32-i386
Disassembly of section .text:
80100000 <multiboot_header>:
80100000: 02 b0 ad 1b 00 00 add 0x1bad(%eax),%dh
80100006: 00 00 add %al,(%eax)
80100008: fe 4f 52 decb 0x52(%edi)
8010000b: e4 0f in $0xf,%al
8010000c <entry>:
# Entering xv6 on boot processor, with paging off.
.globl entry
entry:
# Turn on page size extension for 4Mbyte pages
movl %cr4, %eax
8010000c: 0f 20 e0 mov %cr4,%eax
orl $(CR4_PSE), %eax
8010000f: 83 c8 10 or $0x10,%eax
movl %eax, %cr4
80100012: 0f 22 e0 mov %eax,%cr4
# Set page directory
movl $(V2P_WO(entrypgdir)), %eax
80100015: b8 00 a0 10 00 mov $0x10a000,%eax
movl %eax, %cr3
8010001a: 0f 22 d8 mov %eax,%cr3
# Turn on paging.
movl %cr0, %eax
8010001d: 0f 20 c0 mov %cr0,%eax
orl $(CR0_PG|CR0_WP), %eax
80100020: 0d 00 00 01 80 or $0x80010000,%eax
movl %eax, %cr0
80100025: 0f 22 c0 mov %eax,%cr0
# Set up the stack pointer.
movl $(stack + KSTACKSIZE), %esp
80100028: bc d0 c5 10 80 mov $0x8010c5d0,%esp
# Jump to main(), and switch to executing at
# high addresses. The indirect call is needed because
# the assembler produces a PC-relative instruction
# for a direct jump.
mov $main, %eax
8010002d: b8 50 2e 10 80 mov $0x80102e50,%eax
jmp *%eax
80100032: ff e0 jmp *%eax
80100034: 66 90 xchg %ax,%ax
80100036: 66 90 xchg %ax,%ax
80100038: 66 90 xchg %ax,%ax
8010003a: 66 90 xchg %ax,%ax
8010003c: 66 90 xchg %ax,%ax
8010003e: 66 90 xchg %ax,%ax
80100040 <binit>:
struct buf head;
} bcache;
void
binit(void)
{
80100040: 55 push %ebp
80100041: 89 e5 mov %esp,%ebp
80100043: 83 ec 18 sub $0x18,%esp
struct buf *b;
initlock(&bcache.lock, "bcache");
80100046: c7 44 24 04 40 76 10 movl $0x80107640,0x4(%esp)
8010004d: 80
8010004e: c7 04 24 e0 c5 10 80 movl $0x8010c5e0,(%esp)
80100055: e8 e6 47 00 00 call 80104840 <initlock>
//PAGEBREAK!
// Create linked list of buffers
bcache.head.prev = &bcache.head;
bcache.head.next = &bcache.head;
8010005a: b9 e4 04 11 80 mov $0x801104e4,%ecx
for(b = bcache.buf; b < bcache.buf+NBUF; b++){
8010005f: b8 14 c6 10 80 mov $0x8010c614,%eax
initlock(&bcache.lock, "bcache");
//PAGEBREAK!
// Create linked list of buffers
bcache.head.prev = &bcache.head;
80100064: c7 05 f0 04 11 80 e4 movl $0x801104e4,0x801104f0
8010006b: 04 11 80
bcache.head.next = &bcache.head;
8010006e: c7 05 f4 04 11 80 e4 movl $0x801104e4,0x801104f4
80100075: 04 11 80
80100078: eb 0a jmp 80100084 <binit+0x44>
8010007a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80100080: 89 c1 mov %eax,%ecx
for(b = bcache.buf; b < bcache.buf+NBUF; b++){
80100082: 89 d0 mov %edx,%eax
b->next = bcache.head.next;
80100084: 89 48 10 mov %ecx,0x10(%eax)
b->prev = &bcache.head;
80100087: c7 40 0c e4 04 11 80 movl $0x801104e4,0xc(%eax)
b->dev = -1;
8010008e: c7 40 04 ff ff ff ff movl $0xffffffff,0x4(%eax)
bcache.head.next->prev = b;
80100095: 8b 15 f4 04 11 80 mov 0x801104f4,%edx
8010009b: 89 42 0c mov %eax,0xc(%edx)
//PAGEBREAK!
// Create linked list of buffers
bcache.head.prev = &bcache.head;
bcache.head.next = &bcache.head;
for(b = bcache.buf; b < bcache.buf+NBUF; b++){
8010009e: 8d 90 18 02 00 00 lea 0x218(%eax),%edx
801000a4: 81 fa e4 04 11 80 cmp $0x801104e4,%edx
b->next = bcache.head.next;
b->prev = &bcache.head;
b->dev = -1;
bcache.head.next->prev = b;
bcache.head.next = b;
801000aa: a3 f4 04 11 80 mov %eax,0x801104f4
//PAGEBREAK!
// Create linked list of buffers
bcache.head.prev = &bcache.head;
bcache.head.next = &bcache.head;
for(b = bcache.buf; b < bcache.buf+NBUF; b++){
801000af: 75 cf jne 80100080 <binit+0x40>
b->prev = &bcache.head;
b->dev = -1;
bcache.head.next->prev = b;
bcache.head.next = b;
}
}
801000b1: c9 leave
801000b2: c3 ret
801000b3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801000b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801000c0 <bread>:
}
// Return a B_BUSY buf with the contents of the indicated block.
struct buf*
bread(uint dev, uint blockno)
{
801000c0: 55 push %ebp
801000c1: 89 e5 mov %esp,%ebp
801000c3: 57 push %edi
801000c4: 56 push %esi
801000c5: 53 push %ebx
801000c6: 83 ec 1c sub $0x1c,%esp
801000c9: 8b 75 08 mov 0x8(%ebp),%esi
static struct buf*
bget(uint dev, uint blockno)
{
struct buf *b;
acquire(&bcache.lock);
801000cc: c7 04 24 e0 c5 10 80 movl $0x8010c5e0,(%esp)
}
// Return a B_BUSY buf with the contents of the indicated block.
struct buf*
bread(uint dev, uint blockno)
{
801000d3: 8b 7d 0c mov 0xc(%ebp),%edi
static struct buf*
bget(uint dev, uint blockno)
{
struct buf *b;
acquire(&bcache.lock);
801000d6: e8 e5 47 00 00 call 801048c0 <acquire>
loop:
// Is the block already cached?
for(b = bcache.head.next; b != &bcache.head; b = b->next){
801000db: 8b 1d f4 04 11 80 mov 0x801104f4,%ebx
801000e1: 81 fb e4 04 11 80 cmp $0x801104e4,%ebx
801000e7: 75 12 jne 801000fb <bread+0x3b>
801000e9: eb 35 jmp 80100120 <bread+0x60>
801000eb: 90 nop
801000ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801000f0: 8b 5b 10 mov 0x10(%ebx),%ebx
801000f3: 81 fb e4 04 11 80 cmp $0x801104e4,%ebx
801000f9: 74 25 je 80100120 <bread+0x60>
if(b->dev == dev && b->blockno == blockno){
801000fb: 3b 73 04 cmp 0x4(%ebx),%esi
801000fe: 75 f0 jne 801000f0 <bread+0x30>
80100100: 3b 7b 08 cmp 0x8(%ebx),%edi
80100103: 75 eb jne 801000f0 <bread+0x30>
if(!(b->flags & B_BUSY)){
80100105: 8b 03 mov (%ebx),%eax
80100107: a8 01 test $0x1,%al
80100109: 74 64 je 8010016f <bread+0xaf>
b->flags |= B_BUSY;
release(&bcache.lock);
return b;
}
sleep(b, &bcache.lock);
8010010b: c7 44 24 04 e0 c5 10 movl $0x8010c5e0,0x4(%esp)
80100112: 80
80100113: 89 1c 24 mov %ebx,(%esp)
80100116: e8 45 3c 00 00 call 80103d60 <sleep>
8010011b: eb be jmp 801000db <bread+0x1b>
8010011d: 8d 76 00 lea 0x0(%esi),%esi
}
// Not cached; recycle some non-busy and clean buffer.
// "clean" because B_DIRTY and !B_BUSY means log.c
// hasn't yet committed the changes to the buffer.
for(b = bcache.head.prev; b != &bcache.head; b = b->prev){
80100120: 8b 1d f0 04 11 80 mov 0x801104f0,%ebx
80100126: 81 fb e4 04 11 80 cmp $0x801104e4,%ebx
8010012c: 75 0d jne 8010013b <bread+0x7b>
8010012e: eb 52 jmp 80100182 <bread+0xc2>
80100130: 8b 5b 0c mov 0xc(%ebx),%ebx
80100133: 81 fb e4 04 11 80 cmp $0x801104e4,%ebx
80100139: 74 47 je 80100182 <bread+0xc2>
if((b->flags & B_BUSY) == 0 && (b->flags & B_DIRTY) == 0){
8010013b: f6 03 05 testb $0x5,(%ebx)
8010013e: 75 f0 jne 80100130 <bread+0x70>
b->dev = dev;
80100140: 89 73 04 mov %esi,0x4(%ebx)
b->blockno = blockno;
80100143: 89 7b 08 mov %edi,0x8(%ebx)
b->flags = B_BUSY;
80100146: c7 03 01 00 00 00 movl $0x1,(%ebx)
release(&bcache.lock);
8010014c: c7 04 24 e0 c5 10 80 movl $0x8010c5e0,(%esp)
80100153: e8 98 48 00 00 call 801049f0 <release>
bread(uint dev, uint blockno)
{
struct buf *b;
b = bget(dev, blockno);
if(!(b->flags & B_VALID)) {
80100158: f6 03 02 testb $0x2,(%ebx)
8010015b: 75 08 jne 80100165 <bread+0xa5>
iderw(b);
8010015d: 89 1c 24 mov %ebx,(%esp)
80100160: e8 ab 1f 00 00 call 80102110 <iderw>
}
return b;
}
80100165: 83 c4 1c add $0x1c,%esp
80100168: 89 d8 mov %ebx,%eax
8010016a: 5b pop %ebx
8010016b: 5e pop %esi
8010016c: 5f pop %edi
8010016d: 5d pop %ebp
8010016e: c3 ret
loop:
// Is the block already cached?
for(b = bcache.head.next; b != &bcache.head; b = b->next){
if(b->dev == dev && b->blockno == blockno){
if(!(b->flags & B_BUSY)){
b->flags |= B_BUSY;
8010016f: 83 c8 01 or $0x1,%eax
80100172: 89 03 mov %eax,(%ebx)
release(&bcache.lock);
80100174: c7 04 24 e0 c5 10 80 movl $0x8010c5e0,(%esp)
8010017b: e8 70 48 00 00 call 801049f0 <release>
80100180: eb d6 jmp 80100158 <bread+0x98>
b->flags = B_BUSY;
release(&bcache.lock);
return b;
}
}
panic("bget: no buffers");
80100182: c7 04 24 47 76 10 80 movl $0x80107647,(%esp)
80100189: e8 a2 01 00 00 call 80100330 <panic>
8010018e: 66 90 xchg %ax,%ax
80100190 <bwrite>:
}
// Write b's contents to disk. Must be B_BUSY.
void
bwrite(struct buf *b)
{
80100190: 55 push %ebp
80100191: 89 e5 mov %esp,%ebp
80100193: 83 ec 18 sub $0x18,%esp
80100196: 8b 45 08 mov 0x8(%ebp),%eax
if((b->flags & B_BUSY) == 0)
80100199: 8b 10 mov (%eax),%edx
8010019b: f6 c2 01 test $0x1,%dl
8010019e: 74 0e je 801001ae <bwrite+0x1e>
panic("bwrite");
b->flags |= B_DIRTY;
801001a0: 83 ca 04 or $0x4,%edx
801001a3: 89 10 mov %edx,(%eax)
iderw(b);
801001a5: 89 45 08 mov %eax,0x8(%ebp)
}
801001a8: c9 leave
bwrite(struct buf *b)
{
if((b->flags & B_BUSY) == 0)
panic("bwrite");
b->flags |= B_DIRTY;
iderw(b);
801001a9: e9 62 1f 00 00 jmp 80102110 <iderw>
// Write b's contents to disk. Must be B_BUSY.
void
bwrite(struct buf *b)
{
if((b->flags & B_BUSY) == 0)
panic("bwrite");
801001ae: c7 04 24 58 76 10 80 movl $0x80107658,(%esp)
801001b5: e8 76 01 00 00 call 80100330 <panic>
801001ba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801001c0 <brelse>:
// Release a B_BUSY buffer.
// Move to the head of the MRU list.
void
brelse(struct buf *b)
{
801001c0: 55 push %ebp
801001c1: 89 e5 mov %esp,%ebp
801001c3: 53 push %ebx
801001c4: 83 ec 14 sub $0x14,%esp
801001c7: 8b 5d 08 mov 0x8(%ebp),%ebx
if((b->flags & B_BUSY) == 0)
801001ca: f6 03 01 testb $0x1,(%ebx)
801001cd: 74 57 je 80100226 <brelse+0x66>
panic("brelse");
acquire(&bcache.lock);
801001cf: c7 04 24 e0 c5 10 80 movl $0x8010c5e0,(%esp)
801001d6: e8 e5 46 00 00 call 801048c0 <acquire>
b->next->prev = b->prev;
801001db: 8b 43 10 mov 0x10(%ebx),%eax
801001de: 8b 53 0c mov 0xc(%ebx),%edx
801001e1: 89 50 0c mov %edx,0xc(%eax)
b->prev->next = b->next;
801001e4: 8b 43 0c mov 0xc(%ebx),%eax
801001e7: 8b 53 10 mov 0x10(%ebx),%edx
801001ea: 89 50 10 mov %edx,0x10(%eax)
b->next = bcache.head.next;
801001ed: a1 f4 04 11 80 mov 0x801104f4,%eax
b->prev = &bcache.head;
801001f2: c7 43 0c e4 04 11 80 movl $0x801104e4,0xc(%ebx)
acquire(&bcache.lock);
b->next->prev = b->prev;
b->prev->next = b->next;
b->next = bcache.head.next;
801001f9: 89 43 10 mov %eax,0x10(%ebx)
b->prev = &bcache.head;
bcache.head.next->prev = b;
801001fc: a1 f4 04 11 80 mov 0x801104f4,%eax
80100201: 89 58 0c mov %ebx,0xc(%eax)
bcache.head.next = b;
80100204: 89 1d f4 04 11 80 mov %ebx,0x801104f4
b->flags &= ~B_BUSY;
8010020a: 83 23 fe andl $0xfffffffe,(%ebx)
wakeup(b);
8010020d: 89 1c 24 mov %ebx,(%esp)
80100210: e8 7b 3d 00 00 call 80103f90 <wakeup>
release(&bcache.lock);
80100215: c7 45 08 e0 c5 10 80 movl $0x8010c5e0,0x8(%ebp)
}
8010021c: 83 c4 14 add $0x14,%esp
8010021f: 5b pop %ebx
80100220: 5d pop %ebp
bcache.head.next = b;
b->flags &= ~B_BUSY;
wakeup(b);
release(&bcache.lock);
80100221: e9 ca 47 00 00 jmp 801049f0 <release>
// Move to the head of the MRU list.
void
brelse(struct buf *b)
{
if((b->flags & B_BUSY) == 0)
panic("brelse");
80100226: c7 04 24 5f 76 10 80 movl $0x8010765f,(%esp)
8010022d: e8 fe 00 00 00 call 80100330 <panic>
80100232: 66 90 xchg %ax,%ax
80100234: 66 90 xchg %ax,%ax
80100236: 66 90 xchg %ax,%ax
80100238: 66 90 xchg %ax,%ax
8010023a: 66 90 xchg %ax,%ax
8010023c: 66 90 xchg %ax,%ax
8010023e: 66 90 xchg %ax,%ax
80100240 <consoleread>:
}
}
int
consoleread(struct inode *ip, char *dst, int n)
{
80100240: 55 push %ebp
80100241: 89 e5 mov %esp,%ebp
80100243: 57 push %edi
80100244: 56 push %esi
80100245: 53 push %ebx
80100246: 83 ec 1c sub $0x1c,%esp
80100249: 8b 7d 08 mov 0x8(%ebp),%edi
8010024c: 8b 75 0c mov 0xc(%ebp),%esi
uint target;
int c;
iunlock(ip);
8010024f: 89 3c 24 mov %edi,(%esp)
80100252: e8 f9 14 00 00 call 80101750 <iunlock>
target = n;
acquire(&cons.lock);
80100257: c7 04 24 20 b5 10 80 movl $0x8010b520,(%esp)
8010025e: e8 5d 46 00 00 call 801048c0 <acquire>
while(n > 0){
80100263: 8b 55 10 mov 0x10(%ebp),%edx
80100266: 85 d2 test %edx,%edx
80100268: 0f 8e bc 00 00 00 jle 8010032a <consoleread+0xea>
8010026e: 8b 5d 10 mov 0x10(%ebp),%ebx
80100271: eb 26 jmp 80100299 <consoleread+0x59>
80100273: 90 nop
80100274: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
while(input.r == input.w){
if(proc->killed){
80100278: 65 a1 04 00 00 00 mov %gs:0x4,%eax
8010027e: 8b 40 18 mov 0x18(%eax),%eax
80100281: 85 c0 test %eax,%eax
80100283: 75 73 jne 801002f8 <consoleread+0xb8>
release(&cons.lock);
ilock(ip);
return -1;
}
sleep(&input.r, &cons.lock);
80100285: c7 44 24 04 20 b5 10 movl $0x8010b520,0x4(%esp)
8010028c: 80
8010028d: c7 04 24 80 07 11 80 movl $0x80110780,(%esp)
80100294: e8 c7 3a 00 00 call 80103d60 <sleep>
iunlock(ip);
target = n;
acquire(&cons.lock);
while(n > 0){
while(input.r == input.w){
80100299: a1 80 07 11 80 mov 0x80110780,%eax
8010029e: 3b 05 84 07 11 80 cmp 0x80110784,%eax
801002a4: 74 d2 je 80100278 <consoleread+0x38>
ilock(ip);
return -1;
}
sleep(&input.r, &cons.lock);
}
c = input.buf[input.r++ % INPUT_BUF];
801002a6: 8d 50 01 lea 0x1(%eax),%edx
801002a9: 89 15 80 07 11 80 mov %edx,0x80110780
801002af: 89 c2 mov %eax,%edx
801002b1: 83 e2 7f and $0x7f,%edx
801002b4: 0f b6 8a 00 07 11 80 movzbl -0x7feef900(%edx),%ecx
801002bb: 0f be d1 movsbl %cl,%edx
if(c == C('D')){ // EOF
801002be: 83 fa 04 cmp $0x4,%edx
801002c1: 74 56 je 80100319 <consoleread+0xd9>
// caller gets a 0-byte result.
input.r--;
}
break;
}
*dst++ = c;
801002c3: 83 c6 01 add $0x1,%esi
--n;
801002c6: 83 eb 01 sub $0x1,%ebx
if(c == '\n')
801002c9: 83 fa 0a cmp $0xa,%edx
// caller gets a 0-byte result.
input.r--;
}
break;
}
*dst++ = c;
801002cc: 88 4e ff mov %cl,-0x1(%esi)
--n;
if(c == '\n')
801002cf: 74 52 je 80100323 <consoleread+0xe3>
int c;
iunlock(ip);
target = n;
acquire(&cons.lock);
while(n > 0){
801002d1: 85 db test %ebx,%ebx
801002d3: 75 c4 jne 80100299 <consoleread+0x59>
801002d5: 8b 45 10 mov 0x10(%ebp),%eax
*dst++ = c;
--n;
if(c == '\n')
break;
}
release(&cons.lock);
801002d8: c7 04 24 20 b5 10 80 movl $0x8010b520,(%esp)
801002df: 89 45 e4 mov %eax,-0x1c(%ebp)
801002e2: e8 09 47 00 00 call 801049f0 <release>
ilock(ip);
801002e7: 89 3c 24 mov %edi,(%esp)
801002ea: e8 51 13 00 00 call 80101640 <ilock>
801002ef: 8b 45 e4 mov -0x1c(%ebp),%eax
return target - n;
801002f2: eb 1d jmp 80100311 <consoleread+0xd1>
801002f4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
target = n;
acquire(&cons.lock);
while(n > 0){
while(input.r == input.w){
if(proc->killed){
release(&cons.lock);
801002f8: c7 04 24 20 b5 10 80 movl $0x8010b520,(%esp)
801002ff: e8 ec 46 00 00 call 801049f0 <release>
ilock(ip);
80100304: 89 3c 24 mov %edi,(%esp)
80100307: e8 34 13 00 00 call 80101640 <ilock>
return -1;
8010030c: b8 ff ff ff ff mov $0xffffffff,%eax
}
release(&cons.lock);
ilock(ip);
return target - n;
}
80100311: 83 c4 1c add $0x1c,%esp
80100314: 5b pop %ebx
80100315: 5e pop %esi
80100316: 5f pop %edi
80100317: 5d pop %ebp
80100318: c3 ret
}
sleep(&input.r, &cons.lock);
}
c = input.buf[input.r++ % INPUT_BUF];
if(c == C('D')){ // EOF
if(n < target){
80100319: 39 5d 10 cmp %ebx,0x10(%ebp)
8010031c: 76 05 jbe 80100323 <consoleread+0xe3>
// Save ^D for next time, to make sure
// caller gets a 0-byte result.
input.r--;
8010031e: a3 80 07 11 80 mov %eax,0x80110780
80100323: 8b 45 10 mov 0x10(%ebp),%eax
80100326: 29 d8 sub %ebx,%eax
80100328: eb ae jmp 801002d8 <consoleread+0x98>
int c;
iunlock(ip);
target = n;
acquire(&cons.lock);
while(n > 0){
8010032a: 31 c0 xor %eax,%eax
8010032c: eb aa jmp 801002d8 <consoleread+0x98>
8010032e: 66 90 xchg %ax,%ax
80100330 <panic>:
release(&cons.lock);
}
void
panic(char *s)
{
80100330: 55 push %ebp
80100331: 89 e5 mov %esp,%ebp
80100333: 56 push %esi
80100334: 53 push %ebx
80100335: 83 ec 40 sub $0x40,%esp
}
static inline void
cli(void)
{
asm volatile("cli");
80100338: fa cli
int i;
uint pcs[10];
cli();
cons.locking = 0;
cprintf("cpu with apicid %d: panic: ", cpu->apicid);
80100339: 65 a1 00 00 00 00 mov %gs:0x0,%eax
cprintf(s);
cprintf("\n");
getcallerpcs(&s, pcs);
8010033f: 8d 5d d0 lea -0x30(%ebp),%ebx
{
int i;
uint pcs[10];
cli();
cons.locking = 0;
80100342: c7 05 54 b5 10 80 00 movl $0x0,0x8010b554
80100349: 00 00 00
8010034c: 8d 75 f8 lea -0x8(%ebp),%esi
cprintf("cpu with apicid %d: panic: ", cpu->apicid);
8010034f: 0f b6 00 movzbl (%eax),%eax
80100352: c7 04 24 66 76 10 80 movl $0x80107666,(%esp)
80100359: 89 44 24 04 mov %eax,0x4(%esp)
8010035d: e8 be 02 00 00 call 80100620 <cprintf>
cprintf(s);
80100362: 8b 45 08 mov 0x8(%ebp),%eax
80100365: 89 04 24 mov %eax,(%esp)
80100368: e8 b3 02 00 00 call 80100620 <cprintf>
cprintf("\n");
8010036d: c7 04 24 86 7b 10 80 movl $0x80107b86,(%esp)
80100374: e8 a7 02 00 00 call 80100620 <cprintf>
getcallerpcs(&s, pcs);
80100379: 8d 45 08 lea 0x8(%ebp),%eax
8010037c: 89 5c 24 04 mov %ebx,0x4(%esp)
80100380: 89 04 24 mov %eax,(%esp)
80100383: e8 d8 44 00 00 call 80104860 <getcallerpcs>
for(i=0; i<10; i++)
cprintf(" %p", pcs[i]);
80100388: 8b 03 mov (%ebx),%eax
8010038a: 83 c3 04 add $0x4,%ebx
8010038d: c7 04 24 82 76 10 80 movl $0x80107682,(%esp)
80100394: 89 44 24 04 mov %eax,0x4(%esp)
80100398: e8 83 02 00 00 call 80100620 <cprintf>
cons.locking = 0;
cprintf("cpu with apicid %d: panic: ", cpu->apicid);
cprintf(s);
cprintf("\n");
getcallerpcs(&s, pcs);
for(i=0; i<10; i++)
8010039d: 39 f3 cmp %esi,%ebx
8010039f: 75 e7 jne 80100388 <panic+0x58>
cprintf(" %p", pcs[i]);
panicked = 1; // freeze other CPU
801003a1: c7 05 58 b5 10 80 01 movl $0x1,0x8010b558
801003a8: 00 00 00
801003ab: eb fe jmp 801003ab <panic+0x7b>
801003ad: 8d 76 00 lea 0x0(%esi),%esi
801003b0 <consputc>:
}
void
consputc(int c)
{
if(panicked){
801003b0: 8b 15 58 b5 10 80 mov 0x8010b558,%edx
801003b6: 85 d2 test %edx,%edx
801003b8: 74 06 je 801003c0 <consputc+0x10>
801003ba: fa cli
801003bb: eb fe jmp 801003bb <consputc+0xb>
801003bd: 8d 76 00 lea 0x0(%esi),%esi
crt[pos] = ' ' | 0x0700;
}
void
consputc(int c)
{
801003c0: 55 push %ebp
801003c1: 89 e5 mov %esp,%ebp
801003c3: 57 push %edi
801003c4: 56 push %esi
801003c5: 53 push %ebx
801003c6: 89 c3 mov %eax,%ebx
801003c8: 83 ec 1c sub $0x1c,%esp
cli();
for(;;)
;
}
if(c == BACKSPACE){
801003cb: 3d 00 01 00 00 cmp $0x100,%eax
801003d0: 0f 84 ac 00 00 00 je 80100482 <consputc+0xd2>
uartputc('\b'); uartputc(' '); uartputc('\b');
} else
uartputc(c);
801003d6: 89 04 24 mov %eax,(%esp)
801003d9: e8 c2 5d 00 00 call 801061a0 <uartputc>
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
801003de: bf d4 03 00 00 mov $0x3d4,%edi
801003e3: b8 0e 00 00 00 mov $0xe,%eax
801003e8: 89 fa mov %edi,%edx
801003ea: ee out %al,(%dx)
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801003eb: be d5 03 00 00 mov $0x3d5,%esi
801003f0: 89 f2 mov %esi,%edx
801003f2: ec in (%dx),%al
{
int pos;
// Cursor position: col + 80*row.
outb(CRTPORT, 14);
pos = inb(CRTPORT+1) << 8;
801003f3: 0f b6 c8 movzbl %al,%ecx
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
801003f6: 89 fa mov %edi,%edx
801003f8: c1 e1 08 shl $0x8,%ecx
801003fb: b8 0f 00 00 00 mov $0xf,%eax
80100400: ee out %al,(%dx)
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80100401: 89 f2 mov %esi,%edx
80100403: ec in (%dx),%al
outb(CRTPORT, 15);
pos |= inb(CRTPORT+1);
80100404: 0f b6 c0 movzbl %al,%eax
80100407: 09 c1 or %eax,%ecx
if(c == '\n')
80100409: 83 fb 0a cmp $0xa,%ebx
8010040c: 0f 84 0d 01 00 00 je 8010051f <consputc+0x16f>
pos += 80 - pos%80;
else if(c == BACKSPACE){
80100412: 81 fb 00 01 00 00 cmp $0x100,%ebx
80100418: 0f 84 e8 00 00 00 je 80100506 <consputc+0x156>
if(pos > 0) --pos;
} else
crt[pos++] = (c&0xff) | 0x0700; // black on white
8010041e: 0f b6 db movzbl %bl,%ebx
80100421: 80 cf 07 or $0x7,%bh
80100424: 8d 79 01 lea 0x1(%ecx),%edi
80100427: 66 89 9c 09 00 80 0b mov %bx,-0x7ff48000(%ecx,%ecx,1)
8010042e: 80
if(pos < 0 || pos > 25*80)
8010042f: 81 ff d0 07 00 00 cmp $0x7d0,%edi
80100435: 0f 87 bf 00 00 00 ja 801004fa <consputc+0x14a>
panic("pos under/overflow");
if((pos/80) >= 24){ // Scroll up.
8010043b: 81 ff 7f 07 00 00 cmp $0x77f,%edi
80100441: 7f 68 jg 801004ab <consputc+0xfb>
80100443: 89 f8 mov %edi,%eax
80100445: 89 fb mov %edi,%ebx
80100447: c1 e8 08 shr $0x8,%eax
8010044a: 89 c6 mov %eax,%esi
8010044c: 8d 8c 3f 00 80 0b 80 lea -0x7ff48000(%edi,%edi,1),%ecx
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80100453: bf d4 03 00 00 mov $0x3d4,%edi
80100458: b8 0e 00 00 00 mov $0xe,%eax
8010045d: 89 fa mov %edi,%edx
8010045f: ee out %al,(%dx)
80100460: 89 f0 mov %esi,%eax
80100462: b2 d5 mov $0xd5,%dl
80100464: ee out %al,(%dx)
80100465: b8 0f 00 00 00 mov $0xf,%eax
8010046a: 89 fa mov %edi,%edx
8010046c: ee out %al,(%dx)
8010046d: 89 d8 mov %ebx,%eax
8010046f: b2 d5 mov $0xd5,%dl
80100471: ee out %al,(%dx)
outb(CRTPORT, 14);
outb(CRTPORT+1, pos>>8);
outb(CRTPORT, 15);
outb(CRTPORT+1, pos);
crt[pos] = ' ' | 0x0700;
80100472: b8 20 07 00 00 mov $0x720,%eax
80100477: 66 89 01 mov %ax,(%ecx)
if(c == BACKSPACE){
uartputc('\b'); uartputc(' '); uartputc('\b');
} else
uartputc(c);
cgaputc(c);
}
8010047a: 83 c4 1c add $0x1c,%esp
8010047d: 5b pop %ebx
8010047e: 5e pop %esi
8010047f: 5f pop %edi
80100480: 5d pop %ebp
80100481: c3 ret
for(;;)
;
}
if(c == BACKSPACE){
uartputc('\b'); uartputc(' '); uartputc('\b');
80100482: c7 04 24 08 00 00 00 movl $0x8,(%esp)
80100489: e8 12 5d 00 00 call 801061a0 <uartputc>
8010048e: c7 04 24 20 00 00 00 movl $0x20,(%esp)
80100495: e8 06 5d 00 00 call 801061a0 <uartputc>
8010049a: c7 04 24 08 00 00 00 movl $0x8,(%esp)
801004a1: e8 fa 5c 00 00 call 801061a0 <uartputc>
801004a6: e9 33 ff ff ff jmp 801003de <consputc+0x2e>
if(pos < 0 || pos > 25*80)
panic("pos under/overflow");
if((pos/80) >= 24){ // Scroll up.
memmove(crt, crt+80, sizeof(crt[0])*23*80);
801004ab: c7 44 24 08 60 0e 00 movl $0xe60,0x8(%esp)
801004b2: 00
pos -= 80;
801004b3: 8d 5f b0 lea -0x50(%edi),%ebx
if(pos < 0 || pos > 25*80)
panic("pos under/overflow");
if((pos/80) >= 24){ // Scroll up.
memmove(crt, crt+80, sizeof(crt[0])*23*80);
801004b6: c7 44 24 04 a0 80 0b movl $0x800b80a0,0x4(%esp)
801004bd: 80
pos -= 80;
memset(crt+pos, 0, sizeof(crt[0])*(24*80 - pos));
801004be: 8d b4 1b 00 80 0b 80 lea -0x7ff48000(%ebx,%ebx,1),%esi
if(pos < 0 || pos > 25*80)
panic("pos under/overflow");
if((pos/80) >= 24){ // Scroll up.
memmove(crt, crt+80, sizeof(crt[0])*23*80);
801004c5: c7 04 24 00 80 0b 80 movl $0x800b8000,(%esp)
801004cc: e8 0f 46 00 00 call 80104ae0 <memmove>
pos -= 80;
memset(crt+pos, 0, sizeof(crt[0])*(24*80 - pos));
801004d1: b8 d0 07 00 00 mov $0x7d0,%eax
801004d6: 29 f8 sub %edi,%eax
801004d8: 01 c0 add %eax,%eax
801004da: 89 34 24 mov %esi,(%esp)
801004dd: 89 44 24 08 mov %eax,0x8(%esp)
801004e1: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
801004e8: 00
801004e9: e8 52 45 00 00 call 80104a40 <memset>
801004ee: 89 f1 mov %esi,%ecx
801004f0: be 07 00 00 00 mov $0x7,%esi
801004f5: e9 59 ff ff ff jmp 80100453 <consputc+0xa3>
if(pos > 0) --pos;
} else
crt[pos++] = (c&0xff) | 0x0700; // black on white
if(pos < 0 || pos > 25*80)
panic("pos under/overflow");
801004fa: c7 04 24 86 76 10 80 movl $0x80107686,(%esp)
80100501: e8 2a fe ff ff call 80100330 <panic>
pos |= inb(CRTPORT+1);
if(c == '\n')
pos += 80 - pos%80;
else if(c == BACKSPACE){
if(pos > 0) --pos;
80100506: 85 c9 test %ecx,%ecx
80100508: 8d 79 ff lea -0x1(%ecx),%edi
8010050b: 0f 85 1e ff ff ff jne 8010042f <consputc+0x7f>
80100511: b9 00 80 0b 80 mov $0x800b8000,%ecx
80100516: 31 db xor %ebx,%ebx
80100518: 31 f6 xor %esi,%esi
8010051a: e9 34 ff ff ff jmp 80100453 <consputc+0xa3>
pos = inb(CRTPORT+1) << 8;
outb(CRTPORT, 15);
pos |= inb(CRTPORT+1);
if(c == '\n')
pos += 80 - pos%80;
8010051f: 89 c8 mov %ecx,%eax
80100521: ba 67 66 66 66 mov $0x66666667,%edx
80100526: f7 ea imul %edx
80100528: c1 ea 05 shr $0x5,%edx
8010052b: 8d 04 92 lea (%edx,%edx,4),%eax
8010052e: c1 e0 04 shl $0x4,%eax
80100531: 8d 78 50 lea 0x50(%eax),%edi
80100534: e9 f6 fe ff ff jmp 8010042f <consputc+0x7f>
80100539: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80100540 <printint>:
int locking;
} cons;
static void
printint(int xx, int base, int sign)
{
80100540: 55 push %ebp
80100541: 89 e5 mov %esp,%ebp
80100543: 57 push %edi
80100544: 56 push %esi
80100545: 89 d6 mov %edx,%esi
80100547: 53 push %ebx
80100548: 83 ec 1c sub $0x1c,%esp
static char digits[] = "0123456789abcdef";
char buf[16];
int i;
uint x;
if(sign && (sign = xx < 0))
8010054b: 85 c9 test %ecx,%ecx
8010054d: 74 61 je 801005b0 <printint+0x70>
8010054f: 85 c0 test %eax,%eax
80100551: 79 5d jns 801005b0 <printint+0x70>
x = -xx;
80100553: f7 d8 neg %eax
80100555: bf 01 00 00 00 mov $0x1,%edi
else
x = xx;
i = 0;
8010055a: 31 c9 xor %ecx,%ecx
8010055c: eb 04 jmp 80100562 <printint+0x22>
8010055e: 66 90 xchg %ax,%ax
do{
buf[i++] = digits[x % base];
80100560: 89 d9 mov %ebx,%ecx
80100562: 31 d2 xor %edx,%edx
80100564: f7 f6 div %esi
80100566: 8d 59 01 lea 0x1(%ecx),%ebx
80100569: 0f b6 92 b1 76 10 80 movzbl -0x7fef894f(%edx),%edx
}while((x /= base) != 0);
80100570: 85 c0 test %eax,%eax
else
x = xx;
i = 0;
do{
buf[i++] = digits[x % base];
80100572: 88 54 1d d7 mov %dl,-0x29(%ebp,%ebx,1)
}while((x /= base) != 0);
80100576: 75 e8 jne 80100560 <printint+0x20>
if(sign)
80100578: 85 ff test %edi,%edi
else
x = xx;
i = 0;
do{
buf[i++] = digits[x % base];
8010057a: 89 d8 mov %ebx,%eax
}while((x /= base) != 0);
if(sign)
8010057c: 74 08 je 80100586 <printint+0x46>
buf[i++] = '-';
8010057e: 8d 59 02 lea 0x2(%ecx),%ebx
80100581: c6 44 05 d8 2d movb $0x2d,-0x28(%ebp,%eax,1)
while(--i >= 0)
80100586: 83 eb 01 sub $0x1,%ebx
80100589: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
consputc(buf[i]);
80100590: 0f be 44 1d d8 movsbl -0x28(%ebp,%ebx,1),%eax
}while((x /= base) != 0);
if(sign)
buf[i++] = '-';
while(--i >= 0)
80100595: 83 eb 01 sub $0x1,%ebx
consputc(buf[i]);
80100598: e8 13 fe ff ff call 801003b0 <consputc>
}while((x /= base) != 0);
if(sign)
buf[i++] = '-';
while(--i >= 0)
8010059d: 83 fb ff cmp $0xffffffff,%ebx
801005a0: 75 ee jne 80100590 <printint+0x50>
consputc(buf[i]);
}
801005a2: 83 c4 1c add $0x1c,%esp
801005a5: 5b pop %ebx
801005a6: 5e pop %esi
801005a7: 5f pop %edi
801005a8: 5d pop %ebp
801005a9: c3 ret
801005aa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
uint x;
if(sign && (sign = xx < 0))
x = -xx;
else
x = xx;
801005b0: 31 ff xor %edi,%edi
801005b2: eb a6 jmp 8010055a <printint+0x1a>
801005b4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801005ba: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
801005c0 <consolewrite>:
return target - n;
}
int
consolewrite(struct inode *ip, char *buf, int n)
{
801005c0: 55 push %ebp
801005c1: 89 e5 mov %esp,%ebp
801005c3: 57 push %edi
801005c4: 56 push %esi
801005c5: 53 push %ebx
801005c6: 83 ec 1c sub $0x1c,%esp
int i;
iunlock(ip);
801005c9: 8b 45 08 mov 0x8(%ebp),%eax
return target - n;
}
int
consolewrite(struct inode *ip, char *buf, int n)
{
801005cc: 8b 75 10 mov 0x10(%ebp),%esi
int i;
iunlock(ip);
801005cf: 89 04 24 mov %eax,(%esp)
801005d2: e8 79 11 00 00 call 80101750 <iunlock>
acquire(&cons.lock);
801005d7: c7 04 24 20 b5 10 80 movl $0x8010b520,(%esp)
801005de: e8 dd 42 00 00 call 801048c0 <acquire>
801005e3: 8b 7d 0c mov 0xc(%ebp),%edi
for(i = 0; i < n; i++)
801005e6: 85 f6 test %esi,%esi
801005e8: 8d 1c 37 lea (%edi,%esi,1),%ebx
801005eb: 7e 12 jle 801005ff <consolewrite+0x3f>
801005ed: 8d 76 00 lea 0x0(%esi),%esi
consputc(buf[i] & 0xff);
801005f0: 0f b6 07 movzbl (%edi),%eax
801005f3: 83 c7 01 add $0x1,%edi
801005f6: e8 b5 fd ff ff call 801003b0 <consputc>
{
int i;
iunlock(ip);
acquire(&cons.lock);
for(i = 0; i < n; i++)
801005fb: 39 df cmp %ebx,%edi
801005fd: 75 f1 jne 801005f0 <consolewrite+0x30>
consputc(buf[i] & 0xff);
release(&cons.lock);
801005ff: c7 04 24 20 b5 10 80 movl $0x8010b520,(%esp)
80100606: e8 e5 43 00 00 call 801049f0 <release>
ilock(ip);
8010060b: 8b 45 08 mov 0x8(%ebp),%eax
8010060e: 89 04 24 mov %eax,(%esp)
80100611: e8 2a 10 00 00 call 80101640 <ilock>
return n;
}
80100616: 83 c4 1c add $0x1c,%esp
80100619: 89 f0 mov %esi,%eax
8010061b: 5b pop %ebx
8010061c: 5e pop %esi
8010061d: 5f pop %edi
8010061e: 5d pop %ebp
8010061f: c3 ret
80100620 <cprintf>:
//PAGEBREAK: 50
// Print to the console. only understands %d, %x, %p, %s.
void
cprintf(char *fmt, ...)
{
80100620: 55 push %ebp
80100621: 89 e5 mov %esp,%ebp
80100623: 57 push %edi
80100624: 56 push %esi
80100625: 53 push %ebx
80100626: 83 ec 1c sub $0x1c,%esp
int i, c, locking;
uint *argp;
char *s;
locking = cons.locking;
80100629: a1 54 b5 10 80 mov 0x8010b554,%eax
if(locking)
8010062e: 85 c0 test %eax,%eax
{
int i, c, locking;
uint *argp;
char *s;
locking = cons.locking;
80100630: 89 45 e0 mov %eax,-0x20(%ebp)
if(locking)
80100633: 0f 85 27 01 00 00 jne 80100760 <cprintf+0x140>
acquire(&cons.lock);
if (fmt == 0)
80100639: 8b 45 08 mov 0x8(%ebp),%eax
8010063c: 85 c0 test %eax,%eax
8010063e: 89 c1 mov %eax,%ecx
80100640: 0f 84 2b 01 00 00 je 80100771 <cprintf+0x151>
panic("null fmt");
argp = (uint*)(void*)(&fmt + 1);
for(i = 0; (c = fmt[i] & 0xff) != 0; i++){
80100646: 0f b6 00 movzbl (%eax),%eax
80100649: 31 db xor %ebx,%ebx
8010064b: 89 cf mov %ecx,%edi
8010064d: 8d 75 0c lea 0xc(%ebp),%esi
80100650: 85 c0 test %eax,%eax
80100652: 75 4c jne 801006a0 <cprintf+0x80>
80100654: eb 5f jmp 801006b5 <cprintf+0x95>
80100656: 66 90 xchg %ax,%ax
if(c != '%'){
consputc(c);
continue;
}
c = fmt[++i] & 0xff;
80100658: 83 c3 01 add $0x1,%ebx
8010065b: 0f b6 14 1f movzbl (%edi,%ebx,1),%edx
if(c == 0)
8010065f: 85 d2 test %edx,%edx
80100661: 74 52 je 801006b5 <cprintf+0x95>
break;
switch(c){
80100663: 83 fa 70 cmp $0x70,%edx
80100666: 74 72 je 801006da <cprintf+0xba>
80100668: 7f 66 jg 801006d0 <cprintf+0xb0>
8010066a: 83 fa 25 cmp $0x25,%edx
8010066d: 8d 76 00 lea 0x0(%esi),%esi
80100670: 0f 84 a2 00 00 00 je 80100718 <cprintf+0xf8>
80100676: 83 fa 64 cmp $0x64,%edx
80100679: 75 7d jne 801006f8 <cprintf+0xd8>
case 'd':
printint(*argp++, 10, 1);
8010067b: 8d 46 04 lea 0x4(%esi),%eax
8010067e: b9 01 00 00 00 mov $0x1,%ecx
80100683: 89 45 e4 mov %eax,-0x1c(%ebp)
80100686: 8b 06 mov (%esi),%eax
80100688: ba 0a 00 00 00 mov $0xa,%edx
8010068d: e8 ae fe ff ff call 80100540 <printint>
80100692: 8b 75 e4 mov -0x1c(%ebp),%esi
if (fmt == 0)
panic("null fmt");
argp = (uint*)(void*)(&fmt + 1);
for(i = 0; (c = fmt[i] & 0xff) != 0; i++){
80100695: 83 c3 01 add $0x1,%ebx
80100698: 0f b6 04 1f movzbl (%edi,%ebx,1),%eax
8010069c: 85 c0 test %eax,%eax
8010069e: 74 15 je 801006b5 <cprintf+0x95>
if(c != '%'){
801006a0: 83 f8 25 cmp $0x25,%eax
801006a3: 74 b3 je 80100658 <cprintf+0x38>
consputc('%');
break;
default:
// Print unknown % sequence to draw attention.
consputc('%');
consputc(c);
801006a5: e8 06 fd ff ff call 801003b0 <consputc>
if (fmt == 0)
panic("null fmt");
argp = (uint*)(void*)(&fmt + 1);
for(i = 0; (c = fmt[i] & 0xff) != 0; i++){
801006aa: 83 c3 01 add $0x1,%ebx
801006ad: 0f b6 04 1f movzbl (%edi,%ebx,1),%eax
801006b1: 85 c0 test %eax,%eax
801006b3: 75 eb jne 801006a0 <cprintf+0x80>
consputc(c);
break;
}
}
if(locking)
801006b5: 8b 45 e0 mov -0x20(%ebp),%eax
801006b8: 85 c0 test %eax,%eax
801006ba: 74 0c je 801006c8 <cprintf+0xa8>
release(&cons.lock);
801006bc: c7 04 24 20 b5 10 80 movl $0x8010b520,(%esp)
801006c3: e8 28 43 00 00 call 801049f0 <release>
}
801006c8: 83 c4 1c add $0x1c,%esp
801006cb: 5b pop %ebx
801006cc: 5e pop %esi
801006cd: 5f pop %edi
801006ce: 5d pop %ebp
801006cf: c3 ret
continue;
}
c = fmt[++i] & 0xff;
if(c == 0)
break;
switch(c){
801006d0: 83 fa 73 cmp $0x73,%edx
801006d3: 74 53 je 80100728 <cprintf+0x108>
801006d5: 83 fa 78 cmp $0x78,%edx
801006d8: 75 1e jne 801006f8 <cprintf+0xd8>
case 'd':
printint(*argp++, 10, 1);
break;
case 'x':
case 'p':
printint(*argp++, 16, 0);
801006da: 8d 46 04 lea 0x4(%esi),%eax
801006dd: 31 c9 xor %ecx,%ecx
801006df: 89 45 e4 mov %eax,-0x1c(%ebp)
801006e2: 8b 06 mov (%esi),%eax
801006e4: ba 10 00 00 00 mov $0x10,%edx
801006e9: e8 52 fe ff ff call 80100540 <printint>
801006ee: 8b 75 e4 mov -0x1c(%ebp),%esi
break;
801006f1: eb a2 jmp 80100695 <cprintf+0x75>
801006f3: 90 nop
801006f4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
case '%':
consputc('%');
break;
default:
// Print unknown % sequence to draw attention.
consputc('%');
801006f8: b8 25 00 00 00 mov $0x25,%eax
801006fd: 89 55 e4 mov %edx,-0x1c(%ebp)
80100700: e8 ab fc ff ff call 801003b0 <consputc>
consputc(c);
80100705: 8b 55 e4 mov -0x1c(%ebp),%edx
80100708: 89 d0 mov %edx,%eax
8010070a: e8 a1 fc ff ff call 801003b0 <consputc>
8010070f: eb 99 jmp 801006aa <cprintf+0x8a>
80100711: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
s = "(null)";
for(; *s; s++)
consputc(*s);
break;
case '%':
consputc('%');
80100718: b8 25 00 00 00 mov $0x25,%eax
8010071d: e8 8e fc ff ff call 801003b0 <consputc>
break;
80100722: e9 6e ff ff ff jmp 80100695 <cprintf+0x75>
80100727: 90 nop
case 'x':
case 'p':
printint(*argp++, 16, 0);
break;
case 's':
if((s = (char*)*argp++) == 0)
80100728: 8d 46 04 lea 0x4(%esi),%eax
8010072b: 8b 36 mov (%esi),%esi
8010072d: 89 45 e4 mov %eax,-0x1c(%ebp)
s = "(null)";
80100730: b8 99 76 10 80 mov $0x80107699,%eax
80100735: 85 f6 test %esi,%esi
80100737: 0f 44 f0 cmove %eax,%esi
for(; *s; s++)
8010073a: 0f be 06 movsbl (%esi),%eax
8010073d: 84 c0 test %al,%al
8010073f: 74 16 je 80100757 <cprintf+0x137>
80100741: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80100748: 83 c6 01 add $0x1,%esi
consputc(*s);
8010074b: e8 60 fc ff ff call 801003b0 <consputc>
printint(*argp++, 16, 0);
break;
case 's':
if((s = (char*)*argp++) == 0)
s = "(null)";
for(; *s; s++)
80100750: 0f be 06 movsbl (%esi),%eax
80100753: 84 c0 test %al,%al
80100755: 75 f1 jne 80100748 <cprintf+0x128>
case 'x':
case 'p':
printint(*argp++, 16, 0);
break;
case 's':
if((s = (char*)*argp++) == 0)
80100757: 8b 75 e4 mov -0x1c(%ebp),%esi
8010075a: e9 36 ff ff ff jmp 80100695 <cprintf+0x75>
8010075f: 90 nop
uint *argp;
char *s;
locking = cons.locking;
if(locking)
acquire(&cons.lock);
80100760: c7 04 24 20 b5 10 80 movl $0x8010b520,(%esp)
80100767: e8 54 41 00 00 call 801048c0 <acquire>
8010076c: e9 c8 fe ff ff jmp 80100639 <cprintf+0x19>
if (fmt == 0)
panic("null fmt");
80100771: c7 04 24 a0 76 10 80 movl $0x801076a0,(%esp)
80100778: e8 b3 fb ff ff call 80100330 <panic>
8010077d: 8d 76 00 lea 0x0(%esi),%esi
80100780 <consoleintr>:
#define C(x) ((x)-'@') // Control-x
void
consoleintr(int (*getc)(void))
{
80100780: 55 push %ebp
80100781: 89 e5 mov %esp,%ebp
80100783: 57 push %edi
80100784: 56 push %esi
int c, doprocdump = 0;
80100785: 31 f6 xor %esi,%esi
#define C(x) ((x)-'@') // Control-x
void
consoleintr(int (*getc)(void))
{
80100787: 53 push %ebx
80100788: 83 ec 1c sub $0x1c,%esp
8010078b: 8b 5d 08 mov 0x8(%ebp),%ebx
int c, doprocdump = 0;
acquire(&cons.lock);
8010078e: c7 04 24 20 b5 10 80 movl $0x8010b520,(%esp)
80100795: e8 26 41 00 00 call 801048c0 <acquire>
8010079a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
while((c = getc()) >= 0){
801007a0: ff d3 call *%ebx
801007a2: 85 c0 test %eax,%eax
801007a4: 89 c7 mov %eax,%edi
801007a6: 78 48 js 801007f0 <consoleintr+0x70>
switch(c){
801007a8: 83 ff 10 cmp $0x10,%edi
801007ab: 0f 84 2f 01 00 00 je 801008e0 <consoleintr+0x160>
801007b1: 7e 5d jle 80100810 <consoleintr+0x90>
801007b3: 83 ff 15 cmp $0x15,%edi
801007b6: 0f 84 d4 00 00 00 je 80100890 <consoleintr+0x110>
801007bc: 83 ff 7f cmp $0x7f,%edi
801007bf: 90 nop
801007c0: 75 53 jne 80100815 <consoleintr+0x95>
input.e--;
consputc(BACKSPACE);
}
break;
case C('H'): case '\x7f': // Backspace
if(input.e != input.w){
801007c2: a1 88 07 11 80 mov 0x80110788,%eax
801007c7: 3b 05 84 07 11 80 cmp 0x80110784,%eax
801007cd: 74 d1 je 801007a0 <consoleintr+0x20>
input.e--;
801007cf: 83 e8 01 sub $0x1,%eax
801007d2: a3 88 07 11 80 mov %eax,0x80110788
consputc(BACKSPACE);
801007d7: b8 00 01 00 00 mov $0x100,%eax
801007dc: e8 cf fb ff ff call 801003b0 <consputc>
consoleintr(int (*getc)(void))
{
int c, doprocdump = 0;
acquire(&cons.lock);
while((c = getc()) >= 0){
801007e1: ff d3 call *%ebx
801007e3: 85 c0 test %eax,%eax
801007e5: 89 c7 mov %eax,%edi
801007e7: 79 bf jns 801007a8 <consoleintr+0x28>
801007e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
}
}
break;
}
}
release(&cons.lock);
801007f0: c7 04 24 20 b5 10 80 movl $0x8010b520,(%esp)
801007f7: e8 f4 41 00 00 call 801049f0 <release>
if(doprocdump) {
801007fc: 85 f6 test %esi,%esi
801007fe: 0f 85 ec 00 00 00 jne 801008f0 <consoleintr+0x170>
procdump(); // now call procdump() wo. cons.lock held
}
}
80100804: 83 c4 1c add $0x1c,%esp
80100807: 5b pop %ebx
80100808: 5e pop %esi
80100809: 5f pop %edi
8010080a: 5d pop %ebp
8010080b: c3 ret
8010080c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
{
int c, doprocdump = 0;
acquire(&cons.lock);
while((c = getc()) >= 0){
switch(c){
80100810: 83 ff 08 cmp $0x8,%edi
80100813: 74 ad je 801007c2 <consoleintr+0x42>
input.e--;
consputc(BACKSPACE);
}
break;
default:
if(c != 0 && input.e-input.r < INPUT_BUF){
80100815: 85 ff test %edi,%edi
80100817: 74 87 je 801007a0 <consoleintr+0x20>
80100819: a1 88 07 11 80 mov 0x80110788,%eax
8010081e: 89 c2 mov %eax,%edx
80100820: 2b 15 80 07 11 80 sub 0x80110780,%edx
80100826: 83 fa 7f cmp $0x7f,%edx
80100829: 0f 87 71 ff ff ff ja 801007a0 <consoleintr+0x20>
c = (c == '\r') ? '\n' : c;
input.buf[input.e++ % INPUT_BUF] = c;
8010082f: 8d 50 01 lea 0x1(%eax),%edx
80100832: 83 e0 7f and $0x7f,%eax
consputc(BACKSPACE);
}
break;
default:
if(c != 0 && input.e-input.r < INPUT_BUF){
c = (c == '\r') ? '\n' : c;
80100835: 83 ff 0d cmp $0xd,%edi
input.buf[input.e++ % INPUT_BUF] = c;
80100838: 89 15 88 07 11 80 mov %edx,0x80110788
consputc(BACKSPACE);
}
break;
default:
if(c != 0 && input.e-input.r < INPUT_BUF){
c = (c == '\r') ? '\n' : c;
8010083e: 0f 84 b8 00 00 00 je 801008fc <consoleintr+0x17c>
input.buf[input.e++ % INPUT_BUF] = c;
80100844: 89 f9 mov %edi,%ecx
80100846: 88 88 00 07 11 80 mov %cl,-0x7feef900(%eax)
consputc(c);
8010084c: 89 f8 mov %edi,%eax
8010084e: e8 5d fb ff ff call 801003b0 <consputc>
if(c == '\n' || c == C('D') || input.e == input.r+INPUT_BUF){
80100853: 83 ff 04 cmp $0x4,%edi
80100856: a1 88 07 11 80 mov 0x80110788,%eax
8010085b: 74 19 je 80100876 <consoleintr+0xf6>
8010085d: 83 ff 0a cmp $0xa,%edi
80100860: 74 14 je 80100876 <consoleintr+0xf6>
80100862: 8b 0d 80 07 11 80 mov 0x80110780,%ecx
80100868: 8d 91 80 00 00 00 lea 0x80(%ecx),%edx
8010086e: 39 d0 cmp %edx,%eax
80100870: 0f 85 2a ff ff ff jne 801007a0 <consoleintr+0x20>
input.w = input.e;
wakeup(&input.r);
80100876: c7 04 24 80 07 11 80 movl $0x80110780,(%esp)
if(c != 0 && input.e-input.r < INPUT_BUF){
c = (c == '\r') ? '\n' : c;
input.buf[input.e++ % INPUT_BUF] = c;
consputc(c);
if(c == '\n' || c == C('D') || input.e == input.r+INPUT_BUF){
input.w = input.e;
8010087d: a3 84 07 11 80 mov %eax,0x80110784
wakeup(&input.r);
80100882: e8 09 37 00 00 call 80103f90 <wakeup>
80100887: e9 14 ff ff ff jmp 801007a0 <consoleintr+0x20>
8010088c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
switch(c){
case C('P'): // Process listing.
doprocdump = 1; // procdump() locks cons.lock indirectly; invoke later
break;
case C('U'): // Kill line.
while(input.e != input.w &&
80100890: a1 88 07 11 80 mov 0x80110788,%eax
80100895: 3b 05 84 07 11 80 cmp 0x80110784,%eax
8010089b: 75 2b jne 801008c8 <consoleintr+0x148>
8010089d: e9 fe fe ff ff jmp 801007a0 <consoleintr+0x20>
801008a2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
input.buf[(input.e-1) % INPUT_BUF] != '\n'){
input.e--;
801008a8: a3 88 07 11 80 mov %eax,0x80110788
consputc(BACKSPACE);
801008ad: b8 00 01 00 00 mov $0x100,%eax
801008b2: e8 f9 fa ff ff call 801003b0 <consputc>
switch(c){
case C('P'): // Process listing.
doprocdump = 1; // procdump() locks cons.lock indirectly; invoke later
break;
case C('U'): // Kill line.
while(input.e != input.w &&
801008b7: a1 88 07 11 80 mov 0x80110788,%eax
801008bc: 3b 05 84 07 11 80 cmp 0x80110784,%eax
801008c2: 0f 84 d8 fe ff ff je 801007a0 <consoleintr+0x20>
input.buf[(input.e-1) % INPUT_BUF] != '\n'){
801008c8: 83 e8 01 sub $0x1,%eax
801008cb: 89 c2 mov %eax,%edx
801008cd: 83 e2 7f and $0x7f,%edx
switch(c){
case C('P'): // Process listing.
doprocdump = 1; // procdump() locks cons.lock indirectly; invoke later
break;
case C('U'): // Kill line.
while(input.e != input.w &&
801008d0: 80 ba 00 07 11 80 0a cmpb $0xa,-0x7feef900(%edx)
801008d7: 75 cf jne 801008a8 <consoleintr+0x128>
801008d9: e9 c2 fe ff ff jmp 801007a0 <consoleintr+0x20>
801008de: 66 90 xchg %ax,%ax
acquire(&cons.lock);
while((c = getc()) >= 0){
switch(c){
case C('P'): // Process listing.
doprocdump = 1; // procdump() locks cons.lock indirectly; invoke later
801008e0: be 01 00 00 00 mov $0x1,%esi
801008e5: e9 b6 fe ff ff jmp 801007a0 <consoleintr+0x20>
801008ea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
}
release(&cons.lock);
if(doprocdump) {
procdump(); // now call procdump() wo. cons.lock held
}
}
801008f0: 83 c4 1c add $0x1c,%esp
801008f3: 5b pop %ebx
801008f4: 5e pop %esi
801008f5: 5f pop %edi
801008f6: 5d pop %ebp
break;
}
}
release(&cons.lock);
if(doprocdump) {
procdump(); // now call procdump() wo. cons.lock held
801008f7: e9 a4 3b 00 00 jmp 801044a0 <procdump>
}
break;
default:
if(c != 0 && input.e-input.r < INPUT_BUF){
c = (c == '\r') ? '\n' : c;
input.buf[input.e++ % INPUT_BUF] = c;
801008fc: c6 80 00 07 11 80 0a movb $0xa,-0x7feef900(%eax)
consputc(c);
80100903: b8 0a 00 00 00 mov $0xa,%eax
80100908: e8 a3 fa ff ff call 801003b0 <consputc>
8010090d: a1 88 07 11 80 mov 0x80110788,%eax
80100912: e9 5f ff ff ff jmp 80100876 <consoleintr+0xf6>
80100917: 89 f6 mov %esi,%esi
80100919: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80100920 <consoleinit>:
return n;
}
void
consoleinit(void)
{
80100920: 55 push %ebp
80100921: 89 e5 mov %esp,%ebp
80100923: 83 ec 18 sub $0x18,%esp
initlock(&cons.lock, "console");
80100926: c7 44 24 04 a9 76 10 movl $0x801076a9,0x4(%esp)
8010092d: 80
8010092e: c7 04 24 20 b5 10 80 movl $0x8010b520,(%esp)
80100935: e8 06 3f 00 00 call 80104840 <initlock>
devsw[CONSOLE].write = consolewrite;
devsw[CONSOLE].read = consoleread;
cons.locking = 1;
picenable(IRQ_KBD);
8010093a: c7 04 24 01 00 00 00 movl $0x1,(%esp)
void
consoleinit(void)
{
initlock(&cons.lock, "console");
devsw[CONSOLE].write = consolewrite;
80100941: c7 05 4c 11 11 80 c0 movl $0x801005c0,0x8011114c
80100948: 05 10 80
devsw[CONSOLE].read = consoleread;
8010094b: c7 05 48 11 11 80 40 movl $0x80100240,0x80111148
80100952: 02 10 80
cons.locking = 1;
80100955: c7 05 54 b5 10 80 01 movl $0x1,0x8010b554
8010095c: 00 00 00
picenable(IRQ_KBD);
8010095f: e8 8c 28 00 00 call 801031f0 <picenable>
ioapicenable(IRQ_KBD, 0);
80100964: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
8010096b: 00
8010096c: c7 04 24 01 00 00 00 movl $0x1,(%esp)
80100973: e8 28 19 00 00 call 801022a0 <ioapicenable>
}
80100978: c9 leave
80100979: c3 ret
8010097a: 66 90 xchg %ax,%ax
8010097c: 66 90 xchg %ax,%ax
8010097e: 66 90 xchg %ax,%ax
80100980 <exec>:
#include "x86.h"
#include "elf.h"
int
exec(char *path, char **argv)
{
80100980: 55 push %ebp
80100981: 89 e5 mov %esp,%ebp
80100983: 57 push %edi
80100984: 56 push %esi
80100985: 53 push %ebx
80100986: 81 ec 1c 01 00 00 sub $0x11c,%esp
struct inode *ip;
struct proghdr ph;
pde_t *pgdir, *oldpgdir;
struct thread * t;
begin_op();
8010098c: e8 ef 21 00 00 call 80102b80 <begin_op>
if((ip = namei(path)) == 0){
80100991: 8b 45 08 mov 0x8(%ebp),%eax
80100994: 89 04 24 mov %eax,(%esp)
80100997: e8 44 15 00 00 call 80101ee0 <namei>
8010099c: 85 c0 test %eax,%eax
8010099e: 89 c3 mov %eax,%ebx
801009a0: 74 37 je 801009d9 <exec+0x59>
end_op();
return -1;
}
ilock(ip);
801009a2: 89 04 24 mov %eax,(%esp)
801009a5: e8 96 0c 00 00 call 80101640 <ilock>
pgdir = 0;
// Check ELF header
if(readi(ip, (char*)&elf, 0, sizeof(elf)) < sizeof(elf))
801009aa: 8d 85 24 ff ff ff lea -0xdc(%ebp),%eax
801009b0: c7 44 24 0c 34 00 00 movl $0x34,0xc(%esp)
801009b7: 00
801009b8: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
801009bf: 00
801009c0: 89 44 24 04 mov %eax,0x4(%esp)
801009c4: 89 1c 24 mov %ebx,(%esp)
801009c7: e8 74 0f 00 00 call 80101940 <readi>
801009cc: 83 f8 33 cmp $0x33,%eax
801009cf: 77 1f ja 801009f0 <exec+0x70>
bad:
if(pgdir)
freevm(pgdir);
if(ip){
iunlockput(ip);
801009d1: 89 1c 24 mov %ebx,(%esp)
801009d4: e8 17 0f 00 00 call 801018f0 <iunlockput>
end_op();
801009d9: e8 12 22 00 00 call 80102bf0 <end_op>
}
return -1;
801009de: b8 ff ff ff ff mov $0xffffffff,%eax
}
801009e3: 81 c4 1c 01 00 00 add $0x11c,%esp
801009e9: 5b pop %ebx
801009ea: 5e pop %esi
801009eb: 5f pop %edi
801009ec: 5d pop %ebp
801009ed: c3 ret
801009ee: 66 90 xchg %ax,%ax
pgdir = 0;
// Check ELF header
if(readi(ip, (char*)&elf, 0, sizeof(elf)) < sizeof(elf))
goto bad;
if(elf.magic != ELF_MAGIC)
801009f0: 81 bd 24 ff ff ff 7f cmpl $0x464c457f,-0xdc(%ebp)
801009f7: 45 4c 46
801009fa: 75 d5 jne 801009d1 <exec+0x51>
goto bad;
if((pgdir = setupkvm()) == 0)
801009fc: e8 1f 66 00 00 call 80107020 <setupkvm>
80100a01: 85 c0 test %eax,%eax
80100a03: 89 85 f4 fe ff ff mov %eax,-0x10c(%ebp)
80100a09: 74 c6 je 801009d1 <exec+0x51>
goto bad;
// Load program into memory.
sz = 0;
for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){
80100a0b: 66 83 bd 50 ff ff ff cmpw $0x0,-0xb0(%ebp)
80100a12: 00
80100a13: 8b b5 40 ff ff ff mov -0xc0(%ebp),%esi
80100a19: 0f 84 d2 02 00 00 je 80100cf1 <exec+0x371>
if((pgdir = setupkvm()) == 0)
goto bad;
// Load program into memory.
sz = 0;
80100a1f: c7 85 f0 fe ff ff 00 movl $0x0,-0x110(%ebp)
80100a26: 00 00 00
for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){
80100a29: 31 ff xor %edi,%edi
80100a2b: eb 18 jmp 80100a45 <exec+0xc5>
80100a2d: 8d 76 00 lea 0x0(%esi),%esi
80100a30: 0f b7 85 50 ff ff ff movzwl -0xb0(%ebp),%eax
80100a37: 83 c7 01 add $0x1,%edi
80100a3a: 83 c6 20 add $0x20,%esi
80100a3d: 39 f8 cmp %edi,%eax
80100a3f: 0f 8e be 00 00 00 jle 80100b03 <exec+0x183>
if(readi(ip, (char*)&ph, off, sizeof(ph)) != sizeof(ph))
80100a45: 8d 85 04 ff ff ff lea -0xfc(%ebp),%eax
80100a4b: c7 44 24 0c 20 00 00 movl $0x20,0xc(%esp)
80100a52: 00
80100a53: 89 74 24 08 mov %esi,0x8(%esp)
80100a57: 89 44 24 04 mov %eax,0x4(%esp)
80100a5b: 89 1c 24 mov %ebx,(%esp)
80100a5e: e8 dd 0e 00 00 call 80101940 <readi>
80100a63: 83 f8 20 cmp $0x20,%eax
80100a66: 0f 85 84 00 00 00 jne 80100af0 <exec+0x170>
goto bad;
if(ph.type != ELF_PROG_LOAD)
80100a6c: 83 bd 04 ff ff ff 01 cmpl $0x1,-0xfc(%ebp)
80100a73: 75 bb jne 80100a30 <exec+0xb0>
continue;
if(ph.memsz < ph.filesz)
80100a75: 8b 85 18 ff ff ff mov -0xe8(%ebp),%eax
80100a7b: 3b 85 14 ff ff ff cmp -0xec(%ebp),%eax
80100a81: 72 6d jb 80100af0 <exec+0x170>
goto bad;
if(ph.vaddr + ph.memsz < ph.vaddr)
80100a83: 03 85 0c ff ff ff add -0xf4(%ebp),%eax
80100a89: 72 65 jb 80100af0 <exec+0x170>
goto bad;
if((sz = allocuvm(pgdir, sz, ph.vaddr + ph.memsz)) == 0)
80100a8b: 89 44 24 08 mov %eax,0x8(%esp)
80100a8f: 8b 85 f0 fe ff ff mov -0x110(%ebp),%eax
80100a95: 89 44 24 04 mov %eax,0x4(%esp)
80100a99: 8b 85 f4 fe ff ff mov -0x10c(%ebp),%eax
80100a9f: 89 04 24 mov %eax,(%esp)
80100aa2: e8 19 68 00 00 call 801072c0 <allocuvm>
80100aa7: 85 c0 test %eax,%eax
80100aa9: 89 85 f0 fe ff ff mov %eax,-0x110(%ebp)
80100aaf: 74 3f je 80100af0 <exec+0x170>
goto bad;
if(ph.vaddr % PGSIZE != 0)
80100ab1: 8b 85 0c ff ff ff mov -0xf4(%ebp),%eax
80100ab7: a9 ff 0f 00 00 test $0xfff,%eax
80100abc: 75 32 jne 80100af0 <exec+0x170>
goto bad;
if(loaduvm(pgdir, (char*)ph.vaddr, ip, ph.off, ph.filesz) < 0)
80100abe: 8b 95 14 ff ff ff mov -0xec(%ebp),%edx
80100ac4: 89 44 24 04 mov %eax,0x4(%esp)
80100ac8: 8b 85 f4 fe ff ff mov -0x10c(%ebp),%eax
80100ace: 89 5c 24 08 mov %ebx,0x8(%esp)
80100ad2: 89 54 24 10 mov %edx,0x10(%esp)
80100ad6: 8b 95 08 ff ff ff mov -0xf8(%ebp),%edx
80100adc: 89 04 24 mov %eax,(%esp)
80100adf: 89 54 24 0c mov %edx,0xc(%esp)
80100ae3: e8 18 67 00 00 call 80107200 <loaduvm>
80100ae8: 85 c0 test %eax,%eax
80100aea: 0f 89 40 ff ff ff jns 80100a30 <exec+0xb0>
freevm(oldpgdir);
return 0;
bad:
if(pgdir)
freevm(pgdir);
80100af0: 8b 85 f4 fe ff ff mov -0x10c(%ebp),%eax
80100af6: 89 04 24 mov %eax,(%esp)
80100af9: e8 d2 68 00 00 call 801073d0 <freevm>
80100afe: e9 ce fe ff ff jmp 801009d1 <exec+0x51>
80100b03: 8b b5 f0 fe ff ff mov -0x110(%ebp),%esi
80100b09: 81 c6 ff 0f 00 00 add $0xfff,%esi
80100b0f: 81 e6 00 f0 ff ff and $0xfffff000,%esi
80100b15: 8d be 00 20 00 00 lea 0x2000(%esi),%edi
if(ph.vaddr % PGSIZE != 0)
goto bad;
if(loaduvm(pgdir, (char*)ph.vaddr, ip, ph.off, ph.filesz) < 0)
goto bad;
}
iunlockput(ip);
80100b1b: 89 1c 24 mov %ebx,(%esp)
80100b1e: e8 cd 0d 00 00 call 801018f0 <iunlockput>
end_op();
80100b23: e8 c8 20 00 00 call 80102bf0 <end_op>
ip = 0;
// Allocate two pages at the next page boundary.
// Make the first inaccessible. Use the second as the user stack.
sz = PGROUNDUP(sz);
if((sz = allocuvm(pgdir, sz, sz + 2*PGSIZE)) == 0)
80100b28: 8b 85 f4 fe ff ff mov -0x10c(%ebp),%eax
80100b2e: 89 7c 24 08 mov %edi,0x8(%esp)
80100b32: 89 74 24 04 mov %esi,0x4(%esp)
80100b36: 89 04 24 mov %eax,(%esp)
80100b39: e8 82 67 00 00 call 801072c0 <allocuvm>
80100b3e: 85 c0 test %eax,%eax
80100b40: 89 85 ec fe ff ff mov %eax,-0x114(%ebp)
80100b46: 75 18 jne 80100b60 <exec+0x1e0>
freevm(oldpgdir);
return 0;
bad:
if(pgdir)
freevm(pgdir);
80100b48: 8b 85 f4 fe ff ff mov -0x10c(%ebp),%eax
80100b4e: 89 04 24 mov %eax,(%esp)
80100b51: e8 7a 68 00 00 call 801073d0 <freevm>
if(ip){
iunlockput(ip);
end_op();
}
return -1;
80100b56: b8 ff ff ff ff mov $0xffffffff,%eax
80100b5b: e9 83 fe ff ff jmp 801009e3 <exec+0x63>
// Allocate two pages at the next page boundary.
// Make the first inaccessible. Use the second as the user stack.
sz = PGROUNDUP(sz);
if((sz = allocuvm(pgdir, sz, sz + 2*PGSIZE)) == 0)
goto bad;
clearpteu(pgdir, (char*)(sz - 2*PGSIZE));
80100b60: 8b 9d ec fe ff ff mov -0x114(%ebp),%ebx
80100b66: 89 d8 mov %ebx,%eax
80100b68: 2d 00 20 00 00 sub $0x2000,%eax
80100b6d: 89 44 24 04 mov %eax,0x4(%esp)
80100b71: 8b 85 f4 fe ff ff mov -0x10c(%ebp),%eax
80100b77: 89 04 24 mov %eax,(%esp)
80100b7a: e8 d1 68 00 00 call 80107450 <clearpteu>
sp = sz;
// Push argument strings, prepare rest of stack in ustack.
for(argc = 0; argv[argc]; argc++) {
80100b7f: 8b 45 0c mov 0xc(%ebp),%eax
80100b82: 8b 00 mov (%eax),%eax
80100b84: 85 c0 test %eax,%eax
80100b86: 0f 84 71 01 00 00 je 80100cfd <exec+0x37d>
80100b8c: 8b 4d 0c mov 0xc(%ebp),%ecx
80100b8f: 31 f6 xor %esi,%esi
80100b91: 8b 7d 0c mov 0xc(%ebp),%edi
80100b94: 83 c1 04 add $0x4,%ecx
80100b97: eb 0f jmp 80100ba8 <exec+0x228>
80100b99: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80100ba0: 83 c1 04 add $0x4,%ecx
if(argc >= MAXARG)
80100ba3: 83 fe 20 cmp $0x20,%esi
80100ba6: 74 a0 je 80100b48 <exec+0x1c8>
goto bad;
sp = (sp - (strlen(argv[argc]) + 1)) & ~3;
80100ba8: 89 04 24 mov %eax,(%esp)
80100bab: 89 8d f0 fe ff ff mov %ecx,-0x110(%ebp)
80100bb1: e8 aa 40 00 00 call 80104c60 <strlen>
80100bb6: f7 d0 not %eax
80100bb8: 01 c3 add %eax,%ebx
if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0)
80100bba: 8b 07 mov (%edi),%eax
// Push argument strings, prepare rest of stack in ustack.
for(argc = 0; argv[argc]; argc++) {
if(argc >= MAXARG)
goto bad;
sp = (sp - (strlen(argv[argc]) + 1)) & ~3;
80100bbc: 83 e3 fc and $0xfffffffc,%ebx
if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0)
80100bbf: 89 04 24 mov %eax,(%esp)
80100bc2: e8 99 40 00 00 call 80104c60 <strlen>
80100bc7: 83 c0 01 add $0x1,%eax
80100bca: 89 44 24 0c mov %eax,0xc(%esp)
80100bce: 8b 07 mov (%edi),%eax
80100bd0: 89 5c 24 04 mov %ebx,0x4(%esp)
80100bd4: 89 44 24 08 mov %eax,0x8(%esp)
80100bd8: 8b 85 f4 fe ff ff mov -0x10c(%ebp),%eax
80100bde: 89 04 24 mov %eax,(%esp)
80100be1: e8 ca 69 00 00 call 801075b0 <copyout>
80100be6: 85 c0 test %eax,%eax
80100be8: 0f 88 5a ff ff ff js 80100b48 <exec+0x1c8>
goto bad;
clearpteu(pgdir, (char*)(sz - 2*PGSIZE));
sp = sz;
// Push argument strings, prepare rest of stack in ustack.
for(argc = 0; argv[argc]; argc++) {
80100bee: 8b 8d f0 fe ff ff mov -0x110(%ebp),%ecx
if(argc >= MAXARG)
goto bad;
sp = (sp - (strlen(argv[argc]) + 1)) & ~3;
if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0)
goto bad;
ustack[3+argc] = sp;
80100bf4: 8d 95 58 ff ff ff lea -0xa8(%ebp),%edx
80100bfa: 89 9c b5 64 ff ff ff mov %ebx,-0x9c(%ebp,%esi,4)
goto bad;
clearpteu(pgdir, (char*)(sz - 2*PGSIZE));
sp = sz;
// Push argument strings, prepare rest of stack in ustack.
for(argc = 0; argv[argc]; argc++) {
80100c01: 83 c6 01 add $0x1,%esi
80100c04: 8b 01 mov (%ecx),%eax
80100c06: 89 cf mov %ecx,%edi
80100c08: 85 c0 test %eax,%eax
80100c0a: 75 94 jne 80100ba0 <exec+0x220>
}
ustack[3+argc] = 0;
ustack[0] = 0xffffffff; // fake return PC
ustack[1] = argc;
ustack[2] = sp - (argc+1)*4; // argv pointer
80100c0c: 8d 04 b5 04 00 00 00 lea 0x4(,%esi,4),%eax
80100c13: 89 d9 mov %ebx,%ecx
80100c15: 29 c1 sub %eax,%ecx
sp -= (3+argc+1) * 4;
80100c17: 83 c0 0c add $0xc,%eax
80100c1a: 29 c3 sub %eax,%ebx
if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0)
80100c1c: 89 44 24 0c mov %eax,0xc(%esp)
80100c20: 8b 85 f4 fe ff ff mov -0x10c(%ebp),%eax
80100c26: 89 54 24 08 mov %edx,0x8(%esp)
80100c2a: 89 5c 24 04 mov %ebx,0x4(%esp)
sp = (sp - (strlen(argv[argc]) + 1)) & ~3;
if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0)
goto bad;
ustack[3+argc] = sp;
}
ustack[3+argc] = 0;
80100c2e: c7 84 b5 64 ff ff ff movl $0x0,-0x9c(%ebp,%esi,4)
80100c35: 00 00 00 00
ustack[0] = 0xffffffff; // fake return PC
ustack[1] = argc;
ustack[2] = sp - (argc+1)*4; // argv pointer
sp -= (3+argc+1) * 4;
if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0)
80100c39: 89 04 24 mov %eax,(%esp)
goto bad;
ustack[3+argc] = sp;
}
ustack[3+argc] = 0;
ustack[0] = 0xffffffff; // fake return PC
80100c3c: c7 85 58 ff ff ff ff movl $0xffffffff,-0xa8(%ebp)
80100c43: ff ff ff
ustack[1] = argc;
80100c46: 89 b5 5c ff ff ff mov %esi,-0xa4(%ebp)
ustack[2] = sp - (argc+1)*4; // argv pointer
80100c4c: 89 8d 60 ff ff ff mov %ecx,-0xa0(%ebp)
sp -= (3+argc+1) * 4;
if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0)
80100c52: e8 59 69 00 00 call 801075b0 <copyout>
80100c57: 85 c0 test %eax,%eax
80100c59: 0f 88 e9 fe ff ff js 80100b48 <exec+0x1c8>
goto bad;
// Save program name for debugging.
for(last=s=path; *s; s++)
80100c5f: 8b 45 08 mov 0x8(%ebp),%eax
80100c62: 0f b6 10 movzbl (%eax),%edx
80100c65: 84 d2 test %dl,%dl
80100c67: 74 19 je 80100c82 <exec+0x302>
80100c69: 8b 4d 08 mov 0x8(%ebp),%ecx
80100c6c: 83 c0 01 add $0x1,%eax
if(*s == '/')
last = s+1;
80100c6f: 80 fa 2f cmp $0x2f,%dl
sp -= (3+argc+1) * 4;
if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0)
goto bad;
// Save program name for debugging.
for(last=s=path; *s; s++)
80100c72: 0f b6 10 movzbl (%eax),%edx
if(*s == '/')
last = s+1;
80100c75: 0f 44 c8 cmove %eax,%ecx
80100c78: 83 c0 01 add $0x1,%eax
sp -= (3+argc+1) * 4;
if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0)
goto bad;
// Save program name for debugging.
for(last=s=path; *s; s++)
80100c7b: 84 d2 test %dl,%dl
80100c7d: 75 f0 jne 80100c6f <exec+0x2ef>
80100c7f: 89 4d 08 mov %ecx,0x8(%ebp)
if(*s == '/')
last = s+1;
safestrcpy(proc->name, last, sizeof(proc->name));
80100c82: 8b 45 08 mov 0x8(%ebp),%eax
80100c85: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
80100c8c: 00
80100c8d: 89 44 24 04 mov %eax,0x4(%esp)
80100c91: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80100c97: 83 c0 60 add $0x60,%eax
80100c9a: 89 04 24 mov %eax,(%esp)
80100c9d: e8 7e 3f 00 00 call 80104c20 <safestrcpy>
// Commit to the user image.
oldpgdir = proc->pgdir;
80100ca2: 65 a1 04 00 00 00 mov %gs:0x4,%eax
proc->pgdir = pgdir;
80100ca8: 8b 8d f4 fe ff ff mov -0x10c(%ebp),%ecx
if(*s == '/')
last = s+1;
safestrcpy(proc->name, last, sizeof(proc->name));
// Commit to the user image.
oldpgdir = proc->pgdir;
80100cae: 8b 70 04 mov 0x4(%eax),%esi
proc->pgdir = pgdir;
80100cb1: 89 48 04 mov %ecx,0x4(%eax)
proc->sz = sz;
80100cb4: 8b 8d ec fe ff ff mov -0x114(%ebp),%ecx
80100cba: 89 08 mov %ecx,(%eax)
t = &proc->thread_array[0];
80100cbc: 65 a1 04 00 00 00 mov %gs:0x4,%eax
t->tf->eip = elf.entry; // main
80100cc2: 8b 8d 3c ff ff ff mov -0xc4(%ebp),%ecx
80100cc8: 8b 90 84 00 00 00 mov 0x84(%eax),%edx
80100cce: 89 4a 38 mov %ecx,0x38(%edx)
t->tf->esp = sp;
80100cd1: 8b 90 84 00 00 00 mov 0x84(%eax),%edx
80100cd7: 89 5a 44 mov %ebx,0x44(%edx)
switchuvm(proc);
80100cda: 89 04 24 mov %eax,(%esp)
80100cdd: e8 fe 63 00 00 call 801070e0 <switchuvm>
freevm(oldpgdir);
80100ce2: 89 34 24 mov %esi,(%esp)
80100ce5: e8 e6 66 00 00 call 801073d0 <freevm>
return 0;
80100cea: 31 c0 xor %eax,%eax
80100cec: e9 f2 fc ff ff jmp 801009e3 <exec+0x63>
if((pgdir = setupkvm()) == 0)
goto bad;
// Load program into memory.
sz = 0;
for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){
80100cf1: bf 00 20 00 00 mov $0x2000,%edi
80100cf6: 31 f6 xor %esi,%esi
80100cf8: e9 1e fe ff ff jmp 80100b1b <exec+0x19b>
goto bad;
clearpteu(pgdir, (char*)(sz - 2*PGSIZE));
sp = sz;
// Push argument strings, prepare rest of stack in ustack.
for(argc = 0; argv[argc]; argc++) {
80100cfd: 8b 9d ec fe ff ff mov -0x114(%ebp),%ebx
80100d03: 31 f6 xor %esi,%esi
80100d05: 8d 95 58 ff ff ff lea -0xa8(%ebp),%edx
80100d0b: e9 fc fe ff ff jmp 80100c0c <exec+0x28c>
80100d10 <fileinit>:
struct file file[NFILE];
} ftable;
void
fileinit(void)
{
80100d10: 55 push %ebp
80100d11: 89 e5 mov %esp,%ebp
80100d13: 83 ec 18 sub $0x18,%esp
initlock(&ftable.lock, "ftable");
80100d16: c7 44 24 04 c2 76 10 movl $0x801076c2,0x4(%esp)
80100d1d: 80
80100d1e: c7 04 24 a0 07 11 80 movl $0x801107a0,(%esp)
80100d25: e8 16 3b 00 00 call 80104840 <initlock>
}
80100d2a: c9 leave
80100d2b: c3 ret
80100d2c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80100d30 <filealloc>:
// Allocate a file structure.
struct file*
filealloc(void)
{
80100d30: 55 push %ebp
80100d31: 89 e5 mov %esp,%ebp
80100d33: 53 push %ebx
struct file *f;
acquire(&ftable.lock);
for(f = ftable.file; f < ftable.file + NFILE; f++){
80100d34: bb d4 07 11 80 mov $0x801107d4,%ebx
}
// Allocate a file structure.
struct file*
filealloc(void)
{
80100d39: 83 ec 14 sub $0x14,%esp
struct file *f;
acquire(&ftable.lock);
80100d3c: c7 04 24 a0 07 11 80 movl $0x801107a0,(%esp)
80100d43: e8 78 3b 00 00 call 801048c0 <acquire>
80100d48: eb 11 jmp 80100d5b <filealloc+0x2b>
80100d4a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
for(f = ftable.file; f < ftable.file + NFILE; f++){
80100d50: 83 c3 18 add $0x18,%ebx
80100d53: 81 fb 34 11 11 80 cmp $0x80111134,%ebx
80100d59: 74 25 je 80100d80 <filealloc+0x50>
if(f->ref == 0){
80100d5b: 8b 43 04 mov 0x4(%ebx),%eax
80100d5e: 85 c0 test %eax,%eax
80100d60: 75 ee jne 80100d50 <filealloc+0x20>
f->ref = 1;
release(&ftable.lock);
80100d62: c7 04 24 a0 07 11 80 movl $0x801107a0,(%esp)
struct file *f;
acquire(&ftable.lock);
for(f = ftable.file; f < ftable.file + NFILE; f++){
if(f->ref == 0){
f->ref = 1;
80100d69: c7 43 04 01 00 00 00 movl $0x1,0x4(%ebx)
release(&ftable.lock);
80100d70: e8 7b 3c 00 00 call 801049f0 <release>
return f;
}
}
release(&ftable.lock);
return 0;
}
80100d75: 83 c4 14 add $0x14,%esp
acquire(&ftable.lock);
for(f = ftable.file; f < ftable.file + NFILE; f++){
if(f->ref == 0){
f->ref = 1;
release(&ftable.lock);
return f;
80100d78: 89 d8 mov %ebx,%eax
}
}
release(&ftable.lock);
return 0;
}
80100d7a: 5b pop %ebx
80100d7b: 5d pop %ebp
80100d7c: c3 ret
80100d7d: 8d 76 00 lea 0x0(%esi),%esi
f->ref = 1;
release(&ftable.lock);
return f;
}
}
release(&ftable.lock);
80100d80: c7 04 24 a0 07 11 80 movl $0x801107a0,(%esp)
80100d87: e8 64 3c 00 00 call 801049f0 <release>
return 0;
}
80100d8c: 83 c4 14 add $0x14,%esp
release(&ftable.lock);
return f;
}
}
release(&ftable.lock);
return 0;
80100d8f: 31 c0 xor %eax,%eax
}
80100d91: 5b pop %ebx
80100d92: 5d pop %ebp
80100d93: c3 ret
80100d94: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80100d9a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
80100da0 <filedup>:
// Increment ref count for file f.
struct file*
filedup(struct file *f)
{
80100da0: 55 push %ebp
80100da1: 89 e5 mov %esp,%ebp
80100da3: 53 push %ebx
80100da4: 83 ec 14 sub $0x14,%esp
80100da7: 8b 5d 08 mov 0x8(%ebp),%ebx
acquire(&ftable.lock);
80100daa: c7 04 24 a0 07 11 80 movl $0x801107a0,(%esp)
80100db1: e8 0a 3b 00 00 call 801048c0 <acquire>
if(f->ref < 1)
80100db6: 8b 43 04 mov 0x4(%ebx),%eax
80100db9: 85 c0 test %eax,%eax
80100dbb: 7e 1a jle 80100dd7 <filedup+0x37>
panic("filedup");
f->ref++;
80100dbd: 83 c0 01 add $0x1,%eax
80100dc0: 89 43 04 mov %eax,0x4(%ebx)
release(&ftable.lock);
80100dc3: c7 04 24 a0 07 11 80 movl $0x801107a0,(%esp)
80100dca: e8 21 3c 00 00 call 801049f0 <release>
return f;
}
80100dcf: 83 c4 14 add $0x14,%esp
80100dd2: 89 d8 mov %ebx,%eax
80100dd4: 5b pop %ebx
80100dd5: 5d pop %ebp
80100dd6: c3 ret
struct file*
filedup(struct file *f)
{
acquire(&ftable.lock);
if(f->ref < 1)
panic("filedup");
80100dd7: c7 04 24 c9 76 10 80 movl $0x801076c9,(%esp)
80100dde: e8 4d f5 ff ff call 80100330 <panic>
80100de3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80100de9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80100df0 <fileclose>:
}
// Close file f. (Decrement ref count, close when reaches 0.)
void
fileclose(struct file *f)
{
80100df0: 55 push %ebp
80100df1: 89 e5 mov %esp,%ebp
80100df3: 57 push %edi
80100df4: 56 push %esi
80100df5: 53 push %ebx
80100df6: 83 ec 1c sub $0x1c,%esp
80100df9: 8b 7d 08 mov 0x8(%ebp),%edi
struct file ff;
acquire(&ftable.lock);
80100dfc: c7 04 24 a0 07 11 80 movl $0x801107a0,(%esp)
80100e03: e8 b8 3a 00 00 call 801048c0 <acquire>
if(f->ref < 1)
80100e08: 8b 57 04 mov 0x4(%edi),%edx
80100e0b: 85 d2 test %edx,%edx
80100e0d: 0f 8e 89 00 00 00 jle 80100e9c <fileclose+0xac>
panic("fileclose");
if(--f->ref > 0){
80100e13: 83 ea 01 sub $0x1,%edx
80100e16: 85 d2 test %edx,%edx
80100e18: 89 57 04 mov %edx,0x4(%edi)
80100e1b: 74 13 je 80100e30 <fileclose+0x40>
release(&ftable.lock);
80100e1d: c7 45 08 a0 07 11 80 movl $0x801107a0,0x8(%ebp)
else if(ff.type == FD_INODE){
begin_op();
iput(ff.ip);
end_op();
}
}
80100e24: 83 c4 1c add $0x1c,%esp
80100e27: 5b pop %ebx
80100e28: 5e pop %esi
80100e29: 5f pop %edi
80100e2a: 5d pop %ebp
acquire(&ftable.lock);
if(f->ref < 1)
panic("fileclose");
if(--f->ref > 0){
release(&ftable.lock);
80100e2b: e9 c0 3b 00 00 jmp 801049f0 <release>
return;
}
ff = *f;
80100e30: 0f b6 47 09 movzbl 0x9(%edi),%eax
80100e34: 8b 37 mov (%edi),%esi
80100e36: 8b 5f 0c mov 0xc(%edi),%ebx
f->ref = 0;
f->type = FD_NONE;
80100e39: c7 07 00 00 00 00 movl $0x0,(%edi)
panic("fileclose");
if(--f->ref > 0){
release(&ftable.lock);
return;
}
ff = *f;
80100e3f: 88 45 e7 mov %al,-0x19(%ebp)
80100e42: 8b 47 10 mov 0x10(%edi),%eax
f->ref = 0;
f->type = FD_NONE;
release(&ftable.lock);
80100e45: c7 04 24 a0 07 11 80 movl $0x801107a0,(%esp)
panic("fileclose");
if(--f->ref > 0){
release(&ftable.lock);
return;
}
ff = *f;
80100e4c: 89 45 e0 mov %eax,-0x20(%ebp)
f->ref = 0;
f->type = FD_NONE;
release(&ftable.lock);
80100e4f: e8 9c 3b 00 00 call 801049f0 <release>
if(ff.type == FD_PIPE)
80100e54: 83 fe 01 cmp $0x1,%esi
80100e57: 74 0f je 80100e68 <fileclose+0x78>
pipeclose(ff.pipe, ff.writable);
else if(ff.type == FD_INODE){
80100e59: 83 fe 02 cmp $0x2,%esi
80100e5c: 74 22 je 80100e80 <fileclose+0x90>
begin_op();
iput(ff.ip);
end_op();
}
}
80100e5e: 83 c4 1c add $0x1c,%esp
80100e61: 5b pop %ebx
80100e62: 5e pop %esi
80100e63: 5f pop %edi
80100e64: 5d pop %ebp
80100e65: c3 ret
80100e66: 66 90 xchg %ax,%ax
f->ref = 0;
f->type = FD_NONE;
release(&ftable.lock);
if(ff.type == FD_PIPE)
pipeclose(ff.pipe, ff.writable);
80100e68: 0f be 75 e7 movsbl -0x19(%ebp),%esi
80100e6c: 89 1c 24 mov %ebx,(%esp)
80100e6f: 89 74 24 04 mov %esi,0x4(%esp)
80100e73: e8 28 25 00 00 call 801033a0 <pipeclose>
80100e78: eb e4 jmp 80100e5e <fileclose+0x6e>
80100e7a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
else if(ff.type == FD_INODE){
begin_op();
80100e80: e8 fb 1c 00 00 call 80102b80 <begin_op>
iput(ff.ip);
80100e85: 8b 45 e0 mov -0x20(%ebp),%eax
80100e88: 89 04 24 mov %eax,(%esp)
80100e8b: e8 10 09 00 00 call 801017a0 <iput>
end_op();
}
}
80100e90: 83 c4 1c add $0x1c,%esp
80100e93: 5b pop %ebx
80100e94: 5e pop %esi
80100e95: 5f pop %edi
80100e96: 5d pop %ebp
if(ff.type == FD_PIPE)
pipeclose(ff.pipe, ff.writable);
else if(ff.type == FD_INODE){
begin_op();
iput(ff.ip);
end_op();
80100e97: e9 54 1d 00 00 jmp 80102bf0 <end_op>
{
struct file ff;
acquire(&ftable.lock);
if(f->ref < 1)
panic("fileclose");
80100e9c: c7 04 24 d1 76 10 80 movl $0x801076d1,(%esp)
80100ea3: e8 88 f4 ff ff call 80100330 <panic>
80100ea8: 90 nop
80100ea9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80100eb0 <filestat>:
}
// Get metadata about file f.
int
filestat(struct file *f, struct stat *st)
{
80100eb0: 55 push %ebp
80100eb1: 89 e5 mov %esp,%ebp
80100eb3: 53 push %ebx
80100eb4: 83 ec 14 sub $0x14,%esp
80100eb7: 8b 5d 08 mov 0x8(%ebp),%ebx
if(f->type == FD_INODE){
80100eba: 83 3b 02 cmpl $0x2,(%ebx)
80100ebd: 75 31 jne 80100ef0 <filestat+0x40>
ilock(f->ip);
80100ebf: 8b 43 10 mov 0x10(%ebx),%eax
80100ec2: 89 04 24 mov %eax,(%esp)
80100ec5: e8 76 07 00 00 call 80101640 <ilock>
stati(f->ip, st);
80100eca: 8b 45 0c mov 0xc(%ebp),%eax
80100ecd: 89 44 24 04 mov %eax,0x4(%esp)
80100ed1: 8b 43 10 mov 0x10(%ebx),%eax
80100ed4: 89 04 24 mov %eax,(%esp)
80100ed7: e8 34 0a 00 00 call 80101910 <stati>
iunlock(f->ip);
80100edc: 8b 43 10 mov 0x10(%ebx),%eax
80100edf: 89 04 24 mov %eax,(%esp)
80100ee2: e8 69 08 00 00 call 80101750 <iunlock>
return 0;
}
return -1;
}
80100ee7: 83 c4 14 add $0x14,%esp
{
if(f->type == FD_INODE){
ilock(f->ip);
stati(f->ip, st);
iunlock(f->ip);
return 0;
80100eea: 31 c0 xor %eax,%eax
}
return -1;
}
80100eec: 5b pop %ebx
80100eed: 5d pop %ebp
80100eee: c3 ret
80100eef: 90 nop
80100ef0: 83 c4 14 add $0x14,%esp
ilock(f->ip);
stati(f->ip, st);
iunlock(f->ip);
return 0;
}
return -1;
80100ef3: b8 ff ff ff ff mov $0xffffffff,%eax
}
80100ef8: 5b pop %ebx
80100ef9: 5d pop %ebp
80100efa: c3 ret
80100efb: 90 nop
80100efc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80100f00 <fileread>:
// Read from file f.
int
fileread(struct file *f, char *addr, int n)
{
80100f00: 55 push %ebp
80100f01: 89 e5 mov %esp,%ebp
80100f03: 57 push %edi
80100f04: 56 push %esi
80100f05: 53 push %ebx
80100f06: 83 ec 1c sub $0x1c,%esp
80100f09: 8b 5d 08 mov 0x8(%ebp),%ebx
80100f0c: 8b 75 0c mov 0xc(%ebp),%esi
80100f0f: 8b 7d 10 mov 0x10(%ebp),%edi
int r;
if(f->readable == 0)
80100f12: 80 7b 08 00 cmpb $0x0,0x8(%ebx)
80100f16: 74 68 je 80100f80 <fileread+0x80>
return -1;
if(f->type == FD_PIPE)
80100f18: 8b 03 mov (%ebx),%eax
80100f1a: 83 f8 01 cmp $0x1,%eax
80100f1d: 74 49 je 80100f68 <fileread+0x68>
return piperead(f->pipe, addr, n);
if(f->type == FD_INODE){
80100f1f: 83 f8 02 cmp $0x2,%eax
80100f22: 75 63 jne 80100f87 <fileread+0x87>
ilock(f->ip);
80100f24: 8b 43 10 mov 0x10(%ebx),%eax
80100f27: 89 04 24 mov %eax,(%esp)
80100f2a: e8 11 07 00 00 call 80101640 <ilock>
if((r = readi(f->ip, addr, f->off, n)) > 0)
80100f2f: 89 7c 24 0c mov %edi,0xc(%esp)
80100f33: 8b 43 14 mov 0x14(%ebx),%eax
80100f36: 89 74 24 04 mov %esi,0x4(%esp)
80100f3a: 89 44 24 08 mov %eax,0x8(%esp)
80100f3e: 8b 43 10 mov 0x10(%ebx),%eax
80100f41: 89 04 24 mov %eax,(%esp)
80100f44: e8 f7 09 00 00 call 80101940 <readi>
80100f49: 85 c0 test %eax,%eax
80100f4b: 89 c6 mov %eax,%esi
80100f4d: 7e 03 jle 80100f52 <fileread+0x52>
f->off += r;
80100f4f: 01 43 14 add %eax,0x14(%ebx)
iunlock(f->ip);
80100f52: 8b 43 10 mov 0x10(%ebx),%eax
80100f55: 89 04 24 mov %eax,(%esp)
80100f58: e8 f3 07 00 00 call 80101750 <iunlock>
return -1;
if(f->type == FD_PIPE)
return piperead(f->pipe, addr, n);
if(f->type == FD_INODE){
ilock(f->ip);
if((r = readi(f->ip, addr, f->off, n)) > 0)
80100f5d: 89 f0 mov %esi,%eax
f->off += r;
iunlock(f->ip);
return r;
}
panic("fileread");
}
80100f5f: 83 c4 1c add $0x1c,%esp
80100f62: 5b pop %ebx
80100f63: 5e pop %esi
80100f64: 5f pop %edi
80100f65: 5d pop %ebp
80100f66: c3 ret
80100f67: 90 nop
int r;
if(f->readable == 0)
return -1;
if(f->type == FD_PIPE)
return piperead(f->pipe, addr, n);
80100f68: 8b 43 0c mov 0xc(%ebx),%eax
80100f6b: 89 45 08 mov %eax,0x8(%ebp)
f->off += r;
iunlock(f->ip);
return r;
}
panic("fileread");
}
80100f6e: 83 c4 1c add $0x1c,%esp
80100f71: 5b pop %ebx
80100f72: 5e pop %esi
80100f73: 5f pop %edi
80100f74: 5d pop %ebp
int r;
if(f->readable == 0)
return -1;
if(f->type == FD_PIPE)
return piperead(f->pipe, addr, n);
80100f75: e9 d6 25 00 00 jmp 80103550 <piperead>
80100f7a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
fileread(struct file *f, char *addr, int n)
{
int r;
if(f->readable == 0)
return -1;
80100f80: b8 ff ff ff ff mov $0xffffffff,%eax
80100f85: eb d8 jmp 80100f5f <fileread+0x5f>
if((r = readi(f->ip, addr, f->off, n)) > 0)
f->off += r;
iunlock(f->ip);
return r;
}
panic("fileread");
80100f87: c7 04 24 db 76 10 80 movl $0x801076db,(%esp)
80100f8e: e8 9d f3 ff ff call 80100330 <panic>
80100f93: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80100f99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80100fa0 <filewrite>:
//PAGEBREAK!
// Write to file f.
int
filewrite(struct file *f, char *addr, int n)
{
80100fa0: 55 push %ebp
80100fa1: 89 e5 mov %esp,%ebp
80100fa3: 57 push %edi
80100fa4: 56 push %esi
80100fa5: 53 push %ebx
80100fa6: 83 ec 2c sub $0x2c,%esp
80100fa9: 8b 45 0c mov 0xc(%ebp),%eax
80100fac: 8b 7d 08 mov 0x8(%ebp),%edi
80100faf: 89 45 dc mov %eax,-0x24(%ebp)
80100fb2: 8b 45 10 mov 0x10(%ebp),%eax
int r;
if(f->writable == 0)
80100fb5: 80 7f 09 00 cmpb $0x0,0x9(%edi)
//PAGEBREAK!
// Write to file f.
int
filewrite(struct file *f, char *addr, int n)
{
80100fb9: 89 45 e4 mov %eax,-0x1c(%ebp)
int r;
if(f->writable == 0)
80100fbc: 0f 84 ae 00 00 00 je 80101070 <filewrite+0xd0>
return -1;
if(f->type == FD_PIPE)
80100fc2: 8b 07 mov (%edi),%eax
80100fc4: 83 f8 01 cmp $0x1,%eax
80100fc7: 0f 84 c2 00 00 00 je 8010108f <filewrite+0xef>
return pipewrite(f->pipe, addr, n);
if(f->type == FD_INODE){
80100fcd: 83 f8 02 cmp $0x2,%eax
80100fd0: 0f 85 d7 00 00 00 jne 801010ad <filewrite+0x10d>
// and 2 blocks of slop for non-aligned writes.
// this really belongs lower down, since writei()
// might be writing a device like the console.
int max = ((LOGSIZE-1-1-2) / 2) * 512;
int i = 0;
while(i < n){
80100fd6: 8b 45 e4 mov -0x1c(%ebp),%eax
80100fd9: 31 db xor %ebx,%ebx
80100fdb: 85 c0 test %eax,%eax
80100fdd: 7f 31 jg 80101010 <filewrite+0x70>
80100fdf: e9 9c 00 00 00 jmp 80101080 <filewrite+0xe0>
80100fe4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
begin_op();
ilock(f->ip);
if ((r = writei(f->ip, addr + i, f->off, n1)) > 0)
f->off += r;
iunlock(f->ip);
80100fe8: 8b 4f 10 mov 0x10(%edi),%ecx
n1 = max;
begin_op();
ilock(f->ip);
if ((r = writei(f->ip, addr + i, f->off, n1)) > 0)
f->off += r;
80100feb: 01 47 14 add %eax,0x14(%edi)
80100fee: 89 45 e0 mov %eax,-0x20(%ebp)
iunlock(f->ip);
80100ff1: 89 0c 24 mov %ecx,(%esp)
80100ff4: e8 57 07 00 00 call 80101750 <iunlock>
end_op();
80100ff9: e8 f2 1b 00 00 call 80102bf0 <end_op>
80100ffe: 8b 45 e0 mov -0x20(%ebp),%eax
if(r < 0)
break;
if(r != n1)
80101001: 39 f0 cmp %esi,%eax
80101003: 0f 85 98 00 00 00 jne 801010a1 <filewrite+0x101>
panic("short filewrite");
i += r;
80101009: 01 c3 add %eax,%ebx
// and 2 blocks of slop for non-aligned writes.
// this really belongs lower down, since writei()
// might be writing a device like the console.
int max = ((LOGSIZE-1-1-2) / 2) * 512;
int i = 0;
while(i < n){
8010100b: 39 5d e4 cmp %ebx,-0x1c(%ebp)
8010100e: 7e 70 jle 80101080 <filewrite+0xe0>
int n1 = n - i;
80101010: 8b 75 e4 mov -0x1c(%ebp),%esi
80101013: b8 00 1a 00 00 mov $0x1a00,%eax
80101018: 29 de sub %ebx,%esi
8010101a: 81 fe 00 1a 00 00 cmp $0x1a00,%esi
80101020: 0f 4f f0 cmovg %eax,%esi
if(n1 > max)
n1 = max;
begin_op();
80101023: e8 58 1b 00 00 call 80102b80 <begin_op>
ilock(f->ip);
80101028: 8b 47 10 mov 0x10(%edi),%eax
8010102b: 89 04 24 mov %eax,(%esp)
8010102e: e8 0d 06 00 00 call 80101640 <ilock>
if ((r = writei(f->ip, addr + i, f->off, n1)) > 0)
80101033: 89 74 24 0c mov %esi,0xc(%esp)
80101037: 8b 47 14 mov 0x14(%edi),%eax
8010103a: 89 44 24 08 mov %eax,0x8(%esp)
8010103e: 8b 45 dc mov -0x24(%ebp),%eax
80101041: 01 d8 add %ebx,%eax
80101043: 89 44 24 04 mov %eax,0x4(%esp)
80101047: 8b 47 10 mov 0x10(%edi),%eax
8010104a: 89 04 24 mov %eax,(%esp)
8010104d: e8 ee 09 00 00 call 80101a40 <writei>
80101052: 85 c0 test %eax,%eax
80101054: 7f 92 jg 80100fe8 <filewrite+0x48>
f->off += r;
iunlock(f->ip);
80101056: 8b 4f 10 mov 0x10(%edi),%ecx
80101059: 89 45 e0 mov %eax,-0x20(%ebp)
8010105c: 89 0c 24 mov %ecx,(%esp)
8010105f: e8 ec 06 00 00 call 80101750 <iunlock>
end_op();
80101064: e8 87 1b 00 00 call 80102bf0 <end_op>
if(r < 0)
80101069: 8b 45 e0 mov -0x20(%ebp),%eax
8010106c: 85 c0 test %eax,%eax
8010106e: 74 91 je 80101001 <filewrite+0x61>
i += r;
}
return i == n ? n : -1;
}
panic("filewrite");
}
80101070: 83 c4 2c add $0x2c,%esp
filewrite(struct file *f, char *addr, int n)
{
int r;
if(f->writable == 0)
return -1;
80101073: b8 ff ff ff ff mov $0xffffffff,%eax
i += r;
}
return i == n ? n : -1;
}
panic("filewrite");
}
80101078: 5b pop %ebx
80101079: 5e pop %esi
8010107a: 5f pop %edi
8010107b: 5d pop %ebp
8010107c: c3 ret
8010107d: 8d 76 00 lea 0x0(%esi),%esi
break;
if(r != n1)
panic("short filewrite");
i += r;
}
return i == n ? n : -1;
80101080: 3b 5d e4 cmp -0x1c(%ebp),%ebx
80101083: 89 d8 mov %ebx,%eax
80101085: 75 e9 jne 80101070 <filewrite+0xd0>
}
panic("filewrite");
}
80101087: 83 c4 2c add $0x2c,%esp
8010108a: 5b pop %ebx
8010108b: 5e pop %esi
8010108c: 5f pop %edi
8010108d: 5d pop %ebp
8010108e: c3 ret
int r;
if(f->writable == 0)
return -1;
if(f->type == FD_PIPE)
return pipewrite(f->pipe, addr, n);
8010108f: 8b 47 0c mov 0xc(%edi),%eax
80101092: 89 45 08 mov %eax,0x8(%ebp)
i += r;
}
return i == n ? n : -1;
}
panic("filewrite");
}
80101095: 83 c4 2c add $0x2c,%esp
80101098: 5b pop %ebx
80101099: 5e pop %esi
8010109a: 5f pop %edi
8010109b: 5d pop %ebp
int r;
if(f->writable == 0)
return -1;
if(f->type == FD_PIPE)
return pipewrite(f->pipe, addr, n);
8010109c: e9 8f 23 00 00 jmp 80103430 <pipewrite>
end_op();
if(r < 0)
break;
if(r != n1)
panic("short filewrite");
801010a1: c7 04 24 e4 76 10 80 movl $0x801076e4,(%esp)
801010a8: e8 83 f2 ff ff call 80100330 <panic>
i += r;
}
return i == n ? n : -1;
}
panic("filewrite");
801010ad: c7 04 24 ea 76 10 80 movl $0x801076ea,(%esp)
801010b4: e8 77 f2 ff ff call 80100330 <panic>
801010b9: 66 90 xchg %ax,%ax
801010bb: 66 90 xchg %ax,%ax
801010bd: 66 90 xchg %ax,%ax
801010bf: 90 nop
801010c0 <balloc>:
// Blocks.
// Allocate a zeroed disk block.
static uint
balloc(uint dev)
{
801010c0: 55 push %ebp
801010c1: 89 e5 mov %esp,%ebp
801010c3: 57 push %edi
801010c4: 56 push %esi
801010c5: 53 push %ebx
801010c6: 83 ec 2c sub $0x2c,%esp
801010c9: 89 45 d8 mov %eax,-0x28(%ebp)
int b, bi, m;
struct buf *bp;
bp = 0;
for(b = 0; b < sb.size; b += BPB){
801010cc: a1 a0 11 11 80 mov 0x801111a0,%eax
801010d1: 85 c0 test %eax,%eax
801010d3: 0f 84 8c 00 00 00 je 80101165 <balloc+0xa5>
801010d9: c7 45 dc 00 00 00 00 movl $0x0,-0x24(%ebp)
bp = bread(dev, BBLOCK(b, sb));
801010e0: 8b 75 dc mov -0x24(%ebp),%esi
801010e3: 89 f0 mov %esi,%eax
801010e5: c1 f8 0c sar $0xc,%eax
801010e8: 03 05 b8 11 11 80 add 0x801111b8,%eax
801010ee: 89 44 24 04 mov %eax,0x4(%esp)
801010f2: 8b 45 d8 mov -0x28(%ebp),%eax
801010f5: 89 04 24 mov %eax,(%esp)
801010f8: e8 c3 ef ff ff call 801000c0 <bread>
801010fd: 89 45 e4 mov %eax,-0x1c(%ebp)
80101100: a1 a0 11 11 80 mov 0x801111a0,%eax
80101105: 89 45 e0 mov %eax,-0x20(%ebp)
for(bi = 0; bi < BPB && b + bi < sb.size; bi++){
80101108: 31 c0 xor %eax,%eax
8010110a: eb 33 jmp 8010113f <balloc+0x7f>
8010110c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
m = 1 << (bi % 8);
if((bp->data[bi/8] & m) == 0){ // Is block free?
80101110: 8b 5d e4 mov -0x1c(%ebp),%ebx
80101113: 89 c2 mov %eax,%edx
bp = 0;
for(b = 0; b < sb.size; b += BPB){
bp = bread(dev, BBLOCK(b, sb));
for(bi = 0; bi < BPB && b + bi < sb.size; bi++){
m = 1 << (bi % 8);
80101115: 89 c1 mov %eax,%ecx
if((bp->data[bi/8] & m) == 0){ // Is block free?
80101117: c1 fa 03 sar $0x3,%edx
bp = 0;
for(b = 0; b < sb.size; b += BPB){
bp = bread(dev, BBLOCK(b, sb));
for(bi = 0; bi < BPB && b + bi < sb.size; bi++){
m = 1 << (bi % 8);
8010111a: 83 e1 07 and $0x7,%ecx
8010111d: bf 01 00 00 00 mov $0x1,%edi
80101122: d3 e7 shl %cl,%edi
if((bp->data[bi/8] & m) == 0){ // Is block free?
80101124: 0f b6 5c 13 18 movzbl 0x18(%ebx,%edx,1),%ebx
bp = 0;
for(b = 0; b < sb.size; b += BPB){
bp = bread(dev, BBLOCK(b, sb));
for(bi = 0; bi < BPB && b + bi < sb.size; bi++){
m = 1 << (bi % 8);
80101129: 89 f9 mov %edi,%ecx
if((bp->data[bi/8] & m) == 0){ // Is block free?
8010112b: 0f b6 fb movzbl %bl,%edi
8010112e: 85 cf test %ecx,%edi
80101130: 74 46 je 80101178 <balloc+0xb8>
struct buf *bp;
bp = 0;
for(b = 0; b < sb.size; b += BPB){
bp = bread(dev, BBLOCK(b, sb));
for(bi = 0; bi < BPB && b + bi < sb.size; bi++){
80101132: 83 c0 01 add $0x1,%eax
80101135: 83 c6 01 add $0x1,%esi
80101138: 3d 00 10 00 00 cmp $0x1000,%eax
8010113d: 74 05 je 80101144 <balloc+0x84>
8010113f: 3b 75 e0 cmp -0x20(%ebp),%esi
80101142: 72 cc jb 80101110 <balloc+0x50>
brelse(bp);
bzero(dev, b + bi);
return b + bi;
}
}
brelse(bp);
80101144: 8b 45 e4 mov -0x1c(%ebp),%eax
80101147: 89 04 24 mov %eax,(%esp)
8010114a: e8 71 f0 ff ff call 801001c0 <brelse>
{
int b, bi, m;
struct buf *bp;
bp = 0;
for(b = 0; b < sb.size; b += BPB){
8010114f: 81 45 dc 00 10 00 00 addl $0x1000,-0x24(%ebp)
80101156: 8b 45 dc mov -0x24(%ebp),%eax
80101159: 3b 05 a0 11 11 80 cmp 0x801111a0,%eax
8010115f: 0f 82 7b ff ff ff jb 801010e0 <balloc+0x20>
return b + bi;
}
}
brelse(bp);
}
panic("balloc: out of blocks");
80101165: c7 04 24 f4 76 10 80 movl $0x801076f4,(%esp)
8010116c: e8 bf f1 ff ff call 80100330 <panic>
80101171: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
for(b = 0; b < sb.size; b += BPB){
bp = bread(dev, BBLOCK(b, sb));
for(bi = 0; bi < BPB && b + bi < sb.size; bi++){
m = 1 << (bi % 8);
if((bp->data[bi/8] & m) == 0){ // Is block free?
bp->data[bi/8] |= m; // Mark block in use.
80101178: 09 d9 or %ebx,%ecx
8010117a: 8b 5d e4 mov -0x1c(%ebp),%ebx
8010117d: 88 4c 13 18 mov %cl,0x18(%ebx,%edx,1)
log_write(bp);
80101181: 89 1c 24 mov %ebx,(%esp)
80101184: e8 97 1b 00 00 call 80102d20 <log_write>
brelse(bp);
80101189: 89 1c 24 mov %ebx,(%esp)
8010118c: e8 2f f0 ff ff call 801001c0 <brelse>
static void
bzero(int dev, int bno)
{
struct buf *bp;
bp = bread(dev, bno);
80101191: 8b 45 d8 mov -0x28(%ebp),%eax
80101194: 89 74 24 04 mov %esi,0x4(%esp)
80101198: 89 04 24 mov %eax,(%esp)
8010119b: e8 20 ef ff ff call 801000c0 <bread>
memset(bp->data, 0, BSIZE);
801011a0: c7 44 24 08 00 02 00 movl $0x200,0x8(%esp)
801011a7: 00
801011a8: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
801011af: 00
static void
bzero(int dev, int bno)
{
struct buf *bp;
bp = bread(dev, bno);
801011b0: 89 c3 mov %eax,%ebx
memset(bp->data, 0, BSIZE);
801011b2: 8d 40 18 lea 0x18(%eax),%eax
801011b5: 89 04 24 mov %eax,(%esp)
801011b8: e8 83 38 00 00 call 80104a40 <memset>
log_write(bp);
801011bd: 89 1c 24 mov %ebx,(%esp)
801011c0: e8 5b 1b 00 00 call 80102d20 <log_write>
brelse(bp);
801011c5: 89 1c 24 mov %ebx,(%esp)
801011c8: e8 f3 ef ff ff call 801001c0 <brelse>
}
}
brelse(bp);
}
panic("balloc: out of blocks");
}
801011cd: 83 c4 2c add $0x2c,%esp
801011d0: 89 f0 mov %esi,%eax
801011d2: 5b pop %ebx
801011d3: 5e pop %esi
801011d4: 5f pop %edi
801011d5: 5d pop %ebp
801011d6: c3 ret
801011d7: 89 f6 mov %esi,%esi
801011d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801011e0 <iget>:
// Find the inode with number inum on device dev
// and return the in-memory copy. Does not lock
// the inode and does not read it from disk.
static struct inode*
iget(uint dev, uint inum)
{
801011e0: 55 push %ebp
801011e1: 89 e5 mov %esp,%ebp
801011e3: 57 push %edi
801011e4: 89 c7 mov %eax,%edi
801011e6: 56 push %esi
struct inode *ip, *empty;
acquire(&icache.lock);
// Is the inode already cached?
empty = 0;
801011e7: 31 f6 xor %esi,%esi
// Find the inode with number inum on device dev
// and return the in-memory copy. Does not lock
// the inode and does not read it from disk.
static struct inode*
iget(uint dev, uint inum)
{
801011e9: 53 push %ebx
acquire(&icache.lock);
// Is the inode already cached?
empty = 0;
for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
801011ea: bb f4 11 11 80 mov $0x801111f4,%ebx
// Find the inode with number inum on device dev
// and return the in-memory copy. Does not lock
// the inode and does not read it from disk.
static struct inode*
iget(uint dev, uint inum)
{
801011ef: 83 ec 1c sub $0x1c,%esp
struct inode *ip, *empty;
acquire(&icache.lock);
801011f2: c7 04 24 c0 11 11 80 movl $0x801111c0,(%esp)
// Find the inode with number inum on device dev
// and return the in-memory copy. Does not lock
// the inode and does not read it from disk.
static struct inode*
iget(uint dev, uint inum)
{
801011f9: 89 55 e4 mov %edx,-0x1c(%ebp)
struct inode *ip, *empty;
acquire(&icache.lock);
801011fc: e8 bf 36 00 00 call 801048c0 <acquire>
// Is the inode already cached?
empty = 0;
for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
80101201: 8b 55 e4 mov -0x1c(%ebp),%edx
80101204: eb 11 jmp 80101217 <iget+0x37>
80101206: 66 90 xchg %ax,%ax
if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){
ip->ref++;
release(&icache.lock);
return ip;
}
if(empty == 0 && ip->ref == 0) // Remember empty slot.
80101208: 85 f6 test %esi,%esi
8010120a: 74 3c je 80101248 <iget+0x68>
acquire(&icache.lock);
// Is the inode already cached?
empty = 0;
for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
8010120c: 83 c3 50 add $0x50,%ebx
8010120f: 81 fb 94 21 11 80 cmp $0x80112194,%ebx
80101215: 74 41 je 80101258 <iget+0x78>
if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){
80101217: 8b 4b 08 mov 0x8(%ebx),%ecx
8010121a: 85 c9 test %ecx,%ecx
8010121c: 7e ea jle 80101208 <iget+0x28>
8010121e: 39 3b cmp %edi,(%ebx)
80101220: 75 e6 jne 80101208 <iget+0x28>
80101222: 39 53 04 cmp %edx,0x4(%ebx)
80101225: 75 e1 jne 80101208 <iget+0x28>
ip->ref++;
80101227: 83 c1 01 add $0x1,%ecx
release(&icache.lock);
return ip;
8010122a: 89 de mov %ebx,%esi
// Is the inode already cached?
empty = 0;
for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){
ip->ref++;
release(&icache.lock);
8010122c: c7 04 24 c0 11 11 80 movl $0x801111c0,(%esp)
// Is the inode already cached?
empty = 0;
for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){
ip->ref++;
80101233: 89 4b 08 mov %ecx,0x8(%ebx)
release(&icache.lock);
80101236: e8 b5 37 00 00 call 801049f0 <release>
ip->ref = 1;
ip->flags = 0;
release(&icache.lock);
return ip;
}
8010123b: 83 c4 1c add $0x1c,%esp
8010123e: 89 f0 mov %esi,%eax
80101240: 5b pop %ebx
80101241: 5e pop %esi
80101242: 5f pop %edi
80101243: 5d pop %ebp
80101244: c3 ret
80101245: 8d 76 00 lea 0x0(%esi),%esi
80101248: 85 c9 test %ecx,%ecx
8010124a: 0f 44 f3 cmove %ebx,%esi
acquire(&icache.lock);
// Is the inode already cached?
empty = 0;
for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
8010124d: 83 c3 50 add $0x50,%ebx
80101250: 81 fb 94 21 11 80 cmp $0x80112194,%ebx
80101256: 75 bf jne 80101217 <iget+0x37>
if(empty == 0 && ip->ref == 0) // Remember empty slot.
empty = ip;
}
// Recycle an inode cache entry.
if(empty == 0)
80101258: 85 f6 test %esi,%esi
8010125a: 74 29 je 80101285 <iget+0xa5>
panic("iget: no inodes");
ip = empty;
ip->dev = dev;
8010125c: 89 3e mov %edi,(%esi)
ip->inum = inum;
8010125e: 89 56 04 mov %edx,0x4(%esi)
ip->ref = 1;
80101261: c7 46 08 01 00 00 00 movl $0x1,0x8(%esi)
ip->flags = 0;
80101268: c7 46 0c 00 00 00 00 movl $0x0,0xc(%esi)
release(&icache.lock);
8010126f: c7 04 24 c0 11 11 80 movl $0x801111c0,(%esp)
80101276: e8 75 37 00 00 call 801049f0 <release>
return ip;
}
8010127b: 83 c4 1c add $0x1c,%esp
8010127e: 89 f0 mov %esi,%eax
80101280: 5b pop %ebx
80101281: 5e pop %esi
80101282: 5f pop %edi
80101283: 5d pop %ebp
80101284: c3 ret
empty = ip;
}
// Recycle an inode cache entry.
if(empty == 0)
panic("iget: no inodes");
80101285: c7 04 24 0a 77 10 80 movl $0x8010770a,(%esp)
8010128c: e8 9f f0 ff ff call 80100330 <panic>
80101291: eb 0d jmp 801012a0 <bmap>
80101293: 90 nop
80101294: 90 nop
80101295: 90 nop
80101296: 90 nop
80101297: 90 nop
80101298: 90 nop
80101299: 90 nop
8010129a: 90 nop
8010129b: 90 nop
8010129c: 90 nop
8010129d: 90 nop
8010129e: 90 nop
8010129f: 90 nop
801012a0 <bmap>:
// Return the disk block address of the nth block in inode ip.
// If there is no such block, bmap allocates one.
static uint
bmap(struct inode *ip, uint bn)
{
801012a0: 55 push %ebp
801012a1: 89 e5 mov %esp,%ebp
801012a3: 57 push %edi
801012a4: 56 push %esi
801012a5: 53 push %ebx
801012a6: 89 c3 mov %eax,%ebx
801012a8: 83 ec 1c sub $0x1c,%esp
uint addr, *a;
struct buf *bp;
if(bn < NDIRECT){
801012ab: 83 fa 0b cmp $0xb,%edx
801012ae: 77 18 ja 801012c8 <bmap+0x28>
801012b0: 8d 34 90 lea (%eax,%edx,4),%esi
if((addr = ip->addrs[bn]) == 0)
801012b3: 8b 46 1c mov 0x1c(%esi),%eax
801012b6: 85 c0 test %eax,%eax
801012b8: 74 66 je 80101320 <bmap+0x80>
brelse(bp);
return addr;
}
panic("bmap: out of range");
}
801012ba: 83 c4 1c add $0x1c,%esp
801012bd: 5b pop %ebx
801012be: 5e pop %esi
801012bf: 5f pop %edi
801012c0: 5d pop %ebp
801012c1: c3 ret
801012c2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
if(bn < NDIRECT){
if((addr = ip->addrs[bn]) == 0)
ip->addrs[bn] = addr = balloc(ip->dev);
return addr;
}
bn -= NDIRECT;
801012c8: 8d 72 f4 lea -0xc(%edx),%esi
if(bn < NINDIRECT){
801012cb: 83 fe 7f cmp $0x7f,%esi
801012ce: 77 74 ja 80101344 <bmap+0xa4>
// Load indirect block, allocating if necessary.
if((addr = ip->addrs[NDIRECT]) == 0)
801012d0: 8b 40 4c mov 0x4c(%eax),%eax
801012d3: 85 c0 test %eax,%eax
801012d5: 74 61 je 80101338 <bmap+0x98>
ip->addrs[NDIRECT] = addr = balloc(ip->dev);
bp = bread(ip->dev, addr);
801012d7: 89 44 24 04 mov %eax,0x4(%esp)
801012db: 8b 03 mov (%ebx),%eax
801012dd: 89 04 24 mov %eax,(%esp)
801012e0: e8 db ed ff ff call 801000c0 <bread>
a = (uint*)bp->data;
if((addr = a[bn]) == 0){
801012e5: 8d 54 b0 18 lea 0x18(%eax,%esi,4),%edx
if(bn < NINDIRECT){
// Load indirect block, allocating if necessary.
if((addr = ip->addrs[NDIRECT]) == 0)
ip->addrs[NDIRECT] = addr = balloc(ip->dev);
bp = bread(ip->dev, addr);
801012e9: 89 c7 mov %eax,%edi
a = (uint*)bp->data;
if((addr = a[bn]) == 0){
801012eb: 8b 32 mov (%edx),%esi
801012ed: 85 f6 test %esi,%esi
801012ef: 75 19 jne 8010130a <bmap+0x6a>
a[bn] = addr = balloc(ip->dev);
801012f1: 8b 03 mov (%ebx),%eax
801012f3: 89 55 e4 mov %edx,-0x1c(%ebp)
801012f6: e8 c5 fd ff ff call 801010c0 <balloc>
801012fb: 8b 55 e4 mov -0x1c(%ebp),%edx
801012fe: 89 02 mov %eax,(%edx)
80101300: 89 c6 mov %eax,%esi
log_write(bp);
80101302: 89 3c 24 mov %edi,(%esp)
80101305: e8 16 1a 00 00 call 80102d20 <log_write>
}
brelse(bp);
8010130a: 89 3c 24 mov %edi,(%esp)
8010130d: e8 ae ee ff ff call 801001c0 <brelse>
return addr;
}
panic("bmap: out of range");
}
80101312: 83 c4 1c add $0x1c,%esp
a = (uint*)bp->data;
if((addr = a[bn]) == 0){
a[bn] = addr = balloc(ip->dev);
log_write(bp);
}
brelse(bp);
80101315: 89 f0 mov %esi,%eax
return addr;
}
panic("bmap: out of range");
}
80101317: 5b pop %ebx
80101318: 5e pop %esi
80101319: 5f pop %edi
8010131a: 5d pop %ebp
8010131b: c3 ret
8010131c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
uint addr, *a;
struct buf *bp;
if(bn < NDIRECT){
if((addr = ip->addrs[bn]) == 0)
ip->addrs[bn] = addr = balloc(ip->dev);
80101320: 8b 03 mov (%ebx),%eax
80101322: e8 99 fd ff ff call 801010c0 <balloc>
80101327: 89 46 1c mov %eax,0x1c(%esi)
brelse(bp);
return addr;
}
panic("bmap: out of range");
}
8010132a: 83 c4 1c add $0x1c,%esp
8010132d: 5b pop %ebx
8010132e: 5e pop %esi
8010132f: 5f pop %edi
80101330: 5d pop %ebp
80101331: c3 ret
80101332: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
bn -= NDIRECT;
if(bn < NINDIRECT){
// Load indirect block, allocating if necessary.
if((addr = ip->addrs[NDIRECT]) == 0)
ip->addrs[NDIRECT] = addr = balloc(ip->dev);
80101338: 8b 03 mov (%ebx),%eax
8010133a: e8 81 fd ff ff call 801010c0 <balloc>
8010133f: 89 43 4c mov %eax,0x4c(%ebx)
80101342: eb 93 jmp 801012d7 <bmap+0x37>
}
brelse(bp);
return addr;
}
panic("bmap: out of range");
80101344: c7 04 24 1a 77 10 80 movl $0x8010771a,(%esp)
8010134b: e8 e0 ef ff ff call 80100330 <panic>
80101350 <readsb>:
struct superblock sb;
// Read the super block.
void
readsb(int dev, struct superblock *sb)
{
80101350: 55 push %ebp
80101351: 89 e5 mov %esp,%ebp
80101353: 56 push %esi
80101354: 53 push %ebx
80101355: 83 ec 10 sub $0x10,%esp
struct buf *bp;
bp = bread(dev, 1);
80101358: 8b 45 08 mov 0x8(%ebp),%eax
8010135b: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp)
80101362: 00
struct superblock sb;
// Read the super block.
void
readsb(int dev, struct superblock *sb)
{
80101363: 8b 75 0c mov 0xc(%ebp),%esi
struct buf *bp;
bp = bread(dev, 1);
80101366: 89 04 24 mov %eax,(%esp)
80101369: e8 52 ed ff ff call 801000c0 <bread>
memmove(sb, bp->data, sizeof(*sb));
8010136e: 89 34 24 mov %esi,(%esp)
80101371: c7 44 24 08 1c 00 00 movl $0x1c,0x8(%esp)
80101378: 00
void
readsb(int dev, struct superblock *sb)
{
struct buf *bp;
bp = bread(dev, 1);
80101379: 89 c3 mov %eax,%ebx
memmove(sb, bp->data, sizeof(*sb));
8010137b: 8d 40 18 lea 0x18(%eax),%eax
8010137e: 89 44 24 04 mov %eax,0x4(%esp)
80101382: e8 59 37 00 00 call 80104ae0 <memmove>
brelse(bp);
80101387: 89 5d 08 mov %ebx,0x8(%ebp)
}
8010138a: 83 c4 10 add $0x10,%esp
8010138d: 5b pop %ebx
8010138e: 5e pop %esi
8010138f: 5d pop %ebp
{
struct buf *bp;
bp = bread(dev, 1);
memmove(sb, bp->data, sizeof(*sb));
brelse(bp);
80101390: e9 2b ee ff ff jmp 801001c0 <brelse>
80101395: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101399: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801013a0 <bfree>:
}
// Free a disk block.
static void
bfree(int dev, uint b)
{
801013a0: 55 push %ebp
801013a1: 89 e5 mov %esp,%ebp
801013a3: 57 push %edi
801013a4: 89 d7 mov %edx,%edi
801013a6: 56 push %esi
801013a7: 53 push %ebx
801013a8: 89 c3 mov %eax,%ebx
801013aa: 83 ec 1c sub $0x1c,%esp
struct buf *bp;
int bi, m;
readsb(dev, &sb);
801013ad: 89 04 24 mov %eax,(%esp)
801013b0: c7 44 24 04 a0 11 11 movl $0x801111a0,0x4(%esp)
801013b7: 80
801013b8: e8 93 ff ff ff call 80101350 <readsb>
bp = bread(dev, BBLOCK(b, sb));
801013bd: 89 fa mov %edi,%edx
801013bf: c1 ea 0c shr $0xc,%edx
801013c2: 03 15 b8 11 11 80 add 0x801111b8,%edx
801013c8: 89 1c 24 mov %ebx,(%esp)
bi = b % BPB;
m = 1 << (bi % 8);
801013cb: bb 01 00 00 00 mov $0x1,%ebx
{
struct buf *bp;
int bi, m;
readsb(dev, &sb);
bp = bread(dev, BBLOCK(b, sb));
801013d0: 89 54 24 04 mov %edx,0x4(%esp)
801013d4: e8 e7 ec ff ff call 801000c0 <bread>
bi = b % BPB;
m = 1 << (bi % 8);
801013d9: 89 f9 mov %edi,%ecx
struct buf *bp;
int bi, m;
readsb(dev, &sb);
bp = bread(dev, BBLOCK(b, sb));
bi = b % BPB;
801013db: 81 e7 ff 0f 00 00 and $0xfff,%edi
801013e1: 89 fa mov %edi,%edx
m = 1 << (bi % 8);
801013e3: 83 e1 07 and $0x7,%ecx
if((bp->data[bi/8] & m) == 0)
801013e6: c1 fa 03 sar $0x3,%edx
int bi, m;
readsb(dev, &sb);
bp = bread(dev, BBLOCK(b, sb));
bi = b % BPB;
m = 1 << (bi % 8);
801013e9: d3 e3 shl %cl,%ebx
{
struct buf *bp;
int bi, m;
readsb(dev, &sb);
bp = bread(dev, BBLOCK(b, sb));
801013eb: 89 c6 mov %eax,%esi
bi = b % BPB;
m = 1 << (bi % 8);
if((bp->data[bi/8] & m) == 0)
801013ed: 0f b6 44 10 18 movzbl 0x18(%eax,%edx,1),%eax
801013f2: 0f b6 c8 movzbl %al,%ecx
801013f5: 85 d9 test %ebx,%ecx
801013f7: 74 20 je 80101419 <bfree+0x79>
panic("freeing free block");
bp->data[bi/8] &= ~m;
801013f9: f7 d3 not %ebx
801013fb: 21 c3 and %eax,%ebx
801013fd: 88 5c 16 18 mov %bl,0x18(%esi,%edx,1)
log_write(bp);
80101401: 89 34 24 mov %esi,(%esp)
80101404: e8 17 19 00 00 call 80102d20 <log_write>
brelse(bp);
80101409: 89 34 24 mov %esi,(%esp)
8010140c: e8 af ed ff ff call 801001c0 <brelse>
}
80101411: 83 c4 1c add $0x1c,%esp
80101414: 5b pop %ebx
80101415: 5e pop %esi
80101416: 5f pop %edi
80101417: 5d pop %ebp
80101418: c3 ret
readsb(dev, &sb);
bp = bread(dev, BBLOCK(b, sb));
bi = b % BPB;
m = 1 << (bi % 8);
if((bp->data[bi/8] & m) == 0)
panic("freeing free block");
80101419: c7 04 24 2d 77 10 80 movl $0x8010772d,(%esp)
80101420: e8 0b ef ff ff call 80100330 <panic>
80101425: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101429: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80101430 <iinit>:
struct inode inode[NINODE];
} icache;
void
iinit(int dev)
{
80101430: 55 push %ebp
80101431: 89 e5 mov %esp,%ebp
80101433: 83 ec 28 sub $0x28,%esp
initlock(&icache.lock, "icache");
80101436: c7 44 24 04 40 77 10 movl $0x80107740,0x4(%esp)
8010143d: 80
8010143e: c7 04 24 c0 11 11 80 movl $0x801111c0,(%esp)
80101445: e8 f6 33 00 00 call 80104840 <initlock>
readsb(dev, &sb);
8010144a: 8b 45 08 mov 0x8(%ebp),%eax
8010144d: c7 44 24 04 a0 11 11 movl $0x801111a0,0x4(%esp)
80101454: 80
80101455: 89 04 24 mov %eax,(%esp)
80101458: e8 f3 fe ff ff call 80101350 <readsb>
cprintf("sb: size %d nblocks %d ninodes %d nlog %d logstart %d\
8010145d: a1 b8 11 11 80 mov 0x801111b8,%eax
80101462: c7 04 24 a0 77 10 80 movl $0x801077a0,(%esp)
80101469: 89 44 24 1c mov %eax,0x1c(%esp)
8010146d: a1 b4 11 11 80 mov 0x801111b4,%eax
80101472: 89 44 24 18 mov %eax,0x18(%esp)
80101476: a1 b0 11 11 80 mov 0x801111b0,%eax
8010147b: 89 44 24 14 mov %eax,0x14(%esp)
8010147f: a1 ac 11 11 80 mov 0x801111ac,%eax
80101484: 89 44 24 10 mov %eax,0x10(%esp)
80101488: a1 a8 11 11 80 mov 0x801111a8,%eax
8010148d: 89 44 24 0c mov %eax,0xc(%esp)
80101491: a1 a4 11 11 80 mov 0x801111a4,%eax
80101496: 89 44 24 08 mov %eax,0x8(%esp)
8010149a: a1 a0 11 11 80 mov 0x801111a0,%eax
8010149f: 89 44 24 04 mov %eax,0x4(%esp)
801014a3: e8 78 f1 ff ff call 80100620 <cprintf>
inodestart %d bmap start %d\n", sb.size, sb.nblocks,
sb.ninodes, sb.nlog, sb.logstart, sb.inodestart,
sb.bmapstart);
}
801014a8: c9 leave
801014a9: c3 ret
801014aa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801014b0 <ialloc>:
//PAGEBREAK!
// Allocate a new inode with the given type on device dev.
// A free inode has a type of zero.
struct inode*
ialloc(uint dev, short type)
{
801014b0: 55 push %ebp
801014b1: 89 e5 mov %esp,%ebp
801014b3: 57 push %edi
801014b4: 56 push %esi
801014b5: 53 push %ebx
801014b6: 83 ec 2c sub $0x2c,%esp
801014b9: 8b 45 0c mov 0xc(%ebp),%eax
int inum;
struct buf *bp;
struct dinode *dip;
for(inum = 1; inum < sb.ninodes; inum++){
801014bc: 83 3d a8 11 11 80 01 cmpl $0x1,0x801111a8
//PAGEBREAK!
// Allocate a new inode with the given type on device dev.
// A free inode has a type of zero.
struct inode*
ialloc(uint dev, short type)
{
801014c3: 8b 7d 08 mov 0x8(%ebp),%edi
801014c6: 89 45 e4 mov %eax,-0x1c(%ebp)
int inum;
struct buf *bp;
struct dinode *dip;
for(inum = 1; inum < sb.ninodes; inum++){
801014c9: 0f 86 a2 00 00 00 jbe 80101571 <ialloc+0xc1>
801014cf: be 01 00 00 00 mov $0x1,%esi
801014d4: bb 01 00 00 00 mov $0x1,%ebx
801014d9: eb 1a jmp 801014f5 <ialloc+0x45>
801014db: 90 nop
801014dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
dip->type = type;
log_write(bp); // mark it allocated on the disk
brelse(bp);
return iget(dev, inum);
}
brelse(bp);
801014e0: 89 14 24 mov %edx,(%esp)
{
int inum;
struct buf *bp;
struct dinode *dip;
for(inum = 1; inum < sb.ninodes; inum++){
801014e3: 83 c3 01 add $0x1,%ebx
dip->type = type;
log_write(bp); // mark it allocated on the disk
brelse(bp);
return iget(dev, inum);
}
brelse(bp);
801014e6: e8 d5 ec ff ff call 801001c0 <brelse>
{
int inum;
struct buf *bp;
struct dinode *dip;
for(inum = 1; inum < sb.ninodes; inum++){
801014eb: 89 de mov %ebx,%esi
801014ed: 3b 1d a8 11 11 80 cmp 0x801111a8,%ebx
801014f3: 73 7c jae 80101571 <ialloc+0xc1>
bp = bread(dev, IBLOCK(inum, sb));
801014f5: 89 f0 mov %esi,%eax
801014f7: c1 e8 03 shr $0x3,%eax
801014fa: 03 05 b4 11 11 80 add 0x801111b4,%eax
80101500: 89 3c 24 mov %edi,(%esp)
80101503: 89 44 24 04 mov %eax,0x4(%esp)
80101507: e8 b4 eb ff ff call 801000c0 <bread>
8010150c: 89 c2 mov %eax,%edx
dip = (struct dinode*)bp->data + inum%IPB;
8010150e: 89 f0 mov %esi,%eax
80101510: 83 e0 07 and $0x7,%eax
80101513: c1 e0 06 shl $0x6,%eax
80101516: 8d 4c 02 18 lea 0x18(%edx,%eax,1),%ecx
if(dip->type == 0){ // a free inode
8010151a: 66 83 39 00 cmpw $0x0,(%ecx)
8010151e: 75 c0 jne 801014e0 <ialloc+0x30>
memset(dip, 0, sizeof(*dip));
80101520: 89 0c 24 mov %ecx,(%esp)
80101523: c7 44 24 08 40 00 00 movl $0x40,0x8(%esp)
8010152a: 00
8010152b: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80101532: 00
80101533: 89 55 dc mov %edx,-0x24(%ebp)
80101536: 89 4d e0 mov %ecx,-0x20(%ebp)
80101539: e8 02 35 00 00 call 80104a40 <memset>
dip->type = type;
8010153e: 0f b7 45 e4 movzwl -0x1c(%ebp),%eax
log_write(bp); // mark it allocated on the disk
80101542: 8b 55 dc mov -0x24(%ebp),%edx
for(inum = 1; inum < sb.ninodes; inum++){
bp = bread(dev, IBLOCK(inum, sb));
dip = (struct dinode*)bp->data + inum%IPB;
if(dip->type == 0){ // a free inode
memset(dip, 0, sizeof(*dip));
dip->type = type;
80101545: 8b 4d e0 mov -0x20(%ebp),%ecx
log_write(bp); // mark it allocated on the disk
80101548: 89 55 e4 mov %edx,-0x1c(%ebp)
for(inum = 1; inum < sb.ninodes; inum++){
bp = bread(dev, IBLOCK(inum, sb));
dip = (struct dinode*)bp->data + inum%IPB;
if(dip->type == 0){ // a free inode
memset(dip, 0, sizeof(*dip));
dip->type = type;
8010154b: 66 89 01 mov %ax,(%ecx)
log_write(bp); // mark it allocated on the disk
8010154e: 89 14 24 mov %edx,(%esp)
80101551: e8 ca 17 00 00 call 80102d20 <log_write>
brelse(bp);
80101556: 8b 55 e4 mov -0x1c(%ebp),%edx
80101559: 89 14 24 mov %edx,(%esp)
8010155c: e8 5f ec ff ff call 801001c0 <brelse>
return iget(dev, inum);
}
brelse(bp);
}
panic("ialloc: no inodes");
}
80101561: 83 c4 2c add $0x2c,%esp
if(dip->type == 0){ // a free inode
memset(dip, 0, sizeof(*dip));
dip->type = type;
log_write(bp); // mark it allocated on the disk
brelse(bp);
return iget(dev, inum);
80101564: 89 f2 mov %esi,%edx
}
brelse(bp);
}
panic("ialloc: no inodes");
}
80101566: 5b pop %ebx
if(dip->type == 0){ // a free inode
memset(dip, 0, sizeof(*dip));
dip->type = type;
log_write(bp); // mark it allocated on the disk
brelse(bp);
return iget(dev, inum);
80101567: 89 f8 mov %edi,%eax
}
brelse(bp);
}
panic("ialloc: no inodes");
}
80101569: 5e pop %esi
8010156a: 5f pop %edi
8010156b: 5d pop %ebp
if(dip->type == 0){ // a free inode
memset(dip, 0, sizeof(*dip));
dip->type = type;
log_write(bp); // mark it allocated on the disk
brelse(bp);
return iget(dev, inum);
8010156c: e9 6f fc ff ff jmp 801011e0 <iget>
}
brelse(bp);
}
panic("ialloc: no inodes");
80101571: c7 04 24 47 77 10 80 movl $0x80107747,(%esp)
80101578: e8 b3 ed ff ff call 80100330 <panic>
8010157d: 8d 76 00 lea 0x0(%esi),%esi
80101580 <iupdate>:
}
// Copy a modified in-memory inode to disk.
void
iupdate(struct inode *ip)
{
80101580: 55 push %ebp
80101581: 89 e5 mov %esp,%ebp
80101583: 56 push %esi
80101584: 53 push %ebx
80101585: 83 ec 10 sub $0x10,%esp
80101588: 8b 5d 08 mov 0x8(%ebp),%ebx
struct buf *bp;
struct dinode *dip;
bp = bread(ip->dev, IBLOCK(ip->inum, sb));
8010158b: 8b 43 04 mov 0x4(%ebx),%eax
dip->type = ip->type;
dip->major = ip->major;
dip->minor = ip->minor;
dip->nlink = ip->nlink;
dip->size = ip->size;
memmove(dip->addrs, ip->addrs, sizeof(ip->addrs));
8010158e: 83 c3 1c add $0x1c,%ebx
iupdate(struct inode *ip)
{
struct buf *bp;
struct dinode *dip;
bp = bread(ip->dev, IBLOCK(ip->inum, sb));
80101591: c1 e8 03 shr $0x3,%eax
80101594: 03 05 b4 11 11 80 add 0x801111b4,%eax
8010159a: 89 44 24 04 mov %eax,0x4(%esp)
8010159e: 8b 43 e4 mov -0x1c(%ebx),%eax
801015a1: 89 04 24 mov %eax,(%esp)
801015a4: e8 17 eb ff ff call 801000c0 <bread>
dip = (struct dinode*)bp->data + ip->inum%IPB;
801015a9: 8b 53 e8 mov -0x18(%ebx),%edx
801015ac: 83 e2 07 and $0x7,%edx
801015af: c1 e2 06 shl $0x6,%edx
801015b2: 8d 54 10 18 lea 0x18(%eax,%edx,1),%edx
iupdate(struct inode *ip)
{
struct buf *bp;
struct dinode *dip;
bp = bread(ip->dev, IBLOCK(ip->inum, sb));
801015b6: 89 c6 mov %eax,%esi
dip = (struct dinode*)bp->data + ip->inum%IPB;
dip->type = ip->type;
801015b8: 0f b7 43 f4 movzwl -0xc(%ebx),%eax
dip->major = ip->major;
dip->minor = ip->minor;
dip->nlink = ip->nlink;
dip->size = ip->size;
memmove(dip->addrs, ip->addrs, sizeof(ip->addrs));
801015bc: 83 c2 0c add $0xc,%edx
struct buf *bp;
struct dinode *dip;
bp = bread(ip->dev, IBLOCK(ip->inum, sb));
dip = (struct dinode*)bp->data + ip->inum%IPB;
dip->type = ip->type;
801015bf: 66 89 42 f4 mov %ax,-0xc(%edx)
dip->major = ip->major;
801015c3: 0f b7 43 f6 movzwl -0xa(%ebx),%eax
801015c7: 66 89 42 f6 mov %ax,-0xa(%edx)
dip->minor = ip->minor;
801015cb: 0f b7 43 f8 movzwl -0x8(%ebx),%eax
801015cf: 66 89 42 f8 mov %ax,-0x8(%edx)
dip->nlink = ip->nlink;
801015d3: 0f b7 43 fa movzwl -0x6(%ebx),%eax
801015d7: 66 89 42 fa mov %ax,-0x6(%edx)
dip->size = ip->size;
801015db: 8b 43 fc mov -0x4(%ebx),%eax
801015de: 89 42 fc mov %eax,-0x4(%edx)
memmove(dip->addrs, ip->addrs, sizeof(ip->addrs));
801015e1: 89 5c 24 04 mov %ebx,0x4(%esp)
801015e5: 89 14 24 mov %edx,(%esp)
801015e8: c7 44 24 08 34 00 00 movl $0x34,0x8(%esp)
801015ef: 00
801015f0: e8 eb 34 00 00 call 80104ae0 <memmove>
log_write(bp);
801015f5: 89 34 24 mov %esi,(%esp)
801015f8: e8 23 17 00 00 call 80102d20 <log_write>
brelse(bp);
801015fd: 89 75 08 mov %esi,0x8(%ebp)
}
80101600: 83 c4 10 add $0x10,%esp
80101603: 5b pop %ebx
80101604: 5e pop %esi
80101605: 5d pop %ebp
dip->minor = ip->minor;
dip->nlink = ip->nlink;
dip->size = ip->size;
memmove(dip->addrs, ip->addrs, sizeof(ip->addrs));
log_write(bp);
brelse(bp);
80101606: e9 b5 eb ff ff jmp 801001c0 <brelse>
8010160b: 90 nop
8010160c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101610 <idup>:
// Increment reference count for ip.
// Returns ip to enable ip = idup(ip1) idiom.
struct inode*
idup(struct inode *ip)
{
80101610: 55 push %ebp
80101611: 89 e5 mov %esp,%ebp
80101613: 53 push %ebx
80101614: 83 ec 14 sub $0x14,%esp
80101617: 8b 5d 08 mov 0x8(%ebp),%ebx
acquire(&icache.lock);
8010161a: c7 04 24 c0 11 11 80 movl $0x801111c0,(%esp)
80101621: e8 9a 32 00 00 call 801048c0 <acquire>
ip->ref++;
80101626: 83 43 08 01 addl $0x1,0x8(%ebx)
release(&icache.lock);
8010162a: c7 04 24 c0 11 11 80 movl $0x801111c0,(%esp)
80101631: e8 ba 33 00 00 call 801049f0 <release>
return ip;
}
80101636: 83 c4 14 add $0x14,%esp
80101639: 89 d8 mov %ebx,%eax
8010163b: 5b pop %ebx
8010163c: 5d pop %ebp
8010163d: c3 ret
8010163e: 66 90 xchg %ax,%ax
80101640 <ilock>:
// Lock the given inode.
// Reads the inode from disk if necessary.
void
ilock(struct inode *ip)
{
80101640: 55 push %ebp
80101641: 89 e5 mov %esp,%ebp
80101643: 56 push %esi
80101644: 53 push %ebx
80101645: 83 ec 10 sub $0x10,%esp
80101648: 8b 5d 08 mov 0x8(%ebp),%ebx
struct buf *bp;
struct dinode *dip;
if(ip == 0 || ip->ref < 1)
8010164b: 85 db test %ebx,%ebx
8010164d: 0f 84 ed 00 00 00 je 80101740 <ilock+0x100>
80101653: 8b 43 08 mov 0x8(%ebx),%eax
80101656: 85 c0 test %eax,%eax
80101658: 0f 8e e2 00 00 00 jle 80101740 <ilock+0x100>
panic("ilock");
acquire(&icache.lock);
8010165e: c7 04 24 c0 11 11 80 movl $0x801111c0,(%esp)
80101665: e8 56 32 00 00 call 801048c0 <acquire>
while(ip->flags & I_BUSY)
8010166a: 8b 43 0c mov 0xc(%ebx),%eax
8010166d: a8 01 test $0x1,%al
8010166f: 74 1e je 8010168f <ilock+0x4f>
80101671: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
sleep(ip, &icache.lock);
80101678: c7 44 24 04 c0 11 11 movl $0x801111c0,0x4(%esp)
8010167f: 80
80101680: 89 1c 24 mov %ebx,(%esp)
80101683: e8 d8 26 00 00 call 80103d60 <sleep>
if(ip == 0 || ip->ref < 1)
panic("ilock");
acquire(&icache.lock);
while(ip->flags & I_BUSY)
80101688: 8b 43 0c mov 0xc(%ebx),%eax
8010168b: a8 01 test $0x1,%al
8010168d: 75 e9 jne 80101678 <ilock+0x38>
sleep(ip, &icache.lock);
ip->flags |= I_BUSY;
8010168f: 83 c8 01 or $0x1,%eax
80101692: 89 43 0c mov %eax,0xc(%ebx)
release(&icache.lock);
80101695: c7 04 24 c0 11 11 80 movl $0x801111c0,(%esp)
8010169c: e8 4f 33 00 00 call 801049f0 <release>
if(!(ip->flags & I_VALID)){
801016a1: f6 43 0c 02 testb $0x2,0xc(%ebx)
801016a5: 74 09 je 801016b0 <ilock+0x70>
brelse(bp);
ip->flags |= I_VALID;
if(ip->type == 0)
panic("ilock: no type");
}
}
801016a7: 83 c4 10 add $0x10,%esp
801016aa: 5b pop %ebx
801016ab: 5e pop %esi
801016ac: 5d pop %ebp
801016ad: c3 ret
801016ae: 66 90 xchg %ax,%ax
sleep(ip, &icache.lock);
ip->flags |= I_BUSY;
release(&icache.lock);
if(!(ip->flags & I_VALID)){
bp = bread(ip->dev, IBLOCK(ip->inum, sb));
801016b0: 8b 43 04 mov 0x4(%ebx),%eax
801016b3: c1 e8 03 shr $0x3,%eax
801016b6: 03 05 b4 11 11 80 add 0x801111b4,%eax
801016bc: 89 44 24 04 mov %eax,0x4(%esp)
801016c0: 8b 03 mov (%ebx),%eax
801016c2: 89 04 24 mov %eax,(%esp)
801016c5: e8 f6 e9 ff ff call 801000c0 <bread>
dip = (struct dinode*)bp->data + ip->inum%IPB;
801016ca: 8b 53 04 mov 0x4(%ebx),%edx
801016cd: 83 e2 07 and $0x7,%edx
801016d0: c1 e2 06 shl $0x6,%edx
801016d3: 8d 54 10 18 lea 0x18(%eax,%edx,1),%edx
sleep(ip, &icache.lock);
ip->flags |= I_BUSY;
release(&icache.lock);
if(!(ip->flags & I_VALID)){
bp = bread(ip->dev, IBLOCK(ip->inum, sb));
801016d7: 89 c6 mov %eax,%esi
dip = (struct dinode*)bp->data + ip->inum%IPB;
ip->type = dip->type;
801016d9: 0f b7 02 movzwl (%edx),%eax
ip->major = dip->major;
ip->minor = dip->minor;
ip->nlink = dip->nlink;
ip->size = dip->size;
memmove(ip->addrs, dip->addrs, sizeof(ip->addrs));
801016dc: 83 c2 0c add $0xc,%edx
release(&icache.lock);
if(!(ip->flags & I_VALID)){
bp = bread(ip->dev, IBLOCK(ip->inum, sb));
dip = (struct dinode*)bp->data + ip->inum%IPB;
ip->type = dip->type;
801016df: 66 89 43 10 mov %ax,0x10(%ebx)
ip->major = dip->major;
801016e3: 0f b7 42 f6 movzwl -0xa(%edx),%eax
801016e7: 66 89 43 12 mov %ax,0x12(%ebx)
ip->minor = dip->minor;
801016eb: 0f b7 42 f8 movzwl -0x8(%edx),%eax
801016ef: 66 89 43 14 mov %ax,0x14(%ebx)
ip->nlink = dip->nlink;
801016f3: 0f b7 42 fa movzwl -0x6(%edx),%eax
801016f7: 66 89 43 16 mov %ax,0x16(%ebx)
ip->size = dip->size;
801016fb: 8b 42 fc mov -0x4(%edx),%eax
801016fe: 89 43 18 mov %eax,0x18(%ebx)
memmove(ip->addrs, dip->addrs, sizeof(ip->addrs));
80101701: 8d 43 1c lea 0x1c(%ebx),%eax
80101704: 89 54 24 04 mov %edx,0x4(%esp)
80101708: c7 44 24 08 34 00 00 movl $0x34,0x8(%esp)
8010170f: 00
80101710: 89 04 24 mov %eax,(%esp)
80101713: e8 c8 33 00 00 call 80104ae0 <memmove>
brelse(bp);
80101718: 89 34 24 mov %esi,(%esp)
8010171b: e8 a0 ea ff ff call 801001c0 <brelse>
ip->flags |= I_VALID;
80101720: 83 4b 0c 02 orl $0x2,0xc(%ebx)
if(ip->type == 0)
80101724: 66 83 7b 10 00 cmpw $0x0,0x10(%ebx)
80101729: 0f 85 78 ff ff ff jne 801016a7 <ilock+0x67>
panic("ilock: no type");
8010172f: c7 04 24 5f 77 10 80 movl $0x8010775f,(%esp)
80101736: e8 f5 eb ff ff call 80100330 <panic>
8010173b: 90 nop
8010173c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
{
struct buf *bp;
struct dinode *dip;
if(ip == 0 || ip->ref < 1)
panic("ilock");
80101740: c7 04 24 59 77 10 80 movl $0x80107759,(%esp)
80101747: e8 e4 eb ff ff call 80100330 <panic>
8010174c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101750 <iunlock>:
}
// Unlock the given inode.
void
iunlock(struct inode *ip)
{
80101750: 55 push %ebp
80101751: 89 e5 mov %esp,%ebp
80101753: 53 push %ebx
80101754: 83 ec 14 sub $0x14,%esp
80101757: 8b 5d 08 mov 0x8(%ebp),%ebx
if(ip == 0 || !(ip->flags & I_BUSY) || ip->ref < 1)
8010175a: 85 db test %ebx,%ebx
8010175c: 74 36 je 80101794 <iunlock+0x44>
8010175e: f6 43 0c 01 testb $0x1,0xc(%ebx)
80101762: 74 30 je 80101794 <iunlock+0x44>
80101764: 8b 43 08 mov 0x8(%ebx),%eax
80101767: 85 c0 test %eax,%eax
80101769: 7e 29 jle 80101794 <iunlock+0x44>
panic("iunlock");
acquire(&icache.lock);
8010176b: c7 04 24 c0 11 11 80 movl $0x801111c0,(%esp)
80101772: e8 49 31 00 00 call 801048c0 <acquire>
ip->flags &= ~I_BUSY;
80101777: 83 63 0c fe andl $0xfffffffe,0xc(%ebx)
wakeup(ip);
8010177b: 89 1c 24 mov %ebx,(%esp)
8010177e: e8 0d 28 00 00 call 80103f90 <wakeup>
release(&icache.lock);
80101783: c7 45 08 c0 11 11 80 movl $0x801111c0,0x8(%ebp)
}
8010178a: 83 c4 14 add $0x14,%esp
8010178d: 5b pop %ebx
8010178e: 5d pop %ebp
panic("iunlock");
acquire(&icache.lock);
ip->flags &= ~I_BUSY;
wakeup(ip);
release(&icache.lock);
8010178f: e9 5c 32 00 00 jmp 801049f0 <release>
// Unlock the given inode.
void
iunlock(struct inode *ip)
{
if(ip == 0 || !(ip->flags & I_BUSY) || ip->ref < 1)
panic("iunlock");
80101794: c7 04 24 6e 77 10 80 movl $0x8010776e,(%esp)
8010179b: e8 90 eb ff ff call 80100330 <panic>
801017a0 <iput>:
// to it, free the inode (and its content) on disk.
// All calls to iput() must be inside a transaction in
// case it has to free the inode.
void
iput(struct inode *ip)
{
801017a0: 55 push %ebp
801017a1: 89 e5 mov %esp,%ebp
801017a3: 57 push %edi
801017a4: 56 push %esi
801017a5: 53 push %ebx
801017a6: 83 ec 1c sub $0x1c,%esp
801017a9: 8b 75 08 mov 0x8(%ebp),%esi
acquire(&icache.lock);
801017ac: c7 04 24 c0 11 11 80 movl $0x801111c0,(%esp)
801017b3: e8 08 31 00 00 call 801048c0 <acquire>
if(ip->ref == 1 && (ip->flags & I_VALID) && ip->nlink == 0){
801017b8: 8b 46 08 mov 0x8(%esi),%eax
801017bb: 83 f8 01 cmp $0x1,%eax
801017be: 0f 85 a1 00 00 00 jne 80101865 <iput+0xc5>
801017c4: 8b 56 0c mov 0xc(%esi),%edx
801017c7: f6 c2 02 test $0x2,%dl
801017ca: 0f 84 95 00 00 00 je 80101865 <iput+0xc5>
801017d0: 66 83 7e 16 00 cmpw $0x0,0x16(%esi)
801017d5: 0f 85 8a 00 00 00 jne 80101865 <iput+0xc5>
// inode has no links and no other references: truncate and free.
if(ip->flags & I_BUSY)
801017db: f6 c2 01 test $0x1,%dl
801017de: 0f 85 fa 00 00 00 jne 801018de <iput+0x13e>
panic("iput busy");
ip->flags |= I_BUSY;
801017e4: 83 ca 01 or $0x1,%edx
801017e7: 89 f3 mov %esi,%ebx
801017e9: 89 56 0c mov %edx,0xc(%esi)
801017ec: 8d 7e 30 lea 0x30(%esi),%edi
release(&icache.lock);
801017ef: c7 04 24 c0 11 11 80 movl $0x801111c0,(%esp)
801017f6: e8 f5 31 00 00 call 801049f0 <release>
801017fb: eb 0a jmp 80101807 <iput+0x67>
801017fd: 8d 76 00 lea 0x0(%esi),%esi
80101800: 83 c3 04 add $0x4,%ebx
{
int i, j;
struct buf *bp;
uint *a;
for(i = 0; i < NDIRECT; i++){
80101803: 39 fb cmp %edi,%ebx
80101805: 74 1c je 80101823 <iput+0x83>
if(ip->addrs[i]){
80101807: 8b 53 1c mov 0x1c(%ebx),%edx
8010180a: 85 d2 test %edx,%edx
8010180c: 74 f2 je 80101800 <iput+0x60>
bfree(ip->dev, ip->addrs[i]);
8010180e: 8b 06 mov (%esi),%eax
80101810: 83 c3 04 add $0x4,%ebx
80101813: e8 88 fb ff ff call 801013a0 <bfree>
ip->addrs[i] = 0;
80101818: c7 43 18 00 00 00 00 movl $0x0,0x18(%ebx)
{
int i, j;
struct buf *bp;
uint *a;
for(i = 0; i < NDIRECT; i++){
8010181f: 39 fb cmp %edi,%ebx
80101821: 75 e4 jne 80101807 <iput+0x67>
bfree(ip->dev, ip->addrs[i]);
ip->addrs[i] = 0;
}
}
if(ip->addrs[NDIRECT]){
80101823: 8b 46 4c mov 0x4c(%esi),%eax
80101826: 85 c0 test %eax,%eax
80101828: 75 56 jne 80101880 <iput+0xe0>
brelse(bp);
bfree(ip->dev, ip->addrs[NDIRECT]);
ip->addrs[NDIRECT] = 0;
}
ip->size = 0;
8010182a: c7 46 18 00 00 00 00 movl $0x0,0x18(%esi)
iupdate(ip);
80101831: 89 34 24 mov %esi,(%esp)
80101834: e8 47 fd ff ff call 80101580 <iupdate>
if(ip->flags & I_BUSY)
panic("iput busy");
ip->flags |= I_BUSY;
release(&icache.lock);
itrunc(ip);
ip->type = 0;
80101839: 31 c0 xor %eax,%eax
8010183b: 66 89 46 10 mov %ax,0x10(%esi)
iupdate(ip);
8010183f: 89 34 24 mov %esi,(%esp)
80101842: e8 39 fd ff ff call 80101580 <iupdate>
acquire(&icache.lock);
80101847: c7 04 24 c0 11 11 80 movl $0x801111c0,(%esp)
8010184e: e8 6d 30 00 00 call 801048c0 <acquire>
ip->flags = 0;
80101853: c7 46 0c 00 00 00 00 movl $0x0,0xc(%esi)
wakeup(ip);
8010185a: 89 34 24 mov %esi,(%esp)
8010185d: e8 2e 27 00 00 call 80103f90 <wakeup>
80101862: 8b 46 08 mov 0x8(%esi),%eax
}
ip->ref--;
80101865: 83 e8 01 sub $0x1,%eax
80101868: 89 46 08 mov %eax,0x8(%esi)
release(&icache.lock);
8010186b: c7 45 08 c0 11 11 80 movl $0x801111c0,0x8(%ebp)
}
80101872: 83 c4 1c add $0x1c,%esp
80101875: 5b pop %ebx
80101876: 5e pop %esi
80101877: 5f pop %edi
80101878: 5d pop %ebp
acquire(&icache.lock);
ip->flags = 0;
wakeup(ip);
}
ip->ref--;
release(&icache.lock);
80101879: e9 72 31 00 00 jmp 801049f0 <release>
8010187e: 66 90 xchg %ax,%ax
ip->addrs[i] = 0;
}
}
if(ip->addrs[NDIRECT]){
bp = bread(ip->dev, ip->addrs[NDIRECT]);
80101880: 89 44 24 04 mov %eax,0x4(%esp)
80101884: 8b 06 mov (%esi),%eax
a = (uint*)bp->data;
for(j = 0; j < NINDIRECT; j++){
80101886: 31 db xor %ebx,%ebx
ip->addrs[i] = 0;
}
}
if(ip->addrs[NDIRECT]){
bp = bread(ip->dev, ip->addrs[NDIRECT]);
80101888: 89 04 24 mov %eax,(%esp)
8010188b: e8 30 e8 ff ff call 801000c0 <bread>
80101890: 89 45 e4 mov %eax,-0x1c(%ebp)
a = (uint*)bp->data;
80101893: 8d 78 18 lea 0x18(%eax),%edi
for(j = 0; j < NINDIRECT; j++){
80101896: 31 c0 xor %eax,%eax
80101898: eb 13 jmp 801018ad <iput+0x10d>
8010189a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801018a0: 83 c3 01 add $0x1,%ebx
801018a3: 81 fb 80 00 00 00 cmp $0x80,%ebx
801018a9: 89 d8 mov %ebx,%eax
801018ab: 74 10 je 801018bd <iput+0x11d>
if(a[j])
801018ad: 8b 14 87 mov (%edi,%eax,4),%edx
801018b0: 85 d2 test %edx,%edx
801018b2: 74 ec je 801018a0 <iput+0x100>
bfree(ip->dev, a[j]);
801018b4: 8b 06 mov (%esi),%eax
801018b6: e8 e5 fa ff ff call 801013a0 <bfree>
801018bb: eb e3 jmp 801018a0 <iput+0x100>
}
brelse(bp);
801018bd: 8b 45 e4 mov -0x1c(%ebp),%eax
801018c0: 89 04 24 mov %eax,(%esp)
801018c3: e8 f8 e8 ff ff call 801001c0 <brelse>
bfree(ip->dev, ip->addrs[NDIRECT]);
801018c8: 8b 56 4c mov 0x4c(%esi),%edx
801018cb: 8b 06 mov (%esi),%eax
801018cd: e8 ce fa ff ff call 801013a0 <bfree>
ip->addrs[NDIRECT] = 0;
801018d2: c7 46 4c 00 00 00 00 movl $0x0,0x4c(%esi)
801018d9: e9 4c ff ff ff jmp 8010182a <iput+0x8a>
{
acquire(&icache.lock);
if(ip->ref == 1 && (ip->flags & I_VALID) && ip->nlink == 0){
// inode has no links and no other references: truncate and free.
if(ip->flags & I_BUSY)
panic("iput busy");
801018de: c7 04 24 76 77 10 80 movl $0x80107776,(%esp)
801018e5: e8 46 ea ff ff call 80100330 <panic>
801018ea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801018f0 <iunlockput>:
}
// Common idiom: unlock, then put.
void
iunlockput(struct inode *ip)
{
801018f0: 55 push %ebp
801018f1: 89 e5 mov %esp,%ebp
801018f3: 53 push %ebx
801018f4: 83 ec 14 sub $0x14,%esp
801018f7: 8b 5d 08 mov 0x8(%ebp),%ebx
iunlock(ip);
801018fa: 89 1c 24 mov %ebx,(%esp)
801018fd: e8 4e fe ff ff call 80101750 <iunlock>
iput(ip);
80101902: 89 5d 08 mov %ebx,0x8(%ebp)
}
80101905: 83 c4 14 add $0x14,%esp
80101908: 5b pop %ebx
80101909: 5d pop %ebp
// Common idiom: unlock, then put.
void
iunlockput(struct inode *ip)
{
iunlock(ip);
iput(ip);
8010190a: e9 91 fe ff ff jmp 801017a0 <iput>
8010190f: 90 nop
80101910 <stati>:
}
// Copy stat information from inode.
void
stati(struct inode *ip, struct stat *st)
{
80101910: 55 push %ebp
80101911: 89 e5 mov %esp,%ebp
80101913: 8b 55 08 mov 0x8(%ebp),%edx
80101916: 8b 45 0c mov 0xc(%ebp),%eax
st->dev = ip->dev;
80101919: 8b 0a mov (%edx),%ecx
8010191b: 89 48 04 mov %ecx,0x4(%eax)
st->ino = ip->inum;
8010191e: 8b 4a 04 mov 0x4(%edx),%ecx
80101921: 89 48 08 mov %ecx,0x8(%eax)
st->type = ip->type;
80101924: 0f b7 4a 10 movzwl 0x10(%edx),%ecx
80101928: 66 89 08 mov %cx,(%eax)
st->nlink = ip->nlink;
8010192b: 0f b7 4a 16 movzwl 0x16(%edx),%ecx
8010192f: 66 89 48 0c mov %cx,0xc(%eax)
st->size = ip->size;
80101933: 8b 52 18 mov 0x18(%edx),%edx
80101936: 89 50 10 mov %edx,0x10(%eax)
}
80101939: 5d pop %ebp
8010193a: c3 ret
8010193b: 90 nop
8010193c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101940 <readi>:
//PAGEBREAK!
// Read data from inode.
int
readi(struct inode *ip, char *dst, uint off, uint n)
{
80101940: 55 push %ebp
80101941: 89 e5 mov %esp,%ebp
80101943: 57 push %edi
80101944: 56 push %esi
80101945: 53 push %ebx
80101946: 83 ec 2c sub $0x2c,%esp
80101949: 8b 45 0c mov 0xc(%ebp),%eax
8010194c: 8b 7d 08 mov 0x8(%ebp),%edi
8010194f: 8b 75 10 mov 0x10(%ebp),%esi
80101952: 89 45 e0 mov %eax,-0x20(%ebp)
80101955: 8b 45 14 mov 0x14(%ebp),%eax
uint tot, m;
struct buf *bp;
if(ip->type == T_DEV){
80101958: 66 83 7f 10 03 cmpw $0x3,0x10(%edi)
//PAGEBREAK!
// Read data from inode.
int
readi(struct inode *ip, char *dst, uint off, uint n)
{
8010195d: 89 45 e4 mov %eax,-0x1c(%ebp)
uint tot, m;
struct buf *bp;
if(ip->type == T_DEV){
80101960: 0f 84 aa 00 00 00 je 80101a10 <readi+0xd0>
if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read)
return -1;
return devsw[ip->major].read(ip, dst, n);
}
if(off > ip->size || off + n < off)
80101966: 8b 47 18 mov 0x18(%edi),%eax
80101969: 39 f0 cmp %esi,%eax
8010196b: 0f 82 c7 00 00 00 jb 80101a38 <readi+0xf8>
80101971: 8b 5d e4 mov -0x1c(%ebp),%ebx
80101974: 89 da mov %ebx,%edx
80101976: 01 f2 add %esi,%edx
80101978: 0f 82 ba 00 00 00 jb 80101a38 <readi+0xf8>
return -1;
if(off + n > ip->size)
n = ip->size - off;
8010197e: 89 c1 mov %eax,%ecx
80101980: 29 f1 sub %esi,%ecx
80101982: 39 d0 cmp %edx,%eax
80101984: 0f 43 cb cmovae %ebx,%ecx
for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
80101987: 31 c0 xor %eax,%eax
80101989: 85 c9 test %ecx,%ecx
}
if(off > ip->size || off + n < off)
return -1;
if(off + n > ip->size)
n = ip->size - off;
8010198b: 89 4d e4 mov %ecx,-0x1c(%ebp)
for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
8010198e: 74 70 je 80101a00 <readi+0xc0>
80101990: 89 7d d8 mov %edi,-0x28(%ebp)
80101993: 89 c7 mov %eax,%edi
80101995: 8d 76 00 lea 0x0(%esi),%esi
bp = bread(ip->dev, bmap(ip, off/BSIZE));
80101998: 8b 5d d8 mov -0x28(%ebp),%ebx
8010199b: 89 f2 mov %esi,%edx
8010199d: c1 ea 09 shr $0x9,%edx
801019a0: 89 d8 mov %ebx,%eax
801019a2: e8 f9 f8 ff ff call 801012a0 <bmap>
801019a7: 89 44 24 04 mov %eax,0x4(%esp)
801019ab: 8b 03 mov (%ebx),%eax
m = min(n - tot, BSIZE - off%BSIZE);
801019ad: bb 00 02 00 00 mov $0x200,%ebx
return -1;
if(off + n > ip->size)
n = ip->size - off;
for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
bp = bread(ip->dev, bmap(ip, off/BSIZE));
801019b2: 89 04 24 mov %eax,(%esp)
801019b5: e8 06 e7 ff ff call 801000c0 <bread>
m = min(n - tot, BSIZE - off%BSIZE);
801019ba: 8b 4d e4 mov -0x1c(%ebp),%ecx
801019bd: 29 f9 sub %edi,%ecx
return -1;
if(off + n > ip->size)
n = ip->size - off;
for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
bp = bread(ip->dev, bmap(ip, off/BSIZE));
801019bf: 89 c2 mov %eax,%edx
m = min(n - tot, BSIZE - off%BSIZE);
801019c1: 89 f0 mov %esi,%eax
801019c3: 25 ff 01 00 00 and $0x1ff,%eax
801019c8: 29 c3 sub %eax,%ebx
memmove(dst, bp->data + off%BSIZE, m);
801019ca: 8d 44 02 18 lea 0x18(%edx,%eax,1),%eax
if(off + n > ip->size)
n = ip->size - off;
for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
bp = bread(ip->dev, bmap(ip, off/BSIZE));
m = min(n - tot, BSIZE - off%BSIZE);
801019ce: 39 cb cmp %ecx,%ebx
memmove(dst, bp->data + off%BSIZE, m);
801019d0: 89 44 24 04 mov %eax,0x4(%esp)
801019d4: 8b 45 e0 mov -0x20(%ebp),%eax
if(off + n > ip->size)
n = ip->size - off;
for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
bp = bread(ip->dev, bmap(ip, off/BSIZE));
m = min(n - tot, BSIZE - off%BSIZE);
801019d7: 0f 47 d9 cmova %ecx,%ebx
memmove(dst, bp->data + off%BSIZE, m);
801019da: 89 5c 24 08 mov %ebx,0x8(%esp)
if(off > ip->size || off + n < off)
return -1;
if(off + n > ip->size)
n = ip->size - off;
for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
801019de: 01 df add %ebx,%edi
801019e0: 01 de add %ebx,%esi
bp = bread(ip->dev, bmap(ip, off/BSIZE));
m = min(n - tot, BSIZE - off%BSIZE);
memmove(dst, bp->data + off%BSIZE, m);
801019e2: 89 55 dc mov %edx,-0x24(%ebp)
801019e5: 89 04 24 mov %eax,(%esp)
801019e8: e8 f3 30 00 00 call 80104ae0 <memmove>
brelse(bp);
801019ed: 8b 55 dc mov -0x24(%ebp),%edx
801019f0: 89 14 24 mov %edx,(%esp)
801019f3: e8 c8 e7 ff ff call 801001c0 <brelse>
if(off > ip->size || off + n < off)
return -1;
if(off + n > ip->size)
n = ip->size - off;
for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
801019f8: 01 5d e0 add %ebx,-0x20(%ebp)
801019fb: 39 7d e4 cmp %edi,-0x1c(%ebp)
801019fe: 77 98 ja 80101998 <readi+0x58>
bp = bread(ip->dev, bmap(ip, off/BSIZE));
m = min(n - tot, BSIZE - off%BSIZE);
memmove(dst, bp->data + off%BSIZE, m);
brelse(bp);
}
return n;
80101a00: 8b 45 e4 mov -0x1c(%ebp),%eax
}
80101a03: 83 c4 2c add $0x2c,%esp
80101a06: 5b pop %ebx
80101a07: 5e pop %esi
80101a08: 5f pop %edi
80101a09: 5d pop %ebp
80101a0a: c3 ret
80101a0b: 90 nop
80101a0c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
{
uint tot, m;
struct buf *bp;
if(ip->type == T_DEV){
if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read)
80101a10: 0f bf 47 12 movswl 0x12(%edi),%eax
80101a14: 66 83 f8 09 cmp $0x9,%ax
80101a18: 77 1e ja 80101a38 <readi+0xf8>
80101a1a: 8b 04 c5 40 11 11 80 mov -0x7feeeec0(,%eax,8),%eax
80101a21: 85 c0 test %eax,%eax
80101a23: 74 13 je 80101a38 <readi+0xf8>
return -1;
return devsw[ip->major].read(ip, dst, n);
80101a25: 8b 75 e4 mov -0x1c(%ebp),%esi
80101a28: 89 75 10 mov %esi,0x10(%ebp)
m = min(n - tot, BSIZE - off%BSIZE);
memmove(dst, bp->data + off%BSIZE, m);
brelse(bp);
}
return n;
}
80101a2b: 83 c4 2c add $0x2c,%esp
80101a2e: 5b pop %ebx
80101a2f: 5e pop %esi
80101a30: 5f pop %edi
80101a31: 5d pop %ebp
struct buf *bp;
if(ip->type == T_DEV){
if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read)
return -1;
return devsw[ip->major].read(ip, dst, n);
80101a32: ff e0 jmp *%eax
80101a34: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
uint tot, m;
struct buf *bp;
if(ip->type == T_DEV){
if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read)
return -1;
80101a38: b8 ff ff ff ff mov $0xffffffff,%eax
80101a3d: eb c4 jmp 80101a03 <readi+0xc3>
80101a3f: 90 nop
80101a40 <writei>:
// PAGEBREAK!
// Write data to inode.
int
writei(struct inode *ip, char *src, uint off, uint n)
{
80101a40: 55 push %ebp
80101a41: 89 e5 mov %esp,%ebp
80101a43: 57 push %edi
80101a44: 56 push %esi
80101a45: 53 push %ebx
80101a46: 83 ec 2c sub $0x2c,%esp
80101a49: 8b 45 08 mov 0x8(%ebp),%eax
80101a4c: 8b 75 0c mov 0xc(%ebp),%esi
80101a4f: 8b 4d 14 mov 0x14(%ebp),%ecx
uint tot, m;
struct buf *bp;
if(ip->type == T_DEV){
80101a52: 66 83 78 10 03 cmpw $0x3,0x10(%eax)
// PAGEBREAK!
// Write data to inode.
int
writei(struct inode *ip, char *src, uint off, uint n)
{
80101a57: 89 75 dc mov %esi,-0x24(%ebp)
80101a5a: 8b 75 10 mov 0x10(%ebp),%esi
80101a5d: 89 45 d8 mov %eax,-0x28(%ebp)
80101a60: 89 4d e0 mov %ecx,-0x20(%ebp)
uint tot, m;
struct buf *bp;
if(ip->type == T_DEV){
80101a63: 0f 84 b7 00 00 00 je 80101b20 <writei+0xe0>
if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write)
return -1;
return devsw[ip->major].write(ip, src, n);
}
if(off > ip->size || off + n < off)
80101a69: 8b 45 d8 mov -0x28(%ebp),%eax
80101a6c: 39 70 18 cmp %esi,0x18(%eax)
80101a6f: 0f 82 e3 00 00 00 jb 80101b58 <writei+0x118>
80101a75: 8b 4d e0 mov -0x20(%ebp),%ecx
80101a78: 89 c8 mov %ecx,%eax
80101a7a: 01 f0 add %esi,%eax
80101a7c: 0f 82 d6 00 00 00 jb 80101b58 <writei+0x118>
return -1;
if(off + n > MAXFILE*BSIZE)
80101a82: 3d 00 18 01 00 cmp $0x11800,%eax
80101a87: 0f 87 cb 00 00 00 ja 80101b58 <writei+0x118>
return -1;
for(tot=0; tot<n; tot+=m, off+=m, src+=m){
80101a8d: 85 c9 test %ecx,%ecx
80101a8f: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp)
80101a96: 74 77 je 80101b0f <writei+0xcf>
bp = bread(ip->dev, bmap(ip, off/BSIZE));
80101a98: 8b 7d d8 mov -0x28(%ebp),%edi
80101a9b: 89 f2 mov %esi,%edx
m = min(n - tot, BSIZE - off%BSIZE);
80101a9d: bb 00 02 00 00 mov $0x200,%ebx
return -1;
if(off + n > MAXFILE*BSIZE)
return -1;
for(tot=0; tot<n; tot+=m, off+=m, src+=m){
bp = bread(ip->dev, bmap(ip, off/BSIZE));
80101aa2: c1 ea 09 shr $0x9,%edx
80101aa5: 89 f8 mov %edi,%eax
80101aa7: e8 f4 f7 ff ff call 801012a0 <bmap>
80101aac: 89 44 24 04 mov %eax,0x4(%esp)
80101ab0: 8b 07 mov (%edi),%eax
80101ab2: 89 04 24 mov %eax,(%esp)
80101ab5: e8 06 e6 ff ff call 801000c0 <bread>
m = min(n - tot, BSIZE - off%BSIZE);
80101aba: 8b 4d e0 mov -0x20(%ebp),%ecx
80101abd: 2b 4d e4 sub -0x1c(%ebp),%ecx
memmove(bp->data + off%BSIZE, src, m);
80101ac0: 8b 55 dc mov -0x24(%ebp),%edx
return -1;
if(off + n > MAXFILE*BSIZE)
return -1;
for(tot=0; tot<n; tot+=m, off+=m, src+=m){
bp = bread(ip->dev, bmap(ip, off/BSIZE));
80101ac3: 89 c7 mov %eax,%edi
m = min(n - tot, BSIZE - off%BSIZE);
80101ac5: 89 f0 mov %esi,%eax
80101ac7: 25 ff 01 00 00 and $0x1ff,%eax
80101acc: 29 c3 sub %eax,%ebx
80101ace: 39 cb cmp %ecx,%ebx
80101ad0: 0f 47 d9 cmova %ecx,%ebx
memmove(bp->data + off%BSIZE, src, m);
80101ad3: 8d 44 07 18 lea 0x18(%edi,%eax,1),%eax
if(off > ip->size || off + n < off)
return -1;
if(off + n > MAXFILE*BSIZE)
return -1;
for(tot=0; tot<n; tot+=m, off+=m, src+=m){
80101ad7: 01 de add %ebx,%esi
bp = bread(ip->dev, bmap(ip, off/BSIZE));
m = min(n - tot, BSIZE - off%BSIZE);
memmove(bp->data + off%BSIZE, src, m);
80101ad9: 89 54 24 04 mov %edx,0x4(%esp)
80101add: 89 5c 24 08 mov %ebx,0x8(%esp)
80101ae1: 89 04 24 mov %eax,(%esp)
80101ae4: e8 f7 2f 00 00 call 80104ae0 <memmove>
log_write(bp);
80101ae9: 89 3c 24 mov %edi,(%esp)
80101aec: e8 2f 12 00 00 call 80102d20 <log_write>
brelse(bp);
80101af1: 89 3c 24 mov %edi,(%esp)
80101af4: e8 c7 e6 ff ff call 801001c0 <brelse>
if(off > ip->size || off + n < off)
return -1;
if(off + n > MAXFILE*BSIZE)
return -1;
for(tot=0; tot<n; tot+=m, off+=m, src+=m){
80101af9: 01 5d e4 add %ebx,-0x1c(%ebp)
80101afc: 8b 45 e4 mov -0x1c(%ebp),%eax
80101aff: 01 5d dc add %ebx,-0x24(%ebp)
80101b02: 39 45 e0 cmp %eax,-0x20(%ebp)
80101b05: 77 91 ja 80101a98 <writei+0x58>
memmove(bp->data + off%BSIZE, src, m);
log_write(bp);
brelse(bp);
}
if(n > 0 && off > ip->size){
80101b07: 8b 45 d8 mov -0x28(%ebp),%eax
80101b0a: 39 70 18 cmp %esi,0x18(%eax)
80101b0d: 72 39 jb 80101b48 <writei+0x108>
ip->size = off;
iupdate(ip);
}
return n;
80101b0f: 8b 45 e0 mov -0x20(%ebp),%eax
}
80101b12: 83 c4 2c add $0x2c,%esp
80101b15: 5b pop %ebx
80101b16: 5e pop %esi
80101b17: 5f pop %edi
80101b18: 5d pop %ebp
80101b19: c3 ret
80101b1a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
{
uint tot, m;
struct buf *bp;
if(ip->type == T_DEV){
if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write)
80101b20: 0f bf 40 12 movswl 0x12(%eax),%eax
80101b24: 66 83 f8 09 cmp $0x9,%ax
80101b28: 77 2e ja 80101b58 <writei+0x118>
80101b2a: 8b 04 c5 44 11 11 80 mov -0x7feeeebc(,%eax,8),%eax
80101b31: 85 c0 test %eax,%eax
80101b33: 74 23 je 80101b58 <writei+0x118>
return -1;
return devsw[ip->major].write(ip, src, n);
80101b35: 89 4d 10 mov %ecx,0x10(%ebp)
if(n > 0 && off > ip->size){
ip->size = off;
iupdate(ip);
}
return n;
}
80101b38: 83 c4 2c add $0x2c,%esp
80101b3b: 5b pop %ebx
80101b3c: 5e pop %esi
80101b3d: 5f pop %edi
80101b3e: 5d pop %ebp
struct buf *bp;
if(ip->type == T_DEV){
if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write)
return -1;
return devsw[ip->major].write(ip, src, n);
80101b3f: ff e0 jmp *%eax
80101b41: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
log_write(bp);
brelse(bp);
}
if(n > 0 && off > ip->size){
ip->size = off;
80101b48: 8b 45 d8 mov -0x28(%ebp),%eax
80101b4b: 89 70 18 mov %esi,0x18(%eax)
iupdate(ip);
80101b4e: 89 04 24 mov %eax,(%esp)
80101b51: e8 2a fa ff ff call 80101580 <iupdate>
80101b56: eb b7 jmp 80101b0f <writei+0xcf>
}
return n;
}
80101b58: 83 c4 2c add $0x2c,%esp
uint tot, m;
struct buf *bp;
if(ip->type == T_DEV){
if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write)
return -1;
80101b5b: b8 ff ff ff ff mov $0xffffffff,%eax
if(n > 0 && off > ip->size){
ip->size = off;
iupdate(ip);
}
return n;
}
80101b60: 5b pop %ebx
80101b61: 5e pop %esi
80101b62: 5f pop %edi
80101b63: 5d pop %ebp
80101b64: c3 ret
80101b65: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101b69: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80101b70 <namecmp>:
//PAGEBREAK!
// Directories
int
namecmp(const char *s, const char *t)
{
80101b70: 55 push %ebp
80101b71: 89 e5 mov %esp,%ebp
80101b73: 83 ec 18 sub $0x18,%esp
return strncmp(s, t, DIRSIZ);
80101b76: 8b 45 0c mov 0xc(%ebp),%eax
80101b79: c7 44 24 08 0e 00 00 movl $0xe,0x8(%esp)
80101b80: 00
80101b81: 89 44 24 04 mov %eax,0x4(%esp)
80101b85: 8b 45 08 mov 0x8(%ebp),%eax
80101b88: 89 04 24 mov %eax,(%esp)
80101b8b: e8 d0 2f 00 00 call 80104b60 <strncmp>
}
80101b90: c9 leave
80101b91: c3 ret
80101b92: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80101b99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80101ba0 <dirlookup>:
// Look for a directory entry in a directory.
// If found, set *poff to byte offset of entry.
struct inode*
dirlookup(struct inode *dp, char *name, uint *poff)
{
80101ba0: 55 push %ebp
80101ba1: 89 e5 mov %esp,%ebp
80101ba3: 57 push %edi
80101ba4: 56 push %esi
80101ba5: 53 push %ebx
80101ba6: 83 ec 2c sub $0x2c,%esp
80101ba9: 8b 5d 08 mov 0x8(%ebp),%ebx
uint off, inum;
struct dirent de;
if(dp->type != T_DIR)
80101bac: 66 83 7b 10 01 cmpw $0x1,0x10(%ebx)
80101bb1: 0f 85 97 00 00 00 jne 80101c4e <dirlookup+0xae>
panic("dirlookup not DIR");
for(off = 0; off < dp->size; off += sizeof(de)){
80101bb7: 8b 53 18 mov 0x18(%ebx),%edx
80101bba: 31 ff xor %edi,%edi
80101bbc: 8d 75 d8 lea -0x28(%ebp),%esi
80101bbf: 85 d2 test %edx,%edx
80101bc1: 75 0d jne 80101bd0 <dirlookup+0x30>
80101bc3: eb 73 jmp 80101c38 <dirlookup+0x98>
80101bc5: 8d 76 00 lea 0x0(%esi),%esi
80101bc8: 83 c7 10 add $0x10,%edi
80101bcb: 39 7b 18 cmp %edi,0x18(%ebx)
80101bce: 76 68 jbe 80101c38 <dirlookup+0x98>
if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80101bd0: c7 44 24 0c 10 00 00 movl $0x10,0xc(%esp)
80101bd7: 00
80101bd8: 89 7c 24 08 mov %edi,0x8(%esp)
80101bdc: 89 74 24 04 mov %esi,0x4(%esp)
80101be0: 89 1c 24 mov %ebx,(%esp)
80101be3: e8 58 fd ff ff call 80101940 <readi>
80101be8: 83 f8 10 cmp $0x10,%eax
80101beb: 75 55 jne 80101c42 <dirlookup+0xa2>
panic("dirlink read");
if(de.inum == 0)
80101bed: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp)
80101bf2: 74 d4 je 80101bc8 <dirlookup+0x28>
// Directories
int
namecmp(const char *s, const char *t)
{
return strncmp(s, t, DIRSIZ);
80101bf4: 8d 45 da lea -0x26(%ebp),%eax
80101bf7: 89 44 24 04 mov %eax,0x4(%esp)
80101bfb: 8b 45 0c mov 0xc(%ebp),%eax
80101bfe: c7 44 24 08 0e 00 00 movl $0xe,0x8(%esp)
80101c05: 00
80101c06: 89 04 24 mov %eax,(%esp)
80101c09: e8 52 2f 00 00 call 80104b60 <strncmp>
for(off = 0; off < dp->size; off += sizeof(de)){
if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
panic("dirlink read");
if(de.inum == 0)
continue;
if(namecmp(name, de.name) == 0){
80101c0e: 85 c0 test %eax,%eax
80101c10: 75 b6 jne 80101bc8 <dirlookup+0x28>
// entry matches path element
if(poff)
80101c12: 8b 45 10 mov 0x10(%ebp),%eax
80101c15: 85 c0 test %eax,%eax
80101c17: 74 05 je 80101c1e <dirlookup+0x7e>
*poff = off;
80101c19: 8b 45 10 mov 0x10(%ebp),%eax
80101c1c: 89 38 mov %edi,(%eax)
inum = de.inum;
80101c1e: 0f b7 55 d8 movzwl -0x28(%ebp),%edx
return iget(dp->dev, inum);
80101c22: 8b 03 mov (%ebx),%eax
80101c24: e8 b7 f5 ff ff call 801011e0 <iget>
}
}
return 0;
}
80101c29: 83 c4 2c add $0x2c,%esp
80101c2c: 5b pop %ebx
80101c2d: 5e pop %esi
80101c2e: 5f pop %edi
80101c2f: 5d pop %ebp
80101c30: c3 ret
80101c31: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80101c38: 83 c4 2c add $0x2c,%esp
inum = de.inum;
return iget(dp->dev, inum);
}
}
return 0;
80101c3b: 31 c0 xor %eax,%eax
}
80101c3d: 5b pop %ebx
80101c3e: 5e pop %esi
80101c3f: 5f pop %edi
80101c40: 5d pop %ebp
80101c41: c3 ret
if(dp->type != T_DIR)
panic("dirlookup not DIR");
for(off = 0; off < dp->size; off += sizeof(de)){
if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
panic("dirlink read");
80101c42: c7 04 24 92 77 10 80 movl $0x80107792,(%esp)
80101c49: e8 e2 e6 ff ff call 80100330 <panic>
{
uint off, inum;
struct dirent de;
if(dp->type != T_DIR)
panic("dirlookup not DIR");
80101c4e: c7 04 24 80 77 10 80 movl $0x80107780,(%esp)
80101c55: e8 d6 e6 ff ff call 80100330 <panic>
80101c5a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80101c60 <namex>:
// If parent != 0, return the inode for the parent and copy the final
// path element into name, which must have room for DIRSIZ bytes.
// Must be called inside a transaction since it calls iput().
static struct inode*
namex(char *path, int nameiparent, char *name)
{
80101c60: 55 push %ebp
80101c61: 89 e5 mov %esp,%ebp
80101c63: 57 push %edi
80101c64: 89 cf mov %ecx,%edi
80101c66: 56 push %esi
80101c67: 53 push %ebx
80101c68: 89 c3 mov %eax,%ebx
80101c6a: 83 ec 2c sub $0x2c,%esp
struct inode *ip, *next;
if(*path == '/')
80101c6d: 80 38 2f cmpb $0x2f,(%eax)
// If parent != 0, return the inode for the parent and copy the final
// path element into name, which must have room for DIRSIZ bytes.
// Must be called inside a transaction since it calls iput().
static struct inode*
namex(char *path, int nameiparent, char *name)
{
80101c70: 89 55 e0 mov %edx,-0x20(%ebp)
struct inode *ip, *next;
if(*path == '/')
80101c73: 0f 84 51 01 00 00 je 80101dca <namex+0x16a>
ip = iget(ROOTDEV, ROOTINO);
else
ip = idup(proc->cwd);
80101c79: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80101c7f: 8b 70 5c mov 0x5c(%eax),%esi
// Increment reference count for ip.
// Returns ip to enable ip = idup(ip1) idiom.
struct inode*
idup(struct inode *ip)
{
acquire(&icache.lock);
80101c82: c7 04 24 c0 11 11 80 movl $0x801111c0,(%esp)
80101c89: e8 32 2c 00 00 call 801048c0 <acquire>
ip->ref++;
80101c8e: 83 46 08 01 addl $0x1,0x8(%esi)
release(&icache.lock);
80101c92: c7 04 24 c0 11 11 80 movl $0x801111c0,(%esp)
80101c99: e8 52 2d 00 00 call 801049f0 <release>
80101c9e: eb 03 jmp 80101ca3 <namex+0x43>
{
char *s;
int len;
while(*path == '/')
path++;
80101ca0: 83 c3 01 add $0x1,%ebx
skipelem(char *path, char *name)
{
char *s;
int len;
while(*path == '/')
80101ca3: 0f b6 03 movzbl (%ebx),%eax
80101ca6: 3c 2f cmp $0x2f,%al
80101ca8: 74 f6 je 80101ca0 <namex+0x40>
path++;
if(*path == 0)
80101caa: 84 c0 test %al,%al
80101cac: 0f 84 ed 00 00 00 je 80101d9f <namex+0x13f>
return 0;
s = path;
while(*path != '/' && *path != 0)
80101cb2: 0f b6 03 movzbl (%ebx),%eax
80101cb5: 89 da mov %ebx,%edx
80101cb7: 84 c0 test %al,%al
80101cb9: 0f 84 b1 00 00 00 je 80101d70 <namex+0x110>
80101cbf: 3c 2f cmp $0x2f,%al
80101cc1: 75 0f jne 80101cd2 <namex+0x72>
80101cc3: e9 a8 00 00 00 jmp 80101d70 <namex+0x110>
80101cc8: 3c 2f cmp $0x2f,%al
80101cca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80101cd0: 74 0a je 80101cdc <namex+0x7c>
path++;
80101cd2: 83 c2 01 add $0x1,%edx
while(*path == '/')
path++;
if(*path == 0)
return 0;
s = path;
while(*path != '/' && *path != 0)
80101cd5: 0f b6 02 movzbl (%edx),%eax
80101cd8: 84 c0 test %al,%al
80101cda: 75 ec jne 80101cc8 <namex+0x68>
80101cdc: 89 d1 mov %edx,%ecx
80101cde: 29 d9 sub %ebx,%ecx
path++;
len = path - s;
if(len >= DIRSIZ)
80101ce0: 83 f9 0d cmp $0xd,%ecx
80101ce3: 0f 8e 8f 00 00 00 jle 80101d78 <namex+0x118>
memmove(name, s, DIRSIZ);
80101ce9: 89 5c 24 04 mov %ebx,0x4(%esp)
80101ced: c7 44 24 08 0e 00 00 movl $0xe,0x8(%esp)
80101cf4: 00
80101cf5: 89 3c 24 mov %edi,(%esp)
80101cf8: 89 55 e4 mov %edx,-0x1c(%ebp)
80101cfb: e8 e0 2d 00 00 call 80104ae0 <memmove>
path++;
if(*path == 0)
return 0;
s = path;
while(*path != '/' && *path != 0)
path++;
80101d00: 8b 55 e4 mov -0x1c(%ebp),%edx
80101d03: 89 d3 mov %edx,%ebx
memmove(name, s, DIRSIZ);
else {
memmove(name, s, len);
name[len] = 0;
}
while(*path == '/')
80101d05: 80 3a 2f cmpb $0x2f,(%edx)
80101d08: 75 0e jne 80101d18 <namex+0xb8>
80101d0a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
path++;
80101d10: 83 c3 01 add $0x1,%ebx
memmove(name, s, DIRSIZ);
else {
memmove(name, s, len);
name[len] = 0;
}
while(*path == '/')
80101d13: 80 3b 2f cmpb $0x2f,(%ebx)
80101d16: 74 f8 je 80101d10 <namex+0xb0>
ip = iget(ROOTDEV, ROOTINO);
else
ip = idup(proc->cwd);
while((path = skipelem(path, name)) != 0){
ilock(ip);
80101d18: 89 34 24 mov %esi,(%esp)
80101d1b: e8 20 f9 ff ff call 80101640 <ilock>
if(ip->type != T_DIR){
80101d20: 66 83 7e 10 01 cmpw $0x1,0x10(%esi)
80101d25: 0f 85 85 00 00 00 jne 80101db0 <namex+0x150>
iunlockput(ip);
return 0;
}
if(nameiparent && *path == '\0'){
80101d2b: 8b 55 e0 mov -0x20(%ebp),%edx
80101d2e: 85 d2 test %edx,%edx
80101d30: 74 09 je 80101d3b <namex+0xdb>
80101d32: 80 3b 00 cmpb $0x0,(%ebx)
80101d35: 0f 84 a5 00 00 00 je 80101de0 <namex+0x180>
// Stop one level early.
iunlock(ip);
return ip;
}
if((next = dirlookup(ip, name, 0)) == 0){
80101d3b: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
80101d42: 00
80101d43: 89 7c 24 04 mov %edi,0x4(%esp)
80101d47: 89 34 24 mov %esi,(%esp)
80101d4a: e8 51 fe ff ff call 80101ba0 <dirlookup>
80101d4f: 85 c0 test %eax,%eax
80101d51: 74 5d je 80101db0 <namex+0x150>
// Common idiom: unlock, then put.
void
iunlockput(struct inode *ip)
{
iunlock(ip);
80101d53: 89 34 24 mov %esi,(%esp)
80101d56: 89 45 e4 mov %eax,-0x1c(%ebp)
80101d59: e8 f2 f9 ff ff call 80101750 <iunlock>
iput(ip);
80101d5e: 89 34 24 mov %esi,(%esp)
80101d61: e8 3a fa ff ff call 801017a0 <iput>
if((next = dirlookup(ip, name, 0)) == 0){
iunlockput(ip);
return 0;
}
iunlockput(ip);
ip = next;
80101d66: 8b 45 e4 mov -0x1c(%ebp),%eax
80101d69: 89 c6 mov %eax,%esi
80101d6b: e9 33 ff ff ff jmp 80101ca3 <namex+0x43>
while(*path == '/')
path++;
if(*path == 0)
return 0;
s = path;
while(*path != '/' && *path != 0)
80101d70: 31 c9 xor %ecx,%ecx
80101d72: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
path++;
len = path - s;
if(len >= DIRSIZ)
memmove(name, s, DIRSIZ);
else {
memmove(name, s, len);
80101d78: 89 4c 24 08 mov %ecx,0x8(%esp)
80101d7c: 89 5c 24 04 mov %ebx,0x4(%esp)
80101d80: 89 3c 24 mov %edi,(%esp)
80101d83: 89 55 dc mov %edx,-0x24(%ebp)
80101d86: 89 4d e4 mov %ecx,-0x1c(%ebp)
80101d89: e8 52 2d 00 00 call 80104ae0 <memmove>
name[len] = 0;
80101d8e: 8b 4d e4 mov -0x1c(%ebp),%ecx
80101d91: 8b 55 dc mov -0x24(%ebp),%edx
80101d94: c6 04 0f 00 movb $0x0,(%edi,%ecx,1)
80101d98: 89 d3 mov %edx,%ebx
80101d9a: e9 66 ff ff ff jmp 80101d05 <namex+0xa5>
return 0;
}
iunlockput(ip);
ip = next;
}
if(nameiparent){
80101d9f: 8b 45 e0 mov -0x20(%ebp),%eax
80101da2: 85 c0 test %eax,%eax
80101da4: 75 4c jne 80101df2 <namex+0x192>
80101da6: 89 f0 mov %esi,%eax
iput(ip);
return 0;
}
return ip;
}
80101da8: 83 c4 2c add $0x2c,%esp
80101dab: 5b pop %ebx
80101dac: 5e pop %esi
80101dad: 5f pop %edi
80101dae: 5d pop %ebp
80101daf: c3 ret
// Common idiom: unlock, then put.
void
iunlockput(struct inode *ip)
{
iunlock(ip);
80101db0: 89 34 24 mov %esi,(%esp)
80101db3: e8 98 f9 ff ff call 80101750 <iunlock>
iput(ip);
80101db8: 89 34 24 mov %esi,(%esp)
80101dbb: e8 e0 f9 ff ff call 801017a0 <iput>
if(nameiparent){
iput(ip);
return 0;
}
return ip;
}
80101dc0: 83 c4 2c add $0x2c,%esp
iunlock(ip);
return ip;
}
if((next = dirlookup(ip, name, 0)) == 0){
iunlockput(ip);
return 0;
80101dc3: 31 c0 xor %eax,%eax
if(nameiparent){
iput(ip);
return 0;
}
return ip;
}
80101dc5: 5b pop %ebx
80101dc6: 5e pop %esi
80101dc7: 5f pop %edi
80101dc8: 5d pop %ebp
80101dc9: c3 ret
namex(char *path, int nameiparent, char *name)
{
struct inode *ip, *next;
if(*path == '/')
ip = iget(ROOTDEV, ROOTINO);
80101dca: ba 01 00 00 00 mov $0x1,%edx
80101dcf: b8 01 00 00 00 mov $0x1,%eax
80101dd4: e8 07 f4 ff ff call 801011e0 <iget>
80101dd9: 89 c6 mov %eax,%esi
80101ddb: e9 c3 fe ff ff jmp 80101ca3 <namex+0x43>
iunlockput(ip);
return 0;
}
if(nameiparent && *path == '\0'){
// Stop one level early.
iunlock(ip);
80101de0: 89 34 24 mov %esi,(%esp)
80101de3: e8 68 f9 ff ff call 80101750 <iunlock>
if(nameiparent){
iput(ip);
return 0;
}
return ip;
}
80101de8: 83 c4 2c add $0x2c,%esp
return 0;
}
if(nameiparent && *path == '\0'){
// Stop one level early.
iunlock(ip);
return ip;
80101deb: 89 f0 mov %esi,%eax
if(nameiparent){
iput(ip);
return 0;
}
return ip;
}
80101ded: 5b pop %ebx
80101dee: 5e pop %esi
80101def: 5f pop %edi
80101df0: 5d pop %ebp
80101df1: c3 ret
}
iunlockput(ip);
ip = next;
}
if(nameiparent){
iput(ip);
80101df2: 89 34 24 mov %esi,(%esp)
80101df5: e8 a6 f9 ff ff call 801017a0 <iput>
return 0;
80101dfa: 31 c0 xor %eax,%eax
80101dfc: eb aa jmp 80101da8 <namex+0x148>
80101dfe: 66 90 xchg %ax,%ax
80101e00 <dirlink>:
}
// Write a new directory entry (name, inum) into the directory dp.
int
dirlink(struct inode *dp, char *name, uint inum)
{
80101e00: 55 push %ebp
80101e01: 89 e5 mov %esp,%ebp
80101e03: 57 push %edi
80101e04: 56 push %esi
80101e05: 53 push %ebx
80101e06: 83 ec 2c sub $0x2c,%esp
80101e09: 8b 5d 08 mov 0x8(%ebp),%ebx
int off;
struct dirent de;
struct inode *ip;
// Check that name is not present.
if((ip = dirlookup(dp, name, 0)) != 0){
80101e0c: 8b 45 0c mov 0xc(%ebp),%eax
80101e0f: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
80101e16: 00
80101e17: 89 1c 24 mov %ebx,(%esp)
80101e1a: 89 44 24 04 mov %eax,0x4(%esp)
80101e1e: e8 7d fd ff ff call 80101ba0 <dirlookup>
80101e23: 85 c0 test %eax,%eax
80101e25: 0f 85 8b 00 00 00 jne 80101eb6 <dirlink+0xb6>
iput(ip);
return -1;
}
// Look for an empty dirent.
for(off = 0; off < dp->size; off += sizeof(de)){
80101e2b: 8b 43 18 mov 0x18(%ebx),%eax
80101e2e: 31 ff xor %edi,%edi
80101e30: 8d 75 d8 lea -0x28(%ebp),%esi
80101e33: 85 c0 test %eax,%eax
80101e35: 75 13 jne 80101e4a <dirlink+0x4a>
80101e37: eb 35 jmp 80101e6e <dirlink+0x6e>
80101e39: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80101e40: 8d 57 10 lea 0x10(%edi),%edx
80101e43: 39 53 18 cmp %edx,0x18(%ebx)
80101e46: 89 d7 mov %edx,%edi
80101e48: 76 24 jbe 80101e6e <dirlink+0x6e>
if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80101e4a: c7 44 24 0c 10 00 00 movl $0x10,0xc(%esp)
80101e51: 00
80101e52: 89 7c 24 08 mov %edi,0x8(%esp)
80101e56: 89 74 24 04 mov %esi,0x4(%esp)
80101e5a: 89 1c 24 mov %ebx,(%esp)
80101e5d: e8 de fa ff ff call 80101940 <readi>
80101e62: 83 f8 10 cmp $0x10,%eax
80101e65: 75 5e jne 80101ec5 <dirlink+0xc5>
panic("dirlink read");
if(de.inum == 0)
80101e67: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp)
80101e6c: 75 d2 jne 80101e40 <dirlink+0x40>
break;
}
strncpy(de.name, name, DIRSIZ);
80101e6e: 8b 45 0c mov 0xc(%ebp),%eax
80101e71: c7 44 24 08 0e 00 00 movl $0xe,0x8(%esp)
80101e78: 00
80101e79: 89 44 24 04 mov %eax,0x4(%esp)
80101e7d: 8d 45 da lea -0x26(%ebp),%eax
80101e80: 89 04 24 mov %eax,(%esp)
80101e83: e8 48 2d 00 00 call 80104bd0 <strncpy>
de.inum = inum;
80101e88: 8b 45 10 mov 0x10(%ebp),%eax
if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80101e8b: c7 44 24 0c 10 00 00 movl $0x10,0xc(%esp)
80101e92: 00
80101e93: 89 7c 24 08 mov %edi,0x8(%esp)
80101e97: 89 74 24 04 mov %esi,0x4(%esp)
80101e9b: 89 1c 24 mov %ebx,(%esp)
if(de.inum == 0)
break;
}
strncpy(de.name, name, DIRSIZ);
de.inum = inum;
80101e9e: 66 89 45 d8 mov %ax,-0x28(%ebp)
if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80101ea2: e8 99 fb ff ff call 80101a40 <writei>
80101ea7: 83 f8 10 cmp $0x10,%eax
80101eaa: 75 25 jne 80101ed1 <dirlink+0xd1>
panic("dirlink");
return 0;
80101eac: 31 c0 xor %eax,%eax
}
80101eae: 83 c4 2c add $0x2c,%esp
80101eb1: 5b pop %ebx
80101eb2: 5e pop %esi
80101eb3: 5f pop %edi
80101eb4: 5d pop %ebp
80101eb5: c3 ret
struct dirent de;
struct inode *ip;
// Check that name is not present.
if((ip = dirlookup(dp, name, 0)) != 0){
iput(ip);
80101eb6: 89 04 24 mov %eax,(%esp)
80101eb9: e8 e2 f8 ff ff call 801017a0 <iput>
return -1;
80101ebe: b8 ff ff ff ff mov $0xffffffff,%eax
80101ec3: eb e9 jmp 80101eae <dirlink+0xae>
}
// Look for an empty dirent.
for(off = 0; off < dp->size; off += sizeof(de)){
if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
panic("dirlink read");
80101ec5: c7 04 24 92 77 10 80 movl $0x80107792,(%esp)
80101ecc: e8 5f e4 ff ff call 80100330 <panic>
}
strncpy(de.name, name, DIRSIZ);
de.inum = inum;
if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
panic("dirlink");
80101ed1: c7 04 24 de 7d 10 80 movl $0x80107dde,(%esp)
80101ed8: e8 53 e4 ff ff call 80100330 <panic>
80101edd: 8d 76 00 lea 0x0(%esi),%esi
80101ee0 <namei>:
return ip;
}
struct inode*
namei(char *path)
{
80101ee0: 55 push %ebp
char name[DIRSIZ];
return namex(path, 0, name);
80101ee1: 31 d2 xor %edx,%edx
return ip;
}
struct inode*
namei(char *path)
{
80101ee3: 89 e5 mov %esp,%ebp
80101ee5: 83 ec 18 sub $0x18,%esp
char name[DIRSIZ];
return namex(path, 0, name);
80101ee8: 8b 45 08 mov 0x8(%ebp),%eax
80101eeb: 8d 4d ea lea -0x16(%ebp),%ecx
80101eee: e8 6d fd ff ff call 80101c60 <namex>
}
80101ef3: c9 leave
80101ef4: c3 ret
80101ef5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101ef9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80101f00 <nameiparent>:
struct inode*
nameiparent(char *path, char *name)
{
80101f00: 55 push %ebp
return namex(path, 1, name);
80101f01: ba 01 00 00 00 mov $0x1,%edx
return namex(path, 0, name);
}
struct inode*
nameiparent(char *path, char *name)
{
80101f06: 89 e5 mov %esp,%ebp
return namex(path, 1, name);
80101f08: 8b 4d 0c mov 0xc(%ebp),%ecx
80101f0b: 8b 45 08 mov 0x8(%ebp),%eax
80101f0e: 5d pop %ebp
}
struct inode*
nameiparent(char *path, char *name)
{
return namex(path, 1, name);
80101f0f: e9 4c fd ff ff jmp 80101c60 <namex>
80101f14: 66 90 xchg %ax,%ax
80101f16: 66 90 xchg %ax,%ax
80101f18: 66 90 xchg %ax,%ax
80101f1a: 66 90 xchg %ax,%ax
80101f1c: 66 90 xchg %ax,%ax
80101f1e: 66 90 xchg %ax,%ax
80101f20 <idestart>:
}
// Start the request for b. Caller must hold idelock.
static void
idestart(struct buf *b)
{
80101f20: 55 push %ebp
80101f21: 89 e5 mov %esp,%ebp
80101f23: 56 push %esi
80101f24: 89 c6 mov %eax,%esi
80101f26: 53 push %ebx
80101f27: 83 ec 10 sub $0x10,%esp
if(b == 0)
80101f2a: 85 c0 test %eax,%eax
80101f2c: 0f 84 99 00 00 00 je 80101fcb <idestart+0xab>
panic("idestart");
if(b->blockno >= FSSIZE)
80101f32: 8b 48 08 mov 0x8(%eax),%ecx
80101f35: 81 f9 e7 03 00 00 cmp $0x3e7,%ecx
80101f3b: 0f 87 7e 00 00 00 ja 80101fbf <idestart+0x9f>
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80101f41: ba f7 01 00 00 mov $0x1f7,%edx
80101f46: 66 90 xchg %ax,%ax
80101f48: ec in (%dx),%al
static int
idewait(int checkerr)
{
int r;
while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY)
80101f49: 83 e0 c0 and $0xffffffc0,%eax
80101f4c: 3c 40 cmp $0x40,%al
80101f4e: 75 f8 jne 80101f48 <idestart+0x28>
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80101f50: 31 db xor %ebx,%ebx
80101f52: ba f6 03 00 00 mov $0x3f6,%edx
80101f57: 89 d8 mov %ebx,%eax
80101f59: ee out %al,(%dx)
80101f5a: ba f2 01 00 00 mov $0x1f2,%edx
80101f5f: b8 01 00 00 00 mov $0x1,%eax
80101f64: ee out %al,(%dx)
80101f65: 0f b6 c1 movzbl %cl,%eax
80101f68: b2 f3 mov $0xf3,%dl
80101f6a: ee out %al,(%dx)
idewait(0);
outb(0x3f6, 0); // generate interrupt
outb(0x1f2, sector_per_block); // number of sectors
outb(0x1f3, sector & 0xff);
outb(0x1f4, (sector >> 8) & 0xff);
80101f6b: 89 c8 mov %ecx,%eax
80101f6d: b2 f4 mov $0xf4,%dl
80101f6f: c1 f8 08 sar $0x8,%eax
80101f72: ee out %al,(%dx)
80101f73: b2 f5 mov $0xf5,%dl
80101f75: 89 d8 mov %ebx,%eax
80101f77: ee out %al,(%dx)
outb(0x1f5, (sector >> 16) & 0xff);
outb(0x1f6, 0xe0 | ((b->dev&1)<<4) | ((sector>>24)&0x0f));
80101f78: 0f b6 46 04 movzbl 0x4(%esi),%eax
80101f7c: b2 f6 mov $0xf6,%dl
80101f7e: 83 e0 01 and $0x1,%eax
80101f81: c1 e0 04 shl $0x4,%eax
80101f84: 83 c8 e0 or $0xffffffe0,%eax
80101f87: ee out %al,(%dx)
if(b->flags & B_DIRTY){
80101f88: f6 06 04 testb $0x4,(%esi)
80101f8b: 75 13 jne 80101fa0 <idestart+0x80>
80101f8d: ba f7 01 00 00 mov $0x1f7,%edx
80101f92: b8 20 00 00 00 mov $0x20,%eax
80101f97: ee out %al,(%dx)
outb(0x1f7, write_cmd);
outsl(0x1f0, b->data, BSIZE/4);
} else {
outb(0x1f7, read_cmd);
}
}
80101f98: 83 c4 10 add $0x10,%esp
80101f9b: 5b pop %ebx
80101f9c: 5e pop %esi
80101f9d: 5d pop %ebp
80101f9e: c3 ret
80101f9f: 90 nop
80101fa0: b2 f7 mov $0xf7,%dl
80101fa2: b8 30 00 00 00 mov $0x30,%eax
80101fa7: ee out %al,(%dx)
}
static inline void
outsl(int port, const void *addr, int cnt)
{
asm volatile("cld; rep outsl" :
80101fa8: b9 80 00 00 00 mov $0x80,%ecx
outb(0x1f4, (sector >> 8) & 0xff);
outb(0x1f5, (sector >> 16) & 0xff);
outb(0x1f6, 0xe0 | ((b->dev&1)<<4) | ((sector>>24)&0x0f));
if(b->flags & B_DIRTY){
outb(0x1f7, write_cmd);
outsl(0x1f0, b->data, BSIZE/4);
80101fad: 83 c6 18 add $0x18,%esi
80101fb0: ba f0 01 00 00 mov $0x1f0,%edx
80101fb5: fc cld
80101fb6: f3 6f rep outsl %ds:(%esi),(%dx)
} else {
outb(0x1f7, read_cmd);
}
}
80101fb8: 83 c4 10 add $0x10,%esp
80101fbb: 5b pop %ebx
80101fbc: 5e pop %esi
80101fbd: 5d pop %ebp
80101fbe: c3 ret
idestart(struct buf *b)
{
if(b == 0)
panic("idestart");
if(b->blockno >= FSSIZE)
panic("incorrect blockno");
80101fbf: c7 04 24 05 78 10 80 movl $0x80107805,(%esp)
80101fc6: e8 65 e3 ff ff call 80100330 <panic>
// Start the request for b. Caller must hold idelock.
static void
idestart(struct buf *b)
{
if(b == 0)
panic("idestart");
80101fcb: c7 04 24 fc 77 10 80 movl $0x801077fc,(%esp)
80101fd2: e8 59 e3 ff ff call 80100330 <panic>
80101fd7: 89 f6 mov %esi,%esi
80101fd9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80101fe0 <ideinit>:
return 0;
}
void
ideinit(void)
{
80101fe0: 55 push %ebp
80101fe1: 89 e5 mov %esp,%ebp
80101fe3: 83 ec 18 sub $0x18,%esp
int i;
initlock(&idelock, "ide");
80101fe6: c7 44 24 04 17 78 10 movl $0x80107817,0x4(%esp)
80101fed: 80
80101fee: c7 04 24 80 b5 10 80 movl $0x8010b580,(%esp)
80101ff5: e8 46 28 00 00 call 80104840 <initlock>
picenable(IRQ_IDE);
80101ffa: c7 04 24 0e 00 00 00 movl $0xe,(%esp)
80102001: e8 ea 11 00 00 call 801031f0 <picenable>
ioapicenable(IRQ_IDE, ncpu - 1);
80102006: a1 e0 28 11 80 mov 0x801128e0,%eax
8010200b: c7 04 24 0e 00 00 00 movl $0xe,(%esp)
80102012: 83 e8 01 sub $0x1,%eax
80102015: 89 44 24 04 mov %eax,0x4(%esp)
80102019: e8 82 02 00 00 call 801022a0 <ioapicenable>
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
8010201e: ba f7 01 00 00 mov $0x1f7,%edx
80102023: 90 nop
80102024: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102028: ec in (%dx),%al
static int
idewait(int checkerr)
{
int r;
while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY)
80102029: 83 e0 c0 and $0xffffffc0,%eax
8010202c: 3c 40 cmp $0x40,%al
8010202e: 75 f8 jne 80102028 <ideinit+0x48>
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102030: ba f6 01 00 00 mov $0x1f6,%edx
80102035: b8 f0 ff ff ff mov $0xfffffff0,%eax
8010203a: ee out %al,(%dx)
8010203b: b9 e8 03 00 00 mov $0x3e8,%ecx
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102040: b2 f7 mov $0xf7,%dl
80102042: eb 09 jmp 8010204d <ideinit+0x6d>
80102044: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
ioapicenable(IRQ_IDE, ncpu - 1);
idewait(0);
// Check if disk 1 is present
outb(0x1f6, 0xe0 | (1<<4));
for(i=0; i<1000; i++){
80102048: 83 e9 01 sub $0x1,%ecx
8010204b: 74 0f je 8010205c <ideinit+0x7c>
8010204d: ec in (%dx),%al
if(inb(0x1f7) != 0){
8010204e: 84 c0 test %al,%al
80102050: 74 f6 je 80102048 <ideinit+0x68>
havedisk1 = 1;
80102052: c7 05 60 b5 10 80 01 movl $0x1,0x8010b560
80102059: 00 00 00
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
8010205c: ba f6 01 00 00 mov $0x1f6,%edx
80102061: b8 e0 ff ff ff mov $0xffffffe0,%eax
80102066: ee out %al,(%dx)
}
}
// Switch back to disk 0.
outb(0x1f6, 0xe0 | (0<<4));
}
80102067: c9 leave
80102068: c3 ret
80102069: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80102070 <ideintr>:
}
// Interrupt handler.
void
ideintr(void)
{
80102070: 55 push %ebp
80102071: 89 e5 mov %esp,%ebp
80102073: 57 push %edi
80102074: 56 push %esi
80102075: 53 push %ebx
80102076: 83 ec 1c sub $0x1c,%esp
struct buf *b;
// First queued buffer is the active request.
acquire(&idelock);
80102079: c7 04 24 80 b5 10 80 movl $0x8010b580,(%esp)
80102080: e8 3b 28 00 00 call 801048c0 <acquire>
if((b = idequeue) == 0){
80102085: 8b 1d 64 b5 10 80 mov 0x8010b564,%ebx
8010208b: 85 db test %ebx,%ebx
8010208d: 74 30 je 801020bf <ideintr+0x4f>
release(&idelock);
// cprintf("spurious IDE interrupt\n");
return;
}
idequeue = b->qnext;
8010208f: 8b 43 14 mov 0x14(%ebx),%eax
80102092: a3 64 b5 10 80 mov %eax,0x8010b564
// Read data if needed.
if(!(b->flags & B_DIRTY) && idewait(1) >= 0)
80102097: 8b 33 mov (%ebx),%esi
80102099: f7 c6 04 00 00 00 test $0x4,%esi
8010209f: 74 37 je 801020d8 <ideintr+0x68>
insl(0x1f0, b->data, BSIZE/4);
// Wake process waiting for this buf.
b->flags |= B_VALID;
b->flags &= ~B_DIRTY;
801020a1: 83 e6 fb and $0xfffffffb,%esi
801020a4: 83 ce 02 or $0x2,%esi
801020a7: 89 33 mov %esi,(%ebx)
wakeup(b);
801020a9: 89 1c 24 mov %ebx,(%esp)
801020ac: e8 df 1e 00 00 call 80103f90 <wakeup>
// Start disk on next buf in queue.
if(idequeue != 0)
801020b1: a1 64 b5 10 80 mov 0x8010b564,%eax
801020b6: 85 c0 test %eax,%eax
801020b8: 74 05 je 801020bf <ideintr+0x4f>
idestart(idequeue);
801020ba: e8 61 fe ff ff call 80101f20 <idestart>
struct buf *b;
// First queued buffer is the active request.
acquire(&idelock);
if((b = idequeue) == 0){
release(&idelock);
801020bf: c7 04 24 80 b5 10 80 movl $0x8010b580,(%esp)
801020c6: e8 25 29 00 00 call 801049f0 <release>
// Start disk on next buf in queue.
if(idequeue != 0)
idestart(idequeue);
release(&idelock);
}
801020cb: 83 c4 1c add $0x1c,%esp
801020ce: 5b pop %ebx
801020cf: 5e pop %esi
801020d0: 5f pop %edi
801020d1: 5d pop %ebp
801020d2: c3 ret
801020d3: 90 nop
801020d4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801020d8: ba f7 01 00 00 mov $0x1f7,%edx
801020dd: 8d 76 00 lea 0x0(%esi),%esi
801020e0: ec in (%dx),%al
static int
idewait(int checkerr)
{
int r;
while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY)
801020e1: 89 c1 mov %eax,%ecx
801020e3: 83 e1 c0 and $0xffffffc0,%ecx
801020e6: 80 f9 40 cmp $0x40,%cl
801020e9: 75 f5 jne 801020e0 <ideintr+0x70>
;
if(checkerr && (r & (IDE_DF|IDE_ERR)) != 0)
801020eb: a8 21 test $0x21,%al
801020ed: 75 b2 jne 801020a1 <ideintr+0x31>
}
idequeue = b->qnext;
// Read data if needed.
if(!(b->flags & B_DIRTY) && idewait(1) >= 0)
insl(0x1f0, b->data, BSIZE/4);
801020ef: 8d 7b 18 lea 0x18(%ebx),%edi
}
static inline void
insl(int port, void *addr, int cnt)
{
asm volatile("cld; rep insl" :
801020f2: b9 80 00 00 00 mov $0x80,%ecx
801020f7: ba f0 01 00 00 mov $0x1f0,%edx
801020fc: fc cld
801020fd: f3 6d rep insl (%dx),%es:(%edi)
801020ff: 8b 33 mov (%ebx),%esi
80102101: eb 9e jmp 801020a1 <ideintr+0x31>
80102103: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80102109: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102110 <iderw>:
// Sync buf with disk.
// If B_DIRTY is set, write buf to disk, clear B_DIRTY, set B_VALID.
// Else if B_VALID is not set, read buf from disk, set B_VALID.
void
iderw(struct buf *b)
{
80102110: 55 push %ebp
80102111: 89 e5 mov %esp,%ebp
80102113: 53 push %ebx
80102114: 83 ec 14 sub $0x14,%esp
80102117: 8b 5d 08 mov 0x8(%ebp),%ebx
struct buf **pp;
if(!(b->flags & B_BUSY))
8010211a: 8b 03 mov (%ebx),%eax
8010211c: a8 01 test $0x1,%al
8010211e: 0f 84 9f 00 00 00 je 801021c3 <iderw+0xb3>
panic("iderw: buf not busy");
if((b->flags & (B_VALID|B_DIRTY)) == B_VALID)
80102124: 83 e0 06 and $0x6,%eax
80102127: 83 f8 02 cmp $0x2,%eax
8010212a: 0f 84 ab 00 00 00 je 801021db <iderw+0xcb>
panic("iderw: nothing to do");
if(b->dev != 0 && !havedisk1)
80102130: 8b 53 04 mov 0x4(%ebx),%edx
80102133: 85 d2 test %edx,%edx
80102135: 74 0d je 80102144 <iderw+0x34>
80102137: a1 60 b5 10 80 mov 0x8010b560,%eax
8010213c: 85 c0 test %eax,%eax
8010213e: 0f 84 8b 00 00 00 je 801021cf <iderw+0xbf>
panic("iderw: ide disk 1 not present");
acquire(&idelock); //DOC:acquire-lock
80102144: c7 04 24 80 b5 10 80 movl $0x8010b580,(%esp)
8010214b: e8 70 27 00 00 call 801048c0 <acquire>
// Append b to idequeue.
b->qnext = 0;
for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue
80102150: a1 64 b5 10 80 mov 0x8010b564,%eax
panic("iderw: ide disk 1 not present");
acquire(&idelock); //DOC:acquire-lock
// Append b to idequeue.
b->qnext = 0;
80102155: c7 43 14 00 00 00 00 movl $0x0,0x14(%ebx)
for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue
8010215c: 85 c0 test %eax,%eax
8010215e: 75 0a jne 8010216a <iderw+0x5a>
80102160: eb 51 jmp 801021b3 <iderw+0xa3>
80102162: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80102168: 89 d0 mov %edx,%eax
8010216a: 8b 50 14 mov 0x14(%eax),%edx
8010216d: 85 d2 test %edx,%edx
8010216f: 75 f7 jne 80102168 <iderw+0x58>
80102171: 83 c0 14 add $0x14,%eax
;
*pp = b;
80102174: 89 18 mov %ebx,(%eax)
// Start disk if necessary.
if(idequeue == b)
80102176: 39 1d 64 b5 10 80 cmp %ebx,0x8010b564
8010217c: 74 3c je 801021ba <iderw+0xaa>
idestart(b);
// Wait for request to finish.
while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){
8010217e: 8b 03 mov (%ebx),%eax
80102180: 83 e0 06 and $0x6,%eax
80102183: 83 f8 02 cmp $0x2,%eax
80102186: 74 1a je 801021a2 <iderw+0x92>
sleep(b, &idelock);
80102188: c7 44 24 04 80 b5 10 movl $0x8010b580,0x4(%esp)
8010218f: 80
80102190: 89 1c 24 mov %ebx,(%esp)
80102193: e8 c8 1b 00 00 call 80103d60 <sleep>
// Start disk if necessary.
if(idequeue == b)
idestart(b);
// Wait for request to finish.
while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){
80102198: 8b 13 mov (%ebx),%edx
8010219a: 83 e2 06 and $0x6,%edx
8010219d: 83 fa 02 cmp $0x2,%edx
801021a0: 75 e6 jne 80102188 <iderw+0x78>
sleep(b, &idelock);
}
release(&idelock);
801021a2: c7 45 08 80 b5 10 80 movl $0x8010b580,0x8(%ebp)
}
801021a9: 83 c4 14 add $0x14,%esp
801021ac: 5b pop %ebx
801021ad: 5d pop %ebp
// Wait for request to finish.
while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){
sleep(b, &idelock);
}
release(&idelock);
801021ae: e9 3d 28 00 00 jmp 801049f0 <release>
acquire(&idelock); //DOC:acquire-lock
// Append b to idequeue.
b->qnext = 0;
for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue
801021b3: b8 64 b5 10 80 mov $0x8010b564,%eax
801021b8: eb ba jmp 80102174 <iderw+0x64>
;
*pp = b;
// Start disk if necessary.
if(idequeue == b)
idestart(b);
801021ba: 89 d8 mov %ebx,%eax
801021bc: e8 5f fd ff ff call 80101f20 <idestart>
801021c1: eb bb jmp 8010217e <iderw+0x6e>
iderw(struct buf *b)
{
struct buf **pp;
if(!(b->flags & B_BUSY))
panic("iderw: buf not busy");
801021c3: c7 04 24 1b 78 10 80 movl $0x8010781b,(%esp)
801021ca: e8 61 e1 ff ff call 80100330 <panic>
if((b->flags & (B_VALID|B_DIRTY)) == B_VALID)
panic("iderw: nothing to do");
if(b->dev != 0 && !havedisk1)
panic("iderw: ide disk 1 not present");
801021cf: c7 04 24 44 78 10 80 movl $0x80107844,(%esp)
801021d6: e8 55 e1 ff ff call 80100330 <panic>
struct buf **pp;
if(!(b->flags & B_BUSY))
panic("iderw: buf not busy");
if((b->flags & (B_VALID|B_DIRTY)) == B_VALID)
panic("iderw: nothing to do");
801021db: c7 04 24 2f 78 10 80 movl $0x8010782f,(%esp)
801021e2: e8 49 e1 ff ff call 80100330 <panic>
801021e7: 66 90 xchg %ax,%ax
801021e9: 66 90 xchg %ax,%ax
801021eb: 66 90 xchg %ax,%ax
801021ed: 66 90 xchg %ax,%ax
801021ef: 90 nop
801021f0 <ioapicinit>:
void
ioapicinit(void)
{
int i, id, maxintr;
if(!ismp)
801021f0: a1 c4 22 11 80 mov 0x801122c4,%eax
801021f5: 85 c0 test %eax,%eax
801021f7: 0f 84 9b 00 00 00 je 80102298 <ioapicinit+0xa8>
ioapic->data = data;
}
void
ioapicinit(void)
{
801021fd: 55 push %ebp
801021fe: 89 e5 mov %esp,%ebp
80102200: 56 push %esi
80102201: 53 push %ebx
80102202: 83 ec 10 sub $0x10,%esp
int i, id, maxintr;
if(!ismp)
return;
ioapic = (volatile struct ioapic*)IOAPIC;
80102205: c7 05 94 21 11 80 00 movl $0xfec00000,0x80112194
8010220c: 00 c0 fe
};
static uint
ioapicread(int reg)
{
ioapic->reg = reg;
8010220f: c7 05 00 00 c0 fe 01 movl $0x1,0xfec00000
80102216: 00 00 00
return ioapic->data;
80102219: 8b 15 94 21 11 80 mov 0x80112194,%edx
8010221f: 8b 42 10 mov 0x10(%edx),%eax
};
static uint
ioapicread(int reg)
{
ioapic->reg = reg;
80102222: c7 02 00 00 00 00 movl $0x0,(%edx)
return ioapic->data;
80102228: 8b 1d 94 21 11 80 mov 0x80112194,%ebx
return;
ioapic = (volatile struct ioapic*)IOAPIC;
maxintr = (ioapicread(REG_VER) >> 16) & 0xFF;
id = ioapicread(REG_ID) >> 24;
if(id != ioapicid)
8010222e: 0f b6 15 c0 22 11 80 movzbl 0x801122c0,%edx
if(!ismp)
return;
ioapic = (volatile struct ioapic*)IOAPIC;
maxintr = (ioapicread(REG_VER) >> 16) & 0xFF;
80102235: c1 e8 10 shr $0x10,%eax
80102238: 0f b6 f0 movzbl %al,%esi
static uint
ioapicread(int reg)
{
ioapic->reg = reg;
return ioapic->data;
8010223b: 8b 43 10 mov 0x10(%ebx),%eax
if(!ismp)
return;
ioapic = (volatile struct ioapic*)IOAPIC;
maxintr = (ioapicread(REG_VER) >> 16) & 0xFF;
id = ioapicread(REG_ID) >> 24;
8010223e: c1 e8 18 shr $0x18,%eax
if(id != ioapicid)
80102241: 39 c2 cmp %eax,%edx
80102243: 74 12 je 80102257 <ioapicinit+0x67>
cprintf("ioapicinit: id isn't equal to ioapicid; not a MP\n");
80102245: c7 04 24 64 78 10 80 movl $0x80107864,(%esp)
8010224c: e8 cf e3 ff ff call 80100620 <cprintf>
80102251: 8b 1d 94 21 11 80 mov 0x80112194,%ebx
80102257: ba 10 00 00 00 mov $0x10,%edx
8010225c: 31 c0 xor %eax,%eax
8010225e: eb 02 jmp 80102262 <ioapicinit+0x72>
80102260: 89 cb mov %ecx,%ebx
}
static void
ioapicwrite(int reg, uint data)
{
ioapic->reg = reg;
80102262: 89 13 mov %edx,(%ebx)
ioapic->data = data;
80102264: 8b 1d 94 21 11 80 mov 0x80112194,%ebx
8010226a: 8d 48 20 lea 0x20(%eax),%ecx
cprintf("ioapicinit: id isn't equal to ioapicid; not a MP\n");
// Mark all interrupts edge-triggered, active high, disabled,
// and not routed to any CPUs.
for(i = 0; i <= maxintr; i++){
ioapicwrite(REG_TABLE+2*i, INT_DISABLED | (T_IRQ0 + i));
8010226d: 81 c9 00 00 01 00 or $0x10000,%ecx
if(id != ioapicid)
cprintf("ioapicinit: id isn't equal to ioapicid; not a MP\n");
// Mark all interrupts edge-triggered, active high, disabled,
// and not routed to any CPUs.
for(i = 0; i <= maxintr; i++){
80102273: 83 c0 01 add $0x1,%eax
static void
ioapicwrite(int reg, uint data)
{
ioapic->reg = reg;
ioapic->data = data;
80102276: 89 4b 10 mov %ecx,0x10(%ebx)
80102279: 8d 4a 01 lea 0x1(%edx),%ecx
8010227c: 83 c2 02 add $0x2,%edx
}
static void
ioapicwrite(int reg, uint data)
{
ioapic->reg = reg;
8010227f: 89 0b mov %ecx,(%ebx)
ioapic->data = data;
80102281: 8b 0d 94 21 11 80 mov 0x80112194,%ecx
if(id != ioapicid)
cprintf("ioapicinit: id isn't equal to ioapicid; not a MP\n");
// Mark all interrupts edge-triggered, active high, disabled,
// and not routed to any CPUs.
for(i = 0; i <= maxintr; i++){
80102287: 39 c6 cmp %eax,%esi
static void
ioapicwrite(int reg, uint data)
{
ioapic->reg = reg;
ioapic->data = data;
80102289: c7 41 10 00 00 00 00 movl $0x0,0x10(%ecx)
if(id != ioapicid)
cprintf("ioapicinit: id isn't equal to ioapicid; not a MP\n");
// Mark all interrupts edge-triggered, active high, disabled,
// and not routed to any CPUs.
for(i = 0; i <= maxintr; i++){
80102290: 7d ce jge 80102260 <ioapicinit+0x70>
ioapicwrite(REG_TABLE+2*i, INT_DISABLED | (T_IRQ0 + i));
ioapicwrite(REG_TABLE+2*i+1, 0);
}
}
80102292: 83 c4 10 add $0x10,%esp
80102295: 5b pop %ebx
80102296: 5e pop %esi
80102297: 5d pop %ebp
80102298: f3 c3 repz ret
8010229a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801022a0 <ioapicenable>:
void
ioapicenable(int irq, int cpunum)
{
if(!ismp)
801022a0: 8b 15 c4 22 11 80 mov 0x801122c4,%edx
}
}
void
ioapicenable(int irq, int cpunum)
{
801022a6: 55 push %ebp
801022a7: 89 e5 mov %esp,%ebp
801022a9: 8b 45 08 mov 0x8(%ebp),%eax
if(!ismp)
801022ac: 85 d2 test %edx,%edx
801022ae: 74 29 je 801022d9 <ioapicenable+0x39>
return;
// Mark interrupt edge-triggered, active high,
// enabled, and routed to the given cpunum,
// which happens to be that cpu's APIC ID.
ioapicwrite(REG_TABLE+2*irq, T_IRQ0 + irq);
801022b0: 8d 48 20 lea 0x20(%eax),%ecx
801022b3: 8d 54 00 10 lea 0x10(%eax,%eax,1),%edx
}
static void
ioapicwrite(int reg, uint data)
{
ioapic->reg = reg;
801022b7: a1 94 21 11 80 mov 0x80112194,%eax
801022bc: 89 10 mov %edx,(%eax)
ioapic->data = data;
801022be: a1 94 21 11 80 mov 0x80112194,%eax
// Mark interrupt edge-triggered, active high,
// enabled, and routed to the given cpunum,
// which happens to be that cpu's APIC ID.
ioapicwrite(REG_TABLE+2*irq, T_IRQ0 + irq);
ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24);
801022c3: 83 c2 01 add $0x1,%edx
static void
ioapicwrite(int reg, uint data)
{
ioapic->reg = reg;
ioapic->data = data;
801022c6: 89 48 10 mov %ecx,0x10(%eax)
// Mark interrupt edge-triggered, active high,
// enabled, and routed to the given cpunum,
// which happens to be that cpu's APIC ID.
ioapicwrite(REG_TABLE+2*irq, T_IRQ0 + irq);
ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24);
801022c9: 8b 4d 0c mov 0xc(%ebp),%ecx
}
static void
ioapicwrite(int reg, uint data)
{
ioapic->reg = reg;
801022cc: 89 10 mov %edx,(%eax)
ioapic->data = data;
801022ce: a1 94 21 11 80 mov 0x80112194,%eax
// Mark interrupt edge-triggered, active high,
// enabled, and routed to the given cpunum,
// which happens to be that cpu's APIC ID.
ioapicwrite(REG_TABLE+2*irq, T_IRQ0 + irq);
ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24);
801022d3: c1 e1 18 shl $0x18,%ecx
static void
ioapicwrite(int reg, uint data)
{
ioapic->reg = reg;
ioapic->data = data;
801022d6: 89 48 10 mov %ecx,0x10(%eax)
// Mark interrupt edge-triggered, active high,
// enabled, and routed to the given cpunum,
// which happens to be that cpu's APIC ID.
ioapicwrite(REG_TABLE+2*irq, T_IRQ0 + irq);
ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24);
}
801022d9: 5d pop %ebp
801022da: c3 ret
801022db: 66 90 xchg %ax,%ax
801022dd: 66 90 xchg %ax,%ax
801022df: 90 nop
801022e0 <kfree>:
// which normally should have been returned by a
// call to kalloc(). (The exception is when
// initializing the allocator; see kinit above.)
void
kfree(char *v)
{
801022e0: 55 push %ebp
801022e1: 89 e5 mov %esp,%ebp
801022e3: 53 push %ebx
801022e4: 83 ec 14 sub $0x14,%esp
801022e7: 8b 5d 08 mov 0x8(%ebp),%ebx
struct run *r;
if((uint)v % PGSIZE || v < end || V2P(v) >= PHYSTOP)
801022ea: f7 c3 ff 0f 00 00 test $0xfff,%ebx
801022f0: 75 7c jne 8010236e <kfree+0x8e>
801022f2: 81 fb c8 4e 12 80 cmp $0x80124ec8,%ebx
801022f8: 72 74 jb 8010236e <kfree+0x8e>
801022fa: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax
80102300: 3d ff ff ff 0d cmp $0xdffffff,%eax
80102305: 77 67 ja 8010236e <kfree+0x8e>
panic("kfree");
// Fill with junk to catch dangling refs.
memset(v, 1, PGSIZE);
80102307: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp)
8010230e: 00
8010230f: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp)
80102316: 00
80102317: 89 1c 24 mov %ebx,(%esp)
8010231a: e8 21 27 00 00 call 80104a40 <memset>
if(kmem.use_lock)
8010231f: 8b 15 d4 21 11 80 mov 0x801121d4,%edx
80102325: 85 d2 test %edx,%edx
80102327: 75 37 jne 80102360 <kfree+0x80>
acquire(&kmem.lock);
r = (struct run*)v;
r->next = kmem.freelist;
80102329: a1 d8 21 11 80 mov 0x801121d8,%eax
8010232e: 89 03 mov %eax,(%ebx)
kmem.freelist = r;
if(kmem.use_lock)
80102330: a1 d4 21 11 80 mov 0x801121d4,%eax
if(kmem.use_lock)
acquire(&kmem.lock);
r = (struct run*)v;
r->next = kmem.freelist;
kmem.freelist = r;
80102335: 89 1d d8 21 11 80 mov %ebx,0x801121d8
if(kmem.use_lock)
8010233b: 85 c0 test %eax,%eax
8010233d: 75 09 jne 80102348 <kfree+0x68>
release(&kmem.lock);
}
8010233f: 83 c4 14 add $0x14,%esp
80102342: 5b pop %ebx
80102343: 5d pop %ebp
80102344: c3 ret
80102345: 8d 76 00 lea 0x0(%esi),%esi
acquire(&kmem.lock);
r = (struct run*)v;
r->next = kmem.freelist;
kmem.freelist = r;
if(kmem.use_lock)
release(&kmem.lock);
80102348: c7 45 08 a0 21 11 80 movl $0x801121a0,0x8(%ebp)
}
8010234f: 83 c4 14 add $0x14,%esp
80102352: 5b pop %ebx
80102353: 5d pop %ebp
acquire(&kmem.lock);
r = (struct run*)v;
r->next = kmem.freelist;
kmem.freelist = r;
if(kmem.use_lock)
release(&kmem.lock);
80102354: e9 97 26 00 00 jmp 801049f0 <release>
80102359: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
// Fill with junk to catch dangling refs.
memset(v, 1, PGSIZE);
if(kmem.use_lock)
acquire(&kmem.lock);
80102360: c7 04 24 a0 21 11 80 movl $0x801121a0,(%esp)
80102367: e8 54 25 00 00 call 801048c0 <acquire>
8010236c: eb bb jmp 80102329 <kfree+0x49>
kfree(char *v)
{
struct run *r;
if((uint)v % PGSIZE || v < end || V2P(v) >= PHYSTOP)
panic("kfree");
8010236e: c7 04 24 96 78 10 80 movl $0x80107896,(%esp)
80102375: e8 b6 df ff ff call 80100330 <panic>
8010237a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80102380 <freerange>:
kmem.use_lock = 1;
}
void
freerange(void *vstart, void *vend)
{
80102380: 55 push %ebp
80102381: 89 e5 mov %esp,%ebp
80102383: 56 push %esi
80102384: 53 push %ebx
80102385: 83 ec 10 sub $0x10,%esp
char *p;
p = (char*)PGROUNDUP((uint)vstart);
80102388: 8b 45 08 mov 0x8(%ebp),%eax
kmem.use_lock = 1;
}
void
freerange(void *vstart, void *vend)
{
8010238b: 8b 75 0c mov 0xc(%ebp),%esi
char *p;
p = (char*)PGROUNDUP((uint)vstart);
8010238e: 8d 90 ff 0f 00 00 lea 0xfff(%eax),%edx
80102394: 81 e2 00 f0 ff ff and $0xfffff000,%edx
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
8010239a: 8d 9a 00 10 00 00 lea 0x1000(%edx),%ebx
801023a0: 39 de cmp %ebx,%esi
801023a2: 73 08 jae 801023ac <freerange+0x2c>
801023a4: eb 18 jmp 801023be <freerange+0x3e>
801023a6: 66 90 xchg %ax,%ax
801023a8: 89 da mov %ebx,%edx
801023aa: 89 c3 mov %eax,%ebx
kfree(p);
801023ac: 89 14 24 mov %edx,(%esp)
801023af: e8 2c ff ff ff call 801022e0 <kfree>
void
freerange(void *vstart, void *vend)
{
char *p;
p = (char*)PGROUNDUP((uint)vstart);
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
801023b4: 8d 83 00 10 00 00 lea 0x1000(%ebx),%eax
801023ba: 39 f0 cmp %esi,%eax
801023bc: 76 ea jbe 801023a8 <freerange+0x28>
kfree(p);
}
801023be: 83 c4 10 add $0x10,%esp
801023c1: 5b pop %ebx
801023c2: 5e pop %esi
801023c3: 5d pop %ebp
801023c4: c3 ret
801023c5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801023c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801023d0 <kinit1>:
// the pages mapped by entrypgdir on free list.
// 2. main() calls kinit2() with the rest of the physical pages
// after installing a full page table that maps them on all cores.
void
kinit1(void *vstart, void *vend)
{
801023d0: 55 push %ebp
801023d1: 89 e5 mov %esp,%ebp
801023d3: 56 push %esi
801023d4: 53 push %ebx
801023d5: 83 ec 10 sub $0x10,%esp
801023d8: 8b 75 0c mov 0xc(%ebp),%esi
initlock(&kmem.lock, "kmem");
801023db: c7 44 24 04 9c 78 10 movl $0x8010789c,0x4(%esp)
801023e2: 80
801023e3: c7 04 24 a0 21 11 80 movl $0x801121a0,(%esp)
801023ea: e8 51 24 00 00 call 80104840 <initlock>
void
freerange(void *vstart, void *vend)
{
char *p;
p = (char*)PGROUNDUP((uint)vstart);
801023ef: 8b 45 08 mov 0x8(%ebp),%eax
// after installing a full page table that maps them on all cores.
void
kinit1(void *vstart, void *vend)
{
initlock(&kmem.lock, "kmem");
kmem.use_lock = 0;
801023f2: c7 05 d4 21 11 80 00 movl $0x0,0x801121d4
801023f9: 00 00 00
void
freerange(void *vstart, void *vend)
{
char *p;
p = (char*)PGROUNDUP((uint)vstart);
801023fc: 8d 90 ff 0f 00 00 lea 0xfff(%eax),%edx
80102402: 81 e2 00 f0 ff ff and $0xfffff000,%edx
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
80102408: 8d 9a 00 10 00 00 lea 0x1000(%edx),%ebx
8010240e: 39 de cmp %ebx,%esi
80102410: 73 0a jae 8010241c <kinit1+0x4c>
80102412: eb 1a jmp 8010242e <kinit1+0x5e>
80102414: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102418: 89 da mov %ebx,%edx
8010241a: 89 c3 mov %eax,%ebx
kfree(p);
8010241c: 89 14 24 mov %edx,(%esp)
8010241f: e8 bc fe ff ff call 801022e0 <kfree>
void
freerange(void *vstart, void *vend)
{
char *p;
p = (char*)PGROUNDUP((uint)vstart);
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
80102424: 8d 83 00 10 00 00 lea 0x1000(%ebx),%eax
8010242a: 39 c6 cmp %eax,%esi
8010242c: 73 ea jae 80102418 <kinit1+0x48>
kinit1(void *vstart, void *vend)
{
initlock(&kmem.lock, "kmem");
kmem.use_lock = 0;
freerange(vstart, vend);
}
8010242e: 83 c4 10 add $0x10,%esp
80102431: 5b pop %ebx
80102432: 5e pop %esi
80102433: 5d pop %ebp
80102434: c3 ret
80102435: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102439: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102440 <kinit2>:
void
kinit2(void *vstart, void *vend)
{
80102440: 55 push %ebp
80102441: 89 e5 mov %esp,%ebp
80102443: 56 push %esi
80102444: 53 push %ebx
80102445: 83 ec 10 sub $0x10,%esp
void
freerange(void *vstart, void *vend)
{
char *p;
p = (char*)PGROUNDUP((uint)vstart);
80102448: 8b 45 08 mov 0x8(%ebp),%eax
freerange(vstart, vend);
}
void
kinit2(void *vstart, void *vend)
{
8010244b: 8b 75 0c mov 0xc(%ebp),%esi
void
freerange(void *vstart, void *vend)
{
char *p;
p = (char*)PGROUNDUP((uint)vstart);
8010244e: 8d 90 ff 0f 00 00 lea 0xfff(%eax),%edx
80102454: 81 e2 00 f0 ff ff and $0xfffff000,%edx
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
8010245a: 8d 9a 00 10 00 00 lea 0x1000(%edx),%ebx
80102460: 39 de cmp %ebx,%esi
80102462: 73 08 jae 8010246c <kinit2+0x2c>
80102464: eb 18 jmp 8010247e <kinit2+0x3e>
80102466: 66 90 xchg %ax,%ax
80102468: 89 da mov %ebx,%edx
8010246a: 89 c3 mov %eax,%ebx
kfree(p);
8010246c: 89 14 24 mov %edx,(%esp)
8010246f: e8 6c fe ff ff call 801022e0 <kfree>
void
freerange(void *vstart, void *vend)
{
char *p;
p = (char*)PGROUNDUP((uint)vstart);
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
80102474: 8d 83 00 10 00 00 lea 0x1000(%ebx),%eax
8010247a: 39 c6 cmp %eax,%esi
8010247c: 73 ea jae 80102468 <kinit2+0x28>
void
kinit2(void *vstart, void *vend)
{
freerange(vstart, vend);
kmem.use_lock = 1;
8010247e: c7 05 d4 21 11 80 01 movl $0x1,0x801121d4
80102485: 00 00 00
}
80102488: 83 c4 10 add $0x10,%esp
8010248b: 5b pop %ebx
8010248c: 5e pop %esi
8010248d: 5d pop %ebp
8010248e: c3 ret
8010248f: 90 nop
80102490 <kalloc>:
// Allocate one 4096-byte page of physical memory.
// Returns a pointer that the kernel can use.
// Returns 0 if the memory cannot be allocated.
char*
kalloc(void)
{
80102490: 55 push %ebp
80102491: 89 e5 mov %esp,%ebp
80102493: 53 push %ebx
80102494: 83 ec 14 sub $0x14,%esp
struct run *r;
if(kmem.use_lock)
80102497: a1 d4 21 11 80 mov 0x801121d4,%eax
8010249c: 85 c0 test %eax,%eax
8010249e: 75 30 jne 801024d0 <kalloc+0x40>
acquire(&kmem.lock);
r = kmem.freelist;
801024a0: 8b 1d d8 21 11 80 mov 0x801121d8,%ebx
if(r)
801024a6: 85 db test %ebx,%ebx
801024a8: 74 08 je 801024b2 <kalloc+0x22>
kmem.freelist = r->next;
801024aa: 8b 13 mov (%ebx),%edx
801024ac: 89 15 d8 21 11 80 mov %edx,0x801121d8
if(kmem.use_lock)
801024b2: 85 c0 test %eax,%eax
801024b4: 74 0c je 801024c2 <kalloc+0x32>
release(&kmem.lock);
801024b6: c7 04 24 a0 21 11 80 movl $0x801121a0,(%esp)
801024bd: e8 2e 25 00 00 call 801049f0 <release>
return (char*)r;
}
801024c2: 83 c4 14 add $0x14,%esp
801024c5: 89 d8 mov %ebx,%eax
801024c7: 5b pop %ebx
801024c8: 5d pop %ebp
801024c9: c3 ret
801024ca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
kalloc(void)
{
struct run *r;
if(kmem.use_lock)
acquire(&kmem.lock);
801024d0: c7 04 24 a0 21 11 80 movl $0x801121a0,(%esp)
801024d7: e8 e4 23 00 00 call 801048c0 <acquire>
801024dc: a1 d4 21 11 80 mov 0x801121d4,%eax
801024e1: eb bd jmp 801024a0 <kalloc+0x10>
801024e3: 66 90 xchg %ax,%ax
801024e5: 66 90 xchg %ax,%ax
801024e7: 66 90 xchg %ax,%ax
801024e9: 66 90 xchg %ax,%ax
801024eb: 66 90 xchg %ax,%ax
801024ed: 66 90 xchg %ax,%ax
801024ef: 90 nop
801024f0 <kbdgetc>:
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801024f0: ba 64 00 00 00 mov $0x64,%edx
801024f5: ec in (%dx),%al
normalmap, shiftmap, ctlmap, ctlmap
};
uint st, data, c;
st = inb(KBSTATP);
if((st & KBS_DIB) == 0)
801024f6: a8 01 test $0x1,%al
801024f8: 0f 84 ba 00 00 00 je 801025b8 <kbdgetc+0xc8>
801024fe: b2 60 mov $0x60,%dl
80102500: ec in (%dx),%al
return -1;
data = inb(KBDATAP);
80102501: 0f b6 c8 movzbl %al,%ecx
if(data == 0xE0){
80102504: 81 f9 e0 00 00 00 cmp $0xe0,%ecx
8010250a: 0f 84 88 00 00 00 je 80102598 <kbdgetc+0xa8>
shift |= E0ESC;
return 0;
} else if(data & 0x80){
80102510: 84 c0 test %al,%al
80102512: 79 2c jns 80102540 <kbdgetc+0x50>
// Key released
data = (shift & E0ESC ? data : data & 0x7F);
80102514: 8b 15 b4 b5 10 80 mov 0x8010b5b4,%edx
8010251a: f6 c2 40 test $0x40,%dl
8010251d: 75 05 jne 80102524 <kbdgetc+0x34>
8010251f: 89 c1 mov %eax,%ecx
80102521: 83 e1 7f and $0x7f,%ecx
shift &= ~(shiftcode[data] | E0ESC);
80102524: 0f b6 81 e0 79 10 80 movzbl -0x7fef8620(%ecx),%eax
8010252b: 83 c8 40 or $0x40,%eax
8010252e: 0f b6 c0 movzbl %al,%eax
80102531: f7 d0 not %eax
80102533: 21 d0 and %edx,%eax
80102535: a3 b4 b5 10 80 mov %eax,0x8010b5b4
return 0;
8010253a: 31 c0 xor %eax,%eax
8010253c: c3 ret
8010253d: 8d 76 00 lea 0x0(%esi),%esi
#include "defs.h"
#include "kbd.h"
int
kbdgetc(void)
{
80102540: 55 push %ebp
80102541: 89 e5 mov %esp,%ebp
80102543: 53 push %ebx
80102544: 8b 1d b4 b5 10 80 mov 0x8010b5b4,%ebx
} else if(data & 0x80){
// Key released
data = (shift & E0ESC ? data : data & 0x7F);
shift &= ~(shiftcode[data] | E0ESC);
return 0;
} else if(shift & E0ESC){
8010254a: f6 c3 40 test $0x40,%bl
8010254d: 74 09 je 80102558 <kbdgetc+0x68>
// Last character was an E0 escape; or with 0x80
data |= 0x80;
8010254f: 83 c8 80 or $0xffffff80,%eax
shift &= ~E0ESC;
80102552: 83 e3 bf and $0xffffffbf,%ebx
data = (shift & E0ESC ? data : data & 0x7F);
shift &= ~(shiftcode[data] | E0ESC);
return 0;
} else if(shift & E0ESC){
// Last character was an E0 escape; or with 0x80
data |= 0x80;
80102555: 0f b6 c8 movzbl %al,%ecx
shift &= ~E0ESC;
}
shift |= shiftcode[data];
80102558: 0f b6 91 e0 79 10 80 movzbl -0x7fef8620(%ecx),%edx
shift ^= togglecode[data];
8010255f: 0f b6 81 e0 78 10 80 movzbl -0x7fef8720(%ecx),%eax
// Last character was an E0 escape; or with 0x80
data |= 0x80;
shift &= ~E0ESC;
}
shift |= shiftcode[data];
80102566: 09 da or %ebx,%edx
shift ^= togglecode[data];
80102568: 31 c2 xor %eax,%edx
c = charcode[shift & (CTL | SHIFT)][data];
8010256a: 89 d0 mov %edx,%eax
8010256c: 83 e0 03 and $0x3,%eax
8010256f: 8b 04 85 c0 78 10 80 mov -0x7fef8740(,%eax,4),%eax
data |= 0x80;
shift &= ~E0ESC;
}
shift |= shiftcode[data];
shift ^= togglecode[data];
80102576: 89 15 b4 b5 10 80 mov %edx,0x8010b5b4
c = charcode[shift & (CTL | SHIFT)][data];
if(shift & CAPSLOCK){
8010257c: 83 e2 08 and $0x8,%edx
shift &= ~E0ESC;
}
shift |= shiftcode[data];
shift ^= togglecode[data];
c = charcode[shift & (CTL | SHIFT)][data];
8010257f: 0f b6 04 08 movzbl (%eax,%ecx,1),%eax
if(shift & CAPSLOCK){
80102583: 74 0b je 80102590 <kbdgetc+0xa0>
if('a' <= c && c <= 'z')
80102585: 8d 50 9f lea -0x61(%eax),%edx
80102588: 83 fa 19 cmp $0x19,%edx
8010258b: 77 1b ja 801025a8 <kbdgetc+0xb8>
c += 'A' - 'a';
8010258d: 83 e8 20 sub $0x20,%eax
else if('A' <= c && c <= 'Z')
c += 'a' - 'A';
}
return c;
}
80102590: 5b pop %ebx
80102591: 5d pop %ebp
80102592: c3 ret
80102593: 90 nop
80102594: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if((st & KBS_DIB) == 0)
return -1;
data = inb(KBDATAP);
if(data == 0xE0){
shift |= E0ESC;
80102598: 83 0d b4 b5 10 80 40 orl $0x40,0x8010b5b4
return 0;
8010259f: 31 c0 xor %eax,%eax
801025a1: c3 ret
801025a2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
shift ^= togglecode[data];
c = charcode[shift & (CTL | SHIFT)][data];
if(shift & CAPSLOCK){
if('a' <= c && c <= 'z')
c += 'A' - 'a';
else if('A' <= c && c <= 'Z')
801025a8: 8d 48 bf lea -0x41(%eax),%ecx
c += 'a' - 'A';
801025ab: 8d 50 20 lea 0x20(%eax),%edx
801025ae: 83 f9 19 cmp $0x19,%ecx
801025b1: 0f 46 c2 cmovbe %edx,%eax
}
return c;
801025b4: eb da jmp 80102590 <kbdgetc+0xa0>
801025b6: 66 90 xchg %ax,%ax
};
uint st, data, c;
st = inb(KBSTATP);
if((st & KBS_DIB) == 0)
return -1;
801025b8: b8 ff ff ff ff mov $0xffffffff,%eax
801025bd: c3 ret
801025be: 66 90 xchg %ax,%ax
801025c0 <kbdintr>:
return c;
}
void
kbdintr(void)
{
801025c0: 55 push %ebp
801025c1: 89 e5 mov %esp,%ebp
801025c3: 83 ec 18 sub $0x18,%esp
consoleintr(kbdgetc);
801025c6: c7 04 24 f0 24 10 80 movl $0x801024f0,(%esp)
801025cd: e8 ae e1 ff ff call 80100780 <consoleintr>
}
801025d2: c9 leave
801025d3: c3 ret
801025d4: 66 90 xchg %ax,%ax
801025d6: 66 90 xchg %ax,%ax
801025d8: 66 90 xchg %ax,%ax
801025da: 66 90 xchg %ax,%ax
801025dc: 66 90 xchg %ax,%ax
801025de: 66 90 xchg %ax,%ax
801025e0 <fill_rtcdate>:
return inb(CMOS_RETURN);
}
static void fill_rtcdate(struct rtcdate *r)
{
801025e0: 55 push %ebp
801025e1: 89 c1 mov %eax,%ecx
801025e3: 89 e5 mov %esp,%ebp
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
801025e5: ba 70 00 00 00 mov $0x70,%edx
801025ea: 53 push %ebx
801025eb: 31 c0 xor %eax,%eax
801025ed: ee out %al,(%dx)
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801025ee: bb 71 00 00 00 mov $0x71,%ebx
801025f3: 89 da mov %ebx,%edx
801025f5: ec in (%dx),%al
static uint cmos_read(uint reg)
{
outb(CMOS_PORT, reg);
microdelay(200);
return inb(CMOS_RETURN);
801025f6: 0f b6 c0 movzbl %al,%eax
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
801025f9: b2 70 mov $0x70,%dl
801025fb: 89 01 mov %eax,(%ecx)
801025fd: b8 02 00 00 00 mov $0x2,%eax
80102602: ee out %al,(%dx)
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102603: 89 da mov %ebx,%edx
80102605: ec in (%dx),%al
80102606: 0f b6 c0 movzbl %al,%eax
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102609: b2 70 mov $0x70,%dl
8010260b: 89 41 04 mov %eax,0x4(%ecx)
8010260e: b8 04 00 00 00 mov $0x4,%eax
80102613: ee out %al,(%dx)
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102614: 89 da mov %ebx,%edx
80102616: ec in (%dx),%al
80102617: 0f b6 c0 movzbl %al,%eax
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
8010261a: b2 70 mov $0x70,%dl
8010261c: 89 41 08 mov %eax,0x8(%ecx)
8010261f: b8 07 00 00 00 mov $0x7,%eax
80102624: ee out %al,(%dx)
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102625: 89 da mov %ebx,%edx
80102627: ec in (%dx),%al
80102628: 0f b6 c0 movzbl %al,%eax
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
8010262b: b2 70 mov $0x70,%dl
8010262d: 89 41 0c mov %eax,0xc(%ecx)
80102630: b8 08 00 00 00 mov $0x8,%eax
80102635: ee out %al,(%dx)
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102636: 89 da mov %ebx,%edx
80102638: ec in (%dx),%al
80102639: 0f b6 c0 movzbl %al,%eax
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
8010263c: b2 70 mov $0x70,%dl
8010263e: 89 41 10 mov %eax,0x10(%ecx)
80102641: b8 09 00 00 00 mov $0x9,%eax
80102646: ee out %al,(%dx)
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102647: 89 da mov %ebx,%edx
80102649: ec in (%dx),%al
8010264a: 0f b6 d8 movzbl %al,%ebx
8010264d: 89 59 14 mov %ebx,0x14(%ecx)
r->minute = cmos_read(MINS);
r->hour = cmos_read(HOURS);
r->day = cmos_read(DAY);
r->month = cmos_read(MONTH);
r->year = cmos_read(YEAR);
}
80102650: 5b pop %ebx
80102651: 5d pop %ebp
80102652: c3 ret
80102653: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80102659: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102660 <lapicinit>:
//PAGEBREAK!
void
lapicinit(void)
{
if(!lapic)
80102660: a1 dc 21 11 80 mov 0x801121dc,%eax
}
//PAGEBREAK!
void
lapicinit(void)
{
80102665: 55 push %ebp
80102666: 89 e5 mov %esp,%ebp
if(!lapic)
80102668: 85 c0 test %eax,%eax
8010266a: 0f 84 c0 00 00 00 je 80102730 <lapicinit+0xd0>
volatile uint *lapic; // Initialized in mp.c
static void
lapicw(int index, int value)
{
lapic[index] = value;
80102670: c7 80 f0 00 00 00 3f movl $0x13f,0xf0(%eax)
80102677: 01 00 00
lapic[ID]; // wait for write to finish, by reading
8010267a: 8b 50 20 mov 0x20(%eax),%edx
volatile uint *lapic; // Initialized in mp.c
static void
lapicw(int index, int value)
{
lapic[index] = value;
8010267d: c7 80 e0 03 00 00 0b movl $0xb,0x3e0(%eax)
80102684: 00 00 00
lapic[ID]; // wait for write to finish, by reading
80102687: 8b 50 20 mov 0x20(%eax),%edx
volatile uint *lapic; // Initialized in mp.c
static void
lapicw(int index, int value)
{
lapic[index] = value;
8010268a: c7 80 20 03 00 00 20 movl $0x20020,0x320(%eax)
80102691: 00 02 00
lapic[ID]; // wait for write to finish, by reading
80102694: 8b 50 20 mov 0x20(%eax),%edx
volatile uint *lapic; // Initialized in mp.c
static void
lapicw(int index, int value)
{
lapic[index] = value;
80102697: c7 80 80 03 00 00 80 movl $0x989680,0x380(%eax)
8010269e: 96 98 00
lapic[ID]; // wait for write to finish, by reading
801026a1: 8b 50 20 mov 0x20(%eax),%edx
volatile uint *lapic; // Initialized in mp.c
static void
lapicw(int index, int value)
{
lapic[index] = value;
801026a4: c7 80 50 03 00 00 00 movl $0x10000,0x350(%eax)
801026ab: 00 01 00
lapic[ID]; // wait for write to finish, by reading
801026ae: 8b 50 20 mov 0x20(%eax),%edx
volatile uint *lapic; // Initialized in mp.c
static void
lapicw(int index, int value)
{
lapic[index] = value;
801026b1: c7 80 60 03 00 00 00 movl $0x10000,0x360(%eax)
801026b8: 00 01 00
lapic[ID]; // wait for write to finish, by reading
801026bb: 8b 50 20 mov 0x20(%eax),%edx
lapicw(LINT0, MASKED);
lapicw(LINT1, MASKED);
// Disable performance counter overflow interrupts
// on machines that provide that interrupt entry.
if(((lapic[VER]>>16) & 0xFF) >= 4)
801026be: 8b 50 30 mov 0x30(%eax),%edx
801026c1: c1 ea 10 shr $0x10,%edx
801026c4: 80 fa 03 cmp $0x3,%dl
801026c7: 77 6f ja 80102738 <lapicinit+0xd8>
volatile uint *lapic; // Initialized in mp.c
static void
lapicw(int index, int value)
{
lapic[index] = value;
801026c9: c7 80 70 03 00 00 33 movl $0x33,0x370(%eax)
801026d0: 00 00 00
lapic[ID]; // wait for write to finish, by reading
801026d3: 8b 50 20 mov 0x20(%eax),%edx
volatile uint *lapic; // Initialized in mp.c
static void
lapicw(int index, int value)
{
lapic[index] = value;
801026d6: c7 80 80 02 00 00 00 movl $0x0,0x280(%eax)
801026dd: 00 00 00
lapic[ID]; // wait for write to finish, by reading
801026e0: 8b 50 20 mov 0x20(%eax),%edx
volatile uint *lapic; // Initialized in mp.c
static void
lapicw(int index, int value)
{
lapic[index] = value;
801026e3: c7 80 80 02 00 00 00 movl $0x0,0x280(%eax)
801026ea: 00 00 00
lapic[ID]; // wait for write to finish, by reading
801026ed: 8b 50 20 mov 0x20(%eax),%edx
volatile uint *lapic; // Initialized in mp.c
static void
lapicw(int index, int value)
{
lapic[index] = value;
801026f0: c7 80 b0 00 00 00 00 movl $0x0,0xb0(%eax)
801026f7: 00 00 00
lapic[ID]; // wait for write to finish, by reading
801026fa: 8b 50 20 mov 0x20(%eax),%edx
volatile uint *lapic; // Initialized in mp.c
static void
lapicw(int index, int value)
{
lapic[index] = value;
801026fd: c7 80 10 03 00 00 00 movl $0x0,0x310(%eax)
80102704: 00 00 00
lapic[ID]; // wait for write to finish, by reading
80102707: 8b 50 20 mov 0x20(%eax),%edx
volatile uint *lapic; // Initialized in mp.c
static void
lapicw(int index, int value)
{
lapic[index] = value;
8010270a: c7 80 00 03 00 00 00 movl $0x88500,0x300(%eax)
80102711: 85 08 00
lapic[ID]; // wait for write to finish, by reading
80102714: 8b 50 20 mov 0x20(%eax),%edx
80102717: 90 nop
lapicw(EOI, 0);
// Send an Init Level De-Assert to synchronise arbitration ID's.
lapicw(ICRHI, 0);
lapicw(ICRLO, BCAST | INIT | LEVEL);
while(lapic[ICRLO] & DELIVS)
80102718: 8b 90 00 03 00 00 mov 0x300(%eax),%edx
8010271e: 80 e6 10 and $0x10,%dh
80102721: 75 f5 jne 80102718 <lapicinit+0xb8>
volatile uint *lapic; // Initialized in mp.c
static void
lapicw(int index, int value)
{
lapic[index] = value;
80102723: c7 80 80 00 00 00 00 movl $0x0,0x80(%eax)
8010272a: 00 00 00
lapic[ID]; // wait for write to finish, by reading
8010272d: 8b 40 20 mov 0x20(%eax),%eax
while(lapic[ICRLO] & DELIVS)
;
// Enable interrupts on the APIC (but not on the processor).
lapicw(TPR, 0);
}
80102730: 5d pop %ebp
80102731: c3 ret
80102732: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
volatile uint *lapic; // Initialized in mp.c
static void
lapicw(int index, int value)
{
lapic[index] = value;
80102738: c7 80 40 03 00 00 00 movl $0x10000,0x340(%eax)
8010273f: 00 01 00
lapic[ID]; // wait for write to finish, by reading
80102742: 8b 50 20 mov 0x20(%eax),%edx
80102745: eb 82 jmp 801026c9 <lapicinit+0x69>
80102747: 89 f6 mov %esi,%esi
80102749: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102750 <cpunum>:
lapicw(TPR, 0);
}
int
cpunum(void)
{
80102750: 55 push %ebp
80102751: 89 e5 mov %esp,%ebp
80102753: 56 push %esi
80102754: 53 push %ebx
80102755: 83 ec 10 sub $0x10,%esp
static inline uint
readeflags(void)
{
uint eflags;
asm volatile("pushfl; popl %0" : "=r" (eflags));
80102758: 9c pushf
80102759: 58 pop %eax
// Cannot call cpu when interrupts are enabled:
// result not guaranteed to last long enough to be used!
// Would prefer to panic but even printing is chancy here:
// almost everything, including cprintf and panic, calls cpu,
// often indirectly through acquire and release.
if(readeflags()&FL_IF){
8010275a: f6 c4 02 test $0x2,%ah
8010275d: 74 12 je 80102771 <cpunum+0x21>
static int n;
if(n++ == 0)
8010275f: a1 b8 b5 10 80 mov 0x8010b5b8,%eax
80102764: 8d 50 01 lea 0x1(%eax),%edx
80102767: 85 c0 test %eax,%eax
80102769: 89 15 b8 b5 10 80 mov %edx,0x8010b5b8
8010276f: 74 4a je 801027bb <cpunum+0x6b>
cprintf("cpu called from %x with interrupts enabled\n",
__builtin_return_address(0));
}
if (!lapic)
80102771: a1 dc 21 11 80 mov 0x801121dc,%eax
80102776: 85 c0 test %eax,%eax
80102778: 74 5d je 801027d7 <cpunum+0x87>
return 0;
apicid = lapic[ID] >> 24;
8010277a: 8b 58 20 mov 0x20(%eax),%ebx
for (i = 0; i < ncpu; ++i) {
8010277d: 8b 35 e0 28 11 80 mov 0x801128e0,%esi
}
if (!lapic)
return 0;
apicid = lapic[ID] >> 24;
80102783: c1 eb 18 shr $0x18,%ebx
for (i = 0; i < ncpu; ++i) {
80102786: 85 f6 test %esi,%esi
80102788: 7e 56 jle 801027e0 <cpunum+0x90>
if (cpus[i].apicid == apicid)
8010278a: 0f b6 05 e0 22 11 80 movzbl 0x801122e0,%eax
80102791: 39 d8 cmp %ebx,%eax
80102793: 74 42 je 801027d7 <cpunum+0x87>
80102795: ba a0 23 11 80 mov $0x801123a0,%edx
if (!lapic)
return 0;
apicid = lapic[ID] >> 24;
for (i = 0; i < ncpu; ++i) {
8010279a: 31 c0 xor %eax,%eax
8010279c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801027a0: 83 c0 01 add $0x1,%eax
801027a3: 39 f0 cmp %esi,%eax
801027a5: 74 39 je 801027e0 <cpunum+0x90>
if (cpus[i].apicid == apicid)
801027a7: 0f b6 0a movzbl (%edx),%ecx
801027aa: 81 c2 c0 00 00 00 add $0xc0,%edx
801027b0: 39 d9 cmp %ebx,%ecx
801027b2: 75 ec jne 801027a0 <cpunum+0x50>
return i;
}
panic("unknown apicid\n");
}
801027b4: 83 c4 10 add $0x10,%esp
801027b7: 5b pop %ebx
801027b8: 5e pop %esi
801027b9: 5d pop %ebp
801027ba: c3 ret
// almost everything, including cprintf and panic, calls cpu,
// often indirectly through acquire and release.
if(readeflags()&FL_IF){
static int n;
if(n++ == 0)
cprintf("cpu called from %x with interrupts enabled\n",
801027bb: 8b 45 04 mov 0x4(%ebp),%eax
801027be: c7 04 24 e0 7a 10 80 movl $0x80107ae0,(%esp)
801027c5: 89 44 24 04 mov %eax,0x4(%esp)
801027c9: e8 52 de ff ff call 80100620 <cprintf>
__builtin_return_address(0));
}
if (!lapic)
801027ce: a1 dc 21 11 80 mov 0x801121dc,%eax
801027d3: 85 c0 test %eax,%eax
801027d5: 75 a3 jne 8010277a <cpunum+0x2a>
for (i = 0; i < ncpu; ++i) {
if (cpus[i].apicid == apicid)
return i;
}
panic("unknown apicid\n");
}
801027d7: 83 c4 10 add $0x10,%esp
cprintf("cpu called from %x with interrupts enabled\n",
__builtin_return_address(0));
}
if (!lapic)
return 0;
801027da: 31 c0 xor %eax,%eax
for (i = 0; i < ncpu; ++i) {
if (cpus[i].apicid == apicid)
return i;
}
panic("unknown apicid\n");
}
801027dc: 5b pop %ebx
801027dd: 5e pop %esi
801027de: 5d pop %ebp
801027df: c3 ret
apicid = lapic[ID] >> 24;
for (i = 0; i < ncpu; ++i) {
if (cpus[i].apicid == apicid)
return i;
}
panic("unknown apicid\n");
801027e0: c7 04 24 0c 7b 10 80 movl $0x80107b0c,(%esp)
801027e7: e8 44 db ff ff call 80100330 <panic>
801027ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801027f0 <lapiceoi>:
// Acknowledge interrupt.
void
lapiceoi(void)
{
if(lapic)
801027f0: a1 dc 21 11 80 mov 0x801121dc,%eax
}
// Acknowledge interrupt.
void
lapiceoi(void)
{
801027f5: 55 push %ebp
801027f6: 89 e5 mov %esp,%ebp
if(lapic)
801027f8: 85 c0 test %eax,%eax
801027fa: 74 0d je 80102809 <lapiceoi+0x19>
volatile uint *lapic; // Initialized in mp.c
static void
lapicw(int index, int value)
{
lapic[index] = value;
801027fc: c7 80 b0 00 00 00 00 movl $0x0,0xb0(%eax)
80102803: 00 00 00
lapic[ID]; // wait for write to finish, by reading
80102806: 8b 40 20 mov 0x20(%eax),%eax
void
lapiceoi(void)
{
if(lapic)
lapicw(EOI, 0);
}
80102809: 5d pop %ebp
8010280a: c3 ret
8010280b: 90 nop
8010280c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102810 <microdelay>:
// Spin for a given number of microseconds.
// On real hardware would want to tune this dynamically.
void
microdelay(int us)
{
80102810: 55 push %ebp
80102811: 89 e5 mov %esp,%ebp
}
80102813: 5d pop %ebp
80102814: c3 ret
80102815: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102819: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102820 <lapicstartap>:
// Start additional processor running entry code at addr.
// See Appendix B of MultiProcessor Specification.
void
lapicstartap(uchar apicid, uint addr)
{
80102820: 55 push %ebp
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102821: ba 70 00 00 00 mov $0x70,%edx
80102826: 89 e5 mov %esp,%ebp
80102828: b8 0f 00 00 00 mov $0xf,%eax
8010282d: 53 push %ebx
8010282e: 8b 4d 08 mov 0x8(%ebp),%ecx
80102831: 8b 5d 0c mov 0xc(%ebp),%ebx
80102834: ee out %al,(%dx)
80102835: b8 0a 00 00 00 mov $0xa,%eax
8010283a: b2 71 mov $0x71,%dl
8010283c: ee out %al,(%dx)
// and the warm reset vector (DWORD based at 40:67) to point at
// the AP startup code prior to the [universal startup algorithm]."
outb(CMOS_PORT, 0xF); // offset 0xF is shutdown code
outb(CMOS_PORT+1, 0x0A);
wrv = (ushort*)P2V((0x40<<4 | 0x67)); // Warm reset vector
wrv[0] = 0;
8010283d: 31 c0 xor %eax,%eax
8010283f: 66 a3 67 04 00 80 mov %ax,0x80000467
wrv[1] = addr >> 4;
80102845: 89 d8 mov %ebx,%eax
80102847: c1 e8 04 shr $0x4,%eax
8010284a: 66 a3 69 04 00 80 mov %ax,0x80000469
volatile uint *lapic; // Initialized in mp.c
static void
lapicw(int index, int value)
{
lapic[index] = value;
80102850: a1 dc 21 11 80 mov 0x801121dc,%eax
wrv[0] = 0;
wrv[1] = addr >> 4;
// "Universal startup algorithm."
// Send INIT (level-triggered) interrupt to reset other CPU.
lapicw(ICRHI, apicid<<24);
80102855: c1 e1 18 shl $0x18,%ecx
// when it is in the halted state due to an INIT. So the second
// should be ignored, but it is part of the official Intel algorithm.
// Bochs complains about the second one. Too bad for Bochs.
for(i = 0; i < 2; i++){
lapicw(ICRHI, apicid<<24);
lapicw(ICRLO, STARTUP | (addr>>12));
80102858: c1 eb 0c shr $0xc,%ebx
volatile uint *lapic; // Initialized in mp.c
static void
lapicw(int index, int value)
{
lapic[index] = value;
8010285b: 89 88 10 03 00 00 mov %ecx,0x310(%eax)
lapic[ID]; // wait for write to finish, by reading
80102861: 8b 50 20 mov 0x20(%eax),%edx
volatile uint *lapic; // Initialized in mp.c
static void
lapicw(int index, int value)
{
lapic[index] = value;
80102864: c7 80 00 03 00 00 00 movl $0xc500,0x300(%eax)
8010286b: c5 00 00
lapic[ID]; // wait for write to finish, by reading
8010286e: 8b 50 20 mov 0x20(%eax),%edx
volatile uint *lapic; // Initialized in mp.c
static void
lapicw(int index, int value)
{
lapic[index] = value;
80102871: c7 80 00 03 00 00 00 movl $0x8500,0x300(%eax)
80102878: 85 00 00
lapic[ID]; // wait for write to finish, by reading
8010287b: 8b 50 20 mov 0x20(%eax),%edx
volatile uint *lapic; // Initialized in mp.c
static void
lapicw(int index, int value)
{
lapic[index] = value;
8010287e: 89 88 10 03 00 00 mov %ecx,0x310(%eax)
lapic[ID]; // wait for write to finish, by reading
80102884: 8b 50 20 mov 0x20(%eax),%edx
// when it is in the halted state due to an INIT. So the second
// should be ignored, but it is part of the official Intel algorithm.
// Bochs complains about the second one. Too bad for Bochs.
for(i = 0; i < 2; i++){
lapicw(ICRHI, apicid<<24);
lapicw(ICRLO, STARTUP | (addr>>12));
80102887: 89 da mov %ebx,%edx
80102889: 80 ce 06 or $0x6,%dh
volatile uint *lapic; // Initialized in mp.c
static void
lapicw(int index, int value)
{
lapic[index] = value;
8010288c: 89 90 00 03 00 00 mov %edx,0x300(%eax)
lapic[ID]; // wait for write to finish, by reading
80102892: 8b 58 20 mov 0x20(%eax),%ebx
volatile uint *lapic; // Initialized in mp.c
static void
lapicw(int index, int value)
{
lapic[index] = value;
80102895: 89 88 10 03 00 00 mov %ecx,0x310(%eax)
lapic[ID]; // wait for write to finish, by reading
8010289b: 8b 48 20 mov 0x20(%eax),%ecx
volatile uint *lapic; // Initialized in mp.c
static void
lapicw(int index, int value)
{
lapic[index] = value;
8010289e: 89 90 00 03 00 00 mov %edx,0x300(%eax)
lapic[ID]; // wait for write to finish, by reading
801028a4: 8b 40 20 mov 0x20(%eax),%eax
for(i = 0; i < 2; i++){
lapicw(ICRHI, apicid<<24);
lapicw(ICRLO, STARTUP | (addr>>12));
microdelay(200);
}
}
801028a7: 5b pop %ebx
801028a8: 5d pop %ebp
801028a9: c3 ret
801028aa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801028b0 <cmostime>:
r->year = cmos_read(YEAR);
}
// qemu seems to use 24-hour GWT and the values are BCD encoded
void cmostime(struct rtcdate *r)
{
801028b0: 55 push %ebp
801028b1: ba 70 00 00 00 mov $0x70,%edx
801028b6: 89 e5 mov %esp,%ebp
801028b8: b8 0b 00 00 00 mov $0xb,%eax
801028bd: 57 push %edi
801028be: 56 push %esi
801028bf: 53 push %ebx
801028c0: 83 ec 4c sub $0x4c,%esp
801028c3: ee out %al,(%dx)
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801028c4: b2 71 mov $0x71,%dl
801028c6: ec in (%dx),%al
801028c7: 88 45 b7 mov %al,-0x49(%ebp)
801028ca: 8d 5d b8 lea -0x48(%ebp),%ebx
struct rtcdate t1, t2;
int sb, bcd;
sb = cmos_read(CMOS_STATB);
bcd = (sb & (1 << 2)) == 0;
801028cd: 80 65 b7 04 andb $0x4,-0x49(%ebp)
801028d1: 8d 7d d0 lea -0x30(%ebp),%edi
801028d4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
801028d8: be 70 00 00 00 mov $0x70,%esi
// make sure CMOS doesn't modify time while we read it
for(;;) {
fill_rtcdate(&t1);
801028dd: 89 d8 mov %ebx,%eax
801028df: e8 fc fc ff ff call 801025e0 <fill_rtcdate>
801028e4: b8 0a 00 00 00 mov $0xa,%eax
801028e9: 89 f2 mov %esi,%edx
801028eb: ee out %al,(%dx)
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801028ec: ba 71 00 00 00 mov $0x71,%edx
801028f1: ec in (%dx),%al
if(cmos_read(CMOS_STATA) & CMOS_UIP)
801028f2: 84 c0 test %al,%al
801028f4: 78 e7 js 801028dd <cmostime+0x2d>
continue;
fill_rtcdate(&t2);
801028f6: 89 f8 mov %edi,%eax
801028f8: e8 e3 fc ff ff call 801025e0 <fill_rtcdate>
if(memcmp(&t1, &t2, sizeof(t1)) == 0)
801028fd: c7 44 24 08 18 00 00 movl $0x18,0x8(%esp)
80102904: 00
80102905: 89 7c 24 04 mov %edi,0x4(%esp)
80102909: 89 1c 24 mov %ebx,(%esp)
8010290c: e8 7f 21 00 00 call 80104a90 <memcmp>
80102911: 85 c0 test %eax,%eax
80102913: 75 c3 jne 801028d8 <cmostime+0x28>
break;
}
// convert
if(bcd) {
80102915: 80 7d b7 00 cmpb $0x0,-0x49(%ebp)
80102919: 75 78 jne 80102993 <cmostime+0xe3>
#define CONV(x) (t1.x = ((t1.x >> 4) * 10) + (t1.x & 0xf))
CONV(second);
8010291b: 8b 45 b8 mov -0x48(%ebp),%eax
8010291e: 89 c2 mov %eax,%edx
80102920: 83 e0 0f and $0xf,%eax
80102923: c1 ea 04 shr $0x4,%edx
80102926: 8d 14 92 lea (%edx,%edx,4),%edx
80102929: 8d 04 50 lea (%eax,%edx,2),%eax
8010292c: 89 45 b8 mov %eax,-0x48(%ebp)
CONV(minute);
8010292f: 8b 45 bc mov -0x44(%ebp),%eax
80102932: 89 c2 mov %eax,%edx
80102934: 83 e0 0f and $0xf,%eax
80102937: c1 ea 04 shr $0x4,%edx
8010293a: 8d 14 92 lea (%edx,%edx,4),%edx
8010293d: 8d 04 50 lea (%eax,%edx,2),%eax
80102940: 89 45 bc mov %eax,-0x44(%ebp)
CONV(hour );
80102943: 8b 45 c0 mov -0x40(%ebp),%eax
80102946: 89 c2 mov %eax,%edx
80102948: 83 e0 0f and $0xf,%eax
8010294b: c1 ea 04 shr $0x4,%edx
8010294e: 8d 14 92 lea (%edx,%edx,4),%edx
80102951: 8d 04 50 lea (%eax,%edx,2),%eax
80102954: 89 45 c0 mov %eax,-0x40(%ebp)
CONV(day );
80102957: 8b 45 c4 mov -0x3c(%ebp),%eax
8010295a: 89 c2 mov %eax,%edx
8010295c: 83 e0 0f and $0xf,%eax
8010295f: c1 ea 04 shr $0x4,%edx
80102962: 8d 14 92 lea (%edx,%edx,4),%edx
80102965: 8d 04 50 lea (%eax,%edx,2),%eax
80102968: 89 45 c4 mov %eax,-0x3c(%ebp)
CONV(month );
8010296b: 8b 45 c8 mov -0x38(%ebp),%eax
8010296e: 89 c2 mov %eax,%edx
80102970: 83 e0 0f and $0xf,%eax
80102973: c1 ea 04 shr $0x4,%edx
80102976: 8d 14 92 lea (%edx,%edx,4),%edx
80102979: 8d 04 50 lea (%eax,%edx,2),%eax
8010297c: 89 45 c8 mov %eax,-0x38(%ebp)
CONV(year );
8010297f: 8b 45 cc mov -0x34(%ebp),%eax
80102982: 89 c2 mov %eax,%edx
80102984: 83 e0 0f and $0xf,%eax
80102987: c1 ea 04 shr $0x4,%edx
8010298a: 8d 14 92 lea (%edx,%edx,4),%edx
8010298d: 8d 04 50 lea (%eax,%edx,2),%eax
80102990: 89 45 cc mov %eax,-0x34(%ebp)
#undef CONV
}
*r = t1;
80102993: 8b 4d 08 mov 0x8(%ebp),%ecx
80102996: 8b 45 b8 mov -0x48(%ebp),%eax
80102999: 89 01 mov %eax,(%ecx)
8010299b: 8b 45 bc mov -0x44(%ebp),%eax
8010299e: 89 41 04 mov %eax,0x4(%ecx)
801029a1: 8b 45 c0 mov -0x40(%ebp),%eax
801029a4: 89 41 08 mov %eax,0x8(%ecx)
801029a7: 8b 45 c4 mov -0x3c(%ebp),%eax
801029aa: 89 41 0c mov %eax,0xc(%ecx)
801029ad: 8b 45 c8 mov -0x38(%ebp),%eax
801029b0: 89 41 10 mov %eax,0x10(%ecx)
801029b3: 8b 45 cc mov -0x34(%ebp),%eax
801029b6: 89 41 14 mov %eax,0x14(%ecx)
r->year += 2000;
801029b9: 81 41 14 d0 07 00 00 addl $0x7d0,0x14(%ecx)
801029c0: 83 c4 4c add $0x4c,%esp
801029c3: 5b pop %ebx
801029c4: 5e pop %esi
801029c5: 5f pop %edi
801029c6: 5d pop %ebp
801029c7: c3 ret
801029c8: 66 90 xchg %ax,%ax
801029ca: 66 90 xchg %ax,%ax
801029cc: 66 90 xchg %ax,%ax
801029ce: 66 90 xchg %ax,%ax
801029d0 <install_trans>:
}
// Copy committed blocks from log to their home location
static void
install_trans(void)
{
801029d0: 55 push %ebp
801029d1: 89 e5 mov %esp,%ebp
801029d3: 57 push %edi
801029d4: 56 push %esi
801029d5: 53 push %ebx
int tail;
for (tail = 0; tail < log.lh.n; tail++) {
801029d6: 31 db xor %ebx,%ebx
}
// Copy committed blocks from log to their home location
static void
install_trans(void)
{
801029d8: 83 ec 1c sub $0x1c,%esp
int tail;
for (tail = 0; tail < log.lh.n; tail++) {
801029db: a1 28 22 11 80 mov 0x80112228,%eax
801029e0: 85 c0 test %eax,%eax
801029e2: 7e 78 jle 80102a5c <install_trans+0x8c>
801029e4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
struct buf *lbuf = bread(log.dev, log.start+tail+1); // read log block
801029e8: a1 14 22 11 80 mov 0x80112214,%eax
801029ed: 01 d8 add %ebx,%eax
801029ef: 83 c0 01 add $0x1,%eax
801029f2: 89 44 24 04 mov %eax,0x4(%esp)
801029f6: a1 24 22 11 80 mov 0x80112224,%eax
801029fb: 89 04 24 mov %eax,(%esp)
801029fe: e8 bd d6 ff ff call 801000c0 <bread>
80102a03: 89 c7 mov %eax,%edi
struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst
80102a05: 8b 04 9d 2c 22 11 80 mov -0x7feeddd4(,%ebx,4),%eax
static void
install_trans(void)
{
int tail;
for (tail = 0; tail < log.lh.n; tail++) {
80102a0c: 83 c3 01 add $0x1,%ebx
struct buf *lbuf = bread(log.dev, log.start+tail+1); // read log block
struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst
80102a0f: 89 44 24 04 mov %eax,0x4(%esp)
80102a13: a1 24 22 11 80 mov 0x80112224,%eax
80102a18: 89 04 24 mov %eax,(%esp)
80102a1b: e8 a0 d6 ff ff call 801000c0 <bread>
memmove(dbuf->data, lbuf->data, BSIZE); // copy block to dst
80102a20: c7 44 24 08 00 02 00 movl $0x200,0x8(%esp)
80102a27: 00
{
int tail;
for (tail = 0; tail < log.lh.n; tail++) {
struct buf *lbuf = bread(log.dev, log.start+tail+1); // read log block
struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst
80102a28: 89 c6 mov %eax,%esi
memmove(dbuf->data, lbuf->data, BSIZE); // copy block to dst
80102a2a: 8d 47 18 lea 0x18(%edi),%eax
80102a2d: 89 44 24 04 mov %eax,0x4(%esp)
80102a31: 8d 46 18 lea 0x18(%esi),%eax
80102a34: 89 04 24 mov %eax,(%esp)
80102a37: e8 a4 20 00 00 call 80104ae0 <memmove>
bwrite(dbuf); // write dst to disk
80102a3c: 89 34 24 mov %esi,(%esp)
80102a3f: e8 4c d7 ff ff call 80100190 <bwrite>
brelse(lbuf);
80102a44: 89 3c 24 mov %edi,(%esp)
80102a47: e8 74 d7 ff ff call 801001c0 <brelse>
brelse(dbuf);
80102a4c: 89 34 24 mov %esi,(%esp)
80102a4f: e8 6c d7 ff ff call 801001c0 <brelse>
static void
install_trans(void)
{
int tail;
for (tail = 0; tail < log.lh.n; tail++) {
80102a54: 39 1d 28 22 11 80 cmp %ebx,0x80112228
80102a5a: 7f 8c jg 801029e8 <install_trans+0x18>
memmove(dbuf->data, lbuf->data, BSIZE); // copy block to dst
bwrite(dbuf); // write dst to disk
brelse(lbuf);
brelse(dbuf);
}
}
80102a5c: 83 c4 1c add $0x1c,%esp
80102a5f: 5b pop %ebx
80102a60: 5e pop %esi
80102a61: 5f pop %edi
80102a62: 5d pop %ebp
80102a63: c3 ret
80102a64: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80102a6a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
80102a70 <write_head>:
// Write in-memory log header to disk.
// This is the true point at which the
// current transaction commits.
static void
write_head(void)
{
80102a70: 55 push %ebp
80102a71: 89 e5 mov %esp,%ebp
80102a73: 56 push %esi
80102a74: 53 push %ebx
80102a75: 83 ec 10 sub $0x10,%esp
struct buf *buf = bread(log.dev, log.start);
80102a78: a1 14 22 11 80 mov 0x80112214,%eax
80102a7d: 89 44 24 04 mov %eax,0x4(%esp)
80102a81: a1 24 22 11 80 mov 0x80112224,%eax
80102a86: 89 04 24 mov %eax,(%esp)
80102a89: e8 32 d6 ff ff call 801000c0 <bread>
struct logheader *hb = (struct logheader *) (buf->data);
int i;
hb->n = log.lh.n;
for (i = 0; i < log.lh.n; i++) {
80102a8e: 31 d2 xor %edx,%edx
// This is the true point at which the
// current transaction commits.
static void
write_head(void)
{
struct buf *buf = bread(log.dev, log.start);
80102a90: 89 c6 mov %eax,%esi
struct logheader *hb = (struct logheader *) (buf->data);
int i;
hb->n = log.lh.n;
80102a92: a1 28 22 11 80 mov 0x80112228,%eax
80102a97: 8d 5e 18 lea 0x18(%esi),%ebx
80102a9a: 89 46 18 mov %eax,0x18(%esi)
for (i = 0; i < log.lh.n; i++) {
80102a9d: a1 28 22 11 80 mov 0x80112228,%eax
80102aa2: 85 c0 test %eax,%eax
80102aa4: 7e 18 jle 80102abe <write_head+0x4e>
80102aa6: 66 90 xchg %ax,%ax
hb->block[i] = log.lh.block[i];
80102aa8: 8b 0c 95 2c 22 11 80 mov -0x7feeddd4(,%edx,4),%ecx
80102aaf: 89 4c 93 04 mov %ecx,0x4(%ebx,%edx,4)
{
struct buf *buf = bread(log.dev, log.start);
struct logheader *hb = (struct logheader *) (buf->data);
int i;
hb->n = log.lh.n;
for (i = 0; i < log.lh.n; i++) {
80102ab3: 83 c2 01 add $0x1,%edx
80102ab6: 39 15 28 22 11 80 cmp %edx,0x80112228
80102abc: 7f ea jg 80102aa8 <write_head+0x38>
hb->block[i] = log.lh.block[i];
}
bwrite(buf);
80102abe: 89 34 24 mov %esi,(%esp)
80102ac1: e8 ca d6 ff ff call 80100190 <bwrite>
brelse(buf);
80102ac6: 89 34 24 mov %esi,(%esp)
80102ac9: e8 f2 d6 ff ff call 801001c0 <brelse>
}
80102ace: 83 c4 10 add $0x10,%esp
80102ad1: 5b pop %ebx
80102ad2: 5e pop %esi
80102ad3: 5d pop %ebp
80102ad4: c3 ret
80102ad5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102ad9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102ae0 <initlog>:
static void recover_from_log(void);
static void commit();
void
initlog(int dev)
{
80102ae0: 55 push %ebp
80102ae1: 89 e5 mov %esp,%ebp
80102ae3: 56 push %esi
80102ae4: 53 push %ebx
80102ae5: 83 ec 30 sub $0x30,%esp
80102ae8: 8b 5d 08 mov 0x8(%ebp),%ebx
if (sizeof(struct logheader) >= BSIZE)
panic("initlog: too big logheader");
struct superblock sb;
initlock(&log.lock, "log");
80102aeb: c7 44 24 04 1c 7b 10 movl $0x80107b1c,0x4(%esp)
80102af2: 80
80102af3: c7 04 24 e0 21 11 80 movl $0x801121e0,(%esp)
80102afa: e8 41 1d 00 00 call 80104840 <initlock>
readsb(dev, &sb);
80102aff: 8d 45 dc lea -0x24(%ebp),%eax
80102b02: 89 44 24 04 mov %eax,0x4(%esp)
80102b06: 89 1c 24 mov %ebx,(%esp)
80102b09: e8 42 e8 ff ff call 80101350 <readsb>
log.start = sb.logstart;
80102b0e: 8b 45 ec mov -0x14(%ebp),%eax
log.size = sb.nlog;
80102b11: 8b 55 e8 mov -0x18(%ebp),%edx
// Read the log header from disk into the in-memory log header
static void
read_head(void)
{
struct buf *buf = bread(log.dev, log.start);
80102b14: 89 1c 24 mov %ebx,(%esp)
struct superblock sb;
initlock(&log.lock, "log");
readsb(dev, &sb);
log.start = sb.logstart;
log.size = sb.nlog;
log.dev = dev;
80102b17: 89 1d 24 22 11 80 mov %ebx,0x80112224
// Read the log header from disk into the in-memory log header
static void
read_head(void)
{
struct buf *buf = bread(log.dev, log.start);
80102b1d: 89 44 24 04 mov %eax,0x4(%esp)
struct superblock sb;
initlock(&log.lock, "log");
readsb(dev, &sb);
log.start = sb.logstart;
log.size = sb.nlog;
80102b21: 89 15 18 22 11 80 mov %edx,0x80112218
panic("initlog: too big logheader");
struct superblock sb;
initlock(&log.lock, "log");
readsb(dev, &sb);
log.start = sb.logstart;
80102b27: a3 14 22 11 80 mov %eax,0x80112214
// Read the log header from disk into the in-memory log header
static void
read_head(void)
{
struct buf *buf = bread(log.dev, log.start);
80102b2c: e8 8f d5 ff ff call 801000c0 <bread>
struct logheader *lh = (struct logheader *) (buf->data);
int i;
log.lh.n = lh->n;
for (i = 0; i < log.lh.n; i++) {
80102b31: 31 d2 xor %edx,%edx
read_head(void)
{
struct buf *buf = bread(log.dev, log.start);
struct logheader *lh = (struct logheader *) (buf->data);
int i;
log.lh.n = lh->n;
80102b33: 8b 58 18 mov 0x18(%eax),%ebx
80102b36: 8d 70 18 lea 0x18(%eax),%esi
for (i = 0; i < log.lh.n; i++) {
80102b39: 85 db test %ebx,%ebx
read_head(void)
{
struct buf *buf = bread(log.dev, log.start);
struct logheader *lh = (struct logheader *) (buf->data);
int i;
log.lh.n = lh->n;
80102b3b: 89 1d 28 22 11 80 mov %ebx,0x80112228
for (i = 0; i < log.lh.n; i++) {
80102b41: 7e 17 jle 80102b5a <initlog+0x7a>
80102b43: 90 nop
80102b44: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
log.lh.block[i] = lh->block[i];
80102b48: 8b 4c 96 04 mov 0x4(%esi,%edx,4),%ecx
80102b4c: 89 0c 95 2c 22 11 80 mov %ecx,-0x7feeddd4(,%edx,4)
{
struct buf *buf = bread(log.dev, log.start);
struct logheader *lh = (struct logheader *) (buf->data);
int i;
log.lh.n = lh->n;
for (i = 0; i < log.lh.n; i++) {
80102b53: 83 c2 01 add $0x1,%edx
80102b56: 39 da cmp %ebx,%edx
80102b58: 75 ee jne 80102b48 <initlog+0x68>
log.lh.block[i] = lh->block[i];
}
brelse(buf);
80102b5a: 89 04 24 mov %eax,(%esp)
80102b5d: e8 5e d6 ff ff call 801001c0 <brelse>
static void
recover_from_log(void)
{
read_head();
install_trans(); // if committed, copy from log to disk
80102b62: e8 69 fe ff ff call 801029d0 <install_trans>
log.lh.n = 0;
80102b67: c7 05 28 22 11 80 00 movl $0x0,0x80112228
80102b6e: 00 00 00
write_head(); // clear the log
80102b71: e8 fa fe ff ff call 80102a70 <write_head>
readsb(dev, &sb);
log.start = sb.logstart;
log.size = sb.nlog;
log.dev = dev;
recover_from_log();
}
80102b76: 83 c4 30 add $0x30,%esp
80102b79: 5b pop %ebx
80102b7a: 5e pop %esi
80102b7b: 5d pop %ebp
80102b7c: c3 ret
80102b7d: 8d 76 00 lea 0x0(%esi),%esi
80102b80 <begin_op>:
}
// called at the start of each FS system call.
void
begin_op(void)
{
80102b80: 55 push %ebp
80102b81: 89 e5 mov %esp,%ebp
80102b83: 83 ec 18 sub $0x18,%esp
acquire(&log.lock);
80102b86: c7 04 24 e0 21 11 80 movl $0x801121e0,(%esp)
80102b8d: e8 2e 1d 00 00 call 801048c0 <acquire>
80102b92: eb 18 jmp 80102bac <begin_op+0x2c>
80102b94: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
while(1){
if(log.committing){
sleep(&log, &log.lock);
80102b98: c7 44 24 04 e0 21 11 movl $0x801121e0,0x4(%esp)
80102b9f: 80
80102ba0: c7 04 24 e0 21 11 80 movl $0x801121e0,(%esp)
80102ba7: e8 b4 11 00 00 call 80103d60 <sleep>
void
begin_op(void)
{
acquire(&log.lock);
while(1){
if(log.committing){
80102bac: a1 20 22 11 80 mov 0x80112220,%eax
80102bb1: 85 c0 test %eax,%eax
80102bb3: 75 e3 jne 80102b98 <begin_op+0x18>
sleep(&log, &log.lock);
} else if(log.lh.n + (log.outstanding+1)*MAXOPBLOCKS > LOGSIZE){
80102bb5: a1 1c 22 11 80 mov 0x8011221c,%eax
80102bba: 8b 15 28 22 11 80 mov 0x80112228,%edx
80102bc0: 83 c0 01 add $0x1,%eax
80102bc3: 8d 0c 80 lea (%eax,%eax,4),%ecx
80102bc6: 8d 14 4a lea (%edx,%ecx,2),%edx
80102bc9: 83 fa 1e cmp $0x1e,%edx
80102bcc: 7f ca jg 80102b98 <begin_op+0x18>
// this op might exhaust log space; wait for commit.
sleep(&log, &log.lock);
} else {
log.outstanding += 1;
release(&log.lock);
80102bce: c7 04 24 e0 21 11 80 movl $0x801121e0,(%esp)
sleep(&log, &log.lock);
} else if(log.lh.n + (log.outstanding+1)*MAXOPBLOCKS > LOGSIZE){
// this op might exhaust log space; wait for commit.
sleep(&log, &log.lock);
} else {
log.outstanding += 1;
80102bd5: a3 1c 22 11 80 mov %eax,0x8011221c
release(&log.lock);
80102bda: e8 11 1e 00 00 call 801049f0 <release>
break;
}
}
}
80102bdf: c9 leave
80102be0: c3 ret
80102be1: eb 0d jmp 80102bf0 <end_op>
80102be3: 90 nop
80102be4: 90 nop
80102be5: 90 nop
80102be6: 90 nop
80102be7: 90 nop
80102be8: 90 nop
80102be9: 90 nop
80102bea: 90 nop
80102beb: 90 nop
80102bec: 90 nop
80102bed: 90 nop
80102bee: 90 nop
80102bef: 90 nop
80102bf0 <end_op>:
// called at the end of each FS system call.
// commits if this was the last outstanding operation.
void
end_op(void)
{
80102bf0: 55 push %ebp
80102bf1: 89 e5 mov %esp,%ebp
80102bf3: 57 push %edi
80102bf4: 56 push %esi
80102bf5: 53 push %ebx
80102bf6: 83 ec 1c sub $0x1c,%esp
int do_commit = 0;
acquire(&log.lock);
80102bf9: c7 04 24 e0 21 11 80 movl $0x801121e0,(%esp)
80102c00: e8 bb 1c 00 00 call 801048c0 <acquire>
log.outstanding -= 1;
80102c05: a1 1c 22 11 80 mov 0x8011221c,%eax
if(log.committing)
80102c0a: 8b 15 20 22 11 80 mov 0x80112220,%edx
end_op(void)
{
int do_commit = 0;
acquire(&log.lock);
log.outstanding -= 1;
80102c10: 83 e8 01 sub $0x1,%eax
if(log.committing)
80102c13: 85 d2 test %edx,%edx
end_op(void)
{
int do_commit = 0;
acquire(&log.lock);
log.outstanding -= 1;
80102c15: a3 1c 22 11 80 mov %eax,0x8011221c
if(log.committing)
80102c1a: 0f 85 f3 00 00 00 jne 80102d13 <end_op+0x123>
panic("log.committing");
if(log.outstanding == 0){
80102c20: 85 c0 test %eax,%eax
80102c22: 0f 85 cb 00 00 00 jne 80102cf3 <end_op+0x103>
log.committing = 1;
} else {
// begin_op() may be waiting for log space.
wakeup(&log);
}
release(&log.lock);
80102c28: c7 04 24 e0 21 11 80 movl $0x801121e0,(%esp)
}
static void
commit()
{
if (log.lh.n > 0) {
80102c2f: 31 db xor %ebx,%ebx
log.outstanding -= 1;
if(log.committing)
panic("log.committing");
if(log.outstanding == 0){
do_commit = 1;
log.committing = 1;
80102c31: c7 05 20 22 11 80 01 movl $0x1,0x80112220
80102c38: 00 00 00
} else {
// begin_op() may be waiting for log space.
wakeup(&log);
}
release(&log.lock);
80102c3b: e8 b0 1d 00 00 call 801049f0 <release>
}
static void
commit()
{
if (log.lh.n > 0) {
80102c40: a1 28 22 11 80 mov 0x80112228,%eax
80102c45: 85 c0 test %eax,%eax
80102c47: 0f 8e 90 00 00 00 jle 80102cdd <end_op+0xed>
80102c4d: 8d 76 00 lea 0x0(%esi),%esi
write_log(void)
{
int tail;
for (tail = 0; tail < log.lh.n; tail++) {
struct buf *to = bread(log.dev, log.start+tail+1); // log block
80102c50: a1 14 22 11 80 mov 0x80112214,%eax
80102c55: 01 d8 add %ebx,%eax
80102c57: 83 c0 01 add $0x1,%eax
80102c5a: 89 44 24 04 mov %eax,0x4(%esp)
80102c5e: a1 24 22 11 80 mov 0x80112224,%eax
80102c63: 89 04 24 mov %eax,(%esp)
80102c66: e8 55 d4 ff ff call 801000c0 <bread>
80102c6b: 89 c6 mov %eax,%esi
struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block
80102c6d: 8b 04 9d 2c 22 11 80 mov -0x7feeddd4(,%ebx,4),%eax
static void
write_log(void)
{
int tail;
for (tail = 0; tail < log.lh.n; tail++) {
80102c74: 83 c3 01 add $0x1,%ebx
struct buf *to = bread(log.dev, log.start+tail+1); // log block
struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block
80102c77: 89 44 24 04 mov %eax,0x4(%esp)
80102c7b: a1 24 22 11 80 mov 0x80112224,%eax
80102c80: 89 04 24 mov %eax,(%esp)
80102c83: e8 38 d4 ff ff call 801000c0 <bread>
memmove(to->data, from->data, BSIZE);
80102c88: c7 44 24 08 00 02 00 movl $0x200,0x8(%esp)
80102c8f: 00
{
int tail;
for (tail = 0; tail < log.lh.n; tail++) {
struct buf *to = bread(log.dev, log.start+tail+1); // log block
struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block
80102c90: 89 c7 mov %eax,%edi
memmove(to->data, from->data, BSIZE);
80102c92: 8d 40 18 lea 0x18(%eax),%eax
80102c95: 89 44 24 04 mov %eax,0x4(%esp)
80102c99: 8d 46 18 lea 0x18(%esi),%eax
80102c9c: 89 04 24 mov %eax,(%esp)
80102c9f: e8 3c 1e 00 00 call 80104ae0 <memmove>
bwrite(to); // write the log
80102ca4: 89 34 24 mov %esi,(%esp)
80102ca7: e8 e4 d4 ff ff call 80100190 <bwrite>
brelse(from);
80102cac: 89 3c 24 mov %edi,(%esp)
80102caf: e8 0c d5 ff ff call 801001c0 <brelse>
brelse(to);
80102cb4: 89 34 24 mov %esi,(%esp)
80102cb7: e8 04 d5 ff ff call 801001c0 <brelse>
static void
write_log(void)
{
int tail;
for (tail = 0; tail < log.lh.n; tail++) {
80102cbc: 3b 1d 28 22 11 80 cmp 0x80112228,%ebx
80102cc2: 7c 8c jl 80102c50 <end_op+0x60>
static void
commit()
{
if (log.lh.n > 0) {
write_log(); // Write modified blocks from cache to log
write_head(); // Write header to disk -- the real commit
80102cc4: e8 a7 fd ff ff call 80102a70 <write_head>
install_trans(); // Now install writes to home locations
80102cc9: e8 02 fd ff ff call 801029d0 <install_trans>
log.lh.n = 0;
80102cce: c7 05 28 22 11 80 00 movl $0x0,0x80112228
80102cd5: 00 00 00
write_head(); // Erase the transaction from the log
80102cd8: e8 93 fd ff ff call 80102a70 <write_head>
if(do_commit){
// call commit w/o holding locks, since not allowed
// to sleep with locks.
commit();
acquire(&log.lock);
80102cdd: c7 04 24 e0 21 11 80 movl $0x801121e0,(%esp)
80102ce4: e8 d7 1b 00 00 call 801048c0 <acquire>
log.committing = 0;
80102ce9: c7 05 20 22 11 80 00 movl $0x0,0x80112220
80102cf0: 00 00 00
wakeup(&log);
80102cf3: c7 04 24 e0 21 11 80 movl $0x801121e0,(%esp)
80102cfa: e8 91 12 00 00 call 80103f90 <wakeup>
release(&log.lock);
80102cff: c7 04 24 e0 21 11 80 movl $0x801121e0,(%esp)
80102d06: e8 e5 1c 00 00 call 801049f0 <release>
}
}
80102d0b: 83 c4 1c add $0x1c,%esp
80102d0e: 5b pop %ebx
80102d0f: 5e pop %esi
80102d10: 5f pop %edi
80102d11: 5d pop %ebp
80102d12: c3 ret
int do_commit = 0;
acquire(&log.lock);
log.outstanding -= 1;
if(log.committing)
panic("log.committing");
80102d13: c7 04 24 20 7b 10 80 movl $0x80107b20,(%esp)
80102d1a: e8 11 d6 ff ff call 80100330 <panic>
80102d1f: 90 nop
80102d20 <log_write>:
// modify bp->data[]
// log_write(bp)
// brelse(bp)
void
log_write(struct buf *b)
{
80102d20: 55 push %ebp
80102d21: 89 e5 mov %esp,%ebp
80102d23: 53 push %ebx
80102d24: 83 ec 14 sub $0x14,%esp
int i;
if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1)
80102d27: a1 28 22 11 80 mov 0x80112228,%eax
// modify bp->data[]
// log_write(bp)
// brelse(bp)
void
log_write(struct buf *b)
{
80102d2c: 8b 5d 08 mov 0x8(%ebp),%ebx
int i;
if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1)
80102d2f: 83 f8 1d cmp $0x1d,%eax
80102d32: 0f 8f 98 00 00 00 jg 80102dd0 <log_write+0xb0>
80102d38: 8b 0d 18 22 11 80 mov 0x80112218,%ecx
80102d3e: 8d 51 ff lea -0x1(%ecx),%edx
80102d41: 39 d0 cmp %edx,%eax
80102d43: 0f 8d 87 00 00 00 jge 80102dd0 <log_write+0xb0>
panic("too big a transaction");
if (log.outstanding < 1)
80102d49: a1 1c 22 11 80 mov 0x8011221c,%eax
80102d4e: 85 c0 test %eax,%eax
80102d50: 0f 8e 86 00 00 00 jle 80102ddc <log_write+0xbc>
panic("log_write outside of trans");
acquire(&log.lock);
80102d56: c7 04 24 e0 21 11 80 movl $0x801121e0,(%esp)
80102d5d: e8 5e 1b 00 00 call 801048c0 <acquire>
for (i = 0; i < log.lh.n; i++) {
80102d62: 8b 15 28 22 11 80 mov 0x80112228,%edx
80102d68: 83 fa 00 cmp $0x0,%edx
80102d6b: 7e 54 jle 80102dc1 <log_write+0xa1>
if (log.lh.block[i] == b->blockno) // log absorbtion
80102d6d: 8b 4b 08 mov 0x8(%ebx),%ecx
panic("too big a transaction");
if (log.outstanding < 1)
panic("log_write outside of trans");
acquire(&log.lock);
for (i = 0; i < log.lh.n; i++) {
80102d70: 31 c0 xor %eax,%eax
if (log.lh.block[i] == b->blockno) // log absorbtion
80102d72: 39 0d 2c 22 11 80 cmp %ecx,0x8011222c
80102d78: 75 0f jne 80102d89 <log_write+0x69>
80102d7a: eb 3c jmp 80102db8 <log_write+0x98>
80102d7c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102d80: 39 0c 85 2c 22 11 80 cmp %ecx,-0x7feeddd4(,%eax,4)
80102d87: 74 2f je 80102db8 <log_write+0x98>
panic("too big a transaction");
if (log.outstanding < 1)
panic("log_write outside of trans");
acquire(&log.lock);
for (i = 0; i < log.lh.n; i++) {
80102d89: 83 c0 01 add $0x1,%eax
80102d8c: 39 d0 cmp %edx,%eax
80102d8e: 75 f0 jne 80102d80 <log_write+0x60>
if (log.lh.block[i] == b->blockno) // log absorbtion
break;
}
log.lh.block[i] = b->blockno;
80102d90: 89 0c 95 2c 22 11 80 mov %ecx,-0x7feeddd4(,%edx,4)
if (i == log.lh.n)
log.lh.n++;
80102d97: 83 c2 01 add $0x1,%edx
80102d9a: 89 15 28 22 11 80 mov %edx,0x80112228
b->flags |= B_DIRTY; // prevent eviction
80102da0: 83 0b 04 orl $0x4,(%ebx)
release(&log.lock);
80102da3: c7 45 08 e0 21 11 80 movl $0x801121e0,0x8(%ebp)
}
80102daa: 83 c4 14 add $0x14,%esp
80102dad: 5b pop %ebx
80102dae: 5d pop %ebp
}
log.lh.block[i] = b->blockno;
if (i == log.lh.n)
log.lh.n++;
b->flags |= B_DIRTY; // prevent eviction
release(&log.lock);
80102daf: e9 3c 1c 00 00 jmp 801049f0 <release>
80102db4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
acquire(&log.lock);
for (i = 0; i < log.lh.n; i++) {
if (log.lh.block[i] == b->blockno) // log absorbtion
break;
}
log.lh.block[i] = b->blockno;
80102db8: 89 0c 85 2c 22 11 80 mov %ecx,-0x7feeddd4(,%eax,4)
80102dbf: eb df jmp 80102da0 <log_write+0x80>
80102dc1: 8b 43 08 mov 0x8(%ebx),%eax
80102dc4: a3 2c 22 11 80 mov %eax,0x8011222c
if (i == log.lh.n)
80102dc9: 75 d5 jne 80102da0 <log_write+0x80>
80102dcb: eb ca jmp 80102d97 <log_write+0x77>
80102dcd: 8d 76 00 lea 0x0(%esi),%esi
log_write(struct buf *b)
{
int i;
if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1)
panic("too big a transaction");
80102dd0: c7 04 24 2f 7b 10 80 movl $0x80107b2f,(%esp)
80102dd7: e8 54 d5 ff ff call 80100330 <panic>
if (log.outstanding < 1)
panic("log_write outside of trans");
80102ddc: c7 04 24 45 7b 10 80 movl $0x80107b45,(%esp)
80102de3: e8 48 d5 ff ff call 80100330 <panic>
80102de8: 66 90 xchg %ax,%ax
80102dea: 66 90 xchg %ax,%ax
80102dec: 66 90 xchg %ax,%ax
80102dee: 66 90 xchg %ax,%ax
80102df0 <mpmain>:
}
// Common CPU setup code.
static void
mpmain(void)
{
80102df0: 55 push %ebp
80102df1: 89 e5 mov %esp,%ebp
80102df3: 83 ec 18 sub $0x18,%esp
cprintf("cpu%d: starting\n", cpunum());
80102df6: e8 55 f9 ff ff call 80102750 <cpunum>
80102dfb: c7 04 24 60 7b 10 80 movl $0x80107b60,(%esp)
80102e02: 89 44 24 04 mov %eax,0x4(%esp)
80102e06: e8 15 d8 ff ff call 80100620 <cprintf>
idtinit(); // load idt register
80102e0b: e8 20 30 00 00 call 80105e30 <idtinit>
xchg(&cpu->started, 1); // tell startothers() we're up
80102e10: 65 8b 15 00 00 00 00 mov %gs:0x0,%edx
xchg(volatile uint *addr, uint newval)
{
uint result;
// The + in "+m" denotes a read-modify-write operand.
asm volatile("lock; xchgl %0, %1" :
80102e17: b8 01 00 00 00 mov $0x1,%eax
80102e1c: f0 87 82 a8 00 00 00 lock xchg %eax,0xa8(%edx)
scheduler(); // start running processes
80102e23: e8 88 0d 00 00 call 80103bb0 <scheduler>
80102e28: 90 nop
80102e29: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80102e30 <mpenter>:
}
// Other CPUs jump here from entryother.S.
static void
mpenter(void)
{
80102e30: 55 push %ebp
80102e31: 89 e5 mov %esp,%ebp
80102e33: 83 ec 08 sub $0x8,%esp
switchkvm();
80102e36: e8 85 42 00 00 call 801070c0 <switchkvm>
seginit();
80102e3b: e8 a0 40 00 00 call 80106ee0 <seginit>
lapicinit();
80102e40: e8 1b f8 ff ff call 80102660 <lapicinit>
mpmain();
80102e45: e8 a6 ff ff ff call 80102df0 <mpmain>
80102e4a: 66 90 xchg %ax,%ax
80102e4c: 66 90 xchg %ax,%ax
80102e4e: 66 90 xchg %ax,%ax
80102e50 <main>:
// Bootstrap processor starts running C code here.
// Allocate a real stack and switch to it, first
// doing some setup required for memory allocator to work.
int
main(void)
{
80102e50: 55 push %ebp
80102e51: 89 e5 mov %esp,%ebp
80102e53: 53 push %ebx
80102e54: 83 e4 f0 and $0xfffffff0,%esp
80102e57: 83 ec 10 sub $0x10,%esp
kinit1(end, P2V(4*1024*1024)); // phys page allocator
80102e5a: c7 44 24 04 00 00 40 movl $0x80400000,0x4(%esp)
80102e61: 80
80102e62: c7 04 24 c8 4e 12 80 movl $0x80124ec8,(%esp)
80102e69: e8 62 f5 ff ff call 801023d0 <kinit1>
kvmalloc(); // kernel page table
80102e6e: e8 2d 42 00 00 call 801070a0 <kvmalloc>
mpinit(); // detect other processors
80102e73: e8 a8 01 00 00 call 80103020 <mpinit>
lapicinit(); // interrupt controller
80102e78: e8 e3 f7 ff ff call 80102660 <lapicinit>
80102e7d: 8d 76 00 lea 0x0(%esi),%esi
seginit(); // segment descriptors
80102e80: e8 5b 40 00 00 call 80106ee0 <seginit>
cprintf("\ncpu%d: starting xv6\n\n", cpunum());
80102e85: e8 c6 f8 ff ff call 80102750 <cpunum>
80102e8a: c7 04 24 71 7b 10 80 movl $0x80107b71,(%esp)
80102e91: 89 44 24 04 mov %eax,0x4(%esp)
80102e95: e8 86 d7 ff ff call 80100620 <cprintf>
picinit(); // another interrupt controller
80102e9a: e8 81 03 00 00 call 80103220 <picinit>
ioapicinit(); // another interrupt controller
80102e9f: e8 4c f3 ff ff call 801021f0 <ioapicinit>
consoleinit(); // console hardware
80102ea4: e8 77 da ff ff call 80100920 <consoleinit>
uartinit(); // serial port
80102ea9: e8 42 33 00 00 call 801061f0 <uartinit>
80102eae: 66 90 xchg %ax,%ax
pinit(); // process table
80102eb0: e8 2b 09 00 00 call 801037e0 <pinit>
tvinit(); // trap vectors
80102eb5: e8 d6 2e 00 00 call 80105d90 <tvinit>
binit(); // buffer cache
80102eba: e8 81 d1 ff ff call 80100040 <binit>
80102ebf: 90 nop
fileinit(); // file table
80102ec0: e8 4b de ff ff call 80100d10 <fileinit>
ideinit(); // disk
80102ec5: e8 16 f1 ff ff call 80101fe0 <ideinit>
if(!ismp)
80102eca: a1 c4 22 11 80 mov 0x801122c4,%eax
80102ecf: 85 c0 test %eax,%eax
80102ed1: 0f 84 cb 00 00 00 je 80102fa2 <main+0x152>
// Write entry code to unused memory at 0x7000.
// The linker has placed the image of entryother.S in
// _binary_entryother_start.
code = P2V(0x7000);
memmove(code, _binary_entryother_start, (uint)_binary_entryother_size);
80102ed7: c7 44 24 08 8a 00 00 movl $0x8a,0x8(%esp)
80102ede: 00
for(c = cpus; c < cpus+ncpu; c++){
80102edf: bb e0 22 11 80 mov $0x801122e0,%ebx
// Write entry code to unused memory at 0x7000.
// The linker has placed the image of entryother.S in
// _binary_entryother_start.
code = P2V(0x7000);
memmove(code, _binary_entryother_start, (uint)_binary_entryother_size);
80102ee4: c7 44 24 04 8c b4 10 movl $0x8010b48c,0x4(%esp)
80102eeb: 80
80102eec: c7 04 24 00 70 00 80 movl $0x80007000,(%esp)
80102ef3: e8 e8 1b 00 00 call 80104ae0 <memmove>
for(c = cpus; c < cpus+ncpu; c++){
80102ef8: a1 e0 28 11 80 mov 0x801128e0,%eax
80102efd: 8d 04 40 lea (%eax,%eax,2),%eax
80102f00: c1 e0 06 shl $0x6,%eax
80102f03: 05 e0 22 11 80 add $0x801122e0,%eax
80102f08: 39 d8 cmp %ebx,%eax
80102f0a: 76 78 jbe 80102f84 <main+0x134>
80102f0c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(c == cpus+cpunum()) // We've started already.
80102f10: e8 3b f8 ff ff call 80102750 <cpunum>
80102f15: 8d 04 40 lea (%eax,%eax,2),%eax
80102f18: c1 e0 06 shl $0x6,%eax
80102f1b: 05 e0 22 11 80 add $0x801122e0,%eax
80102f20: 39 c3 cmp %eax,%ebx
80102f22: 74 46 je 80102f6a <main+0x11a>
continue;
// Tell entryother.S what stack to use, where to enter, and what
// pgdir to use. We cannot use kpgdir yet, because the AP processor
// is running in low memory, so we use entrypgdir for the APs too.
stack = kalloc();
80102f24: e8 67 f5 ff ff call 80102490 <kalloc>
*(void**)(code-4) = stack + KSTACKSIZE;
*(void**)(code-8) = mpenter;
80102f29: c7 05 f8 6f 00 80 30 movl $0x80102e30,0x80006ff8
80102f30: 2e 10 80
*(int**)(code-12) = (void *) V2P(entrypgdir);
80102f33: c7 05 f4 6f 00 80 00 movl $0x10a000,0x80006ff4
80102f3a: a0 10 00
// Tell entryother.S what stack to use, where to enter, and what
// pgdir to use. We cannot use kpgdir yet, because the AP processor
// is running in low memory, so we use entrypgdir for the APs too.
stack = kalloc();
*(void**)(code-4) = stack + KSTACKSIZE;
80102f3d: 05 00 10 00 00 add $0x1000,%eax
80102f42: a3 fc 6f 00 80 mov %eax,0x80006ffc
*(void**)(code-8) = mpenter;
*(int**)(code-12) = (void *) V2P(entrypgdir);
lapicstartap(c->apicid, V2P(code));
80102f47: 0f b6 03 movzbl (%ebx),%eax
80102f4a: c7 44 24 04 00 70 00 movl $0x7000,0x4(%esp)
80102f51: 00
80102f52: 89 04 24 mov %eax,(%esp)
80102f55: e8 c6 f8 ff ff call 80102820 <lapicstartap>
80102f5a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
// wait for cpu to finish mpmain()
while(c->started == 0)
80102f60: 8b 83 a8 00 00 00 mov 0xa8(%ebx),%eax
80102f66: 85 c0 test %eax,%eax
80102f68: 74 f6 je 80102f60 <main+0x110>
// The linker has placed the image of entryother.S in
// _binary_entryother_start.
code = P2V(0x7000);
memmove(code, _binary_entryother_start, (uint)_binary_entryother_size);
for(c = cpus; c < cpus+ncpu; c++){
80102f6a: a1 e0 28 11 80 mov 0x801128e0,%eax
80102f6f: 81 c3 c0 00 00 00 add $0xc0,%ebx
80102f75: 8d 04 40 lea (%eax,%eax,2),%eax
80102f78: c1 e0 06 shl $0x6,%eax
80102f7b: 05 e0 22 11 80 add $0x801122e0,%eax
80102f80: 39 c3 cmp %eax,%ebx
80102f82: 72 8c jb 80102f10 <main+0xc0>
fileinit(); // file table
ideinit(); // disk
if(!ismp)
timerinit(); // uniprocessor timer
startothers(); // start other processors
kinit2(P2V(4*1024*1024), P2V(PHYSTOP)); // must come after startothers()
80102f84: c7 44 24 04 00 00 00 movl $0x8e000000,0x4(%esp)
80102f8b: 8e
80102f8c: c7 04 24 00 00 40 80 movl $0x80400000,(%esp)
80102f93: e8 a8 f4 ff ff call 80102440 <kinit2>
userinit(); // first user process
80102f98: e8 73 08 00 00 call 80103810 <userinit>
mpmain(); // finish this processor's setup
80102f9d: e8 4e fe ff ff call 80102df0 <mpmain>
tvinit(); // trap vectors
binit(); // buffer cache
fileinit(); // file table
ideinit(); // disk
if(!ismp)
timerinit(); // uniprocessor timer
80102fa2: e8 89 2d 00 00 call 80105d30 <timerinit>
80102fa7: e9 2b ff ff ff jmp 80102ed7 <main+0x87>
80102fac: 66 90 xchg %ax,%ax
80102fae: 66 90 xchg %ax,%ax
80102fb0 <mpsearch1>:
}
// Look for an MP structure in the len bytes at addr.
static struct mp*
mpsearch1(uint a, int len)
{
80102fb0: 55 push %ebp
80102fb1: 89 e5 mov %esp,%ebp
80102fb3: 56 push %esi
uchar *e, *p, *addr;
addr = P2V(a);
80102fb4: 8d b0 00 00 00 80 lea -0x80000000(%eax),%esi
}
// Look for an MP structure in the len bytes at addr.
static struct mp*
mpsearch1(uint a, int len)
{
80102fba: 53 push %ebx
uchar *e, *p, *addr;
addr = P2V(a);
e = addr+len;
80102fbb: 8d 1c 16 lea (%esi,%edx,1),%ebx
}
// Look for an MP structure in the len bytes at addr.
static struct mp*
mpsearch1(uint a, int len)
{
80102fbe: 83 ec 10 sub $0x10,%esp
uchar *e, *p, *addr;
addr = P2V(a);
e = addr+len;
for(p = addr; p < e; p += sizeof(struct mp))
80102fc1: 39 de cmp %ebx,%esi
80102fc3: 73 3c jae 80103001 <mpsearch1+0x51>
80102fc5: 8d 76 00 lea 0x0(%esi),%esi
if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0)
80102fc8: c7 44 24 08 04 00 00 movl $0x4,0x8(%esp)
80102fcf: 00
80102fd0: c7 44 24 04 88 7b 10 movl $0x80107b88,0x4(%esp)
80102fd7: 80
80102fd8: 89 34 24 mov %esi,(%esp)
80102fdb: e8 b0 1a 00 00 call 80104a90 <memcmp>
80102fe0: 85 c0 test %eax,%eax
80102fe2: 75 16 jne 80102ffa <mpsearch1+0x4a>
80102fe4: 31 c9 xor %ecx,%ecx
80102fe6: 31 d2 xor %edx,%edx
{
int i, sum;
sum = 0;
for(i=0; i<len; i++)
sum += addr[i];
80102fe8: 0f b6 04 16 movzbl (%esi,%edx,1),%eax
sum(uchar *addr, int len)
{
int i, sum;
sum = 0;
for(i=0; i<len; i++)
80102fec: 83 c2 01 add $0x1,%edx
sum += addr[i];
80102fef: 01 c1 add %eax,%ecx
sum(uchar *addr, int len)
{
int i, sum;
sum = 0;
for(i=0; i<len; i++)
80102ff1: 83 fa 10 cmp $0x10,%edx
80102ff4: 75 f2 jne 80102fe8 <mpsearch1+0x38>
uchar *e, *p, *addr;
addr = P2V(a);
e = addr+len;
for(p = addr; p < e; p += sizeof(struct mp))
if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0)
80102ff6: 84 c9 test %cl,%cl
80102ff8: 74 10 je 8010300a <mpsearch1+0x5a>
{
uchar *e, *p, *addr;
addr = P2V(a);
e = addr+len;
for(p = addr; p < e; p += sizeof(struct mp))
80102ffa: 83 c6 10 add $0x10,%esi
80102ffd: 39 f3 cmp %esi,%ebx
80102fff: 77 c7 ja 80102fc8 <mpsearch1+0x18>
if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0)
return (struct mp*)p;
return 0;
}
80103001: 83 c4 10 add $0x10,%esp
addr = P2V(a);
e = addr+len;
for(p = addr; p < e; p += sizeof(struct mp))
if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0)
return (struct mp*)p;
return 0;
80103004: 31 c0 xor %eax,%eax
}
80103006: 5b pop %ebx
80103007: 5e pop %esi
80103008: 5d pop %ebp
80103009: c3 ret
8010300a: 83 c4 10 add $0x10,%esp
8010300d: 89 f0 mov %esi,%eax
8010300f: 5b pop %ebx
80103010: 5e pop %esi
80103011: 5d pop %ebp
80103012: c3 ret
80103013: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80103019: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80103020 <mpinit>:
return conf;
}
void
mpinit(void)
{
80103020: 55 push %ebp
80103021: 89 e5 mov %esp,%ebp
80103023: 57 push %edi
80103024: 56 push %esi
80103025: 53 push %ebx
80103026: 83 ec 1c sub $0x1c,%esp
uchar *bda;
uint p;
struct mp *mp;
bda = (uchar *) P2V(0x400);
if((p = ((bda[0x0F]<<8)| bda[0x0E]) << 4)){
80103029: 0f b6 05 0f 04 00 80 movzbl 0x8000040f,%eax
80103030: 0f b6 15 0e 04 00 80 movzbl 0x8000040e,%edx
80103037: c1 e0 08 shl $0x8,%eax
8010303a: 09 d0 or %edx,%eax
8010303c: c1 e0 04 shl $0x4,%eax
8010303f: 85 c0 test %eax,%eax
80103041: 75 1b jne 8010305e <mpinit+0x3e>
if((mp = mpsearch1(p, 1024)))
return mp;
} else {
p = ((bda[0x14]<<8)|bda[0x13])*1024;
80103043: 0f b6 05 14 04 00 80 movzbl 0x80000414,%eax
8010304a: 0f b6 15 13 04 00 80 movzbl 0x80000413,%edx
80103051: c1 e0 08 shl $0x8,%eax
80103054: 09 d0 or %edx,%eax
80103056: c1 e0 0a shl $0xa,%eax
if((mp = mpsearch1(p-1024, 1024)))
80103059: 2d 00 04 00 00 sub $0x400,%eax
uint p;
struct mp *mp;
bda = (uchar *) P2V(0x400);
if((p = ((bda[0x0F]<<8)| bda[0x0E]) << 4)){
if((mp = mpsearch1(p, 1024)))
8010305e: ba 00 04 00 00 mov $0x400,%edx
80103063: e8 48 ff ff ff call 80102fb0 <mpsearch1>
80103068: 85 c0 test %eax,%eax
8010306a: 89 c7 mov %eax,%edi
8010306c: 0f 84 4e 01 00 00 je 801031c0 <mpinit+0x1a0>
mpconfig(struct mp **pmp)
{
struct mpconf *conf;
struct mp *mp;
if((mp = mpsearch()) == 0 || mp->physaddr == 0)
80103072: 8b 77 04 mov 0x4(%edi),%esi
80103075: 85 f6 test %esi,%esi
80103077: 0f 84 ce 00 00 00 je 8010314b <mpinit+0x12b>
return 0;
conf = (struct mpconf*) P2V((uint) mp->physaddr);
8010307d: 8d 86 00 00 00 80 lea -0x80000000(%esi),%eax
if(memcmp(conf, "PCMP", 4) != 0)
80103083: c7 44 24 08 04 00 00 movl $0x4,0x8(%esp)
8010308a: 00
8010308b: c7 44 24 04 8d 7b 10 movl $0x80107b8d,0x4(%esp)
80103092: 80
80103093: 89 04 24 mov %eax,(%esp)
struct mpconf *conf;
struct mp *mp;
if((mp = mpsearch()) == 0 || mp->physaddr == 0)
return 0;
conf = (struct mpconf*) P2V((uint) mp->physaddr);
80103096: 89 45 e4 mov %eax,-0x1c(%ebp)
if(memcmp(conf, "PCMP", 4) != 0)
80103099: e8 f2 19 00 00 call 80104a90 <memcmp>
8010309e: 85 c0 test %eax,%eax
801030a0: 0f 85 a5 00 00 00 jne 8010314b <mpinit+0x12b>
return 0;
if(conf->version != 1 && conf->version != 4)
801030a6: 0f b6 86 06 00 00 80 movzbl -0x7ffffffa(%esi),%eax
801030ad: 3c 04 cmp $0x4,%al
801030af: 0f 85 29 01 00 00 jne 801031de <mpinit+0x1be>
return 0;
if(sum((uchar*)conf, conf->length) != 0)
801030b5: 0f b7 86 04 00 00 80 movzwl -0x7ffffffc(%esi),%eax
sum(uchar *addr, int len)
{
int i, sum;
sum = 0;
for(i=0; i<len; i++)
801030bc: 85 c0 test %eax,%eax
801030be: 74 1d je 801030dd <mpinit+0xbd>
static uchar
sum(uchar *addr, int len)
{
int i, sum;
sum = 0;
801030c0: 31 c9 xor %ecx,%ecx
for(i=0; i<len; i++)
801030c2: 31 d2 xor %edx,%edx
801030c4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
sum += addr[i];
801030c8: 0f b6 9c 16 00 00 00 movzbl -0x80000000(%esi,%edx,1),%ebx
801030cf: 80
sum(uchar *addr, int len)
{
int i, sum;
sum = 0;
for(i=0; i<len; i++)
801030d0: 83 c2 01 add $0x1,%edx
sum += addr[i];
801030d3: 01 d9 add %ebx,%ecx
sum(uchar *addr, int len)
{
int i, sum;
sum = 0;
for(i=0; i<len; i++)
801030d5: 39 d0 cmp %edx,%eax
801030d7: 7f ef jg 801030c8 <mpinit+0xa8>
conf = (struct mpconf*) P2V((uint) mp->physaddr);
if(memcmp(conf, "PCMP", 4) != 0)
return 0;
if(conf->version != 1 && conf->version != 4)
return 0;
if(sum((uchar*)conf, conf->length) != 0)
801030d9: 84 c9 test %cl,%cl
801030db: 75 6e jne 8010314b <mpinit+0x12b>
struct mp *mp;
struct mpconf *conf;
struct mpproc *proc;
struct mpioapic *ioapic;
if((conf = mpconfig(&mp)) == 0)
801030dd: 8b 5d e4 mov -0x1c(%ebp),%ebx
801030e0: 85 db test %ebx,%ebx
801030e2: 74 67 je 8010314b <mpinit+0x12b>
return;
ismp = 1;
801030e4: c7 05 c4 22 11 80 01 movl $0x1,0x801122c4
801030eb: 00 00 00
lapic = (uint*)conf->lapicaddr;
801030ee: 8b 86 24 00 00 80 mov -0x7fffffdc(%esi),%eax
801030f4: a3 dc 21 11 80 mov %eax,0x801121dc
for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){
801030f9: 0f b7 8e 04 00 00 80 movzwl -0x7ffffffc(%esi),%ecx
80103100: 8d 86 2c 00 00 80 lea -0x7fffffd4(%esi),%eax
80103106: 01 d9 add %ebx,%ecx
80103108: 39 c8 cmp %ecx,%eax
8010310a: 0f 83 90 00 00 00 jae 801031a0 <mpinit+0x180>
switch(*p){
80103110: 80 38 04 cmpb $0x4,(%eax)
80103113: 77 7b ja 80103190 <mpinit+0x170>
80103115: 0f b6 10 movzbl (%eax),%edx
80103118: ff 24 95 94 7b 10 80 jmp *-0x7fef846c(,%edx,4)
8010311f: 90 nop
p += sizeof(struct mpioapic);
continue;
case MPBUS:
case MPIOINTR:
case MPLINTR:
p += 8;
80103120: 83 c0 08 add $0x8,%eax
if((conf = mpconfig(&mp)) == 0)
return;
ismp = 1;
lapic = (uint*)conf->lapicaddr;
for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){
80103123: 39 c1 cmp %eax,%ecx
80103125: 77 e9 ja 80103110 <mpinit+0xf0>
default:
ismp = 0;
break;
}
}
if(!ismp){
80103127: a1 c4 22 11 80 mov 0x801122c4,%eax
8010312c: 85 c0 test %eax,%eax
8010312e: 75 70 jne 801031a0 <mpinit+0x180>
// Didn't like what we found; fall back to no MP.
ncpu = 1;
80103130: c7 05 e0 28 11 80 01 movl $0x1,0x801128e0
80103137: 00 00 00
lapic = 0;
8010313a: c7 05 dc 21 11 80 00 movl $0x0,0x801121dc
80103141: 00 00 00
ioapicid = 0;
80103144: c6 05 c0 22 11 80 00 movb $0x0,0x801122c0
// Bochs doesn't support IMCR, so this doesn't run on Bochs.
// But it would on real hardware.
outb(0x22, 0x70); // Select IMCR
outb(0x23, inb(0x23) | 1); // Mask external interrupts.
}
8010314b: 83 c4 1c add $0x1c,%esp
8010314e: 5b pop %ebx
8010314f: 5e pop %esi
80103150: 5f pop %edi
80103151: 5d pop %ebp
80103152: c3 ret
80103153: 90 nop
80103154: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
lapic = (uint*)conf->lapicaddr;
for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){
switch(*p){
case MPPROC:
proc = (struct mpproc*)p;
if(ncpu < NCPU) {
80103158: 8b 15 e0 28 11 80 mov 0x801128e0,%edx
8010315e: 83 fa 07 cmp $0x7,%edx
80103161: 7f 17 jg 8010317a <mpinit+0x15a>
cpus[ncpu].apicid = proc->apicid; // apicid may differ from ncpu
80103163: 0f b6 58 01 movzbl 0x1(%eax),%ebx
80103167: 8d 14 52 lea (%edx,%edx,2),%edx
ncpu++;
8010316a: 83 05 e0 28 11 80 01 addl $0x1,0x801128e0
for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){
switch(*p){
case MPPROC:
proc = (struct mpproc*)p;
if(ncpu < NCPU) {
cpus[ncpu].apicid = proc->apicid; // apicid may differ from ncpu
80103171: c1 e2 06 shl $0x6,%edx
80103174: 88 9a e0 22 11 80 mov %bl,-0x7feedd20(%edx)
ncpu++;
}
p += sizeof(struct mpproc);
8010317a: 83 c0 14 add $0x14,%eax
continue;
8010317d: eb a4 jmp 80103123 <mpinit+0x103>
8010317f: 90 nop
case MPIOAPIC:
ioapic = (struct mpioapic*)p;
ioapicid = ioapic->apicno;
80103180: 0f b6 50 01 movzbl 0x1(%eax),%edx
p += sizeof(struct mpioapic);
80103184: 83 c0 08 add $0x8,%eax
}
p += sizeof(struct mpproc);
continue;
case MPIOAPIC:
ioapic = (struct mpioapic*)p;
ioapicid = ioapic->apicno;
80103187: 88 15 c0 22 11 80 mov %dl,0x801122c0
p += sizeof(struct mpioapic);
continue;
8010318d: eb 94 jmp 80103123 <mpinit+0x103>
8010318f: 90 nop
case MPIOINTR:
case MPLINTR:
p += 8;
continue;
default:
ismp = 0;
80103190: c7 05 c4 22 11 80 00 movl $0x0,0x801122c4
80103197: 00 00 00
break;
8010319a: eb 87 jmp 80103123 <mpinit+0x103>
8010319c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
lapic = 0;
ioapicid = 0;
return;
}
if(mp->imcrp){
801031a0: 80 7f 0c 00 cmpb $0x0,0xc(%edi)
801031a4: 74 a5 je 8010314b <mpinit+0x12b>
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
801031a6: ba 22 00 00 00 mov $0x22,%edx
801031ab: b8 70 00 00 00 mov $0x70,%eax
801031b0: ee out %al,(%dx)
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801031b1: b2 23 mov $0x23,%dl
801031b3: ec in (%dx),%al
// Bochs doesn't support IMCR, so this doesn't run on Bochs.
// But it would on real hardware.
outb(0x22, 0x70); // Select IMCR
outb(0x23, inb(0x23) | 1); // Mask external interrupts.
801031b4: 83 c8 01 or $0x1,%eax
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
801031b7: ee out %al,(%dx)
}
801031b8: 83 c4 1c add $0x1c,%esp
801031bb: 5b pop %ebx
801031bc: 5e pop %esi
801031bd: 5f pop %edi
801031be: 5d pop %ebp
801031bf: c3 ret
} else {
p = ((bda[0x14]<<8)|bda[0x13])*1024;
if((mp = mpsearch1(p-1024, 1024)))
return mp;
}
return mpsearch1(0xF0000, 0x10000);
801031c0: ba 00 00 01 00 mov $0x10000,%edx
801031c5: b8 00 00 0f 00 mov $0xf0000,%eax
801031ca: e8 e1 fd ff ff call 80102fb0 <mpsearch1>
mpconfig(struct mp **pmp)
{
struct mpconf *conf;
struct mp *mp;
if((mp = mpsearch()) == 0 || mp->physaddr == 0)
801031cf: 85 c0 test %eax,%eax
} else {
p = ((bda[0x14]<<8)|bda[0x13])*1024;
if((mp = mpsearch1(p-1024, 1024)))
return mp;
}
return mpsearch1(0xF0000, 0x10000);
801031d1: 89 c7 mov %eax,%edi
mpconfig(struct mp **pmp)
{
struct mpconf *conf;
struct mp *mp;
if((mp = mpsearch()) == 0 || mp->physaddr == 0)
801031d3: 0f 85 99 fe ff ff jne 80103072 <mpinit+0x52>
801031d9: e9 6d ff ff ff jmp 8010314b <mpinit+0x12b>
return 0;
conf = (struct mpconf*) P2V((uint) mp->physaddr);
if(memcmp(conf, "PCMP", 4) != 0)
return 0;
if(conf->version != 1 && conf->version != 4)
801031de: 3c 01 cmp $0x1,%al
801031e0: 0f 84 cf fe ff ff je 801030b5 <mpinit+0x95>
801031e6: e9 60 ff ff ff jmp 8010314b <mpinit+0x12b>
801031eb: 66 90 xchg %ax,%ax
801031ed: 66 90 xchg %ax,%ax
801031ef: 90 nop
801031f0 <picenable>:
outb(IO_PIC2+1, mask >> 8);
}
void
picenable(int irq)
{
801031f0: 55 push %ebp
picsetmask(irqmask & ~(1<<irq));
801031f1: b8 fe ff ff ff mov $0xfffffffe,%eax
outb(IO_PIC2+1, mask >> 8);
}
void
picenable(int irq)
{
801031f6: 89 e5 mov %esp,%ebp
801031f8: ba 21 00 00 00 mov $0x21,%edx
picsetmask(irqmask & ~(1<<irq));
801031fd: 8b 4d 08 mov 0x8(%ebp),%ecx
80103200: d3 c0 rol %cl,%eax
80103202: 66 23 05 00 b0 10 80 and 0x8010b000,%ax
static ushort irqmask = 0xFFFF & ~(1<<IRQ_SLAVE);
static void
picsetmask(ushort mask)
{
irqmask = mask;
80103209: 66 a3 00 b0 10 80 mov %ax,0x8010b000
8010320f: ee out %al,(%dx)
outb(IO_PIC1+1, mask);
outb(IO_PIC2+1, mask >> 8);
80103210: 66 c1 e8 08 shr $0x8,%ax
80103214: b2 a1 mov $0xa1,%dl
80103216: ee out %al,(%dx)
void
picenable(int irq)
{
picsetmask(irqmask & ~(1<<irq));
}
80103217: 5d pop %ebp
80103218: c3 ret
80103219: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80103220 <picinit>:
// Initialize the 8259A interrupt controllers.
void
picinit(void)
{
80103220: 55 push %ebp
80103221: b8 ff ff ff ff mov $0xffffffff,%eax
80103226: 89 e5 mov %esp,%ebp
80103228: 57 push %edi
80103229: 56 push %esi
8010322a: 53 push %ebx
8010322b: bb 21 00 00 00 mov $0x21,%ebx
80103230: 89 da mov %ebx,%edx
80103232: ee out %al,(%dx)
80103233: b9 a1 00 00 00 mov $0xa1,%ecx
80103238: 89 ca mov %ecx,%edx
8010323a: ee out %al,(%dx)
8010323b: bf 11 00 00 00 mov $0x11,%edi
80103240: be 20 00 00 00 mov $0x20,%esi
80103245: 89 f8 mov %edi,%eax
80103247: 89 f2 mov %esi,%edx
80103249: ee out %al,(%dx)
8010324a: b8 20 00 00 00 mov $0x20,%eax
8010324f: 89 da mov %ebx,%edx
80103251: ee out %al,(%dx)
80103252: b8 04 00 00 00 mov $0x4,%eax
80103257: ee out %al,(%dx)
80103258: b8 03 00 00 00 mov $0x3,%eax
8010325d: ee out %al,(%dx)
8010325e: b3 a0 mov $0xa0,%bl
80103260: 89 f8 mov %edi,%eax
80103262: 89 da mov %ebx,%edx
80103264: ee out %al,(%dx)
80103265: b8 28 00 00 00 mov $0x28,%eax
8010326a: 89 ca mov %ecx,%edx
8010326c: ee out %al,(%dx)
8010326d: b8 02 00 00 00 mov $0x2,%eax
80103272: ee out %al,(%dx)
80103273: b8 03 00 00 00 mov $0x3,%eax
80103278: ee out %al,(%dx)
80103279: bf 68 00 00 00 mov $0x68,%edi
8010327e: 89 f2 mov %esi,%edx
80103280: 89 f8 mov %edi,%eax
80103282: ee out %al,(%dx)
80103283: b9 0a 00 00 00 mov $0xa,%ecx
80103288: 89 c8 mov %ecx,%eax
8010328a: ee out %al,(%dx)
8010328b: 89 f8 mov %edi,%eax
8010328d: 89 da mov %ebx,%edx
8010328f: ee out %al,(%dx)
80103290: 89 c8 mov %ecx,%eax
80103292: ee out %al,(%dx)
outb(IO_PIC1, 0x0a); // read IRR by default
outb(IO_PIC2, 0x68); // OCW3
outb(IO_PIC2, 0x0a); // OCW3
if(irqmask != 0xFFFF)
80103293: 0f b7 05 00 b0 10 80 movzwl 0x8010b000,%eax
8010329a: 66 83 f8 ff cmp $0xffff,%ax
8010329e: 74 0a je 801032aa <picinit+0x8a>
801032a0: b2 21 mov $0x21,%dl
801032a2: ee out %al,(%dx)
static void
picsetmask(ushort mask)
{
irqmask = mask;
outb(IO_PIC1+1, mask);
outb(IO_PIC2+1, mask >> 8);
801032a3: 66 c1 e8 08 shr $0x8,%ax
801032a7: b2 a1 mov $0xa1,%dl
801032a9: ee out %al,(%dx)
outb(IO_PIC2, 0x68); // OCW3
outb(IO_PIC2, 0x0a); // OCW3
if(irqmask != 0xFFFF)
picsetmask(irqmask);
}
801032aa: 5b pop %ebx
801032ab: 5e pop %esi
801032ac: 5f pop %edi
801032ad: 5d pop %ebp
801032ae: c3 ret
801032af: 90 nop
801032b0 <pipealloc>:
int writeopen; // write fd is still open
};
int
pipealloc(struct file **f0, struct file **f1)
{
801032b0: 55 push %ebp
801032b1: 89 e5 mov %esp,%ebp
801032b3: 57 push %edi
801032b4: 56 push %esi
801032b5: 53 push %ebx
801032b6: 83 ec 1c sub $0x1c,%esp
801032b9: 8b 75 08 mov 0x8(%ebp),%esi
801032bc: 8b 5d 0c mov 0xc(%ebp),%ebx
struct pipe *p;
p = 0;
*f0 = *f1 = 0;
801032bf: c7 03 00 00 00 00 movl $0x0,(%ebx)
801032c5: c7 06 00 00 00 00 movl $0x0,(%esi)
if((*f0 = filealloc()) == 0 || (*f1 = filealloc()) == 0)
801032cb: e8 60 da ff ff call 80100d30 <filealloc>
801032d0: 85 c0 test %eax,%eax
801032d2: 89 06 mov %eax,(%esi)
801032d4: 0f 84 a4 00 00 00 je 8010337e <pipealloc+0xce>
801032da: e8 51 da ff ff call 80100d30 <filealloc>
801032df: 85 c0 test %eax,%eax
801032e1: 89 03 mov %eax,(%ebx)
801032e3: 0f 84 87 00 00 00 je 80103370 <pipealloc+0xc0>
goto bad;
if((p = (struct pipe*)kalloc()) == 0)
801032e9: e8 a2 f1 ff ff call 80102490 <kalloc>
801032ee: 85 c0 test %eax,%eax
801032f0: 89 c7 mov %eax,%edi
801032f2: 74 7c je 80103370 <pipealloc+0xc0>
goto bad;
p->readopen = 1;
801032f4: c7 80 3c 02 00 00 01 movl $0x1,0x23c(%eax)
801032fb: 00 00 00
p->writeopen = 1;
801032fe: c7 80 40 02 00 00 01 movl $0x1,0x240(%eax)
80103305: 00 00 00
p->nwrite = 0;
80103308: c7 80 38 02 00 00 00 movl $0x0,0x238(%eax)
8010330f: 00 00 00
p->nread = 0;
80103312: c7 80 34 02 00 00 00 movl $0x0,0x234(%eax)
80103319: 00 00 00
initlock(&p->lock, "pipe");
8010331c: 89 04 24 mov %eax,(%esp)
8010331f: c7 44 24 04 a8 7b 10 movl $0x80107ba8,0x4(%esp)
80103326: 80
80103327: e8 14 15 00 00 call 80104840 <initlock>
(*f0)->type = FD_PIPE;
8010332c: 8b 06 mov (%esi),%eax
8010332e: c7 00 01 00 00 00 movl $0x1,(%eax)
(*f0)->readable = 1;
80103334: 8b 06 mov (%esi),%eax
80103336: c6 40 08 01 movb $0x1,0x8(%eax)
(*f0)->writable = 0;
8010333a: 8b 06 mov (%esi),%eax
8010333c: c6 40 09 00 movb $0x0,0x9(%eax)
(*f0)->pipe = p;
80103340: 8b 06 mov (%esi),%eax
80103342: 89 78 0c mov %edi,0xc(%eax)
(*f1)->type = FD_PIPE;
80103345: 8b 03 mov (%ebx),%eax
80103347: c7 00 01 00 00 00 movl $0x1,(%eax)
(*f1)->readable = 0;
8010334d: 8b 03 mov (%ebx),%eax
8010334f: c6 40 08 00 movb $0x0,0x8(%eax)
(*f1)->writable = 1;
80103353: 8b 03 mov (%ebx),%eax
80103355: c6 40 09 01 movb $0x1,0x9(%eax)
(*f1)->pipe = p;
80103359: 8b 03 mov (%ebx),%eax
return 0;
8010335b: 31 db xor %ebx,%ebx
(*f0)->writable = 0;
(*f0)->pipe = p;
(*f1)->type = FD_PIPE;
(*f1)->readable = 0;
(*f1)->writable = 1;
(*f1)->pipe = p;
8010335d: 89 78 0c mov %edi,0xc(%eax)
if(*f0)
fileclose(*f0);
if(*f1)
fileclose(*f1);
return -1;
}
80103360: 83 c4 1c add $0x1c,%esp
80103363: 89 d8 mov %ebx,%eax
80103365: 5b pop %ebx
80103366: 5e pop %esi
80103367: 5f pop %edi
80103368: 5d pop %ebp
80103369: c3 ret
8010336a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
//PAGEBREAK: 20
bad:
if(p)
kfree((char*)p);
if(*f0)
80103370: 8b 06 mov (%esi),%eax
80103372: 85 c0 test %eax,%eax
80103374: 74 08 je 8010337e <pipealloc+0xce>
fileclose(*f0);
80103376: 89 04 24 mov %eax,(%esp)
80103379: e8 72 da ff ff call 80100df0 <fileclose>
if(*f1)
8010337e: 8b 03 mov (%ebx),%eax
fileclose(*f1);
return -1;
80103380: bb ff ff ff ff mov $0xffffffff,%ebx
bad:
if(p)
kfree((char*)p);
if(*f0)
fileclose(*f0);
if(*f1)
80103385: 85 c0 test %eax,%eax
80103387: 74 d7 je 80103360 <pipealloc+0xb0>
fileclose(*f1);
80103389: 89 04 24 mov %eax,(%esp)
8010338c: e8 5f da ff ff call 80100df0 <fileclose>
return -1;
}
80103391: 83 c4 1c add $0x1c,%esp
80103394: 89 d8 mov %ebx,%eax
80103396: 5b pop %ebx
80103397: 5e pop %esi
80103398: 5f pop %edi
80103399: 5d pop %ebp
8010339a: c3 ret
8010339b: 90 nop
8010339c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801033a0 <pipeclose>:
void
pipeclose(struct pipe *p, int writable)
{
801033a0: 55 push %ebp
801033a1: 89 e5 mov %esp,%ebp
801033a3: 56 push %esi
801033a4: 53 push %ebx
801033a5: 83 ec 10 sub $0x10,%esp
801033a8: 8b 5d 08 mov 0x8(%ebp),%ebx
801033ab: 8b 75 0c mov 0xc(%ebp),%esi
acquire(&p->lock);
801033ae: 89 1c 24 mov %ebx,(%esp)
801033b1: e8 0a 15 00 00 call 801048c0 <acquire>
if(writable){
801033b6: 85 f6 test %esi,%esi
801033b8: 74 3e je 801033f8 <pipeclose+0x58>
p->writeopen = 0;
wakeup(&p->nread);
801033ba: 8d 83 34 02 00 00 lea 0x234(%ebx),%eax
void
pipeclose(struct pipe *p, int writable)
{
acquire(&p->lock);
if(writable){
p->writeopen = 0;
801033c0: c7 83 40 02 00 00 00 movl $0x0,0x240(%ebx)
801033c7: 00 00 00
wakeup(&p->nread);
801033ca: 89 04 24 mov %eax,(%esp)
801033cd: e8 be 0b 00 00 call 80103f90 <wakeup>
} else {
p->readopen = 0;
wakeup(&p->nwrite);
}
if(p->readopen == 0 && p->writeopen == 0){
801033d2: 8b 93 3c 02 00 00 mov 0x23c(%ebx),%edx
801033d8: 85 d2 test %edx,%edx
801033da: 75 0a jne 801033e6 <pipeclose+0x46>
801033dc: 8b 83 40 02 00 00 mov 0x240(%ebx),%eax
801033e2: 85 c0 test %eax,%eax
801033e4: 74 32 je 80103418 <pipeclose+0x78>
release(&p->lock);
kfree((char*)p);
} else
release(&p->lock);
801033e6: 89 5d 08 mov %ebx,0x8(%ebp)
}
801033e9: 83 c4 10 add $0x10,%esp
801033ec: 5b pop %ebx
801033ed: 5e pop %esi
801033ee: 5d pop %ebp
}
if(p->readopen == 0 && p->writeopen == 0){
release(&p->lock);
kfree((char*)p);
} else
release(&p->lock);
801033ef: e9 fc 15 00 00 jmp 801049f0 <release>
801033f4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(writable){
p->writeopen = 0;
wakeup(&p->nread);
} else {
p->readopen = 0;
wakeup(&p->nwrite);
801033f8: 8d 83 38 02 00 00 lea 0x238(%ebx),%eax
acquire(&p->lock);
if(writable){
p->writeopen = 0;
wakeup(&p->nread);
} else {
p->readopen = 0;
801033fe: c7 83 3c 02 00 00 00 movl $0x0,0x23c(%ebx)
80103405: 00 00 00
wakeup(&p->nwrite);
80103408: 89 04 24 mov %eax,(%esp)
8010340b: e8 80 0b 00 00 call 80103f90 <wakeup>
80103410: eb c0 jmp 801033d2 <pipeclose+0x32>
80103412: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
}
if(p->readopen == 0 && p->writeopen == 0){
release(&p->lock);
80103418: 89 1c 24 mov %ebx,(%esp)
8010341b: e8 d0 15 00 00 call 801049f0 <release>
kfree((char*)p);
80103420: 89 5d 08 mov %ebx,0x8(%ebp)
} else
release(&p->lock);
}
80103423: 83 c4 10 add $0x10,%esp
80103426: 5b pop %ebx
80103427: 5e pop %esi
80103428: 5d pop %ebp
p->readopen = 0;
wakeup(&p->nwrite);
}
if(p->readopen == 0 && p->writeopen == 0){
release(&p->lock);
kfree((char*)p);
80103429: e9 b2 ee ff ff jmp 801022e0 <kfree>
8010342e: 66 90 xchg %ax,%ax
80103430 <pipewrite>:
}
//PAGEBREAK: 40
int
pipewrite(struct pipe *p, char *addr, int n)
{
80103430: 55 push %ebp
80103431: 89 e5 mov %esp,%ebp
80103433: 57 push %edi
80103434: 56 push %esi
80103435: 53 push %ebx
80103436: 83 ec 1c sub $0x1c,%esp
80103439: 8b 7d 08 mov 0x8(%ebp),%edi
int i;
acquire(&p->lock);
8010343c: 89 3c 24 mov %edi,(%esp)
8010343f: e8 7c 14 00 00 call 801048c0 <acquire>
for(i = 0; i < n; i++){
80103444: 8b 45 10 mov 0x10(%ebp),%eax
80103447: 85 c0 test %eax,%eax
80103449: 0f 8e c2 00 00 00 jle 80103511 <pipewrite+0xe1>
8010344f: 8b 45 0c mov 0xc(%ebp),%eax
80103452: 8d b7 34 02 00 00 lea 0x234(%edi),%esi
80103458: 8b 8f 38 02 00 00 mov 0x238(%edi),%ecx
8010345e: 8d 9f 38 02 00 00 lea 0x238(%edi),%ebx
80103464: 89 45 e4 mov %eax,-0x1c(%ebp)
80103467: 03 45 10 add 0x10(%ebp),%eax
8010346a: 89 45 e0 mov %eax,-0x20(%ebp)
while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full
8010346d: 8b 87 34 02 00 00 mov 0x234(%edi),%eax
80103473: 8d 90 00 02 00 00 lea 0x200(%eax),%edx
80103479: 39 d1 cmp %edx,%ecx
8010347b: 0f 85 c4 00 00 00 jne 80103545 <pipewrite+0x115>
if(p->readopen == 0 || proc->killed){
80103481: 8b 97 3c 02 00 00 mov 0x23c(%edi),%edx
80103487: 85 d2 test %edx,%edx
80103489: 0f 84 a1 00 00 00 je 80103530 <pipewrite+0x100>
8010348f: 65 8b 15 04 00 00 00 mov %gs:0x4,%edx
80103496: 8b 42 18 mov 0x18(%edx),%eax
80103499: 85 c0 test %eax,%eax
8010349b: 74 22 je 801034bf <pipewrite+0x8f>
8010349d: e9 8e 00 00 00 jmp 80103530 <pipewrite+0x100>
801034a2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801034a8: 8b 87 3c 02 00 00 mov 0x23c(%edi),%eax
801034ae: 85 c0 test %eax,%eax
801034b0: 74 7e je 80103530 <pipewrite+0x100>
801034b2: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801034b8: 8b 48 18 mov 0x18(%eax),%ecx
801034bb: 85 c9 test %ecx,%ecx
801034bd: 75 71 jne 80103530 <pipewrite+0x100>
release(&p->lock);
return -1;
}
wakeup(&p->nread);
801034bf: 89 34 24 mov %esi,(%esp)
801034c2: e8 c9 0a 00 00 call 80103f90 <wakeup>
sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep
801034c7: 89 7c 24 04 mov %edi,0x4(%esp)
801034cb: 89 1c 24 mov %ebx,(%esp)
801034ce: e8 8d 08 00 00 call 80103d60 <sleep>
{
int i;
acquire(&p->lock);
for(i = 0; i < n; i++){
while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full
801034d3: 8b 87 34 02 00 00 mov 0x234(%edi),%eax
801034d9: 8b 97 38 02 00 00 mov 0x238(%edi),%edx
801034df: 05 00 02 00 00 add $0x200,%eax
801034e4: 39 c2 cmp %eax,%edx
801034e6: 74 c0 je 801034a8 <pipewrite+0x78>
return -1;
}
wakeup(&p->nread);
sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep
}
p->data[p->nwrite++ % PIPESIZE] = addr[i];
801034e8: 8b 45 e4 mov -0x1c(%ebp),%eax
801034eb: 8d 4a 01 lea 0x1(%edx),%ecx
801034ee: 81 e2 ff 01 00 00 and $0x1ff,%edx
801034f4: 89 8f 38 02 00 00 mov %ecx,0x238(%edi)
801034fa: 83 45 e4 01 addl $0x1,-0x1c(%ebp)
801034fe: 0f b6 00 movzbl (%eax),%eax
80103501: 88 44 17 34 mov %al,0x34(%edi,%edx,1)
pipewrite(struct pipe *p, char *addr, int n)
{
int i;
acquire(&p->lock);
for(i = 0; i < n; i++){
80103505: 8b 45 e4 mov -0x1c(%ebp),%eax
80103508: 3b 45 e0 cmp -0x20(%ebp),%eax
8010350b: 0f 85 5c ff ff ff jne 8010346d <pipewrite+0x3d>
wakeup(&p->nread);
sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep
}
p->data[p->nwrite++ % PIPESIZE] = addr[i];
}
wakeup(&p->nread); //DOC: pipewrite-wakeup1
80103511: 8d 97 34 02 00 00 lea 0x234(%edi),%edx
80103517: 89 14 24 mov %edx,(%esp)
8010351a: e8 71 0a 00 00 call 80103f90 <wakeup>
release(&p->lock);
8010351f: 89 3c 24 mov %edi,(%esp)
80103522: e8 c9 14 00 00 call 801049f0 <release>
return n;
80103527: 8b 45 10 mov 0x10(%ebp),%eax
8010352a: eb 11 jmp 8010353d <pipewrite+0x10d>
8010352c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
acquire(&p->lock);
for(i = 0; i < n; i++){
while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full
if(p->readopen == 0 || proc->killed){
release(&p->lock);
80103530: 89 3c 24 mov %edi,(%esp)
80103533: e8 b8 14 00 00 call 801049f0 <release>
return -1;
80103538: b8 ff ff ff ff mov $0xffffffff,%eax
p->data[p->nwrite++ % PIPESIZE] = addr[i];
}
wakeup(&p->nread); //DOC: pipewrite-wakeup1
release(&p->lock);
return n;
}
8010353d: 83 c4 1c add $0x1c,%esp
80103540: 5b pop %ebx
80103541: 5e pop %esi
80103542: 5f pop %edi
80103543: 5d pop %ebp
80103544: c3 ret
{
int i;
acquire(&p->lock);
for(i = 0; i < n; i++){
while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full
80103545: 89 ca mov %ecx,%edx
80103547: eb 9f jmp 801034e8 <pipewrite+0xb8>
80103549: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80103550 <piperead>:
return n;
}
int
piperead(struct pipe *p, char *addr, int n)
{
80103550: 55 push %ebp
80103551: 89 e5 mov %esp,%ebp
80103553: 57 push %edi
80103554: 56 push %esi
80103555: 53 push %ebx
80103556: 83 ec 1c sub $0x1c,%esp
80103559: 8b 75 08 mov 0x8(%ebp),%esi
8010355c: 8b 7d 0c mov 0xc(%ebp),%edi
int i;
acquire(&p->lock);
8010355f: 89 34 24 mov %esi,(%esp)
80103562: e8 59 13 00 00 call 801048c0 <acquire>
while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty
80103567: 8b 86 34 02 00 00 mov 0x234(%esi),%eax
8010356d: 3b 86 38 02 00 00 cmp 0x238(%esi),%eax
80103573: 75 5b jne 801035d0 <piperead+0x80>
80103575: 8b 9e 40 02 00 00 mov 0x240(%esi),%ebx
8010357b: 85 db test %ebx,%ebx
8010357d: 74 51 je 801035d0 <piperead+0x80>
8010357f: 8d 9e 34 02 00 00 lea 0x234(%esi),%ebx
80103585: eb 25 jmp 801035ac <piperead+0x5c>
80103587: 90 nop
if(proc->killed){
release(&p->lock);
return -1;
}
sleep(&p->nread, &p->lock); //DOC: piperead-sleep
80103588: 89 74 24 04 mov %esi,0x4(%esp)
8010358c: 89 1c 24 mov %ebx,(%esp)
8010358f: e8 cc 07 00 00 call 80103d60 <sleep>
piperead(struct pipe *p, char *addr, int n)
{
int i;
acquire(&p->lock);
while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty
80103594: 8b 86 34 02 00 00 mov 0x234(%esi),%eax
8010359a: 3b 86 38 02 00 00 cmp 0x238(%esi),%eax
801035a0: 75 2e jne 801035d0 <piperead+0x80>
801035a2: 8b 96 40 02 00 00 mov 0x240(%esi),%edx
801035a8: 85 d2 test %edx,%edx
801035aa: 74 24 je 801035d0 <piperead+0x80>
if(proc->killed){
801035ac: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801035b2: 8b 48 18 mov 0x18(%eax),%ecx
801035b5: 85 c9 test %ecx,%ecx
801035b7: 74 cf je 80103588 <piperead+0x38>
release(&p->lock);
801035b9: 89 34 24 mov %esi,(%esp)
801035bc: e8 2f 14 00 00 call 801049f0 <release>
addr[i] = p->data[p->nread++ % PIPESIZE];
}
wakeup(&p->nwrite); //DOC: piperead-wakeup
release(&p->lock);
return i;
}
801035c1: 83 c4 1c add $0x1c,%esp
acquire(&p->lock);
while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty
if(proc->killed){
release(&p->lock);
return -1;
801035c4: b8 ff ff ff ff mov $0xffffffff,%eax
addr[i] = p->data[p->nread++ % PIPESIZE];
}
wakeup(&p->nwrite); //DOC: piperead-wakeup
release(&p->lock);
return i;
}
801035c9: 5b pop %ebx
801035ca: 5e pop %esi
801035cb: 5f pop %edi
801035cc: 5d pop %ebp
801035cd: c3 ret
801035ce: 66 90 xchg %ax,%ax
release(&p->lock);
return -1;
}
sleep(&p->nread, &p->lock); //DOC: piperead-sleep
}
for(i = 0; i < n; i++){ //DOC: piperead-copy
801035d0: 8b 55 10 mov 0x10(%ebp),%edx
if(p->nread == p->nwrite)
801035d3: 31 db xor %ebx,%ebx
release(&p->lock);
return -1;
}
sleep(&p->nread, &p->lock); //DOC: piperead-sleep
}
for(i = 0; i < n; i++){ //DOC: piperead-copy
801035d5: 85 d2 test %edx,%edx
801035d7: 7f 2b jg 80103604 <piperead+0xb4>
801035d9: eb 31 jmp 8010360c <piperead+0xbc>
801035db: 90 nop
801035dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(p->nread == p->nwrite)
break;
addr[i] = p->data[p->nread++ % PIPESIZE];
801035e0: 8d 48 01 lea 0x1(%eax),%ecx
801035e3: 25 ff 01 00 00 and $0x1ff,%eax
801035e8: 89 8e 34 02 00 00 mov %ecx,0x234(%esi)
801035ee: 0f b6 44 06 34 movzbl 0x34(%esi,%eax,1),%eax
801035f3: 88 04 1f mov %al,(%edi,%ebx,1)
release(&p->lock);
return -1;
}
sleep(&p->nread, &p->lock); //DOC: piperead-sleep
}
for(i = 0; i < n; i++){ //DOC: piperead-copy
801035f6: 83 c3 01 add $0x1,%ebx
801035f9: 3b 5d 10 cmp 0x10(%ebp),%ebx
801035fc: 74 0e je 8010360c <piperead+0xbc>
if(p->nread == p->nwrite)
801035fe: 8b 86 34 02 00 00 mov 0x234(%esi),%eax
80103604: 3b 86 38 02 00 00 cmp 0x238(%esi),%eax
8010360a: 75 d4 jne 801035e0 <piperead+0x90>
break;
addr[i] = p->data[p->nread++ % PIPESIZE];
}
wakeup(&p->nwrite); //DOC: piperead-wakeup
8010360c: 8d 86 38 02 00 00 lea 0x238(%esi),%eax
80103612: 89 04 24 mov %eax,(%esp)
80103615: e8 76 09 00 00 call 80103f90 <wakeup>
release(&p->lock);
8010361a: 89 34 24 mov %esi,(%esp)
8010361d: e8 ce 13 00 00 call 801049f0 <release>
return i;
}
80103622: 83 c4 1c add $0x1c,%esp
break;
addr[i] = p->data[p->nread++ % PIPESIZE];
}
wakeup(&p->nwrite); //DOC: piperead-wakeup
release(&p->lock);
return i;
80103625: 89 d8 mov %ebx,%eax
}
80103627: 5b pop %ebx
80103628: 5e pop %esi
80103629: 5f pop %edi
8010362a: 5d pop %ebp
8010362b: c3 ret
8010362c: 66 90 xchg %ax,%ax
8010362e: 66 90 xchg %ax,%ax
80103630 <wakeup1>:
//PAGEBREAK!
// Wake up all processes sleeping on chan.
// The ptable lock must be held.
static void
wakeup1(void *chan)
{
80103630: 55 push %ebp
80103631: b9 64 3e 11 80 mov $0x80113e64,%ecx
80103636: 89 e5 mov %esp,%ebp
80103638: 8d 91 80 fc ff ff lea -0x380(%ecx),%edx
8010363e: eb 07 jmp 80103647 <wakeup1+0x17>
struct proc *p;
struct thread *t;
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
for(t=&p->thread_array[0];t<&p->thread_array[NTHREAD];t++) {
80103640: 83 c2 38 add $0x38,%edx
80103643: 39 ca cmp %ecx,%edx
80103645: 73 29 jae 80103670 <wakeup1+0x40>
if(t->state == Sleeping && t->chan == chan){
80103647: 83 7a 04 02 cmpl $0x2,0x4(%edx)
8010364b: 75 f3 jne 80103640 <wakeup1+0x10>
8010364d: 39 42 1c cmp %eax,0x1c(%edx)
80103650: 75 ee jne 80103640 <wakeup1+0x10>
//cprintf("wakeup1(): just woke up thread with tid %d under process p->pid.\n",t->tid,p->pid);
p->state = NEED_RUNTIME;
80103652: c7 81 18 fc ff ff 02 movl $0x2,-0x3e8(%ecx)
80103659: 00 00 00
{
struct proc *p;
struct thread *t;
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
for(t=&p->thread_array[0];t<&p->thread_array[NTHREAD];t++) {
8010365c: 83 c2 38 add $0x38,%edx
if(t->state == Sleeping && t->chan == chan){
//cprintf("wakeup1(): just woke up thread with tid %d under process p->pid.\n",t->tid,p->pid);
p->state = NEED_RUNTIME;
t->state = Runnable;
8010365f: c7 42 cc 03 00 00 00 movl $0x3,-0x34(%edx)
{
struct proc *p;
struct thread *t;
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
for(t=&p->thread_array[0];t<&p->thread_array[NTHREAD];t++) {
80103666: 39 ca cmp %ecx,%edx
80103668: 72 dd jb 80103647 <wakeup1+0x17>
8010366a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80103670: 81 c1 30 04 00 00 add $0x430,%ecx
wakeup1(void *chan)
{
struct proc *p;
struct thread *t;
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80103676: 81 f9 64 4a 12 80 cmp $0x80124a64,%ecx
8010367c: 75 ba jne 80103638 <wakeup1+0x8>
p->state = NEED_RUNTIME;
t->state = Runnable;
}
}
}
}
8010367e: 5d pop %ebp
8010367f: c3 ret
80103680 <allocproc>:
// state required to run in the kernel.
// Otherwise return 0.
// Must hold ptable.lock.
static struct proc*
allocproc(void)
{
80103680: 55 push %ebp
80103681: 89 e5 mov %esp,%ebp
80103683: 56 push %esi
80103684: 53 push %ebx
struct proc *p;
struct thread *t;
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80103685: bb 74 3a 11 80 mov $0x80113a74,%ebx
// state required to run in the kernel.
// Otherwise return 0.
// Must hold ptable.lock.
static struct proc*
allocproc(void)
{
8010368a: 83 ec 10 sub $0x10,%esp
8010368d: eb 13 jmp 801036a2 <allocproc+0x22>
8010368f: 90 nop
struct proc *p;
struct thread *t;
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80103690: 81 c3 30 04 00 00 add $0x430,%ebx
80103696: 81 fb 74 46 12 80 cmp $0x80124674,%ebx
8010369c: 0f 84 ce 00 00 00 je 80103770 <allocproc+0xf0>
if(p->state == UNUSED)
801036a2: 8b 43 08 mov 0x8(%ebx),%eax
801036a5: 85 c0 test %eax,%eax
801036a7: 75 e7 jne 80103690 <allocproc+0x10>
goto found;
return 0;
found:
p->state = EMBRYO;
p->pid = nextpid++;
801036a9: a1 10 b0 10 80 mov 0x8010b010,%eax
//initialize the thread array of the process, at this point we locked the proc so only one cpu can
//initilize this proc, one thread active at the start
for(t= &p->thread_array[0];t<&p->thread_array[NTHREAD];t++) {
801036ae: 8d b3 f0 03 00 00 lea 0x3f0(%ebx),%esi
if(p->state == UNUSED)
goto found;
return 0;
found:
p->state = EMBRYO;
801036b4: c7 43 08 01 00 00 00 movl $0x1,0x8(%ebx)
p->pid = nextpid++;
801036bb: 8d 50 01 lea 0x1(%eax),%edx
801036be: 89 43 0c mov %eax,0xc(%ebx)
//initialize the thread array of the process, at this point we locked the proc so only one cpu can
//initilize this proc, one thread active at the start
for(t= &p->thread_array[0];t<&p->thread_array[NTHREAD];t++) {
801036c1: 8d 43 70 lea 0x70(%ebx),%eax
goto found;
return 0;
found:
p->state = EMBRYO;
p->pid = nextpid++;
801036c4: 89 15 10 b0 10 80 mov %edx,0x8010b010
801036ca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
//initialize the thread array of the process, at this point we locked the proc so only one cpu can
//initilize this proc, one thread active at the start
for(t= &p->thread_array[0];t<&p->thread_array[NTHREAD];t++) {
t->parent = p;
801036d0: 89 58 0c mov %ebx,0xc(%eax)
p->state = EMBRYO;
p->pid = nextpid++;
//initialize the thread array of the process, at this point we locked the proc so only one cpu can
//initilize this proc, one thread active at the start
for(t= &p->thread_array[0];t<&p->thread_array[NTHREAD];t++) {
801036d3: 83 c0 38 add $0x38,%eax
t->parent = p;
t->state = Unused;
801036d6: c7 40 cc 00 00 00 00 movl $0x0,-0x34(%eax)
p->state = EMBRYO;
p->pid = nextpid++;
//initialize the thread array of the process, at this point we locked the proc so only one cpu can
//initilize this proc, one thread active at the start
for(t= &p->thread_array[0];t<&p->thread_array[NTHREAD];t++) {
801036dd: 39 f0 cmp %esi,%eax
801036df: 72 ef jb 801036d0 <allocproc+0x50>
struct thread *t;
char *sp;
t=p->thread_array;
//allocate kstack for the thread
if((t->kstack = kalloc()) == 0){
801036e1: e8 aa ed ff ff call 80102490 <kalloc>
801036e6: 85 c0 test %eax,%eax
801036e8: 89 43 70 mov %eax,0x70(%ebx)
801036eb: 0f 84 88 00 00 00 je 80103779 <allocproc+0xf9>
p->state = UNUSED;
return 0;
}
t->state = Embryo;
t->tid = nextid;
801036f1: 8b 15 0c b0 10 80 mov 0x8010b00c,%edx
if((t->kstack = kalloc()) == 0){
p->state = UNUSED;
return 0;
}
t->state = Embryo;
801036f7: c7 43 74 01 00 00 00 movl $0x1,0x74(%ebx)
t->tid = nextid;
801036fe: 89 53 78 mov %edx,0x78(%ebx)
nextid++;
80103701: 83 c2 01 add $0x1,%edx
80103704: 89 15 0c b0 10 80 mov %edx,0x8010b00c
sp = t->kstack + KSTACKSIZE;
// Leave room for trap frame.
sp -= sizeof *t->tf;
8010370a: 8d 90 b4 0f 00 00 lea 0xfb4(%eax),%edx
t->tf = (struct trapframe*)sp;
// Set up new context to start executing at forkret,
// which returns to trapret.
sp -= 4;
*(uint*)sp = (uint)trapret;
sp -= sizeof *t->context;
80103710: 05 9c 0f 00 00 add $0xf9c,%eax
t->state = Embryo;
t->tid = nextid;
nextid++;
sp = t->kstack + KSTACKSIZE;
// Leave room for trap frame.
sp -= sizeof *t->tf;
80103715: 89 93 84 00 00 00 mov %edx,0x84(%ebx)
t->tf = (struct trapframe*)sp;
// Set up new context to start executing at forkret,
// which returns to trapret.
sp -= 4;
*(uint*)sp = (uint)trapret;
8010371b: c7 40 14 7d 5d 10 80 movl $0x80105d7d,0x14(%eax)
sp -= sizeof *t->context;
t->context = (struct context*)sp;
memset(t->context, 0, sizeof *t->context);
80103722: c7 44 24 08 14 00 00 movl $0x14,0x8(%esp)
80103729: 00
8010372a: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80103731: 00
80103732: 89 04 24 mov %eax,(%esp)
// Set up new context to start executing at forkret,
// which returns to trapret.
sp -= 4;
*(uint*)sp = (uint)trapret;
sp -= sizeof *t->context;
t->context = (struct context*)sp;
80103735: 89 83 88 00 00 00 mov %eax,0x88(%ebx)
memset(t->context, 0, sizeof *t->context);
8010373b: e8 00 13 00 00 call 80104a40 <memset>
t->context->eip = (uint)forkret;
80103740: 8b 83 88 00 00 00 mov 0x88(%ebx),%eax
80103746: c7 40 10 90 37 10 80 movl $0x80103790,0x10(%eax)
}
if(allocthread(p) == 0){
return 0;
}
// initialize the spinlock for Threads of the allocated proccess above
initlock(&p->Lock_Threads,"Lock_Threads");
8010374d: 89 34 24 mov %esi,(%esp)
80103750: c7 44 24 04 ad 7b 10 movl $0x80107bad,0x4(%esp)
80103757: 80
80103758: e8 e3 10 00 00 call 80104840 <initlock>
p->total_number_threads = 1;
return p;
8010375d: 89 d8 mov %ebx,%eax
if(allocthread(p) == 0){
return 0;
}
// initialize the spinlock for Threads of the allocated proccess above
initlock(&p->Lock_Threads,"Lock_Threads");
p->total_number_threads = 1;
8010375f: c7 83 24 04 00 00 01 movl $0x1,0x424(%ebx)
80103766: 00 00 00
return p;
}
80103769: 83 c4 10 add $0x10,%esp
8010376c: 5b pop %ebx
8010376d: 5e pop %esi
8010376e: 5d pop %ebp
8010376f: c3 ret
80103770: 83 c4 10 add $0x10,%esp
struct thread *t;
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
if(p->state == UNUSED)
goto found;
return 0;
80103773: 31 c0 xor %eax,%eax
// initialize the spinlock for Threads of the allocated proccess above
initlock(&p->Lock_Threads,"Lock_Threads");
p->total_number_threads = 1;
return p;
}
80103775: 5b pop %ebx
80103776: 5e pop %esi
80103777: 5d pop %ebp
80103778: c3 ret
char *sp;
t=p->thread_array;
//allocate kstack for the thread
if((t->kstack = kalloc()) == 0){
p->state = UNUSED;
80103779: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx)
// initialize the spinlock for Threads of the allocated proccess above
initlock(&p->Lock_Threads,"Lock_Threads");
p->total_number_threads = 1;
return p;
}
80103780: 83 c4 10 add $0x10,%esp
80103783: 5b pop %ebx
80103784: 5e pop %esi
80103785: 5d pop %ebp
80103786: c3 ret
80103787: 89 f6 mov %esi,%esi
80103789: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80103790 <forkret>:
// A fork child's very first scheduling by scheduler()
// will swtch here. "Return" to user space.
void
forkret(void)
{
80103790: 55 push %ebp
80103791: 89 e5 mov %esp,%ebp
80103793: 83 ec 18 sub $0x18,%esp
static int first = 1;
// Still holding ptable.lock from scheduler.
release(&ptable.lock);
80103796: c7 04 24 40 3a 11 80 movl $0x80113a40,(%esp)
8010379d: e8 4e 12 00 00 call 801049f0 <release>
if (first) {
801037a2: a1 04 b0 10 80 mov 0x8010b004,%eax
801037a7: 85 c0 test %eax,%eax
801037a9: 75 05 jne 801037b0 <forkret+0x20>
first = 0;
iinit(ROOTDEV);
initlog(ROOTDEV);
}
// Return to "caller", actually trapret (see allocproc).
}
801037ab: c9 leave
801037ac: c3 ret
801037ad: 8d 76 00 lea 0x0(%esi),%esi
if (first) {
// Some initialization functions must be run in the context
// of a regular process (e.g., they call sleep), and thus cannot
// be run from main().
first = 0;
iinit(ROOTDEV);
801037b0: c7 04 24 01 00 00 00 movl $0x1,(%esp)
if (first) {
// Some initialization functions must be run in the context
// of a regular process (e.g., they call sleep), and thus cannot
// be run from main().
first = 0;
801037b7: c7 05 04 b0 10 80 00 movl $0x0,0x8010b004
801037be: 00 00 00
iinit(ROOTDEV);
801037c1: e8 6a dc ff ff call 80101430 <iinit>
initlog(ROOTDEV);
801037c6: c7 04 24 01 00 00 00 movl $0x1,(%esp)
801037cd: e8 0e f3 ff ff call 80102ae0 <initlog>
}
// Return to "caller", actually trapret (see allocproc).
}
801037d2: c9 leave
801037d3: c3 ret
801037d4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801037da: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
801037e0 <pinit>:
static void wakeup1(void *chan);
void
pinit(void)
{
801037e0: 55 push %ebp
801037e1: 89 e5 mov %esp,%ebp
801037e3: 83 ec 18 sub $0x18,%esp
initlock(&mtable.lock, "mtable");
801037e6: c7 44 24 04 ba 7b 10 movl $0x80107bba,0x4(%esp)
801037ed: 80
801037ee: c7 04 24 00 29 11 80 movl $0x80112900,(%esp)
801037f5: e8 46 10 00 00 call 80104840 <initlock>
initlock(&ptable.lock, "ptable");
801037fa: c7 44 24 04 c1 7b 10 movl $0x80107bc1,0x4(%esp)
80103801: 80
80103802: c7 04 24 40 3a 11 80 movl $0x80113a40,(%esp)
80103809: e8 32 10 00 00 call 80104840 <initlock>
}
8010380e: c9 leave
8010380f: c3 ret
80103810 <userinit>:
//PAGEBREAK: 32
// Set up first user process.
void
userinit(void)
{
80103810: 55 push %ebp
80103811: 89 e5 mov %esp,%ebp
80103813: 53 push %ebx
80103814: 83 ec 14 sub $0x14,%esp
struct proc *p;
struct thread *t;
extern char _binary_initcode_start[], _binary_initcode_size[];
acquire(&ptable.lock);
80103817: c7 04 24 40 3a 11 80 movl $0x80113a40,(%esp)
8010381e: e8 9d 10 00 00 call 801048c0 <acquire>
p = allocproc();
80103823: e8 58 fe ff ff call 80103680 <allocproc>
if(p==0)
80103828: 85 c0 test %eax,%eax
struct thread *t;
extern char _binary_initcode_start[], _binary_initcode_size[];
acquire(&ptable.lock);
p = allocproc();
8010382a: 89 c3 mov %eax,%ebx
if(p==0)
8010382c: 0f 84 2c 01 00 00 je 8010395e <userinit+0x14e>
panic("userinit: can't allocate proc!");
initproc = p;
80103832: a3 bc b5 10 80 mov %eax,0x8010b5bc
if((p->pgdir = setupkvm()) == 0)
80103837: e8 e4 37 00 00 call 80107020 <setupkvm>
8010383c: 85 c0 test %eax,%eax
8010383e: 89 43 04 mov %eax,0x4(%ebx)
80103841: 0f 84 23 01 00 00 je 8010396a <userinit+0x15a>
panic("userinit: out of memory?");
inituvm(p->pgdir, _binary_initcode_start, (int)_binary_initcode_size);
80103847: 89 04 24 mov %eax,(%esp)
8010384a: c7 44 24 08 2c 00 00 movl $0x2c,0x8(%esp)
80103851: 00
80103852: c7 44 24 04 60 b4 10 movl $0x8010b460,0x4(%esp)
80103859: 80
8010385a: e8 21 39 00 00 call 80107180 <inituvm>
p->sz = PGSIZE;
8010385f: c7 03 00 10 00 00 movl $0x1000,(%ebx)
t=&p->thread_array[0];
memset(t->tf, 0, sizeof(*t->tf));
80103865: c7 44 24 08 4c 00 00 movl $0x4c,0x8(%esp)
8010386c: 00
8010386d: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80103874: 00
80103875: 8b 83 84 00 00 00 mov 0x84(%ebx),%eax
8010387b: 89 04 24 mov %eax,(%esp)
8010387e: e8 bd 11 00 00 call 80104a40 <memset>
t->tf->cs = (SEG_UCODE << 3) | DPL_USER;
80103883: 8b 83 84 00 00 00 mov 0x84(%ebx),%eax
80103889: ba 23 00 00 00 mov $0x23,%edx
t->tf->ds = (SEG_UDATA << 3) | DPL_USER;
8010388e: b9 2b 00 00 00 mov $0x2b,%ecx
panic("userinit: out of memory?");
inituvm(p->pgdir, _binary_initcode_start, (int)_binary_initcode_size);
p->sz = PGSIZE;
t=&p->thread_array[0];
memset(t->tf, 0, sizeof(*t->tf));
t->tf->cs = (SEG_UCODE << 3) | DPL_USER;
80103893: 66 89 50 3c mov %dx,0x3c(%eax)
t->tf->ds = (SEG_UDATA << 3) | DPL_USER;
80103897: 8b 83 84 00 00 00 mov 0x84(%ebx),%eax
8010389d: 66 89 48 2c mov %cx,0x2c(%eax)
t->tf->es = t->tf->ds;
801038a1: 8b 83 84 00 00 00 mov 0x84(%ebx),%eax
801038a7: 0f b7 50 2c movzwl 0x2c(%eax),%edx
801038ab: 66 89 50 28 mov %dx,0x28(%eax)
t->tf->ss = t->tf->ds;
801038af: 8b 83 84 00 00 00 mov 0x84(%ebx),%eax
801038b5: 0f b7 50 2c movzwl 0x2c(%eax),%edx
801038b9: 66 89 50 48 mov %dx,0x48(%eax)
t->tf->eflags = FL_IF;
801038bd: 8b 83 84 00 00 00 mov 0x84(%ebx),%eax
801038c3: c7 40 40 00 02 00 00 movl $0x200,0x40(%eax)
t->tf->esp = PGSIZE;
801038ca: 8b 83 84 00 00 00 mov 0x84(%ebx),%eax
801038d0: c7 40 44 00 10 00 00 movl $0x1000,0x44(%eax)
t->tf->eip = 0; // beginning of initcode.S
801038d7: 8b 83 84 00 00 00 mov 0x84(%ebx),%eax
801038dd: c7 40 38 00 00 00 00 movl $0x0,0x38(%eax)
safestrcpy(p->name, "initcode", sizeof(p->name));
801038e4: 8d 43 60 lea 0x60(%ebx),%eax
801038e7: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
801038ee: 00
801038ef: c7 44 24 04 e1 7b 10 movl $0x80107be1,0x4(%esp)
801038f6: 80
801038f7: 89 04 24 mov %eax,(%esp)
801038fa: e8 21 13 00 00 call 80104c20 <safestrcpy>
p->cwd = namei("/");
801038ff: c7 04 24 ea 7b 10 80 movl $0x80107bea,(%esp)
80103906: e8 d5 e5 ff ff call 80101ee0 <namei>
8010390b: 89 43 5c mov %eax,0x5c(%ebx)
safestrcpy(t->name, "initcode", sizeof(t->name));
8010390e: 8d 83 98 00 00 00 lea 0x98(%ebx),%eax
80103914: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
8010391b: 00
8010391c: c7 44 24 04 e1 7b 10 movl $0x80107be1,0x4(%esp)
80103923: 80
80103924: 89 04 24 mov %eax,(%esp)
80103927: e8 f4 12 00 00 call 80104c20 <safestrcpy>
t->cwd = namei("/");
8010392c: c7 04 24 ea 7b 10 80 movl $0x80107bea,(%esp)
80103933: e8 a8 e5 ff ff call 80101ee0 <namei>
p->state= NEED_RUNTIME;
80103938: c7 43 08 02 00 00 00 movl $0x2,0x8(%ebx)
t->state = Runnable;
8010393f: c7 43 74 03 00 00 00 movl $0x3,0x74(%ebx)
safestrcpy(p->name, "initcode", sizeof(p->name));
p->cwd = namei("/");
safestrcpy(t->name, "initcode", sizeof(t->name));
t->cwd = namei("/");
80103946: 89 83 94 00 00 00 mov %eax,0x94(%ebx)
p->state= NEED_RUNTIME;
t->state = Runnable;
//cprintf("Init has been created with pid %d with state %d, thread id %d with state %d. numOfThreads: %d\n",p->pid,p->state,t->tid,t->state,p->total_number_threads);
release(&ptable.lock);
8010394c: c7 04 24 40 3a 11 80 movl $0x80113a40,(%esp)
80103953: e8 98 10 00 00 call 801049f0 <release>
}
80103958: 83 c4 14 add $0x14,%esp
8010395b: 5b pop %ebx
8010395c: 5d pop %ebp
8010395d: c3 ret
acquire(&ptable.lock);
p = allocproc();
if(p==0)
panic("userinit: can't allocate proc!");
8010395e: c7 04 24 a4 7c 10 80 movl $0x80107ca4,(%esp)
80103965: e8 c6 c9 ff ff call 80100330 <panic>
initproc = p;
if((p->pgdir = setupkvm()) == 0)
panic("userinit: out of memory?");
8010396a: c7 04 24 c8 7b 10 80 movl $0x80107bc8,(%esp)
80103971: e8 ba c9 ff ff call 80100330 <panic>
80103976: 8d 76 00 lea 0x0(%esi),%esi
80103979: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80103980 <growproc>:
// Grow current process's memory by n bytes.
// Return 0 on success, -1 on failure.
int
growproc(int n)
{
80103980: 55 push %ebp
80103981: 89 e5 mov %esp,%ebp
80103983: 53 push %ebx
80103984: 83 ec 14 sub $0x14,%esp
80103987: 8b 55 08 mov 0x8(%ebp),%edx
uint sz;
sz = proc->sz;
8010398a: 65 a1 04 00 00 00 mov %gs:0x4,%eax
if(n > 0){
80103990: 83 fa 00 cmp $0x0,%edx
int
growproc(int n)
{
uint sz;
sz = proc->sz;
80103993: 8b 18 mov (%eax),%ebx
if(n > 0){
80103995: 7e 61 jle 801039f8 <growproc+0x78>
if((sz = allocuvm(proc->pgdir, sz, sz + n)) == 0){
80103997: 01 da add %ebx,%edx
80103999: 89 5c 24 04 mov %ebx,0x4(%esp)
8010399d: 89 54 24 08 mov %edx,0x8(%esp)
801039a1: 8b 40 04 mov 0x4(%eax),%eax
801039a4: 89 04 24 mov %eax,(%esp)
801039a7: e8 14 39 00 00 call 801072c0 <allocuvm>
801039ac: 89 c3 mov %eax,%ebx
release(&proc->Lock_Threads);
801039ae: 65 a1 04 00 00 00 mov %gs:0x4,%eax
{
uint sz;
sz = proc->sz;
if(n > 0){
if((sz = allocuvm(proc->pgdir, sz, sz + n)) == 0){
801039b4: 85 db test %ebx,%ebx
801039b6: 74 63 je 80103a1b <growproc+0x9b>
} else if(n < 0){
if((sz = deallocuvm(proc->pgdir, sz, sz + n)) == 0){
release(&proc->Lock_Threads);
return -1;}
}
acquire(&proc->Lock_Threads);
801039b8: 05 f0 03 00 00 add $0x3f0,%eax
801039bd: 89 04 24 mov %eax,(%esp)
801039c0: e8 fb 0e 00 00 call 801048c0 <acquire>
proc->sz = sz;
801039c5: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801039cb: 89 18 mov %ebx,(%eax)
release(&proc->Lock_Threads);
801039cd: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801039d3: 05 f0 03 00 00 add $0x3f0,%eax
801039d8: 89 04 24 mov %eax,(%esp)
801039db: e8 10 10 00 00 call 801049f0 <release>
switchuvm(proc);
801039e0: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801039e6: 89 04 24 mov %eax,(%esp)
801039e9: e8 f2 36 00 00 call 801070e0 <switchuvm>
return 0;
801039ee: 31 c0 xor %eax,%eax
}
801039f0: 83 c4 14 add $0x14,%esp
801039f3: 5b pop %ebx
801039f4: 5d pop %ebp
801039f5: c3 ret
801039f6: 66 90 xchg %ax,%ax
sz = proc->sz;
if(n > 0){
if((sz = allocuvm(proc->pgdir, sz, sz + n)) == 0){
release(&proc->Lock_Threads);
return -1;}
} else if(n < 0){
801039f8: 74 be je 801039b8 <growproc+0x38>
if((sz = deallocuvm(proc->pgdir, sz, sz + n)) == 0){
801039fa: 01 da add %ebx,%edx
801039fc: 89 5c 24 04 mov %ebx,0x4(%esp)
80103a00: 89 54 24 08 mov %edx,0x8(%esp)
80103a04: 8b 40 04 mov 0x4(%eax),%eax
80103a07: 89 04 24 mov %eax,(%esp)
80103a0a: e8 a1 39 00 00 call 801073b0 <deallocuvm>
80103a0f: 89 c3 mov %eax,%ebx
release(&proc->Lock_Threads);
80103a11: 65 a1 04 00 00 00 mov %gs:0x4,%eax
if(n > 0){
if((sz = allocuvm(proc->pgdir, sz, sz + n)) == 0){
release(&proc->Lock_Threads);
return -1;}
} else if(n < 0){
if((sz = deallocuvm(proc->pgdir, sz, sz + n)) == 0){
80103a17: 85 db test %ebx,%ebx
80103a19: 75 9d jne 801039b8 <growproc+0x38>
release(&proc->Lock_Threads);
80103a1b: 05 f0 03 00 00 add $0x3f0,%eax
80103a20: 89 04 24 mov %eax,(%esp)
80103a23: e8 c8 0f 00 00 call 801049f0 <release>
return -1;}
80103a28: b8 ff ff ff ff mov $0xffffffff,%eax
80103a2d: eb c1 jmp 801039f0 <growproc+0x70>
80103a2f: 90 nop
80103a30 <fork>:
// Create a new process copying p as the parent.
// Sets up stack to return as if from system call.
// Caller must set state of returned proc to RUNNABLE.
int
fork(void)
{
80103a30: 55 push %ebp
80103a31: 89 e5 mov %esp,%ebp
80103a33: 57 push %edi
80103a34: 56 push %esi
80103a35: 53 push %ebx
80103a36: 83 ec 1c sub $0x1c,%esp
int i, pid;
struct proc *np;
struct thread * t_new;
struct thread *t_old ;
acquire(&ptable.lock);
80103a39: c7 04 24 40 3a 11 80 movl $0x80113a40,(%esp)
80103a40: e8 7b 0e 00 00 call 801048c0 <acquire>
// Allocate process.
if((np = allocproc()) == 0){
80103a45: e8 36 fc ff ff call 80103680 <allocproc>
release(&ptable.lock);
80103a4a: c7 04 24 40 3a 11 80 movl $0x80113a40,(%esp)
struct thread *t_old ;
acquire(&ptable.lock);
// Allocate process.
if((np = allocproc()) == 0){
80103a51: 85 c0 test %eax,%eax
80103a53: 89 c3 mov %eax,%ebx
80103a55: 0f 84 41 01 00 00 je 80103b9c <fork+0x16c>
release(&ptable.lock);
return -1;
}
release(&ptable.lock);
80103a5b: e8 90 0f 00 00 call 801049f0 <release>
t_new=np->thread_array;
t_old=&proc->thread_array[0];
80103a60: 65 8b 35 04 00 00 00 mov %gs:0x4,%esi
// Copy process state from p.
if((np->pgdir = copyuvm(proc->pgdir, proc->sz)) == 0){
80103a67: 8b 06 mov (%esi),%eax
80103a69: 89 44 24 04 mov %eax,0x4(%esp)
80103a6d: 8b 46 04 mov 0x4(%esi),%eax
80103a70: 89 04 24 mov %eax,(%esp)
80103a73: e8 08 3a 00 00 call 80107480 <copyuvm>
80103a78: 85 c0 test %eax,%eax
80103a7a: 89 43 04 mov %eax,0x4(%ebx)
80103a7d: 0f 84 f9 00 00 00 je 80103b7c <fork+0x14c>
t_new->kstack = 0;
t_new->state = Unused;
release(&ptable.lock);
return -1;
}
acquire(&proc->Lock_Threads);
80103a83: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80103a89: 05 f0 03 00 00 add $0x3f0,%eax
80103a8e: 89 04 24 mov %eax,(%esp)
80103a91: e8 2a 0e 00 00 call 801048c0 <acquire>
np->sz = proc->sz;
80103a96: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80103a9c: 8b 00 mov (%eax),%eax
80103a9e: 89 03 mov %eax,(%ebx)
release(&proc->Lock_Threads);
80103aa0: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80103aa6: 05 f0 03 00 00 add $0x3f0,%eax
80103aab: 89 04 24 mov %eax,(%esp)
80103aae: e8 3d 0f 00 00 call 801049f0 <release>
np->parent = proc;
80103ab3: 65 a1 04 00 00 00 mov %gs:0x4,%eax
t_new->parent_thread=t_old->parent_thread;
*t_new->tf=*thread->tf ;
80103ab9: b9 13 00 00 00 mov $0x13,%ecx
80103abe: 8b bb 84 00 00 00 mov 0x84(%ebx),%edi
return -1;
}
acquire(&proc->Lock_Threads);
np->sz = proc->sz;
release(&proc->Lock_Threads);
np->parent = proc;
80103ac4: 89 43 10 mov %eax,0x10(%ebx)
t_new->parent_thread=t_old->parent_thread;
80103ac7: 8b 86 80 00 00 00 mov 0x80(%esi),%eax
80103acd: 89 83 80 00 00 00 mov %eax,0x80(%ebx)
*t_new->tf=*thread->tf ;
80103ad3: 65 a1 08 00 00 00 mov %gs:0x8,%eax
80103ad9: 8b 70 14 mov 0x14(%eax),%esi
80103adc: f3 a5 rep movsl %ds:(%esi),%es:(%edi)
// Clear %eax so that fork returns 0 in the child.
t_new->tf->eax = 0;
///////////////////////////////////////////////////////////////////////////////////////////////////////////
//copy open files at proc or thread ???? which pid return ??
for(i = 0; i < NOFILE; i++)
80103ade: 31 f6 xor %esi,%esi
np->parent = proc;
t_new->parent_thread=t_old->parent_thread;
*t_new->tf=*thread->tf ;
// Clear %eax so that fork returns 0 in the child.
t_new->tf->eax = 0;
80103ae0: 8b 83 84 00 00 00 mov 0x84(%ebx),%eax
80103ae6: 65 8b 15 04 00 00 00 mov %gs:0x4,%edx
80103aed: c7 40 1c 00 00 00 00 movl $0x0,0x1c(%eax)
80103af4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
///////////////////////////////////////////////////////////////////////////////////////////////////////////
//copy open files at proc or thread ???? which pid return ??
for(i = 0; i < NOFILE; i++)
if(proc->ofile[i])
80103af8: 8b 44 b2 1c mov 0x1c(%edx,%esi,4),%eax
80103afc: 85 c0 test %eax,%eax
80103afe: 74 13 je 80103b13 <fork+0xe3>
np->ofile[i] = filedup(proc->ofile[i]);
80103b00: 89 04 24 mov %eax,(%esp)
80103b03: e8 98 d2 ff ff call 80100da0 <filedup>
80103b08: 89 44 b3 1c mov %eax,0x1c(%ebx,%esi,4)
80103b0c: 65 8b 15 04 00 00 00 mov %gs:0x4,%edx
// Clear %eax so that fork returns 0 in the child.
t_new->tf->eax = 0;
///////////////////////////////////////////////////////////////////////////////////////////////////////////
//copy open files at proc or thread ???? which pid return ??
for(i = 0; i < NOFILE; i++)
80103b13: 83 c6 01 add $0x1,%esi
80103b16: 83 fe 10 cmp $0x10,%esi
80103b19: 75 dd jne 80103af8 <fork+0xc8>
if(proc->ofile[i])
np->ofile[i] = filedup(proc->ofile[i]);
np->cwd = idup(proc->cwd);
80103b1b: 8b 42 5c mov 0x5c(%edx),%eax
80103b1e: 89 04 24 mov %eax,(%esp)
80103b21: e8 ea da ff ff call 80101610 <idup>
80103b26: 89 43 5c mov %eax,0x5c(%ebx)
safestrcpy(np->name, proc->name, sizeof(proc->name));
80103b29: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80103b2f: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
80103b36: 00
80103b37: 83 c0 60 add $0x60,%eax
80103b3a: 89 44 24 04 mov %eax,0x4(%esp)
80103b3e: 8d 43 60 lea 0x60(%ebx),%eax
80103b41: 89 04 24 mov %eax,(%esp)
80103b44: e8 d7 10 00 00 call 80104c20 <safestrcpy>
pid = np->pid;
80103b49: 8b 73 0c mov 0xc(%ebx),%esi
////////////////////////////////////////////////////////////////////////////////////////////////////////
acquire(&ptable.lock);
80103b4c: c7 04 24 40 3a 11 80 movl $0x80113a40,(%esp)
80103b53: e8 68 0d 00 00 call 801048c0 <acquire>
np->state = NEED_RUNTIME;
80103b58: c7 43 08 02 00 00 00 movl $0x2,0x8(%ebx)
t_new->state = Runnable;
80103b5f: c7 43 74 03 00 00 00 movl $0x3,0x74(%ebx)
release(&ptable.lock);
80103b66: c7 04 24 40 3a 11 80 movl $0x80113a40,(%esp)
80103b6d: e8 7e 0e 00 00 call 801049f0 <release>
return pid;
80103b72: 89 f0 mov %esi,%eax
}
80103b74: 83 c4 1c add $0x1c,%esp
80103b77: 5b pop %ebx
80103b78: 5e pop %esi
80103b79: 5f pop %edi
80103b7a: 5d pop %ebp
80103b7b: c3 ret
t_new=np->thread_array;
t_old=&proc->thread_array[0];
// Copy process state from p.
if((np->pgdir = copyuvm(proc->pgdir, proc->sz)) == 0){
kfree(t_new->kstack);
80103b7c: 8b 43 70 mov 0x70(%ebx),%eax
80103b7f: 89 04 24 mov %eax,(%esp)
80103b82: e8 59 e7 ff ff call 801022e0 <kfree>
t_new->kstack = 0;
80103b87: c7 43 70 00 00 00 00 movl $0x0,0x70(%ebx)
t_new->state = Unused;
80103b8e: c7 43 74 00 00 00 00 movl $0x0,0x74(%ebx)
release(&ptable.lock);
80103b95: c7 04 24 40 3a 11 80 movl $0x80113a40,(%esp)
80103b9c: e8 4f 0e 00 00 call 801049f0 <release>
return -1;
80103ba1: b8 ff ff ff ff mov $0xffffffff,%eax
80103ba6: eb cc jmp 80103b74 <fork+0x144>
80103ba8: 90 nop
80103ba9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80103bb0 <scheduler>:
// - swtch to start running that process
// - eventually that process transfers control
// via swtch back to the scheduler.
void
scheduler(void)
{
80103bb0: 55 push %ebp
80103bb1: 89 e5 mov %esp,%ebp
80103bb3: 56 push %esi
80103bb4: 53 push %ebx
80103bb5: 83 ec 10 sub $0x10,%esp
}
static inline void
sti(void)
{
asm volatile("sti");
80103bb8: fb sti
for(;;) {
// Enable interrupts on this processor.
sti();
// Loop over process table looking for process to run.
acquire(&ptable.lock);
80103bb9: c7 04 24 40 3a 11 80 movl $0x80113a40,(%esp)
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80103bc0: be 74 3a 11 80 mov $0x80113a74,%esi
for(;;) {
// Enable interrupts on this processor.
sti();
// Loop over process table looking for process to run.
acquire(&ptable.lock);
80103bc5: e8 f6 0c 00 00 call 801048c0 <acquire>
80103bca: eb 16 jmp 80103be2 <scheduler+0x32>
80103bcc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80103bd0: 81 c6 30 04 00 00 add $0x430,%esi
80103bd6: 81 fe 74 46 12 80 cmp $0x80124674,%esi
80103bdc: 0f 84 85 00 00 00 je 80103c67 <scheduler+0xb7>
if(p->state != NEED_RUNTIME)
80103be2: 83 7e 08 02 cmpl $0x2,0x8(%esi)
80103be6: 75 e8 jne 80103bd0 <scheduler+0x20>
continue;
for(t=&p->thread_array[0] ; t< &p->thread_array[NTHREAD] ; t++){
if(t->state!= Runnable)
80103be8: 83 7e 74 03 cmpl $0x3,0x74(%esi)
80103bec: 8d 5e 70 lea 0x70(%esi),%ebx
80103bef: 8d 86 f0 03 00 00 lea 0x3f0(%esi),%eax
80103bf5: 74 0e je 80103c05 <scheduler+0x55>
80103bf7: 90 nop
// Loop over process table looking for process to run.
acquire(&ptable.lock);
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
if(p->state != NEED_RUNTIME)
continue;
for(t=&p->thread_array[0] ; t< &p->thread_array[NTHREAD] ; t++){
80103bf8: 83 c3 38 add $0x38,%ebx
80103bfb: 39 c3 cmp %eax,%ebx
80103bfd: 73 d1 jae 80103bd0 <scheduler+0x20>
if(t->state!= Runnable)
80103bff: 83 7b 04 03 cmpl $0x3,0x4(%ebx)
80103c03: 75 f3 jne 80103bf8 <scheduler+0x48>
// Switch to chosen process. It is the process's job
// to release ptable.lock and then reacquire it
// before jumping back to us.
thread=t;
proc=p;
switchuvm(p);
80103c05: 89 34 24 mov %esi,(%esp)
continue;
// Switch to chosen process. It is the process's job
// to release ptable.lock and then reacquire it
// before jumping back to us.
thread=t;
proc=p;
80103c08: 65 89 35 04 00 00 00 mov %esi,%gs:0x4
// Enable interrupts on this processor.
sti();
// Loop over process table looking for process to run.
acquire(&ptable.lock);
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80103c0f: 81 c6 30 04 00 00 add $0x430,%esi
if(t->state!= Runnable)
continue;
// Switch to chosen process. It is the process's job
// to release ptable.lock and then reacquire it
// before jumping back to us.
thread=t;
80103c15: 65 89 1d 08 00 00 00 mov %ebx,%gs:0x8
proc=p;
switchuvm(p);
80103c1c: e8 bf 34 00 00 call 801070e0 <switchuvm>
t->state=Running;
swtch(&cpu->scheduler, t->context);
80103c21: 8b 43 18 mov 0x18(%ebx),%eax
// to release ptable.lock and then reacquire it
// before jumping back to us.
thread=t;
proc=p;
switchuvm(p);
t->state=Running;
80103c24: c7 43 04 04 00 00 00 movl $0x4,0x4(%ebx)
swtch(&cpu->scheduler, t->context);
80103c2b: 89 44 24 04 mov %eax,0x4(%esp)
80103c2f: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80103c35: 83 c0 04 add $0x4,%eax
80103c38: 89 04 24 mov %eax,(%esp)
80103c3b: e8 3b 10 00 00 call 80104c7b <swtch>
switchkvm();
80103c40: e8 7b 34 00 00 call 801070c0 <switchkvm>
// Enable interrupts on this processor.
sti();
// Loop over process table looking for process to run.
acquire(&ptable.lock);
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80103c45: 81 fe 74 46 12 80 cmp $0x80124674,%esi
swtch(&cpu->scheduler, t->context);
switchkvm();
// Process is done running for now.
// It should have changed its p->state before coming back.
thread = 0;
80103c4b: 65 c7 05 08 00 00 00 movl $0x0,%gs:0x8
80103c52: 00 00 00 00
proc=0;
80103c56: 65 c7 05 04 00 00 00 movl $0x0,%gs:0x4
80103c5d: 00 00 00 00
// Enable interrupts on this processor.
sti();
// Loop over process table looking for process to run.
acquire(&ptable.lock);
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80103c61: 0f 85 7b ff ff ff jne 80103be2 <scheduler+0x32>
thread = 0;
proc=0;
break;
}
}
release(&ptable.lock);
80103c67: c7 04 24 40 3a 11 80 movl $0x80113a40,(%esp)
80103c6e: e8 7d 0d 00 00 call 801049f0 <release>
}
80103c73: e9 40 ff ff ff jmp 80103bb8 <scheduler+0x8>
80103c78: 90 nop
80103c79: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80103c80 <sched>:
// Enter scheduler. Must hold only ptable.lock
// and have changed proc->state.
void
sched(void)
{
80103c80: 55 push %ebp
80103c81: 89 e5 mov %esp,%ebp
80103c83: 53 push %ebx
80103c84: 83 ec 14 sub $0x14,%esp
int intena;
if(!holding(&ptable.lock))
80103c87: c7 04 24 40 3a 11 80 movl $0x80113a40,(%esp)
80103c8e: e8 bd 0c 00 00 call 80104950 <holding>
80103c93: 85 c0 test %eax,%eax
80103c95: 74 4d je 80103ce4 <sched+0x64>
panic("sched ptable.lock");
if(cpu->ncli != 1)
80103c97: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80103c9d: 83 b8 ac 00 00 00 01 cmpl $0x1,0xac(%eax)
80103ca4: 75 62 jne 80103d08 <sched+0x88>
panic("sched locks");
if(thread->state == Running)
80103ca6: 65 8b 15 08 00 00 00 mov %gs:0x8,%edx
80103cad: 83 7a 04 04 cmpl $0x4,0x4(%edx)
80103cb1: 74 49 je 80103cfc <sched+0x7c>
static inline uint
readeflags(void)
{
uint eflags;
asm volatile("pushfl; popl %0" : "=r" (eflags));
80103cb3: 9c pushf
80103cb4: 59 pop %ecx
panic("sched running");
if(readeflags()&FL_IF)
80103cb5: 80 e5 02 and $0x2,%ch
80103cb8: 75 36 jne 80103cf0 <sched+0x70>
panic("sched interruptible");
intena = cpu->intena;
80103cba: 8b 98 b0 00 00 00 mov 0xb0(%eax),%ebx
swtch(&thread->context, cpu->scheduler);
80103cc0: 83 c2 18 add $0x18,%edx
80103cc3: 8b 40 04 mov 0x4(%eax),%eax
80103cc6: 89 14 24 mov %edx,(%esp)
80103cc9: 89 44 24 04 mov %eax,0x4(%esp)
80103ccd: e8 a9 0f 00 00 call 80104c7b <swtch>
cpu->intena = intena;
80103cd2: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80103cd8: 89 98 b0 00 00 00 mov %ebx,0xb0(%eax)
}
80103cde: 83 c4 14 add $0x14,%esp
80103ce1: 5b pop %ebx
80103ce2: 5d pop %ebp
80103ce3: c3 ret
sched(void)
{
int intena;
if(!holding(&ptable.lock))
panic("sched ptable.lock");
80103ce4: c7 04 24 ec 7b 10 80 movl $0x80107bec,(%esp)
80103ceb: e8 40 c6 ff ff call 80100330 <panic>
if(cpu->ncli != 1)
panic("sched locks");
if(thread->state == Running)
panic("sched running");
if(readeflags()&FL_IF)
panic("sched interruptible");
80103cf0: c7 04 24 18 7c 10 80 movl $0x80107c18,(%esp)
80103cf7: e8 34 c6 ff ff call 80100330 <panic>
if(!holding(&ptable.lock))
panic("sched ptable.lock");
if(cpu->ncli != 1)
panic("sched locks");
if(thread->state == Running)
panic("sched running");
80103cfc: c7 04 24 0a 7c 10 80 movl $0x80107c0a,(%esp)
80103d03: e8 28 c6 ff ff call 80100330 <panic>
int intena;
if(!holding(&ptable.lock))
panic("sched ptable.lock");
if(cpu->ncli != 1)
panic("sched locks");
80103d08: c7 04 24 fe 7b 10 80 movl $0x80107bfe,(%esp)
80103d0f: e8 1c c6 ff ff call 80100330 <panic>
80103d14: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80103d1a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
80103d20 <yield>:
}
// Give up the CPU for one scheduling round.
void
yield(void)
{
80103d20: 55 push %ebp
80103d21: 89 e5 mov %esp,%ebp
80103d23: 83 ec 18 sub $0x18,%esp
acquire(&ptable.lock); //DOC: yieldlock
80103d26: c7 04 24 40 3a 11 80 movl $0x80113a40,(%esp)
80103d2d: e8 8e 0b 00 00 call 801048c0 <acquire>
proc->state = NEED_RUNTIME;
80103d32: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80103d38: c7 40 08 02 00 00 00 movl $0x2,0x8(%eax)
thread->state=Runnable;
80103d3f: 65 a1 08 00 00 00 mov %gs:0x8,%eax
80103d45: c7 40 04 03 00 00 00 movl $0x3,0x4(%eax)
sched();
80103d4c: e8 2f ff ff ff call 80103c80 <sched>
release(&ptable.lock);
80103d51: c7 04 24 40 3a 11 80 movl $0x80113a40,(%esp)
80103d58: e8 93 0c 00 00 call 801049f0 <release>
}
80103d5d: c9 leave
80103d5e: c3 ret
80103d5f: 90 nop
80103d60 <sleep>:
// Atomically release lock and sleep on chan.
// Reacquires lock when awakened.
void
sleep(void *chan, struct spinlock *lk)
{
80103d60: 55 push %ebp
80103d61: 89 e5 mov %esp,%ebp
80103d63: 56 push %esi
80103d64: 53 push %ebx
80103d65: 83 ec 10 sub $0x10,%esp
if(proc == 0)
80103d68: 65 a1 04 00 00 00 mov %gs:0x4,%eax
// Atomically release lock and sleep on chan.
// Reacquires lock when awakened.
void
sleep(void *chan, struct spinlock *lk)
{
80103d6e: 8b 75 08 mov 0x8(%ebp),%esi
80103d71: 8b 5d 0c mov 0xc(%ebp),%ebx
if(proc == 0)
80103d74: 85 c0 test %eax,%eax
80103d76: 0f 84 b1 00 00 00 je 80103e2d <sleep+0xcd>
panic("sleep");
if(lk == 0)
80103d7c: 85 db test %ebx,%ebx
80103d7e: 0f 84 9d 00 00 00 je 80103e21 <sleep+0xc1>
// change p->state and then call sched.
// Once we hold ptable.lock, we can be
// guaranteed that we won't miss any wakeup
// (wakeup runs with ptable.lock locked),
// so it's okay to release lk.
if(lk != &ptable.lock){ //DOC: sleeplock0
80103d84: 81 fb 40 3a 11 80 cmp $0x80113a40,%ebx
80103d8a: 74 64 je 80103df0 <sleep+0x90>
////////////////////////////////////////////////////////////////////////////////////////////////
//acquire also thread lock ?????????????????
acquire(&ptable.lock); //DOC: sleeplock1
80103d8c: c7 04 24 40 3a 11 80 movl $0x80113a40,(%esp)
80103d93: e8 28 0b 00 00 call 801048c0 <acquire>
release(lk);
80103d98: 89 1c 24 mov %ebx,(%esp)
80103d9b: e8 50 0c 00 00 call 801049f0 <release>
}
// Go to sleep.
thread->chan = chan;
80103da0: 65 a1 08 00 00 00 mov %gs:0x8,%eax
80103da6: 89 70 1c mov %esi,0x1c(%eax)
thread->state = Sleeping;
80103da9: c7 40 04 02 00 00 00 movl $0x2,0x4(%eax)
proc->running_threads--;
80103db0: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80103db6: 83 a8 2c 04 00 00 01 subl $0x1,0x42c(%eax)
//cprintf("sleep() before entering the sched()\n");
sched();
80103dbd: e8 be fe ff ff call 80103c80 <sched>
// Tidy up.
thread->chan = 0;
80103dc2: 65 a1 08 00 00 00 mov %gs:0x8,%eax
80103dc8: c7 40 1c 00 00 00 00 movl $0x0,0x1c(%eax)
// Reacquire original lock.
if(lk != &ptable.lock){ //DOC: sleeplock2
release(&ptable.lock);
80103dcf: c7 04 24 40 3a 11 80 movl $0x80113a40,(%esp)
80103dd6: e8 15 0c 00 00 call 801049f0 <release>
acquire(lk);
80103ddb: 89 5d 08 mov %ebx,0x8(%ebp)
}
}
80103dde: 83 c4 10 add $0x10,%esp
80103de1: 5b pop %ebx
80103de2: 5e pop %esi
80103de3: 5d pop %ebp
thread->chan = 0;
// Reacquire original lock.
if(lk != &ptable.lock){ //DOC: sleeplock2
release(&ptable.lock);
acquire(lk);
80103de4: e9 d7 0a 00 00 jmp 801048c0 <acquire>
80103de9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
acquire(&ptable.lock); //DOC: sleeplock1
release(lk);
}
// Go to sleep.
thread->chan = chan;
80103df0: 65 8b 15 08 00 00 00 mov %gs:0x8,%edx
80103df7: 89 72 1c mov %esi,0x1c(%edx)
thread->state = Sleeping;
80103dfa: c7 42 04 02 00 00 00 movl $0x2,0x4(%edx)
proc->running_threads--;
80103e01: 83 a8 2c 04 00 00 01 subl $0x1,0x42c(%eax)
//cprintf("sleep() before entering the sched()\n");
sched();
80103e08: e8 73 fe ff ff call 80103c80 <sched>
// Tidy up.
thread->chan = 0;
80103e0d: 65 a1 08 00 00 00 mov %gs:0x8,%eax
80103e13: c7 40 1c 00 00 00 00 movl $0x0,0x1c(%eax)
if(lk != &ptable.lock){ //DOC: sleeplock2
release(&ptable.lock);
acquire(lk);
}
}
80103e1a: 83 c4 10 add $0x10,%esp
80103e1d: 5b pop %ebx
80103e1e: 5e pop %esi
80103e1f: 5d pop %ebp
80103e20: c3 ret
if(proc == 0)
panic("sleep");
if(lk == 0)
panic("sleep without lk");
80103e21: c7 04 24 32 7c 10 80 movl $0x80107c32,(%esp)
80103e28: e8 03 c5 ff ff call 80100330 <panic>
void
sleep(void *chan, struct spinlock *lk)
{
if(proc == 0)
panic("sleep");
80103e2d: c7 04 24 2c 7c 10 80 movl $0x80107c2c,(%esp)
80103e34: e8 f7 c4 ff ff call 80100330 <panic>
80103e39: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80103e40 <wait>:
// Wait for a child process to exit and return its pid.
// Return -1 if this process has no children.
int
wait(void)
{
80103e40: 55 push %ebp
80103e41: 89 e5 mov %esp,%ebp
80103e43: 57 push %edi
80103e44: 56 push %esi
80103e45: 53 push %ebx
80103e46: 83 ec 1c sub $0x1c,%esp
struct proc *p;
struct thread *t;
int havekids, pid;
acquire(&ptable.lock);
80103e49: c7 04 24 40 3a 11 80 movl $0x80113a40,(%esp)
80103e50: e8 6b 0a 00 00 call 801048c0 <acquire>
80103e55: 65 a1 04 00 00 00 mov %gs:0x4,%eax
for(;;){
// Scan through table looking for zombie children.
havekids = 0;
80103e5b: 31 d2 xor %edx,%edx
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80103e5d: bb 74 3a 11 80 mov $0x80113a74,%ebx
80103e62: eb 12 jmp 80103e76 <wait+0x36>
80103e64: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80103e68: 81 c3 30 04 00 00 add $0x430,%ebx
80103e6e: 81 fb 74 46 12 80 cmp $0x80124674,%ebx
80103e74: 74 22 je 80103e98 <wait+0x58>
if(p->parent != proc)
80103e76: 3b 43 10 cmp 0x10(%ebx),%eax
80103e79: 75 ed jne 80103e68 <wait+0x28>
continue;
havekids = 1;
if(p->state == ZOMBIE){
80103e7b: 83 7b 08 04 cmpl $0x4,0x8(%ebx)
80103e7f: 74 3c je 80103ebd <wait+0x7d>
acquire(&ptable.lock);
for(;;){
// Scan through table looking for zombie children.
havekids = 0;
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80103e81: 81 c3 30 04 00 00 add $0x430,%ebx
if(p->parent != proc)
continue;
havekids = 1;
80103e87: ba 01 00 00 00 mov $0x1,%edx
acquire(&ptable.lock);
for(;;){
// Scan through table looking for zombie children.
havekids = 0;
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80103e8c: 81 fb 74 46 12 80 cmp $0x80124674,%ebx
80103e92: 75 e2 jne 80103e76 <wait+0x36>
80103e94: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
return pid;
}
}
// No point waiting if we don't have any children.
if(!havekids || proc->killed){
80103e98: 85 d2 test %edx,%edx
80103e9a: 0f 84 d5 00 00 00 je 80103f75 <wait+0x135>
80103ea0: 8b 50 18 mov 0x18(%eax),%edx
80103ea3: 85 d2 test %edx,%edx
80103ea5: 0f 85 ca 00 00 00 jne 80103f75 <wait+0x135>
release(&ptable.lock);
return -1;
}
// Wait for children to exit. (See wakeup1 call in proc_exit.)
sleep(proc, &ptable.lock); //DOC: wait-sleep
80103eab: c7 44 24 04 40 3a 11 movl $0x80113a40,0x4(%esp)
80103eb2: 80
80103eb3: 89 04 24 mov %eax,(%esp)
80103eb6: e8 a5 fe ff ff call 80103d60 <sleep>
}
80103ebb: eb 98 jmp 80103e55 <wait+0x15>
continue;
havekids = 1;
if(p->state == ZOMBIE){
// Found one.
acquire(&p->Lock_Threads);
80103ebd: 8d bb f0 03 00 00 lea 0x3f0(%ebx),%edi
80103ec3: 89 3c 24 mov %edi,(%esp)
for(t=&p->thread_array[0];t<&p->thread_array[NTHREAD];t++) {
80103ec6: 8d 73 70 lea 0x70(%ebx),%esi
continue;
havekids = 1;
if(p->state == ZOMBIE){
// Found one.
acquire(&p->Lock_Threads);
80103ec9: e8 f2 09 00 00 call 801048c0 <acquire>
80103ece: eb 07 jmp 80103ed7 <wait+0x97>
for(t=&p->thread_array[0];t<&p->thread_array[NTHREAD];t++) {
80103ed0: 83 c6 38 add $0x38,%esi
80103ed3: 39 f7 cmp %esi,%edi
80103ed5: 76 48 jbe 80103f1f <wait+0xdf>
if(t->state == Zombie) {
80103ed7: 83 7e 04 05 cmpl $0x5,0x4(%esi)
80103edb: 75 f3 jne 80103ed0 <wait+0x90>
kfree(t->kstack);
80103edd: 8b 06 mov (%esi),%eax
havekids = 1;
if(p->state == ZOMBIE){
// Found one.
acquire(&p->Lock_Threads);
for(t=&p->thread_array[0];t<&p->thread_array[NTHREAD];t++) {
80103edf: 83 c6 38 add $0x38,%esi
if(t->state == Zombie) {
kfree(t->kstack);
80103ee2: 89 04 24 mov %eax,(%esp)
80103ee5: e8 f6 e3 ff ff call 801022e0 <kfree>
t->kstack=0;
80103eea: c7 46 c8 00 00 00 00 movl $0x0,-0x38(%esi)
t->parent_thread=0;
80103ef1: c7 46 d8 00 00 00 00 movl $0x0,-0x28(%esi)
t->state=Unused;
80103ef8: c7 46 cc 00 00 00 00 movl $0x0,-0x34(%esi)
t->killed=0;
80103eff: c7 46 e8 00 00 00 00 movl $0x0,-0x18(%esi)
t->tid=-1;
80103f06: c7 46 d0 ff ff ff ff movl $0xffffffff,-0x30(%esi)
t->context=0;
80103f0d: c7 46 e0 00 00 00 00 movl $0x0,-0x20(%esi)
t->tf=0;
80103f14: c7 46 dc 00 00 00 00 movl $0x0,-0x24(%esi)
havekids = 1;
if(p->state == ZOMBIE){
// Found one.
acquire(&p->Lock_Threads);
for(t=&p->thread_array[0];t<&p->thread_array[NTHREAD];t++) {
80103f1b: 39 f7 cmp %esi,%edi
80103f1d: 77 b8 ja 80103ed7 <wait+0x97>
t->tid=-1;
t->context=0;
t->tf=0;
}
}
release(&p->Lock_Threads);
80103f1f: 89 3c 24 mov %edi,(%esp)
80103f22: e8 c9 0a 00 00 call 801049f0 <release>
pid = p->pid;
freevm(p->pgdir);
80103f27: 8b 43 04 mov 0x4(%ebx),%eax
t->context=0;
t->tf=0;
}
}
release(&p->Lock_Threads);
pid = p->pid;
80103f2a: 8b 73 0c mov 0xc(%ebx),%esi
freevm(p->pgdir);
80103f2d: 89 04 24 mov %eax,(%esp)
80103f30: e8 9b 34 00 00 call 801073d0 <freevm>
p->parent = 0;
p->name[0] = 0;
p->killed = 0;
p->total_number_threads=0;
p->state = UNUSED;
release(&ptable.lock);
80103f35: c7 04 24 40 3a 11 80 movl $0x80113a40,(%esp)
}
}
release(&p->Lock_Threads);
pid = p->pid;
freevm(p->pgdir);
p->pid = 0;
80103f3c: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx)
p->parent = 0;
80103f43: c7 43 10 00 00 00 00 movl $0x0,0x10(%ebx)
p->name[0] = 0;
80103f4a: c6 43 60 00 movb $0x0,0x60(%ebx)
p->killed = 0;
80103f4e: c7 43 18 00 00 00 00 movl $0x0,0x18(%ebx)
p->total_number_threads=0;
80103f55: c7 83 24 04 00 00 00 movl $0x0,0x424(%ebx)
80103f5c: 00 00 00
p->state = UNUSED;
80103f5f: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx)
release(&ptable.lock);
80103f66: e8 85 0a 00 00 call 801049f0 <release>
return -1;
}
// Wait for children to exit. (See wakeup1 call in proc_exit.)
sleep(proc, &ptable.lock); //DOC: wait-sleep
}
}
80103f6b: 83 c4 1c add $0x1c,%esp
p->name[0] = 0;
p->killed = 0;
p->total_number_threads=0;
p->state = UNUSED;
release(&ptable.lock);
return pid;
80103f6e: 89 f0 mov %esi,%eax
return -1;
}
// Wait for children to exit. (See wakeup1 call in proc_exit.)
sleep(proc, &ptable.lock); //DOC: wait-sleep
}
}
80103f70: 5b pop %ebx
80103f71: 5e pop %esi
80103f72: 5f pop %edi
80103f73: 5d pop %ebp
80103f74: c3 ret
}
}
// No point waiting if we don't have any children.
if(!havekids || proc->killed){
release(&ptable.lock);
80103f75: c7 04 24 40 3a 11 80 movl $0x80113a40,(%esp)
80103f7c: e8 6f 0a 00 00 call 801049f0 <release>
return -1;
}
// Wait for children to exit. (See wakeup1 call in proc_exit.)
sleep(proc, &ptable.lock); //DOC: wait-sleep
}
}
80103f81: 83 c4 1c add $0x1c,%esp
}
// No point waiting if we don't have any children.
if(!havekids || proc->killed){
release(&ptable.lock);
return -1;
80103f84: b8 ff ff ff ff mov $0xffffffff,%eax
}
// Wait for children to exit. (See wakeup1 call in proc_exit.)
sleep(proc, &ptable.lock); //DOC: wait-sleep
}
}
80103f89: 5b pop %ebx
80103f8a: 5e pop %esi
80103f8b: 5f pop %edi
80103f8c: 5d pop %ebp
80103f8d: c3 ret
80103f8e: 66 90 xchg %ax,%ax
80103f90 <wakeup>:
// Wake up all processes sleeping on chan.
void
wakeup(void *chan)
{
80103f90: 55 push %ebp
80103f91: 89 e5 mov %esp,%ebp
80103f93: 53 push %ebx
80103f94: 83 ec 14 sub $0x14,%esp
80103f97: 8b 5d 08 mov 0x8(%ebp),%ebx
acquire(&ptable.lock);
80103f9a: c7 04 24 40 3a 11 80 movl $0x80113a40,(%esp)
80103fa1: e8 1a 09 00 00 call 801048c0 <acquire>
wakeup1(chan);
80103fa6: 89 d8 mov %ebx,%eax
80103fa8: e8 83 f6 ff ff call 80103630 <wakeup1>
release(&ptable.lock);
80103fad: c7 45 08 40 3a 11 80 movl $0x80113a40,0x8(%ebp)
}
80103fb4: 83 c4 14 add $0x14,%esp
80103fb7: 5b pop %ebx
80103fb8: 5d pop %ebp
void
wakeup(void *chan)
{
acquire(&ptable.lock);
wakeup1(chan);
release(&ptable.lock);
80103fb9: e9 32 0a 00 00 jmp 801049f0 <release>
80103fbe: 66 90 xchg %ax,%ax
80103fc0 <kill>:
// Kill the process with the given pid.
// Process won't exit until it returns
// to user space (see trap in trap.c).
int
kill(int pid)
{
80103fc0: 55 push %ebp
80103fc1: 89 e5 mov %esp,%ebp
80103fc3: 53 push %ebx
80103fc4: 83 ec 14 sub $0x14,%esp
80103fc7: 8b 5d 08 mov 0x8(%ebp),%ebx
struct proc *p;
acquire(&ptable.lock);
80103fca: c7 04 24 40 3a 11 80 movl $0x80113a40,(%esp)
80103fd1: e8 ea 08 00 00 call 801048c0 <acquire>
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80103fd6: b8 74 3a 11 80 mov $0x80113a74,%eax
80103fdb: eb 0f jmp 80103fec <kill+0x2c>
80103fdd: 8d 76 00 lea 0x0(%esi),%esi
80103fe0: 05 30 04 00 00 add $0x430,%eax
80103fe5: 3d 74 46 12 80 cmp $0x80124674,%eax
80103fea: 74 3c je 80104028 <kill+0x68>
if(p->pid == pid){
80103fec: 39 58 0c cmp %ebx,0xc(%eax)
80103fef: 75 ef jne 80103fe0 <kill+0x20>
p->killed = 1;
// Wake process from sleep if necessary.
if(p->state == NO_NEED_RUNTIME)
80103ff1: 83 78 08 03 cmpl $0x3,0x8(%eax)
struct proc *p;
acquire(&ptable.lock);
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
if(p->pid == pid){
p->killed = 1;
80103ff5: c7 40 18 01 00 00 00 movl $0x1,0x18(%eax)
// Wake process from sleep if necessary.
if(p->state == NO_NEED_RUNTIME)
80103ffc: 74 1a je 80104018 <kill+0x58>
p->state = NEED_RUNTIME;
release(&ptable.lock);
80103ffe: c7 04 24 40 3a 11 80 movl $0x80113a40,(%esp)
80104005: e8 e6 09 00 00 call 801049f0 <release>
return 0;
}
}
release(&ptable.lock);
return -1;
}
8010400a: 83 c4 14 add $0x14,%esp
p->killed = 1;
// Wake process from sleep if necessary.
if(p->state == NO_NEED_RUNTIME)
p->state = NEED_RUNTIME;
release(&ptable.lock);
return 0;
8010400d: 31 c0 xor %eax,%eax
}
}
release(&ptable.lock);
return -1;
}
8010400f: 5b pop %ebx
80104010: 5d pop %ebp
80104011: c3 ret
80104012: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
if(p->pid == pid){
p->killed = 1;
// Wake process from sleep if necessary.
if(p->state == NO_NEED_RUNTIME)
p->state = NEED_RUNTIME;
80104018: c7 40 08 02 00 00 00 movl $0x2,0x8(%eax)
8010401f: eb dd jmp 80103ffe <kill+0x3e>
80104021: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
release(&ptable.lock);
return 0;
}
}
release(&ptable.lock);
80104028: c7 04 24 40 3a 11 80 movl $0x80113a40,(%esp)
8010402f: e8 bc 09 00 00 call 801049f0 <release>
return -1;
}
80104034: 83 c4 14 add $0x14,%esp
release(&ptable.lock);
return 0;
}
}
release(&ptable.lock);
return -1;
80104037: b8 ff ff ff ff mov $0xffffffff,%eax
}
8010403c: 5b pop %ebx
8010403d: 5d pop %ebp
8010403e: c3 ret
8010403f: 90 nop
80104040 <kthread_create>:
}*/
//CREATE
int kthread_create(void*(*start_func)(), void* stack, uint stack_size){
80104040: 55 push %ebp
80104041: 89 e5 mov %esp,%ebp
80104043: 57 push %edi
80104044: 56 push %esi
80104045: 53 push %ebx
80104046: 83 ec 1c sub $0x1c,%esp
struct proc * proc = thread->parent;
80104049: 65 a1 08 00 00 00 mov %gs:0x8,%eax
8010404f: 8b 70 0c mov 0xc(%eax),%esi
char *sp;
struct thread *t;
acquire(&proc->Lock_Threads);
80104052: 8d be f0 03 00 00 lea 0x3f0(%esi),%edi
80104058: 89 3c 24 mov %edi,(%esp)
for(t = proc->thread_array; t < &proc->thread_array[NPROC]; t++)
8010405b: 8d 5e 70 lea 0x70(%esi),%ebx
//CREATE
int kthread_create(void*(*start_func)(), void* stack, uint stack_size){
struct proc * proc = thread->parent;
char *sp;
struct thread *t;
acquire(&proc->Lock_Threads);
8010405e: e8 5d 08 00 00 call 801048c0 <acquire>
for(t = proc->thread_array; t < &proc->thread_array[NPROC]; t++)
if(t->state == Unused)
80104063: 8b 4e 74 mov 0x74(%esi),%ecx
int kthread_create(void*(*start_func)(), void* stack, uint stack_size){
struct proc * proc = thread->parent;
char *sp;
struct thread *t;
acquire(&proc->Lock_Threads);
for(t = proc->thread_array; t < &proc->thread_array[NPROC]; t++)
80104066: 8d 86 70 0e 00 00 lea 0xe70(%esi),%eax
if(t->state == Unused)
8010406c: 85 c9 test %ecx,%ecx
8010406e: 75 0f jne 8010407f <kthread_create+0x3f>
80104070: eb 26 jmp 80104098 <kthread_create+0x58>
80104072: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80104078: 8b 53 04 mov 0x4(%ebx),%edx
8010407b: 85 d2 test %edx,%edx
8010407d: 74 19 je 80104098 <kthread_create+0x58>
int kthread_create(void*(*start_func)(), void* stack, uint stack_size){
struct proc * proc = thread->parent;
char *sp;
struct thread *t;
acquire(&proc->Lock_Threads);
for(t = proc->thread_array; t < &proc->thread_array[NPROC]; t++)
8010407f: 83 c3 38 add $0x38,%ebx
80104082: 39 c3 cmp %eax,%ebx
80104084: 72 f2 jb 80104078 <kthread_create+0x38>
if(t->state == Unused)
goto found;
release(&proc->Lock_Threads);
80104086: 89 3c 24 mov %edi,(%esp)
80104089: e8 62 09 00 00 call 801049f0 <release>
t->state=Runnable;
//cprintf("A new thread has been created under process with pid %d with state %d, thread id is %d with state %d. Number of Threads under the process: %d\n",proc->pid,proc->state,t->tid,t->state,proc->total_number_threads);
return t->tid;
}
8010408e: 83 c4 1c add $0x1c,%esp
acquire(&proc->Lock_Threads);
for(t = proc->thread_array; t < &proc->thread_array[NPROC]; t++)
if(t->state == Unused)
goto found;
release(&proc->Lock_Threads);
return 0;
80104091: 31 c0 xor %eax,%eax
t->state=Runnable;
//cprintf("A new thread has been created under process with pid %d with state %d, thread id is %d with state %d. Number of Threads under the process: %d\n",proc->pid,proc->state,t->tid,t->state,proc->total_number_threads);
return t->tid;
}
80104093: 5b pop %ebx
80104094: 5e pop %esi
80104095: 5f pop %edi
80104096: 5d pop %ebp
80104097: c3 ret
release(&proc->Lock_Threads);
return 0;
found:
t->state= Embryo;
t->tid=nextid;
80104098: a1 0c b0 10 80 mov 0x8010b00c,%eax
goto found;
release(&proc->Lock_Threads);
return 0;
found:
t->state= Embryo;
8010409d: c7 43 04 01 00 00 00 movl $0x1,0x4(%ebx)
t->tid=nextid;
801040a4: 89 43 08 mov %eax,0x8(%ebx)
nextid++;
801040a7: 83 c0 01 add $0x1,%eax
proc->total_number_threads++;
801040aa: 83 86 24 04 00 00 01 addl $0x1,0x424(%esi)
release(&proc->Lock_Threads);
801040b1: 89 3c 24 mov %edi,(%esp)
return 0;
found:
t->state= Embryo;
t->tid=nextid;
nextid++;
801040b4: a3 0c b0 10 80 mov %eax,0x8010b00c
proc->total_number_threads++;
release(&proc->Lock_Threads);
801040b9: e8 32 09 00 00 call 801049f0 <release>
if((t->kstack = kalloc()) == 0){
801040be: e8 cd e3 ff ff call 80102490 <kalloc>
801040c3: 85 c0 test %eax,%eax
801040c5: 89 03 mov %eax,(%ebx)
801040c7: 74 77 je 80104140 <kthread_create+0x100>
t->state = Unused;
return 0;
}
// Leave room for trap frame.
sp = t->kstack + KSTACKSIZE;
sp -= sizeof *t->tf;
801040c9: 8d 90 b4 0f 00 00 lea 0xfb4(%eax),%edx
t->tf = (struct trapframe*)sp;
// Set up new context to start executing at forkret,
// which returns to trapret.
sp -= 4;
*(uint*)sp = (uint)trapret;
sp -= sizeof *t->context;
801040cf: 05 9c 0f 00 00 add $0xf9c,%eax
t->state = Unused;
return 0;
}
// Leave room for trap frame.
sp = t->kstack + KSTACKSIZE;
sp -= sizeof *t->tf;
801040d4: 89 53 14 mov %edx,0x14(%ebx)
t->tf = (struct trapframe*)sp;
// Set up new context to start executing at forkret,
// which returns to trapret.
sp -= 4;
*(uint*)sp = (uint)trapret;
801040d7: c7 40 14 7d 5d 10 80 movl $0x80105d7d,0x14(%eax)
sp -= sizeof *t->context;
t->context = (struct context*)sp;
801040de: 89 43 18 mov %eax,0x18(%ebx)
memset(t->context, 0, sizeof *t->context);
801040e1: c7 44 24 08 14 00 00 movl $0x14,0x8(%esp)
801040e8: 00
801040e9: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
801040f0: 00
801040f1: 89 04 24 mov %eax,(%esp)
801040f4: e8 47 09 00 00 call 80104a40 <memset>
t->context->eip = (uint)forkret;
801040f9: 8b 43 18 mov 0x18(%ebx),%eax
*t->tf=*thread->tf;
801040fc: b9 13 00 00 00 mov $0x13,%ecx
t->tf->eip = (uint)start_func;
80104101: 8b 55 08 mov 0x8(%ebp),%edx
sp -= 4;
*(uint*)sp = (uint)trapret;
sp -= sizeof *t->context;
t->context = (struct context*)sp;
memset(t->context, 0, sizeof *t->context);
t->context->eip = (uint)forkret;
80104104: c7 40 10 90 37 10 80 movl $0x80103790,0x10(%eax)
*t->tf=*thread->tf;
8010410b: 65 a1 08 00 00 00 mov %gs:0x8,%eax
80104111: 8b 7b 14 mov 0x14(%ebx),%edi
80104114: 8b 70 14 mov 0x14(%eax),%esi
80104117: f3 a5 rep movsl %ds:(%esi),%es:(%edi)
t->tf->eip = (uint)start_func;
80104119: 8b 43 14 mov 0x14(%ebx),%eax
8010411c: 89 50 38 mov %edx,0x38(%eax)
t->tf->esp = (uint)stack+ stack_size;
8010411f: 8b 55 0c mov 0xc(%ebp),%edx
80104122: 8b 43 14 mov 0x14(%ebx),%eax
80104125: 03 55 10 add 0x10(%ebp),%edx
80104128: 89 50 44 mov %edx,0x44(%eax)
t->state=Runnable;
//cprintf("A new thread has been created under process with pid %d with state %d, thread id is %d with state %d. Number of Threads under the process: %d\n",proc->pid,proc->state,t->tid,t->state,proc->total_number_threads);
return t->tid;
8010412b: 8b 43 08 mov 0x8(%ebx),%eax
*t->tf=*thread->tf;
t->tf->eip = (uint)start_func;
t->tf->esp = (uint)stack+ stack_size;
t->state=Runnable;
8010412e: c7 43 04 03 00 00 00 movl $0x3,0x4(%ebx)
//cprintf("A new thread has been created under process with pid %d with state %d, thread id is %d with state %d. Number of Threads under the process: %d\n",proc->pid,proc->state,t->tid,t->state,proc->total_number_threads);
return t->tid;
}
80104135: 83 c4 1c add $0x1c,%esp
80104138: 5b pop %ebx
80104139: 5e pop %esi
8010413a: 5f pop %edi
8010413b: 5d pop %ebp
8010413c: c3 ret
8010413d: 8d 76 00 lea 0x0(%esi),%esi
t->tid=nextid;
nextid++;
proc->total_number_threads++;
release(&proc->Lock_Threads);
if((t->kstack = kalloc()) == 0){
t->state = Unused;
80104140: c7 43 04 00 00 00 00 movl $0x0,0x4(%ebx)
t->state=Runnable;
//cprintf("A new thread has been created under process with pid %d with state %d, thread id is %d with state %d. Number of Threads under the process: %d\n",proc->pid,proc->state,t->tid,t->state,proc->total_number_threads);
return t->tid;
}
80104147: 83 c4 1c add $0x1c,%esp
8010414a: 5b pop %ebx
8010414b: 5e pop %esi
8010414c: 5f pop %edi
8010414d: 5d pop %ebp
8010414e: c3 ret
8010414f: 90 nop
80104150 <kthread_id>:
int kthread_id() {
int tid = thread->tid;
80104150: 65 a1 08 00 00 00 mov %gs:0x8,%eax
if(tid<0)
tid=-1;
80104156: ba ff ff ff ff mov $0xffffffff,%edx
}
int kthread_id() {
8010415b: 55 push %ebp
8010415c: 89 e5 mov %esp,%ebp
int tid = thread->tid;
if(tid<0)
tid=-1;
return tid;
}
8010415e: 5d pop %ebp
int kthread_id() {
int tid = thread->tid;
8010415f: 8b 40 08 mov 0x8(%eax),%eax
if(tid<0)
tid=-1;
80104162: 85 c0 test %eax,%eax
80104164: 0f 48 c2 cmovs %edx,%eax
return tid;
}
80104167: c3 ret
80104168: 90 nop
80104169: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80104170 <kthread_join>:
int kthread_join(int thread_id)
{
80104170: 55 push %ebp
80104171: 89 e5 mov %esp,%ebp
80104173: 57 push %edi
80104174: 56 push %esi
80104175: 53 push %ebx
80104176: 83 ec 1c sub $0x1c,%esp
struct proc * p = thread->parent;
80104179: 65 a1 08 00 00 00 mov %gs:0x8,%eax
tid=-1;
return tid;
}
int kthread_join(int thread_id)
{
8010417f: 8b 7d 08 mov 0x8(%ebp),%edi
struct proc * p = thread->parent;
80104182: 8b 70 0c mov 0xc(%eax),%esi
struct thread *t;
int havekids;
acquire(&p->Lock_Threads);
80104185: 8d 86 f0 03 00 00 lea 0x3f0(%esi),%eax
8010418b: 89 04 24 mov %eax,(%esp)
8010418e: 8d 9e 70 0e 00 00 lea 0xe70(%esi),%ebx
80104194: 89 45 e0 mov %eax,-0x20(%ebp)
80104197: e8 24 07 00 00 call 801048c0 <acquire>
8010419c: 8d 46 70 lea 0x70(%esi),%eax
8010419f: 89 45 e4 mov %eax,-0x1c(%ebp)
801041a2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
// Scan through table looking for zombie children.
havekids = 0;
for(t = &p->thread_array[0]; t < &p->thread_array[NPROC]; t++) {
//cprintf("kthread_join(): threads loop: waiting for somechild to get zombie...\n");
//cprintf("thread_id: %d, t->tid: %d, t->state: %d.\n",thread_id,t->tid,t->state);
if(t->tid != thread_id) {
801041a8: 39 7e 78 cmp %edi,0x78(%esi)
acquire(&p->Lock_Threads);
for(;;) {
//cprintf("kthread_join(): main loop: waiting for somechild to get zombie...\n");
// Scan through table looking for zombie children.
havekids = 0;
for(t = &p->thread_array[0]; t < &p->thread_array[NPROC]; t++) {
801041ab: 8b 45 e4 mov -0x1c(%ebp),%eax
//cprintf("kthread_join(): threads loop: waiting for somechild to get zombie...\n");
//cprintf("thread_id: %d, t->tid: %d, t->state: %d.\n",thread_id,t->tid,t->state);
if(t->tid != thread_id) {
801041ae: 74 0c je 801041bc <kthread_join+0x4c>
acquire(&p->Lock_Threads);
for(;;) {
//cprintf("kthread_join(): main loop: waiting for somechild to get zombie...\n");
// Scan through table looking for zombie children.
havekids = 0;
for(t = &p->thread_array[0]; t < &p->thread_array[NPROC]; t++) {
801041b0: 83 c0 38 add $0x38,%eax
801041b3: 39 d8 cmp %ebx,%eax
801041b5: 73 39 jae 801041f0 <kthread_join+0x80>
//cprintf("kthread_join(): threads loop: waiting for somechild to get zombie...\n");
//cprintf("thread_id: %d, t->tid: %d, t->state: %d.\n",thread_id,t->tid,t->state);
if(t->tid != thread_id) {
801041b7: 39 78 08 cmp %edi,0x8(%eax)
801041ba: 75 f4 jne 801041b0 <kthread_join+0x40>
continue;
}
havekids = 1;
if(t->state == Zombie) {
801041bc: 83 78 04 05 cmpl $0x5,0x4(%eax)
801041c0: 74 4e je 80104210 <kthread_join+0xa0>
}
}
// No point waiting if we don't have any children.
if(!havekids || thread->killed){
801041c2: 65 8b 0d 08 00 00 00 mov %gs:0x8,%ecx
801041c9: 8b 51 20 mov 0x20(%ecx),%edx
801041cc: 85 d2 test %edx,%edx
801041ce: 75 20 jne 801041f0 <kthread_join+0x80>
release(&proc->Lock_Threads);
return -1;
}
// Wait for children to exit. (See wakeup1 call in proc_exit.)
sleep(t, &proc->Lock_Threads); //DOC: wait-sleep
801041d0: 65 8b 15 04 00 00 00 mov %gs:0x4,%edx
801041d7: 89 04 24 mov %eax,(%esp)
801041da: 8d 8a f0 03 00 00 lea 0x3f0(%edx),%ecx
801041e0: 89 4c 24 04 mov %ecx,0x4(%esp)
801041e4: e8 77 fb ff ff call 80103d60 <sleep>
//the moment it would wake up it would release too.
}
801041e9: eb bd jmp 801041a8 <kthread_join+0x38>
801041eb: 90 nop
801041ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
}
// No point waiting if we don't have any children.
if(!havekids || thread->killed){
release(&proc->Lock_Threads);
801041f0: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801041f6: 05 f0 03 00 00 add $0x3f0,%eax
801041fb: 89 04 24 mov %eax,(%esp)
801041fe: e8 ed 07 00 00 call 801049f0 <release>
// Wait for children to exit. (See wakeup1 call in proc_exit.)
sleep(t, &proc->Lock_Threads); //DOC: wait-sleep
//the moment it would wake up it would release too.
}
}
80104203: 83 c4 1c add $0x1c,%esp
// No point waiting if we don't have any children.
if(!havekids || thread->killed){
release(&proc->Lock_Threads);
return -1;
80104206: b8 ff ff ff ff mov $0xffffffff,%eax
// Wait for children to exit. (See wakeup1 call in proc_exit.)
sleep(t, &proc->Lock_Threads); //DOC: wait-sleep
//the moment it would wake up it would release too.
}
}
8010420b: 5b pop %ebx
8010420c: 5e pop %esi
8010420d: 5f pop %edi
8010420e: 5d pop %ebp
8010420f: c3 ret
continue;
}
havekids = 1;
if(t->state == Zombie) {
//cprintf("kthread_join(): I catched a zombie thread! his tid was %d.\n",t->tid);
kfree(t->kstack);
80104210: 8b 10 mov (%eax),%edx
80104212: 89 45 e4 mov %eax,-0x1c(%ebp)
80104215: 89 14 24 mov %edx,(%esp)
80104218: e8 c3 e0 ff ff call 801022e0 <kfree>
t->kstack=0;
8010421d: 8b 45 e4 mov -0x1c(%ebp),%eax
80104220: c7 00 00 00 00 00 movl $0x0,(%eax)
t->state=Unused;
80104226: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax)
t->killed=0;
8010422d: c7 40 20 00 00 00 00 movl $0x0,0x20(%eax)
t->tid = -1;
80104234: c7 40 08 ff ff ff ff movl $0xffffffff,0x8(%eax)
t->context = 0;
8010423b: c7 40 18 00 00 00 00 movl $0x0,0x18(%eax)
t->tf = 0;
80104242: c7 40 14 00 00 00 00 movl $0x0,0x14(%eax)
release(&p->Lock_Threads);
80104249: 8b 45 e0 mov -0x20(%ebp),%eax
8010424c: 89 04 24 mov %eax,(%esp)
8010424f: e8 9c 07 00 00 call 801049f0 <release>
// Wait for children to exit. (See wakeup1 call in proc_exit.)
sleep(t, &proc->Lock_Threads); //DOC: wait-sleep
//the moment it would wake up it would release too.
}
}
80104254: 83 c4 1c add $0x1c,%esp
t->killed=0;
t->tid = -1;
t->context = 0;
t->tf = 0;
release(&p->Lock_Threads);
return 0;
80104257: 31 c0 xor %eax,%eax
// Wait for children to exit. (See wakeup1 call in proc_exit.)
sleep(t, &proc->Lock_Threads); //DOC: wait-sleep
//the moment it would wake up it would release too.
}
}
80104259: 5b pop %ebx
8010425a: 5e pop %esi
8010425b: 5f pop %edi
8010425c: 5d pop %ebp
8010425d: c3 ret
8010425e: 66 90 xchg %ax,%ax
80104260 <exit>:
// Exit the current process. Does not return.
// An exited process remains in the zombie state
// until its parent calls wait() to find out it exited.
void
exit(void)
{
80104260: 55 push %ebp
80104261: 89 e5 mov %esp,%ebp
80104263: 56 push %esi
80104264: 53 push %ebx
80104265: 83 ec 10 sub $0x10,%esp
struct proc *p;
struct thread *t;
int fd;
if(proc == initproc)
80104268: 65 a1 04 00 00 00 mov %gs:0x4,%eax
8010426e: 3b 05 bc b5 10 80 cmp 0x8010b5bc,%eax
80104274: 0f 84 86 01 00 00 je 80104400 <exit+0x1a0>
panic("init exiting");
acquire(&proc->Lock_Threads);
8010427a: 05 f0 03 00 00 add $0x3f0,%eax
8010427f: 89 04 24 mov %eax,(%esp)
80104282: e8 39 06 00 00 call 801048c0 <acquire>
80104287: 65 8b 0d 04 00 00 00 mov %gs:0x4,%ecx
while(proc->total_number_threads > 1) {
8010428e: 83 b9 24 04 00 00 01 cmpl $0x1,0x424(%ecx)
80104295: 8d 81 f0 03 00 00 lea 0x3f0(%ecx),%eax
8010429b: 7e 71 jle 8010430e <exit+0xae>
8010429d: 8d 76 00 lea 0x0(%esi),%esi
//cprintf("exit(): Number of threads was more then 1");
for (t = &proc->thread_array[0]; t< &proc->thread_array[NTHREAD]; t++) {
801042a0: 8d 59 70 lea 0x70(%ecx),%ebx
801042a3: 90 nop
801042a4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(t != thread && t->state != Unused){
801042a8: 65 3b 1d 08 00 00 00 cmp %gs:0x8,%ebx
801042af: 74 47 je 801042f8 <exit+0x98>
801042b1: 8b 53 04 mov 0x4(%ebx),%edx
801042b4: 85 d2 test %edx,%edx
801042b6: 74 40 je 801042f8 <exit+0x98>
if(t->state != Zombie && !t->killed) {
801042b8: 83 fa 05 cmp $0x5,%edx
801042bb: 74 0e je 801042cb <exit+0x6b>
801042bd: 8b 53 20 mov 0x20(%ebx),%edx
801042c0: 85 d2 test %edx,%edx
801042c2: 75 07 jne 801042cb <exit+0x6b>
t->killed = 1;
801042c4: c7 43 20 01 00 00 00 movl $0x1,0x20(%ebx)
}
release(&proc->Lock_Threads);
801042cb: 89 04 24 mov %eax,(%esp)
801042ce: e8 1d 07 00 00 call 801049f0 <release>
kthread_join(t->tid);
801042d3: 8b 43 08 mov 0x8(%ebx),%eax
801042d6: 89 04 24 mov %eax,(%esp)
801042d9: e8 92 fe ff ff call 80104170 <kthread_join>
acquire(&proc->Lock_Threads);
801042de: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801042e4: 05 f0 03 00 00 add $0x3f0,%eax
801042e9: 89 04 24 mov %eax,(%esp)
801042ec: e8 cf 05 00 00 call 801048c0 <acquire>
801042f1: 65 8b 0d 04 00 00 00 mov %gs:0x4,%ecx
if(proc == initproc)
panic("init exiting");
acquire(&proc->Lock_Threads);
while(proc->total_number_threads > 1) {
//cprintf("exit(): Number of threads was more then 1");
for (t = &proc->thread_array[0]; t< &proc->thread_array[NTHREAD]; t++) {
801042f8: 83 c3 38 add $0x38,%ebx
801042fb: 8d 81 f0 03 00 00 lea 0x3f0(%ecx),%eax
80104301: 39 d8 cmp %ebx,%eax
80104303: 77 a3 ja 801042a8 <exit+0x48>
struct thread *t;
int fd;
if(proc == initproc)
panic("init exiting");
acquire(&proc->Lock_Threads);
while(proc->total_number_threads > 1) {
80104305: 83 b9 24 04 00 00 01 cmpl $0x1,0x424(%ecx)
8010430c: 7f 92 jg 801042a0 <exit+0x40>
}
}
}
release(&proc->Lock_Threads);
8010430e: 89 04 24 mov %eax,(%esp)
// Close all open files.
for(fd = 0; fd < NOFILE; fd++){
80104311: 31 db xor %ebx,%ebx
}
}
}
release(&proc->Lock_Threads);
80104313: e8 d8 06 00 00 call 801049f0 <release>
80104318: 65 8b 0d 04 00 00 00 mov %gs:0x4,%ecx
8010431f: 90 nop
// Close all open files.
for(fd = 0; fd < NOFILE; fd++){
if(proc->ofile[fd]){
80104320: 8d 73 04 lea 0x4(%ebx),%esi
80104323: 8b 44 b1 0c mov 0xc(%ecx,%esi,4),%eax
80104327: 85 c0 test %eax,%eax
80104329: 74 17 je 80104342 <exit+0xe2>
fileclose(proc->ofile[fd]);
8010432b: 89 04 24 mov %eax,(%esp)
8010432e: e8 bd ca ff ff call 80100df0 <fileclose>
proc->ofile[fd] = 0;
80104333: 65 8b 0d 04 00 00 00 mov %gs:0x4,%ecx
8010433a: c7 44 b1 0c 00 00 00 movl $0x0,0xc(%ecx,%esi,4)
80104341: 00
}
release(&proc->Lock_Threads);
// Close all open files.
for(fd = 0; fd < NOFILE; fd++){
80104342: 83 c3 01 add $0x1,%ebx
80104345: 83 fb 10 cmp $0x10,%ebx
80104348: 75 d6 jne 80104320 <exit+0xc0>
fileclose(proc->ofile[fd]);
proc->ofile[fd] = 0;
}
}
begin_op();
8010434a: e8 31 e8 ff ff call 80102b80 <begin_op>
iput(proc->cwd);
8010434f: 65 a1 04 00 00 00 mov %gs:0x4,%eax
// Parent might be sleeping in wait().
wakeup1(proc->parent);
// Pass abandoned children to init.
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) {
80104355: bb 74 3a 11 80 mov $0x80113a74,%ebx
proc->ofile[fd] = 0;
}
}
begin_op();
iput(proc->cwd);
8010435a: 8b 40 5c mov 0x5c(%eax),%eax
8010435d: 89 04 24 mov %eax,(%esp)
80104360: e8 3b d4 ff ff call 801017a0 <iput>
end_op();
80104365: e8 86 e8 ff ff call 80102bf0 <end_op>
proc->cwd = 0;
8010436a: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104370: c7 40 5c 00 00 00 00 movl $0x0,0x5c(%eax)
acquire(&ptable.lock);
80104377: c7 04 24 40 3a 11 80 movl $0x80113a40,(%esp)
8010437e: e8 3d 05 00 00 call 801048c0 <acquire>
///////////////////////////////////////////////////////////////////////////////////////////////////
/////wake up only proc ??? maybe thread ??? parent_thread
// Parent might be sleeping in wait().
wakeup1(proc->parent);
80104383: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104389: 8b 40 10 mov 0x10(%eax),%eax
8010438c: e8 9f f2 ff ff call 80103630 <wakeup1>
80104391: 65 8b 15 04 00 00 00 mov %gs:0x4,%edx
80104398: eb 14 jmp 801043ae <exit+0x14e>
8010439a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
// Pass abandoned children to init.
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) {
801043a0: 81 c3 30 04 00 00 add $0x430,%ebx
801043a6: 81 fb 74 46 12 80 cmp $0x80124674,%ebx
801043ac: 74 2d je 801043db <exit+0x17b>
if(p->parent == proc){
801043ae: 39 53 10 cmp %edx,0x10(%ebx)
801043b1: 75 ed jne 801043a0 <exit+0x140>
p->parent = initproc;
801043b3: a1 bc b5 10 80 mov 0x8010b5bc,%eax
if(p->state == ZOMBIE)
801043b8: 83 7b 08 04 cmpl $0x4,0x8(%ebx)
wakeup1(proc->parent);
// Pass abandoned children to init.
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) {
if(p->parent == proc){
p->parent = initproc;
801043bc: 89 43 10 mov %eax,0x10(%ebx)
if(p->state == ZOMBIE)
801043bf: 75 df jne 801043a0 <exit+0x140>
// Parent might be sleeping in wait().
wakeup1(proc->parent);
// Pass abandoned children to init.
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) {
801043c1: 81 c3 30 04 00 00 add $0x430,%ebx
if(p->parent == proc){
p->parent = initproc;
if(p->state == ZOMBIE)
wakeup1(initproc);
801043c7: e8 64 f2 ff ff call 80103630 <wakeup1>
// Parent might be sleeping in wait().
wakeup1(proc->parent);
// Pass abandoned children to init.
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) {
801043cc: 81 fb 74 46 12 80 cmp $0x80124674,%ebx
801043d2: 65 8b 15 04 00 00 00 mov %gs:0x4,%edx
801043d9: 75 d3 jne 801043ae <exit+0x14e>
}
}
// Jump into the scheduler, never to return.
proc->state = ZOMBIE;
thread->state=Zombie;
801043db: 65 a1 08 00 00 00 mov %gs:0x8,%eax
wakeup1(initproc);
}
}
// Jump into the scheduler, never to return.
proc->state = ZOMBIE;
801043e1: c7 42 08 04 00 00 00 movl $0x4,0x8(%edx)
thread->state=Zombie;
801043e8: c7 40 04 05 00 00 00 movl $0x5,0x4(%eax)
sched();
801043ef: e8 8c f8 ff ff call 80103c80 <sched>
panic("zombie exit");
801043f4: c7 04 24 50 7c 10 80 movl $0x80107c50,(%esp)
801043fb: e8 30 bf ff ff call 80100330 <panic>
{
struct proc *p;
struct thread *t;
int fd;
if(proc == initproc)
panic("init exiting");
80104400: c7 04 24 43 7c 10 80 movl $0x80107c43,(%esp)
80104407: e8 24 bf ff ff call 80100330 <panic>
8010440c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104410 <kthread_exit>:
//the moment it would wake up it would release too.
}
}
void kthread_exit()
{
80104410: 55 push %ebp
80104411: 89 e5 mov %esp,%ebp
80104413: 83 ec 18 sub $0x18,%esp
//cprintf("kthread_exit(): Number of threads is %d...\n",proc->total_number_threads);
if(proc == initproc) {
80104416: 65 a1 04 00 00 00 mov %gs:0x4,%eax
8010441c: 3b 05 bc b5 10 80 cmp 0x8010b5bc,%eax
80104422: 74 6b je 8010448f <kthread_exit+0x7f>
panic("init exiting");
}
if(proc->total_number_threads == 1) {
80104424: 83 b8 24 04 00 00 01 cmpl $0x1,0x424(%eax)
8010442b: 74 5d je 8010448a <kthread_exit+0x7a>
//cprintf("kthread_exit(): Number of threads was 1, so calling exit()...\n");
exit();
}
acquire(&proc->Lock_Threads);
8010442d: 05 f0 03 00 00 add $0x3f0,%eax
80104432: 89 04 24 mov %eax,(%esp)
80104435: e8 86 04 00 00 call 801048c0 <acquire>
proc->total_number_threads--;
8010443a: 65 a1 04 00 00 00 mov %gs:0x4,%eax
thread->state=Zombie;
80104440: 65 8b 15 08 00 00 00 mov %gs:0x8,%edx
if(proc->total_number_threads == 1) {
//cprintf("kthread_exit(): Number of threads was 1, so calling exit()...\n");
exit();
}
acquire(&proc->Lock_Threads);
proc->total_number_threads--;
80104447: 83 a8 24 04 00 00 01 subl $0x1,0x424(%eax)
thread->state=Zombie;
//cprintf("kthread_exit(): Exiting thread with tid %d under process %d...\n",thread->tid,proc->pid);
release(&proc->Lock_Threads);
8010444e: 05 f0 03 00 00 add $0x3f0,%eax
//cprintf("kthread_exit(): Number of threads was 1, so calling exit()...\n");
exit();
}
acquire(&proc->Lock_Threads);
proc->total_number_threads--;
thread->state=Zombie;
80104453: c7 42 04 05 00 00 00 movl $0x5,0x4(%edx)
//cprintf("kthread_exit(): Exiting thread with tid %d under process %d...\n",thread->tid,proc->pid);
release(&proc->Lock_Threads);
8010445a: 89 04 24 mov %eax,(%esp)
8010445d: e8 8e 05 00 00 call 801049f0 <release>
acquire(&ptable.lock);
80104462: c7 04 24 40 3a 11 80 movl $0x80113a40,(%esp)
80104469: e8 52 04 00 00 call 801048c0 <acquire>
// Parent might be sleeping in wait().
wakeup1(thread);
8010446e: 65 a1 08 00 00 00 mov %gs:0x8,%eax
80104474: e8 b7 f1 ff ff call 80103630 <wakeup1>
sched();
80104479: e8 02 f8 ff ff call 80103c80 <sched>
panic("zombie exit");
8010447e: c7 04 24 50 7c 10 80 movl $0x80107c50,(%esp)
80104485: e8 a6 be ff ff call 80100330 <panic>
panic("init exiting");
}
if(proc->total_number_threads == 1) {
//cprintf("kthread_exit(): Number of threads was 1, so calling exit()...\n");
exit();
8010448a: e8 d1 fd ff ff call 80104260 <exit>
void kthread_exit()
{
//cprintf("kthread_exit(): Number of threads is %d...\n",proc->total_number_threads);
if(proc == initproc) {
panic("init exiting");
8010448f: c7 04 24 43 7c 10 80 movl $0x80107c43,(%esp)
80104496: e8 95 be ff ff call 80100330 <panic>
8010449b: 90 nop
8010449c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801044a0 <procdump>:
// Print a process listing to console. For debugging.
// Runs when user types ^P on console.
// No lock to avoid wedging a stuck machine further.
void
procdump(void)
{
801044a0: 55 push %ebp
801044a1: 89 e5 mov %esp,%ebp
801044a3: 57 push %edi
801044a4: 56 push %esi
801044a5: 53 push %ebx
801044a6: bb d4 3a 11 80 mov $0x80113ad4,%ebx
801044ab: 83 ec 4c sub $0x4c,%esp
801044ae: 8d 75 e8 lea -0x18(%ebp),%esi
801044b1: eb 23 jmp 801044d6 <procdump+0x36>
801044b3: 90 nop
801044b4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(p->state == NO_NEED_RUNTIME){
getcallerpcs((uint*)p->thread_array[0].context->ebp+2, pc);
for(i=0; i<10 && pc[i] != 0; i++)
cprintf(" %p", pc[i]);
}
cprintf("\n");
801044b8: c7 04 24 86 7b 10 80 movl $0x80107b86,(%esp)
801044bf: e8 5c c1 ff ff call 80100620 <cprintf>
801044c4: 81 c3 30 04 00 00 add $0x430,%ebx
int i;
struct proc *p;
char *state;
uint pc[10];
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
801044ca: 81 fb d4 46 12 80 cmp $0x801246d4,%ebx
801044d0: 0f 84 8a 00 00 00 je 80104560 <procdump+0xc0>
if(p->state == UNUSED)
801044d6: 8b 43 a8 mov -0x58(%ebx),%eax
801044d9: 85 c0 test %eax,%eax
801044db: 74 e7 je 801044c4 <procdump+0x24>
continue;
if(p->state >= 0 && p->state < NELEM(states) && states[p->state])
801044dd: 83 f8 04 cmp $0x4,%eax
state = states[p->state];
else
state = "???";
801044e0: ba 5c 7c 10 80 mov $0x80107c5c,%edx
uint pc[10];
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
if(p->state == UNUSED)
continue;
if(p->state >= 0 && p->state < NELEM(states) && states[p->state])
801044e5: 77 11 ja 801044f8 <procdump+0x58>
801044e7: 8b 14 85 c4 7c 10 80 mov -0x7fef833c(,%eax,4),%edx
state = states[p->state];
else
state = "???";
801044ee: b8 5c 7c 10 80 mov $0x80107c5c,%eax
801044f3: 85 d2 test %edx,%edx
801044f5: 0f 44 d0 cmove %eax,%edx
cprintf("%d %s %s", p->pid, state, p->name);
801044f8: 8b 43 ac mov -0x54(%ebx),%eax
801044fb: 89 5c 24 0c mov %ebx,0xc(%esp)
801044ff: 89 54 24 08 mov %edx,0x8(%esp)
80104503: c7 04 24 60 7c 10 80 movl $0x80107c60,(%esp)
8010450a: 89 44 24 04 mov %eax,0x4(%esp)
8010450e: e8 0d c1 ff ff call 80100620 <cprintf>
if(p->state == NO_NEED_RUNTIME){
80104513: 83 7b a8 03 cmpl $0x3,-0x58(%ebx)
80104517: 75 9f jne 801044b8 <procdump+0x18>
getcallerpcs((uint*)p->thread_array[0].context->ebp+2, pc);
80104519: 8d 45 c0 lea -0x40(%ebp),%eax
8010451c: 89 44 24 04 mov %eax,0x4(%esp)
80104520: 8b 43 28 mov 0x28(%ebx),%eax
80104523: 8d 7d c0 lea -0x40(%ebp),%edi
80104526: 8b 40 0c mov 0xc(%eax),%eax
80104529: 83 c0 08 add $0x8,%eax
8010452c: 89 04 24 mov %eax,(%esp)
8010452f: e8 2c 03 00 00 call 80104860 <getcallerpcs>
80104534: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
for(i=0; i<10 && pc[i] != 0; i++)
80104538: 8b 17 mov (%edi),%edx
8010453a: 85 d2 test %edx,%edx
8010453c: 0f 84 76 ff ff ff je 801044b8 <procdump+0x18>
cprintf(" %p", pc[i]);
80104542: 89 54 24 04 mov %edx,0x4(%esp)
80104546: 83 c7 04 add $0x4,%edi
80104549: c7 04 24 82 76 10 80 movl $0x80107682,(%esp)
80104550: e8 cb c0 ff ff call 80100620 <cprintf>
else
state = "???";
cprintf("%d %s %s", p->pid, state, p->name);
if(p->state == NO_NEED_RUNTIME){
getcallerpcs((uint*)p->thread_array[0].context->ebp+2, pc);
for(i=0; i<10 && pc[i] != 0; i++)
80104555: 39 f7 cmp %esi,%edi
80104557: 75 df jne 80104538 <procdump+0x98>
80104559: e9 5a ff ff ff jmp 801044b8 <procdump+0x18>
8010455e: 66 90 xchg %ax,%ax
cprintf(" %p", pc[i]);
}
cprintf("\n");
}
}
80104560: 83 c4 4c add $0x4c,%esp
80104563: 5b pop %ebx
80104564: 5e pop %esi
80104565: 5f pop %edi
80104566: 5d pop %ebp
80104567: c3 ret
80104568: 90 nop
80104569: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80104570 <kthread_mutex_alloc>:
int kthread_mutex_alloc()
{
80104570: 55 push %ebp
80104571: 89 e5 mov %esp,%ebp
80104573: 53 push %ebx
struct kthread_mutext_t *m;
acquire(&mtable.lock);
for(m = mtable.mutex; m < &mtable.mutex[MAX_MUTEXES]; m++) {
80104574: bb 34 29 11 80 mov $0x80112934,%ebx
cprintf("\n");
}
}
int kthread_mutex_alloc()
{
80104579: 83 ec 14 sub $0x14,%esp
struct kthread_mutext_t *m;
acquire(&mtable.lock);
8010457c: c7 04 24 00 29 11 80 movl $0x80112900,(%esp)
80104583: e8 38 03 00 00 call 801048c0 <acquire>
80104588: eb 11 jmp 8010459b <kthread_mutex_alloc+0x2b>
8010458a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
for(m = mtable.mutex; m < &mtable.mutex[MAX_MUTEXES]; m++) {
80104590: 83 c3 44 add $0x44,%ebx
80104593: 81 fb 34 3a 11 80 cmp $0x80113a34,%ebx
80104599: 74 55 je 801045f0 <kthread_mutex_alloc+0x80>
if(!m->allocated) {
8010459b: 8b 43 38 mov 0x38(%ebx),%eax
8010459e: 85 c0 test %eax,%eax
801045a0: 75 ee jne 80104590 <kthread_mutex_alloc+0x20>
}
release(&mtable.lock);
return -1;
found:
m->mid = nextmid++;
801045a2: a1 08 b0 10 80 mov 0x8010b008,%eax
m->allocated = 1;
m->owner = 0;
m->locked = 0;
release(&mtable.lock);
801045a7: c7 04 24 00 29 11 80 movl $0x80112900,(%esp)
release(&mtable.lock);
return -1;
found:
m->mid = nextmid++;
m->allocated = 1;
801045ae: c7 43 38 01 00 00 00 movl $0x1,0x38(%ebx)
m->owner = 0;
801045b5: c7 43 3c 00 00 00 00 movl $0x0,0x3c(%ebx)
}
release(&mtable.lock);
return -1;
found:
m->mid = nextmid++;
801045bc: 8d 50 01 lea 0x1(%eax),%edx
801045bf: 89 03 mov %eax,(%ebx)
801045c1: 89 15 08 b0 10 80 mov %edx,0x8010b008
m->allocated = 1;
m->owner = 0;
m->locked = 0;
801045c7: c7 43 40 00 00 00 00 movl $0x0,0x40(%ebx)
release(&mtable.lock);
801045ce: e8 1d 04 00 00 call 801049f0 <release>
initlock(&m->lock, "mutex");
801045d3: 8d 43 04 lea 0x4(%ebx),%eax
801045d6: 89 04 24 mov %eax,(%esp)
801045d9: c7 44 24 04 69 7c 10 movl $0x80107c69,0x4(%esp)
801045e0: 80
801045e1: e8 5a 02 00 00 call 80104840 <initlock>
return m->mid;
801045e6: 8b 03 mov (%ebx),%eax
}
801045e8: 83 c4 14 add $0x14,%esp
801045eb: 5b pop %ebx
801045ec: 5d pop %ebp
801045ed: c3 ret
801045ee: 66 90 xchg %ax,%ax
for(m = mtable.mutex; m < &mtable.mutex[MAX_MUTEXES]; m++) {
if(!m->allocated) {
goto found;
}
}
release(&mtable.lock);
801045f0: c7 04 24 00 29 11 80 movl $0x80112900,(%esp)
801045f7: e8 f4 03 00 00 call 801049f0 <release>
m->owner = 0;
m->locked = 0;
release(&mtable.lock);
initlock(&m->lock, "mutex");
return m->mid;
}
801045fc: 83 c4 14 add $0x14,%esp
if(!m->allocated) {
goto found;
}
}
release(&mtable.lock);
return -1;
801045ff: b8 ff ff ff ff mov $0xffffffff,%eax
m->owner = 0;
m->locked = 0;
release(&mtable.lock);
initlock(&m->lock, "mutex");
return m->mid;
}
80104604: 5b pop %ebx
80104605: 5d pop %ebp
80104606: c3 ret
80104607: 89 f6 mov %esi,%esi
80104609: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104610 <kthread_mutex_dealloc>:
int kthread_mutex_dealloc(int mutex_id)
{
80104610: 55 push %ebp
80104611: 89 e5 mov %esp,%ebp
80104613: 53 push %ebx
80104614: 83 ec 14 sub $0x14,%esp
80104617: 8b 5d 08 mov 0x8(%ebp),%ebx
if(mutex_id < 0) {
8010461a: 85 db test %ebx,%ebx
8010461c: 0f 88 7f 00 00 00 js 801046a1 <kthread_mutex_dealloc+0x91>
return -1;
}
struct kthread_mutext_t *m;
acquire(&mtable.lock);
80104622: c7 04 24 00 29 11 80 movl $0x80112900,(%esp)
80104629: e8 92 02 00 00 call 801048c0 <acquire>
for(m = mtable.mutex; m < &mtable.mutex[MAX_MUTEXES]; m++) {
8010462e: ba 34 29 11 80 mov $0x80112934,%edx
80104633: eb 0e jmp 80104643 <kthread_mutex_dealloc+0x33>
80104635: 8d 76 00 lea 0x0(%esi),%esi
80104638: 83 c2 44 add $0x44,%edx
8010463b: 81 fa 34 3a 11 80 cmp $0x80113a34,%edx
80104641: 74 45 je 80104688 <kthread_mutex_dealloc+0x78>
if(m->mid==mutex_id) {
80104643: 39 1a cmp %ebx,(%edx)
80104645: 75 f1 jne 80104638 <kthread_mutex_dealloc+0x28>
if(!m->allocated || m->locked)
80104647: 8b 42 38 mov 0x38(%edx),%eax
8010464a: 85 c0 test %eax,%eax
8010464c: 74 3a je 80104688 <kthread_mutex_dealloc+0x78>
8010464e: 8b 5a 40 mov 0x40(%edx),%ebx
80104651: 85 db test %ebx,%ebx
80104653: 75 33 jne 80104688 <kthread_mutex_dealloc+0x78>
//m locked or was not allocated yet
release(&mtable.lock);
return -1;
}
//success
m->allocated=0;
80104655: c7 42 38 00 00 00 00 movl $0x0,0x38(%edx)
m->mid=0;
8010465c: c7 02 00 00 00 00 movl $0x0,(%edx)
m->locked=0;
80104662: c7 42 40 00 00 00 00 movl $0x0,0x40(%edx)
m->owner=0;
80104669: c7 42 3c 00 00 00 00 movl $0x0,0x3c(%edx)
release(&mtable.lock);
80104670: c7 04 24 00 29 11 80 movl $0x80112900,(%esp)
80104677: e8 74 03 00 00 call 801049f0 <release>
}
}
release(&mtable.lock);
//not found mutex with mutex_id
return -1;
}
8010467c: 83 c4 14 add $0x14,%esp
8010467f: 89 d8 mov %ebx,%eax
80104681: 5b pop %ebx
80104682: 5d pop %ebp
80104683: c3 ret
80104684: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
for(m = mtable.mutex; m < &mtable.mutex[MAX_MUTEXES]; m++) {
if(m->mid==mutex_id) {
if(!m->allocated || m->locked)
{
//m locked or was not allocated yet
release(&mtable.lock);
80104688: c7 04 24 00 29 11 80 movl $0x80112900,(%esp)
return -1;
8010468f: bb ff ff ff ff mov $0xffffffff,%ebx
for(m = mtable.mutex; m < &mtable.mutex[MAX_MUTEXES]; m++) {
if(m->mid==mutex_id) {
if(!m->allocated || m->locked)
{
//m locked or was not allocated yet
release(&mtable.lock);
80104694: e8 57 03 00 00 call 801049f0 <release>
}
}
release(&mtable.lock);
//not found mutex with mutex_id
return -1;
}
80104699: 83 c4 14 add $0x14,%esp
8010469c: 89 d8 mov %ebx,%eax
8010469e: 5b pop %ebx
8010469f: 5d pop %ebp
801046a0: c3 ret
}
int kthread_mutex_dealloc(int mutex_id)
{
if(mutex_id < 0) {
return -1;
801046a1: bb ff ff ff ff mov $0xffffffff,%ebx
801046a6: eb d4 jmp 8010467c <kthread_mutex_dealloc+0x6c>
801046a8: 90 nop
801046a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
801046b0 <kthread_mutex_lock>:
//not found mutex with mutex_id
return -1;
}
int kthread_mutex_lock(int mutex_id)
{
801046b0: 55 push %ebp
801046b1: 89 e5 mov %esp,%ebp
801046b3: 56 push %esi
801046b4: 53 push %ebx
struct kthread_mutext_t *m;
acquire(&mtable.lock);
for(m = mtable.mutex; m < &mtable.mutex[MAX_MUTEXES]; m++) {
801046b5: bb 34 29 11 80 mov $0x80112934,%ebx
//not found mutex with mutex_id
return -1;
}
int kthread_mutex_lock(int mutex_id)
{
801046ba: 83 ec 10 sub $0x10,%esp
801046bd: 8b 75 08 mov 0x8(%ebp),%esi
struct kthread_mutext_t *m;
acquire(&mtable.lock);
801046c0: c7 04 24 00 29 11 80 movl $0x80112900,(%esp)
801046c7: e8 f4 01 00 00 call 801048c0 <acquire>
801046cc: eb 0d jmp 801046db <kthread_mutex_lock+0x2b>
801046ce: 66 90 xchg %ax,%ax
for(m = mtable.mutex; m < &mtable.mutex[MAX_MUTEXES]; m++) {
801046d0: 83 c3 44 add $0x44,%ebx
801046d3: 81 fb 34 3a 11 80 cmp $0x80113a34,%ebx
801046d9: 74 7d je 80104758 <kthread_mutex_lock+0xa8>
if(m->allocated && m->mid==mutex_id)
801046db: 8b 4b 38 mov 0x38(%ebx),%ecx
801046de: 85 c9 test %ecx,%ecx
801046e0: 74 ee je 801046d0 <kthread_mutex_lock+0x20>
801046e2: 39 33 cmp %esi,(%ebx)
801046e4: 75 ea jne 801046d0 <kthread_mutex_lock+0x20>
{
release(&mtable.lock);
801046e6: c7 04 24 00 29 11 80 movl $0x80112900,(%esp)
acquire(&m->lock);//not 100% required
801046ed: 8d 73 04 lea 0x4(%ebx),%esi
struct kthread_mutext_t *m;
acquire(&mtable.lock);
for(m = mtable.mutex; m < &mtable.mutex[MAX_MUTEXES]; m++) {
if(m->allocated && m->mid==mutex_id)
{
release(&mtable.lock);
801046f0: e8 fb 02 00 00 call 801049f0 <release>
acquire(&m->lock);//not 100% required
801046f5: 89 34 24 mov %esi,(%esp)
801046f8: e8 c3 01 00 00 call 801048c0 <acquire>
//locked ---- add to queue and sleep
while(m->locked)
801046fd: 8b 53 40 mov 0x40(%ebx),%edx
80104700: 85 d2 test %edx,%edx
80104702: 74 17 je 8010471b <kthread_mutex_lock+0x6b>
80104704: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
{
// cprintf("Thread %d going to sleep !\n", kthread_id());
sleep(m,&m->lock);
80104708: 89 74 24 04 mov %esi,0x4(%esp)
8010470c: 89 1c 24 mov %ebx,(%esp)
8010470f: e8 4c f6 ff ff call 80103d60 <sleep>
if(m->allocated && m->mid==mutex_id)
{
release(&mtable.lock);
acquire(&m->lock);//not 100% required
//locked ---- add to queue and sleep
while(m->locked)
80104714: 8b 43 40 mov 0x40(%ebx),%eax
80104717: 85 c0 test %eax,%eax
80104719: 75 ed jne 80104708 <kthread_mutex_lock+0x58>
// cprintf("Thread %d going is awakened !\n", kthread_id());
//return 0;
}
//not locked
// cprintf("Thread %d is locking mutext %d !\n", kthread_id(),m->mid);
acquire(&mtable.lock);
8010471b: c7 04 24 00 29 11 80 movl $0x80112900,(%esp)
80104722: e8 99 01 00 00 call 801048c0 <acquire>
m->locked=1;
m->owner=thread->tid;
80104727: 65 a1 08 00 00 00 mov %gs:0x8,%eax
//return 0;
}
//not locked
// cprintf("Thread %d is locking mutext %d !\n", kthread_id(),m->mid);
acquire(&mtable.lock);
m->locked=1;
8010472d: c7 43 40 01 00 00 00 movl $0x1,0x40(%ebx)
m->owner=thread->tid;
80104734: 8b 40 08 mov 0x8(%eax),%eax
release(&mtable.lock);
80104737: c7 04 24 00 29 11 80 movl $0x80112900,(%esp)
}
//not locked
// cprintf("Thread %d is locking mutext %d !\n", kthread_id(),m->mid);
acquire(&mtable.lock);
m->locked=1;
m->owner=thread->tid;
8010473e: 89 43 3c mov %eax,0x3c(%ebx)
release(&mtable.lock);
80104741: e8 aa 02 00 00 call 801049f0 <release>
release(&m->lock);
80104746: 89 34 24 mov %esi,(%esp)
80104749: e8 a2 02 00 00 call 801049f0 <release>
}
//ERROR not found m with such mutex_id
//release(&m->lock);
release(&mtable.lock);
return -1;
}
8010474e: 83 c4 10 add $0x10,%esp
acquire(&mtable.lock);
m->locked=1;
m->owner=thread->tid;
release(&mtable.lock);
release(&m->lock);
return 0;
80104751: 31 c0 xor %eax,%eax
}
//ERROR not found m with such mutex_id
//release(&m->lock);
release(&mtable.lock);
return -1;
}
80104753: 5b pop %ebx
80104754: 5e pop %esi
80104755: 5d pop %ebp
80104756: c3 ret
80104757: 90 nop
return 0;
}
}
//ERROR not found m with such mutex_id
//release(&m->lock);
release(&mtable.lock);
80104758: c7 04 24 00 29 11 80 movl $0x80112900,(%esp)
8010475f: e8 8c 02 00 00 call 801049f0 <release>
return -1;
}
80104764: 83 c4 10 add $0x10,%esp
}
}
//ERROR not found m with such mutex_id
//release(&m->lock);
release(&mtable.lock);
return -1;
80104767: b8 ff ff ff ff mov $0xffffffff,%eax
}
8010476c: 5b pop %ebx
8010476d: 5e pop %esi
8010476e: 5d pop %ebp
8010476f: c3 ret
80104770 <kthread_mutex_unlock>:
int kthread_mutex_unlock(int mutex_id)
{
80104770: 55 push %ebp
80104771: 89 e5 mov %esp,%ebp
80104773: 56 push %esi
80104774: 53 push %ebx
80104775: 83 ec 10 sub $0x10,%esp
80104778: 8b 75 08 mov 0x8(%ebp),%esi
if(mutex_id < 0) return -1;
8010477b: 85 f6 test %esi,%esi
8010477d: 0f 88 8d 00 00 00 js 80104810 <kthread_mutex_unlock+0xa0>
struct kthread_mutext_t *m;
acquire(&mtable.lock);
80104783: c7 04 24 00 29 11 80 movl $0x80112900,(%esp)
for(m = mtable.mutex; m < &mtable.mutex[MAX_MUTEXES]; m++) {
8010478a: bb 34 29 11 80 mov $0x80112934,%ebx
int kthread_mutex_unlock(int mutex_id)
{
if(mutex_id < 0) return -1;
struct kthread_mutext_t *m;
acquire(&mtable.lock);
8010478f: e8 2c 01 00 00 call 801048c0 <acquire>
80104794: eb 0d jmp 801047a3 <kthread_mutex_unlock+0x33>
80104796: 66 90 xchg %ax,%ax
for(m = mtable.mutex; m < &mtable.mutex[MAX_MUTEXES]; m++) {
80104798: 83 c3 44 add $0x44,%ebx
8010479b: 81 fb 34 3a 11 80 cmp $0x80113a34,%ebx
801047a1: 74 55 je 801047f8 <kthread_mutex_unlock+0x88>
if(m->allocated && m->mid==mutex_id) {
801047a3: 8b 53 38 mov 0x38(%ebx),%edx
801047a6: 85 d2 test %edx,%edx
801047a8: 74 ee je 80104798 <kthread_mutex_unlock+0x28>
801047aa: 39 33 cmp %esi,(%ebx)
801047ac: 75 ea jne 80104798 <kthread_mutex_unlock+0x28>
acquire(&m->lock);
801047ae: 8d 73 04 lea 0x4(%ebx),%esi
801047b1: 89 34 24 mov %esi,(%esp)
801047b4: e8 07 01 00 00 call 801048c0 <acquire>
//check for errors : not locked
if(! m->locked )
801047b9: 8b 43 40 mov 0x40(%ebx),%eax
801047bc: 85 c0 test %eax,%eax
801047be: 74 57 je 80104817 <kthread_mutex_unlock+0xa7>
release(&m->lock);
return -1;
}
m->locked=0;
m->owner=0;
release(&mtable.lock);
801047c0: c7 04 24 00 29 11 80 movl $0x80112900,(%esp)
{
release(&mtable.lock);
release(&m->lock);
return -1;
}
m->locked=0;
801047c7: c7 43 40 00 00 00 00 movl $0x0,0x40(%ebx)
m->owner=0;
801047ce: c7 43 3c 00 00 00 00 movl $0x0,0x3c(%ebx)
release(&mtable.lock);
801047d5: e8 16 02 00 00 call 801049f0 <release>
release(&m->lock);
801047da: 89 34 24 mov %esi,(%esp)
801047dd: e8 0e 02 00 00 call 801049f0 <release>
wakeup(m);
801047e2: 89 1c 24 mov %ebx,(%esp)
801047e5: e8 a6 f7 ff ff call 80103f90 <wakeup>
return 0;
801047ea: 31 c0 xor %eax,%eax
}
//mutex wasnt found
//release(&m->lock);
release(&mtable.lock);
return -1;
}
801047ec: 83 c4 10 add $0x10,%esp
801047ef: 5b pop %ebx
801047f0: 5e pop %esi
801047f1: 5d pop %ebp
801047f2: c3 ret
801047f3: 90 nop
801047f4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
return 0;
}
}
//mutex wasnt found
//release(&m->lock);
release(&mtable.lock);
801047f8: c7 04 24 00 29 11 80 movl $0x80112900,(%esp)
801047ff: e8 ec 01 00 00 call 801049f0 <release>
return -1;
}
80104804: 83 c4 10 add $0x10,%esp
}
}
//mutex wasnt found
//release(&m->lock);
release(&mtable.lock);
return -1;
80104807: b8 ff ff ff ff mov $0xffffffff,%eax
}
8010480c: 5b pop %ebx
8010480d: 5e pop %esi
8010480e: 5d pop %ebp
8010480f: c3 ret
return -1;
}
int kthread_mutex_unlock(int mutex_id)
{
if(mutex_id < 0) return -1;
80104810: b8 ff ff ff ff mov $0xffffffff,%eax
80104815: eb d5 jmp 801047ec <kthread_mutex_unlock+0x7c>
if(m->allocated && m->mid==mutex_id) {
acquire(&m->lock);
//check for errors : not locked
if(! m->locked )
{
release(&mtable.lock);
80104817: c7 04 24 00 29 11 80 movl $0x80112900,(%esp)
8010481e: e8 cd 01 00 00 call 801049f0 <release>
release(&m->lock);
80104823: 89 34 24 mov %esi,(%esp)
80104826: e8 c5 01 00 00 call 801049f0 <release>
return -1;
8010482b: b8 ff ff ff ff mov $0xffffffff,%eax
80104830: eb ba jmp 801047ec <kthread_mutex_unlock+0x7c>
80104832: 66 90 xchg %ax,%ax
80104834: 66 90 xchg %ax,%ax
80104836: 66 90 xchg %ax,%ax
80104838: 66 90 xchg %ax,%ax
8010483a: 66 90 xchg %ax,%ax
8010483c: 66 90 xchg %ax,%ax
8010483e: 66 90 xchg %ax,%ax
80104840 <initlock>:
#include "proc.h"
void
initlock(struct spinlock *lk, char *name)
{
80104840: 55 push %ebp
80104841: 89 e5 mov %esp,%ebp
80104843: 8b 45 08 mov 0x8(%ebp),%eax
lk->name = name;
80104846: 8b 55 0c mov 0xc(%ebp),%edx
lk->locked = 0;
80104849: c7 00 00 00 00 00 movl $0x0,(%eax)
void
initlock(struct spinlock *lk, char *name)
{
lk->name = name;
8010484f: 89 50 04 mov %edx,0x4(%eax)
lk->locked = 0;
lk->cpu = 0;
80104852: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax)
}
80104859: 5d pop %ebp
8010485a: c3 ret
8010485b: 90 nop
8010485c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104860 <getcallerpcs>:
}
// Record the current call stack in pcs[] by following the %ebp chain.
void
getcallerpcs(void *v, uint pcs[])
{
80104860: 55 push %ebp
80104861: 89 e5 mov %esp,%ebp
uint *ebp;
int i;
ebp = (uint*)v - 2;
80104863: 8b 45 08 mov 0x8(%ebp),%eax
}
// Record the current call stack in pcs[] by following the %ebp chain.
void
getcallerpcs(void *v, uint pcs[])
{
80104866: 8b 4d 0c mov 0xc(%ebp),%ecx
80104869: 53 push %ebx
uint *ebp;
int i;
ebp = (uint*)v - 2;
8010486a: 8d 50 f8 lea -0x8(%eax),%edx
for(i = 0; i < 10; i++){
8010486d: 31 c0 xor %eax,%eax
8010486f: 90 nop
if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff)
80104870: 8d 9a 00 00 00 80 lea -0x80000000(%edx),%ebx
80104876: 81 fb fe ff ff 7f cmp $0x7ffffffe,%ebx
8010487c: 77 1a ja 80104898 <getcallerpcs+0x38>
break;
pcs[i] = ebp[1]; // saved %eip
8010487e: 8b 5a 04 mov 0x4(%edx),%ebx
80104881: 89 1c 81 mov %ebx,(%ecx,%eax,4)
{
uint *ebp;
int i;
ebp = (uint*)v - 2;
for(i = 0; i < 10; i++){
80104884: 83 c0 01 add $0x1,%eax
if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff)
break;
pcs[i] = ebp[1]; // saved %eip
ebp = (uint*)ebp[0]; // saved %ebp
80104887: 8b 12 mov (%edx),%edx
{
uint *ebp;
int i;
ebp = (uint*)v - 2;
for(i = 0; i < 10; i++){
80104889: 83 f8 0a cmp $0xa,%eax
8010488c: 75 e2 jne 80104870 <getcallerpcs+0x10>
pcs[i] = ebp[1]; // saved %eip
ebp = (uint*)ebp[0]; // saved %ebp
}
for(; i < 10; i++)
pcs[i] = 0;
}
8010488e: 5b pop %ebx
8010488f: 5d pop %ebp
80104890: c3 ret
80104891: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
break;
pcs[i] = ebp[1]; // saved %eip
ebp = (uint*)ebp[0]; // saved %ebp
}
for(; i < 10; i++)
pcs[i] = 0;
80104898: c7 04 81 00 00 00 00 movl $0x0,(%ecx,%eax,4)
if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff)
break;
pcs[i] = ebp[1]; // saved %eip
ebp = (uint*)ebp[0]; // saved %ebp
}
for(; i < 10; i++)
8010489f: 83 c0 01 add $0x1,%eax
801048a2: 83 f8 0a cmp $0xa,%eax
801048a5: 74 e7 je 8010488e <getcallerpcs+0x2e>
pcs[i] = 0;
801048a7: c7 04 81 00 00 00 00 movl $0x0,(%ecx,%eax,4)
if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff)
break;
pcs[i] = ebp[1]; // saved %eip
ebp = (uint*)ebp[0]; // saved %ebp
}
for(; i < 10; i++)
801048ae: 83 c0 01 add $0x1,%eax
801048b1: 83 f8 0a cmp $0xa,%eax
801048b4: 75 e2 jne 80104898 <getcallerpcs+0x38>
801048b6: eb d6 jmp 8010488e <getcallerpcs+0x2e>
801048b8: 90 nop
801048b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
801048c0 <acquire>:
// Loops (spins) until the lock is acquired.
// Holding a lock for a long time may cause
// other CPUs to waste time spinning to acquire it.
void
acquire(struct spinlock *lk)
{
801048c0: 55 push %ebp
801048c1: 89 e5 mov %esp,%ebp
801048c3: 83 ec 18 sub $0x18,%esp
801048c6: 9c pushf
801048c7: 59 pop %ecx
}
static inline void
cli(void)
{
asm volatile("cli");
801048c8: fa cli
{
int eflags;
eflags = readeflags();
cli();
if(cpu->ncli == 0)
801048c9: 65 a1 00 00 00 00 mov %gs:0x0,%eax
801048cf: 8b 90 ac 00 00 00 mov 0xac(%eax),%edx
801048d5: 85 d2 test %edx,%edx
801048d7: 75 0c jne 801048e5 <acquire+0x25>
cpu->intena = eflags & FL_IF;
801048d9: 81 e1 00 02 00 00 and $0x200,%ecx
801048df: 89 88 b0 00 00 00 mov %ecx,0xb0(%eax)
cpu->ncli += 1;
801048e5: 83 c2 01 add $0x1,%edx
801048e8: 89 90 ac 00 00 00 mov %edx,0xac(%eax)
// other CPUs to waste time spinning to acquire it.
void
acquire(struct spinlock *lk)
{
pushcli(); // disable interrupts to avoid deadlock.
if(holding(lk))
801048ee: 8b 55 08 mov 0x8(%ebp),%edx
// Check whether this cpu is holding the lock.
int
holding(struct spinlock *lock)
{
return lock->locked && lock->cpu == cpu;
801048f1: 8b 0a mov (%edx),%ecx
801048f3: 85 c9 test %ecx,%ecx
801048f5: 74 05 je 801048fc <acquire+0x3c>
801048f7: 3b 42 08 cmp 0x8(%edx),%eax
801048fa: 74 3e je 8010493a <acquire+0x7a>
xchg(volatile uint *addr, uint newval)
{
uint result;
// The + in "+m" denotes a read-modify-write operand.
asm volatile("lock; xchgl %0, %1" :
801048fc: b9 01 00 00 00 mov $0x1,%ecx
80104901: eb 08 jmp 8010490b <acquire+0x4b>
80104903: 90 nop
80104904: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104908: 8b 55 08 mov 0x8(%ebp),%edx
8010490b: 89 c8 mov %ecx,%eax
8010490d: f0 87 02 lock xchg %eax,(%edx)
pushcli(); // disable interrupts to avoid deadlock.
if(holding(lk))
panic("acquire");
// The xchg is atomic.
while(xchg(&lk->locked, 1) != 0)
80104910: 85 c0 test %eax,%eax
80104912: 75 f4 jne 80104908 <acquire+0x48>
;
// Tell the C compiler and the processor to not move loads or stores
// past this point, to ensure that the critical section's memory
// references happen after the lock is acquired.
__sync_synchronize();
80104914: f0 83 0c 24 00 lock orl $0x0,(%esp)
// Record info about lock acquisition for debugging.
lk->cpu = cpu;
80104919: 8b 45 08 mov 0x8(%ebp),%eax
8010491c: 65 8b 15 00 00 00 00 mov %gs:0x0,%edx
getcallerpcs(&lk, lk->pcs);
80104923: 83 c0 0c add $0xc,%eax
// past this point, to ensure that the critical section's memory
// references happen after the lock is acquired.
__sync_synchronize();
// Record info about lock acquisition for debugging.
lk->cpu = cpu;
80104926: 89 50 fc mov %edx,-0x4(%eax)
getcallerpcs(&lk, lk->pcs);
80104929: 89 44 24 04 mov %eax,0x4(%esp)
8010492d: 8d 45 08 lea 0x8(%ebp),%eax
80104930: 89 04 24 mov %eax,(%esp)
80104933: e8 28 ff ff ff call 80104860 <getcallerpcs>
}
80104938: c9 leave
80104939: c3 ret
void
acquire(struct spinlock *lk)
{
pushcli(); // disable interrupts to avoid deadlock.
if(holding(lk))
panic("acquire");
8010493a: c7 04 24 d8 7c 10 80 movl $0x80107cd8,(%esp)
80104941: e8 ea b9 ff ff call 80100330 <panic>
80104946: 8d 76 00 lea 0x0(%esi),%esi
80104949: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104950 <holding>:
}
// Check whether this cpu is holding the lock.
int
holding(struct spinlock *lock)
{
80104950: 55 push %ebp
return lock->locked && lock->cpu == cpu;
80104951: 31 c0 xor %eax,%eax
}
// Check whether this cpu is holding the lock.
int
holding(struct spinlock *lock)
{
80104953: 89 e5 mov %esp,%ebp
80104955: 8b 55 08 mov 0x8(%ebp),%edx
return lock->locked && lock->cpu == cpu;
80104958: 8b 0a mov (%edx),%ecx
8010495a: 85 c9 test %ecx,%ecx
8010495c: 74 0f je 8010496d <holding+0x1d>
8010495e: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80104964: 39 42 08 cmp %eax,0x8(%edx)
80104967: 0f 94 c0 sete %al
8010496a: 0f b6 c0 movzbl %al,%eax
}
8010496d: 5d pop %ebp
8010496e: c3 ret
8010496f: 90 nop
80104970 <pushcli>:
// it takes two popcli to undo two pushcli. Also, if interrupts
// are off, then pushcli, popcli leaves them off.
void
pushcli(void)
{
80104970: 55 push %ebp
80104971: 89 e5 mov %esp,%ebp
static inline uint
readeflags(void)
{
uint eflags;
asm volatile("pushfl; popl %0" : "=r" (eflags));
80104973: 9c pushf
80104974: 59 pop %ecx
}
static inline void
cli(void)
{
asm volatile("cli");
80104975: fa cli
int eflags;
eflags = readeflags();
cli();
if(cpu->ncli == 0)
80104976: 65 a1 00 00 00 00 mov %gs:0x0,%eax
8010497c: 8b 90 ac 00 00 00 mov 0xac(%eax),%edx
80104982: 85 d2 test %edx,%edx
80104984: 75 0c jne 80104992 <pushcli+0x22>
cpu->intena = eflags & FL_IF;
80104986: 81 e1 00 02 00 00 and $0x200,%ecx
8010498c: 89 88 b0 00 00 00 mov %ecx,0xb0(%eax)
cpu->ncli += 1;
80104992: 83 c2 01 add $0x1,%edx
80104995: 89 90 ac 00 00 00 mov %edx,0xac(%eax)
}
8010499b: 5d pop %ebp
8010499c: c3 ret
8010499d: 8d 76 00 lea 0x0(%esi),%esi
801049a0 <popcli>:
void
popcli(void)
{
801049a0: 55 push %ebp
801049a1: 89 e5 mov %esp,%ebp
801049a3: 83 ec 18 sub $0x18,%esp
static inline uint
readeflags(void)
{
uint eflags;
asm volatile("pushfl; popl %0" : "=r" (eflags));
801049a6: 9c pushf
801049a7: 58 pop %eax
if(readeflags()&FL_IF)
801049a8: f6 c4 02 test $0x2,%ah
801049ab: 75 34 jne 801049e1 <popcli+0x41>
panic("popcli - interruptible");
if(--cpu->ncli < 0)
801049ad: 65 a1 00 00 00 00 mov %gs:0x0,%eax
801049b3: 8b 88 ac 00 00 00 mov 0xac(%eax),%ecx
801049b9: 8d 51 ff lea -0x1(%ecx),%edx
801049bc: 85 d2 test %edx,%edx
801049be: 89 90 ac 00 00 00 mov %edx,0xac(%eax)
801049c4: 78 0f js 801049d5 <popcli+0x35>
panic("popcli");
if(cpu->ncli == 0 && cpu->intena)
801049c6: 75 0b jne 801049d3 <popcli+0x33>
801049c8: 8b 80 b0 00 00 00 mov 0xb0(%eax),%eax
801049ce: 85 c0 test %eax,%eax
801049d0: 74 01 je 801049d3 <popcli+0x33>
}
static inline void
sti(void)
{
asm volatile("sti");
801049d2: fb sti
sti();
}
801049d3: c9 leave
801049d4: c3 ret
popcli(void)
{
if(readeflags()&FL_IF)
panic("popcli - interruptible");
if(--cpu->ncli < 0)
panic("popcli");
801049d5: c7 04 24 f7 7c 10 80 movl $0x80107cf7,(%esp)
801049dc: e8 4f b9 ff ff call 80100330 <panic>
void
popcli(void)
{
if(readeflags()&FL_IF)
panic("popcli - interruptible");
801049e1: c7 04 24 e0 7c 10 80 movl $0x80107ce0,(%esp)
801049e8: e8 43 b9 ff ff call 80100330 <panic>
801049ed: 8d 76 00 lea 0x0(%esi),%esi
801049f0 <release>:
}
// Release the lock.
void
release(struct spinlock *lk)
{
801049f0: 55 push %ebp
801049f1: 89 e5 mov %esp,%ebp
801049f3: 83 ec 18 sub $0x18,%esp
801049f6: 8b 45 08 mov 0x8(%ebp),%eax
// Check whether this cpu is holding the lock.
int
holding(struct spinlock *lock)
{
return lock->locked && lock->cpu == cpu;
801049f9: 8b 10 mov (%eax),%edx
801049fb: 85 d2 test %edx,%edx
801049fd: 74 0c je 80104a0b <release+0x1b>
801049ff: 65 8b 15 00 00 00 00 mov %gs:0x0,%edx
80104a06: 39 50 08 cmp %edx,0x8(%eax)
80104a09: 74 0d je 80104a18 <release+0x28>
// Release the lock.
void
release(struct spinlock *lk)
{
if(!holding(lk))
panic("release");
80104a0b: c7 04 24 fe 7c 10 80 movl $0x80107cfe,(%esp)
80104a12: e8 19 b9 ff ff call 80100330 <panic>
80104a17: 90 nop
lk->pcs[0] = 0;
80104a18: c7 40 0c 00 00 00 00 movl $0x0,0xc(%eax)
lk->cpu = 0;
80104a1f: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax)
// Tell the C compiler and the processor to not move loads or stores
// past this point, to ensure that all the stores in the critical
// section are visible to other cores before the lock is released.
// Both the C compiler and the hardware may re-order loads and
// stores; __sync_synchronize() tells them both to not re-order.
__sync_synchronize();
80104a26: f0 83 0c 24 00 lock orl $0x0,(%esp)
// Release the lock, equivalent to lk->locked = 0.
// This code can't use a C assignment, since it might
// not be atomic.
asm volatile("movl $0, %0" : "+m" (lk->locked) : );
80104a2b: c7 00 00 00 00 00 movl $0x0,(%eax)
popcli();
}
80104a31: c9 leave
// Release the lock, equivalent to lk->locked = 0.
// This code can't use a C assignment, since it might
// not be atomic.
asm volatile("movl $0, %0" : "+m" (lk->locked) : );
popcli();
80104a32: e9 69 ff ff ff jmp 801049a0 <popcli>
80104a37: 66 90 xchg %ax,%ax
80104a39: 66 90 xchg %ax,%ax
80104a3b: 66 90 xchg %ax,%ax
80104a3d: 66 90 xchg %ax,%ax
80104a3f: 90 nop
80104a40 <memset>:
#include "types.h"
#include "x86.h"
void*
memset(void *dst, int c, uint n)
{
80104a40: 55 push %ebp
80104a41: 89 e5 mov %esp,%ebp
80104a43: 8b 55 08 mov 0x8(%ebp),%edx
80104a46: 57 push %edi
80104a47: 8b 4d 10 mov 0x10(%ebp),%ecx
80104a4a: 53 push %ebx
if ((int)dst%4 == 0 && n%4 == 0){
80104a4b: f6 c2 03 test $0x3,%dl
80104a4e: 75 05 jne 80104a55 <memset+0x15>
80104a50: f6 c1 03 test $0x3,%cl
80104a53: 74 13 je 80104a68 <memset+0x28>
}
static inline void
stosb(void *addr, int data, int cnt)
{
asm volatile("cld; rep stosb" :
80104a55: 89 d7 mov %edx,%edi
80104a57: 8b 45 0c mov 0xc(%ebp),%eax
80104a5a: fc cld
80104a5b: f3 aa rep stos %al,%es:(%edi)
c &= 0xFF;
stosl(dst, (c<<24)|(c<<16)|(c<<8)|c, n/4);
} else
stosb(dst, c, n);
return dst;
}
80104a5d: 5b pop %ebx
80104a5e: 89 d0 mov %edx,%eax
80104a60: 5f pop %edi
80104a61: 5d pop %ebp
80104a62: c3 ret
80104a63: 90 nop
80104a64: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
void*
memset(void *dst, int c, uint n)
{
if ((int)dst%4 == 0 && n%4 == 0){
c &= 0xFF;
80104a68: 0f b6 7d 0c movzbl 0xc(%ebp),%edi
stosl(dst, (c<<24)|(c<<16)|(c<<8)|c, n/4);
80104a6c: c1 e9 02 shr $0x2,%ecx
80104a6f: 89 f8 mov %edi,%eax
80104a71: 89 fb mov %edi,%ebx
80104a73: c1 e0 18 shl $0x18,%eax
80104a76: c1 e3 10 shl $0x10,%ebx
80104a79: 09 d8 or %ebx,%eax
80104a7b: 09 f8 or %edi,%eax
80104a7d: c1 e7 08 shl $0x8,%edi
80104a80: 09 f8 or %edi,%eax
}
static inline void
stosl(void *addr, int data, int cnt)
{
asm volatile("cld; rep stosl" :
80104a82: 89 d7 mov %edx,%edi
80104a84: fc cld
80104a85: f3 ab rep stos %eax,%es:(%edi)
} else
stosb(dst, c, n);
return dst;
}
80104a87: 5b pop %ebx
80104a88: 89 d0 mov %edx,%eax
80104a8a: 5f pop %edi
80104a8b: 5d pop %ebp
80104a8c: c3 ret
80104a8d: 8d 76 00 lea 0x0(%esi),%esi
80104a90 <memcmp>:
int
memcmp(const void *v1, const void *v2, uint n)
{
80104a90: 55 push %ebp
80104a91: 89 e5 mov %esp,%ebp
80104a93: 8b 45 10 mov 0x10(%ebp),%eax
80104a96: 57 push %edi
80104a97: 56 push %esi
80104a98: 8b 75 0c mov 0xc(%ebp),%esi
80104a9b: 53 push %ebx
80104a9c: 8b 5d 08 mov 0x8(%ebp),%ebx
const uchar *s1, *s2;
s1 = v1;
s2 = v2;
while(n-- > 0){
80104a9f: 85 c0 test %eax,%eax
80104aa1: 8d 78 ff lea -0x1(%eax),%edi
80104aa4: 74 26 je 80104acc <memcmp+0x3c>
if(*s1 != *s2)
80104aa6: 0f b6 03 movzbl (%ebx),%eax
80104aa9: 31 d2 xor %edx,%edx
80104aab: 0f b6 0e movzbl (%esi),%ecx
80104aae: 38 c8 cmp %cl,%al
80104ab0: 74 16 je 80104ac8 <memcmp+0x38>
80104ab2: eb 24 jmp 80104ad8 <memcmp+0x48>
80104ab4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104ab8: 0f b6 44 13 01 movzbl 0x1(%ebx,%edx,1),%eax
80104abd: 83 c2 01 add $0x1,%edx
80104ac0: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx
80104ac4: 38 c8 cmp %cl,%al
80104ac6: 75 10 jne 80104ad8 <memcmp+0x48>
{
const uchar *s1, *s2;
s1 = v1;
s2 = v2;
while(n-- > 0){
80104ac8: 39 fa cmp %edi,%edx
80104aca: 75 ec jne 80104ab8 <memcmp+0x28>
return *s1 - *s2;
s1++, s2++;
}
return 0;
}
80104acc: 5b pop %ebx
if(*s1 != *s2)
return *s1 - *s2;
s1++, s2++;
}
return 0;
80104acd: 31 c0 xor %eax,%eax
}
80104acf: 5e pop %esi
80104ad0: 5f pop %edi
80104ad1: 5d pop %ebp
80104ad2: c3 ret
80104ad3: 90 nop
80104ad4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104ad8: 5b pop %ebx
s1 = v1;
s2 = v2;
while(n-- > 0){
if(*s1 != *s2)
return *s1 - *s2;
80104ad9: 29 c8 sub %ecx,%eax
s1++, s2++;
}
return 0;
}
80104adb: 5e pop %esi
80104adc: 5f pop %edi
80104add: 5d pop %ebp
80104ade: c3 ret
80104adf: 90 nop
80104ae0 <memmove>:
void*
memmove(void *dst, const void *src, uint n)
{
80104ae0: 55 push %ebp
80104ae1: 89 e5 mov %esp,%ebp
80104ae3: 57 push %edi
80104ae4: 8b 45 08 mov 0x8(%ebp),%eax
80104ae7: 56 push %esi
80104ae8: 8b 75 0c mov 0xc(%ebp),%esi
80104aeb: 53 push %ebx
80104aec: 8b 5d 10 mov 0x10(%ebp),%ebx
const char *s;
char *d;
s = src;
d = dst;
if(s < d && s + n > d){
80104aef: 39 c6 cmp %eax,%esi
80104af1: 73 35 jae 80104b28 <memmove+0x48>
80104af3: 8d 0c 1e lea (%esi,%ebx,1),%ecx
80104af6: 39 c8 cmp %ecx,%eax
80104af8: 73 2e jae 80104b28 <memmove+0x48>
s += n;
d += n;
while(n-- > 0)
80104afa: 85 db test %ebx,%ebx
s = src;
d = dst;
if(s < d && s + n > d){
s += n;
d += n;
80104afc: 8d 3c 18 lea (%eax,%ebx,1),%edi
while(n-- > 0)
80104aff: 8d 53 ff lea -0x1(%ebx),%edx
80104b02: 74 1b je 80104b1f <memmove+0x3f>
80104b04: f7 db neg %ebx
80104b06: 8d 34 19 lea (%ecx,%ebx,1),%esi
80104b09: 01 fb add %edi,%ebx
80104b0b: 90 nop
80104b0c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
*--d = *--s;
80104b10: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx
80104b14: 88 0c 13 mov %cl,(%ebx,%edx,1)
s = src;
d = dst;
if(s < d && s + n > d){
s += n;
d += n;
while(n-- > 0)
80104b17: 83 ea 01 sub $0x1,%edx
80104b1a: 83 fa ff cmp $0xffffffff,%edx
80104b1d: 75 f1 jne 80104b10 <memmove+0x30>
} else
while(n-- > 0)
*d++ = *s++;
return dst;
}
80104b1f: 5b pop %ebx
80104b20: 5e pop %esi
80104b21: 5f pop %edi
80104b22: 5d pop %ebp
80104b23: c3 ret
80104b24: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
s += n;
d += n;
while(n-- > 0)
*--d = *--s;
} else
while(n-- > 0)
80104b28: 31 d2 xor %edx,%edx
80104b2a: 85 db test %ebx,%ebx
80104b2c: 74 f1 je 80104b1f <memmove+0x3f>
80104b2e: 66 90 xchg %ax,%ax
*d++ = *s++;
80104b30: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx
80104b34: 88 0c 10 mov %cl,(%eax,%edx,1)
80104b37: 83 c2 01 add $0x1,%edx
s += n;
d += n;
while(n-- > 0)
*--d = *--s;
} else
while(n-- > 0)
80104b3a: 39 da cmp %ebx,%edx
80104b3c: 75 f2 jne 80104b30 <memmove+0x50>
*d++ = *s++;
return dst;
}
80104b3e: 5b pop %ebx
80104b3f: 5e pop %esi
80104b40: 5f pop %edi
80104b41: 5d pop %ebp
80104b42: c3 ret
80104b43: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80104b49: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104b50 <memcpy>:
// memcpy exists to placate GCC. Use memmove.
void*
memcpy(void *dst, const void *src, uint n)
{
80104b50: 55 push %ebp
80104b51: 89 e5 mov %esp,%ebp
return memmove(dst, src, n);
}
80104b53: 5d pop %ebp
// memcpy exists to placate GCC. Use memmove.
void*
memcpy(void *dst, const void *src, uint n)
{
return memmove(dst, src, n);
80104b54: e9 87 ff ff ff jmp 80104ae0 <memmove>
80104b59: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80104b60 <strncmp>:
}
int
strncmp(const char *p, const char *q, uint n)
{
80104b60: 55 push %ebp
80104b61: 89 e5 mov %esp,%ebp
80104b63: 56 push %esi
80104b64: 8b 75 10 mov 0x10(%ebp),%esi
80104b67: 53 push %ebx
80104b68: 8b 4d 08 mov 0x8(%ebp),%ecx
80104b6b: 8b 5d 0c mov 0xc(%ebp),%ebx
while(n > 0 && *p && *p == *q)
80104b6e: 85 f6 test %esi,%esi
80104b70: 74 30 je 80104ba2 <strncmp+0x42>
80104b72: 0f b6 01 movzbl (%ecx),%eax
80104b75: 84 c0 test %al,%al
80104b77: 74 2f je 80104ba8 <strncmp+0x48>
80104b79: 0f b6 13 movzbl (%ebx),%edx
80104b7c: 38 d0 cmp %dl,%al
80104b7e: 75 46 jne 80104bc6 <strncmp+0x66>
80104b80: 8d 51 01 lea 0x1(%ecx),%edx
80104b83: 01 ce add %ecx,%esi
80104b85: eb 14 jmp 80104b9b <strncmp+0x3b>
80104b87: 90 nop
80104b88: 0f b6 02 movzbl (%edx),%eax
80104b8b: 84 c0 test %al,%al
80104b8d: 74 31 je 80104bc0 <strncmp+0x60>
80104b8f: 0f b6 19 movzbl (%ecx),%ebx
80104b92: 83 c2 01 add $0x1,%edx
80104b95: 38 d8 cmp %bl,%al
80104b97: 75 17 jne 80104bb0 <strncmp+0x50>
n--, p++, q++;
80104b99: 89 cb mov %ecx,%ebx
}
int
strncmp(const char *p, const char *q, uint n)
{
while(n > 0 && *p && *p == *q)
80104b9b: 39 f2 cmp %esi,%edx
n--, p++, q++;
80104b9d: 8d 4b 01 lea 0x1(%ebx),%ecx
}
int
strncmp(const char *p, const char *q, uint n)
{
while(n > 0 && *p && *p == *q)
80104ba0: 75 e6 jne 80104b88 <strncmp+0x28>
n--, p++, q++;
if(n == 0)
return 0;
return (uchar)*p - (uchar)*q;
}
80104ba2: 5b pop %ebx
strncmp(const char *p, const char *q, uint n)
{
while(n > 0 && *p && *p == *q)
n--, p++, q++;
if(n == 0)
return 0;
80104ba3: 31 c0 xor %eax,%eax
return (uchar)*p - (uchar)*q;
}
80104ba5: 5e pop %esi
80104ba6: 5d pop %ebp
80104ba7: c3 ret
80104ba8: 0f b6 1b movzbl (%ebx),%ebx
}
int
strncmp(const char *p, const char *q, uint n)
{
while(n > 0 && *p && *p == *q)
80104bab: 31 c0 xor %eax,%eax
80104bad: 8d 76 00 lea 0x0(%esi),%esi
n--, p++, q++;
if(n == 0)
return 0;
return (uchar)*p - (uchar)*q;
80104bb0: 0f b6 d3 movzbl %bl,%edx
80104bb3: 29 d0 sub %edx,%eax
}
80104bb5: 5b pop %ebx
80104bb6: 5e pop %esi
80104bb7: 5d pop %ebp
80104bb8: c3 ret
80104bb9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80104bc0: 0f b6 5b 01 movzbl 0x1(%ebx),%ebx
80104bc4: eb ea jmp 80104bb0 <strncmp+0x50>
}
int
strncmp(const char *p, const char *q, uint n)
{
while(n > 0 && *p && *p == *q)
80104bc6: 89 d3 mov %edx,%ebx
80104bc8: eb e6 jmp 80104bb0 <strncmp+0x50>
80104bca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80104bd0 <strncpy>:
return (uchar)*p - (uchar)*q;
}
char*
strncpy(char *s, const char *t, int n)
{
80104bd0: 55 push %ebp
80104bd1: 89 e5 mov %esp,%ebp
80104bd3: 8b 45 08 mov 0x8(%ebp),%eax
80104bd6: 56 push %esi
80104bd7: 8b 4d 10 mov 0x10(%ebp),%ecx
80104bda: 53 push %ebx
80104bdb: 8b 5d 0c mov 0xc(%ebp),%ebx
char *os;
os = s;
while(n-- > 0 && (*s++ = *t++) != 0)
80104bde: 89 c2 mov %eax,%edx
80104be0: eb 19 jmp 80104bfb <strncpy+0x2b>
80104be2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80104be8: 83 c3 01 add $0x1,%ebx
80104beb: 0f b6 4b ff movzbl -0x1(%ebx),%ecx
80104bef: 83 c2 01 add $0x1,%edx
80104bf2: 84 c9 test %cl,%cl
80104bf4: 88 4a ff mov %cl,-0x1(%edx)
80104bf7: 74 09 je 80104c02 <strncpy+0x32>
80104bf9: 89 f1 mov %esi,%ecx
80104bfb: 85 c9 test %ecx,%ecx
80104bfd: 8d 71 ff lea -0x1(%ecx),%esi
80104c00: 7f e6 jg 80104be8 <strncpy+0x18>
;
while(n-- > 0)
80104c02: 31 c9 xor %ecx,%ecx
80104c04: 85 f6 test %esi,%esi
80104c06: 7e 0f jle 80104c17 <strncpy+0x47>
*s++ = 0;
80104c08: c6 04 0a 00 movb $0x0,(%edx,%ecx,1)
80104c0c: 89 f3 mov %esi,%ebx
80104c0e: 83 c1 01 add $0x1,%ecx
80104c11: 29 cb sub %ecx,%ebx
char *os;
os = s;
while(n-- > 0 && (*s++ = *t++) != 0)
;
while(n-- > 0)
80104c13: 85 db test %ebx,%ebx
80104c15: 7f f1 jg 80104c08 <strncpy+0x38>
*s++ = 0;
return os;
}
80104c17: 5b pop %ebx
80104c18: 5e pop %esi
80104c19: 5d pop %ebp
80104c1a: c3 ret
80104c1b: 90 nop
80104c1c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104c20 <safestrcpy>:
// Like strncpy but guaranteed to NUL-terminate.
char*
safestrcpy(char *s, const char *t, int n)
{
80104c20: 55 push %ebp
80104c21: 89 e5 mov %esp,%ebp
80104c23: 8b 4d 10 mov 0x10(%ebp),%ecx
80104c26: 56 push %esi
80104c27: 8b 45 08 mov 0x8(%ebp),%eax
80104c2a: 53 push %ebx
80104c2b: 8b 55 0c mov 0xc(%ebp),%edx
char *os;
os = s;
if(n <= 0)
80104c2e: 85 c9 test %ecx,%ecx
80104c30: 7e 26 jle 80104c58 <safestrcpy+0x38>
80104c32: 8d 74 0a ff lea -0x1(%edx,%ecx,1),%esi
80104c36: 89 c1 mov %eax,%ecx
80104c38: eb 17 jmp 80104c51 <safestrcpy+0x31>
80104c3a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
return os;
while(--n > 0 && (*s++ = *t++) != 0)
80104c40: 83 c2 01 add $0x1,%edx
80104c43: 0f b6 5a ff movzbl -0x1(%edx),%ebx
80104c47: 83 c1 01 add $0x1,%ecx
80104c4a: 84 db test %bl,%bl
80104c4c: 88 59 ff mov %bl,-0x1(%ecx)
80104c4f: 74 04 je 80104c55 <safestrcpy+0x35>
80104c51: 39 f2 cmp %esi,%edx
80104c53: 75 eb jne 80104c40 <safestrcpy+0x20>
;
*s = 0;
80104c55: c6 01 00 movb $0x0,(%ecx)
return os;
}
80104c58: 5b pop %ebx
80104c59: 5e pop %esi
80104c5a: 5d pop %ebp
80104c5b: c3 ret
80104c5c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104c60 <strlen>:
int
strlen(const char *s)
{
80104c60: 55 push %ebp
int n;
for(n = 0; s[n]; n++)
80104c61: 31 c0 xor %eax,%eax
return os;
}
int
strlen(const char *s)
{
80104c63: 89 e5 mov %esp,%ebp
80104c65: 8b 55 08 mov 0x8(%ebp),%edx
int n;
for(n = 0; s[n]; n++)
80104c68: 80 3a 00 cmpb $0x0,(%edx)
80104c6b: 74 0c je 80104c79 <strlen+0x19>
80104c6d: 8d 76 00 lea 0x0(%esi),%esi
80104c70: 83 c0 01 add $0x1,%eax
80104c73: 80 3c 02 00 cmpb $0x0,(%edx,%eax,1)
80104c77: 75 f7 jne 80104c70 <strlen+0x10>
;
return n;
}
80104c79: 5d pop %ebp
80104c7a: c3 ret
80104c7b <swtch>:
# Save current register context in old
# and then load register context from new.
.globl swtch
swtch:
movl 4(%esp), %eax
80104c7b: 8b 44 24 04 mov 0x4(%esp),%eax
movl 8(%esp), %edx
80104c7f: 8b 54 24 08 mov 0x8(%esp),%edx
# Save old callee-save registers
pushl %ebp
80104c83: 55 push %ebp
pushl %ebx
80104c84: 53 push %ebx
pushl %esi
80104c85: 56 push %esi
pushl %edi
80104c86: 57 push %edi
# Switch stacks
movl %esp, (%eax)
80104c87: 89 20 mov %esp,(%eax)
movl %edx, %esp
80104c89: 89 d4 mov %edx,%esp
# Load new callee-save registers
popl %edi
80104c8b: 5f pop %edi
popl %esi
80104c8c: 5e pop %esi
popl %ebx
80104c8d: 5b pop %ebx
popl %ebp
80104c8e: 5d pop %ebp
ret
80104c8f: c3 ret
80104c90 <fetchint>:
// Fetch the int at addr from the current process.
int
fetchint(uint addr, int *ip)
{
if(addr >= proc->sz || addr+4 > proc->sz)
80104c90: 65 8b 15 04 00 00 00 mov %gs:0x4,%edx
// to a saved program counter, and then the first argument.
// Fetch the int at addr from the current process.
int
fetchint(uint addr, int *ip)
{
80104c97: 55 push %ebp
80104c98: 89 e5 mov %esp,%ebp
80104c9a: 8b 45 08 mov 0x8(%ebp),%eax
if(addr >= proc->sz || addr+4 > proc->sz)
80104c9d: 8b 12 mov (%edx),%edx
80104c9f: 39 c2 cmp %eax,%edx
80104ca1: 76 15 jbe 80104cb8 <fetchint+0x28>
80104ca3: 8d 48 04 lea 0x4(%eax),%ecx
80104ca6: 39 ca cmp %ecx,%edx
80104ca8: 72 0e jb 80104cb8 <fetchint+0x28>
return -1;
*ip = *(int*)(addr);
80104caa: 8b 10 mov (%eax),%edx
80104cac: 8b 45 0c mov 0xc(%ebp),%eax
80104caf: 89 10 mov %edx,(%eax)
return 0;
80104cb1: 31 c0 xor %eax,%eax
}
80104cb3: 5d pop %ebp
80104cb4: c3 ret
80104cb5: 8d 76 00 lea 0x0(%esi),%esi
// Fetch the int at addr from the current process.
int
fetchint(uint addr, int *ip)
{
if(addr >= proc->sz || addr+4 > proc->sz)
return -1;
80104cb8: b8 ff ff ff ff mov $0xffffffff,%eax
*ip = *(int*)(addr);
return 0;
}
80104cbd: 5d pop %ebp
80104cbe: c3 ret
80104cbf: 90 nop
80104cc0 <fetchstr>:
int
fetchstr(uint addr, char **pp)
{
char *s, *ep;
if(addr >= proc->sz)
80104cc0: 65 a1 04 00 00 00 mov %gs:0x4,%eax
// Fetch the nul-terminated string at addr from the current process.
// Doesn't actually copy the string - just sets *pp to point at it.
// Returns length of string, not including nul.
int
fetchstr(uint addr, char **pp)
{
80104cc6: 55 push %ebp
80104cc7: 89 e5 mov %esp,%ebp
80104cc9: 8b 4d 08 mov 0x8(%ebp),%ecx
char *s, *ep;
if(addr >= proc->sz)
80104ccc: 39 08 cmp %ecx,(%eax)
80104cce: 76 2c jbe 80104cfc <fetchstr+0x3c>
return -1;
*pp = (char*)addr;
80104cd0: 8b 55 0c mov 0xc(%ebp),%edx
80104cd3: 89 c8 mov %ecx,%eax
80104cd5: 89 0a mov %ecx,(%edx)
ep = (char*)proc->sz;
80104cd7: 65 8b 15 04 00 00 00 mov %gs:0x4,%edx
80104cde: 8b 12 mov (%edx),%edx
for(s = *pp; s < ep; s++)
80104ce0: 39 d1 cmp %edx,%ecx
80104ce2: 73 18 jae 80104cfc <fetchstr+0x3c>
if(*s == 0)
80104ce4: 80 39 00 cmpb $0x0,(%ecx)
80104ce7: 75 0c jne 80104cf5 <fetchstr+0x35>
80104ce9: eb 1d jmp 80104d08 <fetchstr+0x48>
80104ceb: 90 nop
80104cec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104cf0: 80 38 00 cmpb $0x0,(%eax)
80104cf3: 74 13 je 80104d08 <fetchstr+0x48>
if(addr >= proc->sz)
return -1;
*pp = (char*)addr;
ep = (char*)proc->sz;
for(s = *pp; s < ep; s++)
80104cf5: 83 c0 01 add $0x1,%eax
80104cf8: 39 c2 cmp %eax,%edx
80104cfa: 77 f4 ja 80104cf0 <fetchstr+0x30>
fetchstr(uint addr, char **pp)
{
char *s, *ep;
if(addr >= proc->sz)
return -1;
80104cfc: b8 ff ff ff ff mov $0xffffffff,%eax
ep = (char*)proc->sz;
for(s = *pp; s < ep; s++)
if(*s == 0)
return s - *pp;
return -1;
}
80104d01: 5d pop %ebp
80104d02: c3 ret
80104d03: 90 nop
80104d04: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
return -1;
*pp = (char*)addr;
ep = (char*)proc->sz;
for(s = *pp; s < ep; s++)
if(*s == 0)
return s - *pp;
80104d08: 29 c8 sub %ecx,%eax
return -1;
}
80104d0a: 5d pop %ebp
80104d0b: c3 ret
80104d0c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104d10 <argint>:
// Fetch the nth 32-bit system call argument.
int
argint(int n, int *ip)
{
return fetchint(thread->tf->esp + 4 + 4*n, ip);
80104d10: 65 a1 08 00 00 00 mov %gs:0x8,%eax
}
// Fetch the nth 32-bit system call argument.
int
argint(int n, int *ip)
{
80104d16: 55 push %ebp
80104d17: 89 e5 mov %esp,%ebp
return fetchint(thread->tf->esp + 4 + 4*n, ip);
80104d19: 8b 55 08 mov 0x8(%ebp),%edx
80104d1c: 8b 40 14 mov 0x14(%eax),%eax
80104d1f: 8b 40 44 mov 0x44(%eax),%eax
80104d22: 8d 04 90 lea (%eax,%edx,4),%eax
// Fetch the int at addr from the current process.
int
fetchint(uint addr, int *ip)
{
if(addr >= proc->sz || addr+4 > proc->sz)
80104d25: 65 8b 15 04 00 00 00 mov %gs:0x4,%edx
// Fetch the nth 32-bit system call argument.
int
argint(int n, int *ip)
{
return fetchint(thread->tf->esp + 4 + 4*n, ip);
80104d2c: 8d 48 04 lea 0x4(%eax),%ecx
// Fetch the int at addr from the current process.
int
fetchint(uint addr, int *ip)
{
if(addr >= proc->sz || addr+4 > proc->sz)
80104d2f: 8b 12 mov (%edx),%edx
80104d31: 39 d1 cmp %edx,%ecx
80104d33: 73 13 jae 80104d48 <argint+0x38>
80104d35: 8d 48 08 lea 0x8(%eax),%ecx
80104d38: 39 ca cmp %ecx,%edx
80104d3a: 72 0c jb 80104d48 <argint+0x38>
return -1;
*ip = *(int*)(addr);
80104d3c: 8b 50 04 mov 0x4(%eax),%edx
80104d3f: 8b 45 0c mov 0xc(%ebp),%eax
80104d42: 89 10 mov %edx,(%eax)
return 0;
80104d44: 31 c0 xor %eax,%eax
// Fetch the nth 32-bit system call argument.
int
argint(int n, int *ip)
{
return fetchint(thread->tf->esp + 4 + 4*n, ip);
}
80104d46: 5d pop %ebp
80104d47: c3 ret
// Fetch the int at addr from the current process.
int
fetchint(uint addr, int *ip)
{
if(addr >= proc->sz || addr+4 > proc->sz)
return -1;
80104d48: b8 ff ff ff ff mov $0xffffffff,%eax
// Fetch the nth 32-bit system call argument.
int
argint(int n, int *ip)
{
return fetchint(thread->tf->esp + 4 + 4*n, ip);
}
80104d4d: 5d pop %ebp
80104d4e: c3 ret
80104d4f: 90 nop
80104d50 <argptr>:
// Fetch the nth 32-bit system call argument.
int
argint(int n, int *ip)
{
return fetchint(thread->tf->esp + 4 + 4*n, ip);
80104d50: 65 a1 08 00 00 00 mov %gs:0x8,%eax
// Fetch the nth word-sized system call argument as a pointer
// to a block of memory of size n bytes. Check that the pointer
// lies within the process address space.
int
argptr(int n, char **pp, int size)
{
80104d56: 55 push %ebp
80104d57: 89 e5 mov %esp,%ebp
80104d59: 53 push %ebx
// Fetch the nth 32-bit system call argument.
int
argint(int n, int *ip)
{
return fetchint(thread->tf->esp + 4 + 4*n, ip);
80104d5a: 8b 55 08 mov 0x8(%ebp),%edx
80104d5d: 8b 40 14 mov 0x14(%eax),%eax
80104d60: 8b 40 44 mov 0x44(%eax),%eax
80104d63: 8d 0c 90 lea (%eax,%edx,4),%ecx
// Fetch the int at addr from the current process.
int
fetchint(uint addr, int *ip)
{
if(addr >= proc->sz || addr+4 > proc->sz)
80104d66: 65 a1 04 00 00 00 mov %gs:0x4,%eax
// Fetch the nth 32-bit system call argument.
int
argint(int n, int *ip)
{
return fetchint(thread->tf->esp + 4 + 4*n, ip);
80104d6c: 8d 59 04 lea 0x4(%ecx),%ebx
// Fetch the int at addr from the current process.
int
fetchint(uint addr, int *ip)
{
if(addr >= proc->sz || addr+4 > proc->sz)
80104d6f: 8b 10 mov (%eax),%edx
argptr(int n, char **pp, int size)
{
int i;
if(argint(n, &i) < 0)
return -1;
80104d71: b8 ff ff ff ff mov $0xffffffff,%eax
// Fetch the int at addr from the current process.
int
fetchint(uint addr, int *ip)
{
if(addr >= proc->sz || addr+4 > proc->sz)
80104d76: 39 d3 cmp %edx,%ebx
80104d78: 73 1e jae 80104d98 <argptr+0x48>
80104d7a: 8d 59 08 lea 0x8(%ecx),%ebx
80104d7d: 39 da cmp %ebx,%edx
80104d7f: 72 17 jb 80104d98 <argptr+0x48>
return -1;
*ip = *(int*)(addr);
80104d81: 8b 49 04 mov 0x4(%ecx),%ecx
{
int i;
if(argint(n, &i) < 0)
return -1;
if((uint)i >= proc->sz || (uint)i+size > proc->sz)
80104d84: 39 d1 cmp %edx,%ecx
80104d86: 73 10 jae 80104d98 <argptr+0x48>
80104d88: 8b 5d 10 mov 0x10(%ebp),%ebx
80104d8b: 01 cb add %ecx,%ebx
80104d8d: 39 d3 cmp %edx,%ebx
80104d8f: 77 07 ja 80104d98 <argptr+0x48>
return -1;
*pp = (char*)i;
80104d91: 8b 45 0c mov 0xc(%ebp),%eax
80104d94: 89 08 mov %ecx,(%eax)
return 0;
80104d96: 31 c0 xor %eax,%eax
}
80104d98: 5b pop %ebx
80104d99: 5d pop %ebp
80104d9a: c3 ret
80104d9b: 90 nop
80104d9c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104da0 <argstr>:
// Fetch the nth 32-bit system call argument.
int
argint(int n, int *ip)
{
return fetchint(thread->tf->esp + 4 + 4*n, ip);
80104da0: 65 a1 08 00 00 00 mov %gs:0x8,%eax
// Check that the pointer is valid and the string is nul-terminated.
// (There is no shared writable memory, so the string can't change
// between this check and being used by the kernel.)
int
argstr(int n, char **pp)
{
80104da6: 55 push %ebp
80104da7: 89 e5 mov %esp,%ebp
// Fetch the nth 32-bit system call argument.
int
argint(int n, int *ip)
{
return fetchint(thread->tf->esp + 4 + 4*n, ip);
80104da9: 8b 55 08 mov 0x8(%ebp),%edx
80104dac: 8b 40 14 mov 0x14(%eax),%eax
80104daf: 8b 40 44 mov 0x44(%eax),%eax
80104db2: 8d 14 90 lea (%eax,%edx,4),%edx
// Fetch the int at addr from the current process.
int
fetchint(uint addr, int *ip)
{
if(addr >= proc->sz || addr+4 > proc->sz)
80104db5: 65 a1 04 00 00 00 mov %gs:0x4,%eax
// Fetch the nth 32-bit system call argument.
int
argint(int n, int *ip)
{
return fetchint(thread->tf->esp + 4 + 4*n, ip);
80104dbb: 8d 4a 04 lea 0x4(%edx),%ecx
// Fetch the int at addr from the current process.
int
fetchint(uint addr, int *ip)
{
if(addr >= proc->sz || addr+4 > proc->sz)
80104dbe: 8b 00 mov (%eax),%eax
80104dc0: 39 c1 cmp %eax,%ecx
80104dc2: 73 07 jae 80104dcb <argstr+0x2b>
80104dc4: 8d 4a 08 lea 0x8(%edx),%ecx
80104dc7: 39 c8 cmp %ecx,%eax
80104dc9: 73 0d jae 80104dd8 <argstr+0x38>
int
argstr(int n, char **pp)
{
int addr;
if(argint(n, &addr) < 0)
return -1;
80104dcb: b8 ff ff ff ff mov $0xffffffff,%eax
return fetchstr(addr, pp);
}
80104dd0: 5d pop %ebp
80104dd1: c3 ret
80104dd2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
int
fetchint(uint addr, int *ip)
{
if(addr >= proc->sz || addr+4 > proc->sz)
return -1;
*ip = *(int*)(addr);
80104dd8: 8b 4a 04 mov 0x4(%edx),%ecx
int
fetchstr(uint addr, char **pp)
{
char *s, *ep;
if(addr >= proc->sz)
80104ddb: 39 c1 cmp %eax,%ecx
80104ddd: 73 ec jae 80104dcb <argstr+0x2b>
return -1;
*pp = (char*)addr;
80104ddf: 8b 55 0c mov 0xc(%ebp),%edx
80104de2: 89 c8 mov %ecx,%eax
80104de4: 89 0a mov %ecx,(%edx)
ep = (char*)proc->sz;
80104de6: 65 8b 15 04 00 00 00 mov %gs:0x4,%edx
80104ded: 8b 12 mov (%edx),%edx
for(s = *pp; s < ep; s++)
80104def: 39 d1 cmp %edx,%ecx
80104df1: 73 d8 jae 80104dcb <argstr+0x2b>
if(*s == 0)
80104df3: 80 39 00 cmpb $0x0,(%ecx)
80104df6: 75 0d jne 80104e05 <argstr+0x65>
80104df8: eb 16 jmp 80104e10 <argstr+0x70>
80104dfa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80104e00: 80 38 00 cmpb $0x0,(%eax)
80104e03: 74 0b je 80104e10 <argstr+0x70>
if(addr >= proc->sz)
return -1;
*pp = (char*)addr;
ep = (char*)proc->sz;
for(s = *pp; s < ep; s++)
80104e05: 83 c0 01 add $0x1,%eax
80104e08: 39 c2 cmp %eax,%edx
80104e0a: 77 f4 ja 80104e00 <argstr+0x60>
80104e0c: eb bd jmp 80104dcb <argstr+0x2b>
80104e0e: 66 90 xchg %ax,%ax
if(*s == 0)
return s - *pp;
80104e10: 29 c8 sub %ecx,%eax
{
int addr;
if(argint(n, &addr) < 0)
return -1;
return fetchstr(addr, pp);
}
80104e12: 5d pop %ebp
80104e13: c3 ret
80104e14: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80104e1a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
80104e20 <syscall>:
[SYS_kthread_mutex_unlock] sys_kthread_mutex_unlock,
};
void
syscall(void)
{
80104e20: 55 push %ebp
80104e21: 89 e5 mov %esp,%ebp
80104e23: 53 push %ebx
80104e24: 83 ec 14 sub $0x14,%esp
int num;
num = thread->tf->eax;
80104e27: 65 a1 08 00 00 00 mov %gs:0x8,%eax
80104e2d: 8b 58 14 mov 0x14(%eax),%ebx
80104e30: 8b 43 1c mov 0x1c(%ebx),%eax
if(num > 0 && num < NELEM(syscalls) && syscalls[num]) {
80104e33: 8d 50 ff lea -0x1(%eax),%edx
80104e36: 83 fa 1c cmp $0x1c,%edx
80104e39: 77 1d ja 80104e58 <syscall+0x38>
80104e3b: 8b 14 85 40 7d 10 80 mov -0x7fef82c0(,%eax,4),%edx
80104e42: 85 d2 test %edx,%edx
80104e44: 74 12 je 80104e58 <syscall+0x38>
thread->tf->eax = syscalls[num]();
80104e46: ff d2 call *%edx
80104e48: 89 43 1c mov %eax,0x1c(%ebx)
} else {
cprintf("%d %s: unknown sys call %d\n",
proc->pid, proc->name, num);
thread->tf->eax = -1;
}
}
80104e4b: 83 c4 14 add $0x14,%esp
80104e4e: 5b pop %ebx
80104e4f: 5d pop %ebp
80104e50: c3 ret
80104e51: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
num = thread->tf->eax;
if(num > 0 && num < NELEM(syscalls) && syscalls[num]) {
thread->tf->eax = syscalls[num]();
} else {
cprintf("%d %s: unknown sys call %d\n",
proc->pid, proc->name, num);
80104e58: 65 8b 15 04 00 00 00 mov %gs:0x4,%edx
num = thread->tf->eax;
if(num > 0 && num < NELEM(syscalls) && syscalls[num]) {
thread->tf->eax = syscalls[num]();
} else {
cprintf("%d %s: unknown sys call %d\n",
80104e5f: 89 44 24 0c mov %eax,0xc(%esp)
proc->pid, proc->name, num);
80104e63: 8d 42 60 lea 0x60(%edx),%eax
80104e66: 89 44 24 08 mov %eax,0x8(%esp)
num = thread->tf->eax;
if(num > 0 && num < NELEM(syscalls) && syscalls[num]) {
thread->tf->eax = syscalls[num]();
} else {
cprintf("%d %s: unknown sys call %d\n",
80104e6a: 8b 42 0c mov 0xc(%edx),%eax
80104e6d: c7 04 24 06 7d 10 80 movl $0x80107d06,(%esp)
80104e74: 89 44 24 04 mov %eax,0x4(%esp)
80104e78: e8 a3 b7 ff ff call 80100620 <cprintf>
proc->pid, proc->name, num);
thread->tf->eax = -1;
80104e7d: 65 a1 08 00 00 00 mov %gs:0x8,%eax
80104e83: 8b 40 14 mov 0x14(%eax),%eax
80104e86: c7 40 1c ff ff ff ff movl $0xffffffff,0x1c(%eax)
}
}
80104e8d: 83 c4 14 add $0x14,%esp
80104e90: 5b pop %ebx
80104e91: 5d pop %ebp
80104e92: c3 ret
80104e93: 66 90 xchg %ax,%ax
80104e95: 66 90 xchg %ax,%ax
80104e97: 66 90 xchg %ax,%ax
80104e99: 66 90 xchg %ax,%ax
80104e9b: 66 90 xchg %ax,%ax
80104e9d: 66 90 xchg %ax,%ax
80104e9f: 90 nop
80104ea0 <create>:
return -1;
}
static struct inode*
create(char *path, short type, short major, short minor)
{
80104ea0: 55 push %ebp
80104ea1: 89 e5 mov %esp,%ebp
80104ea3: 57 push %edi
80104ea4: 56 push %esi
80104ea5: 53 push %ebx
80104ea6: 83 ec 4c sub $0x4c,%esp
80104ea9: 89 4d c0 mov %ecx,-0x40(%ebp)
80104eac: 8b 4d 08 mov 0x8(%ebp),%ecx
uint off;
struct inode *ip, *dp;
char name[DIRSIZ];
if((dp = nameiparent(path, name)) == 0)
80104eaf: 8d 5d da lea -0x26(%ebp),%ebx
80104eb2: 89 5c 24 04 mov %ebx,0x4(%esp)
80104eb6: 89 04 24 mov %eax,(%esp)
return -1;
}
static struct inode*
create(char *path, short type, short major, short minor)
{
80104eb9: 89 55 c4 mov %edx,-0x3c(%ebp)
80104ebc: 89 4d bc mov %ecx,-0x44(%ebp)
uint off;
struct inode *ip, *dp;
char name[DIRSIZ];
if((dp = nameiparent(path, name)) == 0)
80104ebf: e8 3c d0 ff ff call 80101f00 <nameiparent>
80104ec4: 85 c0 test %eax,%eax
80104ec6: 89 c7 mov %eax,%edi
80104ec8: 0f 84 da 00 00 00 je 80104fa8 <create+0x108>
return 0;
ilock(dp);
80104ece: 89 04 24 mov %eax,(%esp)
80104ed1: e8 6a c7 ff ff call 80101640 <ilock>
if((ip = dirlookup(dp, name, &off)) != 0){
80104ed6: 8d 45 d4 lea -0x2c(%ebp),%eax
80104ed9: 89 44 24 08 mov %eax,0x8(%esp)
80104edd: 89 5c 24 04 mov %ebx,0x4(%esp)
80104ee1: 89 3c 24 mov %edi,(%esp)
80104ee4: e8 b7 cc ff ff call 80101ba0 <dirlookup>
80104ee9: 85 c0 test %eax,%eax
80104eeb: 89 c6 mov %eax,%esi
80104eed: 74 41 je 80104f30 <create+0x90>
iunlockput(dp);
80104eef: 89 3c 24 mov %edi,(%esp)
80104ef2: e8 f9 c9 ff ff call 801018f0 <iunlockput>
ilock(ip);
80104ef7: 89 34 24 mov %esi,(%esp)
80104efa: e8 41 c7 ff ff call 80101640 <ilock>
if(type == T_FILE && ip->type == T_FILE)
80104eff: 66 83 7d c4 02 cmpw $0x2,-0x3c(%ebp)
80104f04: 75 12 jne 80104f18 <create+0x78>
80104f06: 66 83 7e 10 02 cmpw $0x2,0x10(%esi)
80104f0b: 89 f0 mov %esi,%eax
80104f0d: 75 09 jne 80104f18 <create+0x78>
panic("create: dirlink");
iunlockput(dp);
return ip;
}
80104f0f: 83 c4 4c add $0x4c,%esp
80104f12: 5b pop %ebx
80104f13: 5e pop %esi
80104f14: 5f pop %edi
80104f15: 5d pop %ebp
80104f16: c3 ret
80104f17: 90 nop
if((ip = dirlookup(dp, name, &off)) != 0){
iunlockput(dp);
ilock(ip);
if(type == T_FILE && ip->type == T_FILE)
return ip;
iunlockput(ip);
80104f18: 89 34 24 mov %esi,(%esp)
80104f1b: e8 d0 c9 ff ff call 801018f0 <iunlockput>
panic("create: dirlink");
iunlockput(dp);
return ip;
}
80104f20: 83 c4 4c add $0x4c,%esp
iunlockput(dp);
ilock(ip);
if(type == T_FILE && ip->type == T_FILE)
return ip;
iunlockput(ip);
return 0;
80104f23: 31 c0 xor %eax,%eax
panic("create: dirlink");
iunlockput(dp);
return ip;
}
80104f25: 5b pop %ebx
80104f26: 5e pop %esi
80104f27: 5f pop %edi
80104f28: 5d pop %ebp
80104f29: c3 ret
80104f2a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
return ip;
iunlockput(ip);
return 0;
}
if((ip = ialloc(dp->dev, type)) == 0)
80104f30: 0f bf 45 c4 movswl -0x3c(%ebp),%eax
80104f34: 89 44 24 04 mov %eax,0x4(%esp)
80104f38: 8b 07 mov (%edi),%eax
80104f3a: 89 04 24 mov %eax,(%esp)
80104f3d: e8 6e c5 ff ff call 801014b0 <ialloc>
80104f42: 85 c0 test %eax,%eax
80104f44: 89 c6 mov %eax,%esi
80104f46: 0f 84 bf 00 00 00 je 8010500b <create+0x16b>
panic("create: ialloc");
ilock(ip);
80104f4c: 89 04 24 mov %eax,(%esp)
80104f4f: e8 ec c6 ff ff call 80101640 <ilock>
ip->major = major;
80104f54: 0f b7 45 c0 movzwl -0x40(%ebp),%eax
80104f58: 66 89 46 12 mov %ax,0x12(%esi)
ip->minor = minor;
80104f5c: 0f b7 45 bc movzwl -0x44(%ebp),%eax
80104f60: 66 89 46 14 mov %ax,0x14(%esi)
ip->nlink = 1;
80104f64: b8 01 00 00 00 mov $0x1,%eax
80104f69: 66 89 46 16 mov %ax,0x16(%esi)
iupdate(ip);
80104f6d: 89 34 24 mov %esi,(%esp)
80104f70: e8 0b c6 ff ff call 80101580 <iupdate>
if(type == T_DIR){ // Create . and .. entries.
80104f75: 66 83 7d c4 01 cmpw $0x1,-0x3c(%ebp)
80104f7a: 74 34 je 80104fb0 <create+0x110>
// No ip->nlink++ for ".": avoid cyclic ref count.
if(dirlink(ip, ".", ip->inum) < 0 || dirlink(ip, "..", dp->inum) < 0)
panic("create dots");
}
if(dirlink(dp, name, ip->inum) < 0)
80104f7c: 8b 46 04 mov 0x4(%esi),%eax
80104f7f: 89 5c 24 04 mov %ebx,0x4(%esp)
80104f83: 89 3c 24 mov %edi,(%esp)
80104f86: 89 44 24 08 mov %eax,0x8(%esp)
80104f8a: e8 71 ce ff ff call 80101e00 <dirlink>
80104f8f: 85 c0 test %eax,%eax
80104f91: 78 6c js 80104fff <create+0x15f>
panic("create: dirlink");
iunlockput(dp);
80104f93: 89 3c 24 mov %edi,(%esp)
80104f96: e8 55 c9 ff ff call 801018f0 <iunlockput>
return ip;
}
80104f9b: 83 c4 4c add $0x4c,%esp
if(dirlink(dp, name, ip->inum) < 0)
panic("create: dirlink");
iunlockput(dp);
return ip;
80104f9e: 89 f0 mov %esi,%eax
}
80104fa0: 5b pop %ebx
80104fa1: 5e pop %esi
80104fa2: 5f pop %edi
80104fa3: 5d pop %ebp
80104fa4: c3 ret
80104fa5: 8d 76 00 lea 0x0(%esi),%esi
uint off;
struct inode *ip, *dp;
char name[DIRSIZ];
if((dp = nameiparent(path, name)) == 0)
return 0;
80104fa8: 31 c0 xor %eax,%eax
80104faa: e9 60 ff ff ff jmp 80104f0f <create+0x6f>
80104faf: 90 nop
ip->minor = minor;
ip->nlink = 1;
iupdate(ip);
if(type == T_DIR){ // Create . and .. entries.
dp->nlink++; // for ".."
80104fb0: 66 83 47 16 01 addw $0x1,0x16(%edi)
iupdate(dp);
80104fb5: 89 3c 24 mov %edi,(%esp)
80104fb8: e8 c3 c5 ff ff call 80101580 <iupdate>
// No ip->nlink++ for ".": avoid cyclic ref count.
if(dirlink(ip, ".", ip->inum) < 0 || dirlink(ip, "..", dp->inum) < 0)
80104fbd: 8b 46 04 mov 0x4(%esi),%eax
80104fc0: c7 44 24 04 d4 7d 10 movl $0x80107dd4,0x4(%esp)
80104fc7: 80
80104fc8: 89 34 24 mov %esi,(%esp)
80104fcb: 89 44 24 08 mov %eax,0x8(%esp)
80104fcf: e8 2c ce ff ff call 80101e00 <dirlink>
80104fd4: 85 c0 test %eax,%eax
80104fd6: 78 1b js 80104ff3 <create+0x153>
80104fd8: 8b 47 04 mov 0x4(%edi),%eax
80104fdb: c7 44 24 04 d3 7d 10 movl $0x80107dd3,0x4(%esp)
80104fe2: 80
80104fe3: 89 34 24 mov %esi,(%esp)
80104fe6: 89 44 24 08 mov %eax,0x8(%esp)
80104fea: e8 11 ce ff ff call 80101e00 <dirlink>
80104fef: 85 c0 test %eax,%eax
80104ff1: 79 89 jns 80104f7c <create+0xdc>
panic("create dots");
80104ff3: c7 04 24 c7 7d 10 80 movl $0x80107dc7,(%esp)
80104ffa: e8 31 b3 ff ff call 80100330 <panic>
}
if(dirlink(dp, name, ip->inum) < 0)
panic("create: dirlink");
80104fff: c7 04 24 d6 7d 10 80 movl $0x80107dd6,(%esp)
80105006: e8 25 b3 ff ff call 80100330 <panic>
iunlockput(ip);
return 0;
}
if((ip = ialloc(dp->dev, type)) == 0)
panic("create: ialloc");
8010500b: c7 04 24 b8 7d 10 80 movl $0x80107db8,(%esp)
80105012: e8 19 b3 ff ff call 80100330 <panic>
80105017: 89 f6 mov %esi,%esi
80105019: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80105020 <argfd.constprop.0>:
#include "fcntl.h"
// Fetch the nth word-sized system call argument as a file descriptor
// and return both the descriptor and the corresponding struct file.
static int
argfd(int n, int *pfd, struct file **pf)
80105020: 55 push %ebp
80105021: 89 e5 mov %esp,%ebp
80105023: 56 push %esi
80105024: 89 c6 mov %eax,%esi
80105026: 53 push %ebx
80105027: 89 d3 mov %edx,%ebx
80105029: 83 ec 20 sub $0x20,%esp
{
int fd;
struct file *f;
if(argint(n, &fd) < 0)
8010502c: 8d 45 f4 lea -0xc(%ebp),%eax
8010502f: 89 44 24 04 mov %eax,0x4(%esp)
80105033: c7 04 24 00 00 00 00 movl $0x0,(%esp)
8010503a: e8 d1 fc ff ff call 80104d10 <argint>
8010503f: 85 c0 test %eax,%eax
80105041: 78 35 js 80105078 <argfd.constprop.0+0x58>
return -1;
if(fd < 0 || fd >= NOFILE || (f=proc->ofile[fd]) == 0)
80105043: 8b 4d f4 mov -0xc(%ebp),%ecx
80105046: 83 f9 0f cmp $0xf,%ecx
80105049: 77 2d ja 80105078 <argfd.constprop.0+0x58>
8010504b: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80105051: 8b 44 88 1c mov 0x1c(%eax,%ecx,4),%eax
80105055: 85 c0 test %eax,%eax
80105057: 74 1f je 80105078 <argfd.constprop.0+0x58>
return -1;
if(pfd)
80105059: 85 f6 test %esi,%esi
8010505b: 74 02 je 8010505f <argfd.constprop.0+0x3f>
*pfd = fd;
8010505d: 89 0e mov %ecx,(%esi)
if(pf)
8010505f: 85 db test %ebx,%ebx
80105061: 74 0d je 80105070 <argfd.constprop.0+0x50>
*pf = f;
80105063: 89 03 mov %eax,(%ebx)
return 0;
80105065: 31 c0 xor %eax,%eax
}
80105067: 83 c4 20 add $0x20,%esp
8010506a: 5b pop %ebx
8010506b: 5e pop %esi
8010506c: 5d pop %ebp
8010506d: c3 ret
8010506e: 66 90 xchg %ax,%ax
return -1;
if(pfd)
*pfd = fd;
if(pf)
*pf = f;
return 0;
80105070: 31 c0 xor %eax,%eax
80105072: eb f3 jmp 80105067 <argfd.constprop.0+0x47>
80105074: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
{
int fd;
struct file *f;
if(argint(n, &fd) < 0)
return -1;
80105078: b8 ff ff ff ff mov $0xffffffff,%eax
8010507d: eb e8 jmp 80105067 <argfd.constprop.0+0x47>
8010507f: 90 nop
80105080 <sys_dup>:
return -1;
}
int
sys_dup(void)
{
80105080: 55 push %ebp
struct file *f;
int fd;
if(argfd(0, 0, &f) < 0)
80105081: 31 c0 xor %eax,%eax
return -1;
}
int
sys_dup(void)
{
80105083: 89 e5 mov %esp,%ebp
80105085: 53 push %ebx
80105086: 83 ec 24 sub $0x24,%esp
struct file *f;
int fd;
if(argfd(0, 0, &f) < 0)
80105089: 8d 55 f4 lea -0xc(%ebp),%edx
8010508c: e8 8f ff ff ff call 80105020 <argfd.constprop.0>
80105091: 85 c0 test %eax,%eax
80105093: 78 1b js 801050b0 <sys_dup+0x30>
return -1;
if((fd=fdalloc(f)) < 0)
80105095: 8b 55 f4 mov -0xc(%ebp),%edx
static int
fdalloc(struct file *f)
{
int fd;
for(fd = 0; fd < NOFILE; fd++){
80105098: 31 db xor %ebx,%ebx
8010509a: 65 a1 04 00 00 00 mov %gs:0x4,%eax
if(proc->ofile[fd] == 0){
801050a0: 8b 4c 98 1c mov 0x1c(%eax,%ebx,4),%ecx
801050a4: 85 c9 test %ecx,%ecx
801050a6: 74 18 je 801050c0 <sys_dup+0x40>
static int
fdalloc(struct file *f)
{
int fd;
for(fd = 0; fd < NOFILE; fd++){
801050a8: 83 c3 01 add $0x1,%ebx
801050ab: 83 fb 10 cmp $0x10,%ebx
801050ae: 75 f0 jne 801050a0 <sys_dup+0x20>
return -1;
if((fd=fdalloc(f)) < 0)
return -1;
filedup(f);
return fd;
}
801050b0: 83 c4 24 add $0x24,%esp
{
struct file *f;
int fd;
if(argfd(0, 0, &f) < 0)
return -1;
801050b3: b8 ff ff ff ff mov $0xffffffff,%eax
if((fd=fdalloc(f)) < 0)
return -1;
filedup(f);
return fd;
}
801050b8: 5b pop %ebx
801050b9: 5d pop %ebp
801050ba: c3 ret
801050bb: 90 nop
801050bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
{
int fd;
for(fd = 0; fd < NOFILE; fd++){
if(proc->ofile[fd] == 0){
proc->ofile[fd] = f;
801050c0: 89 54 98 1c mov %edx,0x1c(%eax,%ebx,4)
if(argfd(0, 0, &f) < 0)
return -1;
if((fd=fdalloc(f)) < 0)
return -1;
filedup(f);
801050c4: 89 14 24 mov %edx,(%esp)
801050c7: e8 d4 bc ff ff call 80100da0 <filedup>
return fd;
}
801050cc: 83 c4 24 add $0x24,%esp
if(argfd(0, 0, &f) < 0)
return -1;
if((fd=fdalloc(f)) < 0)
return -1;
filedup(f);
return fd;
801050cf: 89 d8 mov %ebx,%eax
}
801050d1: 5b pop %ebx
801050d2: 5d pop %ebp
801050d3: c3 ret
801050d4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801050da: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
801050e0 <sys_read>:
int
sys_read(void)
{
801050e0: 55 push %ebp
struct file *f;
int n;
char *p;
if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0)
801050e1: 31 c0 xor %eax,%eax
return fd;
}
int
sys_read(void)
{
801050e3: 89 e5 mov %esp,%ebp
801050e5: 83 ec 28 sub $0x28,%esp
struct file *f;
int n;
char *p;
if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0)
801050e8: 8d 55 ec lea -0x14(%ebp),%edx
801050eb: e8 30 ff ff ff call 80105020 <argfd.constprop.0>
801050f0: 85 c0 test %eax,%eax
801050f2: 78 54 js 80105148 <sys_read+0x68>
801050f4: 8d 45 f0 lea -0x10(%ebp),%eax
801050f7: 89 44 24 04 mov %eax,0x4(%esp)
801050fb: c7 04 24 02 00 00 00 movl $0x2,(%esp)
80105102: e8 09 fc ff ff call 80104d10 <argint>
80105107: 85 c0 test %eax,%eax
80105109: 78 3d js 80105148 <sys_read+0x68>
8010510b: 8b 45 f0 mov -0x10(%ebp),%eax
8010510e: c7 04 24 01 00 00 00 movl $0x1,(%esp)
80105115: 89 44 24 08 mov %eax,0x8(%esp)
80105119: 8d 45 f4 lea -0xc(%ebp),%eax
8010511c: 89 44 24 04 mov %eax,0x4(%esp)
80105120: e8 2b fc ff ff call 80104d50 <argptr>
80105125: 85 c0 test %eax,%eax
80105127: 78 1f js 80105148 <sys_read+0x68>
return -1;
return fileread(f, p, n);
80105129: 8b 45 f0 mov -0x10(%ebp),%eax
8010512c: 89 44 24 08 mov %eax,0x8(%esp)
80105130: 8b 45 f4 mov -0xc(%ebp),%eax
80105133: 89 44 24 04 mov %eax,0x4(%esp)
80105137: 8b 45 ec mov -0x14(%ebp),%eax
8010513a: 89 04 24 mov %eax,(%esp)
8010513d: e8 be bd ff ff call 80100f00 <fileread>
}
80105142: c9 leave
80105143: c3 ret
80105144: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
struct file *f;
int n;
char *p;
if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0)
return -1;
80105148: b8 ff ff ff ff mov $0xffffffff,%eax
return fileread(f, p, n);
}
8010514d: c9 leave
8010514e: c3 ret
8010514f: 90 nop
80105150 <sys_write>:
int
sys_write(void)
{
80105150: 55 push %ebp
struct file *f;
int n;
char *p;
if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0)
80105151: 31 c0 xor %eax,%eax
return fileread(f, p, n);
}
int
sys_write(void)
{
80105153: 89 e5 mov %esp,%ebp
80105155: 83 ec 28 sub $0x28,%esp
struct file *f;
int n;
char *p;
if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0)
80105158: 8d 55 ec lea -0x14(%ebp),%edx
8010515b: e8 c0 fe ff ff call 80105020 <argfd.constprop.0>
80105160: 85 c0 test %eax,%eax
80105162: 78 54 js 801051b8 <sys_write+0x68>
80105164: 8d 45 f0 lea -0x10(%ebp),%eax
80105167: 89 44 24 04 mov %eax,0x4(%esp)
8010516b: c7 04 24 02 00 00 00 movl $0x2,(%esp)
80105172: e8 99 fb ff ff call 80104d10 <argint>
80105177: 85 c0 test %eax,%eax
80105179: 78 3d js 801051b8 <sys_write+0x68>
8010517b: 8b 45 f0 mov -0x10(%ebp),%eax
8010517e: c7 04 24 01 00 00 00 movl $0x1,(%esp)
80105185: 89 44 24 08 mov %eax,0x8(%esp)
80105189: 8d 45 f4 lea -0xc(%ebp),%eax
8010518c: 89 44 24 04 mov %eax,0x4(%esp)
80105190: e8 bb fb ff ff call 80104d50 <argptr>
80105195: 85 c0 test %eax,%eax
80105197: 78 1f js 801051b8 <sys_write+0x68>
return -1;
return filewrite(f, p, n);
80105199: 8b 45 f0 mov -0x10(%ebp),%eax
8010519c: 89 44 24 08 mov %eax,0x8(%esp)
801051a0: 8b 45 f4 mov -0xc(%ebp),%eax
801051a3: 89 44 24 04 mov %eax,0x4(%esp)
801051a7: 8b 45 ec mov -0x14(%ebp),%eax
801051aa: 89 04 24 mov %eax,(%esp)
801051ad: e8 ee bd ff ff call 80100fa0 <filewrite>
}
801051b2: c9 leave
801051b3: c3 ret
801051b4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
struct file *f;
int n;
char *p;
if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0)
return -1;
801051b8: b8 ff ff ff ff mov $0xffffffff,%eax
return filewrite(f, p, n);
}
801051bd: c9 leave
801051be: c3 ret
801051bf: 90 nop
801051c0 <sys_close>:
int
sys_close(void)
{
801051c0: 55 push %ebp
801051c1: 89 e5 mov %esp,%ebp
801051c3: 83 ec 28 sub $0x28,%esp
int fd;
struct file *f;
if(argfd(0, &fd, &f) < 0)
801051c6: 8d 55 f4 lea -0xc(%ebp),%edx
801051c9: 8d 45 f0 lea -0x10(%ebp),%eax
801051cc: e8 4f fe ff ff call 80105020 <argfd.constprop.0>
801051d1: 85 c0 test %eax,%eax
801051d3: 78 23 js 801051f8 <sys_close+0x38>
return -1;
proc->ofile[fd] = 0;
801051d5: 8b 55 f0 mov -0x10(%ebp),%edx
801051d8: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801051de: c7 44 90 1c 00 00 00 movl $0x0,0x1c(%eax,%edx,4)
801051e5: 00
fileclose(f);
801051e6: 8b 45 f4 mov -0xc(%ebp),%eax
801051e9: 89 04 24 mov %eax,(%esp)
801051ec: e8 ff bb ff ff call 80100df0 <fileclose>
return 0;
801051f1: 31 c0 xor %eax,%eax
}
801051f3: c9 leave
801051f4: c3 ret
801051f5: 8d 76 00 lea 0x0(%esi),%esi
{
int fd;
struct file *f;
if(argfd(0, &fd, &f) < 0)
return -1;
801051f8: b8 ff ff ff ff mov $0xffffffff,%eax
proc->ofile[fd] = 0;
fileclose(f);
return 0;
}
801051fd: c9 leave
801051fe: c3 ret
801051ff: 90 nop
80105200 <sys_fstat>:
int
sys_fstat(void)
{
80105200: 55 push %ebp
struct file *f;
struct stat *st;
if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0)
80105201: 31 c0 xor %eax,%eax
return 0;
}
int
sys_fstat(void)
{
80105203: 89 e5 mov %esp,%ebp
80105205: 83 ec 28 sub $0x28,%esp
struct file *f;
struct stat *st;
if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0)
80105208: 8d 55 f0 lea -0x10(%ebp),%edx
8010520b: e8 10 fe ff ff call 80105020 <argfd.constprop.0>
80105210: 85 c0 test %eax,%eax
80105212: 78 34 js 80105248 <sys_fstat+0x48>
80105214: 8d 45 f4 lea -0xc(%ebp),%eax
80105217: c7 44 24 08 14 00 00 movl $0x14,0x8(%esp)
8010521e: 00
8010521f: 89 44 24 04 mov %eax,0x4(%esp)
80105223: c7 04 24 01 00 00 00 movl $0x1,(%esp)
8010522a: e8 21 fb ff ff call 80104d50 <argptr>
8010522f: 85 c0 test %eax,%eax
80105231: 78 15 js 80105248 <sys_fstat+0x48>
return -1;
return filestat(f, st);
80105233: 8b 45 f4 mov -0xc(%ebp),%eax
80105236: 89 44 24 04 mov %eax,0x4(%esp)
8010523a: 8b 45 f0 mov -0x10(%ebp),%eax
8010523d: 89 04 24 mov %eax,(%esp)
80105240: e8 6b bc ff ff call 80100eb0 <filestat>
}
80105245: c9 leave
80105246: c3 ret
80105247: 90 nop
{
struct file *f;
struct stat *st;
if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0)
return -1;
80105248: b8 ff ff ff ff mov $0xffffffff,%eax
return filestat(f, st);
}
8010524d: c9 leave
8010524e: c3 ret
8010524f: 90 nop
80105250 <sys_link>:
// Create the path new as a link to the same inode as old.
int
sys_link(void)
{
80105250: 55 push %ebp
80105251: 89 e5 mov %esp,%ebp
80105253: 57 push %edi
80105254: 56 push %esi
80105255: 53 push %ebx
80105256: 83 ec 3c sub $0x3c,%esp
char name[DIRSIZ], *new, *old;
struct inode *dp, *ip;
if(argstr(0, &old) < 0 || argstr(1, &new) < 0)
80105259: 8d 45 d4 lea -0x2c(%ebp),%eax
8010525c: 89 44 24 04 mov %eax,0x4(%esp)
80105260: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80105267: e8 34 fb ff ff call 80104da0 <argstr>
8010526c: 85 c0 test %eax,%eax
8010526e: 0f 88 e6 00 00 00 js 8010535a <sys_link+0x10a>
80105274: 8d 45 d0 lea -0x30(%ebp),%eax
80105277: 89 44 24 04 mov %eax,0x4(%esp)
8010527b: c7 04 24 01 00 00 00 movl $0x1,(%esp)
80105282: e8 19 fb ff ff call 80104da0 <argstr>
80105287: 85 c0 test %eax,%eax
80105289: 0f 88 cb 00 00 00 js 8010535a <sys_link+0x10a>
return -1;
begin_op();
8010528f: e8 ec d8 ff ff call 80102b80 <begin_op>
if((ip = namei(old)) == 0){
80105294: 8b 45 d4 mov -0x2c(%ebp),%eax
80105297: 89 04 24 mov %eax,(%esp)
8010529a: e8 41 cc ff ff call 80101ee0 <namei>
8010529f: 85 c0 test %eax,%eax
801052a1: 89 c3 mov %eax,%ebx
801052a3: 0f 84 ac 00 00 00 je 80105355 <sys_link+0x105>
end_op();
return -1;
}
ilock(ip);
801052a9: 89 04 24 mov %eax,(%esp)
801052ac: e8 8f c3 ff ff call 80101640 <ilock>
if(ip->type == T_DIR){
801052b1: 66 83 7b 10 01 cmpw $0x1,0x10(%ebx)
801052b6: 0f 84 91 00 00 00 je 8010534d <sys_link+0xfd>
iunlockput(ip);
end_op();
return -1;
}
ip->nlink++;
801052bc: 66 83 43 16 01 addw $0x1,0x16(%ebx)
iupdate(ip);
iunlock(ip);
if((dp = nameiparent(new, name)) == 0)
801052c1: 8d 7d da lea -0x26(%ebp),%edi
end_op();
return -1;
}
ip->nlink++;
iupdate(ip);
801052c4: 89 1c 24 mov %ebx,(%esp)
801052c7: e8 b4 c2 ff ff call 80101580 <iupdate>
iunlock(ip);
801052cc: 89 1c 24 mov %ebx,(%esp)
801052cf: e8 7c c4 ff ff call 80101750 <iunlock>
if((dp = nameiparent(new, name)) == 0)
801052d4: 8b 45 d0 mov -0x30(%ebp),%eax
801052d7: 89 7c 24 04 mov %edi,0x4(%esp)
801052db: 89 04 24 mov %eax,(%esp)
801052de: e8 1d cc ff ff call 80101f00 <nameiparent>
801052e3: 85 c0 test %eax,%eax
801052e5: 89 c6 mov %eax,%esi
801052e7: 74 4f je 80105338 <sys_link+0xe8>
goto bad;
ilock(dp);
801052e9: 89 04 24 mov %eax,(%esp)
801052ec: e8 4f c3 ff ff call 80101640 <ilock>
if(dp->dev != ip->dev || dirlink(dp, name, ip->inum) < 0){
801052f1: 8b 03 mov (%ebx),%eax
801052f3: 39 06 cmp %eax,(%esi)
801052f5: 75 39 jne 80105330 <sys_link+0xe0>
801052f7: 8b 43 04 mov 0x4(%ebx),%eax
801052fa: 89 7c 24 04 mov %edi,0x4(%esp)
801052fe: 89 34 24 mov %esi,(%esp)
80105301: 89 44 24 08 mov %eax,0x8(%esp)
80105305: e8 f6 ca ff ff call 80101e00 <dirlink>
8010530a: 85 c0 test %eax,%eax
8010530c: 78 22 js 80105330 <sys_link+0xe0>
iunlockput(dp);
goto bad;
}
iunlockput(dp);
8010530e: 89 34 24 mov %esi,(%esp)
80105311: e8 da c5 ff ff call 801018f0 <iunlockput>
iput(ip);
80105316: 89 1c 24 mov %ebx,(%esp)
80105319: e8 82 c4 ff ff call 801017a0 <iput>
end_op();
8010531e: e8 cd d8 ff ff call 80102bf0 <end_op>
ip->nlink--;
iupdate(ip);
iunlockput(ip);
end_op();
return -1;
}
80105323: 83 c4 3c add $0x3c,%esp
iunlockput(dp);
iput(ip);
end_op();
return 0;
80105326: 31 c0 xor %eax,%eax
ip->nlink--;
iupdate(ip);
iunlockput(ip);
end_op();
return -1;
}
80105328: 5b pop %ebx
80105329: 5e pop %esi
8010532a: 5f pop %edi
8010532b: 5d pop %ebp
8010532c: c3 ret
8010532d: 8d 76 00 lea 0x0(%esi),%esi
if((dp = nameiparent(new, name)) == 0)
goto bad;
ilock(dp);
if(dp->dev != ip->dev || dirlink(dp, name, ip->inum) < 0){
iunlockput(dp);
80105330: 89 34 24 mov %esi,(%esp)
80105333: e8 b8 c5 ff ff call 801018f0 <iunlockput>
end_op();
return 0;
bad:
ilock(ip);
80105338: 89 1c 24 mov %ebx,(%esp)
8010533b: e8 00 c3 ff ff call 80101640 <ilock>
ip->nlink--;
80105340: 66 83 6b 16 01 subw $0x1,0x16(%ebx)
iupdate(ip);
80105345: 89 1c 24 mov %ebx,(%esp)
80105348: e8 33 c2 ff ff call 80101580 <iupdate>
iunlockput(ip);
8010534d: 89 1c 24 mov %ebx,(%esp)
80105350: e8 9b c5 ff ff call 801018f0 <iunlockput>
end_op();
80105355: e8 96 d8 ff ff call 80102bf0 <end_op>
return -1;
}
8010535a: 83 c4 3c add $0x3c,%esp
ilock(ip);
ip->nlink--;
iupdate(ip);
iunlockput(ip);
end_op();
return -1;
8010535d: b8 ff ff ff ff mov $0xffffffff,%eax
}
80105362: 5b pop %ebx
80105363: 5e pop %esi
80105364: 5f pop %edi
80105365: 5d pop %ebp
80105366: c3 ret
80105367: 89 f6 mov %esi,%esi
80105369: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80105370 <sys_unlink>:
}
//PAGEBREAK!
int
sys_unlink(void)
{
80105370: 55 push %ebp
80105371: 89 e5 mov %esp,%ebp
80105373: 57 push %edi
80105374: 56 push %esi
80105375: 53 push %ebx
80105376: 83 ec 5c sub $0x5c,%esp
struct inode *ip, *dp;
struct dirent de;
char name[DIRSIZ], *path;
uint off;
if(argstr(0, &path) < 0)
80105379: 8d 45 c0 lea -0x40(%ebp),%eax
8010537c: 89 44 24 04 mov %eax,0x4(%esp)
80105380: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80105387: e8 14 fa ff ff call 80104da0 <argstr>
8010538c: 85 c0 test %eax,%eax
8010538e: 0f 88 76 01 00 00 js 8010550a <sys_unlink+0x19a>
return -1;
begin_op();
80105394: e8 e7 d7 ff ff call 80102b80 <begin_op>
if((dp = nameiparent(path, name)) == 0){
80105399: 8b 45 c0 mov -0x40(%ebp),%eax
8010539c: 8d 5d ca lea -0x36(%ebp),%ebx
8010539f: 89 5c 24 04 mov %ebx,0x4(%esp)
801053a3: 89 04 24 mov %eax,(%esp)
801053a6: e8 55 cb ff ff call 80101f00 <nameiparent>
801053ab: 85 c0 test %eax,%eax
801053ad: 89 45 b4 mov %eax,-0x4c(%ebp)
801053b0: 0f 84 4f 01 00 00 je 80105505 <sys_unlink+0x195>
end_op();
return -1;
}
ilock(dp);
801053b6: 8b 75 b4 mov -0x4c(%ebp),%esi
801053b9: 89 34 24 mov %esi,(%esp)
801053bc: e8 7f c2 ff ff call 80101640 <ilock>
// Cannot unlink "." or "..".
if(namecmp(name, ".") == 0 || namecmp(name, "..") == 0)
801053c1: c7 44 24 04 d4 7d 10 movl $0x80107dd4,0x4(%esp)
801053c8: 80
801053c9: 89 1c 24 mov %ebx,(%esp)
801053cc: e8 9f c7 ff ff call 80101b70 <namecmp>
801053d1: 85 c0 test %eax,%eax
801053d3: 0f 84 21 01 00 00 je 801054fa <sys_unlink+0x18a>
801053d9: c7 44 24 04 d3 7d 10 movl $0x80107dd3,0x4(%esp)
801053e0: 80
801053e1: 89 1c 24 mov %ebx,(%esp)
801053e4: e8 87 c7 ff ff call 80101b70 <namecmp>
801053e9: 85 c0 test %eax,%eax
801053eb: 0f 84 09 01 00 00 je 801054fa <sys_unlink+0x18a>
goto bad;
if((ip = dirlookup(dp, name, &off)) == 0)
801053f1: 8d 45 c4 lea -0x3c(%ebp),%eax
801053f4: 89 5c 24 04 mov %ebx,0x4(%esp)
801053f8: 89 44 24 08 mov %eax,0x8(%esp)
801053fc: 89 34 24 mov %esi,(%esp)
801053ff: e8 9c c7 ff ff call 80101ba0 <dirlookup>
80105404: 85 c0 test %eax,%eax
80105406: 89 c3 mov %eax,%ebx
80105408: 0f 84 ec 00 00 00 je 801054fa <sys_unlink+0x18a>
goto bad;
ilock(ip);
8010540e: 89 04 24 mov %eax,(%esp)
80105411: e8 2a c2 ff ff call 80101640 <ilock>
if(ip->nlink < 1)
80105416: 66 83 7b 16 00 cmpw $0x0,0x16(%ebx)
8010541b: 0f 8e 24 01 00 00 jle 80105545 <sys_unlink+0x1d5>
panic("unlink: nlink < 1");
if(ip->type == T_DIR && !isdirempty(ip)){
80105421: 66 83 7b 10 01 cmpw $0x1,0x10(%ebx)
80105426: 8d 75 d8 lea -0x28(%ebp),%esi
80105429: 74 7d je 801054a8 <sys_unlink+0x138>
iunlockput(ip);
goto bad;
}
memset(&de, 0, sizeof(de));
8010542b: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
80105432: 00
80105433: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
8010543a: 00
8010543b: 89 34 24 mov %esi,(%esp)
8010543e: e8 fd f5 ff ff call 80104a40 <memset>
if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80105443: 8b 45 c4 mov -0x3c(%ebp),%eax
80105446: c7 44 24 0c 10 00 00 movl $0x10,0xc(%esp)
8010544d: 00
8010544e: 89 74 24 04 mov %esi,0x4(%esp)
80105452: 89 44 24 08 mov %eax,0x8(%esp)
80105456: 8b 45 b4 mov -0x4c(%ebp),%eax
80105459: 89 04 24 mov %eax,(%esp)
8010545c: e8 df c5 ff ff call 80101a40 <writei>
80105461: 83 f8 10 cmp $0x10,%eax
80105464: 0f 85 cf 00 00 00 jne 80105539 <sys_unlink+0x1c9>
panic("unlink: writei");
if(ip->type == T_DIR){
8010546a: 66 83 7b 10 01 cmpw $0x1,0x10(%ebx)
8010546f: 0f 84 a3 00 00 00 je 80105518 <sys_unlink+0x1a8>
dp->nlink--;
iupdate(dp);
}
iunlockput(dp);
80105475: 8b 45 b4 mov -0x4c(%ebp),%eax
80105478: 89 04 24 mov %eax,(%esp)
8010547b: e8 70 c4 ff ff call 801018f0 <iunlockput>
ip->nlink--;
80105480: 66 83 6b 16 01 subw $0x1,0x16(%ebx)
iupdate(ip);
80105485: 89 1c 24 mov %ebx,(%esp)
80105488: e8 f3 c0 ff ff call 80101580 <iupdate>
iunlockput(ip);
8010548d: 89 1c 24 mov %ebx,(%esp)
80105490: e8 5b c4 ff ff call 801018f0 <iunlockput>
end_op();
80105495: e8 56 d7 ff ff call 80102bf0 <end_op>
bad:
iunlockput(dp);
end_op();
return -1;
}
8010549a: 83 c4 5c add $0x5c,%esp
iupdate(ip);
iunlockput(ip);
end_op();
return 0;
8010549d: 31 c0 xor %eax,%eax
bad:
iunlockput(dp);
end_op();
return -1;
}
8010549f: 5b pop %ebx
801054a0: 5e pop %esi
801054a1: 5f pop %edi
801054a2: 5d pop %ebp
801054a3: c3 ret
801054a4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
isdirempty(struct inode *dp)
{
int off;
struct dirent de;
for(off=2*sizeof(de); off<dp->size; off+=sizeof(de)){
801054a8: 83 7b 18 20 cmpl $0x20,0x18(%ebx)
801054ac: 0f 86 79 ff ff ff jbe 8010542b <sys_unlink+0xbb>
801054b2: bf 20 00 00 00 mov $0x20,%edi
801054b7: eb 15 jmp 801054ce <sys_unlink+0x15e>
801054b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
801054c0: 8d 57 10 lea 0x10(%edi),%edx
801054c3: 3b 53 18 cmp 0x18(%ebx),%edx
801054c6: 0f 83 5f ff ff ff jae 8010542b <sys_unlink+0xbb>
801054cc: 89 d7 mov %edx,%edi
if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
801054ce: c7 44 24 0c 10 00 00 movl $0x10,0xc(%esp)
801054d5: 00
801054d6: 89 7c 24 08 mov %edi,0x8(%esp)
801054da: 89 74 24 04 mov %esi,0x4(%esp)
801054de: 89 1c 24 mov %ebx,(%esp)
801054e1: e8 5a c4 ff ff call 80101940 <readi>
801054e6: 83 f8 10 cmp $0x10,%eax
801054e9: 75 42 jne 8010552d <sys_unlink+0x1bd>
panic("isdirempty: readi");
if(de.inum != 0)
801054eb: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp)
801054f0: 74 ce je 801054c0 <sys_unlink+0x150>
ilock(ip);
if(ip->nlink < 1)
panic("unlink: nlink < 1");
if(ip->type == T_DIR && !isdirempty(ip)){
iunlockput(ip);
801054f2: 89 1c 24 mov %ebx,(%esp)
801054f5: e8 f6 c3 ff ff call 801018f0 <iunlockput>
end_op();
return 0;
bad:
iunlockput(dp);
801054fa: 8b 45 b4 mov -0x4c(%ebp),%eax
801054fd: 89 04 24 mov %eax,(%esp)
80105500: e8 eb c3 ff ff call 801018f0 <iunlockput>
end_op();
80105505: e8 e6 d6 ff ff call 80102bf0 <end_op>
return -1;
}
8010550a: 83 c4 5c add $0x5c,%esp
return 0;
bad:
iunlockput(dp);
end_op();
return -1;
8010550d: b8 ff ff ff ff mov $0xffffffff,%eax
}
80105512: 5b pop %ebx
80105513: 5e pop %esi
80105514: 5f pop %edi
80105515: 5d pop %ebp
80105516: c3 ret
80105517: 90 nop
memset(&de, 0, sizeof(de));
if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
panic("unlink: writei");
if(ip->type == T_DIR){
dp->nlink--;
80105518: 8b 45 b4 mov -0x4c(%ebp),%eax
8010551b: 66 83 68 16 01 subw $0x1,0x16(%eax)
iupdate(dp);
80105520: 89 04 24 mov %eax,(%esp)
80105523: e8 58 c0 ff ff call 80101580 <iupdate>
80105528: e9 48 ff ff ff jmp 80105475 <sys_unlink+0x105>
int off;
struct dirent de;
for(off=2*sizeof(de); off<dp->size; off+=sizeof(de)){
if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
panic("isdirempty: readi");
8010552d: c7 04 24 f8 7d 10 80 movl $0x80107df8,(%esp)
80105534: e8 f7 ad ff ff call 80100330 <panic>
goto bad;
}
memset(&de, 0, sizeof(de));
if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
panic("unlink: writei");
80105539: c7 04 24 0a 7e 10 80 movl $0x80107e0a,(%esp)
80105540: e8 eb ad ff ff call 80100330 <panic>
if((ip = dirlookup(dp, name, &off)) == 0)
goto bad;
ilock(ip);
if(ip->nlink < 1)
panic("unlink: nlink < 1");
80105545: c7 04 24 e6 7d 10 80 movl $0x80107de6,(%esp)
8010554c: e8 df ad ff ff call 80100330 <panic>
80105551: eb 0d jmp 80105560 <sys_open>
80105553: 90 nop
80105554: 90 nop
80105555: 90 nop
80105556: 90 nop
80105557: 90 nop
80105558: 90 nop
80105559: 90 nop
8010555a: 90 nop
8010555b: 90 nop
8010555c: 90 nop
8010555d: 90 nop
8010555e: 90 nop
8010555f: 90 nop
80105560 <sys_open>:
return ip;
}
int
sys_open(void)
{
80105560: 55 push %ebp
80105561: 89 e5 mov %esp,%ebp
80105563: 57 push %edi
80105564: 56 push %esi
80105565: 53 push %ebx
80105566: 83 ec 2c sub $0x2c,%esp
char *path;
int fd, omode;
struct file *f;
struct inode *ip;
if(argstr(0, &path) < 0 || argint(1, &omode) < 0)
80105569: 8d 45 e0 lea -0x20(%ebp),%eax
8010556c: 89 44 24 04 mov %eax,0x4(%esp)
80105570: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80105577: e8 24 f8 ff ff call 80104da0 <argstr>
8010557c: 85 c0 test %eax,%eax
8010557e: 0f 88 81 00 00 00 js 80105605 <sys_open+0xa5>
80105584: 8d 45 e4 lea -0x1c(%ebp),%eax
80105587: 89 44 24 04 mov %eax,0x4(%esp)
8010558b: c7 04 24 01 00 00 00 movl $0x1,(%esp)
80105592: e8 79 f7 ff ff call 80104d10 <argint>
80105597: 85 c0 test %eax,%eax
80105599: 78 6a js 80105605 <sys_open+0xa5>
return -1;
begin_op();
8010559b: e8 e0 d5 ff ff call 80102b80 <begin_op>
if(omode & O_CREATE){
801055a0: f6 45 e5 02 testb $0x2,-0x1b(%ebp)
801055a4: 75 72 jne 80105618 <sys_open+0xb8>
if(ip == 0){
end_op();
return -1;
}
} else {
if((ip = namei(path)) == 0){
801055a6: 8b 45 e0 mov -0x20(%ebp),%eax
801055a9: 89 04 24 mov %eax,(%esp)
801055ac: e8 2f c9 ff ff call 80101ee0 <namei>
801055b1: 85 c0 test %eax,%eax
801055b3: 89 c7 mov %eax,%edi
801055b5: 74 49 je 80105600 <sys_open+0xa0>
end_op();
return -1;
}
ilock(ip);
801055b7: 89 04 24 mov %eax,(%esp)
801055ba: e8 81 c0 ff ff call 80101640 <ilock>
if(ip->type == T_DIR && omode != O_RDONLY){
801055bf: 66 83 7f 10 01 cmpw $0x1,0x10(%edi)
801055c4: 0f 84 ae 00 00 00 je 80105678 <sys_open+0x118>
end_op();
return -1;
}
}
if((f = filealloc()) == 0 || (fd = fdalloc(f)) < 0){
801055ca: e8 61 b7 ff ff call 80100d30 <filealloc>
801055cf: 85 c0 test %eax,%eax
801055d1: 89 c6 mov %eax,%esi
801055d3: 74 23 je 801055f8 <sys_open+0x98>
801055d5: 65 8b 15 04 00 00 00 mov %gs:0x4,%edx
801055dc: 31 db xor %ebx,%ebx
801055de: 66 90 xchg %ax,%ax
fdalloc(struct file *f)
{
int fd;
for(fd = 0; fd < NOFILE; fd++){
if(proc->ofile[fd] == 0){
801055e0: 8b 44 9a 1c mov 0x1c(%edx,%ebx,4),%eax
801055e4: 85 c0 test %eax,%eax
801055e6: 74 50 je 80105638 <sys_open+0xd8>
static int
fdalloc(struct file *f)
{
int fd;
for(fd = 0; fd < NOFILE; fd++){
801055e8: 83 c3 01 add $0x1,%ebx
801055eb: 83 fb 10 cmp $0x10,%ebx
801055ee: 75 f0 jne 801055e0 <sys_open+0x80>
}
}
if((f = filealloc()) == 0 || (fd = fdalloc(f)) < 0){
if(f)
fileclose(f);
801055f0: 89 34 24 mov %esi,(%esp)
801055f3: e8 f8 b7 ff ff call 80100df0 <fileclose>
iunlockput(ip);
801055f8: 89 3c 24 mov %edi,(%esp)
801055fb: e8 f0 c2 ff ff call 801018f0 <iunlockput>
end_op();
80105600: e8 eb d5 ff ff call 80102bf0 <end_op>
f->ip = ip;
f->off = 0;
f->readable = !(omode & O_WRONLY);
f->writable = (omode & O_WRONLY) || (omode & O_RDWR);
return fd;
}
80105605: 83 c4 2c add $0x2c,%esp
if((f = filealloc()) == 0 || (fd = fdalloc(f)) < 0){
if(f)
fileclose(f);
iunlockput(ip);
end_op();
return -1;
80105608: b8 ff ff ff ff mov $0xffffffff,%eax
f->ip = ip;
f->off = 0;
f->readable = !(omode & O_WRONLY);
f->writable = (omode & O_WRONLY) || (omode & O_RDWR);
return fd;
}
8010560d: 5b pop %ebx
8010560e: 5e pop %esi
8010560f: 5f pop %edi
80105610: 5d pop %ebp
80105611: c3 ret
80105612: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
return -1;
begin_op();
if(omode & O_CREATE){
ip = create(path, T_FILE, 0, 0);
80105618: 8b 45 e0 mov -0x20(%ebp),%eax
8010561b: 31 c9 xor %ecx,%ecx
8010561d: ba 02 00 00 00 mov $0x2,%edx
80105622: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80105629: e8 72 f8 ff ff call 80104ea0 <create>
if(ip == 0){
8010562e: 85 c0 test %eax,%eax
return -1;
begin_op();
if(omode & O_CREATE){
ip = create(path, T_FILE, 0, 0);
80105630: 89 c7 mov %eax,%edi
if(ip == 0){
80105632: 75 96 jne 801055ca <sys_open+0x6a>
80105634: eb ca jmp 80105600 <sys_open+0xa0>
80105636: 66 90 xchg %ax,%ax
{
int fd;
for(fd = 0; fd < NOFILE; fd++){
if(proc->ofile[fd] == 0){
proc->ofile[fd] = f;
80105638: 89 74 9a 1c mov %esi,0x1c(%edx,%ebx,4)
fileclose(f);
iunlockput(ip);
end_op();
return -1;
}
iunlock(ip);
8010563c: 89 3c 24 mov %edi,(%esp)
8010563f: e8 0c c1 ff ff call 80101750 <iunlock>
end_op();
80105644: e8 a7 d5 ff ff call 80102bf0 <end_op>
f->type = FD_INODE;
80105649: c7 06 02 00 00 00 movl $0x2,(%esi)
f->ip = ip;
f->off = 0;
f->readable = !(omode & O_WRONLY);
8010564f: 8b 55 e4 mov -0x1c(%ebp),%edx
}
iunlock(ip);
end_op();
f->type = FD_INODE;
f->ip = ip;
80105652: 89 7e 10 mov %edi,0x10(%esi)
f->off = 0;
80105655: c7 46 14 00 00 00 00 movl $0x0,0x14(%esi)
f->readable = !(omode & O_WRONLY);
8010565c: 89 d0 mov %edx,%eax
8010565e: 83 e0 01 and $0x1,%eax
80105661: 83 f0 01 xor $0x1,%eax
f->writable = (omode & O_WRONLY) || (omode & O_RDWR);
80105664: 83 e2 03 and $0x3,%edx
end_op();
f->type = FD_INODE;
f->ip = ip;
f->off = 0;
f->readable = !(omode & O_WRONLY);
80105667: 88 46 08 mov %al,0x8(%esi)
f->writable = (omode & O_WRONLY) || (omode & O_RDWR);
return fd;
8010566a: 89 d8 mov %ebx,%eax
f->type = FD_INODE;
f->ip = ip;
f->off = 0;
f->readable = !(omode & O_WRONLY);
f->writable = (omode & O_WRONLY) || (omode & O_RDWR);
8010566c: 0f 95 46 09 setne 0x9(%esi)
return fd;
}
80105670: 83 c4 2c add $0x2c,%esp
80105673: 5b pop %ebx
80105674: 5e pop %esi
80105675: 5f pop %edi
80105676: 5d pop %ebp
80105677: c3 ret
if((ip = namei(path)) == 0){
end_op();
return -1;
}
ilock(ip);
if(ip->type == T_DIR && omode != O_RDONLY){
80105678: 8b 55 e4 mov -0x1c(%ebp),%edx
8010567b: 85 d2 test %edx,%edx
8010567d: 0f 84 47 ff ff ff je 801055ca <sys_open+0x6a>
80105683: e9 70 ff ff ff jmp 801055f8 <sys_open+0x98>
80105688: 90 nop
80105689: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80105690 <sys_mkdir>:
return fd;
}
int
sys_mkdir(void)
{
80105690: 55 push %ebp
80105691: 89 e5 mov %esp,%ebp
80105693: 83 ec 28 sub $0x28,%esp
char *path;
struct inode *ip;
begin_op();
80105696: e8 e5 d4 ff ff call 80102b80 <begin_op>
if(argstr(0, &path) < 0 || (ip = create(path, T_DIR, 0, 0)) == 0){
8010569b: 8d 45 f4 lea -0xc(%ebp),%eax
8010569e: 89 44 24 04 mov %eax,0x4(%esp)
801056a2: c7 04 24 00 00 00 00 movl $0x0,(%esp)
801056a9: e8 f2 f6 ff ff call 80104da0 <argstr>
801056ae: 85 c0 test %eax,%eax
801056b0: 78 2e js 801056e0 <sys_mkdir+0x50>
801056b2: 8b 45 f4 mov -0xc(%ebp),%eax
801056b5: 31 c9 xor %ecx,%ecx
801056b7: ba 01 00 00 00 mov $0x1,%edx
801056bc: c7 04 24 00 00 00 00 movl $0x0,(%esp)
801056c3: e8 d8 f7 ff ff call 80104ea0 <create>
801056c8: 85 c0 test %eax,%eax
801056ca: 74 14 je 801056e0 <sys_mkdir+0x50>
end_op();
return -1;
}
iunlockput(ip);
801056cc: 89 04 24 mov %eax,(%esp)
801056cf: e8 1c c2 ff ff call 801018f0 <iunlockput>
end_op();
801056d4: e8 17 d5 ff ff call 80102bf0 <end_op>
return 0;
801056d9: 31 c0 xor %eax,%eax
}
801056db: c9 leave
801056dc: c3 ret
801056dd: 8d 76 00 lea 0x0(%esi),%esi
char *path;
struct inode *ip;
begin_op();
if(argstr(0, &path) < 0 || (ip = create(path, T_DIR, 0, 0)) == 0){
end_op();
801056e0: e8 0b d5 ff ff call 80102bf0 <end_op>
return -1;
801056e5: b8 ff ff ff ff mov $0xffffffff,%eax
}
iunlockput(ip);
end_op();
return 0;
}
801056ea: c9 leave
801056eb: c3 ret
801056ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801056f0 <sys_mknod>:
int
sys_mknod(void)
{
801056f0: 55 push %ebp
801056f1: 89 e5 mov %esp,%ebp
801056f3: 83 ec 28 sub $0x28,%esp
struct inode *ip;
char *path;
int major, minor;
begin_op();
801056f6: e8 85 d4 ff ff call 80102b80 <begin_op>
if((argstr(0, &path)) < 0 ||
801056fb: 8d 45 ec lea -0x14(%ebp),%eax
801056fe: 89 44 24 04 mov %eax,0x4(%esp)
80105702: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80105709: e8 92 f6 ff ff call 80104da0 <argstr>
8010570e: 85 c0 test %eax,%eax
80105710: 78 5e js 80105770 <sys_mknod+0x80>
argint(1, &major) < 0 ||
80105712: 8d 45 f0 lea -0x10(%ebp),%eax
80105715: 89 44 24 04 mov %eax,0x4(%esp)
80105719: c7 04 24 01 00 00 00 movl $0x1,(%esp)
80105720: e8 eb f5 ff ff call 80104d10 <argint>
struct inode *ip;
char *path;
int major, minor;
begin_op();
if((argstr(0, &path)) < 0 ||
80105725: 85 c0 test %eax,%eax
80105727: 78 47 js 80105770 <sys_mknod+0x80>
argint(1, &major) < 0 ||
argint(2, &minor) < 0 ||
80105729: 8d 45 f4 lea -0xc(%ebp),%eax
8010572c: 89 44 24 04 mov %eax,0x4(%esp)
80105730: c7 04 24 02 00 00 00 movl $0x2,(%esp)
80105737: e8 d4 f5 ff ff call 80104d10 <argint>
char *path;
int major, minor;
begin_op();
if((argstr(0, &path)) < 0 ||
argint(1, &major) < 0 ||
8010573c: 85 c0 test %eax,%eax
8010573e: 78 30 js 80105770 <sys_mknod+0x80>
argint(2, &minor) < 0 ||
(ip = create(path, T_DEV, major, minor)) == 0){
80105740: 0f bf 45 f4 movswl -0xc(%ebp),%eax
int major, minor;
begin_op();
if((argstr(0, &path)) < 0 ||
argint(1, &major) < 0 ||
argint(2, &minor) < 0 ||
80105744: ba 03 00 00 00 mov $0x3,%edx
(ip = create(path, T_DEV, major, minor)) == 0){
80105749: 0f bf 4d f0 movswl -0x10(%ebp),%ecx
8010574d: 89 04 24 mov %eax,(%esp)
int major, minor;
begin_op();
if((argstr(0, &path)) < 0 ||
argint(1, &major) < 0 ||
argint(2, &minor) < 0 ||
80105750: 8b 45 ec mov -0x14(%ebp),%eax
80105753: e8 48 f7 ff ff call 80104ea0 <create>
80105758: 85 c0 test %eax,%eax
8010575a: 74 14 je 80105770 <sys_mknod+0x80>
(ip = create(path, T_DEV, major, minor)) == 0){
end_op();
return -1;
}
iunlockput(ip);
8010575c: 89 04 24 mov %eax,(%esp)
8010575f: e8 8c c1 ff ff call 801018f0 <iunlockput>
end_op();
80105764: e8 87 d4 ff ff call 80102bf0 <end_op>
return 0;
80105769: 31 c0 xor %eax,%eax
}
8010576b: c9 leave
8010576c: c3 ret
8010576d: 8d 76 00 lea 0x0(%esi),%esi
begin_op();
if((argstr(0, &path)) < 0 ||
argint(1, &major) < 0 ||
argint(2, &minor) < 0 ||
(ip = create(path, T_DEV, major, minor)) == 0){
end_op();
80105770: e8 7b d4 ff ff call 80102bf0 <end_op>
return -1;
80105775: b8 ff ff ff ff mov $0xffffffff,%eax
}
iunlockput(ip);
end_op();
return 0;
}
8010577a: c9 leave
8010577b: c3 ret
8010577c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80105780 <sys_chdir>:
int
sys_chdir(void)
{
80105780: 55 push %ebp
80105781: 89 e5 mov %esp,%ebp
80105783: 53 push %ebx
80105784: 83 ec 24 sub $0x24,%esp
char *path;
struct inode *ip;
begin_op();
80105787: e8 f4 d3 ff ff call 80102b80 <begin_op>
if(argstr(0, &path) < 0 || (ip = namei(path)) == 0){
8010578c: 8d 45 f4 lea -0xc(%ebp),%eax
8010578f: 89 44 24 04 mov %eax,0x4(%esp)
80105793: c7 04 24 00 00 00 00 movl $0x0,(%esp)
8010579a: e8 01 f6 ff ff call 80104da0 <argstr>
8010579f: 85 c0 test %eax,%eax
801057a1: 78 5a js 801057fd <sys_chdir+0x7d>
801057a3: 8b 45 f4 mov -0xc(%ebp),%eax
801057a6: 89 04 24 mov %eax,(%esp)
801057a9: e8 32 c7 ff ff call 80101ee0 <namei>
801057ae: 85 c0 test %eax,%eax
801057b0: 89 c3 mov %eax,%ebx
801057b2: 74 49 je 801057fd <sys_chdir+0x7d>
end_op();
return -1;
}
ilock(ip);
801057b4: 89 04 24 mov %eax,(%esp)
801057b7: e8 84 be ff ff call 80101640 <ilock>
if(ip->type != T_DIR){
801057bc: 66 83 7b 10 01 cmpw $0x1,0x10(%ebx)
iunlockput(ip);
801057c1: 89 1c 24 mov %ebx,(%esp)
if(argstr(0, &path) < 0 || (ip = namei(path)) == 0){
end_op();
return -1;
}
ilock(ip);
if(ip->type != T_DIR){
801057c4: 75 32 jne 801057f8 <sys_chdir+0x78>
iunlockput(ip);
end_op();
return -1;
}
iunlock(ip);
801057c6: e8 85 bf ff ff call 80101750 <iunlock>
iput(proc->cwd);
801057cb: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801057d1: 8b 40 5c mov 0x5c(%eax),%eax
801057d4: 89 04 24 mov %eax,(%esp)
801057d7: e8 c4 bf ff ff call 801017a0 <iput>
end_op();
801057dc: e8 0f d4 ff ff call 80102bf0 <end_op>
proc->cwd = ip;
801057e1: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801057e7: 89 58 5c mov %ebx,0x5c(%eax)
return 0;
}
801057ea: 83 c4 24 add $0x24,%esp
}
iunlock(ip);
iput(proc->cwd);
end_op();
proc->cwd = ip;
return 0;
801057ed: 31 c0 xor %eax,%eax
}
801057ef: 5b pop %ebx
801057f0: 5d pop %ebp
801057f1: c3 ret
801057f2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
end_op();
return -1;
}
ilock(ip);
if(ip->type != T_DIR){
iunlockput(ip);
801057f8: e8 f3 c0 ff ff call 801018f0 <iunlockput>
end_op();
801057fd: e8 ee d3 ff ff call 80102bf0 <end_op>
iunlock(ip);
iput(proc->cwd);
end_op();
proc->cwd = ip;
return 0;
}
80105802: 83 c4 24 add $0x24,%esp
}
ilock(ip);
if(ip->type != T_DIR){
iunlockput(ip);
end_op();
return -1;
80105805: b8 ff ff ff ff mov $0xffffffff,%eax
iunlock(ip);
iput(proc->cwd);
end_op();
proc->cwd = ip;
return 0;
}
8010580a: 5b pop %ebx
8010580b: 5d pop %ebp
8010580c: c3 ret
8010580d: 8d 76 00 lea 0x0(%esi),%esi
80105810 <sys_exec>:
int
sys_exec(void)
{
80105810: 55 push %ebp
80105811: 89 e5 mov %esp,%ebp
80105813: 57 push %edi
80105814: 56 push %esi
80105815: 53 push %ebx
80105816: 81 ec ac 00 00 00 sub $0xac,%esp
char *path, *argv[MAXARG];
int i;
uint uargv, uarg;
if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){
8010581c: 8d 85 5c ff ff ff lea -0xa4(%ebp),%eax
80105822: 89 44 24 04 mov %eax,0x4(%esp)
80105826: c7 04 24 00 00 00 00 movl $0x0,(%esp)
8010582d: e8 6e f5 ff ff call 80104da0 <argstr>
80105832: 85 c0 test %eax,%eax
80105834: 0f 88 84 00 00 00 js 801058be <sys_exec+0xae>
8010583a: 8d 85 60 ff ff ff lea -0xa0(%ebp),%eax
80105840: 89 44 24 04 mov %eax,0x4(%esp)
80105844: c7 04 24 01 00 00 00 movl $0x1,(%esp)
8010584b: e8 c0 f4 ff ff call 80104d10 <argint>
80105850: 85 c0 test %eax,%eax
80105852: 78 6a js 801058be <sys_exec+0xae>
return -1;
}
memset(argv, 0, sizeof(argv));
80105854: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax
for(i=0;; i++){
8010585a: 31 db xor %ebx,%ebx
uint uargv, uarg;
if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){
return -1;
}
memset(argv, 0, sizeof(argv));
8010585c: c7 44 24 08 80 00 00 movl $0x80,0x8(%esp)
80105863: 00
80105864: 8d b5 68 ff ff ff lea -0x98(%ebp),%esi
8010586a: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80105871: 00
80105872: 8d bd 64 ff ff ff lea -0x9c(%ebp),%edi
80105878: 89 04 24 mov %eax,(%esp)
8010587b: e8 c0 f1 ff ff call 80104a40 <memset>
for(i=0;; i++){
if(i >= NELEM(argv))
return -1;
if(fetchint(uargv+4*i, (int*)&uarg) < 0)
80105880: 8b 85 60 ff ff ff mov -0xa0(%ebp),%eax
80105886: 89 7c 24 04 mov %edi,0x4(%esp)
8010588a: 8d 04 98 lea (%eax,%ebx,4),%eax
8010588d: 89 04 24 mov %eax,(%esp)
80105890: e8 fb f3 ff ff call 80104c90 <fetchint>
80105895: 85 c0 test %eax,%eax
80105897: 78 25 js 801058be <sys_exec+0xae>
return -1;
if(uarg == 0){
80105899: 8b 85 64 ff ff ff mov -0x9c(%ebp),%eax
8010589f: 85 c0 test %eax,%eax
801058a1: 74 2d je 801058d0 <sys_exec+0xc0>
argv[i] = 0;
break;
}
if(fetchstr(uarg, &argv[i]) < 0)
801058a3: 89 74 24 04 mov %esi,0x4(%esp)
801058a7: 89 04 24 mov %eax,(%esp)
801058aa: e8 11 f4 ff ff call 80104cc0 <fetchstr>
801058af: 85 c0 test %eax,%eax
801058b1: 78 0b js 801058be <sys_exec+0xae>
if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){
return -1;
}
memset(argv, 0, sizeof(argv));
for(i=0;; i++){
801058b3: 83 c3 01 add $0x1,%ebx
801058b6: 83 c6 04 add $0x4,%esi
if(i >= NELEM(argv))
801058b9: 83 fb 20 cmp $0x20,%ebx
801058bc: 75 c2 jne 80105880 <sys_exec+0x70>
}
if(fetchstr(uarg, &argv[i]) < 0)
return -1;
}
return exec(path, argv);
}
801058be: 81 c4 ac 00 00 00 add $0xac,%esp
char *path, *argv[MAXARG];
int i;
uint uargv, uarg;
if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){
return -1;
801058c4: b8 ff ff ff ff mov $0xffffffff,%eax
}
if(fetchstr(uarg, &argv[i]) < 0)
return -1;
}
return exec(path, argv);
}
801058c9: 5b pop %ebx
801058ca: 5e pop %esi
801058cb: 5f pop %edi
801058cc: 5d pop %ebp
801058cd: c3 ret
801058ce: 66 90 xchg %ax,%ax
break;
}
if(fetchstr(uarg, &argv[i]) < 0)
return -1;
}
return exec(path, argv);
801058d0: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax
801058d6: 89 44 24 04 mov %eax,0x4(%esp)
801058da: 8b 85 5c ff ff ff mov -0xa4(%ebp),%eax
if(i >= NELEM(argv))
return -1;
if(fetchint(uargv+4*i, (int*)&uarg) < 0)
return -1;
if(uarg == 0){
argv[i] = 0;
801058e0: c7 84 9d 68 ff ff ff movl $0x0,-0x98(%ebp,%ebx,4)
801058e7: 00 00 00 00
break;
}
if(fetchstr(uarg, &argv[i]) < 0)
return -1;
}
return exec(path, argv);
801058eb: 89 04 24 mov %eax,(%esp)
801058ee: e8 8d b0 ff ff call 80100980 <exec>
}
801058f3: 81 c4 ac 00 00 00 add $0xac,%esp
801058f9: 5b pop %ebx
801058fa: 5e pop %esi
801058fb: 5f pop %edi
801058fc: 5d pop %ebp
801058fd: c3 ret
801058fe: 66 90 xchg %ax,%ax
80105900 <sys_pipe>:
int
sys_pipe(void)
{
80105900: 55 push %ebp
80105901: 89 e5 mov %esp,%ebp
80105903: 57 push %edi
80105904: 56 push %esi
80105905: 53 push %ebx
80105906: 83 ec 2c sub $0x2c,%esp
int *fd;
struct file *rf, *wf;
int fd0, fd1;
if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0)
80105909: 8d 45 dc lea -0x24(%ebp),%eax
8010590c: c7 44 24 08 08 00 00 movl $0x8,0x8(%esp)
80105913: 00
80105914: 89 44 24 04 mov %eax,0x4(%esp)
80105918: c7 04 24 00 00 00 00 movl $0x0,(%esp)
8010591f: e8 2c f4 ff ff call 80104d50 <argptr>
80105924: 85 c0 test %eax,%eax
80105926: 78 7a js 801059a2 <sys_pipe+0xa2>
return -1;
if(pipealloc(&rf, &wf) < 0)
80105928: 8d 45 e4 lea -0x1c(%ebp),%eax
8010592b: 89 44 24 04 mov %eax,0x4(%esp)
8010592f: 8d 45 e0 lea -0x20(%ebp),%eax
80105932: 89 04 24 mov %eax,(%esp)
80105935: e8 76 d9 ff ff call 801032b0 <pipealloc>
8010593a: 85 c0 test %eax,%eax
8010593c: 78 64 js 801059a2 <sys_pipe+0xa2>
8010593e: 65 8b 0d 04 00 00 00 mov %gs:0x4,%ecx
static int
fdalloc(struct file *f)
{
int fd;
for(fd = 0; fd < NOFILE; fd++){
80105945: 31 c0 xor %eax,%eax
if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0)
return -1;
if(pipealloc(&rf, &wf) < 0)
return -1;
fd0 = -1;
if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){
80105947: 8b 5d e0 mov -0x20(%ebp),%ebx
fdalloc(struct file *f)
{
int fd;
for(fd = 0; fd < NOFILE; fd++){
if(proc->ofile[fd] == 0){
8010594a: 8b 54 81 1c mov 0x1c(%ecx,%eax,4),%edx
8010594e: 85 d2 test %edx,%edx
80105950: 74 16 je 80105968 <sys_pipe+0x68>
80105952: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
static int
fdalloc(struct file *f)
{
int fd;
for(fd = 0; fd < NOFILE; fd++){
80105958: 83 c0 01 add $0x1,%eax
8010595b: 83 f8 10 cmp $0x10,%eax
8010595e: 74 2f je 8010598f <sys_pipe+0x8f>
if(proc->ofile[fd] == 0){
80105960: 8b 54 81 1c mov 0x1c(%ecx,%eax,4),%edx
80105964: 85 d2 test %edx,%edx
80105966: 75 f0 jne 80105958 <sys_pipe+0x58>
if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0)
return -1;
if(pipealloc(&rf, &wf) < 0)
return -1;
fd0 = -1;
if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){
80105968: 8b 7d e4 mov -0x1c(%ebp),%edi
{
int fd;
for(fd = 0; fd < NOFILE; fd++){
if(proc->ofile[fd] == 0){
proc->ofile[fd] = f;
8010596b: 8d 70 04 lea 0x4(%eax),%esi
static int
fdalloc(struct file *f)
{
int fd;
for(fd = 0; fd < NOFILE; fd++){
8010596e: 31 d2 xor %edx,%edx
if(proc->ofile[fd] == 0){
proc->ofile[fd] = f;
80105970: 89 5c b1 0c mov %ebx,0xc(%ecx,%esi,4)
80105974: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
fdalloc(struct file *f)
{
int fd;
for(fd = 0; fd < NOFILE; fd++){
if(proc->ofile[fd] == 0){
80105978: 83 7c 91 1c 00 cmpl $0x0,0x1c(%ecx,%edx,4)
8010597d: 74 31 je 801059b0 <sys_pipe+0xb0>
static int
fdalloc(struct file *f)
{
int fd;
for(fd = 0; fd < NOFILE; fd++){
8010597f: 83 c2 01 add $0x1,%edx
80105982: 83 fa 10 cmp $0x10,%edx
80105985: 75 f1 jne 80105978 <sys_pipe+0x78>
if(pipealloc(&rf, &wf) < 0)
return -1;
fd0 = -1;
if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){
if(fd0 >= 0)
proc->ofile[fd0] = 0;
80105987: c7 44 b1 0c 00 00 00 movl $0x0,0xc(%ecx,%esi,4)
8010598e: 00
fileclose(rf);
8010598f: 89 1c 24 mov %ebx,(%esp)
80105992: e8 59 b4 ff ff call 80100df0 <fileclose>
fileclose(wf);
80105997: 8b 45 e4 mov -0x1c(%ebp),%eax
8010599a: 89 04 24 mov %eax,(%esp)
8010599d: e8 4e b4 ff ff call 80100df0 <fileclose>
return -1;
}
fd[0] = fd0;
fd[1] = fd1;
return 0;
}
801059a2: 83 c4 2c add $0x2c,%esp
if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){
if(fd0 >= 0)
proc->ofile[fd0] = 0;
fileclose(rf);
fileclose(wf);
return -1;
801059a5: b8 ff ff ff ff mov $0xffffffff,%eax
}
fd[0] = fd0;
fd[1] = fd1;
return 0;
}
801059aa: 5b pop %ebx
801059ab: 5e pop %esi
801059ac: 5f pop %edi
801059ad: 5d pop %ebp
801059ae: c3 ret
801059af: 90 nop
{
int fd;
for(fd = 0; fd < NOFILE; fd++){
if(proc->ofile[fd] == 0){
proc->ofile[fd] = f;
801059b0: 89 7c 91 1c mov %edi,0x1c(%ecx,%edx,4)
proc->ofile[fd0] = 0;
fileclose(rf);
fileclose(wf);
return -1;
}
fd[0] = fd0;
801059b4: 8b 4d dc mov -0x24(%ebp),%ecx
801059b7: 89 01 mov %eax,(%ecx)
fd[1] = fd1;
801059b9: 8b 45 dc mov -0x24(%ebp),%eax
801059bc: 89 50 04 mov %edx,0x4(%eax)
return 0;
}
801059bf: 83 c4 2c add $0x2c,%esp
fileclose(wf);
return -1;
}
fd[0] = fd0;
fd[1] = fd1;
return 0;
801059c2: 31 c0 xor %eax,%eax
}
801059c4: 5b pop %ebx
801059c5: 5e pop %esi
801059c6: 5f pop %edi
801059c7: 5d pop %ebp
801059c8: c3 ret
801059c9: 66 90 xchg %ax,%ax
801059cb: 66 90 xchg %ax,%ax
801059cd: 66 90 xchg %ax,%ax
801059cf: 90 nop
801059d0 <sys_fork>:
#include "mmu.h"
#include "proc.h"
int
sys_fork(void)
{
801059d0: 55 push %ebp
801059d1: 89 e5 mov %esp,%ebp
return fork();
}
801059d3: 5d pop %ebp
#include "proc.h"
int
sys_fork(void)
{
return fork();
801059d4: e9 57 e0 ff ff jmp 80103a30 <fork>
801059d9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
801059e0 <sys_exit>:
}
int
sys_exit(void)
{
801059e0: 55 push %ebp
801059e1: 89 e5 mov %esp,%ebp
801059e3: 83 ec 08 sub $0x8,%esp
exit();
801059e6: e8 75 e8 ff ff call 80104260 <exit>
return 0; // not reached
}
801059eb: 31 c0 xor %eax,%eax
801059ed: c9 leave
801059ee: c3 ret
801059ef: 90 nop
801059f0 <sys_wait>:
int
sys_wait(void)
{
801059f0: 55 push %ebp
801059f1: 89 e5 mov %esp,%ebp
return wait();
}
801059f3: 5d pop %ebp
}
int
sys_wait(void)
{
return wait();
801059f4: e9 47 e4 ff ff jmp 80103e40 <wait>
801059f9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80105a00 <sys_kill>:
}
int
sys_kill(void)
{
80105a00: 55 push %ebp
80105a01: 89 e5 mov %esp,%ebp
80105a03: 83 ec 28 sub $0x28,%esp
int pid;
if(argint(0, &pid) < 0)
80105a06: 8d 45 f4 lea -0xc(%ebp),%eax
80105a09: 89 44 24 04 mov %eax,0x4(%esp)
80105a0d: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80105a14: e8 f7 f2 ff ff call 80104d10 <argint>
80105a19: 85 c0 test %eax,%eax
80105a1b: 78 13 js 80105a30 <sys_kill+0x30>
return -1;
return kill(pid);
80105a1d: 8b 45 f4 mov -0xc(%ebp),%eax
80105a20: 89 04 24 mov %eax,(%esp)
80105a23: e8 98 e5 ff ff call 80103fc0 <kill>
}
80105a28: c9 leave
80105a29: c3 ret
80105a2a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
sys_kill(void)
{
int pid;
if(argint(0, &pid) < 0)
return -1;
80105a30: b8 ff ff ff ff mov $0xffffffff,%eax
return kill(pid);
}
80105a35: c9 leave
80105a36: c3 ret
80105a37: 89 f6 mov %esi,%esi
80105a39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80105a40 <sys_getpid>:
int
sys_getpid(void)
{
return proc->pid;
80105a40: 65 a1 04 00 00 00 mov %gs:0x4,%eax
return kill(pid);
}
int
sys_getpid(void)
{
80105a46: 55 push %ebp
80105a47: 89 e5 mov %esp,%ebp
return proc->pid;
}
80105a49: 5d pop %ebp
}
int
sys_getpid(void)
{
return proc->pid;
80105a4a: 8b 40 0c mov 0xc(%eax),%eax
}
80105a4d: c3 ret
80105a4e: 66 90 xchg %ax,%ax
80105a50 <sys_sbrk>:
int
sys_sbrk(void)
{
80105a50: 55 push %ebp
80105a51: 89 e5 mov %esp,%ebp
80105a53: 53 push %ebx
80105a54: 83 ec 24 sub $0x24,%esp
int addr;
int n;
if(argint(0, &n) < 0)
80105a57: 8d 45 f4 lea -0xc(%ebp),%eax
80105a5a: 89 44 24 04 mov %eax,0x4(%esp)
80105a5e: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80105a65: e8 a6 f2 ff ff call 80104d10 <argint>
80105a6a: 85 c0 test %eax,%eax
80105a6c: 78 22 js 80105a90 <sys_sbrk+0x40>
return -1;
addr = proc->sz;
80105a6e: 65 a1 04 00 00 00 mov %gs:0x4,%eax
if(growproc(n) < 0)
80105a74: 8b 55 f4 mov -0xc(%ebp),%edx
int addr;
int n;
if(argint(0, &n) < 0)
return -1;
addr = proc->sz;
80105a77: 8b 18 mov (%eax),%ebx
if(growproc(n) < 0)
80105a79: 89 14 24 mov %edx,(%esp)
80105a7c: e8 ff de ff ff call 80103980 <growproc>
80105a81: 85 c0 test %eax,%eax
80105a83: 78 0b js 80105a90 <sys_sbrk+0x40>
return -1;
return addr;
80105a85: 89 d8 mov %ebx,%eax
}
80105a87: 83 c4 24 add $0x24,%esp
80105a8a: 5b pop %ebx
80105a8b: 5d pop %ebp
80105a8c: c3 ret
80105a8d: 8d 76 00 lea 0x0(%esi),%esi
{
int addr;
int n;
if(argint(0, &n) < 0)
return -1;
80105a90: b8 ff ff ff ff mov $0xffffffff,%eax
80105a95: eb f0 jmp 80105a87 <sys_sbrk+0x37>
80105a97: 89 f6 mov %esi,%esi
80105a99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80105aa0 <sys_sleep>:
return addr;
}
int
sys_sleep(void)
{
80105aa0: 55 push %ebp
80105aa1: 89 e5 mov %esp,%ebp
80105aa3: 53 push %ebx
80105aa4: 83 ec 24 sub $0x24,%esp
int n;
uint ticks0;
if(argint(0, &n) < 0)
80105aa7: 8d 45 f4 lea -0xc(%ebp),%eax
80105aaa: 89 44 24 04 mov %eax,0x4(%esp)
80105aae: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80105ab5: e8 56 f2 ff ff call 80104d10 <argint>
80105aba: 85 c0 test %eax,%eax
80105abc: 78 7e js 80105b3c <sys_sleep+0x9c>
return -1;
acquire(&tickslock);
80105abe: c7 04 24 80 46 12 80 movl $0x80124680,(%esp)
80105ac5: e8 f6 ed ff ff call 801048c0 <acquire>
ticks0 = ticks;
while(ticks - ticks0 < n){
80105aca: 8b 55 f4 mov -0xc(%ebp),%edx
uint ticks0;
if(argint(0, &n) < 0)
return -1;
acquire(&tickslock);
ticks0 = ticks;
80105acd: 8b 1d c0 4e 12 80 mov 0x80124ec0,%ebx
while(ticks - ticks0 < n){
80105ad3: 85 d2 test %edx,%edx
80105ad5: 75 29 jne 80105b00 <sys_sleep+0x60>
80105ad7: eb 4f jmp 80105b28 <sys_sleep+0x88>
80105ad9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
if(proc->killed){
release(&tickslock);
return -1;
}
sleep(&ticks, &tickslock);
80105ae0: c7 44 24 04 80 46 12 movl $0x80124680,0x4(%esp)
80105ae7: 80
80105ae8: c7 04 24 c0 4e 12 80 movl $0x80124ec0,(%esp)
80105aef: e8 6c e2 ff ff call 80103d60 <sleep>
if(argint(0, &n) < 0)
return -1;
acquire(&tickslock);
ticks0 = ticks;
while(ticks - ticks0 < n){
80105af4: a1 c0 4e 12 80 mov 0x80124ec0,%eax
80105af9: 29 d8 sub %ebx,%eax
80105afb: 3b 45 f4 cmp -0xc(%ebp),%eax
80105afe: 73 28 jae 80105b28 <sys_sleep+0x88>
if(proc->killed){
80105b00: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80105b06: 8b 40 18 mov 0x18(%eax),%eax
80105b09: 85 c0 test %eax,%eax
80105b0b: 74 d3 je 80105ae0 <sys_sleep+0x40>
release(&tickslock);
80105b0d: c7 04 24 80 46 12 80 movl $0x80124680,(%esp)
80105b14: e8 d7 ee ff ff call 801049f0 <release>
return -1;
80105b19: b8 ff ff ff ff mov $0xffffffff,%eax
}
sleep(&ticks, &tickslock);
}
release(&tickslock);
return 0;
}
80105b1e: 83 c4 24 add $0x24,%esp
80105b21: 5b pop %ebx
80105b22: 5d pop %ebp
80105b23: c3 ret
80105b24: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
release(&tickslock);
return -1;
}
sleep(&ticks, &tickslock);
}
release(&tickslock);
80105b28: c7 04 24 80 46 12 80 movl $0x80124680,(%esp)
80105b2f: e8 bc ee ff ff call 801049f0 <release>
return 0;
}
80105b34: 83 c4 24 add $0x24,%esp
return -1;
}
sleep(&ticks, &tickslock);
}
release(&tickslock);
return 0;
80105b37: 31 c0 xor %eax,%eax
}
80105b39: 5b pop %ebx
80105b3a: 5d pop %ebp
80105b3b: c3 ret
{
int n;
uint ticks0;
if(argint(0, &n) < 0)
return -1;
80105b3c: b8 ff ff ff ff mov $0xffffffff,%eax
80105b41: eb db jmp 80105b1e <sys_sleep+0x7e>
80105b43: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80105b49: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80105b50 <sys_uptime>:
// return how many clock tick interrupts have occurred
// since start.
int
sys_uptime(void)
{
80105b50: 55 push %ebp
80105b51: 89 e5 mov %esp,%ebp
80105b53: 53 push %ebx
80105b54: 83 ec 14 sub $0x14,%esp
uint xticks;
acquire(&tickslock);
80105b57: c7 04 24 80 46 12 80 movl $0x80124680,(%esp)
80105b5e: e8 5d ed ff ff call 801048c0 <acquire>
xticks = ticks;
80105b63: 8b 1d c0 4e 12 80 mov 0x80124ec0,%ebx
release(&tickslock);
80105b69: c7 04 24 80 46 12 80 movl $0x80124680,(%esp)
80105b70: e8 7b ee ff ff call 801049f0 <release>
return xticks;
}
80105b75: 83 c4 14 add $0x14,%esp
80105b78: 89 d8 mov %ebx,%eax
80105b7a: 5b pop %ebx
80105b7b: 5d pop %ebp
80105b7c: c3 ret
80105b7d: 8d 76 00 lea 0x0(%esi),%esi
80105b80 <sys_kthread_create>:
int sys_kthread_create(void)
{
80105b80: 55 push %ebp
80105b81: 89 e5 mov %esp,%ebp
80105b83: 83 ec 28 sub $0x28,%esp
void*(*start_func)();
void* stack;
uint stack_size;
if(argptr(0, (char **)&start_func,4) < 0)
80105b86: 8d 45 ec lea -0x14(%ebp),%eax
80105b89: c7 44 24 08 04 00 00 movl $0x4,0x8(%esp)
80105b90: 00
80105b91: 89 44 24 04 mov %eax,0x4(%esp)
80105b95: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80105b9c: e8 af f1 ff ff call 80104d50 <argptr>
80105ba1: 85 c0 test %eax,%eax
80105ba3: 78 53 js 80105bf8 <sys_kthread_create+0x78>
return -1;
if(argptr(1, (char **)&stack,4) < 0)
80105ba5: 8d 45 f0 lea -0x10(%ebp),%eax
80105ba8: c7 44 24 08 04 00 00 movl $0x4,0x8(%esp)
80105baf: 00
80105bb0: 89 44 24 04 mov %eax,0x4(%esp)
80105bb4: c7 04 24 01 00 00 00 movl $0x1,(%esp)
80105bbb: e8 90 f1 ff ff call 80104d50 <argptr>
80105bc0: 85 c0 test %eax,%eax
80105bc2: 78 34 js 80105bf8 <sys_kthread_create+0x78>
return -1;
if(argint(2,(int*) &stack_size) < 0)
80105bc4: 8d 45 f4 lea -0xc(%ebp),%eax
80105bc7: 89 44 24 04 mov %eax,0x4(%esp)
80105bcb: c7 04 24 02 00 00 00 movl $0x2,(%esp)
80105bd2: e8 39 f1 ff ff call 80104d10 <argint>
80105bd7: 85 c0 test %eax,%eax
80105bd9: 78 1d js 80105bf8 <sys_kthread_create+0x78>
return -1;
return kthread_create(start_func,stack,stack_size);
80105bdb: 8b 45 f4 mov -0xc(%ebp),%eax
80105bde: 89 44 24 08 mov %eax,0x8(%esp)
80105be2: 8b 45 f0 mov -0x10(%ebp),%eax
80105be5: 89 44 24 04 mov %eax,0x4(%esp)
80105be9: 8b 45 ec mov -0x14(%ebp),%eax
80105bec: 89 04 24 mov %eax,(%esp)
80105bef: e8 4c e4 ff ff call 80104040 <kthread_create>
}
80105bf4: c9 leave
80105bf5: c3 ret
80105bf6: 66 90 xchg %ax,%ax
{
void*(*start_func)();
void* stack;
uint stack_size;
if(argptr(0, (char **)&start_func,4) < 0)
return -1;
80105bf8: b8 ff ff ff ff mov $0xffffffff,%eax
if(argptr(1, (char **)&stack,4) < 0)
return -1;
if(argint(2,(int*) &stack_size) < 0)
return -1;
return kthread_create(start_func,stack,stack_size);
}
80105bfd: c9 leave
80105bfe: c3 ret
80105bff: 90 nop
80105c00 <sys_kthread_id>:
int sys_kthread_id(void)
{
80105c00: 55 push %ebp
80105c01: 89 e5 mov %esp,%ebp
return kthread_id();
}
80105c03: 5d pop %ebp
return kthread_create(start_func,stack,stack_size);
}
int sys_kthread_id(void)
{
return kthread_id();
80105c04: e9 47 e5 ff ff jmp 80104150 <kthread_id>
80105c09: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80105c10 <sys_kthread_exit>:
}
int
sys_kthread_exit(void){
80105c10: 55 push %ebp
80105c11: 89 e5 mov %esp,%ebp
80105c13: 83 ec 08 sub $0x8,%esp
kthread_exit();
80105c16: e8 f5 e7 ff ff call 80104410 <kthread_exit>
return 0;
}
80105c1b: 31 c0 xor %eax,%eax
80105c1d: c9 leave
80105c1e: c3 ret
80105c1f: 90 nop
80105c20 <sys_kthread_join>:
int
sys_kthread_join(void){
80105c20: 55 push %ebp
80105c21: 89 e5 mov %esp,%ebp
80105c23: 83 ec 28 sub $0x28,%esp
int pid;
if(argint(0, &pid) < 0)
80105c26: 8d 45 f4 lea -0xc(%ebp),%eax
80105c29: 89 44 24 04 mov %eax,0x4(%esp)
80105c2d: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80105c34: e8 d7 f0 ff ff call 80104d10 <argint>
80105c39: 85 c0 test %eax,%eax
80105c3b: 78 13 js 80105c50 <sys_kthread_join+0x30>
return -1;
return kthread_join(pid);
80105c3d: 8b 45 f4 mov -0xc(%ebp),%eax
80105c40: 89 04 24 mov %eax,(%esp)
80105c43: e8 28 e5 ff ff call 80104170 <kthread_join>
}
80105c48: c9 leave
80105c49: c3 ret
80105c4a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
int
sys_kthread_join(void){
int pid;
if(argint(0, &pid) < 0)
return -1;
80105c50: b8 ff ff ff ff mov $0xffffffff,%eax
return kthread_join(pid);
}
80105c55: c9 leave
80105c56: c3 ret
80105c57: 89 f6 mov %esi,%esi
80105c59: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80105c60 <sys_kthread_mutex_alloc>:
int sys_kthread_mutex_alloc(void)
{
80105c60: 55 push %ebp
80105c61: 89 e5 mov %esp,%ebp
return kthread_mutex_alloc();
}
80105c63: 5d pop %ebp
return kthread_join(pid);
}
int sys_kthread_mutex_alloc(void)
{
return kthread_mutex_alloc();
80105c64: e9 07 e9 ff ff jmp 80104570 <kthread_mutex_alloc>
80105c69: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80105c70 <sys_kthread_mutex_dealloc>:
}
int sys_kthread_mutex_dealloc(void )
{
80105c70: 55 push %ebp
80105c71: 89 e5 mov %esp,%ebp
80105c73: 83 ec 28 sub $0x28,%esp
int mutex_id;
if(argint(0, &mutex_id) < 0)
80105c76: 8d 45 f4 lea -0xc(%ebp),%eax
80105c79: 89 44 24 04 mov %eax,0x4(%esp)
80105c7d: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80105c84: e8 87 f0 ff ff call 80104d10 <argint>
80105c89: 85 c0 test %eax,%eax
80105c8b: 78 13 js 80105ca0 <sys_kthread_mutex_dealloc+0x30>
return -1;
return kthread_mutex_dealloc(mutex_id);
80105c8d: 8b 45 f4 mov -0xc(%ebp),%eax
80105c90: 89 04 24 mov %eax,(%esp)
80105c93: e8 78 e9 ff ff call 80104610 <kthread_mutex_dealloc>
}
80105c98: c9 leave
80105c99: c3 ret
80105c9a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
int sys_kthread_mutex_dealloc(void )
{
int mutex_id;
if(argint(0, &mutex_id) < 0)
return -1;
80105ca0: b8 ff ff ff ff mov $0xffffffff,%eax
return kthread_mutex_dealloc(mutex_id);
}
80105ca5: c9 leave
80105ca6: c3 ret
80105ca7: 89 f6 mov %esi,%esi
80105ca9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80105cb0 <sys_kthread_mutex_lock>:
int sys_kthread_mutex_lock(void )
{
80105cb0: 55 push %ebp
80105cb1: 89 e5 mov %esp,%ebp
80105cb3: 83 ec 28 sub $0x28,%esp
int mutex_id;
if(argint(0, &mutex_id) < 0)
80105cb6: 8d 45 f4 lea -0xc(%ebp),%eax
80105cb9: 89 44 24 04 mov %eax,0x4(%esp)
80105cbd: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80105cc4: e8 47 f0 ff ff call 80104d10 <argint>
80105cc9: 85 c0 test %eax,%eax
80105ccb: 78 13 js 80105ce0 <sys_kthread_mutex_lock+0x30>
return -1;
return kthread_mutex_lock(mutex_id);
80105ccd: 8b 45 f4 mov -0xc(%ebp),%eax
80105cd0: 89 04 24 mov %eax,(%esp)
80105cd3: e8 d8 e9 ff ff call 801046b0 <kthread_mutex_lock>
}
80105cd8: c9 leave
80105cd9: c3 ret
80105cda: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
int sys_kthread_mutex_lock(void )
{
int mutex_id;
if(argint(0, &mutex_id) < 0)
return -1;
80105ce0: b8 ff ff ff ff mov $0xffffffff,%eax
return kthread_mutex_lock(mutex_id);
}
80105ce5: c9 leave
80105ce6: c3 ret
80105ce7: 89 f6 mov %esi,%esi
80105ce9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80105cf0 <sys_kthread_mutex_unlock>:
int sys_kthread_mutex_unlock(void )
{
80105cf0: 55 push %ebp
80105cf1: 89 e5 mov %esp,%ebp
80105cf3: 83 ec 28 sub $0x28,%esp
int mutex_id;
if(argint(0, &mutex_id) < 0)
80105cf6: 8d 45 f4 lea -0xc(%ebp),%eax
80105cf9: 89 44 24 04 mov %eax,0x4(%esp)
80105cfd: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80105d04: e8 07 f0 ff ff call 80104d10 <argint>
80105d09: 85 c0 test %eax,%eax
80105d0b: 78 13 js 80105d20 <sys_kthread_mutex_unlock+0x30>
return -1;
return kthread_mutex_unlock(mutex_id);
80105d0d: 8b 45 f4 mov -0xc(%ebp),%eax
80105d10: 89 04 24 mov %eax,(%esp)
80105d13: e8 58 ea ff ff call 80104770 <kthread_mutex_unlock>
}
80105d18: c9 leave
80105d19: c3 ret
80105d1a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
int sys_kthread_mutex_unlock(void )
{
int mutex_id;
if(argint(0, &mutex_id) < 0)
return -1;
80105d20: b8 ff ff ff ff mov $0xffffffff,%eax
return kthread_mutex_unlock(mutex_id);
}
80105d25: c9 leave
80105d26: c3 ret
80105d27: 66 90 xchg %ax,%ax
80105d29: 66 90 xchg %ax,%ax
80105d2b: 66 90 xchg %ax,%ax
80105d2d: 66 90 xchg %ax,%ax
80105d2f: 90 nop
80105d30 <timerinit>:
#define TIMER_RATEGEN 0x04 // mode 2, rate generator
#define TIMER_16BIT 0x30 // r/w counter 16 bits, LSB first
void
timerinit(void)
{
80105d30: 55 push %ebp
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80105d31: ba 43 00 00 00 mov $0x43,%edx
80105d36: 89 e5 mov %esp,%ebp
80105d38: b8 34 00 00 00 mov $0x34,%eax
80105d3d: 83 ec 18 sub $0x18,%esp
80105d40: ee out %al,(%dx)
80105d41: b8 9c ff ff ff mov $0xffffff9c,%eax
80105d46: b2 40 mov $0x40,%dl
80105d48: ee out %al,(%dx)
80105d49: b8 2e 00 00 00 mov $0x2e,%eax
80105d4e: ee out %al,(%dx)
// Interrupt 100 times/sec.
outb(TIMER_MODE, TIMER_SEL0 | TIMER_RATEGEN | TIMER_16BIT);
outb(IO_TIMER1, TIMER_DIV(100) % 256);
outb(IO_TIMER1, TIMER_DIV(100) / 256);
picenable(IRQ_TIMER);
80105d4f: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80105d56: e8 95 d4 ff ff call 801031f0 <picenable>
}
80105d5b: c9 leave
80105d5c: c3 ret
80105d5d <alltraps>:
# vectors.S sends all traps here.
.globl alltraps
alltraps:
# Build trap frame.
pushl %ds
80105d5d: 1e push %ds
pushl %es
80105d5e: 06 push %es
pushl %fs
80105d5f: 0f a0 push %fs
pushl %gs
80105d61: 0f a8 push %gs
pushal
80105d63: 60 pusha
# Set up data and per-cpu segments.
movw $(SEG_KDATA<<3), %ax
80105d64: 66 b8 10 00 mov $0x10,%ax
movw %ax, %ds
80105d68: 8e d8 mov %eax,%ds
movw %ax, %es
80105d6a: 8e c0 mov %eax,%es
movw $(SEG_KCPU<<3), %ax
80105d6c: 66 b8 18 00 mov $0x18,%ax
movw %ax, %fs
80105d70: 8e e0 mov %eax,%fs
movw %ax, %gs
80105d72: 8e e8 mov %eax,%gs
# Call trap(tf), where tf=%esp
pushl %esp
80105d74: 54 push %esp
call trap
80105d75: e8 e6 00 00 00 call 80105e60 <trap>
addl $4, %esp
80105d7a: 83 c4 04 add $0x4,%esp
80105d7d <trapret>:
# Return falls through to trapret...
.globl trapret
trapret:
popal
80105d7d: 61 popa
popl %gs
80105d7e: 0f a9 pop %gs
popl %fs
80105d80: 0f a1 pop %fs
popl %es
80105d82: 07 pop %es
popl %ds
80105d83: 1f pop %ds
addl $0x8, %esp # trapno and errcode
80105d84: 83 c4 08 add $0x8,%esp
iret
80105d87: cf iret
80105d88: 66 90 xchg %ax,%ax
80105d8a: 66 90 xchg %ax,%ax
80105d8c: 66 90 xchg %ax,%ax
80105d8e: 66 90 xchg %ax,%ax
80105d90 <tvinit>:
void
tvinit(void)
{
int i;
for(i = 0; i < 256; i++)
80105d90: 31 c0 xor %eax,%eax
80105d92: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
SETGATE(idt[i], 0, SEG_KCODE<<3, vectors[i], 0);
80105d98: 8b 14 85 14 b0 10 80 mov -0x7fef4fec(,%eax,4),%edx
80105d9f: b9 08 00 00 00 mov $0x8,%ecx
80105da4: 66 89 0c c5 c2 46 12 mov %cx,-0x7fedb93e(,%eax,8)
80105dab: 80
80105dac: c6 04 c5 c4 46 12 80 movb $0x0,-0x7fedb93c(,%eax,8)
80105db3: 00
80105db4: c6 04 c5 c5 46 12 80 movb $0x8e,-0x7fedb93b(,%eax,8)
80105dbb: 8e
80105dbc: 66 89 14 c5 c0 46 12 mov %dx,-0x7fedb940(,%eax,8)
80105dc3: 80
80105dc4: c1 ea 10 shr $0x10,%edx
80105dc7: 66 89 14 c5 c6 46 12 mov %dx,-0x7fedb93a(,%eax,8)
80105dce: 80
void
tvinit(void)
{
int i;
for(i = 0; i < 256; i++)
80105dcf: 83 c0 01 add $0x1,%eax
80105dd2: 3d 00 01 00 00 cmp $0x100,%eax
80105dd7: 75 bf jne 80105d98 <tvinit+0x8>
struct spinlock tickslock;
uint ticks;
void
tvinit(void)
{
80105dd9: 55 push %ebp
int i;
for(i = 0; i < 256; i++)
SETGATE(idt[i], 0, SEG_KCODE<<3, vectors[i], 0);
SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER);
80105dda: ba 08 00 00 00 mov $0x8,%edx
struct spinlock tickslock;
uint ticks;
void
tvinit(void)
{
80105ddf: 89 e5 mov %esp,%ebp
80105de1: 83 ec 18 sub $0x18,%esp
int i;
for(i = 0; i < 256; i++)
SETGATE(idt[i], 0, SEG_KCODE<<3, vectors[i], 0);
SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER);
80105de4: a1 14 b1 10 80 mov 0x8010b114,%eax
initlock(&tickslock, "time");
80105de9: c7 44 24 04 19 7e 10 movl $0x80107e19,0x4(%esp)
80105df0: 80
80105df1: c7 04 24 80 46 12 80 movl $0x80124680,(%esp)
{
int i;
for(i = 0; i < 256; i++)
SETGATE(idt[i], 0, SEG_KCODE<<3, vectors[i], 0);
SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER);
80105df8: 66 89 15 c2 48 12 80 mov %dx,0x801248c2
80105dff: 66 a3 c0 48 12 80 mov %ax,0x801248c0
80105e05: c1 e8 10 shr $0x10,%eax
80105e08: c6 05 c4 48 12 80 00 movb $0x0,0x801248c4
80105e0f: c6 05 c5 48 12 80 ef movb $0xef,0x801248c5
80105e16: 66 a3 c6 48 12 80 mov %ax,0x801248c6
initlock(&tickslock, "time");
80105e1c: e8 1f ea ff ff call 80104840 <initlock>
}
80105e21: c9 leave
80105e22: c3 ret
80105e23: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80105e29: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80105e30 <idtinit>:
void
idtinit(void)
{
80105e30: 55 push %ebp
static inline void
lidt(struct gatedesc *p, int size)
{
volatile ushort pd[3];
pd[0] = size-1;
80105e31: b8 ff 07 00 00 mov $0x7ff,%eax
80105e36: 89 e5 mov %esp,%ebp
80105e38: 83 ec 10 sub $0x10,%esp
80105e3b: 66 89 45 fa mov %ax,-0x6(%ebp)
pd[1] = (uint)p;
80105e3f: b8 c0 46 12 80 mov $0x801246c0,%eax
80105e44: 66 89 45 fc mov %ax,-0x4(%ebp)
pd[2] = (uint)p >> 16;
80105e48: c1 e8 10 shr $0x10,%eax
80105e4b: 66 89 45 fe mov %ax,-0x2(%ebp)
asm volatile("lidt (%0)" : : "r" (pd));
80105e4f: 8d 45 fa lea -0x6(%ebp),%eax
80105e52: 0f 01 18 lidtl (%eax)
lidt(idt, sizeof(idt));
}
80105e55: c9 leave
80105e56: c3 ret
80105e57: 89 f6 mov %esi,%esi
80105e59: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80105e60 <trap>:
//PAGEBREAK: 41
void
trap(struct trapframe *tf)
{
80105e60: 55 push %ebp
80105e61: 89 e5 mov %esp,%ebp
80105e63: 57 push %edi
80105e64: 56 push %esi
80105e65: 53 push %ebx
80105e66: 83 ec 2c sub $0x2c,%esp
80105e69: 8b 5d 08 mov 0x8(%ebp),%ebx
if(tf->trapno == T_SYSCALL){
80105e6c: 8b 43 30 mov 0x30(%ebx),%eax
80105e6f: 83 f8 40 cmp $0x40,%eax
80105e72: 0f 84 48 01 00 00 je 80105fc0 <trap+0x160>
else if(thread->killed)
kthread_exit();
return;
}
switch(tf->trapno){
80105e78: 83 e8 20 sub $0x20,%eax
80105e7b: 83 f8 1f cmp $0x1f,%eax
80105e7e: 0f 87 b4 00 00 00 ja 80105f38 <trap+0xd8>
80105e84: ff 24 85 c0 7e 10 80 jmp *-0x7fef8140(,%eax,4)
80105e8b: 90 nop
80105e8c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
case T_IRQ0 + IRQ_TIMER:
if(cpunum() == 0){
80105e90: e8 bb c8 ff ff call 80102750 <cpunum>
80105e95: 85 c0 test %eax,%eax
80105e97: 0f 84 6b 02 00 00 je 80106108 <trap+0x2a8>
80105e9d: 8d 76 00 lea 0x0(%esi),%esi
acquire(&tickslock);
ticks++;
wakeup(&ticks);
release(&tickslock);
}
lapiceoi();
80105ea0: e8 4b c9 ff ff call 801027f0 <lapiceoi>
80105ea5: 65 a1 04 00 00 00 mov %gs:0x4,%eax
}
// Force process exit if it has been killed and is in user space.
// (If it is still executing in the kernel, let it keep running
// until it gets to the regular system call return.)
if(proc && proc->killed && (tf->cs&3) == DPL_USER)
80105eab: 85 c0 test %eax,%eax
80105ead: 74 0b je 80105eba <trap+0x5a>
80105eaf: 8b 70 18 mov 0x18(%eax),%esi
80105eb2: 85 f6 test %esi,%esi
80105eb4: 0f 85 ea 00 00 00 jne 80105fa4 <trap+0x144>
exit();
if(thread && thread->killed && (tf->cs&3) == DPL_USER)
80105eba: 65 a1 08 00 00 00 mov %gs:0x8,%eax
80105ec0: 85 c0 test %eax,%eax
80105ec2: 74 22 je 80105ee6 <trap+0x86>
80105ec4: 8b 48 20 mov 0x20(%eax),%ecx
80105ec7: 85 c9 test %ecx,%ecx
80105ec9: 74 11 je 80105edc <trap+0x7c>
80105ecb: 0f b7 53 3c movzwl 0x3c(%ebx),%edx
80105ecf: 83 e2 03 and $0x3,%edx
80105ed2: 66 83 fa 03 cmp $0x3,%dx
80105ed6: 0f 84 04 02 00 00 je 801060e0 <trap+0x280>
kthread_exit();
// Force process to give up CPU on clock tick.
// If interrupts were on while locks held, would need to check nlock.
if(thread && thread->state == Running && tf->trapno == T_IRQ0+IRQ_TIMER)
80105edc: 83 78 04 04 cmpl $0x4,0x4(%eax)
80105ee0: 0f 84 c2 01 00 00 je 801060a8 <trap+0x248>
yield();
// Check if the process has been killed since we yielded
if(proc && proc->killed && (tf->cs&3) == DPL_USER)
80105ee6: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80105eec: 85 c0 test %eax,%eax
80105eee: 74 18 je 80105f08 <trap+0xa8>
80105ef0: 8b 50 18 mov 0x18(%eax),%edx
80105ef3: 85 d2 test %edx,%edx
80105ef5: 74 11 je 80105f08 <trap+0xa8>
80105ef7: 0f b7 43 3c movzwl 0x3c(%ebx),%eax
80105efb: 83 e0 03 and $0x3,%eax
80105efe: 66 83 f8 03 cmp $0x3,%ax
80105f02: 0f 84 f0 01 00 00 je 801060f8 <trap+0x298>
exit();
if(thread && thread->killed && (tf->cs&3) == DPL_USER)
80105f08: 65 a1 08 00 00 00 mov %gs:0x8,%eax
80105f0e: 85 c0 test %eax,%eax
80105f10: 74 18 je 80105f2a <trap+0xca>
80105f12: 8b 40 20 mov 0x20(%eax),%eax
80105f15: 85 c0 test %eax,%eax
80105f17: 74 11 je 80105f2a <trap+0xca>
80105f19: 0f b7 43 3c movzwl 0x3c(%ebx),%eax
80105f1d: 83 e0 03 and $0x3,%eax
80105f20: 66 83 f8 03 cmp $0x3,%ax
80105f24: 0f 84 e2 00 00 00 je 8010600c <trap+0x1ac>
kthread_exit();
}
80105f2a: 83 c4 2c add $0x2c,%esp
80105f2d: 5b pop %ebx
80105f2e: 5e pop %esi
80105f2f: 5f pop %edi
80105f30: 5d pop %ebp
80105f31: c3 ret
80105f32: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
lapiceoi();
break;
//PAGEBREAK: 13
default:
if(proc == 0 || (tf->cs&3) == 0){
80105f38: 65 8b 3d 04 00 00 00 mov %gs:0x4,%edi
80105f3f: 85 ff test %edi,%edi
80105f41: 0f 84 f1 01 00 00 je 80106138 <trap+0x2d8>
80105f47: f6 43 3c 03 testb $0x3,0x3c(%ebx)
80105f4b: 0f 84 e7 01 00 00 je 80106138 <trap+0x2d8>
static inline uint
rcr2(void)
{
uint val;
asm volatile("movl %%cr2,%0" : "=r" (val));
80105f51: 0f 20 d7 mov %cr2,%edi
cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n",
tf->trapno, cpunum(), tf->eip, rcr2());
panic("trap");
}
// In user space, assume process misbehaved.
cprintf("pid %d %s: trap %d err %d on cpu %d "
80105f54: 8b 73 38 mov 0x38(%ebx),%esi
80105f57: e8 f4 c7 ff ff call 80102750 <cpunum>
"eip 0x%x addr 0x%x--kill proc\n",
proc->pid, proc->name, tf->trapno, tf->err, cpunum(), tf->eip,
80105f5c: 65 8b 15 04 00 00 00 mov %gs:0x4,%edx
cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n",
tf->trapno, cpunum(), tf->eip, rcr2());
panic("trap");
}
// In user space, assume process misbehaved.
cprintf("pid %d %s: trap %d err %d on cpu %d "
80105f63: 89 7c 24 1c mov %edi,0x1c(%esp)
80105f67: 89 74 24 18 mov %esi,0x18(%esp)
80105f6b: 89 44 24 14 mov %eax,0x14(%esp)
80105f6f: 8b 43 34 mov 0x34(%ebx),%eax
80105f72: 89 44 24 10 mov %eax,0x10(%esp)
80105f76: 8b 43 30 mov 0x30(%ebx),%eax
80105f79: 89 44 24 0c mov %eax,0xc(%esp)
"eip 0x%x addr 0x%x--kill proc\n",
proc->pid, proc->name, tf->trapno, tf->err, cpunum(), tf->eip,
80105f7d: 8d 42 60 lea 0x60(%edx),%eax
80105f80: 89 44 24 08 mov %eax,0x8(%esp)
cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n",
tf->trapno, cpunum(), tf->eip, rcr2());
panic("trap");
}
// In user space, assume process misbehaved.
cprintf("pid %d %s: trap %d err %d on cpu %d "
80105f84: 8b 42 0c mov 0xc(%edx),%eax
80105f87: c7 04 24 7c 7e 10 80 movl $0x80107e7c,(%esp)
80105f8e: 89 44 24 04 mov %eax,0x4(%esp)
80105f92: e8 89 a6 ff ff call 80100620 <cprintf>
"eip 0x%x addr 0x%x--kill proc\n",
proc->pid, proc->name, tf->trapno, tf->err, cpunum(), tf->eip,
rcr2());
proc->killed = 1;
80105f97: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80105f9d: c7 40 18 01 00 00 00 movl $0x1,0x18(%eax)
}
// Force process exit if it has been killed and is in user space.
// (If it is still executing in the kernel, let it keep running
// until it gets to the regular system call return.)
if(proc && proc->killed && (tf->cs&3) == DPL_USER)
80105fa4: 0f b7 43 3c movzwl 0x3c(%ebx),%eax
80105fa8: 83 e0 03 and $0x3,%eax
80105fab: 66 83 f8 03 cmp $0x3,%ax
80105faf: 0f 85 05 ff ff ff jne 80105eba <trap+0x5a>
exit();
80105fb5: e8 a6 e2 ff ff call 80104260 <exit>
80105fba: e9 fb fe ff ff jmp 80105eba <trap+0x5a>
80105fbf: 90 nop
//PAGEBREAK: 41
void
trap(struct trapframe *tf)
{
if(tf->trapno == T_SYSCALL){
if(proc->killed)
80105fc0: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80105fc6: 8b 48 18 mov 0x18(%eax),%ecx
80105fc9: 85 c9 test %ecx,%ecx
80105fcb: 0f 85 c7 00 00 00 jne 80106098 <trap+0x238>
exit();
else if(thread->killed)
80105fd1: 65 a1 08 00 00 00 mov %gs:0x8,%eax
80105fd7: 8b 50 20 mov 0x20(%eax),%edx
80105fda: 85 d2 test %edx,%edx
80105fdc: 0f 85 ee 00 00 00 jne 801060d0 <trap+0x270>
kthread_exit();
thread->tf = tf;
80105fe2: 89 58 14 mov %ebx,0x14(%eax)
syscall();
80105fe5: e8 36 ee ff ff call 80104e20 <syscall>
if(proc->killed)
80105fea: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80105ff0: 8b 40 18 mov 0x18(%eax),%eax
80105ff3: 85 c0 test %eax,%eax
80105ff5: 0f 85 c5 00 00 00 jne 801060c0 <trap+0x260>
exit();
else if(thread->killed)
80105ffb: 65 a1 08 00 00 00 mov %gs:0x8,%eax
80106001: 8b 40 20 mov 0x20(%eax),%eax
80106004: 85 c0 test %eax,%eax
80106006: 0f 84 1e ff ff ff je 80105f2a <trap+0xca>
// Check if the process has been killed since we yielded
if(proc && proc->killed && (tf->cs&3) == DPL_USER)
exit();
if(thread && thread->killed && (tf->cs&3) == DPL_USER)
kthread_exit();
}
8010600c: 83 c4 2c add $0x2c,%esp
8010600f: 5b pop %ebx
80106010: 5e pop %esi
80106011: 5f pop %edi
80106012: 5d pop %ebp
thread->tf = tf;
syscall();
if(proc->killed)
exit();
else if(thread->killed)
kthread_exit();
80106013: e9 f8 e3 ff ff jmp 80104410 <kthread_exit>
release(&tickslock);
}
lapiceoi();
break;
case T_IRQ0 + IRQ_IDE:
ideintr();
80106018: e8 53 c0 ff ff call 80102070 <ideintr>
lapiceoi();
8010601d: e8 ce c7 ff ff call 801027f0 <lapiceoi>
80106022: 65 a1 04 00 00 00 mov %gs:0x4,%eax
break;
80106028: e9 7e fe ff ff jmp 80105eab <trap+0x4b>
8010602d: 8d 76 00 lea 0x0(%esi),%esi
case T_IRQ0 + IRQ_KBD:
kbdintr();
lapiceoi();
break;
case T_IRQ0 + IRQ_COM1:
uartintr();
80106030: e8 6b 02 00 00 call 801062a0 <uartintr>
lapiceoi();
80106035: e8 b6 c7 ff ff call 801027f0 <lapiceoi>
8010603a: 65 a1 04 00 00 00 mov %gs:0x4,%eax
break;
80106040: e9 66 fe ff ff jmp 80105eab <trap+0x4b>
80106045: 8d 76 00 lea 0x0(%esi),%esi
case T_IRQ0 + 7:
case T_IRQ0 + IRQ_SPURIOUS:
cprintf("cpu%d: spurious interrupt at %x:%x\n",
80106048: 8b 7b 38 mov 0x38(%ebx),%edi
8010604b: 0f b7 73 3c movzwl 0x3c(%ebx),%esi
8010604f: e8 fc c6 ff ff call 80102750 <cpunum>
80106054: c7 04 24 24 7e 10 80 movl $0x80107e24,(%esp)
8010605b: 89 7c 24 0c mov %edi,0xc(%esp)
8010605f: 89 74 24 08 mov %esi,0x8(%esp)
80106063: 89 44 24 04 mov %eax,0x4(%esp)
80106067: e8 b4 a5 ff ff call 80100620 <cprintf>
cpunum(), tf->cs, tf->eip);
lapiceoi();
8010606c: e8 7f c7 ff ff call 801027f0 <lapiceoi>
80106071: 65 a1 04 00 00 00 mov %gs:0x4,%eax
break;
80106077: e9 2f fe ff ff jmp 80105eab <trap+0x4b>
8010607c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
break;
case T_IRQ0 + IRQ_IDE+1:
// Bochs generates spurious IDE1 interrupts.
break;
case T_IRQ0 + IRQ_KBD:
kbdintr();
80106080: e8 3b c5 ff ff call 801025c0 <kbdintr>
lapiceoi();
80106085: e8 66 c7 ff ff call 801027f0 <lapiceoi>
8010608a: 65 a1 04 00 00 00 mov %gs:0x4,%eax
break;
80106090: e9 16 fe ff ff jmp 80105eab <trap+0x4b>
80106095: 8d 76 00 lea 0x0(%esi),%esi
void
trap(struct trapframe *tf)
{
if(tf->trapno == T_SYSCALL){
if(proc->killed)
exit();
80106098: e8 c3 e1 ff ff call 80104260 <exit>
8010609d: 65 a1 08 00 00 00 mov %gs:0x8,%eax
801060a3: e9 3a ff ff ff jmp 80105fe2 <trap+0x182>
exit();
if(thread && thread->killed && (tf->cs&3) == DPL_USER)
kthread_exit();
// Force process to give up CPU on clock tick.
// If interrupts were on while locks held, would need to check nlock.
if(thread && thread->state == Running && tf->trapno == T_IRQ0+IRQ_TIMER)
801060a8: 83 7b 30 20 cmpl $0x20,0x30(%ebx)
801060ac: 0f 85 34 fe ff ff jne 80105ee6 <trap+0x86>
yield();
801060b2: e8 69 dc ff ff call 80103d20 <yield>
801060b7: e9 2a fe ff ff jmp 80105ee6 <trap+0x86>
801060bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
// Check if the process has been killed since we yielded
if(proc && proc->killed && (tf->cs&3) == DPL_USER)
exit();
if(thread && thread->killed && (tf->cs&3) == DPL_USER)
kthread_exit();
}
801060c0: 83 c4 2c add $0x2c,%esp
801060c3: 5b pop %ebx
801060c4: 5e pop %esi
801060c5: 5f pop %edi
801060c6: 5d pop %ebp
else if(thread->killed)
kthread_exit();
thread->tf = tf;
syscall();
if(proc->killed)
exit();
801060c7: e9 94 e1 ff ff jmp 80104260 <exit>
801060cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
{
if(tf->trapno == T_SYSCALL){
if(proc->killed)
exit();
else if(thread->killed)
kthread_exit();
801060d0: e8 3b e3 ff ff call 80104410 <kthread_exit>
801060d5: 65 a1 08 00 00 00 mov %gs:0x8,%eax
801060db: e9 02 ff ff ff jmp 80105fe2 <trap+0x182>
// (If it is still executing in the kernel, let it keep running
// until it gets to the regular system call return.)
if(proc && proc->killed && (tf->cs&3) == DPL_USER)
exit();
if(thread && thread->killed && (tf->cs&3) == DPL_USER)
kthread_exit();
801060e0: e8 2b e3 ff ff call 80104410 <kthread_exit>
// Force process to give up CPU on clock tick.
// If interrupts were on while locks held, would need to check nlock.
if(thread && thread->state == Running && tf->trapno == T_IRQ0+IRQ_TIMER)
801060e5: 65 a1 08 00 00 00 mov %gs:0x8,%eax
801060eb: 85 c0 test %eax,%eax
801060ed: 0f 85 e9 fd ff ff jne 80105edc <trap+0x7c>
801060f3: e9 ee fd ff ff jmp 80105ee6 <trap+0x86>
yield();
// Check if the process has been killed since we yielded
if(proc && proc->killed && (tf->cs&3) == DPL_USER)
exit();
801060f8: e8 63 e1 ff ff call 80104260 <exit>
801060fd: 8d 76 00 lea 0x0(%esi),%esi
80106100: e9 03 fe ff ff jmp 80105f08 <trap+0xa8>
80106105: 8d 76 00 lea 0x0(%esi),%esi
}
switch(tf->trapno){
case T_IRQ0 + IRQ_TIMER:
if(cpunum() == 0){
acquire(&tickslock);
80106108: c7 04 24 80 46 12 80 movl $0x80124680,(%esp)
8010610f: e8 ac e7 ff ff call 801048c0 <acquire>
ticks++;
wakeup(&ticks);
80106114: c7 04 24 c0 4e 12 80 movl $0x80124ec0,(%esp)
switch(tf->trapno){
case T_IRQ0 + IRQ_TIMER:
if(cpunum() == 0){
acquire(&tickslock);
ticks++;
8010611b: 83 05 c0 4e 12 80 01 addl $0x1,0x80124ec0
wakeup(&ticks);
80106122: e8 69 de ff ff call 80103f90 <wakeup>
release(&tickslock);
80106127: c7 04 24 80 46 12 80 movl $0x80124680,(%esp)
8010612e: e8 bd e8 ff ff call 801049f0 <release>
80106133: e9 65 fd ff ff jmp 80105e9d <trap+0x3d>
80106138: 0f 20 d7 mov %cr2,%edi
//PAGEBREAK: 13
default:
if(proc == 0 || (tf->cs&3) == 0){
// In kernel, it must be our mistake.
cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n",
8010613b: 8b 73 38 mov 0x38(%ebx),%esi
8010613e: e8 0d c6 ff ff call 80102750 <cpunum>
80106143: 89 7c 24 10 mov %edi,0x10(%esp)
80106147: 89 74 24 0c mov %esi,0xc(%esp)
8010614b: 89 44 24 08 mov %eax,0x8(%esp)
8010614f: 8b 43 30 mov 0x30(%ebx),%eax
80106152: c7 04 24 48 7e 10 80 movl $0x80107e48,(%esp)
80106159: 89 44 24 04 mov %eax,0x4(%esp)
8010615d: e8 be a4 ff ff call 80100620 <cprintf>
tf->trapno, cpunum(), tf->eip, rcr2());
panic("trap");
80106162: c7 04 24 1e 7e 10 80 movl $0x80107e1e,(%esp)
80106169: e8 c2 a1 ff ff call 80100330 <panic>
8010616e: 66 90 xchg %ax,%ax
80106170 <uartgetc>:
}
static int
uartgetc(void)
{
if(!uart)
80106170: a1 c0 b5 10 80 mov 0x8010b5c0,%eax
outb(COM1+0, c);
}
static int
uartgetc(void)
{
80106175: 55 push %ebp
80106176: 89 e5 mov %esp,%ebp
if(!uart)
80106178: 85 c0 test %eax,%eax
8010617a: 74 14 je 80106190 <uartgetc+0x20>
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
8010617c: ba fd 03 00 00 mov $0x3fd,%edx
80106181: ec in (%dx),%al
return -1;
if(!(inb(COM1+5) & 0x01))
80106182: a8 01 test $0x1,%al
80106184: 74 0a je 80106190 <uartgetc+0x20>
80106186: b2 f8 mov $0xf8,%dl
80106188: ec in (%dx),%al
return -1;
return inb(COM1+0);
80106189: 0f b6 c0 movzbl %al,%eax
}
8010618c: 5d pop %ebp
8010618d: c3 ret
8010618e: 66 90 xchg %ax,%ax
static int
uartgetc(void)
{
if(!uart)
return -1;
80106190: b8 ff ff ff ff mov $0xffffffff,%eax
if(!(inb(COM1+5) & 0x01))
return -1;
return inb(COM1+0);
}
80106195: 5d pop %ebp
80106196: c3 ret
80106197: 89 f6 mov %esi,%esi
80106199: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801061a0 <uartputc>:
void
uartputc(int c)
{
int i;
if(!uart)
801061a0: a1 c0 b5 10 80 mov 0x8010b5c0,%eax
801061a5: 85 c0 test %eax,%eax
801061a7: 74 3f je 801061e8 <uartputc+0x48>
uartputc(*p);
}
void
uartputc(int c)
{
801061a9: 55 push %ebp
801061aa: 89 e5 mov %esp,%ebp
801061ac: 56 push %esi
801061ad: be fd 03 00 00 mov $0x3fd,%esi
801061b2: 53 push %ebx
int i;
if(!uart)
801061b3: bb 80 00 00 00 mov $0x80,%ebx
uartputc(*p);
}
void
uartputc(int c)
{
801061b8: 83 ec 10 sub $0x10,%esp
801061bb: eb 14 jmp 801061d1 <uartputc+0x31>
801061bd: 8d 76 00 lea 0x0(%esi),%esi
int i;
if(!uart)
return;
for(i = 0; i < 128 && !(inb(COM1+5) & 0x20); i++)
microdelay(10);
801061c0: c7 04 24 0a 00 00 00 movl $0xa,(%esp)
801061c7: e8 44 c6 ff ff call 80102810 <microdelay>
{
int i;
if(!uart)
return;
for(i = 0; i < 128 && !(inb(COM1+5) & 0x20); i++)
801061cc: 83 eb 01 sub $0x1,%ebx
801061cf: 74 07 je 801061d8 <uartputc+0x38>
801061d1: 89 f2 mov %esi,%edx
801061d3: ec in (%dx),%al
801061d4: a8 20 test $0x20,%al
801061d6: 74 e8 je 801061c0 <uartputc+0x20>
microdelay(10);
outb(COM1+0, c);
801061d8: 0f b6 45 08 movzbl 0x8(%ebp),%eax
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
801061dc: ba f8 03 00 00 mov $0x3f8,%edx
801061e1: ee out %al,(%dx)
}
801061e2: 83 c4 10 add $0x10,%esp
801061e5: 5b pop %ebx
801061e6: 5e pop %esi
801061e7: 5d pop %ebp
801061e8: f3 c3 repz ret
801061ea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801061f0 <uartinit>:
static int uart; // is there a uart?
void
uartinit(void)
{
801061f0: 55 push %ebp
801061f1: 31 c9 xor %ecx,%ecx
801061f3: 89 e5 mov %esp,%ebp
801061f5: 89 c8 mov %ecx,%eax
801061f7: 57 push %edi
801061f8: bf fa 03 00 00 mov $0x3fa,%edi
801061fd: 56 push %esi
801061fe: 89 fa mov %edi,%edx
80106200: 53 push %ebx
80106201: 83 ec 1c sub $0x1c,%esp
80106204: ee out %al,(%dx)
80106205: be fb 03 00 00 mov $0x3fb,%esi
8010620a: b8 80 ff ff ff mov $0xffffff80,%eax
8010620f: 89 f2 mov %esi,%edx
80106211: ee out %al,(%dx)
80106212: b8 0c 00 00 00 mov $0xc,%eax
80106217: b2 f8 mov $0xf8,%dl
80106219: ee out %al,(%dx)
8010621a: bb f9 03 00 00 mov $0x3f9,%ebx
8010621f: 89 c8 mov %ecx,%eax
80106221: 89 da mov %ebx,%edx
80106223: ee out %al,(%dx)
80106224: b8 03 00 00 00 mov $0x3,%eax
80106229: 89 f2 mov %esi,%edx
8010622b: ee out %al,(%dx)
8010622c: b2 fc mov $0xfc,%dl
8010622e: 89 c8 mov %ecx,%eax
80106230: ee out %al,(%dx)
80106231: b8 01 00 00 00 mov $0x1,%eax
80106236: 89 da mov %ebx,%edx
80106238: ee out %al,(%dx)
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80106239: b2 fd mov $0xfd,%dl
8010623b: ec in (%dx),%al
outb(COM1+3, 0x03); // Lock divisor, 8 data bits.
outb(COM1+4, 0);
outb(COM1+1, 0x01); // Enable receive interrupts.
// If status is 0xFF, no serial port.
if(inb(COM1+5) == 0xFF)
8010623c: 3c ff cmp $0xff,%al
8010623e: 74 52 je 80106292 <uartinit+0xa2>
return;
uart = 1;
80106240: c7 05 c0 b5 10 80 01 movl $0x1,0x8010b5c0
80106247: 00 00 00
8010624a: 89 fa mov %edi,%edx
8010624c: ec in (%dx),%al
8010624d: b2 f8 mov $0xf8,%dl
8010624f: ec in (%dx),%al
// Acknowledge pre-existing interrupt conditions;
// enable interrupts.
inb(COM1+2);
inb(COM1+0);
picenable(IRQ_COM1);
80106250: c7 04 24 04 00 00 00 movl $0x4,(%esp)
ioapicenable(IRQ_COM1, 0);
// Announce that we're here.
for(p="xv6...\n"; *p; p++)
80106257: bb 40 7f 10 80 mov $0x80107f40,%ebx
// Acknowledge pre-existing interrupt conditions;
// enable interrupts.
inb(COM1+2);
inb(COM1+0);
picenable(IRQ_COM1);
8010625c: e8 8f cf ff ff call 801031f0 <picenable>
ioapicenable(IRQ_COM1, 0);
80106261: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80106268: 00
80106269: c7 04 24 04 00 00 00 movl $0x4,(%esp)
80106270: e8 2b c0 ff ff call 801022a0 <ioapicenable>
// Announce that we're here.
for(p="xv6...\n"; *p; p++)
80106275: b8 78 00 00 00 mov $0x78,%eax
8010627a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
uartputc(*p);
80106280: 89 04 24 mov %eax,(%esp)
inb(COM1+0);
picenable(IRQ_COM1);
ioapicenable(IRQ_COM1, 0);
// Announce that we're here.
for(p="xv6...\n"; *p; p++)
80106283: 83 c3 01 add $0x1,%ebx
uartputc(*p);
80106286: e8 15 ff ff ff call 801061a0 <uartputc>
inb(COM1+0);
picenable(IRQ_COM1);
ioapicenable(IRQ_COM1, 0);
// Announce that we're here.
for(p="xv6...\n"; *p; p++)
8010628b: 0f be 03 movsbl (%ebx),%eax
8010628e: 84 c0 test %al,%al
80106290: 75 ee jne 80106280 <uartinit+0x90>
uartputc(*p);
}
80106292: 83 c4 1c add $0x1c,%esp
80106295: 5b pop %ebx
80106296: 5e pop %esi
80106297: 5f pop %edi
80106298: 5d pop %ebp
80106299: c3 ret
8010629a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801062a0 <uartintr>:
return inb(COM1+0);
}
void
uartintr(void)
{
801062a0: 55 push %ebp
801062a1: 89 e5 mov %esp,%ebp
801062a3: 83 ec 18 sub $0x18,%esp
consoleintr(uartgetc);
801062a6: c7 04 24 70 61 10 80 movl $0x80106170,(%esp)
801062ad: e8 ce a4 ff ff call 80100780 <consoleintr>
}
801062b2: c9 leave
801062b3: c3 ret
801062b4 <vector0>:
# generated by vectors.pl - do not edit
# handlers
.globl alltraps
.globl vector0
vector0:
pushl $0
801062b4: 6a 00 push $0x0
pushl $0
801062b6: 6a 00 push $0x0
jmp alltraps
801062b8: e9 a0 fa ff ff jmp 80105d5d <alltraps>
801062bd <vector1>:
.globl vector1
vector1:
pushl $0
801062bd: 6a 00 push $0x0
pushl $1
801062bf: 6a 01 push $0x1
jmp alltraps
801062c1: e9 97 fa ff ff jmp 80105d5d <alltraps>
801062c6 <vector2>:
.globl vector2
vector2:
pushl $0
801062c6: 6a 00 push $0x0
pushl $2
801062c8: 6a 02 push $0x2
jmp alltraps
801062ca: e9 8e fa ff ff jmp 80105d5d <alltraps>
801062cf <vector3>:
.globl vector3
vector3:
pushl $0
801062cf: 6a 00 push $0x0
pushl $3
801062d1: 6a 03 push $0x3
jmp alltraps
801062d3: e9 85 fa ff ff jmp 80105d5d <alltraps>
801062d8 <vector4>:
.globl vector4
vector4:
pushl $0
801062d8: 6a 00 push $0x0
pushl $4
801062da: 6a 04 push $0x4
jmp alltraps
801062dc: e9 7c fa ff ff jmp 80105d5d <alltraps>
801062e1 <vector5>:
.globl vector5
vector5:
pushl $0
801062e1: 6a 00 push $0x0
pushl $5
801062e3: 6a 05 push $0x5
jmp alltraps
801062e5: e9 73 fa ff ff jmp 80105d5d <alltraps>
801062ea <vector6>:
.globl vector6
vector6:
pushl $0
801062ea: 6a 00 push $0x0
pushl $6
801062ec: 6a 06 push $0x6
jmp alltraps
801062ee: e9 6a fa ff ff jmp 80105d5d <alltraps>
801062f3 <vector7>:
.globl vector7
vector7:
pushl $0
801062f3: 6a 00 push $0x0
pushl $7
801062f5: 6a 07 push $0x7
jmp alltraps
801062f7: e9 61 fa ff ff jmp 80105d5d <alltraps>
801062fc <vector8>:
.globl vector8
vector8:
pushl $8
801062fc: 6a 08 push $0x8
jmp alltraps
801062fe: e9 5a fa ff ff jmp 80105d5d <alltraps>
80106303 <vector9>:
.globl vector9
vector9:
pushl $0
80106303: 6a 00 push $0x0
pushl $9
80106305: 6a 09 push $0x9
jmp alltraps
80106307: e9 51 fa ff ff jmp 80105d5d <alltraps>
8010630c <vector10>:
.globl vector10
vector10:
pushl $10
8010630c: 6a 0a push $0xa
jmp alltraps
8010630e: e9 4a fa ff ff jmp 80105d5d <alltraps>
80106313 <vector11>:
.globl vector11
vector11:
pushl $11
80106313: 6a 0b push $0xb
jmp alltraps
80106315: e9 43 fa ff ff jmp 80105d5d <alltraps>
8010631a <vector12>:
.globl vector12
vector12:
pushl $12
8010631a: 6a 0c push $0xc
jmp alltraps
8010631c: e9 3c fa ff ff jmp 80105d5d <alltraps>
80106321 <vector13>:
.globl vector13
vector13:
pushl $13
80106321: 6a 0d push $0xd
jmp alltraps
80106323: e9 35 fa ff ff jmp 80105d5d <alltraps>
80106328 <vector14>:
.globl vector14
vector14:
pushl $14
80106328: 6a 0e push $0xe
jmp alltraps
8010632a: e9 2e fa ff ff jmp 80105d5d <alltraps>
8010632f <vector15>:
.globl vector15
vector15:
pushl $0
8010632f: 6a 00 push $0x0
pushl $15
80106331: 6a 0f push $0xf
jmp alltraps
80106333: e9 25 fa ff ff jmp 80105d5d <alltraps>
80106338 <vector16>:
.globl vector16
vector16:
pushl $0
80106338: 6a 00 push $0x0
pushl $16
8010633a: 6a 10 push $0x10
jmp alltraps
8010633c: e9 1c fa ff ff jmp 80105d5d <alltraps>
80106341 <vector17>:
.globl vector17
vector17:
pushl $17
80106341: 6a 11 push $0x11
jmp alltraps
80106343: e9 15 fa ff ff jmp 80105d5d <alltraps>
80106348 <vector18>:
.globl vector18
vector18:
pushl $0
80106348: 6a 00 push $0x0
pushl $18
8010634a: 6a 12 push $0x12
jmp alltraps
8010634c: e9 0c fa ff ff jmp 80105d5d <alltraps>
80106351 <vector19>:
.globl vector19
vector19:
pushl $0
80106351: 6a 00 push $0x0
pushl $19
80106353: 6a 13 push $0x13
jmp alltraps
80106355: e9 03 fa ff ff jmp 80105d5d <alltraps>
8010635a <vector20>:
.globl vector20
vector20:
pushl $0
8010635a: 6a 00 push $0x0
pushl $20
8010635c: 6a 14 push $0x14
jmp alltraps
8010635e: e9 fa f9 ff ff jmp 80105d5d <alltraps>
80106363 <vector21>:
.globl vector21
vector21:
pushl $0
80106363: 6a 00 push $0x0
pushl $21
80106365: 6a 15 push $0x15
jmp alltraps
80106367: e9 f1 f9 ff ff jmp 80105d5d <alltraps>
8010636c <vector22>:
.globl vector22
vector22:
pushl $0
8010636c: 6a 00 push $0x0
pushl $22
8010636e: 6a 16 push $0x16
jmp alltraps
80106370: e9 e8 f9 ff ff jmp 80105d5d <alltraps>
80106375 <vector23>:
.globl vector23
vector23:
pushl $0
80106375: 6a 00 push $0x0
pushl $23
80106377: 6a 17 push $0x17
jmp alltraps
80106379: e9 df f9 ff ff jmp 80105d5d <alltraps>
8010637e <vector24>:
.globl vector24
vector24:
pushl $0
8010637e: 6a 00 push $0x0
pushl $24
80106380: 6a 18 push $0x18
jmp alltraps
80106382: e9 d6 f9 ff ff jmp 80105d5d <alltraps>
80106387 <vector25>:
.globl vector25
vector25:
pushl $0
80106387: 6a 00 push $0x0
pushl $25
80106389: 6a 19 push $0x19
jmp alltraps
8010638b: e9 cd f9 ff ff jmp 80105d5d <alltraps>
80106390 <vector26>:
.globl vector26
vector26:
pushl $0
80106390: 6a 00 push $0x0
pushl $26
80106392: 6a 1a push $0x1a
jmp alltraps
80106394: e9 c4 f9 ff ff jmp 80105d5d <alltraps>
80106399 <vector27>:
.globl vector27
vector27:
pushl $0
80106399: 6a 00 push $0x0
pushl $27
8010639b: 6a 1b push $0x1b
jmp alltraps
8010639d: e9 bb f9 ff ff jmp 80105d5d <alltraps>
801063a2 <vector28>:
.globl vector28
vector28:
pushl $0
801063a2: 6a 00 push $0x0
pushl $28
801063a4: 6a 1c push $0x1c
jmp alltraps
801063a6: e9 b2 f9 ff ff jmp 80105d5d <alltraps>
801063ab <vector29>:
.globl vector29
vector29:
pushl $0
801063ab: 6a 00 push $0x0
pushl $29
801063ad: 6a 1d push $0x1d
jmp alltraps
801063af: e9 a9 f9 ff ff jmp 80105d5d <alltraps>
801063b4 <vector30>:
.globl vector30
vector30:
pushl $0
801063b4: 6a 00 push $0x0
pushl $30
801063b6: 6a 1e push $0x1e
jmp alltraps
801063b8: e9 a0 f9 ff ff jmp 80105d5d <alltraps>
801063bd <vector31>:
.globl vector31
vector31:
pushl $0
801063bd: 6a 00 push $0x0
pushl $31
801063bf: 6a 1f push $0x1f
jmp alltraps
801063c1: e9 97 f9 ff ff jmp 80105d5d <alltraps>
801063c6 <vector32>:
.globl vector32
vector32:
pushl $0
801063c6: 6a 00 push $0x0
pushl $32
801063c8: 6a 20 push $0x20
jmp alltraps
801063ca: e9 8e f9 ff ff jmp 80105d5d <alltraps>
801063cf <vector33>:
.globl vector33
vector33:
pushl $0
801063cf: 6a 00 push $0x0
pushl $33
801063d1: 6a 21 push $0x21
jmp alltraps
801063d3: e9 85 f9 ff ff jmp 80105d5d <alltraps>
801063d8 <vector34>:
.globl vector34
vector34:
pushl $0
801063d8: 6a 00 push $0x0
pushl $34
801063da: 6a 22 push $0x22
jmp alltraps
801063dc: e9 7c f9 ff ff jmp 80105d5d <alltraps>
801063e1 <vector35>:
.globl vector35
vector35:
pushl $0
801063e1: 6a 00 push $0x0
pushl $35
801063e3: 6a 23 push $0x23
jmp alltraps
801063e5: e9 73 f9 ff ff jmp 80105d5d <alltraps>
801063ea <vector36>:
.globl vector36
vector36:
pushl $0
801063ea: 6a 00 push $0x0
pushl $36
801063ec: 6a 24 push $0x24
jmp alltraps
801063ee: e9 6a f9 ff ff jmp 80105d5d <alltraps>
801063f3 <vector37>:
.globl vector37
vector37:
pushl $0
801063f3: 6a 00 push $0x0
pushl $37
801063f5: 6a 25 push $0x25
jmp alltraps
801063f7: e9 61 f9 ff ff jmp 80105d5d <alltraps>
801063fc <vector38>:
.globl vector38
vector38:
pushl $0
801063fc: 6a 00 push $0x0
pushl $38
801063fe: 6a 26 push $0x26
jmp alltraps
80106400: e9 58 f9 ff ff jmp 80105d5d <alltraps>
80106405 <vector39>:
.globl vector39
vector39:
pushl $0
80106405: 6a 00 push $0x0
pushl $39
80106407: 6a 27 push $0x27
jmp alltraps
80106409: e9 4f f9 ff ff jmp 80105d5d <alltraps>
8010640e <vector40>:
.globl vector40
vector40:
pushl $0
8010640e: 6a 00 push $0x0
pushl $40
80106410: 6a 28 push $0x28
jmp alltraps
80106412: e9 46 f9 ff ff jmp 80105d5d <alltraps>
80106417 <vector41>:
.globl vector41
vector41:
pushl $0
80106417: 6a 00 push $0x0
pushl $41
80106419: 6a 29 push $0x29
jmp alltraps
8010641b: e9 3d f9 ff ff jmp 80105d5d <alltraps>
80106420 <vector42>:
.globl vector42
vector42:
pushl $0
80106420: 6a 00 push $0x0
pushl $42
80106422: 6a 2a push $0x2a
jmp alltraps
80106424: e9 34 f9 ff ff jmp 80105d5d <alltraps>
80106429 <vector43>:
.globl vector43
vector43:
pushl $0
80106429: 6a 00 push $0x0
pushl $43
8010642b: 6a 2b push $0x2b
jmp alltraps
8010642d: e9 2b f9 ff ff jmp 80105d5d <alltraps>
80106432 <vector44>:
.globl vector44
vector44:
pushl $0
80106432: 6a 00 push $0x0
pushl $44
80106434: 6a 2c push $0x2c
jmp alltraps
80106436: e9 22 f9 ff ff jmp 80105d5d <alltraps>
8010643b <vector45>:
.globl vector45
vector45:
pushl $0
8010643b: 6a 00 push $0x0
pushl $45
8010643d: 6a 2d push $0x2d
jmp alltraps
8010643f: e9 19 f9 ff ff jmp 80105d5d <alltraps>
80106444 <vector46>:
.globl vector46
vector46:
pushl $0
80106444: 6a 00 push $0x0
pushl $46
80106446: 6a 2e push $0x2e
jmp alltraps
80106448: e9 10 f9 ff ff jmp 80105d5d <alltraps>
8010644d <vector47>:
.globl vector47
vector47:
pushl $0
8010644d: 6a 00 push $0x0
pushl $47
8010644f: 6a 2f push $0x2f
jmp alltraps
80106451: e9 07 f9 ff ff jmp 80105d5d <alltraps>
80106456 <vector48>:
.globl vector48
vector48:
pushl $0
80106456: 6a 00 push $0x0
pushl $48
80106458: 6a 30 push $0x30
jmp alltraps
8010645a: e9 fe f8 ff ff jmp 80105d5d <alltraps>
8010645f <vector49>:
.globl vector49
vector49:
pushl $0
8010645f: 6a 00 push $0x0
pushl $49
80106461: 6a 31 push $0x31
jmp alltraps
80106463: e9 f5 f8 ff ff jmp 80105d5d <alltraps>
80106468 <vector50>:
.globl vector50
vector50:
pushl $0
80106468: 6a 00 push $0x0
pushl $50
8010646a: 6a 32 push $0x32
jmp alltraps
8010646c: e9 ec f8 ff ff jmp 80105d5d <alltraps>
80106471 <vector51>:
.globl vector51
vector51:
pushl $0
80106471: 6a 00 push $0x0
pushl $51
80106473: 6a 33 push $0x33
jmp alltraps
80106475: e9 e3 f8 ff ff jmp 80105d5d <alltraps>
8010647a <vector52>:
.globl vector52
vector52:
pushl $0
8010647a: 6a 00 push $0x0
pushl $52
8010647c: 6a 34 push $0x34
jmp alltraps
8010647e: e9 da f8 ff ff jmp 80105d5d <alltraps>
80106483 <vector53>:
.globl vector53
vector53:
pushl $0
80106483: 6a 00 push $0x0
pushl $53
80106485: 6a 35 push $0x35
jmp alltraps
80106487: e9 d1 f8 ff ff jmp 80105d5d <alltraps>
8010648c <vector54>:
.globl vector54
vector54:
pushl $0
8010648c: 6a 00 push $0x0
pushl $54
8010648e: 6a 36 push $0x36
jmp alltraps
80106490: e9 c8 f8 ff ff jmp 80105d5d <alltraps>
80106495 <vector55>:
.globl vector55
vector55:
pushl $0
80106495: 6a 00 push $0x0
pushl $55
80106497: 6a 37 push $0x37
jmp alltraps
80106499: e9 bf f8 ff ff jmp 80105d5d <alltraps>
8010649e <vector56>:
.globl vector56
vector56:
pushl $0
8010649e: 6a 00 push $0x0
pushl $56
801064a0: 6a 38 push $0x38
jmp alltraps
801064a2: e9 b6 f8 ff ff jmp 80105d5d <alltraps>
801064a7 <vector57>:
.globl vector57
vector57:
pushl $0
801064a7: 6a 00 push $0x0
pushl $57
801064a9: 6a 39 push $0x39
jmp alltraps
801064ab: e9 ad f8 ff ff jmp 80105d5d <alltraps>
801064b0 <vector58>:
.globl vector58
vector58:
pushl $0
801064b0: 6a 00 push $0x0
pushl $58
801064b2: 6a 3a push $0x3a
jmp alltraps
801064b4: e9 a4 f8 ff ff jmp 80105d5d <alltraps>
801064b9 <vector59>:
.globl vector59
vector59:
pushl $0
801064b9: 6a 00 push $0x0
pushl $59
801064bb: 6a 3b push $0x3b
jmp alltraps
801064bd: e9 9b f8 ff ff jmp 80105d5d <alltraps>
801064c2 <vector60>:
.globl vector60
vector60:
pushl $0
801064c2: 6a 00 push $0x0
pushl $60
801064c4: 6a 3c push $0x3c
jmp alltraps
801064c6: e9 92 f8 ff ff jmp 80105d5d <alltraps>
801064cb <vector61>:
.globl vector61
vector61:
pushl $0
801064cb: 6a 00 push $0x0
pushl $61
801064cd: 6a 3d push $0x3d
jmp alltraps
801064cf: e9 89 f8 ff ff jmp 80105d5d <alltraps>
801064d4 <vector62>:
.globl vector62
vector62:
pushl $0
801064d4: 6a 00 push $0x0
pushl $62
801064d6: 6a 3e push $0x3e
jmp alltraps
801064d8: e9 80 f8 ff ff jmp 80105d5d <alltraps>
801064dd <vector63>:
.globl vector63
vector63:
pushl $0
801064dd: 6a 00 push $0x0
pushl $63
801064df: 6a 3f push $0x3f
jmp alltraps
801064e1: e9 77 f8 ff ff jmp 80105d5d <alltraps>
801064e6 <vector64>:
.globl vector64
vector64:
pushl $0
801064e6: 6a 00 push $0x0
pushl $64
801064e8: 6a 40 push $0x40
jmp alltraps
801064ea: e9 6e f8 ff ff jmp 80105d5d <alltraps>
801064ef <vector65>:
.globl vector65
vector65:
pushl $0
801064ef: 6a 00 push $0x0
pushl $65
801064f1: 6a 41 push $0x41
jmp alltraps
801064f3: e9 65 f8 ff ff jmp 80105d5d <alltraps>
801064f8 <vector66>:
.globl vector66
vector66:
pushl $0
801064f8: 6a 00 push $0x0
pushl $66
801064fa: 6a 42 push $0x42
jmp alltraps
801064fc: e9 5c f8 ff ff jmp 80105d5d <alltraps>
80106501 <vector67>:
.globl vector67
vector67:
pushl $0
80106501: 6a 00 push $0x0
pushl $67
80106503: 6a 43 push $0x43
jmp alltraps
80106505: e9 53 f8 ff ff jmp 80105d5d <alltraps>
8010650a <vector68>:
.globl vector68
vector68:
pushl $0
8010650a: 6a 00 push $0x0
pushl $68
8010650c: 6a 44 push $0x44
jmp alltraps
8010650e: e9 4a f8 ff ff jmp 80105d5d <alltraps>
80106513 <vector69>:
.globl vector69
vector69:
pushl $0
80106513: 6a 00 push $0x0
pushl $69
80106515: 6a 45 push $0x45
jmp alltraps
80106517: e9 41 f8 ff ff jmp 80105d5d <alltraps>
8010651c <vector70>:
.globl vector70
vector70:
pushl $0
8010651c: 6a 00 push $0x0
pushl $70
8010651e: 6a 46 push $0x46
jmp alltraps
80106520: e9 38 f8 ff ff jmp 80105d5d <alltraps>
80106525 <vector71>:
.globl vector71
vector71:
pushl $0
80106525: 6a 00 push $0x0
pushl $71
80106527: 6a 47 push $0x47
jmp alltraps
80106529: e9 2f f8 ff ff jmp 80105d5d <alltraps>
8010652e <vector72>:
.globl vector72
vector72:
pushl $0
8010652e: 6a 00 push $0x0
pushl $72
80106530: 6a 48 push $0x48
jmp alltraps
80106532: e9 26 f8 ff ff jmp 80105d5d <alltraps>
80106537 <vector73>:
.globl vector73
vector73:
pushl $0
80106537: 6a 00 push $0x0
pushl $73
80106539: 6a 49 push $0x49
jmp alltraps
8010653b: e9 1d f8 ff ff jmp 80105d5d <alltraps>
80106540 <vector74>:
.globl vector74
vector74:
pushl $0
80106540: 6a 00 push $0x0
pushl $74
80106542: 6a 4a push $0x4a
jmp alltraps
80106544: e9 14 f8 ff ff jmp 80105d5d <alltraps>
80106549 <vector75>:
.globl vector75
vector75:
pushl $0
80106549: 6a 00 push $0x0
pushl $75
8010654b: 6a 4b push $0x4b
jmp alltraps
8010654d: e9 0b f8 ff ff jmp 80105d5d <alltraps>
80106552 <vector76>:
.globl vector76
vector76:
pushl $0
80106552: 6a 00 push $0x0
pushl $76
80106554: 6a 4c push $0x4c
jmp alltraps
80106556: e9 02 f8 ff ff jmp 80105d5d <alltraps>
8010655b <vector77>:
.globl vector77
vector77:
pushl $0
8010655b: 6a 00 push $0x0
pushl $77
8010655d: 6a 4d push $0x4d
jmp alltraps
8010655f: e9 f9 f7 ff ff jmp 80105d5d <alltraps>
80106564 <vector78>:
.globl vector78
vector78:
pushl $0
80106564: 6a 00 push $0x0
pushl $78
80106566: 6a 4e push $0x4e
jmp alltraps
80106568: e9 f0 f7 ff ff jmp 80105d5d <alltraps>
8010656d <vector79>:
.globl vector79
vector79:
pushl $0
8010656d: 6a 00 push $0x0
pushl $79
8010656f: 6a 4f push $0x4f
jmp alltraps
80106571: e9 e7 f7 ff ff jmp 80105d5d <alltraps>
80106576 <vector80>:
.globl vector80
vector80:
pushl $0
80106576: 6a 00 push $0x0
pushl $80
80106578: 6a 50 push $0x50
jmp alltraps
8010657a: e9 de f7 ff ff jmp 80105d5d <alltraps>
8010657f <vector81>:
.globl vector81
vector81:
pushl $0
8010657f: 6a 00 push $0x0
pushl $81
80106581: 6a 51 push $0x51
jmp alltraps
80106583: e9 d5 f7 ff ff jmp 80105d5d <alltraps>
80106588 <vector82>:
.globl vector82
vector82:
pushl $0
80106588: 6a 00 push $0x0
pushl $82
8010658a: 6a 52 push $0x52
jmp alltraps
8010658c: e9 cc f7 ff ff jmp 80105d5d <alltraps>
80106591 <vector83>:
.globl vector83
vector83:
pushl $0
80106591: 6a 00 push $0x0
pushl $83
80106593: 6a 53 push $0x53
jmp alltraps
80106595: e9 c3 f7 ff ff jmp 80105d5d <alltraps>
8010659a <vector84>:
.globl vector84
vector84:
pushl $0
8010659a: 6a 00 push $0x0
pushl $84
8010659c: 6a 54 push $0x54
jmp alltraps
8010659e: e9 ba f7 ff ff jmp 80105d5d <alltraps>
801065a3 <vector85>:
.globl vector85
vector85:
pushl $0
801065a3: 6a 00 push $0x0
pushl $85
801065a5: 6a 55 push $0x55
jmp alltraps
801065a7: e9 b1 f7 ff ff jmp 80105d5d <alltraps>
801065ac <vector86>:
.globl vector86
vector86:
pushl $0
801065ac: 6a 00 push $0x0
pushl $86
801065ae: 6a 56 push $0x56
jmp alltraps
801065b0: e9 a8 f7 ff ff jmp 80105d5d <alltraps>
801065b5 <vector87>:
.globl vector87
vector87:
pushl $0
801065b5: 6a 00 push $0x0
pushl $87
801065b7: 6a 57 push $0x57
jmp alltraps
801065b9: e9 9f f7 ff ff jmp 80105d5d <alltraps>
801065be <vector88>:
.globl vector88
vector88:
pushl $0
801065be: 6a 00 push $0x0
pushl $88
801065c0: 6a 58 push $0x58
jmp alltraps
801065c2: e9 96 f7 ff ff jmp 80105d5d <alltraps>
801065c7 <vector89>:
.globl vector89
vector89:
pushl $0
801065c7: 6a 00 push $0x0
pushl $89
801065c9: 6a 59 push $0x59
jmp alltraps
801065cb: e9 8d f7 ff ff jmp 80105d5d <alltraps>
801065d0 <vector90>:
.globl vector90
vector90:
pushl $0
801065d0: 6a 00 push $0x0
pushl $90
801065d2: 6a 5a push $0x5a
jmp alltraps
801065d4: e9 84 f7 ff ff jmp 80105d5d <alltraps>
801065d9 <vector91>:
.globl vector91
vector91:
pushl $0
801065d9: 6a 00 push $0x0
pushl $91
801065db: 6a 5b push $0x5b
jmp alltraps
801065dd: e9 7b f7 ff ff jmp 80105d5d <alltraps>
801065e2 <vector92>:
.globl vector92
vector92:
pushl $0
801065e2: 6a 00 push $0x0
pushl $92
801065e4: 6a 5c push $0x5c
jmp alltraps
801065e6: e9 72 f7 ff ff jmp 80105d5d <alltraps>
801065eb <vector93>:
.globl vector93
vector93:
pushl $0
801065eb: 6a 00 push $0x0
pushl $93
801065ed: 6a 5d push $0x5d
jmp alltraps
801065ef: e9 69 f7 ff ff jmp 80105d5d <alltraps>
801065f4 <vector94>:
.globl vector94
vector94:
pushl $0
801065f4: 6a 00 push $0x0
pushl $94
801065f6: 6a 5e push $0x5e
jmp alltraps
801065f8: e9 60 f7 ff ff jmp 80105d5d <alltraps>
801065fd <vector95>:
.globl vector95
vector95:
pushl $0
801065fd: 6a 00 push $0x0
pushl $95
801065ff: 6a 5f push $0x5f
jmp alltraps
80106601: e9 57 f7 ff ff jmp 80105d5d <alltraps>
80106606 <vector96>:
.globl vector96
vector96:
pushl $0
80106606: 6a 00 push $0x0
pushl $96
80106608: 6a 60 push $0x60
jmp alltraps
8010660a: e9 4e f7 ff ff jmp 80105d5d <alltraps>
8010660f <vector97>:
.globl vector97
vector97:
pushl $0
8010660f: 6a 00 push $0x0
pushl $97
80106611: 6a 61 push $0x61
jmp alltraps
80106613: e9 45 f7 ff ff jmp 80105d5d <alltraps>
80106618 <vector98>:
.globl vector98
vector98:
pushl $0
80106618: 6a 00 push $0x0
pushl $98
8010661a: 6a 62 push $0x62
jmp alltraps
8010661c: e9 3c f7 ff ff jmp 80105d5d <alltraps>
80106621 <vector99>:
.globl vector99
vector99:
pushl $0
80106621: 6a 00 push $0x0
pushl $99
80106623: 6a 63 push $0x63
jmp alltraps
80106625: e9 33 f7 ff ff jmp 80105d5d <alltraps>
8010662a <vector100>:
.globl vector100
vector100:
pushl $0
8010662a: 6a 00 push $0x0
pushl $100
8010662c: 6a 64 push $0x64
jmp alltraps
8010662e: e9 2a f7 ff ff jmp 80105d5d <alltraps>
80106633 <vector101>:
.globl vector101
vector101:
pushl $0
80106633: 6a 00 push $0x0
pushl $101
80106635: 6a 65 push $0x65
jmp alltraps
80106637: e9 21 f7 ff ff jmp 80105d5d <alltraps>
8010663c <vector102>:
.globl vector102
vector102:
pushl $0
8010663c: 6a 00 push $0x0
pushl $102
8010663e: 6a 66 push $0x66
jmp alltraps
80106640: e9 18 f7 ff ff jmp 80105d5d <alltraps>
80106645 <vector103>:
.globl vector103
vector103:
pushl $0
80106645: 6a 00 push $0x0
pushl $103
80106647: 6a 67 push $0x67
jmp alltraps
80106649: e9 0f f7 ff ff jmp 80105d5d <alltraps>
8010664e <vector104>:
.globl vector104
vector104:
pushl $0
8010664e: 6a 00 push $0x0
pushl $104
80106650: 6a 68 push $0x68
jmp alltraps
80106652: e9 06 f7 ff ff jmp 80105d5d <alltraps>
80106657 <vector105>:
.globl vector105
vector105:
pushl $0
80106657: 6a 00 push $0x0
pushl $105
80106659: 6a 69 push $0x69
jmp alltraps
8010665b: e9 fd f6 ff ff jmp 80105d5d <alltraps>
80106660 <vector106>:
.globl vector106
vector106:
pushl $0
80106660: 6a 00 push $0x0
pushl $106
80106662: 6a 6a push $0x6a
jmp alltraps
80106664: e9 f4 f6 ff ff jmp 80105d5d <alltraps>
80106669 <vector107>:
.globl vector107
vector107:
pushl $0
80106669: 6a 00 push $0x0
pushl $107
8010666b: 6a 6b push $0x6b
jmp alltraps
8010666d: e9 eb f6 ff ff jmp 80105d5d <alltraps>
80106672 <vector108>:
.globl vector108
vector108:
pushl $0
80106672: 6a 00 push $0x0
pushl $108
80106674: 6a 6c push $0x6c
jmp alltraps
80106676: e9 e2 f6 ff ff jmp 80105d5d <alltraps>
8010667b <vector109>:
.globl vector109
vector109:
pushl $0
8010667b: 6a 00 push $0x0
pushl $109
8010667d: 6a 6d push $0x6d
jmp alltraps
8010667f: e9 d9 f6 ff ff jmp 80105d5d <alltraps>
80106684 <vector110>:
.globl vector110
vector110:
pushl $0
80106684: 6a 00 push $0x0
pushl $110
80106686: 6a 6e push $0x6e
jmp alltraps
80106688: e9 d0 f6 ff ff jmp 80105d5d <alltraps>
8010668d <vector111>:
.globl vector111
vector111:
pushl $0
8010668d: 6a 00 push $0x0
pushl $111
8010668f: 6a 6f push $0x6f
jmp alltraps
80106691: e9 c7 f6 ff ff jmp 80105d5d <alltraps>
80106696 <vector112>:
.globl vector112
vector112:
pushl $0
80106696: 6a 00 push $0x0
pushl $112
80106698: 6a 70 push $0x70
jmp alltraps
8010669a: e9 be f6 ff ff jmp 80105d5d <alltraps>
8010669f <vector113>:
.globl vector113
vector113:
pushl $0
8010669f: 6a 00 push $0x0
pushl $113
801066a1: 6a 71 push $0x71
jmp alltraps
801066a3: e9 b5 f6 ff ff jmp 80105d5d <alltraps>
801066a8 <vector114>:
.globl vector114
vector114:
pushl $0
801066a8: 6a 00 push $0x0
pushl $114
801066aa: 6a 72 push $0x72
jmp alltraps
801066ac: e9 ac f6 ff ff jmp 80105d5d <alltraps>
801066b1 <vector115>:
.globl vector115
vector115:
pushl $0
801066b1: 6a 00 push $0x0
pushl $115
801066b3: 6a 73 push $0x73
jmp alltraps
801066b5: e9 a3 f6 ff ff jmp 80105d5d <alltraps>
801066ba <vector116>:
.globl vector116
vector116:
pushl $0
801066ba: 6a 00 push $0x0
pushl $116
801066bc: 6a 74 push $0x74
jmp alltraps
801066be: e9 9a f6 ff ff jmp 80105d5d <alltraps>
801066c3 <vector117>:
.globl vector117
vector117:
pushl $0
801066c3: 6a 00 push $0x0
pushl $117
801066c5: 6a 75 push $0x75
jmp alltraps
801066c7: e9 91 f6 ff ff jmp 80105d5d <alltraps>
801066cc <vector118>:
.globl vector118
vector118:
pushl $0
801066cc: 6a 00 push $0x0
pushl $118
801066ce: 6a 76 push $0x76
jmp alltraps
801066d0: e9 88 f6 ff ff jmp 80105d5d <alltraps>
801066d5 <vector119>:
.globl vector119
vector119:
pushl $0
801066d5: 6a 00 push $0x0
pushl $119
801066d7: 6a 77 push $0x77
jmp alltraps
801066d9: e9 7f f6 ff ff jmp 80105d5d <alltraps>
801066de <vector120>:
.globl vector120
vector120:
pushl $0
801066de: 6a 00 push $0x0
pushl $120
801066e0: 6a 78 push $0x78
jmp alltraps
801066e2: e9 76 f6 ff ff jmp 80105d5d <alltraps>
801066e7 <vector121>:
.globl vector121
vector121:
pushl $0
801066e7: 6a 00 push $0x0
pushl $121
801066e9: 6a 79 push $0x79
jmp alltraps
801066eb: e9 6d f6 ff ff jmp 80105d5d <alltraps>
801066f0 <vector122>:
.globl vector122
vector122:
pushl $0
801066f0: 6a 00 push $0x0
pushl $122
801066f2: 6a 7a push $0x7a
jmp alltraps
801066f4: e9 64 f6 ff ff jmp 80105d5d <alltraps>
801066f9 <vector123>:
.globl vector123
vector123:
pushl $0
801066f9: 6a 00 push $0x0
pushl $123
801066fb: 6a 7b push $0x7b
jmp alltraps
801066fd: e9 5b f6 ff ff jmp 80105d5d <alltraps>
80106702 <vector124>:
.globl vector124
vector124:
pushl $0
80106702: 6a 00 push $0x0
pushl $124
80106704: 6a 7c push $0x7c
jmp alltraps
80106706: e9 52 f6 ff ff jmp 80105d5d <alltraps>
8010670b <vector125>:
.globl vector125
vector125:
pushl $0
8010670b: 6a 00 push $0x0
pushl $125
8010670d: 6a 7d push $0x7d
jmp alltraps
8010670f: e9 49 f6 ff ff jmp 80105d5d <alltraps>
80106714 <vector126>:
.globl vector126
vector126:
pushl $0
80106714: 6a 00 push $0x0
pushl $126
80106716: 6a 7e push $0x7e
jmp alltraps
80106718: e9 40 f6 ff ff jmp 80105d5d <alltraps>
8010671d <vector127>:
.globl vector127
vector127:
pushl $0
8010671d: 6a 00 push $0x0
pushl $127
8010671f: 6a 7f push $0x7f
jmp alltraps
80106721: e9 37 f6 ff ff jmp 80105d5d <alltraps>
80106726 <vector128>:
.globl vector128
vector128:
pushl $0
80106726: 6a 00 push $0x0
pushl $128
80106728: 68 80 00 00 00 push $0x80
jmp alltraps
8010672d: e9 2b f6 ff ff jmp 80105d5d <alltraps>
80106732 <vector129>:
.globl vector129
vector129:
pushl $0
80106732: 6a 00 push $0x0
pushl $129
80106734: 68 81 00 00 00 push $0x81
jmp alltraps
80106739: e9 1f f6 ff ff jmp 80105d5d <alltraps>
8010673e <vector130>:
.globl vector130
vector130:
pushl $0
8010673e: 6a 00 push $0x0
pushl $130
80106740: 68 82 00 00 00 push $0x82
jmp alltraps
80106745: e9 13 f6 ff ff jmp 80105d5d <alltraps>
8010674a <vector131>:
.globl vector131
vector131:
pushl $0
8010674a: 6a 00 push $0x0
pushl $131
8010674c: 68 83 00 00 00 push $0x83
jmp alltraps
80106751: e9 07 f6 ff ff jmp 80105d5d <alltraps>
80106756 <vector132>:
.globl vector132
vector132:
pushl $0
80106756: 6a 00 push $0x0
pushl $132
80106758: 68 84 00 00 00 push $0x84
jmp alltraps
8010675d: e9 fb f5 ff ff jmp 80105d5d <alltraps>
80106762 <vector133>:
.globl vector133
vector133:
pushl $0
80106762: 6a 00 push $0x0
pushl $133
80106764: 68 85 00 00 00 push $0x85
jmp alltraps
80106769: e9 ef f5 ff ff jmp 80105d5d <alltraps>
8010676e <vector134>:
.globl vector134
vector134:
pushl $0
8010676e: 6a 00 push $0x0
pushl $134
80106770: 68 86 00 00 00 push $0x86
jmp alltraps
80106775: e9 e3 f5 ff ff jmp 80105d5d <alltraps>
8010677a <vector135>:
.globl vector135
vector135:
pushl $0
8010677a: 6a 00 push $0x0
pushl $135
8010677c: 68 87 00 00 00 push $0x87
jmp alltraps
80106781: e9 d7 f5 ff ff jmp 80105d5d <alltraps>
80106786 <vector136>:
.globl vector136
vector136:
pushl $0
80106786: 6a 00 push $0x0
pushl $136
80106788: 68 88 00 00 00 push $0x88
jmp alltraps
8010678d: e9 cb f5 ff ff jmp 80105d5d <alltraps>
80106792 <vector137>:
.globl vector137
vector137:
pushl $0
80106792: 6a 00 push $0x0
pushl $137
80106794: 68 89 00 00 00 push $0x89
jmp alltraps
80106799: e9 bf f5 ff ff jmp 80105d5d <alltraps>
8010679e <vector138>:
.globl vector138
vector138:
pushl $0
8010679e: 6a 00 push $0x0
pushl $138
801067a0: 68 8a 00 00 00 push $0x8a
jmp alltraps
801067a5: e9 b3 f5 ff ff jmp 80105d5d <alltraps>
801067aa <vector139>:
.globl vector139
vector139:
pushl $0
801067aa: 6a 00 push $0x0
pushl $139
801067ac: 68 8b 00 00 00 push $0x8b
jmp alltraps
801067b1: e9 a7 f5 ff ff jmp 80105d5d <alltraps>
801067b6 <vector140>:
.globl vector140
vector140:
pushl $0
801067b6: 6a 00 push $0x0
pushl $140
801067b8: 68 8c 00 00 00 push $0x8c
jmp alltraps
801067bd: e9 9b f5 ff ff jmp 80105d5d <alltraps>
801067c2 <vector141>:
.globl vector141
vector141:
pushl $0
801067c2: 6a 00 push $0x0
pushl $141
801067c4: 68 8d 00 00 00 push $0x8d
jmp alltraps
801067c9: e9 8f f5 ff ff jmp 80105d5d <alltraps>
801067ce <vector142>:
.globl vector142
vector142:
pushl $0
801067ce: 6a 00 push $0x0
pushl $142
801067d0: 68 8e 00 00 00 push $0x8e
jmp alltraps
801067d5: e9 83 f5 ff ff jmp 80105d5d <alltraps>
801067da <vector143>:
.globl vector143
vector143:
pushl $0
801067da: 6a 00 push $0x0
pushl $143
801067dc: 68 8f 00 00 00 push $0x8f
jmp alltraps
801067e1: e9 77 f5 ff ff jmp 80105d5d <alltraps>
801067e6 <vector144>:
.globl vector144
vector144:
pushl $0
801067e6: 6a 00 push $0x0
pushl $144
801067e8: 68 90 00 00 00 push $0x90
jmp alltraps
801067ed: e9 6b f5 ff ff jmp 80105d5d <alltraps>
801067f2 <vector145>:
.globl vector145
vector145:
pushl $0
801067f2: 6a 00 push $0x0
pushl $145
801067f4: 68 91 00 00 00 push $0x91
jmp alltraps
801067f9: e9 5f f5 ff ff jmp 80105d5d <alltraps>
801067fe <vector146>:
.globl vector146
vector146:
pushl $0
801067fe: 6a 00 push $0x0
pushl $146
80106800: 68 92 00 00 00 push $0x92
jmp alltraps
80106805: e9 53 f5 ff ff jmp 80105d5d <alltraps>
8010680a <vector147>:
.globl vector147
vector147:
pushl $0
8010680a: 6a 00 push $0x0
pushl $147
8010680c: 68 93 00 00 00 push $0x93
jmp alltraps
80106811: e9 47 f5 ff ff jmp 80105d5d <alltraps>
80106816 <vector148>:
.globl vector148
vector148:
pushl $0
80106816: 6a 00 push $0x0
pushl $148
80106818: 68 94 00 00 00 push $0x94
jmp alltraps
8010681d: e9 3b f5 ff ff jmp 80105d5d <alltraps>
80106822 <vector149>:
.globl vector149
vector149:
pushl $0
80106822: 6a 00 push $0x0
pushl $149
80106824: 68 95 00 00 00 push $0x95
jmp alltraps
80106829: e9 2f f5 ff ff jmp 80105d5d <alltraps>
8010682e <vector150>:
.globl vector150
vector150:
pushl $0
8010682e: 6a 00 push $0x0
pushl $150
80106830: 68 96 00 00 00 push $0x96
jmp alltraps
80106835: e9 23 f5 ff ff jmp 80105d5d <alltraps>
8010683a <vector151>:
.globl vector151
vector151:
pushl $0
8010683a: 6a 00 push $0x0
pushl $151
8010683c: 68 97 00 00 00 push $0x97
jmp alltraps
80106841: e9 17 f5 ff ff jmp 80105d5d <alltraps>
80106846 <vector152>:
.globl vector152
vector152:
pushl $0
80106846: 6a 00 push $0x0
pushl $152
80106848: 68 98 00 00 00 push $0x98
jmp alltraps
8010684d: e9 0b f5 ff ff jmp 80105d5d <alltraps>
80106852 <vector153>:
.globl vector153
vector153:
pushl $0
80106852: 6a 00 push $0x0
pushl $153
80106854: 68 99 00 00 00 push $0x99
jmp alltraps
80106859: e9 ff f4 ff ff jmp 80105d5d <alltraps>
8010685e <vector154>:
.globl vector154
vector154:
pushl $0
8010685e: 6a 00 push $0x0
pushl $154
80106860: 68 9a 00 00 00 push $0x9a
jmp alltraps
80106865: e9 f3 f4 ff ff jmp 80105d5d <alltraps>
8010686a <vector155>:
.globl vector155
vector155:
pushl $0
8010686a: 6a 00 push $0x0
pushl $155
8010686c: 68 9b 00 00 00 push $0x9b
jmp alltraps
80106871: e9 e7 f4 ff ff jmp 80105d5d <alltraps>
80106876 <vector156>:
.globl vector156
vector156:
pushl $0
80106876: 6a 00 push $0x0
pushl $156
80106878: 68 9c 00 00 00 push $0x9c
jmp alltraps
8010687d: e9 db f4 ff ff jmp 80105d5d <alltraps>
80106882 <vector157>:
.globl vector157
vector157:
pushl $0
80106882: 6a 00 push $0x0
pushl $157
80106884: 68 9d 00 00 00 push $0x9d
jmp alltraps
80106889: e9 cf f4 ff ff jmp 80105d5d <alltraps>
8010688e <vector158>:
.globl vector158
vector158:
pushl $0
8010688e: 6a 00 push $0x0
pushl $158
80106890: 68 9e 00 00 00 push $0x9e
jmp alltraps
80106895: e9 c3 f4 ff ff jmp 80105d5d <alltraps>
8010689a <vector159>:
.globl vector159
vector159:
pushl $0
8010689a: 6a 00 push $0x0
pushl $159
8010689c: 68 9f 00 00 00 push $0x9f
jmp alltraps
801068a1: e9 b7 f4 ff ff jmp 80105d5d <alltraps>
801068a6 <vector160>:
.globl vector160
vector160:
pushl $0
801068a6: 6a 00 push $0x0
pushl $160
801068a8: 68 a0 00 00 00 push $0xa0
jmp alltraps
801068ad: e9 ab f4 ff ff jmp 80105d5d <alltraps>
801068b2 <vector161>:
.globl vector161
vector161:
pushl $0
801068b2: 6a 00 push $0x0
pushl $161
801068b4: 68 a1 00 00 00 push $0xa1
jmp alltraps
801068b9: e9 9f f4 ff ff jmp 80105d5d <alltraps>
801068be <vector162>:
.globl vector162
vector162:
pushl $0
801068be: 6a 00 push $0x0
pushl $162
801068c0: 68 a2 00 00 00 push $0xa2
jmp alltraps
801068c5: e9 93 f4 ff ff jmp 80105d5d <alltraps>
801068ca <vector163>:
.globl vector163
vector163:
pushl $0
801068ca: 6a 00 push $0x0
pushl $163
801068cc: 68 a3 00 00 00 push $0xa3
jmp alltraps
801068d1: e9 87 f4 ff ff jmp 80105d5d <alltraps>
801068d6 <vector164>:
.globl vector164
vector164:
pushl $0
801068d6: 6a 00 push $0x0
pushl $164
801068d8: 68 a4 00 00 00 push $0xa4
jmp alltraps
801068dd: e9 7b f4 ff ff jmp 80105d5d <alltraps>
801068e2 <vector165>:
.globl vector165
vector165:
pushl $0
801068e2: 6a 00 push $0x0
pushl $165
801068e4: 68 a5 00 00 00 push $0xa5
jmp alltraps
801068e9: e9 6f f4 ff ff jmp 80105d5d <alltraps>
801068ee <vector166>:
.globl vector166
vector166:
pushl $0
801068ee: 6a 00 push $0x0
pushl $166
801068f0: 68 a6 00 00 00 push $0xa6
jmp alltraps
801068f5: e9 63 f4 ff ff jmp 80105d5d <alltraps>
801068fa <vector167>:
.globl vector167
vector167:
pushl $0
801068fa: 6a 00 push $0x0
pushl $167
801068fc: 68 a7 00 00 00 push $0xa7
jmp alltraps
80106901: e9 57 f4 ff ff jmp 80105d5d <alltraps>
80106906 <vector168>:
.globl vector168
vector168:
pushl $0
80106906: 6a 00 push $0x0
pushl $168
80106908: 68 a8 00 00 00 push $0xa8
jmp alltraps
8010690d: e9 4b f4 ff ff jmp 80105d5d <alltraps>
80106912 <vector169>:
.globl vector169
vector169:
pushl $0
80106912: 6a 00 push $0x0
pushl $169
80106914: 68 a9 00 00 00 push $0xa9
jmp alltraps
80106919: e9 3f f4 ff ff jmp 80105d5d <alltraps>
8010691e <vector170>:
.globl vector170
vector170:
pushl $0
8010691e: 6a 00 push $0x0
pushl $170
80106920: 68 aa 00 00 00 push $0xaa
jmp alltraps
80106925: e9 33 f4 ff ff jmp 80105d5d <alltraps>
8010692a <vector171>:
.globl vector171
vector171:
pushl $0
8010692a: 6a 00 push $0x0
pushl $171
8010692c: 68 ab 00 00 00 push $0xab
jmp alltraps
80106931: e9 27 f4 ff ff jmp 80105d5d <alltraps>
80106936 <vector172>:
.globl vector172
vector172:
pushl $0
80106936: 6a 00 push $0x0
pushl $172
80106938: 68 ac 00 00 00 push $0xac
jmp alltraps
8010693d: e9 1b f4 ff ff jmp 80105d5d <alltraps>
80106942 <vector173>:
.globl vector173
vector173:
pushl $0
80106942: 6a 00 push $0x0
pushl $173
80106944: 68 ad 00 00 00 push $0xad
jmp alltraps
80106949: e9 0f f4 ff ff jmp 80105d5d <alltraps>
8010694e <vector174>:
.globl vector174
vector174:
pushl $0
8010694e: 6a 00 push $0x0
pushl $174
80106950: 68 ae 00 00 00 push $0xae
jmp alltraps
80106955: e9 03 f4 ff ff jmp 80105d5d <alltraps>
8010695a <vector175>:
.globl vector175
vector175:
pushl $0
8010695a: 6a 00 push $0x0
pushl $175
8010695c: 68 af 00 00 00 push $0xaf
jmp alltraps
80106961: e9 f7 f3 ff ff jmp 80105d5d <alltraps>
80106966 <vector176>:
.globl vector176
vector176:
pushl $0
80106966: 6a 00 push $0x0
pushl $176
80106968: 68 b0 00 00 00 push $0xb0
jmp alltraps
8010696d: e9 eb f3 ff ff jmp 80105d5d <alltraps>
80106972 <vector177>:
.globl vector177
vector177:
pushl $0
80106972: 6a 00 push $0x0
pushl $177
80106974: 68 b1 00 00 00 push $0xb1
jmp alltraps
80106979: e9 df f3 ff ff jmp 80105d5d <alltraps>
8010697e <vector178>:
.globl vector178
vector178:
pushl $0
8010697e: 6a 00 push $0x0
pushl $178
80106980: 68 b2 00 00 00 push $0xb2
jmp alltraps
80106985: e9 d3 f3 ff ff jmp 80105d5d <alltraps>
8010698a <vector179>:
.globl vector179
vector179:
pushl $0
8010698a: 6a 00 push $0x0
pushl $179
8010698c: 68 b3 00 00 00 push $0xb3
jmp alltraps
80106991: e9 c7 f3 ff ff jmp 80105d5d <alltraps>
80106996 <vector180>:
.globl vector180
vector180:
pushl $0
80106996: 6a 00 push $0x0
pushl $180
80106998: 68 b4 00 00 00 push $0xb4
jmp alltraps
8010699d: e9 bb f3 ff ff jmp 80105d5d <alltraps>
801069a2 <vector181>:
.globl vector181
vector181:
pushl $0
801069a2: 6a 00 push $0x0
pushl $181
801069a4: 68 b5 00 00 00 push $0xb5
jmp alltraps
801069a9: e9 af f3 ff ff jmp 80105d5d <alltraps>
801069ae <vector182>:
.globl vector182
vector182:
pushl $0
801069ae: 6a 00 push $0x0
pushl $182
801069b0: 68 b6 00 00 00 push $0xb6
jmp alltraps
801069b5: e9 a3 f3 ff ff jmp 80105d5d <alltraps>
801069ba <vector183>:
.globl vector183
vector183:
pushl $0
801069ba: 6a 00 push $0x0
pushl $183
801069bc: 68 b7 00 00 00 push $0xb7
jmp alltraps
801069c1: e9 97 f3 ff ff jmp 80105d5d <alltraps>
801069c6 <vector184>:
.globl vector184
vector184:
pushl $0
801069c6: 6a 00 push $0x0
pushl $184
801069c8: 68 b8 00 00 00 push $0xb8
jmp alltraps
801069cd: e9 8b f3 ff ff jmp 80105d5d <alltraps>
801069d2 <vector185>:
.globl vector185
vector185:
pushl $0
801069d2: 6a 00 push $0x0
pushl $185
801069d4: 68 b9 00 00 00 push $0xb9
jmp alltraps
801069d9: e9 7f f3 ff ff jmp 80105d5d <alltraps>
801069de <vector186>:
.globl vector186
vector186:
pushl $0
801069de: 6a 00 push $0x0
pushl $186
801069e0: 68 ba 00 00 00 push $0xba
jmp alltraps
801069e5: e9 73 f3 ff ff jmp 80105d5d <alltraps>
801069ea <vector187>:
.globl vector187
vector187:
pushl $0
801069ea: 6a 00 push $0x0
pushl $187
801069ec: 68 bb 00 00 00 push $0xbb
jmp alltraps
801069f1: e9 67 f3 ff ff jmp 80105d5d <alltraps>
801069f6 <vector188>:
.globl vector188
vector188:
pushl $0
801069f6: 6a 00 push $0x0
pushl $188
801069f8: 68 bc 00 00 00 push $0xbc
jmp alltraps
801069fd: e9 5b f3 ff ff jmp 80105d5d <alltraps>
80106a02 <vector189>:
.globl vector189
vector189:
pushl $0
80106a02: 6a 00 push $0x0
pushl $189
80106a04: 68 bd 00 00 00 push $0xbd
jmp alltraps
80106a09: e9 4f f3 ff ff jmp 80105d5d <alltraps>
80106a0e <vector190>:
.globl vector190
vector190:
pushl $0
80106a0e: 6a 00 push $0x0
pushl $190
80106a10: 68 be 00 00 00 push $0xbe
jmp alltraps
80106a15: e9 43 f3 ff ff jmp 80105d5d <alltraps>
80106a1a <vector191>:
.globl vector191
vector191:
pushl $0
80106a1a: 6a 00 push $0x0
pushl $191
80106a1c: 68 bf 00 00 00 push $0xbf
jmp alltraps
80106a21: e9 37 f3 ff ff jmp 80105d5d <alltraps>
80106a26 <vector192>:
.globl vector192
vector192:
pushl $0
80106a26: 6a 00 push $0x0
pushl $192
80106a28: 68 c0 00 00 00 push $0xc0
jmp alltraps
80106a2d: e9 2b f3 ff ff jmp 80105d5d <alltraps>
80106a32 <vector193>:
.globl vector193
vector193:
pushl $0
80106a32: 6a 00 push $0x0
pushl $193
80106a34: 68 c1 00 00 00 push $0xc1
jmp alltraps
80106a39: e9 1f f3 ff ff jmp 80105d5d <alltraps>
80106a3e <vector194>:
.globl vector194
vector194:
pushl $0
80106a3e: 6a 00 push $0x0
pushl $194
80106a40: 68 c2 00 00 00 push $0xc2
jmp alltraps
80106a45: e9 13 f3 ff ff jmp 80105d5d <alltraps>
80106a4a <vector195>:
.globl vector195
vector195:
pushl $0
80106a4a: 6a 00 push $0x0
pushl $195
80106a4c: 68 c3 00 00 00 push $0xc3
jmp alltraps
80106a51: e9 07 f3 ff ff jmp 80105d5d <alltraps>
80106a56 <vector196>:
.globl vector196
vector196:
pushl $0
80106a56: 6a 00 push $0x0
pushl $196
80106a58: 68 c4 00 00 00 push $0xc4
jmp alltraps
80106a5d: e9 fb f2 ff ff jmp 80105d5d <alltraps>
80106a62 <vector197>:
.globl vector197
vector197:
pushl $0
80106a62: 6a 00 push $0x0
pushl $197
80106a64: 68 c5 00 00 00 push $0xc5
jmp alltraps
80106a69: e9 ef f2 ff ff jmp 80105d5d <alltraps>
80106a6e <vector198>:
.globl vector198
vector198:
pushl $0
80106a6e: 6a 00 push $0x0
pushl $198
80106a70: 68 c6 00 00 00 push $0xc6
jmp alltraps
80106a75: e9 e3 f2 ff ff jmp 80105d5d <alltraps>
80106a7a <vector199>:
.globl vector199
vector199:
pushl $0
80106a7a: 6a 00 push $0x0
pushl $199
80106a7c: 68 c7 00 00 00 push $0xc7
jmp alltraps
80106a81: e9 d7 f2 ff ff jmp 80105d5d <alltraps>
80106a86 <vector200>:
.globl vector200
vector200:
pushl $0
80106a86: 6a 00 push $0x0
pushl $200
80106a88: 68 c8 00 00 00 push $0xc8
jmp alltraps
80106a8d: e9 cb f2 ff ff jmp 80105d5d <alltraps>
80106a92 <vector201>:
.globl vector201
vector201:
pushl $0
80106a92: 6a 00 push $0x0
pushl $201
80106a94: 68 c9 00 00 00 push $0xc9
jmp alltraps
80106a99: e9 bf f2 ff ff jmp 80105d5d <alltraps>
80106a9e <vector202>:
.globl vector202
vector202:
pushl $0
80106a9e: 6a 00 push $0x0
pushl $202
80106aa0: 68 ca 00 00 00 push $0xca
jmp alltraps
80106aa5: e9 b3 f2 ff ff jmp 80105d5d <alltraps>
80106aaa <vector203>:
.globl vector203
vector203:
pushl $0
80106aaa: 6a 00 push $0x0
pushl $203
80106aac: 68 cb 00 00 00 push $0xcb
jmp alltraps
80106ab1: e9 a7 f2 ff ff jmp 80105d5d <alltraps>
80106ab6 <vector204>:
.globl vector204
vector204:
pushl $0
80106ab6: 6a 00 push $0x0
pushl $204
80106ab8: 68 cc 00 00 00 push $0xcc
jmp alltraps
80106abd: e9 9b f2 ff ff jmp 80105d5d <alltraps>
80106ac2 <vector205>:
.globl vector205
vector205:
pushl $0
80106ac2: 6a 00 push $0x0
pushl $205
80106ac4: 68 cd 00 00 00 push $0xcd
jmp alltraps
80106ac9: e9 8f f2 ff ff jmp 80105d5d <alltraps>
80106ace <vector206>:
.globl vector206
vector206:
pushl $0
80106ace: 6a 00 push $0x0
pushl $206
80106ad0: 68 ce 00 00 00 push $0xce
jmp alltraps
80106ad5: e9 83 f2 ff ff jmp 80105d5d <alltraps>
80106ada <vector207>:
.globl vector207
vector207:
pushl $0
80106ada: 6a 00 push $0x0
pushl $207
80106adc: 68 cf 00 00 00 push $0xcf
jmp alltraps
80106ae1: e9 77 f2 ff ff jmp 80105d5d <alltraps>
80106ae6 <vector208>:
.globl vector208
vector208:
pushl $0
80106ae6: 6a 00 push $0x0
pushl $208
80106ae8: 68 d0 00 00 00 push $0xd0
jmp alltraps
80106aed: e9 6b f2 ff ff jmp 80105d5d <alltraps>
80106af2 <vector209>:
.globl vector209
vector209:
pushl $0
80106af2: 6a 00 push $0x0
pushl $209
80106af4: 68 d1 00 00 00 push $0xd1
jmp alltraps
80106af9: e9 5f f2 ff ff jmp 80105d5d <alltraps>
80106afe <vector210>:
.globl vector210
vector210:
pushl $0
80106afe: 6a 00 push $0x0
pushl $210
80106b00: 68 d2 00 00 00 push $0xd2
jmp alltraps
80106b05: e9 53 f2 ff ff jmp 80105d5d <alltraps>
80106b0a <vector211>:
.globl vector211
vector211:
pushl $0
80106b0a: 6a 00 push $0x0
pushl $211
80106b0c: 68 d3 00 00 00 push $0xd3
jmp alltraps
80106b11: e9 47 f2 ff ff jmp 80105d5d <alltraps>
80106b16 <vector212>:
.globl vector212
vector212:
pushl $0
80106b16: 6a 00 push $0x0
pushl $212
80106b18: 68 d4 00 00 00 push $0xd4
jmp alltraps
80106b1d: e9 3b f2 ff ff jmp 80105d5d <alltraps>
80106b22 <vector213>:
.globl vector213
vector213:
pushl $0
80106b22: 6a 00 push $0x0
pushl $213
80106b24: 68 d5 00 00 00 push $0xd5
jmp alltraps
80106b29: e9 2f f2 ff ff jmp 80105d5d <alltraps>
80106b2e <vector214>:
.globl vector214
vector214:
pushl $0
80106b2e: 6a 00 push $0x0
pushl $214
80106b30: 68 d6 00 00 00 push $0xd6
jmp alltraps
80106b35: e9 23 f2 ff ff jmp 80105d5d <alltraps>
80106b3a <vector215>:
.globl vector215
vector215:
pushl $0
80106b3a: 6a 00 push $0x0
pushl $215
80106b3c: 68 d7 00 00 00 push $0xd7
jmp alltraps
80106b41: e9 17 f2 ff ff jmp 80105d5d <alltraps>
80106b46 <vector216>:
.globl vector216
vector216:
pushl $0
80106b46: 6a 00 push $0x0
pushl $216
80106b48: 68 d8 00 00 00 push $0xd8
jmp alltraps
80106b4d: e9 0b f2 ff ff jmp 80105d5d <alltraps>
80106b52 <vector217>:
.globl vector217
vector217:
pushl $0
80106b52: 6a 00 push $0x0
pushl $217
80106b54: 68 d9 00 00 00 push $0xd9
jmp alltraps
80106b59: e9 ff f1 ff ff jmp 80105d5d <alltraps>
80106b5e <vector218>:
.globl vector218
vector218:
pushl $0
80106b5e: 6a 00 push $0x0
pushl $218
80106b60: 68 da 00 00 00 push $0xda
jmp alltraps
80106b65: e9 f3 f1 ff ff jmp 80105d5d <alltraps>
80106b6a <vector219>:
.globl vector219
vector219:
pushl $0
80106b6a: 6a 00 push $0x0
pushl $219
80106b6c: 68 db 00 00 00 push $0xdb
jmp alltraps
80106b71: e9 e7 f1 ff ff jmp 80105d5d <alltraps>
80106b76 <vector220>:
.globl vector220
vector220:
pushl $0
80106b76: 6a 00 push $0x0
pushl $220
80106b78: 68 dc 00 00 00 push $0xdc
jmp alltraps
80106b7d: e9 db f1 ff ff jmp 80105d5d <alltraps>
80106b82 <vector221>:
.globl vector221
vector221:
pushl $0
80106b82: 6a 00 push $0x0
pushl $221
80106b84: 68 dd 00 00 00 push $0xdd
jmp alltraps
80106b89: e9 cf f1 ff ff jmp 80105d5d <alltraps>
80106b8e <vector222>:
.globl vector222
vector222:
pushl $0
80106b8e: 6a 00 push $0x0
pushl $222
80106b90: 68 de 00 00 00 push $0xde
jmp alltraps
80106b95: e9 c3 f1 ff ff jmp 80105d5d <alltraps>
80106b9a <vector223>:
.globl vector223
vector223:
pushl $0
80106b9a: 6a 00 push $0x0
pushl $223
80106b9c: 68 df 00 00 00 push $0xdf
jmp alltraps
80106ba1: e9 b7 f1 ff ff jmp 80105d5d <alltraps>
80106ba6 <vector224>:
.globl vector224
vector224:
pushl $0
80106ba6: 6a 00 push $0x0
pushl $224
80106ba8: 68 e0 00 00 00 push $0xe0
jmp alltraps
80106bad: e9 ab f1 ff ff jmp 80105d5d <alltraps>
80106bb2 <vector225>:
.globl vector225
vector225:
pushl $0
80106bb2: 6a 00 push $0x0
pushl $225
80106bb4: 68 e1 00 00 00 push $0xe1
jmp alltraps
80106bb9: e9 9f f1 ff ff jmp 80105d5d <alltraps>
80106bbe <vector226>:
.globl vector226
vector226:
pushl $0
80106bbe: 6a 00 push $0x0
pushl $226
80106bc0: 68 e2 00 00 00 push $0xe2
jmp alltraps
80106bc5: e9 93 f1 ff ff jmp 80105d5d <alltraps>
80106bca <vector227>:
.globl vector227
vector227:
pushl $0
80106bca: 6a 00 push $0x0
pushl $227
80106bcc: 68 e3 00 00 00 push $0xe3
jmp alltraps
80106bd1: e9 87 f1 ff ff jmp 80105d5d <alltraps>
80106bd6 <vector228>:
.globl vector228
vector228:
pushl $0
80106bd6: 6a 00 push $0x0
pushl $228
80106bd8: 68 e4 00 00 00 push $0xe4
jmp alltraps
80106bdd: e9 7b f1 ff ff jmp 80105d5d <alltraps>
80106be2 <vector229>:
.globl vector229
vector229:
pushl $0
80106be2: 6a 00 push $0x0
pushl $229
80106be4: 68 e5 00 00 00 push $0xe5
jmp alltraps
80106be9: e9 6f f1 ff ff jmp 80105d5d <alltraps>
80106bee <vector230>:
.globl vector230
vector230:
pushl $0
80106bee: 6a 00 push $0x0
pushl $230
80106bf0: 68 e6 00 00 00 push $0xe6
jmp alltraps
80106bf5: e9 63 f1 ff ff jmp 80105d5d <alltraps>
80106bfa <vector231>:
.globl vector231
vector231:
pushl $0
80106bfa: 6a 00 push $0x0
pushl $231
80106bfc: 68 e7 00 00 00 push $0xe7
jmp alltraps
80106c01: e9 57 f1 ff ff jmp 80105d5d <alltraps>
80106c06 <vector232>:
.globl vector232
vector232:
pushl $0
80106c06: 6a 00 push $0x0
pushl $232
80106c08: 68 e8 00 00 00 push $0xe8
jmp alltraps
80106c0d: e9 4b f1 ff ff jmp 80105d5d <alltraps>
80106c12 <vector233>:
.globl vector233
vector233:
pushl $0
80106c12: 6a 00 push $0x0
pushl $233
80106c14: 68 e9 00 00 00 push $0xe9
jmp alltraps
80106c19: e9 3f f1 ff ff jmp 80105d5d <alltraps>
80106c1e <vector234>:
.globl vector234
vector234:
pushl $0
80106c1e: 6a 00 push $0x0
pushl $234
80106c20: 68 ea 00 00 00 push $0xea
jmp alltraps
80106c25: e9 33 f1 ff ff jmp 80105d5d <alltraps>
80106c2a <vector235>:
.globl vector235
vector235:
pushl $0
80106c2a: 6a 00 push $0x0
pushl $235
80106c2c: 68 eb 00 00 00 push $0xeb
jmp alltraps
80106c31: e9 27 f1 ff ff jmp 80105d5d <alltraps>
80106c36 <vector236>:
.globl vector236
vector236:
pushl $0
80106c36: 6a 00 push $0x0
pushl $236
80106c38: 68 ec 00 00 00 push $0xec
jmp alltraps
80106c3d: e9 1b f1 ff ff jmp 80105d5d <alltraps>
80106c42 <vector237>:
.globl vector237
vector237:
pushl $0
80106c42: 6a 00 push $0x0
pushl $237
80106c44: 68 ed 00 00 00 push $0xed
jmp alltraps
80106c49: e9 0f f1 ff ff jmp 80105d5d <alltraps>
80106c4e <vector238>:
.globl vector238
vector238:
pushl $0
80106c4e: 6a 00 push $0x0
pushl $238
80106c50: 68 ee 00 00 00 push $0xee
jmp alltraps
80106c55: e9 03 f1 ff ff jmp 80105d5d <alltraps>
80106c5a <vector239>:
.globl vector239
vector239:
pushl $0
80106c5a: 6a 00 push $0x0
pushl $239
80106c5c: 68 ef 00 00 00 push $0xef
jmp alltraps
80106c61: e9 f7 f0 ff ff jmp 80105d5d <alltraps>
80106c66 <vector240>:
.globl vector240
vector240:
pushl $0
80106c66: 6a 00 push $0x0
pushl $240
80106c68: 68 f0 00 00 00 push $0xf0
jmp alltraps
80106c6d: e9 eb f0 ff ff jmp 80105d5d <alltraps>
80106c72 <vector241>:
.globl vector241
vector241:
pushl $0
80106c72: 6a 00 push $0x0
pushl $241
80106c74: 68 f1 00 00 00 push $0xf1
jmp alltraps
80106c79: e9 df f0 ff ff jmp 80105d5d <alltraps>
80106c7e <vector242>:
.globl vector242
vector242:
pushl $0
80106c7e: 6a 00 push $0x0
pushl $242
80106c80: 68 f2 00 00 00 push $0xf2
jmp alltraps
80106c85: e9 d3 f0 ff ff jmp 80105d5d <alltraps>
80106c8a <vector243>:
.globl vector243
vector243:
pushl $0
80106c8a: 6a 00 push $0x0
pushl $243
80106c8c: 68 f3 00 00 00 push $0xf3
jmp alltraps
80106c91: e9 c7 f0 ff ff jmp 80105d5d <alltraps>
80106c96 <vector244>:
.globl vector244
vector244:
pushl $0
80106c96: 6a 00 push $0x0
pushl $244
80106c98: 68 f4 00 00 00 push $0xf4
jmp alltraps
80106c9d: e9 bb f0 ff ff jmp 80105d5d <alltraps>
80106ca2 <vector245>:
.globl vector245
vector245:
pushl $0
80106ca2: 6a 00 push $0x0
pushl $245
80106ca4: 68 f5 00 00 00 push $0xf5
jmp alltraps
80106ca9: e9 af f0 ff ff jmp 80105d5d <alltraps>
80106cae <vector246>:
.globl vector246
vector246:
pushl $0
80106cae: 6a 00 push $0x0
pushl $246
80106cb0: 68 f6 00 00 00 push $0xf6
jmp alltraps
80106cb5: e9 a3 f0 ff ff jmp 80105d5d <alltraps>
80106cba <vector247>:
.globl vector247
vector247:
pushl $0
80106cba: 6a 00 push $0x0
pushl $247
80106cbc: 68 f7 00 00 00 push $0xf7
jmp alltraps
80106cc1: e9 97 f0 ff ff jmp 80105d5d <alltraps>
80106cc6 <vector248>:
.globl vector248
vector248:
pushl $0
80106cc6: 6a 00 push $0x0
pushl $248
80106cc8: 68 f8 00 00 00 push $0xf8
jmp alltraps
80106ccd: e9 8b f0 ff ff jmp 80105d5d <alltraps>
80106cd2 <vector249>:
.globl vector249
vector249:
pushl $0
80106cd2: 6a 00 push $0x0
pushl $249
80106cd4: 68 f9 00 00 00 push $0xf9
jmp alltraps
80106cd9: e9 7f f0 ff ff jmp 80105d5d <alltraps>
80106cde <vector250>:
.globl vector250
vector250:
pushl $0
80106cde: 6a 00 push $0x0
pushl $250
80106ce0: 68 fa 00 00 00 push $0xfa
jmp alltraps
80106ce5: e9 73 f0 ff ff jmp 80105d5d <alltraps>
80106cea <vector251>:
.globl vector251
vector251:
pushl $0
80106cea: 6a 00 push $0x0
pushl $251
80106cec: 68 fb 00 00 00 push $0xfb
jmp alltraps
80106cf1: e9 67 f0 ff ff jmp 80105d5d <alltraps>
80106cf6 <vector252>:
.globl vector252
vector252:
pushl $0
80106cf6: 6a 00 push $0x0
pushl $252
80106cf8: 68 fc 00 00 00 push $0xfc
jmp alltraps
80106cfd: e9 5b f0 ff ff jmp 80105d5d <alltraps>
80106d02 <vector253>:
.globl vector253
vector253:
pushl $0
80106d02: 6a 00 push $0x0
pushl $253
80106d04: 68 fd 00 00 00 push $0xfd
jmp alltraps
80106d09: e9 4f f0 ff ff jmp 80105d5d <alltraps>
80106d0e <vector254>:
.globl vector254
vector254:
pushl $0
80106d0e: 6a 00 push $0x0
pushl $254
80106d10: 68 fe 00 00 00 push $0xfe
jmp alltraps
80106d15: e9 43 f0 ff ff jmp 80105d5d <alltraps>
80106d1a <vector255>:
.globl vector255
vector255:
pushl $0
80106d1a: 6a 00 push $0x0
pushl $255
80106d1c: 68 ff 00 00 00 push $0xff
jmp alltraps
80106d21: e9 37 f0 ff ff jmp 80105d5d <alltraps>
80106d26: 66 90 xchg %ax,%ax
80106d28: 66 90 xchg %ax,%ax
80106d2a: 66 90 xchg %ax,%ax
80106d2c: 66 90 xchg %ax,%ax
80106d2e: 66 90 xchg %ax,%ax
80106d30 <walkpgdir>:
// Return the address of the PTE in page table pgdir
// that corresponds to virtual address va. If alloc!=0,
// create any required page table pages.
static pte_t *
walkpgdir(pde_t *pgdir, const void *va, int alloc)
{
80106d30: 55 push %ebp
80106d31: 89 e5 mov %esp,%ebp
80106d33: 57 push %edi
80106d34: 56 push %esi
80106d35: 89 d6 mov %edx,%esi
pde_t *pde;
pte_t *pgtab;
pde = &pgdir[PDX(va)];
80106d37: c1 ea 16 shr $0x16,%edx
// Return the address of the PTE in page table pgdir
// that corresponds to virtual address va. If alloc!=0,
// create any required page table pages.
static pte_t *
walkpgdir(pde_t *pgdir, const void *va, int alloc)
{
80106d3a: 53 push %ebx
pde_t *pde;
pte_t *pgtab;
pde = &pgdir[PDX(va)];
80106d3b: 8d 3c 90 lea (%eax,%edx,4),%edi
// Return the address of the PTE in page table pgdir
// that corresponds to virtual address va. If alloc!=0,
// create any required page table pages.
static pte_t *
walkpgdir(pde_t *pgdir, const void *va, int alloc)
{
80106d3e: 83 ec 1c sub $0x1c,%esp
pde_t *pde;
pte_t *pgtab;
pde = &pgdir[PDX(va)];
if(*pde & PTE_P){
80106d41: 8b 1f mov (%edi),%ebx
80106d43: f6 c3 01 test $0x1,%bl
80106d46: 74 28 je 80106d70 <walkpgdir+0x40>
pgtab = (pte_t*)P2V(PTE_ADDR(*pde));
80106d48: 81 e3 00 f0 ff ff and $0xfffff000,%ebx
80106d4e: 81 c3 00 00 00 80 add $0x80000000,%ebx
// The permissions here are overly generous, but they can
// be further restricted by the permissions in the page table
// entries, if necessary.
*pde = V2P(pgtab) | PTE_P | PTE_W | PTE_U;
}
return &pgtab[PTX(va)];
80106d54: c1 ee 0a shr $0xa,%esi
}
80106d57: 83 c4 1c add $0x1c,%esp
// The permissions here are overly generous, but they can
// be further restricted by the permissions in the page table
// entries, if necessary.
*pde = V2P(pgtab) | PTE_P | PTE_W | PTE_U;
}
return &pgtab[PTX(va)];
80106d5a: 89 f2 mov %esi,%edx
80106d5c: 81 e2 fc 0f 00 00 and $0xffc,%edx
80106d62: 8d 04 13 lea (%ebx,%edx,1),%eax
}
80106d65: 5b pop %ebx
80106d66: 5e pop %esi
80106d67: 5f pop %edi
80106d68: 5d pop %ebp
80106d69: c3 ret
80106d6a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
pde = &pgdir[PDX(va)];
if(*pde & PTE_P){
pgtab = (pte_t*)P2V(PTE_ADDR(*pde));
} else {
if(!alloc || (pgtab = (pte_t*)kalloc()) == 0)
80106d70: 85 c9 test %ecx,%ecx
80106d72: 74 34 je 80106da8 <walkpgdir+0x78>
80106d74: e8 17 b7 ff ff call 80102490 <kalloc>
80106d79: 85 c0 test %eax,%eax
80106d7b: 89 c3 mov %eax,%ebx
80106d7d: 74 29 je 80106da8 <walkpgdir+0x78>
return 0;
// Make sure all those PTE_P bits are zero.
memset(pgtab, 0, PGSIZE);
80106d7f: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp)
80106d86: 00
80106d87: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80106d8e: 00
80106d8f: 89 04 24 mov %eax,(%esp)
80106d92: e8 a9 dc ff ff call 80104a40 <memset>
// The permissions here are overly generous, but they can
// be further restricted by the permissions in the page table
// entries, if necessary.
*pde = V2P(pgtab) | PTE_P | PTE_W | PTE_U;
80106d97: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax
80106d9d: 83 c8 07 or $0x7,%eax
80106da0: 89 07 mov %eax,(%edi)
80106da2: eb b0 jmp 80106d54 <walkpgdir+0x24>
80106da4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
}
return &pgtab[PTX(va)];
}
80106da8: 83 c4 1c add $0x1c,%esp
pde = &pgdir[PDX(va)];
if(*pde & PTE_P){
pgtab = (pte_t*)P2V(PTE_ADDR(*pde));
} else {
if(!alloc || (pgtab = (pte_t*)kalloc()) == 0)
return 0;
80106dab: 31 c0 xor %eax,%eax
// be further restricted by the permissions in the page table
// entries, if necessary.
*pde = V2P(pgtab) | PTE_P | PTE_W | PTE_U;
}
return &pgtab[PTX(va)];
}
80106dad: 5b pop %ebx
80106dae: 5e pop %esi
80106daf: 5f pop %edi
80106db0: 5d pop %ebp
80106db1: c3 ret
80106db2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80106db9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80106dc0 <mappages>:
// Create PTEs for virtual addresses starting at va that refer to
// physical addresses starting at pa. va and size might not
// be page-aligned.
static int
mappages(pde_t *pgdir, void *va, uint size, uint pa, int perm)
{
80106dc0: 55 push %ebp
80106dc1: 89 e5 mov %esp,%ebp
80106dc3: 57 push %edi
80106dc4: 56 push %esi
80106dc5: 53 push %ebx
char *a, *last;
pte_t *pte;
a = (char*)PGROUNDDOWN((uint)va);
80106dc6: 89 d3 mov %edx,%ebx
// Create PTEs for virtual addresses starting at va that refer to
// physical addresses starting at pa. va and size might not
// be page-aligned.
static int
mappages(pde_t *pgdir, void *va, uint size, uint pa, int perm)
{
80106dc8: 83 ec 1c sub $0x1c,%esp
80106dcb: 8b 7d 08 mov 0x8(%ebp),%edi
char *a, *last;
pte_t *pte;
a = (char*)PGROUNDDOWN((uint)va);
80106dce: 81 e3 00 f0 ff ff and $0xfffff000,%ebx
// Create PTEs for virtual addresses starting at va that refer to
// physical addresses starting at pa. va and size might not
// be page-aligned.
static int
mappages(pde_t *pgdir, void *va, uint size, uint pa, int perm)
{
80106dd4: 89 45 e0 mov %eax,-0x20(%ebp)
char *a, *last;
pte_t *pte;
a = (char*)PGROUNDDOWN((uint)va);
last = (char*)PGROUNDDOWN(((uint)va) + size - 1);
80106dd7: 8d 44 0a ff lea -0x1(%edx,%ecx,1),%eax
80106ddb: 89 45 e4 mov %eax,-0x1c(%ebp)
for(;;){
if((pte = walkpgdir(pgdir, a, 1)) == 0)
return -1;
if(*pte & PTE_P)
panic("remap");
*pte = pa | perm | PTE_P;
80106dde: 83 4d 0c 01 orl $0x1,0xc(%ebp)
{
char *a, *last;
pte_t *pte;
a = (char*)PGROUNDDOWN((uint)va);
last = (char*)PGROUNDDOWN(((uint)va) + size - 1);
80106de2: 81 65 e4 00 f0 ff ff andl $0xfffff000,-0x1c(%ebp)
80106de9: 29 df sub %ebx,%edi
80106deb: eb 18 jmp 80106e05 <mappages+0x45>
80106ded: 8d 76 00 lea 0x0(%esi),%esi
for(;;){
if((pte = walkpgdir(pgdir, a, 1)) == 0)
return -1;
if(*pte & PTE_P)
80106df0: f6 00 01 testb $0x1,(%eax)
80106df3: 75 3d jne 80106e32 <mappages+0x72>
panic("remap");
*pte = pa | perm | PTE_P;
80106df5: 0b 75 0c or 0xc(%ebp),%esi
if(a == last)
80106df8: 3b 5d e4 cmp -0x1c(%ebp),%ebx
for(;;){
if((pte = walkpgdir(pgdir, a, 1)) == 0)
return -1;
if(*pte & PTE_P)
panic("remap");
*pte = pa | perm | PTE_P;
80106dfb: 89 30 mov %esi,(%eax)
if(a == last)
80106dfd: 74 29 je 80106e28 <mappages+0x68>
break;
a += PGSIZE;
80106dff: 81 c3 00 10 00 00 add $0x1000,%ebx
pte_t *pte;
a = (char*)PGROUNDDOWN((uint)va);
last = (char*)PGROUNDDOWN(((uint)va) + size - 1);
for(;;){
if((pte = walkpgdir(pgdir, a, 1)) == 0)
80106e05: 8b 45 e0 mov -0x20(%ebp),%eax
80106e08: b9 01 00 00 00 mov $0x1,%ecx
80106e0d: 89 da mov %ebx,%edx
80106e0f: 8d 34 3b lea (%ebx,%edi,1),%esi
80106e12: e8 19 ff ff ff call 80106d30 <walkpgdir>
80106e17: 85 c0 test %eax,%eax
80106e19: 75 d5 jne 80106df0 <mappages+0x30>
break;
a += PGSIZE;
pa += PGSIZE;
}
return 0;
}
80106e1b: 83 c4 1c add $0x1c,%esp
a = (char*)PGROUNDDOWN((uint)va);
last = (char*)PGROUNDDOWN(((uint)va) + size - 1);
for(;;){
if((pte = walkpgdir(pgdir, a, 1)) == 0)
return -1;
80106e1e: b8 ff ff ff ff mov $0xffffffff,%eax
break;
a += PGSIZE;
pa += PGSIZE;
}
return 0;
}
80106e23: 5b pop %ebx
80106e24: 5e pop %esi
80106e25: 5f pop %edi
80106e26: 5d pop %ebp
80106e27: c3 ret
80106e28: 83 c4 1c add $0x1c,%esp
if(a == last)
break;
a += PGSIZE;
pa += PGSIZE;
}
return 0;
80106e2b: 31 c0 xor %eax,%eax
}
80106e2d: 5b pop %ebx
80106e2e: 5e pop %esi
80106e2f: 5f pop %edi
80106e30: 5d pop %ebp
80106e31: c3 ret
last = (char*)PGROUNDDOWN(((uint)va) + size - 1);
for(;;){
if((pte = walkpgdir(pgdir, a, 1)) == 0)
return -1;
if(*pte & PTE_P)
panic("remap");
80106e32: c7 04 24 48 7f 10 80 movl $0x80107f48,(%esp)
80106e39: e8 f2 94 ff ff call 80100330 <panic>
80106e3e: 66 90 xchg %ax,%ax
80106e40 <deallocuvm.part.0>:
// Deallocate user pages to bring the process size from oldsz to
// newsz. oldsz and newsz need not be page-aligned, nor does newsz
// need to be less than oldsz. oldsz can be larger than the actual
// process size. Returns the new process size.
int
deallocuvm(pde_t *pgdir, uint oldsz, uint newsz)
80106e40: 55 push %ebp
80106e41: 89 e5 mov %esp,%ebp
80106e43: 57 push %edi
80106e44: 89 c7 mov %eax,%edi
80106e46: 56 push %esi
80106e47: 89 d6 mov %edx,%esi
80106e49: 53 push %ebx
uint a, pa;
if(newsz >= oldsz)
return oldsz;
a = PGROUNDUP(newsz);
80106e4a: 8d 99 ff 0f 00 00 lea 0xfff(%ecx),%ebx
// Deallocate user pages to bring the process size from oldsz to
// newsz. oldsz and newsz need not be page-aligned, nor does newsz
// need to be less than oldsz. oldsz can be larger than the actual
// process size. Returns the new process size.
int
deallocuvm(pde_t *pgdir, uint oldsz, uint newsz)
80106e50: 83 ec 1c sub $0x1c,%esp
uint a, pa;
if(newsz >= oldsz)
return oldsz;
a = PGROUNDUP(newsz);
80106e53: 81 e3 00 f0 ff ff and $0xfffff000,%ebx
for(; a < oldsz; a += PGSIZE){
80106e59: 39 d3 cmp %edx,%ebx
// Deallocate user pages to bring the process size from oldsz to
// newsz. oldsz and newsz need not be page-aligned, nor does newsz
// need to be less than oldsz. oldsz can be larger than the actual
// process size. Returns the new process size.
int
deallocuvm(pde_t *pgdir, uint oldsz, uint newsz)
80106e5b: 89 4d e0 mov %ecx,-0x20(%ebp)
if(newsz >= oldsz)
return oldsz;
a = PGROUNDUP(newsz);
for(; a < oldsz; a += PGSIZE){
80106e5e: 72 3b jb 80106e9b <deallocuvm.part.0+0x5b>
80106e60: eb 5e jmp 80106ec0 <deallocuvm.part.0+0x80>
80106e62: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
pte = walkpgdir(pgdir, (char*)a, 0);
if(!pte)
a += (NPTENTRIES - 1) * PGSIZE;
else if((*pte & PTE_P) != 0){
80106e68: 8b 10 mov (%eax),%edx
80106e6a: f6 c2 01 test $0x1,%dl
80106e6d: 74 22 je 80106e91 <deallocuvm.part.0+0x51>
pa = PTE_ADDR(*pte);
if(pa == 0)
80106e6f: 81 e2 00 f0 ff ff and $0xfffff000,%edx
80106e75: 74 54 je 80106ecb <deallocuvm.part.0+0x8b>
panic("kfree");
char *v = P2V(pa);
80106e77: 81 c2 00 00 00 80 add $0x80000000,%edx
kfree(v);
80106e7d: 89 14 24 mov %edx,(%esp)
80106e80: 89 45 e4 mov %eax,-0x1c(%ebp)
80106e83: e8 58 b4 ff ff call 801022e0 <kfree>
*pte = 0;
80106e88: 8b 45 e4 mov -0x1c(%ebp),%eax
80106e8b: c7 00 00 00 00 00 movl $0x0,(%eax)
if(newsz >= oldsz)
return oldsz;
a = PGROUNDUP(newsz);
for(; a < oldsz; a += PGSIZE){
80106e91: 81 c3 00 10 00 00 add $0x1000,%ebx
80106e97: 39 f3 cmp %esi,%ebx
80106e99: 73 25 jae 80106ec0 <deallocuvm.part.0+0x80>
pte = walkpgdir(pgdir, (char*)a, 0);
80106e9b: 31 c9 xor %ecx,%ecx
80106e9d: 89 da mov %ebx,%edx
80106e9f: 89 f8 mov %edi,%eax
80106ea1: e8 8a fe ff ff call 80106d30 <walkpgdir>
if(!pte)
80106ea6: 85 c0 test %eax,%eax
80106ea8: 75 be jne 80106e68 <deallocuvm.part.0+0x28>
a += (NPTENTRIES - 1) * PGSIZE;
80106eaa: 81 c3 00 f0 3f 00 add $0x3ff000,%ebx
if(newsz >= oldsz)
return oldsz;
a = PGROUNDUP(newsz);
for(; a < oldsz; a += PGSIZE){
80106eb0: 81 c3 00 10 00 00 add $0x1000,%ebx
80106eb6: 39 f3 cmp %esi,%ebx
80106eb8: 72 e1 jb 80106e9b <deallocuvm.part.0+0x5b>
80106eba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
kfree(v);
*pte = 0;
}
}
return newsz;
}
80106ec0: 8b 45 e0 mov -0x20(%ebp),%eax
80106ec3: 83 c4 1c add $0x1c,%esp
80106ec6: 5b pop %ebx
80106ec7: 5e pop %esi
80106ec8: 5f pop %edi
80106ec9: 5d pop %ebp
80106eca: c3 ret
if(!pte)
a += (NPTENTRIES - 1) * PGSIZE;
else if((*pte & PTE_P) != 0){
pa = PTE_ADDR(*pte);
if(pa == 0)
panic("kfree");
80106ecb: c7 04 24 96 78 10 80 movl $0x80107896,(%esp)
80106ed2: e8 59 94 ff ff call 80100330 <panic>
80106ed7: 89 f6 mov %esi,%esi
80106ed9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80106ee0 <seginit>:
// Set up CPU's kernel segment descriptors.
// Run once on entry on each CPU.
void
seginit(void)
{
80106ee0: 55 push %ebp
80106ee1: 89 e5 mov %esp,%ebp
80106ee3: 83 ec 18 sub $0x18,%esp
// Map "logical" addresses to virtual addresses using identity map.
// Cannot share a CODE descriptor for both kernel and user
// because it would have to have DPL_USR, but the CPU forbids
// an interrupt from CPL=0 to DPL=3.
c = &cpus[cpunum()];
80106ee6: e8 65 b8 ff ff call 80102750 <cpunum>
c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0);
80106eeb: 31 c9 xor %ecx,%ecx
80106eed: ba ff ff ff ff mov $0xffffffff,%edx
// Map "logical" addresses to virtual addresses using identity map.
// Cannot share a CODE descriptor for both kernel and user
// because it would have to have DPL_USR, but the CPU forbids
// an interrupt from CPL=0 to DPL=3.
c = &cpus[cpunum()];
80106ef2: 8d 04 40 lea (%eax,%eax,2),%eax
80106ef5: c1 e0 06 shl $0x6,%eax
80106ef8: 05 e0 22 11 80 add $0x801122e0,%eax
c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0);
80106efd: 66 89 50 78 mov %dx,0x78(%eax)
c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0);
80106f01: ba ff ff ff ff mov $0xffffffff,%edx
// Map "logical" addresses to virtual addresses using identity map.
// Cannot share a CODE descriptor for both kernel and user
// because it would have to have DPL_USR, but the CPU forbids
// an interrupt from CPL=0 to DPL=3.
c = &cpus[cpunum()];
c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0);
80106f06: 66 89 48 7a mov %cx,0x7a(%eax)
c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0);
80106f0a: 31 c9 xor %ecx,%ecx
80106f0c: 66 89 90 80 00 00 00 mov %dx,0x80(%eax)
c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER);
80106f13: ba ff ff ff ff mov $0xffffffff,%edx
// Cannot share a CODE descriptor for both kernel and user
// because it would have to have DPL_USR, but the CPU forbids
// an interrupt from CPL=0 to DPL=3.
c = &cpus[cpunum()];
c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0);
c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0);
80106f18: 66 89 88 82 00 00 00 mov %cx,0x82(%eax)
c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER);
80106f1f: 31 c9 xor %ecx,%ecx
80106f21: 66 89 90 90 00 00 00 mov %dx,0x90(%eax)
c->gdt[SEG_UDATA] = SEG(STA_W, 0, 0xffffffff, DPL_USER);
80106f28: ba ff ff ff ff mov $0xffffffff,%edx
// because it would have to have DPL_USR, but the CPU forbids
// an interrupt from CPL=0 to DPL=3.
c = &cpus[cpunum()];
c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0);
c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0);
c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER);
80106f2d: 66 89 88 92 00 00 00 mov %cx,0x92(%eax)
c->gdt[SEG_UDATA] = SEG(STA_W, 0, 0xffffffff, DPL_USER);
80106f34: 31 c9 xor %ecx,%ecx
80106f36: 66 89 90 98 00 00 00 mov %dx,0x98(%eax)
// Map cpu and curproc -- these are private per cpu.
c->gdt[SEG_KCPU] = SEG(STA_W, &c->cpu, 12, 0);
80106f3d: 8d 90 b4 00 00 00 lea 0xb4(%eax),%edx
// an interrupt from CPL=0 to DPL=3.
c = &cpus[cpunum()];
c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0);
c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0);
c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER);
c->gdt[SEG_UDATA] = SEG(STA_W, 0, 0xffffffff, DPL_USER);
80106f43: 66 89 88 9a 00 00 00 mov %cx,0x9a(%eax)
// Map cpu and curproc -- these are private per cpu.
c->gdt[SEG_KCPU] = SEG(STA_W, &c->cpu, 12, 0);
80106f4a: 31 c9 xor %ecx,%ecx
80106f4c: 66 89 88 88 00 00 00 mov %cx,0x88(%eax)
80106f53: 89 d1 mov %edx,%ecx
80106f55: c1 e9 10 shr $0x10,%ecx
80106f58: 66 89 90 8a 00 00 00 mov %dx,0x8a(%eax)
80106f5f: c1 ea 18 shr $0x18,%edx
80106f62: 88 88 8c 00 00 00 mov %cl,0x8c(%eax)
static inline void
lgdt(struct segdesc *p, int size)
{
volatile ushort pd[3];
pd[0] = size-1;
80106f68: b9 37 00 00 00 mov $0x37,%ecx
80106f6d: 88 90 8f 00 00 00 mov %dl,0x8f(%eax)
lgdt(c->gdt, sizeof(c->gdt));
80106f73: 8d 50 70 lea 0x70(%eax),%edx
// Map "logical" addresses to virtual addresses using identity map.
// Cannot share a CODE descriptor for both kernel and user
// because it would have to have DPL_USR, but the CPU forbids
// an interrupt from CPL=0 to DPL=3.
c = &cpus[cpunum()];
c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0);
80106f76: c6 40 7d 9a movb $0x9a,0x7d(%eax)
80106f7a: c6 40 7e cf movb $0xcf,0x7e(%eax)
c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0);
80106f7e: c6 80 85 00 00 00 92 movb $0x92,0x85(%eax)
80106f85: c6 80 86 00 00 00 cf movb $0xcf,0x86(%eax)
c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER);
80106f8c: c6 80 95 00 00 00 fa movb $0xfa,0x95(%eax)
80106f93: c6 80 96 00 00 00 cf movb $0xcf,0x96(%eax)
c->gdt[SEG_UDATA] = SEG(STA_W, 0, 0xffffffff, DPL_USER);
80106f9a: c6 80 9d 00 00 00 f2 movb $0xf2,0x9d(%eax)
80106fa1: c6 80 9e 00 00 00 cf movb $0xcf,0x9e(%eax)
// Map cpu and curproc -- these are private per cpu.
c->gdt[SEG_KCPU] = SEG(STA_W, &c->cpu, 12, 0);
80106fa8: c6 80 8d 00 00 00 92 movb $0x92,0x8d(%eax)
80106faf: c6 80 8e 00 00 00 c0 movb $0xc0,0x8e(%eax)
80106fb6: 66 89 4d f2 mov %cx,-0xe(%ebp)
pd[1] = (uint)p;
80106fba: 66 89 55 f4 mov %dx,-0xc(%ebp)
pd[2] = (uint)p >> 16;
80106fbe: c1 ea 10 shr $0x10,%edx
80106fc1: 66 89 55 f6 mov %dx,-0xa(%ebp)
asm volatile("lgdt (%0)" : : "r" (pd));
80106fc5: 8d 55 f2 lea -0xe(%ebp),%edx
// Map "logical" addresses to virtual addresses using identity map.
// Cannot share a CODE descriptor for both kernel and user
// because it would have to have DPL_USR, but the CPU forbids
// an interrupt from CPL=0 to DPL=3.
c = &cpus[cpunum()];
c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0);
80106fc8: c6 40 7c 00 movb $0x0,0x7c(%eax)
80106fcc: c6 40 7f 00 movb $0x0,0x7f(%eax)
c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0);
80106fd0: c6 80 84 00 00 00 00 movb $0x0,0x84(%eax)
80106fd7: c6 80 87 00 00 00 00 movb $0x0,0x87(%eax)
c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER);
80106fde: c6 80 94 00 00 00 00 movb $0x0,0x94(%eax)
80106fe5: c6 80 97 00 00 00 00 movb $0x0,0x97(%eax)
c->gdt[SEG_UDATA] = SEG(STA_W, 0, 0xffffffff, DPL_USER);
80106fec: c6 80 9c 00 00 00 00 movb $0x0,0x9c(%eax)
80106ff3: c6 80 9f 00 00 00 00 movb $0x0,0x9f(%eax)
80106ffa: 0f 01 12 lgdtl (%edx)
}
static inline void
loadgs(ushort v)
{
asm volatile("movw %0, %%gs" : : "r" (v));
80106ffd: ba 18 00 00 00 mov $0x18,%edx
80107002: 8e ea mov %edx,%gs
lgdt(c->gdt, sizeof(c->gdt));
loadgs(SEG_KCPU << 3);
// Initialize cpu-local storage.
cpu = c;
proc = 0;
80107004: 65 c7 05 04 00 00 00 movl $0x0,%gs:0x4
8010700b: 00 00 00 00
lgdt(c->gdt, sizeof(c->gdt));
loadgs(SEG_KCPU << 3);
// Initialize cpu-local storage.
cpu = c;
8010700f: 65 a3 00 00 00 00 mov %eax,%gs:0x0
proc = 0;
}
80107015: c9 leave
80107016: c3 ret
80107017: 89 f6 mov %esi,%esi
80107019: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80107020 <setupkvm>:
};
// Set up kernel part of a page table.
pde_t*
setupkvm(void)
{
80107020: 55 push %ebp
80107021: 89 e5 mov %esp,%ebp
80107023: 56 push %esi
80107024: 53 push %ebx
80107025: 83 ec 10 sub $0x10,%esp
pde_t *pgdir;
struct kmap *k;
if((pgdir = (pde_t*)kalloc()) == 0)
80107028: e8 63 b4 ff ff call 80102490 <kalloc>
8010702d: 85 c0 test %eax,%eax
8010702f: 89 c6 mov %eax,%esi
80107031: 74 55 je 80107088 <setupkvm+0x68>
return 0;
memset(pgdir, 0, PGSIZE);
80107033: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp)
8010703a: 00
if (P2V(PHYSTOP) > (void*)DEVSPACE)
panic("PHYSTOP too high");
for(k = kmap; k < &kmap[NELEM(kmap)]; k++)
8010703b: bb 20 b4 10 80 mov $0x8010b420,%ebx
pde_t *pgdir;
struct kmap *k;
if((pgdir = (pde_t*)kalloc()) == 0)
return 0;
memset(pgdir, 0, PGSIZE);
80107040: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80107047: 00
80107048: 89 04 24 mov %eax,(%esp)
8010704b: e8 f0 d9 ff ff call 80104a40 <memset>
if (P2V(PHYSTOP) > (void*)DEVSPACE)
panic("PHYSTOP too high");
for(k = kmap; k < &kmap[NELEM(kmap)]; k++)
if(mappages(pgdir, k->virt, k->phys_end - k->phys_start,
80107050: 8b 53 0c mov 0xc(%ebx),%edx
80107053: 8b 43 04 mov 0x4(%ebx),%eax
80107056: 8b 4b 08 mov 0x8(%ebx),%ecx
80107059: 89 54 24 04 mov %edx,0x4(%esp)
8010705d: 8b 13 mov (%ebx),%edx
8010705f: 89 04 24 mov %eax,(%esp)
80107062: 29 c1 sub %eax,%ecx
80107064: 89 f0 mov %esi,%eax
80107066: e8 55 fd ff ff call 80106dc0 <mappages>
8010706b: 85 c0 test %eax,%eax
8010706d: 78 19 js 80107088 <setupkvm+0x68>
if((pgdir = (pde_t*)kalloc()) == 0)
return 0;
memset(pgdir, 0, PGSIZE);
if (P2V(PHYSTOP) > (void*)DEVSPACE)
panic("PHYSTOP too high");
for(k = kmap; k < &kmap[NELEM(kmap)]; k++)
8010706f: 83 c3 10 add $0x10,%ebx
80107072: 81 fb 60 b4 10 80 cmp $0x8010b460,%ebx
80107078: 72 d6 jb 80107050 <setupkvm+0x30>
if(mappages(pgdir, k->virt, k->phys_end - k->phys_start,
(uint)k->phys_start, k->perm) < 0)
return 0;
return pgdir;
}
8010707a: 83 c4 10 add $0x10,%esp
8010707d: 89 f0 mov %esi,%eax
8010707f: 5b pop %ebx
80107080: 5e pop %esi
80107081: 5d pop %ebp
80107082: c3 ret
80107083: 90 nop
80107084: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80107088: 83 c4 10 add $0x10,%esp
{
pde_t *pgdir;
struct kmap *k;
if((pgdir = (pde_t*)kalloc()) == 0)
return 0;
8010708b: 31 c0 xor %eax,%eax
for(k = kmap; k < &kmap[NELEM(kmap)]; k++)
if(mappages(pgdir, k->virt, k->phys_end - k->phys_start,
(uint)k->phys_start, k->perm) < 0)
return 0;
return pgdir;
}
8010708d: 5b pop %ebx
8010708e: 5e pop %esi
8010708f: 5d pop %ebp
80107090: c3 ret
80107091: eb 0d jmp 801070a0 <kvmalloc>
80107093: 90 nop
80107094: 90 nop
80107095: 90 nop
80107096: 90 nop
80107097: 90 nop
80107098: 90 nop
80107099: 90 nop
8010709a: 90 nop
8010709b: 90 nop
8010709c: 90 nop
8010709d: 90 nop
8010709e: 90 nop
8010709f: 90 nop
801070a0 <kvmalloc>:
// Allocate one page table for the machine for the kernel address
// space for scheduler processes.
void
kvmalloc(void)
{
801070a0: 55 push %ebp
801070a1: 89 e5 mov %esp,%ebp
801070a3: 83 ec 08 sub $0x8,%esp
kpgdir = setupkvm();
801070a6: e8 75 ff ff ff call 80107020 <setupkvm>
801070ab: a3 c4 4e 12 80 mov %eax,0x80124ec4
// Switch h/w page table register to the kernel-only page table,
// for when no process is running.
void
switchkvm(void)
{
lcr3(V2P(kpgdir)); // switch to the kernel page table
801070b0: 05 00 00 00 80 add $0x80000000,%eax
}
static inline void
lcr3(uint val)
{
asm volatile("movl %0,%%cr3" : : "r" (val));
801070b5: 0f 22 d8 mov %eax,%cr3
void
kvmalloc(void)
{
kpgdir = setupkvm();
switchkvm();
}
801070b8: c9 leave
801070b9: c3 ret
801070ba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801070c0 <switchkvm>:
// Switch h/w page table register to the kernel-only page table,
// for when no process is running.
void
switchkvm(void)
{
lcr3(V2P(kpgdir)); // switch to the kernel page table
801070c0: a1 c4 4e 12 80 mov 0x80124ec4,%eax
// Switch h/w page table register to the kernel-only page table,
// for when no process is running.
void
switchkvm(void)
{
801070c5: 55 push %ebp
801070c6: 89 e5 mov %esp,%ebp
lcr3(V2P(kpgdir)); // switch to the kernel page table
801070c8: 05 00 00 00 80 add $0x80000000,%eax
801070cd: 0f 22 d8 mov %eax,%cr3
}
801070d0: 5d pop %ebp
801070d1: c3 ret
801070d2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
801070d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801070e0 <switchuvm>:
// Switch TSS and h/w page table to correspond to process p.
void
switchuvm(struct proc *p)
{
801070e0: 55 push %ebp
801070e1: 89 e5 mov %esp,%ebp
801070e3: 53 push %ebx
801070e4: 83 ec 14 sub $0x14,%esp
801070e7: 8b 5d 08 mov 0x8(%ebp),%ebx
pushcli();
801070ea: e8 81 d8 ff ff call 80104970 <pushcli>
cpu->gdt[SEG_TSS] = SEG16(STS_T32A, &cpu->ts, sizeof(cpu->ts)-1, 0);
801070ef: 65 a1 00 00 00 00 mov %gs:0x0,%eax
801070f5: b9 67 00 00 00 mov $0x67,%ecx
801070fa: 8d 50 08 lea 0x8(%eax),%edx
801070fd: 66 89 88 a0 00 00 00 mov %cx,0xa0(%eax)
80107104: 89 d1 mov %edx,%ecx
80107106: 66 89 90 a2 00 00 00 mov %dx,0xa2(%eax)
8010710d: c1 ea 18 shr $0x18,%edx
80107110: 88 90 a7 00 00 00 mov %dl,0xa7(%eax)
cpu->gdt[SEG_TSS].s = 0;
cpu->ts.ss0 = SEG_KDATA << 3;
80107116: ba 10 00 00 00 mov $0x10,%edx
// Switch TSS and h/w page table to correspond to process p.
void
switchuvm(struct proc *p)
{
pushcli();
cpu->gdt[SEG_TSS] = SEG16(STS_T32A, &cpu->ts, sizeof(cpu->ts)-1, 0);
8010711b: c6 80 a6 00 00 00 40 movb $0x40,0xa6(%eax)
80107122: c1 e9 10 shr $0x10,%ecx
cpu->gdt[SEG_TSS].s = 0;
80107125: c6 80 a5 00 00 00 89 movb $0x89,0xa5(%eax)
cpu->ts.ss0 = SEG_KDATA << 3;
8010712c: 66 89 50 10 mov %dx,0x10(%eax)
cpu->ts.esp0 = (uint)thread->kstack + KSTACKSIZE;
80107130: 65 8b 15 08 00 00 00 mov %gs:0x8,%edx
// Switch TSS and h/w page table to correspond to process p.
void
switchuvm(struct proc *p)
{
pushcli();
cpu->gdt[SEG_TSS] = SEG16(STS_T32A, &cpu->ts, sizeof(cpu->ts)-1, 0);
80107137: 88 88 a4 00 00 00 mov %cl,0xa4(%eax)
cpu->gdt[SEG_TSS].s = 0;
cpu->ts.ss0 = SEG_KDATA << 3;
cpu->ts.esp0 = (uint)thread->kstack + KSTACKSIZE;
// setting IOPL=0 in eflags *and* iomb beyond the tss segment limit
// forbids I/O instructions (e.g., inb and outb) from user space
cpu->ts.iomb = (ushort) 0xFFFF;
8010713d: b9 ff ff ff ff mov $0xffffffff,%ecx
{
pushcli();
cpu->gdt[SEG_TSS] = SEG16(STS_T32A, &cpu->ts, sizeof(cpu->ts)-1, 0);
cpu->gdt[SEG_TSS].s = 0;
cpu->ts.ss0 = SEG_KDATA << 3;
cpu->ts.esp0 = (uint)thread->kstack + KSTACKSIZE;
80107142: 8b 12 mov (%edx),%edx
// setting IOPL=0 in eflags *and* iomb beyond the tss segment limit
// forbids I/O instructions (e.g., inb and outb) from user space
cpu->ts.iomb = (ushort) 0xFFFF;
80107144: 66 89 48 6e mov %cx,0x6e(%eax)
{
pushcli();
cpu->gdt[SEG_TSS] = SEG16(STS_T32A, &cpu->ts, sizeof(cpu->ts)-1, 0);
cpu->gdt[SEG_TSS].s = 0;
cpu->ts.ss0 = SEG_KDATA << 3;
cpu->ts.esp0 = (uint)thread->kstack + KSTACKSIZE;
80107148: 81 c2 00 10 00 00 add $0x1000,%edx
8010714e: 89 50 0c mov %edx,0xc(%eax)
}
static inline void
ltr(ushort sel)
{
asm volatile("ltr %0" : : "r" (sel));
80107151: b8 30 00 00 00 mov $0x30,%eax
80107156: 0f 00 d8 ltr %ax
// setting IOPL=0 in eflags *and* iomb beyond the tss segment limit
// forbids I/O instructions (e.g., inb and outb) from user space
cpu->ts.iomb = (ushort) 0xFFFF;
ltr(SEG_TSS << 3);
if(p->pgdir == 0)
80107159: 8b 43 04 mov 0x4(%ebx),%eax
8010715c: 85 c0 test %eax,%eax
8010715e: 74 12 je 80107172 <switchuvm+0x92>
panic("switchuvm: no pgdir");
lcr3(V2P(p->pgdir)); // switch to process's address space
80107160: 05 00 00 00 80 add $0x80000000,%eax
}
static inline void
lcr3(uint val)
{
asm volatile("movl %0,%%cr3" : : "r" (val));
80107165: 0f 22 d8 mov %eax,%cr3
popcli();
}
80107168: 83 c4 14 add $0x14,%esp
8010716b: 5b pop %ebx
8010716c: 5d pop %ebp
cpu->ts.iomb = (ushort) 0xFFFF;
ltr(SEG_TSS << 3);
if(p->pgdir == 0)
panic("switchuvm: no pgdir");
lcr3(V2P(p->pgdir)); // switch to process's address space
popcli();
8010716d: e9 2e d8 ff ff jmp 801049a0 <popcli>
// setting IOPL=0 in eflags *and* iomb beyond the tss segment limit
// forbids I/O instructions (e.g., inb and outb) from user space
cpu->ts.iomb = (ushort) 0xFFFF;
ltr(SEG_TSS << 3);
if(p->pgdir == 0)
panic("switchuvm: no pgdir");
80107172: c7 04 24 4e 7f 10 80 movl $0x80107f4e,(%esp)
80107179: e8 b2 91 ff ff call 80100330 <panic>
8010717e: 66 90 xchg %ax,%ax
80107180 <inituvm>:
// Load the initcode into address 0 of pgdir.
// sz must be less than a page.
void
inituvm(pde_t *pgdir, char *init, uint sz)
{
80107180: 55 push %ebp
80107181: 89 e5 mov %esp,%ebp
80107183: 57 push %edi
80107184: 56 push %esi
80107185: 53 push %ebx
80107186: 83 ec 1c sub $0x1c,%esp
80107189: 8b 75 10 mov 0x10(%ebp),%esi
8010718c: 8b 45 08 mov 0x8(%ebp),%eax
8010718f: 8b 7d 0c mov 0xc(%ebp),%edi
char *mem;
if(sz >= PGSIZE)
80107192: 81 fe ff 0f 00 00 cmp $0xfff,%esi
// Load the initcode into address 0 of pgdir.
// sz must be less than a page.
void
inituvm(pde_t *pgdir, char *init, uint sz)
{
80107198: 89 45 e4 mov %eax,-0x1c(%ebp)
char *mem;
if(sz >= PGSIZE)
8010719b: 77 54 ja 801071f1 <inituvm+0x71>
panic("inituvm: more than a page");
mem = kalloc();
8010719d: e8 ee b2 ff ff call 80102490 <kalloc>
memset(mem, 0, PGSIZE);
801071a2: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp)
801071a9: 00
801071aa: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
801071b1: 00
{
char *mem;
if(sz >= PGSIZE)
panic("inituvm: more than a page");
mem = kalloc();
801071b2: 89 c3 mov %eax,%ebx
memset(mem, 0, PGSIZE);
801071b4: 89 04 24 mov %eax,(%esp)
801071b7: e8 84 d8 ff ff call 80104a40 <memset>
mappages(pgdir, 0, PGSIZE, V2P(mem), PTE_W|PTE_U);
801071bc: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax
801071c2: b9 00 10 00 00 mov $0x1000,%ecx
801071c7: 89 04 24 mov %eax,(%esp)
801071ca: 8b 45 e4 mov -0x1c(%ebp),%eax
801071cd: 31 d2 xor %edx,%edx
801071cf: c7 44 24 04 06 00 00 movl $0x6,0x4(%esp)
801071d6: 00
801071d7: e8 e4 fb ff ff call 80106dc0 <mappages>
memmove(mem, init, sz);
801071dc: 89 75 10 mov %esi,0x10(%ebp)
801071df: 89 7d 0c mov %edi,0xc(%ebp)
801071e2: 89 5d 08 mov %ebx,0x8(%ebp)
}
801071e5: 83 c4 1c add $0x1c,%esp
801071e8: 5b pop %ebx
801071e9: 5e pop %esi
801071ea: 5f pop %edi
801071eb: 5d pop %ebp
if(sz >= PGSIZE)
panic("inituvm: more than a page");
mem = kalloc();
memset(mem, 0, PGSIZE);
mappages(pgdir, 0, PGSIZE, V2P(mem), PTE_W|PTE_U);
memmove(mem, init, sz);
801071ec: e9 ef d8 ff ff jmp 80104ae0 <memmove>
inituvm(pde_t *pgdir, char *init, uint sz)
{
char *mem;
if(sz >= PGSIZE)
panic("inituvm: more than a page");
801071f1: c7 04 24 62 7f 10 80 movl $0x80107f62,(%esp)
801071f8: e8 33 91 ff ff call 80100330 <panic>
801071fd: 8d 76 00 lea 0x0(%esi),%esi
80107200 <loaduvm>:
// Load a program segment into pgdir. addr must be page-aligned
// and the pages from addr to addr+sz must already be mapped.
int
loaduvm(pde_t *pgdir, char *addr, struct inode *ip, uint offset, uint sz)
{
80107200: 55 push %ebp
80107201: 89 e5 mov %esp,%ebp
80107203: 57 push %edi
80107204: 56 push %esi
80107205: 53 push %ebx
80107206: 83 ec 1c sub $0x1c,%esp
uint i, pa, n;
pte_t *pte;
if((uint) addr % PGSIZE != 0)
80107209: f7 45 0c ff 0f 00 00 testl $0xfff,0xc(%ebp)
80107210: 0f 85 98 00 00 00 jne 801072ae <loaduvm+0xae>
panic("loaduvm: addr must be page aligned");
for(i = 0; i < sz; i += PGSIZE){
80107216: 8b 75 18 mov 0x18(%ebp),%esi
80107219: 31 db xor %ebx,%ebx
8010721b: 85 f6 test %esi,%esi
8010721d: 75 1a jne 80107239 <loaduvm+0x39>
8010721f: eb 77 jmp 80107298 <loaduvm+0x98>
80107221: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80107228: 81 c3 00 10 00 00 add $0x1000,%ebx
8010722e: 81 ee 00 10 00 00 sub $0x1000,%esi
80107234: 39 5d 18 cmp %ebx,0x18(%ebp)
80107237: 76 5f jbe 80107298 <loaduvm+0x98>
80107239: 8b 55 0c mov 0xc(%ebp),%edx
if((pte = walkpgdir(pgdir, addr+i, 0)) == 0)
8010723c: 31 c9 xor %ecx,%ecx
8010723e: 8b 45 08 mov 0x8(%ebp),%eax
80107241: 01 da add %ebx,%edx
80107243: e8 e8 fa ff ff call 80106d30 <walkpgdir>
80107248: 85 c0 test %eax,%eax
8010724a: 74 56 je 801072a2 <loaduvm+0xa2>
panic("loaduvm: address should exist");
pa = PTE_ADDR(*pte);
8010724c: 8b 00 mov (%eax),%eax
if(sz - i < PGSIZE)
n = sz - i;
else
n = PGSIZE;
8010724e: bf 00 10 00 00 mov $0x1000,%edi
80107253: 8b 4d 14 mov 0x14(%ebp),%ecx
if((uint) addr % PGSIZE != 0)
panic("loaduvm: addr must be page aligned");
for(i = 0; i < sz; i += PGSIZE){
if((pte = walkpgdir(pgdir, addr+i, 0)) == 0)
panic("loaduvm: address should exist");
pa = PTE_ADDR(*pte);
80107256: 25 00 f0 ff ff and $0xfffff000,%eax
if(sz - i < PGSIZE)
n = sz - i;
else
n = PGSIZE;
8010725b: 81 fe 00 10 00 00 cmp $0x1000,%esi
80107261: 0f 42 fe cmovb %esi,%edi
if(readi(ip, P2V(pa), offset+i, n) != n)
80107264: 05 00 00 00 80 add $0x80000000,%eax
80107269: 89 44 24 04 mov %eax,0x4(%esp)
8010726d: 8b 45 10 mov 0x10(%ebp),%eax
80107270: 01 d9 add %ebx,%ecx
80107272: 89 7c 24 0c mov %edi,0xc(%esp)
80107276: 89 4c 24 08 mov %ecx,0x8(%esp)
8010727a: 89 04 24 mov %eax,(%esp)
8010727d: e8 be a6 ff ff call 80101940 <readi>
80107282: 39 f8 cmp %edi,%eax
80107284: 74 a2 je 80107228 <loaduvm+0x28>
return -1;
}
return 0;
}
80107286: 83 c4 1c add $0x1c,%esp
if(sz - i < PGSIZE)
n = sz - i;
else
n = PGSIZE;
if(readi(ip, P2V(pa), offset+i, n) != n)
return -1;
80107289: b8 ff ff ff ff mov $0xffffffff,%eax
}
return 0;
}
8010728e: 5b pop %ebx
8010728f: 5e pop %esi
80107290: 5f pop %edi
80107291: 5d pop %ebp
80107292: c3 ret
80107293: 90 nop
80107294: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80107298: 83 c4 1c add $0x1c,%esp
else
n = PGSIZE;
if(readi(ip, P2V(pa), offset+i, n) != n)
return -1;
}
return 0;
8010729b: 31 c0 xor %eax,%eax
}
8010729d: 5b pop %ebx
8010729e: 5e pop %esi
8010729f: 5f pop %edi
801072a0: 5d pop %ebp
801072a1: c3 ret
if((uint) addr % PGSIZE != 0)
panic("loaduvm: addr must be page aligned");
for(i = 0; i < sz; i += PGSIZE){
if((pte = walkpgdir(pgdir, addr+i, 0)) == 0)
panic("loaduvm: address should exist");
801072a2: c7 04 24 7c 7f 10 80 movl $0x80107f7c,(%esp)
801072a9: e8 82 90 ff ff call 80100330 <panic>
{
uint i, pa, n;
pte_t *pte;
if((uint) addr % PGSIZE != 0)
panic("loaduvm: addr must be page aligned");
801072ae: c7 04 24 20 80 10 80 movl $0x80108020,(%esp)
801072b5: e8 76 90 ff ff call 80100330 <panic>
801072ba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801072c0 <allocuvm>:
// Allocate page tables and physical memory to grow process from oldsz to
// newsz, which need not be page aligned. Returns new size or 0 on error.
int
allocuvm(pde_t *pgdir, uint oldsz, uint newsz)
{
801072c0: 55 push %ebp
801072c1: 89 e5 mov %esp,%ebp
801072c3: 57 push %edi
801072c4: 56 push %esi
801072c5: 53 push %ebx
801072c6: 83 ec 1c sub $0x1c,%esp
801072c9: 8b 7d 10 mov 0x10(%ebp),%edi
char *mem;
uint a;
if(newsz >= KERNBASE)
801072cc: 85 ff test %edi,%edi
801072ce: 0f 88 7e 00 00 00 js 80107352 <allocuvm+0x92>
return 0;
if(newsz < oldsz)
801072d4: 3b 7d 0c cmp 0xc(%ebp),%edi
return oldsz;
801072d7: 8b 45 0c mov 0xc(%ebp),%eax
char *mem;
uint a;
if(newsz >= KERNBASE)
return 0;
if(newsz < oldsz)
801072da: 72 78 jb 80107354 <allocuvm+0x94>
return oldsz;
a = PGROUNDUP(oldsz);
801072dc: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx
801072e2: 81 e3 00 f0 ff ff and $0xfffff000,%ebx
for(; a < newsz; a += PGSIZE){
801072e8: 39 df cmp %ebx,%edi
801072ea: 77 4a ja 80107336 <allocuvm+0x76>
801072ec: eb 72 jmp 80107360 <allocuvm+0xa0>
801072ee: 66 90 xchg %ax,%ax
if(mem == 0){
cprintf("allocuvm out of memory\n");
deallocuvm(pgdir, newsz, oldsz);
return 0;
}
memset(mem, 0, PGSIZE);
801072f0: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp)
801072f7: 00
801072f8: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
801072ff: 00
80107300: 89 04 24 mov %eax,(%esp)
80107303: e8 38 d7 ff ff call 80104a40 <memset>
if(mappages(pgdir, (char*)a, PGSIZE, V2P(mem), PTE_W|PTE_U) < 0){
80107308: 8d 86 00 00 00 80 lea -0x80000000(%esi),%eax
8010730e: b9 00 10 00 00 mov $0x1000,%ecx
80107313: 89 04 24 mov %eax,(%esp)
80107316: 8b 45 08 mov 0x8(%ebp),%eax
80107319: 89 da mov %ebx,%edx
8010731b: c7 44 24 04 06 00 00 movl $0x6,0x4(%esp)
80107322: 00
80107323: e8 98 fa ff ff call 80106dc0 <mappages>
80107328: 85 c0 test %eax,%eax
8010732a: 78 44 js 80107370 <allocuvm+0xb0>
return 0;
if(newsz < oldsz)
return oldsz;
a = PGROUNDUP(oldsz);
for(; a < newsz; a += PGSIZE){
8010732c: 81 c3 00 10 00 00 add $0x1000,%ebx
80107332: 39 df cmp %ebx,%edi
80107334: 76 2a jbe 80107360 <allocuvm+0xa0>
mem = kalloc();
80107336: e8 55 b1 ff ff call 80102490 <kalloc>
if(mem == 0){
8010733b: 85 c0 test %eax,%eax
if(newsz < oldsz)
return oldsz;
a = PGROUNDUP(oldsz);
for(; a < newsz; a += PGSIZE){
mem = kalloc();
8010733d: 89 c6 mov %eax,%esi
if(mem == 0){
8010733f: 75 af jne 801072f0 <allocuvm+0x30>
cprintf("allocuvm out of memory\n");
80107341: c7 04 24 9a 7f 10 80 movl $0x80107f9a,(%esp)
80107348: e8 d3 92 ff ff call 80100620 <cprintf>
deallocuvm(pde_t *pgdir, uint oldsz, uint newsz)
{
pte_t *pte;
uint a, pa;
if(newsz >= oldsz)
8010734d: 3b 7d 0c cmp 0xc(%ebp),%edi
80107350: 77 48 ja 8010739a <allocuvm+0xda>
memset(mem, 0, PGSIZE);
if(mappages(pgdir, (char*)a, PGSIZE, V2P(mem), PTE_W|PTE_U) < 0){
cprintf("allocuvm out of memory (2)\n");
deallocuvm(pgdir, newsz, oldsz);
kfree(mem);
return 0;
80107352: 31 c0 xor %eax,%eax
}
}
return newsz;
}
80107354: 83 c4 1c add $0x1c,%esp
80107357: 5b pop %ebx
80107358: 5e pop %esi
80107359: 5f pop %edi
8010735a: 5d pop %ebp
8010735b: c3 ret
8010735c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80107360: 83 c4 1c add $0x1c,%esp
80107363: 89 f8 mov %edi,%eax
80107365: 5b pop %ebx
80107366: 5e pop %esi
80107367: 5f pop %edi
80107368: 5d pop %ebp
80107369: c3 ret
8010736a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
deallocuvm(pgdir, newsz, oldsz);
return 0;
}
memset(mem, 0, PGSIZE);
if(mappages(pgdir, (char*)a, PGSIZE, V2P(mem), PTE_W|PTE_U) < 0){
cprintf("allocuvm out of memory (2)\n");
80107370: c7 04 24 b2 7f 10 80 movl $0x80107fb2,(%esp)
80107377: e8 a4 92 ff ff call 80100620 <cprintf>
deallocuvm(pde_t *pgdir, uint oldsz, uint newsz)
{
pte_t *pte;
uint a, pa;
if(newsz >= oldsz)
8010737c: 3b 7d 0c cmp 0xc(%ebp),%edi
8010737f: 76 0d jbe 8010738e <allocuvm+0xce>
80107381: 8b 4d 0c mov 0xc(%ebp),%ecx
80107384: 89 fa mov %edi,%edx
80107386: 8b 45 08 mov 0x8(%ebp),%eax
80107389: e8 b2 fa ff ff call 80106e40 <deallocuvm.part.0>
}
memset(mem, 0, PGSIZE);
if(mappages(pgdir, (char*)a, PGSIZE, V2P(mem), PTE_W|PTE_U) < 0){
cprintf("allocuvm out of memory (2)\n");
deallocuvm(pgdir, newsz, oldsz);
kfree(mem);
8010738e: 89 34 24 mov %esi,(%esp)
80107391: e8 4a af ff ff call 801022e0 <kfree>
return 0;
80107396: 31 c0 xor %eax,%eax
80107398: eb ba jmp 80107354 <allocuvm+0x94>
8010739a: 8b 4d 0c mov 0xc(%ebp),%ecx
8010739d: 89 fa mov %edi,%edx
8010739f: 8b 45 08 mov 0x8(%ebp),%eax
801073a2: e8 99 fa ff ff call 80106e40 <deallocuvm.part.0>
for(; a < newsz; a += PGSIZE){
mem = kalloc();
if(mem == 0){
cprintf("allocuvm out of memory\n");
deallocuvm(pgdir, newsz, oldsz);
return 0;
801073a7: 31 c0 xor %eax,%eax
801073a9: eb a9 jmp 80107354 <allocuvm+0x94>
801073ab: 90 nop
801073ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801073b0 <deallocuvm>:
// newsz. oldsz and newsz need not be page-aligned, nor does newsz
// need to be less than oldsz. oldsz can be larger than the actual
// process size. Returns the new process size.
int
deallocuvm(pde_t *pgdir, uint oldsz, uint newsz)
{
801073b0: 55 push %ebp
801073b1: 89 e5 mov %esp,%ebp
801073b3: 8b 55 0c mov 0xc(%ebp),%edx
801073b6: 8b 4d 10 mov 0x10(%ebp),%ecx
801073b9: 8b 45 08 mov 0x8(%ebp),%eax
pte_t *pte;
uint a, pa;
if(newsz >= oldsz)
801073bc: 39 d1 cmp %edx,%ecx
801073be: 73 08 jae 801073c8 <deallocuvm+0x18>
kfree(v);
*pte = 0;
}
}
return newsz;
}
801073c0: 5d pop %ebp
801073c1: e9 7a fa ff ff jmp 80106e40 <deallocuvm.part.0>
801073c6: 66 90 xchg %ax,%ax
801073c8: 89 d0 mov %edx,%eax
801073ca: 5d pop %ebp
801073cb: c3 ret
801073cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801073d0 <freevm>:
// Free a page table and all the physical memory pages
// in the user part.
void
freevm(pde_t *pgdir)
{
801073d0: 55 push %ebp
801073d1: 89 e5 mov %esp,%ebp
801073d3: 56 push %esi
801073d4: 53 push %ebx
801073d5: 83 ec 10 sub $0x10,%esp
801073d8: 8b 75 08 mov 0x8(%ebp),%esi
uint i;
if(pgdir == 0)
801073db: 85 f6 test %esi,%esi
801073dd: 74 59 je 80107438 <freevm+0x68>
801073df: 31 c9 xor %ecx,%ecx
801073e1: ba 00 00 00 80 mov $0x80000000,%edx
801073e6: 89 f0 mov %esi,%eax
panic("freevm: no pgdir");
deallocuvm(pgdir, KERNBASE, 0);
for(i = 0; i < NPDENTRIES; i++){
801073e8: 31 db xor %ebx,%ebx
801073ea: e8 51 fa ff ff call 80106e40 <deallocuvm.part.0>
801073ef: eb 12 jmp 80107403 <freevm+0x33>
801073f1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
801073f8: 83 c3 01 add $0x1,%ebx
801073fb: 81 fb 00 04 00 00 cmp $0x400,%ebx
80107401: 74 27 je 8010742a <freevm+0x5a>
if(pgdir[i] & PTE_P){
80107403: 8b 14 9e mov (%esi,%ebx,4),%edx
80107406: f6 c2 01 test $0x1,%dl
80107409: 74 ed je 801073f8 <freevm+0x28>
char * v = P2V(PTE_ADDR(pgdir[i]));
8010740b: 81 e2 00 f0 ff ff and $0xfffff000,%edx
uint i;
if(pgdir == 0)
panic("freevm: no pgdir");
deallocuvm(pgdir, KERNBASE, 0);
for(i = 0; i < NPDENTRIES; i++){
80107411: 83 c3 01 add $0x1,%ebx
if(pgdir[i] & PTE_P){
char * v = P2V(PTE_ADDR(pgdir[i]));
80107414: 81 c2 00 00 00 80 add $0x80000000,%edx
kfree(v);
8010741a: 89 14 24 mov %edx,(%esp)
8010741d: e8 be ae ff ff call 801022e0 <kfree>
uint i;
if(pgdir == 0)
panic("freevm: no pgdir");
deallocuvm(pgdir, KERNBASE, 0);
for(i = 0; i < NPDENTRIES; i++){
80107422: 81 fb 00 04 00 00 cmp $0x400,%ebx
80107428: 75 d9 jne 80107403 <freevm+0x33>
if(pgdir[i] & PTE_P){
char * v = P2V(PTE_ADDR(pgdir[i]));
kfree(v);
}
}
kfree((char*)pgdir);
8010742a: 89 75 08 mov %esi,0x8(%ebp)
}
8010742d: 83 c4 10 add $0x10,%esp
80107430: 5b pop %ebx
80107431: 5e pop %esi
80107432: 5d pop %ebp
if(pgdir[i] & PTE_P){
char * v = P2V(PTE_ADDR(pgdir[i]));
kfree(v);
}
}
kfree((char*)pgdir);
80107433: e9 a8 ae ff ff jmp 801022e0 <kfree>
freevm(pde_t *pgdir)
{
uint i;
if(pgdir == 0)
panic("freevm: no pgdir");
80107438: c7 04 24 ce 7f 10 80 movl $0x80107fce,(%esp)
8010743f: e8 ec 8e ff ff call 80100330 <panic>
80107444: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
8010744a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
80107450 <clearpteu>:
// Clear PTE_U on a page. Used to create an inaccessible
// page beneath the user stack.
void
clearpteu(pde_t *pgdir, char *uva)
{
80107450: 55 push %ebp
pte_t *pte;
pte = walkpgdir(pgdir, uva, 0);
80107451: 31 c9 xor %ecx,%ecx
// Clear PTE_U on a page. Used to create an inaccessible
// page beneath the user stack.
void
clearpteu(pde_t *pgdir, char *uva)
{
80107453: 89 e5 mov %esp,%ebp
80107455: 83 ec 18 sub $0x18,%esp
pte_t *pte;
pte = walkpgdir(pgdir, uva, 0);
80107458: 8b 55 0c mov 0xc(%ebp),%edx
8010745b: 8b 45 08 mov 0x8(%ebp),%eax
8010745e: e8 cd f8 ff ff call 80106d30 <walkpgdir>
if(pte == 0)
80107463: 85 c0 test %eax,%eax
80107465: 74 05 je 8010746c <clearpteu+0x1c>
panic("clearpteu");
*pte &= ~PTE_U;
80107467: 83 20 fb andl $0xfffffffb,(%eax)
}
8010746a: c9 leave
8010746b: c3 ret
{
pte_t *pte;
pte = walkpgdir(pgdir, uva, 0);
if(pte == 0)
panic("clearpteu");
8010746c: c7 04 24 df 7f 10 80 movl $0x80107fdf,(%esp)
80107473: e8 b8 8e ff ff call 80100330 <panic>
80107478: 90 nop
80107479: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80107480 <copyuvm>:
// Given a parent process's page table, create a copy
// of it for a child.
pde_t*
copyuvm(pde_t *pgdir, uint sz)
{
80107480: 55 push %ebp
80107481: 89 e5 mov %esp,%ebp
80107483: 57 push %edi
80107484: 56 push %esi
80107485: 53 push %ebx
80107486: 83 ec 2c sub $0x2c,%esp
pde_t *d;
pte_t *pte;
uint pa, i, flags;
char *mem;
if((d = setupkvm()) == 0)
80107489: e8 92 fb ff ff call 80107020 <setupkvm>
8010748e: 85 c0 test %eax,%eax
80107490: 89 45 e0 mov %eax,-0x20(%ebp)
80107493: 0f 84 b2 00 00 00 je 8010754b <copyuvm+0xcb>
return 0;
for(i = 0; i < sz; i += PGSIZE){
80107499: 8b 45 0c mov 0xc(%ebp),%eax
8010749c: 85 c0 test %eax,%eax
8010749e: 0f 84 9c 00 00 00 je 80107540 <copyuvm+0xc0>
801074a4: 31 db xor %ebx,%ebx
801074a6: eb 48 jmp 801074f0 <copyuvm+0x70>
panic("copyuvm: page not present");
pa = PTE_ADDR(*pte);
flags = PTE_FLAGS(*pte);
if((mem = kalloc()) == 0)
goto bad;
memmove(mem, (char*)P2V(pa), PGSIZE);
801074a8: 81 c7 00 00 00 80 add $0x80000000,%edi
801074ae: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp)
801074b5: 00
801074b6: 89 7c 24 04 mov %edi,0x4(%esp)
801074ba: 89 04 24 mov %eax,(%esp)
801074bd: e8 1e d6 ff ff call 80104ae0 <memmove>
if(mappages(d, (void*)i, PGSIZE, V2P(mem), flags) < 0)
801074c2: 8b 45 e4 mov -0x1c(%ebp),%eax
801074c5: 8d 96 00 00 00 80 lea -0x80000000(%esi),%edx
801074cb: 89 14 24 mov %edx,(%esp)
801074ce: b9 00 10 00 00 mov $0x1000,%ecx
801074d3: 89 da mov %ebx,%edx
801074d5: 89 44 24 04 mov %eax,0x4(%esp)
801074d9: 8b 45 e0 mov -0x20(%ebp),%eax
801074dc: e8 df f8 ff ff call 80106dc0 <mappages>
801074e1: 85 c0 test %eax,%eax
801074e3: 78 41 js 80107526 <copyuvm+0xa6>
uint pa, i, flags;
char *mem;
if((d = setupkvm()) == 0)
return 0;
for(i = 0; i < sz; i += PGSIZE){
801074e5: 81 c3 00 10 00 00 add $0x1000,%ebx
801074eb: 39 5d 0c cmp %ebx,0xc(%ebp)
801074ee: 76 50 jbe 80107540 <copyuvm+0xc0>
if((pte = walkpgdir(pgdir, (void *) i, 0)) == 0)
801074f0: 8b 45 08 mov 0x8(%ebp),%eax
801074f3: 31 c9 xor %ecx,%ecx
801074f5: 89 da mov %ebx,%edx
801074f7: e8 34 f8 ff ff call 80106d30 <walkpgdir>
801074fc: 85 c0 test %eax,%eax
801074fe: 74 5b je 8010755b <copyuvm+0xdb>
panic("copyuvm: pte should exist");
if(!(*pte & PTE_P))
80107500: 8b 30 mov (%eax),%esi
80107502: f7 c6 01 00 00 00 test $0x1,%esi
80107508: 74 45 je 8010754f <copyuvm+0xcf>
panic("copyuvm: page not present");
pa = PTE_ADDR(*pte);
8010750a: 89 f7 mov %esi,%edi
flags = PTE_FLAGS(*pte);
8010750c: 81 e6 ff 0f 00 00 and $0xfff,%esi
80107512: 89 75 e4 mov %esi,-0x1c(%ebp)
for(i = 0; i < sz; i += PGSIZE){
if((pte = walkpgdir(pgdir, (void *) i, 0)) == 0)
panic("copyuvm: pte should exist");
if(!(*pte & PTE_P))
panic("copyuvm: page not present");
pa = PTE_ADDR(*pte);
80107515: 81 e7 00 f0 ff ff and $0xfffff000,%edi
flags = PTE_FLAGS(*pte);
if((mem = kalloc()) == 0)
8010751b: e8 70 af ff ff call 80102490 <kalloc>
80107520: 85 c0 test %eax,%eax
80107522: 89 c6 mov %eax,%esi
80107524: 75 82 jne 801074a8 <copyuvm+0x28>
goto bad;
}
return d;
bad:
freevm(d);
80107526: 8b 45 e0 mov -0x20(%ebp),%eax
80107529: 89 04 24 mov %eax,(%esp)
8010752c: e8 9f fe ff ff call 801073d0 <freevm>
return 0;
80107531: 31 c0 xor %eax,%eax
}
80107533: 83 c4 2c add $0x2c,%esp
80107536: 5b pop %ebx
80107537: 5e pop %esi
80107538: 5f pop %edi
80107539: 5d pop %ebp
8010753a: c3 ret
8010753b: 90 nop
8010753c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80107540: 8b 45 e0 mov -0x20(%ebp),%eax
80107543: 83 c4 2c add $0x2c,%esp
80107546: 5b pop %ebx
80107547: 5e pop %esi
80107548: 5f pop %edi
80107549: 5d pop %ebp
8010754a: c3 ret
pte_t *pte;
uint pa, i, flags;
char *mem;
if((d = setupkvm()) == 0)
return 0;
8010754b: 31 c0 xor %eax,%eax
8010754d: eb e4 jmp 80107533 <copyuvm+0xb3>
for(i = 0; i < sz; i += PGSIZE){
if((pte = walkpgdir(pgdir, (void *) i, 0)) == 0)
panic("copyuvm: pte should exist");
if(!(*pte & PTE_P))
panic("copyuvm: page not present");
8010754f: c7 04 24 03 80 10 80 movl $0x80108003,(%esp)
80107556: e8 d5 8d ff ff call 80100330 <panic>
if((d = setupkvm()) == 0)
return 0;
for(i = 0; i < sz; i += PGSIZE){
if((pte = walkpgdir(pgdir, (void *) i, 0)) == 0)
panic("copyuvm: pte should exist");
8010755b: c7 04 24 e9 7f 10 80 movl $0x80107fe9,(%esp)
80107562: e8 c9 8d ff ff call 80100330 <panic>
80107567: 89 f6 mov %esi,%esi
80107569: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80107570 <uva2ka>:
//PAGEBREAK!
// Map user virtual address to kernel address.
char*
uva2ka(pde_t *pgdir, char *uva)
{
80107570: 55 push %ebp
pte_t *pte;
pte = walkpgdir(pgdir, uva, 0);
80107571: 31 c9 xor %ecx,%ecx
//PAGEBREAK!
// Map user virtual address to kernel address.
char*
uva2ka(pde_t *pgdir, char *uva)
{
80107573: 89 e5 mov %esp,%ebp
80107575: 83 ec 08 sub $0x8,%esp
pte_t *pte;
pte = walkpgdir(pgdir, uva, 0);
80107578: 8b 55 0c mov 0xc(%ebp),%edx
8010757b: 8b 45 08 mov 0x8(%ebp),%eax
8010757e: e8 ad f7 ff ff call 80106d30 <walkpgdir>
if((*pte & PTE_P) == 0)
80107583: 8b 00 mov (%eax),%eax
80107585: 89 c2 mov %eax,%edx
80107587: 83 e2 05 and $0x5,%edx
return 0;
if((*pte & PTE_U) == 0)
8010758a: 83 fa 05 cmp $0x5,%edx
8010758d: 75 11 jne 801075a0 <uva2ka+0x30>
return 0;
return (char*)P2V(PTE_ADDR(*pte));
8010758f: 25 00 f0 ff ff and $0xfffff000,%eax
80107594: 05 00 00 00 80 add $0x80000000,%eax
}
80107599: c9 leave
8010759a: c3 ret
8010759b: 90 nop
8010759c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
pte = walkpgdir(pgdir, uva, 0);
if((*pte & PTE_P) == 0)
return 0;
if((*pte & PTE_U) == 0)
return 0;
801075a0: 31 c0 xor %eax,%eax
return (char*)P2V(PTE_ADDR(*pte));
}
801075a2: c9 leave
801075a3: c3 ret
801075a4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801075aa: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
801075b0 <copyout>:
// Copy len bytes from p to user address va in page table pgdir.
// Most useful when pgdir is not the current page table.
// uva2ka ensures this only works for PTE_U pages.
int
copyout(pde_t *pgdir, uint va, void *p, uint len)
{
801075b0: 55 push %ebp
801075b1: 89 e5 mov %esp,%ebp
801075b3: 57 push %edi
801075b4: 56 push %esi
801075b5: 53 push %ebx
801075b6: 83 ec 1c sub $0x1c,%esp
801075b9: 8b 5d 14 mov 0x14(%ebp),%ebx
801075bc: 8b 4d 0c mov 0xc(%ebp),%ecx
801075bf: 8b 7d 10 mov 0x10(%ebp),%edi
char *buf, *pa0;
uint n, va0;
buf = (char*)p;
while(len > 0){
801075c2: 85 db test %ebx,%ebx
801075c4: 75 3a jne 80107600 <copyout+0x50>
801075c6: eb 68 jmp 80107630 <copyout+0x80>
va0 = (uint)PGROUNDDOWN(va);
pa0 = uva2ka(pgdir, (char*)va0);
if(pa0 == 0)
return -1;
n = PGSIZE - (va - va0);
801075c8: 8b 4d e4 mov -0x1c(%ebp),%ecx
801075cb: 89 f2 mov %esi,%edx
if(n > len)
n = len;
memmove(pa0 + (va - va0), buf, n);
801075cd: 89 7c 24 04 mov %edi,0x4(%esp)
while(len > 0){
va0 = (uint)PGROUNDDOWN(va);
pa0 = uva2ka(pgdir, (char*)va0);
if(pa0 == 0)
return -1;
n = PGSIZE - (va - va0);
801075d1: 29 ca sub %ecx,%edx
801075d3: 81 c2 00 10 00 00 add $0x1000,%edx
801075d9: 39 da cmp %ebx,%edx
801075db: 0f 47 d3 cmova %ebx,%edx
if(n > len)
n = len;
memmove(pa0 + (va - va0), buf, n);
801075de: 29 f1 sub %esi,%ecx
801075e0: 01 c8 add %ecx,%eax
801075e2: 89 54 24 08 mov %edx,0x8(%esp)
801075e6: 89 04 24 mov %eax,(%esp)
801075e9: 89 55 e4 mov %edx,-0x1c(%ebp)
801075ec: e8 ef d4 ff ff call 80104ae0 <memmove>
len -= n;
buf += n;
801075f1: 8b 55 e4 mov -0x1c(%ebp),%edx
va = va0 + PGSIZE;
801075f4: 8d 8e 00 10 00 00 lea 0x1000(%esi),%ecx
n = PGSIZE - (va - va0);
if(n > len)
n = len;
memmove(pa0 + (va - va0), buf, n);
len -= n;
buf += n;
801075fa: 01 d7 add %edx,%edi
{
char *buf, *pa0;
uint n, va0;
buf = (char*)p;
while(len > 0){
801075fc: 29 d3 sub %edx,%ebx
801075fe: 74 30 je 80107630 <copyout+0x80>
va0 = (uint)PGROUNDDOWN(va);
pa0 = uva2ka(pgdir, (char*)va0);
80107600: 8b 45 08 mov 0x8(%ebp),%eax
char *buf, *pa0;
uint n, va0;
buf = (char*)p;
while(len > 0){
va0 = (uint)PGROUNDDOWN(va);
80107603: 89 ce mov %ecx,%esi
80107605: 81 e6 00 f0 ff ff and $0xfffff000,%esi
pa0 = uva2ka(pgdir, (char*)va0);
8010760b: 89 74 24 04 mov %esi,0x4(%esp)
char *buf, *pa0;
uint n, va0;
buf = (char*)p;
while(len > 0){
va0 = (uint)PGROUNDDOWN(va);
8010760f: 89 4d e4 mov %ecx,-0x1c(%ebp)
pa0 = uva2ka(pgdir, (char*)va0);
80107612: 89 04 24 mov %eax,(%esp)
80107615: e8 56 ff ff ff call 80107570 <uva2ka>
if(pa0 == 0)
8010761a: 85 c0 test %eax,%eax
8010761c: 75 aa jne 801075c8 <copyout+0x18>
len -= n;
buf += n;
va = va0 + PGSIZE;
}
return 0;
}
8010761e: 83 c4 1c add $0x1c,%esp
buf = (char*)p;
while(len > 0){
va0 = (uint)PGROUNDDOWN(va);
pa0 = uva2ka(pgdir, (char*)va0);
if(pa0 == 0)
return -1;
80107621: b8 ff ff ff ff mov $0xffffffff,%eax
len -= n;
buf += n;
va = va0 + PGSIZE;
}
return 0;
}
80107626: 5b pop %ebx
80107627: 5e pop %esi
80107628: 5f pop %edi
80107629: 5d pop %ebp
8010762a: c3 ret
8010762b: 90 nop
8010762c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80107630: 83 c4 1c add $0x1c,%esp
memmove(pa0 + (va - va0), buf, n);
len -= n;
buf += n;
va = va0 + PGSIZE;
}
return 0;
80107633: 31 c0 xor %eax,%eax
}
80107635: 5b pop %ebx
80107636: 5e pop %esi
80107637: 5f pop %edi
80107638: 5d pop %ebp
80107639: c3 ret
| liadgi/Assignment2 | kernel.asm | Assembly | mit | 732,653 |
processor 6502
include "macros.asm"
include "standard.asm"
include "loadingPictureConstants.inc"
ORG $1001
DC.W $100B,0
DC.B $9E,"4109",0,0,0 ; SYS4107
JMP MAINPRG
ORG $1800,$00
include "fw_interface.asm"
include "fw_bootstrap.asm"
TEXTCOLOR = $71
ORG $5800
ds.b $800,$00
;--------------------------------------------------------------------
; Hauptprogramm (Init)
;--------------------------------------------------------------------
MAINPRG SUBROUTINE
jsr waitFrame
lda #$00
sta $ff15
sta $ff19
sei
lda $ff13
sta .yo + 1
and #%11111101
; bit 2=1 auf slow
sta $ff13
.yo
lda #$44
ora #%00000010
sta $ff13
lda #$00
sta $ff11
jsr waitFrame
lda #%01011000 ; adress 5800 ff14
sta $ff14
lda #$01
sta $ff3e
cli
lda #$00
jsr fw_init
; lda #$01
; sta fw_song_off
sei
sta $ff3f
lda #$00
sta $ff0a
lda $ff09
sta $ff09
ldy #$04
lda #$00
.0 sta $0000,y
iny
bne .0
jsr fw_run
cli
lda #<LUMRAM
sta .read + 1
lda #>LUMRAM
sta .read + 2
lda #<$b800
sta .write + 1
lda #>$b800
sta .write + 2
ldx #$28
.reloop2
ldy #$00
.reloop
.read
lda $4444,y
.write
sta $4444,y
iny
bne .reloop
inc .read + 2
inc .write + 2
dex
bne .reloop2
jsr waitFrame
lda #$01
.waitb
bit $ff1c
beq .waitb
lda #$fe
.a
cmp $ff1d
bne .a
jsr displayInfoScreen
;-------------------------------------------------------------------
; verticalSmoothscrollposition3 - 25Rows - BlankScreen
;-------------------------------------------------------------------
;lda #%00111011
lda #$0b
sta $ff06
;-------------------------------------------------------------------
; char reversing of | multicolor
;-------------------------------------------------------------------
lda #%10011000
sta $ff07
;-------------------------------------------------------------------
; bitmap adress 2000 - bitmap from ram - prevail voice frequencies
;-------------------------------------------------------------------
lda $ff12
and #%11000011
ora #%00110000 ; c000
sta $ff12
;-------------------------------------------------------------------
; font adress 3800
;-------------------------------------------------------------------
lda $ff13
and #%00000101
ora #%00111000 ; bit 2=1 auf slow
sta $ff13
ldx #%10111000 ; adress b800 ff14
stx $ff14
lda #loadingFrontColor
sta $ff16
jsr FADEINAMIGA
jmp loadNext
waitFrame SUBROUTINE
lda #$01
.waitb
bit $ff1c
beq .waitb
.waita
bit $ff1c
bne .waita
rts
include "fadein.asm"
INFOSCREEN
incbin "infoscreen.bin"
INFOCHARSET
incbin "infocharset.bin"
displayInfoScreen SUBROUTINE
lda #$0b
sta $ff06
;-------------------------------------------------------------------
; char reversing of | no multicolor
;-------------------------------------------------------------------
lda #%10001000
sta $ff07
lda #%00011000 ; 1800
sta $ff14
;-------------------------------------------------------------------
; bitmap adress 2000 - bitmap from ram - prevail voice frequencies
;-------------------------------------------------------------------
lda $ff12
and #%11000011
ora #%00110000 ; c000
sta $ff12
;-------------------------------------------------------------------
; font adress 2000
;-------------------------------------------------------------------
lda $ff13
and #%00000101
ora #%00100000 ; bit 2=1 auf slow
sta $ff13
ldx #$00
.b
Y SET 0
REPEAT $08
lda INFOCHARSET + Y * $100,x
sta $2000 + Y * $100,x
Y SET Y + 1
REPEND
inx
bne .b
ldx #$00
.next
lda INFOSCREEN + $100*0,x
sta $1c00 + $100*0,x
lda INFOSCREEN + $100*1,x
sta $1c00 + $100*1,x
lda INFOSCREEN + $100*2,x
sta $1c00 + $100*2,x
lda INFOSCREEN + $100*3,x
sta $1c00 + $100*3,x
lda #$00
sta $1800 + $100*0,x
sta $1800 + $100*1,x
sta $1800 + $100*2,x
sta $1800 + $100*3,x
inx
bne .next
;-------------------------------------------------------------------
; bitmap mode
;-------------------------------------------------------------------
lda #%00011011
sta $ff06
Y SET 0
REPEAT $07
jsr waitFrame
jsr waitFrame
jsr waitFrame
lda #[Y * $10] + [TEXTCOLOR & $0f]
sta $ff15
Y SET Y + 1
REPEND
ldx #250
.a
jsr waitFrame
dex
bne .a
Y SET 0
REPEAT $07
jsr waitFrame
jsr waitFrame
jsr waitFrame
lda #[[6-Y] * $10] + [TEXTCOLOR & $0f]
sta $ff15
Y SET Y + 1
REPEND
rts
ORG $f500 - $2800
LUMRAM
incbin "loadingPictureLumi.bin"
ds.b 24,0
COLRAM
incbin "loadingPictureColi.bin"
ds.b 24,0
BITMAP
incbin "loadingPicture.bin"
ORG $f500
fname dc.b "STARTPIC",$00
;--------------------------------------------------------------------------------------------------
; loadNext SUBROUTINE
;--------------------------------------------------------------------------------------------------
loadNext SUBROUTINE
ldx #<fname
ldy #>fname
LOAD_NORMAL
ldx fw_load_end + 0
ldy fw_load_end + 1
jsr fw_decrunch
jmp ENTRYPOINT_STARTPICTURE ; STARTPICTURE
echo "eof: ",.
| kosmonautdnb/TheLandsOfZador | Bootloader/_code/GlobalCode/demopart (Rainer Mührs in Konflikt stehende Kopie 2015-07-29).asm | Assembly | mit | 4,948 |
;//////////////////////////////////////////////////////////////////////////////;
;/// void drawRect(int x, int y, int width, int height, int color) ///;
;//////////////////////////////////////////////////////////////////////////////;
; Label for procedure.
drawRect:
;//////////////////////////////////////////////////////////////////////////////;
;/// Initialization code. ///;
;//////////////////////////////////////////////////////////////////////////////;
; Create stack frame.
push bp
mov bp,sp
; Define aliases for arguments.
%define .arg0 bp+4
%define .arg1 bp+6
%define .arg2 bp+8
%define .arg3 bp+10
%define .arg4 bp+12
; Define aliases for local variables.
%define .x bp-10
%define .y bp-8
%define .width bp-6
%define .height bp-4
%define .color bp-2
; Allocate space for local variables on the stack.
sub sp,10
; Make local copies of arguments.
mov ax,[.arg0]
mov [.x],ax
mov ax,[.arg1]
mov [.y],ax
mov ax,[.arg2]
mov [.width],ax
mov ax,[.arg3]
mov [.height],ax
mov ax,[.arg4]
mov [.color],ax
; Preserve register state.
push bx
push cx
push dx
push di
push es
;//////////////////////////////////////////////////////////////////////////////;
;/// Procedure code. ///;
;//////////////////////////////////////////////////////////////////////////////;
mov ax,[.width]
test ax,ax
jz .exit
mov ax,[.height]
test ax,ax
jz .exit
mov ax,GFXSEG
mov es,ax
mov ax,[.y]
mov dx,320
mul dx
add ax,[.x]
mov dx,ax
mov al,[.color]
mov di,dx
mov cx,[.width]
rep stosb
dec di
mov cx,[.height]
dec cx
jz .exit
.right: add di,320
mov byte [es:di],al
loop .right
mov di,dx
mov cx,[.height]
dec cx
jz .exit
.left: add di,320
mov byte [es:di],al
loop .left
mov cx,[.width]
rep stosb
.exit:
;//////////////////////////////////////////////////////////////////////////////;
;/// Deinitialization code. ///;
;//////////////////////////////////////////////////////////////////////////////;
; Restore register state.
pop es
pop di
pop dx
pop cx
pop bx
; Free local variable stack space.
add sp,10
; Release stack frame and return.
pop bp
ret | richgieg/RichOS | src/boot/graphics/drawRect.asm | Assembly | mit | 3,084 |
section .multiboot_header
header_start:
dd 0xe85250d6 ; magic number (multiboot 2)
dd 0 ; architecture 0 (protected mode i386)
dd header_end - header_start ; header length
; checksum
dd 0x100000000 - (0xe85250d6 + 0 + (header_end - header_start))
; insert optional multiboot tags here
; required end tag
dw 0 ; type
dw 0 ; flags
dd 8 ; size
header_end:
| scrogson/cosmos | src/arch/x86_64/multiboot_header.asm | Assembly | mit | 424 |
.686
.model flat
.xmm
.data
___unnamed_float_0 dd 040000000h
public ___unnamed_float_0
___unnamed_float_1 dd 03f800000h
public ___unnamed_float_1
___unnamed_float_2 dd 040400000h
public ___unnamed_float_2
___unnamed_float_3 dd 040800000h
public ___unnamed_float_3
.code
_test1 proc
push ebp
mov ebp,esp
sub esp,4
movss xmm0,dword ptr [ebp+8]
movss dword ptr [ebp-4],xmm0
movss xmm0,dword ptr [ebp-4]
addss xmm0,dword ptr [___unnamed_float_0]
movss dword ptr [ebp-4],xmm0
movss xmm0,dword ptr [ebp-4]
movss dword ptr [ebp+8],xmm0
movss xmm0,dword ptr [ebp+8]
add esp,4
pop ebp
ret
_test1 endp
_test2 proc
push ebp
mov ebp,esp
movss xmm0,dword ptr [ebp+8]
addss xmm0,dword ptr [___unnamed_float_0]
pop ebp
ret
_test2 endp
_test proc
push ebp
mov ebp,esp
movss xmm0,dword ptr [___unnamed_float_1]
movss dword ptr [esp-4],xmm0
sub esp,4
call _test1
add esp,4
comiss xmm0,dword ptr [___unnamed_float_2]
je label0000
mov eax,1
pop ebp
ret
label0000:
movss xmm0,dword ptr [___unnamed_float_0]
movss dword ptr [esp-4],xmm0
sub esp,4
call _test2
add esp,4
comiss xmm0,dword ptr [___unnamed_float_3]
je label0001
mov eax,2
pop ebp
ret
label0001:
mov eax,0
pop ebp
ret
_test endp
end
| artyompal/C-compiler | cc4x86/tests/regressive/asm_listings/float2_.asm | Assembly | mit | 1,783 |
;*****************************************************************
;* - Description: Device definition file for RC Calibration
;* - File: t84.asm
;* - AppNote: AVR053 - Production calibration of the
;* RC oscillator
;*
;* - Author: Atmel Corporation: http://www.atmel.com
;* Support email: avr@atmel.com
;*
;* $Name$
;* $Revision: 56 $
;* $RCSfile$
;* $Date: 2006-02-16 17:44:45 +0100 (to, 16 feb 2006) $
;*****************************************************************
.include "tn84def.inc"
.include "Common\memoryMap.inc"
.include "Device specific\t24_family_pinout.inc"
.EQU OSC_VER = 5
.equ TCCR0 = TCCR0B
.equ TIFR = TIFR0
.equ EEMWE = EEMPE
.equ EEWE = EEPE
| smart-electro/BMS_SLAVE_V2.0 | Software/AtTiny_programmer/RC calib Projekt/Device specific/t84.asm | Assembly | cc0-1.0 | 742 |
DEVICE ZXSPECTRUMNEXT : SLOT 7 : LABELSLIST "incbin80k.lbl"
; incbin80k.bin is from offset 2 letters 'a' to 't' with linux newlines (byte 10)
; for each letter, there's 80 of them + newline, repeated 51 times
; such one letter block = 51*81 = 4131 bytes (just over 4ki), there's 20 letters
; = 82620 bytes (plus 2 bytes at beginning making it "binary" file for git)
; try short incbin (no paging) first into page 20
ORG 0xE000
MMU 7 n, 20
short_start:
INCBIN "incbin80k/incbin80k.bin",2,81
short_end:
ASSERT $$ == 20 && $ == 0xE000 + 81
ASSERT {0xE000} == "aa" && {0xE000+79} == "\na"
; try 3-page long incbin into pages 21, 22, 23
MMU 7 n, 21
ORG 0xE000
p3_start:
INCBIN "incbin80k/incbin80k.bin",2,81*51*4 ; include four letters (16524 bytes)
p3_end:
PAGE 21 : ASSERT {0xE000} == "aa" && {0xE000+79} == "\na" && {0xE000+81*51} == "bb" && {0xFFFE} == "bb"
PAGE 22 : ASSERT {0xE000} == "bb" && {0xE000+81*102-0x2000-2} == "\nb"
ASSERT {0xE000+81*102-0x2000} == "cc" && {0xE000+81*153-0x2000-2} == "\nc"
ASSERT {0xE000+81*153-0x2000} == "dd" && {0xFFFE} == "dd"
PAGE 23 : ASSERT {0xE000} == "dd" && {0xE000+81*204-0x4000-2} == "\nd"
ASSERT {0xE000+81*204-0x4000} == 0
; try error by including beyond device RAM range
MMU 7, 23 ; reset wrapping behaviour for slot 7, keep page 23
err_start:
INCBIN "incbin80k/incbin80k.bin",2,81*51*2 ; include two letters (8+ki)
err_end:
; try full length 80+ki binary include
MMU 7 n, 30 ; map pages 30, 31, 32, .., 40 (11 pages long)
ORG 0xE000
long_start:
INCBIN "incbin80k/incbin80k.bin",2 ; include 20 letters from offset 2
long_end:
PAGE 30 : ASSERT {0xE000} == "aa" && {0xE000+79} == "\na" && {0xE000+81*51} == "bb" && {0xFFFE} == "bb"
PAGE 31 : ASSERT {0xE000} == "bb" && {0xE000+81*102-0x2000-2} == "\nb"
ASSERT {0xE000+81*102-0x2000} == "cc" && {0xE000+81*153-0x2000-2} == "\nc"
ASSERT {0xE000+81*153-0x2000} == "dd" && {0xFFFE} == "dd"
PAGE 32 : ASSERT {0xE000} == "dd" && {0xE000+81*204-0x4000-2} == "\nd"
ASSERT {0xE000+81*204-0x4000} == "ee" && {0xE000+81*255-0x4000-2} == "\ne"
PAGE 37 : ASSERT {0xE000} == "nn" && {0xE000+81*51*14-0xE000-2} == "\nn"
ASSERT {0xE000+81*51*14-0xE000} == "oo" && {0xE000+81*51*15-0xE000-2} == "\no"
ASSERT {0xE000+81*51*15-0xE000} == "pp" && {0xFFFE} == "pp"
PAGE 38 : ASSERT {0xE000} == "pp" && {0xE000+81*51*16-0x10000-2} == "\np"
ASSERT {0xE000+81*51*16-0x10000} == "qq" && {0xE000+81*51*17-0x10000-2} == "\nq"
ASSERT {0xE000+81*51*17-0x10000} == "rr" && {0xFFFE} == "rr"
PAGE 40 : ASSERT {0xE000} == "tt" && {0xE000+81*51*20-0x14000-2} == "\nt"
ASSERT {0xE000+81*51*20-0x14000} == 0 && {0xFFFE} == 0
; incbin in no-device mode: includes whole file, addressing goes into 16+ bit realm
DEVICE NONE
ORG 0xE000
nodevice_start:
INCBIN "incbin80k/incbin80k.bin",2 ; include 20 letters from offset 2
nodevice_end: ; emits warning about going over 0x10000
; switch back to ZX Next to produce labels list
ORG 0 : DEVICE ZXSPECTRUMNEXT ; slot 7 is still in "wrap", but $ is beyond (error) => org 0 needed
; one more test of case when even wrapping MMU runs out of next pages
MMU 7 n, 222 ; two pages left: 222, 223, try to include 3 pages
ORG 0xE000
noram_start: ; emit error of running out of free memory pages
INCBIN "incbin80k/incbin80k.bin",2,81*51*4 ; include four letters (16524 bytes)
noram_end:
PAGE 222 : ASSERT {0xE000} == "aa" && {0xE000+79} == "\na" && {0xE000+81*51} == "bb" && {0xFFFE} == "bb"
PAGE 223 : ASSERT {0xE000} == "bb" && {0xE000+81*102-0x2000-2} == "\nb"
ASSERT {0xE000+81*102-0x2000} == "cc" && {0xE000+81*153-0x2000-2} == "\nc"
ASSERT {0xE000+81*153-0x2000} == "dd" && {0xFFFE} == "dd"
nop ; check error message wording in case of further write
| z00m128/sjasmplus | tests/devices/incbin80k/incbin80k.asm | Assembly | bsd-3-clause | 4,025 |
format coff
public encode
public encode as '_encode'
encode:
mov edx,[esp+8]
mov ecx,[esp+4]
file 'bin\encode.bin'
public decode
public decode as '_decode'
decode:
mov edx,[esp+8]
mov ecx,[esp+4]
file 'bin\decode.bin'
| leiacoder/fde32 | fde32.asm | Assembly | bsd-2-clause | 251 |
;; Licensed to the .NET Foundation under one or more agreements.
;; The .NET Foundation licenses this file to you under the MIT license.
;; See the LICENSE file in the project root for more information.
LEAF_ENTRY macro Name, Section
Section segment para 'CODE'
align 16
public Name
Name proc
endm
LEAF_END macro Name, Section
Name endp
Section ends
endm
.data
g_methodEntrypointThunk qword 0 ; The method which operates on universal transition
g_universalTransition qword 0 ; The address of Redhawk's UniversalTransition thunk
.code
; - TAILCALL_RAX: ("jmp rax") should be used for tailcalls, this emits an instruction
; sequence which is recognized by the unwinder as a valid epilogue terminator
TAILJMP_RAX TEXTEQU <DB 048h, 0FFh, 0E0h>
PointerSize equ 8
;;
;; __jmpstub__MethodEntrypointStubs_CommonCallingStub(?)
;; Used when we dynamically need a VTableResolver not pre-generated
;;
;; r10 contains a pointer to a VTableResolverStruct
;; struct MethodEntryPointStubInfo
;; {
;; IntPtr targetCodePointer;
;; IntPtr MethodEntrypointStructPointer;
;; };
;;
LEAF_ENTRY __jmpstub__MethodEntrypointStubs_CommonCallingStub, _TEXT
;; r10 <- stub info
mov rax, [r10]
cmp rax, 0
je SLOW_PATH
mov rax, [r10]
TAILJMP_RAX
SLOW_PATH:
mov r11, [r10 + 8]
mov r10, g_methodEntrypointThunk
mov rax, g_universalTransition
TAILJMP_RAX
LEAF_END __jmpstub__MethodEntrypointStubs_CommonCallingStub, _TEXT
;; Returns the size of the pre-generated thunks
;; IntPtr MethodEntrypointStubs_SetupPointers(
;; IntPtr universalTransition,
;; IntPtr methodEntrypointThunk)
;;
LEAF_ENTRY MethodEntrypointStubs_SetupPointers, _TEXT
mov g_universalTransition, rcx
mov g_methodEntrypointThunk, rdx
lea rax, [__jmpstub__MethodEntrypointStubs_CommonCallingStub]
ret
LEAF_END MethodEntrypointStubs_SetupPointers, _TEXT
end
| zenos-os/zenos | vendor/corert/src/Native/System.Private.TypeLoader.Native/amd64/MethodEntrypointStubs.asm | Assembly | mit | 2,061 |
list p=18f4550
#include <p18f4550.inc>
CONFIG FOSC = XT_XT ; Oscillator Selection bits (XT oscillator (XT))
CONFIG PWRT = ON ; Power-up Timer Enable bit (PWRT enabled)
CONFIG BOR = OFF ; Brown-out Reset Enable bits (Brown-out Reset disabled in hardware and software)
CONFIG WDT = OFF ; Watchdog Timer Enable bit (WDT disabled (control is placed on the SWDTEN bit))
CONFIG PBADEN = OFF ; PORTB A/D Enable bit (PORTB<4:0> pins are configured as digital I/O on Reset)
CONFIG MCLRE = ON ; MCLR Pin Enable bit (RE3 input pin enabled; MCLR pin disabled)
CONFIG LVP = OFF ; Single-Supply ICSP Enable bit (Single-Supply ICSP disabled)
cblock 0x020 ;Bloque de variable para delaymon
var1
var2
var3
endc
posicion EQU 0x030
org 0x0200
flamita db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x99,0xBD,0x42,0x24
flamita2 db 0x24,0x18,0x00,0x24,0x4A,0xD3,0x91,0x89,0xDB,0x76,0x18,0x00,0x3C,0x42
flamita3 db 0x99,0xBD,0x42,0x24,0x24,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
org 0x0300
foquito db 0x3C,0x42,0x99,0xBD,0x42,0x24,0x24,0x18
org 0x0000 ;Vector de RESET
goto confego
org 0x0008 ;Vector de INTERUPCION ALTA
goto enterrop
org 0x0020
confego:
clrf TRISB ;Puertos como salida RB y RD
clrf TRISD
movlw HIGH flamita ;Asignando una dirección al TBLPTR
movwf TBLPTRH
movlw LOW flamita
movwf TBLPTRL
setf LATD ;Condicion inicial de las columnas (apagadas)
movlw 0xC8
movwf T0CON ;Timer0 con FOSC/4, PSC 1:1
movlw .176
movwf TMR0L ;Cuenta inicial del TMR0
movlw 0xA0
movwf INTCON ;Habilitamos interrupciones para el TMR0
inicio:
clrf posicion
bucle:
call delaymon
incf posicion, f
movlw .32
cpfseq posicion ;Preguntamos si posicion=16
goto otraso
bucl2:
call delaymon
decfsz posicion, f
goto otraso2
goto inicio
otraso:
movlw .17
cpfseq posicion
goto bucle
call delaymon
call delaymon
call delaymon
call delaymon
call delaymon
call delaymon
call delaymon
call delaymon
call delaymon
goto bucle
otraso2:
movlw .17
cpfseq posicion
goto bucl2
call delaymon
call delaymon
call delaymon
call delaymon
call delaymon
call delaymon
call delaymon
call delaymon
call delaymon
goto bucl2
enterrop:
movf posicion, W
movwf TBLPTRL
TBLRD*+
movff TABLAT, LATD
bcf LATB, 7
nop
bsf LATB, 7
TBLRD*+
movff TABLAT, LATD
bcf LATB, 6
nop
bsf LATB, 6
TBLRD*+
movff TABLAT, LATD
bcf LATB, 5
nop
bsf LATB, 5
TBLRD*+
movff TABLAT, LATD
bcf LATB, 4
nop
bsf LATB, 4
TBLRD*+
movff TABLAT, LATD ;33us
bcf LATB, 3
nop
bsf LATB, 3
TBLRD*+
movff TABLAT, LATD
bcf LATB, 2
nop
bsf LATB, 2
TBLRD*+
movff TABLAT, LATD
bcf LATB, 1
nop
bsf LATB, 1
TBLRD*
movff TABLAT, LATD
bcf LATB, 0
nop
bsf LATB, 0
bcf INTCON, TMR0IF ;Bajamos la bandera de desborde de TMR0
movlw .176
movwf TMR0L ;Precargamos cuenta en TMR0
retfie ;59us
delaymon:
movlw .100
movwf var1
otro1:
call anid1
decfsz var1, f
goto otro1
return
anid1:
movlw .10
movwf var2
otro2:
call anid2
decfsz var2, f
goto otro2
return
anid2:
movlw .10
movwf var3
otro3:
nop
decfsz var3, f
goto otro3
return
end
| tocache/picomones | UPC Microcontroladores 2019-2/Semana 5/sem5_sm.X/maincode.asm | Assembly | cc0-1.0 | 3,628 |
Map_361FAE: dc.w Frame_361FB6-Map_361FAE
dc.w Frame_361FBE-Map_361FAE
dc.w Frame_361FC6-Map_361FAE
dc.w Frame_361FCE-Map_361FAE
Frame_361FB6: dc.w 1
dc.b $F8, 5, 0, 0,$FF,$F8
Frame_361FBE: dc.w 1
dc.b $F8, 5, 0, 4,$FF,$F8
Frame_361FC6: dc.w 1
dc.b $F8, 5, 0, 8,$FF,$F8
Frame_361FCE: dc.w 1
dc.b $F8, 5, 0, $C,$FF,$F8
| TeamASM-Blur/Sonic-3-Blue-Balls-Edition | Working Disassembly/General/Sprites/Star Pointer/Map - Star Pointer.asm | Assembly | apache-2.0 | 342 |
; interrupt vector
section reset
rjmp reset
rjmp unhandled
rjmp unhandled
rjmp unhandled
rjmp unhandled
rjmp unhandled
rjmp unhandled
rjmp unhandled
rjmp unhandled
rjmp unhandled
rjmp unhandled
rjmp unhandled
rjmp unhandled
unhandled:
reti
global bsp_init
global bsp_putc
global main_main
reset:
ldi r16, 0x8
out 0x3e, r16 ; Setup stack pointer (SPH)
ldi r16, 0xff
out 0x3d, r16 ; SPL
call __do_copy_data
call bsp_init
; sei ; enable interrupts
call main_main
; end of transmission:
ldi r24, 4
call bsp_putc
endless:
rjmp endless
section init2
; load data section from program memory to RAM:
global __data_end
global __data_start
global __data_load_start
__do_copy_data:
ldi r16, low(__data_end)
ldi r17, high(__data_end)
; X at data start:
ldi r26, low(__data_start)
ldi r27, high(__data_start)
; Z at program memory:
ldi r30, low(__data_load_start)
ldi r31, high(__data_load_start)
__do_copy_data_loop:
lpm r0, Z+
st X+, r0
cp r26, r16
cpc r27, r17
brne __do_copy_data_loop
ret
| windelbouwman/ppci-mirror | examples/avr/glue.asm | Assembly | bsd-2-clause | 1,059 |
.global JpegTest0Pixels
.global JpegTest0PixelsSize
JpegTest0Pixels:
.incbin "jpeg/test0.jpg"
JpegTest0PixelsSize=.-JpegTest0Pixels
| tokoro10g/stm32plus | examples/lds285/JpegPixels.asm | Assembly | bsd-3-clause | 137 |
{ 'abc_class': 'AbcFile'
, 'minor_version': 16
, 'major_version': 46
, 'int_pool': [ undefined
, '10000' ]
, 'uint_pool': [ undefined ]
, 'double_pool': [ undefined
, '3.14' ]
, 'utf8_pool': [ undefined
, ''
, 'Object'
, 'Array'
, 'RegExp'
, 's1'
, 's2'
, 'b1'
, 'b2'
, 'n1'
, 'n2'
, 'n3'
, 'hello'
, 'print'
, 'expecting s1=hello'
, 'expecting s2=hello'
, 'expecting b1=true'
, 'expecting b2=false'
, 'expecting n1=10000'
, 'expecting n2=-10000'
, 'expecting n3=3.14' ]
, 'namespace_pool': [ undefined
, { 'kind': 'PackageNamespace'
, 'utf8': 1 }
, { 'kind': 'Namespace'
, 'utf8': 1 } ]
, 'nsset_pool': [ undefined
, [ 2 ] ]
, 'name_pool': [ undefined
, { 'kind': 'QName'
, 'ns': 1
, 'utf8': 2 }
, { 'kind': 'QName'
, 'ns': 1
, 'utf8': 3 }
, { 'kind': 'QName'
, 'ns': 1
, 'utf8': 4 }
, { 'kind': 'QName'
, 'ns': 2
, 'utf8': 5 }
, { 'kind': 'QName'
, 'ns': 2
, 'utf8': 6 }
, { 'kind': 'QName'
, 'ns': 2
, 'utf8': 7 }
, { 'kind': 'QName'
, 'ns': 2
, 'utf8': 8 }
, { 'kind': 'QName'
, 'ns': 2
, 'utf8': 9 }
, { 'kind': 'QName'
, 'ns': 2
, 'utf8': 10 }
, { 'kind': 'QName'
, 'ns': 2
, 'utf8': 11 }
, { 'kind': 'Multiname'
, 'utf8': 13
, 'nsset': 1 }
, { 'kind': 'Multiname'
, 'utf8': 5
, 'nsset': 1 }
, { 'kind': 'Multiname'
, 'utf8': 6
, 'nsset': 1 }
, { 'kind': 'Multiname'
, 'utf8': 7
, 'nsset': 1 }
, { 'kind': 'Multiname'
, 'utf8': 8
, 'nsset': 1 }
, { 'kind': 'Multiname'
, 'utf8': 9
, 'nsset': 1 }
, { 'kind': 'Multiname'
, 'utf8': 10
, 'nsset': 1 }
, { 'kind': 'Multiname'
, 'utf8': 11
, 'nsset': 1 } ]
, 'method_infos': [ { 'ret_type': 0
, 'param_types': []
, 'name': 0
, 'flags': 0
, 'optional_count': 0
, 'value_kind': [ ]
, 'param_names': [ ] }
, ]
, 'metadata_infos': [ ]
, 'instance_infos': [ ]
, 'class_infos': [ ]
, 'script_infos': [ { 'init': 0
, 'traits': [ { 'name': 4
, 'kind': 0
, 'attrs': 0
, 'slot_id': 0
, 'type_name': 0
, 'val_index': 0 }
, { 'name': 5
, 'kind': 0
, 'attrs': 0
, 'slot_id': 0
, 'type_name': 0
, 'val_index': 0 }
, { 'name': 6
, 'kind': 0
, 'attrs': 0
, 'slot_id': 0
, 'type_name': 0
, 'val_index': 0 }
, { 'name': 7
, 'kind': 0
, 'attrs': 0
, 'slot_id': 0
, 'type_name': 0
, 'val_index': 0 }
, { 'name': 8
, 'kind': 0
, 'attrs': 0
, 'slot_id': 0
, 'type_name': 0
, 'val_index': 0 }
, { 'name': 9
, 'kind': 0
, 'attrs': 0
, 'slot_id': 0
, 'type_name': 0
, 'val_index': 0 }
, { 'name': 10
, 'kind': 0
, 'attrs': 0
, 'slot_id': 0
, 'type_name': 0
, 'val_index': 0 }
, ] }
, ]
, 'method_bodys': [ { 'method_info': 0
, 'max_stack': 3
, 'max_regs': 1
, 'scope_depth': 0
, 'max_scope': 1
, 'code': [ [ 'getlocal0' ]
, [ 'pushscope' ]
, [ 'findproperty', 4 ]
, [ 'pushstring', 12 ]
, [ 'setproperty', 4 ]
, [ 'pushundefined' ]
, [ 'pop' ]
, [ 'findproperty', 5 ]
, [ 'pushstring', 12 ]
, [ 'setproperty', 5 ]
, [ 'pushundefined' ]
, [ 'pop' ]
, [ 'findproperty', 6 ]
, [ 'pushtrue' ]
, [ 'setproperty', 6 ]
, [ 'pushundefined' ]
, [ 'pop' ]
, [ 'findproperty', 7 ]
, [ 'pushfalse' ]
, [ 'setproperty', 7 ]
, [ 'pushundefined' ]
, [ 'pop' ]
, [ 'findproperty', 8 ]
, [ 'pushint', 1 ]
, [ 'setproperty', 8 ]
, [ 'pushundefined' ]
, [ 'pop' ]
, [ 'findproperty', 9 ]
, [ 'pushint', 1 ]
, [ 'negate' ]
, [ 'setproperty', 9 ]
, [ 'pushundefined' ]
, [ 'pop' ]
, [ 'findproperty', 10 ]
, [ 'pushdouble', 1 ]
, [ 'setproperty', 10 ]
, [ 'pushundefined' ]
, [ 'pop' ]
, [ 'findpropstrict', 11 ]
, [ 'getproperty', 11 ]
, [ 'pushnull' ]
, [ 'pushstring', 14 ]
, [ 'call', 1 ]
, [ 'pop' ]
, [ 'findpropstrict', 11 ]
, [ 'getproperty', 11 ]
, [ 'pushnull' ]
, [ 'findpropstrict', 12 ]
, [ 'getproperty', 12 ]
, [ 'call', 1 ]
, [ 'pop' ]
, [ 'findpropstrict', 11 ]
, [ 'getproperty', 11 ]
, [ 'pushnull' ]
, [ 'pushstring', 15 ]
, [ 'call', 1 ]
, [ 'pop' ]
, [ 'findpropstrict', 11 ]
, [ 'getproperty', 11 ]
, [ 'pushnull' ]
, [ 'findpropstrict', 13 ]
, [ 'getproperty', 13 ]
, [ 'call', 1 ]
, [ 'pop' ]
, [ 'findpropstrict', 11 ]
, [ 'getproperty', 11 ]
, [ 'pushnull' ]
, [ 'pushstring', 16 ]
, [ 'call', 1 ]
, [ 'pop' ]
, [ 'findpropstrict', 11 ]
, [ 'getproperty', 11 ]
, [ 'pushnull' ]
, [ 'findpropstrict', 14 ]
, [ 'getproperty', 14 ]
, [ 'call', 1 ]
, [ 'pop' ]
, [ 'findpropstrict', 11 ]
, [ 'getproperty', 11 ]
, [ 'pushnull' ]
, [ 'pushstring', 17 ]
, [ 'call', 1 ]
, [ 'pop' ]
, [ 'findpropstrict', 11 ]
, [ 'getproperty', 11 ]
, [ 'pushnull' ]
, [ 'findpropstrict', 15 ]
, [ 'getproperty', 15 ]
, [ 'call', 1 ]
, [ 'pop' ]
, [ 'findpropstrict', 11 ]
, [ 'getproperty', 11 ]
, [ 'pushnull' ]
, [ 'pushstring', 18 ]
, [ 'call', 1 ]
, [ 'pop' ]
, [ 'findpropstrict', 11 ]
, [ 'getproperty', 11 ]
, [ 'pushnull' ]
, [ 'findpropstrict', 16 ]
, [ 'getproperty', 16 ]
, [ 'call', 1 ]
, [ 'pop' ]
, [ 'findpropstrict', 11 ]
, [ 'getproperty', 11 ]
, [ 'pushnull' ]
, [ 'pushstring', 19 ]
, [ 'call', 1 ]
, [ 'pop' ]
, [ 'findpropstrict', 11 ]
, [ 'getproperty', 11 ]
, [ 'pushnull' ]
, [ 'findpropstrict', 17 ]
, [ 'getproperty', 17 ]
, [ 'call', 1 ]
, [ 'pop' ]
, [ 'findpropstrict', 11 ]
, [ 'getproperty', 11 ]
, [ 'pushnull' ]
, [ 'pushstring', 20 ]
, [ 'call', 1 ]
, [ 'pop' ]
, [ 'findpropstrict', 11 ]
, [ 'getproperty', 11 ]
, [ 'pushnull' ]
, [ 'findpropstrict', 18 ]
, [ 'getproperty', 18 ]
, [ 'call', 1 ]
, [ 'pop' ]
, [ 'returnvoid' ]
, ]
, 'exceptions': [ ]
, 'fixtures': [ ]
, 'traits': [ ] }
, ] } | greyhavens/thane | tamarin-central/esc/test/sanity/tests/vars.es.asm | Assembly | bsd-2-clause | 12,232 |
; hello.asm: loadable program that the shell can run
; To use:
; Build into a bare assembled binary
; Pretend it's a disk image and load it into your emulator
; Image it to a file in BBFS
; load by typing iuts name
.org 0
#include "bbos.inc.asm"
define WRITE_STRING 0x1004
SET PUSH, str_hello
SET PUSH, 1 ; With newline
SET A, WRITE_STRING
INT BBOS_IRQ_MAGIC
ADD SP, 2
; Return to the shell if applicable
IFN SP, 0x0000
SET PC, POP
str_hello:
.asciiz "Hello from a loadable binary!"
; Terminate with at least a sector of zeroes so the imager knows to stop imaging
.RESERVE 1024
| interfect/bbfs | hello.asm | Assembly | mit | 601 |
; _________ _________ _________ _________ _________ _________
; ___\______ /___\____ /_____\____ /___\_____ /___\_____ /___\______ /___
; \_ | | _ |_____/\_ ____ _ |/ _ |/ _ | | _/
; |___|___|___|_____| sns |___________|___________|___________|___|___|___|
;==[mr.boom 3.0]=====================================================[1997-99]=
; ? tapis roulants nivo 1
; ? fleches sur le sol pour les bombes kon pousse
%MACS
;NB_JOUEURS_MIN EQU 1
duree_saut EQU 64
duree_mort EQU 32
;ttp EQU 4000 ;emps avant le mode demo (touches pressees ...)
;ttp EQU 40 ;emps avant le mode demo (touches pressees ...)
ttp2 EQU 180 ;temps avant le mode demo (pas de touches pressees)
TRICHE EQU 0
;faire des apocalypse differentes
;version_du_jeu EQU 00110000B ;10110000B
nombre_de_vbl_avant_le_droit_de_poser_bombe2 EQU 60*2
invisibilite_totale EQU 100 ;nombre de résistance apres un choc.
invinsibilite_bonus equ 750 ;nombre vbl de mégaforce apres manger bonus...
duree_match EQU 512 ;001000000000B ;2 minutes
duree_match2 EQU 48 ; 000000110000B ;30 secondes
duree_match4 EQU 512 ;001000000000B ;2 minutes
duree_match3 EQU 256 ;000100000000B ;1 minutes
duree_match5 EQU 304 ; 000100110000B ;1 minutes 30
;+duree_match EQU 512 ;001000000000B ;2 minutes^M
;+duree_match2 EQU 48 ; 000000110000B ;30 secondes^M
;+duree_match4 EQU 512 ;001000000000B ;2 minutes^M
;+duree_match3 EQU 256 ;000100000000B ;1 minutes^M
;+duree_match5 EQU 304 ; 000100110000B ;1 minutes 30^M
;010011B ;001100000000B
time_bouboule equ 5 ;temps pour rotation boules menu
pic_max equ 420 ;durée attente sur gfx de zaac
duree_conta EQU 0800 ;nombre de vbl pour une contamination.
duree_draw2 EQU 500 ;durée du draw game
duree_med2 EQU 1200 ;durée du med cere ;10 secondes...
duree_vic2 EQU 1200 ;durée du vic cere
attente_avant_draw2 equ 100
attente_avant_med2 equ 100
temps_re_menu equ 15
resistance_au_debut_pour_un_dyna equ 0
;----- pour les joueurs...
info1 equ 1
info2 equ 1
info3 equ 210
info4 equ 3
;1,2,3 (normal),4:double...
;ééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééé
; PMODE/W Assembly Example File #1
;ééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééé
.386p
;
;extrn ExitProcess : PROC ;procedure to shut down a process
;
;extrn ShowWindow : PROC
;extrn GetModuleHandleA: PROC
;extrn GetForegroundWindow : PROC
;extrn ExitProcess : PROC ;procedure to shut down a process
;extrn GetForegroundWindow : PROC
;extrn SendMessageA : PROC
;extrn IsZoomed : PROC
;extrn ShowWindow : PROC
vbl MACRO
local avbl1
local avbl2
inc dword ptr [changement]
mov dx,3dah
avbl1: in al,dx
test al,8
jne avbl1
avbl2: in al,dx
test al,8
je avbl2
xor eax,eax
xor edx,edx
ENDM
BIGENDIANPATCH MACRO a
local blablablatoto
cmp isbigendian,1
jne blablablatoto
mov bigendianin,a
push eax
mov al,byte ptr [bigendianin]
mov byte ptr [bigendianout+3],al
mov al,byte ptr [bigendianin+1]
mov byte ptr [bigendianout+2],al
mov al,byte ptr [bigendianin+2]
mov byte ptr [bigendianout+1],al
mov al,byte ptr [bigendianin+3]
mov byte ptr [bigendianout+0],al
pop eax
mov a,bigendianout
blablablatoto:
ENDM
PUSHALL MACRO ; Pushes all registers onto stack = 18c
PUSHAD
PUSH DS ES
ENDM
POPALL MACRO ; Pops all registers from stack = 18c
POP ES DS
POPAD
ENDM
actionButtonPushed2 MACRO a
local ok
cmp byte ptr [total_t+ebx+4],1
je ok
cmp byte ptr [total_t+ebx+5],1
je ok
cmp byte ptr [total_t+ebx+6],1
je ok
jmp a
ok:
endm
actionButtonPushed MACRO a
local ok
cmp byte ptr [esi+4],1
je ok
cmp byte ptr [esi+5],1
je ok
cmp byte ptr [esi+6],1
je ok
jmp a
ok:
endm
_TEXT segment use32 dword public 'CODE' ;IGNORE
assume cs:_TEXT,ds:_DATA
start: ;IGNORE
jmp _main
db ' Monsieur Boom ' ; The "WATCOM" string is needed in
; order to run under DOS/4G and WD.
;E db 'envois !!!',10,13,'$'
;a db 'attend... !!!',10,13,'$'
get_all_infos3 MACRO
local donoterasekeyslabel
cmp taille_exe_gonfle,0
je donoterasekeyslabel
PUSHALL
;------------- ;ordy local...
push ds
pop es
mov esi,offset donnee2
mov edi,offset total_t
mov ecx,touches_size
rep movsb
POPALL
donoterasekeyslabel:
ENDM
get_all_infos2 MACRO
local donoterasekeyslabel
cmp taille_exe_gonfle,0
je donoterasekeyslabel
PUSHALL
;------------- ;ordy local...
push ds
pop es
mov esi,offset donnee2
mov edi,offset total_t
mov ecx,touches_size
rep movsb
;------------------
;edi est bien placé...
POPALL
donoterasekeyslabel:
ENDM
num proc near ;entree eax:juska 9999999999
push dx esi
push ebx eax ecx
;mov eax,0543212345
mov ebx,eax
mov esi,offset liste_de_machin
mov ecx,[esi]
errrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr:
mov ax,0
rrtetrertertretertterert:
cmp ebx,ecx ;10000
jb reerrereerret
sub ebx,ecx ;10000
inc ax
jmp rrtetrertertretertterert
reerrereerret:
;affchiffre
push ax
push dx
add al,48
mov dl,al
mov ah,2
int 21h
pop ax
pop dx
add esi,4
mov ecx,[esi]
or ecx,ecx
jz reererreer
jmp errrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
reererreer:
mov dl,' '
mov ah,2
int 21h
pop ecx eax ebx
pop esi dx
ret
endp
;
;----- aff hexa.
;notreadresse db 4 dup (0FFh) ;netadd
; db 6 dup (0FFh) ;nodeadd
; dw 0FFFFh ;sockette...
aff_adresse proc near ; ds:si sur adresse
push ds es
Pushad
mov cx,10
dds:
call hexa
cmp cx,1
je ertertertertert
mov dl,'.'
cmp cx,9
jne reterertert
mov dl,' '
reterertert:
cmp cx,3
jne reterertertu
mov dl,' '
reterertertu:
mov ah,2
int 21h
loop dds
ertertertertert:
mov dl,10
mov ah,2
int 21h
mov dl,13
mov ah,2
int 21h
popad
pop es ds
ret
aff_adresse endp
hexa proc near ; ds:si sur variable
xor ax,ax
lodsb
push ax
shr ax,4
movzx ebx,ax
mov dl,cs:[trucs+ebx]
mov ah,2
int 21h
pop ax
and al,01111B
movzx ebx,ax
mov dl,cs:[trucs+ebx]
mov ah,2
int 21h
ret
hexa endp
printeax proc near
;-----------------------
; convert the value in EAX to hexadecimal ASCIIs
;-----------------------
mov edi,OFFSET ASCII ; get the offset address
mov cl,8 ; number of ASCII
P1: rol eax,4 ; 1 Nibble (start with highest byte)
mov bl,al
and bl,0Fh ; only low-Nibble
add bl,30h ; convert to ASCII
cmp bl,39h ; above 9?
jna short P2
add bl,7 ; "A" to "F"
P2: mov [edi],bl ; store ASCII in buffer
inc edi ; increase target address
dec cl ; decrease loop counter
jnz P1 ; jump if cl is not equal 0 (zeroflag is not set)
;-----------------------
; Print string
;-----------------------
mov edx,OFFSET ASCII ; DOS 1+ WRITE STRING TO STANDARD OUTPUT
mov ah,9 ; DS:DX->'$'-terminated string
int 21h ; maybe redirected under DOS 2+ for output to file
; (using pipe character">") or output to printer
ret
endp
last_color proc near
PUSHALL
;------------
;dans BX: la couleur k'on veut !!!
;mov bl,0100B ;rouge
;mov bh,10000000B ;indique clignotement
push bx
;mov ax,0b800h
;mov es,ax
;mov ds,ax
push ds
pop es
mov edi,0b8000h
mov esi,0b8000h
;xor di,di
;xor si,si
;-----
mov ah,03h
mov bh,0
int 10h
;dans dh ligne du curseur
dec dh ; car toujours > 1 vu k'on balance apres avoir afficvhé
;movzx edx,dh ;*128
shr dx,8
and edx,255
mov eax,edx
shl edx,7
shl eax,5
add edx,eax
add esi,edx
add edi,edx
mov cx,80
pop bx
nooon:
inc edi
inc esi
lodsb
or al,bh
and al,11110000B
or al,bl
stosb
dec cx
jne nooon
;---------------------------------
POPALL
ret
last_color endp
;sortie: ebx entree ebp...
direction_du_joueur MACRO a
local trrtertyrtytyrtyrrtyRz
local trrtertyrtytyrtyrrtyRzt
local ytrrtertyrtytyrtyrrtyy
local ytrrtertyrtytyrtyrrtyRy
push eax
xor ebx,ebx
mov eax,[touches+ebp]
and eax,127
cmp eax,16
jne trrtertyrtytyrtyrrtyRz
mov ebx,-1*a
trrtertyrtytyrtyrrtyRz:
cmp eax,8
jne trrtertyrtytyrtyrrtyRzt
mov ebx,1*a
trrtertyrtytyrtyrrtyRzt:
cmp eax,00
jne ytrrtertyrtytyrtyrrtyy
mov ebx,32*a
ytrrtertyrtytyrtyrrtyy:
cmp eax,24
jne ytrrtertyrtytyrtyrrtyRy
mov ebx,-32*a
ytrrtertyrtytyrtyrrtyRy:
pop eax
ENDM
;esi: endroit ou on pose la bombe...
;edi: infojoueur du dyna
pose_une_bombe MACRO
local vania
local ttyrrtyrtyrtyrtytyrrtyrtyyrtrty
local erertertrteterert
local nononono_onest_en_recordplay
mov byte ptr [esi],1
;utilise Esi par rapport a truc2 pour gauche/droite.
bruit2 11,34 ;,BLOW_WHAT2 ;bruit de kan on pose une bombe
;"hazard" pour ke les bombes soit pas toutes pareille lors du tri bombe
push eax
mov eax,dword ptr [edi] ;nombre de bombes k'on peut encore poser...
and eax,011B
add byte ptr [esi],al
pop eax
;---------------
dec dword ptr [edi] ;nombre de bombes k'on peut encore poser...
;donnee dw 20,20,277,277,150,200,250,280 ;x du dynablaster
; dw 9,170,9,170,78,98,98,10 ;y du dynablaster
;liste_bombe dd 0 ; nombre de bombes...
; dd 247 dup (0,0,0,0)
;1er: offset de l'infojoeur
;2eme: nombre de tours avant que ca PETE !!!
;3eme:distance par rapport au debut de truc2
;4eme puissance de la bombe. + retardee ou non
;mov ebx,[liste_bombe]
;shl ebx,4 ;*16
;recherche la premiere place de libre !!!
xor ebx,ebx
ttyrrtyrtyrtyrtytyrrtyrtyyrtrty:
cmp dword ptr [liste_bombe+ebx+4+1*4],0 ;indique emplacement non remplis !!!
je erertertrteterert
add ebx,taille_dune_info_bombe
jmp ttyrrtyrtyrtyrtytyrrtyrtyyrtrty
erertertrteterert:
mov edx,dword ptr [edi+4] ;récupere la puissance de la bombe dans
;l'info du joueur...
mov ecx,dword ptr [edi+8] ;récupere la taille de la meiche de la
;bombe dans l'info du joueur...
;mov [nomonster],1
cmp action_replay,0
jne nononono_onest_en_recordplay
cmp twice,1
jne nononono_onest_en_recordplay
shr ecx,1
nononono_onest_en_recordplay:
mov [liste_bombe+ebx+4+2*4],eax ;distance par rapport au debut de truc2
mov word ptr [liste_bombe+ebx+4+3*4],dx ;puissance de la bombe.
;------------------------------------ mouvement de la bombe
;truc_X db 32*0,0,0,0,0,0,0,0,0,0,0,0,0 ;+ ou -...
;truc_Y db 32*0,0,0,0,0,0,0,0,0,0,0,0,0
mov byte ptr [truc_X+eax],0
mov byte ptr [truc_Y+eax],0
mov word ptr [liste_bombe+ebx+4+4*4],0 ;!!!!!!!!!1 ;adder X automatique.
mov word ptr [liste_bombe+ebx+4+4*4+2],0
mov word ptr [liste_bombe+ebx+4+5*4],0 ;adder X
mov word ptr [liste_bombe+ebx+4+5*4+2],0 ;adder Y
;-------------------------------------------------
push ebx
mov ebx,[infojoueur+ebp] ;uniquement s'il y a droit...
mov edx,dword ptr [ebx+4*4]
pop ebx
;---- maladie de la bonbinette ???
cmp word ptr [maladie+ebp],6 ;malade ??? (en general)
jne vania
mov word ptr [liste_bombe+ebx+4+3*4],1 ;puissance de la bombe.
vania:
;------
mov word ptr [liste_bombe+ebx+4+3*4+2],dx ;bombe a retardement ou pas ???
mov [liste_bombe+ebx+4+1*4],ecx ;nombre de tours avant que ca PETE !!!
mov [liste_bombe+ebx+4+0*4],edi ;offset de l'infojoeur
inc dword ptr [liste_bombe]
mov [tribombe2+ebp],0
ENDM
lapinomb MACRO a
local nooooiii
local nooooiii2
local nan_prend_pas_lombre
cmp word ptr [donnee4+4+ebx],-1
je nooooiii2
push ecx ebx
mov ecx,edi
add ecx,ecx
mov ebx,[kel_ombre]
shr ebx,cl
and ebx,1111B
jz nan_prend_pas_lombre
cmp ebx,3
ja nan_prend_pas_lombre
pop ebx ecx
;ombres dw 8 dup (0)
;mov ax,[ombres+edi]
;push ecx ebx
;sub ecx
mov a,[ombres+edi]
add a,8*320
jmp nooooiii
nan_prend_pas_lombre:
pop ebx ecx
nooooiii:
;ca c pour lordre daffichage, pour pas ke 2 dyna se croisent de maniere bizarre
add a,bx
add a,bx
add a,bx
nooooiii2:
ENDM
poussage MACRO ou,xy_adder,xy_x32
local pas_changement_case
local pas_ca___
local stooppppes
local continue_lme_train_train
local stooppppes_pas
local ya_une_bombe_stope_ou_explose
local ttyrrtyrtyrtyrtytyrrtyrtyyrtrty
local nan_pas_de_bombe_ayant_squatte_entre_temps
local erertertrteterert
local fait_pas_peter
local tantpis
local nanana
local reterertertertertterertert
push ebx eax
xor eax,eax
cmp word ptr [liste_bombe+ebp+4+4*4+xy_adder],ou ;adder X automatique.
jne pas_ca___
;************* _il ya a donc une force ki nous pousser a pousser *********
mov ebx,[liste_bombe+ebp+4+2*4] ;offset dans truc
cmp word ptr [liste_bombe+ebp+4+5*4+xy_adder],0 ; on est au milieu ???
; changement possible
jne continue_lme_train_train ;
cmp byte ptr [truc+ebx+(ou*xy_x32)],66 ;ya du dur rebondissant a cote ?
jne reterertertertertterertert
neg word ptr [liste_bombe+ebp+4+4*4+xy_adder]
bruit2b 3,45
jmp continue_lme_train_train
reterertertertertterertert:
cmp byte ptr [truc+ebx+(ou*xy_x32)],0 ;ya du dur a cote ?
jne stooppppes
cmp byte ptr [truc_monstre+ebx],'' ;stoppe si on est sur un dyna/monstre..
je stooppppes
cmp byte ptr [truc2+ebx+(ou*xy_x32)],0 ;ya du dur a cote ?
je stooppppes_pas
cmp byte ptr [truc2+ebx+(ou*xy_x32)],5 ;ya du dur a cote ?
jb ya_une_bombe_stope_ou_explose
cmp byte ptr [truc2+ebx+(ou*xy_x32)],54 ;ya du dur a cote ?
ja stooppppes
stooppppes_pas:
jmp continue_lme_train_train
ya_une_bombe_stope_ou_explose:
;***************** CHOC EVENTUEL AVEC UNE BOMBE 50% ******************************
;---------- recherche la bombe... pour la faire eventuellement peter.
;fait un diiiing (chok entre deux bombes)
;bruit3 6 30 BLOW_WHAT2
push esi ebx
mov esi,ebx
add esi,ou*xy_x32
xor ebx,ebx
ttyrrtyrtyrtyrtytyrrtyrtyyrtrty:
cmp dword ptr [liste_bombe+ebx+4+2*4],esi ;regarde si ya une bombe a cet endroit
je erertertrteterert
add ebx,taille_dune_info_bombe
jmp ttyrrtyrtyrtyrtytyrrtyrtyyrtrty
erertertrteterert:
;fait peter ke si elle bouge...
cmp word ptr [liste_bombe+ebx+4+4*4],0
jne tantpis
cmp word ptr [liste_bombe+ebx+4+4*4+2],0
je fait_pas_peter
tantpis:
mov dword ptr [liste_bombe+ebx+4+1*4],1 ;fait peter la bombe...
mov word ptr [liste_bombe+ebx+4+4*3+2],0 ;(la rend la bombe normalle. au cas ou)
pop ebx esi
jmp stooppppes
fait_pas_peter:
;----------------------------------------------------------
pop ebx esi
;jmp continue_lme_train_train
;-------------------------------
stooppppes:
mov word ptr [liste_bombe+ebp+4+4*4+xy_adder],0 ;adder X automatique.
;bruit2b 2 40
bruit2 0 40
jmp pas_ca___
continue_lme_train_train:
;------------ rien ne peu nous arreter: on pousse.
add word ptr [liste_bombe+ebp+4+5*4+xy_adder],ou ;ax ;adder X
cmp word ptr [liste_bombe+ebp+4+5*4+xy_adder],8*(ou) ;on a change de case !!!
jne pas_changement_case
;--- cas particulier des 50% de bombes restantexs non detectees.
; (forcement en deplacement celles la.)
; (peut aussi etre un bonus, une flamme; un espoir. euh non, pas despoir)
cmp [truc2+ebx+(ou*xy_x32)],0
je nan_pas_de_bombe_ayant_squatte_entre_temps
sub word ptr [liste_bombe+ebp+4+5*4+xy_adder],ou
mov dword ptr [liste_bombe+ebp+4+1*4],1 ;fait peter la bombe...
mov word ptr [liste_bombe+ebp+4+4*3+2],0 ;(la rend la bombe normalle. au cas ou)
jmp stooppppes ;remonte...
nan_pas_de_bombe_ayant_squatte_entre_temps:
;-------------------------------------------
mov word ptr [liste_bombe+ebp+4+5*4+xy_adder],-8*(ou)
mov al,byte ptr [truc2+ebx]
mov byte ptr [truc2+ebx],0
add ebx,ou*xy_x32
add dword ptr [liste_bombe+ebp+4+2*4],ou*xy_x32
mov byte ptr [truc2+ebx],al
pas_changement_case:
;validation du nouveau X/Y....
mov ax,word ptr [liste_bombe+ebp+4+5*4+xy_adder]
mov ebx,[liste_bombe+ebp+4+2*4]
mov byte ptr [truc_X+ebx],0
mov byte ptr [truc_Y+ebx],0
mov byte ptr [truc_X+ebx+(13*16*xy_adder)],al
pas_ca___:
pop eax ebx
ENDM
;viseur esi-1 sur TRUC.
colle_un_bonus MACRO viseur_hazard_bonus,hazard_bonus,correspondance_bonus
local uihuiuihhuiouiohuihuiorteerrty
local reertertert
local pas_rec
local pas_rect
local drtytyrrtyrteterertert
local drtytyrrtyrteterertert2
;------------- ne pose pas de bonus sur une bombe non explosee
cmp byte ptr [esi-1+32*13],0
je drtytyrrtyrteterertert2
cmp byte ptr [esi-1+32*13],5
jb drtytyrrtyrteterertert
drtytyrrtyrteterertert2:
;--------------------------------------------------
;local rteterertert
;-------------- met ou du vide ou un bonus...
;hazard_bonus db 54,0,54,0,54,0,54,0,0,0,54,0
;viseur_hazard_bonus dd 0
push eax
push esi
inc [viseur_hazard_bonus]
mov esi,offset hazard_bonus
mov eax,[changement] ;renegade
and eax,000000011B
add esi,eax
add esi,[viseur_hazard_bonus]
cmp esi,offset viseur_hazard_bonus
jb reertertert
mov [viseur_hazard_bonus],0
mov esi,offset hazard_bonus
mov eax,[changement]
and eax,000000011B
add esi,eax
reertertert:
mov al,[esi]
pop esi
;or al,al
;jz rteterertert
push ebx
xor ebx,ebx
mov bl,al
mov al,[correspondance_bonus+ebx]
;********************** TRAFFIC POUR PLAY !!! *********
cmp action_replay,2 ;play
jne pas_rect
push ebx
;STRUTURE DE REC:
xor ebx,ebx
;mov bl,byte ptr fs:[1966080+TAILLE_HEADER_REC]
;mov byte ptr al,fs:[1966080+TAILLE_HEADER_REC+ebx]
;inc byte ptr fs:[1966080+TAILLE_HEADER_REC]
push esi
mov esi,replayer_saver4
mov bl,replayer_saver5 ;byte ptr fs:[esi+TAILLE_HEADER_REC]
mov byte ptr al,fs:[esi+TAILLE_HEADER_REC+ebx]
inc replayer_saver5 ;byte ptr fs:[esi+TAILLE_HEADER_REC]
pop esi
pop ebx
pas_rect:
;**************************************************
;;cas particulier: terrain6 plus apres lapocalypse, pas de bonus
cmp special_nivo_6,0
jz uihuiuihhuiouiohuihuiorteerrty
xor al,al
uihuiuihhuiouiohuihuiorteerrty:
;---------------
mov byte ptr [esi-1+32*13],al ;54
pop ebx
pop eax
drtytyrrtyrteterertert:
ENDM
resistance MACRO saut,monstre_ou_pas
local finito_baby
local erterdynanormalito
local passaut2
cmp [invinsible+ebp],0 ;flamme ? sauf si on est en invinsible apres un coups...
jne saut ;évite la mort de justesse...
cmp [lapipipino+ebp],0 ;lapin ?
je erterdynanormalito
cmp [lapipipino2+ebp],0 ;lapin qui saute ?
je passaut2
cmp [lapipipino5+ebp],0 ;hauteur du saut
jne saut
passaut2:
;tue le lapin...
bruit3 12,34,BLOW_WHAT2 ;bruit de kan on pose une bombe
mov [lapipipino2+ebp],3 ;mort du lapin
mov [lapipipino3+ebp],duree_mort
erterdynanormalito:
;--- rend normalles toutes ses bombes
;--- qui etaient a retardement. et retire son pouvoir..
push ebx
mov ebx,[infojoueur+ebp]
mov dword ptr [ebx+4*4],0 ;retire pouvoir
call nike_toutes_ses_bombes
pop ebx
;---------------------
;**décrémente le nombre de coups k'on peut prendre ***
cmp [nombre_de_coups+ebp],0
je finito_baby
dec dword ptr [nombre_de_coups+ebp]
mov [invinsible+ebp],invisibilite_totale
;---- retire le pouvoir de pousser (and car on le retire pas pour les monstres)
and dword ptr [pousseur+ebp],monstre_ou_pas
;retire les patins a roulette
mov dword ptr [patineur+ebp],0
;retire le tribombe
mov dword ptr [tribombe+ebp],0
jmp saut
finito_baby:
ENDM
aff_spt666 MACRO lignes,colonnes
local yuertertertrteerti
local yuconcerti
local yuertertertrtei
mov ecx,lignes
yuertertertrteerti:
mov ebx,colonnes
yuconcerti:
movsb
dec ebx
jnz yuconcerti
add edi,320-colonnes
add esi,320-colonnes
dec ecx
jnz yuertertertrteerti
ENDM
aff_spt2 MACRO lignes,colonnes,a
local yuertertertrteerti
local yuconcerti
local yuertertertrteiE
local yuertertertrtei
local rtrtyrtyrtyrtyrtyrtyrty
mov ecx,lignes
yuertertertrteerti:
mov ebx,colonnes
yuconcerti:
lodsb
or al,al
jz rtrtyrtyrtyrtyrtyrtyrty
cmp al,1
je yuertertertrtei
cmp al,156
je yuertertertrteiE
mov byte ptr es:[edi],al
jmp rtrtyrtyrtyrtyrtyrtyrty
yuertertertrteiE:
push ebx
xor ebx,ebx
mov bl,es:[edi]
mov al,es:[couleurssss+ebx]
add al,93 ;!
mov byte ptr es:[edi],al
pop ebx
jmp rtrtyrtyrtyrtyrtyrtyrty
yuertertertrtei:
push ebx
xor ebx,ebx
mov bl,es:[edi]
mov al,es:[couleurssss+ebx]
add al,a
mov byte ptr es:[edi],al
pop ebx
rtrtyrtyrtyrtyrtyrtyrty:
inc edi
dec ebx
jnz yuconcerti
add edi,320-colonnes
add esi,320-colonnes
dec ecx
jnz yuertertertrteerti
ENDM
return_presse MACRO e,machin
local retertertertertetrtrertertert
local erterertertert
PUSHALL
mov ecx,[nb_ordy_connected]
inc ecx
;nombre d'ordy en tout...
mov esi,offset total_t
;control_joueur dd 8 dup (?) ;-1,6,32,32+6,-1,-1,-1,-1
retertertertertetrtrertertert:
cmp byte ptr [esi+7*8],1
jne erterertertert
cmp [nombre_de_dyna],2 ;uniquement s'il y a au moins 2 dyna...
jb erterertertert
mov byte ptr [e],machin
erterertertert:
add esi,64
dec ecx
jnz retertertertertetrtrertertert
POPALL
ENDM
touche_pressedd MACRO e,machin
local retertertertertetrtrertertert
local erterertertert
PUSHALL
mov ecx,[nb_ordy_connected]
inc ecx
;nombre d'ordy en tout...
mov esi,offset total_t
;control_joueur dd 8 dup (?) ;-1,6,32,32+6,-1,-1,-1,-1
retertertertertetrtrertertert:
cmp byte ptr [esi+7*8+2],1
jne erterertertert
push eax
mov eax,machin
mov [e],eax
pop eax
erterertertert:
add esi,64
dec ecx
jnz retertertertertetrtrertertert
POPALL
ENDM
touche_presse MACRO e,machin
local retertertertertetrtrertertert
local erterertertert
PUSHALL
mov ecx,[nb_ordy_connected]
inc ecx
;nombre d'ordy en tout...
mov esi,offset total_t
;control_joueur dd 8 dup (?) ;-1,6,32,32+6,-1,-1,-1,-1
retertertertertetrtrertertert:
cmp byte ptr [esi+7*8+2],1
jne erterertertert
mov [e],machin
erterertertert:
add esi,64
dec ecx
jnz retertertertertetrtrertertert
POPALL
ENDM
touche_presseque_master MACRO e,machin
local erterertertert
PUSHALL
cmp [master],0
jne erterertertert
cmp byte ptr [total_t+7*8+2],1
jne erterertertert
mov byte ptr [e],machin
erterertertert:
POPALL
ENDM
bonus_tete MACRO a ;active un bonus... quand on marche dessus
local yertterertertertert
push eax
cmp byte ptr [esi],a
jb yertterertertertert
cmp byte ptr [esi],a+10 ;54+10
jnb yertterertertertert
bruit2 1,40
;bruit 1 40
mov byte ptr [esi],0
mov eax,[changement]
and eax,01111B
mov al,[hazard_maladie+eax]
and ax,255
mov word ptr [maladie+ebp],ax ;ax ;4: touches inversée...
;3 : la chiasse...
;2 : maladie de la lenteur...
;1 : maladie du speeD.
;5 : maladie de la constipation
;6 : maladie de la bonbinette
mov word ptr [maladie+ebp+2],duree_conta ;500 ; dd 8 dup (?)
;mov esi,[infojoueur+ebp]
;cmp byte ptr [esi+c],b ;bombe_max
;je yertterertertertert
;inc byte ptr [esi+c]
yertterertertertert:
pop eax
ENDM
bruit MACRO a,b,t
local op
;a:panning 0 droite
;
;last_voice dd 0
; ;derniere voix utilisée (*2)
;
;
;0.1.2.3.4.5.6 7
;8.9.0.1.2.3.4.5
;a: sample, b:note
push ebp eax
mov al,a
or al,01110000B
mov ebp,[last_voice]
add [last_voice],2
cmp [last_voice],14*2
jne op
mov [last_voice],0
op:
mov byte ptr [t+ebp],al ;al ;073h ;4 bits:panning, 4 bits: sample
;0 droite. ici. F left
mov eax,[changement]
and eax,011B
add eax,b
mov byte ptr [t+ebp+1],al ;note
pop eax ebp
ENDM
; au milieu
bruit3 MACRO a,b,t
local op
;a:panning 0 droite
;
;last_voice dd 0
; ;derniere voix utilisée (*2)
;
;
;0.1.2.3.4.5.6 7
;8.9.0.1.2.3.4.5
;a: sample, b:note
push ebp eax
mov al,a
or al,01110000B
mov ebp,[last_voice]
add [last_voice],2
cmp [last_voice],14*2
jne op
mov [last_voice],0
op:
mov byte ptr [t+ebp],al ;al ;073h ;4 bits:panning, 4 bits: sample
;0 droite. ici. F left
;,mov eax,[changement]
;and eax,011B
mov eax,b
mov byte ptr [t+ebp+1],al ;note
pop eax ebp
ENDM
bruit3b MACRO a,b,t ; au milieu
local op
;a:panning 0 droite
;
;last_voice dd 0
; ;derniere voix utilisée (*2)
;
;
;0.1.2.3.4.5.6 7
;8.9.0.1.2.3.4.5
;a: sample, b:note
push ebp eax
mov al,a
or al,01110000B
mov ebp,[last_voice]
add [last_voice],2
cmp [last_voice],14*2
jne op
mov [last_voice],0
op:
mov byte ptr [t+ebp],al ;al ;073h ;4 bits:panning, 4 bits: sample
;0 droite. ici. F left
mov eax,[changement]
and eax,011B
add eax,b
mov byte ptr [t+ebp+1],al ;note
pop eax ebp
ENDM
bruit2 MACRO a,b
local op
;a: sample, b:note
push ebp eax esi ebx
mov al,a
;
;---------------
sub esi,offset truc2
and esi,011111B
;0 a 32.
mov bl,byte ptr [panning2+esi]
shl ebx,4
;------------ fait exploser la bombe -------------------------------------
or al,bl ;apnning
mov ebp,[last_voice]
add [last_voice],2
cmp [last_voice],14*2
jne op
mov [last_voice],0
op:
mov byte ptr [BLOW_WHAT2+ebp],al ;al ;073h ;4 bits:panning, 4 bits: sample
;0 droite. ici. F left
mov eax,[changement]
and eax,010B
add eax,b
;mov eax,b ;!!
mov byte ptr [BLOW_WHAT2+ebp+1],al ;note
pop ebx esi eax ebp
ENDM
bruit2b MACRO a,b
local op
;a: sample, b:note
push ebp eax esi ebx
;
;on recup le panning sur ebx
and ebx,011111B
mov bl,byte ptr [panning2+ebx]
mov al,a
shl ebx,4
;------------ fait exploser la bombe -------------------------------------
or al,bl ;apnning
mov ebp,[last_voice]
add [last_voice],2
cmp [last_voice],14*2
jne op
mov [last_voice],0
op:
mov byte ptr [BLOW_WHAT2+ebp],al ;al ;073h ;4 bits:panning, 4 bits: sample
;0 droite. ici. F left
mov eax,[changement]
and eax,010B
add eax,b
;mov eax,b ;!!
mov byte ptr [BLOW_WHAT2+ebp+1],al ;note
pop ebx esi eax ebp
ENDM
SOUND_FAC MACRO a
PUSHALL
mov ax,ds
mov es,ax
lea edi,a
mov ecx,14
xor ax,ax
rep stosw
POPALL
ENDM
SOUND MACRO
PUSHALL
mov ax,ds
mov es,ax
lea edi,BLOW_WHAT
lea esi,BLOW_WHAT2
mov ecx,14
rep movsw
POPALL
ENDM
sound_menu MACRO
PUSHALL
mov ax,ds
mov es,ax
lea edi,BLOW_WHAT
lea esi,fx
mov ecx,14
rep movsw
POPALL
ENDM
crocro macro
local eretretrertertert
lodsb
or al,al
jz eretretrertertert
mov es:[edi],bl
eretretrertertert:
inc edi
ENDM
copie macro a
PUSHALL
mov ax,ds
mov es,ax
mov ax,fs
mov ds,ax
mov ecx,a
rep movsd
POPALL
ENDM
aff_oeuf MACRO
local ertertrteertrterte
local zerertertter
local retertterert
sub edi,3
mov dx,16
ertertrteertrterte:
mov bx,22
zerertertter:
lodsb
or al,al
jz retertterert
mov es:[edi],al
retertterert:
inc edi
dec bx
jnz zerertertter
add edi,320-22
add esi,320-22
dec dx
jnz ertertrteertrterte
ENDM
;b: max...
bonus_ MACRO a,b,c ;active un bonus... quand on marche dessus
local yertterertertertert
local FIREUERTKjertjertkljertertertertter2
local FIREUERTKjertjertkljertertertertter
push esi
cmp byte ptr [esi],a
jb yertterertertertert
cmp byte ptr [esi],a+10 ;54+10
jnb yertterertertertert
mov byte ptr [esi],0
bruit2 1,40
mov esi,[infojoueur+ebp]
cmp dword ptr [esi+c],b ;bombe_max
je FIREUERTKjertjertkljertertertertter2
;yertterertertertert
inc dword ptr [esi+c]
;------------ tricheur notoire
cmp dword ptr [esi+c],b ;bombe_max
je yertterertertertert
push esi
mov esi,offset nick_t
add esi,[control_joueur+ebp]
cmp dword ptr [esi+4],0
pop esi
jne yertterertertertert
inc dword ptr [esi+c]
;--------------------------------------------------
yertterertertertert:
pop esi
jmp FIREUERTKjertjertkljertertertertter
FIREUERTKjertjertkljertertertertter2:
pop esi
mov byte ptr [esi],194 ;degage le bonus
bruit2 4,40
FIREUERTKjertjertkljertertertertter:
ENDM
bonus_2 MACRO a,b,c ;active un bonus... quand on marche dessus
local yertterertertertert
cmp byte ptr [esi],a
jb yertterertertertert
cmp byte ptr [esi],a+10 ;54+10
jnb yertterertertertert
bruit2 1,40
;mov byte ptr [esi],0
;mov esi,[infojoueur+ebp]
;cmp byte ptr [esi+c],b ;bombe_max
;je yertterertertertert
;inc byte ptr [esi+c]
mov byte ptr [esi],0
add [c+ebp],b
;------------ tricheur notoire
push esi
mov esi,offset nick_t
add esi,[control_joueur+ebp]
cmp byte ptr [esi+4],''
pop esi
jne yertterertertertert
add [c+ebp],b
;--------------------------------------------------
yertterertertertert:
ENDM
bonus_3 MACRO a,b,c ;active un bonus... quand on marche dessus
local yertterertertertert
local rteelmkklmertklmertklmertertterter
;cas particulier,bon kon peut deja avoir
cmp byte ptr [esi],a
jb yertterertertertert
cmp byte ptr [esi],a+10 ;54+10
jnb yertterertertertert
cmp [c+ebp],b
jne rteelmkklmertklmertklmertertterter
mov byte ptr [esi],194 ;degage le bonus
bruit2 4,40
jmp yertterertertertert
rteelmkklmertklmertklmertertterter:
bruit2 1,40
mov byte ptr [esi],0
mov [c+ebp],b
yertterertertertert:
ENDM
bonus_5 MACRO a ;active un bonus... quand on marche dessus
local yertterertertertert
local rteelmkklmertklmertklmertertterter
;cas particulier,bon kon peut deja avoir
cmp byte ptr [esi],a
jne yertterertertertert
cmp [lapipipino+ebp],1
jne rteelmkklmertklmertklmertertterter
mov byte ptr [esi],194 ;degage le bonus
bruit2 4,40
jmp yertterertertertert
rteelmkklmertklmertklmertertterter:
;ke kan on est au milieu
au_milieu_x_et_y yertterertertertert
;---------
bruit2 1,40
mov byte ptr [esi],0
;mov byte ptr [esi],194 ;degage le bonus
;mov [lapipipino3+ebp],duree_saut
;mov [lapipipino2+ebp],1
mov [lapipipino6+ebp],1
inc [nombre_de_coups+ebp]
;saut de lapin le lapin...
bruit3 10,30,BLOW_WHAT2 ;bruit kan 1 lapin saute
;nombre_de_coups dd 8 dup (?) ;avant la mort...
;clignotement dd 8 dup (?) ;varie entre 1 et 0 quand invinsible <>0
; ;mis a jour par la proc "blanchiment"
;pousseur dd 8 dup (0)
;patineur dd 8 dup (?)
;invinsible dd 8 dup (?) ;invincibilité. nombre de vbl restant ... décrémentée... 0= none...
yertterertertertert:
ENDM
bonus_4 MACRO a ;pour horloge
local yertterertertertert
local pas_zeroerrterteert
cmp byte ptr [esi],a
jb yertterertertertert
cmp byte ptr [esi],a+10
jnb yertterertertertert
bruit2 1,40
mov byte ptr [esi],0 ;degage le bonus
;cas particulier si le temps = 0
;alors on fait exploser le bonus :)
test temps,000111111111111B
jnz pas_zeroerrterteert
mov byte ptr [esi],194 ;degage le bonus
bruit2 4,40
jmp yertterertertertert
pas_zeroerrterteert:
push ax bx
mov ax,temps ;duree_match ;001100000000B ;time
mov bx,ax
and bx,0111100000000B
cmp bx,9*256
je non_fait_rien
mov special_clignotement,2
add ax,256 ;ajoute une minute
non_fait_rien:
mov temps,ax
pop bx ax
yertterertertertert:
ENDM
;pour xblast
bonus_6 MACRO a
local yertterertertertert
local pas_zeroerrterteert
cmp byte ptr [esi],a
jb yertterertertertert
cmp byte ptr [esi],a+10
jnb yertterertertertert
bruit2 1,40
mov byte ptr [esi],0 ;degage le bonus
call nike_toutes_les_bombes
yertterertertertert:
ENDM
au_milieu_x_et_y MACRO a
local pas_milieu
local boooh
local wqtreertter
local wqtreertter2
push ebp eax
shr ebp,1
xor eax,eax
mov ax,word ptr [donnee+nb_dyna*2+ebp] ;recup Y
add ax,14
and ax,00000000000001111B
cmp action_replay,2
jne wqtreertter
cmp ax,7
jne pas_milieu
wqtreertter:
cmp ax,4
jb pas_milieu
cmp ax,10
ja pas_milieu
mov ax,word ptr [donnee+ebp] ;recup X
add ax,3
and ax,01111B
cmp action_replay,2
jne wqtreertter2
cmp ax,7
jne pas_milieu
wqtreertter2:
cmp ax,4
jb pas_milieu
cmp ax,10
ja pas_milieu
pop eax ebp
jmp boooh
pas_milieu:
pop eax ebp
jmp a
boooh:
ENDM
au_milieu_y2 MACRO a
local ertzerterta
push ebp eax
shr ebp,1
xor eax,eax
mov ax,word ptr [donnee+nb_dyna*2+ebp] ;recup Y
add ax,14
and ax,00000000000001111B
cmp ax,7
je ertzerterta
pop eax ebp
jmp a
ertzerterta:
pop eax ebp
ENDM
au_milieu_X2 MACRO a
local ertzerterta
push ebp eax
shr ebp,1
xor eax,eax
mov ax,word ptr [donnee+ebp] ;recup X
add ax,3
and ax,01111B
cmp ax,7
je ertzerterta
pop eax ebp
jmp a
ertzerterta:
pop eax ebp
ENDM
au_milieu_y MACRO
local ertzerterta
local erterererererertertYUTYUyutyuu
local retreterertertterertertert
push ebp
shr ebp,1
xor eax,eax
mov ax,word ptr [donnee+nb_dyna*2+ebp] ;recup Y
add ax,14
and ax,00000000000001111B
cmp ax,7
jne ertzerterta
pop ebp
jmp erterererererertertYUTYUyutyuu
ertzerterta:
pop ebp
;---- pas au milieu 2 cas de figure:
;la place est libre en face
cmp ax,7
jb retreterertertterertertert
cmp byte ptr [esi+ebx+32],0
jne erterererererertert2
jmp erterererererertertYUTYUyutyuu
retreterertertterertertert:
cmp byte ptr [esi+ebx-32],0
jne erterererererertert2 ;ne fait pas le saut, transforme en saut vertical
erterererererertertYUTYUyutyuu:
mov [lapipipino2+ebp],2 ;saut directionel
mov [lapipipino7+ebp],17 ;endroit a partir dukel on arrete de bouger
;------------------------------
ENDM
au_milieu_x MACRO
local ertzerterta
local erterererererertertYUTYUyutyuuty222
local retreterertertterertertertty222
push ebp
shr ebp,1
xor eax,eax
mov ax,word ptr [donnee+ebp] ;recup X
add ax,3
and ax,01111B
cmp ax,7
jne ertzerterta
pop ebp
jmp erterererererertertYUTYUyutyuuty222
ertzerterta:
pop ebp
;---- pas au milieu 2 cas de figure:
;la place est libre en face
cmp ax,7
jb retreterertertterertertertty222
cmp byte ptr [esi+ebx+1],0
jne erterererererertert2
jmp erterererererertertYUTYUyutyuuty222
retreterertertterertertertty222:
cmp byte ptr [esi+ebx-1],0
jne erterererererertert2
erterererererertertYUTYUyutyuuty222:
mov [lapipipino2+ebp],2 ;saut directionel
mov [lapipipino7+ebp],17 ;endroit a partir dukel on arrete de bouger
;------------------------------
ENDM
xy_to_offset MACRO
xor eax,eax
shr ebp,1
mov ax,word ptr [donnee+nb_dyna*2+ebp] ;recup Y
add ax,14
;shr ax,4
mov bx,word ptr [donnee+ebp] ;X
and ax,01111111111110000B
add bx,3
shl ax,1 ;*32
;mov esi,offset truc2
shr bx,4
add ax,bx
;add esi,eax
ENDM
explosion MACRO a,b,c
local nononononono_rien_pas_de_bonus
local nononononono_rien_pas_de_bombe
local trrtyyrtrytrtyrytrytrtyyrtyrt
local reerertterertteretr
local ferretertrterteetrrteertrterteretrteretertertrteert
local retertertert
local ttyrrtyrtyrtyrtytyrrtyrtyyrtrty
local erertertrteterert
local erterertrteert
local erterertrteertre
local ytyutyuiityuityu
PUSHALL
;puissance bombe
xor ecx,ecx
mov cx,word ptr [liste_bombe+ebp+4+3*4]
;[eax+4]
;mov eax,[liste_bombe+ebp+4+0*4] ;offset de l'infojoeur
trrtyyrtrytrtyrytrytrtyyrtyrt:
add esi,a ;-32
cmp byte ptr [esi-32*13],0
je reerertterertteretr
cmp byte ptr [esi-32*13],2
jne ferretertrterteetrrteertrterteretrteretertertrteert ;on arrete tout
;si ce n'est pas une
;Pierre cassable.
mov byte ptr [esi-32*13],3 ;casse la brique...
jmp ferretertrterteetrrteertrterteretrteretertertrteert
reerertterertteretr:
;donc il n'y a rien dans truc... c'est vide...
;3 possibilité: vide.. ou une bombe,ou un bonus... visible dans truc 2.
cmp byte ptr [esi],1
jb nononononono_rien_pas_de_bombe
;1 = bombe... (2,3,4) respirant...
cmp byte ptr [esi],4
ja nononononono_rien_pas_de_bombe
;---- il y a une bombe il faut la faire exploser...
PUSHALL
sub esi,offset truc2 ;dans esi: distance par rapport a truc2
;liste_bombe dd 0 ; nombre de bombes...
; dd 247 dup (0,0,0,0)
;1er: offset de l'infojoeur
;2eme: nombre de tours avant que ca PETE !!! ; si = 0 ca veut dire
; ;emplacement libre...
;3eme:distance par rapport au debut de truc2
;4eme puissance de la bombe.
;recherche la bombe a niker...
xor ebx,ebx
ttyrrtyrtyrtyrtytyrrtyrtyyrtrty:
cmp dword ptr [liste_bombe+ebx+4+2*4],esi ;regarde si ya une bombe a cet endroit
je erertertrteterert
add ebx,taille_dune_info_bombe
jmp ttyrrtyrtyrtyrtytyrrtyrtyyrtrty
erertertrteterert:
mov dword ptr [liste_bombe+ebx+4+1*4],1 ;fait peter la bombe...
mov word ptr [liste_bombe+ebx+4+4*3+2],0 ;(la rend la bombe normalle. au cas ou)
POPALL
jmp ferretertrterteetrrteertrterteretrteretertertrteert
;----------------------------------------
nononononono_rien_pas_de_bombe:
;----- ya t'il un bonus ??? -----
;54-- bonus bombe... de 54 a 63 (offset 144)
;64-- bonus flamme... de 64 a 73 (offset 144+320*16)
;
;
;194-- explosion d'un bonus... de 194 a 200 (offset 0.172 31x27 +32)
cmp byte ptr [esi],54
jb nononononono_rien_pas_de_bonus
;1 = bombe... (2,3,4) respirant...
cmp byte ptr [esi],194
ja nononononono_rien_pas_de_bonus
;-- ya un bonus.. il faut le faire exploseR. --
;194
bruit2 4,40
mov byte ptr [esi],194
jmp ferretertrterteetrrteertrterteretrteretertertrteert
nononononono_rien_pas_de_bonus:
;---------------------------------
cmp byte ptr [esi],0 ;uniquement si ya aucune autre bombe en train d'exploser
; a cet endroit. en ce moment ...
je erterertrteertre
;--- on choisit quelle bombe il faut proviligier...
; si c'est un coeur de bombe.. on le laissE...
;
;5 = centre de bombe. de 5 a 11
cmp byte ptr [esi],5
jb ytyutyuiityuityu
cmp byte ptr [esi],12
;b erterertrteert ;c un coeur.. on arrete...
jb ferretertrterteetrrteertrterteretrteretertertrteert
ytyutyuiityuityu:
erterertrteertre:
mov al,b ;33 ;truc verti...
cmp ecx,1
jne retertertert
mov al,c ;40
retertertert:
mov byte ptr [esi],al
erterertrteert:
dec ecx
jnz trrtyyrtrytrtyrytrytrtyyrtyrt
ferretertrterteetrrteertrterteretrteretertertrteert:
POPALL
ENDM
bombe MACRO baba
local tetererterertrteerterrteertertrteertrteertertterooi
local terertrteerterto
cmp ax,baba
jnb tetererterertrteerterrteertertrteertrteertertterooi
test dword ptr [changement],0000000000011B
jnz terertrteerterto
inc byte ptr [esi-1]
cmp byte ptr [esi-1],baba
jne terertrteerterto
mov byte ptr [esi-1],0 ;renegade
terertrteerterto:
and eax,011111111B
sub ax,5
shl eax,1
mov ax,word ptr [central_b+eax]
stosw
mov ax,bx
stosw
inc cx
jmp tzererrte
tetererterertrteerterrteertertrteertrteertertterooi:
ENDM
bonus MACRO baba,toto
local tetererterertrteerterrteertertrteertrteertertterooit
local terertrteertertot
cmp ax,baba
jnb tetererterertrteerterrteertertrteertrteertertterooit
test dword ptr [changement],0000000000111B
jnz terertrteertertot
inc byte ptr [esi-1]
cmp byte ptr [esi-1],baba
jne terertrteertertot
mov byte ptr [esi-1],baba-10
terertrteertertot:
and eax,011111111B
sub ax,baba-10
shl eax,4 ;*16
add eax,toto
stosw
mov ax,bx
stosw
inc cx
jmp tzererrte
tetererterertrteerterrteertertrteertrteertertterooit:
ENDM
explo_bonus MACRO baba,toto
local tetererterertrteerterrteertertrteertrteertertterooit
local terertrteertertot
cmp ax,baba
jnb tetererterertrteerterrteertertrteertrteertertterooit
test dword ptr [changement],0000000000111B
jnz terertrteertertot
inc byte ptr [esi-1]
cmp byte ptr [esi-1],baba
jne terertrteertertot
mov byte ptr [esi-1],0 ;baba-8
terertrteertertot:
and eax,011111111B
sub ax,baba-7
shl eax,5 ;*32
add eax,toto
stosw
mov ax,bx
stosw
inc cx
jmp tzererrte
tetererterertrteerterrteertertrteertrteertertterooit:
ENDM
oeuf_bonus MACRO baba,toto
local tetererterertrteerterrteertertrteertrteertertterooit
cmp ax,baba
jne tetererterertrteerterrteertertrteertrteertertterooit
;and eax,011111111B
;sub ax,baba-7
;shl eax,5 ;*32
mov ax,toto
stosw
mov ax,bx
stosw
inc cx
jmp tzererrte
tetererterertrteerterrteertertrteertrteertertterooit:
ENDM
affiche_sprites proc near
PUSHALL
mov ax,ds
mov es,ax
SOUND
;-----------------------------------------------------
cmp terrain,5
jne pas_nuages
cmp [detail],1
je pas_nuages
call gestion_nuage
pas_nuages:
;----- mignon petit oiseau: ceux ki sont derriere nos dynas
cmp [terrain],2
jne retrterterte5rtrze
cmp [detail],1
je retrterterte5rtrze
call noel2
retrterterte5rtrze:
;foot
cmp [terrain],8
jne retrterterte5ertertertreteer
cmp [detail],1
je retrterterte5ertertertreteer
call animfoot_haut
retrterterte5ertertertreteer:
;----------------------------------------------------------
;-------------------- briques ....
;briques dw 3,0,0,0,32,0,64
xor ecx,ecx
mov esi,offset briques
lodsw
or ax,ax
jz reertertertertertterrterte
mov cx,ax
xor ebx,ebx
libere:
xor eax,eax
lodsw
mov bx,ax
lodsw
push esi
push ds
push fs
pop ds
mov esi,1582080
;mov esi,offset buffer3
add esi,ebx
mov edi,offset buffer
add edi,eax
cmp es:[terrain],2 ;pas ce cas particulier avec la neige...
je retterterertertertertertertertertertert
cmp es:[terrain],4 ;pas ce cas particulier avec la foret
je retterterertertertertertertertertertert
or bx,bx
jnz retterterertertertertertertertertertert ;cas particulier:brique en
;destruction.
retrterterte:
call aff_brique
retterterertertertertertertertertertert2:
pop ds
pop esi
dec cx
jnz libere
reertertertertertterrterte: ;
;-------------------- bombes, explosions & bonus
;briques dw 3,0,0,0,32,0,64
xor ecx,ecx
mov esi,offset bombes
lodsw
or ax,ax
jz reertertertertertterrtertet
mov cx,ax
xor ebx,ebx
liberet:
xor eax,eax
lodsw
mov bx,ax
lodsw
push esi
mov esi,1582080+64000*5 ;offset buffer3
add esi,ebx
push ds
push fs
pop ds
;---
mov edi,offset buffer
add edi,eax
cmp bx,320*172 ;cas particulier : bonus en explosion... (ne fait rien)
jnb reetrertertert2tyrtyryrtrtyrtyrty
cmp bx,320*16+112 ;cas particulier : oeuf (ne fait rien)
je reetrertertert2tyrtyryrtrtyrtyrty
;aff_bombe
SPRITE_16_16
reetrertertert2tyrtyryrtrtyrtyrty:
pop ds
pop esi
dec cx
jnz liberet
reertertertertertterrtertet:
;.... bonus oeuf et explosion de bonus (par dessus)
xor ecx,ecx
mov esi,offset bombes
lodsw
or ax,ax
jz treertertertertertterrtertet
mov cx,ax
xor ebx,ebx
tliberet:
xor eax,eax
lodsw
mov bx,ax
lodsw
push esi
mov esi,1582080+64000*5 ;offset buffer3
add esi,ebx
push ds
push fs
pop ds
;---
mov edi,offset buffer
add edi,eax
cmp bx,320*172 ;cas particulier : bonus en explosion...
jnb reetrertertert2
cmp bx,320*16+112 ;cas particulier : oeuf
je reetrertertert3
;aff_bombe
reetrertertert:
pop ds
pop esi
dec cx
jnz tliberet
treertertertertertterrtertet:
;--- ombres
call aff_ombres
;----- dynablaster
call expere ;affiche le...
;---- arbre de noel
cmp [terrain],2 ;NEIGE !!!
jne retrterterte5ertertert
call noel
retrterterte5ertertert:
;mov edi,896000+384000+46080+64000+64000 ; 128000 ;307200
;1966080+64000*22;foot 7
;---- faux foot (soucoupes volantes)
cmp [terrain],7
jne retrterterte5ertertertrete
;cmp [detail],1
;je retrterterte5ertertertrete
call soucoupe
retrterterte5ertertertrete:
;---- vrai soccer
cmp [terrain],8
jne retrterterte5ertertertretee
call animfoot_oblige
cmp [detail],1
je retrterterte5ertertertretee
call animfoot
retrterterte5ertertertretee:
;mov edi,1966080+64000*24
;---- feuilles de la foret.
cmp [terrain],4 ;foret.
jne retrterterte5ertertertret
cmp [detail],1
je retrterterte5ertertertret
call feuillage
retrterterte5ertertertret:
;---- puzzles sur les crayons
cmp [terrain],6 ;crayon
jne retrterterte5ertertertrett
cmp [detail],1
je retrterterte5ertertertrett
call puzzle2
retrterterte5ertertertrett:
call tv
;cmp action_replay,2
;je retrterterte5ertertertretterrettereererettrr
cmp [detail],1
je retrterterte5ertertertretterrettereererettrr
call bdraw
retrterterte5ertertertretterrettereererettrr:
call horloge
call pauseur
;mov edi,1582080
POPALL
ret
tv:
;cmp adder_inser_coin,320*67
;je rerteerterterterttrertertertertetrertertert
;AFFICHAGE DU INSER COIN POUR LE MODE DEMO
;cmp [detail],1
;je rerteerterterterttrertertertertetrertertert
;cmp special_on_a_loadee_nivo,2 ;si on load un .mrb pas de truc a droite !!
;je rerteerterterterttrertertertertetrertertert
;cmp action_replay,2
;je ertrteertretterertrteertrte
;rerteerterterterttrertertertertetrertertert:
ret
ertrteertretterertrteertrte:
PUSHALL
;
;pause db 0 ;0=nan inverse = oui
;pas de pause en action replay
;cmp action_replay,2
;je pas_en_a
xor ebx,ebx
;mov bl,pauseur2
;mov esi,[offset_pause+ebx]
;offset_ic dd 0,74*2,74
;viseur_ic2 dd 0
;inser_coin dd 256
dec inser_coin
jnz rerteertertyrt
mov inser_coin,32
add viseur_ic2,4
cmp viseur_ic2,4*4
jne rerteertertyrt
mov viseur_ic2,0
rerteertertyrt:
mov ebx,viseur_ic2
mov esi,[offset_ic+ebx]
add esi,adder_inser_coin
;cmp attente_avant_adder_inser_coin,0
;je ertrteertertertertetrertertert
;dec attente_avant_adder_inser_coin
;jmp ertertertertetrertertert
;ertrteertertertertetrertertert:
cmp adder_inser_coin,0 ;320*67
je ertertertertetrertertert
sub adder_inser_coin,320
ertertertertetrertertert:
add esi,1582080+64000*4+74+22*320
push ds
pop es
push fs
pop ds
;add esi,1582080
mov edi,offset buffer+(0*320+256)
aff_spt2 67,58,0
pas_en_a:
POPALL
ret
bdraw:
cmp adder_bdraw,50*320
jne reterreer233
;test temps,000111111111111B
;jz zerooo
;
;mov in_the_apocalypse,0
;
;cmp nombre_de_vbl_avant_le_droit_de_poser_bombe,0
;je reterreer233
ret
reterreer233:
;mov esi,1966080+64000*22+32 ;foot 7896000+384000+46080+64000+64000+11
PUSHALL
;bdraw666 db '30'
;--- affichage des chiffres ---
xor eax,eax
mov al,bdraw666
sub al,'0'
shl eax,3
mov esi,eax
PUSHALL
push fs
pop es
push fs
pop ds
add esi,1966080+64000*22+173+320*33
mov edi,1966080+64000*22+137+320*64
aff_spt666 5,8
POPALL
xor eax,eax
mov al,bdraw666+1
sub al,'0'
shl eax,3
mov esi,eax
PUSHALL
push fs
pop es
push fs
pop ds
add esi,1966080+64000*22+173+320*33
mov edi,1966080+64000*22+137+8+320*64
aff_spt666 5,8
POPALL
;-----------------------
xor esi,esi
mov si,adder_bdraw
add esi,1966080+64000*22+96+41*320
cmp slowcpu,1
je cunfalcon
;
;add esi,adder_bdraw
push ds
pop es
push fs
pop ds
;add esi,1582080
mov edi,offset buffer+8
aff_spt2 43,78,11-31 ;
POPALL
ret
cunfalcon:
push ds
pop es
push fs
pop ds
;add esi,1582080
mov edi,offset buffer+8
SPRITE_TIMEOUT
POPALL
ret
pauseur:
PUSHALL
;
;pause db 0 ;0=nan inverse = oui
;pas de pause en action replay
cmp pauseur2,0
je pas_en_pause
xor ebx,ebx
mov bl,pauseur2
mov esi,[offset_pause+ebx]
push ds
pop es
push fs
pop ds
add esi,1582080
mov edi,offset buffer+(136+(100-32)*320)
SPRITE_64_46
pas_en_pause:
POPALL
ret
animfoot:
;mov edi,1966080+64000*24
PUSHALL
inc dword ptr [compteur_nuage]
push ds
pop es
push fs
pop ds
;supporter..
;
;ov ebx,es:[compteur_nuage]
;nd ebx,0000000000110000B ; 011111110000B
;hr ebx,4
;ov esi,1966080+64000*24+24+28*320
;or ecx,ecx
;ov cl,es:[offset_supporter+ebx]
;dd esi,ecx
;ov edi,offset buffer+320*2+2
;ff_spt 19 23
;camera 2
mov ebx,es:[compteur_nuage]
and ebx,0000000111110000B ; 011111110000B
shr ebx,4
mov esi,1966080+64000*24
xor ecx,ecx
mov cl,es:[offset_cameraman+ebx]
add esi,ecx
mov edi,offset buffer+140*320
SPRITE_23_21
;camera
mov ebx,es:[compteur_nuage]
add ebx,8+16
and ebx,0000000111110000B ; 011111110000B
shr ebx,4
mov esi,1966080+64000*24
xor ecx,ecx
mov cl,es:[offset_cameraman+ebx]
add esi,ecx
add esi,5*24
mov edi,offset buffer+25*320+299
SPRITE_23_21
; girl
mov ebx,es:[compteur_nuage]
and ebx,00011110000B
shr ebx,3
mov esi,1966080+64000*24
xor ecx,ecx
mov cx,es:[offset_fille+ebx]
add esi,ecx
mov edi,offset buffer+170*320+140+32
SPRITE_30_48
mov ebx,es:[compteur_nuage]
and ebx,00011110000B
shr ebx,3
mov esi,1966080+64000*24
xor ecx,ecx
mov cx,es:[offset_fille+ebx]
add esi,ecx
mov edi,offset buffer+170*320+140+33+32
SPRITE_30_48
mov ebx,es:[compteur_nuage]
and ebx,00011110000B
shr ebx,3
mov esi,1966080+64000*24
xor ecx,ecx
mov cx,es:[offset_fille+ebx]
add esi,ecx
mov edi,offset buffer+170*320+140+66+32
SPRITE_30_48
mov ebx,es:[compteur_nuage]
and ebx,00011110000B
shr ebx,3
mov esi,1966080+64000*24
xor ecx,ecx
mov cx,es:[offset_fille+ebx]
add esi,ecx
mov edi,offset buffer+170*320+10
SPRITE_30_48
mov ebx,es:[compteur_nuage]
and ebx,00011110000B
shr ebx,3
mov esi,1966080+64000*24
xor ecx,ecx
mov cx,es:[offset_fille+ebx]
add esi,ecx
mov edi,offset buffer+170*320+42
SPRITE_30_48
;----
;mov edi,1966080+64000*22
POPALL
ret
animfoot_haut:
PUSHALL
push ds
pop es
push fs
pop ds
;supporter..
mov ebx,es:[compteur_nuage]
and ebx,0000000000110000B ; 011111110000B
shr ebx,4
mov esi,1966080+64000*24+24+28*320
xor ecx,ecx
mov cl,es:[offset_supporter+ebx]
add esi,ecx
mov edi,offset buffer+320*2+2
SPRITE_19_23
;supporter..2
mov ebx,es:[compteur_nuage]
add ebx,7
and ebx,0000000000110000B ; 011111110000B
shr ebx,4
mov esi,1966080+64000*24+144+28*320
xor ecx,ecx
mov cl,es:[offset_supporter+ebx]
add esi,ecx
mov edi,offset buffer+320*3+295
SPRITE_19_23
POPALL
ret
animfoot_oblige:
;mov edi,1966080+64000*24
PUSHALL
push ds
pop es
push fs
pop ds
mov esi,1966080+64000*22+11+52*320
mov edi,offset buffer+11+52*320
SPRITE_77_12
mov esi,1966080+64000*22+297+52*320
mov edi,offset buffer+297+52*320
SPRITE_77_12
POPALL
ret
soucoupe:
PUSHALL
inc dword ptr [compteur_nuage]
mov ebx,[compteur_nuage]
xor esi,esi
and ebx,0000000000010000B
jnz mlkjmljktrjklmrejklmtrjklmjklmteerrtrtrrttrrttre
mov esi,232
mlkjmljktrjklmrejklmtrjklmjklmteerrtrtrrttrrttre:
push ds
pop es
push fs
pop ds
add esi,1966080+64000*22+133*320 ;foot 7896000+384000+46080+64000+64000+11
mov edi,offset buffer+232
SPRITE_36_88
POPALL
ret
feuillage:
PUSHALL
push ds
pop es
push fs
pop ds
mov esi,896000+384000+46080+64000+64000+11
mov edi,offset buffer+11
SPRITE_192_21
mov esi,896000+384000+46080+64000+64000+288
mov edi,offset buffer+288
SPRITE_192_21
mov esi,896000+384000+46080+64000+64000+36-6
mov edi,offset buffer+30
SPRITE_16_263
mov esi,896000+384000+46080+64000+64000+69+166*320
mov edi,offset buffer+69+166*320 ;166
SPRITE_26_206
POPALL
ret
puzzle2:
PUSHALL
push ds
pop es
push fs
pop ds
mov esi,1582080+64000*4+51 ;le haut
mov edi,offset buffer+51
SPRITE_16_187
;ov esi,1582080+64000*4+155+6*320
;ov edi,offset buffer+155+6*320
;ff_spt 10 10
;ov esi,1582080+64000*7+217+6*320
;ov edi,offset buffer+217+6*320
;ff_spt 10 10
mov esi,1582080+64000*4+16 ;a gauche
mov edi,offset buffer+16
SPRITE_191_16
;a droite
mov esi,1582080+64000*4+288
mov edi,offset buffer+288
SPRITE_92_17
mov esi,1582080+64000*4+288+107*320
mov edi,offset buffer+288+107*320
SPRITE_85_17
POPALL
ret
gestion_nuage:
PUSHALL
inc dword ptr [compteur_nuage]
;nuage_sympa dd 72+296*320,0
mov ecx,16
lea esi,nuage_sympa
;-------
teryrtyrtyuuiyuyu:
;add eax,160
mov eax,dword ptr [esi+16]
test dword ptr [compteur_nuage],eax
jnz pas_cette_fois
inc dword ptr [esi+4]
pas_cette_fois:
mov eax,[esi]
mov ebx,[esi+8]
cmp dword ptr [esi+4],ebx
jb ertrteterertert
mov dword ptr [esi+4],0
ertrteterertert:
cmp dword ptr [esi+4],319
ja ertertrteterertert
sub eax,[esi+4]
mov edx,dword ptr [esi+12]
PUSHALL
mov esi,1582080+64000*5
add esi,edx
mov edi,offset buffer
add edi,eax
push ds
pop es
push fs
pop ds
SPRITE_CLOUD
POPALL
ertertrteterertert:
add esi,4*5
dec ecx
jnz teryrtyrtyuuiyuyu
POPALL
ret
noel:
PUSHALL
push ds
pop es
push fs
pop ds
mov esi,64000*8+136*320
inc es:[arbre]
test es:[arbre],0000100000B
jz retterertertert
add esi,33
retterertertert:
mov edi,offset buffer+112+31*320
mov ecx,48 ;64
uertertertrteert:
mov ebx,33
uconcert:
lodsb
or al,al
jz uertertertrte
mov byte ptr es:[edi],al
uertertertrte:
inc edi
dec ebx
jnz uconcert
add edi,320-33
add esi,320-33
dec ecx
jnz uertertertrteert
mov esi,64000*8+077*320
mov edi,offset buffer+232+56*320
mov ecx,42
yuertertertrteert:
mov ebx,48
yuconcert:
lodsb
or al,al
jz yuertertertrte
mov byte ptr es:[edi],al
yuertertertrte:
inc edi
dec ebx
jnz yuconcert
add edi,320-48
add esi,320-48
dec ecx
jnz yuertertertrteert
;--- oiseaux
cmp es:[detail],1
je retrterterte5
mov esi,64000*8+040*320+69+16*4
mov ebx,es:[arbre]
and ebx,0000010000B
jz ertertreterterter
add esi,16
ertertreterterter:
mov edi,offset buffer+320*184+50
call oiseau
mov edi,offset buffer+320*184+50+17*1
call oiseau
mov edi,offset buffer+320*184+50+17*4
call oiseau
mov edi,offset buffer+320*184+50+17*9
call oiseau
mov esi,64000*8+040*320+69+16*0
mov ebx,es:[arbre]
and ebx,0000010000B
jz iertertreterterter
add esi,16
iertertreterterter:
mov edi,offset buffer+320*164+1
call oiseau
mov edi,offset buffer+320*148+1
call oiseau
mov edi,offset buffer+320*101+1
call oiseau
mov edi,offset buffer+320*30+1
call oiseau
mov edi,offset buffer+320*47+1
call oiseau
retrterterte5:
POPALL
ret
noel2:
PUSHALL
push ds
pop es
push fs
pop ds
mov esi,64000*8+023*320+69
;mov edi,offset buffer+112+86*320
mov edi,offset buffer+1+320+9
mov ebx,es:[arbre]
add ebx,18*16
and ebx,0111110000B
shr ebx,2
add esi,es:[offset_oiseau+ebx]
call oiseau
mov edi,offset buffer+1+320+16+1+9
call oiseau
mov edi,offset buffer+1+320+16+1+16+1+9
call oiseau
mov esi,64000*8+023*320+69
mov ebx,es:[arbre]
add ebx,20*16
and ebx,0111100000B
shr ebx,3
add esi,es:[offset_oiseau+ebx]
mov edi,offset buffer+1+320+16+1+16+1+16*8
call oiseau
mov edi,offset buffer+1+320+16+1+16+1+16*10
call oiseau
mov esi,64000*8+023*320+69
mov ebx,es:[arbre]
add ebx,20*16
and ebx,0011110000B
shr ebx,2
add esi,es:[offset_oiseau+ebx]
mov edi,offset buffer+1+320+16+1+16+1+16*5
call oiseau
mov edi,offset buffer+1+320+16+1+6+1+16*14
call oiseau
;---- devant l'arbre
mov esi,64000*8+023*320+69
mov edi,offset buffer+112+89*320
mov ebx,es:[arbre]
and ebx,0111110000B
shr ebx,2
add esi,es:[offset_oiseau+ebx]
call oiseau
mov edi,offset buffer+112+89*320+16+1
call oiseau
retrterterte5rt:
POPALL
ret
oiseau:
PUSHALL
mov ecx,16
iyuertertertrteert:
mov ebx,16
iyuconcert:
lodsb
or al,al
jz iyuertertertrte
mov byte ptr es:[edi],al
iyuertertertrte:
inc edi
dec ebx
jnz iyuconcert
add edi,320-16
add esi,320-16
dec ecx
jnz iyuertertertrteert
POPALL
ret
;rterterteertrteertert:
;xor ebx,ebx
;mov ecx,[nombre_de_dyna]
expere:
PUSHALL
;POPALL
;push ecx
;xor eax,eax
;mov ax,word ptr [donnee+nb_dyna*2+ebx] ;y
;
;push eax
;shl eax,6 ; x 64
;mov edi,eax
;pop eax
;shl eax,8 ; x 256
;add edi,eax
;
;xor eax,eax
;xor esi,esi
;mov ax,word ptr [donnee+ebx]
;mov si,word ptr [donnee+nb_dyna*2*2+ebx]
;cmp si,666 ;code speical indique affiche rien...
;je nanananana_il_est_mort
;;------- source en fonction de si c'est un boy ou une girl...
;add esi,576000 ; 128000 ;307200
;cmp ebx,2*4
;jb reterterertrte45 ;c'est une girl...
;add esi,64000
;reterterertrte45:
;;-------------------------------
;mov ebx,320*200 ;307200
;mov ax,fs
; (serra trié a l'affichage par chaque machine.mettra dest a 0ffffh)
mov ecx,8 ;[nombre_de_dyna]
oooooooo:
push ecx
;----- recherche le dyna le plus haut !!!
xor ebx,ebx
xor edi,edi
xor eax,eax
mov al,byte ptr [donnee4+6+ebx]
EAX_X_320
add ax,word ptr [donnee4+4+ebx]
;--- cas particulier: on a une ombre: donc on prend l'ombre a la place
lapinomb ax
;----------------------------------------
;----
mov ebp,ebx
push ecx
mov ecx,8 ;[nombre_de_dyna]
gogotingo:
add ebx,nb_unite_donnee4 ;8
add edi,2 ;pour avoir un viseur x2 sur le numero du dyna kon a choisit
dec ecx
jz mwai
xor edx,edx
mov dl,byte ptr [donnee4+6+ebx]
EDX_X_320
add dx,word ptr [donnee4+4+ebx]
;--- cas particulier: on a une ombre: donc on prend l'ombre a la place
lapinomb dx
;----------------------------------------
;cmp word ptr [donnee4+4+ebx],ax
cmp dx,ax
jnb fraiche
xor eax,eax
mov al,byte ptr [donnee4+6+ebx]
EAX_X_320
add ax,word ptr [donnee4+4+ebx]
;add ax,319 ;pour ke ka on se croie gauche droite ca change pas bizarre
; ;rement au milieu
;--- cas particulier: on a une ombre: donc on prend l'ombre a la place
lapinomb ax
;----------------------------------------
mov ebp,ebx
fraiche:
jmp gogotingo
mwai:
pop ecx
mov esi,dword ptr [donnee4+ebp]
cmp esi,666
je nanananana_il_est_mort
push edi
xor edi,edi
mov di,word ptr [donnee4+4+ebp] ;offset "bloc"
push ds
xor bx,bx
mov bl,byte ptr [donnee4+6+ebp] ;nombre des lignes.
xor cx,cx
mov cl,byte ptr [donnee4+7+ebp] ;nombre de colonnes.
mov dl,byte ptr [donnee4+8+ebp] ;1er bit: clignotement ???
and dl,01B
push fs
pop ds
call affiche_bomby
pop ds
pop edi
nanananana_il_est_mort:
mov word ptr [donnee4+4+ebp],-1
mov byte ptr [donnee4+6+ebp],0
pop ecx
dec ecx
jnz oooooooo
POPALL
ret
;cas particulier. brique en destruction...
retterterertertertertertertertertertert:
SPRITE_16_16
;PUSHALL
;aff_bombe
;POPALL
jmp retterterertertertertertertertertertert2
affiche_bomby:
;mov dl,byte ptr [donnee4+8+ebp] ;1er bit: clignotement ???
;and dl,01B
cmp dl,1
je blancheur_supreme
affiche_bomby2: ;sans blancheur
;-----
add edi,offset buffer
sprite_bn
ret
;affiche sprite mais en blanc.
blancheur_supreme:
add edi,offset buffer
sprite_bw
ret
; 6.71447
aff_brique:
mov eax,[esi]
mov [edi],eax
mov eax,[esi+4]
mov [edi+4],eax
mov eax,[esi+8]
mov [edi+8],eax
mov eax,[esi+12]
mov [edi+12],eax
mov eax,[esi+320]
mov [edi+320],eax
mov eax,[esi+320+4]
mov [edi+320+4],eax
mov eax,[esi+320+8]
mov [edi+320+8],eax
mov eax,[esi+320+12]
mov [edi+12+320],eax
mov eax,[esi+320*2]
mov [edi+320*2],eax
mov eax,[esi+320*2+4]
mov [edi+320*2+4],eax
mov eax,[esi+320*2+8]
mov [edi+320*2+8],eax
mov eax,[esi+320*2+12]
mov [edi+12+320*2],eax
mov eax,[esi+320*3]
mov [edi+320*3],eax
mov eax,[esi+320*3+4]
mov [edi+320*3+4],eax
mov eax,[esi+320*3+8]
mov [edi+320*3+8],eax
mov eax,[esi+320*3+12]
mov [edi+12+320*3],eax
mov eax,[esi+320*4]
mov [edi+320*4],eax
mov eax,[esi+320*4+4]
mov [edi+320*4+4],eax
mov eax,[esi+320*4+8]
mov [edi+320*4+8],eax
mov eax,[esi+320*4+12]
mov [edi+12+320*4],eax
mov eax,[esi+320*5]
mov [edi+320*5],eax
mov eax,[esi+320*5+4]
mov [edi+320*5+4],eax
mov eax,[esi+320*5+8]
mov [edi+320*5+8],eax
mov eax,[esi+320*5+12]
mov [edi+12+320*5],eax
mov eax,[esi+320*6]
mov [edi+320*6],eax
mov eax,[esi+320*6+4]
mov [edi+320*6+4],eax
mov eax,[esi+320*6+8]
mov [edi+320*6+8],eax
mov eax,[esi+320*6+12]
mov [edi+12+320*6],eax
mov eax,[esi+320*7]
mov [edi+320*7],eax
mov eax,[esi+320*7+4]
mov [edi+320*7+4],eax
mov eax,[esi+320*7+8]
mov [edi+320*7+8],eax
mov eax,[esi+320*7+12]
mov [edi+12+320*7],eax
mov eax,[esi+320*8]
mov [edi+320*8],eax
mov eax,[esi+320*8+4]
mov [edi+320*8+4],eax
mov eax,[esi+320*8+8]
mov [edi+320*8+8],eax
mov eax,[esi+320*8+12]
mov [edi+12+320*8],eax
mov eax,[esi+320*9]
mov [edi+320*9],eax
mov eax,[esi+320*9+4]
mov [edi+320*9+4],eax
mov eax,[esi+320*9+8]
mov [edi+320*9+8],eax
mov eax,[esi+320*9+12]
mov [edi+12+320*9],eax
mov eax,[esi+320*10]
mov [edi+320*10],eax
mov eax,[esi+320*10+4]
mov [edi+320*10+4],eax
mov eax,[esi+320*10+8]
mov [edi+320*10+8],eax
mov eax,[esi+320*10+12]
mov [edi+12+320*10],eax
mov eax,[esi+320*11]
mov [edi+320*11],eax
mov eax,[esi+320*11+4]
mov [edi+320*11+4],eax
mov eax,[esi+320*11+8]
mov [edi+320*11+8],eax
mov eax,[esi+320*11+12]
mov [edi+12+320*11],eax
mov eax,[esi+320*12]
mov [edi+320*12],eax
mov eax,[esi+320*12+4]
mov [edi+320*12+4],eax
mov eax,[esi+320*12+8]
mov [edi+320*12+8],eax
mov eax,[esi+320*12+12]
mov [edi+12+320*12],eax
mov eax,[esi+320*13]
mov [edi+320*13],eax
mov eax,[esi+320*13+4]
mov [edi+320*13+4],eax
mov eax,[esi+320*13+8]
mov [edi+320*13+8],eax
mov eax,[esi+320*13+12]
mov [edi+12+320*13],eax
mov eax,[esi+320*14]
mov [edi+320*14],eax
mov eax,[esi+320*14+4]
mov [edi+320*14+4],eax
mov eax,[esi+320*14+8]
mov [edi+320*14+8],eax
mov eax,[esi+320*14+12]
mov [edi+12+320*14],eax
mov eax,[esi+320*15]
mov [edi+320*15],eax
mov eax,[esi+320*15+4]
mov [edi+320*15+4],eax
mov eax,[esi+320*15+8]
mov [edi+320*15+8],eax
mov eax,[esi+320*15+12]
mov [edi+12+320*15],eax
ret
reetrertertert3: ;affichage d'un oeuf
aff_oeuf
jmp reetrertertert
reetrertertert2: ;affichage d'une explosion de bonus...
sub edi,11*320+6
SPRITE_27_31
jmp reetrertertert
affiche_sprites endp
;load proc near
; xor eax,eax
; mov al,00h ;ouverture du fichier pour lecture.
; mov ah,03dh
; mov edx,offset fichier
; int 21h
; jc erreur_filec;saute si carry=1
;
; mov ebx,eax
; mov ah,03fh
; mov ecx,064000
; mov edx,offset buffer
; int 21h
;
; mov ah,03eh
; int 21h
;ret
; DOS INT 21h
;call affsigne
;ret
;load endp
beuh proc near
push ds
mov ax,fs ;SOURCE...
mov ds,ax ;
mov es,ax
mov esi,0
mov edi,614400
mov ecx,76800
rep movsd
pop ds
ret
beuh endp
aff_page proc near ;affiche en ram video ce k'il y a a : FS:ESI
;ENTREE : ESI
push ds
xor edi,edi
mov ax,fs ;SOURCE...
mov ds,ax ;
xor bx,bx ;pour l'int.
xor dx,dx
call change_page
push edi
mov ecx,016384
rep movsd
pop edi
call change_page
push edi
mov ecx,016384
rep movsd
pop edi
call change_page
push edi
mov ecx,016384
rep movsd
pop edi
call change_page
push edi
mov ecx,016384
rep movsd
pop edi
call change_page
push edi
mov ecx,45056/4
rep movsd
pop edi
pop ds
ret
change_page:
;mov dx,bp ;numero de la fenetre ;ax
;xor bx,bx
mov ax,4f05h
int 10h
inc dx ;bp
ret
aff_page endp
;copie_page proc near ;copie dans buffer ce k'il y a a : FS:ESI
;PUSHALL
;mov ax,ds
;mov es,ax
;mov ax,fs
;mov ds,ax
;mov edi,offset buffer
;mov ecx,64000/4
;rep movsd
;
;POPALL
;ret
;copie_page endp
aff_page2 proc near ;affiche en ram video ce k'il y a a dans le buffer
RAMBUFFER
;PUSH ESI
;mov esi,offset buffer
;ram
;POP ESI
RET
;PUSHALL
;
;cmp [affiche_pal],1 ;!!! sauf si on eteint la pal...
;jne erertrte
;POPALL
;ret
;erertrte:
;
;xor edi,edi
;
;;mov ax,fs ;SOURCE...
;;mov ds,ax ;
;
;mov esi,offset buffer
;
;mov ecx,320*200/4
;rep movsd
;
;POPALL
;ret
aff_page2 endp
FILEERROR MACRO
local erreur_filec
jnc erreur_filec ;saute si carry=1
mov ax,3h
int 10h
lea edx,loaderror
mov ah,9
int 21h
mov bl,0100B ;rouge
mov bh,10000000B ;indique clignotement
call last_color
mov ax,4c00h ; AH=4Ch - Exit To DOS
int 21h
erreur_filec:
ENDM
load_pcx proc near ; ecx: offset dans le fichier.
; edx: offset nom du fichier
; edi: viseur dans données ou ca serra copié (ax:)
; ebx: nombre de pixels dans le pcx
pushad
push es ds
mov [load_pcx_interne],ebx
mov es,ax
xor eax,eax
mov al,00h ;ouverture du fichier pour lecture.
mov ah,03dh
int 21h
FILEERROR
mov [load_handle],eax
;... deplacement a l'interieur du fichier rmd ...
push ecx ;(1)
mov ebx,[load_handle]
mov ah,042h
mov al,00h ;debut du fichier
mov dx,cx
shr ecx,16
;dans cx:dx deplacement a l'interieur du fichier
int 21h
FILEERROR
;...lecture du fichier...
mov ebx,[load_handle]
mov ah,03fh
mov ecx,0FFFFh
mov edx,offset buffer
int 21h
FILEERROR
pop eax ;(1)
push ebx
mov ebx,dword ptr [buffer]
BIGENDIANPATCH ebx
add eax,ebx
pop ebx
sub eax,768
push eax ;(1)
;xor edi,edi
xor ebx,ebx ;nombre de pixel k'on a affiche
xor ecx,ecx
mov esi,offset buffer+128
encore_un_pixel:
cmp ebx,[load_pcx_interne]
jnb cestfini
lodsb
cmp esi,offset buffer+0ffffh
jne coke
call charge_encore
mov esi,offset buffer
coke:
cmp al,192
jb non_c_un_octet_seul
and al,0111111B
movzx cx,al ;non signe... 8 -> 16 bits
lodsb
cmp esi,offset buffer+0ffffh
jne cok
call charge_encore
mov esi,offset buffer
cok:
viennes:
stosb
inc ebx ;nombre de pixels k'on a affiches.
dec cx
jnz viennes
jmp encore_un_pixel
non_c_un_octet_seul:
stosb
inc ebx ;nombre de pixels k'on a affiches.
jmp encore_un_pixel
cestfini:
;.... plus k'a recopier la palette...
;mov ax,c
;mov es,ax
;mov ds,ax
mov ebx,[load_handle]
;;mov eax,0 ;-768 ;259995 ;768
pop eax ;(1) !!
;
mov dx,ax
shr eax,16
mov cx,ax
mov ah,042h
mov al,00h
int 21h
FILEERROR
;
;push dx
;mov ax,c
;mov es,ax
;mov ds,ax
mov ebx,[load_handle]
mov ah,03fh
mov cx,0768
mov edx,offset pal
int 21h
;pop dx
;
;;...............convertis la palette...
;
;
;;dans cx:dx deplacement a l'interieur du fichier
;
;mov ax,c
;mov es,ax
;mov ds,ax
mov esi,offset pal
; mov di,offset pal
mov cx,768
xor ax,ax
rtrttr:
mov al,[esi]
shr al,2
mov [esi],al
inc esi
dec cx
jnz rtrttr
;
;...fermeture fichier...
mov ebx,[load_handle]
mov ah,03eh
int 21h
FILEERROR
pop ds es
popad
ret
load_pcx endp
load_raw proc near ; ecx: offset dans le fichier.
; edx: offset nom du fichier
; edi: viseur dans données ou ca serra copié (ax:)
; ebx: nombre de pixels dans le pcx
pushad
push es ds
xor eax,eax
mov al,00h ;ouverture du fichier pour lecture.
mov ah,03dh
int 21h
jnc retyryurttyutyutyuutyyuiiyuuiyuiy
mov dl,13
mov ah,2
int 21h
lea edx,suite2
mov ah,09h
int 21h
mov bl,4 ;rouge
mov bh,10000000B ;indique clignotement
call last_color
mov ax,4c00h ; AH=4Ch - Exit To DOS
int 21h ; DOS INT 21h
retyryurttyutyutyuutyyuiiyuuiyuiy:
mov [load_handle],eax
mov ebx,[load_handle]
mov ah,042h
mov al,00h ;debut du fichier
mov dx,cx
shr ecx,16
int 21h
mov ebx,[load_handle]
mov ah,03fh
mov ecx,064000
; edi: viseur dans données ou ca serra copié (ax:)
push ds
push fs
pop ds
mov edx,edi
int 21h
pop ds
mov ebx,[load_handle]
mov ah,03eh
int 21h
pop ds es
popad
ret
load_raw endp
charge_encore proc near
push ds ax es ds ebx cx dx
mov ebx,[load_handle]
mov ah,03fh
mov cx,0FFFFh
mov edx,offset buffer
int 21h
pop dx cx ebx ds es ax ds
ret
charge_encore endp
;pal db 768 dup (?) ;pal de l'émulateur.
;pal_affiche db 768 dup (0) ;pal k'on affiche...
;affiche_pal db 0 ; 1: vas de la palette au noir (ne plus afficher
; ; d'écran !!!)
; ;
; ; 2: va du noir a la palette
; ; 0: ne fait rien...
pal_visage proc near
PUSHALL
;call noping
;call noping
;call noping
;call noping
;call noping
;call noping
;call noping
;call noping
;call noping
;call noping
;call noping
;call noping
cmp [affiche_pal],0
jne histoire
rty:
POPALL
ret
histoire:
push ds
pop es
cmp [affiche_pal],1
jne zorrro
;affiche_pal db 0 ; 1: vas de la palette au noir (ne plus afficher
; ; d'écran !!!)
;------------
xor bp,bp
mov dx,4
reeeeee:
;mov esi,offset pal
mov esi,offset pal_affiche
mov cx,768
rchanger:
cmp byte ptr [esi],0
je pareil
dec byte ptr [esi]
jmp pas_pareil
pareil:
inc bp
pas_pareil:
inc esi
dec cx
jnz rchanger
dec dx
jnz reeeeee
cmp bp,768*4
jne erterterterrterte
mov [affiche_pal],2
erterterterrterte:
call affpal
POPALL
ret
zorrro:
xor bp,bp
mov dx,4
yreeeeee:
mov edi,offset pal
;cmp byte ptr [ordre2],'' ;uniqUEMENT si on est dans le jeu.
;jne terterertrteertyerertrteterter
cmp byte ptr [ordre],'S'
jne rezterterertrteertyerertrteterter
cmp [master],0
jne opiopiioiouuiiuiuiuooo
cmp [pic_time],0
je opiopiioiouuiiuiuiuooo
lea edi,pal_pic
;cmp kel_pic_intro,1
;jne opiopiioiouuiiuiuiuooo
;lea edi,pal_pic2
opiopiioiouuiiuiuiuooo:
rezterterertrteertyerertrteterter:
; si on est pas dans le menu
cmp byte ptr [ordre],'S'
je terterertrteertyerertrteterter
cmp byte ptr [ordre2],''
jne terrteterertterterertrteertyerertrtetertererer
lea edi,pal_jeu
terrteterertterterertrteertyerertrtetertererer:
cmp byte ptr [ordre2],'V'
jne terrteterertterterertrteertyerertrteterterererr
lea edi,pal_jeu
terrteterertterterertrteertyerertrteterterererr:
cmp byte ptr [ordre2],'V'
jne terrteterertterterertrteertyerertrtetertererereErr
lea edi,pal_vic
terrteterertterterertrteertyerertrtetertererereErr:
cmp byte ptr [ordre2],'Z'
jne terrteterertterterertrteertyerertrtetertererereE
lea edi,pal_med
terrteterertterterertrteertyerertrtetertererereE:
cmp byte ptr [ordre2],'D'
jne tyr2trtyrtyrtyrtyrtyterterertrteert
lea edi,pal_draw
tyr2trtyrtyrtyrtyrtyterterertrteert:
terterertrteertyerertrteterter:
cmp pic_de_tout_debut,1
jne ereetrtrtrtrteeete
lea edi,pal_pic2
ereetrtrtrtrteeete:
mov esi,offset pal_affiche
mov cx,768
yrchanger:
mov al,byte ptr [edi]
cmp byte ptr [esi],al
je ypareil
inc byte ptr [esi]
jmp ypas_pareil
ypareil:
inc bp
ypas_pareil:
inc edi
inc esi
dec cx
jnz yrchanger
dec dx
jnz yreeeeee
cmp bp,768*4
jne yerterterterrterte
mov [affiche_pal],0
yerterterterrterte:
call affpal
POPALL
ret
endp
;get_pal_ansi proc near
;PUSHALL
; mov dx,3c7h
; XOR al,al
; out dx,al
; mov dx,3c9h
;push ds
;pop es
;lea edi,pal_txt_debut
; mov cx,256*3
; u@@saaccvaaaax:
; in al,dx
;stosb
; dec cx
; JNZ u@@saaccvaaaax
;POPALL
;ret
;get_pal_ansi endp
affpal proc near
pushad
mov esi,offset pal_affiche
mov dx,3c8h
XOR al,al
out dx,al
mov dx,3c9h
mov cx,256*3
@@saaccvaaaax:
LODSB
out dx,al
dec cx
JNZ @@saaccvaaaax
popad
ret
affpal endp
affpal2 proc near
pushad
; mov esi,offset pal_affichée
mov dx,3c8h
XOR al,al
out dx,al
mov dx,3c9h
mov cx,256*3
a@@saaccvaaaax:
LODSB
out dx,al
dec cx
JNZ a@@saaccvaaaax
popad
ret
affpal2 endp
copie_le_fond proc near
PUSHALL
dec [attente]
cmp [attente],0
jne erteteteerre
add [viseur_sur_fond],4
mov [attente],max_attente
cmp [terrain],2 ; eau...
jne yertertertertertutyoooooortyyrt
mov [attente],min_attente ;
yertertertertertutyoooooortyyrt:
erteteteerre:
mov eax,4*4
cmp [terrain],2 ; db 2 ; 1:fete, 2: neige...
jne yertertertertertutyoooooo
mov eax,3*4
yertertertertertutyoooooo:
mov ebx,[viseur_sur_fond]
cmp ebx,eax ;4 [nombre_de_fond]
jb erterertyurttyu
mov [viseur_sur_fond],0
xor ebx,ebx
erterertyurttyu:
push ebx
mov bl,terrain
dec bl
shl ebx,2
mov esi,[ebx+kelle_offset_fond]
pop ebx
mov esi,[esi+ebx]
;cmp [terrain],2 ; db 2 ; 1:fete, 2: neige...
;jne yertertertertert
;mov esi,[adresse_des_fonds_neige+ebx]
;yertertertertert:
;
;cmp [terrain],3 ; db 2 ; 1:fete, 2: neige...
;jne yertertertertert1
;mov esi,[adresse_des_fonds_hell+ebx]
;yertertertertert1:
;
;cmp [terrain],4 ; db 2 ; 1:fete, 2: neige...
;jne yertertertertert2
;mov esi,[adresse_des_fonds_foret+ebx]
;yertertertertert2:
;
;cmp [terrain],5 ; db 2 ; 1:fete, 2: neige...
;jne yertertertertert2r
;mov esi,[adresse_des_fonds_nuage+ebx]
;yertertertertert2r:
;
;
;
;cmp [terrain],1 ; db 2 ; 1:fete, 2: neige...
;jne rertertertertert
;mov esi,[adresse_des_fonds+ebx]
;rertertertertert:
;===== affiche en ram video ce k'il y a a : FS:ESI
; ENTREE : ESI
ramesi
copyblock
POPALL
ret
copie_le_fond endp
copie_le_fond_draw proc near
PUSHALL
;adresse_des_fonds dd 0,64000,128000
;nombre_de_fond dd 3*2
;viseur_sur_fond dd 0
;attente db 0
;max_attente db 0
dec [attente]
cmp [attente],0
jne yerteteteerre
add [viseur_sur_draw],4
mov [attente],max_attente
yerteteteerre:
mov ebx,[viseur_sur_draw]
cmp ebx,[nombre_de_draw]
jne yerterertyurttyu
mov [viseur_sur_draw],0
xor ebx,ebx
yerterertyurttyu:
mov esi,[adresse_des_draws+ebx]
;===== affiche en ram video ce k'il y a a : FS:ESI
; ENTREE : ESI
ramesi
copyblock
POPALL
ret
copie_le_fond_draw endp
copie_le_fond_vic proc near
PUSHALL
dec [attente]
cmp [attente],0
jne iyyerteteteerre
;mov edi,704000 ; 128000 ;307200
add [viseur_sur_vic],4
mov [attente],max_attente4
iyyerteteteerre:
mov ebx,[viseur_sur_vic]
cmp ebx,[nombre_de_vic]
jne iyerterertyurttyu
mov [viseur_sur_vic],0
xor ebx,ebx
iyerterertyurttyu:
mov esi,[adresse_des_vic+ebx]
;===== affiche en ram video ce k'il y a a : FS:ESI
; ENTREE : ESI
ramesi
copyblock
POPALL
PUSHALL
push ds
pop es
;mov esi,offset donnee4+9*4
;mov ecx,9
;rep movsd
;mov esi,dword ptr [donnee4+9*4]
;
;mov esi,640000 ; 128000 ;307200
inc dword ptr [changementZZ]
supreme_victory_group:
mov eax,[nombre_de_dyna]
mov edi,[latest_victory]
mov ebx,[team+edi]
xor edi,edi
xor ecx,ecx
supreme_victory_group_winners_loop:
cmp ebx,[team+edi]
jne supreme_victory_group_winners_next
add ecx,16+8
supreme_victory_group_winners_next:
add edi,4
dec eax
jne supreme_victory_group_winners_loop
mov edx,320
sub edx,ecx
shr edx,1
add edx,57*320
xor ecx,ecx
mov eax,[nombre_de_dyna]
supreme_victory_group_loop:
cmp ebx,[team+ecx]
jne supreme_victory_group_next
push eax
push ebx
push ecx
push edx
test ecx,0100b
jne supreme_victory_group_sprite
add edx,3*320
supreme_victory_group_sprite:
lea edi,[donnee4+9*4]
mov esi,[ooo546+ecx]
mov ebx,[liste_couleur+ecx]
movzx eax,word ptr [ebx+0*2]
add eax,esi
stosd
movzx eax,word ptr [ebx+1*2]
add eax,esi
stosd
movzx eax,word ptr [ebx+2*2]
add eax,esi
stosd
movzx eax,word ptr [ebx+3*2]
add eax,esi
stosd
shr ecx,1
mov ax,[dummy1392+ecx]
stosb
mov ax,[dummy1393+ecx]
stosb
shl ecx,1
mov ebx,[changementZZ]
and ebx,000110000B
shr ebx,2
mov esi,[donnee4+9*4+ebx]
mov edi,edx
xor cx,cx
mov cl,[donnee4+9*4+4*4+1] ;nombre de colonnes.
xor bx,bx
mov bl,[donnee4+9*4+4*4] ;nb lignes
mov dl,[donnee4+8+ebp] ;1er bit: clignotement ???
and dl,01B
push ds
push fs
pop ds
call affiche_bomby2
pop ds
pop edx
pop ecx
pop ebx
pop eax
add edx,16+8
supreme_victory_group_next:
add ecx,4
dec eax
jnz supreme_victory_group_loop
POPALL
ret
copie_le_fond_vic endp
copie_le_fond_med proc near
PUSHALL
SOUND
;adresse_des_fonds dd 0,64000,128000
;nombre_de_fond dd 3*2
;viseur_sur_fond dd 0
;attente db 0
;max_attente db 0
mov esi,64000*7 ;[adresse_des_draws+ebx]
cmp [team3],1
jne pas_color
mov esi,1582080+64000
pas_color:
cmp [team3],2
jne pas_g
mov esi,1582080+64000*2
pas_g:
;===== affiche en ram video ce k'il y a a : FS:ESI
; ENTREE : ESI
ramesi
copyblock
;---- copie les noms des joueurs
PUSHALL
push ds
pop es
mov ebx,offset briques
mov [viseur_couleur],0
mov edi,offset buffer
mov ecx,8
xor edx,edx
pppppppgoeger:
push edi
;viseur_namec dd 10+(69)*320,10+(69+9)*320,10+(43+42*2)*320,10+(43+42*3)*320
cmp [team3],1
jne pas_c3
add edi,[viseur_namec+edx]
jmp ihjhuihui
pas_c3:
cmp [team3],2
jne pas_g3
add edi,[viseur_nameg+edx]
jmp ihjhuihui
pas_g3:
add edi,[viseur_name+edx]
ihjhuihui:
;------------- affiche un nom de joueur...--
PUSHALL
call affiche_un_caractere
POPALL
add edi,8
inc ebx
PUSHALL
call affiche_un_caractere
POPALL
add edi,8
inc ebx
PUSHALL
call affiche_un_caractere
POPALL
inc [viseur_couleur]
add ebx,2 ;affichae pas l'espace
;-------------------------------------------
pop edi
add edx,4
;add ebx,4
dec ecx
jnz pppppppgoeger
POPALL
;-------------------
POPALL
PUSHALL
;------- copie les médailles ---
;victoires dd 8 dup (?)
;viseur pour on place la premiere médaille pour chacun des 8 joueurs.
;
;viseur_victory dd 44+44*320,44+86*320,44+128*320,44+170*320
; dd 205+45*320,205+86*320,205+128*320,205+170*320
;latest_victory dd ?
;offset_medaille dw 23*0,23*1,23*2,23*3,23*4,23*5,23*6,23*7,23*8,23*9,23*10,23*11,23*12
; dw 23*320+23*0,23*320+23*1,23*320+23*2
push ds
pop es
;mov edi,offset buffer
;mov ecx,320
;mov eax,54501015
;rep stosd
mov esi,64000*8
xor ebx,ebx
mov ax,fs
;;dans ax: source
mov ds,ax
;add viseur sur la piece !!!
mov ebx,es:[changementZZ]
and ebx,0111100B
shr ebx,1
inc dword ptr es:[changementZZ]
xor ebp,ebp
mov edi,offset buffer
ertrterteterter:
push edi
mov ecx,dword ptr es:[donnee4+ebp] ;victoires
or ecx,ecx
jz ertertertertertertert
cmp ecx,5
jb rerterteertrte
mov ecx,5
rerterteertrte:
;-----
erertererrteert:
push edi esi
xor eax,eax
;mov ebx,es:[changement]
;and ebx,0111100B
;shr ebx,1
;add ebx,ebx
mov ax,word ptr es:[offset_medaille+ebx]
add esi,eax
cmp es:[team3],1
jne pas_c32
add edi,es:[viseur_victoryc+ebp]
jmp ihjhuihui2
pas_c32:
cmp es:[team3],2
jne pas_c32r
add edi,es:[viseur_victoryg+ebp]
jmp ihjhuihui2
pas_c32r:
add edi,es:[viseur_victory+ebp]
ihjhuihui2:
;--- clignotement ---
cmp ecx,1
jne eertterrtrteterert
draw_skynet_team_medals:
cmp es:[team3_sauve],4
jne check_victory_medal_player
mov eax,es:[latest_victory]
mov eax,es:[team+eax]
cmp eax,es:[team+ebp]
je draw_win_victory_medal
check_victory_medal_player:
cmp dword ptr es:[donnee4+4*8],ebp
jne eertterrtrteterert
draw_win_victory_medal:
mov esi,64000*8 ;de face uniquement
;briques dw 1+19*13*2 dup (?) ;nombre de brique, source de la brique, destination
; ;dans buffer video
; ;si on est dans 'Z' médaille céremony
; ;les noms de chaque joueur. 8x4 octets.
;
; ;+ 1 db= faut afficher la brike ki clignote ou pas???
cmp byte ptr es:[briques+8*4],1
je ertterrtrteterert
;test dword ptr es:[changementZZ],0000110000B
;jnz eertterrtrteterert
;jmp ertterrtrteterert
eertterrtrteterert:
call aff_sprite ;// c'est le sprite pour les victoire ou autre ignorer.
ertterrtrteterert:
;--- clignotement ---
pop esi edi
add edi,23
add ebx,2*2
and ebx,31
dec ecx
jnz erertererrteert
;-----
ertertertertertertert:
pop edi
add ebp,4
cmp ebp,4*8
jne ertrterteterter
POPALL
ret
aff_sprite:
PUSH ecx ebx esi
mov ecx,22
ertertertrteert:
mov ebx,22
concert:
lodsb
or al,al
jz ertertertrte
mov byte ptr es:[edi],al
ertertertrte:
inc edi
dec ebx
jnz concert
add edi,320-22
add esi,320-22
dec ecx
jnz ertertertrteert
pop esi ebx ecx
ret
copie_le_fond_med endp
inst_clavier proc near
PUSHALL
;2.14 - Function 0200h - Get Real Mode Interrupt Vector:
;-------------------------------------------------------
; Returns the real mode segment:offset for the specified interrupt vector.
;In:
; AX = 0200h
; BL = interrupt number
;Out:
; always successful:
; carry flag clear
; CX:DX = segment:offset of real mode interrupt handler
;Notes:
;) The value returned in CX is a real mode segment address, not a protected
; mode selector.
;mov ax,0200h
;mov bl,9
;int 31h
;
;mov word ptr [clavier_old_int],dx
;mov word ptr [clavier_old_int+2],cx
;2.15 - Function 0201h - Set Real Mode Interrupt Vector:
;-------------------------------------------------------
; Sets the real mode segment:offset for the specified interrupt vector.
;In:
; AX = 0201h
; BL = interrupt number
; CX:DX = segment:offset of real mode interrupt handler
;offset_2_adresse_physique proc near ;source ds:esi
; ;adresse physique (dx:ax)
;mov esi,offset HANDLER9
;call offset_2_adresse_physique
;mov cx,dx
;mov dx,ax
;mov ax,201h
;int 31h
;2.18 - Function 0204h - Get Protected Mode Interrupt Vector:
;------------------------------------------------------------
;
; Returns the address of the current protected mode interrupt handler for the
;specified interrupt.
;
;In:
; AX = 0204h
; BL = interrupt number
;
;Out:
; always successful:
; carry flag clear
; CX:EDX = selector:offset of protected mode interrupt handler
; AX = 0204h
; BL = interrupt number
;
;Out:
; always successful:
; carry flag clear
; CX:EDX = selector:offset of protected mode interrupt handler
mov cx,cs
mov edx,offset handler10 ;IGNORE
mov ax,0205h
mov bl,9
int 31h
POPALL
ret
inst_clavier endp
;de_inst_clavier proc near
;PUSHALL
;
;mov dx,word ptr [clavier_old_int]
;mov cx,word ptr [clavier_old_int+2]
;
;mov ax,201h
;int 31h
;
;
;POPALL
;ret
;
;de_inst_clavier endp
;db 0b8h
;sisisis dw ?
HANDLER10 PROC NEAR ;detourtenement int 9h (procedure k'on rajoute devant l'int.)
PUSHF
PUSHALL
mov ecx,132456h
mov edx,132456h
db 0b8h ;IGNORE
merdo dd ? ;IGNORE
;2144
mov ds,ax
;mov temps_avant_demo,ttp
xor eax,eax
in al,60h
;call affsigne
;mov [last_sucker],al
;mov [last_sucker],al
test al,128
jnz ureertrteertert2
ureertrteertert2:
mov edi,offset clavier
cmp al,225 ;
jne retertert_specialye
mov [clavier_stuff2],2
cmp action_replay,0
jne retertert_specialye
mov [pause],1
jmp tttttttttoooooi
retertert_specialye:
cmp al,224 ;
jne retertert_special
mov [clavier_stuff],1
jmp tttttttttoooooi
retertert_special:
;------------- special pause -----------
cmp [clavier_stuff2],0
je reterrteertertter
dec [clavier_stuff2]
;;;;;;;;jnz tttttttttoooooi
;;;;;;;;;;;mov [last_sucker],110 ;code pause...
jmp tttttttttoooooi
reterrteertertter:
;---------------------
cmp [clavier_stuff],1
jne pas_extanded
mov [clavier_stuff],0
;;-+----------------
;cmp al,42 ;cas particulier.. les 224,42 on s'en tappe !!!
;je tttttttttoooooi
;;-+------------
;---c as particulier pause !!!!
cmp al,70
jne pas_poauser
mov [pause],1
pas_poauser:
;--------
xor ebx,ebx
CMP AL,128
JB uTOU
and al,127
mov bl,al
mov al,[clavier_extanded+ebx]
or al,al ;si non prevu... fait rien...
je tttttttttoooooi
or al,128
jmp pas_extanded
uTOU:
mov bl,al
mov al,[clavier_extanded+ebx]
;cmp al,42 ;cas particulier.. les 224,42 on s'en tappe !!!
or al,al ;si non prevu... fait rien...
je tttttttttoooooi
pas_extanded:
CMP AL,128
JB uTOUCHE_APPUYEE
AND AL,01111111B
ADD eDI,eAX
MOV byte ptr [eDI],0
jMP uBE_ALL
uTOUCHE_APPUYEE:
add edi,eax
;;-----------------------***--------------**
;;touches_ dd 114,115,112,113,82,83,0, -1
;; dd 20,21,16,30,57,15,0, -1
;push ebx edi
;xor ebx,ebx
;encpoooe:
;cmp [touches_+ebx+7*4],-1
;;jne pas_active
;cmp [touches_+ebx],eax
;je cceluila
;cmp [touches_+ebx+4],eax
;je cceluila
;cmp [touches_+ebx+8],eax
;je cceluila
;cmp [touches+ebx+12],eax
;je cceluila
;
;jmp pas_active
;cceluila:
;mov edi,offset clavier
;add edi,[touches_+ebx]
;MOV byte ptr [eDI],0
;
;mov edi,offset clavier
;add edi,[touches_+ebx+4]
;;MOV byte ptr [eDI],0
;
;mov edi,offset clavier
;add edi,[touches_+ebx+8]
;MOV byte ptr [eDI],0
;
;mov edi,offset clavier
;add edi,[touches_+ebx+12]
;MOV byte ptr [eDI],0
;
;pas_active:
;add ebx,8*4
;cmp ebx,(8*4)*8
;jne encpoooe
;pop edi ebx
;;------------********---------************-
MOV byte ptr [eDI],1
;mov [last_sucker],al
uBE_ALL:
tttttttttoooooi:
cmp eax,1
jne uertterertert
cmp [attente_nouveau_esc],0
jne uertterertert
mov [sortie],1
uertterertert:
uoitreterrtyrty:
mov byte ptr [une_touche_a_telle_ete_pressee],1 ;et oui...
mov al,20h
out 20h,al
POPALL
POPF
iret
handleR10 ENdP
;donnee2 dd 0,0,0,0 ,0,0 ;1er joeur d'un ordy.
; dd 0,0,0,0 ,0,0 ;2eme joeur d'un ordy
; dd 0,0,0,0 ,0,0 ;3eme joeur d'un ordy
; dd 0,0,0,0 ,0,0 ;4eme joeur d'un ordy
;mov esi,offset donnee2 ;si joeur 1
controle proc near ;utilise par les slavers et les masters
cmp taille_exe_gonfle,0
jne dfgdf222gfghjktrhtkrjjrtyhjkrtyjklrty
;mov byte ptr [donnee2+8*7+2],0
ret
dfgdf222gfghjktrhtkrjjrtyhjkrtyjklrty:
PUSHALL
;prépare le packet qu'on va transmettre en informant
;les touches ke l'on presse actuellement
;
;nbe_bomber_locaux dd 2 ;nombre de bombers locaux
;
;bomber_locaux dd 0,1,0,0 ;mode de controle pour les bombermans locaux.
;;0 key droit
;;1 keyb gauche
;--------- efface le packet...
push ds
pop es
xor eax,eax
mov edi,offset donnee2
mov ecx,touches_size
rep stosb
;----------------------------
mov ecx,8 ;[nbe_bomber_locaux] ;ceci ne correspond pas a l'ordre des dyna
; juste les 8 dyna possilbe sur 1 becane
mov esi,offset donnee2
mov edi,offset touches_ ;mode de control
;xor ebp,ebp
;
;mov ah,02h ;SUPER_SIGNE2 DB 0
;mov dl,13
;int 21h
ertyertyjyuiyuiyuiiyu:
push ecx
push esi
mov dword ptr [esi],0 ;on efface le dernier packet
mov word ptr [esi+4],0
push edi
cmp dword ptr [edi+7*4],-1 ;ke si joueur en action (via setup)
jne retertertrtertetyyrtuui
call controle_joueur_fleche
retertertrtertetyyrtuui:
pop edi
pop esi
add esi,7 ;6 ;7
add edi,8*4 ;mode de control
;add ebp,4
pop ecx
dec ecx
jnz ertyertyjyuiyuiyuiiyu
cmp taille_exe_gonfle,0
je zappelesmachins
;return
cmp byte ptr [clavier+28],1
jne erertertertp
mov byte ptr [donnee2+8*7],1
erertertertp:
;esc
cmp byte ptr [clavier+1],1
jne erertertertpt
mov byte ptr [donnee2+8*7+1],1
erertertertpt:
cmp byte ptr [une_touche_a_telle_ete_pressee],1
jne erertertertptEE
mov byte ptr [donnee2+8*7+2],1
erertertertptEE:
mov byte ptr [une_touche_a_telle_ete_pressee],0
zappelesmachins:
POPALL
ret
controle endp
start_cpu_player proc near
PUSHALL
mov esi,offset differents_offset_possible+4*8
xor eax,eax
mov al,nb_ai_bombermen
shl eax,2
add esi,eax
mov ebp,nombre_de_dyna
cmp ebp,8
je exit_function
shl ebp,2
mov eax,[esi+ebp]
mov [control_joueur+ebp],eax
inc nombre_de_dyna
inc nb_ai_bombermen
exit_function:
POPALL
ret
start_cpu_player endp
menu_intelligence proc near
PUSHALL
SOUND_FAC fx
;n al,60h
;cmp al,57
;jne reterrterterte2
;mov byte ptr [ordre],''
;reterrterterte2:
;cmp byte ptr [clavier+1],1
;jne erertertertpt
;cmp byte ptr [total_t+6*4+1],1
;------------- ordre du master --------------------------
;******************************************************
cmp [nombre_de_dyna],0 ;
jnz rtbrtyjkrtklrtyrtyrtyrty ; dont go to demo if someone is reg...
dec temps_avant_demo
jnz rtbrtyjkrtklrtyrtyrtyrty
mov temps_avant_demo,ttp2 ;temps_avant_demo2/10
jmp rtrtytyutyutyutyuyuttyuyuttyuyutyuyuttyuyuttyuyut
rtbrtyjkrtklrtyrtyrtyrty:
;cmp byte ptr [clavier+88],1 ;F12
;jne retyeyutyuutyyutyutyuioodfgdfgdfggdf
;
cmp action_replay,2
je rtrtytyutyutyutyuyuttyuyuttyuyutyuyuttyuyuttyuyut
jmp retyeyutyuutyyutyutyuioodfgdfgdfggdf
rtrtytyutyutyutyuyuttyuyuttyuyutyuyuttyuyuttyuyut:
;on ne passe pas en mode demo si on est sur le 386...
; cmp [assez_de_memoire],1
; je retyeyutyuutyyutyutyuioodfgdfgdfggdf
;=========== restauration/sauvegarde replay ===========
;******** ACTION REPLAY--------------------
; si play
;cmp action_replay,2 ; play,recup...
;jne pashjktrkhjerterttyrr
;mov edx,dword ptr fs:[1966080+TAILLE_HEADER_REC-5] ;rotation, offet 1 dans le header !
PUSHALL
; on joue une partie
;differentesply dd 1966080+64000,1966080+64000*2,1966080+64000*3,1966080+64000*4,1966080+64000*5
mov ebx,differentesply2
add differentesply2,4
cmp differentesply2,4*nb_sply
jne ertyertyuityu
mov differentesply2,0
ertyertyuityu:
mov esi,[differentesply+ebx]
mov replayer_saver4,esi
;mov ax,fs
;mov ds,ax
;mov es,ax
;mov eax,fs:[1966080+TAILLE_HEADER_REC-9] ;variable changement
;mov edi,1966080
;;mov esi,1966080+64000
;mov ecx,16000
;rep movsd
POPALL
;pashjktrkhjerterttyrr:
;=======
;initialisation des pointeurs..
mov esi,replayer_saver4
mov replayer_saver5,1 ;// byte ptr fs:[esi+TAILLE_HEADER_REC],1 ;(viseur bonus ?)
;mov byte ptr fs:[1966080+TAILLE_HEADER_REC],1 ;(viseur bonus ?)
mov replayer_saver,4 ; (taille octet suite a BONUS_REC)
mov eax,dword ptr fs:[esi+TAILLE_HEADER_REC-13]
BIGENDIANPATCH eax
mov replayer_saver2,eax
mov action_replay,2 ;play
mov eax,dword ptr fs:[esi+TAILLE_HEADER_REC-17] ;nombre de dyna
BIGENDIANPATCH eax
mov [nombre_de_dyna],eax
mov replayer_saver3, eax
mov byte ptr [ordre],''
POPALL
ret
retyeyutyuutyyutyutyuioodfgdfgdfggdf:
;****************************************************
cmp [total_t+8*7],1
jne erertertertpert
;cmp byte ptr [clavier+28],1
;jne erertertertpert
;cmp nombre_de_dyna,1
;ja startGame
cmp team3_sauve,1
jne pascolormode
cmp nombre_de_dyna,2
ja startGame
bruit2 14 40 ;fail because not enough players in colormode
jmp erertertertpert
pascolormode:
cmp [nombre_de_dyna],1
ja startGame
cmp nombre_de_dyna,0
jne nozerodyna
bruit2 14 40 ;fail because not enough players in colormode
jmp erertertertpert
nozerodyna:
cmp nb_ai_bombermen,1
jne donenottoaddacpuifonlyonecpuregistered
bruit2 14 40 ;fail because not enough players in colormode
jmp erertertertpert
donenottoaddacpuifonlyonecpuregistered:
call start_cpu_player
startGame:
bruit2 15 40
;cmp demande_partie_slave2,0
;je jkrltjhetjhejhjhtejhhjthjehjehjerjherlhjetlhljter2
;cmp demande_partie_slave,1
;je jkrltjhetjhejhjhtejhhjthjehjehjerjherlhjetlhljter
;jkrltjhetjhejhjhtejhhjthjehjehjerjherlhjetlhljter2:
;jkrltjhetjhejhjhtejhhjthjehjehjerjherlhjetlhljter:
;mov demande_partie_slave,0
;mov [on_a_bien_fait_une_partie],1
mov byte ptr [ordre],''
erertertertpert:
;cmp byte ptr [clavier+2],1
;jne erertertertperterre
;mov [viseur_liste_terrain],0
;erertertertperterre:
;cmp byte ptr [clavier+3],1
;jne erertertertperterrert
;mov [viseur_liste_terrain],1
;erertertertperterrert:
;cmp byte ptr [clavier+4],1
;jne erertertertperterrert4t
;mov [viseur_liste_terrain],2
;erertertertperterrert4t:
;cmp byte ptr [clavier+5],1
;jne erertertertperterrert4t54
;mov [viseur_liste_terrain],3
;erertertertperterrert4t54:
;cmp byte ptr [clavier+6],1
;jne erertertertperterrert4t54r
;mov [viseur_liste_terrain],4
;erertertertperterrert4t54r:
;cmp byte ptr [clavier+7],1
;jne erertertertperterrert4t54rt5
;mov [viseur_liste_terrain],5
;erertertertperterrert4t54rt5:
;cmp byte ptr [clavier+8],1
;jne erertertertperterrert4t54rt5y
;mov [viseur_liste_terrain],6
;erertertertperterrert4t54rt5y:
;cmp byte ptr [clavier+9],1
;jne erertertertperterrert4t54rt5yd
;mov [viseur_liste_terrain],7
;erertertertperterrert4t54rt5yd:
;cmp byte ptr [clavier+5],1
;jne erertertertperterrert4t3
;mov [viseur_liste_terrain],3
;erertertertperterrert4t3:
;----------------------------------------------------------------
;--------- récupere touches pour personnes déja inscrites...
push ds
pop es
mov ebp,[nombre_de_dyna]
or ebp,ebp
jz yen_a_pas
xor ebx,ebx
xor edx,edx
ooooooooh:
cmp [name_joueur+ebx],4 ;finito
je ms_dos
;---- copie le nom du joueur
mov esi,offset nick_t
add esi,[control_joueur+ebx]
lodsd
mov dword ptr [texte1+6*1+1+32*0+edx],eax
mov dword ptr [texte1+6*1+1+32*1+edx],eax
mov dword ptr [texte1+6*1+1+32*2+edx],eax
mov dword ptr [texte1+6*1+1+32*3+edx],eax
;---- affiche le curseur.
cmp [name_joueur+ebx],1
jb retrterteoooshow
cmp [name_joueur+ebx],3
ja retrterteoooshow
push edx
mov dword ptr [texte1+6*2+32*0+edx],' '
mov dword ptr [texte1+6*2+32*1+edx],' '
mov dword ptr [texte1+6*2+32*2+edx],' '
mov dword ptr [texte1+6*2+32*3+edx],' '
add edx,[name_joueur+ebx]
mov byte ptr [texte1+6*2+32*0+edx],'-'
mov byte ptr [texte1+6*2+32*1+edx],'-'
mov byte ptr [texte1+6*2+32*2+edx],'-'
mov byte ptr [texte1+6*2+32*3+edx],'-'
pop edx
retrterteoooshow:
;-------------------
;regarde si on a pressé...
dec [temps_joueur+ebx]
cmp [temps_joueur+ebx],0
jne ertterrtytyrrtyrtyrtyrtytuoooooooooo
;les fleches... changement d'un caratere...
mov esi,offset total_t
add esi,[control_joueur+ebx]
cmp byte ptr [esi+3],0
je pas_flechedu
;mov temps_avant_demo,ttp
push esi
mov esi,offset nick_t
add esi,[control_joueur+ebx]
add esi,[name_joueur+ebx]
dec byte ptr [esi-1]
cmp byte ptr [esi-1],'a'-1
jne ertrteertterrterterte
mov byte ptr [esi-1],'z'+13 ;,'a'
ertrteertterrterterte:
pop esi
mov [temps_joueur+ebx],temps_re_menu
jmp finito_touches
pas_flechedu:
;les fleches... changement d'un caratere...
mov esi,offset total_t
add esi,[control_joueur+ebx]
cmp byte ptr [esi+0],0
je upas_flechedu
;mov temps_avant_demo,ttp
push esi
mov esi,offset nick_t
add esi,[control_joueur+ebx]
add esi,[name_joueur+ebx]
inc byte ptr [esi-1]
cmp byte ptr [esi-1],'z'+14
jne uertrteertterrterterte
mov byte ptr [esi-1],'a' ;'z'+13
uertrteertterrterterte:
pop esi
mov [temps_joueur+ebx],temps_re_menu
jmp finito_touches
upas_flechedu:
;les fleches...
mov esi,offset total_t
add esi,[control_joueur+ebx]
cmp byte ptr [esi+1],0
je pas_fleched
;mov temps_avant_demo,ttp
inc [name_joueur+ebx]
cmp [name_joueur+ebx],4
jne pertertras_flechedertertertret
mov [name_joueur+ebx],3
jmp ooooiio
pertertras_flechedertertertret:
bruit 5,40,BLOW_WHAT2
ooooiio:
mov [temps_joueur+ebx],temps_re_menu
jmp finito_touches
pas_fleched:
cmp byte ptr [esi+2],0
je pas_flechedm
;mov temps_avant_demo,ttp
dec [name_joueur+ebx]
cmp [name_joueur+ebx],0
jne pertertras_flechedertertertretm
mov [name_joueur+ebx],1
jmp ootoi
pertertras_flechedertertertretm:
bruit 5,40,BLOW_WHAT2
ootoi:
mov [temps_joueur+ebx],temps_re_menu
jmp finito_touches
pas_flechedm:
;--- sort...
;cmp byte ptr [esi+4],0
;je pas_flechedmy
actionButtonPushed pas_flechedmy
;mov temps_avant_demo,ttp
;---- que si sur le 3eme caractere. sinon decalle...
cmp [name_joueur+ebx],3
je pertertras_flechedertertertrety
bruit 5,40,BLOW_WHAT2
inc [name_joueur+ebx]
mov [temps_joueur+ebx],temps_re_menu
jmp finito_touches
pertertras_flechedertertertrety:
;;====================--------- cas particulier de gruge !!! rmc:
;PUSHALL
;mov esi,offset nick_t
;add esi,[control_joueur+ebx]
;;------ pourle retour ici dans longtemps --
;cmp byte ptr [esi+4],'' ;pour ke ca soit retire ensuite...
;jne etreyytyyyuuuuuuuuuu
;mov byte ptr [esi+4],' '
;etreyytyyyuuuuuuuuuu:
;;-------------
;;--- pour la 2eme fois ou on passe la !! (juste apres :))
;cmp byte ptr [esi+4],'t' ;pour ke ca soit retire ensuite...
;jne treyytyyyuuuuuuuuuu
;mov byte ptr [esi+4],''
;treyytyyyuuuuuuuuuu:
;;-----------------------------
;mov eax,dword ptr [nomdetriche]
;cmp dword ptr [esi],eax
;jne iiuiuiuoooooooooooooooooo
;mov eax,dword ptr [nomdetriche2]
;mov dword ptr [esi],eax
;mov byte ptr [esi+4],'t'
;POPALL
;mov [temps_joueur+ebx],temps_re_menu
;jmp finito_touches
;iiuiuiuoooooooooooooooooo:
;POPALL
;======================----------------------------------------------------------
bruit 3,40,BLOW_WHAT2
;on est sur le 3eme caracte !! finito !!
mov [name_joueur+ebx],4
mov eax,[control_joueur+ebx]
shr eax,6 ;/64
inc eax
add al,'0'
mov esi,offset nick_t
add esi,[control_joueur+ebx]
push eax
mov eax,[esi]
mov esi,offset message2
mov [esi],eax
mov [esi+32],eax
mov last_name,eax
pop eax
mov byte ptr [esi+16+32*2],al
mov byte ptr [esi+16+32*3],al
mov edi,offset texte1
add edi,edx
mov ecx,32
rep movsd
;dans ebx... nomé du mec... cas particulier...
;cmp ebx,'rmd '
PUSHALL
xor ebx,ebx
xor ebp,ebp
enojjojortyrtyrtytyr:
mov eax,dword ptr [love_si+ebx]
cmp last_name,eax
jne nonon_
mov esi,[offset_si+ebp]
mov edi,offset texte1
add edi,edx
mov ecx,[offset_si+ebp+4]
rep movsd
mov eax,'FFFF' ;pour sortir
nonon_:
add ebp,8
add ebx,4
cmp eax,'FFFF'
jne enojjojortyrtyrtytyr
POPALL
jmp finito_touches
pas_flechedmy:
mov [temps_joueur+ebx],1
finito_touches:
ertterrtytyrrtyrtyrtyrtytuoooooooooo:
;-------------------
ms_dos:
add ebx,4
add edx,32*4
dec ebp
jnz ooooooooh
;name_joueur dd 8 dup (?) ;pour dans le menu...
;name_joueur dd 8 dup (?) ;pour dans le menu...
;0: pas encore inscrit.
;1: récupere la premiere lettre
;2: récupere la premiere lettre
;3: récupere la troisieme lettre
;4: finis... attend de jouer
;temps_joueur dd 8 dup (temps_re_menu) ;temps d'attente avant validation
;d'une nouvelle frappe de touche.
;dans menu...
yen_a_pas:
;--------------------------------------------------------
mov ebp,[nombre_de_dyna]
cmp ebp,8
je finito_trop_de_dyna
shl ebp,2 ;nombre de joueurs x4
mov esi,offset differents_offset_possible ;dans la table des offset du tas
; de touches.
eetterrterterterteertterertert:
mov ebx,[esi]
cmp ebx,666 ;fin...
je ok_on_en_a_trouve_un
;cmp byte ptr [total_t+ebx+4],1
;jne touche_non_appuyee
actionButtonPushed2 touche_non_appuyee
;---regarde si ce EBX n'est pas deja dans le control_joeur...
; cmp byte ptr [esi+ebx+4],1
;jmp plusieur ;renegade ***********************
push ebp
or ebp,ebp
jz ca_roule_mon_coco
tretrrtrtrtrtrttr:
sub ebp,4
cmp [control_joueur+ebp],eBx
jne reetretrert
;et non on l'avait deja pris...
pop ebp
jmp touche_non_appuyee
reetretrert:
or ebp,ebp
jnz tretrrtrtrtrtrttr
ca_roule_mon_coco:
pop ebp
;--
plusieur:
mov dword ptr [control_joueur+ebp],ebx
inc [nombre_de_dyna]
push ds
pop es
;--- sonne
;a: sample, b:note
bruit 3,40,BLOW_WHAT2
; on va marquer le numero de l'ordy connecté...
;mov eax,esi
;sub eax,offset differents_offset_possible
;shr eax,4
;inc eax
;add al,'0'
;mov ah,byte ptr [nombre_de_dyna]
;add ah,'0'
mov esi,offset message3 ;2
;mov byte ptr [esi+5],ah
;mov byte ptr [esi+5+32],ah
;mov byte ptr [esi+16+32*2],al
;mov byte ptr [esi+16+32*3],al
mov [name_joueur+ebp],1
mov edi,offset texte1
shl ebp,5 ;*32 (deja x4)
add edi,ebp
mov ecx,32
rep movsd
jmp ok_on_en_a_trouve_un
touche_non_appuyee:
add esi,4
jmp eetterrterterterteertterertert
finito_trop_de_dyna:
ok_on_en_a_trouve_un:
;----
POPALL
ret
menu_intelligence endp
controle_joueur_fleche proc near ;touches fleches
PUSHALL
;75,77,80,72
mov ebx,[edi]
cmp byte ptr [clavier+ebx],1
jne erertertert
mov byte ptr [esi+2],1
erertertert:
mov ebx,[edi+4]
cmp byte ptr [clavier+ebx],1
jne erertertert2
mov byte ptr [esi+1],1
erertertert2:
mov ebx,[edi+8]
cmp byte ptr [clavier+ebx],1
jne erertertert3
mov byte ptr [esi],1
erertertert3:
mov ebx,[edi+12]
cmp byte ptr [clavier+ebx],1
jne erertertert4
mov byte ptr [esi+03],1
erertertert4:
mov ebx,[edi+16]
cmp byte ptr [clavier+ebx],1
jne erertertert45
mov byte ptr [esi+04],1
erertertert45:
mov ebx,[edi+20]
cmp byte ptr [clavier+ebx],1
jne ererterter45
mov byte ptr [esi+05],1
ererterter45:
mov ebx,[edi+24]
cmp byte ptr [clavier+ebx],1
jne ererterter455
mov byte ptr [esi+06],1
ererterter455:
;offset 0 =1 si la fleche bas est pressé/ j1
; 1 =1 si la fleche droite est pressé j1
; 2 =1 si la fleche gauche est pressé j1
; 3 =1 si la fleche haut est pressé2 j1
; 4 =1 bouton 1 j1
; 5 =1 bouton 2 j1
POPALL
ret
endp
gestion_jeu proc near ;uniquement appelé par le master.
PUSHALL
;;cas particulier: terrain6 plus apres lapocalypse, pas de bonus
;decompte le tempos pendant lekel ya pas de bonus
;---
cmp special_nivo_6,0
je iophrehuiophuioeterterrte
dec special_nivo_6
iophrehuiophuioeterterrte:
;---
;************************************* refuse une pause tout de suite !!!
cmp action_replay,0
jne ytnononono_onest_en_recordplaye
cmp twice,1
jne ytnononono_onest_en_recordplaye
cmp nombre_de_vbl_avant_le_droit_de_poser_bombe,(nombre_de_vbl_avant_le_droit_de_poser_bombe2-10)/2
ja erteetetretrerterterter
jmp klhlkjljkjkljlkjkljkljklkljkljkljkljklj
ytnononono_onest_en_recordplaye:
cmp nombre_de_vbl_avant_le_droit_de_poser_bombe,nombre_de_vbl_avant_le_droit_de_poser_bombe2-10
ja erteetetretrerterterter
klhlkjljkjkljlkjkljkljklkljkljkljkljklj:
;mov byte ptr [esi],0
;mov [lapipipino3+ebp],duree_saut
;mov [lapipipino2+ebp],1
;mov [lapipipino6+ebp],1
;transformation homme -> lapin doit se faire uniqment ici. car ca serrait
;un demi-lapin dans le process sinon. clair ?
PUSHALL
xor ebp,ebp
ertyrtyutyutyutyuioooppp:
cmp [lapipipino6+ebp],1
jne ertytyuyututyuyyuiyui
mov [lapipipino6+ebp],0
mov [lapipipino+ebp],1
mov [lapipipino3+ebp],duree_saut
mov [lapipipino2+ebp],1
ertytyuyututyuyyuiyui:
cmp [lapipipino6+ebp],2
jne ertytyuyututyuyyuiyuir
mov [lapipipino6+ebp],0
mov [lapipipino+ebp],0
mov [lapipipino3+ebp],0
mov [lapipipino2+ebp],0
ertytyuyututyuyyuiyuir:
add ebp,4
cmp ebp,4*8
jne ertyrtyutyutyutyuioooppp
POPALL
;
call gestion_pause
cmp pauseur2,0
je erteetetretrerterterter
call donnee_to_donnee4 ;passe de donne a donnee4
POPALL
ret
erteetetretrerterterter:
;******************
call transmet_central ; transmet au CENTRAL les infos k'on vient de pomper.
SOUND_FAC BLOW_WHAT2
call dec_temps
call gestion_bdraw
cmp action_replay,0
jne nononono_onest_en_recordplaye
cmp twice,1
jne nononono_onest_en_recordplaye
cmp twice2,1
je nononono_onest_en_recordplaye
call dec_temps
call gestion_bdraw
nononono_onest_en_recordplaye:
call fabrique_monstro_truc
call gestion_blanchiment
call contamination ;contamination de dyna ?.
mov ecx,[nombre_de_dyna]
xor ebp,ebp ;--- bp: joeur en ce moment *4
brouter:
push ecx
mov esi,[liste_couleur+ebp] ;offset blanc ;esi: couleur du joeur...
call gestion_lapin
;------ patineur ----------------------------
cmp [patineur+ebp],0
je OooooOooooooOooooooooooOooooooooooOoooooo
call gestion_lapin
OooooOooooooOooooooooooOooooooooooOoooooo:
;--- maladie de la speed ---
cmp word ptr [maladie+ebp],01B
jne OooooOooooooOooooooooooOooooooooooOooooooe
call gestion_lapin
OooooOooooooOooooooooooOooooooooooOooooooe:
cmp action_replay,0
jne tnononono_onest_en_recordplaye
cmp twice,1
jne tnononono_onest_en_recordplaye
call gestion_lapin
tnononono_onest_en_recordplaye:
;-malade ???
cmp word ptr [maladie+ebp],0 ;malade ??? (en general)
je ertterterrterterte
cmp [lapipipino+ebp],0 ;lapin ?
jne ertterterrterterte ;si oui, on doit pas gerer le changement de couleur
;ici...
mov ax, word ptr [maladie+ebp+2]
and eax, 1023
cmp [blinking+eax], 0
jnz ertterterrterterte
mov esi,[liste_couleur_malade+ebp]
ertterterrterterte:
;-----
call anim_un_joeur
cmp [vie+ebp],1
jne erertert
Call touches_action
call la_mort ;regarde si elle a frappée. OU si on a mangé un BONUS...
erertert:
add ebp,4
pop ecx
dec ecx
jnz brouter
;dans ebp: viseur sur numéro du joeur. enfin du premier monstre
;------ il reste les méchants é gérer ---
cmp [nombre_de_monstres],0
je y_en_a_pas
mov ecx,[nombre_de_monstres]
;--- bp: joeur en ce moment *4
tbrouter:
push ecx
cmp [vie+ebp],1
jne next_monstre
cmp [blocage+ebp],0
jne ertreteretterter
call intelligence_monstre
ertreteretterter:
call la_mort_monstre ;regarde si elle a frappée.
next_monstre:
mov esi,[liste_couleur+ebp] ;offset blanc ;esi: couleur du joeur...
PUSHALL
call anim_un_joeur
POPALL
cmp [vie+ebp],1
jne next_monstre2
cmp [blocage+ebp],0
jne next_monstre2
;---- si le monstre est monté sur la flamme.. on lui dit pas bonne idée..
jmp anti_bomb_monstre
nonononononononon: ;retours anti_bomb pas sur une bombe...
;;si pas reussit a bouger. remet anciennes touches ...
cmp [avance+ebp],1 ;=0 si PAS reussit a bouger
je retererttZERer ;=1 si reussit a bouger...
mov eax,[touches_save+ebp]
or eax,128 ;fige...
mov [touches+ebp],eax
ouiuouiouiuoi: ;retours anti_bomb aletre rouge changement de CAP....
mov esi,[liste_couleur+ebp] ;offset blanc ;esi: couleur du joeur...
PUSHALL
call anim_un_joeur
POPALL
retererttZERer:
next_monstre2:
add ebp,4
pop ecx
dec ecx
jnz tbrouter
y_en_a_pas:
;------------------------------------------
call minuteur ;pour les bombes... fauit le tic tic tic :)
call monsieur_bombe ;crée l'affichage les bombes
call monsieur_brik
call calc_ombres
call phase ;draw game ??? fin machin ???
cmp byte ptr [ordre2],'' ;on ne fait pas ca si on a quitté le jeu...
jne reertertertertert
call donnee_to_donnee4 ;passe de donne a donnee4
reertertertertert:
POPALL
ret
gestion_lapin:
;====== SPECIAL LE LASCAR EST UN MOTHAFUCKAAAA DE LAPINA (3lit3)
cmp [lapipipino+ebp],1
jne ertyrttyrrtytyuutyyuiyuiiyuyuityuioouiioyuuioyyuioe
;c'est un lapin
mov esi,[lapin_mania1+ebp] ; pointeur sur la bloc de position
; du lapin normal
;c'est un lapin qui fait un saut vertical de lapin
; cmp [lapipipino2+ebp],2 ;saut direction
; je ertrterterteertzerzererzzer
cmp [lapipipino2+ebp],0 ;lapin ki fait rien
je ertrterterteert
; cmp [lapipipino2+ebp],1 ;saut vertical ou mort du lapin
; jne ertrterterteert ;lapin ki fait rien
ertrterterteertzerzererzzer:
;..................... LAPIN QUI SAUTE ......................................
mov [lapipipino4+ebp],0 ;hauteur du lapin (Y)
mov [lapipipino5+ebp],0 ;hauteur du lapin (Y)
;decrementation du compteur saut
; dec [lapipipino3+ebp]
; jz ohohohohohohh
dec [lapipipino3+ebp]
jnz erterterterterertrterterteert
;ohohohohohohh:
;--- cas particulier lapin mort
cmp [lapipipino2+ebp],3 ;mort
jne rttyuooooooo
mov [lapipipino6+ebp],2
jmp ertrterterteert ;c pu un lapin ki saute (ou lapin mort..)
rttyuooooooo:
;-------------
mov [lapipipino2+ebp],0 ;arrete le saut
jmp ertrterterteert ;c pu un lapin ki saute (ou lapin mort..)
erterterterterertrterterteert:
;******************* lapin ki saute phase 1 ***********************
cmp [lapipipino3+ebp],duree_saut-15 ;compteur dans le saut du lapin
ja trtyrtyrtyrtyrtyrty
cmp [lapipipino3+ebp],15 ;compteur dans le saut du lapin
jb trtyrtyrtyrtyrtyrty
cmp [lapipipino2+ebp],3 ;mort (cas particulier, esi, tjs le meme)
je ertertertrterterteertzerzererzzerrtyrtrtyyrtrty
mov esi,[lapin_mania3+ebp] ; milieu de saut
ertertertrterterteertzerzererzzerrtyrtrtyyrtrty:
push eax ebx
mov ebx,[lapipipino3+ebp] ;compteur dans le saut du lapin
sub ebx,15
add ebx,ebx
xor eax,eax
mov ax,[saut_de_lapin+ebx]
cmp [lapipipino2+ebp],1 ;saut vertical
jne ertrterterteertererer
mov ax,[saut_de_lapin2+ebx]
ertrterterteertererer:
mov [lapipipino5+ebp],eax ;hauteur du lapin x1
EAX_X_320
mov [lapipipino4+ebp],eax ;hauteur du lapin x320
pop ebx eax
;********************************** lapin qui saute directionnellement
;---- deplace le lapin ---
cmp [lapipipino3+ebp],duree_saut-15 ;compteur dans le saut du lapin
je ertrterterteert
cmp [lapipipino2+ebp],2 ;que lapin sautant dans une direction
jne ertrterterteert
;compteur a partir dukel on ne fait plus avancer le lapin 17 normallement
push eax
mov eax,[lapipipino7+ebp]
cmp [lapipipino3+ebp],eax
jnb ertrterterteert_oooo
pop eax
jmp ertrterterteert
ertrterterteert_oooo:
pop eax
push eax ebx
mov ebx,ebp
shr ebx,1
;mov ah,02h ;SUPER_SIGNE2 DB 0
;mov dl,13
;int 21h
;8: gauche
mov eax,[touches+ebp]
and eax,127
cmp eax,8
jne trrtertyrtytyrtyrrty
;donnee dw 8 dup (?) ;x du dynablaster
; dw 8 dup (?) ;y du dynablaster
inc [donnee+ebx]
trrtertyrtytyrtyrrty:
cmp eax,16
jne trrtertyrtytyrtyrrtyR
dec [donnee+ebx]
trrtertyrtytyrtyrrtyR:
cmp eax,00
jne trrtertyrtytyrtyrrtyy
;donnee dw 8 dup (?) ;x du dynablaster
; dw 8 dup (?) ;y du dynablaster
inc [donnee+8*2+ebx]
trrtertyrtytyrtyrrtyy:
cmp eax,24
jne trrtertyrtytyrtyrrtyRy
dec [donnee+8*2+ebx]
trrtertyrtytyrtyrrtyRy:
pop ebx eax
PUSHALL
push ebp
xy_to_offset
pop ebp
lea esi,[truc+eax]
mov [last_bomb+ebp],esi
POPALL
jmp ertrterterteert
;-------------------------
trtyrtyrtyrtyrtyrty:
;******************* LAPIN FASE SE COURBE (?) *
cmp [lapipipino3+ebp],duree_saut-7
ja trtyrtyrtyrtyrtyrtyu
cmp [lapipipino3+ebp],7
jb trtyrtyrtyrtyrtyrtyu
mov esi,[lapin_mania4+ebp] ; preske normal
jmp ertrterterteert
trtyrtyrtyrtyrtyrtyu:
mov esi,[lapin_mania2+ebp] ; se courbe
ertrterterteert:
;----- lapin mort !!! ----
cmp [lapipipino2+ebp],3 ;mort (cas particulier, esi, tjs le meme)
jne kertrterterteert
push eax ebx
mov ebx,[lapipipino3+ebp] ;compteur dans le saut du lapin
add ebx,ebx
xor eax,eax
mov ax,[mort_de_lapin+ebx]
mov [lapipipino5+ebp],eax ;hauteur du lapin x1
EAX_X_320
mov [lapipipino4+ebp],eax ;hauteur du lapin x320
mov esi,[lapin_mania5+ebp] ; pointeur sur la bloc de position
; du lapin mort
pop ebx eax
kertrterterteert:
;---------------
ertyrttyrrtytyuutyyuiyuiiyuyuityuioouiioyuuioyyuioe:
;====================================================
ret
gestion_pause:
;*******************************
;gestion, sprite
;pas de pause en action replay
cmp pauseur2,0
je pas_en_pauseer
test dword ptr [changement],0000000001111B
jnz pas_en_pauseer
xor ebx,ebx
mov bl,pauseur2
add ebx,4
cmp [offset_pause+ebx],666
jne ihhihiertteretr
mov ebx,4
ihhihiertteretr:
mov pauseur2,bl
pas_en_pauseer:
;*******************************
cmp pause2,0
je uerertertert
dec pause2
uerertertert:
cmp pause,1 ;touche vient d'etre touchee/relachee ?
jne raison_detat
;;------------- gestion sprite
;xor ebx,ebx
;mov bl,pause
;dec bl
;shl ebx,2
;
;add ebx,4
;cmp [offset_pause+ebx],666
;jne uiyuighguirrtrt
;xor ebx,ebx
;uiyuighguirrtrt:
;inc bl
;mov pause,bl
;;------------------------------
mov pause,0
cmp pause2,0
jne dejapresseyapaslongtemps
mov pause2,15
;pauseur2
;NOT pauseur2
cmp pauseur2,0
jne reeertertterert
mov pauseur2,4
jmp raison_detat
reeertertterert:
mov pauseur2,0
raison_detat:
dejapresseyapaslongtemps:
ret
anti_bomb_monstre:
cmp [invinsible+ebp],0
jne nonononononononon ;si il s'est prit dans la bombe il faut k'il se tretourne.
;ou alors il resiste donc on s'en fou.
PUSHALL
;cmp [avance+ebp],1 ;=0 si PAS reussit a bouger
;je reterertter ;=1 si reussit a bouger...
push ebp
xy_to_offset
lea esi,[truc2+eax]
pop ebp
cmp byte ptr [esi],5
jb ertterertertertertt
cmp byte ptr [esi],54
jnb ertterertertertertt
mov [avance+ebp],0 ;=0 si PAS reussit a bouger. vaut mieu pas babe..
;+ mouvement inverse...
mov ebx,[touches+ebp]
and ebx,127 ;défige...
mov eax,[anti_bomb+ebx]
mov [touches+ebp],eax
POPALL
jmp ouiuouiouiuoi
ertterertertertertt:
POPALL
jmp nonononononononon ;retours anti_bomb
intelligence_monstre:
mov esi,[infojoueur+ebp]
mov ecx,dword ptr [esi+12]
cmp ecx,1
jne pas_1i
test dword ptr [changement],00000000111B
jnz non_bouge_pasttryrtytyr
jmp ok_il_bougert
pas_1i:
cmp ecx,2
jne ok_il_bougert
test dword ptr [changement],00000000011B
jnz non_bouge_pasttryrtytyr
jmp ok_il_bougert
non_bouge_pasttryrtytyr:
ret
ok_il_bougert:
;1,2,3 (normal),4:double...
;--- intelligence ----
mov eax,[changement]
add eax,[avance2+ebp] ;hazard
add eax,[viseur_change_in+ebp] ;hazard total...
;add eax,[maladie+ebp] ;hazard..
;add eax,dword ptr [donnee+ebp] ;hazard..
add eax,ebp ;nouveau hazard.. violent
and eax,01111111B
jnz alllagrishna
cmp [avance2+ebp],3 ;compte a rebourd avant nouvelle action...
jb arrete__
mov [avance2+ebp],3 ;compte a rebourd avant nouvelle action...
jmp arrete__
alllagrishna:
cmp [avance+ebp],1 ;=0 si PAS reussit a bouger
je reterertter ;=1 si reussit a bouger...
;si reussit continue...
;pas reussit
arrete__:
dec [avance2+ebp] ;compte a rebourd avant nouvelle action...
jnz mendier
hier2:
mov [avance2+ebp],15
PUSHALL
mov ebx,[viseur_change_in+ebp]
mov eax,[changeiny+ebx]
mov [touches+ebp],eax
add [viseur_change_in+ebp],4
cmp [viseur_change_in+ebp],16*4
jne retkortykokoptrkopkop
mov [viseur_change_in+ebp],0
retkortykokoptrkopkop:
POPALL
;0= face bas.
;8= droite droite
;16= gauche gauche
;24= haut haut
jmp mendier
reterertter:
mov eax,[touches+ebp] ;sauvegarde du dernier success d'un monstre...
mov [touches_save+ebp],eax
;------------------
mendier:
ret
donnee_to_donnee4:
PUSHALL
;POPALL
;push ecx
xor ecx,ecx ;0,nb_unite_donnee4,...
xor ebx,ebx ;0,2,4,
xor ebp,ebp ;0,4,8,12,...
;***
hooooooop:
;----- calcule dans edi le Y en le multipliant par 320
;;EAX_X_320
;;mov [vise_de_ca_haut2+ebp],eax
xor eax,eax
mov ax,word ptr [donnee+nb_dyna*2+ebx] ;y
push eax
shl eax,6 ; x 64
mov edi,eax
pop eax
shl eax,8 ; x 256
add edi,eax
;-------------- rajoute le X
xor eax,eax
mov ax,word ptr [donnee+ebx]
add edi,eax
;---------------
mov [vise_de_ca_haut+ebp],0
mov [vise_de_ca_haut2+ebp],0
;====== SPECIAL LE LASCAR EST UN MOTHAFUCKAAAA DE LAPINA (3lit3)
cmp [lapipipino+ebp],1
jne ertrtyyuttyutyurtyutyutyuyutyut
;=== cas particulier: trop haut./ deborderait de l'ecran
push eax
xor eax,eax
mov ax,word ptr [donnee+nb_dyna*2+ebx] ;y
mov edx,[lapipipino5+ebp]
add edx,13
cmp ax,dx
ja erertzertertertertertert
;combien_faut_baisser dd 320*14,320*13,320*12,320*11,320*10,320*9,320*8
; dd 320*7,320*6,320*5,320*4,320*3,320*2,320*1
;combien_faut_baisser2 dd 14,13,12,11,10,9,8
; dd 7,6,5,4,3,2,1
;push ebx
;push eax
neg eax
add eax,edx
inc eax
mov [vise_de_ca_haut2+ebp],eax
;pop eax
;mov [vise_de_ca_haut2+ebp],eax
;xor ebx,ebx
;shl ax,2
;mov bx,ax
;mov eax,[combien_faut_baisser2+ebx]
;mov [vise_de_ca_haut2+ebp],eax
;mov eax,[combien_faut_baisser+ebx]
EAX_X_320
;mov [vise_de_ca_haut2+ebp],eax
;pop ebx
add edi,eax ;320*14
mov [vise_de_ca_haut+ebp],eax ;320*14
erertzertertertertertert:
pop eax
;=== attention au adder, faut pas kon le mette trop haut ================
add edi,-14*320-4
sub edi,[lapipipino4+ebp] ;saut du lapin (y)
or edi,edi ;!
jns rterteerertertterteryuyyuuuuu ;!
add edi,[lapipipino4+ebp] ;saut du lapin (y) ;!
;!
;bon on bidouille !!
push eax
mov eax,[lapipipino4+ebp]
; add [lapin_mania+ebp],eax ;pointeur sur la source memoire
; add [vise_de_ca_haut+ebp],eax
pop eax
rterteerertertterteryuyyuuuuu:
jmp tryrtyyrttyutyuyuttyutyutyutyutyutyutyu
ertrtyyuttyutyurtyutyutyuyutyut: ;pas un lapin
add edi,dword ptr [donnee+112+ebp] ;adder y.. (car girl plus gaut!!!)
tryrtyyrttyutyuyuttyutyutyutyutyutyutyu:
;============
mov word ptr [donnee4+ecx+4],di
;---------------
;----- OFFSET EN MEMOIRE -------------
xor eax,eax
mov ax,word ptr [donnee+nb_dyna*4+ebx]
cmp ax,666 ;mort... et on affiche plus...
je reertertertrte
;====== SPECIAL LE LASCAR EST UN MOTHAFUCKAAAA DE LAPINA (3lit3)
cmp [lapipipino+ebp],1
jne ertyrttyrrtytyuutyyuiyuiiyuyuityuioouiioyuuioyyuio
add eax,[vise_de_ca_haut+ebp] ;decalleur spoecial y
;--- glignotement des lapins malades ---
cmp word ptr [maladie+ebp],0 ;malade ??? (en general)
je ertterterrtertertertt
mov dx, word ptr [maladie+ebp+2]
and edx, 1023
cmp [blinking+edx], 0
jnz ertterterrtertertertt
add eax,[lapin_mania_malade+ebp] ;pointeur sur la source memoire
jmp reertertertrte
ertterterrtertertertt:
;------------------------------------------
add eax,[lapin_mania+ebp] ;pointeur sur la source memoire
jmp reertertertrte
ertyrttyrrtytyuutyyuiyuiiyuyuityuioouiioyuuioyyuio:
;====================================================
add eax,dword ptr [donnee+8*2*3+ebp] ;ou en mémoire!!!
reertertertrte:
mov dword ptr [donnee4+ecx],eax ;source... 666 indique: ne rien afficher
;---
mov ax,word ptr [donnee+8*5*2+ebx]
mov byte ptr [donnee4+6+ecx],al ;nombre de lignes...
mov ax,word ptr [donnee+8*6*2+ebx]
mov byte ptr [donnee4+7+ecx],al ;nombre de colonnes....
;---
;====== SPECIAL LE LASCAR EST UN MOTHAFUCKAAAA DE LAPINA (3lit3)
cmp [lapipipino+ebp],1
jne rertyrttyrrtytyuutyyuiyuiiyuyuityuioouiioyuuioyyuio
push ax
mov ax,37
sub ax,word ptr [vise_de_ca_haut2+ebp]
mov byte ptr [donnee4+6+ecx],al ;nombre de lignes...
pop ax
mov byte ptr [donnee4+7+ecx],32 ;nombre de colonnes....
rertyrttyrrtytyuutyyuiyuiiyuyuityuioouiioyuuioyyuio:
;====================================================
;dw 23,23,23,23,25,25,25,25 ;nombre de lignes pour un dyna...
;mov si,word ptr [donnee+nb_dyna*2*2+ebx]
;xor ecx,ecx ;0,7,...
;xor ebx,ebx ;0,2,4,
;xor ebp,ebp ;0,4,8,12,...
mov eax,[clignotement+ebp] ;
and byte ptr [donnee4+8+ecx],011111110B
or byte ptr [donnee4+8+ecx],al
add ecx,nb_unite_donnee4
add ebx,2
add ebp,4
cmp ebp,4*8
jne hooooooop
POPALL
ret
;*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
la_mort: ;regarde si elle a frappée. ou si on a mangé un bonus.
PUSHALL
push ebp
xy_to_offset
lea esi,[truc2+eax]
pop ebp
;==== mort par brike sur la gueule ===
cmp [lapipipino+ebp],0 ;lapin ?
je nan_comme_dab
cmp [lapipipino2+ebp],0 ;lapin qui saute pas?
jne nan_laisse_tourner
cmp byte ptr [esi-32*13],11 ;regarde si c a la fin... brique sur la gueulle..
jne nan_laisse_tourner
mov [lapipipino2+ebp],3
mov [lapipipino3+ebp],duree_mort
jmp nan_laisse_tourner
nan_comme_dab:
cmp byte ptr [esi-32*13],11 ;regarde si c a la fin... brique sur la gueulle..
je microsoft
nan_laisse_tourner:
;==================================
cmp byte ptr [esi],5
jb ertterertertertert
cmp byte ptr [esi],54
jnb ertterertertertert
;invinsible dd 8 dup (?) ;invincibilité. nombre de vbl restant ... décrémentée... 0= none...
;nombre_de_coups dd 8 dup (3) ;avant la mort...
;résistance aux coups/calcul...
resistance ertterertertertert,0
microsoft: ;LA c'est la mort.
;mort d'un dyna par flamme. ou brike sur la gueulle (de dayna)
;-- on lui ote le pouvoir d'explosion retarde ... (ca a deja du etre fait,
; sauf s'il est mort par apocalypse. donc on en remet une couche!)
push ebx ;et sinon ses bombes elles resteraient.
mov ebx,[infojoueur+ebp]
mov dword ptr [ebx+4*4],0
call nike_toutes_ses_bombes
pop ebx
;--------
bruit3 7,35,BLOW_WHAT2
mov [vie+ebp],0
ertterertertertert:
;regarde si on a mangé un bonus
;si on est un lapin en train de sauter on mange pas le bonus
cmp [lapipipino+ebp],0 ;lapin ?
je on_est_pas_un_lapin_on_mange_les_bonus
cmp [lapipipino5+ebp],0 ;en hauteur ?
jne baaaaaaaaaaaaaaaaaaaaaaaah_paas_de_bonus
on_est_pas_un_lapin_on_mange_les_bonus:
bonus_ 54,bombe_max,0
bonus_ 64,bombe_max2,4
bonus_tete 74
bonus_2 84,invinsibilite_bonus,invinsible
bonus_2 94,1,nombre_de_coups
bonus_ 104,1,4*4
bonus_3 114,1,pousseur
bonus_3 124,1,patineur
;horloge
bonus_4 134
bonus_3 144,1,tribombe
bonus_6 154
;oeuf
bonus_5 193
baaaaaaaaaaaaaaaaaaaaaaaah_paas_de_bonus:
;--- regarde si un mechant nous a mangé...
mov eax,[last_bomb+ebp]
cmp [nombre_de_monstres],0
je y_en_a_pas2
mov ebx,[nombre_de_dyna]
shl ebx,2
reetrertetert:
cmp [vie+ebx],1 ;si le mechant il est mort. ben il peut pas nous tuer...
jne pas_tue
cmp eax,[last_bomb+ebx]
jne pas_tue
;résistance aux coups/calcul...
resistance pas_tue,0
;mort d'un dyna
bruit3 7,35,BLOW_WHAT2
mov [vie+ebp],0
pas_tue:
add ebx,4
cmp ebx,32
jne reetrertetert
y_en_a_pas2:
POPALL
ret
la_mort_monstre: ;regarde si elle a frappée.
PUSHALL
push ebp
xy_to_offset
lea esi,[truc2+eax]
pop ebp
cmp byte ptr [esi-32*13],11 ;regarde si c a la fin... brique sur la gueulle..
je microsoft2
cmp byte ptr [esi],5
jb uertterertertertert
cmp byte ptr [esi],54
jnb uertterertertertert
;résistance aux coups/calcul...
resistance uertterertertertert,-1
PUSHALL
sub esi,32*13-1
;inc esi
colle_un_bonus viseur_hazard_bonus2,hazard_bonus2,correspondance_bonus2
POPALL
microsoft2:
;mort d'un monstre courageux.
bruit3 8,35,BLOW_WHAT2
mov [vie+ebp],0
uertterertertertert:
POPALL
ret
;----------------
anim_un_joeur:
cmp [vie+ebp],1
jne rtertterterrterte
;0= face
;8= droite
;16= gauche
;24= haut
;cas du lapin ki saute... ne bouge pas comme ca
; cmp [lapipipino+ebp],1
; jne ertyrttyrrtytyuutyyuiyuiiyuyuityuioouiioyuuioyyuioeertertert
; cmp [lapipipino2+ebp],1 ;saut vertical
; je rtrtyyrtrtytrytyrrty
; ertyrttyrrtytyuutyyuiyuiiyuyuityuioouiioyuuioyyuioeertertert:
cmp dword ptr [touches+ebp],128 ;on met le bit 7 a 1 si bouge pas.
jb okbouge_pas
;on a un monstre/dyna ki ne se deplace pas..
;donc on ne le je fait pas gigoter.
; sauf cas particulier: monstre du nivo 7, et nivo micro !!
; ki gigottent tout le temps
and dword ptr [touches+ebp],127
add esi,[touches+ebp] ;variable en central ou ya une valeur pour chaque type
;de deplacement pour un joeur et ceci pour TOUS les
;joeurs...
;les touches.
or dword ptr [touches+ebp],128 ;remet le bit a 1
;---- cas particulier gigotage
cmp [nombre_de_dyna_x4],ebp ; uniquement si on est pas un humain...
ja non_c_pas_un_monstre2
cmp terrain,7
jne special_monstres_gigoteurs4
;*** c un cas particulier dans le cas particulier.. BIDOUILLE ATTENTION
;il faut ke ca soit des sprites ou les pieds bougent pas !!!
push ebx
xor eax,eax
;mov eax,[changement]
;and eax,0011000B
;shr eax,2
mov ebx,[changement]
;and ebx,0110000B
;shr ebx,3
and ebx,011000B
shr ebx,2
cmp bx,2
jne trhjllhjkrtlhjrhjkltyrlhjkrty
mov ax,-17*2
trhjllhjkrtlhjrhjkltyrlhjkrty:
cmp bx,6
jne trhjllhjkrtlhjrhjkltyrlhjkrty2
mov ax,-17
trhjllhjkrtlhjrhjkltyrlhjkrty2:
add ax,[esi] ;;ATTENTION JE SUIS HARD CORE LA :))
pop ebx
jmp rtrtyyrtrtytrytyrrtyZERZERZERZER
;****
special_monstres_gigoteurs4:
cmp terrain,3
je special_monstres_gigoteurs
non_c_pas_un_monstre2:
jmp rtrtyyrtrtytrytyrrty
;--------
okbouge_pas:
;------------------------- TOUCHES INVERSEES -------------------------------
cmp [nombre_de_dyna_x4],ebp ; uniquement si on est un humain...
jna ui
cmp word ptr [maladie+ebp],4 ;touches inversée...
jne ui
cmp [touches+ebp],8
jne tyuo
mov [touches+ebp],16
jmp ui
tyuo:
cmp [touches+ebp],16
jne tyuu
mov [touches+ebp],8
jmp ui
tyuu:
cmp [touches+ebp],0
jne tyuo2
mov [touches+ebp],24
jmp ui
tyuo2:
cmp [touches+ebp],24
jne tyuu1
mov [touches+ebp],0
jmp ui
tyuu1:
ui:
;---------------------------------------------------------------------------
;---- lapin ... annule tous les direction si on est en train de sauter ---
; cmp [lapipipino+ebp],1
; jne rertyrttyrrtytyuutyyuiyuiiyuyuityuioouiioyuuioyyuioeertertert
; cmp [lapipipino2+ebp],1 ;saut vertical
; jne rertyrttyrrtytyuutyyuiyuiiyuyuityuioouiioyuuioyyuioeertertert
; or dword ptr [touches+ebp],128 ;remet le bit a 1
; rertyrttyrrtytyuutyyuiyuiiyuyuityuioouiioyuuioyyuioeertertert:
;------
add esi,[touches+ebp] ;variable en central ou ya une valeur pour chaque type
;de deplacement pour un joeur et ceci pour TOUS les
;joeurs...
;les touches.
;pour le deplacement...
;-------------- variation du sprite si il bouge... (gauche/droite.. )
special_monstres_gigoteurs:
;cmp [nombre_de_dyna_x4],ebp ; uniquement si on est un humain...
;ja non_c_pas_un_monstre
mov eax,[changement]
;--- c un monstre ??? -----
cmp [nombre_de_dyna_x4],ebp ; uniquement si on est pas un humain...
ja non_c_pas_un_monstre
push ecx ebx
mov ecx,[vitesse_monstre+ebp]
;----
cmp action_replay,0
jne eanononono_onest_en_recordplaye
cmp twice,1
jne eanononono_onest_en_recordplaye
inc ecx
eanononono_onest_en_recordplaye:
;-----
mov ebx,011B
shl ebx,cl
and eax,ebx
dec cl
shr eax,cl
pop ebx ecx
jmp eanononono_onest_en_recordplay
non_c_pas_un_monstre:
;----------------------
and eax,0110000B
shr eax,3
cmp [patineur+ebp],0 ;patineur cour 2 fois plus vite
je tryyyyyyyyyyytyuiouiiuoouiuiooui
mov eax,[changement]
and eax,0011000B
shr eax,2
tryyyyyyyyyyytyuiouiiuoouiuiooui:
;mode twice...--------------------
cmp action_replay,0
jne eanononono_onest_en_recordplay
cmp twice,1
jne eanononono_onest_en_recordplay
;cours 2 fois plus vite
mov eax,[changement]
and eax,0011000B
shr eax,2
eanononono_onest_en_recordplay:
;---------------------------------
add esi,eax
;----------------
rtrtyyrtrtytrytyrrty:
mov ax,[esi]
rtrtyyrtrtytrytyrrtyZERZERZERZER:
push ebp
shr ebp,1
mov [donnee+nb_dyna*4+ebp],ax ;variables en central contenant les infos completes
;nivo affichage pour chaque joueur
;X,Y,offset
pop ebp
;------------ regarde si le sprite se deplace... (X/Y)
cmp [touches+ebp],128 ;variable en central ou ya une valeur pour chaque type
jNB non_bouge_pas
;----- vitesse = normal.. + = + !!!
;infojoueur dd offset j1,offset j2,offset j3,offset j4,offset j5,offset j6,offset j7,offset j8
;premier dd: nombre de bombes que le joeur peut encore mettre.
;deuxieme dd: puissance de ces bombes... minimum = 1 ...
;troisieme dd: nombre de tous avant que ca pete.
;quatrieme dd: vitesse du joeur... 1:normal...
mov esi,[infojoueur+ebp]
mov ecx,dword ptr [esi+12]
;1,2,3 (normal),4:double...
;-*-*-*-*-*-*-* GESTION vitesse -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
;---- modif..
cmp ecx,1
jne pas_1
test dword ptr [changement],00000000111B
jnz non_bouge_pas
;mov ecx,1
jmp finto_gestion_vitesse
pas_1:
cmp ecx,2
jne pas_2
test dword ptr [changement],00000000011B
jnz non_bouge_pas
mov ecx,1
jmp finto_gestion_vitesse
pas_2:
cmp ecx,3
jne pas_3
mov ecx,1
jmp finto_gestion_vitesse
pas_3:
cmp ecx,4
jne pas_4
mov ecx,2
jmp finto_gestion_vitesse
pas_4:
finto_gestion_vitesse:
;-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
;--- mode twice ------------
cmp action_replay,0
jne anononono_onest_en_recordplay
cmp twice,1
jne anononono_onest_en_recordplay
inc ecx
anononono_onest_en_recordplay:
;-------------------
;--- patins a roulettes ?
add ecx,[patineur+ebp]
;--- maladie de la speed ---
cmp word ptr [maladie+ebp],01B ;255 ; dd 8 dup (?)
jne ertertrterteterrteert2
add ecx,3
ertertrterteterrteert2:
;----------------------------
;;--- maladie de la lenteur ne marche pas sur le lapin !!!
;cmp [lapipipino+ebp],1
;je ertertrterteterrteert3
;--- maladie de la lenteur --
cmp word ptr [maladie+ebp],02 ;255 ; dd 8 dup (?)
jne ertertrterteterrteert3
test dword ptr [changement],00000000011B
jnz non_bouge_pas
ertertrterteterrteert3:
;----------------------------
;----------------------------
cmp [blocage+ebp],0
je next_monstre2r2
dec [blocage+ebp]
jmp non_bouge_pas
next_monstre2r2:
;--------------------------------
mov [avance+ebp],1 ;reussit a bouger par défault. (pour monstre)
ertertrterteterrteert:
push ECX
cmp [touches+ebp],8 ;*********** droite
jne ererterertert4
push ebp
shr ebp,1
;------ remet au milieu ----- Y-------------------------------
mov si,16
call remet_milieu_y
jz errteterertertrte3 ;on l'a remis au milieu...
;-------------------------------------------------------------
;dx add x, cx: add y
mov dx,8+1
mov cx,0
call possible_ou_pas
jnz errteterertertrte2 ;impossible
inc [donnee+ebp]
;add ebp,ebp
jmp errteterertertrte3
errteterertertrte2:
;---------------------------
push ebp
add ebp,ebp
mov [avance+ebp],0 ;PAS reussit a bouger apres avoir été replacé. (pour monstre)
pop ebp
errteterertertrte3:
;-----------------------------
pop ebp
ererterertert4:
cmp [touches+ebp],16 ;*********** gauche
jne ererterertert4e
push ebp
shr ebp,1
;------ remet au milieu ----- Y-------------------------------
mov si,-16
call remet_milieu_y
jz errteterertertrte3e
;-------------------------------------------------------------
;dx add x, cx: add y
mov dx,-8
mov cx,0
call possible_ou_pas
jnz errteterertertrte2e ;impossible
dec [donnee+ebp]
;add ebp,ebp
jmp errteterertertrte3e
errteterertertrte2e:
;---------------------------
push ebp
add ebp,ebp
mov [avance+ebp],0 ;PAS reussit a bouger apres avoir été replacé. (pour monstre)
pop ebp
errteterertertrte3e:
;-----------------------------
pop ebp
ererterertert4e:
cmp [touches+ebp],24 ;*********** haut
jne ererterertert4ey
push ebp
shr ebp,1
;------ remet au milieu ----- Y-------------------------------
mov si,-16 ; ;16 ;8
call remet_milieu_x
jz errteterertertrte3ey
;-------------------------------------------------------------
;dx add x, cx: add y
mov dx,0
mov cx,-8
call possible_ou_pas
jnz errteterertertrte2ey ;impossible
dec [donnee+nb_dyna*2+ebp]
;add ebp,ebp
;errteterertertrte2ey:
jmp errteterertertrte3ey
errteterertertrte2ey:
;---------------------------
push ebp
add ebp,ebp
mov [avance+ebp],0 ;PAS reussit a bouger apres avoir été replacé. (pour monstre)
pop ebp
errteterertertrte3ey:
;-----------------------------
pop ebp
ererterertert4ey:
cmp [touches+ebp],0 ;*********** bas
jne ererterertert4eyt
push ebp
shr ebp,1
;------ remet au milieu ----- Y-------------------------------
mov si,16
call remet_milieu_x
jz errteterertertrte3eyt
;-------------------------------------------------------------
;dx add x, cx: add y
mov dx,0
mov cx,8+1
call possible_ou_pas
jnz errteterertertrte2eyt ;impossible
inc [donnee+nb_dyna*2+ebp]
;add ebp,ebp
jmp errteterertertrte3eyt
errteterertertrte2eyt:
;---------------------------
push ebp
add ebp,ebp
mov [avance+ebp],0 ;PAS reussit a bouger apres avoir été replacé. (pour monstre)
pop ebp
errteterertertrte3eyt:
;-----------------------------
pop ebp
ererterertert4eyt:
;----- vitesse/. 1 = normal.. + = + !!!
pop ECX
dec ecx
jnz ertertrterteterrteert
;
PUSHALL
push ebp
xy_to_offset
pop ebp
lea esi,[truc+eax]
mov [last_bomb+ebp],esi
POPALL
non_bouge_pas:
ret
;dead dyna.
rtertterterrterte:
;add esi,32 ;[vie+ebp]
;add esi,[vie+ebp]
;add esi,0 ;32
add esi,[vie+ebp]
mov ax,[esi+32]
push ebp
shr ebp,1
mov [donnee+nb_dyna*4+ebp],ax
pop ebp
mov eax,[changement]
and eax,000000111B
jnz ertterrteertrterteertrte
cmp dword ptr [vie+ebp],16 ;8*2
je ertterrteertrterteertrte
add dword ptr [vie+ebp],2
ertterrteertrterteertrte:
ret
monsieur_brik:
;--------------- gestion des briques ---------------------------------
;briques dw 3,0,0,0,32,0,64
mov ax,ds
mov es,ax
mov esi,offset truc
mov edi,offset briques+2
xor cx,cx
xor eax,eax
mov bx,8 ;offset dans buffer destionation auquel la case correspond...
mov dx,13
rettertyutyuuityyuityuityuiyuiyuiyui:
push dx
mov dx,19
reertertertertertreerertert:
xor ax,ax
lodsb
or al,al
jz zererrte
cmp al,1
je zererrte
cmp al,66
je zererrte
cmp al,2
je ertrtyrtytyytutyutyuuty
;--- rajout de brique dure pour la fin...
cmp al,11
jne nonononono
xor ax,ax
push ebx
xor ebx,ebx
mov bl,terrain
dec bl
add ebx,ebx
mov ax,[kel_viseur_brike_fin+ebx]
pop ebx
jmp brique_dure_rajoutee
nonononono:
;----------------
;cmp [terrain],2 ;pas ce cas particulier avec la neige...
;jne retterterertertertertertertertertertertertret
test dword ptr [changement],00000000011B
jnz erertrteertert
;j,z rteterterrterterterte
;retterterertertertertertertertertertertertret:
;
;cmp [terrain],4 ;pas ce cas particulier avec la foret
;jne retterterertertertertertertertertertertertret5
;test dword ptr [changement],00000000011B
;jz rteterterrterterterte
;retterterertertertertertertertertertertertret5:
;
;test dword ptr [changement],00000000111B
;jnz erertrteertert
;rteterterrterterterte: ;cas particulier neige + foret
inc byte ptr [esi-1]
cmp byte ptr [esi-1],11
jne erertrteertert
mov byte ptr [esi-1],0
colle_un_bonus viseur_hazard_bonus,hazard_bonus,correspondance_bonus
erertrteertert:
ertrtyrtytyytutyutyuuty:
sub ax,2
shl ax,4
;------ affiche brique différentes en fonction du terrain...
push ebx
xor ebx,ebx
mov bl,[terrain] ;offset_briques dw 0,0,65+116*320
dec bl
add bx,bx
add ax,word ptr [offset_briques+ebx]
pop ebx
;-----------------
brique_dure_rajoutee:
inc cx
;add ax,320*16*2
stosw
;--------------------
mov ax,bx
stosw
ertteretretrertrte:
zererrte:
add bx,16
rettertertertert:
;*************************************************************************
dec dx
jnz reertertertertertreerertert
pop dx
add esi,13
add bx,320*16-16*19
dec dx
jnz rettertyutyuuityyuityuityuiyuiyuiyui
mov [briques],cx
;truc db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 1,0,1,2,1,2,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 1,0,0,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 1,0,1,2,1,2,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0
ret
monsieur_bombe:
;briques dw 3,0,0,0,32,0,64
mov ax,ds
mov es,ax
mov esi,offset truc2
mov edi,offset bombes+2
xor cx,cx
xor eax,eax
mov bx,8 ;offset dans buffer destionation auquel la case correspond...
mov dx,13
trettertyutyuuityyuityuityuiyuiyuiyui:
push dx
mov dx,19
treertertertertertreerertert:
xor ax,ax
lodsb
or al,al
jz tzererrte
cmp al,5
jnb ftttrrtrtyyrtyrtrtyrtytyrrtyrtyrtyrtyrty
;******************************************** bombe qui respire...
test dword ptr [changement],00000001111B
jnz terertrteertert
inc byte ptr [esi-1]
cmp byte ptr [esi-1],5
jne terertrteertert
mov byte ptr [esi-1],1
terertrteertert:
inc cx
dec ax
shl ax,4
add ax,320*16
stosw
;add ax,
;add byte ptr [esi-1],5
;mov
;--- special bombes... adder X/Y
push cx
xor ax,ax
;movsx ax,byte ptr [esi-1+32*13] ;trux_X
mov al,byte ptr [esi-1+32*13]
movsx ax,al ;byte ptr [esi-1+32*13] ;trux_X^M
add ax,bx
;movsx cx,byte ptr [esi-1+32*13*2] ;trux_Y
mov cl,byte ptr [esi-1+32*13*2] ;trux_Y^M
movsx cx,cl
push ax
mov ax,cx
shl ax,6 ;*64
shl cx,8 ;*256
add cx,ax
pop ax
add ax,cx
stosw
pop cx
jmp tzererrte
tertteretretrertrte:
;*************************************************
ftttrrtrtyyrtyrtrtyrtytyrrtyrtyrtyrtyrty:
;***************************************************************************
bombe 12
bombe 12+7
bombe 12+7+7
bombe 12+7+7+7
bombe 12+7+7+7+7
bombe 12+7+7+7+7+7
bombe 12+7+7+7+7+7+7
;----- bonus
bonus 64,160
bonus 74,160+320*16
bonus 84,160+320*32
bonus 94,160+320*48
bonus 104,160+320*16*4
bonus 114,160+320*16*5
bonus 124,160+320*16*6
bonus 134,160+320*16*7
bonus 144,160+320*16*8
bonus 154,160+320*16*9
bonus 164,0
;----- bonus qui explose...
oeuf_bonus 193,112+16*320
explo_bonus 194+7,0+172*320
tzererrte:
;***************************************************************************
add bx,16
trettertertertert:
;*************************************************************************
dec dx
jnz treertertertertertreerertert
pop dx
add esi,13
add bx,320*16-16*19
dec dx
jnz trettertyutyuuityyuityuityuiyuiyuiyui
mov [bombes],cx
ret
touches_action: ;--- bp: joeur en ce moment *4
PUSHALL
;-pour par k'on pose une bombe au début tout de suite kan meme...
cmp nombre_de_vbl_avant_le_droit_de_poser_bombe,0
je okokokok_pas_debut
dec nombre_de_vbl_avant_le_droit_de_poser_bombe
jmp treteterrterteterertter
okokokok_pas_debut:
;--------------
cmp [attente_avant_med],attente_avant_med2 ;uniquement si le processus
jb treteterrterteterertter ;de medaille est pas sur le point
;d'avoir lieu... plus de
; bombes
;--- maladie de la chiasse...
cmp word ptr [maladie+ebp],03 ;255 ; dd 8 dup (?)
je ertertrterteterrteert2rttyrrty
;---------------------------
inc [tribombe2+ebp]
;--- maladie de la constipation
cmp word ptr [maladie+ebp],05
je treteterrterteterertter
;---------------------------
;----- touche action 1 ---
cmp byte ptr [ACTION+ebp],1
jne treteterrterteterertter
;------------------------
ertertrterteterrteert2rttyrrty:
;regarde si on peut poser une bombe...
mov edi,[infojoueur+ebp] ;dans edi: viseur sur l'info d'un joueur.
cmp dword ptr [edi],0 ;nombre de bombes qu'il peut encore poser.
je treteterrterteterertter
push ebp
xy_to_offset
pop ebp
lea esi,[truc2+eax]
cmp byte ptr [esi],0 ;regarde si ya rien ou l'on veut placer la bombe
jne ya_une_bombeici
cmp byte ptr [esi-32*13],0 ;regarde si ya rien ou l'on veut placer la bombe
jne ya_une_bombeici
PUSHALL
pose_une_bombe
POPALL
jmp treteterrterteterertter
ya_une_bombeici:
cmp [tribombe+ebp],0 ;que si on a le bonus
je treteterrterteterertter
cmp [tribombe2+ebp],20
ja treteterrterteterertter
cmp [tribombe2+ebp],2
ja ttrrttreteterrterteterertter
mov [tribombe2+ebp],0 ;remet a zero si on presse tjs
jmp treteterrterteterertter
ttrrttreteterrterteterertter:
;utilise Esi par rapport a truc2 pour gauche/droite.
;2eme generation
;sortie: ebx entree ebp...
direction_du_joueur 1
PUSHALL ;(1)
encore_une_toto:
cmp dword ptr [edi],0 ;nombre de bombes qu'il peut encore poser.
jne nan_c_bon_on_peut_encore_poser
POPALL ;(1)
jmp treteterrterteterertter
nan_c_bon_on_peut_encore_poser:
add esi,ebx
add eax,ebx
cmp byte ptr [esi],0 ;regarde si ya rien ou l'on veut placer la bombe
je ici_toto
POPALL ;(1)
jmp treteterrterteterertter
ici_toto:
cmp byte ptr [esi-32*13],0 ;regarde si ya rien ou l'on veut placer la bombe
je ici_toto2
POPALL ;(1)
jmp treteterrterteterertter
ici_toto2:
mov playSoundFx,1
PUSHALL
pose_une_bombe
POPALL
jmp encore_une_toto
treteterrterteterertter:
cmp playSoundFx,1
jne dfgjhldfgkhjdflgkjhdfkljhdfglkjhdfglkjhgdfyeah
bruit2 9,34 ;,BLOW_WHAT2 ;bruit du bonus tri bombe.
mov playSoundFx,0
dfgjhldfgkhjdflgkjhdfkljhdfglkjhdfglkjhgdfyeah:
;---------- touche action 2 -----------
;***
;PUSHALL
;mov ah,02h ;SUPER_SIGNE2 DB 0
;mov dl,13
;int 21h
;xor eax,eax
;shr ebp,1
;mov ax,word ptr [donnee+nb_dyna*2+ebp] ;recup Y
;add ax,14
;and ax,00000000000001111B
;call affsigne
;POPALL
;***
PUSHALL
cmp byte ptr [ACTION+2+ebp],1
jne treteterrterteterertteruiotyterertertterert
;2 possibilites vertical ou pas vertical
cmp [lapipipino+ebp],0
je treteterrterteterertteruiotyterertertterert
cmp [lapipipino2+ebp],0
jne treteterrterteterertteruiotyterertertterert
;saut de lapin le lapin...
bruit3 10,32,BLOW_WHAT2 ;bruit kan 1 lapin saute
;sortie: ebx entree ebp...
direction_du_joueur 2
push ebp ebx
xy_to_offset
lea esi,[truc+eax]
pop ebx ebp
mov [lapipipino3+ebp],duree_saut
mov [lapipipino2+ebp],1 ;saut vertical
;cas particulier: le lapin est ;en bas
cmp ebx,32*2
jne ertytyyuttyuyuiyuiiyyuiiyuiyu2
cmp eax,32*10
ja erterererererertert
ertytyyuttyuyuiyuiiyyuiiyuiyu2:
;cas particulier: le lapin est en haut:
cmp ebx,-32*2
jne ertytyyuttyuyuiyuiiyyuiiyuiyuo
cmp eax,32*2
jb erterererererertert
ertytyyuttyuyuiyuiiyyuiiyuiyuo:
;========== cas pqrticulier: on veut sauter une brike ==========
;il ne faut pas ke lon soit pas au milieu d'une brike
cmp ebx,-32*2
jne biooooiiii
cmp byte ptr [esi+ebx+32],0 ;une brike ?
je biooooiiii
au_milieu_y2 erterererererertert2
biooooiiii:
cmp ebx,32*2
jne biooooiiiiE2
cmp byte ptr [esi+ebx-32],0 ;une brike ?
je biooooiiiiE2
au_milieu_y2 erterererererertert2
biooooiiiiE2:
cmp ebx,2
jne biooooiiiiE24
cmp byte ptr [esi+ebx-1],0 ;une brike ?
je biooooiiiiE24
au_milieu_X2 erterererererertert2
biooooiiiiE24:
cmp ebx,-2
jne biooooiiiiE24y
cmp byte ptr [esi+ebx+1],0 ;une brike ?
je biooooiiiiE24y
au_milieu_X2 erterererererertert2
biooooiiiiE24y:
;)===================================================================
;---------------------------------------
cmp byte ptr [esi+ebx],0 ;si ya rien a l'endroit ou on va sauter
jne erterererererertert
;-- 3 cases a gauche
cmp ebx,-2
jne iuertytyyuttyuyuiyuiiyyuiiyuiyu
;--- si on est pas au milieu de la case en Y il faut verif ke on peut sauter
au_milieu_y
;la place est pas libre en face
;cmp [touches+ebp],128 ;si on avance pas
;jb herterererererertert ;on saute a la verticale
;mov [lapipipino2+ebp],1 ;saut vertical
;jmp erterererererertert
;herterererererertert:
;mov [lapipipino3+ebp],0
;mov [lapipipino2+ebp],0 ;pés de saut
;jmp treteterrterteterertteruiotyterertertterert
;
;erterererererertertYUTYUyutyuu:
; pour etre sur kon va pas avancer sur cette case
;-- si elle est dur en effet on pourrait deborder
push eax
push ebp
shr ebp,1
xor eax,eax
mov ax,word ptr [donnee+ebp] ;recup X
add ax,3
and ax,1111B
pop ebp
cmp byte ptr [esi+ebx-1],0 ;pas vide a 3 cases a gauche
je iuokeeey
cmp ax,7
ja iuokeeey
push eax
sub eax,7
sub [lapipipino7+ebp],eax
pop eax
iuokeeey:
pop eax
iuertytyyuttyuyuiyuiiyyuiiyuiyu:
;------
;-- 3 cases a droite
; pour etre sur kon va pas avancer sur cette case
;-- si elle est dur en effet on pourrait deborder
cmp ebx,+2
jne iiuertytyyuttyuyuiyuiiyyuiiyuiyu
;--- si on est pas au milieu de la case en Y il faut verif ke on peut sauter
au_milieu_y
;------------------------------
push eax
push ebp
shr ebp,1
xor eax,eax
mov ax,word ptr [donnee+ebp] ;recup X
add ax,3
and ax,1111B
pop ebp
cmp byte ptr [esi+ebx+1],0 ;pas vide a 3 cases a gauche
je iiuokeeey
cmp ax,8
jb iiuokeeey
push eax
sub eax,7
add [lapipipino7+ebp],eax
pop eax
iiuokeeey:
pop eax
iiuertytyyuttyuyuiyuiiyyuiiyuiyu:
;------
;en bas ???
; pour etre sur kon va pas avancer sur cette case
;-- si elle est dur en effet on pourrait deborder
cmp ebx,32*2
jne nooooooooooooooooooooi
;saut vers le bas, avec truc dur a 3 cases dessous
;--- si on est pas au milieu de la case en X il faut verif ke on peut sauter
au_milieu_x
;;---- donc on regarde si ya du dur juste en dessous de lendroit ========
;; ou on va atterir, car on pourrait deborder...
;; ou on va arriver
push eax
push ebp
shr ebp,1
xor eax,eax
mov ax,word ptr [donnee+nb_dyna*2+ebp] ;recup Y
add ax,14
and ax,00000000000001111B
pop ebp
cmp byte ptr [esi+ebx+32],0 ;pas vide a 3 cases en dessous ?
je uokeeey
cmp ax,8
jb uokeeey
push eax
sub eax,7
add [lapipipino7+ebp],eax
pop eax
uokeeey:
pop eax
nooooooooooooooooooooi:
;en haut
; pour etre sur kon va pas avancer sur cette case
;-- si elle est dur en effet on pourrait deborder
cmp ebx,-32*2 ;en haut
jne knooooooooooooooooooooi
;--- si on est pas au milieu de la case en X il faut verif ke on peut sauter
au_milieu_x
;saut vers le bas, avec truc dur a 3 cases dessous
;;---- donc on regarde si ya du dur juste en dessous de lendroit ========
;; ou on va atterir, car on pourrait deborder...
;; ou on va arriver
push eax
push ebp
shr ebp,1
xor eax,eax
mov ax,word ptr [donnee+nb_dyna*2+ebp] ;recup Y
add ax,14
and ax,00000000000001111B
pop ebp
cmp byte ptr [esi+ebx-32],0 ;pas vide a 3 cases au dessus
je kuokeeey ;pour cas particulier, on est avance vers le
cmp ax,7 ;bas... donc on serra avance sur une case dure
ja kuokeeey
push eax
sub eax,7
neg eax
add [lapipipino7+ebp],eax
pop eax
kuokeeey:
pop eax
knooooooooooooooooooooi:
;;---===================================================================
erterererererertert:
jmp baaaaaaaaaaa
erterererererertert2: ;pour pas sauter a la verticale,dans tous les cas
cmp [touches+ebp],127 ;si on avance pas
ja baaaaaaaaaaa ;on saute a la verticale
mov [lapipipino3+ebp],0
mov [lapipipino2+ebp],0
baaaaaaaaaaa:
;--------
treteterrterteterertteruiotyterertertterert:
POPALL
mov ebx,[infojoueur+ebp] ;uniquement s'il y a droit...
cmp dword ptr [ebx+4*4],1
jne treteterrterteterertteruioty
cmp byte ptr [ACTION+1+ebp],1
jne treteterrterteterertteruioty
;liste_bombe dd ? ; nombre de bombes...
; dd 247 dup (?,?,?,?)
mov ecx,[liste_bombe]
or ecx,ecx
jz pasdutout
lea esi,liste_bombe+4-taille_dune_info_bombe
next_bomby:
add esi,taille_dune_info_bombe
cmp dword ptr [esi+4],0
jne ya_bombe_ici
jmp next_bomby
ya_bombe_ici:
;------- unqieuemnt si c'est notre propre bombe...
mov ebx,[infojoueur+ebp]
cmp dword ptr [esi],ebx
jne non_dejar
;--------- uniquement si cette bombe est a retardement...
cmp word ptr [esi+4*3+2],0
je non_dejar
mov word ptr [esi+4*3+2],0 ;la transforme en bombe normalle
mov dword ptr [esi+4],1 ;la fait exploser
non_dejar:
dec ecx
jnz next_bomby
pasdutout:
;1er: offset de l'infojoeur
;2eme: nombre de tours avant que ca PETE !!! ; si = 0 ca veut dire
; ;emplacement libre...
;3eme:distance par rapport au debut de truc2
;4eme puissance de la bombe.
treteterrterteterertteruioty:
;-----------------------------------------
POPALL
ret
minuteur: ;le tic tic tic des bombes...+ deplacement
PUSHALL
mov ecx,[liste_bombe]
or ecx,ecx
jz ertrteertertrterteertertertrteertertert
xor ebp,ebp
tetrrtyrtyrtyrtyrtyrtytyrtyr:
cmp dword ptr [liste_bombe+ebp+4+1*4],0 ;indique emplacement non remplis !!!
jne rtytyrrtytyrtyuutyiyuuiouiopuiouiopioppiopiopp2
inc ecx
jmp rtytyrrtytyrtyuutyiyuuiouiopuiouiopioppiopiopp
rtytyrrtytyrtyuutyiyuuiouiopuiouiopioppiopiopp2:
;*****-*-*-------********----------POUSSER DEPLACEMENT *-*-*********------
;add esi,[liste_bombe+ebp+4+2*4] ;distance par rapport au debut de truc2
;mov word ptr [liste_bombe+ebx+4+4*4],1 ;adder X automatique.
;mov word ptr [liste_bombe+ebx+4+4*4+2],0
;mov word ptr [liste_bombe+ebx+4+5*4],0 ;adder X
;mov word ptr [liste_bombe+ebx+4+5*4+2],0 ;adder Y
;movsx eax,word ptr [liste_bombe+ebp+4+4*4] ;force d'addage.. (+1 ou -1)
;or eax,eax
;je non_zero ;pas de force de deplacement X/Y
;add ebx,1 ;eax ;offset dans truc+addage
;--- réflechis au deplacement uniquement si on est a 0 en adder...
;cmp word ptr [liste_bombe+ebp+4+5*4],0
;jne depeplacement_kan_mee
;cmp byte ptr [truc+ebx],0
;jne non_ya_un_mur_ote ;mur a cote...
;depeplacement_kan_mee:
;on deplace....
;jne nan_nan_normale
;xy_adder 0 ou 2
;xy_x32 1 ou 32
;truc_monstre db 32*13 dup (?)
call deplacement_bombes
cmp action_replay,0
jne nononono_onest_en_recordplayzrezerzeezr
cmp twice,1
jne nononono_onest_en_recordplayzrezerzeezr
call deplacement_bombes
nononono_onest_en_recordplayzrezerzeezr:
;mov word ptr [liste_bombe+ebp+4+5*4],-7
;-----------
;mov ax,word ptr [liste_bombe+ebp+4+5*4]
;mov ebx,[liste_bombe+ebp+4+2*4]
;mov byte ptr [truc_X+ebx],al
;jmp okey_abe
;mov word ptr [liste_bombe+ebp+4+4*4],0
;okey_abe:
;non_zero:
;------------------ sauf si on a les bombes a retardement
;liste_bombe dd ? ; nombre de bombes...
; dd 247 dup (?,?,?,?)
;1er: offset de l'infojoeur
;2eme: nombre de tours avant que ca PETE !!! ; si = 0 ca veut dire
;3eme:distance par rapport au debut de truc2
;4eme:DD= 1 DW: puissance de la bombe + 1 DW: bombe a retardement ??? (=1)
;mov ebx,[liste_bombe+ebp+4]
;cmp dword ptr [ebx+4*4],1
mov esi,offset truc2
add esi,[liste_bombe+ebp+4+2*4] ;distance par rapport au debut de truc2
;---- cas particulier.. on est une bombe, est on vient de se prendre
;une brike sur la gueule... donc on explose...
cmp byte ptr [esi-32*13],11 ;cas particulier... apres apocalypse...
jne kklmjjkjklmklmjmjklmjklmjklmjkl
;on la fait exploser de suite...
mov dword ptr [liste_bombe+ebp+4+1*4],1 ;pour ke ca pete :))
mov word ptr [liste_bombe+ebp+4+3*4+2],0 ;elle est plus retarde (enfin
;plus.. maintenant. si elle l'etait)
jmp finis_la
kklmjjkjklmklmjmjklmjklmjklmjkl:
;----
cmp word ptr [liste_bombe+ebp+4+3*4+2],1 ;si bombe retardee...
je rertertertert ;ne decremente pas
finis_la:
dec dword ptr [liste_bombe+ebp+4+1*4]
jnz rertertertert
dec dword ptr [liste_bombe]
;------------ fait exploser la bombe -------------------------------------
;bruit 1 40 BLOW_WHAT2
cmp byte ptr [esi-32*13],11 ;cas particulier... apres apocalypse...
je nononononiioiouuio
mov byte ptr [esi],05 ;centre.
bruit2 2,40
nononononiioiouuio:
mov eax,[liste_bombe+ebp+4+0*4] ;offset de l'infojoeur
inc dword ptr [eax] ;augmente le nombre de bombe k'il a le droit de poser...
;,explosion ; -32 33 40
cmp byte ptr [esi-32*13],11 ;cas particulier... apres apocalypse... (pice dure)
je nononononiioiouuiorytrty
explosion -32,33,40
explosion 32,33,47
explosion 1,12,26
explosion -1,12,19
nononononiioiouuiorytrty:
;mov dword ptr [liste_bombe+ebp+4+3*4]
mov dword ptr [liste_bombe+ebp+4+0*4],0
mov dword ptr [liste_bombe+ebp+4+1*4],0
mov dword ptr [liste_bombe+ebp+4+2*4],0
mov dword ptr [liste_bombe+ebp+4+3*4],0
mov dword ptr [liste_bombe+ebp+4+4*4],0
mov dword ptr [liste_bombe+ebp+4+5*4],0
;----------------------------------------------------------------------
rertertertert:
rtytyrrtytyrtyuutyiyuuiouiopuiouiopioppiopiopp:
add ebp,taille_dune_info_bombe
dec ecx
jnz tetrrtyrtyrtyrtyrtyrtytyrtyr
ertrteertertrterteertertertrteertertert:
POPALL
ret
;ya un draw game ??? ou une victoire ???
;mov ecx,8
;mov edi,offset victoires
;xor eax,eax
;rep stosd
phase:
pushad
;-- special... draw forcé ---
cmp word ptr bdraw666,'99'
je dikgrhrfhgrrethghkgh
mov edi,offset vie
mov ecx,[nombre_de_dyna]
yretrteertertert:
cmp dword ptr [edi],1
je et_non_pas_de_draw
add edi,4
dec ecx
jnz yretrteertertert
;-------- si on est au temps = 0 on compte moins vite !!!!
;car c le bordel faut k'on ai le temps de voir...
;;cmp in_the_apocalypse,1
;;je pas_encore
;;----------------------
dec [attente_avant_draw]
jnz pas_encore
dikgrhrfhgrrethghkgh:
mov byte ptr [ordre2],'D'
cmp nombre_de_dyna,1
jne pas_encore
mov byte ptr [ordre2],'M'
pas_encore:
et_non_pas_de_draw:
;----------------------------- ya une victoire ???? ----------------------
xor ebx,ebx
xor edx,edx
xor edi,edi
mov eax,-1 ;equipe du dernier a avoir gagne..
mov ecx,[nombre_de_dyna]
uyretrteertertert:
cmp dword ptr [vie+edi],1
jne uil_est_mort
;team dd 0,1,2,3,4,5,6,7
cmp eax,[team+edi] ;si deja un gagnant de cette équipe. on le compte pas.
je deja_dernier_un_gagnant_comme_ca
inc edx ;------- nombre de gagnants
mov eax,[team+edi] ;recup dans eax la team du gagnant...
mov ebx,edi ;sauvegarde du gagnant.
deja_dernier_un_gagnant_comme_ca:
uil_est_mort:
add edi,4
dec ecx
jnz uyretrteertertert
;//** cas particulier si mode 1 player... retourne edx = 1 si 1 seul vivant (moi)
cmp nombre_de_dyna,1
jne pasmode1player
mov ecx,8
mov edx,0
xor edi,edi
comptemonstresvivants:
cmp dword ptr [vie+edi],1
jne monstreMort
inc edx
monstreMort:
add edi,4
dec ecx
jnz comptemonstresvivants
pasmode1player:
;//**********
;// declenche victoire sur 2 joueur ou plus
cmp edx,1
jne terertyrtytyrrtyrty
; plus k'1 EQUIPE vivante... !!! !
; regarde si ya plus de bombes....
;dans eax on a l'equipe du gagnat
push eax
;-- transforme les bombes en semi-retardee
push ebx
xor ebx,ebx
ertterertuuuuu:
push ebx
mov ebx,[infojoueur+ebx]
;mov dword ptr [ebx+4*4],0
call nike_toutes_ses_bombes
pop ebx
add ebx,4
cmp ebx,32
jne ertterertuuuuu
pop ebx
;--------
pop eax
; juste pour la premiere fois... pour k'on ne pose plus de bombes.
cmp [attente_avant_med],attente_avant_med2
jne reterertertertr89
mov [attente_avant_med],attente_avant_med2-1
reterertertertr89:
;cmp word ptr [bombes],0
;jne terertyrtytyrrtyrty
mov esi,offset truc2
mov ecx,32*13
zertertrtertetyrtyutyuiuiy:
cmp byte ptr [esi],0
je terertyrtytyrrtyrtyert
cmp byte ptr [esi],54
jb terertyrtytyrrtyrty ;bombe trouvée...
terertyrtytyrrtyrtyert:
inc esi
dec ecx
jnz zertertrtertetyrtyutyuiuiy
;truc2 db 32*13 dup (?)
; 40
; 33
; 19 12 05 12 26
; 33
; 47
;1 = bombe... (2,3,4) respirant... si c sup a 4; on est mort...
;5 = centre de bombe. de 5 a 11
;12 = ligne droite...
;19 = arrondie ligne droite vers la gauche...
;26 = arrondie ligne droite vers la droite
;33 = ligne verti
;40 arrondie verti vers le haut
;47-- bas
;---------- regarde si on est dans un terrain ou il faut attendre ke l'apocalypse
; soit terminee pour determiner un gagnant.
push ebx
mov bl,terrain
dec bl
shl ebx,2
cmp [ebx+kelle_fin],0
je pas_attente_fin_apocalypse
pop ebx
cmp in_the_apocalypse,1 ;c'est encore l'apo. decompte pas encore.
je terertyrtytyrrtyrty
push ebx
pas_attente_fin_apocalypse:
pop ebx
;;----------------------
dec [attente_avant_med]
jnz terertyrtytyrrtyrty
;fabriquation du packet/victoires&médailles
mov [ordre2],'Z'
;-------- on donne la victoire au tout premier de cette equipe
xor ebx,ebx
pas_celui_la:
cmp [team+ebx],eax
je reertertertertert90
add ebx,4
jmp pas_celui_la
reertertertertert90:
; si un joueur on zappe les medailles
cmp nombre_de_dyna,1
jne dfdfdfgkldgflkdgflkdlgklgdfl
mov [ordre2],'%'
dec dword ptr [victoires+ebx]
dfdfdfgkldgflkdgflkdlgklgdfl:
;
inc dword ptr [victoires+ebx]
mov [latest_victory],ebx
skynet_team_victory:
cmp [team3_sauve],4
jne copy_victory_data
mov ecx,[nombre_de_dyna]
mov esi,[team+ebx]
xor edi,edi
skynet_team_victory_loop:
cmp esi,[team+edi]
jne skynet_team_victory_next
cmp edi,[latest_victory]
je skynet_team_victory_next
inc dword ptr [victoires+edi]
skynet_team_victory_next:
add edi,4
dec ecx
jne skynet_team_victory_loop
copy_victory_data:
push ds
pop es
mov esi,offset victoires
mov edi,offset donnee4
mov ecx,9
rep movsd
;--- puis on copie:
;les 4 dd: des sources du dyna de face ki a gagné...
;puis 1 db: le nombre de lignes k'il fait...
;liste_couleur dd offset blanc,
mov esi,[liste_couleur+ebx]
xor eax,eax
mov ax,word ptr [esi]
add eax,dword ptr [donnee+8*3*2+ebx] ;--- adresse page
stosd
xor eax,eax
mov ax,word ptr [esi+2]
add eax,dword ptr [donnee+8*3*2+ebx] ;--- adresse page
stosd
xor eax,eax
mov ax,word ptr [esi+4]
add eax,dword ptr [donnee+8*3*2+ebx] ;--- adresse page
stosd
xor eax,eax
mov ax,word ptr [esi+6]
add eax,dword ptr [donnee+8*3*2+ebx] ;--- adresse page
stosd
shr ebx,1
mov ax,word ptr [donnee+8*5*2+ebx] ;--- nombre de lignes
stosb
mov ax,word ptr [donnee+8*6*2+ebx] ;--- nombre de colones.
stosb
;--- puis copie les noms des différents joueurs...
mov edi,offset briques
xor ebx,ebx
erertcharmant:
mov esi,offset nick_t
add esi,[control_joueur+ebx]
;lodsd
movsd
add ebx,4
cmp ebx,4*8
jne erertcharmant
;-------------------------------------------------------
;mov dword ptr [texte1+6*1+1+32*0+edx],eax
;mov dword ptr [texte1+6*1+1+32*1+edx],eax
;mov dword ptr [texte1+6*1+1+32*2+edx],eax
;mov dword ptr [texte1+6*1+1+32*3+edx],eax
;donnee dw 8 dup (?) ;x du dynablaster
; dw 8 dup (?) ;y du dynablaster
; dw 8 dup (?) ;source du dyna dans bloque
; dd 8 dup (?) ;source bloque memoire
; dw 8 dup (?) ;nombre de lignes pour un dyna...
; dw 8 dup (?) ;nombre de colonnes.
; dd 8 dup (?) ;adder di (pour la girl + grande...)
;liste_couleur dd 8 dup (?)
;donnee4+9*4+4*4
;mov ecx,4
;lodsw
;rep movsd ;des sources du dyna de face ki a gagné...
;stosd
;;donnee dw 8*3 dup (?)
;; dw 20,20,277,277,116,116,180,180 ;x du dynablaster
;; dw 9,170,9,170,41,137,41,137 ;y du dynablaster
;; dw 24*0,777,24*2,24*3,24*4,24*5,24*6,24*7 ;source du dyna dans bloque
;;dd 576000,576000,576000,576000,640000,640000,640000,640000 ;source bloque memoire
;;dw 23,23,23,23,25,25,25,25 ;nombre de lignes pour un dyna...
;;dd 0,0,0,0,-3*320,-3*320,-3*320,-3*320 ;adder di (pour la girl + grande...)
;si ordre2='Z'
; copie de "victoires dd 8 dup (?)"
; et 1 dd avec le offset du dernier ki a eu une victoire...
; (latest_victory)
terertyrtytyrrtyrty:
popad
ret
gestion_jeu endp
;touches dd nb_dyna dup (0)
;0= face bas.
;8= droite droite
;16= gauche gauche
;24= haut haut
load_data proc near
cmp dataLoaded,1
jne doTheLoad
RET
doTheLoad:
mov dataLoaded,2
PUSHALL
call load_gus
;------------------- charge le fichier avec les sprites ---------------
;mov ecx,[packed_liste+4*6]
;mov edx,offset iff_file_name
;mov edi,offset buffer4 ; 128000 ;307200
;mov ebx,320*200 ;307200
;mov ax,ds
;call load_pcx
;mov esi,0
;copyblock2
;-----------------------------------------------------------------------
;mov ecx,0
;mov edx,offset fichier1
mov ecx,[packed_liste+4*0]
mov edx,offset iff_file_name
;adresse_des_fonds dd 640000,64000,328000
mov edi,0
mov ebx,320*200 ;307200 ;nombre de pixels.
mov ax,fs
call load_pcx
;mov ecx,0
;mov edx,offset fichier2
mov ecx,[packed_liste+4*1]
mov edx,offset iff_file_name
mov edi,64000*2
mov ebx,320*200 ;307200
mov ax,fs
call load_pcx
;mov ecx,0
;mov edx,offset fichier3
;---- game
mov ecx,[packed_liste+4*2]
mov edx,offset iff_file_name
mov edi,64000*3 ; 128000 ;307200
mov ebx,320*200 ;307200
mov ax,fs
call load_pcx
;--- draw 1 ----
mov ecx,[packed_liste+4*7]
mov edx,offset iff_file_name
mov edi,64000*5
mov ebx,320*200
mov ax,fs
call load_pcx
;----------------
;--- draw2 ----
mov ecx,[packed_liste+4*8]
mov edx,offset iff_file_name
mov edi,64000*6
mov ebx,320*200
mov ax,fs
call load_pcx
;----------------
;--- med 1 ----
mov ecx,[packed_liste+4*9]
mov edx,offset iff_file_name
mov edi,64000*7
mov ebx,320*200
mov ax,fs
call load_pcx
;----------------
;--- med 3 ----
mov ecx,[packed_liste+4*10]
mov edx,offset iff_file_name
mov edi,64000*8
mov ebx,320*200
mov ax,fs
call load_pcx
;----------------
;--- sprites bomberman masculins ---
mov ecx,[packed_liste+4*3]
mov edx,offset iff_file_name
mov edi,576000 ; 128000 ;307200
mov ebx,320*200 ;307200
mov ax,fs
call load_pcx
;--- sprites bomberman feminin ---
mov ecx,[packed_liste+4*6]
mov edx,offset iff_file_name
mov edi,640000 ; 128000 ;307200
mov ebx,320*200 ;307200
mov ax,fs
call load_pcx
;--- vic 1 ---
mov ecx,[packed_liste+4*11]
mov edx,offset iff_file_name
mov edi,704000 ; 128000 ;307200
mov ebx,320*200 ;307200
mov ax,fs
call load_pcx
;--- vic 2 ---
mov ecx,[packed_liste+4*12]
mov edx,offset iff_file_name
mov edi,768000 ; 128000 ;307200
mov ebx,320*200 ;307200
mov ax,fs
call load_pcx
;--- vic 3 ---
mov ecx,[packed_liste+4*13]
mov edx,offset iff_file_name
mov edi,832000 ; 128000 ;307200
mov ebx,320*200 ;307200
mov ax,fs
call load_pcx
;--- vic 4 ---
mov ecx,[packed_liste+4*14]
mov edx,offset iff_file_name
mov edi,896000 ; 128000 ;307200
mov ebx,320*200 ;307200
mov ax,fs
call load_pcx
;--- neige1 ---
mov ecx,[packed_liste+4*15]
mov edx,offset iff_file_name
mov edi,896000+64000*3 ; 128000 ;307200
mov ebx,320*200 ;307200
mov ax,fs
call load_pcx
;--- neige2 ---
mov ecx,[packed_liste+4*16]
mov edx,offset iff_file_name
mov edi,896000+64000*2 ; 128000 ;307200
mov ebx,320*200 ;307200
mov ax,fs
call load_pcx
;--- pic.pcx ---
mov ecx,[packed_liste+4*18]
mov edx,offset iff_file_name
mov edi,896000+64000*1 ;896000+64000*3 ; 128000 ;307200
mov ebx,320*200 ;307200
mov ax,fs
call load_pcx
;;--- mrfond.pcx ---
;mov ecx,[packed_liste+4*19]
;mov edx,offset iff_file_name
;;cmp kel_pic_intro,1
;;jne opiopiioiouuiiuiuiuooo
;;
;mov edi,896000+64000*4 ; 128000 ;307200
;mov ebx,640*(36*2) ;307200
;mov ax,fs
;call load_pcx
;
;;--- mrfond.pcx ---
mov ecx,[packed_liste+4*19]
mov edx,offset iff_file_name
;;cmp kel_pic_intro,1
;;jne opiopiioiouuiiuiuiuooo
;;
mov edi,1966080+64000*21
mov ebx,320*200
mov ax,fs
call load_pcx
;--- final.pcx ---
mov ecx,[packed_liste+4*20]
mov edx,offset iff_file_name
mov edi,896000+64000*4+640*(36*2) ; 128000 ;307200
mov ebx,320*200
mov ax,fs
call load_pcx
;;--nuage1.pcx--
mov ecx,[packed_liste+4*21]
mov edx,offset iff_file_name
mov edi,896000+64000*4+640*(36*2)+64000 ; 128000 ;307200
mov ebx,320*200
mov ax,fs
call load_pcx
;--nuage2.pcx--
mov ecx,[packed_liste+4*22]
mov edx,offset iff_file_name
mov edi,896000+64000*4+640*(36*2)+64000*2 ; 128000 ;307200
mov ebx,320*200
mov ax,fs
call load_pcx
;--- foret.pcx ---
mov ecx,[packed_liste+4*23]
mov edx,offset iff_file_name
mov edi,896000+384000+46080+64000 ; 128000 ;307200
mov ebx,320*200
mov ax,fs
call load_pcx
;--- feuille.pcx ---
mov ecx,[packed_liste+4*24]
mov edx,offset iff_file_name
mov edi,896000+384000+46080+64000+64000 ; 128000 ;307200
mov ebx,320*200
mov ax,fs
call load_pcx
;--- neige3 ---
mov ecx,[packed_liste+4*17]
mov edx,offset iff_file_name
mov edi, 896000+384000+46080+64000*3
mov ebx,320*200 ;307200
mov ax,fs
call load_pcx
;1582080
;--- pause.pcx ---
mov ecx,[packed_liste+4*25]
mov edx,offset iff_file_name
mov edi,1582080
mov ebx,320*200 ;307200
mov ax,fs
call load_pcx
;--- mdec.pcx ---
mov ecx,[packed_liste+4*26]
mov edx,offset iff_file_name
mov edi,1582080+64000
mov ebx,320*200 ;307200
mov ax,fs
call load_pcx
;--- mdeg.pcx ---
mov ecx,[packed_liste+4*27]
mov edx,offset iff_file_name
mov edi,1582080+64000*2
mov ebx,320*200 ;307200
mov ax,fs
call load_pcx
;;--- exo1.pcx ---
;mov ecx,[packed_liste+4*28]
;mov edx,offset iff_file_name
;mov edi,1582080+64000*3
;mov ebx,320*200
;mov ax,fs
;call load_pcx
;
;;--- puzzle.pcx ---
;mov ecx,[packed_liste+4*29]
;mov edx,offset iff_file_name
;mov edi,1582080+64000*4
;mov ebx,320*200
;mov ax,fs
;call load_pcx
;
;---- record0.mbr ---
;cmp special_on_a_loadee_nivo,1
;je naoinoirzeniozerrzeerzzererz
mov ecx,[packed_liste+4*30]
mov edx,offset iff_file_name
;cmp economode,1
;je ertertterterrtertytyrrtyrtyrtyrtyrtyrtyrty
;
;cmp special_on_a_loadee_nivo,1
;jne ertertterterrtertytyrrtyrtyrtyrtyrtyrtyrty
;lea edx,reccord2
;xor ecx,ecx
;
;ertertterterrtertytyrrtyrtyrtyrtyrtyrtyrty:
mov edi,1966080+64000
call load_raw
naoinoirzeniozerrzeerzzererz:
;---- record1.mbr ---
mov ecx,[packed_liste+4*31]
mov edx,offset iff_file_name
mov edi,1966080+64000*2
call load_raw
;---- record2.mbr ---
mov ecx,[packed_liste+4*32]
mov edx,offset iff_file_name
mov edi,1966080+64000*3
call load_raw
;---- record3.mbr ---
mov ecx,[packed_liste+4*33]
mov edx,offset iff_file_name
mov edi,1966080+64000*4
call load_raw
;---- fete1.mbr ---
mov ecx,[packed_liste+4*34]
mov edx,offset iff_file_name
mov edi,1966080+64000*5
call load_raw
;---- record5.mbr ---
mov ecx,[packed_liste+4*37]
mov edx,offset iff_file_name
mov edi,1966080+64000*6
call load_raw
;---- crayon.pcx ---
mov ecx,[packed_liste+4*35]
mov edx,offset iff_file_name
mov edi,1582080+64000*3 ;1582080+64000*6
mov ebx,320*200 ;307200
mov ax,fs
call load_pcx
;---- crayon2.pcx ---
mov ecx,[packed_liste+4*36]
mov edx,offset iff_file_name
mov edi,1582080+64000*4 ;1582080+64000*7
mov ebx,320*200 ;307200
mov ax,fs
call load_pcx
;---- lapin1.pcx ---
mov ecx,[packed_liste+4*38]
mov edx,offset iff_file_name
mov edi,1966080+64000*7
mov ebx,320*200 ;307200
mov ax,fs
call load_pcx
;---- mort.pcx ---
mov ecx,[packed_liste+4*39]
mov edx,offset iff_file_name
mov edi,1966080+64000*8
mov ebx,320*200
mov ax,fs
call load_pcx
;---- lapin2.pcx ---
mov ecx,[packed_liste+4*40]
mov edx,offset iff_file_name
mov edi,1966080+64000*9
mov ebx,320*200
mov ax,fs
call load_pcx
;---- lapin3.pcx ---
mov ecx,[packed_liste+4*41]
mov edx,offset iff_file_name
mov edi,1966080+64000*10
mov ebx,320*200
mov ax,fs
call load_pcx
;---- lapin4.pcx ---
mov ecx,[packed_liste+4*42]
mov edx,offset iff_file_name
mov edi,1966080+64000*11
mov ebx,320*200
mov ax,fs
call load_pcx
;---- foot.pcx ---
mov ecx,[packed_liste+4*43]
mov edx,offset iff_file_name
mov edi,1966080+64000*12
mov ebx,320*200
mov ax,fs
call load_pcx
;---- foot1.mbr ---
mov ecx,[packed_liste+4*44]
mov edx,offset iff_file_name
mov edi,1966080+64000*13
call load_raw
;---- foot2.mbr ---
mov ecx,[packed_liste+4*45]
mov edx,offset iff_file_name
mov edi,1966080+64000*14
call load_raw
;---- fete2.mbr ---
mov ecx,[packed_liste+4*46]
mov edx,offset iff_file_name
mov edi,1966080+64000*15
call load_raw
;---- neige2.mbr ---
mov ecx,[packed_liste+4*47]
mov edx,offset iff_file_name
mov edi,1966080+64000*16
call load_raw
;---- rose2.mbr ---
mov ecx,[packed_liste+4*48]
mov edx,offset iff_file_name
mov edi,1966080+64000*17
call load_raw
;---- jungle2.mbr ---
mov ecx,[packed_liste+4*49]
mov edx,offset iff_file_name
mov edi,1966080+64000*18
call load_raw
;---- micro2.mbr ---
mov ecx,[packed_liste+4*50]
mov edx,offset iff_file_name
mov edi,1966080+64000*19
call load_raw
;---- nuage2.mbr ---
mov ecx,[packed_liste+4*51]
mov edx,offset iff_file_name
mov edi,1966080+64000*20
call load_raw
;--- soucoupe.pcx ---
mov ecx,[packed_liste+4*52]
mov edx,offset iff_file_name
mov edi,1966080+64000*22
mov ebx,320*200
mov ax,fs
call load_pcx
;--- soccer.pcx ---
mov ecx,[packed_liste+4*53]
mov edx,offset iff_file_name
mov edi,1966080+64000*23
mov ebx,320*200
mov ax,fs
call load_pcx
;--- footanim.pcx ---
mov ecx,[packed_liste+4*54]
mov edx,offset iff_file_name
mov edi,1966080+64000*24
mov ebx,320*200
mov ax,fs
call load_pcx
;---- lune1.mbr ---
mov ecx,[packed_liste+4*55]
mov edx,offset iff_file_name
mov edi,1966080+64000*25
call load_raw
;---- lune2.mbr ---
mov ecx,[packed_liste+4*56]
mov edx,offset iff_file_name
mov edi,1966080+64000*26
call load_raw
;---- bombes.+ sprites bonus (sprite2.pcx)
mov ecx,[packed_liste+4*4]
mov edx,offset iff_file_name
mov edi,1582080+64000*5
mov ebx,320*200 ;307200
mov ax,fs
call load_pcx
;------------------------
;(1582080+64000*6) 64000K réservé pour sauvegarde
;
;
;------------------------
;--- menu... ----
mov ecx,[packed_liste+4*5]
mov edx,offset iff_file_name
mov edi,64000*4
mov ebx,320*200
mov ax,fs
call load_pcx
;----------------
eretterertrerzet:
POPALL
ret
endp
transmet_central proc near ; é partir du GROS packet de touches qu'on a
; récupéré pour tous les ordinateur.
; on regarde é kel dyna correspond chaque partie
; packet
; et on modifie les variables CENTRAL "touches"
; et "action"
; qui informent dans kel direction le dyna va
; s'il est en mouvement et s'il veut poser une
; bombes. grace a ces variables l'intelligence du
; master déterminera les packets finaux a envoyer
; ou différents slaves... (enfin é l'affichage koi)
PUSHALL
;*************** transmet au central...
mov ecx,[nombre_de_dyna] ; dd 2 ;en tout.. pour le master
xor ebp,ebp
rterteterrterteertert:
mov ebx,[control_joueur+ebp] ;récupere l'offet du packet en question.
;controle joueur special play
cmp action_replay,2
jne pas_recertterteretrreertyutyyut
mov ebx,[control_joueur2+ebp] ;récupere l'offet du packet en question.
;mov ebx,-64
pas_recertterteretrreertyutyyut:
;=================
lea esi,[total_t+ebx]
;entrée. ebp ;numéro CENTRAL d'un joeur.
;mov esi,offset total_t ;packet
;call packet_to_central ;modifie les valeurs du central a partir des
; ;deplacement d'un dyna.
;packet_to_central proc near ;numéro du dyna * 4
PUSHALL
;model des packets recus par le master.. (envoyé par slave.)
;donnee2 dd 0,0,0,0 ,0,0 ;1er joeur d'un ordy.
; dd 0,0,0,0 ,0,0 ;2eme joeur d'un ordy
; dd 0,0,0,0 ,0,0 ;3eme joeur d'un ordy
; dd 0,0,0,0 ,0,0 ;4eme joeur d'un ordy
;
;;offset 0 =1 si la fleche bas est pressé/ j1
;; 4 =1 si la fleche droite est pressé j1
;; 8 =1 si la fleche gauche est pressé j1
;; 12 =1 si la fleche haut est pressé2 j1
;; 16 =1 bouton 1 j1
;; 20 =1 bouton 2 j1
xor ax,ax ;indique k'on a trouvé aucune touche...
mov dword ptr [ACTION+ebp],0 ;touches action a 0
cmp [lapipipino+ebp],0 ;lapin ? tient pas compte de ses trucs
je dynanormalito
cmp [lapipipino2+ebp],0 ;en train de sauter ? tient pas compte de ses trucs
jne errereerreerretertertrtertetyyrtuui
dynanormalito:
cmp byte ptr [esi+3],1
jne erterertertertert
mov [touches+ebp],0
mov ax,1
erterertertertert:
cmp byte ptr [esi+1],1
jne erterertertertert2
mov [touches+ebp],8
mov ax,2
erterertertertert2:
cmp byte ptr [esi+2],1
jne erterertertertert3
mov [touches+ebp],16
mov ax,3
erterertertertert3:
cmp byte ptr [esi],1
jne erterertertertert4
mov [touches+ebp],24
mov ax,4
erterertertertert4:
;**************** touches d'action
;------------- touches d'action
; 4 =1 bouton 1 j1
; 5 =1 bouton 2 j1
cmp byte ptr [esi+4],1
jne ertertertertrte
mov byte ptr [ACTION+ebp],1
ertertertertrte:
cmp byte ptr [esi+6],1
jne ertertertertrte3
mov byte ptr [ACTION+ebp+2],1
; si lapin ki a la maladie de la lenteur... on lui permet pas de sauter ...
cmp word ptr [maladie+ebp],02 ;255 ; dd 8 dup (?)
jne ertertertertrte3
mov byte ptr [ACTION+ebp+2],0
;------------
ertertertertrte3:
;special lapin en train de sauter,on arrive directement la
errereerreerretertertrtertetyyrtuui:
cmp byte ptr [esi+5],1
jne tertertertertrte
mov byte ptr [ACTION+ebp+1],1
tertertertertrte:
;*******************************
;-------------
;touches dd nb_dyna dup (0)
; ;0= face bas.
; ;8= droite droite
; ;16= gauche gauche
; ;24= haut haut
;+128 si ne bouge pas..
or ax,ax
jnz reerrteertyut
or dword ptr [touches+ebp],128
reerrteertyut:
POPALL
add ebp,4
dec ecx
jnz rterteterrterteertert
POPALL
ret
endp
;get_all_infos proc near
;PUSHALL
;
;;1er mot 0=existe pas: 1 existe !!!
;;2eme mot: numéro de l'ordinateur !!!
;; 0= local.
;;3eme mot: numéro interne (0 a 3) pour chaque ordinateur.
;;liste_des_joeurs dd 1,0,0
;; dd 0,0,0
;
;xor ebp,ebp
;
;mov esi,offset liste_des_joeurs
;mov ecx,[nombre_de_dyna] ; dd 2 ;en tout.. pour le master
;sauver_de_moi_meme:
;or ecx,ecx
;jz fini
;dec ecx
;;cmp dword ptr [esi],0
;;je fini
;
;
;cmp dword ptr [esi+4],0 ;regarde si le joueur en question est en local. sinon il faut
; ;récupérer l'info par communication avec l'ordinateur.
;je cest_en_local
;
;cmp dword ptr [esi+8],0 ;regarde si on aurait pas deja récupéré le packet..
; ;(vrai si offset dans le packet <> 0...)
;jne cest_en_local ;deja fait...
;
;;communication. (si le packet n'est pas deja chargé...)
;;**************************************************************************
;ytytytytttttttttttttttttttttt:
;PUSHALL
;mov esi,[esi+4] ;offset liste_adresse ;récupere l'adresse de l'ordy ou on envois... ;offset adresse
;mov ebp,offset packed_data ;donnee
;;call envois
;;envois special bloc total...
;envois3 ecb2 header_envois socket_jeu
;POPALL
;;call ecoute
;ecoute2 ecb1 recu_data header_ecoute touches_size socket_jeu
;
;xor ax,ax
;erzertrteertertert1:
;
; /********************************************************\
;cmp byte ptr [clavier+59],1 ;F1... donne la periode d'attente pour la comm
; ;avec un ordy...
;jne reertertertertertert
;;- raster vert -
;inc ax
;push dx ax
; mov dx,3c8h
;push ax
; xor ax,ax
; out dx,al
; mov dx,3c9h
; out dx,al
;pop ax
; out dx,al
;xor ax,ax
; out dx,al
;pop ax dx
;;- raster vert -
;reertertertertertert:
;; \********************************************************/
;cmp byte ptr [sortie],1 ;eSC.
;je rtyrtyrtyretertdgrfgdtrdfgdfgdfg
;cmp byte ptr [ecb1+8],0
;jne erzertrteertertert1
;;
;call raster2
;rtyrtyrtyretertdgrfgdtrdfgdfgdfg:
;;-------
;PUSHALL
;mov ax,gs
;mov es,ax
;;recu_data db '??????????????????????????????????????????????????????????????',10,13,'$'
;mov esi,offset recu_data
;mov edi,offset donnee2
;mov ecx,6*4*4
;rep movsb
;POPALL
;
;;**************************************************************************
;cest_en_local:
;
;push esi
;mov esi,[esi+8] ;récupere l'offet du packet en question.
;add esi,offset donnee2 ;packet
;
;;entrée. ebp ;numéro CENTRAL d'un joeur.
;
;call packet_to_central ;modifie les valeurs du central a partir des
; ;deplacement d'un dyna.
;pop esi
;;------------------------------------------
;add ebp,4
;add esi,32
;jmp sauver_de_moi_meme
;fini:
;POPALL
;ret
;endp
possible_ou_pas proc near ;dx add x, cx: add y
PUSHALL
;add [donnee+nb_dyna*2+ebp],1 Y
;xy_to_offset
;lea esi,[truc+eax]
xor eax,eax
mov ax,[donnee+ebp] ;x !!!!
add ax,dx
add ax,3
shr ax,4
xor ebx,ebx
mov bx,[donnee+nb_dyna*2+ebp] ;Y !!!!
add bx,14
add bx,cx
;shr bx,4
and bx,01111111111110000B
shl bx,1 ;*32
mov esi,offset truc
add esi,ebx
add esi,eax
cmp byte ptr [esi],0
jne zerrzerzeerzer
;;1 = bombe... (2,3,4) respirant... si c sup a 4; on est mort...
cmp byte ptr [esi+32*13],1
jb efrerrereterter
cmp byte ptr [esi+32*13],4
ja efrerrereterter
add ebp,ebp
cmp [last_bomb+ebp],esi
je efrerrereterter
;--- ya une bombe+c'est pas la derniere case !!! essaye de la pousser ---
cmp [pousseur+ebp],1
jne zerrzerzeerzer
PUSHALL
cmp dx,0
je pas_eee
jns tjyuyu6754oooi
mov ax,-1
tjyuyu6754oooi:
cmp dx,0
js tjyuyu6754oooir
mov ax,1
tjyuyu6754oooir:
mov ecx,0
call pousse_la_bombe
jmp okeeeeeyiui
pas_eee:
cmp cx,0
je pas_eeerty
jns tjyuyu6754oooirr
mov ax,-1
tjyuyu6754oooirr:
cmp cx,0
js tjyuyu6754oooirt
mov ax,1
tjyuyu6754oooirt:
mov ecx,2
call pousse_la_bombe
pas_eeerty:
okeeeeeyiui:
POPALL
jmp zerrzerzeerzer
efrerrereterter:
xor cx,cx ;retourne jz=vrai
POPALL
ret
zerrzerzeerzer:
mov cx,1
or cx,cx ;retourne jz=faux
POPALL
ret
endp
;mov si,-16 ; ;16 ;8 haut.
;call remet_milieu_x
remet_milieu_x proc near ;replace le sprite au milieu d'un case.
PUSHALL
xor ebx,ebx
mov bx,[donnee+ebp] ;x !!!!
add bx,3
;------------------
and bx,01111B
cmp bx,7
je iookokokokok_deja_milieux
;dx add x, cx: add y
mov dx,0 ;X
mov cx,si ;Y
call possible_ou_pas
jnz ertertirtyrtyyrtrtyrtyxer ;impossible.
;il n'y a rien juste au dessus/sous. remet vers le milieu...
eheheh_mur:
cmp bx,7
ja zererzerrteertrterteert
inc word ptr [donnee+ebp] ;x !!!!
xor cx,cx ;retourne jz=vrai
POPALL
ret
zererzerrteertrterteert:
dec word ptr [donnee+ebp] ;x !!!!
xor cx,cx ;retourne jz=vrai
POPALL
ret
;---------- ya kekchoz en dessous/sus
ertertirtyrtyyrtrtyrtyxer:
push ebp
add ebp,ebp
mov [avance+ebp],0 ;=0 PAS reussit a bouger
pop ebp
cmp bx,7
ja uzererzerrteertrterteert
;dx add x, cx: add y
mov dx,-16 ;X
mov cx,si ;Y
call possible_ou_pas
jnz eheheh_mur
;dx add x, cx: add y
mov dx,-16 ;X
mov cx,0 ;Y
call possible_ou_pas
jnz eheheh_mur
dec word ptr [donnee+ebp] ;x !!!!
xor cx,cx ;retourne jz=vrai
POPALL
ret
uzererzerrteertrterteert:
mov dx,16
mov cx,si ;16 ;8
call possible_ou_pas
jnz eheheh_mur
mov dx,16 ;0
mov cx,0 ;si ;16 ;8
call possible_ou_pas
jnz eheheh_mur
inc word ptr [donnee+ebp] ;x !!!!
xor cx,cx ;retourne jz=vrai
POPALL
ret
iookokokokok_deja_milieux:
mov cx,1
or cx,cx ;retourne jz=faux
POPALL
ret
endp
remet_milieu_y proc near ;replace le sprite au milieu d'un case.
PUSHALL
xor ebx,ebx
mov bx,[donnee+nb_dyna*2+ebp] ;y !!!!
add bx,14 ;!
;------------------
and bx,01111B
cmp bx,7
je yiookokokokok_deja_milieux
;dx add x, cx: add y
mov dx,si
mov cx,0 ;16 ;8
call possible_ou_pas
jnz yertertirtyrtyyrtrtyrtyxer ;impossible.
impossible_2_fois:
;push ebp
;add ebp,ebp
;mov [avance+ebp],0 ;=0 PAS reussit a bouger
;pop ebp
cmp bx,7
ja yzererzerrteertrterteert
inc word ptr [donnee+nb_dyna*2+ebp] ;y !!!!
xor cx,cx ;retourne jz=vrai
POPALL
ret
yzererzerrteertrterteert:
dec word ptr [donnee+nb_dyna*2+ebp] ;y !!!!
xor cx,cx ;retourne jz=vrai
POPALL
ret
;---------- ya kekchoz en dessous
yertertirtyrtyyrtrtyrtyxer:
push ebp
add ebp,ebp
mov [avance+ebp],0 ;=0 PAS reussit a bouger
pop ebp
cmp bx,7
ja yuzererzerrteertrterteert
mov dx,si
mov cx,-16
call possible_ou_pas
jnz impossible_2_fois
mov dx,0
mov cx,-16
call possible_ou_pas
jnz impossible_2_fois
dec word ptr [donnee+nb_dyna*2+ebp] ;y !!!!
xor cx,cx ;retourne jz=vrai
POPALL
ret
yuzererzerrteertrterteert:
mov dx,si
mov cx,16
call possible_ou_pas
jnz impossible_2_fois
mov dx,0
mov cx,16
call possible_ou_pas
jnz impossible_2_fois
inc word ptr [donnee+nb_dyna*2+ebp] ;y !!!!
xor cx,cx ;retourne jz=vrai
POPALL
ret
yiookokokokok_deja_milieux:
mov cx,1
or cx,cx ;retourne jz=faux
POPALL
ret
endp
nouvelle_partie proc near
PUSHALL
push ds
pop es
mov pauseur2,0
mov pause,0
mov pause2,50 ;interdiction de pause !!!
mov eax,[nombre_de_dyna]
push eax
shl eax,2
mov [nombre_de_dyna_x4],eax
pop eax
sub eax,8
neg eax
mov [nombre_de_monstres],eax
mov [nombre_de_monstres],eax
cmp [master],0
je trtyrtrtyrtyrtyrtyrtytyrrtyrtytyryrtrty2erte
POPALL
ret
;*************** QUE MASTER -******************
trtyrtrtyrtyrtyrtyrtytyrrtyrtytyryrtrty2erte:
mov ecx,8
mov edi,offset victoires
xor eax,eax
rep stosd
POPALL
ret
endp
nouvelle_manche proc near
PUSHALL
push ds
pop es
;mov attente_avant_adder_inser_coin,60*20
;bdraw666 db ' '
;bdraw1 dd ? ;32
mov inser_coin,120
mov viseur_ic2,4
mov adder_inser_coin,320*(67+50)
mov [viseur_sur_fond],0
mov [duree_vic],duree_vic2
mov [attente_avant_draw],attente_avant_draw2
mov [attente_avant_med],attente_avant_med2
mov [duree_draw],duree_draw2
mov [duree_med],duree_med2
mov [attente_nouveau_esc],0
mov [affiche_pal],1
mov [ordre2],''
mov [sortie],0
cmp [master],0
je trtyrtrtyrtyrtyrtyrtytyrrtyrtytyryrtrty2ert
POPALL
ret
;*************** QUE MASTER -******************
trtyrtrtyrtyrtyrtyrtytyrrtyrtytyryrtrty2ert:
mov word ptr bdraw666,'03'
mov bdraw1,60
mov adder_bdraw,50*320
mov balance_le_bdrawn,0
mov temps2,59
mov special_nivo_6,0
mov acceleration,0
mov in_the_apocalypse,0
mov nombre_de_vbl_avant_le_droit_de_poser_bombe,nombre_de_vbl_avant_le_droit_de_poser_bombe2
cmp nombre_de_dyna,1
jne fdlkjdfkljdfglkgdjf
mov nombre_de_vbl_avant_le_droit_de_poser_bombe,0
fdlkjdfkljdfglkgdjf:
push ax
mov al,team3_sauve
and al,3
mov team3,al
pop ax
;---- terrain ---
mov ebx,[viseur_liste_terrain] ;dd 0
mov al,[liste_terrain+ebx]
mov [terrain],al
inc [viseur_liste_terrain]
cmp [liste_terrain+1+ebx],66
jne coolio
mov [viseur_liste_terrain],0
coolio:
;------------------
;;SI PLAY, terrain dans le header !!! + variable "changement" -------
cmp action_replay,2
jne ertrtertertyetyuyutyut
;cmp nombre_de_vbl_avant_le_droit_de_poser_bombe,0
;jne erterertrtertetertyutyuyuttyuuty
mov team3,0
push eax
;mov eax,fs:[1966080+TAILLE_HEADER_REC-9] ;variable changement
mov esi,replayer_saver4
mov eax,fs:[esi+TAILLE_HEADER_REC-9] ;variable changement
BIGENDIANPATCH eax
mov [changement],eax
;mov byte ptr al,fs:[1966080+TAILLE_HEADER_REC-1] ;1er octet: le numero du terrain
mov byte ptr al,fs:[esi+TAILLE_HEADER_REC-1] ;1er octet: le numero du terrain
mov [terrain],al
pop eax
ertrtertertyetyuyutyut:
;mov temps,duree_match
;push ax
;mov al,team3_sauve
;mov team3,al
;pop ax
cmp [team3],0
jne etrtyertyrdfgdfggdffgdgdfgy
PUSHALL
lea esi,n_team
lea edi,team
mov ecx,9
rep movsd
POPALL
etrtyertyrdfgdfggdffgdgdfgy:
cmp [team3],2
jne etrtyertyrdfgdfggdffgdgdf
PUSHALL
lea esi,s_team
lea edi,team
mov ecx,9
rep movsd
POPALL
etrtyertyrdfgdfggdffgdgdf:
cmp [team3],1
jne etrtyertyrdfgdfggdffgdgdfE
PUSHALL
lea esi,c_team
lea edi,team
mov ecx,9
rep movsd
POPALL
etrtyertyrdfgdfggdffgdgdfE:
;--- recup la duree du match en fonction du terrain
xor ebx,ebx
mov bl,terrain
dec bl
shl ebx,2
mov eax,[ebx+kelle_duree]
mov temps,ax
;----------------------------------------------------------
mov edi,offset total_t
xor eax,eax
mov ecx,(64/4)*8
rep stosd
lea edi,total_play
xor eax,eax
mov ecx,64/4
rep stosd
xor eax,eax
mov ecx,8 ;nb_dyna
lea edi,touches_save
rep stosd
;-------------------------------------------- données ...
mov edi,offset donnee
xor ebx,ebx
mov bl,terrain
dec bl
shl ebx,2
mov esi,[ebx+kelle_donnee]
;donnee_s_neige dw 20,20,277,277-32,116-16-16,116,180+16+16,180 ;x du dynablaster
; dw 9,170,9,170,41,137,41,137-16-16 ;y du dynablaster
;--- X/Y avec rotation pour changer la place des dyna..
xor edx,edx
mov edx,[changement]
and edx,01111B ;
shl edx,5 ;*32
;******** ACTION REPLAY--------------------
; si play
cmp action_replay,2
jne pashjktrkhjerterttyr
push esi
mov esi,replayer_saver4
mov edx,dword ptr fs:[esi+TAILLE_HEADER_REC-5] ;rotation, offet 1 dans le header !
pop esi
BIGENDIANPATCH edx
pashjktrkhjerterttyr:
mov ecx,8
oooiiooiioio:
mov ebx,[random_place+edx]
mov ax,word ptr [esi+ebx]
mov word ptr [edi],ax
mov ax,word ptr [esi+ebx+8*2]
mov word ptr [edi+8*2],ax
add edi,2
add edx,4
dec ecx
jnz oooiiooiioio
add esi,8*4
add edi,8*2
;------
mov ecx,8*14
rep movsb
mov edi,offset liste_couleur
mov ecx,8
rep movsd
lea edi,nombre_de_coups
mov ecx,8
rep movsd
mov edi,offset infos_j_n
mov ecx,5
rep movsd
lea edi,infos_m_n
mov ecx,5*8
rep movsd
lea edi,invinsible
mov ecx,8
rep movsd
lea edi,blocage
mov ecx,8
rep movsd
mov ecx,[nombre_de_dyna]
lodsd
lea edi,invinsible
rep stosd
mov ecx,[nombre_de_dyna]
lodsd
lea edi,blocage
rep stosd
lea edi,pousseur
mov ecx,8
rep movsd
lea edi,vitesse_monstre
mov ecx,8
rep movsd
mov ecx,[nombre_de_dyna]
lodsd
lea edi,pousseur
rep stosd
mov ecx,[nombre_de_dyna]
lodsd
lea edi,patineur
rep stosd
lea edi,correspondance_bonus
mov ecx,32/4
rep movsd
;info j.
mov edi,offset j1
mov ecx,[nombre_de_dyna]
;--- 1
push ecx
koaiouiouiouiououiuio:
mov eax,[infos_j_n]
stosd
mov eax,[infos_j_n+4]
stosd
mov eax,[infos_j_n+8]
stosd
mov eax,[infos_j_n+12]
stosd
mov eax,[infos_j_n+16]
stosd
dec ecx
jnz koaiouiouiouiououiuio
pop ecx
mov eax,ecx
sub ecx,8
neg ecx
or ecx,ecx
jz centralol
;--- 8 POUR LES MONSTRES !!!
lea esi,infos_m_n
;on doit ajouter (4*5)*nombre joueurs en offset
erterertertert:
add esi,4*5
dec eax
jnz erterertertert
monstro4:
;mov eax,[infos_m_n]
;stosd
push ecx
mov ecx,5
rep movsd
pop ecx
;mov eax,[infos_m_n+4]
;stosd
;movsd
;mov eax,[infos_m_n+8]
;stosd
;movsd
;mov eax,[infos_m_n+12]
;stosd
;movsd
;xor eax,eax
;stosd
;movsd
;---
dec ecx
jnz monstro4
centralol:
;-- transforme les monstres par défaux en dynas ...
mov esi,offset s_normal
lea edi,donnee+8*6
mov ecx,[nombre_de_dyna]
rep movsd
lea esi,liste_couleur_normal
lea edi,liste_couleur ;(= donnee+8*18)
mov ecx,[nombre_de_dyna]
rep movsd
mov esi,offset l_normal
lea edi,donnee+8*10
mov ecx,[nombre_de_dyna]
rep movsw
mov esi,offset c_normal
lea edi,donnee+8*12
mov ecx,[nombre_de_dyna]
rep movsw
mov esi,offset a_normal
lea edi,donnee+8*14
mov ecx,[nombre_de_dyna]
rep movsd
lea esi,r_normal
lea edi,nombre_de_coups
mov ecx,[nombre_de_dyna]
rep movsd
i:
;donnee_s_neige dw 20,20,277,277-32,116-16-16,116,180+16+16,180 ;x du dynablaster
; 2 dw 9,170,9,170,41,137,41,137-16-16 ;y du dynablaster
; 4 dw 24*0,777,24*2,24*3,24*4,24*5,24*6,24*7 ;source du dyna
; 6 dd 512000,512000,512000,512000,512000,512000,512000,512000 ;source bloque memoire
; 10 dw 32,32,32,32,32,32,32,32 ;nombre de lignes pour un dyna...
; 12 dw 32,32,32,32,32,32,32,32 ;nombre de colonnes.
; 14 dd -9*320-4,-9*320-4,-9*320-4,-9*320-4,-9*320-4,-9*320-4,-9*320-4,-9*320-4 ;adder di
; 18 dd offset grosbleu,offset grosbleu,offset grosbleu,offset grosbleu,offset grosbleu,offset grosbleu,offset grosbleu,offset grosbleu
;
;;avec un dyna...
;liste_couleur_normal dd blanc,offset bleu,offset vert,offset rouge,offset blancg,offset bleug,offset vertg,offset rougeg
;
;; dw 20,20,277,277,116,116,180,180 ;x du dynablaster
;; dw 9,170,9,170,41,137,41,137 ;y du dynablaster
;; dw 24*0,777,24*2,24*3,24*4,24*5,24*6,24*7 ;source du dyna dans bloque
;; 64000*8
;s_normal dd 512000,576000,576000,576000,640000,640000,640000,640000 ;source bloque memoire
;l_normal dw 23,23,23,23,25,25,25,25 ;nombre de lignes pour un dyna...
;c_normal dw 32,23,23,23,23,23,23,23 ;nombre de colonnes.
;a_normal dd 0,0,0,0,-3*320,-3*320,-3*320,-3*320 ;adder di (pour la girl + grande...)
;-----------------------------------
;briques dw 1+19*13*2 dup (?) ;nombre de brique, source de la brique, destination
; ;dans buffer video
;bombes dw 1+19*13*2 dup (?) ; pareil pour les bombes & explosion & bonus
xor eax,eax
mov edi,offset briques
mov ecx,1+19*13*2
rep stosw
mov edi,offset bombes
mov ecx,1+19*13*2
rep stosw
mov edi,offset maladie
mov ecx,8
rep stosd
lea edi,clignotement
mov ecx,8
rep stosd
lea edi,tribombe
mov ecx,8
rep stosd
lea edi,tribombe2
mov ecx,8
rep stosd
lea edi,lapipipino ;pour pu kil soit considere comme un lapin
mov ecx,8
rep stosd
lea edi,lapipipino2 ;pour pu kil soit considere comme un lapin
mov ecx,8
rep stosd
lea edi,lapipipino3 ;pour pu kil soit considere comme un lapin
mov ecx,8
rep stosd
lea edi,lapipipino4 ;pour pu kil soit considere comme un lapin
mov ecx,8
rep stosd
lea edi,lapipipino5 ;pour pu kil soit considere comme un lapin
mov ecx,8
rep stosd
lea edi,lapipipino6 ;pour pu kil soit considere comme un lapin
mov ecx,8
rep stosd
xor ebx,ebx
mov bl,terrain
dec bl
shl ebx,2
mov esi,[ebx+kelle_truc]
mov edi,offset truc
mov ecx,32*13
rep movsb
;--
xor ebx,ebx
mov bl,terrain
dec bl
shl ebx,2
mov esi,[ebx+kelle_bonus]
mov edi,offset truc2
mov ecx,32*13
rep movsb
;---
;liste_bombe dd ? ; nombre de bombes...
; dd 247 dup (?,?,?,?)
mov edi,offset liste_bombe
mov ecx,1+247*(taille_dune_info_bombe/4)
rep stosd
;touches dd nb_dyna dup (0)
;action, touches d'action appuyés pour chacun des joeurs...
;
;ACTION dw nb_dyna dup (0,0)
lea edi,avance2
mov eax,1
mov ecx,8
rep stosd
mov edi,offset touches
xor eax,eax
mov ecx,8
rep stosd
xor eax,eax
mov edi,offset action
mov ecx,8
rep stosd
;-------- choisit une apocalypse en fonction du terrain...
;lea esi,truc_fin_s
push ebx
mov bl,terrain
dec bl
shl ebx,2
mov esi,[ebx+kelle_apocalypse]
pop ebx
lea edi,truc_fin
mov ecx,13*32+4
rep movsb
;------------------------------- eax: -1
mov edi,offset vie
mov ecx,8
mov eax,1
rep stosd
;fabrique un last_bomb pour chaque dyna...(par rapport a la position de debut)
xor ebp,ebp
a6ans:
PUSHALL
push ebp
xy_to_offset
pop ebp
lea esi,[truc+eax]
mov [last_bomb+ebp],esi
POPALL
add ebp,4
cmp ebp,4*8
jne a6ans
;mov [nomonster],1
cmp action_replay,0
jne nonononpasmode
cmp nomonster,1
jne nonononpasmode
; jne nononono_onest_en_recordplay
;cmp twice,1
;jne nononono_onest_en_recordplay
;shr ecx,1
;nononono_onest_en_recordplay:
;----- tue tout le monde-
;cmp byte ptr [clavier+88],1 ;F12
;jne ertretetertertrte
mov edi,offset vie
xor ebp,ebp
mov ecx,[nombre_de_dyna]
retrteertertert:
or ecx,ecx
jz ljkljkmjkljklmljk
dec ecx
jmp trttyyrryrrryryryryr
ljkljkmjkljklmljk:
mov dword ptr [edi+ebp],14
trttyyrryrrryryryryr:
add ebp,4
cmp ebp,8*4
jnz retrteertertert
;ertretetertertrte:
nonononpasmode:
cmp action_replay,0 ;1
je pas_action
mov liste_bombbbb2,0
mov attente_entre_chake_bombe,0
mov viseur__nouvelle_attente_entre_chake_bombe,0
;viseur_change_in dd 0,4,8,12,16,20,24,28
PUSHALL
lea edi,avance
xor eax,eax
mov ecx,8
rep stosd
;viseur_change_in dd 0,4,8,12,16,20,24,28
;viseur_change_in_save dd 0,4,8,12,16,20,24,28 ;pour replay
lea esi,viseur_change_in_save
lea edi,viseur_change_in
xor eax,eax
mov ecx,8
rep movsd
POPALL
;STRUTURE DE REC:
TAILLE_HEADER_REC EQU 32
TAILLE_BONUS_REC EQU 256
;---------- REC ou -------------
;PUSHALL ;hazard indesirable :) kan on enregistre :)
;push ds
;pop es
;lea edi,avance2
;mov eax,1
;mov ecx,8
;rep stosd
;POPALL
;si on rec, on initialise la veriable ki contiendra a la fin le nombre
; total de "tours"
;mov byte ptr fs:[1966080+TAILLE_HEADER_REC],1
;mov dword ptr fs:[1966080+TAILLE_HEADER_REC+TAILLE_BONUS_REC],4
pas_action:
;------------------------------
;(1582080+64000*6) 64000K réservé pour sauvegarde
POPALL
ret
endp
rec_play_touches proc near
PUSHALL
;***********************************************
; PLAY !!! é>
;***** ...
cmp action_replay,2
jne pas_rec4
;******
;cmp economode,1
;je rertterterrtertytyrrtyrtyrtyrtyrtyrtyrty
;cmp economode,1
;je erererjhrejhreerlhehelej
cmp special_on_a_loadee_nivo,2 ;bizarrerie pour sortir a la fin du play
;car on a fin un load mrb
jne rertterterrtertytyrrtyrtyrtyrtyrtyrtyrty
erererjhrejhreerlhehelej:
mov [sors_du_menu_aussitot],1
rertterterrtertytyrrtyrtyrtyrtyrtyrtyrty:
;*********
;total_play db 0,0,0,0 ,0,0 ;1er joeur d'un ordy.
; db 0,0,0,0 ,0,0 ;2eme joeur d'un ordy
; db 0,0,0,0 ,0,0 ;3eme joeur d'un ordy
; db 0,0,0,0 ,0,0 ;4eme joeur d'un ordy
; db 0,0,0,0 ,0,0 ;5emejoeur d'un ordy.
; db 0,0,0,0 ,0,0 ;6eme joeur d'un ordy
; db 0,0,0,0 ,0,0 ;7eme joeur d'un ordy
; db 0,0,0,00 ,0,0 ;8eme joeur d'un ordy
; db 0,0
mov ebp,replayer_saver
;BIGENDIANPATCH ebp
xor ebx,ebx
lea esi,total_play
mov ecx,replayer_saver3
iencoermnjklrtrtytyuyuisdfgrht345:
;mov al,byte ptr fs:[1966080+TAILLE_HEADER_REC+TAILLE_BONUS_REC+ebp]
push esi
mov esi,replayer_saver4
mov al,byte ptr fs:[esi+TAILLE_HEADER_REC+TAILLE_BONUS_REC+ebp]
pop esi
mov byte ptr [esi+ebx],0
test al,0000001B
jz bhrebherterteeeeee
mov byte ptr [esi+ebx],1
bhrebherterteeeeee:
mov byte ptr [esi+ebx+1],0
test al,0000010B
jz bhrebherterteeeeeei
mov byte ptr [esi+ebx+1],1
bhrebherterteeeeeei:
mov byte ptr [esi+ebx+2],0
test al,0000100B
jz bhrebherterteeeeeeii
mov byte ptr [esi+ebx+2],1
bhrebherterteeeeeeii:
mov byte ptr [esi+ebx+3],0
test al,0001000B
jz bhrebherterteeeeeeiii
mov byte ptr [esi+ebx+3],1
bhrebherterteeeeeeiii:
mov byte ptr [esi+ebx+4],0
test al,0010000B
jz bhrebherterteeeeeeooo
mov byte ptr [esi+ebx+4],1
bhrebherterteeeeeeooo:
mov byte ptr [esi+ebx+5],0
test al,0100000B
jz bhrebherterteeeeeep
mov byte ptr [esi+ebx+5],1
bhrebherterteeeeeep:
mov byte ptr [esi+ebx+6],0
test al,01000000B
jz bhrebherterteeeeeept
mov byte ptr [esi+ebx+6],1
bhrebherterteeeeeept:
;xor ah,ah
;mov al,byte ptr [esi+5]
;shl al,5
;or ah,al
;mov al,byte ptr [esi+4]
;shl al,4
;or ah,al
;mov al,byte ptr [esi+3]
;shl al,3
;or ah,al
;mov al,byte ptr [esi+2]
;shl al,2
;or ah,al
;mov al,byte ptr [esi+1]
;shl al,1
;or ah,al
;mov al,byte ptr [esi]
;or ah,al
;mov byte ptr fs:[1966080+TAILLE_HEADER_REC+TAILLE_BONUS_REC+ebp],ah
inc ebp
add ebx,7
;cmp ebx,6*8
;
dec ecx
jnz iencoermnjklrtrtytyuyuisdfgrht345
;BIGENDIANPATCH ebp
mov replayer_saver,ebp
;----------- ;pour sortir si un slave press return... (euh en fait sil presse
;cmp temps_avant_demo,1
;je rertttttttttttttttttttttt345
touche_presse sortie 1
cmp sortie,1
jne rertttttttttttttttttttttt345
push eax
mov eax,ttp
mov temps_avant_demo,eax
pop eax
rertttttttttttttttttttttt345:
;-------
dec replayer_saver2
jnz continueeeee
;--
;cmp economode,2
;jne non_non_pas_en_mode_truc
;mov [sors_du_menu_aussitot],0
;mov economode,1
;non_non_pas_en_mode_truc:
;--
mov [sortie],1 ;on sort !
continueeeee:
;mov temps_avant_demo,ttp2
;----------
;control_joueur dd 8 dup (0) ;-1,6,32,32+6,-1,-1,-1,-1
;
;total_t db 0,0,0,0 ,0,0 ;1er joeur d'un ordy.
; db 0,0,0,0 ,0,0 ;2eme joeur d'un ordy
; db 0,0,0,0 ,0,0 ;3eme joeur d'un ordy
; db 0,0,0,0 ,0,0 ;4eme joeur d'un ordy
; db 0,0,0,0 ,0,0 ;5emejoeur d'un ordy.
; db 0,0,0,0 ,0,0 ;6eme joeur d'un ordy
; db 0,0,0,0 ,0,0 ;7eme joeur d'un ordy
; db 0,0,0,0 ,0,0 ;8eme joeur d'un ordy
; db 0,0
pas_rec4:
POPALL
ret
endp
;affichage_rec proc near
;PUSHALL
;xor ax,ax
;mov al,byte ptr fs:[1966080+TAILLE_HEADER_REC]
;call affsigne
;mov al,byte ptr fs:[1966080+TAILLE_HEADER_REC+1]
;call affsigne
;mov al,byte ptr fs:[1966080+TAILLE_HEADER_REC+2]
;call affsigne
;mov eax,dword ptr fs:[1966080+TAILLE_HEADER_REC+TAILLE_BONUS_REC]
;call num
;xor eax,eax
;mov al,byte ptr fs:[1966080+TAILLE_HEADER_REC-1] ;1er octet: le numero du terrain
;call affsigne
;POPALL
;ret
;endp
load_gus proc near
PUSHALL
;BOOM IFF 10,783 08-06-97 4:36a
;BANG IFF 8,046 08-06-97 10:26a
;KLANNG IFF 9,373 08-06-97 10:27a
;
;del iff.dat
;copy /B BOOM.IFF+BANG.IFF+KLANNG.IFF iff.Dat
mov edi,offset iff_liste
mov eax,[total_liste]
uencoremasuperdeliredemaker:
cmp dword ptr [edi],-1
je ufinitobabyr
add dword ptr eax,[edi]
mov dword ptr [edi],eax
add edi,4
jmp uencoremasuperdeliredemaker
ufinitobabyr:
xor ebp,ebp
mov eax,4
tyu:
mov ecx,[iff_liste+ebp]
cmp ecx,-1
je ooo
PUSHALL
; call LOAD_BONUS_SAMPLE
POPALL
add ebp,4
add eax,4
jmp tyu
ooo:
;ECX: OFFSET
;! dans EaX NUMERO DU SAMPLE *4 !
;MOV BP,32*4
;mov byte ptr [BLOW_WHAT],8 ;8*4
;mov byte ptr [BLOW_WHAT+1],40
;mov byte ptr [BLOW_WHAT+12],2 ;8*4
;mov byte ptr [BLOW_WHAT+13],30
;mov byte ptr [BLOW_WHAT],073h ;4 bits:panning, 4 bits: sample
;mov byte ptr [BLOW_WHAT+1],40 ;0 droite. ici. F left
POPALL
ret
endp
init_packed_liste proc near
PUSHALL
mov edi,offset packed_liste
mov eax,taille_exe_gonfle
encoremasuperdeliredemaker:
cmp dword ptr [edi],-1
je finitobabyr
add dword ptr eax,[edi]
mov dword ptr [edi],eax
add edi,4
jmp encoremasuperdeliredemaker
finitobabyr:
mov [total_liste],eax
POPALL
ret
init_packed_liste endp
menu proc near
PUSHALL
;regarde si le dernier packet est un packet de menu.. ou non...
; si c'est on est pas master...
;;cmp [master],1
;;jne erttrtyrtrtyrtyrtyrtyrtytyrrtyrtytyryrtrty2r
;;
;;;cmp dword ptr [packed_data+1],'unem'
;;;je retttttttttttt
;;POPALL
;;ret
;retttttttttttt:
;erttrtyrtrtyrtyrtyrtyrtytyrrtyrtytyryrtrty2r:
; db 'menu' ;pout reconnaitre ou on est... enfin si c'est un packet
;sound_menu
;mov edi,896000+64000*3 ; 128000 ;307200
;---- affiche le PIC.PCX -----------------------------------------------
cmp [master],0
jne reerttrtyrtrtyrtyrtyrtyrtytyrrtyrtytyryrtrty2R
cmp [pic_time],0
jz reerttrtyrtrtyrtyrtyrtyrtytyrrtyrtytyryrtrty2R
dec [pic_time]
cmp [pic_time],16
jne erterertyyuuutyutyutyutyutyutyutyuty
mov [affiche_pal],1
erterertyyuuutyutyutyutyutyutyutyuty:
cmp [pic_time],17 ;RE quitte pas pendant k'on efface la palette
jb erttertertertertert
cmp [pic_time],pic_max-34 ;quitte pas avant k'on ait la pallette affiché
ja erttertertertertert ;
;cmp [last_sucker],0 ;derniere touche...
;je erttertertertertert
touche_presse pic_time 17
;mov [pic_time],17 ;accélere le processus...
erttertertertertert:
;cmp [assez_de_memoire],1
;je affiche_pas_
mov esi,896000+64000*1 ;896000+64000*3
;cmp kel_pic_intro,1
;jne opiopiioiouuiiuiuiuooorytyyryrtt
;mov esi,1966080+64000*21
;opiopiioiouuiiuiuiuooorytyyryrtt:
;===== affiche en ram video ce k'il y a a : FS:ESI
; ENTREE : ESI
ramesi
;copyblock
copyblock
call aff_page2 ;affiche en ram video ce k'il y a a dans le buffer
;affiche_pas_:
POPALL
ret
reerttrtyrtrtyrtyrtyrtyrtytyrrtyrtytyryrtrty2R:
;---------------------------------------------------------------------------
;cmp [assez_de_memoire],1
;je erettererttrtyrtyyrtrty
push es
cmp [last_sucker], 0
jne kjhkjhfhgfhgfhgfghfghfhgfhgfhgfhgfhgfghf
mov esi,896000+64000*3
;===== affiche en ram video ce k'il y a a : FS:ESI
; ENTREE : ESI
mov esi,64000*4
ramesi
copyblock
kjhkjhfhgfhgfhgfghfghfhgfhgfhgfhgfhgfghf:
mov ax,ds
mov es,ax
;call copie_bande
;mov edi,offset buffer
;xor eax,eax
;mov ecx,16000
;rep stosD
call scroll
mov [viseur_couleur],0
;------ premiere barre.
;mov esi,64000*4+58*320
;mov edi,offset buffer
;push edi
;copie 80*71
;pop edi
;lea edi,buffer+(30*320+36*320+14+320*3+2)
lea edi,buffer+(30*320+36*320+14+320*3+2-06+2+320*08+1)
mov ebx,offset texte1
mov ecx,4
rrteertertrteert:
PUSHALL
;---- edi: viseur sur ou ecrire
; ebx:texte
;------
mov eax,[scrollyf]
and eax,001100000B
add ebx,eax
call aff_texte
POPALL
add ebx,32*4
inc [viseur_couleur]
add edi,80
dec ecx
jnz rrteertertrteert
;------ deuxieme barre.
;mov esi,64000*4+129*320
;mov edi,offset buffer+100*320
;push edi
;copie 80*71
;pop edi
;lea edi,buffer+(101*320+36*320+14+320*3+2)
lea edi,buffer+(101*320+36*320+14+320*3+2-06+2+320*08+1)
mov ebx,offset texte1+32*4*4
mov ecx,4
oorrteertertrteert:
PUSHALL
;---- edi: viseur sur ou ecrire
; ebx:texte
;------
mov eax,[scrollyf]
and eax,001100000B
add ebx,eax
call aff_texte
POPALL
add ebx,32*4
inc [viseur_couleur]
add edi,80
dec ecx
jnz oorrteertertrteert
;.............................................................................
pop es
call aff_page2 ;affiche en ram video ce k'il y a a dans le buffer
POPALL
ret
erettererttrtyrtyyrtrty:
;pas assez de mémoire...
POPALL
ret
aff_lettre:
push ecx
mov ecx,6
oertterertertertert:
push ebx
;couleur db 62,3,224,28,65,160,28,3
mov ebx,es:[viseur_couleur] ;db 0
cmp es:[ordre2],'Z' ; médaille distribution
jne rertetyutyuyuttuyyuttyu
mov bl,es:[couleur+ebx]
jmp rtyutyuyuttyutyuyutyutyut
rertetyutyuyuttuyyuttyu:
mov bl,es:[couleur_menu+ebx]
rtyutyuyuttyutyuyutyutyut:
crocro
crocro
crocro
crocro
crocro
crocro
crocro
crocro
pop ebx
add edi,320-8
add esi,320-8
dec ecx
jnz oertterertertertert
pop ecx
ret
aff_texte:
mov edx,3
reretertertrte:
mov ecx,6
ererrteertertertertert:
call affiche_un_caractere
add edi,8
dec ecx
jnz ererrteertertertertert
add edi,320*10-8*6
dec edx
jnz reretertertrte
ret
rerteertertertertertrteertertretrerertertert:
inc ebx
jmp rtrtytyryrtrtysepcialespace
affiche_un_caractere:
push edi ds
;mov esi,offset buffer3+165*320
mov esi,1582080+64000*5+165*320 ;offset buffer3
push fs
pop ds
;-- selectionne lettre
xor eax,eax
mov al,byte ptr es:[ebx]
cmp al,' '
je rerteertertertertertrteertertretrerertertert
cmp al,'z'+13 ;special pour le menu... espace dans nom d'un joueur...
je rerteertertertertertrteertertretrerertertert
cmp al,'?'
jne erttrerteertertertertertrteertertretrerertertertyyfr
;mov esi,223+171*320
mov esi,1582080+64000*5+232+8*3+172*320 ;[buffer3+232+8*3+172*320]
jmp reerertrteertertrteertrtertertrteert
erttrerteertertertertertrteertertretrerertertertyyfr:
;cmp al,'-'-'a'
;jne tderterterertZtr
;mov ax,304/8
;jmp rtrtyrtyrty
;tderterterertZtr:
cmp al,'-' ;curseur...
jne erttrerteertertertertertrteertertretrerertertertyyfrt
;mov esi,223+171*320
mov esi,1582080+64000*5+167*320+304 ;[buffer3+167*320+304]
sub edi,320*3
jmp reerertrteertertrteertrtertertrteert
erttrerteertertertertertrteertertretrerertertertyyfrt:
sub al,'a'
cmp al,'!'-'a'
jne erterterert
mov ax,288/8
jmp rtrtyrtyrty
erterterert:
cmp al,'.'-'a'
jne erterterertZ
mov ax,296/8
jmp rtrtyrtyrty
erterterertZ:
cmp al,':'-'a'
jne derterterertZ
mov ax,312/8
jmp rtrtyrtyrty
derterterertZ:
cmp al,'0'-'a'
jb rderterterertZ
add al,26-('0'-'a')
rderterterertZ:
rtrtyrtyrty:
shl ax,3
add esi,eax
reerertrteertertrteertrtertertrteert:
inc ebx
;----
call aff_lettre
rtrtytyryrtrtysepcialespace:
pop ds edi
ret
menu endp
scroll proc near
;---
inc [scrollyF]
;-- selectionne lettre
test dword ptr [scrollyF],0000000000111B
jnz trerteertertertertertrteertertretrerertertert
;223,171
xor eax,eax
mov ebx,offset tected
;-cmp [master],1
;-jne trtyrtrtyrtyrtyrtyrtytyrrtyrtytyryrtrty2R
;-mov ebx,offset tecte_sl
;-trtyrtrtyrtyrtyrtyrtytyrrtyrtytyryrtrty2R:
;-
add ebx,[tecte2]
inc [tecte2]
;tecte db 'abcedfghijklmnopq remdy is back é'
;tecte2 dd 0
mov al,byte ptr [ebx]
cmp al,02ah
jne dtrerteertertertertertrteertertretrererterterte
lea edx,tected
sub edx,offset tecte
neg edx
mov [tecte2],edx
;lea esi,[buffer3+223+171*320]
mov esi,1582080+64000*5+223+171*320 ;64000*5+165*320 ;offset buffer3
jmp reerertrteertertrteert
dtrerteertertertertertrteertertretrererterterte:
mov al,byte ptr [ebx]
cmp al,0dbh
jne dtrerteertertertertertrteertertretrerertertert
;mov [tecte2],0
lea edx,tected
sub edx,offset tecte
neg edx
mov [tecte2],edx
mov esi,1582080+64000*5+223+171*320 ;[buffer3++223+171*320]
cmp [master],1
jne reerertrteertertrteert
mov [tecte2],0
jmp reerertrteertertrteert
dtrerteertertertertertrteertertretrerertertert:
cmp al,' '
jne erttrerteertertertertertrteertertretrerertertert
;mov esi,223+171*320
mov esi,1582080+64000*5+223+171*320 ;[buffer3+223+171*320]
jmp reerertrteertertrteert
erttrerteertertertertertrteertertretrerertertert:
cmp al,'/'
jne erttrerteertertertertertrteertertretrererterterty
;mov esi,223+171*320
;,ea esi,[buffer3+232+172*320]
mov esi,1582080+64000*5+223+172*320-8+16
jmp reerertrteertertrteert
erttrerteertertertertertrteertertretrererterterty:
cmp al,'('
jne erttrerteertertertertertrteertertretrerertertertyr
;mov esi,223+171*320
;,lea esi,[buffer3+232+8+172*320]
mov esi,1582080+64000*5+223+8+172*320-8+16
jmp reerertrteertertrteert
erttrerteertertertertertrteertertretrerertertertyr:
cmp al,')'
jne erttrerteertertertertertrteertertretrerertertertyy
;mov esi,223+171*320
;lea esi,[buffer3+232+8*2+172*320]
mov esi,1582080+64000*5+223+8*2+172*320-8+16
jmp reerertrteertertrteert
erttrerteertertertertertrteertertretrerertertertyy:
cmp al,'?'
jne erttrerteertertertertertrteertertretrerertertertyyf
;mov esi,223+171*320
;lea esi,[buffer3+232+8*3+172*320]
mov esi,1582080+64000*5+223+8*3+172*320-8+16
jmp reerertrteertertrteert
erttrerteertertertertertrteertertretrerertertertyyf:
sub al,'a'
cmp al,'!'-'a'
jne terterterert
mov ax,288/8
jmp trtrtyrtyrty
terterterert:
cmp al,'.'-'a'
jne terterterertZ
mov ax,296/8
jmp trtrtyrtyrty
terterterertZ:
cmp al,':'-'a'
jne tderterterertZ
mov ax,312/8
jmp trtrtyrtyrty
tderterterertZ:
cmp al,'-'-'a'
jne tderterterertZt
mov ax,304/8
jmp trtrtyrtyrty
tderterterertZt:
cmp al,'0'-'a'
jb trderterterertZ
add al,26-('0'-'a')
trderterterertZ:
trtrtyrtyrty:
shl ax,3
;inc ebx
;lea esi,[buffer3+165*320+eax]
mov esi,1582080+64000*5+165*320
add esi,eax
reerertrteertertrteert:
;----
;call aff_lettre
;:,:test [changement],0000111B
push ds
push fs
pop ds
mov edi,offset scrolly+320
mov ecx,6
frrr:
movsd
movsd
add edi,320
add esi,320-8
dec ecx
jnz frrr
pop ds
;---
trerteertertertertertrteertertretrerertertert:
lea esi,scrolly+1 ; db 6*328 dup (01011101B)
lea edi,scrolly
mov ecx,328*6
rep movsb
lea esi,scrolly
mov edi,offset buffer+320*192
;4,5,6,7,8,9
mov edx,6
ddd:
mov ecx,320
;rep movsd
oooooooooi:
lodsb
or al,al
jz retertetyooo
mov es:[edi],al
retertetyooo:
inc edi
dec ecx
jnz oooooooooi
add esi,8
dec edx
jnz ddd
ret
endp
foo MACRO speed_bonus,i
local o2
cmp [last_bomb+i],eax
jne o2
cmp [vie+i],1 ;que les dyna vivants !!!!
jne o2
cmp word ptr [speed_bonus+i],0 ;pas si deja une maladie..
jne o2
cmp word ptr [lapipipino2+i],1 ;check kangaroo jump
je o2
cmp word ptr [lapipipino2+i],2 ;check kangaroo jump
je o2
mov word ptr [speed_bonus+i],bx ;maladie..
mov word ptr [speed_bonus+i+2],duree_conta
o2:
ENDM
conta MACRO speed_bonus,ebp
local reterterrtertert
local o2
;last_bomb dd 8 dup (?)
;speed_bonus dd 8 dup (?)
cmp word ptr [speed_bonus+ebp],0 ;regarde si on a une maladie a donner.
je reterterrtertert
cmp [vie+ebp],1 ;que les dyna vivants !!!!
jne reterterrtertert
mov eax,[last_bomb+ebp]
;--- regarde pour les autres si
mov bx,word ptr [speed_bonus+ebp] ;dans bx on a la maladie...
foo maladie,0
foo maladie,4
foo maladie,8
foo maladie,12
foo maladie,0+16
foo maladie,4+16
foo maladie,8+16
foo maladie,12+16
reterterrtertert:
ENDM
decrem MACRO speed_bonus,o
local ertertrterteterrteert
local ooo
cmp word ptr [speed_bonus+o+2],0 ;255 ; dd 8 dup (?)
je ertertrterteterrteert
dec word ptr [speed_bonus+o+2]
jmp ooo
ertertrterteterrteert:
mov [speed_bonus+o],0 ;annule la maladie..
ooo:
ENDM
contamination proc near
PUSHALL
decrem maladie,0
decrem maladie,4
decrem maladie,8
decrem maladie,12
decrem maladie,0+16
decrem maladie,4+16
decrem maladie,8+16
decrem maladie,12+16
conta maladie,0
conta maladie,4
conta maladie,8
conta maladie,12
conta maladie,0+16
conta maladie,4+16
conta maladie,8+16
conta maladie,12+16
POPALL
ret
endp
;copie_bande proc near
;PUSHALL
;mov ebx,[machin2]
;
;dec dword ptr [changementZZ2] ;000011000B
;jnz retterertrte
;mov dword ptr [changementZZ2],time_bouboule ;011000B
;add [machin2],4
;cmp [machin2],4*29*2-4
;jne retterertrte
;mov [machin2],0
;retterertrte:
;
;mov esi,[machin+ebx]
;add esi,[machin3]
;
;push ds
;pop es
;push fs
;pop ds
;add esi,896000+64000*4 ; 128000 ;307200
;lea edi,buffer
;mov edx,29
;ano:
;mov ecx,320/4
;rep movsd
;add esi,320
;dec edx
;jnz ano
;POPALL
;
;PUSHALL
;mov ebx,[machin2]
;sub ebx,4*29*2
;neg ebx
;dec dword ptr [changementZZ2] ;000011000B
;jnz retterertrtey
;;mov dword ptr [changementZZ2],time_bouboule ;011000B
;;add [machin2],4
;;cmp [machin2],4*29*2
;;jne retterertrtey
;;mov [machin2],0
;;retterertrtey:
;
;
;mov esi,[machin+ebx]
;add esi,[machin3]
;add esi,640*1
;push ds
;pop es
;push fs
;pop ds
;add esi,896000+64000*4 ; 128000 ;307200
;lea edi,buffer+173*320
;mov edx,27
;anoy:
;mov ecx,320/4
;rep movsd
;add esi,320
;dec edx
;jnz anoy
;POPALL
;
;ret
;copie_bande endp
horloge proc near
PUSHALL
;inc es:[changementzz]
;
test [temps],01000000000000000B
jz clignote
;test dword ptr es:[changementzz],00000100000B
;jnz affiche_pas_deuxpointR
POPALL
ret
clignote:
;temps dw 000200030000B ;time
mov bp,temps
;1 bit, 3 bit,4 bits
;temps db 10010001B ;time
push ds
pop es
push fs
pop ds
lea edi,buffer+320*183+277
push edi
xor eax,eax
mov ax,bp
shr ax,8
and ax,01111B
mov esi,896000+384000+46080+128000+83*320+80
shl eax,4
add esi,eax
SPRITE_16_11
mov esi,896000+384000+46080+128000+83*320+80+10*16
;lea edi,buffer+320*170+200+12
pop edi
push edi
add edi,12
test es:[temps],00100000000000000B
jnz affiche_pas_deuxpoint
SPRITE_16_5
affiche_pas_deuxpoint:
pop edi
;lea edi,buffer+320*170+200+12+6
push edi
add edi,12+6
xor eax,eax
mov ax,bp
shr ax,4
and ax,001111B
mov esi,896000+384000+46080+128000+83*320+80
shl eax,4
add esi,eax
SPRITE_16_11
pop edi
;,push edi
add edi,24+6
;lea edi,buffer+320*170+200+24+6
xor eax,eax
mov ax,bp
and ax,01111B
mov esi,896000+384000+46080+128000+83*320+80
shl eax,4
add esi,eax
SPRITE_16_11
POPALL
ret
endp
gestion_bdraw proc near
;test temps,000111111111111B
;jnz zerrezrezezrerrteerzerooo
;cmp in_the_apocalypse,0
;jne zerrezrezezrerrteerzerooo
;mov balance_le_bdrawn,1
;zerrezrezezrerrteerzerooo:
cmp balance_le_bdrawn,0
jne ereretereterreer233
ret
ereretereterreer233:
PUSHALL
;mov bdraw666,'03'
;mov bdraw1,60
;cas particulier... on est entré en phase 1 seul dyna vivant...
;on doit donc arreter le compte a rebourd...
cmp [attente_avant_med],attente_avant_med2
jne ertertertertetrertertertzet
;--
cmp word ptr bdraw666,'99'
je kjmlkjjkmlkjlmjklmjmkl
dec bdraw1
jnz kjmlkjjkmlkjlmjklmjmkl
mov bdraw1,60
dec bdraw666+1
cmp bdraw666+1,'0'-1
jne kjmlkjjkmlkjlmjklmjmkl
mov bdraw666+1,'9'
dec bdraw666
cmp bdraw666,'0'-1
jne kjmlkjjkmlkjlmjklmjmkl
mov bdraw666,'9'
kjmlkjjkmlkjlmjklmjmkl:
cmp adder_bdraw,0
je ertertertertetrertertertzet
cmp nombre_de_dyna,1
je ertertertertetrertertertzet
sub adder_bdraw,320
ertertertertetrertertertzet:
;--------------
POPALL
ret
endp
dec_temps proc near
PUSHALL
test temps,000111111111111B
jz zerooo
;mov balance_le_bdrawn,0
cmp temps2,15
jne nonononoiuioiohjrr
;--- deuxieme cas particulier-
cmp special_clignotement,0
je dommage_pp
dec special_clignotement
jmp special_fete
dommage_pp:
;-----------------------------
or temps,00100000000000000B
mov ax,temps
and ax,0011111111111111B
cmp ax,000010001B
ja nonononoiuioiohjrr
special_fete:
or temps,01000000000000000B ;clinotement général.
nonononoiuioiohjrr:
cmp temps2,1
jne nonononoiuioiohjrrt
and temps,01011111111111111B
test temps,01000000000000000B
jz nonononoiuioiohjrrt
bruit3 6,40,BLOW_WHAT2
and temps,00111111111111111B ;glonotement global..
nonononoiuioiohjrrt:
dec temps2
jz ertterrtyrtyrtyyrt
POPALL
ret
zerooo:
;-*-*-*-*-*-*-*-*-*-*- apocalypse
cmp terrain,6
jne ertrtytyuyuiiyuughfdfgdfgfgdrtyrtyrtyerertertert
call pose_une_bombe_bonus
ertrtytyuyuiiyuughfdfgdfgfgdrtyrtyrtyerertertert:
;--------
;test dword ptr [changement],0000000000001B
;jnz finto_pasé_cetelmk
;133: virrer la brique. pour le milieu...
;test temps,000111111111111B
;jz zerooo
;
mov in_the_apocalypse,0
push ds
pop es
lea esi,truc_fin
lea edi,truc
mov ecx,32*13
nextooi:
cmp byte ptr [esi],0
je nextooo
mov in_the_apocalypse,1 ;indiquate the apocalypse is going on
;test temps,000111111111111B
;jz zerooo
;mov balance_le_bdrawn,0
;------------- vitesse de l'apocalypse... ---
mov eax,dword ptr [truc_fin+32*13] ;recup la vitesse.
test [changement],eax
jnz nextooo
dec byte ptr [esi]
;quand arrive a 133 defonce ce kil y avait en dessous...
;mais ne posera pas de brike dure, puisuquon aurra mis byte ptr [esi] a 0
;malin...
;------ cas particulier... anti-brique... (et au milieu...)
cmp byte ptr [esi],133
jne nextooo567888888_
mov special_nivo_6,60 ;indike de pas filler de bonus :) (cf. nivo 6)
;TOFIX cmp terrain,6 ;terrain nivo 6
;TOFIX je ertrtytyuyuiiyuughfdfgdfgfgdrtyrtyrtyertetttrrttrt
mov balance_le_bdrawn,1 ;indique de balancer es 30 dernieres secondes
ertrtytyuyuiiyuughfdfgdfgfgdrtyrtyrtyertetttrrttrt:
cmp byte ptr [edi],2 ;pour brique.
jne nextoooy
;194
;----- explosion de la brike ---
cmp terrain,6 ;terrain nivo 6
je ertrtytyuyuiiyuughfdfgdfgfgdrtyrtyrty
mov byte ptr [edi],0 ;+degages la brique
mov byte ptr [edi+32*13],194 ;+ explosion
bruit3 4,40,BLOW_WHAT2
jmp nextoooy
;------ cas particulier: nivo 6: brike se decompose
ertrtytyuyuiiyuughfdfgdfgfgdrtyrtyrty:
mov byte ptr [edi],3 ;casse la brique... normallement
nextoooy:
mov byte ptr [esi],0
jmp nextooo
nextooo567888888_:
;---------- endroit normal.. bombardement de piece dure.
cmp byte ptr [esi],0
jne nextooo
cmp byte ptr [edi],1 ;si y'en a deja une...
je nextooo
;194
;bruit2 4 40
mov byte ptr [edi],11 ;place la brique dure.
mov byte ptr [edi+32*13],194 ;+ explosion
bruit2 4,40
nextooo:
inc edi
inc esi
dec ecx
jnz nextooi
finto_pas_cetelmk:
POPALL
ret
;*--*-*-*-*-*-*-*-* décrémentation du compte rebour.
ertterrtyrtyrtyyrt:
mov temps2,59
;--------
mov ax,temps
and ax,01111B
dec ax
cmp ax,-1
jne pas_zeroret
mov ax,9
jmp canal_sux
pas_zeroret:
and temps,01111111111110000B
or temps,ax
POPALL
ret
canal_sux:
and temps,01111111111110000B
or temps,ax
mov ax,temps
shr ax,4
and ax,01111B
;mov bl,al
dec ax
cmp ax,-1
jne pas_zeroret7
mov ax,5
jmp stade
pas_zeroret7:
shl ax,4
and temps,01111111100001111B
or temps,ax
POPALL
ret
stade:
shl ax,4
and temps,01111111100001111B
or temps,ax
mov ax,temps
shr ax,8
;and ax,01111B
;mov bl,al
dec ax
cmp ax,-1
jne pas_zeroret72
mov ax,9
jmp stade
pas_zeroret72:
shl ax,8
and temps,01111000011111111B
or temps,ax
POPALL
ret
endp
gestion_blanchiment proc near
PUSHALL
xor ebp,ebp
verite:
mov eax,0
cmp [invinsible+ebp],0
je bababh
dec dword ptr [invinsible+ebp]
mov ax, word ptr [invinsible+ebp]
and eax, 1023
mov al,[blinking+eax]
and eax, 1
bababh:
mov [clignotement+ebp],eax
add ebp,4
cmp ebp,4*8
jne verite
POPALL
ret
endp
nike_toutes_ses_bombes proc near ;entree ebx: viseur infojoueur.
PUSHALL
mov ecx,[liste_bombe]
or ecx,ecx
jz upasdutout
lea esi,liste_bombe+4-taille_dune_info_bombe
unext_bomby:
add esi,taille_dune_info_bombe
cmp dword ptr [esi+4],0
jne uya_bombe_ici
jmp unext_bomby
uya_bombe_ici:
;------- unqieuemnt si c'est notre propre bombe...
cmp dword ptr [esi],ebx
jne unon_dejar
;--------- uniquement si cette bombe etait a retardement...
cmp word ptr [esi+4*3+2],1
jne unon_dejar
mov word ptr [esi+4*3+2],2 ;la rend preske normalle .... ;0 ;le rend normalle
unon_dejar:
dec ecx
jnz unext_bomby
upasdutout:
POPALL
ret
endp
nike_toutes_les_bombes proc near
PUSHALL
mov ecx,[liste_bombe]
or ecx,ecx
jz upasdutoutu
lea esi,liste_bombe+4-taille_dune_info_bombe
unext_bombyu:
add esi,taille_dune_info_bombe
cmp dword ptr [esi+4],0
jne uya_bombe_iciu
jmp unext_bombyu
uya_bombe_iciu:
;--------- uniquement si cette bombe etait a retardement...
mov word ptr [esi+4*3+2],0 ;le rend normalle
mov dword ptr [esi+1*4],1
dec ecx
jnz unext_bombyu
upasdutoutu:
POPALL
ret
endp
pousse_la_bombe proc near
PUSHALL
;cmp byte ptr [esi+32*13],1
;jb efrerrereterter
;cmp byte ptr [esi+32*13],4
;ja efrerrereterter
;--- ya une bombe !!! essaye de la pousser ---
;
;call pouse_la_bombe
sub esi,offset truc
;recherche cette bombe.
xor ebx,ebx
ttyrrtyrtyrtyrtytyrrtyrtyyrtrtye:
cmp dword ptr [liste_bombe+ebx+4+1*4],0 ;indique emplacement non remplis !!!
je cherche_encore
cmp dword ptr [liste_bombe+ebx+4+2*4],esi ;regarde si ya une bombe a cet endroit
jne cherche_encore
jmp okey_on_puse
cherche_encore:
add ebx,taille_dune_info_bombe
jmp ttyrrtyrtyrtyrtytyrrtyrtyyrtrtye
okey_on_puse:
;mov dword ptr [liste_bombe+ebx+4+1*4],1
;
;on peut pousser ke si elle est au milieu
cmp word ptr [liste_bombe+ebx+4+5*4],0 ; adder X
jne peu_pas_pousser ;
cmp word ptr [liste_bombe+ebx+4+5*4+2],0 ;adder Y
jne peu_pas_pousser
;---- cas particulier -- on ne pousse pas vers le bas en bas ----
;cas particulier speical cote rebondissant pour eviter kon fasse rebondir
;contre un mur alors ke la bombe y est colle.
;bas
cmp esi,32*11
jb pas_ce_cas_larrr
cmp ecx,2
je peu_pas_pousser
pas_ce_cas_larrr:
;haut
cmp esi,32*2
jnb pas_ce_cas_larrr2
cmp ecx,2
je peu_pas_pousser
pas_ce_cas_larrr2:
and esi,31
;gauche
cmp esi,1
jne pas_ce_cas3
or ecx,ecx
jz peu_pas_pousser
pas_ce_cas3:
;droite
cmp esi,17
jne pas_ce_cas5
or ecx,ecx
jz peu_pas_pousser
pas_ce_cas5:
;----------------------------------------------------
mov dword ptr [liste_bombe+ebx+4+4*4],0 ;pour degager l'ancien mouvement
;si elle bougait
;deja...
add ebx,ecx ;!!!!!!!!!!!! ;oU y automatique cA dEPENT dE eCX
mov word ptr [liste_bombe+ebx+4+4*4],ax ;0 ;!!!!!!!!!1 ;adder X automatique.
bruit2 13,34
peu_pas_pousser:
;mov word ptr [liste_bombe+ebx+4+4*4+2],0
;mov word ptr [liste_bombe+ebx+4+5*4],15 ;adder X
;mov word ptr [liste_bombe+ebx+4+5*4+2],0 ;adder Y
POPALL
ret
endp
;truc_monstre db 32*13 dup (?)
fabrique_monstro_truc proc near
PUSHALL
push ds
pop es
lea edi,truc_monstre
xor eax,eax
mov ecx,32*13/4
rep stosd
xor ebp,ebp
zecompetion:
cmp [vie+ebp],1
jne fdggrtetyrklmjyurtmkljrtymjklyut
push ebp
xy_to_offset
mov [truc_monstre+eax],''
pop ebp
fdggrtetyrklmjyurtmkljrtymjklyut:
add ebp,4
cmp ebp,8*4
jne zecompetion
POPALL
ret
endp
pose_une_bombe_bonus proc near
PUSHALL
;call noping
;liste_bombbbb dd 32+1
; dd 32*3+1
; dd 32*5+1
; dd 32*7+1
; dd 32*9+1
;
cmp [attente_avant_med],attente_avant_med2
jne errteerterttyjtyutyuutytyuyutyutyututy
;test dword ptr [changement],0000000000111B
;jnz errteerterttyjtyutyuutytyuyutyutyututy
;
cmp attente_entre_chake_bombe,0
je okokokokok_cette_fois
dec attente_entre_chake_bombe
jmp errteerterttyjtyutyuutytyuyutyutyututy
okokokokok_cette_fois:
add viseur__nouvelle_attente_entre_chake_bombe,4
;nouvelle_attente_entre_chake_bombe2 dd 16,21,17,9,20,15,12,20
lea esi,nouvelle_attente_entre_chake_bombe2
add esi,viseur__nouvelle_attente_entre_chake_bombe
cmp esi,offset viseur__nouvelle_attente_entre_chake_bombe
jne ertteertertertertter
cmp [acceleration],20
je retteterrterteterertert
inc [acceleration]
retteterrterteterertert:
mov viseur__nouvelle_attente_entre_chake_bombe,0
lea esi,nouvelle_attente_entre_chake_bombe2
ertteertertertertter:
mov ebx,[esi]
sub ebx,[acceleration]
js loupe
jz loupe
jmp rrtyertyrtyrtyrtyertyrtytyr
loupe:
mov ebx,1
rrtyertyrtyrtyrtyertyrtytyr:
mov attente_entre_chake_bombe,ebx
mov ebx,liste_bombbbb2
add ebx,12
lea esi,liste_bombbbb+ebx
cmp esi,offset liste_bombbbb2
;
;cmp ebx,4*6
jne e6rtertertert
xor ebx,ebx
e6rtertertert:
mov liste_bombbbb2,ebx
mov eax,[liste_bombbbb+ebx]
mov dx,word ptr [liste_bombbbb+4+ebx]
mov cx,word ptr [liste_bombbbb+6+ebx]
mov ebp,dword ptr [liste_bombbbb+8+ebx]
lea esi,truc2
;mov eax,32*1+1
add esi,eax
cmp byte ptr [esi-32*13],0 ;regarde si ya rien ou l'on veut placer la bombe
jne ytreteterrterteterertter
cmp byte ptr [esi],0 ;regarde si ya rien ou l'on veut placer la bombe
jne ytreteterrterteterertter
;cmp cx,-1
;jne retterertertertter
;sub esi,2
;retterertertertter:
;inc esi
;cmp byte ptr [esi-32*13],0 ;regarde si ya rien ou l'on veut placer la bombe
;jne ytreteterrterteterertter
;cmp byte ptr [esi-32*13],0 ;regarde si ya rien ou l'on veut placer la bombe
;jne ytreteterrterteterertter
;cmp byte ptr [esi],0 ;regarde si ya rien ou l'on veut placer la bombe
;jne ytreteterrterteterertter
;cmp cx,-1
;jne rettererterterttere
;add esi,2
;rettererterterttere:
;dec esi
mov byte ptr [esi],1
;dec dword ptr [edi] ;nombre de bombes k'on peut encore poser...
;donnee dw 20,20,277,277,150,200,250,280 ;x du dynablaster
; dw 9,170,9,170,78,98,98,10 ;y du dynablaster
;liste_bombe dd 0 ; nombre de bombes...
; dd 247 dup (0,0,0,0)
;1er: offset de l'infojoeur
;2eme: nombre de tours avant que ca PETE !!! ; si = 0 ca veut dire
; ;emplacement libre...
;3eme:distance par rapport au debut de truc2
;4eme:DD= 1 DW: puissance de la bombe + 1 DW: bombe a retardement ??? (=1)
;5eme: VITESSE:1 db:X (+1/-1/0) ,1 db:Y (+1/-1/0);+ 2 db VIDE
;6eme: ADDER_X/Y: 1 dw:X,1 dW:Y
;mov ebx,[liste_bombe]
;shl ebx,4 ;*16
;recherche la premiere place de libre !!!
xor ebx,ebx
yttyrrtyrtyrtyrtytyrrtyrtyyrtrty:
cmp dword ptr [liste_bombe+ebx+4+1*4],0 ;indique emplacement non remplis !!!
je yerertertrteterert
add ebx,taille_dune_info_bombe
jmp yttyrrtyrtyrtyrtytyrrtyrtyyrtrty
yerertertrteterert:
;mov edx,3 ;dword ptr [edi+4] ;récupere la puissance de la bombe dans
;l'info du joueur...
;mov ecx,256 ;dword ptr [edi+8] ;récupere la taille de la meiche de la
;bombe dans l'info du joueur...
;------------------------------------ mouvement de la bombe
;push dx
; cmp dx,-7
; jne zerertrterteterert
; mov dl,-7
; zerertrterteterert:
mov byte ptr [truc_X+eax],dl ;;;;;;;;;;;;;;;;;;;;;;;;;;dl ;0
;pop dx
mov byte ptr [truc_Y+eax],0
mov [liste_bombe+ebx+4+0*4],offset infojoueur2
mov [liste_bombe+ebx+4+1*4],ebp ;ecx ;nombre de tours avant que ca PETE !!!
mov [liste_bombe+ebx+4+2*4],eax ;distance par rapport au debut de truc2
mov word ptr [liste_bombe+ebx+4+3*4],3 ;dx ;puissance de la bombe.
mov word ptr [liste_bombe+ebx+4+3*4+2],0 ;dx ;bombe a retardement ou pas ???
mov word ptr [liste_bombe+ebx+4+4*4],cx ;adder X automatique.
mov word ptr [liste_bombe+ebx+4+4*4+2],0
mov word ptr [liste_bombe+ebx+4+5*4],dx ;-7 ;0 ;adder X
mov word ptr [liste_bombe+ebx+4+5*4+2],0 ;adder Y
;5eme: VITESSE:1 db:X (+1/-1/0) ,1 db:Y (+1/-1/0);+ 2 db VIDE
;6eme: ADDER_X/Y: 1 dw:X,1 dW:Y
;edi ;offset de l'infojoeur
inc dword ptr [liste_bombe]
ytreteterrterteterertter:
errteerterttyjtyutyuutytyuyutyutyututy:
POPALL
ret
endp
calc_ombres proc near
PUSHALL
;
;call noping
;call noping
;call noping
;donnee dw 8 dup (?) ;x du dynablaster
; dw 8 dup (?) ;y du dynablaster
xor ebx,ebx
xor ebp,ebp
mov kel_ombre,0
mertrymrtejklertyjklmtyer:
cmp [lapipipino+ebp],0
je pas_un_lapin_345
;cmp [lapipipino5+ebp],0
;je pas_un_lapin_345 ;ki saute pas
mov eax,1
cmp [lapipipino5+ebp],6
jb aaaaaa
mov eax,2
aaaaaa:
cmp [lapipipino5+ebp],12
jb aaaaaa2
mov eax,3
aaaaaa2:
;mort de lapin
cmp [lapipipino2+ebp],3 ;mort du lapin
jne veuoooooooooooi
mov eax,4
cmp [lapipipino3+ebp],27
ja reeeeeeeeeet
inc eax
cmp [lapipipino3+ebp],24
ja reeeeeeeeeet
inc eax
cmp [lapipipino3+ebp],21
ja reeeeeeeeeet
inc eax
cmp [lapipipino3+ebp],18
ja reeeeeeeeeet
inc eax
cmp [lapipipino3+ebp],16
ja reeeeeeeeeet
inc eax
cmp [lapipipino3+ebp],14
ja reeeeeeeeeet
inc eax
cmp [lapipipino3+ebp],11
ja reeeeeeeeeet
inc eax
cmp [lapipipino3+ebp],08
ja reeeeeeeeeet
inc eax
cmp [lapipipino3+ebp],05
ja reeeeeeeeeet
inc eax
reeeeeeeeeet:
mov ecx,ebp
shl eax,cl
or [kel_ombre],eax
xor eax,eax
mov ax,[donnee+8*2+ebx]
add ax,15
EAX_X_320
add ax,[donnee+ebx]
add ax,4
sub ax,8
sub ax,320*19
mov [ombres+ebx],ax
jmp pas_un_lapin_345
veuoooooooooooi:
;-----
mov ecx,ebp
shl eax,cl
or [kel_ombre],eax
xor eax,eax
mov ax,[donnee+8*2+ebx]
add ax,15
EAX_X_320
add ax,[donnee+ebx]
add ax,4
mov [ombres+ebx],ax
pas_un_lapin_345:
add ebp,4
add ebx,2
cmp ebx,2*8
jne mertrymrtejklertyjklmtyer
POPALL
ret
endp
aff_ombres proc near
PUSHALL
;--- pour ombres ---
;kel_ombre dd 0
;ombres dw 8 dup (?)
;-------------------
mov esi,1582080+64000*5 ;offset buffer3
;add esi,ebx
;push ds
xor ebp,ebp
mov edi,offset buffer
push fs
pop ds
xor ebp,ebp
xor ebx,ebx
rtmklmrtyjklrtymjkrtyjklmrtyrty:
mov eax,1111B
mov ecx,ebp
shl eax,cl
mov edx,es:[kel_ombre]
and edx,eax
shr edx,cl
or edx,edx
jz nananan_pas_dombre_ici
push esi edi ebx
cmp edx,2
jne oooooorytrtyrtyp
add esi,24
oooooorytrtyrtyp:
cmp edx,3
jne oooooorytrtyrtyp4
add esi,24*2
oooooorytrtyrtyp4:
;mort phase 1 (carcasse de lapin mort. hey oui c une ombre)
cmp edx,4
jb caaaaaaaaaaaaaaaaa
mov esi,1966080+64000*8+1+1*320
;---- couleur rose ou bleu
test ebp,0100B
jnz c_une_fille
add esi,320*(33+33)
c_une_fille:
;-----
sub edx,4
shl edx,5 ;*32
add esi,edx
xor eax,eax
mov ax,es:[ombres+ebx]
add edi,eax
SPRITE_32_32
pop ebx edi esi
jmp nananan_pas_dombre_ici
caaaaaaaaaaaaaaaaa:
xor eax,eax
mov ax,es:[ombres+ebx]
add edi,eax
add esi,71+150*320
;aff_omb
SPRITE_8_16
pop ebx edi esi
nananan_pas_dombre_ici:
add ebx,2
add ebp,4
cmp ebx,8*2
jne rtmklmrtyjklrtymjkrtyjklmrtyrty
POPALL
ret
endp
deplacement_bombes proc near
poussage 1,0,1
poussage -1,0,1
poussage 1,2,32
poussage -1,2,32
poussage 1,0,1
poussage -1,0,1
poussage 1,2,32
poussage -1,2,32
ret
endp
compact proc near
ret
endp
decompact proc near
ret
endp
zget_information proc near
ret
endp
ferme_socket proc near
ret
endp
;; fin include
;ééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééé
; CODE
;ééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééé
;ééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééé
; Entry To ASM Code (_main)
; In:
; CS - Code Selector Base: 00000000h - Limit: 4G
; DS - Data Selector Base: 00000000h - Limit: 4G
; ES - PSP Selector Base: PSP Seg - Limit: 100h ;segment video: selector: ES
; FS - ?
; GS - ? ;sauvegarde de DS..
; SS - Data Selector Base: 00000000h - Limit: 4G
; ESP -> STACK segment
; Direction Flag - ?
; Interrupt Flag - ?
;
; All Other Registers Are Undefined!
;ééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééé
_main:
sti ; Set The Interrupt Flag
cld ; Clear The Direction Flag
PUSHALL
;PUSHALL
; protected mode shit ?
;mov ah,02ch
;int 21h
;xor eax,eax
;mov al,dh
;and eax,11100B
;mov differentesply2,eax
;and dh,01
;mov kel_pic_intro,dh
;POPALL
; mov ax,3h
; int 10h
mov eax,ttp
mov temps_avant_demo,eax
call doStuffClavierExtended
POPALL
;----- inst clavier -
PUSHALL
xor eax,eax
mov ax,ds
mov ss:[merdo],eax ;IGNORE
call inst_clavier
POPALL
;---
; push 0h
; call GetModuleHandleA
; mov [AppHWnd],eax
; call GetForegroundWindow
; push 3
;
; this can be any of the following values :
;SW_HIDE equ 0
;SW_SHOWNORMAL equ 1
;SW_NORMAL equ 1
;SW_SHOWMINIMIZED equ 2
;SW_SHOWMAXIMIZED equ 3
;SW_MAXIMIZE equ 3
;SW_SHOWNOACTIVATE equ 4
;SW_SHOW equ 5
;SW_MINIMIZE equ 6
;SW_SHOWMINNOACTIVE equ 7
;SW_SHOWNA equ 8
;SW_RESTORE equ 9
;SW_SHOWDEFAULT equ 10
;SW_MAX equ 10
; push eax
; call ShowWindow
; CALL ExitProcess ;End (exit) program
; call get_pal_ansi
PUSHALL
; mov bp,240h
;setup_viseur dd 0
;setup_viseur2 dd 8
;setup_viseur2_offset dw 210h,220h,230h,240h,250h,260h,270h,280h,0
;cmp economode,1
;jne trreljljrjkltjhtehljtehljte
;mov setup_viseur2,8
;trreljljrjkltjhtehljtehljte:
;mov ebx,setup_viseur2
;add ebx,ebx
;xor ebp,ebp
;mov bp,[setup_viseur2_offset+ebx]
;mov bp,260h
;mov ax,bp
;call affsigne
;setup_viseur2_offset dw 210h,220h,230h,240h,250h,260h,270h,280h,0
; REMOVED call detect ;es:PSP
POPALL
;mov ax,4c00h ; AH=4Ch - Exit To DOS
;int 21h ; DOS INT 21h
;reserve la memoire pour les données --> selector: FS
;segment video: selector: ES
;1966080
taille_moire equ ((((2030080+64000*26)/4096)+1)*4096)-1
;--------------------- r�serve de la m�moire pour mettre les donn�es. ----
;2.29 - Function 0501h - Allocate Memory Block:
;In: AX = 0501h
; BX:CX = size of block in bytes (must be non-zero)
;Out: if successful:
; carry flag clear
; BX:CX = linear address of allocated memory block
; SI:DI = memory block handle (used to resize and free block)
mov eax,taille_moire
;0200000h ;2mega
mov cx,ax
shr eax,16
mov bx,ax
mov ax,501h
int 31h
jNC ca_roule_roll
;mov edx,offset pas_de_mem
;mov ah,9
;int 21h
; !!!!!! RETIRE mov [assez_de_memoire],1 ; db 0 ; 0 OUI suffisament
nanananaaaaaaaaaaaa_demande_ligne_c:
jmp okokokokokoioioiioio
ca_roule_roll:
push bx cx ; linear address of allocated memory block
;2.0 - Function 0000h - Allocate Descriptors:
;--------------------------------------------
; Allocates one or more descriptors in the client's descriptor table. The
;descriptor(s) allocated must be initialized by the application with other
;function calls.
;In:
; AX = 0000h
; CX = number of descriptors to allocate
;Out:
; if successful:
; carry flag clear
; AX = base selector
xor ax,ax
mov cx,1
int 31h
jNC ca_roule_roll2
;mov edx,offset pbs1
;mov ah,9
;int 21h
mov ax,4c00h ; AH=4Ch - Exit To DOS
int 21h ; DOS INT 21h
ca_roule_roll2:
;2.5 - Function 0007h - Set Segment Base Address:
; Sets the 32bit linear base address field in the descriptor for the specified
;segment.
; In: AX = 0007h
; BX = selector
; CX:DX = 32bit linear base address of segment
pop dx cx ; linear address of allocated memory block
mov bx,ax
mov fs,ax
mov ax,0007
;mov cx,si //removed???
;mov dx,di // Removed???
int 31h
;dans FS: selector sur donn�es.
;2.6 - Function 0008h - Set Segment Limit:
;-----------------------------------------
; Sets the limit field in the descriptor for the specified segment.
; In:
; AX = 0008h
; BX = selector
; CX:DX = 32bit segment limit
; Out:
; if successful:
; carry flag clear
; if failed:
; carry flag set
mov eax,taille_moire ;::!300000h-1 ;182400h-1 ;1582080 ;0300000h-1 ;2mega 182400h-1
;mov eax,((((2582080)/4096)+1)*4096)-1 ;::!300000h-1 ;182400h-1 ;1582080 ;0300000h-1 ;2mega 182400h-1
mov dx,ax
shr eax,16
mov cx,ax
mov bx,fs
mov ax,08h
int 31h
jNC tca_roule_roll
;mov edx,offset pbs2
;mov ah,9
;int 21h
mov ax,4c00h ; AH=4Ch - Exit To DOS
int 21h ; DOS INT 21h
tca_roule_roll:
;-------------------------------------------------------------------------
;----- pour la memoire video
mov ax,0002h
mov BX,0a000h
int 31h
mov es,ax
okokokokokoioioiioio:
; mov ax,4c00h ; AH=4Ch - Exit To DOS
; int 21h ; DOS INT 21h
; mov ax,4c00h ; AH=4Ch - Exit To DOS
; int 21h ; DOS INT 21h
; mov ax,4c00h ; AH=4Ch - Exit To DOS
; int 21h
call init_packed_liste
cmp modeinfo,1 ;cas ou on scan le reso.
jne ertrerertrtrer
call zget_information
ertrerertrtrer:
;-*-*-*-*-*===================_____X____)\_,--------------------------
;*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
call load_data ;serra fait que si y'a assez de memoire.
; PASSE EN MODE 13h!!!
mov ax,13h
int 10h
call affpal
;lea esi,pal_pic2
;PUSHALL
;push ds
;pop es
;
;lea esi,pal_pic2 ;;;rene
;lea edi,pal_affichée
;mov ecx,768
;rep movsb
;pal db 768 dup (?) ;pal de l'émulateur.
;pal_affichée db 768 dup (0) ;pal k'on affiche...
;POPALL
;mov esi,1966080+64000*21
;copyblock
;call aff_page2
;cmp [assez_de_memoire],1
;
; je eretterertd
; call affpal
;eretterertd:
hoooooooop:
call init_menu
reterrterterte:
call menu
call pal_visage
;call play_fx
call controle
;gestion temps de demo/repousse le compte a rebours
;cmp temps_avant_demo,1
;je ljljrtjhrljhrryr
touche_pressedd temps_avant_demo ttp
;ljljrtjhrljhrryr:
;==================== SPECIAL DEMO,pour kitter avec nimporte kelle touche...
cmp action_replay,2
jne erterertrtertetertyutyuyuttyuuty
cmp nombre_de_vbl_avant_le_droit_de_poser_bombe,0 ;pas des le debut...
jne erterertrtertetertyutyuyuttyuuty
touche_presse sortie 1
erterertrtertetertyutyuyuttyuuty:
;=================================================================
;kb_packets_jeu_envoyes dd 0
;call gooroo
;return_presse demande_partie_slave,1
mov nosetjmp,1
vbl
directmenu:
call menu_intelligence
get_all_infos3 ; récupere les touches pour chaque joueur et pour
; tous les différents ordinateurs.
mov on_les_dans_le_menu,1
;call master_net
;--- esc du master ---------------------------------
cmp sors_du_menu_aussitot,1
jne y_special_mrb
mov byte ptr [sortie],1 ;eSC.
y_special_mrb:
cmp byte ptr [sortie],1 ;eSC.
jne erertrterteertrteertertrtertertyeertrteertterertertterertterert
mov byte ptr [sortie],0 ;// ignore...
;;mov [previentlmesenfants],1
;cmp byte ptr [ordre],'B' ;pour bye... (du master)
;je rtertertyeertrteertterertertterertterert
;mov byte ptr [ordre],'B' ;pour bye...
;jmp reterrterterte
erertrterteertrteertertrtertertyeertrteertterertertterertterert:
;----------------------------------------------------------------------
;cmp changement,300
;jne poiy
;mov byte ptr [sortie],1 ;eSC. ;!!!!!!!!
;poiy:
;cmp byte ptr [ordre],'B' ;pour bye... (du slave)
;jne rtertertyeertrteertterertertterertterert2RT
;mov previentlmesenfants,1 ;pour slave: affiche messgae fin
;jmp rtertertyeertrteertterertertterertterert
;rtertertyeertrteertterertertterertterert2RT:
cmp [attente_nouveau_esc],0
jne ook
cmp [master],0
jne oook2
cmp byte ptr [sortie],1 ;eSC.
je rtertertyeertrteertterertertterertterert
jmp oook2
ook:
dec [attente_nouveau_esc]
oook2:
cmp byte ptr [ordre],''
jne reterrterterte
;--------------------------------------------------------------------
nouvelle_partie345:
call nouvelle_partie
nouvelle_manche3:
call nouvelle_manche
;**************************************************************************
retertdgrfgd:
call pal_visage
;call play_fx
;----- gestion des joeurs locaux.
call controle ;prépare le packet qu'on va transmettre en informant
;les touches ke l'on presse actuellement
;*************************** MASTER *******************************
cmp [master],0
jne trtyrtrtyrtyrtyrtyrtytyrrtyrtytyryrtrty
;call gooroo
mov on_les_dans_le_menu,0
;call master_net
mov nosetjmp,2
vbl
directjeu:
call master1
trtyrtrtyrtyrtyrtyrtytyrrtyrtytyryrtrty:
;*************************** SLAVE ********************************
;;cmp [master],1
;;jne trtyrtrtyrtyrtyrtyrtytyrrtyrtytyryrtrty2
;;call slave1
;;trtyrtrtyrtyrtyrtyrtytyrrtyrtytyryrtrty2:
;-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
;--------------- lecture des ordre ------------------------------
cmp byte ptr [ordre2],'M' ;pour slave...
je hoooooooop ;saute au menu si ordre...
;--------------------------------------------------
cmp byte ptr [ordre2],'%' ;indique nouvelle manche
je nouvelle_manche3
;-*-------------------------------
;-- sortie forcee..
cmp [master],0
je ertyerttyrrtyyrtretertdgrfgd
cmp sortie_slave,0 ;cmp sortie,0 ;
jne rtertertyeertrteertterertertterertterert
jmp retertdgrfgd
ertyerttyrrtyyrtretertdgrfgd:
cmp [master],0
jne retertdgrfgd
cmp byte ptr [sortie],1 ;eSC.
jne retertdgrfgd
;on est master.. et echap est appuyé...
;****************** SORTIE... uniquement pour le master *********************
mov byte ptr [ordre2],'M' ;donne ordre de sortie
jmp retertdgrfgd
; récupere les touches pour chaque joueur et pour
; tous les différents ordinateurs.
;call master1 ; comme ca... les autres vont recup ordre2..
;jmp hoooooooop
;****************************************************************************
rtertertyeertrteertterertertterertterert:
mov ax,3h
int 10h
;----
;cmp previentlmesenfants,1 ;pour slave: affiche messgae fin
;jne ertertterrtertyutyutyutyutyutyuutytyu
;lea edx,gameover
;mov ah,09h
;int 21h
;ertertterrtertyutyutyutyutyutyuutytyu:
;---
rtertertyeertrteertterertertterertterert2:
busy_ou: ;fin koi
;--effacage de fin ... ---
;cmp [mechant],1
;je mechant3
mechant5:
;PUSHALL
;mov ax,02fh
;mov ax,1684h
;mov bx,07fe0h
;int 2Fh
;mov ax,es
;call affsigne
;
;POPALL
; mov eax,[adresse_des_fonds] ; dd 0h ;,100000h,200000h,100000h
; mov eax,[differents_offset_possible+8*4*4]
; call num
; sagouin texte_fin
; call gus_init
;cmp [jesus_mode],0
;jne reteretrertert5445870t
;packets_jeu_envoyes dw 0
;packets_jeu_recus dw 0
;call affichage_stats
;call affichage_rec
;control_joueur dd 8 dup (?) ;-1,6,32,32+6,-1,-1,-1,-1
;mov eax,control_joueur
;call num
;mov ecx,9
;mov esi,offset victoires
;money_train:
;lodsd
;call affsigne
;loop money_train
;lea edx,last_name
;mov ah,9
;int 21h
;mov ah,02ah
;int 21h
;cmp cx,1998
;jb tranquilleee
;ja rtertertyeertrteertterertertterertterertertrtetyrtyuyuuie
;cmp dh,3
;ja rtertertyeertrteertterertertterertterertertrtetyrtyuyuuie
;tranquilleee:
;
; lea edx,information2
; mov ah,9
; int 21h
; mov bh,00000000B ;indique clignotement
; mov bl,11 ;5 ;rouge
; call last_color
;rtertertyeertrteertterertertterertterertertrtetyrtyuyuuie:
;mov cl,[last_sucker]
;nonoiutryyrtryt:
;cmp [last_sucker],cl
;je nonoiutryyrtryt
;;------------ dky -
;push ds
;pop es
;
;xor al,al
;lea edi,pal_affichée
;mov cx,768
;rep stosb
;call affpal
;
;mov esi,offset darky
;mov edi,0b8000h
;mov ecx,1000
;rep movsd
;mov dl,79
;mov dh,23
;mov al,0
;mov bh,0
;mov ah,2
;int 10h
;
;;lea esi,pal_txt_debut
;
;;rep movsb
;
;;------------
;
;mov cx,63
;rereerter:
;call affpal
;call vbl
;
;;lea esi,pal_txt_debut
;mov bx,768
;xor al,al
;lea esi,pal_txt_debut
;lea edi,pal_affichée
;oohiu:
;;lodsb
;cmp al,[edi]
;cmpsb
;je ertterrtyrtrtyrty
;inc byte ptr [edi-1]
;ertterrtyrtrtyrty:
;;inc edi
;
;dec bx
;jnz oohiu
;;rep stosb
;
;
;dec cx
;jnz rereerter
;cmp windows,1
;je oregreteiiooi
;
; lea edx,information3
; mov ah,9
; int 21h
; mov bh,00000000B ;indique clignotement
; mov bl,15
; call last_color
;oregreteiiooi:
;master db 0 ; 0 = OUI
;cmp byte ptr [lost_conney],1 ;eSC.
;je r4564654eertrterereetr
;cmp [master],0
;jne r4564654eertrterereetr
;cmp on_a_bien_fait_une_partie,0
;jne r4564654eertrterereetr
; lea edx,information5
; mov ah,9
; int 21h
;lea ebx,beginningdata
;lea eax,enddata
;sub eax,ebx
;call printeax
;r4564654eertrterereetr:
;lea edx,nick_t
;mov ah,9
;int 21h
mov al,[lost_conney]
mov ah,4ch ; AH=4Ch - Exit To DOS
int 21h ; DOS INT 21h
;mov ax,bidouille
;push ax
;pop cs
;xchg ax,cs
;;push cs
;pop cs
;int 20h
quitte_baby: ;cas de connection lost... pour slave...
POPALL
mov ax,3h
int 10h
mov [lost_conney],1
mov dl,''
mov ah,2
int 21h
;mov trygain,1
;jmp tryagain
;
;mov esi,0b8000h
;mov [esi],651516
jmp rtertertyeertrteertterertertterertterert2
;mechant3:
;
; mov ax,3h
; int 10h
;
;;load_pcx proc near ; ecx: offset dans le fichier.
;; ; edx: offset nom du fichier
;; ; edi: viseur dans données ou ca serra copié (ax:)
;; ; ebx: nombre de pixels dans le pcx
;;
;;pushad
;;push es ds
;;
;;mov [load_pcx_interne],ebx
;;
;;
;; mov es,ax
; mov edx,offset iff_file_name
;; mov ah,09h
;; int 21h
; xor eax,eax
; mov al,01h ;ecriture;
; mov ah,03dh
; int 21h
;
;;xor ebx,ebx
;mov ebx,eax
;mov ah,040h
;mov ecx,250000 ;juste le code
;push ds
;
;push fs
;pop ds
;xor edx,edx
;int 21h
;; AH = 40h
;; BX = file handle
;; ECX = number of bytes to write
;; DS:EDX -> buffer to write from
;
;pop ds
;jmp mechant5
master1 proc near
;je no_fucking_vbl
;TOFIX
;jmp ouiouirt
;no_fucking_vbl:
;inc dword ptr [changement]
;ouiouirt:
;--- intelligence draw game ------------------------------------------------
cmp byte ptr [ordre2],'D'
jne trtyrtyrtyrtyrtyterterertrteert
;*** affichage draw game
cmp [duree_draw],duree_draw2
jne erertertteryr
mov [affiche_pal],1
erertertteryr:
call copie_le_fond_draw
call aff_page2
jmp rtyrtyrtytyrrtyyttyutyutyutyutyutyutyutyutyuyuttyu
retetrterterertertrteertertertertre:
;;;- pas asssez memoire -
;mov ah,02h
;mov dh,24
;mov dl,0
;mov bh,0
;int 10h
;call affiche_en_mode_texte
rtyrtyrtytyrrtyyttyutyutyutyutyutyutyutyutyuyuttyu:
;**************************************************************************
dec [duree_draw]
jnz reterertertert
mov [ordre2],'%' ;indique nouvelle manche
reterertertert:
;,return_presseque_master ordre2 '%'
;--- pour pas ke le master kitte de suite kan on sort d'un draw game forcé
cmp [duree_draw],450 ;pas tout de suite kan meme...
ja ertetrtrkjjklmkjlmetkjlmdikgrhrfhgrrethghkgh
cmp word ptr bdraw666,'99'
je ertetrtrkjjklmkjlmetkjlmdikgrhrfhgrrethghkgh
touche_presseque_master ordre2,'%'
ertetrtrkjjklmkjlmetkjlmdikgrhrfhgrrethghkgh:
cmp [duree_draw],400 ;pas tout de suite kan meme...
ja rerteertertertert3r0
touche_presse ordre2 '%' ;saute au menu...
rerteertertertert3r0:
call compact
get_all_infos2 ; récupere les touches pour chaque joueur et pour
; ; tous les différents ordinateurs.
jmp exitFunction
trtyrtyrtyrtyrtyterterertrteert:
;---------------------------------------------------------------------------
;--------------- intelligence jeu ------------------------------
cmp byte ptr [ordre2],'' ;uniqUEMENT si on est dans le jeu.
jne terterertrteert
call gestion_jeu
;----affichage jeu -------------------
cmp byte ptr [ordre2],'Z' ;uniqUEMENT si on a quitté le jeu en fait...
je meeeeeed
call compact
get_all_infos2 ; récupere les touches pour chaque joueur et pour
; tous les différents ordinateurs.
; si ca n'a pas changé...
; l'ordre peut avoir changé mais seulement a la fin...
call rec_play_touches ;enregistre/joue les touches (pour le REPLAY...)
cmp byte ptr [ordre2],'' ;uniqUEMENT si on a pas quitté le jeu en fait...
jne yttyutyutyutyutyutyutyutyutyuyuttyu
;*************** affichage *************************************************
;master db 0 ; 0 = OUI
; ; 1 = NON
;----- affichage de l'écran local. l'ancien ecran...
cmp [last_sucker],0
jne yttyutyutyutyutyutyutyutyutyuyuttyu
call copie_le_fond
call affiche_sprites
call aff_page2
;jmp yttyutyutyutyutyutyutyutyutyuyuttyu
;retetrterterertertrteertertertert:
;call affiche_en_mode_texte
yttyutyutyutyutyutyutyutyutyuyuttyu:
jmp exitFunction
terterertrteert:
;--------------------------------------------------
;---- victoire supreme -------------------------------------------------------
cmp byte ptr [ordre2],'V'
jne etrertertrtertertyerterttrtyrtyrtyrtyrtyterterertrteert
victoire_sup:
cmp [duree_vic],duree_vic2 ;pour kitter...
jne kierertertteryr
mov [affiche_pal],1
kierertertteryr:
call copie_le_fond_vic
call aff_page2
;jmp kirtyrtyrtytyrrtyyttyutyutyutyutyutyutyutyutyuyuttyu
kiretetrterterertertrteertertertertre:
;--- intelligence vic ---
dec [duree_vic]
jnz ireterertertertu
mov [ordre2],'M' ;indique saute au menu...
ireterertertertu:
cmp [duree_vic],duree_vic2-60 ;pas tout de suite kan meme...
ja rerteertertertert
cmp [duree_vic],duree_vic2-60 ;pas tout de suite kan meme.
ja rerteertertertertPOPOP
touche_presseque_master ordre2,'M'
rerteertertertertPOPOP:
cmp [duree_vic],duree_vic2/2 ;pas tout de suite kan meme...
ja rerteertertertert
touche_presse ordre2 'M' ;saute au menu...
rerteertertertert:
;------------------------------
call compact
get_all_infos2 ; récupere les touches pour chaque joueur et pour
; tous les différents ordinateurs.
; si ca n'a pas changé...
; l'ordre peut avoir changé mais seulement a la fin...
jmp exitFunction
etrertertrtertertyerterttrtyrtyrtyrtyrtyterterertrteert:
;-----------------------------------------------------------------------------
;------ intelligence medaille ---
cmp byte ptr [ordre2],'Z'
jne rtyerterttrtyrtyrtyrtyrtyterterertrteertrtrtrtrtyyrtyooooooooooooo
meeeeeed:
;*****************************************************************************
cmp [duree_med],duree_med2 ;pour kitter...
jne ierertertteryr
mov [affiche_pal],1
ierertertteryr:
call copie_le_fond_med
call aff_page2
jmp irtyrtyrtytyrrtyyttyutyutyutyutyutyutyutyutyuyuttyu
iretetrterterertertrteertertertertre:
;-------------- pas asssez memoire -----------
;mov ah,02h
;mov dh,24
;mov dl,0
;mov bh,0
;int 10h
irtyrtyrtytyrrtyyttyutyutyutyutyutyutyutyutyuyuttyu:
pas_med:
;----------------------------------------------------------------
;--- intelligence mediakle ---
;; ;+ 1 db= faut afficher la brike ki clignote ou pas???
;----------- intelligence clignotement... ----
SOUND_FAC BLOW_WHAT2
mov eax,[changement]
and eax,0000111111B
cmp eax,32
jne tout_
mov byte ptr [briques+8*4],1
tout_:
or eax,eax
jnz tout_3
bruit3 3,35,BLOW_WHAT2 ;sonne
mov byte ptr [briques+8*4],0
tout_3:
;----------------------------------
dec [duree_med]
jnz ireterertertert
mov [ordre2],'%' ;indique nouvelle manche
ireterertertert:
cmp [duree_med],duree_med2-1*90 ;pas tout de suite kan meme.
ja rerteertertertertPOPOP2
touche_presseque_master ordre2,'%'
rerteertertertertPOPOP2:
;------------------- pas de quittage trop hatif...
cmp [duree_med],duree_med2-3*60 ;3 secondes minimum
ja okokokokokokok345345345
touche_presse ordre2 '%'
okokokokokokok345345345:
;-----------------------------------
;sauf si on aurait gagné...
cmp [ordre2],'%'
jne iertrtrterteert
xor ebx,ebx
ierterertertrtyetyutyutyuutytyutyu:
cmp [victoires+ebx],5
jne iertterteteertzerzerzerzerrteretr
mov byte ptr [ordre2],'V' ;victoire supreme
jmp victoire_sup
iertterteteertzerzerzerzerrteretr:
add ebx,4
cmp ebx,4*8
jne ierterertertrtyetyutyutyuutytyutyu
iertrtrterteert:
;---
rtyerterttrtyrtyrtyrtyrtyterterertrteertrtrtrtrtyyrtyooooooooooooo:
;------------------------------
call compact
get_all_infos2 ; récupere les touches pour chaque joueur et pour
; tous les différents ordinateurs.
exitFunction:
mov byte ptr [donnee2+8*7],0
mov byte ptr [donnee2+8*7+1],0
mov byte ptr [donnee2+8*7+2],0
ret
;=================================================
endp
doStuffClavierExtended proc near
;28 ENTER (KEYPAD) ! 75 LEFT (NOT KEYPAD) !
;29 RIGHT CONTROL ! 77 RIGHT (NOT KEYPAD) !
;42 PRINT SCREEN (SEE TEXT) 79 END (NOT KEYPAD) !
;53 / (KEYPAD) ! 80 DOWN (NOT KEYPAD) !
;55 PRINT SCREEN (SEE TEXT) ! 81 PAGE DOWN (NOT KEYPAD) !
;56 RIGHT ALT ! 82 INSERT (NOT KEYPAD) !
;71 HOME (NOT KEYPAD) ! 83 DELETE (NOT KEYPAD) !
;72 UP (NOT KEYPAD) ! 111 ccc
;73 PAGE UP (NOT KEYPAD) !
;
; db 'UP ',3 ;112
; db 'DOWN ',3 ;113
; db 'LEFT ',3 ;114
; db 'RIGHT ',3 ;115
mov byte ptr [clavier_extanded+72],72 ; db 128 dup (123)
mov byte ptr [clavier_extanded+80],80
mov byte ptr [clavier_extanded+91],91
mov byte ptr [clavier_extanded+92],92
mov byte ptr [clavier_extanded+93],93
mov byte ptr [clavier_extanded+29],123
mov byte ptr [clavier_extanded+53],116
mov byte ptr [clavier_extanded+79],117
mov byte ptr [clavier_extanded+83],118
mov byte ptr [clavier_extanded+82],122
mov byte ptr [clavier_extanded+73],120
mov byte ptr [clavier_extanded+71],121
mov byte ptr [clavier_extanded+81],119
mov byte ptr [clavier_extanded+56],124
mov byte ptr [clavier_extanded+28],125
mov byte ptr [clavier_extanded+55],84 ;print screen (2/2)
;----------------------------------------------------------------------------.
mov byte ptr [clavier_extanded+72],112
mov byte ptr [clavier_extanded+80],113
mov byte ptr [clavier_extanded+75],114
mov byte ptr [clavier_extanded+77],115
;----------------------------------------------------------------------------.
ret
endp
;cmp [jesus_mode],0
;jne reteretrertert5445870t
;packets_jeu_envoyes dw 0
;packets_jeu_recus dw 0
a_la_ligne proc near
PUSHALL
mov dl,10
mov ah,2
int 21h
mov dl,13
mov ah,2
int 21h
POPALL
ret
endp
init_menu proc near
PUSHALL
;--- pour le deuxieme tours.. car special... serra a 2
; econo est ensuite mis a 0
; et serra remis a 1 ke si on finit le record (pas de esc)
;cmp economode,1
;jne tyjktrjhtjhrtjtjtrhlhhjhyhjyjhlyjhly
;mov temps_avant_demo,1 ;ttp ;temps_avant_demo2
;;mov [sors_du_menu_aussitot],1
;mov special_on_a_loadee_nivo,2
;mov economode,2
;tyjktrjhtjhrtjtjtrhlhhjhyhjyjhlyjhly:
cmp special_on_a_loadee_nivo,1
jne ertterterrtertytyrrtyrtyrtyrtyrtyrtyrty
mov temps_avant_demo,1 ;ttp ;temps_avant_demo2
mov special_on_a_loadee_nivo,2
;mov [sors_du_menu_aussitot],1
ertterterrtertytyrrtyrtyrtyrtyrtyrtyrty:
mov [affiche_pal],1 ;!!!
mov [sortie],0
mov [attente_nouveau_esc],20
mov byte ptr [ordre],'S'
mov byte ptr [ordre2],''
push ds
pop es
cmp [master],0
je trtyrtrtyrtyrtyrtyrtytyrrtyrtytyryrtrty2erte34fgh
POPALL
ret
;*************** QUE MASTER -******************
trtyrtrtyrtyrtyrtyrtytyrrtyrtytyryrtrty2erte34fgh:
push ax
mov al,team3_sauve
and al,3
mov team3,al
pop ax
;--- jsute utilie pour le debut..
;pour remplir le nombre de joueurs dans le menu...
;kil faut pour commencer une partie.
cmp [team3],0
jne tetrtyertyrdfgdfggdffgdgdf0
PUSHALL
lea esi,n_team
lea edi,team
mov ecx,9
rep movsd
POPALL
tetrtyertyrdfgdfggdffgdgdf0:
cmp [team3],2
jne tetrtyertyrdfgdfggdffgdgdf
PUSHALL
lea esi,s_team
lea edi,team
mov ecx,9
rep movsd
POPALL
tetrtyertyrdfgdfggdffgdgdf:
cmp [team3],1
jne tetrtyertyrdfgdfggdffgdgdfE
PUSHALL
lea esi,c_team
lea edi,team
mov ecx,9
rep movsd
POPALL
tetrtyertyrdfgdfggdffgdgdfE:
;mov [last_sucker],0 ;derniere touche... pour attente zaac pic
lea edi,total_play
xor eax,eax
mov ecx,64/4
rep stosd
lea edi,fx
xor ax,ax
mov ecx,14
rep stosw
mov edi,offset total_t
xor eax,eax
mov ecx,(64/4)*8
rep stosd
lea edi,name_joueur
xor eax,eax
mov ecx,8
rep stosd
mov esi,offset message1
mov edi,offset texte1
mov ecx,32
rep movsd
mov esi,offset message1
mov ecx,32
rep movsd
mov esi,offset message1
mov ecx,32
rep movsd
mov esi,offset message1
mov ecx,32
rep movsd
mov esi,offset message1
mov ecx,32
rep movsd
mov esi,offset message1
mov ecx,32
rep movsd
mov esi,offset message1
mov ecx,32
rep movsd
mov esi,offset message1
mov ecx,32
rep movsd
lea edi,control_joueur ;fait correspondre é cpu pour affichage des noms
mov eax,64*8
mov ecx,8
rep stosd
mov [nombre_de_dyna],0
mov nb_ai_bombermen,0
lea edi,temps_joueur
mov eax,temps_re_menu
mov ecx,8
rep stosd
mov action_replay,0 ;pas si on est en play
lea edi,lapipipino ;pour pu kil soit considere comme un lapin
xor eax,eax
mov ecx,8
rep stosd
POPALL
ret
init_menu endp
_TEXT ends ;IGNORE
_DATA segment use32 dword public 'DATA' ;IGNORE
;ééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééé
; DATA
;ééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééé
beginningdata db 1
donoterasekeys db 0
liste_de_machin dd 1000000000,100000000,10000000,1000000,100000,10000,1000,100,10,1,0
;// LOCAL VARIABLES R/W BUT -> NOT SHARED
infojoueur2 dd 5000,5000,5000,1,0
tecte2 dd 0
scrollyF dd 0
scrolly db 6*328 dup (0)
special_clignotement dd ?
trucs db '0123456789ABCDEF'
last_voice dd 0
BLOW_WHAT2 dw 14 dup (?)
BLOW_WHAT dw 14 dup (0)
;---- allignement = ok :)
slowcpu dd 0
paaaaaaading db 35 dup (0)
buffer db 0FFFFh dup (0)
paaaaading db 11 dup (0)
message2 db ' is'
db 'ready '
db '2 kill'
db ' '
db ' is'
db 'ready '
db '2 kill'
db ' '
db 'hosted'
db 'by cpu'
db ' nb: '
db ' '
db 'hosted'
db 'by cpu'
db ' nb: '
db ' '
total_liste dd ?
bigendianin dd 0
bigendianout dd 0
dataloaded db 1
clavier db 128 dup (0)
;// FIRST READ ONLY VARIBLES.... -> NOT SHARED
taille_exe_gonfle dd 0255442
playSoundFx db 0
master db 0 ; 0 = OUI
; 1 = NON
;----
clavier_stuff db 0 ;0 rien
clavier_stuff2 db 0 ;0 rien
clavier_extanded db 128 dup (0)
include pal_pic.inc
include pal_pic2.inc
include pal_jeu.inc
include pal_med.inc
include pal_vic.inc
include pal_draw.inc
include blinking.inc
isbigendian db 1
;touches par default.. ;-1 = actif...
touches_ dd 114,115,112,113,82,83,125,-1,20,21,16,30,57,15,58 ,-1,,0,0,0,0,0,0,0, 00,,0,0,0,0,0,0,0, 00,,0,0,0,0,0,0,0, 00,,0,0,0,0,0,0,0, 00,,0,0,0,0,0,0,0, 00,,0,0,0,0,0,0,0, 00
tected db 'welcome to mr.boom v4.2 *'
tecte db ' players can join the game using their action keys... '
db ' use the b button to drop a bomb a to trigger the bomb remote control x to jump (if you are riding a kangaroo) select to add a bomber-bot start to start! graphics by zaac exocet easy and marblemad musics by 4-mat carter estrayk heatbeat jester kenet parsec quazar rez and ultrasyd (c) 1997-2020 remdy software. (wrap time) ',0dbh
db 512 dup(0)
message1 db ' join '
db ' us '
db ' !! '
db ' '
db ' '
db ' '
db ' '
db ' '
db ' push '
db ' fire '
db ' !! '
db ' '
db ' '
db ' '
db ' '
db ' '
message3 db 'name ?'
db ' '
db ' '
db ' '
db 'name ?'
db ' '
db ' '
db ' '
db 'name ?'
db ' '
db ' '
db ' '
db ' '
db ' '
db ' '
db ' '
mess_kli db 'kli kl'
db ' kli k'
db 'i kli '
db ' '
db ' kli k'
db 'i kli '
db 'li kli'
db ' '
db 'i kli '
db 'li kli'
db 'kli kl'
db ' '
db 'li kli'
db 'kli kl'
db ' kli k'
db ' '
mess_luc db 'luc lu'
db ' luc l'
db 'c luc '
db ' '
db ' luc l'
db 'c luc '
db 'uc luc'
db ' '
db 'c luc '
db 'uc luc'
db 'luc lu'
db ' '
db 'uc luc'
db 'luc lu'
db ' luc l'
db ' '
mess_frd db ' '
db ' fred '
db ' '
db ' '
db ' '
db 'point!'
db ' '
db ' '
db ' '
db ' fred '
db ' '
db ' '
db ' '
db 'point!'
db ' '
db ' '
mess_jag db 'jaguar'
db ' '
db ' '
db ' '
db ' '
db 'jaguar'
db ' '
db ' '
db ' '
db ' '
db 'jaguar'
db ' '
db ' '
db 'jaguar'
db ' '
db ' '
mess_din db ' '
db 'dines '
db ' '
db ' '
db ' '
db 'dines!'
db ' '
db ' '
db ' '
db 'dines '
db ' '
db ' '
db ' '
db 'dines!'
db ' '
db ' '
mess_jdg db 'judge '
db ' '
db 'j.f.f.'
db ' '
db 'miguel'
db ' '
db 'j.f.f.'
db ' '
mess_rmd db ' '
db 'remdy.'
db ' '
db ' '
db ' '
db 'remdy '
db ' '
db ' '
db ' '
db 'remdy.'
db ' '
db ' '
db ' '
db 'remdy '
db ' '
db ' '
mess_ors db ' '
db ' orsi '
db ' '
db ' '
db ' '
db ' orsi '
db ' '
db ' '
db ' '
db ' orsi '
db ' '
db ' '
db ' '
db ' orsi '
db ' '
db ' '
mess_kor db 'enjoy.'
db 'meteor'
db ' '
db ' '
db 'think.'
db 'meteor'
db ' '
db ' '
db 'drink.'
db 'meteor'
db ' '
db ' '
db ' '
db ' kor! '
db ' '
db ' '
mess_sl1 db ' '
db ' s '
db ' '
db ' '
db ' '
db ' sl '
db ' '
db ' '
db ' '
db ' sli '
db ' '
db ' '
db ' '
db ' slin '
db ' '
db ' '
mess_adr db 'lechat'
db ' '
db ' '
db ' '
db 'lechat'
db 'login '
db ' '
db ' '
db 'lechat'
db 'login '
db ' root '
db ' '
db 'dpx 20'
db 'xwbh44'
db 'orsay!'
db ' '
mess_wil db 'willy!'
db 'united'
db 'lamers'
db ' '
db 'willy!'
db 'united'
db 'lamers'
db ' '
mess_exo db 'exocet'
db ' '
db 'j.f.f.'
db ' '
db 'exocet'
db ' '
db 'j.f.f.'
db ' '
mess_cl db 'cl!nph'
db ' cle. '
db ' aner '
db ' '
db 'cl!nph'
db ' cle. '
db ' aner '
db ' '
mess_ben db 'benji!'
db ' '
db 'j.f.f.'
db ' '
db 'benji!'
db ' '
db 'j.f.f.'
db ' '
mess_aaa db 'anony.'
db 'mous ?'
db 'pffff.'
db ' '
db 'lamer!'
db 'lamer!'
db 'lamer!'
db ' '
mess_fzf db ' '
db ' fzf! '
db ' '
db ' '
db ' le '
db 'maitre'
db 'est...'
db ' '
db ' de '
db 'retour'
db ' !! '
db ' '
db ' '
db ' fzf! '
db ' '
db ' '
mess_het db 'hetero'
db ' of '
db 'razor!'
db ' '
db 'if you'
db 'are to'
db ' slow '
db ' '
db 'i will'
db 'insert'
db 'a bomb'
db ' '
db ' in '
db ' your '
db ' ass! '
db ' '
mess_big db ' '
db ' b... '
db ' '
db ' '
db ' '
db ' bi.. '
db ' '
db ' '
db ' '
db ' big. '
db ' '
db ' '
db ' '
db 'jokes!'
db ' '
db ' '
mess_hak db 'hak ha'
db ' hak h'
db 'k hak '
db ' '
db ' hak h'
db 'k hak '
db 'ak hak'
db ' '
db 'k hak '
db 'ak hak'
db 'hak ka'
db ' '
db 'ak hak'
db 'hak ha'
db ' hak h'
db ' '
mess_jc db ' '
db ' jc '
db ' '
db ' '
db ' '
db ' jc '
db ' '
db ' '
defo db 'aaa',87h
;(a)pocalypse de rechange:
truc_fin_s db 000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,001,002,003,004,005,006,007,008,009,010,011,012,013,014,015,016,017,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,052,053,054,055,056,057,058,059,060,061,062,063,064,065,066,067,018,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,051,096,097,098,099,100,101,102,103,104,105,106,107,108,109,068,019,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,050,095,132,255,255,255,255,255,255,255,255,255,255,255,110,069,020,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,049,094,131,255,255,255,255,255,255,255,255,255,255,255,111,070,021,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,048,093,130,255,255,255,255,255,255,255,255,255,255,255,112,071,022,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,047,092,129,255,255,255,255,255,255,255,255,255,255,255,113,072,023,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,046,091,128,255,255,255,255,255,255,255,255,255,255,255,114,073,024,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,045,090,127,126,125,124,123,122,121,120,119,118,117,116,115,074,025,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,044,089,088,087,086,085,084,083,082,081,080,079,078,077,076,075,026,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,043,042,041,040,039,038,037,036,035,034,033,032,031,030,029,028,027,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,0,0,0,0,0,0,0,0,0,0,0,0,0
dd 000 ;vitesse
truc_fin_soccer db 000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,001,002,003,004,005,006,007,008,009,010,011,012,013,014,015,016,017,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,034,033,032,031,030,029,028,027,026,025,024,023,022,021,020,019,018,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,035,036,037,038,039,040,041,042,043,044,045,046,047,048,049,050,051,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,050,050,053,053,054,055,056,255,255,255,058,057,056,055,054,053,052,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,075,074,073,072,071,070,255,255,255,255,255,059,060,061,062,063,064,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,064,065,066,067,068,069,255,255,255,255,255,070,069,068,067,066,065,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,063,062,061,060,059,058,255,255,255,255,255,071,072,073,074,075,076,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,052,053,054,055,055,056,057,255,255,255,083,082,081,080,079,078,077,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,051,050,049,048,047,046,045,044,043,042,041,040,039,038,037,036,035,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,018,019,020,021,022,023,024,025,026,027,028,029,030,031,032,033,034,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,017,016,015,014,013,012,011,010,009,008,007,006,005,004,003,002,001,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,0,0,0,0,0,0,0,0,0,0,0,0,0
dd 002;vitesse
truc_fin_s_c db 000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,0,0,0,0,0,0,0,0,0,0,0,0,0
dd 000 ;vitesse
;pour le nivo micro...(hell)
truc_fin_s_m db 000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,001,001,001,001,001,001,001,001,001,001,001,001,001,001,001,001,001,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,015,015,015,015,015,015,015,015,015,015,015,015,015,015,015,015,015,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,030,030,030,030,030,030,030,030,030,030,030,030,030,030,030,030,030,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,045,045,045,045,045,045,045,045,045,045,045,045,045,045,045,045,045,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,060,060,060,060,060,060,060,060,060,060,060,060,060,060,060,060,060,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,075,075,075,075,075,075,075,075,075,075,075,075,075,075,075,075,075,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,090,090,090,090,090,090,090,090,090,090,090,090,090,090,090,090,090,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,105,105,105,102,105,105,105,105,105,105,105,105,105,105,105,105,105,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,0,0,0,0,0,0,0,0,0,0,0,0,0
dd 0111B ;vitesse
;truc_fin_foot db 000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 000,001,022,023,044,045,066,067,088,225,078,077,056,055,034,033,012,011,000,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 000,002,021,024,043,046,065,068,087,225,079,076,057,054,035,032,013,010,000,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 000,003,020,025,042,047,064,069,086,225,080,075,058,053,036,031,014,009,000,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 000,004,019,026,041,048,063,070,085,226,081,074,059,052,037,030,015,008,000,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 000,005,018,027,040,049,062,071,084,226,082,073,060,051,038,029,016,007,000,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 000,006,017,028,039,050,061,072,083,226,083,072,061,050,039,028,017,006,000,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 000,007,016,029,038,051,060,073,082,227,084,071,062,049,040,027,018,005,000,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 000,008,015,030,037,052,059,074,081,227,085,070,063,048,041,026,019,004,000,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 000,009,014,031,036,053,058,075,080,227,086,069,064,047,042,025,020,003,000,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 000,010,013,032,035,054,057,076,079,228,087,068,065,046,043,024,021,002,000,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 000,011,012,033,034,055,056,077,078,228,088,067,066,045,044,023,022,001,000,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,0,0,0,0,0,0,0,0,0,0,0,0,0
; dd 0111B ;vitesse
truc_fin_s_n db 000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,100,100,100,100,100,255,040,041,042,043,044,255,085,085,085,085,085,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,100,100,100,100,100,255,047,255,046,255,045,255,085,085,085,085,085,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,100,100,100,100,100,255,255,255,255,255,255,255,085,085,085,085,085,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,100,100,100,100,100,255,255,255,255,255,255,255,085,085,085,085,085,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,100,100,100,100,100,001,255,255,255,255,255,020,085,085,085,085,085,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,070,070,070,070,070,030,255,255,255,255,255,010,110,110,110,110,110,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,070,070,070,070,070,255,255,255,255,255,255,255,110,110,110,110,110,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,070,070,070,070,070,255,255,255,255,255,255,255,110,110,110,110,110,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,070,070,070,070,070,255,056,255,057,255,058,255,110,110,110,110,110,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,070,070,070,070,070,255,055,054,053,052,051,255,110,110,110,110,110,000,0,0,0,0,0,0,0,0,0,0,0,0,0
db 000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,0,0,0,0,0,0,0,0,0,0,0,0,0
dd 0011B ;vitesse
truc_s db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,0,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,2,2,2,2,0,0,2,2,2,0,0,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,1,2,1,2,1,0,1,2,1,0,1,2,1,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,1,2,1,2,1,0,1,2,1,0,1,2,1,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,2,2,2,2,0,0,2,2,2,0,0,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,0,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
truc_foot db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,1,0,1,2,1,2,1,2,1,0,1,2,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,0,0,0,2,2,2,2,2,0,0,0,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,1,0,1,2,1,0,1,2,1,0,1,2,1,0,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,2,2,2,2,0,0,0,2,2,2,2,2,0,0,0,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,1,0,1,2,1,0,1,2,1,0,1,2,1,0,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,0,0,0,2,2,2,2,2,0,0,0,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,1,0,1,2,1,0,1,2,1,0,1,2,1,0,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,2,2,2,2,0,0,0,2,2,2,2,2,0,0,0,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,1,2,1,2,1,0,1,2,1,2,1,2,1,0,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
truc_soccer db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,1,0,1,2,1,2,1,2,1,2,1,2,1,0,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,0,0,0,2,2,2,2,2,2,2,2,2,0,0,0,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,1,2,1,2,1,0,1,2,1,2,1,0,1,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,2,2,2,0,0,0,2,2,2,0,0,0,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,2,2,2,0,0,0,2,2,2,0,0,0,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,1,2,1,2,1,0,1,2,1,2,1,0,1,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,0,0,0,2,2,2,2,2,2,2,2,2,0,0,0,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,1,0,1,2,1,2,1,2,1,2,1,2,1,0,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
;truc_n db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0
truc_n db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,2,2,0,0,1,2,0,0,0,2,1,0,0,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,1,2,1,0,1,2,1,2,1,2,1,0,1,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,2,2,2,2,1,2,2,2,2,2,1,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,0,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,1,1,1,1,1,1,2,1,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,0,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,2,2,2,2,1,2,2,2,2,2,1,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,1,2,1,0,1,2,1,2,1,2,1,0,1,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,2,2,0,0,1,2,0,0,0,2,1,0,0,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
truc_c db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,0,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,0,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,0,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,0,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
truc_h db 1,66,66,66,66,66,66,66,1,1,1,66,66,66,66,66,66,66,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,66,1,1,1,1,1,1,1,1,1,1,1,1,1
db 66,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,66,1,1,1,1,1,1,1,1,1,1,1,1,1
db 66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,66,1,1,1,1,1,1,1,1,1,1,1,1,1
db 66,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,66,1,1,1,1,1,1,1,1,1,1,1,1,1
db 66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,66,1,1,1,1,1,1,1,1,1,1,1,1,1
db 66,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,66,1,1,1,1,1,1,1,1,1,1,1,1,1
db 66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,66,1,1,1,1,1,1,1,1,1,1,1,1,1
db 66,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,66,1,1,1,1,1,1,1,1,1,1,1,1,1
db 66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,66,1,1,1,1,1,1,1,1,1,1,1,1,1
db 66,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,66,1,1,1,1,1,1,1,1,1,1,1,1,1
db 66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,66,1,1,1,1,1,1,1,1,1,1,1,1,1
db 66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,1,1,1,1,1,1,1,1,1,1,1,1,1
truc_f db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,0,1,2,1,1,1,2,1,2,1,1,1,2,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,0,2,2,2,0,0,0,1,2,2,0,0,0,2,2,2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,1,1,1,0,1,2,1,1,1,0,1,1,1,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,1,2,2,2,2,2,2,2,1,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,2,2,1,2,0,0,2,2,2,2,2,2,1,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,1,2,1,1,1,0,1,2,1,1,1,2,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,0,2,2,2,2,1,0,2,2,2,0,0,0,2,2,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,0,1,1,1,2,1,2,1,1,1,0,1,1,1,2,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
truc_neige db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,0,1,2,1,0,1,2,1,2,1,2,1,2,1,2,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,2,2,0,0,2,2,2,2,2,2,0,0,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,1,2,1,2,1,1,1,2,1,2,1,0,1,0,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,2,2,2,2,1,1,1,2,2,2,2,2,0,0,0,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,1,2,1,2,1,1,1,2,1,2,1,2,1,0,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,2,2,2,2,2,2,2,2,0,0,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,1,2,1,2,1,0,1,2,1,0,1,2,1,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,2,2,2,2,2,0,0,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,0,1,2,1,2,1,2,1,2,1,2,1,2,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,0,0,2,2,2,2,2,2,2,2,2,2,2,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
;--- laisser ensemble
truc2_save_foot db 0,0,0,0,0,0,00,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,00,0,000,00,00,0,0,0,0,0,0,94,0,0,0,0,0,0,0,0,0,0,0,0,0,0
truc2_save db 32*0,0,0,0,0,0,0,0,0,0,0,0,0
;---
truc2_save_n db 0,0,0,0,0,0,00,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,00,0,114,74,84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,00,00,0,00,00,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,00,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,00,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,00,0,104,74,94,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
;0= face bas.
;8= droite droite
;16= gauche gauche
;24= haut haut
;0;8;24;
ia dd 16,0,8,24,0,8,24,16,0,24,16,0,8,16,0,24
offset_supporter db 0,24,0,24*2
offset_cameraman db 0*lft,1*lft,2*lft,1*lft ;4
db 12 dup (0);
db 0*lft,3*lft,4*lft,3*lft
db 12 dup (0);
; db 0*lft,4*lft,4*lft,4*lft,3*lft,4*lft,4*lft,4*lft
; db 8 dup (0);
;
; db 16 dup (0);
;--
db 0*lft,4*lft,4*lft,4*lft,4*lft,4*lft,4*lft,4*lft
db 8 dup (4*lft);
db 8 dup (0);
db 0*lft,5*lft,6*lft,5*lft
db 12 dup (0);
db 8 dup (0);
db 0*lft,1*lft,2*lft,1*lft ;4
db 12 dup (0);
;diffents modes demo :)) mrb.. record.. tout ca koi
differentesply dd 1966080+64000*25 ;lune1.mrb
dd 1966080+64000*6 ;nuage1.mrb record5.mrb
dd 1966080+64000*13 ;foot1.mrb
dd 1966080+64000*2 ;micro1.mrb record1.mrb
dd 1966080+64000*3 ;jungle1.mrb record2.mrb
dd 1966080+64000*4 ;rose1.mrb record3.mrb
dd 1966080+64000 ;neige1.mrb record0.mrb
dd 1966080+64000*5 ;fete1.mrb record4.mrb
dd 1966080+64000*26 ;lune2.mrb
dd 1966080+64000*20 ;nuage2.mrb
dd 1966080+64000*14 ;foot2.mrb
dd 1966080+64000*19 ;micro2.mrb
dd 1966080+64000*18 ;jungle2.mrb
dd 1966080+64000*17 ;rose2.mrb
dd 1966080+64000*16 ;neige2.mrb
dd 1966080+64000*15 ;fete2.mrb
offset_pause dd 0,48,0,48,0,48,48*2,48*3,48*2,48
dd 0,48,0,48
dd 0,48,0,48,0,48,48*2,48*3,48*2,48
dd 0,48,0,48,0,48,0,48,0,48,0,48,0,48,0,48,0
dd 666
offset_si dd offset mess_rmd
dd 32
dd offset mess_ors
dd 32
dd offset mess_kli
dd 32
dd offset mess_aaa
dd 16
dd offset mess_jc
dd 16
dd offset mess_exo
dd 16
dd offset mess_ben
dd 16
dd offset mess_wil
dd 16
dd offset mess_cl
dd 16
dd offset mess_jdg
dd 16
dd offset mess_big
dd 32
dd offset mess_kor
dd 32
dd offset mess_fzf
dd 32
dd offset mess_din
dd 32
dd offset mess_jag
dd 32
dd offset mess_het
dd 32
dd offset mess_hak
dd 32
dd offset mess_sl1
dd 32
dd offset mess_adr
dd 32
dd offset mess_luc
dd 32
dd offset mess_frd
dd 32
liste_couleur_malade dd offset rouge,offset rougeg
dd offset blanc,offset blancg
dd offset rouge,offset rougeg
dd offset rouge,offset rougeg
love_si db 'rmd',87h
db 'ors',87h
db 'kli',87h
db 'aaa',87h
db 'jc',87h,87h
db 'exo',87h
db 'ben',87h
db 'wil',87h
db 'cl',85h,87h
db 'jdg',87h
db 'big',87h
db 'kor',87h
db 'fzf',87h
db 'din',87h
db 'jag',87h
db 'het',87h
db 'hak',87h
db 'sl|',87h
db 'adr',87h
db 'luc',87h
db 'frd',87h
db 'FFFF'
IFF_file_name db 'mrboom30.exe',0
reccord db 'record00.mrb',0
reccord3 db 'Loading: '
reccord2 db 'record00.mrb',0
suite db ' ',13,10,'$'
suite2 db 'ERROR WHILE LOADING.',13,10,'$'
suite3 db 'Option error, you must use: -R ????????.MRB (yes...8 letter names!!!)',13,10,'$'
cfgerror db 'Config file not found or data error inside: run with -s option for setup !!!',13,10,'$'
errorcfg db 'ERROR WRITING CONFIG FILE.',13,10,'$'
message_mem_rp db 'ERROR: NO .MRB LOADING/RECORDING IN TERMINAL MODE.',13,10,'$'
okcfg db 'using c:\mrboom3.cfg for settings.',13,10,'$'
okcfg3 db 'using .\mrboom3.cfg for settings.',13,10,'$'
;win db 'Game ran from Windows 95: NO IPX NETWORK SUPPORT.',13,10,'$'
;nowin db 'game ran from DOS. what a thrill.',13,10,'$'
terminalor db '386 Terminal mode: the network game+keyboard is working, but NO VGA display.',13,10
db 'BETTER LOOK AT ANOTHER SCREEN (ppl complained)',13,10,'$'
NULOSPRODUCTION db 'NO IPX + NO MEMORY (OR TERMINAL MODE ASKED) = NO MR.BOOM.',13,10,'$'
stat1 db 'master:',13,10,'$'
stat2 db 'moi:',13,10,'$'
stat3 db 'table:',13,10,'$'
gameover db 'Master left the menu: GAME OVER !!!',13,10,'$'
no_server_ db '# ... no server available ...',13,10,'$'
select_server_ db 'what server do you want ? (press 0 to 9):$'
cnx1 db 'cnx [ ]$'
transformateur_98 db '0123456789!. '
cnx2 db 'cnx [$'
load_pcx_interne dd 0 ;variable interne a load_pcx : (nombre de pixels...)
load_handle dd ? ;handle pour la gestion de fichier....
adresse_des_fonds dd 0,64000*2,64000*3,64000*2
adresse_des_fonds_foot dd 1966080+64000*12,1966080+64000*12
dd 1966080+64000*12,1966080+64000*12
adresse_des_fonds_neige dd 896000+384000+46080+64000*3
dd 896000+64000*2
dd 896000+64000*3
;adresse_des_fonds_neige dd 896000+384000+46080+64000*3,896000+64000*1,896000+64000*2
adresse_des_fonds_final dd 896000+64000*4+640*(36*2),896000+64000*4+640*(36*2),896000+64000*4+640*(36*2),896000+64000*4+640*(36*2)
adresse_des_fonds_foret dd 896000+384000+46080+64000,896000+384000+46080+64000,896000+384000+46080+64000,896000+384000+46080+64000
adresse_des_fonds_nuage dd 896000+64000*4+640*(36*2)+64000,896000+64000*4+640*(36*2)+64000*2,896000+64000*4+640*(36*2)+64000,896000+64000*4+640*(36*2)+64000*2
adresse_des_fonds_crayon dd 1582080+64000*3,1582080+64000*3,1582080+64000*3,1582080+64000*3
adresse_des_fonds_soccer dd 4 dup (1966080+64000*23)
nombre_de_fond dd 4*4
adresse_des_draws dd 64000*5,64000*6
nombre_de_draw dd 2*4
adresse_des_vic dd 704000,768000,832000,896000
nombre_de_vic dd 4*4
;--------------- parametres terrains ----------------
;pour chacun des terrains ...
kelle_donnee dd offset donnee_s,offset donnee_s_neige,offset donnee_h,offset donnee_f,offset donnee_n
dd offset donnee_c,offset donnee_foot,offset donnee_soccer
;---- attente fin d'apocalypse pour determiner vaincqueur ? 1=oui
kelle_fin dd 0,0,0,0,1
dd 0,0,0
;---- terrain: briques dures, pas dures, vides:
kelle_truc dd offset truc_s,offset truc_neige,offset truc_h,offset truc_f,offset truc_n
dd offset truc_c,offset truc_foot,offset truc_soccer
;---- bonus affiches au depart...
kelle_bonus dd offset truc2_save,offset truc2_save,offset truc2_save,offset truc2_save,offset truc2_save_n
dd offset truc2_save,offset truc2_save_foot,offset truc2_save
;---- comment ca va peter a la fin...
kelle_apocalypse dd offset truc_fin_s,offset truc_fin_s,offset truc_fin_s_m,offset truc_fin_s,offset truc_fin_s_n
dd offset truc_fin_s_c,offset truc_fin_s,offset truc_fin_s
;occer
kelle_duree dd duree_match,duree_match,duree_match2,duree_match,duree_match3
dd duree_match4,duree_match,duree_match5
;offset_briques dw 128*320,80*320,0,64*320,96*320 ; ,112*320
offset_briques dw 128*320,80*320,0,64*320,96*320 ; ,112*320
dw 112*320,128*320+160,112*320+160
kelle_offset_fond dd offset adresse_des_fonds,offset adresse_des_fonds_neige,offset adresse_des_fonds_final,offset adresse_des_fonds_foret,offset adresse_des_fonds_nuage
dd offset adresse_des_fonds_crayon,offset adresse_des_fonds_foot,offset adresse_des_fonds_soccer
;kel_viseur_brike_fin dw 65+84*320,65+84*320+16,65+84*320+16*2,65+84*320+16*3,65+(84-16)*320
kel_viseur_brike_fin dw 256+16*320,256+16*320+16,256+16*320+16*2,256+16*320+16*3,256
dw 256,256+32,256+48
;----------------------------------------------------
lapin_mort dw 4 dup (258) ;face
dw 4 dup (258+38*320*3) ;regarde a droite
dw 4 dup (258+38*320*2) ;regarde a gauche
dw 4 dup (258+38*320) ;dos
lapin_mortg dw 4 dup (287) ;face
dw 4 dup (287+38*320*3) ;regarde a droite
dw 4 dup (287+38*320*2) ;regarde a gauche
dw 4 dup (287+38*320) ;dos
aagb EQU 00*320
aagb2 EQU (00+38)*320
aagb3 EQU (00+38*2)*320
aagb4 EQU (00+38*3)*320
lapin2 dw aagb+0,aagb+33,aagb,aagb+66
dw aagb4+0,aagb4+33,aagb4,aagb4+66
dw aagb3+0,aagb3+33,aagb3,aagb3+66
dw aagb2+0,aagb2+33,aagb2,aagb2+66
dw aagb3,aagb3+33,aagb3+66,aagb3+99
dw aagb4,aagb4+33,aagb4+66,aagb4+99
dw 666
aagbg EQU 00*320+33*3
aagb2g EQU (00+38)*320+33*3
aagb3g EQU (00+38*2)*320+33*3
aagb4g EQU (00+38*3)*320+33*3
lapin2G dw aagbg+0,aagbg+33,aagbg,aagbg+66
dw aagb4g+0,aagb4g+33,aagb4g,aagb4g+66
dw aagb3g+0,aagb3g+33,aagb3g,aagb3g+66
dw aagb2g+0,aagb2g+33,aagb2g,aagb2g+66
dw aagb3g,aagb3g+33,aagb3g+66,aagb3g+99
dw aagb4g,aagb4g+33,aagb4g+66,aagb4g+99
dw 666
lapin2___ dw 4 dup (aagb+0) ;retour a la position style normale
dw 4 dup (aagb4+0)
dw 4 dup (aagb3+0)
dw 4 dup (aagb2+0)
lapin2___G dw 4 dup (aagb+33*3) ;retour a la position style normale
dw 4 dup (aagb4+33*3)
dw 4 dup (aagb3+33*3)
dw 4 dup (aagb2+33*3)
eaagb5a EQU (00+38*4)*320
lapin2_ dw 4 dup (eaagb5a+0)
dw 4 dup (eaagb5a+33*2)
dw 4 dup (eaagb5a+33*4)
dw 4 dup (eaagb5a+33*6)
aagb5a EQU 198
lapin2_G dw 4 dup (aagb5a+0) ;lapin s'accroupissant
dw 4 dup (aagb5a+38*1*320)
dw 4 dup (aagb5a+38*2*320)
dw 4 dup (aagb5a+38*3*320)
aagb5 EQU (00+38*4)*320
;lapin garcon ki saute (pedant le vol)
lapin2__ dw 4 dup (aagb5+0+33)
dw 4 dup (aagb5+33*2+33)
dw 4 dup (aagb5+33*4+33)
dw 4 dup (aagb5+229)
;dw 4 dup (aagb5+33*6+33)
;lapin fille ki saute (pedant le vol)
taagb5 EQU 229 ;198+33
lapin2__G dw 4 dup (taagb5+0)
dw 4 dup (taagb5+38*320)
dw 4 dup (taagb5+38*2*320)
dw 4 dup (taagb5+38*3*320)
gb EQU 89+56*320
gb2 EQU 89+56*320+320*33
gb3 EQU 89+56*320+320*33*2
gb4 EQU 89+56*320+320*33*3
grosbleu dw gb+0,gb+33,gb,gb+66
dw gb+99,gb+132,gb+99,gb+165
dw gb2+99,gb2+132,gb2+99,gb2+165
dw gb2+0,gb2+33,gb2,gb2+66
dw gb3,gb3+33,gb3+66,gb3+99
dw gb4,gb4+33,gb4+66,gb4+99
dw 666
agb equ 158*320
agb2 equ 179*320
coca dw agb,agb+24,agb,agb+24*2
dw agb+24*3,agb+24*4,agb+24*3,agb+24*5
dw agb+24*6,agb+24*7,agb+24*6,agb+24*8
dw agb+24*9,agb2,agb+24*9,agb+24*10
dw agb2+24,agb2+24*2,agb2+24*3,agb2+24*4,agb2+24*5,agb2+24*6,agb2+24*7,agb2+24*8
dw 666
agb5 EQU 41+17*320
agb6 EQU 41+17*320+33*320
agb7 EQU 41+17*320+33*320*2
escargot dw agb5,agb5+39,agb5,agb5+39
dw agb5+39*5,agb5+39*4,agb5+39*5,agb5+39*4
dw agb5+39*2,agb5+39*3,agb5+39*2,agb5+39*3
dw agb6+39*1,agb6+39*0,agb6+39*1,agb6+39*0
dw agb6+39*2,agb6+39*3,agb6+39*4,agb6+39*5
dw agb7,agb7,agb7,agb7
dw 666
old_school dw 79+128*320+16,79+128*320,79+128*320+16,79+128*320+32
dw 79+128*320+16,79+128*320,79+128*320+16,79+128*320+32
dw 79+128*320+16,79+128*320,79+128*320+16,79+128*320+32
dw 79+128*320+16,79+128*320,79+128*320+16,79+128*320+32
; dw 79+128*320,79+128*320+16,79+128*320,79+128*320+32
; dw 79+128*320,79+128*320+16,79+128*320,79+128*320+32
; dw 79+128*320,79+128*320+16,79+128*320,79+128*320+32
; dw 79+128*320,79+128*320+16,79+128*320,79+128*320+32
dw 127+16+128*320,127+16*2+128*320,127+16*3+128*320
dw 127+16*4+128*320,127+16*5+128*320,127+16*6+128*320,127+16*6+128*320,127+16*6+128*320
dw 666
bleuoio EQU 80+100*320
bleu_triste dw bleuoio,bleuoio+27,bleuoio,bleuoio+27
dw bleuoio,bleuoio+27,bleuoio,bleuoio+27
dw bleuoio,bleuoio+27,bleuoio,bleuoio+27
dw bleuoio,bleuoio+27,bleuoio,bleuoio+27
dw bleuoio+27*2,bleuoio+27*3,bleuoio+27*4,bleuoio+27*5
dw agb7,agb7,agb7,agb7
dw 666
machinerie EQU 76+148*320
machine dw 4 dup (0+machinerie,17+machinerie,0+machinerie,17*2+machinerie)
dw 17*3+machinerie,17*4+machinerie,17*5+machinerie,17*6+machinerie
dw 17*7+machinerie,17*8+machinerie,17*9+machinerie,17*9+machinerie
dw 666
;escargot
;mov edi,896000+384000+46080+64000 ; 128000 ;307200
gb5 equ 144*320
gb6 equ 144*320+24*3
gb7 equ 144*320+24*6
gb8 equ 144*320+24*9
gb9 equ 163*320
petit_jaune dw gb5,gb5+24,gb5,gb5+24*2
dw gb6,gb6+24,gb6,gb6+24*2
dw gb7,gb7+24,gb7,gb7+24*2
dw gb8,gb8+24,gb8,gb9
dw gb9+24*1,gb9+24*2,gb9+24*3,gb9+24*4,gb9+24*5,gb9+24*6,gb9+24*7,gb9+24*8
dw 666
blanc dw 0, 24, 0, 24*2 ;face
dw 24*3+0,24*3+24,24*3+0,24*3+24*2 ;droite
dw 24*6+0,24*6+24,24*6+0,24*6+24*2 ;gauche
dw 24*9+0,24*9+24,24*9+0,24*9+24*2 ;haut
;--------------------------------------------------------
dw 288,24*320,24*320+24*1,24*320+24*2
dw 24*320+24*3,24*320+24*4,24*320+24*5,24*320+24*6 ;,24*320+24*7,24*320+24*2
dw 666 ;indique: ne pas afficher (apres explosion...)
bleu dw 192+96*320,24+192+96*320,192+96*320,24*2+192+96*320
dw 264+96*320,24+264+96*320,264+96*320,120*320
dw 24+120*320,24+24+120*320,24+120*320,24*2+24+120*320
dw 96+120*320,24+96+120*320,96+120*320,24*2+96+120*320
;--------
dw 168+120*320,168+120*320+24*1,168+120*320+24*2,168+120*320+24*3,168+120*320+24*4,168+120*320+24*5
dw 264+144*320,264+144*320+24
dw 666 ;indique: ne pas afficher (apres explosion...)
rouge dw 0+24+72*320, 24+24+72*320, 0+24+72*320, 24*2+24+72*320 ;face
dw 24*3+0+24+72*320,24*3+24+24+72*320,24*3+0+24+72*320,24*3+24*2+24+72*320 ;droite
dw 24*6+0+24+72*320,24*6+24+24+72*320,24*6+0+24+72*320,24*6+24*2+24+72*320 ;gauche
dw 24*9+0+24+72*320,24*9+24+24+72*320,24*9+0+24+72*320,24*9+24*2+24+72*320 ;haut
;-------------
dw 96*320,96*320+24*1,96*320+24*2,96*320+24*3,96*320+24*4,96*320+24*5,96*320+24*6,96*320+24*7
dw 666 ;indique: ne pas afficher (apres explosion...)
vert dw 0+168+24*320, 24+168+24*320, 0+168+24*320, 24*2+168+24*320 ;face
dw 24*3+0+168+24*320,24*3+24+168+24*320,24*3+0+168+24*320,24*3+24*2+168+24*320 ;droite
dw 320*48,320*48+24,320*48,320*48+24*2
dw 320*48+24*3+24*0,320*48+24*3+24*1,320*48+24*3+24*0,320*48+24*3+24*2
;-------------
dw 144+48*320,144+48*320+24*1,144+48*320+24*2,144+48*320+24*3,144+48*320+24*4,144+48*320+24*5,144+48*320+24*6,0+72*320
dw 666 ;indique: ne pas afficher (apres explosion...)
blancg dw 0, 24, 0, 24*2 ;face
dw 24*3+0,24*3+24,24*3+0,24*3+24*2 ;droite
dw 24*6+0,24*6+24,24*6+0,24*6+24*2 ;gauche
dw 24*9+0,24*9+24,24*9+0,24*9+24*2 ;haut
;--------------------------------------------------------
dw 288,26*320,26*320+24*1,26*320+24*2,26*320+24*3,26*320+24*4,26*320+24*5,26*320+24*6 ;,24*320+24*7,24*320+24*2
dw 666 ;indique: ne pas afficher (apres explosion...)
bleug dw 192+104*320,24+192+104*320,192+104*320,24*2+192+104*320
dw 264+104*320,24+264+104*320,264+104*320,130*320
dw 24+130*320,24*2+130*320,24+130*320,24*3+130*320
dw 96+130*320,24+96+130*320,96+130*320,24*2+96+130*320
;--------
dw 168+130*320,168+130*320+24*1,168+130*320+24*2,168+130*320+24*3
dw 168+130*320+24*4,168+130*320+24*5
dw 264+156*320,264+156*320+24
dw 666 ;indique: ne pas afficher (apres explosion...)
rougeg dw 0+24+78*320, 24+24+78*320, 0+24+78*320, 24*2+24+78*320 ;face
dw 24*3+0+24+78*320,24*3+24+24+78*320,24*3+0+24+78*320,24*3+24*2+24+78*320 ;droite
dw 24*6+0+24+78*320,24*6+24+24+78*320,24*6+0+24+78*320,24*6+24*2+24+78*320 ;gauche
dw 24*9+0+24+78*320,24*9+24+24+78*320,24*9+0+24+78*320,24*9+24*2+24+78*320 ;haut
;-------------
dw 104*320,104*320+24*1,104*320+24*2,104*320+24*3,104*320+24*4,104*320+24*5,104*320+24*6,104*320+24*7
dw 666 ;indique: ne pas afficher (apres explosion...)
vertg dw 0+168+26*320, 24+168+26*320, 0+168+26*320, 24*2+168+26*320 ;face
dw 24*3+0+168+26*320,24*3+24+168+26*320,24*3+0+168+26*320,24*3+24*2+168+26*320 ;droite
dw 320*52,320*52+24,320*52,320*52+24*2
dw 320*52+24*3,320*52+24*3+24,320*52+24*3,320*52+24*3+24*2
;---
dw 144+52*320,144+52*320+24*1,144+52*320+24*2,144+52*320+24*3
dw 144+52*320+24*4,144+52*320+24*5,144+52*320+24*6,0+78*320
dw 666 ;indique: ne pas afficher (apres explosion...)
offset_ic dd 58*2,58,0,58
;54-- bonus bombe... de 54 a 63 (offset 144)
;64-- bonus flamme... de 64 a 73 (offset 144+320*16)
;74-- tete de mort de 74 a 83
;84-- bonus parre balle. de 84 a 93
;94-- bonus COEUR !!!
;104 -- bonus bombe retardement
;114 --- bonus pousseur
;124 --- patins a roulettes
;134 --- HORLOGE
;144 --- tri-bombe
;154 --- bonus xblast
hazard_bonus_classique MACRO
db 0,54,64,74,84,94,104,114
db 124,134,144,0,0,0,0,0
db 94,114,94,94,0,94,94,74
db 144,104,124,94,84,94,114,94
ENDM
hazard_bonus_lapin MACRO
db 0,54,64,74,84,94,104,114
db 124,134,144,0,0,193,0,0
db 94,114,94,94,124,94,94,74
db 144,104,0,94,84,94,114,94
ENDM
;lapin + bonus xblast
hazard_bonus_foot MACRO
db 0,54,64,74,84,94,104,114
db 124,0,144,154,0,000,0,0
db 94,114,94,94,124,94,94,74
db 144,104,0,94,84,94,114,94
ENDM
hazard_bonus_crayon MACRO
db 0,54,64,74,84,94,104,114
db 124,134,144,0,0,0,104,193
db 94,94,94,94,124,94,94,74
db 144,94,124,94,84,94,94,94
ENDM
bombe_a_gauche MACRO toto
dd 32*toto+1 ;5ere ligne a gauche
dw -6
dw 1
dd 155
ENDM
bombe_a_droite MACRO toto
dd 32*toto+17 ;3eme ligne a droite
dw 6
dw -1
dd 155
ENDM
;affset pour les sprites d'explosion:
central_b dw 320*46+16*3,320*46+16*2,320*46+16*1,320*46+16*0,320*46+16*1,320*46+16*2,320*46+16*3
dw 320*62+16*3,320*62+16*2,320*62+16*1,320*62+16*0,320*62+16*1,320*62+16*2,320*62+16*3
dw 320*78+16*3,320*78+16*2,320*78+16*1,320*78+16*0,320*78+16*1,320*78+16*2,320*78+16*3
dw 320*94+16*3,320*94+16*2,320*94+16*1,320*94+16*0,320*94+16*1,320*94+16*2,320*94+16*3
dw 320*110+16*3,320*110+16*2,320*110+16*1,320*110+16*0,320*110+16*1,320*110+16*2,320*110+16*3
dw 320*126+16*3,320*126+16*2,320*126+16*1,320*126+16*0,320*126+16*1,320*126+16*2,320*126+16*3
dw 320*142+16*3,320*142+16*2,320*142+16*1,320*142+16*0,320*142+16*1,320*142+16*2,320*142+16*3
;viseur pour on place la premiere médaille pour chacun des 8 joueurs.
viseur_victory dd 44+28*320,44+70*320 ;blanc
dd 205+28*320,205+70*320 ;rouge
dd 44+112*320,44+154*320 ;bleu
dd 205+112*320,205+154*320 ;vert
viseur_victoryc dd 44+54*320,44+54*320
dd 205+54*320,205+54*320
dd 44+118*320,44+118*320
dd 205+118*320,205+118*320
viseur_victoryg dd 4 dup (127+61*320,128+129*320)
;visieur ou on place les lettres nom des joueurs pour les medailles.
;mode normal
viseur_name dd 10+(43)*320,10+(43+42)*320 ;
dd 171+(43)*320,171+(43+42)*320
dd 10+(43+42*2)*320,10+(43+42*3)*320
dd 171+(43+42*2)*320,171+(43+42*3)*320
viseur_namec dd 10+(69)*320,10+(69+9)*320
dd 171+(69)*320,171+(69+9)*320
dd 10+(133)*320,10+(133+9)*320
dd 171+(133)*320,171+(133+9)*320
;85*60;85*128
viseur_nameg dd 85+(61)*320,85+(129)*320
dd 85+(61+7)*320,85+(129+7)*320
dd 85+(61+14)*320,85+(129+14)*320
dd 85+(61+21)*320,85+(129+21)*320
;offset pour le sprite médaille...
offset_medaille dw 23*0,23*1,23*2,23*3,23*4,23*5,23*6,23*7,23*8,23*9,23*10,23*11,23*12
dw 23*320+23*0,23*320+23*1,23*320+23*2
random_place dd 5*2,2*2,1*2,3*2,7*2,6*2,0*2,4*2 ;0
dd 0*2,1*2,2*2,3*2,4*2,5*2,6*2,7*2
dd 7*2,6*2,5*2,4*2,3*2,2*2,1*2,0*2
dd 4*2,7*2,6*2,5*2,2*2,3*2,0*2,1*2
dd 2*2,5*2,3*2,1*2,6*2,7*2,4*2,0*2 ;5
dd 1*2,2*2,3*2,0*2,4*2,5*2,7*2,6*2
dd 2*2,1*2,0*2,6*2,5*2,7*2,4*2,3*2
dd 6*2,7*2,4*2,3*2,5*2,0*2,2*2,1*2
dd 7*2,3*2,6*2,0*2,2*2,1*2,4*2,5*2
dd 4*2,1*2,3*2,2*2,5*2,6*2,7*2,0*2 ;10
dd 0*2,5*2,2*2,7*2,3*2,6*2,1*2,4*2
dd 1*2,6*2,3*2,4*2,0*2,7*2,5*2,2*2
dd 2*2,7*2,4*2,5*2,1*2,0*2,6*2,3*2
dd 7*2,2*2,5*2,4*2,0*2,1*2,3*2,6*2
dd 5*2,0*2,2*2,7*2,1*2,4*2,6*2,3*2 ;15
dd 3*2,5*2,7*2,0*2,2*2,1*2,6*2,4*2 ;16
loaderror db 'Error while loading ! corrupted datas or not ran from current directory.',13,10,'$'
differents_offset_possible dd 00+64*0,07+64*0,14+64*0,21+64*0
dd 28+64*0,35+64*0,42+64*0,49+64*0
dd 00+64*1,07+64*1,14+64*1,21+64*1
dd 28+64*1,35+64*1,42+64*1,49+64*1
dd 666
;dd 00+64*2,07+64*2,14+64*2,21+64*2
;dd 28+64*2,35+64*2,42+64*2,49+64*2
;dd 00+64*3,07+64*3,14+64*3,21+64*3
;dd 28+64*3,35+64*3,42+64*3,49+64*3
;dd 00+64*4,07+64*4,14+64*4,21+64*4
;dd 28+64*4,35+64*4,42+64*4,49+64*4
;dd 00+64*5,07+64*5,14+64*5,21+64*5
;dd 28+64*5,35+64*5,42+64*5,49+64*5
;dd 00+64*6,07+64*6,14+64*6,21+64*6
;dd 28+64*6,35+64*6,42+64*6,49+64*6
;dd 00+64*7,07+64*7,14+64*7,21+64*7
;dd 28+64*7,35+64*7,42+64*7,49+64*7
;differents_offset_possible2 dd 00+64*0,07+64*0,14+64*0,21+64*0
;dd 28+64*0,35+64*0,42+64*0,49+64*0
;dd 666
packed_liste dd 0,29535,29535,29096,27889,35223,39271,24798,29855,29772,38197,22395
dd 56219,56131,56121,56133,24256,24229,24412,51616,37038,28755,29069,28107,46700,31766,30517,35050,33790,00000,0000,64000,64000,64000,64000,64000
dd 32190,10299,64000,25841,9185,25203,24473,25203,39396,64000,64000,64000,64000,64000,64000,64000,64000,15266,50285,25477,64000,64000
;DRAW1.PCX 10954 -7
;DRAW2.PCX 10886 -8
;NEIGE1 PCX 24,256 09-13-97 5:44a
;NEIGE2 PCX 24,229 09-13-97 5:44a
;NEIGE3 PCX 24,412 09-13-97 5:44a
dd -1 ;indique la fin...
iff_liste dd 0,10050,8046,9373,18043,2090,6643,3291,3297,5752,11285,1186,34928
dd -1
;correspo db 128 dup (0)
;sauveur dw 2144
;ligne_commande 256 db (?)
; db '$'
;texte_fin db 'texte integrité.',10,13,'$'
liste_terrain db 1,2,6,4,3,8,5,7,66
;8:soccer
;7:foot (extra terrestres)
;3
;36 ;J RASTER--->JESUS.
;18 ;19+128 ;E
;31 ;19+128 ;S
;22 ;19+128 ;U
ASCII DB '00000000',0Dh,0Ah,'$' ; buffer for ASCII string
;db 1
;db 2
;db 3
;enddata db 4
couleurssss db 64 dup (31)
db 64 dup (31+32)
db 64 dup (31+32*2)
db 64 dup (31+32*3)
lost_conney db 0
hazard_maladie db 1,2,3,4 ,5,6,5,4
db 3,6,5,1 ,2,4,2,4
couleur db 98,98,42,42,62,62,37,37 ;medailles
couleur_menu db 195,195,224,224,214,214,144,144
;kel_pic_intro db 1
of_f0 equ 72*320
of_f1 equ 72*320+49
of_f2 equ 72*320+49*2
of_f3 equ 72*320+49*3
of_f4 equ 72*320+49*4
of_f5 equ 72*320+49*5
of_f6 equ 105*320
of_f7 equ 107*320+49
of_f8 equ 107*320+49*2
of_f9 equ 107*320+49*3
of_f10 equ 107*320+49*4
of_f11 equ 107*320+49+5
of_f12 equ 107*320+49+5
offset_fille dw 4 dup (of_f5,of_f4,of_f6,of_f4)
offset_oiseau dd 0,16,0,16,0,16,0,16,0,16,0,16,0,16,0,16
dd 0,16*1,16*0,16*2,16*2,16*0,16*3,16*3,16*0,16*4,16*5,16*6,16*7,16*8,16,0
fx dw 14 dup (0)
liste_couleur_normal dd offset blanc,offset blancg
dd offset rouge,offset rougeg
dd offset bleu,offset bleug
dd offset vert,offset vertg
; dw 20,20,277,277,116,116,180,180 ;x du dynablaster
; dw 9,170,9,170,41,137,41,137 ;y du dynablaster
; dw 24*0,777,24*2,24*3,24*4,24*5,24*6,24*7 ;source du dyna dans bloque
; 64000*8
s_normal dd 576000,640000,576000,640000,576000,640000,576000,640000 ;source bloque memoire
l_normal dw 23,25,23,25,23,25,23,25 ;nombre de lignes pour un dyna...
c_normal dw 23,23,23,23,23,23,23,23 ;nombre de colonnes.
a_normal dd 0,-3*320,0,-3*320,0,-3*320,0,-3*320 ;adder di (pour la girl + grande...)
r_normal dd 8 dup (resistance_au_debut_pour_un_dyna)
; 0,0,0,-3*320,-3*320,-3*320,-3*320 ;adder di (pour la girl + grande...)
;--- nivo fete foraine...
donnee_s dw 20,20,277,277,116,116,180,180 ;x du dynablaster ;8*0
dw 9,169,9,169,41,137,41,137 ;y du dynablaster ;8*2
dw 24*0,777,24*2,24*3,24*4,24*5,24*6,24*7 ;source du dyna ;8*4
ooo34 dd 512000,512000,512000,512000,512000,512000,512000,512000 ;source bloque memoire ;8*6
dw 32,32,32,32,32,32,32,32 ;nombre de lignes pour un dyna... ;8*10
dw 32,32,32,32,32,32,32,32 ;nombre de colonnes. ;8*12
dd -9*320-4,-9*320-4,-9*320-4,-9*320-4,-9*320-4,-9*320-4,-9*320-4,-9*320-4 ;adder di ;8*16
dd offset grosbleu,offset grosbleu,offset grosbleu,offset grosbleu,offset grosbleu,offset grosbleu,offset grosbleu,offset grosbleu
dd 8 dup (2) ;résistance aux bobos... (par défault: pour monstre)
;pour les joueurs...
dd info1,info2,info3,info4,0
;premier dd: nombre de bombes que le joeur peut encore mettre.
;deuxieme dd: puissance de ces bombes... minimum = 1 ...
;troisieme dd: nombre de tous avant que ca pete.
;quatrieme dd: vitesse du joeur...
;pour les monstres
dd 8 dup (1,1,220,3,0)
dd 8 dup (0) ;invinsibilite au debut. (juste monstre)
dd 8 dup (0) ;blocage au debut. (juste monstre)
dd 0,0 ;invisibilite/blocage joeur
dd 8 dup (0) ;pousseurs au debut (pour monstres)
dd 8 dup (3) ;vitesse de dehambulation (gauche/droite) pour monstre
dd 0 ;pousseur ou pas pousseur (pour dyna)
dd 0 ;patineur au debut, ou pas (pour dyna)
hazard_bonus_lapin
;--- nivo foot
donnee_foot dw 52,52 ,244,244, 116,116, 180,180 ;x du dynablaster ;8*0
dw 73-32, 137-32,73,137,73,137, 73-32, 137-32
;y du dynablaster ;8*2
dw 24*0,777,24*2,24*3,24*4,24*5,24*6,24*7 ;source du dyna ;8*4
dd 1454080,1454080,1454080,1454080,1454080,1454080,1454080,1454080
dw 8 dup (18) ;nombre de lignes pour un dyna... ;8*10
dw 8 dup (16) ;nombre de colonnes. ;8*12
dd 8 dup (4+320*4)
dd 8 dup (offset machine)
dd 8 dup (0) ;résistance aux bobos... (par défault: pour monstre)
;pour les joueurs...
dd info1,info2,info3,info4,0
;premier dd: nombre de bombes que le joeur peut encore mettre.
;deuxieme dd: puissance de ces bombes... minimum = 1 ...
;troisieme dd: nombre de tous avant que ca pete.
;quatrieme dd: vitesse du joeur...
;pour les monstres
dd 8 dup (1,1,220,3,0)
dd 8 dup (0) ;invinsibilite au debut. (juste monstre)
dd 8 dup (0) ;blocage au debut. (juste monstre)
dd 0,0 ;invisibilite/blocage joeur
dd 8 dup (1) ;pousseurs au debut (pour monstres)
dd 8 dup (3) ;vitesse de dehambulation (gauche/droite) pour monstre
dd 0 ;pousseur ou pas pousseur (pour dyna)
dd 0 ;patineur au debut, ou pas (pour dyna)
hazard_bonus_foot
;--- nivo soccer
donnee_soccer dw 52,52,244,244,100,100,196,196 ;x du dynablaster ;8*0
dw 41,137,41,137,73,105,73,105 ;y du dynablaster ;8*2
dw 24*0,777,24*2,24*3,24*4,24*5,24*6,24*7 ;source du dyna ;8*4
dd 4 dup (512000,1454080)
dw 8 dup (32) ;nombre de lignes pour un dyna... ;8*10
dw 4 dup (32,38) ;26,26,16,23,26,32,17,38 ;nombre de colonnes. ;8*12
dd 4 dup (-9*320-4,-9*320-7) ;adder di ;8*16
dd 4 dup (offset grosbleu,offset escargot)
dd 2,2,2,2,2,2,2,2 ;résistance aux bobos... (par défault: pour monstre)
dd info1,info2,info3,info4,0
dd 1,1,220,3,0,1,1,220,3,0 ;2 premiers montres forcements ecrase!
;dd 1,1,220,2,0 ;le oldschool.
;dd 1,1,220,3,0 ;le coca
;dd 1,1,220,3,0 ;le bleu triste (grandes oreilles)
dd 3 dup (1,1,220,3,0,1,1,220,2,0) ;le gros bleu
;dd 1,1,220,3,0 ;le gros bleu
;dd 1,1,220,3,0 ;le gros bleu
;dd 1,1,220,3,0 ;le petit jaune
;dd 1,1,220,2,0 ;l'escargot
;dd 1,1,220,2,0 ;l'escargot
;dd 1,1,220,2,0 ;l'escargot
dd 8 dup (0) ;invinsibilite au debut. (""")
dd 8 dup (0) ;blocage au debut. (juste monstre)
dd 0,0 ;invisibilite/blocage joeur
dd 0,0,0,0,0,0,0,0 ;pousseurs au debut (pour monstres)
dd 4 dup (3,4) ;vitesse de dehambulation (gauche/droite) pour monstre
dd 1 ;pousseur ou pas pousseur (pour dyna)
dd 0 ;patineur au debut, ou pas (pour dyna)
hazard_bonus_lapin
;--- (micro.pcx)
donnee_h dw 20,20,276,276,116,116,180,180 ;x du dynablaster ;8*0
dw 9,169,9,170,41,137,41,137 ;y du dynablaster ;8*2
dw 24*0,777,24*2,24*3,24*4,24*5,24*6,24*7 ;source du dyna ;8*4
dd 1454080,1454080,1454080,1454080,1454080,1454080,1454080,1454080
dw 27,27,27,27,27,27,27,27 ;nombre de lignes pour un dyna... ;8*10
dw 26,26,26,26,26,26,26,26 ;nombre de colonnes. ;8*12
dd -5*320-1,-5*320-1,-5*320-1,-05*320-1,-05*320-1,-05*320-1,-05*320-1,-05*320-1 ;adder di ;8*16
dd offset bleu_triste,offset bleu_triste,offset bleu_triste,offset bleu_triste,offset bleu_triste,offset bleu_triste,offset bleu_triste,offset bleu_triste
dd 8 dup (1) ;résistance aux bobos... (par défault: pour monstre)
dd info1+7,info2+7,info3,info4,0
dd 8 dup (1,1,220,3,0)
dd 8 dup (200) ;invinsibilite au debut. (""")
dd 8 dup (250) ;blocage au debut. (juste monstre)
dd 0,0 ;invisibilite/blocage joeur
dd 8 dup (1) ;pousseurs au debut (pour monstres)
dd 8 dup (3) ;vitesse de dehambulation (gauche/droite) pour monstre
dd 1 ;pousseur ou pas pousseur (pour dyna)
dd 0 ;patineur au debut, ou pas (pour dyna)
hazard_bonus_lapin
;--- nuages
donnee_n dw 84 ,84 ,213,213, 20, 20,277,277 ;x du dynablaster ;8*0
dw 9 ,169,9 ,170,73,105,73,105 ;y du dynablaster ;8*2
dw 24*0,777,24*2,24*3,24*4,24*5,24*6,24*7 ;source du dyna ;8*4
dd 1454080,1454080,1454080,1582080,1454080,512000,576000,1454080
dw 27,27,19,21,27,32,18,32 ;nombre de lignes pour un dyna... ;8*10
dw 26,26,16,23,26,32,17,38 ;nombre de colonnes. ;8*12
dd -5*320-1,-5*320-1,4+320*3,320*1,-05*320-1,-9*320-4,4*320+3,-9*320-7 ;adder di ;8*16
dd offset bleu_triste,offset bleu_triste,offset old_school,offset coca,offset bleu_triste,offset grosbleu,offset petit_jaune,offset escargot
dd 1,1,0,1,1,2,0,2 ;résistance aux bobos... (par défault: pour monstre)
dd info1,info2,info3,info4,0
dd 1,1,220,3,0,1,1,220,3,0 ;2 premiers montres forcements ecrase!
dd 1,1,220,2,0 ;le oldschool.
dd 1,1,220,3,0 ;le coca
dd 1,1,220,3,0 ;le bleu triste (grandes oreilles)
dd 1,1,220,3,0 ;le gros bleu
dd 1,1,220,3,0 ;le petit jaune
dd 1,1,220,2,0 ;l'escargot
dd 8 dup (0) ;invinsibilite au debut. (""")
dd 8 dup (0) ;blocage au debut. (juste monstre)
dd 0,0 ;invisibilite/blocage joeur
dd 0,0,0,0,1,0,0,0 ;pousseurs au debut (pour monstres)
dd 3,3,3,3,3,3,3,4 ;vitesse de dehambulation (gauche/droite) pour monstre
dd 0 ;pousseur ou pas pousseur (pour dyna)
dd 0 ;patineur au debut, ou pas (pour dyna)
hazard_bonus_lapin
;--- crayon
donnee_c dw 20 ,20 ,277,277, 20, 20,277,277 ;x du dynablaster ;8*0
dw 9 ,169,9 ,169,73,105,73,105 ;y du dynablaster ;8*2
dw 8 dup (24*5) ;source du dyna ;8*4
dd 8 dup (1582080)
dw 21,21,21,21,21,21,21,21 ;nombre de lignes pour un dyna... ;8*10
dw 23,23,23,23,23,23,23,23 ;nombre de colonnes. ;8*12
dd 8 dup (320*1)
dd 8 dup (offset coca)
dd 8 dup (1)
dd info1,info2,info3,info4,0
; dd 1,1,220,3,0,1,1,220,3,0 ;2 premiers montres forcements ecrase!
; dd 1,1,220,2,0 ;le oldschool.
dd 8 dup (1,1,220,3,0) ;le coca
; dd 1,1,220,3,0 ;le bleu triste (grandes oreilles)
; dd 1,1,220,3,0 ;le gros bleu
; dd 1,1,220,3,0 ;le petit jaune
; dd 1,1,220,2,0 ;l'escargot
dd 8 dup (0) ;invinsibilite au debut. (""")
dd 8 dup (0) ;blocage au debut. (juste monstre)
dd 0,0 ;invisibilite/blocage joeur
dd 8 dup (0) ;pousseurs au debut (pour monstres)
dd 8 dup (3) ;vitesse de dehambulation (gauche/droite) pour monstre
dd 1 ;pousseur ou pas pousseur (pour dyna)
dd 0 ;patineur au debut, ou pas (pour dyna)
hazard_bonus_crayon
;--- foret
donnee_f dw 20,20 ,277,277,116,116,180,180 ;x du dynablaster ;8*0
dw 9 ,169,9 ,169,41 ,105,41 ,137 ;y du dynablaster ;8*2
dw 24*0,777,24*2,24*3,24*4,24*5,24*6,24*7 ;source du dyna ;8*4
dd 1454080,1454080,1454080,1454080,1454080,1454080,1454080,1454080
;512000,512000,512000,512000,512000,512000,512000,512000 ;source bloque memoire ;8*6
dw 32,32,32,32,32,32,32,32 ;nombre de lignes pour un dyna... ;8*10
dw 38,38,38,38,38,38,38,38 ;nombre de colonnes. ;8*12
dd -9*320-7,-9*320-7,-9*320-7,-9*320-7,-9*320-7,-9*320-7,-9*320-7,-9*320-7 ;adder di ;8*16
dd offset escargot,offset escargot,offset escargot,offset escargot,offset escargot,offset escargot,offset escargot,offset escargot
dd 8 dup (2) ;résistance aux bobos... (par défault: pour monstre)
dd info1,info2,info3,info4,0
dd 8 dup (1,1,220,2,0) ;monstres vitesse lente (escargots...)
dd 8 dup (0) ;invinsibilite au debut. (""")
dd 8 dup (0) ;blocage au debut. (juste monstre)
dd 0,0 ;invisibilite/blocage joeur
dd 8 dup (0) ;pousseurs au debut (pour monstres)
dd 8 dup (4) ;vitesse de dehambulation (gauche/droite) pour monstre
dd 0 ;pousseur ou pas pousseur (pour dyna)
dd 0 ;patineur au debut, ou pas (pour dyna)
hazard_bonus_lapin
;escargot
;mov edi,896000+384000+46080+64000 ; 128000 ;307200
;resistance_au_debut_pour_un_dyna equ 0
donnee_s_neige dw 20,20,277,277-32,116-16-16,116,180+16+16,180 ;x du dynablaster
dw 9,169,9,169,41,137,41,137-16-16 ;y du dynablaster
dw 24*0,777,24*2,24*3,24*4,24*5,24*6,24*7 ;source du dyna
dd 576000,576000,576000,576000,576000,576000,576000,576000 ;source bloque memoire
dw 18,18,18,18,18,18,18,18 ;nombre de lignes pour un dyna...
dw 17,17,17,17,17,17,17,17 ;nombre de colonnes.
dd 4*320+3,4*320+3,4*320+3,4*320+3,4*320+3,4*320+3,4*320+3,4*320+3;adder di
dd offset petit_jaune,offset petit_jaune,offset petit_jaune,offset petit_jaune,offset petit_jaune,offset petit_jaune,offset petit_jaune,offset petit_jaune
dd 8 dup (0) ;résistance aux bobos... (par défault: pour monstre)
dd info1,info2,info3,info4,0
dd 8 dup (1,1,220,3,0)
dd 8 dup (0) ;invinsibilite au debut. (""")
dd 8 dup (0) ;blocage au debut. (juste monstre)
dd 0,0 ;invisibilite/blocage joeur
dd 8 dup (0) ;pousseurs au debut (pour monstres)
dd 8 dup (3) ;vitesse de dehambulation (gauche/droite) pour monstre
dd 0 ;pousseur ou pas pousseur (pour dyna)
dd 0 ;patineur au debut, ou pas (pour dyna)
hazard_bonus_classique
;avec un dyna...
mort_de_lapin dw 00,00,01,02,03,04 ;6
dw 05,06,07,08,09,10 ;12
dw 11,12,14,15,17,18 ;18
dw 20,21,23,24,25,24 ;24
dw 23,21,20,18,17,15 ;30
dw 14,12 ;32
saut_de_lapin2 dw 02,04,05,07,08,10
dw 11,13,14,15,16,17
dw 18,19,20,21,22
;50%
dw 22,21,20
dw 19,18,17,16,15,14
dw 13,11,10,08,07,05
dw 04
dw 02,00,00,00
dw 00,00,00,00
saut_de_lapin dw 01,02,03,04,05,06
dw 07,08,09,10,11,11
dw 12,12,13,13,14
;50%
dw 14,13,13
dw 12,11,10,09,08,07
dw 06,05,04,03,02,01
dw 00
dw 00,00,00,00
dw 00,00,00,00
dw 320*00,320*00,320*00,320*00
dw 320*00,320*00,320*00,320*00
dw 320*00,320*00,320*00,320*00
dw 320*00,320*00,320*00,320*00
n_team dd 0,1,2,3,4,5,6,7 ;par default
dd 2
c_team dd 0,0,1,1,2,2,3,3 ;par couleur
dd 3 ;minimum joueurs
s_team dd 0,1,0,1,0,1,0,1 ;par sexe
dd 2
infojoueur dd offset j1,offset j2,offset j3,offset j4,offset j5,offset j6,offset j7,offset j8
panning2 db 0,1,2,3,4,5,6,6,7,7,8,8,9,10,11,12,13,14,15
; FORTHE SAVE STATES IT START HERE:
;------------------------------- dd --------------------------------------
replayer_saver dd 0
replayer_saver2 dd 0
replayer_saver3 dd 0
replayer_saver4 dd 0
replayer_saver5 db 0
;*--*-*-*-*-*-*-*-* BLOCK ENVOIS AUX SLAVES -*-*-*-*-*-*-*-*-*-*-*-*-*-
;---
nb_unite_donnee4 EQU 9
;donnee4 db 8*(nb_unite_donnee4) dup (0) ;source DD=666 rien afficher il est mort.
donnee4 db 8*(9) dup (0) ;source DD=666 rien afficher il est mort.
;si ordre2=''
; 8x source DD, destination dw pour chaque dyna..., db: nombre de ligne du dyna
; (serra trié é l'affichage par chaque machine.mettra dest a ffffh)
;si ordre2='Z'
; copie de "victoires dd 8 dup (?)" ;8*4=32
; et 1 dd avec le offset du dernier ki a eu une victoire... ;+4=36
; (latest_victory)
; puis les 4 dd: des sources du dyna de face (gauche/droite) ki ;+16=52
; a gagné...
; puis 1 db: le nombre de lignes k'il fait... +1=53
; puis 1 db: nombre de colonnes k'il fait +1=54
; puis 1 db: divers infos... bit0: clignotement ? (pour vulnéralité)
;.............................................................................
attente dd max_attente
nosetjmp db 0
nuage_sympa dd 296+120*320 ,0,508, 64+16*320,1B
dd 296+80*320 ,350,575,64+(16+22)*320,1B
dd 296+151*320 ,480,598,64+16*320,0B
dd 296+9*320 ,38,671, 64+16*320,1B
dd 296+97*320 ,100,512,64+16*320,1B
dd 296+59*320 ,180,1007,64+16*320,0B
dd 296+161*320 ,250,799,64+16*320,0B
dd 296+57*320 ,300,655,64+(16+22)*320,1B
dd 296+129*320 ,055,503,64+16*320,1B
dd 296+68*320 ,400,572,64+(16+22)*320,0B
dd 296+166*320 ,200,597,64+16*320,1B
dd 296+33*320 ,300,679,64+16*320,0B
dd 296+89*320 ,400,538,64+(16+22)*320,0B
dd 296+19*320 ,900,1008,64+16*320,0B
dd 296+174*320 ,600,991,64+(16+22)*320,1B
dd 296+55*320 ,800,655,64+(16+22)*320,1B
;combien_faut_baisser dd 320*14,320*13,320*12,320*11,320*10,320*9,320*8
; dd 320*7,320*6,320*5,320*4,320*3,320*2,320*1
;combien_faut_baisser2 dd 14,13,12,11,10,9,8
; dd 7,6,5,4,3,2,1
vise_de_ca_haut dd 8 dup (0)
vise_de_ca_haut2 dd 8 dup (0)
;attente_avant_adder_inser_coin dd ?
adder_inser_coin dd ?
viseur_ic2 dd ?
inser_coin dd ? ;32
acceleration dd ?
attente_entre_chake_bombe dd 0
nouvelle_attente_entre_chake_bombe2 dd 3,16,2,21,8,17,9,5,20,15,8,12,20,15,12,10,6,25,17
viseur__nouvelle_attente_entre_chake_bombe dd 0
liste_bombbbb dd 32*5+1 ;5ere ligne a gauche
dw -6
dw 1
dd 155
bombe_a_gauche 9
bombe_a_droite 3
bombe_a_gauche 5
bombe_a_droite 9
bombe_a_gauche 1
bombe_a_droite 5
bombe_a_gauche 11
bombe_a_droite 11
bombe_a_gauche 5
bombe_a_droite 9
bombe_a_gauche 1
bombe_a_droite 1
bombe_a_gauche 7
bombe_a_droite 5
bombe_a_gauche 11
bombe_a_droite 9
bombe_a_gauche 3
bombe_a_droite 11
bombe_a_gauche 9
bombe_a_droite 3
bombe_a_gauche 1
bombe_a_droite 1
bombe_a_gauche 11
bombe_a_droite 5
bombe_a_gauche 9
bombe_a_droite 7
bombe_a_gauche 1
bombe_a_droite 1
bombe_a_gauche 3
bombe_a_droite 11
liste_bombbbb2 dd 0
;attente_entre_chake_bombe dd 0
;nouvelle_attente_entre_chake_bombe2 dd 16,21,17,9,20,15,12,20
;viseur__nouvelle_attente_entre_chake_bombe dd 0
;;cas particulier: terrain6 plus apres lapocalypse, pas de bonus
;pour pas ke y'en a*i partout, donc on
;decompte le tempos pendant lekel ya pas de bonus
special_nivo_6 dd ?
differentesply2 dd 0 ; ;0
nb_sply EQU 16
temps_avant_demo dd 0 ;temps_avant_demo2
ttp dd 3200
;bomber_locaux dd offset touches_
; dd offset touches_+8*4
; dd offset touches_+8*4*2
; dd offset touches_+8*4*3
; dd offset touches_+8*4*4
; dd offset touches_+8*4*5
; dd offset touches_+8*4*6
; dd offset touches_+8*4*7
; db 'UP ',3 ;112
; db 'DOWN ',3 ;113
; db 'LEFT ',3 ;114
; db 'RIGHT ',3 ;115
arbre dd 0
viseur_couleur dd 0
;derniere voix utilisée (*2)
;3 affiche tout le monde en mechant
;monstro dd 0 ; monstromanie; 0:non 1:montromanie gros montre
attente_nouveau_esc dd 0
nombre_de_dyna_x4 dd ?
changeiny dd 08,24,16,00,16,24,08,00
dd 08,24,08,00,08,24,16,00
viseur_change_in dd 0,4,8,12,16,20,24,28
viseur_change_in_save dd 0,4,8,12,16,20,24,28 ;pour replay
;0= face bas. -> droite 8
;8= droite droite -> haut 24
;16= gauche gauche -> bas 0
;24= haut haut -> gauche 16
anti_bomb dd 24,24
dd 16,16
dd 8,8
dd 0,0
machin2 dd 0
machin3 dd 0
russe EQU 36*640
machin dd 0 ,11 ,22 ,33 ,44 ,55 ,66 ,77 ,88 ,99 ,110 ,121 ,132 ,143 ,154 ,165
dd 11+165,22+165,33+165,44+165,55+165,66+165,77+165,88+165,99+165,110+165,121+165,132+165,143+165,154+165
dd 154+165
; dd ,165+165
dd 0+russe ,11+russe ,22+russe ,33+russe ,44+russe ,55+russe ,66+russe ,77+russe ,88+russe ,99+russe ,110+russe ,121+russe ,132+russe ,143+russe ,154+russe ,165+russe
dd 11+165+russe,22+165+russe,33+165+russe,44+165+russe,55+165+russe,66+165+russe,77+165+russe,88+165+russe,99+165+russe,110+165+russe,121+165+russe,132+165+russe,143+165+russe,154+165+russe
dd 154+165+russe
;,165+165+russe
duree_draw dd ?
duree_med dd ?
duree_vic dd ?
affiche_raster dd 0
save_banke dd ?
;affiche_raster2 dd -1
attente_avant_draw dd ?
attente_avant_med dd ?
pic_time dd pic_max
;differentesply dd 1966080+64000,1966080+64000*2,1966080+64000*3,1966080+64000*4,1966080+64000*5
;64000*3,
viseur_sur_fond dd 0
viseur_sur_draw dd 0
viseur_sur_vic dd 0
max_attente equ 25 ;
max_attente4 equ 5
min_attente equ 15 ;
;garcon
;donnee dw nb_dyna dup (50) ;x du dynablaster
; dw nb_dyna dup (100) ;y du dynablaster
; dw nb_dyna dup (24*10) ;offset source du dynablaster (dans buffer2)
compteur_nuage dd 0 ;utilisé aussi pour les anims du nivo foot
changementZZ dd 0
changementZZ2 dd time_bouboule
changement dd 0
;---- TRUC ET TRUC2 DOIVENT ETRE COLLES
truc db 32*13 dup (?)
; db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 1,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 1,0,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 1,2,2,2,2,2,0,0,2,2,2,0,0,2,2,2,2,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 1,2,1,2,1,2,1,0,1,2,1,0,1,2,1,2,1,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 1,2,1,2,1,2,1,0,1,2,1,0,1,2,1,2,1,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 1,2,2,2,2,2,0,0,2,2,2,0,0,2,2,2,2,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 1,0,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 1,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0
;TRUC ET TRUC2 DOIVENT ETRE L'UN A LA SUITE DE L'AUTRE...
;0 vide, 1: dur incassable
; 2: dur cassable
; 3,4,5,6,7,8,9,10 piece en destruction (mettre 3 pour la detruire...)
;bombes !!!!
;11: piece dure pour la fin du jeu. tombée quoi...
truc2 db 32*13 dup (?)
;db 0,0,0,0,0,0,00,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 0,0,0,0,0,0,00,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 0,0,0,0,00,00,0,00,00,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 0,0,0,0,0,0,00,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 0,0,0,0,0,0,00,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
; db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
; 40
; 33
; 19 12 05 12 26
; 33
; 47
;1 = bombe... (2,3,4) respirant... si c sup a 4; on est mort...
;5 = centre de bombe. de 5 a 11
;12 = ligne droite...
;19 = arrondie ligne droite vers la gauche...
;26 = arrondie ligne droite vers la droite
;33 = ligne verti
;40 arrondie verti vers le haut
;47-- bas
;54-- bonus bombe... de 54 a 63 (offset 144)
;64-- bonus flamme... de 64 a 73 (offset 144+320*16)
;74-- tete de mort de 74 a 83
;84-- bonus parre balle. de 84 a 93
;94-- bonus COEUR !!!
;104 -- bonus bombe retardement
;114 --- bonus pousseur
;124 --- patins a roulettes
;134 --- HORLOGE
;193-- OEUF
;194-- explosion d'un bonus... de 194 a 200 (offset 0.172 31x27 +32)
;4,5,6,7,8,9,0
truc_X db 32*13 dup (?) ;+ ou -...
truc_Y db 32*13 dup (?) ;adders x et y pour les bombes !!!
truc_monstre db 32*13 dup (?)
;***************** CENTRAL **************************************
;on ecris ici uniquement quand on recoit un packet
;FLECHES appuyée pour chacun des dyna sur tous les ordinateur
;touches dd nb_dyna dup (?)
touches dd 8 dup (?)
;0= face bas.
;8= droite droite
;16= gauche gauche
;24= haut haut
;+128 si le perso ne bouge pas...
;avance dd nb_dyna dup (?)
avance dd 8 dup (?)
avance2 dd 8 dup (?) ;15,60,7,25,13,2,79,33 compte a rebourd avant autre action
touches_save dd 8 dup (?) ;last successfull touches !!!!
;touches_save dd nb_dyna dup (?) ;last successfull touches !!!!
;action, touches d'action appuyés pour chacun des joeurs...
;ACTION db nb_dyna dup (?,?,?,?)
ACTION db 8 dup (?,?,?,?)
;touches action 1 puis touche action 2...
;0=non appuyée
;1=passablement activé
vie dd 8 dup (?)
;1,1,1,1,1,1,1,1
;-- les 2 variables doivent etre ensemble (victoires+lastest_victory)
victoires dd 8 dup (?)
latest_victory dd ?
;---
;--- laisser ces 2 variables ensembles !!! ==
team dd 8 dup (?) ;0,1,2,3,4,5,6,7 ;par default
nombre_minimum_de_dyna dd 2
;=============================================
;;ipx_ dd 0 ;1 ;1:oui_ par default... (indique teste serra fait...)
;0:non...
;temporaire... pour stocker a partir de la source d'un nivo et on recopie ensuite
;en fonction du nombre de dynas...
infos_j_n dd 5 dup (?) ;joueurs...
infos_m_n dd 5*8 dup (?) ;les montres
last_bomb dd 8 dup (?)
;dernier offset dans truc ou le dyna a été...
;premier dd: nombre de bombes que le joeur peut encore mettre.
;deuxieme dd: puissance de ces bombes... minimum = 1 ...
;troisieme dd: nombre de tous avant que ca pete.
;quatrieme dd: vitesse du joeur... 1:1vbl/4,2: 1/vbl/2,3:chaque ,4:2 fois/vbl
;5eme mode bombes a retardement ou pas ???
bombe_max EQU 16 ;nombre max de bombes k'on peut poser. au grand max
bombe_max2 EQU 16 ;nombre max de puissance bombes k'on peut avoir
viseur_liste_terrain dd 0
nombre_de_dyna dd ? ;variable appartenant au master... mais transmise
;a toutes les becanes...
nb_ai_bombermen db 0
nombre_de_monstres dd ?
nombre_de_vbl_avant_le_droit_de_poser_bombe dd ? ;pour début de partie...
info_joeur MACRO toto
toto dd ?,?,?,?,?
;toto db 20 dup (?)
;toto dd 3,3,150
ENDM
;***** laisser ensemble ****
info_joeur j1
info_joeur j2
info_joeur j3
info_joeur j4
info_joeur j5
info_joeur j6
info_joeur j7
info_joeur j8
;****************************
taille_dune_info_bombe EQU 6*4
;1er: offset de l'infojoeur
;2eme: nombre de tours avant que ca PETE !!! ; si = 0 ca veut dire
; ;emplacement libre...
;3eme:distance par rapport au debut de truc2
;4eme:DD= 1 DW: puissance de la bombe + 1 DW: bombe a retardement ??? (=1)
; =2 semi-retardement (cas
; particulier a la fin des
; parties. (victoire dun dyna)
; pour ne pas kil puisse retenir
; bloke le jeu a cause de sa bombe
;5eme: VITESSE:1 dw:X (+1/-1/0) ,1 dw:Y (+1/-1/0)
;6eme: ADDER_X/Y: 1 dw:X,1 dW:Y
donnee dw 8*3 dup (?) ;x du dynablaster ;y du dynablaster ;source du dyna dans bloque
ooo546 dd 8 dup (?) ;source bloque memoire
dw 8 dup (?) ;nombre de lignes pour un dyna...
dw 8 dup (?) ;nombre de colonnes.
dd 8 dup (?) ;adder di (pour la girl + grande...)
liste_couleur dd 8 dup (?) ;offset sur la table d offset sprite correpondant dd 8 dup (?) ;avant la mort...
nombre_de_coups dd 8 dup (?) ;avant la mort...
;donnee dw 8 dup (?) ;x du dynablaster
; dw 8 dup (?) ;y du dynablaster
; dw 8 dup (?) ;source du dyna dans bloque
;ooo546 dd 8 dup (?) ;source bloque memoire
; dw 8 dup (?) ;nombre de lignes pour un dyna...
; dw 8 dup (?) ;nombre de colonnes.
; dd 8 dup (?) ;adder di (pour la girl + grande...)
clignotement dd 8 dup (?) ;varie entre 1 et 0 quand invinsible <>0
;mis a jour par la proc "blanchiment"
pousseur dd 8 dup (0)
patineur dd 8 dup (?)
vitesse_monstre dd 8 dup (?) ;vitesse de dehanbulation du monstre (gaucge_droite)
tribombe2 dd 8 dup (?) ; indique depuis combien de temps le dyna
; a relache sa touche action 1
tribombe dd 8 dup (?)
invinsible dd 8 dup (?) ;invincibilité. nombre de vbl restant ... décrémentée... 0= none...
;si = 0, mortel.
blocage dd 8 dup (?) ;nombre de vbl bloke
;si = 0, bouge.
lapipipino dd 8 dup (?) ;si = 1, on est un lapin
lapipipino2 dd 8 dup (?) ;si = 0 activite de lapin normalle
;si = 1 saut vertical
lapipipino3 dd 8 dup (?) ;compteur activite
lapipipino4 dd 8 dup (?) ;hauteur du lapin x320(lors des sauts Y)
lapipipino5 dd 8 dup (?) ;hauteur du lapin x1 (lors des sauts Y)
lapipipino6 dd 8 dup (?) ;indique kon devient un lapin au prochain
;vbl..
lapipipino7 dd 8 dup (?) ; chiffre partir dukel on arrete
;de fqire bouger le lapin ki saute
; dqns le cqs ou le lapin
; saute dans une direfction
;utilise pour ajuste lorske
;le lapin depasserrait sur la case den dessous
action_replay db 0 ; 0 = RIEN
; 1 = REC
; 2 = PLAY
ordre2 db ? ;ordre 2...
;'' dans le jeu...
;'D' Draw Game...
;'M' saute au menu
;'%' indique nouvelle manche
;'Z' médaille céremony
;'V' victoire supreme céremony
detail db 0 ;
mechant db 0 ;0 ne fait rien...
;1 efface le fichier...
;2 affiche le raster rouge
terrain db ? ; 1:fete, 2: neige...
; 3:hell.
; 4:foret 5:nuage
; 6:crayon
; 7:foot (;) )
; 8:soccer
team3 db ? ; 0=normal, 1=color, 2=sexe
pauseur2 db 0 ; pauseur !!! ;1,2,3,4 pour les images de la fille
bdraw666 db ?,?
adder_bdraw dw ? ;51*320
temps dw ? ;duree_match ;001100000000B ;time
;--- pour ombres ---
kel_ombre dd 0
ombres dw 8 dup (0)
;-------------------
;sexe db 00001111B ;sexe pour chaque dyna. (bit 0=dyna 0)
;masculin=0
;---
;---
briques dw 1+19*13*2 dup (?) ;nombre de brique, source de la brique, destination
;dans buffer video
;si on est dans 'Z' médaille céremony
;les noms de chaque joueur. 8x4 octets.
;+ 1 db= faut afficher la brike ki clignote ou pas???
bombes dw 1+19*13*2 dup (?) ; pareil pour les bombes & explosion & bonus
;+ bonus qui explose.
;cas particulier: offzet >= 172*320
;gestion differente de l'afficheur...
taille_bloc_the_total EQU 1500-packet_header_size ; 8*2*3 ;+1 +19*13*2*4
;que pour l'ecoute en fait. bidon ??
;-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*--
;offset offset grosbleu,offset bleu,offset vert,offset rouge,offset blancg,offset bleug,offset vertg,offset rougeg
control_joueur dd 8 dup (0) ;-1,6,32,32+6,-1,-1,-1,-1
;special replay:
control_joueur2 dd -64,-64+7,-64+7*2,-64+7*3,-64+7*4,-64+7*5,-64+7*6,-64+7*7
;-1,6,32,32+6,-1,-1,-1,-1
;offset dans la totale des touches appyee du master.
;-1,6,32,32+6,-1,-1,-1,-1
name_joueur dd 8 dup (?) ;pour dans le menu...
;0: pas encore inscrit.
;1: récupere la premiere lettre
;2: récupere la premiere lettre
;3: récupere la troisieme lettre
;4: finis... attend de jouer
temps_joueur dd 8 dup (?) ;temps d'attente avant validation
;d'une nouvelle frappe de touche.
;dans menu...
nb_max_ordy EQU 10 ;dans la liste...
;adresse_master db 12 dup (0)
;liste_adresse db nb_max_ordy*16 dup (0)
;liste_adresse db 10*16 dup (0)
;adresse des autres ordinateurs connectés... 10 premiers octets...
;12 premiers octets: adresse, puis ACTIVIté 'okok' ca roule
; 'dead' plus de réponse...
nb_ordy_connected dd 0 ; nombre d'otres ordy...
;last_packet_size dd 100
;adresse_master db 12 dup (0)
;00,00,00,00,00,040h,05h,2ah,3dh,8fh,40h,02h
;00,00,00,00,00,0c0h,0a8h,40h,06h,03h,40h,02h ; ordy numéro 1
;cultura MACRO d
;ENDM
;----- les offset pour le nick de chaque pseudo et le méme ke pour les
;packet des touches...
;cultura nick_t
; cultura
; cultura
; cultura
; cultura
; cultura
; cultura
; cultura
last_name dd ?
;---------- endroit ou on decompacte les touches kan on fait le play
total_play db 0,0,0,0 ,0,0 ;1er joeur d'un ordy.
db 0,0,0,0 ,0,0 ;2eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;3eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;4eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;5emejoeur d'un ordy.
db 0,0,0,0 ,0,0 ;6eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;7eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;8eme joeur d'un ordy
db 0,0,0 ;return,esc, touche pressee
db 0,0,0,0,0,0,0,0,0,0,0,0,0 ;pour faire 64 octets...
;---------- packet de touches pour chaque ordy...
total_t db 0,0,0,0 ,0,0 ;1er joeur d'un ordy.
db 0,0,0,0 ,0,0 ;2eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;3eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;4eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;5emejoeur d'un ordy.
db 0,0,0,0 ,0,0 ;6eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;7eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;8eme joeur d'un ordy
db 0,0
db 14 dup (0) ;pour faire 64 octets...
db 0,0,0,0 ,0,0 ;1er joeur d'un ordy.
db 0,0,0,0 ,0,0 ;2eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;3eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;4eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;5emejoeur d'un ordy.
db 0,0,0,0 ,0,0 ;6eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;7eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;8eme joeur d'un ordy
db 0,0
db 14 dup (0) ;pour faire 64 octets...
db 0,0,0,0 ,0,0 ;1er joeur d'un ordy.
db 0,0,0,0 ,0,0 ;2eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;3eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;4eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;5emejoeur d'un ordy.
db 0,0,0,0 ,0,0 ;6eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;7eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;8eme joeur d'un ordy
db 0,0
db 14 dup (0) ;pour faire 64 octets...
db 0,0,0,0 ,0,0 ;1er joeur d'un ordy.
db 0,0,0,0 ,0,0 ;2eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;3eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;4eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;5emejoeur d'un ordy.
db 0,0,0,0 ,0,0 ;6eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;7eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;8eme joeur d'un ordy
db 0,0
db 14 dup (0) ;pour faire 64 octets...
db 0,0,0,0 ,0,0 ;1er joeur d'un ordy.
db 0,0,0,0 ,0,0 ;2eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;3eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;4eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;5emejoeur d'un ordy.
db 0,0,0,0 ,0,0 ;6eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;7eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;8eme joeur d'un ordy
db 0,0
db 14 dup (0) ;pour faire 64 octets...
db 0,0,0,0 ,0,0 ;1er joeur d'un ordy.
db 0,0,0,0 ,0,0 ;2eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;3eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;4eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;5emejoeur d'un ordy.
db 0,0,0,0 ,0,0 ;6eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;7eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;8eme joeur d'un ordy
db 0,0
db 14 dup (0) ;pour faire 64 octets...
db 0,0,0,0 ,0,0 ;1er joeur d'un ordy.
db 0,0,0,0 ,0,0 ;2eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;3eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;4eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;5emejoeur d'un ordy.
db 0,0,0,0 ,0,0 ;6eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;7eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;8eme joeur d'un ordy
db 0,0
db 14 dup (0) ;pour faire 64 octets...
db 0,0,0,0 ,0,0 ;1er joeur d'un ordy.
db 0,0,0,0 ,0,0 ;2eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;3eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;4eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;5emejoeur d'un ordy.
db 0,0,0,0 ,0,0 ;6eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;7eme joeur d'un ordy
db 0,0,0,0 ,0,0 ;8eme joeur d'un ordy
db 0,0
db 14 dup (0) ;pour faire 64 octets...
;***************** variables IPX *********************************************
;model des packets recus par le master.. (envoyé par slave.)
;----------------------------------------------------------------------------
;cette zone mémoire est d'abord utiliseé par le local (master) en transmition
;directe a partir des touches puis par les autres ordy via communtication.
donnee2 db 0,0,0,0 ,0,0,0 ;1er joeur d'un ordy.
db 0,0,0,0 ,0,0,0 ;2eme joeur d'un ordy.
db 0,0,0,0 ,0,0,0 ;3eme joeur d'un ordy
db 0,0,0,0 ,0,0,0 ;4eme joeur d'un ordy
db 0,0,0,0 ,0,0,0 ;5er joeur d'un ordy.
db 0,0,0,0 ,0,0,0 ;6eme joeur d'un ordy
db 0,0,0,0 ,0,0,0 ;7eme joeur d'un ordy
db 0,0,0,0 ,0,0,0 ;8eme joeur d'un ordy
db 0,0 ;si ordy presse RETURN + si ordy presse ESC.
db 0 ;n'importe kelle touche presse ???
touches_size EQU 7*8+2+1
;donnee98 db ' ... server found !!! x player(s) in xxxx. '
;menu_ db 'menu'
;game_ db 'game'
;demo_ db 'demo'
;no_dyna db 13,10,'No game Network found... Creating one...',13,10,'$'
;no_dyna2 db 13,10,'Connected as slave to the other computer (no display mode:use the keyboard !).',13,10,'$'
;pas_de_mem db 'NOT enought memory for VGA display, controls work for network games',13,10,'$'
;pbs1 db 'probleme dans allocation de descriptor..',13,10,'$'
;pbs2 db 'probleme dans dans definition de la taille du segment',13,10,'$'
;socketipx db 'cannot open socket.',13,10,'$'
;erreur_dans_ecoute2 db 'erreur dans ecoute',13,10,'$'
;information db 'Type "speed" during the game to get maximum speed.',13,10,'$'
;pasipx db 'NO IPX DRIVERS FOUND ! NO NETWORK GAME ! NO INTERREST !',13,10,'$'
;msg1 db 'packets envoyes: $'
;msg2 db 'packets recus: $'
;msg3 db 'taille packets envoys par master (hors menu): $'
;msg4 db 'KB',13,10,'$'
;
;ipx db 'IPX detected !!! ',13,10,'$'
nick_t db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db ' '
db 'bot',87h,' '
db 'bot',87h,' '
db 'bot',87h,' '
db 'bot',87h,' '
db 'bot',87h,' '
db 'bot',87h,' '
db 'bot',87h,' '
db 'bot',87h,' '
db ' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db ' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db ' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db ' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db ' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db ' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db 'aaa',87h,' '
db ' '
db 'cpu',87h,' '
; ;indique la fin pour le fichier de cryptage
;mov dl,''
;mov ah,2
;int 21h
; ; 18source
; db 4 dup (0) ;netadd ;REMPLIS AUTOMATIQUEMENT QUAND ON RECOIT
; db 6 dup (0) ;nodeadd ;contient l'adresse d'ou provient le message.
; dw 0 ;sockette...
nb_dyna equ 8
;***************** IPX ECOUTE ************************************************
packet_data_size equ 576-packet_header_size
packet_header_size equ 30
;ecouteur ecb1,header_ecoute
;ecouteur ecb3,header_ecoute3
;donnee3 db 0;pour envoyer donnée. systeme.
;envoye_data db 1500 dup (0)
;BIP IFF 10,050 08-06-97 4:36a
;BANG IFF 8,046 08-06-97 10:26a
;KLANNG IFF 9,373 08-06-97 10:27a
;SAC.IFF 18043 explosion d'un bonus
;TIC2.IFF 2090
;TIC6 6643 ;ding sonnerie avant fin...
;ouil.iff 3291 ;mort d'un dyna exceptionnel.
;ail.iff 3297 ;mort d'un monstre courageux.
;tribombe.iff 5752 ;(9) utilisation du bonus tribombe
;SAUT-LAP IFF 11 285 (10)
;POSEBOMB IFF 1 186 (11)
;MORTLAP IFF 34 928 (12)
;GAME1 PCX 29,535 07-04-97 3:28a -0
;GAME2 PCX 29,535 07-04-97 3:28a -1
;GAME3 PCX 29,096 07-04-97 3:28a -2
;SPRITE PCX 30269 07-30-97 8:40a -3
;SPRITE2 PCX 45239 07-30-97 5:26a -4
;MENU.PCX 51047 -5
;SPRITE3.PCX 27709 -6
;DRAW1.PCX 29855 -7
;DRAW2.PCX 29772 -8
;MED.PCX 38197 -9
;MED3.PCX 22395 -10
;VIC1 PCX 26 830 -11
;VIC2 PCX """""" -12
;VIC3 PCX """""" -13
;VIC4 PCX """""" -14
;NEIGE1 PCX 24,256 09-13-97 5:44a
;NEIGE2 PCX 24,229 09-13-97 5:44a
;NEIGE3 PCX 24,412 09-13-97 5:44a
;neige1 24256 -15
;neige2 24229 -16
;neige3 24412 -17
;pic.pcx 51618 -18
;mrfond.pcx 50396 -19
;micro.pcx 23593 -20
;nuage1 29069 21
;nuage2 28107 22
;foret.pcx 59615 -23
;feuille.pcx 40910 -24
;pause.pcx 30517 -25
;medc.pcx 35050 -26
;medg.pcx 33790 -27
;--------------------------------------- -28
;--------------------------------------- -29
;record0.mrb 64000 -30 neige
;record1.mrb 64000 -31 micro (hell)
;record2.mrb 64000 -32
;record3.mrb 64000 -33
;fete1.mrb 64000 -34
;crayon.pcx 25675 -35
;crayon2.pcx 10299 -36
;record5.mrb 64000 -37
;lapin1.pcx 25841 -38
;mort.pcx 11838 -39
;lapin2.pcx 25203 -40
;lapin3.pcx 24473 -41
;lapin4.pcx 25203 -42
;foot.pcx 52283 -43
;foot1.mrb 64000 -44
;foot2.mrb 64000 -45
;fete2.mrb 64000 -46
;neige2.mrb 64000 -47
;rose2.mrb 64000 -48
;jungle2.mrb 64000 -49
;micro2.mrb 64000 -50
;nuage2.mrb 64000 -51
;soucoupe.pcx 15266 -52
;soccer.pcx 62297 -53
;footanim.pcx 25477 -54
;lune1.mrb 64000 -55
;lune2.mrb 64000 -56
;*************** save des nivos *****************
;lapin_mania dd 8 dup (1966080+64000*7)
; dw 8 dup (32)
; dw 37,37,37,37,37,37,37,37 ;nombre de lignes pour un dyna... ;8*10
; dw 32,32,32,32,32,32,32,32 ;nombre de colonnes. ;8*12
; dd 8 dup (-11*320-4)
; dd -14*320-4,-14*320-4,-14*320-4,-14*320-4,-14*320-4,-14*320-4,-14*320-4,-14*320-4 ;adder di ;8*16
; dd 8 dup (offset lapin2)
lapin_mania dd 1966080+64000*7,1966080+64000*7
dd 1966080+64000*11,1966080+64000*11
dd 1966080+64000*9,1966080+64000*9
dd 1966080+64000*10,1966080+64000*10
lapin_mania_malade dd 1966080+64000*11,1966080+64000*11
dd 1966080+64000*7,1966080+64000*7
dd 1966080+64000*11,1966080+64000*11
dd 1966080+64000*11,1966080+64000*11
;dd 512000,512000,512000,512000,512000,512000,512000,512000 ;source bloque memoire ;8*6
; dw 8 dup (37)
; dw 32,32,32,32,32,32,32,32 ;nombre de colonnes. ;8*12
; dd 8 dup (-8*320-4)
lapin_mania1 dd offset lapin2,offset lapin2G
dd offset lapin2,offset lapin2G
dd offset lapin2,offset lapin2G
dd offset lapin2,offset lapin2G
lapin_mania2 dd offset lapin2_,offset lapin2_g
dd offset lapin2_,offset lapin2_g
dd offset lapin2_,offset lapin2_g
dd offset lapin2_,offset lapin2_g
lapin_mania3 dd offset lapin2__,offset lapin2__G
dd offset lapin2__,offset lapin2__G
dd offset lapin2__,offset lapin2__G
dd offset lapin2__,offset lapin2__G
lapin_mania4 dd offset lapin2___,offset lapin2___G
dd offset lapin2___,offset lapin2___G
dd offset lapin2___,offset lapin2___G
dd offset lapin2___,offset lapin2___G
lapin_mania5 dd offset lapin_mort,offset lapin_mortg
dd offset lapin_mort,offset lapin_mortg
dd offset lapin_mort,offset lapin_mortg
dd offset lapin_mort,offset lapin_mortg
truc_fin db 13*32 dup (?) ;endroit ou l'on place le compte é rebourd.
;enfin le nombre de vbl avant le défoncage lors
dd ? ;sa vitesse ; de L'(a)pocalypse.
;-***********************************************
ordre db 'M'
db 'menu' ;pout reconnaitre ou on est... enfin si c'est un packet
;menu ou pas.
texte1 db 32*4*8 dup (0) ;texte pour chaque dyna
taille_block_slave_menu equ 32*4*8+1+14*2
;panning2 db 15,14,13,12,11,10,09,08,08,07,07,06,06,05,04,03
; db 02,01,00
;,14,13,12,11,10,09,08,08,07,07,06,06,05,04,03
; db 02,01,00
maladie dw 16 dup (?)
autofire db 1
;---------------------- db ---------------------------------------
;save64 db 0
;economode db 0
;demande_partie_slave db 0
balance_le_bdrawn db ?
bdraw1 db ? ;32
;on_a_bien_fait_une_partie db 0
on_les_dans_le_menu db 1
sortie_slave db 0
modeinfo db 0
nomonster db 0
twice db 0 ;pour le mode twice faster.
twice2 db 0 ;pour le mode twice faster.
;32
lft equ 24
pic_de_tout_debut db 0 ;pour viser la palette de la pic detection reso
une_touche_a_telle_ete_pressee db 0 ;mis a un si on a touche le clavier
;depuis le dernier packet...
sors_du_menu_aussitot db 0 ;pour kon kitte le jeu aussitot apres avoir
;loade un fichier .mrb
team3_sauve db 0 ;
special_on_a_loadee_nivo db 0
record_user db 0 ;activé si on a le droit d'enclancher le mode REC/PLAY
;previentlmesenfants db 0 ;pour slave: affiche messgae fin
;-- mettre ensemble... ;0-32
hazard_bonus db 0,1,0,14,11,2,0,13,1,11,2,14,0,6,15,0,10,0,1,14,11,0,3,0,1,0,15,0,4,0,11,2,0,2,1,0,14,0,0,15,0,0,5,11,0,15
db 0,7,2,15,11,0,1,3,0,0,0,14,0,2,0,14,0,11,14,9,0,15,0,11,7,0,13,1,0,14,2,11,0,15,0,1,4,0,2,6,0,11,7,8,2,1,0,1,2,11,14,15,11
; db 0,54,0,64,0,114,74,0,64,0,0,54,0,74,0,0,64,0,104,54,0,64,0,0,64,0,54,0,0,64,0,0,0,94,0,64,114,0,64,0,74,0,0,84,0,0,0,54,0,64,0,64
; db 0,54,0,64,0,74,0,64,0,74,54,0,54,0,114,0,0,54,0,64,0,64,0,84,0,0,64,0,54,0,0,54,0,0,114,0,0,64,0,64,0,54,0,0,94,0,0,54,0,104,0,0,74,0,64,0,64,0
viseur_hazard_bonus dd 0
hazard_bonus2 db 0,1,2,3,4,5,6,7
db 8,9,10,11,12,13,14,15
;db 84,94,94,104,94,84,94,104,114,94,94,104,94,84,94,74,94,104,114
viseur_hazard_bonus2 dd 0
;---- laisser ces deux truc ENSEMBLES !! SOMBRE CRETIN
correspondance_bonus db 16 dup (?)
correspondance_bonus2 db 16 dup (?)
;----------------
;---
;54-- bonus bombe... de 54 a 63 (offset 144) ;1
;64-- bonus flamme... de 64 a 73 (offset 144+320*16) 2
;74-- tete de mort de 74 a 83 3
;84-- bonus parre balle. de 84 a 93 4
;94-- bonus COEUR !!! 5
;104 -- bonus bombe retardement 6
;114 --- bonus pousseur 7
;124 --- patins a roulettes 8
;134 --- HORLOGE 9
last_sucker db 0 ;derniere touche...
affiche_pal db 2 ; 1: vas de la palette au noir (ne plus afficher
; d'écran !!!)
;
; 2: va du noir a la palette
; 0: ne fait rien...
pause db 0 ;0=nan inverse = oui
pause2 db 0 ;temps ou on s'en fou
max_s equ 16 ;pour viseur rouge
max_s2 equ 8 ;pour viseur rouge
temps2 db ?
sortie db 0 ;sortie...
in_the_apocalypse db 0
pal db 0,0,0,7,7,4,8,6,5,10,6,6,11,5,7,11,8,8,7,6,8,9,8,8,9,8,7,11,10,10,17,13,10,19,14,10,22,17,11,4,3,3,9,10,8,11,12,10,13,12,12,15,15,14,17,17,17,22,21,20,23,22,22,27
db 25,25,28,26,26,23,24,15,15,13,10,13,13,13,17,15,12,13,11,14,17,18,14,20,21,15,23,20,14,29,21,8,19,6,10,19,8,5,6,4,4,19,3,3,21,3,3,24,8,13,27,5,5,28,17,7,29,19,19,23,20,23,31,30
db 31,13,8,7,14,6,8,17,7,8,19,9,13,23,10,16,6,5,6,8,7,9,10,7,10,12,8,12,11,12,16,14,14,18,16,15,21,20,17,24,21,20,25,23,24,26,26,26,28,30,27,29,34,29,29,12,8,10,14,8,11,13,4,4
db 22,15,14,17,12,17,24,12,20,27,15,15,30,10,17,22,13,13,22,14,10,22,11,6,29,22,20,23,15,11,20,19,19,24,17,11,20,17,12,20,17,14,26,19,11,19,12,9,29,17,9,19,9,9,18,13,11,26,23,22,26,20,16,13
db 9,13,15,5,5,16,8,5,19,10,6,21,10,6,24,13,7,26,14,7,27,15,8,29,12,4,30,20,10,32,18,11,31,23,10,33,26,10,35,30,10,15,9,9,15,7,7,30,7,7,17,10,8,13,2,2,8,5,5,10,7,3,3,4
db 6,16,3,3,13,8,5,11,10,8,7,8,12,14,10,10,31,25,23,31,28,25,34,30,27,29,23,12,37,37,36,31,26,13,17,10,10,21,5,10,10,10,3,19,11,11,15,10,13,18,12,13,6,9,11,33,29,14,36,33,14,33,33,33
db 6,5,8,5,8,8,9,9,14,10,11,13,15,13,16,19,13,13,20,13,13,20,15,14,24,17,15,25,15,14,23,19,15,25,19,17,26,19,17,26,21,18,29,21,17,29,20,15,0,23,0,28,23,19,31,23,18,32,25,18,33,28,19,35
db 30,20,35,31,23,35,31,27,6,9,6,5,7,12,6,9,14,8,8,15,8,10,16,10,13,18,12,15,20,14,17,22,17,19,23,20,21,25,25,25,25,27,24,27,29,28,29,33,28,27,35,32,30,36,36,41,12,15,10,17,14,18,15,18
db 12,18,16,19,18,21,15,20,20,20,21,24,19,29,24,21,23,3,3,18,14,21,25,3,3,20,17,20,21,19,22,20,19,28,24,22,24,33,9,9,36,10,10,26,23,25,23,23,34,24,27,22,29,32,23,34,25,16,33,39,23,39,23,15
db 40,37,20,39,29,17,39,44,22,49,17,31,46,33,16,40,41,39,33,3,3,34,11,4,39,12,12,35,16,5,8,14,27,35,20,13,41,26,16,27,26,40,43,28,16,52,41,16,30,31,47,34,35,49,44,30,16,42,14,14,33,3,21,38
db 17,6,14,21,34,41,19,6,44,17,17,44,20,7,48,24,24,48,12,12,52,30,11,52,33,33,55,35,11,49,4,21,41,4,4,47,23,8,49,12,5,50,24,9,51,28,6,59,29,42,51,37,7,57,41,10,55,47,16,40,40,52,42,42
db 40,44,44,40,59,48,10,44,44,44,45,45,54,58,54,16,62,56,9,61,61,17,51,49,41,49,46,42,48,47,41,53,51,42,54,52,42,48,48,48,50,51,57,56,53,42,54,50,45,59,54,47,59,52,52,61,61,61,41,41,39,39,40,39
pal_affiche db 768 dup (0) ;pal k'on affiche...
liste_bombe dd ? ; nombre de bombes...
liste_bombe_array dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
dd 3 dup (?)
dw 6 dup (?)
_DATA ends ;IGNORE
;ééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééé
; STACK
;ééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééé
stackseg segment para stack 'STACK' ;IGNORE
db 1000h dup(?) ;IGNORE
stackseg ends ;IGNORE
end start ;IGNORE
| Javanaise/mrboom-libretro | tools/asm/src/mrboom.asm | Assembly | mit | 363,957 |
EXTRN GetStdHandle: PROC
EXTRN WriteFile: PROC
EXTRN lstrlen: PROC
EXTRN ExitProcess: PROC
.DATA
hFile QWORD 0
msglen DWORD 0
BytesWritten DWORD 0
msg BYTE "Hello x64 World!", 13, 10, 0
.CODE
main PROC
;int 3 ; breakpoint for debugger
sub rsp, 28h
lea rcx, msg
call lstrlen
mov msglen, eax
mov ecx, -11 ; STD_OUTPUT
call GetStdHandle
mov hFile, rax
lea r9, BytesWritten
mov r8d, msglen
lea rdx, msg
mov rcx, hFile
call WriteFile
xor ecx, ecx ; exit code = 0
call ExitProcess
main ENDP
END
| markfinal/BuildAMation | tests/AssemblerTest1/source/helloworld64.asm | Assembly | bsd-3-clause | 644 |
assume cs:code,ds:data
data segment
t1 dw ?
t2 dw ?
sum dw ?
b dw ?
a dw ?
newl db ,13,10,"$"
string db 5
db ?
db 5 dup (?)
data ends
code segment
start:
mov ax,data
mov ds,ax
call readInput
mov a,bx
call readInput
mov b,bx
mov ax,b
mov t1,ax
mov ax,a
mov bx,t1
add ax,bx
mov t2,ax
mov ax,t2
mov sum,ax
mov ax,sum
call disp
mov ah,4ch
int 21h
disp proc
MOV BX, 10
MOV DX, 0000H
MOV CX, 0000H
.Dloop1:
MOV DX, 0000H
div BX
PUSH DX
INC CX
CMP AX, 0
JNE .Dloop1
.Dloop2:
POP DX
ADD DX, 30H
MOV AH, 02H
INT 21H
LOOP .Dloop2
mov dx,offset newl
mov ah,09h
int 21h
RET
disp ENDP
readInput proc
mov ah, 0Ah
mov dx, offset string
int 21H
call string2number
ret
readInput endp
string2number proc
;MAKE SI TO POINT TO THE LEAST SIGNIFICANT DIGIT.
mov si, offset string + 1 ;NUMBER OF CHARACTERS ENTERED.
mov cl, [ si ] ;NUMBER OF CHARACTERS ENTERED.
mov ch, 0 ;CLEAR CH, NOW CX==CL.
add si, cx ;NOW SI POINTS TO LEAST SIGNIFICANT DIGIT.
;CONVERT STRING.
mov bx, 0
mov bp, 1 ;MULTIPLE OF 10 TO MULTIPLY EVERY DIGIT.
repeat:
;CONVERT CHARACTER.
mov al, [ si ] ;CHARACTER TO PROCESS.
sub al, 48 ;CONVERT ASCII CHARACTER TO DIGIT.
mov ah, 0 ;CLEAR AH, NOW AX==AL.
mul bp ;AX*BP = DX:AX.
add bx,ax ;ADD RESULT TO BX
;INCREASE MULTIPLE OF 10 (1, 10, 100...).
mov ax, bp
mov bp, 10
mul bp ;AX*10 = DX:AX.
mov bp, ax ;NEW MULTIPLE OF 10.
;CHECK IF WE HAVE FINISHED
dec si ;NEXT DIGIT TO PROCESS.
loop repeat ;COUNTER CX-1, IF NOT ZERO, REPEAT.
ret
string2number endp
code ends
end start
| rusucosmin/courses | ubb/lftc/lab6/test/syntax_error.asm | Assembly | mit | 1,522 |
; Copyright 2015 Adam <https://github.com/n00btube>
; MIT license.
; Makes save points refill Samus' energy and supplies, like the ship.
;
; Hijacks the save station PLM and uses some free space in that bank ($84), as
; well as any other bank of your choosing. This *is* the cross-bank version.
lorom
; hijack point: reconfigure the save-station PLM instructions. do not edit.
; the original instructions read:
; [8CF1=prompt][B008][B00E=freeze/pose Samus][8C07,2E=saving sound]...
; we overwrite those first 3 words and chain into the hijacked instructions,
; making it have the effect of:
; [B00E][refill_run, repeated until full][8CF1][B008][8C07,2E]...
org $84AFEE
DW plm_start ; hijack the "save?" message & posing
DW plm_run, $B008
; the hijack will chain the PLMs we overwrote.
; remaining PLM instructions are used as-is.
; this stub can be moved anywhere in bank $84’s free space, and MUST be bank $84.
; the stub needs 31 ($1F) bytes of space.
; moved to an unused plm instruction.
org $84853E
plm_start:
TYA ; copy pointer to refill_run into A
STA $1D27,X ; set refill_run as next PLM instruction
JSR $B00E ; freeze and pose Samus (saves X/Y itself)
JSL refill_start
plm_run:
JSL refill_run
ASL ; set Z flag if A is $0000 (saves 2 bytes vs. CMP)
BNE plm_more ; not all full: run this refill instruction next frame
JMP $8CF1 ; all items full: run hijacked save prompt
; (this will stop the current PLM instruction from running again)
plm_more:
LDA #$0001 ; run this PLM instruction next frame
STA $7EDE1C,X ; write frame delay
PLA ; end current frame's instructions for this PLM
RTS ; run next PLM
; this can be any free space, anywhere in the ROM.
; all it needs is 86 ($56) bytes of space there.
; for demonstration, I just picked the first possible location.
org $A1F400
refill_start:
STZ $0A6A ; zero "health alarm on" flag
LDA #$0001 ; stop sound
JSL $80914D ; sound lib 3 routine (also saves X/Y)
INY : INY ; advance past the refill_run instruction
; (if we are ALREADY full, JMP $8CF1 wouldn't have $B008 as arg.)
RTL ; get back to PLM code (so it can JSL refill_run...)
refill_run:
PHX : PHY ; preserve regs
LDY #$0000 ; set up "everything fully refilled" value
; comment the LDX/JSR line (add a semicolon to the beginning of the line)
; of any items you DO NOT want to refill. or just delete it.
LDA #$0005 : STA $12 ; energy increment value per frame
LDX #$09C2 : JSR inc_item ; energy tanks
LDX #$09D4 : JSR inc_reserve ; reserve tanks
LDA #$0002 : STA $12 ; other supplies increment value per frame
LDX #$09C6 : JSR inc_item ; missiles
LDX #$09CA : JSR inc_item ; super missiles
LDX #$09CE : JSR inc_item ; power bombs
TYA ; hang onto fill-state result
PLY : PLX ; restore regs
RTL
inc_item:
LDA $0000,X ; current value
CMP $0002,X ; max value
BEQ inc_is_full ; already full? just exit out
INY ; not already full: mark as such
CLC : ADC $12 ; add current increment value
CMP $0002,X ; is it full now?
BCC inc_item_write ; less than full: only save back to current
LDA $0002,X ; equal or overfull: set to full exactly
inc_item_write:
STA $0000,X ; write new (calculated or max) value to current
inc_is_full:
RTS ; return
;;; reserve current / max is inverted in RAM compared to other items
inc_reserve:
LDA $0002,X ; current value
CMP $0000,X ; max value
BEQ inc_reserve_is_full ; already full? just exit out
INY ; not already full: mark as such
CLC : ADC $12 ; add current increment value
CMP $0000,X ; is it full now?
BCC inc_reserve_write ; less than full: only save back to current
LDA $0000,X ; equal or overfull: set to full exactly
inc_reserve_write:
STA $0002,X ; write new (calculated or max) value to current
inc_reserve_is_full:
RTS ; return
warnpc $a1f46f
| theonlydude/RandomMetroidSolver | patches/common/src/refill_before_save.asm | Assembly | mit | 4,119 |
;Statically mapped at $A1A000 Referenced by the front end. Do not move without coordination.
InvertedTileAttributeLookup:
SEP #$20
LDA $8A : CMP.b #$47 : BEQ .turtleRock
LDA Overworld_TileAttr, X
JML.l Overworld_GetTileAttrAtLocation_continue
.turtleRock
LDA Inverted_TR_TileAttributes, X
JML.l Overworld_GetTileAttrAtLocation_continue
| mmxbass/z3randomizer | invertedstatic.asm | Assembly | mit | 342 |
;
; COMMUNICATING WITH MODEM: PORTS & IRQ
;
; Compile with FASM for Menuet
;
include "lang.inc"
include "..\..\..\..\macros.inc"
use32
org 0x0
db 'MENUET01' ; 8 byte id
dd 0x01 ; header version
dd START ; start of code
dd I_END ; size of image
dd 0x1000 ; memory for app
dd 0x1000 ; esp
dd 0x0 , 0x0 ; I_Param , I_Icon
START: ; start of execution
mov eax,45 ; reserve irq 4
mov ebx,0
mov ecx,4
mcall
mov eax,46 ; reserve ports 0x3f8-0x3ff
mov ebx,0
mov ecx,0x3f8
mov edx,0x3ff
mcall
mov eax,44 ; read these ports at interrupt/irq 4
mov ebx,irqtable
mov ecx,4
mcall
mov eax,40 ; enable event for interrupt/irq 4
mov ebx,10000b shl 16 + 111b
mcall
call program_com1
mov eax, 48
mov ebx, 3
mov ecx, sc
mov edx, sizeof.system_colors
mcall
red:
call draw_window
still:
mov eax,10 ; wait here for event
mcall
cmp eax,1 ; redraw request ?
je red
cmp eax,2 ; key in buffer ?
je key
cmp eax,3 ; button in buffer ?
je button
cmp eax,16+4 ; data read by interrupt ?
je irq4
jmp still
key: ; key
mov eax,2 ; just read it and ignore
mcall
mov al,ah
mov dx,0x3f8
out dx,al
jmp still
button: ; button
or eax,-1 ; close this program
mcall
irq4:
mov eax,42
mov ebx,4
mcall
; eax = number of bytes left
; ecx = 0 success, =1 fail
; bl = byte
inc [pos]
and [pos],31
mov eax,[pos]
mov [string+eax], bl
call draw_string
jmp still
baudrate_9600 equ 12
baudrate_57600 equ 2
program_com1:
mov dx,0x3f8+3
mov al,0x80
out dx,al
mov dx,0x3f8+1
mov al,0x00
out dx,al
mov dx,0x3f8+0
mov al,baudrate_9600
out dx,al
mov dx,0x3f8+3
mov al,0x3
out dx,al
mov dx,0x3f8+4
mov al,0xb
out dx,al
mov dx,0x3f8+1
mov al,0x1
out dx,al
ret
; *********************************************
; ******* WINDOW DEFINITIONS AND DRAW ********
; *********************************************
draw_window:
mov eax, 12 ; function 12:tell os about windowdraw
mov ebx, 1 ; 1, start of draw
mcall
; DRAW WINDOW
mov eax, 0 ; function 0 : define and draw window
mov ebx, 100*65536+250 ; [x start] *65536 + [x size]
mov ecx, 100*65536+85 ; [y start] *65536 + [y size]
mov edx, [sc.work]
or edx, 0x03000000 ; color of work area RRGGBB,8->color gl
mcall
; WINDOW LABEL
mov eax, 4 ; function 4 : write text to window
mov ebx, 8*65536+8 ; [x start] *65536 + [y start]
mov ecx, [sc.grab_text]
or ecx, 0x10000000 ; font 1 & color ( 0xF0RRGGBB )
mov edx, title ; pointer to text beginning
mov esi, title.len ; text length
mcall
mov eax, 4 ; draw text
mov ebx, 20*65536+33
mov ecx, [sc.work_text]
mov edx, text+4
.nextstr:
mov esi, [edx-4]
test esi, 0xFF000000
jnz .finstr
mcall
add edx, esi
add edx, 4
add ebx, 10
jmp .nextstr
.finstr:
call draw_string
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
ret
draw_string:
mov eax, 4
mov ebx, 20*65536+65
mov ecx, [sc.work_text]
mov edx, string
mov esi, 32
mcall
ret
; DATA AREA
if lang eq ru
text mstr "
.",\
"
",\
"
IRQ4
."
title:
db '
COM1'
.len = $ - title
else
text mstr "TYPED CHARACTERS ARE SENT TO MODEM.",\
"DATA FROM MODEM IS READ BY IRQ4",\
"INTERRUPT AND DISPLAYED BELOW."
title:
db 'MODEM AT COM1'
.len = $ - title
end if
pos dd 0x0
irqtable:
; port ; 1=byte, 2=word
dd 0x3f8 +0x01000000 ; read byte from port 0x3f8 at interrupt/irq 4
dd 0x0 ; no more ports ( max 15 ) to read
I_END:
string rb 32
sc system_colors
| devlato/kolibrios-llvm | programs/develop/examples/rtdata/trunk/rtdata.asm | Assembly | mit | 4,711 |
starter:
bne $k1,$zero,checkintrupt
j f095
j runP
checkintrupt:
addi $a0,$zero,10
addi $a1,$zero,1
beq $a1,$k1,isuserint
j runP
isuserint:
beq $a0,$v0,exitint
exitint:
j f093
runP:
j f094
addi $a1,$zero,-1
beq $a1,$v0,ex
j f020
ex:
add $zero,$zero,$zero
| CoffeeMIPS/netbeans | FCFS.asm | Assembly | apache-2.0 | 274 |
;; This file is a part of the IncludeOS unikernel - www.includeos.org
;;
;; Copyright 2017 IncludeOS AS, Oslo, Norway
;;
;; Licensed under the Apache License, Version 2.0 (the "License");
;; you may not use this file except in compliance with the License.
;; You may obtain a copy of the License at
;;
;; http:;;www.apache.org/licenses/LICENSE-2.0
;;
;; Unless required by applicable law or agreed to in writing, software
;; distributed under the License is distributed on an "AS IS" BASIS,
;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
;; See the License for the specific language governing permissions and
;; limitations under the License.
;
; Master thesis
; by Alf-Andre Walla 2016-2017
;
;
ORG 0x8000
%define code32_segment 0x08
%define data32_segment 0x10
%define SOFT_RESET_MAGIC 0xFEE1DEAD
[BITS 64]
ALIGN 16
;; first six pointer arguments are passed in
;; RDI, RSI, RDX, RCX, R8, and R9
;; hotswap64(
;; RDI: char* dest,
;; RSI: const char* base,
;; RDX: size_t len,
;; RCX: void* entry_function,
;; R8: void* reset_data,
;; R9: void* zero_until)
hotswap_amd64:
;; save soft reset data location and entry function
mov rax, r8
mov [startaddr], ecx ; rcx
mov [bootaddr], eax ; r8
;; hotswap 64-bit kernel
;; source: RSI
;; dest: RDI
mov rcx, rdx ;; count
cld
rep movsb
;; memzero area between kernel and end of heap
cmp r9, 0 ;; ... but only if r9 != 0
jz begin_enter_protected
mov rcx, r9 ;; rdi = kernel_end, r9 = zero_until
sub rcx, rdi ;; set rcx = zero_until - kernel_end
mov rax, 0 ;; memzero
rep stosb
begin_enter_protected:
; load 64-bit GDTR with 32-bit entries
lgdt [gdtr64]
; enter compatibility mode
push data32_segment
push rsp
pushf
push code32_segment
mov ecx, compatibility_mode
push rcx
iretq
startaddr: dd 0
bootaddr: dd 0
[BITS 32]
ALIGN 16
compatibility_mode:
; disable paging
mov ecx, cr0
and ecx, 0x7fffffff ;; clear PG (bit 31)
mov cr0, ecx
; disable LM
mov ecx, 0xC0000080 ; EFER MSR
rdmsr
and eax, ~(1 << 8) ; remove LM-bit
wrmsr
;; enter 32-bit protected mode
jmp code32_segment:protected_mode
protected_mode:
mov cx, data32_segment
mov ss, cx
mov ds, cx
mov es, cx
mov fs, cx
mov gs, cx
;;rdtsc
;;mov DWORD [0x10000], eax
;;mov DWORD [0x10004], edx
;; enter the new service from its entry point
;; in 32-bit protected mode, while passing
;; multiboot parameters in eax and ebx
mov eax, SOFT_RESET_MAGIC
mov ebx, [bootaddr]
jmp DWORD [startaddr]
gdtr:
dw gdt32_end - gdt32 - 1
dd gdt32
gdt32:
;; Entry 0x0: Null descriptor
dq 0x0
;; Entry 0x18: 32-bit Code segment
dw 0xffff ;Limit
dw 0x0000 ;Base 15:00
db 0x00 ;Base 23:16
dw 0xcf9a ;Flags / Limit / Type [F,L,F,Type]
db 0x00 ;Base 32:24
;; Entry 0x20: 32-bit Data segment
dw 0xffff ;Limit
dw 0x0000 ;Base 15:00
db 0x00 ;Base 23:16
dw 0xcf92 ;Flags / Limit / Type [F,L,F,Type]
db 0x00 ;Base 32:24
gdt32_end:
gdtr64:
dw $ - gdt32 - 1 ; Limit
dq gdt32 ; Base
| AnnikaH/IncludeOS | lib/LiveUpdate/src/hotswap64.asm | Assembly | apache-2.0 | 3,349 |
21
00
50
4E
0D
51
21
01
50
7E
23
BE
DA
14
00
46
77
2B
70
23
15
C2
09
00
0D
C2
05
00
76
| bogas04/asm8085 | test/bubbleSort.asm | Assembly | mit | 87 |
;
; HALO: HAribote-os LOader for EFI
;
; Copyright (c) 2016,2018 Nerry, All rights reserved.
;
; Permission is hereby granted, free of charge, to any person obtaining a copy
; of this software and associated documentation files (the "Software"), to deal
; in the Software without restriction, including without limitation the rights
; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
; copies of the Software, and to permit persons to whom the Software is
; furnished to do so, subject to the following conditions:
;
; The above copyright notice and this permission notice shall be included in all
; copies or substantial portions of the Software.
;
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
; SOFTWARE.
;
%define LOADER_CS 0x18
%define LOADER_DS 0x08
[bits 32]
[section .text]
; int _setjmp3(jmp_buf env, int count, ... /* OPTIONAL PARAMETERS */);
global __setjmp3
__setjmp3:
; TODO: NOT IMPLEMENTED
int 3
; void _longjmp(jmp_buf env, int retval);
global __longjmp
__longjmp:
; TODO: NOT IMPLEMENTED
int 3
; int strncmp(const char* s1, const char* s2, size_t n)
global _strncmp
_strncmp:
push ebp
mov ebp, esp
push ebx
mov ebx, [ebp+8]
mov edx, [ebp+12]
mov ecx, [ebp+16]
.loop:
mov al, [ebx]
or al, al
jz .last
sub al, [edx]
jnz .end
inc ebx
inc edx
loop .loop
jmp short .end
.last:
sub al, [edx]
.end:
movsx eax, al
pop ebx
pop ebp
ret
; void* memset(void* p, int val, size_t n)
global _memset
_memset:
push ebp
mov ebp, esp
mov edx, [ebp+8]
mov al, [ebp+12]
mov ecx, [ebp+16]
mov edi, edx
rep stosb
mov eax, edx
pop ebp
ret
; void start_kernel(i386_context_t* regs)
global _start_kernel
_start_kernel:
; mask IRQ
mov al, 0xFF
out 0x21, al
out 0xA1, al
; block IRQ
cli
; copy context
mov esi, [esp+4]
mov ebp, [esi+0x48]
sub ebp, byte 0x48
mov edi, ebp
mov ecx, 0x11
rep movsd
; load GDTR
mov ebx, __GDT
mov [ebx+2], ebx
lgdt [ebx]
; use new segment
mov eax, LOADER_DS
mov ds, eax
mov es, eax
mov ss, eax
mov esp, ebp
push BYTE LOADER_CS
call _retf
; disable paging
mov eax, cr0
btr eax, 31
mov cr0, eax
; disable misc flags
mov eax, cr4
and eax, 0xFFFFFD5F ; OSFXSR/PGE/PAE
mov cr4, eax
; setup context registers
add esp, byte 4
popad
pop gs
pop fs
pop es
pop ds
add esp, byte 8
; goto kernel
_retf:
retf
[section .data]
__GDT:
dw (__end_GDT-__GDT-1), 0, 0, 0 ; NULL
dw 0xFFFF,0x0000,0x9200,0x00CF ; 08 32bit KERNEL DATA FLAT
dw 0xFFFF,0x0000,0x9A28,0x0047 ; 10 32bit KERNEL TEXT haribote
dw 0xFFFF,0x0000,0x9A00,0x00CF ; 18 32bit KERNEL TEXT FLAT
__end_GDT:
| neri/halo | src/haloasm-ia32.asm | Assembly | mit | 3,460 |
; ----------------------------------------------------------------------------------------
; Writes "Hello, World" to the console using only system calls. Runs on 64-bit Linux only.
; To assemble and run:
;
; nasm -felf64 hello.asm && ld hello.o && ./a.out
; ----------------------------------------------------------------------------------------
global _start
section .text
_start:
; write(1, message, 13)
mov rax, 1 ; system call 1 is write
mov rdi, 1 ; file handle 1 is stdout
mov rsi, message ; address of string to output
mov rdx, 13 ; number of bytes
syscall ; invoke operating system to do the write
; exit(0)
mov eax, 60 ; system call 60 is exit
xor rdi, rdi ; exit code 0
syscall ; invoke operating system to exit
message:
db "Hello, World", 10 ; note the newline at the end | adeekshith/code-snippets | assembly/hello.asm | Assembly | apache-2.0 | 1,070 |
; Listing generated by Microsoft (R) Optimizing Compiler Version 16.00.40219.01
TITLE D:\Projects\TaintAnalysis\AntiTaint\Epilog\src\func-iparam-stdcall.c
.686P
.XMM
include listing.inc
.model flat
INCLUDELIB MSVCRT
INCLUDELIB OLDNAMES
PUBLIC ??_C@_0BA@NNIFAFEJ@?$CFd?5?$CFd?5?$CFd?5?$CFd?5?$CFs?6?$AA@ ; `string'
PUBLIC _func@16
EXTRN __imp__printf:PROC
EXTRN __imp__gets:PROC
; COMDAT ??_C@_0BA@NNIFAFEJ@?$CFd?5?$CFd?5?$CFd?5?$CFd?5?$CFs?6?$AA@
; File d:\projects\taintanalysis\antitaint\epilog\src\func-iparam-stdcall.c
CONST SEGMENT
??_C@_0BA@NNIFAFEJ@?$CFd?5?$CFd?5?$CFd?5?$CFd?5?$CFs?6?$AA@ DB '%d %d %d '
DB '%d %s', 0aH, 00H ; `string'
; Function compile flags: /Ogtpy
CONST ENDS
; COMDAT _func@16
_TEXT SEGMENT
_buf$ = -8 ; size = 8
_param1$ = 8 ; size = 4
_param2$ = 12 ; size = 4
_param3$ = 16 ; size = 4
_param4$ = 20 ; size = 4
_func@16 PROC ; COMDAT
; 17 : char buf[8];
; 18 : gets(buf);
lea eax, DWORD PTR _buf$[esp]
sub esp, 8
push eax
call DWORD PTR __imp__gets
; 19 : printf("%d %d %d %d %s\n", param1, param2, param3, param4, buf);
mov edx, DWORD PTR _param4$[esp+8]
mov eax, DWORD PTR _param3$[esp+8]
lea ecx, DWORD PTR _buf$[esp+12]
push ecx
mov ecx, DWORD PTR _param2$[esp+12]
push edx
mov edx, DWORD PTR _param1$[esp+16]
push eax
push ecx
push edx
push OFFSET ??_C@_0BA@NNIFAFEJ@?$CFd?5?$CFd?5?$CFd?5?$CFd?5?$CFs?6?$AA@
call DWORD PTR __imp__printf
; 20 : }
add esp, 36 ; 00000024H
ret 16 ; 00000010H
_func@16 ENDP
_TEXT ENDS
PUBLIC _main
; Function compile flags: /Ogtpy
; COMDAT _main
_TEXT SEGMENT
_main PROC ; COMDAT
; 24 : func(1, 2, 3, 4);
push 4
push 3
push 2
push 1
call _func@16
; 25 : return 0;
xor eax, eax
; 26 : }
ret 0
_main ENDP
_TEXT ENDS
END
| Dovgalyuk/AntiTaint | Epilog/asm/MSVC2010/func-iparam-stdcall-omitfp-opt.asm | Assembly | apache-2.0 | 1,883 |
[bits 32]
%macro exit %1
mov eax,1
mov ebx,%1
int 0x80
%enmacro
%macro write %2
push eax
mov eax,4
mov ebx,1
mov ecx,%1
mov edx,%2
int 0x80
pop eax
%enmacro
segment .text
global _start
_start:
mov eax,10
jmp conditional
conditional:
write msg,len
mov ebx,eax
sub ebx,1
cmp ebx,0
jnle codintional
exit 0
segment .data
msg: db 'greater than zero.',0xa,0
len: equ $-msg
| jozadaquebatista/Assembly-Overview | non_zero.asm | Assembly | apache-2.0 | 611 |
01: ; BOOL __stdcall DllMain(HINSTANCE hinstDLL, DWORD fdwReason,LPVOID lpvReserved)
02: _DllMain@12 proc near
03: 55 push ebp ; function prologue
04: 8B EC mov ebp, esp ; function prologue
05: 81 EC 30 01 00+ sub esp, 130h ; makes room for local variables
06: 57 push edi ; EDI is stored,therefore line 18 may modify it
07: 0F 01 4D F8 sidt fword ptr [ebp-8] ; gets the content of the IDTRegister
08: 8B 45 FA mov eax, [ebp-6] ; reads the limit (first 2 bytes)
09: 3D 00 F4 03 80 cmp eax, 8003F400h
10: 76 10 jbe short loc_10001C88 (line 18)
11: 3D 00 74 04 80 cmp eax, 80047400h
12: 73 09 jnb short loc_10001C88 (line 18) ; if ( value < 8003F400h || 80047400h > value ) jmp line 18
13: 33 C0 xor eax, eax ; set EAX to 0
14: 5F pop edi
15: 8B E5 mov esp, ebp ; function epilogue
16: 5D pop ebp ; function epilogue
17: C2 0C 00 retn 0Ch ; return
18: loc_10001C88: ;
19: 33 C0 xor eax, eax ; set EAX to 0, so we can later use it as an argument
20: B9 49 00 00 00 mov ecx, 49h ; 49h = 73d
21: 8D BD D4 FE FF+ lea edi, [ebp-12Ch] ; 130h - 12Ch = 4h which is exactly 4 bytes
22: C7 85 D0 FE FF+ mov dword ptr [ebp-130h], 0 ; the dwSize member must be initialized in order to use the function. It beign the first field and this being a little - endian machine we can tell that the allocated space will be used for a PROCESSENTRY32 variable
23: 50 push eax ; _In_ DWORD th32ProcessID :: "The process identifier of the process to be included in the snapshot. This parameter can be zero to indicate the current process." :: In this case the latter case is in play.
24: 6A 02 push 2 ; _In_ DWORD dwFlags :: "TH32CS_SNAPPROCESS 0x00000002 Includes all processes in the system in the snapshot."
25: F3 AB rep stosd ; we set those 4 bytes to 0,starting from address 12Ch
26: E8 2D 2F 00 00 call CreateToolhelp32Snapshot ; Takes a snapshot of the specified processes, as well as the heaps, modules, and threads used by these processes.
27: 8B F8 mov edi, eax ; the return value of CreateToolhelp32Snapshot is stored in EAX,which is then assigned to EDI
28: 83 FF FF cmp edi, 0FFFFFFFFh ; if ( edi != -1 )
29: 75 09 jnz short loc_10001CB9 (line 35) ; jump line 35
30: 33 C0 xor eax, eax ;
31: 5F pop edi ; restores the previous EDI value
32: 8B E5 mov esp, ebp ; function epilogue
33: 5D pop ebp ; function epilogue
34: C2 0C 00 retn 0Ch ; return
35: loc_10001CB9:
36: 8D 85 D0 FE FF+ lea eax, [ebp-130h] ;
37: 56 push esi ; ESI will be later used for the _stricmp function
38: 50 push eax ; _Inout_ LPPROCESSENTRY32 lppe :: "A pointer to a PROCESSENTRY32 structure."
39: 57 push edi ; _In_ HANDLE hSnapshot :: "A handle to the snapshot returned from a previous call to the CreateToolhelp32Snapshot function."
40: C7 85 D0 FE FF+ mov dword ptr [ebp-130h], 128h ; dwSize = 128h,therefore,the first 8 bytes are used for local variables
41: E8 FF 2E 00 00 call Process32First ; BOOL WINAPI Process32First (_In_ HANDLE hSnapshot, _Inout_ LPPROCESSENTRY32 lppe) If successful returns a nonzero value. If an error occured the function returns zero.
42: 85 C0 test eax, eax ; if ( an error occured )
43: 74 4F jz short loc_10001D24 (line 70) ; jump line 70
44: 8B 35 C0 50 00+ mov esi, ds:_stricmp ;
45: 8D 8D F4 FE FF+ lea ecx, [ebp-10Ch] ; TCHAR szExeFile[MAX_PATH]
46: 68 50 7C 00 10 push 10007C50h ; address of the second argument
47: 51 push ecx ; first argument
48: FF D6 call esi ; call _stricmp
49: 83 C4 08 add esp, 8 ;
50: 85 C0 test eax, eax ; if _stricmp returns 0
51: 74 26 jz short loc_10001D16 (line 66) ;
52: loc_10001CF0:
53: 8D 95 D0 FE FF+ lea edx, [ebp-130h] ;
54: 52 push edx ; _Out_ LPPROCESSENTRY32 lppe
55: 57 push edi ; _In_ HANDLE hSnapshot
56: E8 CD 2E 00 00 call Process32Next ; BOOL WINAPI Process32Next(_In_ HANDLE hSnapshot, _Out_ LPPROCESSENTRY32 lppe) :: Retrieves information about the next process recorded in a system snapshot.
57: 85 C0 test eax, eax ; Returns TRUE if the next entry of the process list has been copied to the buffer or FALSE otherwise. 0 must be false
58: 74 23 jz short loc_10001D24 (line 70) ; if ( return == 0 ) jump 0 = false
59: 8D 85 F4 FE FF+ lea eax, [ebp-10Ch] ; TCHAR szExeFile[MAX_PATH]
60: 68 50 7C 00 10 push 10007C50h ; second argument
61: 50 push eax ; first argument
62: FF D6 call esi ; _stricmp
63: 83 C4 08 add esp, 8 ;
64: 85 C0 test eax, eax ;
65: 75 DA jnz short loc_10001CF0 (line 52) ; while ( _stricmp != 0 ) | this loop can be left when there are no entries in the process list, or 2 strings are equal
66: loc_10001D16:
67: 8B 85 E8 FE FF+ mov eax, [ebp-118h] ; DWORD th32ParentProcessID
68: 8B 8D D8 FE FF+ mov ecx, [ebp-128h] ; DWORD th32ProcessID
69: EB 06 jmp short loc_10001D2A (line 73)
70: loc_10001D24:
71: 8B 45 0C mov eax, [ebp+0Ch] ; fdwReason
72: 8B 4D 0C mov ecx, [ebp+0Ch] ; fdwReason
73: loc_10001D2A:
74: 3B C1 cmp eax, ecx ;
75: 5E pop esi ; restores esi
76: 75 09 jnz short loc_10001D38 (line 82) ; if ( fdwReason == 0 )
77: 33 C0 xor eax, eax ;
78: 5F pop edi
79: 8B E5 mov esp, ebp ; function epilogue
80: 5D pop ebp ; function epilogue
81: C2 0C 00 retn 0Ch
82: loc_10001D38:
83: 8B 45 0C mov eax, [ebp+0Ch] ; fdwReason
84: 48 dec eax ; if ( fdwReason > 1 ) jump line 93
85: 75 15 jnz short loc_10001D53 (line 93) ;
86: 6A 00 push 0 ; lpThreadId [out, optional] A pointer to a variable that receives the thread identifier. If this parameter is NULL, the thread identifier is not returned.
87: 6A 00 push 0 ; dwCreationFlags [in] The flags that control the creation of the thread. 0 = the thread runs immediately after creation.
88: 6A 00 push 0 ; lpParameter [in, optional] A pointer to a variable to be passed to the thread.
89: 68 D0 32 00 10 push 100032D0h ; lpStartAddress [in] A pointer to the application-defined function to be executed by the thread. This pointer represents the starting address of the thread.
90: 6A 00 push 0 ; dwStackSize [in] The initial size of the stack, in bytes. The system rounds this value to the nearest page. If this parameter is zero, the new thread uses the default size for the executable. For more information, see Thread Stack Size.
91: 6A 00 push 0 ; lpThreadAttributes [in, optional] A pointer to a SECURITY_ATTRIBUTES structure that determines whether the returned handle can be inherited by child processes. If lpThreadAttributes is NULL, the handle cannot be inherited.
92: FF 15 20 50 00+ call ds:CreateThread ; HANDLE WINAPI CreateThread(_In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes,_In_ SIZE_T dwStackSize,_In_ LPTHREAD_START_ROUTINE lpStartAddress,_In_opt_ LPVOID lpParameter,_In_ DWORD dwCreationFlags, _Out_opt_ LPDWORD lpThreadId)
93: loc_10001D53:
94: B8 01 00 00 00 mov eax, 1 ; return 1
95: 5F pop edi ; restores edi
96: 8B E5 mov esp, ebp ; function epilogue
97: 5D pop ebp ; function epilogue
98: C2 0C 00 retn 0Ch ; ret
99: _DllMain@12 endp
| shxdow/practical-reverse-engineering | practical-reverse-engineering/chapter_01/page33/exercise01/exercise01.asm | Assembly | mit | 10,827 |
; Shows that the square timer's period is (raw + 1) * 2, not raw + 1
; with a divide-by-two before the duty sequencer.
;
; I also ran the square at highest pitch ($4002 = 8), quickly
; wrote 255 to $4002 then 8 to $4002 again. This would cause the
; timer to be loaded once with the higher value. Looking in a sound
; editor, the momentary flat section was 512 clocks, not 256 clocks.
;
; correct.wav correct output with divide-by-two before timer
; div2_after.wav emulator result with divide-by-two after timer
.include "prefix_apu.a"
reset:
lda #250
jsr delay_msec
lda #1 ; enable
sta $4015
lda #$bf
sta $4000
lda #$0f
sta $4001
lda #$00 ; timer period = 2
sta $4002
lda #$00
sta $4003
lda #100
jsr delay_msec
lda #0
sta <0
; If divide-by-two is after timer, timer reload never
; falls between A and B, so frequency is just $4002=255
;
; A B (see below)
;128|256|256|256|256|256|256|256|256|256 ...
; 0 1792 clocks
; If divide-by-two is before timer, every fourth timer reload
; falls between A and B, so frequency is equivalent to $4002=223
; (512*3 + 256 = 1792, (1792 / 4) / 2 - 1 = 223)
;
; A B (see below)
; 256| 512 | 512 | 512 |256| 512 | 512 ...
; 0 1792 clocks
loop: ; 1792 clocks per iteration
; 512 + 512 + 512 + 256 = 1792
ldy #5 ; 1772 delay
lda #69
jsr delay_ya0
; Timer reloaded with 512 three times during delay
ldx #127 ; 20 clocks
ldy #255
stx $4002 ; A in diagram above
; Timer is reloaded with 256 here
sty $4002 ; B in diagram above
dec <0
bne loop
lda #223 ; play square with $4003 = 223
sta $4002
lda #250
jsr delay_msec
lda #255 ; play square with $4003 = 255
sta $4002
lda #250
jsr delay_msec
lda #0
sta $4002
jmp forever
| peteward44/WebNES | project/testRoms/apu/square_timer_div2/square_timer_div2/square_timer_div2.asm | Assembly | mit | 2,298 |
bits 64
blendvpd xmm2,xmm1,xmm0
vblendvpd xmm2,xmm1,xmm0,xmm0
vblendvpd xmm2,xmm1,xmm0
vblendvpd ymm2,ymm1,ymm0,ymm0
vblendvpd ymm2,ymm1,ymm0
vcvtsi2sd xmm9,xmm10,ecx
vcvtsi2sd xmm9,xmm10,rcx
vcvtsi2sd xmm9,xmm10,dword [rdi]
vcvtsi2sd xmm9,xmm10,qword [rdi]
vpextrb [rax],xmm1,0x33
vpextrw [rax],xmm1,0x33
vpextrd [rax],xmm1,0x33
vpextrq [rax],xmm1,0x33
vpextrb rax,xmm1,0x33
vpextrw rax,xmm1,0x33
vpextrd rax,xmm1,0x33
vpextrq rax,xmm1,0x33
vpextrb eax,xmm1,0x33
vpextrw eax,xmm1,0x33
vpextrd eax,xmm1,0x33
; vpextrq eax,xmm1,0x33
pextrw rax,xmm0,0x33
vcvtpd2ps xmm0,xmm1
vcvtpd2ps xmm0,oword [rsi]
vcvtpd2ps xmm0,ymm1
vcvtpd2ps xmm0,yword [rsi]
; vcvtpd2ps xmm0,[rsi]
vcvtpd2dq xmm0,xmm1
vcvtpd2dq xmm0,oword [rsi]
vcvtpd2dq xmm0,ymm1
vcvtpd2dq xmm0,yword [rsi]
; vcvtpd2dq xmm0,[rsi]
vcvttpd2dq xmm0,xmm1
vcvttpd2dq xmm0,oword [rsi]
vcvttpd2dq xmm0,ymm1
vcvttpd2dq xmm0,yword [rsi]
; vcvttpd2dq xmm0,[rsi]
| techkey/nasm | travis/test/avx.asm | Assembly | bsd-2-clause | 1,001 |
assume cs:code, ds:data
data segment
a dw 1010111001101100b
b dw 0111110100100110b
c dw ?
data ends
code segment
start:
mov ax, data
mov ds, ax
mov dx, a
and dx, 1b ;isolate the bit 0 from a
mov ax, a ;ax = a
mov ax, 10b ;isolate the bit 1 from a
shl ax, 1 ;put the isolate bit 1 from a to pos 2
or dx, ax ;on bit 2 we put the bit 1 from a
;we solved the task 1
mov ax, b ;ax = b
and ax, 10b ;isolate the bit 1 from b
or dx, ax ;put on the bit 1 the bit 1 from b
;we solved the task 2
or dx, 010111b ;we put on the bits 3-5 the bits 0 1 0 corespondly
;we solved task 3
mov ax, a ;ax = a
and ax, 0111100000000000b ;we isolate the bits 11-14
shr ax, 5 ;we move the bits to the positions 6-9
or dx, ax ;put the bits from 11-14 in a to 6-9 in dx
;we solved task 4
mov ax, b
and ax, 0000000111111000b ;we isolate the bits 3-8 from b
shl ax, 7 ;we put the bits 3-8 from b to bits 10-15 in ax
xor ax, 1111110000000000b ;we flip the bits 10-15 in ax
or dx, ax ;we put the bits 10-15 from ax to 3-8 in ax
mov c, dx ;c = dx
mov ax, 4C00h
int 21h
code ends
end start
| rusucosmin/courses | ubb/asc/lab05/a.asm | Assembly | mit | 1,121 |
; Listing generated by Microsoft (R) Optimizing Compiler Version 13.10.3077
TITLE .\CRLCache.cpp
.386P
include listing.inc
if @Version gt 510
.model FLAT
else
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
_BSS SEGMENT DWORD USE32 PUBLIC 'BSS'
_BSS ENDS
$$SYMBOLS SEGMENT BYTE USE32 'DEBSYM'
$$SYMBOLS ENDS
$$TYPES SEGMENT BYTE USE32 'DEBTYP'
$$TYPES ENDS
_TLS SEGMENT DWORD USE32 PUBLIC 'TLS'
_TLS ENDS
; COMDAT ??_C@_0CD@HFEEKIIE@mbstr?5?$DN?$DN?50?5?$HM?$HM?5result?5?$DM?$DN?5?$CIint?$CJcou@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??_C@_0FB@DNILBHEN@C?3?2Program?5Files?2Microsoft?5Visua@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??_C@_0CD@JADEDFCN@wcstr?5?$DN?$DN?50?5?$HM?$HM?5result?5?$DM?$DN?5?$CIint?$CJcou@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??_C@_0BA@CLMJJCOM@nSize?5?$DO?$DN?5nSizeW?$AA@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??_C@_0BF@DFFCODPF@m_pData?9?$DOnRefs?5?$DN?$DN?5?91?$AA@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??_C@_0BK@KFNMPDFA@m_pData?9?$DOnDataLength?5?$DN?$DN?50?$AA@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??_C@_0BC@JINHKJCC@pData?9?$DOnRefs?5?$DM?$DN?50?$AA@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??_C@_0BB@HNGMIMJM@pData?9?$DOnRefs?5?$DM?50?$AA@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??_C@_0FB@EIPLHBJE@CFixedStringMgr?3?3Allocate?$CI?$CJ?5spil@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??_C@_0FD@PINPFILO@CFixedStringMgr?3?3Reallocate?$CI?$CJ?5sp@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??_C@_0P@MDHCGOCC@m_pMemMgr?5?$DN?$DN?50?$AA@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??_C@_0EP@ENACCIMA@C?3?2Program?5Files?2Microsoft?5Visua@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??_C@_0BK@KICONMKH@pData?9?$DOpStringMgr?5?$DN?$DN?5this?$AA@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??_C@_0CG@HPMMCKHL@?$CI?$CIWORD?$CJ?$CI?$CIDWORD_PTR?$CJ?$CIpsz?$CJ?5?$DO?$DO?516?$CJ?$CJ@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??_C@_0N@BDLMIBLB@pFormat?5?$CB?$DN?50?$AA@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??_C@_0FA@JGFACAOB@C?3?2Program?5Files?2Microsoft?5Visua@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??_C@_05LLAMLEHD@?$CFI64d?$AA@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??_C@_05KCADNOJC@?$CF02ld?$AA@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??_C@_0CB@FKADHJGH@strFormat?4LoadStringA?$CInFormatID?$CJ@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??_C@_0BO@OBIGOAOM@AtlIsValidString?$CI?5pszFormat?5?$CJ?$AA@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??_C@_0BA@GOIMFHNK@pStringMgr?5?$CB?$DN?50?$AA@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??_C@_0CJ@FJEKGMMD@Warning?3?5implicit?5LoadString?$CI?$CFu?$CJ@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??_C@_0BA@GNIEOBOF@nNewLength?5?$DO?$DN?50?$AA@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
text$yc SEGMENT PARA USE32 PUBLIC 'CODE'
text$yc ENDS
CRT$XCA SEGMENT DWORD USE32 PUBLIC 'DATA'
CRT$XCA ENDS
CRT$XCU SEGMENT DWORD USE32 PUBLIC 'DATA'
CRT$XCU ENDS
CRT$XCL SEGMENT DWORD USE32 PUBLIC 'DATA'
CRT$XCL ENDS
CRT$XCC SEGMENT DWORD USE32 PUBLIC 'DATA'
CRT$XCC ENDS
CRT$XCZ SEGMENT DWORD USE32 PUBLIC 'DATA'
CRT$XCZ ENDS
text$yd SEGMENT PARA USE32 PUBLIC 'CODE'
text$yd ENDS
ATL$__m SEGMENT DWORD USE32 PUBLIC ''
ATL$__m ENDS
ATL$__z SEGMENT DWORD USE32 PUBLIC ''
ATL$__z ENDS
ATL$__a SEGMENT DWORD USE32 PUBLIC ''
ATL$__a ENDS
xdata$x SEGMENT DWORD USE32 PUBLIC 'CONST'
xdata$x ENDS
; COMDAT _acosl
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _asinl
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _atanl
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _atan2l
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _ceill
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _cosl
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _coshl
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _expl
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _fabsl
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _floorl
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _fmodl
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _frexpl
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _ldexpl
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _logl
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _log10l
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _modfl
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _powl
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _sinl
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _sinhl
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _sqrtl
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _tanl
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _tanhl
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _frexpf
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _ldexpf
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _acosf
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _asinf
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _atanf
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _atan2f
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _ceilf
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _cosf
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _coshf
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _expf
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _fabsf
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _floorf
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _fmodf
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _logf
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _log10f
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _modff
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _powf
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _sinf
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _sinhf
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _sqrtf
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _tanf
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _tanhf
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?_AtlInstallStringThunk@ATL@@YAXPAPAXPAX1@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetEnvironmentVariableWFake@ATL@@YGKPBGPAGK@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetEnvironmentVariableWThunk@ATL@@YGKPBGPAGK@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?CompareStringWFake@ATL@@YGHKKPBGH0H@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?CompareStringWThunk@ATL@@YGHKKPBGH0H@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetStringTypeExWFake@ATL@@YGHKKPBGHPAG@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetStringTypeExWThunk@ATL@@YGHKKPBGHPAG@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?lstrcmpiWFake@ATL@@YGHPBG0@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?lstrcmpiWThunk@ATL@@YGHPBG0@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?CharLowerWFake@ATL@@YGPAGPAG@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?CharLowerWThunk@ATL@@YGPAGPAG@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?CharUpperWFake@ATL@@YGPAGPAG@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?CharUpperWThunk@ATL@@YGPAGPAG@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?_GetEnvironmentVariableW@?$ChTraitsCRT@G@ATL@@CGKPBGPAGK@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?StringFindString@?$ChTraitsCRT@G@ATL@@SAPBGPBG0@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??1CFixedStringMgr@ATL@@UAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Allocate@CFixedStringMgr@ATL@@UAEPAUCStringData@2@HH@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Free@CFixedStringMgr@ATL@@UAEXPAUCStringData@2@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Reallocate@CFixedStringMgr@ATL@@UAEPAUCStringData@2@PAU32@HH@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetNilString@CFixedStringMgr@ATL@@UAEPAUCStringData@2@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Clone@CFixedStringMgr@ATL@@UAEPAUIAtlStringMgr@2@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??_GCFixedStringMgr@ATL@@UAEPAXI@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??1CFixedStringLog@ATL@@UAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?OnAllocateSpill@CFixedStringLog@ATL@@UAEXHHPBUCStringData@2@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?OnReallocateSpill@CFixedStringLog@ATL@@UAEXHHPBUCStringData@2@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??_GCFixedStringLog@ATL@@UAEPAXI@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0IFixedStringLog@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??1CAtlStringMgr@ATL@@UAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Allocate@CAtlStringMgr@ATL@@UAEPAUCStringData@2@HH@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Free@CAtlStringMgr@ATL@@UAEXPAUCStringData@2@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Reallocate@CAtlStringMgr@ATL@@UAEPAUCStringData@2@PAU32@HH@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetNilString@CAtlStringMgr@ATL@@UAEPAUCStringData@2@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Clone@CAtlStringMgr@ATL@@UAEPAUIAtlStringMgr@2@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??_GCAtlStringMgr@ATL@@UAEPAXI@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?CompareStringW@?$ChTraitsOS@G@ATL@@KGHKKPBGH0H@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetStringTypeExW@?$ChTraitsOS@G@ATL@@KGHKKPBGHPAG@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?lstrcmpiW@?$ChTraitsOS@G@ATL@@KGHPBG0@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?CharLowerW@?$ChTraitsOS@G@ATL@@KGPAGPAG@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?CharUpperW@?$ChTraitsOS@G@ATL@@KGPAGPAG@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?strchr@?$ChTraitsOS@G@ATL@@SAPBGPBGG@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?strrchr@?$ChTraitsOS@G@ATL@@SAPBGPBGG@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?_strrev@?$ChTraitsOS@G@ATL@@SAPAGPAG@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?strstr@?$ChTraitsOS@G@ATL@@SAPBGPBG0@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?strspn@?$ChTraitsOS@G@ATL@@SAHPBG0@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?strcspn@?$ChTraitsOS@G@ATL@@SAHPBG0@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?strpbrk@?$ChTraitsOS@G@ATL@@SAPBGPBG0@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?StringFindString@?$ChTraitsOS@G@ATL@@SAPBGPBG0@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Format@CTimeSpan@ATL@@QBE?AV?$CStringT@DV?$StrTraitATL@DV?$ChTraitsCRT@D@ATL@@@ATL@@@2@PBD@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Format@CTime@ATL@@QBE?AV?$CStringT@DV?$StrTraitATL@DV?$ChTraitsCRT@D@ATL@@@ATL@@@2@PBD@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?FormatGmt@CTime@ATL@@QBE?AV?$CStringT@DV?$StrTraitATL@DV?$ChTraitsCRT@D@ATL@@@ATL@@@2@PBD@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??B?$CComPtrBase@UITypeInfo2@@@ATL@@QBEPAUITypeInfo2@@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??B?$CSimpleStringT@D$0A@@ATL@@QBEPBDXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Preallocate@?$CSimpleStringT@D$0A@@ATL@@QAEXH@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0?$CComObject@VCAxFrameWindow@ATL@@@ATL@@QAE@PAX@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0?$CComObject@VCAxUIWindow@ATL@@@ATL@@QAE@PAX@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?copy@?$_CopyInterface@UIUnknown@@@ATL@@SAJPAPAUIUnknown@@0@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?init@?$_CopyInterface@UIUnknown@@@ATL@@SAXPAPAUIUnknown@@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?destroy@?$_CopyInterface@UIUnknown@@@ATL@@SAXPAPAUIUnknown@@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0?$CW2AEX@$0IA@@ATL@@QAE@PBG@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??1?$CW2AEX@$0IA@@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??B?$CW2AEX@$0IA@@ATL@@QBEPADXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0?$CStringT@DV?$StrTraitATL@DV?$ChTraitsCRT@D@ATL@@@ATL@@@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0?$CStringT@DV?$StrTraitATL@DV?$ChTraitsCRT@D@ATL@@@ATL@@@ATL@@QAE@ABV01@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0?$CStringT@DV?$StrTraitATL@DV?$ChTraitsCRT@D@ATL@@@ATL@@@ATL@@QAE@PBD@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??1?$CStringT@DV?$StrTraitATL@DV?$ChTraitsCRT@D@ATL@@@ATL@@@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??Y?$CStringT@DV?$StrTraitATL@DV?$ChTraitsCRT@D@ATL@@@ATL@@@ATL@@QAEAAV01@D@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?AppendFormat@?$CStringT@DV?$StrTraitATL@DV?$ChTraitsCRT@D@ATL@@@ATL@@@ATL@@QAAXPBDZZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?LoadStringA@?$CStringT@DV?$StrTraitATL@DV?$ChTraitsCRT@D@ATL@@@ATL@@@ATL@@QAEHI@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0?$CSimpleStringT@D$0A@@ATL@@QAE@PAUIAtlStringMgr@1@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0?$CSimpleStringT@D$0A@@ATL@@QAE@ABV01@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??1?$CSimpleStringT@D$0A@@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??Y?$CSimpleStringT@D$0A@@ATL@@QAEAAV01@D@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Init@?$CW2AEX@$0IA@@ATL@@AAEXPBGI@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??4?$CStringT@DV?$StrTraitATL@DV?$ChTraitsCRT@D@ATL@@@ATL@@@ATL@@QAEAAV01@PBD@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?AppendFormatV@?$CStringT@DV?$StrTraitATL@DV?$ChTraitsCRT@D@ATL@@@ATL@@@ATL@@QAEXPBDPAD@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?LoadStringA@?$CStringT@DV?$StrTraitATL@DV?$ChTraitsCRT@D@ATL@@@ATL@@@ATL@@QAEHPAUHINSTANCE__@@I@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?CheckImplicitLoad@?$CStringT@DV?$StrTraitATL@DV?$ChTraitsCRT@D@ATL@@@ATL@@@ATL@@AAE_NPBX@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?FindStringResourceInstance@?$StrTraitATL@DV?$ChTraitsCRT@D@ATL@@@ATL@@SAPAUHINSTANCE__@@I@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetDefaultManager@?$StrTraitATL@DV?$ChTraitsCRT@D@ATL@@@ATL@@SAPAUIAtlStringMgr@2@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??4?$CSimpleStringT@D$0A@@ATL@@QAEAAV01@PBD@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?AppendChar@?$CSimpleStringT@D$0A@@ATL@@QAEXD@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetLength@?$CSimpleStringT@D$0A@@ATL@@QBEHXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?ReleaseBufferSetLength@?$CSimpleStringT@D$0A@@ATL@@QAEXH@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?CloneData@?$CSimpleStringT@D$0A@@ATL@@CAPAUCStringData@2@PAU32@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetFormattedLength@?$ChTraitsCRT@D@ATL@@SAHPBDPAD@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Format@?$ChTraitsCRT@D@ATL@@SAHPADPBD0@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetBaseTypeLength@?$ChTraitsCRT@D@ATL@@SAHPBGH@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?ConvertToBaseType@?$ChTraitsCRT@D@ATL@@SAXPADHPBGH@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?SetString@?$CSimpleStringT@D$0A@@ATL@@QAEXPBD@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?SetString@?$CSimpleStringT@D$0A@@ATL@@QAEXPBDH@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetString@?$CSimpleStringT@D$0A@@ATL@@QBEPBDXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?CopyCharsOverlapped@?$CSimpleStringT@D$0A@@ATL@@SAXPADPBDH@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Unlock@?$CComCritSecLock@VCComCriticalSection@ATL@@@ATL@@QAEXXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?CreateInstance@?$CComObject@V?$CComEnum@UIEnumUnknown@@$1?_GUID_00000100_0000_0000_c000_000000000046@@3U__s_GUID@@BPAUIUnknown@@V?$_CopyInterface@UIUnknown@@@ATL@@VCComSingleThreadModel@6@@ATL@@@ATL@@SGJPAPAV12@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??$_Pow_int@N@@YANNH@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??$_Pow_int@H@@YAHHH@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??$_Pow_int@M@@YAMMH@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??$_Pow_int@O@@YAOOH@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??$AtlAlignUp@H@ATL@@YGHHK@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?InternalFinalConstructRelease@CComObjectRootBase@ATL@@QAEXXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??_C@_0N@JELNCKOF@m_dwRef?5?$DN?$DN?50?$AA@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??_C@_0EP@FBJOMLAB@C?3?2Program?5Files?2Microsoft?5Visua@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?_AtlFinalConstruct@CComObjectRootBase@ATL@@QAEJXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?FinalConstruct@CComObjectRootBase@ATL@@QAEJXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?InternalFinalConstructAddRef@CComObjectRootBase@ATL@@QAEXXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?SetVoid@CComObjectRootBase@ATL@@QAEXPAX@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0?$CComObject@V?$CComEnum@UIEnumUnknown@@$1?_GUID_00000100_0000_0000_c000_000000000046@@3U__s_GUID@@BPAUIUnknown@@V?$_CopyInterface@UIUnknown@@@ATL@@VCComSingleThreadModel@6@@ATL@@@ATL@@QAE@PAX@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0?$CComEnum@UIEnumUnknown@@$1?_GUID_00000100_0000_0000_c000_000000000046@@3U__s_GUID@@BPAUIUnknown@@V?$_CopyInterface@UIUnknown@@@ATL@@VCComSingleThreadModel@6@@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0?$CComEnumImpl@UIEnumUnknown@@$1?_GUID_00000100_0000_0000_c000_000000000046@@3U__s_GUID@@BPAUIUnknown@@V?$_CopyInterface@UIUnknown@@@ATL@@@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0IEnumUnknown@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0IUnknown@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0?$CComPtr@UIUnknown@@@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0?$CComPtrBase@UIUnknown@@@ATL@@IAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??1?$CComPtrBase@UIUnknown@@@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??1?$CComPtr@UIUnknown@@@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??1?$CComEnumImpl@UIEnumUnknown@@$1?_GUID_00000100_0000_0000_c000_000000000046@@3U__s_GUID@@BPAUIUnknown@@V?$_CopyInterface@UIUnknown@@@ATL@@@ATL@@UAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0?$CComObjectRootEx@VCComSingleThreadModel@ATL@@@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0CComObjectRootBase@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??1?$CComEnum@UIEnumUnknown@@$1?_GUID_00000100_0000_0000_c000_000000000046@@3U__s_GUID@@BPAUIUnknown@@V?$_CopyInterface@UIUnknown@@@ATL@@VCComSingleThreadModel@6@@ATL@@UAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??_7?$CComObject@V?$CComEnum@UIEnumUnknown@@$1?_GUID_00000100_0000_0000_c000_000000000046@@3U__s_GUID@@BPAUIUnknown@@V?$_CopyInterface@UIUnknown@@@ATL@@VCComSingleThreadModel@6@@ATL@@@ATL@@6B@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?QueryInterface@?$CComObject@V?$CComEnum@UIEnumUnknown@@$1?_GUID_00000100_0000_0000_c000_000000000046@@3U__s_GUID@@BPAUIUnknown@@V?$_CopyInterface@UIUnknown@@@ATL@@VCComSingleThreadModel@6@@ATL@@@ATL@@UAGJABU_GUID@@PAPAX@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?_InternalQueryInterface@?$CComEnum@UIEnumUnknown@@$1?_GUID_00000100_0000_0000_c000_000000000046@@3U__s_GUID@@BPAUIUnknown@@V?$_CopyInterface@UIUnknown@@@ATL@@VCComSingleThreadModel@6@@ATL@@QAEJABU_GUID@@PAPAX@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?InternalQueryInterface@CComObjectRootBase@ATL@@SGJPAXPBU_ATL_INTMAP_ENTRY@2@ABU_GUID@@PAPAX@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??_C@_0P@BMHEGBAP@ppvObject?5?$CB?$DN?50?$AA@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??_C@_0L@DBHNDLKF@pThis?5?$CB?$DN?50?$AA@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??_C@_0DC@BBKMJDPM@pEntries?9?$DOpFunc?5?$DN?$DN?5?$CI?$CIATL?3?3_ATL_C@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?_GetEntries@?$CComEnum@UIEnumUnknown@@$1?_GUID_00000100_0000_0000_c000_000000000046@@3U__s_GUID@@BPAUIUnknown@@V?$_CopyInterface@UIUnknown@@@ATL@@VCComSingleThreadModel@6@@ATL@@SGPBU_ATL_INTMAP_ENTRY@2@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??_C@_09BEHAHIFA@_CComEnum?$AA@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT __GUID_00000100_0000_0000_c000_000000000046
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?_entries@?1??_GetEntries@?$CComEnum@UIEnumUnknown@@$1?_GUID_00000100_0000_0000_c000_000000000046@@3U__s_GUID@@BPAUIUnknown@@V?$_CopyInterface@UIUnknown@@@ATL@@VCComSingleThreadModel@6@@ATL@@SGPBU_ATL_INTMAP_ENTRY@3@XZ@4QBU43@B
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?AddRef@?$CComObject@V?$CComEnum@UIEnumUnknown@@$1?_GUID_00000100_0000_0000_c000_000000000046@@3U__s_GUID@@BPAUIUnknown@@V?$_CopyInterface@UIUnknown@@@ATL@@VCComSingleThreadModel@6@@ATL@@@ATL@@UAGKXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?InternalAddRef@?$CComObjectRootEx@VCComSingleThreadModel@ATL@@@ATL@@QAEKXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??_C@_0P@IDNKKMJE@m_dwRef?5?$CB?$DN?5?91L?$AA@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?Increment@CComSingleThreadModel@ATL@@SGKPAJ@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Release@?$CComObject@V?$CComEnum@UIEnumUnknown@@$1?_GUID_00000100_0000_0000_c000_000000000046@@3U__s_GUID@@BPAUIUnknown@@V?$_CopyInterface@UIUnknown@@@ATL@@VCComSingleThreadModel@6@@ATL@@@ATL@@UAGKXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?InternalRelease@?$CComObjectRootEx@VCComSingleThreadModel@ATL@@@ATL@@QAEKXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Decrement@CComSingleThreadModel@ATL@@SGKPAJ@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??_C@_0EC@FOHBGNDM@0?5?$CG?$CG?5?$CCRelease?5called?5on?5a?5pointe@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?Next@?$CComEnumImpl@UIEnumUnknown@@$1?_GUID_00000100_0000_0000_c000_000000000046@@3U__s_GUID@@BPAUIUnknown@@V?$_CopyInterface@UIUnknown@@@ATL@@@ATL@@UAGJKPAPAUIUnknown@@PAK@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Skip@?$CComEnumImpl@UIEnumUnknown@@$1?_GUID_00000100_0000_0000_c000_000000000046@@3U__s_GUID@@BPAUIUnknown@@V?$_CopyInterface@UIUnknown@@@ATL@@@ATL@@UAGJK@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Reset@?$CComEnumImpl@UIEnumUnknown@@$1?_GUID_00000100_0000_0000_c000_000000000046@@3U__s_GUID@@BPAUIUnknown@@V?$_CopyInterface@UIUnknown@@@ATL@@@ATL@@UAGJXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Clone@?$CComEnumImpl@UIEnumUnknown@@$1?_GUID_00000100_0000_0000_c000_000000000046@@3U__s_GUID@@BPAUIUnknown@@V?$_CopyInterface@UIUnknown@@@ATL@@@ATL@@UAGJPAPAUIEnumUnknown@@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Init@?$CComEnumImpl@UIEnumUnknown@@$1?_GUID_00000100_0000_0000_c000_000000000046@@3U__s_GUID@@BPAUIUnknown@@V?$_CopyInterface@UIUnknown@@@ATL@@@ATL@@QAEJPAPAUIUnknown@@0PAU3@W4CComEnumFlags@2@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??4?$CComPtr@UIUnknown@@@ATL@@QAEPAUIUnknown@@PAU2@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??B?$CComPtrBase@UIUnknown@@@ATL@@QBEPAUIUnknown@@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0?$CComPtr@UIUnknown@@@ATL@@QAE@PAUIUnknown@@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0?$CComPtrBase@UIUnknown@@@ATL@@IAE@PAUIUnknown@@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??_G?$CComObject@V?$CComEnum@UIEnumUnknown@@$1?_GUID_00000100_0000_0000_c000_000000000046@@3U__s_GUID@@BPAUIUnknown@@V?$_CopyInterface@UIUnknown@@@ATL@@VCComSingleThreadModel@6@@ATL@@@ATL@@UAEPAXI@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??1?$CComObject@V?$CComEnum@UIEnumUnknown@@$1?_GUID_00000100_0000_0000_c000_000000000046@@3U__s_GUID@@BPAUIUnknown@@V?$_CopyInterface@UIUnknown@@@ATL@@VCComSingleThreadModel@6@@ATL@@@ATL@@UAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?FinalRelease@CComObjectRootBase@ATL@@QAEXXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Unlock@CComCriticalSection@ATL@@QAEJXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??_C@_0FA@KBNNCCJL@C?3?2Program?5Files?2Microsoft?5Visua@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??_C@_09HIEJFN@m_bLocked?$AA@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?Empty@?$CSimpleStringT@D$0A@@ATL@@QAEXXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?StringLength@?$CSimpleStringT@D$0A@@ATL@@SAHPBD@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?CopyChars@?$CSimpleStringT@D$0A@@ATL@@SAXPADPBDH@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?ThrowMemoryException@?$CSimpleStringT@D$0A@@ATL@@KAXXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?IsLocked@CStringData@ATL@@QBE_NXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?SetLength@?$CSimpleStringT@D$0A@@ATL@@AAEXH@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??_C@_0N@ILOMLJGA@nLength?5?$DO?$DN?50?$AA@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??_C@_0CD@EEFFJEGJ@nLength?5?$DM?$DN?5GetData?$CI?$CJ?9?$DOnAllocLeng@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?AtlFindStringResourceInstance@ATL@@YAPAUHINSTANCE__@@IG@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?AtlGetStringResourceImage@ATL@@YAPBUATLSTRINGRESOURCEIMAGE@1@PAUHINSTANCE__@@IG@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?_AtlGetStringResourceImage@ATL@@YAPBUATLSTRINGRESOURCEIMAGE@1@PAUHINSTANCE__@@PAUHRSRC__@@I@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?AtlGetStringResourceImage@ATL@@YAPBUATLSTRINGRESOURCEIMAGE@1@PAUHINSTANCE__@@I@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetBuffer@?$CSimpleStringT@D$0A@@ATL@@QAEPADH@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?AtlThrowLastWin32@ATL@@YGXXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Release@CStringData@ATL@@QAEXXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??_C@_0L@OIIMFBNE@nRefs?5?$CB?$DN?50?$AA@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?GetData@?$CSimpleStringT@D$0A@@ATL@@ABEPAUCStringData@2@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Attach@?$CSimpleStringT@D$0A@@ATL@@AAEXPAUCStringData@2@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??_C@_0FD@MKDEOELP@C?3?2Program?5Files?2Microsoft?5Visua@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?AtlIsValidString@ATL@@YAHPBDI@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??_7?$CComObject@VCAxUIWindow@ATL@@@ATL@@6BIOleInPlaceUIWindow@@@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?QueryInterface@?$CComObject@VCAxUIWindow@ATL@@@ATL@@UAGJABU_GUID@@PAPAX@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?_InternalQueryInterface@CAxUIWindow@ATL@@QAEJABU_GUID@@PAPAX@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?_GetEntries@CAxUIWindow@ATL@@SGPBU_ATL_INTMAP_ENTRY@2@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??_C@_0M@EHKCMBND@CAxUIWindow?$AA@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT __GUID_00000115_0000_0000_c000_000000000046
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT __GUID_00000114_0000_0000_c000_000000000046
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?_entries@?1??_GetEntries@CAxUIWindow@ATL@@SGPBU_ATL_INTMAP_ENTRY@3@XZ@4QBU43@B
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?AddRef@?$CComObject@VCAxUIWindow@ATL@@@ATL@@UAGKXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Release@?$CComObject@VCAxUIWindow@ATL@@@ATL@@UAGKXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetWindow@CAxUIWindow@ATL@@UAGJPAPAUHWND__@@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Create@?$CWindowImpl@VCAxUIWindow@ATL@@VCWindow@2@V?$CWinTraits@$0FGAAAAAA@$0A@@2@@ATL@@QAEPAUHWND__@@PAU3@V_U_RECT@2@PBDKKV_U_MENUorID@2@PAX@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetWndClassName@CWindow@ATL@@SAPBDXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Register@_ATL_WNDCLASSINFOA@ATL@@QAEGPAP6GJPAUHWND__@@IIJ@Z@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?_AtlWinModule@ATL@@3VCAtlWinModule@1@A
_BSS SEGMENT DWORD USE32 PUBLIC 'BSS'
_BSS ENDS
; COMDAT _$E1
text$yc SEGMENT PARA USE32 PUBLIC 'CODE'
text$yc ENDS
; COMDAT ??0CAtlWinModule@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0_ATL_WIN_MODULE70@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0CComCriticalSection@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0?$CSimpleArray@GV?$CSimpleArrayEqualHelper@G@ATL@@@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??1?$CSimpleArray@GV?$CSimpleArrayEqualHelper@G@ATL@@@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?RemoveAll@?$CSimpleArray@GV?$CSimpleArrayEqualHelper@G@ATL@@@ATL@@QAEXXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??1_ATL_WIN_MODULE70@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?m_bInitFailed@CAtlBaseModule@ATL@@2_NA
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
; COMDAT _$E2
text$yd SEGMENT PARA USE32 PUBLIC 'CODE'
text$yd ENDS
; COMDAT ??1CAtlWinModule@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Term@CAtlWinModule@ATL@@QAEXXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetModuleInstance@CAtlBaseModule@ATL@@QAEPAUHINSTANCE__@@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT CRT$XCU
CRT$XCU SEGMENT DWORD USE32 PUBLIC 'DATA'
CRT$XCU ENDS
; COMDAT ?GetWndClassInfo@?$CWindowImpl@VCAxUIWindow@ATL@@VCWindow@2@V?$CWinTraits@$0FGAAAAAA@$0A@@2@@ATL@@SAAAU_ATL_WNDCLASSINFOA@2@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?StartWindowProc@?$CWindowImplBaseT@VCWindow@ATL@@V?$CWinTraits@$0FGAAAAAA@$0A@@2@@ATL@@SGJPAUHWND__@@IIJ@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?ExtractCreateWndData@CAtlWinModule@ATL@@QAEPAXXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Init@CWndProcThunk@ATL@@QAEXP6GJPAUHWND__@@IIJ@ZPAX@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Init@CDynamicStdCallThunk@ATL@@QAEXKPAX@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??_C@_06CIAHICCP@pThunk?$AA@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?Init@_stdcallthunk@ATL@@QAEXKPAX@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetWNDPROC@CWndProcThunk@ATL@@QAEP6GJPAUHWND__@@IIJ@ZXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetCodeAddress@CDynamicStdCallThunk@ATL@@QAEPAXXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetCodeAddress@_stdcallthunk@ATL@@QAEPAXXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?SetWindowLongPtrA@@YAJPAUHWND__@@HJ@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?wc@?1??GetWndClassInfo@?$CWindowImpl@VCAxUIWindow@ATL@@VCWindow@2@V?$CWinTraits@$0FGAAAAAA@$0A@@2@@ATL@@SAAAU_ATL_WNDCLASSINFOA@3@XZ@4U43@A
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
; COMDAT ?GetWndStyle@?$CWindowImplBaseT@VCWindow@ATL@@V?$CWinTraits@$0FGAAAAAA@$0A@@2@@ATL@@SAKK@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetWndStyle@?$CWinTraits@$0FGAAAAAA@$0A@@ATL@@SAKK@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetWndExStyle@?$CWindowImplBaseT@VCWindow@ATL@@V?$CWinTraits@$0FGAAAAAA@$0A@@2@@ATL@@SAKK@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetWndExStyle@?$CWinTraits@$0FGAAAAAA@$0A@@ATL@@SAKK@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetWndCaption@?$CWindowImpl@VCAxUIWindow@ATL@@VCWindow@2@V?$CWinTraits@$0FGAAAAAA@$0A@@2@@ATL@@SAPBDXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Create@?$CWindowImplBaseT@VCWindow@ATL@@V?$CWinTraits@$0FGAAAAAA@$0A@@2@@ATL@@QAEPAUHWND__@@PAU3@V_U_RECT@2@PBDKKV_U_MENUorID@2@GPAX@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?AddCreateWndData@CAtlWinModule@ATL@@QAEXPAU_AtlCreateWndData@2@PAX@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?rcDefault@CWindow@ATL@@2UtagRECT@@A
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
; COMDAT ??0_U_MENUorID@ATL@@QAE@I@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??_C@_0BA@FJBCDDKK@AXWIN?5UI?5Window?$AA@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??0_U_RECT@ATL@@QAE@PAUtagRECT@@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?ContextSensitiveHelp@CAxUIWindow@ATL@@UAGJH@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetBorder@CAxUIWindow@ATL@@UAGJPAUtagRECT@@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?RequestBorderSpace@CAxUIWindow@ATL@@UAGJPBUtagRECT@@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?SetBorderSpace@CAxUIWindow@ATL@@UAGJPBUtagRECT@@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?SetActiveObject@CAxUIWindow@ATL@@UAGJPAUIOleInPlaceActiveObject@@PBG@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??4?$CComPtr@UIOleInPlaceActiveObject@@@ATL@@QAEPAUIOleInPlaceActiveObject@@PAU2@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??_7?$CComObject@VCAxUIWindow@ATL@@@ATL@@6B?$CWindowImpl@VCAxUIWindow@ATL@@VCWindow@2@V?$CWinTraits@$0FGAAAAAA@$0A@@2@@1@@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?ProcessWindowMessage@CAxUIWindow@ATL@@UAEHPAUHWND__@@IIJAAJK@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??_G?$CComObject@VCAxUIWindow@ATL@@@ATL@@UAEPAXI@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??1?$CComObject@VCAxUIWindow@ATL@@@ATL@@UAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?FinalRelease@CAxUIWindow@ATL@@QAEXXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Release@?$CComPtrBase@UIOleInPlaceActiveObject@@@ATL@@QAEXXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?DestroyWindow@?$CWindowImplBaseT@VCWindow@ATL@@V?$CWinTraits@$0FGAAAAAA@$0A@@2@@ATL@@QAEHXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??_C@_0BD@OAFOKPBM@?3?3IsWindow?$CIm_hWnd?$CJ?$AA@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??_C@_0EP@FECMNBMC@C?3?2Program?5Files?2Microsoft?5Visua@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?GetWindowProc@?$CWindowImplBaseT@VCWindow@ATL@@V?$CWinTraits@$0FGAAAAAA@$0A@@2@@ATL@@UAEP6GJPAUHWND__@@IIJ@ZXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?WindowProc@?$CWindowImplBaseT@VCWindow@ATL@@V?$CWinTraits@$0FGAAAAAA@$0A@@2@@ATL@@SGJPAUHWND__@@IIJ@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0_ATL_MSG@ATL@@QAE@PAUHWND__@@IIJH@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?DefWindowProcA@?$CWindowImplBaseT@VCWindow@ATL@@V?$CWinTraits@$0FGAAAAAA@$0A@@2@@ATL@@QAEJIIJ@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetWindowLongPtrA@@YAJPAUHWND__@@H@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?OnFinalMessage@?$CWindowImplBaseT@VCWindow@ATL@@V?$CWinTraits@$0FGAAAAAA@$0A@@2@@ATL@@UAEXPAUHWND__@@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??1CAxUIWindow@ATL@@UAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??1?$CWindowImpl@VCAxUIWindow@ATL@@VCWindow@2@V?$CWinTraits@$0FGAAAAAA@$0A@@2@@ATL@@UAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??1?$CWindowImplBaseT@VCWindow@ATL@@V?$CWinTraits@$0FGAAAAAA@$0A@@2@@ATL@@UAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??1?$CWindowImplRoot@VCWindow@ATL@@@ATL@@UAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??1CWndProcThunk@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??1CDynamicStdCallThunk@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??_C@_0DE@JJEOCICO@ERROR?5?9?5Object?5deleted?5before?5wi@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??1?$CComPtr@UIOleInPlaceActiveObject@@@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??1?$CComPtrBase@UIOleInPlaceActiveObject@@@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0CAxUIWindow@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0?$CWindowImpl@VCAxUIWindow@ATL@@VCWindow@2@V?$CWinTraits@$0FGAAAAAA@$0A@@2@@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0?$CWindowImplBaseT@VCWindow@ATL@@V?$CWinTraits@$0FGAAAAAA@$0A@@2@@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0?$CWindowImplRoot@VCWindow@ATL@@@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0CWindow@ATL@@QAE@PAUHWND__@@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0CMessageMap@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0CWndProcThunk@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0CDynamicStdCallThunk@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0IOleInPlaceUIWindow@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0IOleWindow@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0?$CComPtr@UIOleInPlaceActiveObject@@@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0?$CComPtrBase@UIOleInPlaceActiveObject@@@ATL@@IAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?_pAtlModule@ATL@@3PAVCAtlModule@1@A
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
; COMDAT ??_7?$CComObject@VCAxFrameWindow@ATL@@@ATL@@6BIOleInPlaceFrame@@@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?QueryInterface@?$CComObject@VCAxFrameWindow@ATL@@@ATL@@UAGJABU_GUID@@PAPAX@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?_InternalQueryInterface@CAxFrameWindow@ATL@@QAEJABU_GUID@@PAPAX@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?_GetEntries@CAxFrameWindow@ATL@@SGPBU_ATL_INTMAP_ENTRY@2@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??_C@_0P@MFMDEJMN@CAxFrameWindow?$AA@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT __GUID_00000116_0000_0000_c000_000000000046
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?_entries@?1??_GetEntries@CAxFrameWindow@ATL@@SGPBU_ATL_INTMAP_ENTRY@3@XZ@4QBU43@B
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?AddRef@?$CComObject@VCAxFrameWindow@ATL@@@ATL@@UAGKXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Release@?$CComObject@VCAxFrameWindow@ATL@@@ATL@@UAGKXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetWindow@CAxFrameWindow@ATL@@UAGJPAPAUHWND__@@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??_C@_0L@JIHHHPOK@phwnd?5?$CB?$DN?50?$AA@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??_C@_0FA@NHACCMFP@C?3?2Program?5Files?2Microsoft?5Visua@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?Create@?$CWindowImpl@VCAxFrameWindow@ATL@@VCWindow@2@V?$CWinTraits@$0FGAAAAAA@$0A@@2@@ATL@@QAEPAUHWND__@@PAU3@V_U_RECT@2@PBDKKV_U_MENUorID@2@PAX@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetWndClassInfo@?$CWindowImpl@VCAxFrameWindow@ATL@@VCWindow@2@V?$CWinTraits@$0FGAAAAAA@$0A@@2@@ATL@@SAAAU_ATL_WNDCLASSINFOA@2@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?wc@?1??GetWndClassInfo@?$CWindowImpl@VCAxFrameWindow@ATL@@VCWindow@2@V?$CWinTraits@$0FGAAAAAA@$0A@@2@@ATL@@SAAAU_ATL_WNDCLASSINFOA@3@XZ@4U43@A
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
; COMDAT ?GetWndCaption@?$CWindowImpl@VCAxFrameWindow@ATL@@VCWindow@2@V?$CWinTraits@$0FGAAAAAA@$0A@@2@@ATL@@SAPBDXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??_C@_0BD@LIOMMJMF@AXWIN?5Frame?5Window?$AA@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?ContextSensitiveHelp@CAxFrameWindow@ATL@@UAGJH@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetBorder@CAxFrameWindow@ATL@@UAGJPAUtagRECT@@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?RequestBorderSpace@CAxFrameWindow@ATL@@UAGJPBUtagRECT@@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?SetBorderSpace@CAxFrameWindow@ATL@@UAGJPBUtagRECT@@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?SetActiveObject@CAxFrameWindow@ATL@@UAGJPAUIOleInPlaceActiveObject@@PBG@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?InsertMenus@CAxFrameWindow@ATL@@UAGJPAUHMENU__@@PAUtagOleMenuGroupWidths@@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?SetMenu@CAxFrameWindow@ATL@@UAGJPAUHMENU__@@PAXPAUHWND__@@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?RemoveMenus@CAxFrameWindow@ATL@@UAGJPAUHMENU__@@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?SetStatusText@CAxFrameWindow@ATL@@UAGJPBG@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?EnableModeless@CAxFrameWindow@ATL@@UAGJH@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?TranslateAcceleratorA@CAxFrameWindow@ATL@@UAGJPAUtagMSG@@G@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??_7?$CComObject@VCAxFrameWindow@ATL@@@ATL@@6B?$CWindowImpl@VCAxFrameWindow@ATL@@VCWindow@2@V?$CWinTraits@$0FGAAAAAA@$0A@@2@@1@@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?ProcessWindowMessage@CAxFrameWindow@ATL@@UAEHPAUHWND__@@IIJAAJK@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??_G?$CComObject@VCAxFrameWindow@ATL@@@ATL@@UAEPAXI@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??1?$CComObject@VCAxFrameWindow@ATL@@@ATL@@UAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?FinalRelease@CAxFrameWindow@ATL@@QAEXXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??1CAxFrameWindow@ATL@@UAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??1?$CWindowImpl@VCAxFrameWindow@ATL@@VCWindow@2@V?$CWinTraits@$0FGAAAAAA@$0A@@2@@ATL@@UAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0CAxFrameWindow@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0?$CWindowImpl@VCAxFrameWindow@ATL@@VCWindow@2@V?$CWinTraits@$0FGAAAAAA@$0A@@2@@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0IOleInPlaceFrame@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?PrepareWrite@?$CSimpleStringT@D$0A@@ATL@@AAEPADH@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?PrepareWrite2@?$CSimpleStringT@D$0A@@ATL@@AAEXH@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?IsShared@CStringData@ATL@@QBE_NXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Fork@?$CSimpleStringT@D$0A@@ATL@@AAEXH@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Reallocate@?$CSimpleStringT@D$0A@@ATL@@AAEXH@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??_C@_0CB@GFHAPKDK@pOldData?9?$DOnAllocLength?5?$DM?5nLength@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??_C@_01GBGANLPD@0?$AA@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?szInvalidDateTimeSpan@ATL@@3QBDB
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?szInvalidDateTime@ATL@@3QBDB
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?Week@CFileTime@ATL@@2_KB
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?Day@CFileTime@ATL@@2_KB
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?Hour@CFileTime@ATL@@2_KB
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?Minute@CFileTime@ATL@@2_KB
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?Second@CFileTime@ATL@@2_KB
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?Millisecond@CFileTime@ATL@@2_KB
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?c_bIsMFCDLLTraits@?$_MFCDLLTraitsCheck@GV?$StrTraitATL@GV?$ChTraitsCRT@G@ATL@@@ATL@@@_CSTRING_IMPL_@ATL@@2_NB
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?c_bIsMFCDLLTraits@?$_MFCDLLTraitsCheck@DV?$StrTraitATL@DV?$ChTraitsCRT@D@ATL@@@ATL@@@_CSTRING_IMPL_@ATL@@2_NB
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??_C@_09BBJEMDLA@nRet?5?$CB?$DN?50?$AA@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?AddRef@CStringData@ATL@@QAEXXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??_C@_09EEBKLCFA@nRefs?5?$DO?50?$AA@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?SetManager@CNilStringData@ATL@@QAEXPAUIAtlStringMgr@2@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??_C@_0BA@MLJMCNFJ@pStringMgr?5?$DN?$DN?50?$AA@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??0CNilStringData@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??_7CAtlStringMgr@ATL@@6B@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??_7IFixedStringLog@ATL@@6B@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??BCTraceCategory@ATL@@QBEKXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0CTraceFileAndLineInfo@ATL@@QAE@PBDH@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??RCTraceFileAndLineInfo@ATL@@QBAXKIPBDZZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?TraceV@CTrace@ATL@@QBAXPBDHKI0PAD@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??_7CFixedStringLog@ATL@@6B@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?s_pLog@CFixedStringMgr@ATL@@2PAVIFixedStringLog@2@A
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
; COMDAT ?data@CStringData@ATL@@QAEPAXXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??_7CFixedStringMgr@ATL@@6B@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?AtlA2WHelper@@YGPAGPAGPBDHI@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??_C@_08DMHHBMMN@lpa?5?$CB?$DN?50?$AA@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??_C@_08DIHJLFDJ@lpw?5?$CB?$DN?50?$AA@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??_C@_0FA@OHHMODBN@C?3?2Program?5Files?2Microsoft?5Visua@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?AtlThrow@ATL@@YGXJ@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??_C@_0FC@CFIFHLCH@C?3?2Program?5Files?2Microsoft?5Visua@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??_C@_0BF@IAAKIJDJ@AtlThrow?3?5hr?5?$DN?50x?$CFx?6?$AA@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??0CAtlException@ATL@@QAE@J@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT __TI1?AVCAtlException@ATL@@
xdata$x SEGMENT DWORD USE32 PUBLIC 'CONST'
xdata$x ENDS
; COMDAT __CTA1?AVCAtlException@ATL@@
xdata$x SEGMENT DWORD USE32 PUBLIC 'CONST'
xdata$x ENDS
; COMDAT __CT??_R0?AVCAtlException@ATL@@@84
xdata$x SEGMENT DWORD USE32 PUBLIC 'CONST'
xdata$x ENDS
; COMDAT ??_R0?AVCAtlException@ATL@@@8
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
; COMDAT ?Allocate@?$CAtlSafeAllocBufferManager@VCCRTAllocator@ATL@@@_ATL_SAFE_ALLOCA_IMPL@ATL@@QAEPAXK@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Allocate@CCRTAllocator@ATL@@SAPAXI@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetData@CAtlSafeAllocBufferNode@?$CAtlSafeAllocBufferManager@VCCRTAllocator@ATL@@@_ATL_SAFE_ALLOCA_IMPL@ATL@@QAEPAXXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?_AtlVerifyStackAvailable@_ATL_SAFE_ALLOCA_IMPL@ATL@@YA_NK@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?AtlW2AHelper@@YGPADPADPBGHI@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??1?$CAtlSafeAllocBufferManager@VCCRTAllocator@ATL@@@_ATL_SAFE_ALLOCA_IMPL@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Free@CCRTAllocator@ATL@@SAXPAX@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0?$CAtlSafeAllocBufferManager@VCCRTAllocator@ATL@@@_ATL_SAFE_ALLOCA_IMPL@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?_strthunks@ATL@@3U_AtlStringThunks@1@A
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
; COMDAT ??B?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QBEPADXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?Allocate@?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QAEPADI@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?AllocateBytes@?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QAEPADI@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??_C@_08GPODJFIN@m_p?5?$DN?$DN?50?$AA@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ??_C@_0FB@IAFJMJBP@C?3?2Program?5Files?2Microsoft?5Visua@
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
; COMDAT ?AllocateHeap@?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@AAEXI@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??1?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?FreeHeap@?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@AAEXXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ??0?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QAE@XZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?InterlockedExchangePointer@@YGPAXPAPAXPAX@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?s_bWin9x@?1??_AtlInstallStringThunk@ATL@@YAXPAPAXPAX1@Z@4_NA
_BSS SEGMENT DWORD USE32 PUBLIC 'BSS'
_BSS ENDS
; COMDAT ??_B?1??_AtlInstallStringThunk@ATL@@YAXPAPAXPAX1@Z@51
_BSS SEGMENT DWORD USE32 PUBLIC 'BSS'
_BSS ENDS
; COMDAT ?_AtlGetConversionACP@ATL@@YGIXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?g_pfnGetThreadACP@ATL@@3P6GIXZA
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
; COMDAT ?_AtlGetThreadACPThunk@ATL@@YGIXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?_AtlGetThreadACPReal@ATL@@YGIXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?_AtlGetThreadACPFake@ATL@@YGIXZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
sxdata SEGMENT DWORD USE32 'SXDATA'
sxdata ENDS
FLAT GROUP _DATA, CONST, _BSS, CRT$XCU
ASSUME CS: FLAT, DS: FLAT, SS: FLAT
endif
INCLUDELIB LIBCMTD
INCLUDELIB OLDNAMES
PUBLIC ?Week@CFileTime@ATL@@2_KB ; ATL::CFileTime::Week
PUBLIC ?g_pfnGetThreadACP@ATL@@3P6GIXZA ; ATL::g_pfnGetThreadACP
PUBLIC ?_AtlGetThreadACPThunk@ATL@@YGIXZ ; ATL::_AtlGetThreadACPThunk
PUBLIC ?szInvalidDateTime@ATL@@3QBDB ; ATL::szInvalidDateTime
PUBLIC ?szInvalidDateTimeSpan@ATL@@3QBDB ; ATL::szInvalidDateTimeSpan
PUBLIC ?_pAtlModule@ATL@@3PAVCAtlModule@1@A ; ATL::_pAtlModule
PUBLIC ?s_pLog@CFixedStringMgr@ATL@@2PAVIFixedStringLog@2@A ; ATL::CFixedStringMgr::s_pLog
PUBLIC ?c_bIsMFCDLLTraits@?$_MFCDLLTraitsCheck@GV?$StrTraitATL@GV?$ChTraitsCRT@G@ATL@@@ATL@@@_CSTRING_IMPL_@ATL@@2_NB ; ATL::_CSTRING_IMPL_::_MFCDLLTraitsCheck<unsigned short,ATL::StrTraitATL<unsigned short,ATL::ChTraitsCRT<unsigned short> > >::c_bIsMFCDLLTraits
PUBLIC ?_strthunks@ATL@@3U_AtlStringThunks@1@A ; ATL::_strthunks
PUBLIC ?GetEnvironmentVariableWThunk@ATL@@YGKPBGPAGK@Z ; ATL::GetEnvironmentVariableWThunk
PUBLIC ?CompareStringWThunk@ATL@@YGHKKPBGH0H@Z ; ATL::CompareStringWThunk
PUBLIC ?GetStringTypeExWThunk@ATL@@YGHKKPBGHPAG@Z ; ATL::GetStringTypeExWThunk
PUBLIC ?lstrcmpiWThunk@ATL@@YGHPBG0@Z ; ATL::lstrcmpiWThunk
PUBLIC ?CharLowerWThunk@ATL@@YGPAGPAG@Z ; ATL::CharLowerWThunk
PUBLIC ?CharUpperWThunk@ATL@@YGPAGPAG@Z ; ATL::CharUpperWThunk
PUBLIC ?rcDefault@CWindow@ATL@@2UtagRECT@@A ; ATL::CWindow::rcDefault
PUBLIC ?m_bInitFailed@CAtlBaseModule@ATL@@2_NA ; ATL::CAtlBaseModule::m_bInitFailed
PUBLIC ?c_bIsMFCDLLTraits@?$_MFCDLLTraitsCheck@DV?$StrTraitATL@DV?$ChTraitsCRT@D@ATL@@@ATL@@@_CSTRING_IMPL_@ATL@@2_NB ; ATL::_CSTRING_IMPL_::_MFCDLLTraitsCheck<char,ATL::StrTraitATL<char,ATL::ChTraitsCRT<char> > >::c_bIsMFCDLLTraits
PUBLIC ?Millisecond@CFileTime@ATL@@2_KB ; ATL::CFileTime::Millisecond
PUBLIC ?Second@CFileTime@ATL@@2_KB ; ATL::CFileTime::Second
PUBLIC ?Minute@CFileTime@ATL@@2_KB ; ATL::CFileTime::Minute
PUBLIC ?Hour@CFileTime@ATL@@2_KB ; ATL::CFileTime::Hour
PUBLIC ?Day@CFileTime@ATL@@2_KB ; ATL::CFileTime::Day
; COMDAT ?_pAtlModule@ATL@@3PAVCAtlModule@1@A
_BSS SEGMENT
?_pAtlModule@ATL@@3PAVCAtlModule@1@A DD 01H DUP (?) ; ATL::_pAtlModule
_BSS ENDS
; COMDAT ?s_pLog@CFixedStringMgr@ATL@@2PAVIFixedStringLog@2@A
_BSS SEGMENT
?s_pLog@CFixedStringMgr@ATL@@2PAVIFixedStringLog@2@A DD 01H DUP (?) ; ATL::CFixedStringMgr::s_pLog
_BSS ENDS
; COMDAT ?m_bInitFailed@CAtlBaseModule@ATL@@2_NA
_BSS SEGMENT
?m_bInitFailed@CAtlBaseModule@ATL@@2_NA DB 01H DUP (?) ; ATL::CAtlBaseModule::m_bInitFailed
_BSS ENDS
; COMDAT ?_strthunks@ATL@@3U_AtlStringThunks@1@A
_DATA SEGMENT
?_strthunks@ATL@@3U_AtlStringThunks@1@A DD FLAT:?CompareStringWThunk@ATL@@YGHKKPBGH0H@Z ; ATL::_strthunks
DD FLAT:?GetStringTypeExWThunk@ATL@@YGHKKPBGHPAG@Z
DD FLAT:?lstrcmpiWThunk@ATL@@YGHPBG0@Z
DD FLAT:?CharLowerWThunk@ATL@@YGPAGPAG@Z
DD FLAT:?CharUpperWThunk@ATL@@YGPAGPAG@Z
DD FLAT:?GetEnvironmentVariableWThunk@ATL@@YGKPBGPAGK@Z
_DATA ENDS
; COMDAT ?c_bIsMFCDLLTraits@?$_MFCDLLTraitsCheck@DV?$StrTraitATL@DV?$ChTraitsCRT@D@ATL@@@ATL@@@_CSTRING_IMPL_@ATL@@2_NB
CONST SEGMENT
?c_bIsMFCDLLTraits@?$_MFCDLLTraitsCheck@DV?$StrTraitATL@DV?$ChTraitsCRT@D@ATL@@@ATL@@@_CSTRING_IMPL_@ATL@@2_NB DB 00H ; ATL::_CSTRING_IMPL_::_MFCDLLTraitsCheck<char,ATL::StrTraitATL<char,ATL::ChTraitsCRT<char> > >::c_bIsMFCDLLTraits
CONST ENDS
; COMDAT ?c_bIsMFCDLLTraits@?$_MFCDLLTraitsCheck@GV?$StrTraitATL@GV?$ChTraitsCRT@G@ATL@@@ATL@@@_CSTRING_IMPL_@ATL@@2_NB
CONST SEGMENT
?c_bIsMFCDLLTraits@?$_MFCDLLTraitsCheck@GV?$StrTraitATL@GV?$ChTraitsCRT@G@ATL@@@ATL@@@_CSTRING_IMPL_@ATL@@2_NB DB 00H ; ATL::_CSTRING_IMPL_::_MFCDLLTraitsCheck<unsigned short,ATL::StrTraitATL<unsigned short,ATL::ChTraitsCRT<unsigned short> > >::c_bIsMFCDLLTraits
CONST ENDS
; COMDAT ?Millisecond@CFileTime@ATL@@2_KB
CONST SEGMENT
?Millisecond@CFileTime@ATL@@2_KB DQ 0000000000002710H ; ATL::CFileTime::Millisecond
CONST ENDS
; COMDAT ?Second@CFileTime@ATL@@2_KB
CONST SEGMENT
?Second@CFileTime@ATL@@2_KB DQ 0000000000989680H ; ATL::CFileTime::Second
CONST ENDS
; COMDAT ?Minute@CFileTime@ATL@@2_KB
CONST SEGMENT
?Minute@CFileTime@ATL@@2_KB DQ 0000000023c34600H ; ATL::CFileTime::Minute
CONST ENDS
; COMDAT ?Hour@CFileTime@ATL@@2_KB
CONST SEGMENT
?Hour@CFileTime@ATL@@2_KB DQ 0000000861c46800H ; ATL::CFileTime::Hour
CONST ENDS
; COMDAT ?Day@CFileTime@ATL@@2_KB
CONST SEGMENT
?Day@CFileTime@ATL@@2_KB DQ 000000c92a69c000H ; ATL::CFileTime::Day
CONST ENDS
; COMDAT ?Week@CFileTime@ATL@@2_KB
CONST SEGMENT
?Week@CFileTime@ATL@@2_KB DQ 0000058028e44000H ; ATL::CFileTime::Week
CONST ENDS
CONST SEGMENT
$SG181255 DB 'Invalid DateTime', 00H
CONST ENDS
; COMDAT ?szInvalidDateTime@ATL@@3QBDB
CONST SEGMENT
?szInvalidDateTime@ATL@@3QBDB DD FLAT:$SG181255 ; ATL::szInvalidDateTime
CONST ENDS
CONST SEGMENT
ORG $+3
$SG181257 DB 'Invalid DateTimeSpan', 00H
CONST ENDS
; COMDAT ?szInvalidDateTimeSpan@ATL@@3QBDB
CONST SEGMENT
?szInvalidDateTimeSpan@ATL@@3QBDB DD FLAT:$SG181257 ; ATL::szInvalidDateTimeSpan
CONST ENDS
CONST SEGMENT
ORG $+3
$SG181728 DB 'pp != 0', 00H
ORG $+4
$SG181729 DB 'C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\a'
DB 'tlmfc\include\atlcom.h', 00H
CONST ENDS
; COMDAT ?g_pfnGetThreadACP@ATL@@3P6GIXZA
_DATA SEGMENT
?g_pfnGetThreadACP@ATL@@3P6GIXZA DD FLAT:?_AtlGetThreadACPThunk@ATL@@YGIXZ ; ATL::g_pfnGetThreadACP
_DATA ENDS
; COMDAT ?rcDefault@CWindow@ATL@@2UtagRECT@@A
_DATA SEGMENT
?rcDefault@CWindow@ATL@@2UtagRECT@@A DD 080000000H ; ATL::CWindow::rcDefault
DD 080000000H
DD 00H
DD 00H
_DATA ENDS
CONST SEGMENT
ORG $+1
$SG160733 DB 'pThis != 0', 00H
ORG $+5
$SG160734 DB 'C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\a'
DB 'tlmfc\include\atlwin.h', 00H
ORG $+1
$SG160741 DB 'C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\a'
DB 'tlmfc\include\atlwin.h', 00H
ORG $+1
$SG160742 DB 'Subclassing through a hook discarded.', 0aH, 00H
ORG $+1
$SG160758 DB 'pThis->m_pCurrentMsg == &msg', 00H
ORG $+3
$SG160759 DB 'C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\a'
DB 'tlmfc\include\atlwin.h', 00H
ORG $+1
$SG160782 DB 'm_hWnd == 0', 00H
ORG $+4
$SG160783 DB 'C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\a'
DB 'tlmfc\include\atlwin.h', 00H
ORG $+1
$SG160794 DB 'm_hWnd == hWnd', 00H
ORG $+1
$SG160795 DB 'C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\a'
DB 'tlmfc\include\atlwin.h', 00H
ORG $+1
$SG161005 DB 'm_begin == 0', 00H
ORG $+3
$SG161006 DB 'C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\a'
DB 'tlmfc\include\atlcom.h', 00H
CONST ENDS
PUBLIC ?InterlockedExchangePointer@@YGPAXPAPAXPAX@Z ; InterlockedExchangePointer
PUBLIC ?_AtlGetThreadACPFake@ATL@@YGIXZ ; ATL::_AtlGetThreadACPFake
PUBLIC ?_AtlGetThreadACPReal@ATL@@YGIXZ ; ATL::_AtlGetThreadACPReal
EXTRN __RTC_InitBase:NEAR
EXTRN __RTC_Shutdown:NEAR
EXTRN __RTC_CheckEsp:NEAR
EXTRN ___security_cookie:DWORD
EXTRN @_RTC_CheckStackVars@8:NEAR
EXTRN @__security_check_cookie@4:NEAR
EXTRN __imp__GetVersionExA@4:NEAR
; COMDAT rtc$IMZ
; File c:\program files\microsoft visual studio .net 2003\vc7\atlmfc\include\atlconv.h
rtc$IMZ SEGMENT
__RTC_InitBase.rtc$IMZ DD FLAT:__RTC_InitBase
rtc$IMZ ENDS
; COMDAT rtc$TMZ
rtc$TMZ SEGMENT
__RTC_Shutdown.rtc$TMZ DD FLAT:__RTC_Shutdown
; Function compile flags: /Odt /RTCsu
rtc$TMZ ENDS
; COMDAT ?_AtlGetThreadACPThunk@ATL@@YGIXZ
_TEXT SEGMENT
_pfnGetThreadACP$ = -164 ; size = 4
_ver$ = -156 ; size = 148
__$ArrayPad$ = -4 ; size = 4
__$ReturnAddr$ = 4 ; size = 4
?_AtlGetThreadACPThunk@ATL@@YGIXZ PROC NEAR ; ATL::_AtlGetThreadACPThunk, COMDAT
; 134 : {
push ebp
mov ebp, esp
sub esp, 164 ; 000000a4H
push esi
push edi
lea edi, DWORD PTR [ebp-164]
mov ecx, 41 ; 00000029H
mov eax, -858993460 ; ccccccccH
rep stosd
mov eax, DWORD PTR ___security_cookie
mov DWORD PTR __$ArrayPad$[ebp], eax
; 135 : OSVERSIONINFO ver;
; 136 : ATLGETTHREADACP pfnGetThreadACP;
; 137 :
; 138 : ver.dwOSVersionInfoSize = sizeof( ver );
mov DWORD PTR _ver$[ebp], 148 ; 00000094H
; 139 : ::GetVersionEx( &ver );
mov esi, esp
lea eax, DWORD PTR _ver$[ebp]
push eax
call DWORD PTR __imp__GetVersionExA@4
cmp esi, esp
call __RTC_CheckEsp
; 140 : if( (ver.dwPlatformId == VER_PLATFORM_WIN32_NT) && (ver.dwMajorVersion >= 5) )
cmp DWORD PTR _ver$[ebp+16], 2
jne SHORT $L75782
cmp DWORD PTR _ver$[ebp+4], 5
jb SHORT $L75782
; 141 : {
; 142 : // On Win2K, CP_THREAD_ACP is supported
; 143 : pfnGetThreadACP = _AtlGetThreadACPReal;
mov DWORD PTR _pfnGetThreadACP$[ebp], OFFSET FLAT:?_AtlGetThreadACPReal@ATL@@YGIXZ ; ATL::_AtlGetThreadACPReal
; 144 : }
; 145 : else
jmp SHORT $L75783
$L75782:
; 146 : {
; 147 : pfnGetThreadACP = _AtlGetThreadACPFake;
mov DWORD PTR _pfnGetThreadACP$[ebp], OFFSET FLAT:?_AtlGetThreadACPFake@ATL@@YGIXZ ; ATL::_AtlGetThreadACPFake
$L75783:
; 148 : }
; 149 : InterlockedExchangePointer( reinterpret_cast< void** >(&g_pfnGetThreadACP), pfnGetThreadACP );
mov ecx, DWORD PTR _pfnGetThreadACP$[ebp]
push ecx
push OFFSET FLAT:?g_pfnGetThreadACP@ATL@@3P6GIXZA ; ATL::g_pfnGetThreadACP
call ?InterlockedExchangePointer@@YGPAXPAPAXPAX@Z ; InterlockedExchangePointer
; 150 :
; 151 : return( g_pfnGetThreadACP() );
mov esi, esp
call DWORD PTR ?g_pfnGetThreadACP@ATL@@3P6GIXZA ; ATL::g_pfnGetThreadACP
cmp esi, esp
call __RTC_CheckEsp
; 152 : }
push edx
mov ecx, ebp
push eax
lea edx, DWORD PTR $L182306
call @_RTC_CheckStackVars@8
pop eax
pop edx
mov ecx, DWORD PTR __$ArrayPad$[ebp]
call @__security_check_cookie@4
pop edi
pop esi
add esp, 164 ; 000000a4H
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
$L182306:
DD 1
DD $L182305
$L182305:
DD -156 ; ffffff64H
DD 148 ; 00000094H
DD $L182302
$L182302:
DB 118 ; 00000076H
DB 101 ; 00000065H
DB 114 ; 00000072H
DB 0
?_AtlGetThreadACPThunk@ATL@@YGIXZ ENDP ; ATL::_AtlGetThreadACPThunk
_TEXT ENDS
EXTRN __imp__InterlockedExchange@8:NEAR
; Function compile flags: /Odt /RTCsu
; COMDAT ?InterlockedExchangePointer@@YGPAXPAPAXPAX@Z
_TEXT SEGMENT
_pp$ = 8 ; size = 4
_pNew$ = 12 ; size = 4
?InterlockedExchangePointer@@YGPAXPAPAXPAX@Z PROC NEAR ; InterlockedExchangePointer, COMDAT
; 91 : {
push ebp
mov ebp, esp
push esi
; 92 : return( reinterpret_cast<void*>(static_cast<LONG_PTR>(::InterlockedExchange(reinterpret_cast<LONG*>(pp), static_cast<LONG>(reinterpret_cast<LONG_PTR>(pNew))))) );
mov esi, esp
mov eax, DWORD PTR _pNew$[ebp]
push eax
mov ecx, DWORD PTR _pp$[ebp]
push ecx
call DWORD PTR __imp__InterlockedExchange@8
cmp esi, esp
call __RTC_CheckEsp
; 93 : }
pop esi
cmp ebp, esp
call __RTC_CheckEsp
pop ebp
ret 8
?InterlockedExchangePointer@@YGPAXPAPAXPAX@Z ENDP ; InterlockedExchangePointer
_TEXT ENDS
EXTRN __imp__GetACP@0:NEAR
EXTRN __imp__GetLocaleInfoA@16:NEAR
EXTRN __imp__GetThreadLocale@0:NEAR
; Function compile flags: /Odt /RTCsu
; COMDAT ?_AtlGetThreadACPFake@ATL@@YGIXZ
_TEXT SEGMENT
_pch$75770 = -32 ; size = 4
_szACP$ = -24 ; size = 7
_lcidThread$ = -12 ; size = 4
_nACP$ = -8 ; size = 4
__$ArrayPad$ = -4 ; size = 4
__$ReturnAddr$ = 4 ; size = 4
?_AtlGetThreadACPFake@ATL@@YGIXZ PROC NEAR ; ATL::_AtlGetThreadACPFake, COMDAT
; 101 : {
push ebp
mov ebp, esp
sub esp, 32 ; 00000020H
push esi
mov eax, -858993460 ; ccccccccH
mov DWORD PTR [ebp-32], eax
mov DWORD PTR [ebp-28], eax
mov DWORD PTR [ebp-24], eax
mov DWORD PTR [ebp-20], eax
mov DWORD PTR [ebp-16], eax
mov DWORD PTR [ebp-12], eax
mov DWORD PTR [ebp-8], eax
mov DWORD PTR [ebp-4], eax
mov eax, DWORD PTR ___security_cookie
mov DWORD PTR __$ArrayPad$[ebp], eax
; 102 : UINT nACP = 0;
mov DWORD PTR _nACP$[ebp], 0
; 103 :
; 104 : LCID lcidThread = ::GetThreadLocale();
mov esi, esp
call DWORD PTR __imp__GetThreadLocale@0
cmp esi, esp
call __RTC_CheckEsp
mov DWORD PTR _lcidThread$[ebp], eax
; 105 :
; 106 : char szACP[7];
; 107 : // GetLocaleInfoA will fail for a Unicode-only LCID, but those are only supported on
; 108 : // Windows 2000. Since Windows 2000 supports CP_THREAD_ACP, this code path is never
; 109 : // executed on Windows 2000.
; 110 : if (::GetLocaleInfoA(lcidThread, LOCALE_IDEFAULTANSICODEPAGE, szACP, 7) != 0)
mov esi, esp
push 7
lea eax, DWORD PTR _szACP$[ebp]
push eax
push 4100 ; 00001004H
mov ecx, DWORD PTR _lcidThread$[ebp]
push ecx
call DWORD PTR __imp__GetLocaleInfoA@16
cmp esi, esp
call __RTC_CheckEsp
test eax, eax
je SHORT $L75769
; 111 : {
; 112 : char* pch = szACP;
lea edx, DWORD PTR _szACP$[ebp]
mov DWORD PTR _pch$75770[ebp], edx
$L75772:
; 113 : while (*pch != '\0')
mov eax, DWORD PTR _pch$75770[ebp]
movsx ecx, BYTE PTR [eax]
test ecx, ecx
je SHORT $L75769
; 114 : {
; 115 : nACP *= 10;
mov edx, DWORD PTR _nACP$[ebp]
imul edx, 10 ; 0000000aH
mov DWORD PTR _nACP$[ebp], edx
; 116 : nACP += *pch++ - '0';
mov eax, DWORD PTR _pch$75770[ebp]
movsx ecx, BYTE PTR [eax]
mov edx, DWORD PTR _nACP$[ebp]
lea eax, DWORD PTR [edx+ecx-48]
mov DWORD PTR _nACP$[ebp], eax
mov ecx, DWORD PTR _pch$75770[ebp]
add ecx, 1
mov DWORD PTR _pch$75770[ebp], ecx
; 117 : }
jmp SHORT $L75772
$L75769:
; 118 : }
; 119 : // Use the Default ANSI Code Page if we were unable to get the thread ACP or if one does not exist.
; 120 : if (nACP == 0)
cmp DWORD PTR _nACP$[ebp], 0
jne SHORT $L75774
; 121 : nACP = ::GetACP();
mov esi, esp
call DWORD PTR __imp__GetACP@0
cmp esi, esp
call __RTC_CheckEsp
mov DWORD PTR _nACP$[ebp], eax
$L75774:
; 122 :
; 123 : return nACP;
mov eax, DWORD PTR _nACP$[ebp]
; 124 : }
push edx
mov ecx, ebp
push eax
lea edx, DWORD PTR $L182319
call @_RTC_CheckStackVars@8
pop eax
pop edx
mov ecx, DWORD PTR __$ArrayPad$[ebp]
call @__security_check_cookie@4
pop esi
add esp, 32 ; 00000020H
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
$L182319:
DD 1
DD $L182318
$L182318:
DD -24 ; ffffffe8H
DD 7
DD $L182316
$L182316:
DB 115 ; 00000073H
DB 122 ; 0000007aH
DB 65 ; 00000041H
DB 67 ; 00000043H
DB 80 ; 00000050H
DB 0
?_AtlGetThreadACPFake@ATL@@YGIXZ ENDP ; ATL::_AtlGetThreadACPFake
; Function compile flags: /Odt /RTCsu
_TEXT ENDS
; COMDAT ?_AtlGetThreadACPReal@ATL@@YGIXZ
_TEXT SEGMENT
?_AtlGetThreadACPReal@ATL@@YGIXZ PROC NEAR ; ATL::_AtlGetThreadACPReal, COMDAT
; 127 : {
push ebp
mov ebp, esp
; 128 : return( CP_THREAD_ACP );
mov eax, 3
; 129 : }
pop ebp
ret 0
?_AtlGetThreadACPReal@ATL@@YGIXZ ENDP ; ATL::_AtlGetThreadACPReal
_TEXT ENDS
PUBLIC ?_AtlInstallStringThunk@ATL@@YAXPAPAXPAX1@Z ; ATL::_AtlInstallStringThunk
PUBLIC ?GetEnvironmentVariableWFake@ATL@@YGKPBGPAGK@Z ; ATL::GetEnvironmentVariableWFake
EXTRN __imp__GetEnvironmentVariableW@12:NEAR
; Function compile flags: /Odt /RTCsu
; File c:\program files\microsoft visual studio .net 2003\vc7\atlmfc\include\cstringt.h
; COMDAT ?GetEnvironmentVariableWThunk@ATL@@YGKPBGPAGK@Z
_TEXT SEGMENT
_pszName$ = 8 ; size = 4
_pszBuffer$ = 12 ; size = 4
_nSize$ = 16 ; size = 4
?GetEnvironmentVariableWThunk@ATL@@YGKPBGPAGK@Z PROC NEAR ; ATL::GetEnvironmentVariableWThunk, COMDAT
; 183 : {
push ebp
mov ebp, esp
push esi
; 184 : _AtlInstallStringThunk(reinterpret_cast<void**>(&_strthunks.pfnGetEnvironmentVariableW),
; 185 : GetEnvironmentVariableWFake, ::GetEnvironmentVariableW);
mov eax, DWORD PTR __imp__GetEnvironmentVariableW@12
push eax
push OFFSET FLAT:?GetEnvironmentVariableWFake@ATL@@YGKPBGPAGK@Z ; ATL::GetEnvironmentVariableWFake
push OFFSET FLAT:?_strthunks@ATL@@3U_AtlStringThunks@1@A+20
call ?_AtlInstallStringThunk@ATL@@YAXPAPAXPAX1@Z ; ATL::_AtlInstallStringThunk
add esp, 12 ; 0000000cH
; 186 :
; 187 : return _strthunks.pfnGetEnvironmentVariableW(pszName, pszBuffer, nSize);
mov esi, esp
mov ecx, DWORD PTR _nSize$[ebp]
push ecx
mov edx, DWORD PTR _pszBuffer$[ebp]
push edx
mov eax, DWORD PTR _pszName$[ebp]
push eax
call DWORD PTR ?_strthunks@ATL@@3U_AtlStringThunks@1@A+20
cmp esi, esp
call __RTC_CheckEsp
; 188 : }
pop esi
cmp ebp, esp
call __RTC_CheckEsp
pop ebp
ret 12 ; 0000000cH
?GetEnvironmentVariableWThunk@ATL@@YGKPBGPAGK@Z ENDP ; ATL::GetEnvironmentVariableWThunk
_TEXT ENDS
PUBLIC ?s_bWin9x@?1??_AtlInstallStringThunk@ATL@@YAXPAPAXPAX1@Z@4_NA ; `ATL::_AtlInstallStringThunk'::`2'::s_bWin9x
PUBLIC ??_B?1??_AtlInstallStringThunk@ATL@@YAXPAPAXPAX1@Z@51 ; `ATL::_AtlInstallStringThunk'::`2'::`local static guard'
EXTRN __imp__GetVersion@0:NEAR
; COMDAT ?s_bWin9x@?1??_AtlInstallStringThunk@ATL@@YAXPAPAXPAX1@Z@4_NA
_BSS SEGMENT
?s_bWin9x@?1??_AtlInstallStringThunk@ATL@@YAXPAPAXPAX1@Z@4_NA DB 01H DUP (?) ; `ATL::_AtlInstallStringThunk'::`2'::s_bWin9x
_BSS ENDS
; COMDAT ??_B?1??_AtlInstallStringThunk@ATL@@YAXPAPAXPAX1@Z@51
_BSS SEGMENT
??_B?1??_AtlInstallStringThunk@ATL@@YAXPAPAXPAX1@Z@51 DD 01H DUP (?) ; `ATL::_AtlInstallStringThunk'::`2'::`local static guard'
; Function compile flags: /Odt /RTCsu
_BSS ENDS
; COMDAT ?_AtlInstallStringThunk@ATL@@YAXPAPAXPAX1@Z
_TEXT SEGMENT
_pfn$ = -4 ; size = 4
_ppThunk$ = 8 ; size = 4
_pfnWin9x$ = 12 ; size = 4
_pfnNT$ = 16 ; size = 4
?_AtlInstallStringThunk@ATL@@YAXPAPAXPAX1@Z PROC NEAR ; ATL::_AtlInstallStringThunk, COMDAT
; 115 : {
push ebp
mov ebp, esp
push ecx
push esi
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
; 116 : #pragma warning (push)
; 117 : #pragma warning (disable : 4640) // construction of local static object is not thread-safe
; 118 :
; 119 : static bool s_bWin9x = (::GetVersion()&0x80000000) != 0;
mov eax, DWORD PTR ??_B?1??_AtlInstallStringThunk@ATL@@YAXPAPAXPAX1@Z@51
and eax, 1
jne SHORT $L178535
mov ecx, DWORD PTR ??_B?1??_AtlInstallStringThunk@ATL@@YAXPAPAXPAX1@Z@51
or ecx, 1
mov DWORD PTR ??_B?1??_AtlInstallStringThunk@ATL@@YAXPAPAXPAX1@Z@51, ecx
mov esi, esp
call DWORD PTR __imp__GetVersion@0
cmp esi, esp
call __RTC_CheckEsp
and eax, -2147483648 ; 80000000H
neg eax
sbb eax, eax
neg eax
mov BYTE PTR ?s_bWin9x@?1??_AtlInstallStringThunk@ATL@@YAXPAPAXPAX1@Z@4_NA, al ; `ATL::_AtlInstallStringThunk'::`2'::s_bWin9x
$L178535:
; 120 :
; 121 : #pragma warning (pop)
; 122 :
; 123 : void* pfn;
; 124 : if (s_bWin9x)
movzx edx, BYTE PTR ?s_bWin9x@?1??_AtlInstallStringThunk@ATL@@YAXPAPAXPAX1@Z@4_NA ; `ATL::_AtlInstallStringThunk'::`2'::s_bWin9x
test edx, edx
je SHORT $L178537
; 125 : pfn = pfnWin9x;
mov eax, DWORD PTR _pfnWin9x$[ebp]
mov DWORD PTR _pfn$[ebp], eax
; 126 : else
jmp SHORT $L178538
$L178537:
; 127 : {
; 128 : #ifdef _CSTRING_ALWAYS_THUNK
; 129 : pfn = pfnWin9x;
; 130 : (void)pfnNT;
; 131 : #else
; 132 : pfn = pfnNT;
mov ecx, DWORD PTR _pfnNT$[ebp]
mov DWORD PTR _pfn$[ebp], ecx
$L178538:
; 133 : #endif
; 134 : }
; 135 : InterlockedExchangePointer(ppThunk, pfn);
mov edx, DWORD PTR _pfn$[ebp]
push edx
mov eax, DWORD PTR _ppThunk$[ebp]
push eax
call ?InterlockedExchangePointer@@YGPAXPAPAXPAX@Z ; InterlockedExchangePointer
; 136 : }
pop esi
add esp, 4
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
?_AtlInstallStringThunk@ATL@@YAXPAPAXPAX1@Z ENDP ; ATL::_AtlInstallStringThunk
_TEXT ENDS
PUBLIC ?_AtlGetConversionACP@ATL@@YGIXZ ; ATL::_AtlGetConversionACP
PUBLIC ??_C@_0FB@DNILBHEN@C?3?2Program?5Files?2Microsoft?5Visua@ ; `string'
PUBLIC ??0?$CW2AEX@$0IA@@ATL@@QAE@PBG@Z ; ATL::CW2AEX<128>::CW2AEX<128>
PUBLIC ??1?$CW2AEX@$0IA@@ATL@@QAE@XZ ; ATL::CW2AEX<128>::~CW2AEX<128>
PUBLIC ??B?$CW2AEX@$0IA@@ATL@@QBEPADXZ ; ATL::CW2AEX<128>::operator char *
PUBLIC ??_C@_0BA@CLMJJCOM@nSize?5?$DO?$DN?5nSizeW?$AA@ ; `string'
PUBLIC ??0?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QAE@XZ ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::CTempBuffer<char,128,ATL::CCRTAllocator>
PUBLIC ??1?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QAE@XZ ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::~CTempBuffer<char,128,ATL::CCRTAllocator>
PUBLIC ??B?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QBEPADXZ ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::operator char *
PUBLIC ?Allocate@?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QAEPADI@Z ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::Allocate
EXTRN __except_list:DWORD
EXTRN ___CxxFrameHandler:NEAR
EXTRN __imp__MultiByteToWideChar@24:NEAR
EXTRN __imp__GetEnvironmentVariableA@12:NEAR
EXTRN __CrtDbgReport:NEAR
; COMDAT xdata$x
xdata$x SEGMENT
$T182346 DD 0ffffffffH
DD FLAT:$L182333
DD 00H
DD FLAT:$L182334
$T182338 DD 019930520H
DD 02H
DD FLAT:$T182346
DD 2 DUP(00H)
DD 2 DUP(00H)
xdata$x ENDS
; COMDAT ??_C@_0BA@CLMJJCOM@nSize?5?$DO?$DN?5nSizeW?$AA@
CONST SEGMENT
??_C@_0BA@CLMJJCOM@nSize?5?$DO?$DN?5nSizeW?$AA@ DB 'nSize >= nSizeW', 00H ; `string'
CONST ENDS
; COMDAT ??_C@_0FB@DNILBHEN@C?3?2Program?5Files?2Microsoft?5Visua@
CONST SEGMENT
??_C@_0FB@DNILBHEN@C?3?2Program?5Files?2Microsoft?5Visua@ DB 'C:\Program '
DB 'Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\cs'
DB 'tringt.h', 00H ; `string'
; Function compile flags: /Odt /RTCsu
CONST ENDS
; COMDAT ?GetEnvironmentVariableWFake@ATL@@YGKPBGPAGK@Z
_TEXT SEGMENT
$T182332 = -316 ; size = 4
$T182330 = -312 ; size = 4
$T182329 = -308 ; size = 4
_pszNameA$ = -300 ; size = 132
_pszBufferA$ = -160 ; size = 132
_nSizeW$ = -24 ; size = 4
_nSizeA$ = -20 ; size = 4
__$ArrayPad$ = -16 ; size = 4
__$EHRec$ = -12 ; size = 12
__$ReturnAddr$ = 4 ; size = 4
_pszName$ = 8 ; size = 4
_pszBuffer$ = 12 ; size = 4
_nSize$ = 16 ; size = 4
?GetEnvironmentVariableWFake@ATL@@YGKPBGPAGK@Z PROC NEAR ; ATL::GetEnvironmentVariableWFake, COMDAT
; 159 : {
push ebp
mov ebp, esp
push -1
push __ehhandler$?GetEnvironmentVariableWFake@ATL@@YGKPBGPAGK@Z
mov eax, DWORD PTR fs:__except_list
push eax
mov DWORD PTR fs:__except_list, esp
sub esp, 304 ; 00000130H
push esi
push edi
lea edi, DWORD PTR [ebp-316]
mov ecx, 76 ; 0000004cH
mov eax, -858993460 ; ccccccccH
rep stosd
mov eax, DWORD PTR ___security_cookie
mov DWORD PTR __$ArrayPad$[ebp], eax
; 160 : ULONG nSizeA;
; 161 : ULONG nSizeW;
; 162 : CTempBuffer<char> pszBufferA;
lea ecx, DWORD PTR _pszBufferA$[ebp]
call ??0?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QAE@XZ ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::CTempBuffer<char,128,ATL::CCRTAllocator>
mov DWORD PTR __$EHRec$[ebp+8], 0
; 163 : CW2A pszNameA(pszName);
mov eax, DWORD PTR _pszName$[ebp]
push eax
lea ecx, DWORD PTR _pszNameA$[ebp]
call ??0?$CW2AEX@$0IA@@ATL@@QAE@PBG@Z ; ATL::CW2AEX<128>::CW2AEX<128>
mov BYTE PTR __$EHRec$[ebp+8], 1
; 164 :
; 165 : nSizeA = ::GetEnvironmentVariableA(pszNameA, NULL, 0);
mov esi, esp
push 0
push 0
lea ecx, DWORD PTR _pszNameA$[ebp]
call ??B?$CW2AEX@$0IA@@ATL@@QBEPADXZ ; ATL::CW2AEX<128>::operator char *
push eax
call DWORD PTR __imp__GetEnvironmentVariableA@12
cmp esi, esp
call __RTC_CheckEsp
mov DWORD PTR _nSizeA$[ebp], eax
; 166 : if (nSizeA == 0)
cmp DWORD PTR _nSizeA$[ebp], 0
jne SHORT $L178609
; 167 : return 0;
mov DWORD PTR $T182329[ebp], 0
mov BYTE PTR __$EHRec$[ebp+8], 0
lea ecx, DWORD PTR _pszNameA$[ebp]
call ??1?$CW2AEX@$0IA@@ATL@@QAE@XZ ; ATL::CW2AEX<128>::~CW2AEX<128>
mov DWORD PTR __$EHRec$[ebp+8], -1
lea ecx, DWORD PTR _pszBufferA$[ebp]
call ??1?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QAE@XZ ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::~CTempBuffer<char,128,ATL::CCRTAllocator>
mov eax, DWORD PTR $T182329[ebp]
jmp $L178581
$L178609:
; 168 :
; 169 : pszBufferA.Allocate(nSizeA*2);
mov ecx, DWORD PTR _nSizeA$[ebp]
shl ecx, 1
push ecx
lea ecx, DWORD PTR _pszBufferA$[ebp]
call ?Allocate@?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QAEPADI@Z ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::Allocate
; 170 : ::GetEnvironmentVariableA(pszNameA, pszBufferA, nSizeA);
mov esi, esp
mov edx, DWORD PTR _nSizeA$[ebp]
push edx
lea ecx, DWORD PTR _pszBufferA$[ebp]
call ??B?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QBEPADXZ ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::operator char *
push eax
lea ecx, DWORD PTR _pszNameA$[ebp]
call ??B?$CW2AEX@$0IA@@ATL@@QBEPADXZ ; ATL::CW2AEX<128>::operator char *
push eax
call DWORD PTR __imp__GetEnvironmentVariableA@12
cmp esi, esp
call __RTC_CheckEsp
; 171 :
; 172 : nSizeW = ::MultiByteToWideChar(_AtlGetConversionACP(), 0, pszBufferA, -1, NULL, 0);
mov esi, esp
push 0
push 0
push -1
lea ecx, DWORD PTR _pszBufferA$[ebp]
call ??B?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QBEPADXZ ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::operator char *
push eax
push 0
call ?_AtlGetConversionACP@ATL@@YGIXZ ; ATL::_AtlGetConversionACP
push eax
call DWORD PTR __imp__MultiByteToWideChar@24
cmp esi, esp
call __RTC_CheckEsp
mov DWORD PTR _nSizeW$[ebp], eax
; 173 : if (nSize == 0)
cmp DWORD PTR _nSize$[ebp], 0
jne SHORT $L178611
; 174 : return nSizeW;
mov eax, DWORD PTR _nSizeW$[ebp]
mov DWORD PTR $T182330[ebp], eax
mov BYTE PTR __$EHRec$[ebp+8], 0
lea ecx, DWORD PTR _pszNameA$[ebp]
call ??1?$CW2AEX@$0IA@@ATL@@QAE@XZ ; ATL::CW2AEX<128>::~CW2AEX<128>
mov DWORD PTR __$EHRec$[ebp+8], -1
lea ecx, DWORD PTR _pszBufferA$[ebp]
call ??1?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QAE@XZ ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::~CTempBuffer<char,128,ATL::CCRTAllocator>
mov eax, DWORD PTR $T182330[ebp]
jmp $L178581
$L178611:
; 175 : ATLASSERT(nSize >= nSizeW);
mov ecx, DWORD PTR _nSize$[ebp]
cmp ecx, DWORD PTR _nSizeW$[ebp]
jae SHORT $L182331
push OFFSET FLAT:??_C@_0BA@CLMJJCOM@nSize?5?$DO?$DN?5nSizeW?$AA@
push 0
push 175 ; 000000afH
push OFFSET FLAT:??_C@_0FB@DNILBHEN@C?3?2Program?5Files?2Microsoft?5Visua@
push 2
call __CrtDbgReport
add esp, 20 ; 00000014H
cmp eax, 1
jne SHORT $L182331
int 3
$L182331:
; 176 : ::MultiByteToWideChar(_AtlGetConversionACP(), 0, pszBufferA, -1, pszBuffer, nSizeW);
mov esi, esp
mov eax, DWORD PTR _nSizeW$[ebp]
push eax
mov ecx, DWORD PTR _pszBuffer$[ebp]
push ecx
push -1
lea ecx, DWORD PTR _pszBufferA$[ebp]
call ??B?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QBEPADXZ ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::operator char *
push eax
push 0
call ?_AtlGetConversionACP@ATL@@YGIXZ ; ATL::_AtlGetConversionACP
push eax
call DWORD PTR __imp__MultiByteToWideChar@24
cmp esi, esp
call __RTC_CheckEsp
; 177 :
; 178 : return nSizeW;
mov edx, DWORD PTR _nSizeW$[ebp]
mov DWORD PTR $T182332[ebp], edx
mov BYTE PTR __$EHRec$[ebp+8], 0
lea ecx, DWORD PTR _pszNameA$[ebp]
call ??1?$CW2AEX@$0IA@@ATL@@QAE@XZ ; ATL::CW2AEX<128>::~CW2AEX<128>
mov DWORD PTR __$EHRec$[ebp+8], -1
lea ecx, DWORD PTR _pszBufferA$[ebp]
call ??1?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QAE@XZ ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::~CTempBuffer<char,128,ATL::CCRTAllocator>
mov eax, DWORD PTR $T182332[ebp]
$L178581:
; 179 : }
push edx
mov ecx, ebp
push eax
lea edx, DWORD PTR $L182345
call @_RTC_CheckStackVars@8
pop eax
pop edx
mov ecx, DWORD PTR __$EHRec$[ebp]
mov DWORD PTR fs:__except_list, ecx
mov ecx, DWORD PTR __$ArrayPad$[ebp]
call @__security_check_cookie@4
pop edi
pop esi
add esp, 316 ; 0000013cH
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 12 ; 0000000cH
$L182345:
DD 2
DD $L182344
$L182344:
DD -160 ; ffffff60H
DD 132 ; 00000084H
DD $L182339
DD -300 ; fffffed4H
DD 132 ; 00000084H
DD $L182340
$L182340:
DB 112 ; 00000070H
DB 115 ; 00000073H
DB 122 ; 0000007aH
DB 78 ; 0000004eH
DB 97 ; 00000061H
DB 109 ; 0000006dH
DB 101 ; 00000065H
DB 65 ; 00000041H
DB 0
$L182339:
DB 112 ; 00000070H
DB 115 ; 00000073H
DB 122 ; 0000007aH
DB 66 ; 00000042H
DB 117 ; 00000075H
DB 102 ; 00000066H
DB 102 ; 00000066H
DB 101 ; 00000065H
DB 114 ; 00000072H
DB 65 ; 00000041H
DB 0
_TEXT ENDS
; COMDAT text$x
text$x SEGMENT
$L182333:
lea ecx, DWORD PTR _pszBufferA$[ebp]
jmp ??1?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QAE@XZ ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::~CTempBuffer<char,128,ATL::CCRTAllocator>
$L182334:
lea ecx, DWORD PTR _pszNameA$[ebp]
jmp ??1?$CW2AEX@$0IA@@ATL@@QAE@XZ ; ATL::CW2AEX<128>::~CW2AEX<128>
__ehhandler$?GetEnvironmentVariableWFake@ATL@@YGKPBGPAGK@Z:
mov eax, OFFSET FLAT:$T182338
jmp ___CxxFrameHandler
text$x ENDS
?GetEnvironmentVariableWFake@ATL@@YGKPBGPAGK@Z ENDP ; ATL::GetEnvironmentVariableWFake
; Function compile flags: /Odt /RTCsu
; File c:\program files\microsoft visual studio .net 2003\vc7\atlmfc\include\atlconv.h
; COMDAT ?_AtlGetConversionACP@ATL@@YGIXZ
_TEXT SEGMENT
?_AtlGetConversionACP@ATL@@YGIXZ PROC NEAR ; ATL::_AtlGetConversionACP, COMDAT
; 157 : {
push ebp
mov ebp, esp
push esi
; 158 : return( g_pfnGetThreadACP() );
mov esi, esp
call DWORD PTR ?g_pfnGetThreadACP@ATL@@3P6GIXZA ; ATL::g_pfnGetThreadACP
cmp esi, esp
call __RTC_CheckEsp
; 159 : }
pop esi
cmp ebp, esp
call __RTC_CheckEsp
pop ebp
ret 0
?_AtlGetConversionACP@ATL@@YGIXZ ENDP ; ATL::_AtlGetConversionACP
_TEXT ENDS
PUBLIC ?CompareStringWFake@ATL@@YGHKKPBGH0H@Z ; ATL::CompareStringWFake
EXTRN __imp__CompareStringW@24:NEAR
; Function compile flags: /Odt /RTCsu
; File c:\program files\microsoft visual studio .net 2003\vc7\atlmfc\include\cstringt.h
; COMDAT ?CompareStringWThunk@ATL@@YGHKKPBGH0H@Z
_TEXT SEGMENT
_lcid$ = 8 ; size = 4
_dwFlags$ = 12 ; size = 4
_pszString1$ = 16 ; size = 4
_nLength1$ = 20 ; size = 4
_pszString2$ = 24 ; size = 4
_nLength2$ = 28 ; size = 4
?CompareStringWThunk@ATL@@YGHKKPBGH0H@Z PROC NEAR ; ATL::CompareStringWThunk, COMDAT
; 216 : {
push ebp
mov ebp, esp
push esi
; 217 : _AtlInstallStringThunk(reinterpret_cast<void**>(&_strthunks.pfnCompareStringW), CompareStringWFake, ::CompareStringW);
mov eax, DWORD PTR __imp__CompareStringW@24
push eax
push OFFSET FLAT:?CompareStringWFake@ATL@@YGHKKPBGH0H@Z ; ATL::CompareStringWFake
push OFFSET FLAT:?_strthunks@ATL@@3U_AtlStringThunks@1@A ; ATL::_strthunks
call ?_AtlInstallStringThunk@ATL@@YAXPAPAXPAX1@Z ; ATL::_AtlInstallStringThunk
add esp, 12 ; 0000000cH
; 218 :
; 219 : return _strthunks.pfnCompareStringW(lcid, dwFlags, pszString1, nLength1, pszString2, nLength2);
mov esi, esp
mov ecx, DWORD PTR _nLength2$[ebp]
push ecx
mov edx, DWORD PTR _pszString2$[ebp]
push edx
mov eax, DWORD PTR _nLength1$[ebp]
push eax
mov ecx, DWORD PTR _pszString1$[ebp]
push ecx
mov edx, DWORD PTR _dwFlags$[ebp]
push edx
mov eax, DWORD PTR _lcid$[ebp]
push eax
call DWORD PTR ?_strthunks@ATL@@3U_AtlStringThunks@1@A
cmp esi, esp
call __RTC_CheckEsp
; 220 : }
pop esi
cmp ebp, esp
call __RTC_CheckEsp
pop ebp
ret 24 ; 00000018H
?CompareStringWThunk@ATL@@YGHKKPBGH0H@Z ENDP ; ATL::CompareStringWThunk
_TEXT ENDS
PUBLIC ?AtlW2AHelper@@YGPADPADPBGHI@Z ; AtlW2AHelper
PUBLIC ?AtlThrow@ATL@@YGXJ@Z ; ATL::AtlThrow
PUBLIC ??0?$CAtlSafeAllocBufferManager@VCCRTAllocator@ATL@@@_ATL_SAFE_ALLOCA_IMPL@ATL@@QAE@XZ ; ATL::_ATL_SAFE_ALLOCA_IMPL::CAtlSafeAllocBufferManager<ATL::CCRTAllocator>::CAtlSafeAllocBufferManager<ATL::CCRTAllocator>
PUBLIC ?Allocate@?$CAtlSafeAllocBufferManager@VCCRTAllocator@ATL@@@_ATL_SAFE_ALLOCA_IMPL@ATL@@QAEPAXK@Z ; ATL::_ATL_SAFE_ALLOCA_IMPL::CAtlSafeAllocBufferManager<ATL::CCRTAllocator>::Allocate
PUBLIC ??1?$CAtlSafeAllocBufferManager@VCCRTAllocator@ATL@@@_ATL_SAFE_ALLOCA_IMPL@ATL@@QAE@XZ ; ATL::_ATL_SAFE_ALLOCA_IMPL::CAtlSafeAllocBufferManager<ATL::CCRTAllocator>::~CAtlSafeAllocBufferManager<ATL::CCRTAllocator>
PUBLIC ?_AtlVerifyStackAvailable@_ATL_SAFE_ALLOCA_IMPL@ATL@@YA_NK@Z ; ATL::_ATL_SAFE_ALLOCA_IMPL::_AtlVerifyStackAvailable
EXTRN __alloca_probe:NEAR
EXTRN __imp__lstrlenW@4:NEAR
EXTRN __imp__CompareStringA@24:NEAR
; COMDAT xdata$x
xdata$x SEGMENT
$T182373 DD 0ffffffffH
DD FLAT:$L182365
$T182367 DD 019930520H
DD 01H
DD FLAT:$T182373
DD 2 DUP(00H)
DD 2 DUP(00H)
; Function compile flags: /Odt /RTCsu
xdata$x ENDS
; COMDAT ?CompareStringWFake@ATL@@YGHKKPBGH0H@Z
_TEXT SEGMENT
tv147 = -76 ; size = 4
tv142 = -72 ; size = 4
tv149 = -68 ; size = 4
tv89 = -64 ; size = 4
tv84 = -60 ; size = 4
tv91 = -56 ; size = 4
$T182364 = -52 ; size = 4
_pszAString2$ = -48 ; size = 4
_pszAString1$ = -44 ; size = 4
__AtlSafeAllocaManager$ = -36 ; size = 4
__lpa_ex$ = -28 ; size = 4
__lpw_ex$ = -24 ; size = 4
__acp_ex$ = -20 ; size = 4
__convert_ex$ = -16 ; size = 4
__$EHRec$ = -12 ; size = 12
_lcid$ = 8 ; size = 4
_dwFlags$ = 12 ; size = 4
_pszString1$ = 16 ; size = 4
_nLength1$ = 20 ; size = 4
_pszString2$ = 24 ; size = 4
_nLength2$ = 28 ; size = 4
?CompareStringWFake@ATL@@YGHKKPBGH0H@Z PROC NEAR ; ATL::CompareStringWFake, COMDAT
; 192 : {
push ebp
mov ebp, esp
push -1
push __ehhandler$?CompareStringWFake@ATL@@YGHKKPBGH0H@Z
mov eax, DWORD PTR fs:__except_list
push eax
mov DWORD PTR fs:__except_list, esp
sub esp, 64 ; 00000040H
push esi
push edi
lea edi, DWORD PTR [ebp-76]
mov ecx, 16 ; 00000010H
mov eax, -858993460 ; ccccccccH
rep stosd
; 193 : USES_CONVERSION_EX;
mov DWORD PTR __convert_ex$[ebp], 0
call ?_AtlGetConversionACP@ATL@@YGIXZ ; ATL::_AtlGetConversionACP
mov DWORD PTR __acp_ex$[ebp], eax
mov DWORD PTR __lpw_ex$[ebp], 0
mov DWORD PTR __lpa_ex$[ebp], 0
lea ecx, DWORD PTR __AtlSafeAllocaManager$[ebp]
call ??0?$CAtlSafeAllocBufferManager@VCCRTAllocator@ATL@@@_ATL_SAFE_ALLOCA_IMPL@ATL@@QAE@XZ ; ATL::_ATL_SAFE_ALLOCA_IMPL::CAtlSafeAllocBufferManager<ATL::CCRTAllocator>::CAtlSafeAllocBufferManager<ATL::CCRTAllocator>
mov DWORD PTR __$EHRec$[ebp+8], 0
; 194 :
; 195 : LPCSTR pszAString1 = NULL;
mov DWORD PTR _pszAString1$[ebp], 0
; 196 : if(pszString1 != NULL)
cmp DWORD PTR _pszString1$[ebp], 0
je $L178636
; 197 : {
; 198 : pszAString1 = W2A_EX(pszString1,_ATL_SAFE_ALLOCA_DEF_THRESHOLD);
mov eax, DWORD PTR _pszString1$[ebp]
mov DWORD PTR __lpw_ex$[ebp], eax
cmp DWORD PTR __lpw_ex$[ebp], 0
jne SHORT $L182358
mov DWORD PTR tv91[ebp], 0
jmp SHORT $L182359
$L182358:
mov esi, esp
mov ecx, DWORD PTR __lpw_ex$[ebp]
push ecx
call DWORD PTR __imp__lstrlenW@4
cmp esi, esp
call __RTC_CheckEsp
lea edx, DWORD PTR [eax+eax+2]
mov DWORD PTR __convert_ex$[ebp], edx
cmp DWORD PTR __convert_ex$[ebp], 1024 ; 00000400H
jg SHORT $L182356
mov eax, DWORD PTR __convert_ex$[ebp]
push eax
call ?_AtlVerifyStackAvailable@_ATL_SAFE_ALLOCA_IMPL@ATL@@YA_NK@Z ; ATL::_ATL_SAFE_ALLOCA_IMPL::_AtlVerifyStackAvailable
add esp, 4
movzx ecx, al
test ecx, ecx
je SHORT $L182356
mov eax, DWORD PTR __convert_ex$[ebp]
add eax, 3
and eax, -4 ; fffffffcH
call __alloca_probe
mov DWORD PTR tv84[ebp], esp
mov edx, DWORD PTR tv84[ebp]
mov DWORD PTR tv89[ebp], edx
jmp SHORT $L182357
$L182356:
mov eax, DWORD PTR __convert_ex$[ebp]
push eax
lea ecx, DWORD PTR __AtlSafeAllocaManager$[ebp]
call ?Allocate@?$CAtlSafeAllocBufferManager@VCCRTAllocator@ATL@@@_ATL_SAFE_ALLOCA_IMPL@ATL@@QAEPAXK@Z ; ATL::_ATL_SAFE_ALLOCA_IMPL::CAtlSafeAllocBufferManager<ATL::CCRTAllocator>::Allocate
mov DWORD PTR tv89[ebp], eax
$L182357:
mov ecx, DWORD PTR __acp_ex$[ebp]
push ecx
mov edx, DWORD PTR __convert_ex$[ebp]
push edx
mov eax, DWORD PTR __lpw_ex$[ebp]
push eax
mov ecx, DWORD PTR tv89[ebp]
push ecx
call ?AtlW2AHelper@@YGPADPADPBGHI@Z ; AtlW2AHelper
mov DWORD PTR tv91[ebp], eax
$L182359:
mov edx, DWORD PTR tv91[ebp]
mov DWORD PTR _pszAString1$[ebp], edx
; 199 : if(pszAString1 == NULL)
cmp DWORD PTR _pszAString1$[ebp], 0
jne SHORT $L178636
; 200 : AtlThrow(E_OUTOFMEMORY);
push -2147024882 ; 8007000eH
call ?AtlThrow@ATL@@YGXJ@Z ; ATL::AtlThrow
$L178636:
; 201 : }
; 202 :
; 203 : LPCSTR pszAString2 = NULL;
mov DWORD PTR _pszAString2$[ebp], 0
; 204 : if(pszString2 != NULL)
cmp DWORD PTR _pszString2$[ebp], 0
je $L178642
; 205 : {
; 206 : pszAString2 = W2A_EX(pszString2,_ATL_SAFE_ALLOCA_DEF_THRESHOLD);
mov eax, DWORD PTR _pszString2$[ebp]
mov DWORD PTR __lpw_ex$[ebp], eax
cmp DWORD PTR __lpw_ex$[ebp], 0
jne SHORT $L182362
mov DWORD PTR tv149[ebp], 0
jmp SHORT $L182363
$L182362:
mov esi, esp
mov ecx, DWORD PTR __lpw_ex$[ebp]
push ecx
call DWORD PTR __imp__lstrlenW@4
cmp esi, esp
call __RTC_CheckEsp
lea edx, DWORD PTR [eax+eax+2]
mov DWORD PTR __convert_ex$[ebp], edx
cmp DWORD PTR __convert_ex$[ebp], 1024 ; 00000400H
jg SHORT $L182360
mov eax, DWORD PTR __convert_ex$[ebp]
push eax
call ?_AtlVerifyStackAvailable@_ATL_SAFE_ALLOCA_IMPL@ATL@@YA_NK@Z ; ATL::_ATL_SAFE_ALLOCA_IMPL::_AtlVerifyStackAvailable
add esp, 4
movzx ecx, al
test ecx, ecx
je SHORT $L182360
mov eax, DWORD PTR __convert_ex$[ebp]
add eax, 3
and eax, -4 ; fffffffcH
call __alloca_probe
mov DWORD PTR tv142[ebp], esp
mov edx, DWORD PTR tv142[ebp]
mov DWORD PTR tv147[ebp], edx
jmp SHORT $L182361
$L182360:
mov eax, DWORD PTR __convert_ex$[ebp]
push eax
lea ecx, DWORD PTR __AtlSafeAllocaManager$[ebp]
call ?Allocate@?$CAtlSafeAllocBufferManager@VCCRTAllocator@ATL@@@_ATL_SAFE_ALLOCA_IMPL@ATL@@QAEPAXK@Z ; ATL::_ATL_SAFE_ALLOCA_IMPL::CAtlSafeAllocBufferManager<ATL::CCRTAllocator>::Allocate
mov DWORD PTR tv147[ebp], eax
$L182361:
mov ecx, DWORD PTR __acp_ex$[ebp]
push ecx
mov edx, DWORD PTR __convert_ex$[ebp]
push edx
mov eax, DWORD PTR __lpw_ex$[ebp]
push eax
mov ecx, DWORD PTR tv147[ebp]
push ecx
call ?AtlW2AHelper@@YGPADPADPBGHI@Z ; AtlW2AHelper
mov DWORD PTR tv149[ebp], eax
$L182363:
mov edx, DWORD PTR tv149[ebp]
mov DWORD PTR _pszAString2$[ebp], edx
; 207 : if(pszAString2 == NULL)
cmp DWORD PTR _pszAString2$[ebp], 0
jne SHORT $L178642
; 208 : AtlThrow(E_OUTOFMEMORY);
push -2147024882 ; 8007000eH
call ?AtlThrow@ATL@@YGXJ@Z ; ATL::AtlThrow
$L178642:
; 209 : }
; 210 :
; 211 : return ::CompareStringA(lcid, dwFlags, pszAString1, nLength1, pszAString2, nLength2);
mov esi, esp
mov eax, DWORD PTR _nLength2$[ebp]
push eax
mov ecx, DWORD PTR _pszAString2$[ebp]
push ecx
mov edx, DWORD PTR _nLength1$[ebp]
push edx
mov eax, DWORD PTR _pszAString1$[ebp]
push eax
mov ecx, DWORD PTR _dwFlags$[ebp]
push ecx
mov edx, DWORD PTR _lcid$[ebp]
push edx
call DWORD PTR __imp__CompareStringA@24
cmp esi, esp
call __RTC_CheckEsp
mov DWORD PTR $T182364[ebp], eax
mov DWORD PTR __$EHRec$[ebp+8], -1
lea ecx, DWORD PTR __AtlSafeAllocaManager$[ebp]
call ??1?$CAtlSafeAllocBufferManager@VCCRTAllocator@ATL@@@_ATL_SAFE_ALLOCA_IMPL@ATL@@QAE@XZ ; ATL::_ATL_SAFE_ALLOCA_IMPL::CAtlSafeAllocBufferManager<ATL::CCRTAllocator>::~CAtlSafeAllocBufferManager<ATL::CCRTAllocator>
mov eax, DWORD PTR $T182364[ebp]
$L182355:
; 212 : }
lea esp, DWORD PTR [ebp-84]
push edx
mov ecx, ebp
push eax
lea edx, DWORD PTR $L182372
call @_RTC_CheckStackVars@8
pop eax
pop edx
mov ecx, DWORD PTR __$EHRec$[ebp]
mov DWORD PTR fs:__except_list, ecx
pop edi
pop esi
mov esp, ebp
pop ebp
ret 24 ; 00000018H
$L182372:
DD 1
DD $L182371
$L182371:
DD -36 ; ffffffdcH
DD 4
DD $L182369
$L182369:
DB 95 ; 0000005fH
DB 65 ; 00000041H
DB 116 ; 00000074H
DB 108 ; 0000006cH
DB 83 ; 00000053H
DB 97 ; 00000061H
DB 102 ; 00000066H
DB 101 ; 00000065H
DB 65 ; 00000041H
DB 108 ; 0000006cH
DB 108 ; 0000006cH
DB 111 ; 0000006fH
DB 99 ; 00000063H
DB 97 ; 00000061H
DB 77 ; 0000004dH
DB 97 ; 00000061H
DB 110 ; 0000006eH
DB 97 ; 00000061H
DB 103 ; 00000067H
DB 101 ; 00000065H
DB 114 ; 00000072H
DB 0
_TEXT ENDS
; COMDAT text$x
text$x SEGMENT
$L182365:
lea ecx, DWORD PTR __AtlSafeAllocaManager$[ebp]
jmp ??1?$CAtlSafeAllocBufferManager@VCCRTAllocator@ATL@@@_ATL_SAFE_ALLOCA_IMPL@ATL@@QAE@XZ ; ATL::_ATL_SAFE_ALLOCA_IMPL::CAtlSafeAllocBufferManager<ATL::CCRTAllocator>::~CAtlSafeAllocBufferManager<ATL::CCRTAllocator>
__ehhandler$?CompareStringWFake@ATL@@YGHKKPBGH0H@Z:
mov eax, OFFSET FLAT:$T182367
jmp ___CxxFrameHandler
text$x ENDS
?CompareStringWFake@ATL@@YGHKKPBGH0H@Z ENDP ; ATL::CompareStringWFake
EXTRN __except_handler3:NEAR
EXTRN __resetstkoflw:NEAR
; COMDAT CONST
; File c:\program files\microsoft visual studio .net 2003\vc7\atlmfc\include\atlalloc.h
CONST SEGMENT
$T182384 DD 0ffffffffH
DD FLAT:$L182379
DD FLAT:$L182380
; Function compile flags: /Odt /RTCsu
CONST ENDS
; COMDAT ?_AtlVerifyStackAvailable@_ATL_SAFE_ALLOCA_IMPL@ATL@@YA_NK@Z
_TEXT SEGMENT
tv65 = -48 ; size = 4
$T182383 = -44 ; size = 4
_p$75737 = -36 ; size = 4
_bStackAvailable$ = -25 ; size = 1
__$SEHRec$ = -24 ; size = 24
_Size$ = 8 ; size = 4
?_AtlVerifyStackAvailable@_ATL_SAFE_ALLOCA_IMPL@ATL@@YA_NK@Z PROC NEAR ; ATL::_ATL_SAFE_ALLOCA_IMPL::_AtlVerifyStackAvailable, COMDAT
; 331 : {
push ebp
mov ebp, esp
push -1
push OFFSET FLAT:$T182384
push OFFSET FLAT:__except_handler3
mov eax, DWORD PTR fs:__except_list
push eax
mov DWORD PTR fs:__except_list, esp
add esp, -32 ; ffffffe0H
push ebx
push esi
push edi
mov eax, -858993460 ; ccccccccH
mov DWORD PTR [ebp-48], eax
mov DWORD PTR [ebp-44], eax
mov DWORD PTR [ebp-40], eax
mov DWORD PTR [ebp-36], eax
mov DWORD PTR [ebp-32], eax
mov DWORD PTR [ebp-28], eax
mov DWORD PTR __$SEHRec$[ebp], esp
; 332 : bool bStackAvailable = true;
mov BYTE PTR _bStackAvailable$[ebp], 1
; 333 :
; 334 : __try
mov DWORD PTR __$SEHRec$[ebp+20], 0
; 335 : {
; 336 : PVOID p = _alloca(Size + _ATL_STACK_MARGIN);
mov eax, DWORD PTR _Size$[ebp]
add eax, 8195 ; 00002003H
and eax, -4 ; fffffffcH
call __alloca_probe
mov DWORD PTR tv65[ebp], esp
mov DWORD PTR __$SEHRec$[ebp], esp
mov eax, DWORD PTR tv65[ebp]
mov DWORD PTR _p$75737[ebp], eax
mov DWORD PTR __$SEHRec$[ebp+20], -1
jmp SHORT $L182382
$L182379:
$L182391:
; 337 : (p);
; 338 : }
; 339 : __except ((EXCEPTION_STACK_OVERFLOW == GetExceptionCode()) ?
; 340 : EXCEPTION_EXECUTE_HANDLER :
; 341 : EXCEPTION_CONTINUE_SEARCH)
mov ecx, DWORD PTR __$SEHRec$[ebp+4]
mov edx, DWORD PTR [ecx]
mov eax, DWORD PTR [edx]
mov DWORD PTR $T182383[ebp], eax
mov eax, DWORD PTR $T182383[ebp]
sub eax, -1073741571 ; c00000fdH
neg eax
sbb eax, eax
inc eax
$L182381:
$L182390:
ret 0
$L182380:
mov esp, DWORD PTR __$SEHRec$[ebp]
; 342 : {
; 343 : bStackAvailable = false;
mov BYTE PTR _bStackAvailable$[ebp], 0
; 344 : _resetstkoflw();
call __resetstkoflw
mov DWORD PTR __$SEHRec$[ebp+20], -1
$L182382:
; 345 : }
; 346 : return bStackAvailable;
mov al, BYTE PTR _bStackAvailable$[ebp]
$L182378:
; 347 : }
lea esp, DWORD PTR [ebp-60]
push edx
mov ecx, ebp
push eax
lea edx, DWORD PTR $L182389
call @_RTC_CheckStackVars@8
pop eax
pop edx
mov ecx, DWORD PTR __$SEHRec$[ebp+8]
mov DWORD PTR fs:__except_list, ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0
$L182389:
DD 1
DD $L182388
$L182388:
DD -36 ; ffffffdcH
DD 4
DD $L182386
$L182386:
DB 112 ; 00000070H
DB 0
?_AtlVerifyStackAvailable@_ATL_SAFE_ALLOCA_IMPL@ATL@@YA_NK@Z ENDP ; ATL::_ATL_SAFE_ALLOCA_IMPL::_AtlVerifyStackAvailable
_TEXT ENDS
PUBLIC ??_C@_08DMHHBMMN@lpa?5?$CB?$DN?50?$AA@ ; `string'
PUBLIC ??_C@_0FA@OHHMODBN@C?3?2Program?5Files?2Microsoft?5Visua@ ; `string'
PUBLIC ??_C@_08DIHJLFDJ@lpw?5?$CB?$DN?50?$AA@ ; `string'
PUBLIC ??_C@_01GBGANLPD@0?$AA@ ; `string'
EXTRN __imp__WideCharToMultiByte@32:NEAR
; COMDAT ??_C@_08DIHJLFDJ@lpw?5?$CB?$DN?50?$AA@
; File c:\program files\microsoft visual studio .net 2003\vc7\atlmfc\include\atlconv.h
CONST SEGMENT
??_C@_08DIHJLFDJ@lpw?5?$CB?$DN?50?$AA@ DB 'lpw != 0', 00H ; `string'
CONST ENDS
; COMDAT ??_C@_0FA@OHHMODBN@C?3?2Program?5Files?2Microsoft?5Visua@
CONST SEGMENT
??_C@_0FA@OHHMODBN@C?3?2Program?5Files?2Microsoft?5Visua@ DB 'C:\Program '
DB 'Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\at'
DB 'lconv.h', 00H ; `string'
CONST ENDS
; COMDAT ??_C@_08DMHHBMMN@lpa?5?$CB?$DN?50?$AA@
CONST SEGMENT
??_C@_08DMHHBMMN@lpa?5?$CB?$DN?50?$AA@ DB 'lpa != 0', 00H ; `string'
CONST ENDS
; COMDAT ??_C@_01GBGANLPD@0?$AA@
CONST SEGMENT
??_C@_01GBGANLPD@0?$AA@ DB '0', 00H ; `string'
; Function compile flags: /Odt /RTCsu
CONST ENDS
; COMDAT ?AtlW2AHelper@@YGPADPADPBGHI@Z
_TEXT SEGMENT
_ret$ = -4 ; size = 4
_lpa$ = 8 ; size = 4
_lpw$ = 12 ; size = 4
_nChars$ = 16 ; size = 4
_acp$ = 20 ; size = 4
?AtlW2AHelper@@YGPADPADPBGHI@Z PROC NEAR ; AtlW2AHelper, COMDAT
; 573 : {
push ebp
mov ebp, esp
push ecx
push esi
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
; 574 : ATLASSERT(lpw != NULL);
cmp DWORD PTR _lpw$[ebp], 0
jne SHORT $L182396
push OFFSET FLAT:??_C@_08DIHJLFDJ@lpw?5?$CB?$DN?50?$AA@
push 0
push 574 ; 0000023eH
push OFFSET FLAT:??_C@_0FA@OHHMODBN@C?3?2Program?5Files?2Microsoft?5Visua@
push 2
call __CrtDbgReport
add esp, 20 ; 00000014H
cmp eax, 1
jne SHORT $L182396
int 3
$L182396:
; 575 : ATLASSERT(lpa != NULL);
cmp DWORD PTR _lpa$[ebp], 0
jne SHORT $L182397
push OFFSET FLAT:??_C@_08DMHHBMMN@lpa?5?$CB?$DN?50?$AA@
push 0
push 575 ; 0000023fH
push OFFSET FLAT:??_C@_0FA@OHHMODBN@C?3?2Program?5Files?2Microsoft?5Visua@
push 2
call __CrtDbgReport
add esp, 20 ; 00000014H
cmp eax, 1
jne SHORT $L182397
int 3
$L182397:
; 576 : if (lpa == NULL || lpw == NULL)
cmp DWORD PTR _lpa$[ebp], 0
je SHORT $L75958
cmp DWORD PTR _lpw$[ebp], 0
jne SHORT $L75957
$L75958:
; 577 : return NULL;
xor eax, eax
jmp SHORT $L75954
$L75957:
; 578 : // verify that no illegal character present
; 579 : // since lpa was allocated based on the size of lpw
; 580 : // don't worry about the number of chars
; 581 : lpa[0] = '\0';
mov edx, DWORD PTR _lpa$[ebp]
mov BYTE PTR [edx], 0
; 582 : int ret = WideCharToMultiByte(acp, 0, lpw, -1, lpa, nChars, NULL, NULL);
mov esi, esp
push 0
push 0
mov eax, DWORD PTR _nChars$[ebp]
push eax
mov ecx, DWORD PTR _lpa$[ebp]
push ecx
push -1
mov edx, DWORD PTR _lpw$[ebp]
push edx
push 0
mov eax, DWORD PTR _acp$[ebp]
push eax
call DWORD PTR __imp__WideCharToMultiByte@32
cmp esi, esp
call __RTC_CheckEsp
mov DWORD PTR _ret$[ebp], eax
; 583 : if(ret == 0)
cmp DWORD PTR _ret$[ebp], 0
jne SHORT $L75960
; 584 : {
; 585 : ATLASSERT(FALSE);
xor ecx, ecx
jne SHORT $L182398
push OFFSET FLAT:??_C@_01GBGANLPD@0?$AA@
push 0
push 585 ; 00000249H
push OFFSET FLAT:??_C@_0FA@OHHMODBN@C?3?2Program?5Files?2Microsoft?5Visua@
push 2
call __CrtDbgReport
add esp, 20 ; 00000014H
cmp eax, 1
jne SHORT $L182398
int 3
$L182398:
; 586 : return NULL;
xor eax, eax
jmp SHORT $L75954
$L75960:
; 587 : }
; 588 : return lpa;
mov eax, DWORD PTR _lpa$[ebp]
$L75954:
; 589 : }
pop esi
add esp, 4
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 16 ; 00000010H
?AtlW2AHelper@@YGPADPADPBGHI@Z ENDP ; AtlW2AHelper
_TEXT ENDS
PUBLIC ?GetStringTypeExWFake@ATL@@YGHKKPBGHPAG@Z ; ATL::GetStringTypeExWFake
EXTRN __imp__GetStringTypeExW@20:NEAR
; Function compile flags: /Odt /RTCsu
; File c:\program files\microsoft visual studio .net 2003\vc7\atlmfc\include\cstringt.h
; COMDAT ?GetStringTypeExWThunk@ATL@@YGHKKPBGHPAG@Z
_TEXT SEGMENT
_lcid$ = 8 ; size = 4
_dwInfoType$ = 12 ; size = 4
_pszSrc$ = 16 ; size = 4
_nLength$ = 20 ; size = 4
_pwCharType$ = 24 ; size = 4
?GetStringTypeExWThunk@ATL@@YGHKKPBGHPAG@Z PROC NEAR ; ATL::GetStringTypeExWThunk, COMDAT
; 240 : {
push ebp
mov ebp, esp
push esi
; 241 : _AtlInstallStringThunk(reinterpret_cast<void**>(&_strthunks.pfnGetStringTypeExW), GetStringTypeExWFake, ::GetStringTypeExW);
mov eax, DWORD PTR __imp__GetStringTypeExW@20
push eax
push OFFSET FLAT:?GetStringTypeExWFake@ATL@@YGHKKPBGHPAG@Z ; ATL::GetStringTypeExWFake
push OFFSET FLAT:?_strthunks@ATL@@3U_AtlStringThunks@1@A+4
call ?_AtlInstallStringThunk@ATL@@YAXPAPAXPAX1@Z ; ATL::_AtlInstallStringThunk
add esp, 12 ; 0000000cH
; 242 :
; 243 : return _strthunks.pfnGetStringTypeExW(lcid, dwInfoType, pszSrc, nLength, pwCharType);
mov esi, esp
mov ecx, DWORD PTR _pwCharType$[ebp]
push ecx
mov edx, DWORD PTR _nLength$[ebp]
push edx
mov eax, DWORD PTR _pszSrc$[ebp]
push eax
mov ecx, DWORD PTR _dwInfoType$[ebp]
push ecx
mov edx, DWORD PTR _lcid$[ebp]
push edx
call DWORD PTR ?_strthunks@ATL@@3U_AtlStringThunks@1@A+4
cmp esi, esp
call __RTC_CheckEsp
; 244 : }
pop esi
cmp ebp, esp
call __RTC_CheckEsp
pop ebp
ret 20 ; 00000014H
?GetStringTypeExWThunk@ATL@@YGHKKPBGHPAG@Z ENDP ; ATL::GetStringTypeExWThunk
_TEXT ENDS
EXTRN __imp__GetStringTypeExA@20:NEAR
; COMDAT xdata$x
xdata$x SEGMENT
$T182413 DD 0ffffffffH
DD FLAT:$L182405
$T182407 DD 019930520H
DD 01H
DD FLAT:$T182413
DD 2 DUP(00H)
DD 2 DUP(00H)
; Function compile flags: /Odt /RTCsu
xdata$x ENDS
; COMDAT ?GetStringTypeExWFake@ATL@@YGHKKPBGHPAG@Z
_TEXT SEGMENT
$T182404 = -164 ; size = 4
_pszA$ = -156 ; size = 132
_nLengthA$ = -20 ; size = 4
__$ArrayPad$ = -16 ; size = 4
__$EHRec$ = -12 ; size = 12
__$ReturnAddr$ = 4 ; size = 4
_lcid$ = 8 ; size = 4
_dwInfoType$ = 12 ; size = 4
_pszSrc$ = 16 ; size = 4
_nLength$ = 20 ; size = 4
_pwCharType$ = 24 ; size = 4
?GetStringTypeExWFake@ATL@@YGHKKPBGHPAG@Z PROC NEAR ; ATL::GetStringTypeExWFake, COMDAT
; 224 : {
push ebp
mov ebp, esp
push -1
push __ehhandler$?GetStringTypeExWFake@ATL@@YGHKKPBGHPAG@Z
mov eax, DWORD PTR fs:__except_list
push eax
mov DWORD PTR fs:__except_list, esp
sub esp, 152 ; 00000098H
push esi
push edi
lea edi, DWORD PTR [ebp-164]
mov ecx, 38 ; 00000026H
mov eax, -858993460 ; ccccccccH
rep stosd
mov eax, DWORD PTR ___security_cookie
mov DWORD PTR __$ArrayPad$[ebp], eax
; 225 : int nLengthA;
; 226 : CTempBuffer<char> pszA;
lea ecx, DWORD PTR _pszA$[ebp]
call ??0?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QAE@XZ ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::CTempBuffer<char,128,ATL::CCRTAllocator>
mov DWORD PTR __$EHRec$[ebp+8], 0
; 227 :
; 228 : nLengthA = ::WideCharToMultiByte(_AtlGetConversionACP(), 0, pszSrc, nLength, NULL, 0, NULL, NULL);
mov esi, esp
push 0
push 0
push 0
push 0
mov eax, DWORD PTR _nLength$[ebp]
push eax
mov ecx, DWORD PTR _pszSrc$[ebp]
push ecx
push 0
call ?_AtlGetConversionACP@ATL@@YGIXZ ; ATL::_AtlGetConversionACP
push eax
call DWORD PTR __imp__WideCharToMultiByte@32
cmp esi, esp
call __RTC_CheckEsp
mov DWORD PTR _nLengthA$[ebp], eax
; 229 : pszA.Allocate(nLengthA);
mov edx, DWORD PTR _nLengthA$[ebp]
push edx
lea ecx, DWORD PTR _pszA$[ebp]
call ?Allocate@?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QAEPADI@Z ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::Allocate
; 230 : ::WideCharToMultiByte(_AtlGetConversionACP(), 0, pszSrc, nLength, pszA, nLengthA, NULL, NULL);
mov esi, esp
push 0
push 0
mov eax, DWORD PTR _nLengthA$[ebp]
push eax
lea ecx, DWORD PTR _pszA$[ebp]
call ??B?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QBEPADXZ ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::operator char *
push eax
mov ecx, DWORD PTR _nLength$[ebp]
push ecx
mov edx, DWORD PTR _pszSrc$[ebp]
push edx
push 0
call ?_AtlGetConversionACP@ATL@@YGIXZ ; ATL::_AtlGetConversionACP
push eax
call DWORD PTR __imp__WideCharToMultiByte@32
cmp esi, esp
call __RTC_CheckEsp
; 231 :
; 232 : if (nLength == -1)
cmp DWORD PTR _nLength$[ebp], -1
jne SHORT $L178668
; 233 : nLengthA = -1;
mov DWORD PTR _nLengthA$[ebp], -1
$L178668:
; 234 :
; 235 : return ::GetStringTypeExA(lcid, dwInfoType, pszA, nLengthA, pwCharType);
mov esi, esp
mov eax, DWORD PTR _pwCharType$[ebp]
push eax
mov ecx, DWORD PTR _nLengthA$[ebp]
push ecx
lea ecx, DWORD PTR _pszA$[ebp]
call ??B?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QBEPADXZ ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::operator char *
push eax
mov edx, DWORD PTR _dwInfoType$[ebp]
push edx
mov eax, DWORD PTR _lcid$[ebp]
push eax
call DWORD PTR __imp__GetStringTypeExA@20
cmp esi, esp
call __RTC_CheckEsp
mov DWORD PTR $T182404[ebp], eax
mov DWORD PTR __$EHRec$[ebp+8], -1
lea ecx, DWORD PTR _pszA$[ebp]
call ??1?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QAE@XZ ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::~CTempBuffer<char,128,ATL::CCRTAllocator>
mov eax, DWORD PTR $T182404[ebp]
; 236 : }
push edx
mov ecx, ebp
push eax
lea edx, DWORD PTR $L182412
call @_RTC_CheckStackVars@8
pop eax
pop edx
mov ecx, DWORD PTR __$EHRec$[ebp]
mov DWORD PTR fs:__except_list, ecx
mov ecx, DWORD PTR __$ArrayPad$[ebp]
call @__security_check_cookie@4
pop edi
pop esi
add esp, 164 ; 000000a4H
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 20 ; 00000014H
$L182412:
DD 1
DD $L182411
$L182411:
DD -156 ; ffffff64H
DD 132 ; 00000084H
DD $L182408
$L182408:
DB 112 ; 00000070H
DB 115 ; 00000073H
DB 122 ; 0000007aH
DB 65 ; 00000041H
DB 0
_TEXT ENDS
; COMDAT text$x
text$x SEGMENT
$L182405:
lea ecx, DWORD PTR _pszA$[ebp]
jmp ??1?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QAE@XZ ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::~CTempBuffer<char,128,ATL::CCRTAllocator>
__ehhandler$?GetStringTypeExWFake@ATL@@YGHKKPBGHPAG@Z:
mov eax, OFFSET FLAT:$T182407
jmp ___CxxFrameHandler
text$x ENDS
?GetStringTypeExWFake@ATL@@YGHKKPBGHPAG@Z ENDP ; ATL::GetStringTypeExWFake
PUBLIC ?lstrcmpiWFake@ATL@@YGHPBG0@Z ; ATL::lstrcmpiWFake
EXTRN __imp__lstrcmpiW@8:NEAR
; Function compile flags: /Odt /RTCsu
; COMDAT ?lstrcmpiWThunk@ATL@@YGHPBG0@Z
_TEXT SEGMENT
_psz1$ = 8 ; size = 4
_psz2$ = 12 ; size = 4
?lstrcmpiWThunk@ATL@@YGHPBG0@Z PROC NEAR ; ATL::lstrcmpiWThunk, COMDAT
; 254 : {
push ebp
mov ebp, esp
push esi
; 255 : _AtlInstallStringThunk(reinterpret_cast<void**>(&_strthunks.pfnlstrcmpiW), lstrcmpiWFake, ::lstrcmpiW);
mov eax, DWORD PTR __imp__lstrcmpiW@8
push eax
push OFFSET FLAT:?lstrcmpiWFake@ATL@@YGHPBG0@Z ; ATL::lstrcmpiWFake
push OFFSET FLAT:?_strthunks@ATL@@3U_AtlStringThunks@1@A+8
call ?_AtlInstallStringThunk@ATL@@YAXPAPAXPAX1@Z ; ATL::_AtlInstallStringThunk
add esp, 12 ; 0000000cH
; 256 :
; 257 : return _strthunks.pfnlstrcmpiW(psz1, psz2);
mov esi, esp
mov ecx, DWORD PTR _psz2$[ebp]
push ecx
mov edx, DWORD PTR _psz1$[ebp]
push edx
call DWORD PTR ?_strthunks@ATL@@3U_AtlStringThunks@1@A+8
cmp esi, esp
call __RTC_CheckEsp
; 258 : }
pop esi
cmp ebp, esp
call __RTC_CheckEsp
pop ebp
ret 8
?lstrcmpiWThunk@ATL@@YGHPBG0@Z ENDP ; ATL::lstrcmpiWThunk
_TEXT ENDS
EXTRN __imp__lstrcmpiA@8:NEAR
; Function compile flags: /Odt /RTCsu
; COMDAT ?lstrcmpiWFake@ATL@@YGHPBG0@Z
_TEXT SEGMENT
tv91 = -32 ; size = 4
tv94 = -28 ; size = 4
tv76 = -24 ; size = 4
tv79 = -20 ; size = 4
__lpa$ = -16 ; size = 4
__lpw$ = -12 ; size = 4
__acp$ = -8 ; size = 4
__convert$ = -4 ; size = 4
_psz1$ = 8 ; size = 4
_psz2$ = 12 ; size = 4
?lstrcmpiWFake@ATL@@YGHPBG0@Z PROC NEAR ; ATL::lstrcmpiWFake, COMDAT
; 247 : {
push ebp
mov ebp, esp
sub esp, 32 ; 00000020H
push esi
mov eax, -858993460 ; ccccccccH
mov DWORD PTR [ebp-32], eax
mov DWORD PTR [ebp-28], eax
mov DWORD PTR [ebp-24], eax
mov DWORD PTR [ebp-20], eax
mov DWORD PTR [ebp-16], eax
mov DWORD PTR [ebp-12], eax
mov DWORD PTR [ebp-8], eax
mov DWORD PTR [ebp-4], eax
; 248 : USES_CONVERSION;
mov DWORD PTR __convert$[ebp], 0
call ?_AtlGetConversionACP@ATL@@YGIXZ ; ATL::_AtlGetConversionACP
mov DWORD PTR __acp$[ebp], eax
mov DWORD PTR __lpw$[ebp], 0
mov DWORD PTR __lpa$[ebp], 0
; 249 :
; 250 : return ::lstrcmpiA(W2A(psz1), W2A(psz2));
mov eax, DWORD PTR _psz2$[ebp]
mov DWORD PTR __lpw$[ebp], eax
cmp DWORD PTR __lpw$[ebp], 0
jne SHORT $L182420
mov DWORD PTR tv79[ebp], 0
jmp SHORT $L182421
$L182420:
mov esi, esp
mov ecx, DWORD PTR __lpw$[ebp]
push ecx
call DWORD PTR __imp__lstrlenW@4
cmp esi, esp
call __RTC_CheckEsp
lea edx, DWORD PTR [eax+eax+2]
mov DWORD PTR __convert$[ebp], edx
mov eax, DWORD PTR __convert$[ebp]
add eax, 3
and eax, -4 ; fffffffcH
call __alloca_probe
mov DWORD PTR tv76[ebp], esp
mov eax, DWORD PTR __acp$[ebp]
push eax
mov ecx, DWORD PTR __convert$[ebp]
push ecx
mov edx, DWORD PTR __lpw$[ebp]
push edx
mov eax, DWORD PTR tv76[ebp]
push eax
call ?AtlW2AHelper@@YGPADPADPBGHI@Z ; AtlW2AHelper
mov DWORD PTR tv79[ebp], eax
$L182421:
mov ecx, DWORD PTR _psz1$[ebp]
mov DWORD PTR __lpw$[ebp], ecx
cmp DWORD PTR __lpw$[ebp], 0
jne SHORT $L182422
mov DWORD PTR tv94[ebp], 0
jmp SHORT $L182423
$L182422:
mov esi, esp
mov edx, DWORD PTR __lpw$[ebp]
push edx
call DWORD PTR __imp__lstrlenW@4
cmp esi, esp
call __RTC_CheckEsp
lea eax, DWORD PTR [eax+eax+2]
mov DWORD PTR __convert$[ebp], eax
mov eax, DWORD PTR __convert$[ebp]
add eax, 3
and eax, -4 ; fffffffcH
call __alloca_probe
mov DWORD PTR tv91[ebp], esp
mov ecx, DWORD PTR __acp$[ebp]
push ecx
mov edx, DWORD PTR __convert$[ebp]
push edx
mov eax, DWORD PTR __lpw$[ebp]
push eax
mov ecx, DWORD PTR tv91[ebp]
push ecx
call ?AtlW2AHelper@@YGPADPADPBGHI@Z ; AtlW2AHelper
mov DWORD PTR tv94[ebp], eax
$L182423:
mov esi, esp
mov edx, DWORD PTR tv79[ebp]
push edx
mov eax, DWORD PTR tv94[ebp]
push eax
call DWORD PTR __imp__lstrcmpiA@8
cmp esi, esp
call __RTC_CheckEsp
; 251 : }
lea esp, DWORD PTR [ebp-36]
pop esi
mov esp, ebp
pop ebp
ret 8
?lstrcmpiWFake@ATL@@YGHPBG0@Z ENDP ; ATL::lstrcmpiWFake
_TEXT ENDS
PUBLIC ?CharLowerWFake@ATL@@YGPAGPAG@Z ; ATL::CharLowerWFake
EXTRN __imp__CharLowerW@4:NEAR
; Function compile flags: /Odt /RTCsu
; COMDAT ?CharLowerWThunk@ATL@@YGPAGPAG@Z
_TEXT SEGMENT
_psz$ = 8 ; size = 4
?CharLowerWThunk@ATL@@YGPAGPAG@Z PROC NEAR ; ATL::CharLowerWThunk, COMDAT
; 273 : {
push ebp
mov ebp, esp
push esi
; 274 : _AtlInstallStringThunk(reinterpret_cast<void**>(&_strthunks.pfnCharLowerW), CharLowerWFake, ::CharLowerW);
mov eax, DWORD PTR __imp__CharLowerW@4
push eax
push OFFSET FLAT:?CharLowerWFake@ATL@@YGPAGPAG@Z ; ATL::CharLowerWFake
push OFFSET FLAT:?_strthunks@ATL@@3U_AtlStringThunks@1@A+12
call ?_AtlInstallStringThunk@ATL@@YAXPAPAXPAX1@Z ; ATL::_AtlInstallStringThunk
add esp, 12 ; 0000000cH
; 275 :
; 276 : return _strthunks.pfnCharLowerW(psz);
mov esi, esp
mov ecx, DWORD PTR _psz$[ebp]
push ecx
call DWORD PTR ?_strthunks@ATL@@3U_AtlStringThunks@1@A+12
cmp esi, esp
call __RTC_CheckEsp
; 277 : }
pop esi
cmp ebp, esp
call __RTC_CheckEsp
pop ebp
ret 4
?CharLowerWThunk@ATL@@YGPAGPAG@Z ENDP ; ATL::CharLowerWThunk
_TEXT ENDS
PUBLIC ?AtlA2WHelper@@YGPAGPAGPBDHI@Z ; AtlA2WHelper
EXTRN __imp__CharLowerA@4:NEAR
EXTRN __imp__lstrlenA@4:NEAR
EXTRN _wcscpy:NEAR
; Function compile flags: /Odt /RTCsu
; COMDAT ?CharLowerWFake@ATL@@YGPAGPAG@Z
_TEXT SEGMENT
tv90 = -36 ; size = 4
tv94 = -32 ; size = 4
tv75 = -28 ; size = 4
tv78 = -24 ; size = 4
_pszA$ = -20 ; size = 4
__lpa$ = -16 ; size = 4
__lpw$ = -12 ; size = 4
__acp$ = -8 ; size = 4
__convert$ = -4 ; size = 4
_psz$ = 8 ; size = 4
?CharLowerWFake@ATL@@YGPAGPAG@Z PROC NEAR ; ATL::CharLowerWFake, COMDAT
; 261 : {
push ebp
mov ebp, esp
sub esp, 36 ; 00000024H
push esi
mov eax, -858993460 ; ccccccccH
mov DWORD PTR [ebp-36], eax
mov DWORD PTR [ebp-32], eax
mov DWORD PTR [ebp-28], eax
mov DWORD PTR [ebp-24], eax
mov DWORD PTR [ebp-20], eax
mov DWORD PTR [ebp-16], eax
mov DWORD PTR [ebp-12], eax
mov DWORD PTR [ebp-8], eax
mov DWORD PTR [ebp-4], eax
; 262 : USES_CONVERSION;
mov DWORD PTR __convert$[ebp], 0
call ?_AtlGetConversionACP@ATL@@YGIXZ ; ATL::_AtlGetConversionACP
mov DWORD PTR __acp$[ebp], eax
mov DWORD PTR __lpw$[ebp], 0
mov DWORD PTR __lpa$[ebp], 0
; 263 : LPSTR pszA;
; 264 :
; 265 : pszA = W2A(psz);
mov eax, DWORD PTR _psz$[ebp]
mov DWORD PTR __lpw$[ebp], eax
cmp DWORD PTR __lpw$[ebp], 0
jne SHORT $L182428
mov DWORD PTR tv78[ebp], 0
jmp SHORT $L182429
$L182428:
mov esi, esp
mov ecx, DWORD PTR __lpw$[ebp]
push ecx
call DWORD PTR __imp__lstrlenW@4
cmp esi, esp
call __RTC_CheckEsp
lea edx, DWORD PTR [eax+eax+2]
mov DWORD PTR __convert$[ebp], edx
mov eax, DWORD PTR __convert$[ebp]
add eax, 3
and eax, -4 ; fffffffcH
call __alloca_probe
mov DWORD PTR tv75[ebp], esp
mov eax, DWORD PTR __acp$[ebp]
push eax
mov ecx, DWORD PTR __convert$[ebp]
push ecx
mov edx, DWORD PTR __lpw$[ebp]
push edx
mov eax, DWORD PTR tv75[ebp]
push eax
call ?AtlW2AHelper@@YGPADPADPBGHI@Z ; AtlW2AHelper
mov DWORD PTR tv78[ebp], eax
$L182429:
mov ecx, DWORD PTR tv78[ebp]
mov DWORD PTR _pszA$[ebp], ecx
; 266 : ::CharLowerA(pszA);
mov esi, esp
mov edx, DWORD PTR _pszA$[ebp]
push edx
call DWORD PTR __imp__CharLowerA@4
cmp esi, esp
call __RTC_CheckEsp
; 267 : wcscpy(psz, A2W(pszA));
mov eax, DWORD PTR _pszA$[ebp]
mov DWORD PTR __lpa$[ebp], eax
cmp DWORD PTR __lpa$[ebp], 0
jne SHORT $L182430
mov DWORD PTR tv94[ebp], 0
jmp SHORT $L182431
$L182430:
mov esi, esp
mov ecx, DWORD PTR __lpa$[ebp]
push ecx
call DWORD PTR __imp__lstrlenA@4
cmp esi, esp
call __RTC_CheckEsp
add eax, 1
mov DWORD PTR __convert$[ebp], eax
mov eax, DWORD PTR __convert$[ebp]
shl eax, 1
add eax, 3
and eax, -4 ; fffffffcH
call __alloca_probe
mov DWORD PTR tv90[ebp], esp
mov edx, DWORD PTR __acp$[ebp]
push edx
mov eax, DWORD PTR __convert$[ebp]
push eax
mov ecx, DWORD PTR __lpa$[ebp]
push ecx
mov edx, DWORD PTR tv90[ebp]
push edx
call ?AtlA2WHelper@@YGPAGPAGPBDHI@Z ; AtlA2WHelper
mov DWORD PTR tv94[ebp], eax
$L182431:
mov eax, DWORD PTR tv94[ebp]
push eax
mov ecx, DWORD PTR _psz$[ebp]
push ecx
call _wcscpy
add esp, 8
; 268 :
; 269 : return psz;
mov eax, DWORD PTR _psz$[ebp]
; 270 : }
lea esp, DWORD PTR [ebp-40]
pop esi
mov esp, ebp
pop ebp
ret 4
?CharLowerWFake@ATL@@YGPAGPAG@Z ENDP ; ATL::CharLowerWFake
; Function compile flags: /Odt /RTCsu
; File c:\program files\microsoft visual studio .net 2003\vc7\atlmfc\include\atlconv.h
_TEXT ENDS
; COMDAT ?AtlA2WHelper@@YGPAGPAGPBDHI@Z
_TEXT SEGMENT
_ret$ = -4 ; size = 4
_lpw$ = 8 ; size = 4
_lpa$ = 12 ; size = 4
_nChars$ = 16 ; size = 4
_acp$ = 20 ; size = 4
?AtlA2WHelper@@YGPAGPAGPBDHI@Z PROC NEAR ; AtlA2WHelper, COMDAT
; 554 : {
push ebp
mov ebp, esp
push ecx
push esi
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
; 555 : ATLASSERT(lpa != NULL);
cmp DWORD PTR _lpa$[ebp], 0
jne SHORT $L182434
push OFFSET FLAT:??_C@_08DMHHBMMN@lpa?5?$CB?$DN?50?$AA@
push 0
push 555 ; 0000022bH
push OFFSET FLAT:??_C@_0FA@OHHMODBN@C?3?2Program?5Files?2Microsoft?5Visua@
push 2
call __CrtDbgReport
add esp, 20 ; 00000014H
cmp eax, 1
jne SHORT $L182434
int 3
$L182434:
; 556 : ATLASSERT(lpw != NULL);
cmp DWORD PTR _lpw$[ebp], 0
jne SHORT $L182435
push OFFSET FLAT:??_C@_08DIHJLFDJ@lpw?5?$CB?$DN?50?$AA@
push 0
push 556 ; 0000022cH
push OFFSET FLAT:??_C@_0FA@OHHMODBN@C?3?2Program?5Files?2Microsoft?5Visua@
push 2
call __CrtDbgReport
add esp, 20 ; 00000014H
cmp eax, 1
jne SHORT $L182435
int 3
$L182435:
; 557 : if (lpw == NULL || lpa == NULL)
cmp DWORD PTR _lpw$[ebp], 0
je SHORT $L75944
cmp DWORD PTR _lpa$[ebp], 0
jne SHORT $L75943
$L75944:
; 558 : return NULL;
xor eax, eax
jmp SHORT $L75937
$L75943:
; 559 : // verify that no illegal character present
; 560 : // since lpw was allocated based on the size of lpa
; 561 : // don't worry about the number of chars
; 562 : lpw[0] = '\0';
mov edx, DWORD PTR _lpw$[ebp]
mov WORD PTR [edx], 0
; 563 : int ret = MultiByteToWideChar(acp, 0, lpa, -1, lpw, nChars);
mov esi, esp
mov eax, DWORD PTR _nChars$[ebp]
push eax
mov ecx, DWORD PTR _lpw$[ebp]
push ecx
push -1
mov edx, DWORD PTR _lpa$[ebp]
push edx
push 0
mov eax, DWORD PTR _acp$[ebp]
push eax
call DWORD PTR __imp__MultiByteToWideChar@24
cmp esi, esp
call __RTC_CheckEsp
mov DWORD PTR _ret$[ebp], eax
; 564 : if(ret == 0)
cmp DWORD PTR _ret$[ebp], 0
jne SHORT $L75946
; 565 : {
; 566 : ATLASSERT(FALSE);
xor ecx, ecx
jne SHORT $L182436
push OFFSET FLAT:??_C@_01GBGANLPD@0?$AA@
push 0
push 566 ; 00000236H
push OFFSET FLAT:??_C@_0FA@OHHMODBN@C?3?2Program?5Files?2Microsoft?5Visua@
push 2
call __CrtDbgReport
add esp, 20 ; 00000014H
cmp eax, 1
jne SHORT $L182436
int 3
$L182436:
; 567 : return NULL;
xor eax, eax
jmp SHORT $L75937
$L75946:
; 568 : }
; 569 : return lpw;
mov eax, DWORD PTR _lpw$[ebp]
$L75937:
; 570 : }
pop esi
add esp, 4
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 16 ; 00000010H
?AtlA2WHelper@@YGPAGPAGPBDHI@Z ENDP ; AtlA2WHelper
_TEXT ENDS
PUBLIC ?CharUpperWFake@ATL@@YGPAGPAG@Z ; ATL::CharUpperWFake
EXTRN __imp__CharUpperW@4:NEAR
; Function compile flags: /Odt /RTCsu
; File c:\program files\microsoft visual studio .net 2003\vc7\atlmfc\include\cstringt.h
; COMDAT ?CharUpperWThunk@ATL@@YGPAGPAG@Z
_TEXT SEGMENT
_psz$ = 8 ; size = 4
?CharUpperWThunk@ATL@@YGPAGPAG@Z PROC NEAR ; ATL::CharUpperWThunk, COMDAT
; 292 : {
push ebp
mov ebp, esp
push esi
; 293 : _AtlInstallStringThunk(reinterpret_cast<void**>(&_strthunks.pfnCharUpperW), CharUpperWFake, ::CharUpperW);
mov eax, DWORD PTR __imp__CharUpperW@4
push eax
push OFFSET FLAT:?CharUpperWFake@ATL@@YGPAGPAG@Z ; ATL::CharUpperWFake
push OFFSET FLAT:?_strthunks@ATL@@3U_AtlStringThunks@1@A+16
call ?_AtlInstallStringThunk@ATL@@YAXPAPAXPAX1@Z ; ATL::_AtlInstallStringThunk
add esp, 12 ; 0000000cH
; 294 :
; 295 : return _strthunks.pfnCharUpperW(psz);
mov esi, esp
mov ecx, DWORD PTR _psz$[ebp]
push ecx
call DWORD PTR ?_strthunks@ATL@@3U_AtlStringThunks@1@A+16
cmp esi, esp
call __RTC_CheckEsp
; 296 : }
pop esi
cmp ebp, esp
call __RTC_CheckEsp
pop ebp
ret 4
?CharUpperWThunk@ATL@@YGPAGPAG@Z ENDP ; ATL::CharUpperWThunk
_TEXT ENDS
EXTRN __imp__CharUpperA@4:NEAR
; Function compile flags: /Odt /RTCsu
; COMDAT ?CharUpperWFake@ATL@@YGPAGPAG@Z
_TEXT SEGMENT
tv90 = -36 ; size = 4
tv94 = -32 ; size = 4
tv75 = -28 ; size = 4
tv78 = -24 ; size = 4
_pszA$ = -20 ; size = 4
__lpa$ = -16 ; size = 4
__lpw$ = -12 ; size = 4
__acp$ = -8 ; size = 4
__convert$ = -4 ; size = 4
_psz$ = 8 ; size = 4
?CharUpperWFake@ATL@@YGPAGPAG@Z PROC NEAR ; ATL::CharUpperWFake, COMDAT
; 280 : {
push ebp
mov ebp, esp
sub esp, 36 ; 00000024H
push esi
mov eax, -858993460 ; ccccccccH
mov DWORD PTR [ebp-36], eax
mov DWORD PTR [ebp-32], eax
mov DWORD PTR [ebp-28], eax
mov DWORD PTR [ebp-24], eax
mov DWORD PTR [ebp-20], eax
mov DWORD PTR [ebp-16], eax
mov DWORD PTR [ebp-12], eax
mov DWORD PTR [ebp-8], eax
mov DWORD PTR [ebp-4], eax
; 281 : USES_CONVERSION;
mov DWORD PTR __convert$[ebp], 0
call ?_AtlGetConversionACP@ATL@@YGIXZ ; ATL::_AtlGetConversionACP
mov DWORD PTR __acp$[ebp], eax
mov DWORD PTR __lpw$[ebp], 0
mov DWORD PTR __lpa$[ebp], 0
; 282 : LPSTR pszA;
; 283 :
; 284 : pszA = W2A(psz);
mov eax, DWORD PTR _psz$[ebp]
mov DWORD PTR __lpw$[ebp], eax
cmp DWORD PTR __lpw$[ebp], 0
jne SHORT $L182441
mov DWORD PTR tv78[ebp], 0
jmp SHORT $L182442
$L182441:
mov esi, esp
mov ecx, DWORD PTR __lpw$[ebp]
push ecx
call DWORD PTR __imp__lstrlenW@4
cmp esi, esp
call __RTC_CheckEsp
lea edx, DWORD PTR [eax+eax+2]
mov DWORD PTR __convert$[ebp], edx
mov eax, DWORD PTR __convert$[ebp]
add eax, 3
and eax, -4 ; fffffffcH
call __alloca_probe
mov DWORD PTR tv75[ebp], esp
mov eax, DWORD PTR __acp$[ebp]
push eax
mov ecx, DWORD PTR __convert$[ebp]
push ecx
mov edx, DWORD PTR __lpw$[ebp]
push edx
mov eax, DWORD PTR tv75[ebp]
push eax
call ?AtlW2AHelper@@YGPADPADPBGHI@Z ; AtlW2AHelper
mov DWORD PTR tv78[ebp], eax
$L182442:
mov ecx, DWORD PTR tv78[ebp]
mov DWORD PTR _pszA$[ebp], ecx
; 285 : ::CharUpperA(pszA);
mov esi, esp
mov edx, DWORD PTR _pszA$[ebp]
push edx
call DWORD PTR __imp__CharUpperA@4
cmp esi, esp
call __RTC_CheckEsp
; 286 : wcscpy(psz, A2W(pszA));
mov eax, DWORD PTR _pszA$[ebp]
mov DWORD PTR __lpa$[ebp], eax
cmp DWORD PTR __lpa$[ebp], 0
jne SHORT $L182443
mov DWORD PTR tv94[ebp], 0
jmp SHORT $L182444
$L182443:
mov esi, esp
mov ecx, DWORD PTR __lpa$[ebp]
push ecx
call DWORD PTR __imp__lstrlenA@4
cmp esi, esp
call __RTC_CheckEsp
add eax, 1
mov DWORD PTR __convert$[ebp], eax
mov eax, DWORD PTR __convert$[ebp]
shl eax, 1
add eax, 3
and eax, -4 ; fffffffcH
call __alloca_probe
mov DWORD PTR tv90[ebp], esp
mov edx, DWORD PTR __acp$[ebp]
push edx
mov eax, DWORD PTR __convert$[ebp]
push eax
mov ecx, DWORD PTR __lpa$[ebp]
push ecx
mov edx, DWORD PTR tv90[ebp]
push edx
call ?AtlA2WHelper@@YGPAGPAGPBDHI@Z ; AtlA2WHelper
mov DWORD PTR tv94[ebp], eax
$L182444:
mov eax, DWORD PTR tv94[ebp]
push eax
mov ecx, DWORD PTR _psz$[ebp]
push ecx
call _wcscpy
add esp, 8
; 287 :
; 288 : return psz;
mov eax, DWORD PTR _psz$[ebp]
; 289 : }
lea esp, DWORD PTR [ebp-40]
pop esi
mov esp, ebp
pop ebp
ret 4
?CharUpperWFake@ATL@@YGPAGPAG@Z ENDP ; ATL::CharUpperWFake
_TEXT ENDS
PUBLIC ??BCTraceCategory@ATL@@QBEKXZ ; ATL::CTraceCategory::operator unsigned long
PUBLIC ??0CTraceFileAndLineInfo@ATL@@QAE@PBDH@Z ; ATL::CTraceFileAndLineInfo::CTraceFileAndLineInfo
PUBLIC ??RCTraceFileAndLineInfo@ATL@@QBAXKIPBDZZ ; ATL::CTraceFileAndLineInfo::operator()
PUBLIC ??0CAtlException@ATL@@QAE@J@Z ; ATL::CAtlException::CAtlException
PUBLIC ??_C@_0FC@CFIFHLCH@C?3?2Program?5Files?2Microsoft?5Visua@ ; `string'
PUBLIC ??_C@_0BF@IAAKIJDJ@AtlThrow?3?5hr?5?$DN?50x?$CFx?6?$AA@ ; `string'
PUBLIC __TI1?AVCAtlException@ATL@@
PUBLIC __CTA1?AVCAtlException@ATL@@
PUBLIC ??_R0?AVCAtlException@ATL@@@8 ; ATL::CAtlException `RTTI Type Descriptor'
PUBLIC __CT??_R0?AVCAtlException@ATL@@@84
EXTRN __CxxThrowException@8:NEAR
EXTRN ?atlTraceException@ATL@@3VCTraceCategory@1@A:DWORD ; ATL::atlTraceException
EXTRN ??_7type_info@@6B@:DWORD ; type_info::`vftable'
; COMDAT ??_C@_0BF@IAAKIJDJ@AtlThrow?3?5hr?5?$DN?50x?$CFx?6?$AA@
; File c:\program files\microsoft visual studio .net 2003\vc7\atlmfc\include\atlexcept.h
CONST SEGMENT
??_C@_0BF@IAAKIJDJ@AtlThrow?3?5hr?5?$DN?50x?$CFx?6?$AA@ DB 'AtlThrow: hr '
DB '= 0x%x', 0aH, 00H ; `string'
CONST ENDS
; COMDAT ??_C@_0FC@CFIFHLCH@C?3?2Program?5Files?2Microsoft?5Visua@
CONST SEGMENT
??_C@_0FC@CFIFHLCH@C?3?2Program?5Files?2Microsoft?5Visua@ DB 'C:\Program '
DB 'Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\at'
DB 'lexcept.h', 00H ; `string'
CONST ENDS
; COMDAT __TI1?AVCAtlException@ATL@@
xdata$x SEGMENT
__TI1?AVCAtlException@ATL@@ DD 00H
DD 00H
DD 00H
DD FLAT:__CTA1?AVCAtlException@ATL@@
xdata$x ENDS
; COMDAT __CTA1?AVCAtlException@ATL@@
xdata$x SEGMENT
__CTA1?AVCAtlException@ATL@@ DD 01H
DD FLAT:__CT??_R0?AVCAtlException@ATL@@@84
xdata$x ENDS
; COMDAT __CT??_R0?AVCAtlException@ATL@@@84
xdata$x SEGMENT
__CT??_R0?AVCAtlException@ATL@@@84 DD 00H
DD FLAT:??_R0?AVCAtlException@ATL@@@8
DD 00H
DD 0ffffffffH
ORG $+4
DD 04H
DD 00H
xdata$x ENDS
; COMDAT ??_R0?AVCAtlException@ATL@@@8
_DATA SEGMENT
??_R0?AVCAtlException@ATL@@@8 DD FLAT:??_7type_info@@6B@ ; ATL::CAtlException `RTTI Type Descriptor'
DD 00H
DB '.?AVCAtlException@ATL@@', 00H
; Function compile flags: /Odt /RTCsu
_DATA ENDS
; COMDAT ?AtlThrow@ATL@@YGXJ@Z
_TEXT SEGMENT
$T182449 = -16 ; size = 4
$T182448 = -12 ; size = 4
$T182447 = -8 ; size = 8
_hr$ = 8 ; size = 4
?AtlThrow@ATL@@YGXJ@Z PROC NEAR ; ATL::AtlThrow, COMDAT
; 61 : {
push ebp
mov ebp, esp
sub esp, 16 ; 00000010H
mov eax, -858993460 ; ccccccccH
mov DWORD PTR [ebp-16], eax
mov DWORD PTR [ebp-12], eax
mov DWORD PTR [ebp-8], eax
mov DWORD PTR [ebp-4], eax
; 62 : ATLTRACE(atlTraceException, 0, _T("AtlThrow: hr = 0x%x\n"), hr );
mov eax, DWORD PTR _hr$[ebp]
push eax
push OFFSET FLAT:??_C@_0BF@IAAKIJDJ@AtlThrow?3?5hr?5?$DN?50x?$CFx?6?$AA@
push 0
mov ecx, OFFSET FLAT:?atlTraceException@ATL@@3VCTraceCategory@1@A ; ATL::atlTraceException
call ??BCTraceCategory@ATL@@QBEKXZ ; ATL::CTraceCategory::operator unsigned long
push eax
push 62 ; 0000003eH
push OFFSET FLAT:??_C@_0FC@CFIFHLCH@C?3?2Program?5Files?2Microsoft?5Visua@
lea ecx, DWORD PTR $T182447[ebp]
call ??0CTraceFileAndLineInfo@ATL@@QAE@PBDH@Z ; ATL::CTraceFileAndLineInfo::CTraceFileAndLineInfo
push eax
call ??RCTraceFileAndLineInfo@ATL@@QBAXKIPBDZZ ; ATL::CTraceFileAndLineInfo::operator()
add esp, 20 ; 00000014H
; 63 : #ifdef _AFX
; 64 : if( hr == E_OUTOFMEMORY )
; 65 : {
; 66 : AfxThrowMemoryException();
; 67 : }
; 68 : else
; 69 : {
; 70 : AfxThrowOleException( hr );
; 71 : }
; 72 : #else
; 73 : throw CAtlException( hr );
mov ecx, DWORD PTR _hr$[ebp]
push ecx
lea ecx, DWORD PTR $T182449[ebp]
call ??0CAtlException@ATL@@QAE@J@Z ; ATL::CAtlException::CAtlException
mov edx, DWORD PTR [eax]
mov DWORD PTR $T182448[ebp], edx
push OFFSET FLAT:__TI1?AVCAtlException@ATL@@
lea eax, DWORD PTR $T182448[ebp]
push eax
call __CxxThrowException@8
$L182446:
; 74 : #endif
; 75 : };
add esp, 16 ; 00000010H
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 4
?AtlThrow@ATL@@YGXJ@Z ENDP ; ATL::AtlThrow
; Function compile flags: /Odt /RTCsu
; File c:\program files\microsoft visual studio .net 2003\vc7\atlmfc\include\atltrace.h
_TEXT ENDS
; COMDAT ??0CTraceFileAndLineInfo@ATL@@QAE@PBDH@Z
_TEXT SEGMENT
_this$ = -4 ; size = 4
_pszFileName$ = 8 ; size = 4
_nLineNo$ = 12 ; size = 4
??0CTraceFileAndLineInfo@ATL@@QAE@PBDH@Z PROC NEAR ; ATL::CTraceFileAndLineInfo::CTraceFileAndLineInfo, COMDAT
; _this$ = ecx
; 158 : {}
push ebp
mov ebp, esp
push ecx
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov DWORD PTR _this$[ebp], ecx
mov eax, DWORD PTR _this$[ebp]
mov ecx, DWORD PTR _pszFileName$[ebp]
mov DWORD PTR [eax], ecx
mov edx, DWORD PTR _this$[ebp]
mov eax, DWORD PTR _nLineNo$[ebp]
mov DWORD PTR [edx+4], eax
mov eax, DWORD PTR _this$[ebp]
mov esp, ebp
pop ebp
ret 8
??0CTraceFileAndLineInfo@ATL@@QAE@PBDH@Z ENDP ; ATL::CTraceFileAndLineInfo::CTraceFileAndLineInfo
_TEXT ENDS
PUBLIC ?TraceV@CTrace@ATL@@QBAXPBDHKI0PAD@Z ; ATL::CTrace::TraceV
EXTRN ?s_trace@CTrace@ATL@@2V12@A:QWORD ; ATL::CTrace::s_trace
; Function compile flags: /Odt /RTCsu
; COMDAT ??RCTraceFileAndLineInfo@ATL@@QBAXKIPBDZZ
_TEXT SEGMENT
_ptr$ = -4 ; size = 4
_this$ = 8 ; size = 4
_dwCategory$ = 12 ; size = 4
_nLevel$ = 16 ; size = 4
_pszFmt$ = 20 ; size = 4
??RCTraceFileAndLineInfo@ATL@@QBAXKIPBDZZ PROC NEAR ; ATL::CTraceFileAndLineInfo::operator(), COMDAT
; 161 : {
push ebp
mov ebp, esp
push ecx
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
; 162 : va_list ptr; va_start(ptr, pszFmt);
lea eax, DWORD PTR _pszFmt$[ebp+4]
mov DWORD PTR _ptr$[ebp], eax
; 163 : ATL::CTrace::s_trace.TraceV(m_pszFileName, m_nLineNo, dwCategory, nLevel, pszFmt, ptr);
mov ecx, DWORD PTR _ptr$[ebp]
push ecx
mov edx, DWORD PTR _pszFmt$[ebp]
push edx
mov eax, DWORD PTR _nLevel$[ebp]
push eax
mov ecx, DWORD PTR _dwCategory$[ebp]
push ecx
mov edx, DWORD PTR _this$[ebp]
mov eax, DWORD PTR [edx+4]
push eax
mov ecx, DWORD PTR _this$[ebp]
mov edx, DWORD PTR [ecx]
push edx
push OFFSET FLAT:?s_trace@CTrace@ATL@@2V12@A
call ?TraceV@CTrace@ATL@@QBAXPBDHKI0PAD@Z ; ATL::CTrace::TraceV
add esp, 28 ; 0000001cH
; 164 : va_end(ptr);
mov DWORD PTR _ptr$[ebp], 0
; 165 : }
add esp, 4
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
??RCTraceFileAndLineInfo@ATL@@QBAXKIPBDZZ ENDP ; ATL::CTraceFileAndLineInfo::operator()
_TEXT ENDS
EXTRN _AtlTraceVA:NEAR
; Function compile flags: /Odt /RTCsu
; COMDAT ?TraceV@CTrace@ATL@@QBAXPBDHKI0PAD@Z
_TEXT SEGMENT
_this$ = 8 ; size = 4
_pszFileName$ = 12 ; size = 4
_nLine$ = 16 ; size = 4
_dwCategory$ = 20 ; size = 4
_nLevel$ = 24 ; size = 4
_pszFmt$ = 28 ; size = 4
_args$ = 32 ; size = 4
?TraceV@CTrace@ATL@@QBAXPBDHKI0PAD@Z PROC NEAR ; ATL::CTrace::TraceV, COMDAT
; 121 : {
push ebp
mov ebp, esp
; 122 : AtlTraceVA(m_dwModule, pszFileName, nLine, dwCategory, nLevel, pszFmt, args);
mov eax, DWORD PTR _args$[ebp]
push eax
mov ecx, DWORD PTR _pszFmt$[ebp]
push ecx
mov edx, DWORD PTR _nLevel$[ebp]
push edx
mov eax, DWORD PTR _dwCategory$[ebp]
push eax
mov ecx, DWORD PTR _nLine$[ebp]
push ecx
mov edx, DWORD PTR _pszFileName$[ebp]
push edx
mov eax, DWORD PTR _this$[ebp]
mov ecx, DWORD PTR [eax+4]
push ecx
call _AtlTraceVA
add esp, 28 ; 0000001cH
; 123 : }
cmp ebp, esp
call __RTC_CheckEsp
pop ebp
ret 0
?TraceV@CTrace@ATL@@QBAXPBDHKI0PAD@Z ENDP ; ATL::CTrace::TraceV
; Function compile flags: /Odt /RTCsu
_TEXT ENDS
; COMDAT ??BCTraceCategory@ATL@@QBEKXZ
_TEXT SEGMENT
_this$ = -4 ; size = 4
??BCTraceCategory@ATL@@QBEKXZ PROC NEAR ; ATL::CTraceCategory::operator unsigned long, COMDAT
; _this$ = ecx
; 202 : {
push ebp
mov ebp, esp
push ecx
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov DWORD PTR _this$[ebp], ecx
; 203 : return( m_dwCategory );
mov eax, DWORD PTR _this$[ebp]
mov eax, DWORD PTR [eax]
; 204 : }
mov esp, ebp
pop ebp
ret 0
??BCTraceCategory@ATL@@QBEKXZ ENDP ; ATL::CTraceCategory::operator unsigned long
; Function compile flags: /Odt /RTCsu
; File c:\program files\microsoft visual studio .net 2003\vc7\atlmfc\include\atlexcept.h
_TEXT ENDS
; COMDAT ??0CAtlException@ATL@@QAE@J@Z
_TEXT SEGMENT
_this$ = -4 ; size = 4
_hr$ = 8 ; size = 4
??0CAtlException@ATL@@QAE@J@Z PROC NEAR ; ATL::CAtlException::CAtlException, COMDAT
; _this$ = ecx
; 40 : {
push ebp
mov ebp, esp
push ecx
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov DWORD PTR _this$[ebp], ecx
mov eax, DWORD PTR _this$[ebp]
mov ecx, DWORD PTR _hr$[ebp]
mov DWORD PTR [eax], ecx
; 41 : }
mov eax, DWORD PTR _this$[ebp]
mov esp, ebp
pop ebp
ret 4
??0CAtlException@ATL@@QAE@J@Z ENDP ; ATL::CAtlException::CAtlException
_TEXT ENDS
PUBLIC ?GetTimeDifferenceInMinutes@@YAJPAU_SYSTEMTIME@@0@Z ; GetTimeDifferenceInMinutes
EXTRN ?GetTotalMinutes@CTimeSpan@ATL@@QBE_JXZ:NEAR ; ATL::CTimeSpan::GetTotalMinutes
EXTRN ??0CTime@ATL@@QAE@ABU_SYSTEMTIME@@H@Z:NEAR ; ATL::CTime::CTime
EXTRN ??GCTime@ATL@@QBE?AVCTimeSpan@1@V01@@Z:NEAR ; ATL::CTime::operator-
; Function compile flags: /Odt /RTCsu
; File c:\activex\xmlsign\crlcache.cpp
_TEXT SEGMENT
_timeDiff$ = -44 ; size = 8
_fetchCTime$ = -28 ; size = 8
_curCTime$ = -12 ; size = 8
_curTime$ = 8 ; size = 4
_fetchTime$ = 12 ; size = 4
?GetTimeDifferenceInMinutes@@YAJPAU_SYSTEMTIME@@0@Z PROC NEAR ; GetTimeDifferenceInMinutes
; 62 : {
push ebp
mov ebp, esp
sub esp, 48 ; 00000030H
push edi
lea edi, DWORD PTR [ebp-48]
mov ecx, 12 ; 0000000cH
mov eax, -858993460 ; ccccccccH
rep stosd
; 63 : CTime curCTime(*curTime, -1);
push -1
mov eax, DWORD PTR _curTime$[ebp]
push eax
lea ecx, DWORD PTR _curCTime$[ebp]
call ??0CTime@ATL@@QAE@ABU_SYSTEMTIME@@H@Z ; ATL::CTime::CTime
; 64 : CTime fetchCTime(*fetchTime, -1);
push -1
mov ecx, DWORD PTR _fetchTime$[ebp]
push ecx
lea ecx, DWORD PTR _fetchCTime$[ebp]
call ??0CTime@ATL@@QAE@ABU_SYSTEMTIME@@H@Z ; ATL::CTime::CTime
; 65 : CTimeSpan timeDiff = curCTime - fetchCTime;
mov edx, DWORD PTR _fetchCTime$[ebp+4]
push edx
mov eax, DWORD PTR _fetchCTime$[ebp]
push eax
lea ecx, DWORD PTR _timeDiff$[ebp]
push ecx
lea ecx, DWORD PTR _curCTime$[ebp]
call ??GCTime@ATL@@QBE?AVCTimeSpan@1@V01@@Z ; ATL::CTime::operator-
; 66 :
; 67 : return timeDiff.GetTotalMinutes();
lea ecx, DWORD PTR _timeDiff$[ebp]
call ?GetTotalMinutes@CTimeSpan@ATL@@QBE_JXZ ; ATL::CTimeSpan::GetTotalMinutes
; 68 : }
push edx
mov ecx, ebp
push eax
lea edx, DWORD PTR $L182467
call @_RTC_CheckStackVars@8
pop eax
pop edx
pop edi
add esp, 48 ; 00000030H
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
$L182467:
DD 3
DD $L182466
$L182466:
DD -12 ; fffffff4H
DD 8
DD $L182463
DD -28 ; ffffffe4H
DD 8
DD $L182464
DD -44 ; ffffffd4H
DD 8
DD $L182465
$L182465:
DB 116 ; 00000074H
DB 105 ; 00000069H
DB 109 ; 0000006dH
DB 101 ; 00000065H
DB 68 ; 00000044H
DB 105 ; 00000069H
DB 102 ; 00000066H
DB 102 ; 00000066H
DB 0
$L182464:
DB 102 ; 00000066H
DB 101 ; 00000065H
DB 116 ; 00000074H
DB 99 ; 00000063H
DB 104 ; 00000068H
DB 67 ; 00000043H
DB 84 ; 00000054H
DB 105 ; 00000069H
DB 109 ; 0000006dH
DB 101 ; 00000065H
DB 0
$L182463:
DB 99 ; 00000063H
DB 117 ; 00000075H
DB 114 ; 00000072H
DB 67 ; 00000043H
DB 84 ; 00000054H
DB 105 ; 00000069H
DB 109 ; 0000006dH
DB 101 ; 00000065H
DB 0
?GetTimeDifferenceInMinutes@@YAJPAU_SYSTEMTIME@@0@Z ENDP ; GetTimeDifferenceInMinutes
_TEXT ENDS
PUBLIC ??0CRLCache@@QAE@PAGPAU_GLOBAL_SIG@@@Z ; CRLCache::CRLCache
; Function compile flags: /Odt /RTCsu
_TEXT SEGMENT
_this$ = -4 ; size = 4
_connStr$ = 8 ; size = 4
_SigHandle$ = 12 ; size = 4
??0CRLCache@@QAE@PAGPAU_GLOBAL_SIG@@@Z PROC NEAR ; CRLCache::CRLCache
; _this$ = ecx
; 70 : {
push ebp
mov ebp, esp
push ecx
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov DWORD PTR _this$[ebp], ecx
; 71 : #ifdef NSS
; 72 : // not implemented
; 73 : #else
; 74 : _ConnectionPtr spCON;
; 75 : SecureXMLDbConnectionString = SysAllocString(connStr);
; 76 : crlTimeoutInMinutes = 0;
; 77 : CoInitialize(NULL);
; 78 :
; 79 : try{
; 80 : CREATEiNSTANCE(spCON,Connection);
; 81 : spCON->ConnectionString = SecureXMLDbConnectionString;
; 82 : spCON->Open( "", "", "", -1 );
; 83 : spCON->Close();
; 84 : CRLCacheInitialized = TRUE;
; 85 : }
; 86 : catch( _com_error &e){
; 87 : _bstr_t bstrSource(e.Source());
; 88 : _bstr_t bs = _bstr_t(" Error: ") + _bstr_t(e.Error()) + _bstr_t(" Msg: ")
; 89 : + _bstr_t(e.ErrorMessage()) + _bstr_t(" Description: ")
; 90 : + _bstr_t(e.Description());
; 91 : CRLCacheInitialized = FALSE;
; 92 : char *errorDetail = (char *)bs;
; 93 : setErrorWithDescr(SigHandle, ADO_ERROR, (unsigned char *)errorDetail);
; 94 : }
; 95 : #endif
; 96 : }
mov eax, DWORD PTR _this$[ebp]
mov esp, ebp
pop ebp
ret 8
??0CRLCache@@QAE@PAGPAU_GLOBAL_SIG@@@Z ENDP ; CRLCache::CRLCache
_TEXT ENDS
PUBLIC ??1CRLCache@@QAE@XZ ; CRLCache::~CRLCache
EXTRN __imp__SysFreeString@4:NEAR
EXTRN __imp__CoUninitialize@0:NEAR
; Function compile flags: /Odt /RTCsu
_TEXT SEGMENT
_this$ = -4 ; size = 4
??1CRLCache@@QAE@XZ PROC NEAR ; CRLCache::~CRLCache
; _this$ = ecx
; 99 : {
push ebp
mov ebp, esp
push ecx
push esi
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov DWORD PTR _this$[ebp], ecx
; 100 : CRLCacheInitialized = FALSE;
mov eax, DWORD PTR _this$[ebp]
mov DWORD PTR [eax+8], 0
; 101 : if (SecureXMLDbConnectionString != NULL)
mov ecx, DWORD PTR _this$[ebp]
cmp DWORD PTR [ecx+4], 0
je SHORT $L181556
; 102 : SysFreeString(SecureXMLDbConnectionString);
mov esi, esp
mov edx, DWORD PTR _this$[ebp]
mov eax, DWORD PTR [edx+4]
push eax
call DWORD PTR __imp__SysFreeString@4
cmp esi, esp
call __RTC_CheckEsp
$L181556:
; 103 : CoUninitialize();
mov esi, esp
call DWORD PTR __imp__CoUninitialize@0
cmp esi, esp
call __RTC_CheckEsp
; 104 : }
pop esi
add esp, 4
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
??1CRLCache@@QAE@XZ ENDP ; CRLCache::~CRLCache
_TEXT ENDS
PUBLIC ?FetchCRLFromCRLCache@CRLCache@@QAEPAPAU_DS_DATA_BLOB@@PAU_CRYPTOAPI_BLOB@@PAIPAU_GLOBAL_SIG@@@Z ; CRLCache::FetchCRLFromCRLCache
; Function compile flags: /Odt /RTCsu
_TEXT SEGMENT
_crlList$ = -8 ; size = 4
_this$ = -4 ; size = 4
_certIssuer$ = 8 ; size = 4
_crlCount$ = 12 ; size = 4
_SigHandle$ = 16 ; size = 4
?FetchCRLFromCRLCache@CRLCache@@QAEPAPAU_DS_DATA_BLOB@@PAU_CRYPTOAPI_BLOB@@PAIPAU_GLOBAL_SIG@@@Z PROC NEAR ; CRLCache::FetchCRLFromCRLCache
; _this$ = ecx
; 109 : {
push ebp
mov ebp, esp
sub esp, 8
mov DWORD PTR [ebp-8], -858993460 ; ccccccccH
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov DWORD PTR _this$[ebp], ecx
; 110 : PDS_DATA_BLOB *crlList=NULL;
mov DWORD PTR _crlList$[ebp], 0
; 111 : #ifdef NSS
; 112 : // not implemented
; 113 : #else
; 114 : _ConnectionPtr spCON;
; 115 : _RecordsetPtr spRS;
; 116 : PCERT_NAME_BLOB normCertName=NULL;
; 117 : BYTE *pbData=NULL;
; 118 : DWORD cbData=0;
; 119 : PDS_DATA_BLOB crlData=NULL;
; 120 : _variant_t recsAffected;
; 121 : recsAffected.vt = VT_ERROR;
; 122 : recsAffected.scode = DISP_E_PARAMNOTFOUND;
; 123 : int validCrlCount=0;
; 124 : int i=0;
; 125 :
; 126 : normCertName = normalizeCertName(certIssuer);
; 127 : normCertName->pbData = (BYTE *) zRealloc(normCertName->pbData, normCertName->cbData + 1);
; 128 : *(normCertName->pbData + normCertName->cbData) = '\0';
; 129 : _bstr_t selectCRLCommand = CRLCache::selectCrlCommand + _bstr_t("'") + _bstr_t((LPCSTR)normCertName->pbData) + _bstr_t("'");
; 130 :
; 131 : if (CRLCacheInitialized == TRUE)
; 132 : {
; 133 : try
; 134 : {
; 135 : //DebugBreak();
; 136 : CREATEiNSTANCE(spCON,Connection);
; 137 : spCON->ConnectionString = SecureXMLDbConnectionString;
; 138 : spCON->Open( "", "", "", -1 );
; 139 : CREATEiNSTANCE(spRS,Recordset)
; 140 : spRS->PutRefActiveConnection( spCON );
; 141 : spRS->Open(selectCRLCommand,
; 142 : vtMissing, adOpenKeyset,
; 143 : adLockOptimistic, adCmdText);
; 144 :
; 145 : // The Following was part of release 2.1.134.35
; 146 : //spRS->Open(selectCRLCommand,
; 147 : // vtMissing, adOpenKeyset,
; 148 : // adLockBatchOptimistic, -1);
; 149 :
; 150 : validCrlCount = spRS->RecordCount;
; 151 : //if (validCrlCount == -1)
; 152 : //{
; 153 : // spRS->Open(selectCRLCommand,
; 154 : // vtMissing, adOpenKeyset,
; 155 : // adLockBatchOptimistic, -1);
; 156 : //}
; 157 : //validCrlCount = spRS->RecordCount;
; 158 :
; 159 : if (validCrlCount > 0)
; 160 : {
; 161 : crlList = (PDS_DATA_BLOB *)zMalloc(sizeof(PDS_DATA_BLOB) * spRS->RecordCount);
; 162 : if (crlTimeoutInMinutes != 0) // A finite CRL expiry is enforced by the application
; 163 : {
; 164 : while(spRS->adoEOF == false)
; 165 : {
; 166 : SYSTEMTIME curTime;
; 167 : GetSystemTime(&curTime);
; 168 : _bstr_t fetchTime = _bstr_t(RsITEM(spRS, 1L));
; 169 : LPSYSTEMTIME sysFetchTime = vbNowTimeToSystem((BYTE *)(char *)fetchTime);
; 170 : localTimeToUtcTime(sysFetchTime);
; 171 : if (GetTimeDifferenceInMinutes(&curTime, sysFetchTime) >= crlTimeoutInMinutes)
; 172 : {
; 173 : //Delete the CRL entry from the CRL Cache database
; 174 : //MessageBox(NULL, "Calling Delete Record", "FetchCRLFromCRLCache", MB_OK);
; 175 : spRS->Delete(adAffectCurrent);
; 176 : //Decrement the number of maching CRLs by one
; 177 : validCrlCount--;
; 178 : spRS->MoveNext();
; 179 : }
; 180 : else
; 181 : {
; 182 : _bstr_t base64CrlData =_bstr_t(RsITEM(spRS, 0L));
; 183 : cbData = base64decodeSize(strlen((const char *)base64CrlData));
; 184 : pbData = (BYTE *)zMalloc(cbData+1);
; 185 : crlData = (PDS_DATA_BLOB)zMalloc(sizeof(DS_DATA_BLOB));
; 186 : if ((crlData->cbData = base64decode((unsigned char *)(const char *)base64CrlData, (unsigned char *)pbData, cbData+1)) == -1)
; 187 : {
; 188 : setError(SigHandle, BASE64_ERROR);
; 189 : return NULL;
; 190 : }
; 191 : crlData->pbData = pbData;
; 192 : crlList[i] = crlData;
; 193 : i++;
; 194 : spRS->MoveNext();
; 195 : }
; 196 : zFree(sysFetchTime);
; 197 : }//End While
; 198 : }
; 199 : else
; 200 : {
; 201 : if (spRS->RecordCount > 0)
; 202 : {
; 203 : // crlList = (PDS_DATA_BLOB *)zMalloc(sizeof(PDS_DATA_BLOB) * spRS->RecordCount);
; 204 : i=0;
; 205 : while(spRS->adoEOF == false)
; 206 : {
; 207 : _bstr_t base64CrlData =_bstr_t(RsITEM(spRS, 0L));
; 208 : cbData = base64decodeSize(strlen((const char *)base64CrlData));
; 209 : pbData = (BYTE *)zMalloc(cbData+1);
; 210 : crlData = (PDS_DATA_BLOB)zMalloc(sizeof(DS_DATA_BLOB));
; 211 : if ((crlData->cbData = base64decode((unsigned char *)(const char *)base64CrlData, (unsigned char *)pbData, cbData+1)) == -1)
; 212 : {
; 213 : setError(SigHandle, BASE64_ERROR);
; 214 : return NULL;
; 215 : }
; 216 : crlData->pbData = pbData;
; 217 : crlList[i] = crlData;
; 218 : i++;
; 219 : spRS->MoveNext();
; 220 : }
; 221 : }
; 222 : }
; 223 : }// End if
; 224 : *crlCount = i;
; 225 : spRS->Close();
; 226 : spCON->Close();
; 227 : }
; 228 : catch( _com_error &e)
; 229 : {
; 230 : _bstr_t bstrSource(e.Source());
; 231 : _bstr_t bs = _bstr_t(" Error: ") + _bstr_t(e.Error()) + _bstr_t(" Msg: ")
; 232 : + _bstr_t(e.ErrorMessage()) + _bstr_t(" Description: ")
; 233 : + _bstr_t(e.Description());
; 234 : CRLCacheInitialized = FALSE;
; 235 : char *errorDetail = (char *)bs;
; 236 : setErrorWithDescr(SigHandle, ADO_ERROR, (unsigned char *)errorDetail);
; 237 : }
; 238 : }
; 239 :
; 240 : zFree(normCertName->pbData);
; 241 : zFree(normCertName);
; 242 :
; 243 : if (*crlCount == 0)
; 244 : {
; 245 : zFree(crlList);
; 246 : crlList = NULL;
; 247 : }
; 248 : #endif
; 249 : return crlList;
mov eax, DWORD PTR _crlList$[ebp]
; 250 : }
mov esp, ebp
pop ebp
ret 12 ; 0000000cH
?FetchCRLFromCRLCache@CRLCache@@QAEPAPAU_DS_DATA_BLOB@@PAU_CRYPTOAPI_BLOB@@PAIPAU_GLOBAL_SIG@@@Z ENDP ; CRLCache::FetchCRLFromCRLCache
_TEXT ENDS
PUBLIC ?EnterCRLIntoCRLCache@CRLCache@@QAEXPAU_CRYPTOAPI_BLOB@@PAU_DS_DATA_BLOB@@PAU_GLOBAL_SIG@@@Z ; CRLCache::EnterCRLIntoCRLCache
; Function compile flags: /Odt /RTCsu
_TEXT SEGMENT
_this$ = -4 ; size = 4
_certIssuer$ = 8 ; size = 4
_crlDataBlob$ = 12 ; size = 4
_SigHandle$ = 16 ; size = 4
?EnterCRLIntoCRLCache@CRLCache@@QAEXPAU_CRYPTOAPI_BLOB@@PAU_DS_DATA_BLOB@@PAU_GLOBAL_SIG@@@Z PROC NEAR ; CRLCache::EnterCRLIntoCRLCache
; _this$ = ecx
; 254 : {
push ebp
mov ebp, esp
push ecx
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov DWORD PTR _this$[ebp], ecx
; 255 : #ifdef NSS
; 256 : #else
; 257 : PDS_DATA_BLOB *crlList=NULL;
; 258 : _ConnectionPtr spCON;
; 259 : PCERT_NAME_BLOB normCertName=NULL;
; 260 : BYTE *pbData=NULL;
; 261 : DWORD cbData=0;
; 262 : _variant_t recsAffected;
; 263 : recsAffected.vt = VT_ERROR;
; 264 : recsAffected.scode = DISP_E_PARAMNOTFOUND;
; 265 :
; 266 : if (CRLCacheInitialized == TRUE)
; 267 : {
; 268 : // Base64 encode the data
; 269 : cbData = base64encodeSize(crlDataBlob->cbData);
; 270 : // allocate memory
; 271 : if(!(pbData = (BYTE*)zMalloc(cbData+1)))
; 272 : {
; 273 : setError(SigHandle, MEMORY_FAULT);
; 274 : return;
; 275 : }
; 276 : if (base64encode(crlDataBlob->pbData,crlDataBlob->cbData,(unsigned char*)pbData,cbData+1)==-1) {
; 277 : setError(SigHandle, BASE64_ERROR);
; 278 : return;
; 279 : }
; 280 : *(pbData+cbData)='\0';
; 281 :
; 282 : normCertName = normalizeCertName(certIssuer);
; 283 : normCertName->pbData = (BYTE *) zRealloc(normCertName->pbData, normCertName->cbData + 1);
; 284 : *(normCertName->pbData + normCertName->cbData) = '\0';
; 285 : _bstr_t insertCRLCommand = CRLCache::insertCrlCommand + _bstr_t("('") +
; 286 : _bstr_t((LPCSTR)normCertName->pbData) + _bstr_t("','") +
; 287 : _bstr_t((LPCSTR)pbData) + _bstr_t("')");
; 288 : zFree(normCertName->pbData);
; 289 : zFree(normCertName);
; 290 : zFree(pbData);
; 291 :
; 292 : try{
; 293 : CREATEiNSTANCE(spCON,Connection);
; 294 : spCON->ConnectionString = SecureXMLDbConnectionString;
; 295 : spCON->Open( "", "", "", -1 );
; 296 : spCON->Execute(insertCRLCommand, &recsAffected, 0);
; 297 : spCON->Close();
; 298 : }
; 299 : catch( _com_error &e){
; 300 : _bstr_t bstrSource(e.Source());
; 301 : _bstr_t bs = _bstr_t(" Error: ") + _bstr_t(e.Error()) + _bstr_t(" Msg: ")
; 302 : + _bstr_t(e.ErrorMessage()) + _bstr_t(" Description: ")
; 303 : + _bstr_t(e.Description());
; 304 : CRLCacheInitialized = FALSE;
; 305 : char *errorDetail = (char *)bs;
; 306 : setErrorWithDescr(SigHandle, ADO_ERROR, (unsigned char *)errorDetail);
; 307 : }
; 308 : }
; 309 : //else
; 310 : // MessageBox(NULL, (LPCTSTR)"CRLCache not initialized", "CRLCache::EnterCRLIntoCRLCache", MB_OK);
; 311 : #endif
; 312 : }
mov esp, ebp
pop ebp
ret 12 ; 0000000cH
?EnterCRLIntoCRLCache@CRLCache@@QAEXPAU_CRYPTOAPI_BLOB@@PAU_DS_DATA_BLOB@@PAU_GLOBAL_SIG@@@Z ENDP ; CRLCache::EnterCRLIntoCRLCache
_TEXT ENDS
PUBLIC ?DeleteCRLFromCRLCache@CRLCache@@QAEXPAU_CRYPTOAPI_BLOB@@PAU_DS_DATA_BLOB@@PAU_GLOBAL_SIG@@@Z ; CRLCache::DeleteCRLFromCRLCache
; Function compile flags: /Odt /RTCsu
_TEXT SEGMENT
_this$ = -4 ; size = 4
_certIssuer$ = 8 ; size = 4
_crlDataBlob$ = 12 ; size = 4
_SigHandle$ = 16 ; size = 4
?DeleteCRLFromCRLCache@CRLCache@@QAEXPAU_CRYPTOAPI_BLOB@@PAU_DS_DATA_BLOB@@PAU_GLOBAL_SIG@@@Z PROC NEAR ; CRLCache::DeleteCRLFromCRLCache
; _this$ = ecx
; 317 : {
push ebp
mov ebp, esp
push ecx
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov DWORD PTR _this$[ebp], ecx
; 318 : #ifdef NSS
; 319 : #else
; 320 : PDS_DATA_BLOB *crlList=NULL;
; 321 : _ConnectionPtr spCON;
; 322 : _RecordsetPtr spRS;
; 323 : PCERT_NAME_BLOB normCertName=NULL;
; 324 : BYTE *pbData=NULL;
; 325 : DWORD cbData=0;
; 326 : _variant_t recsAffected;
; 327 : recsAffected.vt = VT_ERROR;
; 328 : recsAffected.scode = DISP_E_PARAMNOTFOUND;
; 329 :
; 330 : normCertName = normalizeCertName(certIssuer);
; 331 : normCertName->pbData = (BYTE *) zRealloc(normCertName->pbData, normCertName->cbData + 1);
; 332 : *(normCertName->pbData + normCertName->cbData) = '\0';
; 333 : _bstr_t deleteCRLCommand = CRLCache::deleteCrlCommand + _bstr_t("CertificateIssuer = '") +
; 334 : _bstr_t((LPCSTR)normCertName->pbData) + _bstr_t("'");
; 335 : zFree(normCertName->pbData);
; 336 : zFree(normCertName);
; 337 :
; 338 : if (CRLCacheInitialized == TRUE)
; 339 : {
; 340 : try{
; 341 : CREATEiNSTANCE(spCON,Connection);
; 342 : spCON->ConnectionString = SecureXMLDbConnectionString;
; 343 : spCON->Open( "", "", "", -1 );
; 344 : spCON->Execute(deleteCRLCommand, &recsAffected, 0);
; 345 : spCON->Close();
; 346 : }
; 347 : catch( _com_error &e){
; 348 : _bstr_t bstrSource(e.Source());
; 349 : _bstr_t bs = _bstr_t(" Error: ") + _bstr_t(e.Error()) + _bstr_t(" Msg: ")
; 350 : + _bstr_t(e.ErrorMessage()) + _bstr_t(" Description: ")
; 351 : + _bstr_t(e.Description());
; 352 : CRLCacheInitialized = FALSE;
; 353 : char *errorDetail = (char *)bs;
; 354 : setErrorWithDescr(SigHandle, ADO_ERROR, (unsigned char *)errorDetail);
; 355 : }
; 356 : }
; 357 : //else
; 358 : // MessageBox(NULL, (LPCTSTR)"CRLCache not initialized", "CRLCache::DeleteCRLFromCRLCache", MB_OK);
; 359 : #endif
; 360 : }
mov esp, ebp
pop ebp
ret 12 ; 0000000cH
?DeleteCRLFromCRLCache@CRLCache@@QAEXPAU_CRYPTOAPI_BLOB@@PAU_DS_DATA_BLOB@@PAU_GLOBAL_SIG@@@Z ENDP ; CRLCache::DeleteCRLFromCRLCache
_TEXT ENDS
PUBLIC ?Init@?$CW2AEX@$0IA@@ATL@@AAEXPBGI@Z ; ATL::CW2AEX<128>::Init
; Function compile flags: /Odt /RTCsu
; File c:\program files\microsoft visual studio .net 2003\vc7\atlmfc\include\atlconv.h
; COMDAT ??0?$CW2AEX@$0IA@@ATL@@QAE@PBG@Z
_TEXT SEGMENT
_this$ = -4 ; size = 4
_psz$ = 8 ; size = 4
??0?$CW2AEX@$0IA@@ATL@@QAE@PBG@Z PROC NEAR ; ATL::CW2AEX<128>::CW2AEX<128>, COMDAT
; _this$ = ecx
; 419 : {
push ebp
mov ebp, esp
push ecx
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov DWORD PTR _this$[ebp], ecx
mov eax, DWORD PTR _this$[ebp]
add eax, 4
mov ecx, DWORD PTR _this$[ebp]
mov DWORD PTR [ecx], eax
; 420 : Init( psz, _AtlGetConversionACP() );
call ?_AtlGetConversionACP@ATL@@YGIXZ ; ATL::_AtlGetConversionACP
push eax
mov edx, DWORD PTR _psz$[ebp]
push edx
mov ecx, DWORD PTR _this$[ebp]
call ?Init@?$CW2AEX@$0IA@@ATL@@AAEXPBGI@Z ; ATL::CW2AEX<128>::Init
; 421 : }
mov eax, DWORD PTR _this$[ebp]
add esp, 4
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 4
??0?$CW2AEX@$0IA@@ATL@@QAE@PBG@Z ENDP ; ATL::CW2AEX<128>::CW2AEX<128>
_TEXT ENDS
EXTRN _free:NEAR
; Function compile flags: /Odt /RTCsu
; COMDAT ??1?$CW2AEX@$0IA@@ATL@@QAE@XZ
_TEXT SEGMENT
_this$ = -4 ; size = 4
??1?$CW2AEX@$0IA@@ATL@@QAE@XZ PROC NEAR ; ATL::CW2AEX<128>::~CW2AEX<128>, COMDAT
; _this$ = ecx
; 428 : {
push ebp
mov ebp, esp
push ecx
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov DWORD PTR _this$[ebp], ecx
; 429 : if( m_psz != m_szBuffer )
mov eax, DWORD PTR _this$[ebp]
add eax, 4
mov ecx, DWORD PTR _this$[ebp]
cmp DWORD PTR [ecx], eax
je SHORT $L181595
; 430 : {
; 431 : free( m_psz );
mov edx, DWORD PTR _this$[ebp]
mov eax, DWORD PTR [edx]
push eax
call _free
add esp, 4
$L181595:
; 432 : }
; 433 : }
add esp, 4
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
??1?$CW2AEX@$0IA@@ATL@@QAE@XZ ENDP ; ATL::CW2AEX<128>::~CW2AEX<128>
; Function compile flags: /Odt /RTCsu
_TEXT ENDS
; COMDAT ??B?$CW2AEX@$0IA@@ATL@@QBEPADXZ
_TEXT SEGMENT
_this$ = -4 ; size = 4
??B?$CW2AEX@$0IA@@ATL@@QBEPADXZ PROC NEAR ; ATL::CW2AEX<128>::operator char *, COMDAT
; _this$ = ecx
; 436 : {
push ebp
mov ebp, esp
push ecx
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov DWORD PTR _this$[ebp], ecx
; 437 : return( m_psz );
mov eax, DWORD PTR _this$[ebp]
mov eax, DWORD PTR [eax]
; 438 : }
mov esp, ebp
pop ebp
ret 0
??B?$CW2AEX@$0IA@@ATL@@QBEPADXZ ENDP ; ATL::CW2AEX<128>::operator char *
_TEXT ENDS
PUBLIC ?AtlThrowLastWin32@ATL@@YGXXZ ; ATL::AtlThrowLastWin32
EXTRN _malloc:NEAR
; Function compile flags: /Odt /RTCsu
; COMDAT ?Init@?$CW2AEX@$0IA@@ATL@@AAEXPBGI@Z
_TEXT SEGMENT
_nLengthA$ = -12 ; size = 4
_nLengthW$ = -8 ; size = 4
_this$ = -4 ; size = 4
_psz$ = 8 ; size = 4
_nCodePage$ = 12 ; size = 4
?Init@?$CW2AEX@$0IA@@ATL@@AAEXPBGI@Z PROC NEAR ; ATL::CW2AEX<128>::Init, COMDAT
; _this$ = ecx
; 442 : {
push ebp
mov ebp, esp
sub esp, 12 ; 0000000cH
push esi
mov DWORD PTR [ebp-12], -858993460 ; ccccccccH
mov DWORD PTR [ebp-8], -858993460 ; ccccccccH
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov DWORD PTR _this$[ebp], ecx
; 443 : if (psz == NULL)
cmp DWORD PTR _psz$[ebp], 0
jne SHORT $L181640
; 444 : {
; 445 : m_psz = NULL;
mov eax, DWORD PTR _this$[ebp]
mov DWORD PTR [eax], 0
; 446 : return;
jmp $L182479
$L181640:
; 447 : }
; 448 : int nLengthW = lstrlenW( psz )+1;
mov esi, esp
mov ecx, DWORD PTR _psz$[ebp]
push ecx
call DWORD PTR __imp__lstrlenW@4
cmp esi, esp
call __RTC_CheckEsp
add eax, 1
mov DWORD PTR _nLengthW$[ebp], eax
; 449 : int nLengthA = nLengthW*2;
mov edx, DWORD PTR _nLengthW$[ebp]
shl edx, 1
mov DWORD PTR _nLengthA$[ebp], edx
; 450 :
; 451 : if( nLengthA > t_nBufferLength )
cmp DWORD PTR _nLengthA$[ebp], 128 ; 00000080H
jle SHORT $L181643
; 452 : {
; 453 : m_psz = static_cast< LPSTR >( malloc( nLengthA*sizeof( char ) ) );
mov eax, DWORD PTR _nLengthA$[ebp]
push eax
call _malloc
add esp, 4
mov ecx, DWORD PTR _this$[ebp]
mov DWORD PTR [ecx], eax
; 454 : if (m_psz == NULL)
mov edx, DWORD PTR _this$[ebp]
cmp DWORD PTR [edx], 0
jne SHORT $L181643
; 455 : {
; 456 : AtlThrow( E_OUTOFMEMORY );
push -2147024882 ; 8007000eH
call ?AtlThrow@ATL@@YGXJ@Z ; ATL::AtlThrow
$L181643:
; 457 : }
; 458 : }
; 459 :
; 460 : if (::WideCharToMultiByte( nCodePage, 0, psz, nLengthW, m_psz, nLengthA, NULL, NULL ) == 0)
mov esi, esp
push 0
push 0
mov eax, DWORD PTR _nLengthA$[ebp]
push eax
mov ecx, DWORD PTR _this$[ebp]
mov edx, DWORD PTR [ecx]
push edx
mov eax, DWORD PTR _nLengthW$[ebp]
push eax
mov ecx, DWORD PTR _psz$[ebp]
push ecx
push 0
mov edx, DWORD PTR _nCodePage$[ebp]
push edx
call DWORD PTR __imp__WideCharToMultiByte@32
cmp esi, esp
call __RTC_CheckEsp
test eax, eax
jne SHORT $L182479
; 461 : {
; 462 : AtlThrowLastWin32();
call ?AtlThrowLastWin32@ATL@@YGXXZ ; ATL::AtlThrowLastWin32
$L182479:
; 463 : }
; 464 : }
pop esi
add esp, 12 ; 0000000cH
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 8
?Init@?$CW2AEX@$0IA@@ATL@@AAEXPBGI@Z ENDP ; ATL::CW2AEX<128>::Init
_TEXT ENDS
EXTRN __imp__GetLastError@0:NEAR
; Function compile flags: /Odt /RTCsu
; File c:\program files\microsoft visual studio .net 2003\vc7\atlmfc\include\atlexcept.h
; COMDAT ?AtlThrowLastWin32@ATL@@YGXXZ
_TEXT SEGMENT
tv69 = -8 ; size = 4
_dwError$ = -4 ; size = 4
?AtlThrowLastWin32@ATL@@YGXXZ PROC NEAR ; ATL::AtlThrowLastWin32, COMDAT
; 80 : {
push ebp
mov ebp, esp
sub esp, 8
push esi
mov DWORD PTR [ebp-8], -858993460 ; ccccccccH
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
; 81 : DWORD dwError = ::GetLastError();
mov esi, esp
call DWORD PTR __imp__GetLastError@0
cmp esi, esp
call __RTC_CheckEsp
mov DWORD PTR _dwError$[ebp], eax
; 82 : AtlThrow( HRESULT_FROM_WIN32( dwError ) );
cmp DWORD PTR _dwError$[ebp], 0
jg SHORT $L182482
mov eax, DWORD PTR _dwError$[ebp]
mov DWORD PTR tv69[ebp], eax
jmp SHORT $L182483
$L182482:
mov ecx, DWORD PTR _dwError$[ebp]
and ecx, 65535 ; 0000ffffH
or ecx, 458752 ; 00070000H
or ecx, -2147483648 ; 80000000H
mov DWORD PTR tv69[ebp], ecx
$L182483:
mov edx, DWORD PTR tv69[ebp]
push edx
call ?AtlThrow@ATL@@YGXJ@Z ; ATL::AtlThrow
$L182481:
; 83 : }
pop esi
add esp, 8
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
?AtlThrowLastWin32@ATL@@YGXXZ ENDP ; ATL::AtlThrowLastWin32
; Function compile flags: /Odt /RTCsu
; File c:\program files\microsoft visual studio .net 2003\vc7\atlmfc\include\atlalloc.h
_TEXT ENDS
; COMDAT ??0?$CAtlSafeAllocBufferManager@VCCRTAllocator@ATL@@@_ATL_SAFE_ALLOCA_IMPL@ATL@@QAE@XZ
_TEXT SEGMENT
_this$ = -4 ; size = 4
??0?$CAtlSafeAllocBufferManager@VCCRTAllocator@ATL@@@_ATL_SAFE_ALLOCA_IMPL@ATL@@QAE@XZ PROC NEAR ; ATL::_ATL_SAFE_ALLOCA_IMPL::CAtlSafeAllocBufferManager<ATL::CCRTAllocator>::CAtlSafeAllocBufferManager<ATL::CCRTAllocator>, COMDAT
; _this$ = ecx
; 373 : CAtlSafeAllocBufferManager() : m_pHead(NULL) {};
push ebp
mov ebp, esp
push ecx
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov DWORD PTR _this$[ebp], ecx
mov eax, DWORD PTR _this$[ebp]
mov DWORD PTR [eax], 0
mov eax, DWORD PTR _this$[ebp]
mov esp, ebp
pop ebp
ret 0
??0?$CAtlSafeAllocBufferManager@VCCRTAllocator@ATL@@@_ATL_SAFE_ALLOCA_IMPL@ATL@@QAE@XZ ENDP ; ATL::_ATL_SAFE_ALLOCA_IMPL::CAtlSafeAllocBufferManager<ATL::CCRTAllocator>::CAtlSafeAllocBufferManager<ATL::CCRTAllocator>
_TEXT ENDS
PUBLIC ?Allocate@CCRTAllocator@ATL@@SAPAXI@Z ; ATL::CCRTAllocator::Allocate
PUBLIC ?GetData@CAtlSafeAllocBufferNode@?$CAtlSafeAllocBufferManager@VCCRTAllocator@ATL@@@_ATL_SAFE_ALLOCA_IMPL@ATL@@QAEPAXXZ ; ATL::_ATL_SAFE_ALLOCA_IMPL::CAtlSafeAllocBufferManager<ATL::CCRTAllocator>::CAtlSafeAllocBufferNode::GetData
; Function compile flags: /Odt /RTCsu
; COMDAT ?Allocate@?$CAtlSafeAllocBufferManager@VCCRTAllocator@ATL@@@_ATL_SAFE_ALLOCA_IMPL@ATL@@QAEPAXK@Z
_TEXT SEGMENT
_p$ = -8 ; size = 4
_this$ = -4 ; size = 4
_nRequestedSize$ = 8 ; size = 4
?Allocate@?$CAtlSafeAllocBufferManager@VCCRTAllocator@ATL@@@_ATL_SAFE_ALLOCA_IMPL@ATL@@QAEPAXK@Z PROC NEAR ; ATL::_ATL_SAFE_ALLOCA_IMPL::CAtlSafeAllocBufferManager<ATL::CCRTAllocator>::Allocate, COMDAT
; _this$ = ecx
; 375 : {
push ebp
mov ebp, esp
sub esp, 8
mov DWORD PTR [ebp-8], -858993460 ; ccccccccH
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov DWORD PTR _this$[ebp], ecx
; 376 : CAtlSafeAllocBufferNode *p = (CAtlSafeAllocBufferNode*)Allocator::Allocate(nRequestedSize + sizeof(CAtlSafeAllocBufferNode));
mov eax, DWORD PTR _nRequestedSize$[ebp]
add eax, 8
push eax
call ?Allocate@CCRTAllocator@ATL@@SAPAXI@Z ; ATL::CCRTAllocator::Allocate
add esp, 4
mov DWORD PTR _p$[ebp], eax
; 377 : if (p == NULL)
cmp DWORD PTR _p$[ebp], 0
jne SHORT $L159703
; 378 : return NULL;
xor eax, eax
jmp SHORT $L159690
$L159703:
; 379 :
; 380 : // Add buffer to the list
; 381 : p->m_pNext = m_pHead;
mov ecx, DWORD PTR _p$[ebp]
mov edx, DWORD PTR _this$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR [ecx], eax
; 382 : m_pHead = p;
mov ecx, DWORD PTR _this$[ebp]
mov edx, DWORD PTR _p$[ebp]
mov DWORD PTR [ecx], edx
; 383 :
; 384 : return p->GetData();
mov ecx, DWORD PTR _p$[ebp]
call ?GetData@CAtlSafeAllocBufferNode@?$CAtlSafeAllocBufferManager@VCCRTAllocator@ATL@@@_ATL_SAFE_ALLOCA_IMPL@ATL@@QAEPAXXZ ; ATL::_ATL_SAFE_ALLOCA_IMPL::CAtlSafeAllocBufferManager<ATL::CCRTAllocator>::CAtlSafeAllocBufferNode::GetData
$L159690:
; 385 : }
add esp, 8
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 4
?Allocate@?$CAtlSafeAllocBufferManager@VCCRTAllocator@ATL@@@_ATL_SAFE_ALLOCA_IMPL@ATL@@QAEPAXK@Z ENDP ; ATL::_ATL_SAFE_ALLOCA_IMPL::CAtlSafeAllocBufferManager<ATL::CCRTAllocator>::Allocate
; Function compile flags: /Odt /RTCsu
_TEXT ENDS
; COMDAT ?Allocate@CCRTAllocator@ATL@@SAPAXI@Z
_TEXT SEGMENT
_nBytes$ = 8 ; size = 4
?Allocate@CCRTAllocator@ATL@@SAPAXI@Z PROC NEAR ; ATL::CCRTAllocator::Allocate, COMDAT
; 30 : {
push ebp
mov ebp, esp
; 31 : return malloc(nBytes);
mov eax, DWORD PTR _nBytes$[ebp]
push eax
call _malloc
add esp, 4
; 32 : }
cmp ebp, esp
call __RTC_CheckEsp
pop ebp
ret 0
?Allocate@CCRTAllocator@ATL@@SAPAXI@Z ENDP ; ATL::CCRTAllocator::Allocate
_TEXT ENDS
PUBLIC ?Free@CCRTAllocator@ATL@@SAXPAX@Z ; ATL::CCRTAllocator::Free
; Function compile flags: /Odt /RTCsu
; COMDAT ??1?$CAtlSafeAllocBufferManager@VCCRTAllocator@ATL@@@_ATL_SAFE_ALLOCA_IMPL@ATL@@QAE@XZ
_TEXT SEGMENT
_p$159709 = -8 ; size = 4
_this$ = -4 ; size = 4
??1?$CAtlSafeAllocBufferManager@VCCRTAllocator@ATL@@@_ATL_SAFE_ALLOCA_IMPL@ATL@@QAE@XZ PROC NEAR ; ATL::_ATL_SAFE_ALLOCA_IMPL::CAtlSafeAllocBufferManager<ATL::CCRTAllocator>::~CAtlSafeAllocBufferManager<ATL::CCRTAllocator>, COMDAT
; _this$ = ecx
; 387 : {
push ebp
mov ebp, esp
sub esp, 8
mov DWORD PTR [ebp-8], -858993460 ; ccccccccH
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov DWORD PTR _this$[ebp], ecx
$L159707:
; 388 : // Walk the list and free the buffers
; 389 : while (m_pHead != NULL)
mov eax, DWORD PTR _this$[ebp]
cmp DWORD PTR [eax], 0
je SHORT $L159705
; 390 : {
; 391 : CAtlSafeAllocBufferNode* p = m_pHead;
mov ecx, DWORD PTR _this$[ebp]
mov edx, DWORD PTR [ecx]
mov DWORD PTR _p$159709[ebp], edx
; 392 : m_pHead = m_pHead->m_pNext;
mov eax, DWORD PTR _this$[ebp]
mov ecx, DWORD PTR [eax]
mov edx, DWORD PTR _this$[ebp]
mov eax, DWORD PTR [ecx]
mov DWORD PTR [edx], eax
; 393 : Allocator::Free(p);
mov ecx, DWORD PTR _p$159709[ebp]
push ecx
call ?Free@CCRTAllocator@ATL@@SAXPAX@Z ; ATL::CCRTAllocator::Free
add esp, 4
; 394 : }
jmp SHORT $L159707
$L159705:
; 395 : }
add esp, 8
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
??1?$CAtlSafeAllocBufferManager@VCCRTAllocator@ATL@@@_ATL_SAFE_ALLOCA_IMPL@ATL@@QAE@XZ ENDP ; ATL::_ATL_SAFE_ALLOCA_IMPL::CAtlSafeAllocBufferManager<ATL::CCRTAllocator>::~CAtlSafeAllocBufferManager<ATL::CCRTAllocator>
; Function compile flags: /Odt /RTCsu
_TEXT ENDS
; COMDAT ?Free@CCRTAllocator@ATL@@SAXPAX@Z
_TEXT SEGMENT
_p$ = 8 ; size = 4
?Free@CCRTAllocator@ATL@@SAXPAX@Z PROC NEAR ; ATL::CCRTAllocator::Free, COMDAT
; 35 : {
push ebp
mov ebp, esp
; 36 : free(p);
mov eax, DWORD PTR _p$[ebp]
push eax
call _free
add esp, 4
; 37 : }
cmp ebp, esp
call __RTC_CheckEsp
pop ebp
ret 0
?Free@CCRTAllocator@ATL@@SAXPAX@Z ENDP ; ATL::CCRTAllocator::Free
; Function compile flags: /Odt /RTCsu
_TEXT ENDS
; COMDAT ??0?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QAE@XZ
_TEXT SEGMENT
_this$ = -4 ; size = 4
??0?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QAE@XZ PROC NEAR ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::CTempBuffer<char,128,ATL::CCRTAllocator>, COMDAT
; _this$ = ecx
; 216 : {
push ebp
mov ebp, esp
push ecx
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov DWORD PTR _this$[ebp], ecx
mov eax, DWORD PTR _this$[ebp]
mov DWORD PTR [eax], 0
; 217 : }
mov eax, DWORD PTR _this$[ebp]
mov esp, ebp
pop ebp
ret 0
??0?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QAE@XZ ENDP ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::CTempBuffer<char,128,ATL::CCRTAllocator>
_TEXT ENDS
PUBLIC ?FreeHeap@?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@AAEXXZ ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::FreeHeap
; Function compile flags: /Odt /RTCsu
; COMDAT ??1?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QAE@XZ
_TEXT SEGMENT
_this$ = -4 ; size = 4
??1?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QAE@XZ PROC NEAR ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::~CTempBuffer<char,128,ATL::CCRTAllocator>, COMDAT
; _this$ = ecx
; 225 : {
push ebp
mov ebp, esp
push ecx
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov DWORD PTR _this$[ebp], ecx
; 226 : if( m_p != reinterpret_cast< T* >( m_abFixedBuffer ) )
mov eax, DWORD PTR _this$[ebp]
add eax, 4
mov ecx, DWORD PTR _this$[ebp]
cmp DWORD PTR [ecx], eax
je SHORT $L159763
; 227 : {
; 228 : FreeHeap();
mov ecx, DWORD PTR _this$[ebp]
call ?FreeHeap@?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@AAEXXZ ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::FreeHeap
$L159763:
; 229 : }
; 230 : }
add esp, 4
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
??1?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QAE@XZ ENDP ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::~CTempBuffer<char,128,ATL::CCRTAllocator>
; Function compile flags: /Odt /RTCsu
_TEXT ENDS
; COMDAT ??B?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QBEPADXZ
_TEXT SEGMENT
_this$ = -4 ; size = 4
??B?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QBEPADXZ PROC NEAR ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::operator char *, COMDAT
; _this$ = ecx
; 233 : {
push ebp
mov ebp, esp
push ecx
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov DWORD PTR _this$[ebp], ecx
; 234 : return( m_p );
mov eax, DWORD PTR _this$[ebp]
mov eax, DWORD PTR [eax]
; 235 : }
mov esp, ebp
pop ebp
ret 0
??B?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QBEPADXZ ENDP ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::operator char *
_TEXT ENDS
PUBLIC ?AllocateBytes@?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QAEPADI@Z ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::AllocateBytes
; Function compile flags: /Odt /RTCsu
; COMDAT ?Allocate@?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QAEPADI@Z
_TEXT SEGMENT
_this$ = -4 ; size = 4
_nElements$ = 8 ; size = 4
?Allocate@?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QAEPADI@Z PROC NEAR ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::Allocate, COMDAT
; _this$ = ecx
; 243 : {
push ebp
mov ebp, esp
push ecx
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov DWORD PTR _this$[ebp], ecx
; 244 : return( AllocateBytes( nElements*sizeof( T ) ) );
mov eax, DWORD PTR _nElements$[ebp]
push eax
mov ecx, DWORD PTR _this$[ebp]
call ?AllocateBytes@?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QAEPADI@Z ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::AllocateBytes
; 245 : }
add esp, 4
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 4
?Allocate@?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QAEPADI@Z ENDP ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::Allocate
_TEXT ENDS
PUBLIC ??_C@_08GPODJFIN@m_p?5?$DN?$DN?50?$AA@ ; `string'
PUBLIC ??_C@_0FB@IAFJMJBP@C?3?2Program?5Files?2Microsoft?5Visua@ ; `string'
PUBLIC ?AllocateHeap@?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@AAEXI@Z ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::AllocateHeap
; COMDAT ??_C@_08GPODJFIN@m_p?5?$DN?$DN?50?$AA@
CONST SEGMENT
??_C@_08GPODJFIN@m_p?5?$DN?$DN?50?$AA@ DB 'm_p == 0', 00H ; `string'
CONST ENDS
; COMDAT ??_C@_0FB@IAFJMJBP@C?3?2Program?5Files?2Microsoft?5Visua@
CONST SEGMENT
??_C@_0FB@IAFJMJBP@C?3?2Program?5Files?2Microsoft?5Visua@ DB 'C:\Program '
DB 'Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\at'
DB 'lalloc.h', 00H ; `string'
; Function compile flags: /Odt /RTCsu
CONST ENDS
; COMDAT ?AllocateBytes@?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QAEPADI@Z
_TEXT SEGMENT
_this$ = -4 ; size = 4
_nBytes$ = 8 ; size = 4
?AllocateBytes@?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QAEPADI@Z PROC NEAR ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::AllocateBytes, COMDAT
; _this$ = ecx
; 276 : {
push ebp
mov ebp, esp
push ecx
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov DWORD PTR _this$[ebp], ecx
; 277 : ATLASSERT( m_p == NULL );
mov eax, DWORD PTR _this$[ebp]
cmp DWORD PTR [eax], 0
je SHORT $L182504
push OFFSET FLAT:??_C@_08GPODJFIN@m_p?5?$DN?$DN?50?$AA@
push 0
push 277 ; 00000115H
push OFFSET FLAT:??_C@_0FB@IAFJMJBP@C?3?2Program?5Files?2Microsoft?5Visua@
push 2
call __CrtDbgReport
add esp, 20 ; 00000014H
cmp eax, 1
jne SHORT $L182504
int 3
$L182504:
; 278 : if( nBytes > t_nFixedBytes )
cmp DWORD PTR _nBytes$[ebp], 128 ; 00000080H
jbe SHORT $L160415
; 279 : {
; 280 : AllocateHeap( nBytes );
mov edx, DWORD PTR _nBytes$[ebp]
push edx
mov ecx, DWORD PTR _this$[ebp]
call ?AllocateHeap@?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@AAEXI@Z ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::AllocateHeap
; 281 : }
; 282 : else
jmp SHORT $L160416
$L160415:
; 283 : {
; 284 : m_p = reinterpret_cast< T* >( m_abFixedBuffer );
mov eax, DWORD PTR _this$[ebp]
add eax, 4
mov ecx, DWORD PTR _this$[ebp]
mov DWORD PTR [ecx], eax
$L160416:
; 285 : }
; 286 :
; 287 : return( m_p );
mov edx, DWORD PTR _this$[ebp]
mov eax, DWORD PTR [edx]
; 288 : }
add esp, 4
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 4
?AllocateBytes@?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QAEPADI@Z ENDP ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::AllocateBytes
; Function compile flags: /Odt /RTCsu
_TEXT ENDS
; COMDAT ?FreeHeap@?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@AAEXXZ
_TEXT SEGMENT
_this$ = -4 ; size = 4
?FreeHeap@?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@AAEXXZ PROC NEAR ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::FreeHeap, COMDAT
; _this$ = ecx
; 312 : {
push ebp
mov ebp, esp
push ecx
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov DWORD PTR _this$[ebp], ecx
; 313 : Allocator::Free( m_p );
mov eax, DWORD PTR _this$[ebp]
mov ecx, DWORD PTR [eax]
push ecx
call ?Free@CCRTAllocator@ATL@@SAXPAX@Z ; ATL::CCRTAllocator::Free
add esp, 4
; 314 : }
add esp, 4
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
?FreeHeap@?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@AAEXXZ ENDP ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::FreeHeap
; Function compile flags: /Odt /RTCsu
_TEXT ENDS
; COMDAT ?GetData@CAtlSafeAllocBufferNode@?$CAtlSafeAllocBufferManager@VCCRTAllocator@ATL@@@_ATL_SAFE_ALLOCA_IMPL@ATL@@QAEPAXXZ
_TEXT SEGMENT
_this$ = -4 ; size = 4
?GetData@CAtlSafeAllocBufferNode@?$CAtlSafeAllocBufferManager@VCCRTAllocator@ATL@@@_ATL_SAFE_ALLOCA_IMPL@ATL@@QAEPAXXZ PROC NEAR ; ATL::_ATL_SAFE_ALLOCA_IMPL::CAtlSafeAllocBufferManager<ATL::CCRTAllocator>::CAtlSafeAllocBufferNode::GetData, COMDAT
; _this$ = ecx
; 365 : {
push ebp
mov ebp, esp
push ecx
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov DWORD PTR _this$[ebp], ecx
; 366 : return (this + 1);
mov eax, DWORD PTR _this$[ebp]
add eax, 8
; 367 : }
mov esp, ebp
pop ebp
ret 0
?GetData@CAtlSafeAllocBufferNode@?$CAtlSafeAllocBufferManager@VCCRTAllocator@ATL@@@_ATL_SAFE_ALLOCA_IMPL@ATL@@QAEPAXXZ ENDP ; ATL::_ATL_SAFE_ALLOCA_IMPL::CAtlSafeAllocBufferManager<ATL::CCRTAllocator>::CAtlSafeAllocBufferNode::GetData
; Function compile flags: /Odt /RTCsu
_TEXT ENDS
; COMDAT ?AllocateHeap@?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@AAEXI@Z
_TEXT SEGMENT
_p$ = -8 ; size = 4
_this$ = -4 ; size = 4
_nBytes$ = 8 ; size = 4
?AllocateHeap@?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@AAEXI@Z PROC NEAR ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::AllocateHeap, COMDAT
; _this$ = ecx
; 292 : {
push ebp
mov ebp, esp
sub esp, 8
mov DWORD PTR [ebp-8], -858993460 ; ccccccccH
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov DWORD PTR _this$[ebp], ecx
; 293 : T* p = static_cast< T* >( Allocator::Allocate( nBytes ) );
mov eax, DWORD PTR _nBytes$[ebp]
push eax
call ?Allocate@CCRTAllocator@ATL@@SAPAXI@Z ; ATL::CCRTAllocator::Allocate
add esp, 4
mov DWORD PTR _p$[ebp], eax
; 294 : if( p == NULL )
cmp DWORD PTR _p$[ebp], 0
jne SHORT $L160603
; 295 : {
; 296 : AtlThrow( E_OUTOFMEMORY );
push -2147024882 ; 8007000eH
call ?AtlThrow@ATL@@YGXJ@Z ; ATL::AtlThrow
$L160603:
; 297 : }
; 298 : m_p = p;
mov ecx, DWORD PTR _this$[ebp]
mov edx, DWORD PTR _p$[ebp]
mov DWORD PTR [ecx], edx
$L182510:
; 299 : }
add esp, 8
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 4
?AllocateHeap@?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@AAEXI@Z ENDP ; ATL::CTempBuffer<char,128,ATL::CCRTAllocator>::AllocateHeap
_TEXT ENDS
PUBLIC ??0CAtlWinModule@ATL@@QAE@XZ ; ATL::CAtlWinModule::CAtlWinModule
EXTRN _atexit:NEAR
; COMDAT CRT$XCU
; File c:\program files\microsoft visual studio .net 2003\vc7\atlmfc\include\atlbase.h
CRT$XCU SEGMENT
_$S3 DD FLAT:_$E1
; Function compile flags: /Odt /RTCsu
CRT$XCU ENDS
; COMDAT _$E1
text$yc SEGMENT
_$E1 PROC NEAR ; COMDAT
; 2602 : __declspec(selectany) CAtlWinModule _AtlWinModule;
push ebp
mov ebp, esp
mov ecx, OFFSET FLAT:?_AtlWinModule@ATL@@3VCAtlWinModule@1@A
call ??0CAtlWinModule@ATL@@QAE@XZ ; ATL::CAtlWinModule::CAtlWinModule
push OFFSET FLAT:_$E2
call _atexit
add esp, 4
cmp ebp, esp
call __RTC_CheckEsp
pop ebp
ret 0
_$E1 ENDP
text$yc ENDS
PUBLIC ??0_ATL_WIN_MODULE70@ATL@@QAE@XZ ; ATL::_ATL_WIN_MODULE70::_ATL_WIN_MODULE70
EXTRN __imp__AtlWinModuleInit@4:NEAR
; Function compile flags: /Odt /RTCsu
; COMDAT ??0CAtlWinModule@ATL@@QAE@XZ
_TEXT SEGMENT
_hr$ = -8 ; size = 4
_this$ = -4 ; size = 4
??0CAtlWinModule@ATL@@QAE@XZ PROC NEAR ; ATL::CAtlWinModule::CAtlWinModule, COMDAT
; _this$ = ecx
; 2573 : CAtlWinModule()
push ebp
mov ebp, esp
sub esp, 8
push esi
mov DWORD PTR [ebp-8], -858993460 ; ccccccccH
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov DWORD PTR _this$[ebp], ecx
mov ecx, DWORD PTR _this$[ebp]
call ??0_ATL_WIN_MODULE70@ATL@@QAE@XZ
; 2574 : {
; 2575 : cbSize = sizeof(_ATL_WIN_MODULE);
mov eax, DWORD PTR _this$[ebp]
mov DWORD PTR [eax], 44 ; 0000002cH
; 2576 : HRESULT hr = AtlWinModuleInit(this);
mov esi, esp
mov ecx, DWORD PTR _this$[ebp]
push ecx
call DWORD PTR __imp__AtlWinModuleInit@4
cmp esi, esp
call __RTC_CheckEsp
mov DWORD PTR _hr$[ebp], eax
; 2577 : if (FAILED(hr))
cmp DWORD PTR _hr$[ebp], 0
jge SHORT $L88081
; 2578 : CAtlBaseModule::m_bInitFailed = true;
mov BYTE PTR ?m_bInitFailed@CAtlBaseModule@ATL@@2_NA, 1 ; ATL::CAtlBaseModule::m_bInitFailed
$L88081:
; 2579 : }
mov eax, DWORD PTR _this$[ebp]
pop esi
add esp, 8
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
??0CAtlWinModule@ATL@@QAE@XZ ENDP ; ATL::CAtlWinModule::CAtlWinModule
_TEXT ENDS
PUBLIC ??0CComCriticalSection@ATL@@QAE@XZ ; ATL::CComCriticalSection::CComCriticalSection
PUBLIC ??0?$CSimpleArray@GV?$CSimpleArrayEqualHelper@G@ATL@@@ATL@@QAE@XZ ; ATL::CSimpleArray<unsigned short,ATL::CSimpleArrayEqualHelper<unsigned short> >::CSimpleArray<unsigned short,ATL::CSimpleArrayEqualHelper<unsigned short> >
; Function compile flags: /Odt /RTCsu
; COMDAT ??0_ATL_WIN_MODULE70@ATL@@QAE@XZ
_TEXT SEGMENT
_this$ = -4 ; size = 4
??0_ATL_WIN_MODULE70@ATL@@QAE@XZ PROC NEAR ; ATL::_ATL_WIN_MODULE70::_ATL_WIN_MODULE70, COMDAT
; _this$ = ecx
push ebp
mov ebp, esp
push ecx
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov DWORD PTR _this$[ebp], ecx
mov ecx, DWORD PTR _this$[ebp]
add ecx, 4
call ??0CComCriticalSection@ATL@@QAE@XZ ; ATL::CComCriticalSection::CComCriticalSection
mov ecx, DWORD PTR _this$[ebp]
add ecx, 32 ; 00000020H
call ??0?$CSimpleArray@GV?$CSimpleArrayEqualHelper@G@ATL@@@ATL@@QAE@XZ ; ATL::CSimpleArray<unsigned short,ATL::CSimpleArrayEqualHelper<unsigned short> >::CSimpleArray<unsigned short,ATL::CSimpleArrayEqualHelper<unsigned short> >
mov eax, DWORD PTR _this$[ebp]
add esp, 4
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
??0_ATL_WIN_MODULE70@ATL@@QAE@XZ ENDP ; ATL::_ATL_WIN_MODULE70::_ATL_WIN_MODULE70
_TEXT ENDS
EXTRN _memset:NEAR
; Function compile flags: /Odt /RTCsu
; File c:\program files\microsoft visual studio .net 2003\vc7\atlmfc\include\atlcore.h
; COMDAT ??0CComCriticalSection@ATL@@QAE@XZ
_TEXT SEGMENT
_this$ = -4 ; size = 4
??0CComCriticalSection@ATL@@QAE@XZ PROC NEAR ; ATL::CComCriticalSection::CComCriticalSection, COMDAT
; _this$ = ecx
; 114 : CComCriticalSection() throw()
push ebp
mov ebp, esp
push ecx
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov DWORD PTR _this$[ebp], ecx
; 115 : {
; 116 : memset(&m_sec, 0, sizeof(CRITICAL_SECTION));
push 24 ; 00000018H
push 0
mov eax, DWORD PTR _this$[ebp]
push eax
call _memset
add esp, 12 ; 0000000cH
; 117 : }
mov eax, DWORD PTR _this$[ebp]
add esp, 4
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
??0CComCriticalSection@ATL@@QAE@XZ ENDP ; ATL::CComCriticalSection::CComCriticalSection
; Function compile flags: /Odt /RTCsu
; File c:\program files\microsoft visual studio .net 2003\vc7\atlmfc\include\atlsimpcoll.h
_TEXT ENDS
; COMDAT ??0?$CSimpleArray@GV?$CSimpleArrayEqualHelper@G@ATL@@@ATL@@QAE@XZ
_TEXT SEGMENT
_this$ = -4 ; size = 4
??0?$CSimpleArray@GV?$CSimpleArrayEqualHelper@G@ATL@@@ATL@@QAE@XZ PROC NEAR ; ATL::CSimpleArray<unsigned short,ATL::CSimpleArrayEqualHelper<unsigned short> >::CSimpleArray<unsigned short,ATL::CSimpleArrayEqualHelper<unsigned short> >, COMDAT
; _this$ = ecx
; 97 : { }
push ebp
mov ebp, esp
push ecx
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov DWORD PTR _this$[ebp], ecx
mov eax, DWORD PTR _this$[ebp]
mov DWORD PTR [eax], 0
mov ecx, DWORD PTR _this$[ebp]
mov DWORD PTR [ecx+4], 0
mov edx, DWORD PTR _this$[ebp]
mov DWORD PTR [edx+8], 0
mov eax, DWORD PTR _this$[ebp]
mov esp, ebp
pop ebp
ret 0
??0?$CSimpleArray@GV?$CSimpleArrayEqualHelper@G@ATL@@@ATL@@QAE@XZ ENDP ; ATL::CSimpleArray<unsigned short,ATL::CSimpleArrayEqualHelper<unsigned short> >::CSimpleArray<unsigned short,ATL::CSimpleArrayEqualHelper<unsigned short> >
_TEXT ENDS
PUBLIC ??1CAtlWinModule@ATL@@QAE@XZ ; ATL::CAtlWinModule::~CAtlWinModule
; Function compile flags: /Odt /RTCsu
; COMDAT _$E2
text$yd SEGMENT
_$E2 PROC NEAR ; COMDAT
push ebp
mov ebp, esp
mov ecx, OFFSET FLAT:?_AtlWinModule@ATL@@3VCAtlWinModule@1@A
call ??1CAtlWinModule@ATL@@QAE@XZ ; ATL::CAtlWinModule::~CAtlWinModule
cmp ebp, esp
call __RTC_CheckEsp
pop ebp
ret 0
_$E2 ENDP
text$yd ENDS
PUBLIC ?Term@CAtlWinModule@ATL@@QAEXXZ ; ATL::CAtlWinModule::Term
PUBLIC ??1_ATL_WIN_MODULE70@ATL@@QAE@XZ ; ATL::_ATL_WIN_MODULE70::~_ATL_WIN_MODULE70
; COMDAT xdata$x
; File c:\program files\microsoft visual studio .net 2003\vc7\atlmfc\include\atlbase.h
xdata$x SEGMENT
$T182531 DD 0ffffffffH
DD FLAT:$L182527
$T182529 DD 019930520H
DD 01H
DD FLAT:$T182531
DD 2 DUP(00H)
DD 2 DUP(00H)
; Function compile flags: /Odt /RTCsu
xdata$x ENDS
; COMDAT ??1CAtlWinModule@ATL@@QAE@XZ
_TEXT SEGMENT
_this$ = -16 ; size = 4
__$EHRec$ = -12 ; size = 12
??1CAtlWinModule@ATL@@QAE@XZ PROC NEAR ; ATL::CAtlWinModule::~CAtlWinModule, COMDAT
; _this$ = ecx
; 2582 : {
push ebp
mov ebp, esp
push -1
push __ehhandler$??1CAtlWinModule@ATL@@QAE@XZ
mov eax, DWORD PTR fs:__except_list
push eax
mov DWORD PTR fs:__except_list, esp
push ecx
mov DWORD PTR [ebp-16], -858993460 ; ccccccccH
mov DWORD PTR _this$[ebp], ecx
mov DWORD PTR __$EHRec$[ebp+8], 0
; 2583 : Term();
mov ecx, DWORD PTR _this$[ebp]
call ?Term@CAtlWinModule@ATL@@QAEXXZ ; ATL::CAtlWinModule::Term
; 2584 : }
mov DWORD PTR __$EHRec$[ebp+8], -1
mov ecx, DWORD PTR _this$[ebp]
call ??1_ATL_WIN_MODULE70@ATL@@QAE@XZ
mov ecx, DWORD PTR __$EHRec$[ebp]
mov DWORD PTR fs:__except_list, ecx
add esp, 16 ; 00000010H
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
_TEXT ENDS
; COMDAT text$x
text$x SEGMENT
$L182527:
mov ecx, DWORD PTR _this$[ebp]
jmp ??1_ATL_WIN_MODULE70@ATL@@QAE@XZ
__ehhandler$??1CAtlWinModule@ATL@@QAE@XZ:
mov eax, OFFSET FLAT:$T182529
jmp ___CxxFrameHandler
text$x ENDS
??1CAtlWinModule@ATL@@QAE@XZ ENDP ; ATL::CAtlWinModule::~CAtlWinModule
PUBLIC ?GetModuleInstance@CAtlBaseModule@ATL@@QAEPAUHINSTANCE__@@XZ ; ATL::CAtlBaseModule::GetModuleInstance
EXTRN ?_AtlBaseModule@ATL@@3VCAtlBaseModule@1@A:BYTE ; ATL::_AtlBaseModule
EXTRN __imp__AtlWinModuleTerm@8:NEAR
; Function compile flags: /Odt /RTCsu
; COMDAT ?Term@CAtlWinModule@ATL@@QAEXXZ
_TEXT SEGMENT
_this$ = -4 ; size = 4
?Term@CAtlWinModule@ATL@@QAEXXZ PROC NEAR ; ATL::CAtlWinModule::Term, COMDAT
; _this$ = ecx
; 2587 : {
push ebp
mov ebp, esp
push ecx
push esi
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov DWORD PTR _this$[ebp], ecx
; 2588 : AtlWinModuleTerm(this, _AtlBaseModule.GetModuleInstance());
mov ecx, OFFSET FLAT:?_AtlBaseModule@ATL@@3VCAtlBaseModule@1@A
call ?GetModuleInstance@CAtlBaseModule@ATL@@QAEPAUHINSTANCE__@@XZ ; ATL::CAtlBaseModule::GetModuleInstance
mov esi, esp
push eax
mov eax, DWORD PTR _this$[ebp]
push eax
call DWORD PTR __imp__AtlWinModuleTerm@8
cmp esi, esp
call __RTC_CheckEsp
; 2589 : }
pop esi
add esp, 4
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
?Term@CAtlWinModule@ATL@@QAEXXZ ENDP ; ATL::CAtlWinModule::Term
; Function compile flags: /Odt /RTCsu
; File c:\program files\microsoft visual studio .net 2003\vc7\atlmfc\include\atlcore.h
_TEXT ENDS
; COMDAT ?GetModuleInstance@CAtlBaseModule@ATL@@QAEPAUHINSTANCE__@@XZ
_TEXT SEGMENT
_this$ = -4 ; size = 4
?GetModuleInstance@CAtlBaseModule@ATL@@QAEPAUHINSTANCE__@@XZ PROC NEAR ; ATL::CAtlBaseModule::GetModuleInstance, COMDAT
; _this$ = ecx
; 206 : {
push ebp
mov ebp, esp
push ecx
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov DWORD PTR _this$[ebp], ecx
; 207 : return m_hInst;
mov eax, DWORD PTR _this$[ebp]
mov eax, DWORD PTR [eax+4]
; 208 : }
mov esp, ebp
pop ebp
ret 0
?GetModuleInstance@CAtlBaseModule@ATL@@QAEPAUHINSTANCE__@@XZ ENDP ; ATL::CAtlBaseModule::GetModuleInstance
_TEXT ENDS
PUBLIC ??1?$CSimpleArray@GV?$CSimpleArrayEqualHelper@G@ATL@@@ATL@@QAE@XZ ; ATL::CSimpleArray<unsigned short,ATL::CSimpleArrayEqualHelper<unsigned short> >::~CSimpleArray<unsigned short,ATL::CSimpleArrayEqualHelper<unsigned short> >
; Function compile flags: /Odt /RTCsu
; COMDAT ??1_ATL_WIN_MODULE70@ATL@@QAE@XZ
_TEXT SEGMENT
_this$ = -4 ; size = 4
??1_ATL_WIN_MODULE70@ATL@@QAE@XZ PROC NEAR ; ATL::_ATL_WIN_MODULE70::~_ATL_WIN_MODULE70, COMDAT
; _this$ = ecx
push ebp
mov ebp, esp
push ecx
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov DWORD PTR _this$[ebp], ecx
mov ecx, DWORD PTR _this$[ebp]
add ecx, 32 ; 00000020H
call ??1?$CSimpleArray@GV?$CSimpleArrayEqualHelper@G@ATL@@@ATL@@QAE@XZ ; ATL::CSimpleArray<unsigned short,ATL::CSimpleArrayEqualHelper<unsigned short> >::~CSimpleArray<unsigned short,ATL::CSimpleArrayEqualHelper<unsigned short> >
add esp, 4
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
??1_ATL_WIN_MODULE70@ATL@@QAE@XZ ENDP ; ATL::_ATL_WIN_MODULE70::~_ATL_WIN_MODULE70
_TEXT ENDS
PUBLIC ?RemoveAll@?$CSimpleArray@GV?$CSimpleArrayEqualHelper@G@ATL@@@ATL@@QAEXXZ ; ATL::CSimpleArray<unsigned short,ATL::CSimpleArrayEqualHelper<unsigned short> >::RemoveAll
; Function compile flags: /Odt /RTCsu
; File c:\program files\microsoft visual studio .net 2003\vc7\atlmfc\include\atlsimpcoll.h
; COMDAT ??1?$CSimpleArray@GV?$CSimpleArrayEqualHelper@G@ATL@@@ATL@@QAE@XZ
_TEXT SEGMENT
_this$ = -4 ; size = 4
??1?$CSimpleArray@GV?$CSimpleArrayEqualHelper@G@ATL@@@ATL@@QAE@XZ PROC NEAR ; ATL::CSimpleArray<unsigned short,ATL::CSimpleArrayEqualHelper<unsigned short> >::~CSimpleArray<unsigned short,ATL::CSimpleArrayEqualHelper<unsigned short> >, COMDAT
; _this$ = ecx
; 100 : {
push ebp
mov ebp, esp
push ecx
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov DWORD PTR _this$[ebp], ecx
; 101 : RemoveAll();
mov ecx, DWORD PTR _this$[ebp]
call ?RemoveAll@?$CSimpleArray@GV?$CSimpleArrayEqualHelper@G@ATL@@@ATL@@QAEXXZ ; ATL::CSimpleArray<unsigned short,ATL::CSimpleArrayEqualHelper<unsigned short> >::RemoveAll
; 102 : }
add esp, 4
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
??1?$CSimpleArray@GV?$CSimpleArrayEqualHelper@G@ATL@@@ATL@@QAE@XZ ENDP ; ATL::CSimpleArray<unsigned short,ATL::CSimpleArrayEqualHelper<unsigned short> >::~CSimpleArray<unsigned short,ATL::CSimpleArrayEqualHelper<unsigned short> >
; Function compile flags: /Odt /RTCsu
_TEXT ENDS
; COMDAT ?RemoveAll@?$CSimpleArray@GV?$CSimpleArrayEqualHelper@G@ATL@@@ATL@@QAEXXZ
_TEXT SEGMENT
_i$160433 = -8 ; size = 4
_this$ = -4 ; size = 4
?RemoveAll@?$CSimpleArray@GV?$CSimpleArrayEqualHelper@G@ATL@@@ATL@@QAEXXZ PROC NEAR ; ATL::CSimpleArray<unsigned short,ATL::CSimpleArrayEqualHelper<unsigned short> >::RemoveAll, COMDAT
; _this$ = ecx
; 173 : {
push ebp
mov ebp, esp
sub esp, 8
mov DWORD PTR [ebp-8], -858993460 ; ccccccccH
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov DWORD PTR _this$[ebp], ecx
; 174 : if(m_aT != NULL)
mov eax, DWORD PTR _this$[ebp]
cmp DWORD PTR [eax], 0
je SHORT $L160432
; 175 : {
; 176 : for(int i = 0; i < m_nSize; i++)
mov DWORD PTR _i$160433[ebp], 0
jmp SHORT $L160434
$L160435:
mov ecx, DWORD PTR _i$160433[ebp]
add ecx, 1
mov DWORD PTR _i$160433[ebp], ecx
$L160434:
mov edx, DWORD PTR _this$[ebp]
mov eax, DWORD PTR _i$160433[ebp]
cmp eax, DWORD PTR [edx+4]
jge SHORT $L160436
; 177 : m_aT[i].~T();
jmp SHORT $L160435
$L160436:
; 178 : free(m_aT);
mov ecx, DWORD PTR _this$[ebp]
mov edx, DWORD PTR [ecx]
push edx
call _free
add esp, 4
; 179 : m_aT = NULL;
mov eax, DWORD PTR _this$[ebp]
mov DWORD PTR [eax], 0
$L160432:
; 180 : }
; 181 : m_nSize = 0;
mov ecx, DWORD PTR _this$[ebp]
mov DWORD PTR [ecx+4], 0
; 182 : m_nAllocSize = 0;
mov edx, DWORD PTR _this$[ebp]
mov DWORD PTR [edx+8], 0
; 183 : }
add esp, 8
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
?RemoveAll@?$CSimpleArray@GV?$CSimpleArrayEqualHelper@G@ATL@@@ATL@@QAEXXZ ENDP ; ATL::CSimpleArray<unsigned short,ATL::CSimpleArrayEqualHelper<unsigned short> >::RemoveAll
_TEXT ENDS
PUBLIC ?_AtlWinModule@ATL@@3VCAtlWinModule@1@A ; ATL::_AtlWinModule
; COMDAT ?_AtlWinModule@ATL@@3VCAtlWinModule@1@A
_BSS SEGMENT
?_AtlWinModule@ATL@@3VCAtlWinModule@1@A DB 02cH DUP (?) ; ATL::_AtlWinModule
_BSS ENDS
END
| SrivastavaConsultingGroup/DigitalSignature | Xmlsign/nssdebug/CRLCache.asm | Assembly | mit | 183,852 |
section .data
hello: db 'Hello World!',10 ; Hello World with \n
helloLen: equ $-hello ; Length of hello World string
section .text
global _start
_start:
call _hello_world_endless
call _exit
_hello_world:
mov eax, 4 ; The syscall for write
mov ebx, 1 ; File descriptor 1 - stdout
mov ecx, hello ; put offset of hello to ecx
mov edx, helloLen ; set srin lenght. is allready a constant, so we ont need to do mov edx, [helloLen]
int 80h
ret
_hello_world_endless:
call _hello_world
call _hello_world_endless
ret
_exit:
mov eax, 1 ; Syscall for exit (sys_exit)
mov ebx, 0 ; rturn code 0
int 80h ; Call to the kernel (execute the syscall)
ret | kije/assembly_experiments | test3.asm | Assembly | bsd-3-clause | 710 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.