text
stringlengths
1
1.05M
; A337997: Triangle read by rows, generalized Eulerian polynomials evaluated at x = 1. ; Submitted by Simon Strandgaard ; 1,0,1,0,2,8,0,6,48,162,0,24,384,1944,6144,0,120,3840,29160,122880,375000,0,720,46080,524880,2949120,11250000,33592320,0,5040,645120,11022480,82575360,393750000,1410877440,4150656720 mov $2,1 lpb $0 add $1,1 sub $0,$1 mul $2,$1 lpe pow $0,$1 mul $2,$0 mov $0,$2
/*============================================================================== Copyright (c) 2002-2003 Joel de Guzman Copyright (c) 2006 Tobias Schwinger http://spirit.sourceforge.net/ Use, modification and distribution is subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ //------------------------------------------------------------------------------ // This example demonstrates how to make recursive grammars scale with typeof. // It uses a rule parser with member variables and the parser_reference utility. // See boost/spirit/include/rule_parser.hpp for details. // This example is based on subrule_calc.cpp. //------------------------------------------------------------------------------ #include <string> #include <iostream> #include <boost/config.hpp> #if defined(BOOST_MSVC) // Disable MSVC's "'this' used in base/member initializer" warning. // It's perfectly safe to use 'this' in a base/member initializer [ 12.6.2-7 ]. // The warning tries to prevent undefined behaviour when the 'this'-pointer is // used to do illegal things during construction [ 12.6.2-8 ] -- we don't. # pragma warning(disable:4355) #endif #include <boost/typeof/typeof.hpp> #include <boost/spirit/include/classic_core.hpp> #include <boost/spirit/include/classic_typeof.hpp> #include <boost/spirit/include/classic_rule_parser.hpp> // Don't forget to #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() using namespace BOOST_SPIRIT_CLASSIC_NS; // Semantic actions namespace { void do_int(int v) { std::cout << "PUSH(" << v << ')' << std::endl; } void do_add(char const*, char const*) { std::cout << "ADD" << std::endl; } void do_sub(char const*, char const*) { std::cout << "SUB" << std::endl; } void do_mul(char const*, char const*) { std::cout << "MUL" << std::endl; } void do_div(char const*, char const*) { std::cout << "DIV" << std::endl; } void do_neg(char const*, char const*) { std::cout << "NEG" << std::endl; } } // Operating at root namespace... #define BOOST_SPIRIT__NAMESPACE - // Our calculator grammar using paramterized rule parsers. // Subrules are passed to the rule parsers as arguments to allow recursion. BOOST_SPIRIT_RULE_PARSER(expression, (1,(term)), -, -, term >> *( ('+' >> term)[ &do_add ] | ('-' >> term)[ &do_sub ] ) ) BOOST_SPIRIT_RULE_PARSER(term, (1,(factor)), -, -, factor >> *( ('*' >> factor)[ &do_mul ] | ('/' >> factor)[ &do_div ] ) ) // This rule parser uses the 'parser_reference' utility to refer to itself. // Note that here is another recursive loop, however, the self-reference, unlike // a subrule, cannot be passed to contained parsers because we would end up with // an endless loop at compile time finding the type. BOOST_SPIRIT_RULE_PARSER(factor, (1,(expression)), -, (1,( ((parser_reference<factor_t>),factor,(*this)) )), ( int_p[& do_int] | ('(' >> expression >> ')') | ('-' >> factor)[&do_neg] | ('+' >> factor) ) ) // This rule parser implements recursion between the other ones. BOOST_SPIRIT_RULE_PARSER( calc, -, -, (3,( ((subrule<0>),sr_expression,()), ((subrule<1>),sr_term,()), ((subrule<2>),sr_factor,() )) ), ( sr_expression = expression(sr_term), sr_term = term(sr_factor), sr_factor = factor(sr_expression) ) ) // Main program int main() { std::cout << "/////////////////////////////////////////////////////////////\n" << "\t\tA ruleless calculator using rule parsers and subrules...\n" << "/////////////////////////////////////////////////////////////\n" << "Type an expression...or an empty line to quit\n" << std::endl; std::string str; while (std::getline(std::cin, str)) { if (str.empty()) break; parse_info<> info = parse(str.c_str(), calc, space_p); if (info.full) std::cout << "OK." << std::endl; else std::cout << "ERROR.\n" << "Stopped at: \": " << info.stop << "\".\n" << std::endl; } return 0; }
; base area SMSQ QXL Keyboard Tables section header xref kbd_base xref smsq_end include 'dev8_keys_qdos_sms' include 'dev8_keys_ldm' header_base dc.l kbd_base-header_base ; length of header dc.l 0 ; module length unknown dc.l smsq_end-kbd_base ; loaded length dc.l 0 ; checksum dc.l 0 ; no select dc.b 1 ; 1 level down dc.b 0 dc.w smsq_name-* smsq_name dc.w 24,'SMSQ Q40 Keyboard Tables' dc.l ' ' dc.w $200a end
*********************************************************** * * Card reader tester * *********************************************************** CRTS START 0 USING *,0 EXTRN READ Reader I/O entry point EXTRN PRNT ENTRY FOF ENTRY RBUF ENTRY REOF CARD DS CL80 My record buffer RBUF DS CL80 IOCS reader buffer PBUF DS CL132 Printer buffer STRT EQU * MVI PBUF,C' ' Clear printer buffer MVC PBUF+1(131),PBUF OPEN READ OPEN PRNT LOOP EQU * GET READ,CARD MVC PBUF(80),CARD PUT PRNT,PBUF BC 15,LOOP * * End-of-file * REOF EQU * MVC PBUF(80),CARD PUT PRNT,PBUF CLOSE READ CLOSE PRNT EOF1 EQU * MSG X'1FFF' BC 15,EOF1 * * Form overflow * FOF EQU * BC 15,0(,14) END STRT
#include "BAPlayer.h" #include "BAShip.h" #include "BAMapData.h" #include "ABGeometry.h" BAPlayer::BAPlayer(CharacterID charID){ // init character Data this->charData = BACharacterData::newCharacterForID(charID); this->numberOfShips = charData->numberOfSmallShips + charData->numberOfMediumShips + charData->numberOfLargeShips; // init ships this->ships = new BAShip[charData->numberOfAllShips()]; // small ships for(int8_t i = 0; i < charData->numberOfSmallShips; i++) this->ships[i] = BAShipMake(1); // medium ships for(int8_t i = 0; i < charData->numberOfMediumShips; i++) this->ships[i + charData->numberOfSmallShips] = BAShipMake(2); // big ships for(int8_t i = 0; i < charData->numberOfLargeShips; i++) this->ships[i + charData->numberOfSmallShips + charData->numberOfMediumShips] = BAShipMake(3); // create map uint8_t mountainsCount = random(4,6); for(int8_t y = 0; y < GAME_BOARD_SIZE_HEIGHT; y++){ for(int8_t x = 0; x < GAME_BOARD_SIZE_WIDTH; x++){ // Water playerBoard[y][x] = BAMapTileTypeWater0; // slight chance fo a mountain if ( (random(0, 100) < 3) && (mountainsCount > 0) ) { playerBoard[y][x] = BAMapTileTypeMountain; mountainsCount--; } } } // distribute the remaining mountains while(mountainsCount > 0) { uint8_t x = random(0, GAME_BOARD_SIZE_WIDTH); uint8_t y = random(0, GAME_BOARD_SIZE_HEIGHT); if (playerBoard[y][x] != BAMapTileTypeMountain) { playerBoard[y][x] = BAMapTileTypeMountain; mountainsCount--; } } } BAPlayer::~BAPlayer(){ delete this->charData; this->charData = NULL; delete[] this->ships; this->ships = NULL; } ABSize BAPlayer::gameBoardSize(){ return ABSizeMake(GAME_BOARD_SIZE_WIDTH, GAME_BOARD_SIZE_HEIGHT); } const BACharacterData* BAPlayer::getCharacterData(){ return charData; } BAShip BAPlayer::shipAtIndex(uint8_t idx){ return ships[idx]; } void BAPlayer::updateShipAtIndex(uint8_t idx, BAShip newShip){ ships[idx].remainingLength = newShip.remainingLength; ships[idx].orientation = newShip.orientation; ships[idx].positionX = newShip.positionX; ships[idx].positionY = newShip.positionY; } int8_t BAPlayer::numberOfAllShips(){ return this->numberOfShips; } int8_t BAPlayer::numberOfRemainingShips(){ uint8_t nr = 0; for(int i = 0; i<this->numberOfAllShips() ;i++) if(!BAShipIsShipDestroyed(ships[i])) nr++; return nr; } bool BAPlayer::shipCollidesOnMap(BAShip &ship){ bool colides = false; for (int len = 0; len < ship.fullLength; len++) { int dX = 0, dY = 0; if (ship.orientation == BAShipOrientationHorizontal) dX = len; else dY = len; if (this->playerBoard[ship.positionY+dY][ship.positionX+dX] >= 0 || this->playerBoard[ship.positionY+dY][ship.positionX+dX] == BAMapTileTypeMountain) { colides = true; break; } } return colides; }
include stdmacro.i include raster.i _TEXT segment public pj_mcga_get_hseg public pj_mcga_put_hseg ;***************************************************************************** ;* LONG pj_mcga_get_hseg(Bytemap *r,void *pixbuf, ULONG x,ULONG y,ULONG width); ;* unclipped! get horizontal line segment ;***************************************************************************** align 4 pj_mcga_get_hseg proc near Entry Args #raster,#pixbuf,#x,#y,#width Save esi,edi mov esi,#raster ; load raster pointer mov edi,#pixbuf ; load output buffer pointer mov ecx,#width ; load width mov eax,#y ; standard calc-the-screen-address... mul [esi].bym_bpr add eax,#x mov esi,[esi].bym_p add esi,eax mov eax,ecx ; save width as return value in eax shr ecx,2 ; standard fast-move... rep movs dptr es:[edi],gs:[esi] mov cl,al and cl,3 rep movs bptr es:[edi],gs:[esi] Restore esi,edi Exit pj_mcga_get_hseg endp ;***************************************************************************** ;* LONG pj_mcga_put_hseg(Bytemap *r,void *pixbuf, ULONG x,ULONG y,ULONG width); ;* unclipped! put horizontal line segment ;***************************************************************************** align 4 pj_mcga_put_hseg proc near Entry Args #raster,#pixbuf,#x,#y,#width Save esi,edi,es mov edi,#raster ; load raster pointer mov esi,#pixbuf ; load input buffer pointer mov ecx,#width ; load width mov eax,#y ; standard calc-the-screen-address... mul [edi].bym_bpr add eax,#x mov edi,[edi].bym_p add edi,eax mov ax,gs ; make screen addressable via ES reg mov es,ax ; for rep movs instructions. mov eax,ecx ; save width as return value in eax shr ecx,2 ; standard fast-move... rep movsd mov cl,al and cl,3 rep movsb Restore esi,edi,es Exit pj_mcga_put_hseg endp _TEXT ends end
;***************************************************************************** ;* x86-optimized Float DSP functions ;* ;* Copyright 2006 Loren Merritt ;* ;* 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 "x86util.asm" SECTION .text ;----------------------------------------------------------------------------- ; void vector_fmul(float *dst, const float *src0, const float *src1, int len) ;----------------------------------------------------------------------------- %macro VECTOR_FMUL 0 cglobal vector_fmul, 4,4,2, dst, src0, src1, len lea lenq, [lend*4 - 2*mmsize] ALIGN 16 .loop: mova m0, [src0q + lenq] mova m1, [src0q + lenq + mmsize] mulps m0, m0, [src1q + lenq] mulps m1, m1, [src1q + lenq + mmsize] mova [dstq + lenq], m0 mova [dstq + lenq + mmsize], m1 sub lenq, 2*mmsize jge .loop REP_RET %endmacro INIT_XMM sse VECTOR_FMUL %if HAVE_AVX_EXTERNAL INIT_YMM avx VECTOR_FMUL %endif ;------------------------------------------------------------------------------ ; void ff_vector_fmac_scalar(float *dst, const float *src, float mul, int len) ;------------------------------------------------------------------------------ %macro VECTOR_FMAC_SCALAR 0 %if UNIX64 cglobal vector_fmac_scalar, 3,3,3, dst, src, len %else cglobal vector_fmac_scalar, 4,4,3, dst, src, mul, len %endif %if ARCH_X86_32 VBROADCASTSS m0, mulm %else %if WIN64 mova xmm0, xmm2 %endif shufps xmm0, xmm0, 0 %if cpuflag(avx) vinsertf128 m0, m0, xmm0, 1 %endif %endif lea lenq, [lend*4-2*mmsize] .loop: mulps m1, m0, [srcq+lenq ] mulps m2, m0, [srcq+lenq+mmsize] addps m1, m1, [dstq+lenq ] addps m2, m2, [dstq+lenq+mmsize] mova [dstq+lenq ], m1 mova [dstq+lenq+mmsize], m2 sub lenq, 2*mmsize jge .loop REP_RET %endmacro INIT_XMM sse VECTOR_FMAC_SCALAR %if HAVE_AVX_EXTERNAL INIT_YMM avx VECTOR_FMAC_SCALAR %endif ;------------------------------------------------------------------------------ ; void ff_vector_fmul_scalar(float *dst, const float *src, float mul, int len) ;------------------------------------------------------------------------------ %macro VECTOR_FMUL_SCALAR 0 %if UNIX64 cglobal vector_fmul_scalar, 3,3,2, dst, src, len %else cglobal vector_fmul_scalar, 4,4,3, dst, src, mul, len %endif %if ARCH_X86_32 movss m0, mulm %elif WIN64 SWAP 0, 2 %endif shufps m0, m0, 0 lea lenq, [lend*4-mmsize] .loop: mova m1, [srcq+lenq] mulps m1, m0 mova [dstq+lenq], m1 sub lenq, mmsize jge .loop REP_RET %endmacro INIT_XMM sse VECTOR_FMUL_SCALAR ;------------------------------------------------------------------------------ ; void ff_vector_dmul_scalar(double *dst, const double *src, double mul, ; int len) ;------------------------------------------------------------------------------ %macro VECTOR_DMUL_SCALAR 0 %if ARCH_X86_32 cglobal vector_dmul_scalar, 3,4,3, dst, src, mul, len, lenaddr mov lenq, lenaddrm %elif UNIX64 cglobal vector_dmul_scalar, 3,3,3, dst, src, len %else cglobal vector_dmul_scalar, 4,4,3, dst, src, mul, len %endif %if ARCH_X86_32 VBROADCASTSD m0, mulm %else %if WIN64 movlhps xmm2, xmm2 %if cpuflag(avx) vinsertf128 ymm2, ymm2, xmm2, 1 %endif SWAP 0, 2 %else movlhps xmm0, xmm0 %if cpuflag(avx) vinsertf128 ymm0, ymm0, xmm0, 1 %endif %endif %endif lea lenq, [lend*8-2*mmsize] .loop: mulpd m1, m0, [srcq+lenq ] mulpd m2, m0, [srcq+lenq+mmsize] mova [dstq+lenq ], m1 mova [dstq+lenq+mmsize], m2 sub lenq, 2*mmsize jge .loop REP_RET %endmacro INIT_XMM sse2 VECTOR_DMUL_SCALAR %if HAVE_AVX_EXTERNAL INIT_YMM avx VECTOR_DMUL_SCALAR %endif ;----------------------------------------------------------------------------- ; vector_fmul_add(float *dst, const float *src0, const float *src1, ; const float *src2, int len) ;----------------------------------------------------------------------------- %macro VECTOR_FMUL_ADD 0 cglobal vector_fmul_add, 5,5,2, dst, src0, src1, src2, len lea lenq, [lend*4 - 2*mmsize] ALIGN 16 .loop: mova m0, [src0q + lenq] mova m1, [src0q + lenq + mmsize] mulps m0, m0, [src1q + lenq] mulps m1, m1, [src1q + lenq + mmsize] addps m0, m0, [src2q + lenq] addps m1, m1, [src2q + lenq + mmsize] mova [dstq + lenq], m0 mova [dstq + lenq + mmsize], m1 sub lenq, 2*mmsize jge .loop REP_RET %endmacro INIT_XMM sse VECTOR_FMUL_ADD %if HAVE_AVX_EXTERNAL INIT_YMM avx VECTOR_FMUL_ADD %endif ;----------------------------------------------------------------------------- ; void vector_fmul_reverse(float *dst, const float *src0, const float *src1, ; int len) ;----------------------------------------------------------------------------- %macro VECTOR_FMUL_REVERSE 0 cglobal vector_fmul_reverse, 4,4,2, dst, src0, src1, len lea lenq, [lend*4 - 2*mmsize] ALIGN 16 .loop: %if cpuflag(avx) vmovaps xmm0, [src1q + 16] vinsertf128 m0, m0, [src1q], 1 vshufps m0, m0, m0, q0123 vmovaps xmm1, [src1q + mmsize + 16] vinsertf128 m1, m1, [src1q + mmsize], 1 vshufps m1, m1, m1, q0123 %else mova m0, [src1q] mova m1, [src1q + mmsize] shufps m0, m0, q0123 shufps m1, m1, q0123 %endif mulps m0, m0, [src0q + lenq + mmsize] mulps m1, m1, [src0q + lenq] mova [dstq + lenq + mmsize], m0 mova [dstq + lenq], m1 add src1q, 2*mmsize sub lenq, 2*mmsize jge .loop REP_RET %endmacro INIT_XMM sse VECTOR_FMUL_REVERSE %if HAVE_AVX_EXTERNAL INIT_YMM avx VECTOR_FMUL_REVERSE %endif ; float scalarproduct_float_sse(const float *v1, const float *v2, int len) INIT_XMM sse cglobal scalarproduct_float, 3,3,2, v1, v2, offset neg offsetq shl offsetq, 2 sub v1q, offsetq sub v2q, offsetq xorps xmm0, xmm0 .loop: movaps xmm1, [v1q+offsetq] mulps xmm1, [v2q+offsetq] addps xmm0, xmm1 add offsetq, 16 js .loop movhlps xmm1, xmm0 addps xmm0, xmm1 movss xmm1, xmm0 shufps xmm0, xmm0, 1 addss xmm0, xmm1 %if ARCH_X86_64 == 0 movss r0m, xmm0 fld dword r0m %endif RET ;----------------------------------------------------------------------------- ; void ff_butterflies_float(float *src0, float *src1, int len); ;----------------------------------------------------------------------------- INIT_XMM sse cglobal butterflies_float, 3,3,3, src0, src1, len %if ARCH_X86_64 movsxd lenq, lend %endif test lenq, lenq jz .end shl lenq, 2 add src0q, lenq add src1q, lenq neg lenq .loop: mova m0, [src0q + lenq] mova m1, [src1q + lenq] subps m2, m0, m1 addps m0, m0, m1 mova [src1q + lenq], m2 mova [src0q + lenq], m0 add lenq, mmsize jl .loop .end: REP_RET
SECTION code_fcntl PUBLIC console_01_output_stdio_msg_writ EXTERN OTERM_MSG_PUTC, l_jpix console_01_output_stdio_msg_writ: ; BC' = length > 0 ; HL' = void *buffer = byte source ; HL = length > 0 ; ; return: ; ; HL'= void *buffer + num bytes written ; HL = number of bytes successfully output ; carry set if error push hl ; num chars to output exx writ_loop: ld a,(hl) exx ld c,a ld a,OTERM_MSG_PUTC call l_jpix exx cpi ; hl++, bc-- jp pe, writ_loop writ_end: exx pop hl ; hl = num chars to output or a ret
;------------------------------------------------------------------------------ ; This file is part of the RTX-51 TINY Real-Time Operating System Package ; Copyright KEIL ELEKTRONIK GmbH and Keil Software, Inc. 1991 - 2002 ;------------------------------------------------------------------------------ ; ; OS_RUNNING_TASK.A51: This module contains the OS_RUNNING_TASK_ID function. ; ; RTX51 TINY VERSION 2 ; ;------------------------------------------------------------------------------ NAME ?RTX51_TINY_OS_RUNNING_TASK_ID $include (os_defines.inc) PUBLIC os_running_task_id ?RTX?CODE SEGMENT CODE RSEG ?RTX?CODE USING 0 ; Registerbank 0 for following code ; uchar os_running_task_id (void) { os_running_task_id: MOV R7,?RTX_CURRENTTASK RET END
_wc: file format elf32-i386 Disassembly of section .text: 00000000 <main>: printf(1, "%d %d %d %s\n", l, w, c, name); } int main(int argc, char *argv[]) { 0: f3 0f 1e fb endbr32 4: 8d 4c 24 04 lea 0x4(%esp),%ecx 8: 83 e4 f0 and $0xfffffff0,%esp b: ff 71 fc pushl -0x4(%ecx) e: 55 push %ebp f: 89 e5 mov %esp,%ebp 11: 57 push %edi 12: 56 push %esi 13: be 01 00 00 00 mov $0x1,%esi 18: 53 push %ebx 19: 51 push %ecx 1a: 83 ec 18 sub $0x18,%esp 1d: 8b 01 mov (%ecx),%eax 1f: 8b 59 04 mov 0x4(%ecx),%ebx 22: 89 45 e4 mov %eax,-0x1c(%ebp) 25: 83 c3 04 add $0x4,%ebx int fd, i; if(argc <= 1){ 28: 83 f8 01 cmp $0x1,%eax 2b: 7e 52 jle 7f <main+0x7f> 2d: 8d 76 00 lea 0x0(%esi),%esi wc(0, ""); exit(); } for(i = 1; i < argc; i++){ if((fd = open(argv[i], 0)) < 0){ 30: 83 ec 08 sub $0x8,%esp 33: 6a 00 push $0x0 35: ff 33 pushl (%ebx) 37: e8 f7 03 00 00 call 433 <open> 3c: 83 c4 10 add $0x10,%esp 3f: 89 c7 mov %eax,%edi 41: 85 c0 test %eax,%eax 43: 78 26 js 6b <main+0x6b> printf(1, "wc: cannot open %s\n", argv[i]); exit(); } wc(fd, argv[i]); 45: 83 ec 08 sub $0x8,%esp 48: ff 33 pushl (%ebx) for(i = 1; i < argc; i++){ 4a: 83 c6 01 add $0x1,%esi 4d: 83 c3 04 add $0x4,%ebx wc(fd, argv[i]); 50: 50 push %eax 51: e8 4a 00 00 00 call a0 <wc> close(fd); 56: 89 3c 24 mov %edi,(%esp) 59: e8 bd 03 00 00 call 41b <close> for(i = 1; i < argc; i++){ 5e: 83 c4 10 add $0x10,%esp 61: 39 75 e4 cmp %esi,-0x1c(%ebp) 64: 75 ca jne 30 <main+0x30> } exit(); 66: e8 88 03 00 00 call 3f3 <exit> printf(1, "wc: cannot open %s\n", argv[i]); 6b: 50 push %eax 6c: ff 33 pushl (%ebx) 6e: 68 eb 08 00 00 push $0x8eb 73: 6a 01 push $0x1 75: e8 e6 04 00 00 call 560 <printf> exit(); 7a: e8 74 03 00 00 call 3f3 <exit> wc(0, ""); 7f: 52 push %edx 80: 52 push %edx 81: 68 dd 08 00 00 push $0x8dd 86: 6a 00 push $0x0 88: e8 13 00 00 00 call a0 <wc> exit(); 8d: e8 61 03 00 00 call 3f3 <exit> 92: 66 90 xchg %ax,%ax 94: 66 90 xchg %ax,%ax 96: 66 90 xchg %ax,%ax 98: 66 90 xchg %ax,%ax 9a: 66 90 xchg %ax,%ax 9c: 66 90 xchg %ax,%ax 9e: 66 90 xchg %ax,%ax 000000a0 <wc>: { a0: f3 0f 1e fb endbr32 a4: 55 push %ebp a5: 89 e5 mov %esp,%ebp a7: 57 push %edi a8: 56 push %esi a9: 53 push %ebx l = w = c = 0; aa: 31 db xor %ebx,%ebx { ac: 83 ec 1c sub $0x1c,%esp inword = 0; af: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp) l = w = c = 0; b6: c7 45 dc 00 00 00 00 movl $0x0,-0x24(%ebp) bd: c7 45 e0 00 00 00 00 movl $0x0,-0x20(%ebp) c4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi while((n = read(fd, buf, sizeof(buf))) > 0){ c8: 83 ec 04 sub $0x4,%esp cb: 68 00 02 00 00 push $0x200 d0: 68 20 0c 00 00 push $0xc20 d5: ff 75 08 pushl 0x8(%ebp) d8: e8 2e 03 00 00 call 40b <read> dd: 83 c4 10 add $0x10,%esp e0: 89 c6 mov %eax,%esi e2: 85 c0 test %eax,%eax e4: 7e 62 jle 148 <wc+0xa8> for(i=0; i<n; i++){ e6: 31 ff xor %edi,%edi e8: eb 14 jmp fe <wc+0x5e> ea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi inword = 0; f0: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp) for(i=0; i<n; i++){ f7: 83 c7 01 add $0x1,%edi fa: 39 fe cmp %edi,%esi fc: 74 42 je 140 <wc+0xa0> if(buf[i] == '\n') fe: 0f be 87 20 0c 00 00 movsbl 0xc20(%edi),%eax l++; 105: 31 c9 xor %ecx,%ecx 107: 3c 0a cmp $0xa,%al 109: 0f 94 c1 sete %cl if(strchr(" \r\t\n\v", buf[i])) 10c: 83 ec 08 sub $0x8,%esp 10f: 50 push %eax l++; 110: 01 cb add %ecx,%ebx if(strchr(" \r\t\n\v", buf[i])) 112: 68 c8 08 00 00 push $0x8c8 117: e8 54 01 00 00 call 270 <strchr> 11c: 83 c4 10 add $0x10,%esp 11f: 85 c0 test %eax,%eax 121: 75 cd jne f0 <wc+0x50> else if(!inword){ 123: 8b 55 e4 mov -0x1c(%ebp),%edx 126: 85 d2 test %edx,%edx 128: 75 cd jne f7 <wc+0x57> for(i=0; i<n; i++){ 12a: 83 c7 01 add $0x1,%edi w++; 12d: 83 45 e0 01 addl $0x1,-0x20(%ebp) inword = 1; 131: c7 45 e4 01 00 00 00 movl $0x1,-0x1c(%ebp) for(i=0; i<n; i++){ 138: 39 fe cmp %edi,%esi 13a: 75 c2 jne fe <wc+0x5e> 13c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 140: 01 75 dc add %esi,-0x24(%ebp) 143: eb 83 jmp c8 <wc+0x28> 145: 8d 76 00 lea 0x0(%esi),%esi if(n < 0){ 148: 75 24 jne 16e <wc+0xce> printf(1, "%d %d %d %s\n", l, w, c, name); 14a: 83 ec 08 sub $0x8,%esp 14d: ff 75 0c pushl 0xc(%ebp) 150: ff 75 dc pushl -0x24(%ebp) 153: ff 75 e0 pushl -0x20(%ebp) 156: 53 push %ebx 157: 68 de 08 00 00 push $0x8de 15c: 6a 01 push $0x1 15e: e8 fd 03 00 00 call 560 <printf> } 163: 83 c4 20 add $0x20,%esp 166: 8d 65 f4 lea -0xc(%ebp),%esp 169: 5b pop %ebx 16a: 5e pop %esi 16b: 5f pop %edi 16c: 5d pop %ebp 16d: c3 ret printf(1, "wc: read error\n"); 16e: 50 push %eax 16f: 50 push %eax 170: 68 ce 08 00 00 push $0x8ce 175: 6a 01 push $0x1 177: e8 e4 03 00 00 call 560 <printf> exit(); 17c: e8 72 02 00 00 call 3f3 <exit> 181: 66 90 xchg %ax,%ax 183: 66 90 xchg %ax,%ax 185: 66 90 xchg %ax,%ax 187: 66 90 xchg %ax,%ax 189: 66 90 xchg %ax,%ax 18b: 66 90 xchg %ax,%ax 18d: 66 90 xchg %ax,%ax 18f: 90 nop 00000190 <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, const char *t) { 190: f3 0f 1e fb endbr32 194: 55 push %ebp char *os; os = s; while((*s++ = *t++) != 0) 195: 31 c0 xor %eax,%eax { 197: 89 e5 mov %esp,%ebp 199: 53 push %ebx 19a: 8b 4d 08 mov 0x8(%ebp),%ecx 19d: 8b 5d 0c mov 0xc(%ebp),%ebx while((*s++ = *t++) != 0) 1a0: 0f b6 14 03 movzbl (%ebx,%eax,1),%edx 1a4: 88 14 01 mov %dl,(%ecx,%eax,1) 1a7: 83 c0 01 add $0x1,%eax 1aa: 84 d2 test %dl,%dl 1ac: 75 f2 jne 1a0 <strcpy+0x10> ; return os; } 1ae: 89 c8 mov %ecx,%eax 1b0: 5b pop %ebx 1b1: 5d pop %ebp 1b2: c3 ret 1b3: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 1ba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 000001c0 <strcmp>: int strcmp(const char *p, const char *q) { 1c0: f3 0f 1e fb endbr32 1c4: 55 push %ebp 1c5: 89 e5 mov %esp,%ebp 1c7: 53 push %ebx 1c8: 8b 4d 08 mov 0x8(%ebp),%ecx 1cb: 8b 55 0c mov 0xc(%ebp),%edx while(*p && *p == *q) 1ce: 0f b6 01 movzbl (%ecx),%eax 1d1: 0f b6 1a movzbl (%edx),%ebx 1d4: 84 c0 test %al,%al 1d6: 75 19 jne 1f1 <strcmp+0x31> 1d8: eb 26 jmp 200 <strcmp+0x40> 1da: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 1e0: 0f b6 41 01 movzbl 0x1(%ecx),%eax p++, q++; 1e4: 83 c1 01 add $0x1,%ecx 1e7: 83 c2 01 add $0x1,%edx while(*p && *p == *q) 1ea: 0f b6 1a movzbl (%edx),%ebx 1ed: 84 c0 test %al,%al 1ef: 74 0f je 200 <strcmp+0x40> 1f1: 38 d8 cmp %bl,%al 1f3: 74 eb je 1e0 <strcmp+0x20> return (uchar)*p - (uchar)*q; 1f5: 29 d8 sub %ebx,%eax } 1f7: 5b pop %ebx 1f8: 5d pop %ebp 1f9: c3 ret 1fa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 200: 31 c0 xor %eax,%eax return (uchar)*p - (uchar)*q; 202: 29 d8 sub %ebx,%eax } 204: 5b pop %ebx 205: 5d pop %ebp 206: c3 ret 207: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 20e: 66 90 xchg %ax,%ax 00000210 <strlen>: uint strlen(const char *s) { 210: f3 0f 1e fb endbr32 214: 55 push %ebp 215: 89 e5 mov %esp,%ebp 217: 8b 55 08 mov 0x8(%ebp),%edx int n; for(n = 0; s[n]; n++) 21a: 80 3a 00 cmpb $0x0,(%edx) 21d: 74 21 je 240 <strlen+0x30> 21f: 31 c0 xor %eax,%eax 221: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 228: 83 c0 01 add $0x1,%eax 22b: 80 3c 02 00 cmpb $0x0,(%edx,%eax,1) 22f: 89 c1 mov %eax,%ecx 231: 75 f5 jne 228 <strlen+0x18> ; return n; } 233: 89 c8 mov %ecx,%eax 235: 5d pop %ebp 236: c3 ret 237: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 23e: 66 90 xchg %ax,%ax for(n = 0; s[n]; n++) 240: 31 c9 xor %ecx,%ecx } 242: 5d pop %ebp 243: 89 c8 mov %ecx,%eax 245: c3 ret 246: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 24d: 8d 76 00 lea 0x0(%esi),%esi 00000250 <memset>: void* memset(void *dst, int c, uint n) { 250: f3 0f 1e fb endbr32 254: 55 push %ebp 255: 89 e5 mov %esp,%ebp 257: 57 push %edi 258: 8b 55 08 mov 0x8(%ebp),%edx } static inline void stosb(void *addr, int data, int cnt) { asm volatile("cld; rep stosb" : 25b: 8b 4d 10 mov 0x10(%ebp),%ecx 25e: 8b 45 0c mov 0xc(%ebp),%eax 261: 89 d7 mov %edx,%edi 263: fc cld 264: f3 aa rep stos %al,%es:(%edi) stosb(dst, c, n); return dst; } 266: 89 d0 mov %edx,%eax 268: 5f pop %edi 269: 5d pop %ebp 26a: c3 ret 26b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 26f: 90 nop 00000270 <strchr>: char* strchr(const char *s, char c) { 270: f3 0f 1e fb endbr32 274: 55 push %ebp 275: 89 e5 mov %esp,%ebp 277: 8b 45 08 mov 0x8(%ebp),%eax 27a: 0f b6 4d 0c movzbl 0xc(%ebp),%ecx for(; *s; s++) 27e: 0f b6 10 movzbl (%eax),%edx 281: 84 d2 test %dl,%dl 283: 75 16 jne 29b <strchr+0x2b> 285: eb 21 jmp 2a8 <strchr+0x38> 287: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 28e: 66 90 xchg %ax,%ax 290: 0f b6 50 01 movzbl 0x1(%eax),%edx 294: 83 c0 01 add $0x1,%eax 297: 84 d2 test %dl,%dl 299: 74 0d je 2a8 <strchr+0x38> if(*s == c) 29b: 38 d1 cmp %dl,%cl 29d: 75 f1 jne 290 <strchr+0x20> return (char*)s; return 0; } 29f: 5d pop %ebp 2a0: c3 ret 2a1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return 0; 2a8: 31 c0 xor %eax,%eax } 2aa: 5d pop %ebp 2ab: c3 ret 2ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 000002b0 <gets>: char* gets(char *buf, int max) { 2b0: f3 0f 1e fb endbr32 2b4: 55 push %ebp 2b5: 89 e5 mov %esp,%ebp 2b7: 57 push %edi 2b8: 56 push %esi int i, cc; char c; for(i=0; i+1 < max; ){ 2b9: 31 f6 xor %esi,%esi { 2bb: 53 push %ebx 2bc: 89 f3 mov %esi,%ebx 2be: 83 ec 1c sub $0x1c,%esp 2c1: 8b 7d 08 mov 0x8(%ebp),%edi for(i=0; i+1 < max; ){ 2c4: eb 33 jmp 2f9 <gets+0x49> 2c6: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 2cd: 8d 76 00 lea 0x0(%esi),%esi cc = read(0, &c, 1); 2d0: 83 ec 04 sub $0x4,%esp 2d3: 8d 45 e7 lea -0x19(%ebp),%eax 2d6: 6a 01 push $0x1 2d8: 50 push %eax 2d9: 6a 00 push $0x0 2db: e8 2b 01 00 00 call 40b <read> if(cc < 1) 2e0: 83 c4 10 add $0x10,%esp 2e3: 85 c0 test %eax,%eax 2e5: 7e 1c jle 303 <gets+0x53> break; buf[i++] = c; 2e7: 0f b6 45 e7 movzbl -0x19(%ebp),%eax 2eb: 83 c7 01 add $0x1,%edi 2ee: 88 47 ff mov %al,-0x1(%edi) if(c == '\n' || c == '\r') 2f1: 3c 0a cmp $0xa,%al 2f3: 74 23 je 318 <gets+0x68> 2f5: 3c 0d cmp $0xd,%al 2f7: 74 1f je 318 <gets+0x68> for(i=0; i+1 < max; ){ 2f9: 83 c3 01 add $0x1,%ebx 2fc: 89 fe mov %edi,%esi 2fe: 3b 5d 0c cmp 0xc(%ebp),%ebx 301: 7c cd jl 2d0 <gets+0x20> 303: 89 f3 mov %esi,%ebx break; } buf[i] = '\0'; return buf; } 305: 8b 45 08 mov 0x8(%ebp),%eax buf[i] = '\0'; 308: c6 03 00 movb $0x0,(%ebx) } 30b: 8d 65 f4 lea -0xc(%ebp),%esp 30e: 5b pop %ebx 30f: 5e pop %esi 310: 5f pop %edi 311: 5d pop %ebp 312: c3 ret 313: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 317: 90 nop 318: 8b 75 08 mov 0x8(%ebp),%esi 31b: 8b 45 08 mov 0x8(%ebp),%eax 31e: 01 de add %ebx,%esi 320: 89 f3 mov %esi,%ebx buf[i] = '\0'; 322: c6 03 00 movb $0x0,(%ebx) } 325: 8d 65 f4 lea -0xc(%ebp),%esp 328: 5b pop %ebx 329: 5e pop %esi 32a: 5f pop %edi 32b: 5d pop %ebp 32c: c3 ret 32d: 8d 76 00 lea 0x0(%esi),%esi 00000330 <stat>: int stat(const char *n, struct stat *st) { 330: f3 0f 1e fb endbr32 334: 55 push %ebp 335: 89 e5 mov %esp,%ebp 337: 56 push %esi 338: 53 push %ebx int fd; int r; fd = open(n, O_RDONLY); 339: 83 ec 08 sub $0x8,%esp 33c: 6a 00 push $0x0 33e: ff 75 08 pushl 0x8(%ebp) 341: e8 ed 00 00 00 call 433 <open> if(fd < 0) 346: 83 c4 10 add $0x10,%esp 349: 85 c0 test %eax,%eax 34b: 78 2b js 378 <stat+0x48> return -1; r = fstat(fd, st); 34d: 83 ec 08 sub $0x8,%esp 350: ff 75 0c pushl 0xc(%ebp) 353: 89 c3 mov %eax,%ebx 355: 50 push %eax 356: e8 f0 00 00 00 call 44b <fstat> close(fd); 35b: 89 1c 24 mov %ebx,(%esp) r = fstat(fd, st); 35e: 89 c6 mov %eax,%esi close(fd); 360: e8 b6 00 00 00 call 41b <close> return r; 365: 83 c4 10 add $0x10,%esp } 368: 8d 65 f8 lea -0x8(%ebp),%esp 36b: 89 f0 mov %esi,%eax 36d: 5b pop %ebx 36e: 5e pop %esi 36f: 5d pop %ebp 370: c3 ret 371: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 378: be ff ff ff ff mov $0xffffffff,%esi 37d: eb e9 jmp 368 <stat+0x38> 37f: 90 nop 00000380 <atoi>: int atoi(const char *s) { 380: f3 0f 1e fb endbr32 384: 55 push %ebp 385: 89 e5 mov %esp,%ebp 387: 53 push %ebx 388: 8b 55 08 mov 0x8(%ebp),%edx int n; n = 0; while('0' <= *s && *s <= '9') 38b: 0f be 02 movsbl (%edx),%eax 38e: 8d 48 d0 lea -0x30(%eax),%ecx 391: 80 f9 09 cmp $0x9,%cl n = 0; 394: b9 00 00 00 00 mov $0x0,%ecx while('0' <= *s && *s <= '9') 399: 77 1a ja 3b5 <atoi+0x35> 39b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 39f: 90 nop n = n*10 + *s++ - '0'; 3a0: 83 c2 01 add $0x1,%edx 3a3: 8d 0c 89 lea (%ecx,%ecx,4),%ecx 3a6: 8d 4c 48 d0 lea -0x30(%eax,%ecx,2),%ecx while('0' <= *s && *s <= '9') 3aa: 0f be 02 movsbl (%edx),%eax 3ad: 8d 58 d0 lea -0x30(%eax),%ebx 3b0: 80 fb 09 cmp $0x9,%bl 3b3: 76 eb jbe 3a0 <atoi+0x20> return n; } 3b5: 89 c8 mov %ecx,%eax 3b7: 5b pop %ebx 3b8: 5d pop %ebp 3b9: c3 ret 3ba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 000003c0 <memmove>: void* memmove(void *vdst, const void *vsrc, int n) { 3c0: f3 0f 1e fb endbr32 3c4: 55 push %ebp 3c5: 89 e5 mov %esp,%ebp 3c7: 57 push %edi 3c8: 8b 45 10 mov 0x10(%ebp),%eax 3cb: 8b 55 08 mov 0x8(%ebp),%edx 3ce: 56 push %esi 3cf: 8b 75 0c mov 0xc(%ebp),%esi char *dst; const char *src; dst = vdst; src = vsrc; while(n-- > 0) 3d2: 85 c0 test %eax,%eax 3d4: 7e 0f jle 3e5 <memmove+0x25> 3d6: 01 d0 add %edx,%eax dst = vdst; 3d8: 89 d7 mov %edx,%edi 3da: 8d b6 00 00 00 00 lea 0x0(%esi),%esi *dst++ = *src++; 3e0: a4 movsb %ds:(%esi),%es:(%edi) while(n-- > 0) 3e1: 39 f8 cmp %edi,%eax 3e3: 75 fb jne 3e0 <memmove+0x20> return vdst; } 3e5: 5e pop %esi 3e6: 89 d0 mov %edx,%eax 3e8: 5f pop %edi 3e9: 5d pop %ebp 3ea: c3 ret 000003eb <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) 3eb: b8 01 00 00 00 mov $0x1,%eax 3f0: cd 40 int $0x40 3f2: c3 ret 000003f3 <exit>: SYSCALL(exit) 3f3: b8 02 00 00 00 mov $0x2,%eax 3f8: cd 40 int $0x40 3fa: c3 ret 000003fb <wait>: SYSCALL(wait) 3fb: b8 03 00 00 00 mov $0x3,%eax 400: cd 40 int $0x40 402: c3 ret 00000403 <pipe>: SYSCALL(pipe) 403: b8 04 00 00 00 mov $0x4,%eax 408: cd 40 int $0x40 40a: c3 ret 0000040b <read>: SYSCALL(read) 40b: b8 05 00 00 00 mov $0x5,%eax 410: cd 40 int $0x40 412: c3 ret 00000413 <write>: SYSCALL(write) 413: b8 10 00 00 00 mov $0x10,%eax 418: cd 40 int $0x40 41a: c3 ret 0000041b <close>: SYSCALL(close) 41b: b8 15 00 00 00 mov $0x15,%eax 420: cd 40 int $0x40 422: c3 ret 00000423 <kill>: SYSCALL(kill) 423: b8 06 00 00 00 mov $0x6,%eax 428: cd 40 int $0x40 42a: c3 ret 0000042b <exec>: SYSCALL(exec) 42b: b8 07 00 00 00 mov $0x7,%eax 430: cd 40 int $0x40 432: c3 ret 00000433 <open>: SYSCALL(open) 433: b8 0f 00 00 00 mov $0xf,%eax 438: cd 40 int $0x40 43a: c3 ret 0000043b <mknod>: SYSCALL(mknod) 43b: b8 11 00 00 00 mov $0x11,%eax 440: cd 40 int $0x40 442: c3 ret 00000443 <unlink>: SYSCALL(unlink) 443: b8 12 00 00 00 mov $0x12,%eax 448: cd 40 int $0x40 44a: c3 ret 0000044b <fstat>: SYSCALL(fstat) 44b: b8 08 00 00 00 mov $0x8,%eax 450: cd 40 int $0x40 452: c3 ret 00000453 <link>: SYSCALL(link) 453: b8 13 00 00 00 mov $0x13,%eax 458: cd 40 int $0x40 45a: c3 ret 0000045b <mkdir>: SYSCALL(mkdir) 45b: b8 14 00 00 00 mov $0x14,%eax 460: cd 40 int $0x40 462: c3 ret 00000463 <chdir>: SYSCALL(chdir) 463: b8 09 00 00 00 mov $0x9,%eax 468: cd 40 int $0x40 46a: c3 ret 0000046b <dup>: SYSCALL(dup) 46b: b8 0a 00 00 00 mov $0xa,%eax 470: cd 40 int $0x40 472: c3 ret 00000473 <getpid>: SYSCALL(getpid) 473: b8 0b 00 00 00 mov $0xb,%eax 478: cd 40 int $0x40 47a: c3 ret 0000047b <sbrk>: SYSCALL(sbrk) 47b: b8 0c 00 00 00 mov $0xc,%eax 480: cd 40 int $0x40 482: c3 ret 00000483 <sleep>: SYSCALL(sleep) 483: b8 0d 00 00 00 mov $0xd,%eax 488: cd 40 int $0x40 48a: c3 ret 0000048b <uptime>: SYSCALL(uptime) 48b: b8 0e 00 00 00 mov $0xe,%eax 490: cd 40 int $0x40 492: c3 ret 00000493 <cps>: SYSCALL(cps) 493: b8 16 00 00 00 mov $0x16,%eax 498: cd 40 int $0x40 49a: c3 ret 0000049b <chpr>: 49b: b8 17 00 00 00 mov $0x17,%eax 4a0: cd 40 int $0x40 4a2: c3 ret 4a3: 66 90 xchg %ax,%ax 4a5: 66 90 xchg %ax,%ax 4a7: 66 90 xchg %ax,%ax 4a9: 66 90 xchg %ax,%ax 4ab: 66 90 xchg %ax,%ax 4ad: 66 90 xchg %ax,%ax 4af: 90 nop 000004b0 <printint>: write(fd, &c, 1); } static void printint(int fd, int xx, int base, int sgn) { 4b0: 55 push %ebp 4b1: 89 e5 mov %esp,%ebp 4b3: 57 push %edi 4b4: 56 push %esi 4b5: 53 push %ebx 4b6: 83 ec 3c sub $0x3c,%esp 4b9: 89 4d c4 mov %ecx,-0x3c(%ebp) uint x; neg = 0; if(sgn && xx < 0){ neg = 1; x = -xx; 4bc: 89 d1 mov %edx,%ecx { 4be: 89 45 b8 mov %eax,-0x48(%ebp) if(sgn && xx < 0){ 4c1: 85 d2 test %edx,%edx 4c3: 0f 89 7f 00 00 00 jns 548 <printint+0x98> 4c9: f6 45 08 01 testb $0x1,0x8(%ebp) 4cd: 74 79 je 548 <printint+0x98> neg = 1; 4cf: c7 45 bc 01 00 00 00 movl $0x1,-0x44(%ebp) x = -xx; 4d6: f7 d9 neg %ecx } else { x = xx; } i = 0; 4d8: 31 db xor %ebx,%ebx 4da: 8d 75 d7 lea -0x29(%ebp),%esi 4dd: 8d 76 00 lea 0x0(%esi),%esi do{ buf[i++] = digits[x % base]; 4e0: 89 c8 mov %ecx,%eax 4e2: 31 d2 xor %edx,%edx 4e4: 89 cf mov %ecx,%edi 4e6: f7 75 c4 divl -0x3c(%ebp) 4e9: 0f b6 92 08 09 00 00 movzbl 0x908(%edx),%edx 4f0: 89 45 c0 mov %eax,-0x40(%ebp) 4f3: 89 d8 mov %ebx,%eax 4f5: 8d 5b 01 lea 0x1(%ebx),%ebx }while((x /= base) != 0); 4f8: 8b 4d c0 mov -0x40(%ebp),%ecx buf[i++] = digits[x % base]; 4fb: 88 14 1e mov %dl,(%esi,%ebx,1) }while((x /= base) != 0); 4fe: 39 7d c4 cmp %edi,-0x3c(%ebp) 501: 76 dd jbe 4e0 <printint+0x30> if(neg) 503: 8b 4d bc mov -0x44(%ebp),%ecx 506: 85 c9 test %ecx,%ecx 508: 74 0c je 516 <printint+0x66> buf[i++] = '-'; 50a: c6 44 1d d8 2d movb $0x2d,-0x28(%ebp,%ebx,1) buf[i++] = digits[x % base]; 50f: 89 d8 mov %ebx,%eax buf[i++] = '-'; 511: ba 2d 00 00 00 mov $0x2d,%edx while(--i >= 0) 516: 8b 7d b8 mov -0x48(%ebp),%edi 519: 8d 5c 05 d7 lea -0x29(%ebp,%eax,1),%ebx 51d: eb 07 jmp 526 <printint+0x76> 51f: 90 nop 520: 0f b6 13 movzbl (%ebx),%edx 523: 83 eb 01 sub $0x1,%ebx write(fd, &c, 1); 526: 83 ec 04 sub $0x4,%esp 529: 88 55 d7 mov %dl,-0x29(%ebp) 52c: 6a 01 push $0x1 52e: 56 push %esi 52f: 57 push %edi 530: e8 de fe ff ff call 413 <write> while(--i >= 0) 535: 83 c4 10 add $0x10,%esp 538: 39 de cmp %ebx,%esi 53a: 75 e4 jne 520 <printint+0x70> putc(fd, buf[i]); } 53c: 8d 65 f4 lea -0xc(%ebp),%esp 53f: 5b pop %ebx 540: 5e pop %esi 541: 5f pop %edi 542: 5d pop %ebp 543: c3 ret 544: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi neg = 0; 548: c7 45 bc 00 00 00 00 movl $0x0,-0x44(%ebp) 54f: eb 87 jmp 4d8 <printint+0x28> 551: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 558: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 55f: 90 nop 00000560 <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, const char *fmt, ...) { 560: f3 0f 1e fb endbr32 564: 55 push %ebp 565: 89 e5 mov %esp,%ebp 567: 57 push %edi 568: 56 push %esi 569: 53 push %ebx 56a: 83 ec 2c sub $0x2c,%esp int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 56d: 8b 75 0c mov 0xc(%ebp),%esi 570: 0f b6 1e movzbl (%esi),%ebx 573: 84 db test %bl,%bl 575: 0f 84 b4 00 00 00 je 62f <printf+0xcf> ap = (uint*)(void*)&fmt + 1; 57b: 8d 45 10 lea 0x10(%ebp),%eax 57e: 83 c6 01 add $0x1,%esi write(fd, &c, 1); 581: 8d 7d e7 lea -0x19(%ebp),%edi state = 0; 584: 31 d2 xor %edx,%edx ap = (uint*)(void*)&fmt + 1; 586: 89 45 d0 mov %eax,-0x30(%ebp) 589: eb 33 jmp 5be <printf+0x5e> 58b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 58f: 90 nop 590: 89 55 d4 mov %edx,-0x2c(%ebp) c = fmt[i] & 0xff; if(state == 0){ if(c == '%'){ state = '%'; 593: ba 25 00 00 00 mov $0x25,%edx if(c == '%'){ 598: 83 f8 25 cmp $0x25,%eax 59b: 74 17 je 5b4 <printf+0x54> write(fd, &c, 1); 59d: 83 ec 04 sub $0x4,%esp 5a0: 88 5d e7 mov %bl,-0x19(%ebp) 5a3: 6a 01 push $0x1 5a5: 57 push %edi 5a6: ff 75 08 pushl 0x8(%ebp) 5a9: e8 65 fe ff ff call 413 <write> 5ae: 8b 55 d4 mov -0x2c(%ebp),%edx } else { putc(fd, c); 5b1: 83 c4 10 add $0x10,%esp for(i = 0; fmt[i]; i++){ 5b4: 0f b6 1e movzbl (%esi),%ebx 5b7: 83 c6 01 add $0x1,%esi 5ba: 84 db test %bl,%bl 5bc: 74 71 je 62f <printf+0xcf> c = fmt[i] & 0xff; 5be: 0f be cb movsbl %bl,%ecx 5c1: 0f b6 c3 movzbl %bl,%eax if(state == 0){ 5c4: 85 d2 test %edx,%edx 5c6: 74 c8 je 590 <printf+0x30> } } else if(state == '%'){ 5c8: 83 fa 25 cmp $0x25,%edx 5cb: 75 e7 jne 5b4 <printf+0x54> if(c == 'd'){ 5cd: 83 f8 64 cmp $0x64,%eax 5d0: 0f 84 9a 00 00 00 je 670 <printf+0x110> printint(fd, *ap, 10, 1); ap++; } else if(c == 'x' || c == 'p'){ 5d6: 81 e1 f7 00 00 00 and $0xf7,%ecx 5dc: 83 f9 70 cmp $0x70,%ecx 5df: 74 5f je 640 <printf+0xe0> printint(fd, *ap, 16, 0); ap++; } else if(c == 's'){ 5e1: 83 f8 73 cmp $0x73,%eax 5e4: 0f 84 d6 00 00 00 je 6c0 <printf+0x160> s = "(null)"; while(*s != 0){ putc(fd, *s); s++; } } else if(c == 'c'){ 5ea: 83 f8 63 cmp $0x63,%eax 5ed: 0f 84 8d 00 00 00 je 680 <printf+0x120> putc(fd, *ap); ap++; } else if(c == '%'){ 5f3: 83 f8 25 cmp $0x25,%eax 5f6: 0f 84 b4 00 00 00 je 6b0 <printf+0x150> write(fd, &c, 1); 5fc: 83 ec 04 sub $0x4,%esp 5ff: c6 45 e7 25 movb $0x25,-0x19(%ebp) 603: 6a 01 push $0x1 605: 57 push %edi 606: ff 75 08 pushl 0x8(%ebp) 609: e8 05 fe ff ff call 413 <write> putc(fd, c); } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); putc(fd, c); 60e: 88 5d e7 mov %bl,-0x19(%ebp) write(fd, &c, 1); 611: 83 c4 0c add $0xc,%esp 614: 6a 01 push $0x1 616: 83 c6 01 add $0x1,%esi 619: 57 push %edi 61a: ff 75 08 pushl 0x8(%ebp) 61d: e8 f1 fd ff ff call 413 <write> for(i = 0; fmt[i]; i++){ 622: 0f b6 5e ff movzbl -0x1(%esi),%ebx putc(fd, c); 626: 83 c4 10 add $0x10,%esp } state = 0; 629: 31 d2 xor %edx,%edx for(i = 0; fmt[i]; i++){ 62b: 84 db test %bl,%bl 62d: 75 8f jne 5be <printf+0x5e> } } } 62f: 8d 65 f4 lea -0xc(%ebp),%esp 632: 5b pop %ebx 633: 5e pop %esi 634: 5f pop %edi 635: 5d pop %ebp 636: c3 ret 637: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 63e: 66 90 xchg %ax,%ax printint(fd, *ap, 16, 0); 640: 83 ec 0c sub $0xc,%esp 643: b9 10 00 00 00 mov $0x10,%ecx 648: 6a 00 push $0x0 64a: 8b 5d d0 mov -0x30(%ebp),%ebx 64d: 8b 45 08 mov 0x8(%ebp),%eax 650: 8b 13 mov (%ebx),%edx 652: e8 59 fe ff ff call 4b0 <printint> ap++; 657: 89 d8 mov %ebx,%eax 659: 83 c4 10 add $0x10,%esp state = 0; 65c: 31 d2 xor %edx,%edx ap++; 65e: 83 c0 04 add $0x4,%eax 661: 89 45 d0 mov %eax,-0x30(%ebp) 664: e9 4b ff ff ff jmp 5b4 <printf+0x54> 669: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi printint(fd, *ap, 10, 1); 670: 83 ec 0c sub $0xc,%esp 673: b9 0a 00 00 00 mov $0xa,%ecx 678: 6a 01 push $0x1 67a: eb ce jmp 64a <printf+0xea> 67c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi putc(fd, *ap); 680: 8b 5d d0 mov -0x30(%ebp),%ebx write(fd, &c, 1); 683: 83 ec 04 sub $0x4,%esp putc(fd, *ap); 686: 8b 03 mov (%ebx),%eax write(fd, &c, 1); 688: 6a 01 push $0x1 ap++; 68a: 83 c3 04 add $0x4,%ebx write(fd, &c, 1); 68d: 57 push %edi 68e: ff 75 08 pushl 0x8(%ebp) putc(fd, *ap); 691: 88 45 e7 mov %al,-0x19(%ebp) write(fd, &c, 1); 694: e8 7a fd ff ff call 413 <write> ap++; 699: 89 5d d0 mov %ebx,-0x30(%ebp) 69c: 83 c4 10 add $0x10,%esp state = 0; 69f: 31 d2 xor %edx,%edx 6a1: e9 0e ff ff ff jmp 5b4 <printf+0x54> 6a6: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 6ad: 8d 76 00 lea 0x0(%esi),%esi putc(fd, c); 6b0: 88 5d e7 mov %bl,-0x19(%ebp) write(fd, &c, 1); 6b3: 83 ec 04 sub $0x4,%esp 6b6: e9 59 ff ff ff jmp 614 <printf+0xb4> 6bb: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 6bf: 90 nop s = (char*)*ap; 6c0: 8b 45 d0 mov -0x30(%ebp),%eax 6c3: 8b 18 mov (%eax),%ebx ap++; 6c5: 83 c0 04 add $0x4,%eax 6c8: 89 45 d0 mov %eax,-0x30(%ebp) if(s == 0) 6cb: 85 db test %ebx,%ebx 6cd: 74 17 je 6e6 <printf+0x186> while(*s != 0){ 6cf: 0f b6 03 movzbl (%ebx),%eax state = 0; 6d2: 31 d2 xor %edx,%edx while(*s != 0){ 6d4: 84 c0 test %al,%al 6d6: 0f 84 d8 fe ff ff je 5b4 <printf+0x54> 6dc: 89 75 d4 mov %esi,-0x2c(%ebp) 6df: 89 de mov %ebx,%esi 6e1: 8b 5d 08 mov 0x8(%ebp),%ebx 6e4: eb 1a jmp 700 <printf+0x1a0> s = "(null)"; 6e6: bb ff 08 00 00 mov $0x8ff,%ebx while(*s != 0){ 6eb: 89 75 d4 mov %esi,-0x2c(%ebp) 6ee: b8 28 00 00 00 mov $0x28,%eax 6f3: 89 de mov %ebx,%esi 6f5: 8b 5d 08 mov 0x8(%ebp),%ebx 6f8: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 6ff: 90 nop write(fd, &c, 1); 700: 83 ec 04 sub $0x4,%esp s++; 703: 83 c6 01 add $0x1,%esi 706: 88 45 e7 mov %al,-0x19(%ebp) write(fd, &c, 1); 709: 6a 01 push $0x1 70b: 57 push %edi 70c: 53 push %ebx 70d: e8 01 fd ff ff call 413 <write> while(*s != 0){ 712: 0f b6 06 movzbl (%esi),%eax 715: 83 c4 10 add $0x10,%esp 718: 84 c0 test %al,%al 71a: 75 e4 jne 700 <printf+0x1a0> 71c: 8b 75 d4 mov -0x2c(%ebp),%esi state = 0; 71f: 31 d2 xor %edx,%edx 721: e9 8e fe ff ff jmp 5b4 <printf+0x54> 726: 66 90 xchg %ax,%ax 728: 66 90 xchg %ax,%ax 72a: 66 90 xchg %ax,%ax 72c: 66 90 xchg %ax,%ax 72e: 66 90 xchg %ax,%ax 00000730 <free>: static Header base; static Header *freep; void free(void *ap) { 730: f3 0f 1e fb endbr32 734: 55 push %ebp Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 735: a1 00 0c 00 00 mov 0xc00,%eax { 73a: 89 e5 mov %esp,%ebp 73c: 57 push %edi 73d: 56 push %esi 73e: 53 push %ebx 73f: 8b 5d 08 mov 0x8(%ebp),%ebx 742: 8b 10 mov (%eax),%edx bp = (Header*)ap - 1; 744: 8d 4b f8 lea -0x8(%ebx),%ecx for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 747: 39 c8 cmp %ecx,%eax 749: 73 15 jae 760 <free+0x30> 74b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 74f: 90 nop 750: 39 d1 cmp %edx,%ecx 752: 72 14 jb 768 <free+0x38> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 754: 39 d0 cmp %edx,%eax 756: 73 10 jae 768 <free+0x38> { 758: 89 d0 mov %edx,%eax for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 75a: 8b 10 mov (%eax),%edx 75c: 39 c8 cmp %ecx,%eax 75e: 72 f0 jb 750 <free+0x20> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 760: 39 d0 cmp %edx,%eax 762: 72 f4 jb 758 <free+0x28> 764: 39 d1 cmp %edx,%ecx 766: 73 f0 jae 758 <free+0x28> break; if(bp + bp->s.size == p->s.ptr){ 768: 8b 73 fc mov -0x4(%ebx),%esi 76b: 8d 3c f1 lea (%ecx,%esi,8),%edi 76e: 39 fa cmp %edi,%edx 770: 74 1e je 790 <free+0x60> bp->s.size += p->s.ptr->s.size; bp->s.ptr = p->s.ptr->s.ptr; } else bp->s.ptr = p->s.ptr; 772: 89 53 f8 mov %edx,-0x8(%ebx) if(p + p->s.size == bp){ 775: 8b 50 04 mov 0x4(%eax),%edx 778: 8d 34 d0 lea (%eax,%edx,8),%esi 77b: 39 f1 cmp %esi,%ecx 77d: 74 28 je 7a7 <free+0x77> p->s.size += bp->s.size; p->s.ptr = bp->s.ptr; } else p->s.ptr = bp; 77f: 89 08 mov %ecx,(%eax) freep = p; } 781: 5b pop %ebx freep = p; 782: a3 00 0c 00 00 mov %eax,0xc00 } 787: 5e pop %esi 788: 5f pop %edi 789: 5d pop %ebp 78a: c3 ret 78b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 78f: 90 nop bp->s.size += p->s.ptr->s.size; 790: 03 72 04 add 0x4(%edx),%esi 793: 89 73 fc mov %esi,-0x4(%ebx) bp->s.ptr = p->s.ptr->s.ptr; 796: 8b 10 mov (%eax),%edx 798: 8b 12 mov (%edx),%edx 79a: 89 53 f8 mov %edx,-0x8(%ebx) if(p + p->s.size == bp){ 79d: 8b 50 04 mov 0x4(%eax),%edx 7a0: 8d 34 d0 lea (%eax,%edx,8),%esi 7a3: 39 f1 cmp %esi,%ecx 7a5: 75 d8 jne 77f <free+0x4f> p->s.size += bp->s.size; 7a7: 03 53 fc add -0x4(%ebx),%edx freep = p; 7aa: a3 00 0c 00 00 mov %eax,0xc00 p->s.size += bp->s.size; 7af: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; 7b2: 8b 53 f8 mov -0x8(%ebx),%edx 7b5: 89 10 mov %edx,(%eax) } 7b7: 5b pop %ebx 7b8: 5e pop %esi 7b9: 5f pop %edi 7ba: 5d pop %ebp 7bb: c3 ret 7bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 000007c0 <malloc>: return freep; } void* malloc(uint nbytes) { 7c0: f3 0f 1e fb endbr32 7c4: 55 push %ebp 7c5: 89 e5 mov %esp,%ebp 7c7: 57 push %edi 7c8: 56 push %esi 7c9: 53 push %ebx 7ca: 83 ec 1c sub $0x1c,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 7cd: 8b 45 08 mov 0x8(%ebp),%eax if((prevp = freep) == 0){ 7d0: 8b 3d 00 0c 00 00 mov 0xc00,%edi nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 7d6: 8d 70 07 lea 0x7(%eax),%esi 7d9: c1 ee 03 shr $0x3,%esi 7dc: 83 c6 01 add $0x1,%esi if((prevp = freep) == 0){ 7df: 85 ff test %edi,%edi 7e1: 0f 84 a9 00 00 00 je 890 <malloc+0xd0> base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 7e7: 8b 07 mov (%edi),%eax if(p->s.size >= nunits){ 7e9: 8b 48 04 mov 0x4(%eax),%ecx 7ec: 39 f1 cmp %esi,%ecx 7ee: 73 6d jae 85d <malloc+0x9d> 7f0: 81 fe 00 10 00 00 cmp $0x1000,%esi 7f6: bb 00 10 00 00 mov $0x1000,%ebx 7fb: 0f 43 de cmovae %esi,%ebx p = sbrk(nu * sizeof(Header)); 7fe: 8d 0c dd 00 00 00 00 lea 0x0(,%ebx,8),%ecx 805: 89 4d e4 mov %ecx,-0x1c(%ebp) 808: eb 17 jmp 821 <malloc+0x61> 80a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 810: 8b 10 mov (%eax),%edx if(p->s.size >= nunits){ 812: 8b 4a 04 mov 0x4(%edx),%ecx 815: 39 f1 cmp %esi,%ecx 817: 73 4f jae 868 <malloc+0xa8> 819: 8b 3d 00 0c 00 00 mov 0xc00,%edi 81f: 89 d0 mov %edx,%eax p->s.size = nunits; } freep = prevp; return (void*)(p + 1); } if(p == freep) 821: 39 c7 cmp %eax,%edi 823: 75 eb jne 810 <malloc+0x50> p = sbrk(nu * sizeof(Header)); 825: 83 ec 0c sub $0xc,%esp 828: ff 75 e4 pushl -0x1c(%ebp) 82b: e8 4b fc ff ff call 47b <sbrk> if(p == (char*)-1) 830: 83 c4 10 add $0x10,%esp 833: 83 f8 ff cmp $0xffffffff,%eax 836: 74 1b je 853 <malloc+0x93> hp->s.size = nu; 838: 89 58 04 mov %ebx,0x4(%eax) free((void*)(hp + 1)); 83b: 83 ec 0c sub $0xc,%esp 83e: 83 c0 08 add $0x8,%eax 841: 50 push %eax 842: e8 e9 fe ff ff call 730 <free> return freep; 847: a1 00 0c 00 00 mov 0xc00,%eax if((p = morecore(nunits)) == 0) 84c: 83 c4 10 add $0x10,%esp 84f: 85 c0 test %eax,%eax 851: 75 bd jne 810 <malloc+0x50> return 0; } } 853: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 856: 31 c0 xor %eax,%eax } 858: 5b pop %ebx 859: 5e pop %esi 85a: 5f pop %edi 85b: 5d pop %ebp 85c: c3 ret if(p->s.size >= nunits){ 85d: 89 c2 mov %eax,%edx 85f: 89 f8 mov %edi,%eax 861: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(p->s.size == nunits) 868: 39 ce cmp %ecx,%esi 86a: 74 54 je 8c0 <malloc+0x100> p->s.size -= nunits; 86c: 29 f1 sub %esi,%ecx 86e: 89 4a 04 mov %ecx,0x4(%edx) p += p->s.size; 871: 8d 14 ca lea (%edx,%ecx,8),%edx p->s.size = nunits; 874: 89 72 04 mov %esi,0x4(%edx) freep = prevp; 877: a3 00 0c 00 00 mov %eax,0xc00 } 87c: 8d 65 f4 lea -0xc(%ebp),%esp return (void*)(p + 1); 87f: 8d 42 08 lea 0x8(%edx),%eax } 882: 5b pop %ebx 883: 5e pop %esi 884: 5f pop %edi 885: 5d pop %ebp 886: c3 ret 887: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 88e: 66 90 xchg %ax,%ax base.s.ptr = freep = prevp = &base; 890: c7 05 00 0c 00 00 04 movl $0xc04,0xc00 897: 0c 00 00 base.s.size = 0; 89a: bf 04 0c 00 00 mov $0xc04,%edi base.s.ptr = freep = prevp = &base; 89f: c7 05 04 0c 00 00 04 movl $0xc04,0xc04 8a6: 0c 00 00 for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 8a9: 89 f8 mov %edi,%eax base.s.size = 0; 8ab: c7 05 08 0c 00 00 00 movl $0x0,0xc08 8b2: 00 00 00 if(p->s.size >= nunits){ 8b5: e9 36 ff ff ff jmp 7f0 <malloc+0x30> 8ba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi prevp->s.ptr = p->s.ptr; 8c0: 8b 0a mov (%edx),%ecx 8c2: 89 08 mov %ecx,(%eax) 8c4: eb b1 jmp 877 <malloc+0xb7>
db "PLAYHOUSE@" ; species name db "It will carefully" next "carry a round" next "white rock that it" page "thinks is an egg." next "It is bothererd by" next "its curly hair.@"
;ALP to find the Greatest Common Deviser of two unsigned integer. NAME Comprehensive TITLE gcd_two ;test passed ASSUME CS:CODE,DS:DATA DATA SEGMENT NUM1 DW 0017H NUM2 DW 0007H GCD DW ? DATA ENDS CODE SEGMENT START: MOV AX,DATA MOV DS,AX MOV AX,NUM1 MOV BX,NUM2 X1: CMP AX,BX JE X4 JB X3 X2: MOV DX,0000H DIV BX CMP DX,0000H JE X4 MOV AX,DX JMP X1 X3: XCHG AX,BX JMP X2 X4: MOV GCD ,BX OUT 0,BX MOV AH,4CH INT 21H CODE ENDS END START
/**************************************************************************** ** ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the config.tests of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage ** This file may be used under the terms of the GNU Lesser General Public ** License version 2.1 as published by the Free Software Foundation and ** appearing in the file LICENSE.LGPL included in the packaging of this ** file. Please review the following information to ensure the GNU Lesser ** General Public License version 2.1 requirements will be met: ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU General ** Public License version 3.0 as published by the Free Software Foundation ** and appearing in the file LICENSE.GPL included in the packaging of this ** file. Please review the following information to ensure the GNU General ** Public License version 3.0 requirements will be met: ** http://www.gnu.org/copyleft/gpl.html. ** ** Other Usage ** Alternatively, this file may be used in accordance with the terms and ** conditions contained in a signed written agreement between you and Nokia. ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #include <GL/gl.h> int main(int, char **) { GLuint x; x = 0; return 0; }
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r13 push %rax push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_WT_ht+0x1450d, %r13 nop nop nop nop nop dec %rdx mov (%r13), %rax nop nop nop cmp $46044, %rdx lea addresses_WT_ht+0x1e6ad, %r11 nop nop sub %rbx, %rbx mov $0x6162636465666768, %rdi movq %rdi, %xmm5 vmovups %ymm5, (%r11) nop sub %r11, %r11 lea addresses_UC_ht+0x3d75, %rsi lea addresses_UC_ht+0x11133, %rdi and %rdx, %rdx mov $6, %rcx rep movsb nop nop sub $54248, %rdx lea addresses_UC_ht+0xa50d, %rsi lea addresses_WC_ht+0x1ab0d, %rdi nop nop nop sub $10572, %rbx mov $43, %rcx rep movsq nop nop nop xor $57008, %rsi lea addresses_WT_ht+0x1990d, %rsi clflush (%rsi) nop nop nop nop nop xor %rdi, %rdi movl $0x61626364, (%rsi) xor %rsi, %rsi lea addresses_normal_ht+0x58d, %rsi nop nop nop nop and $32097, %rdi movl $0x61626364, (%rsi) nop nop nop nop and %r11, %r11 lea addresses_WC_ht+0x19b2d, %rcx nop nop nop and %rbx, %rbx mov $0x6162636465666768, %r13 movq %r13, %xmm0 vmovups %ymm0, (%rcx) nop nop nop and %r11, %r11 lea addresses_A_ht+0xde8d, %rsi lea addresses_UC_ht+0x1982b, %rdi clflush (%rdi) and %rdx, %rdx mov $73, %rcx rep movsq nop nop nop nop inc %rsi lea addresses_UC_ht+0x1d70d, %rsi lea addresses_UC_ht+0xaed6, %rdi nop nop nop and $63353, %rdx mov $36, %rcx rep movsb nop nop nop and $12307, %rbx lea addresses_D_ht+0xe765, %rax nop nop nop and $35945, %rdx mov (%rax), %r11 sub $39724, %rsi lea addresses_normal_ht+0x910d, %r11 nop nop nop nop nop lfence and $0xffffffffffffffc0, %r11 vmovaps (%r11), %ymm0 vextracti128 $1, %ymm0, %xmm0 vpextrq $0, %xmm0, %r13 nop nop cmp %rdx, %rdx lea addresses_normal_ht+0x1a9ed, %r13 nop nop nop nop add $47854, %rdi mov $0x6162636465666768, %rdx movq %rdx, %xmm6 vmovups %ymm6, (%r13) nop nop nop nop cmp $20323, %rcx lea addresses_WT_ht+0x14dd1, %rsi lea addresses_WC_ht+0x3b4d, %rdi nop nop nop nop nop cmp %r11, %r11 mov $2, %rcx rep movsl cmp %r13, %r13 lea addresses_WC_ht+0x113d, %rax add $60269, %rbx mov (%rax), %si nop add %r11, %r11 lea addresses_WT_ht+0x18c4d, %r11 nop nop nop nop add $6979, %rbx movb (%r11), %cl nop nop nop nop add $35680, %rbx pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %rax pop %r13 pop %r11 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r15 push %rbp push %rbx push %rdx push %rsi // Load lea addresses_PSE+0x1a10d, %rdx nop nop inc %rbp movb (%rdx), %r15b add $10444, %r11 // Store lea addresses_PSE+0x16924, %r12 nop nop nop nop nop sub $33006, %rsi mov $0x5152535455565758, %rbx movq %rbx, %xmm5 vmovups %ymm5, (%r12) nop nop and %r11, %r11 // Faulty Load lea addresses_PSE+0x1a10d, %rdx nop nop and $40110, %r15 vmovaps (%rdx), %ymm5 vextracti128 $0, %ymm5, %xmm5 vpextrq $0, %xmm5, %rsi lea oracles, %rbx and $0xff, %rsi shlq $12, %rsi mov (%rbx,%rsi,1), %rsi pop %rsi pop %rdx pop %rbx pop %rbp pop %r15 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_PSE', 'same': False, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_PSE', 'same': True, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_PSE', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} [Faulty Load] {'src': {'type': 'addresses_PSE', 'same': True, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 8, 'congruent': 9, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 32, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM'} {'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 4, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 4, 'congruent': 5, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'} {'dst': {'type': 'addresses_WC_ht', 'same': True, 'size': 32, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_A_ht', 'congruent': 7, 'same': True}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_D_ht', 'same': False, 'size': 8, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 32, 'congruent': 9, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 32, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_WT_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 2, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 1, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
; ; THIS FILE IS AUTOMATICALLY GENERATED ; !source "system/header.asm" !source "data/constants.asm" !source "data/zeropage.asm" !source "system/stackdata.asm" !source "data/memory.asm" !source "data/kernal.asm" !source "initialise/initialise.asm" !source "system/macros.asm" !source "system/indirection.asm" !source "system/tokeniser.asm" !source "tokeniser/keywords.asm" !source "tokeniser/keyword/esc.asm" !source "tokeniser/vectors.asm" !source "tokeniser/const.asm" !source "error/messages.asm" !source "error/constants.asm" !source "error/message.asm" !source "system/dispatcher.asm" !source "command/set1.asm" !source "function/dispatch.asm" !source "operator/binary.asm" !source "operator/relational.asm" !source "system/readyerror.asm" !source "error/handler.asm" !source "system/interface.asm" !source "system/execute.asm" !source "edit/shift.asm" !source "system/linkprogram.asm" !source "command/input/handler.asm" !source "system/stack.asm" !source "system/linesearch.asm" !source "command/text/get.asm" !source "command/list.asm" !source "command/list/basic.asm" !source "command/newclr.asm" !source "stack/init.asm" !source "command/return.asm" !source "command/data.asm" !source "command/ifthenelse.asm" !source "command/on.asm" !source "command/let/standard.asm" !source "command/text,print.asm" !source "command/text/input.asm" !source "command/next.asm" !source "command/dim.asm" !source "command/sys.asm" !source "command/dma.asm" !source "command/trace.asm" !source "command/sys/returnreg.asm" !source "command/let/midstring.asm" !source "command/auto.asm" !source "command/gotosub.asm" !source "command/continue.asm" !source "command/run.asm" !source "command/restore.asm" !source "command/renumber.asm" !source "command/for.asm" !source "command/delete.asm" !source "command/findchange.asm" !source "command/trap.asm" !source "command/resume.asm" !source "command/loops.asm" !source "command/key.asm" !source "command/bank.asm" !source "command/sound/play.asm" !source "command/sound/filter.asm" !source "command/sound/envelope.asm" !source "command/sound/volume.asm" !source "command/sound/sound.asm" !source "command/text/window.asm" !source "command/fastslow.asm" !source "system/evaluate.asm" !source "system/arrays.asm" !source "command/time.asm" !source "system/time.asm" !source "command/sleep.asm" !source "command/wait.asm" !source "function/fre.asm" !source "function/val.asm" !source "function/dec.asm" !source "command/peekpoke.asm" !source "function/errstr.asm" !source "function/hexstr.asm" !source "function/joy.asm" !source "function/potpen.asm" !source "function/pointer.asm" !source "operator/xor.asm" !source "operator/mod.asm" !source "function/rwindow.asm" !source "function/rnd.asm" !source "math/utils.asm" !source "function/userdef.asm" !source "function/stringmisc.asm" !source "string/manager.asm" !source "string/garbage.asm" !source "string/garbage/utils.asm" !source "math/parameters.asm" !source "math/addsub.asm" !source "math/const.asm" !source "math/log.asm" !source "math/multiply.asm" !source "math/unpack.asm" !source "math/integer.asm" !source "math/fpin.asm" !source "math/convert.asm" !source "math/logarithms.asm" !source "math/polyeval.asm" !source "math/trigonometry.asm" !source "system/boot.asm" !source "command/text/printusing.asm" !source "command/fform.asm" !source "function/instr.asm" !source "function/type.asm" !source "command/disk.asm" !source "dos/setup.asm" !source "command/ldir.asm" !source "function/dopen.asm" !source "command/bload.asm" !source "command/header.asm" !source "dos/errors.asm" !source "command/scratch.asm" !source "command/record.asm" !source "command/dclear.asm" !source "command/collect.asm" !source "command/copy.asm" !source "command/concat.asm" !source "command/rename.asm" !source "command/trans.asm" !source "dos/parser.asm" !source "dos/sendparam.asm" !source "handler/irq.asm" !source "command/mouse.asm" !source "function/rmouse.asm" !source "command/cursor.asm" !source "function/rcursor.asm" !source "command/graphics/screen.asm" !source "command/graphics/pen.asm" !source "command/graphics/dmode.asm" !source "command/graphics/dpat.asm" !source "command/graphics/palette.asm" !source "command/graphics/line.asm" !source "command/graphics/box.asm" !source "command/graphics/circle.asm" !source "command/graphics/ellipse.asm" !source "command/graphics/polygon.asm" !source "command/graphics/set.asm" !source "command/graphics/char.asm" !source "command/graphics/paint.asm" !source "command/graphics/loadiff.asm" !source "command/graphics/saveiff.asm" !source "command/graphics/viewport.asm" !source "command/graphics/genlock.asm" !source "command/graphics/color.asm" !source "command/graphics/sprite.asm" !source "command/graphics/movspr.asm" !source "command/graphics/sprcor.asm" !source "command/graphics/sprcolor.asm" !source "command/graphics/collision.asm" !source "function/graphics/rcolor.asm" !source "function/graphics/rgraphic.asm" !source "function/graphics/pixel.asm" !source "function/graphics/rpen.asm" !source "function/graphics/rpalette.asm" !source "function/graphics/rsprite.asm" !source "function/graphics/rsppos.asm" !source "function/graphics/bump.asm" !source "edit/mode.asm" !source "initialise/sprites.asm" !source "handler/nmi.asm" !source "system/jumptable.asm"
; A270299: Numbers which are representable as a sum of eleven but no fewer consecutive nonnegative integers. ; Submitted by Jon Maiga ; 88,176,352,704,968,1144,1408,1496,1672,1936,2024,2288,2552,2728,2816,2992,3256,3344,3608,3784,3872,4048,4136,4576,4664,5104,5192,5368,5456,5632,5896,5984,6248,6424,6512,6688,6952,7216,7304,7568,7744,7832,8096,8272,8536,8888,9064,9152,9328,9416,9592,9944,10208,10384,10648,10736,10912,11176,11264,11528,11792,11968,12056,12232,12496,12584,12848,13024,13112,13288,13376,13816,13904,14344,14432,14608,14696,14872,15136,15224,15488,15664,15752,15928,16192,16456,16544,16808,16984,17072,17336,17512,17776 mov $2,1 lpb $0 mov $3,$2 lpb $3 add $2,1 mov $4,105 gcd $4,$2 cmp $4,1 cmp $4,0 sub $3,$4 lpe sub $0,1 add $2,1 lpe mov $0,$2 mul $0,88
#include <iostream> #include <vector> using namespace std; vector<int> optimal_summands(int n) { vector<int> summands; int a = 0; while (n > 0) { int next_a = a + 2; int next_n = n - (a + 1); if (next_a > next_n) { a = n; } else { a = a + 1; } summands.push_back(a); n -= a; } return summands; } int main() { int n; cin >> n; vector<int> summands = optimal_summands(n); cout << summands.size() << '\n'; for (size_t i = 0; i < summands.size(); ++i) { cout << summands[i] << ' '; } }
;************************************************************************** ;* * ;* OCaml * ;* * ;* Xavier Leroy, projet Gallium, INRIA Rocquencourt * ;* * ;* Copyright 2006 Institut National de Recherche en Informatique et * ;* en Automatique. * ;* * ;* All rights reserved. This file is distributed under the terms of * ;* the GNU Lesser General Public License version 2.1, with the * ;* special exception on linking described in the file LICENSE. * ;* * ;************************************************************************** ; Asm part of the runtime system, AMD64 processor, Intel syntax ; Notes on Win64 calling conventions: ; function arguments in RCX, RDX, R8, R9 / XMM0 - XMM3 ; caller must reserve 32 bytes of stack space ; callee must preserve RBX, RBP, RSI, RDI, R12-R15, XMM6-XMM15 EXTRN caml_garbage_collection: NEAR EXTRN caml_apply2: NEAR EXTRN caml_apply3: NEAR EXTRN caml_program: NEAR EXTRN caml_array_bound_error: NEAR EXTRN caml_stash_backtrace: NEAR INCLUDE domain_state64.inc .CODE PUBLIC caml_system__code_begin caml_system__code_begin: ret ; just one instruction, so that debuggers don't display ; caml_system__code_begin instead of caml_call_gc ; Allocation PUBLIC caml_call_gc ALIGN 16 caml_call_gc: ; Record lowest stack address and return address mov r11, [rsp] Store_last_return_address r11 lea r11, [rsp+8] Store_bottom_of_stack r11 ; Touch the stack to trigger a recoverable segfault ; if insufficient space remains sub rsp, 01000h mov [rsp], r11 add rsp, 01000h ; Save young_ptr Store_young_ptr r15 ; Build array of registers, save it into Caml_state(gc_regs) push rbp push r11 push r10 push r13 push r12 push r9 push r8 push rcx push rdx push rsi push rdi push rbx push rax Store_gc_regs rsp ; Save floating-point registers sub rsp, 16*8 movsd QWORD PTR [rsp + 0*8], xmm0 movsd QWORD PTR [rsp + 1*8], xmm1 movsd QWORD PTR [rsp + 2*8], xmm2 movsd QWORD PTR [rsp + 3*8], xmm3 movsd QWORD PTR [rsp + 4*8], xmm4 movsd QWORD PTR [rsp + 5*8], xmm5 movsd QWORD PTR [rsp + 6*8], xmm6 movsd QWORD PTR [rsp + 7*8], xmm7 movsd QWORD PTR [rsp + 8*8], xmm8 movsd QWORD PTR [rsp + 9*8], xmm9 movsd QWORD PTR [rsp + 10*8], xmm10 movsd QWORD PTR [rsp + 11*8], xmm11 movsd QWORD PTR [rsp + 12*8], xmm12 movsd QWORD PTR [rsp + 13*8], xmm13 movsd QWORD PTR [rsp + 14*8], xmm14 movsd QWORD PTR [rsp + 15*8], xmm15 ; Call the garbage collector sub rsp, 32 ; PR#5008: bottom 32 bytes are reserved for callee call caml_garbage_collection add rsp, 32 ; PR#5008 ; Restore all regs used by the code generator movsd xmm0, QWORD PTR [rsp + 0*8] movsd xmm1, QWORD PTR [rsp + 1*8] movsd xmm2, QWORD PTR [rsp + 2*8] movsd xmm3, QWORD PTR [rsp + 3*8] movsd xmm4, QWORD PTR [rsp + 4*8] movsd xmm5, QWORD PTR [rsp + 5*8] movsd xmm6, QWORD PTR [rsp + 6*8] movsd xmm7, QWORD PTR [rsp + 7*8] movsd xmm8, QWORD PTR [rsp + 8*8] movsd xmm9, QWORD PTR [rsp + 9*8] movsd xmm10, QWORD PTR [rsp + 10*8] movsd xmm11, QWORD PTR [rsp + 11*8] movsd xmm12, QWORD PTR [rsp + 12*8] movsd xmm13, QWORD PTR [rsp + 13*8] movsd xmm14, QWORD PTR [rsp + 14*8] movsd xmm15, QWORD PTR [rsp + 15*8] add rsp, 16*8 pop rax pop rbx pop rdi pop rsi pop rdx pop rcx pop r8 pop r9 pop r12 pop r13 pop r10 pop r11 pop rbp ; Restore Caml_state(young_ptr) Load_young_ptr r15 ; Return to caller ret PUBLIC caml_alloc1 ALIGN 16 caml_alloc1: sub r15, 16 Cmp_young_limit r15 jb caml_call_gc ret PUBLIC caml_alloc2 ALIGN 16 caml_alloc2: sub r15, 24 Cmp_young_limit r15 jb caml_call_gc ret PUBLIC caml_alloc3 ALIGN 16 caml_alloc3: sub r15, 32 Cmp_young_limit r15 jb caml_call_gc ret PUBLIC caml_allocN ALIGN 16 caml_allocN: Cmp_young_limit r15 jb caml_call_gc ret ; Call a C function from OCaml PUBLIC caml_c_call ALIGN 16 caml_c_call: ; Record lowest stack address and return address pop r12 Store_last_return_address r12 Store_bottom_of_stack rsp ; Touch the stack to trigger a recoverable segfault ; if insufficient space remains sub rsp, 01000h mov [rsp], rax add rsp, 01000h ; Make the alloc ptr available to the C code Store_young_ptr r15 ; Call the function (address in rax) call rax ; Reload alloc ptr Load_young_ptr r15 ; Return to caller push r12 ret ; Start the OCaml program PUBLIC caml_start_program ALIGN 16 caml_start_program: ; Save callee-save registers push rbx push rbp push rsi push rdi push r12 push r13 push r14 push r15 sub rsp, 8+10*16 ; stack 16-aligned + 10 saved xmm regs movapd OWORD PTR [rsp + 0*16], xmm6 movapd OWORD PTR [rsp + 1*16], xmm7 movapd OWORD PTR [rsp + 2*16], xmm8 movapd OWORD PTR [rsp + 3*16], xmm9 movapd OWORD PTR [rsp + 4*16], xmm10 movapd OWORD PTR [rsp + 5*16], xmm11 movapd OWORD PTR [rsp + 6*16], xmm12 movapd OWORD PTR [rsp + 7*16], xmm13 movapd OWORD PTR [rsp + 8*16], xmm14 movapd OWORD PTR [rsp + 9*16], xmm15 ; First argument (rcx) is Caml_state. Load it in r14 mov r14, rcx ; Initial entry point is caml_program lea r12, caml_program ; Common code for caml_start_program and caml_callback* L106: ; Build a callback link sub rsp, 8 ; stack 16-aligned Push_gc_regs Push_last_return_address Push_bottom_of_stack ; Setup alloc ptr Load_young_ptr r15 ; Build an exception handler lea r13, L108 push r13 Push_exception_pointer Store_exception_pointer rsp ; Call the OCaml code call r12 L107: ; Pop the exception handler Pop_exception_pointer pop r12 ; dummy register L109: ; Update alloc ptr Store_young_ptr r15 ; Pop the callback restoring, link the global variables Pop_bottom_of_stack Pop_last_return_address Pop_gc_regs add rsp, 8 ; Restore callee-save registers. movapd xmm6, OWORD PTR [rsp + 0*16] movapd xmm7, OWORD PTR [rsp + 1*16] movapd xmm8, OWORD PTR [rsp + 2*16] movapd xmm9, OWORD PTR [rsp + 3*16] movapd xmm10, OWORD PTR [rsp + 4*16] movapd xmm11, OWORD PTR [rsp + 5*16] movapd xmm12, OWORD PTR [rsp + 6*16] movapd xmm13, OWORD PTR [rsp + 7*16] movapd xmm14, OWORD PTR [rsp + 8*16] movapd xmm15, OWORD PTR [rsp + 9*16] add rsp, 8+10*16 pop r15 pop r14 pop r13 pop r12 pop rdi pop rsi pop rbp pop rbx ; Return to caller ret L108: ; Exception handler ; Mark the bucket as an exception result and return it or rax, 2 jmp L109 ; Raise an exception from OCaml PUBLIC caml_raise_exn ALIGN 16 caml_raise_exn: Load_backtrace_active r11 test r11, 1 jne L110 Load_exception_pointer rsp ; Cut stack ; Recover previous exception handler Pop_exception_pointer ret ; Branch to handler L110: mov r12, rax ; Save exception bucket in r12 mov rcx, rax ; Arg 1: exception bucket mov rdx, [rsp] ; Arg 2: PC of raise lea r8, [rsp+8] ; Arg 3: SP of raise Load_exception_pointer r9 ; Arg 4: SP of handler sub rsp, 32 ; Reserve 32 bytes on stack call caml_stash_backtrace mov rax, r12 ; Recover exception bucket Load_exception_pointer rsp ; Cut stack ; Recover previous exception handler Pop_exception_pointer ret ; Branch to handler ; Raise an exception from C PUBLIC caml_raise_exception ALIGN 16 caml_raise_exception: mov r14, rcx ; First argument is Caml_state Load_backtrace_active r11 test r11, 1 jne L112 mov rax, rdx ; Second argument is exn bucket Load_exception_pointer rsp ; Recover previous exception handler Pop_exception_pointer Load_young_ptr r15 ; Reload alloc ptr ret L112: mov r12, rdx ; Save exception bucket in r12 mov rcx, rdx ; Arg 1: exception bucket Load_last_return_address rdx ; Arg 2: PC of raise Load_bottom_of_stack r8 ; Arg 3: SP of raise Load_exception_pointer r9 ; Arg 4: SP of handler sub rsp, 32 ; Reserve 32 bytes on stack call caml_stash_backtrace mov rax, r12 ; Recover exception bucket Load_exception_pointer rsp ; Recover previous exception handler Pop_exception_pointer Load_young_ptr r15; Reload alloc ptr ret ; Callback from C to OCaml PUBLIC caml_callback_asm ALIGN 16 caml_callback_asm: ; Save callee-save registers push rbx push rbp push rsi push rdi push r12 push r13 push r14 push r15 sub rsp, 8+10*16 ; stack 16-aligned + 10 saved xmm regs movapd OWORD PTR [rsp + 0*16], xmm6 movapd OWORD PTR [rsp + 1*16], xmm7 movapd OWORD PTR [rsp + 2*16], xmm8 movapd OWORD PTR [rsp + 3*16], xmm9 movapd OWORD PTR [rsp + 4*16], xmm10 movapd OWORD PTR [rsp + 5*16], xmm11 movapd OWORD PTR [rsp + 6*16], xmm12 movapd OWORD PTR [rsp + 7*16], xmm13 movapd OWORD PTR [rsp + 8*16], xmm14 movapd OWORD PTR [rsp + 9*16], xmm15 ; Initial loading of arguments mov r14, rcx ; Caml_state mov rbx, rdx ; closure mov rax, [r8] ; argument mov r12, [rbx] ; code pointer jmp L106 PUBLIC caml_callback2_asm ALIGN 16 caml_callback2_asm: ; Save callee-save registers push rbx push rbp push rsi push rdi push r12 push r13 push r14 push r15 sub rsp, 8+10*16 ; stack 16-aligned + 10 saved xmm regs movapd OWORD PTR [rsp + 0*16], xmm6 movapd OWORD PTR [rsp + 1*16], xmm7 movapd OWORD PTR [rsp + 2*16], xmm8 movapd OWORD PTR [rsp + 3*16], xmm9 movapd OWORD PTR [rsp + 4*16], xmm10 movapd OWORD PTR [rsp + 5*16], xmm11 movapd OWORD PTR [rsp + 6*16], xmm12 movapd OWORD PTR [rsp + 7*16], xmm13 movapd OWORD PTR [rsp + 8*16], xmm14 movapd OWORD PTR [rsp + 9*16], xmm15 ; Initial loading of arguments mov r14, rcx ; Caml_state mov rdi, rdx ; closure mov rax, [r8] ; first argument mov rbx, [r8 + 8] ; second argument lea r12, caml_apply2 ; code pointer jmp L106 PUBLIC caml_callback3_asm ALIGN 16 caml_callback3_asm: ; Save callee-save registers push rbx push rbp push rsi push rdi push r12 push r13 push r14 push r15 sub rsp, 8+10*16 ; stack 16-aligned + 10 saved xmm regs movapd OWORD PTR [rsp + 0*16], xmm6 movapd OWORD PTR [rsp + 1*16], xmm7 movapd OWORD PTR [rsp + 2*16], xmm8 movapd OWORD PTR [rsp + 3*16], xmm9 movapd OWORD PTR [rsp + 4*16], xmm10 movapd OWORD PTR [rsp + 5*16], xmm11 movapd OWORD PTR [rsp + 6*16], xmm12 movapd OWORD PTR [rsp + 7*16], xmm13 movapd OWORD PTR [rsp + 8*16], xmm14 movapd OWORD PTR [rsp + 9*16], xmm15 ; Initial loading of arguments mov r14, rcx ; Caml_state mov rsi, rdx ; closure mov rax, [r8] ; first argument mov rbx, [r8 + 8] ; second argument mov rdi, [r8 + 16] ; third argument lea r12, caml_apply3 ; code pointer jmp L106 PUBLIC caml_ml_array_bound_error ALIGN 16 caml_ml_array_bound_error: lea rax, caml_array_bound_error jmp caml_c_call PUBLIC caml_system__code_end caml_system__code_end: .DATA PUBLIC caml_system__frametable caml_system__frametable LABEL QWORD QWORD 1 ; one descriptor QWORD L107 ; return address into callback WORD -1 ; negative frame size => use callback link WORD 0 ; no roots here ALIGN 8 PUBLIC caml_negf_mask ALIGN 16 caml_negf_mask LABEL QWORD QWORD 8000000000000000H, 0 PUBLIC caml_absf_mask ALIGN 16 caml_absf_mask LABEL QWORD QWORD 7FFFFFFFFFFFFFFFH, 0FFFFFFFFFFFFFFFFH END
; Copyright (C) 2021 Mateus de Lima Oliveira global enter_pm enter_pm: ret _idt:
SECTION "Intro", ROMX Intro:: ; Remove this line ; Put your code here! ld a,HIGH(wShadowOAM) ldh [hOAMHigh],a ld hl, wDvdLogoLoc ld b,13 ;13 metasprites .MoveMetaSprite ld a, [hl+] add a, [hl]; Add Y-Velocity to Y-Position dec l ld [hl+], a cp 144 + 16 - 16 ; is it at the past the vertical edge of the screen? call nc, InvHL cp 16 call c, InvHL inc l ;now we do the same for the X component ld a, [hl+] add a, [hl] dec l ld [hl+], a cp 160 + 8 - 8 * 3 ; is it past the horizontal edge of the screen? call nc, InvHL ;skip the velocity invert if it's not cp 8 call c, InvHL inc l dec b jr nz,.MoveMetaSprite call SetMetaspriteCoords rst WaitVBlank jr Intro SECTION "Move Metasprite", ROM0 SetMetaspriteCoords:: ld hl, wShadowOAM ld de, wDvdLogoLoc ld b,13 ;13 metasprites .setMetasprites ld a, [de]; load y coord inc e inc e ld c, a; y -> c ld a, [de]; load x coord inc e inc de ld [hl], c;store y in shadow OAM inc l ld [hl+], a inc l inc hl; since the shadow OAM is aligned and each sprite is 4 bytes long, only every 4th inc needs to inc hl rather than just l. add a,8 ;the next sprite should be 8 px further down ld [hl], c inc l ld [hl+], a ; do this 2 more times for the other sprites inc l inc hl add a,8 ld [hl], c inc l ld [hl+], a inc l inc hl dec b jr nz,.setMetasprites ret SECTION "InvHL",ROM0 InvHL::;hl gets inverted, a is destroyed ld a, [hl] cpl inc a ld [hl],a ret SECTION "Sprites", ROM0 SpriteTiles:: INCBIN "dvdvideo.bin" SpriteTilesEnd:: SECTION "DvdLogoLoc", WRAM0,ALIGN[2] wDvdLogoLoc:: ds 4*13;struct of arrays. 4 bytes, y then y-velocity then x then x-velocity, times 13 metasprite structs
SECTION code_fp_math48 PUBLIC asm_sqrt EXTERN am48_sqrt defc asm_sqrt = am48_sqrt
*= $0801 .byte $4c,$14,$08,$00,$97 turboass = 780 .text "780" .byte $2c,$30,$3a,$9e,$32,$30 .byte $37,$33,$00,$00,$00 lda #1 sta turboass jmp main code = $2800 data = $29c0 zerodata = $f7 zeroptr = $f7;$f8 ptable = 172;173 bcmd .byte 0 pcode = 174;175 db = %00011011 ab = %11000110 xb = %10110001 yb = %01101100 da = data aa .byte 0 xa .byte 0 ya .byte 0 pa .byte 0 main jsr print .byte 13 .text "(up)trap1" .byte 0 lda #<code sta pcode+0 lda #>code sta pcode+1 lda #<table sta ptable+0 lda #>table sta ptable+1 nextcommand ldy #0 lda bcmd sta (pcode),y lda #$60 iny sta (pcode),y iny sta (pcode),y iny sta (pcode),y ldy #3 lda (ptable),y sta jump+1 iny lda (ptable),y sta jump+2 waitborder lda $d011 bmi jump lda $d012 cmp #30 bcs waitborder jump jsr $1111 ldy #5 lda da cmp (ptable),y bne error iny lda aa cmp (ptable),y bne error iny lda xa cmp (ptable),y bne error iny lda ya cmp (ptable),y bne error iny lda pa cmp (ptable),y bne error nostop clc lda ptable+0 adc #10 sta ptable+0 lda ptable+1 adc #0 sta ptable+1 inc bcmd bne jmpnextcommand jmp ok jmpnextcommand jmp nextcommand error lda #13 jsr $ffd2 ldy #0 lda (ptable),y jsr $ffd2 iny lda (ptable),y jsr $ffd2 iny lda (ptable),y jsr $ffd2 lda #32 jsr $ffd2 lda bcmd jsr printhb jsr print .byte 13 .text "after " .byte 0 lda da jsr printhb lda #32 jsr $ffd2 jsr $ffd2 lda aa jsr printhb lda #32 jsr $ffd2 lda xa jsr printhb lda #32 jsr $ffd2 lda ya jsr printhb lda #32 jsr $ffd2 jsr $ffd2 lda pa jsr printhb jsr print .byte 13 .text "right " .byte 0 ldy #5 lda (ptable),y jsr printhb lda #32 jsr $ffd2 jsr $ffd2 iny lda (ptable),y jsr printhb lda #32 jsr $ffd2 iny lda (ptable),y jsr printhb lda #32 jsr $ffd2 iny lda (ptable),y jsr printhb lda #32 jsr $ffd2 jsr $ffd2 iny lda (ptable),y jsr printhb lda #13 jsr $ffd2 waitkey jsr $ffe4 beq waitkey cmp #3 bne jmpnostop lda turboass beq return jmp $8000 jmpnostop jmp nostop return lda #47 sta 0 rts ok jsr print .text " - ok" .byte 13,0 lda turboass beq load wait jsr $ffe4 beq wait jmp $8000 load lda #47 sta 0 jsr print name .text "trap2" namelen = *-name .byte 0 lda #0 sta $0a sta $b9 lda #namelen sta $b7 lda #<name sta $bb lda #>name sta $bc pla pla jmp $e16f print pla .block sta print0+1 pla sta print0+2 ldx #1 print0 lda !*,x beq print1 jsr $ffd2 inx bne print0 print1 sec txa adc print0+1 sta print2+1 lda #0 adc print0+2 sta print2+2 print2 jmp !* .bend printhb .block pha lsr a lsr a lsr a lsr a jsr printhn pla and #$0f printhn ora #$30 cmp #$3a bcc printhn0 adc #6 printhn0 jsr $ffd2 rts .bend savesp .byte 0 savedstack = $2a00;2aff savestack .block tsx stx savesp ldx #0 save lda $0100,x sta savedstack,x inx bne save rts .bend restorestack .block pla sta retlow+1 pla sta rethigh+1 ldx savesp inx inx txs ldx #0 restore lda savedstack,x sta $0100,x inx bne restore rethigh lda #$11 pha retlow lda #$11 pha rts .bend execute lda #0 pha lda #db sta da lda #ab ldx #xb ldy #yb plp jsr jmppcode php cld sta aa stx xa sty ya pla sta pa rts jmppcode jmp (pcode) n jsr execute rts b lda #db ldy #1 sta (pcode),y jsr execute rts z lda #zerodata ldy #1 sta (pcode),y lda #db sta zerodata jsr execute lda zerodata sta da rts zx lda #zerodata-xb&$ff ldy #1 sta (pcode),y lda #db sta zerodata jsr execute lda zerodata sta da rts zy lda #zerodata-yb&$ff ldy #1 sta (pcode),y lda #db sta zerodata jsr execute lda zerodata sta da rts a ldy #1 lda #<da sta (pcode),y iny lda #>da sta (pcode),y jsr execute rts ax ldy #1 lda #<(da-xb) sta (pcode),y iny lda #>(da-xb) sta (pcode),y jsr execute rts ay ldy #1 lda #<(da-yb) sta (pcode),y iny lda #>(da-yb) sta (pcode),y jsr execute rts ix ldy #1 lda #zeroptr-xb&$ff sta (pcode),y lda #<da sta zeroptr+0&$ff lda #>da sta zeroptr+1&$ff jsr execute rts iy ldy #1 lda #zeroptr sta (pcode),y lda #<(da-yb) sta zeroptr+0&$ff lda #>(da-yb) sta zeroptr+1&$ff jsr execute rts r lda #1 ldy #1 sta (pcode),y lda #0 pha lda #db sta da lda #ab ldx #xb ldy #yb plp jsr jmppcode lda #$f3 pha lda #db sta da lda #ab ldx #xb ldy #yb plp jsr jmppcode dec pcode+1 lda #$60 ldy #130 sta (pcode),y inc pcode+1 lda #128 ldy #1 sta (pcode),y lda #0 pha lda #db sta da lda #ab ldx #xb ldy #yb plp jsr jmppcode lda #$f3 pha lda #db sta da lda #ab ldx #xb ldy #yb plp jsr jmppcode php cld sta aa stx xa sty ya pla sta pa rts hltn lda #0 sta da sta aa sta xa sta ya sta pa rts brkn .block lda #<continue sta $fffe lda #>continue sta $ffff sei lda 0 sta old0+1 lda #47 sta 0 lda 1 sta old1+1 and #$fd sta 1 lda #0 pha lda #ab ldx #xb ldy #yb plp jmp (pcode) continue php cld sta aa stx xa sty ya pla sta pa old1 lda #$11 sta 1 old0 lda #$11 sta 0 lda #db sta da cli pla pla pla rts .bend jmpi .block lda #<zeroptr ldy #1 sta (pcode),y lda #>zeroptr iny sta (pcode),y lda #<continue sta zeroptr+0&$ff lda #>continue sta zeroptr+1&$ff lda #0 pha lda #db sta da lda #ab ldx #xb ldy #yb plp jmp (pcode) continue php cld sta aa stx xa sty ya pla sta pa rts .bend jmpw .block lda #<continue ldy #1 sta (pcode),y lda #>continue iny sta (pcode),y lda #0 pha lda #db sta da lda #ab ldx #xb ldy #yb plp jmp (pcode) continue php cld sta aa stx xa sty ya pla sta pa rts .bend jsrw .block lda #<continue ldy #1 sta (pcode),y lda #>continue iny sta (pcode),y lda #0 pha lda #db sta da lda #ab ldx #xb ldy #yb plp jmp (pcode) continue php cld sta aa stx xa sty ya pla sta pa pla pla rts .bend rtin .block lda #>continue pha lda #<continue pha lda #$b3 pha lda #0 pha lda #db sta da lda #ab ldx #xb ldy #yb plp jmp (pcode) continue php cld sta aa stx xa sty ya pla sta pa rts .bend txsn .block lda #$4c ldy #1 sta (pcode),y lda #<continue iny sta (pcode),y lda #>continue iny sta (pcode),y jsr savestack lda #0 pha lda #db sta da lda #ab ldx #xb ldy #yb plp jmp (pcode) continue php cld sta aa stx xa sty ya pla sta pa tsx stx newsp+1 jsr restorestack newsp lda #$11 cmp #xb bne wrong rts wrong pla pla jmp error .bend plan .block lda #$4c ldy #1 sta (pcode),y lda #<continue iny sta (pcode),y lda #>continue iny sta (pcode),y lda #$f0 pha lda #0 pha lda #db sta da lda #ab ldx #xb ldy #yb plp jmp (pcode) continue php cld sta aa stx xa sty ya pla sta pa rts .bend phan .block lda #$4c ldy #1 sta (pcode),y lda #<continue iny sta (pcode),y lda #>continue iny sta (pcode),y lda #0 pha lda #db sta da lda #ab ldx #xb ldy #yb plp jmp (pcode) continue php cld sta aa stx xa sty ya pla sta pa pla cmp #ab bne wrong rts wrong pla pla jmp error .bend plpn .block lda #$4c ldy #1 sta (pcode),y lda #<continue iny sta (pcode),y lda #>continue iny sta (pcode),y lda #$b3 pha lda #0 pha lda #db sta da lda #ab ldx #xb ldy #yb plp jmp (pcode) continue php cld sta aa stx xa sty ya pla sta pa rts .bend phpn .block lda #$4c ldy #1 sta (pcode),y lda #<continue iny sta (pcode),y lda #>continue iny sta (pcode),y lda #0 pha lda #db sta da lda #ab ldx #xb ldy #yb plp jmp (pcode) continue php cld sta aa stx xa sty ya pla sta pa pla cmp #$30 bne wrong rts wrong pla pla jmp error .bend shaay .ifpl da&$ff-$c0 lda #>da clc adc #1 and #ab and #xb ldy #5 sta (ptable),y jmp ay .endif shaiy .ifpl da&$ff-$c0 lda #>da clc adc #1 and #ab and #xb ldy #5 sta (ptable),y jmp iy .endif shxay .ifpl da&$ff-$c0 lda #>da clc adc #1 and #xb ldy #5 sta (ptable),y jmp ay .endif shyax .ifpl da&$ff-$c0 lda #>da clc adc #1 and #yb ldy #5 sta (ptable),y jmp ax .endif shsay .ifpl da&$ff-$c0 .block lda #ab and #xb sta sr+1 ldx #>da inx stx andx+1 andx and #$11 ldy #5 sta (ptable),y jsr savestack lda #<da-yb ldy #1 sta (pcode),y lda #>da-yb iny sta (pcode),y lda #$4c iny sta (pcode),y lda #<continue iny sta (pcode),y lda #>continue iny sta (pcode),y lda #0 pha lda #db sta da lda #ab ldx #xb ldy #yb plp jmp (pcode) continue php cld sta aa stx xa sty ya pla sta pa tsx stx sa+1 jsr restorestack sa lda #$11 ldy #6 sr cmp #$11 bne wrong rts wrong pla pla jmp error .bend .endif .ifmi da&$ff-$c0 pla pla jmp nostop .endif lasay .block tsx txa and #db php ldy #6 sta (ptable),y iny sta (ptable),y pla and #%10110010 ldy #9 sta (ptable),y jsr savestack lda #<da-yb ldy #1 sta (pcode),y lda #>da-yb iny sta (pcode),y lda #$4c iny sta (pcode),y lda #<continue iny sta (pcode),y lda #>continue iny sta (pcode),y lda #0 pha lda #db sta da lda #ab ldx #xb ldy #yb plp jmp (pcode) continue php cld sta aa stx xa sty ya pla sta pa tsx stx sa+1 jsr restorestack sa lda #$11 ldy #6 cmp (ptable),y bne wrong rts wrong pla pla jmp error .bend tsxn jsr execute tsx dex dex dex dex php txa ldy #7 sta (ptable),y pla ldy #9 sta (ptable),y rts table .text "brk" .word brkn .byte $1b,$c6,$b1,$6c,$34 .text "ora" .word ix .byte $1b,$df,$b1,$6c,$b0 .text "hlt" .word hltn .byte $00,$00,$00,$00,$00 .text "aso" .word ix .byte $36,$f6,$b1,$6c,$b0 .text "nop" .word z .byte $1b,$c6,$b1,$6c,$30 .text "ora" .word z .byte $1b,$df,$b1,$6c,$b0 .text "asl" .word z .byte $36,$c6,$b1,$6c,$30 .text "aso" .word z .byte $36,$f6,$b1,$6c,$b0 .text "php" .word phpn .byte $1b,$c6,$b1,$6c,$30 .text "ora" .word b .byte $1b,$df,$b1,$6c,$b0 .text "asl" .word n .byte $1b,$8c,$b1,$6c,$b1 .text "anc" .word b .byte $1b,$02,$b1,$6c,$30 .text "nop" .word a .byte $1b,$c6,$b1,$6c,$30 .text "ora" .word a .byte $1b,$df,$b1,$6c,$b0 .text "asl" .word a .byte $36,$c6,$b1,$6c,$30 .text "aso" .word a .byte $36,$f6,$b1,$6c,$b0 .text "bpl" .word r .byte $1b,$c6,$b1,$6c,$f3 .text "ora" .word iy .byte $1b,$df,$b1,$6c,$b0 .text "hlt" .word hltn .byte $00,$00,$00,$00,$00 .text "aso" .word iy .byte $36,$f6,$b1,$6c,$b0 .text "nop" .word zx .byte $1b,$c6,$b1,$6c,$30 .text "ora" .word zx .byte $1b,$df,$b1,$6c,$b0 .text "asl" .word zx .byte $36,$c6,$b1,$6c,$30 .text "aso" .word zx .byte $36,$f6,$b1,$6c,$b0 .text "clc" .word n .byte $1b,$c6,$b1,$6c,$30 .text "ora" .word ay .byte $1b,$df,$b1,$6c,$b0 .text "nop" .word n .byte $1b,$c6,$b1,$6c,$30 .text "aso" .word ay .byte $36,$f6,$b1,$6c,$b0 .text "nop" .word ax .byte $1b,$c6,$b1,$6c,$30 .text "ora" .word ax .byte $1b,$df,$b1,$6c,$b0 .text "asl" .word ax .byte $36,$c6,$b1,$6c,$30 .text "aso" .word ax .byte $36,$f6,$b1,$6c,$b0 .text "jsr" .word jsrw .byte $1b,$c6,$b1,$6c,$30 .text "and" .word ix .byte $1b,$02,$b1,$6c,$30 .text "hlt" .word hltn .byte $00,$00,$00,$00,$00 .text "rla" .word ix .byte $36,$06,$b1,$6c,$30 .text "bit" .word z .byte $1b,$c6,$b1,$6c,$30 .text "and" .word z .byte $1b,$02,$b1,$6c,$30 .text "rol" .word z .byte $36,$c6,$b1,$6c,$30 .text "rla" .word z .byte $36,$06,$b1,$6c,$30 .text "plp" .word plpn .byte $1b,$c6,$b1,$6c,$b3 .text "and" .word b .byte $1b,$02,$b1,$6c,$30 .text "rol" .word n .byte $1b,$8c,$b1,$6c,$b1 .text "anc" .word b .byte $1b,$02,$b1,$6c,$30 .text "bit" .word a .byte $1b,$c6,$b1,$6c,$30 .text "and" .word a .byte $1b,$02,$b1,$6c,$30 .text "rol" .word a .byte $36,$c6,$b1,$6c,$30 .text "rla" .word a .byte $36,$06,$b1,$6c,$30 .text "bmi" .word r .byte $1b,$c6,$b1,$6c,$f3 .text "and" .word iy .byte $1b,$02,$b1,$6c,$30 .text "hlt" .word hltn .byte $00,$00,$00,$00,$00 .text "rla" .word iy .byte $36,$06,$b1,$6c,$30 .text "nop" .word zx .byte $1b,$c6,$b1,$6c,$30 .text "and" .word zx .byte $1b,$02,$b1,$6c,$30 .text "rol" .word zx .byte $36,$c6,$b1,$6c,$30 .text "rla" .word zx .byte $36,$06,$b1,$6c,$30 .text "sec" .word n .byte $1b,$c6,$b1,$6c,$31 .text "and" .word ay .byte $1b,$02,$b1,$6c,$30 .text "nop" .word n .byte $1b,$c6,$b1,$6c,$30 .text "rla" .word ay .byte $36,$06,$b1,$6c,$30 .text "nop" .word ax .byte $1b,$c6,$b1,$6c,$30 .text "and" .word ax .byte $1b,$02,$b1,$6c,$30 .text "rol" .word ax .byte $36,$c6,$b1,$6c,$30 .text "rla" .word ax .byte $36,$06,$b1,$6c,$30 .text "rti" .word rtin .byte $1b,$c6,$b1,$6c,$b3 .text "eor" .word ix .byte $1b,$dd,$b1,$6c,$b0 .text "hlt" .word hltn .byte $00,$00,$00,$00,$00 .text "lse" .word ix .byte $0d,$cb,$b1,$6c,$b1 .text "nop" .word z .byte $1b,$c6,$b1,$6c,$30 .text "eor" .word z .byte $1b,$dd,$b1,$6c,$b0 .text "lsr" .word z .byte $0d,$c6,$b1,$6c,$31 .text "lse" .word z .byte $0d,$cb,$b1,$6c,$b1 .text "pha" .word phan .byte $1b,$c6,$b1,$6c,$30 .text "eor" .word b .byte $1b,$dd,$b1,$6c,$b0 .text "lsr" .word n .byte $1b,$63,$b1,$6c,$30 .text "alr" .word b .byte $1b,$01,$b1,$6c,$30 .text "jmp" .word jmpw .byte $1b,$c6,$b1,$6c,$30 .text "eor" .word a .byte $1b,$dd,$b1,$6c,$b0 .text "lsr" .word a .byte $0d,$c6,$b1,$6c,$31 .text "lse" .word a .byte $0d,$cb,$b1,$6c,$b1 .text "bvc" .word r .byte $1b,$c6,$b1,$6c,$f3 .text "eor" .word iy .byte $1b,$dd,$b1,$6c,$b0 .text "hlt" .word hltn .byte $00,$00,$00,$00,$00 .text "lse" .word iy .byte $0d,$cb,$b1,$6c,$b1 .text "nop" .word zx .byte $1b,$c6,$b1,$6c,$30 .text "eor" .word zx .byte $1b,$dd,$b1,$6c,$b0 .text "lsr" .word zx .byte $0d,$c6,$b1,$6c,$31 .text "lse" .word zx .byte $0d,$cb,$b1,$6c,$b1 .text "cli" .word n .byte $1b,$c6,$b1,$6c,$30 .text "eor" .word ay .byte $1b,$dd,$b1,$6c,$b0 .text "nop" .word n .byte $1b,$c6,$b1,$6c,$30 .text "lse" .word ay .byte $0d,$cb,$b1,$6c,$b1 .text "nop" .word ax .byte $1b,$c6,$b1,$6c,$30 .text "eor" .word ax .byte $1b,$dd,$b1,$6c,$b0 .text "lsr" .word ax .byte $0d,$c6,$b1,$6c,$31 .text "lse" .word ax .byte $0d,$cb,$b1,$6c,$b1 .text "rts" .word n .byte $1b,$c6,$b1,$6c,$30 .text "adc" .word ix .byte $1b,$e1,$b1,$6c,$b0 .text "hlt" .word hltn .byte $00,$00,$00,$00,$00 .text "rra" .word ix .byte $0d,$d4,$b1,$6c,$b0 .text "nop" .word z .byte $1b,$c6,$b1,$6c,$30 .text "adc" .word z .byte $1b,$e1,$b1,$6c,$b0 .text "ror" .word z .byte $0d,$c6,$b1,$6c,$31 .text "rra" .word z .byte $0d,$d4,$b1,$6c,$b0 .text "pla" .word plan .byte $1b,$f0,$b1,$6c,$b0 .text "adc" .word b .byte $1b,$e1,$b1,$6c,$b0 .text "ror" .word n .byte $1b,$63,$b1,$6c,$30 .text "arr" .word b .byte $1b,$01,$b1,$6c,$30 .text "jmp" .word jmpi .byte $1b,$c6,$b1,$6c,$30 .text "adc" .word a .byte $1b,$e1,$b1,$6c,$b0 .text "ror" .word a .byte $0d,$c6,$b1,$6c,$31 .text "rra" .word a .byte $0d,$d4,$b1,$6c,$b0 .text "bvs" .word r .byte $1b,$c6,$b1,$6c,$f3 .text "adc" .word iy .byte $1b,$e1,$b1,$6c,$b0 .text "hlt" .word hltn .byte $00,$00,$00,$00,$00 .text "rra" .word iy .byte $0d,$d4,$b1,$6c,$b0 .text "nop" .word zx .byte $1b,$c6,$b1,$6c,$30 .text "adc" .word zx .byte $1b,$e1,$b1,$6c,$b0 .text "ror" .word zx .byte $0d,$c6,$b1,$6c,$31 .text "rra" .word zx .byte $0d,$d4,$b1,$6c,$b0 .text "sei" .word n .byte $1b,$c6,$b1,$6c,$34 .text "adc" .word ay .byte $1b,$e1,$b1,$6c,$b0 .text "nop" .word n .byte $1b,$c6,$b1,$6c,$30 .text "rra" .word ay .byte $0d,$d4,$b1,$6c,$b0 .text "nop" .word ax .byte $1b,$c6,$b1,$6c,$30 .text "adc" .word ax .byte $1b,$e1,$b1,$6c,$b0 .text "ror" .word ax .byte $0d,$c6,$b1,$6c,$31 .text "rra" .word ax .byte $0d,$d4,$b1,$6c,$b0 .text "nop" .word b .byte $1b,$c6,$b1,$6c,$30 .text "sta" .word ix .byte $c6,$c6,$b1,$6c,$30 .text "nop" .word b .byte $1b,$c6,$b1,$6c,$30 .text "axs" .word ix .byte $80,$c6,$b1,$6c,$30 .text "sty" .word z .byte $6c,$c6,$b1,$6c,$30 .text "sta" .word z .byte $c6,$c6,$b1,$6c,$30 .text "stx" .word z .byte $b1,$c6,$b1,$6c,$30 .text "axs" .word z .byte $80,$c6,$b1,$6c,$30 .text "dey" .word n .byte $1b,$c6,$b1,$6b,$30 .text "nop" .word b .byte $1b,$c6,$b1,$6c,$30 .text "txa" .word n .byte $1b,$b1,$b1,$6c,$b0 .text "ane" .word b .byte $1b,$00,$b1,$6c,$32 .text "sty" .word a .byte $6c,$c6,$b1,$6c,$30 .text "sta" .word a .byte $c6,$c6,$b1,$6c,$30 .text "stx" .word a .byte $b1,$c6,$b1,$6c,$30 .text "axs" .word a .byte $80,$c6,$b1,$6c,$30 .text "bcc" .word r .byte $1b,$c6,$b1,$6c,$f3 .text "sta" .word iy .byte $c6,$c6,$b1,$6c,$30 .text "hlt" .word hltn .byte $00,$00,$00,$00,$00 .text "sha" .word shaiy .byte $00,$c6,$b1,$6c,$30 .text "sty" .word zx .byte $6c,$c6,$b1,$6c,$30 .text "sta" .word zx .byte $c6,$c6,$b1,$6c,$30 .text "stx" .word zy .byte $b1,$c6,$b1,$6c,$30 .text "axs" .word zy .byte $80,$c6,$b1,$6c,$30 .text "tya" .word n .byte $1b,$6c,$b1,$6c,$30 .text "sta" .word ay .byte $c6,$c6,$b1,$6c,$30 .text "txs" .word txsn .byte $1b,$c6,$b1,$6c,$30 .text "shs" .word shsay .byte $00,$c6,$b1,$6c,$30 .text "shy" .word shyax .byte $00,$c6,$b1,$6c,$30 .text "sta" .word ax .byte $c6,$c6,$b1,$6c,$30 .text "shx" .word shxay .byte $00,$c6,$b1,$6c,$30 .text "sha" .word shaay .byte $00,$c6,$b1,$6c,$30 .text "ldy" .word b .byte $1b,$c6,$b1,$1b,$30 .text "lda" .word ix .byte $1b,$1b,$b1,$6c,$30 .text "ldx" .word b .byte $1b,$c6,$1b,$6c,$30 .text "lax" .word ix .byte $1b,$1b,$1b,$6c,$30 .text "ldy" .word z .byte $1b,$c6,$b1,$1b,$30 .text "lda" .word z .byte $1b,$1b,$b1,$6c,$30 .text "ldx" .word z .byte $1b,$c6,$1b,$6c,$30 .text "lax" .word z .byte $1b,$1b,$1b,$6c,$30 .text "tay" .word n .byte $1b,$c6,$b1,$c6,$b0 .text "lda" .word b .byte $1b,$1b,$b1,$6c,$30 .text "tax" .word n .byte $1b,$c6,$c6,$6c,$b0 .text "lxa" .word b .byte $1b,$0a,$0a,$6c,$30 .text "ldy" .word a .byte $1b,$c6,$b1,$1b,$30 .text "lda" .word a .byte $1b,$1b,$b1,$6c,$30 .text "ldx" .word a .byte $1b,$c6,$1b,$6c,$30 .text "lax" .word a .byte $1b,$1b,$1b,$6c,$30 .text "bcs" .word r .byte $1b,$c6,$b1,$6c,$f3 .text "lda" .word iy .byte $1b,$1b,$b1,$6c,$30 .text "hlt" .word hltn .byte $00,$00,$00,$00,$00 .text "lax" .word iy .byte $1b,$1b,$1b,$6c,$30 .text "ldy" .word zx .byte $1b,$c6,$b1,$1b,$30 .text "lda" .word zx .byte $1b,$1b,$b1,$6c,$30 .text "ldx" .word zy .byte $1b,$c6,$1b,$6c,$30 .text "lax" .word zy .byte $1b,$1b,$1b,$6c,$30 .text "clv" .word n .byte $1b,$c6,$b1,$6c,$30 .text "lda" .word ay .byte $1b,$1b,$b1,$6c,$30 .text "tsx" .word tsxn .byte $1b,$c6,$00,$6c,$00 .text "las" .word lasay .byte $1b,$00,$00,$6c,$00 .text "ldy" .word ax .byte $1b,$c6,$b1,$1b,$30 .text "lda" .word ax .byte $1b,$1b,$b1,$6c,$30 .text "ldx" .word ay .byte $1b,$c6,$1b,$6c,$30 .text "lax" .word ay .byte $1b,$1b,$1b,$6c,$30 .text "cpy" .word b .byte $1b,$c6,$b1,$6c,$31 .text "cmp" .word ix .byte $1b,$c6,$b1,$6c,$b1 .text "nop" .word b .byte $1b,$c6,$b1,$6c,$30 .text "dcm" .word ix .byte $1a,$c6,$b1,$6c,$b1 .text "cpy" .word z .byte $1b,$c6,$b1,$6c,$31 .text "cmp" .word z .byte $1b,$c6,$b1,$6c,$b1 .text "dec" .word z .byte $1a,$c6,$b1,$6c,$30 .text "dcm" .word z .byte $1a,$c6,$b1,$6c,$b1 .text "iny" .word n .byte $1b,$c6,$b1,$6d,$30 .text "cmp" .word b .byte $1b,$c6,$b1,$6c,$b1 .text "dex" .word n .byte $1b,$c6,$b0,$6c,$b0 .text "sbx" .word b .byte $1b,$c6,$65,$6c,$31 .text "cpy" .word a .byte $1b,$c6,$b1,$6c,$31 .text "cmp" .word a .byte $1b,$c6,$b1,$6c,$b1 .text "dec" .word a .byte $1a,$c6,$b1,$6c,$30 .text "dcm" .word a .byte $1a,$c6,$b1,$6c,$b1 .text "bne" .word r .byte $1b,$c6,$b1,$6c,$f3 .text "cmp" .word iy .byte $1b,$c6,$b1,$6c,$b1 .text "hlt" .word hltn .byte $00,$00,$00,$00,$00 .text "dcm" .word iy .byte $1a,$c6,$b1,$6c,$b1 .text "nop" .word zx .byte $1b,$c6,$b1,$6c,$30 .text "cmp" .word zx .byte $1b,$c6,$b1,$6c,$b1 .text "dec" .word zx .byte $1a,$c6,$b1,$6c,$30 .text "dcm" .word zx .byte $1a,$c6,$b1,$6c,$b1 .text "cld" .word n .byte $1b,$c6,$b1,$6c,$30 .text "cmp" .word ay .byte $1b,$c6,$b1,$6c,$b1 .text "nop" .word n .byte $1b,$c6,$b1,$6c,$30 .text "dcm" .word ay .byte $1a,$c6,$b1,$6c,$b1 .text "nop" .word ax .byte $1b,$c6,$b1,$6c,$30 .text "cmp" .word ax .byte $1b,$c6,$b1,$6c,$b1 .text "dec" .word ax .byte $1a,$c6,$b1,$6c,$30 .text "dcm" .word ax .byte $1a,$c6,$b1,$6c,$b1 .text "cpx" .word b .byte $1b,$c6,$b1,$6c,$b1 .text "sbc" .word ix .byte $1b,$aa,$b1,$6c,$b1 .text "nop" .word b .byte $1b,$c6,$b1,$6c,$30 .text "ins" .word ix .byte $1c,$a9,$b1,$6c,$b1 .text "cpx" .word z .byte $1b,$c6,$b1,$6c,$b1 .text "sbc" .word z .byte $1b,$aa,$b1,$6c,$b1 .text "inc" .word z .byte $1c,$c6,$b1,$6c,$30 .text "ins" .word z .byte $1c,$a9,$b1,$6c,$b1 .text "inx" .word n .byte $1b,$c6,$b2,$6c,$b0 .text "sbc" .word b .byte $1b,$aa,$b1,$6c,$b1 .text "nop" .word n .byte $1b,$c6,$b1,$6c,$30 .text "sbc" .word b .byte $1b,$aa,$b1,$6c,$b1 .text "cpx" .word a .byte $1b,$c6,$b1,$6c,$b1 .text "sbc" .word a .byte $1b,$aa,$b1,$6c,$b1 .text "inc" .word a .byte $1c,$c6,$b1,$6c,$30 .text "ins" .word a .byte $1c,$a9,$b1,$6c,$b1 .text "beq" .word r .byte $1b,$c6,$b1,$6c,$f3 .text "sbc" .word iy .byte $1b,$aa,$b1,$6c,$b1 .text "hlt" .word hltn .byte $00,$00,$00,$00,$00 .text "ins" .word iy .byte $1c,$a9,$b1,$6c,$b1 .text "nop" .word zx .byte $1b,$c6,$b1,$6c,$30 .text "sbc" .word zx .byte $1b,$aa,$b1,$6c,$b1 .text "inc" .word zx .byte $1c,$c6,$b1,$6c,$30 .text "ins" .word zx .byte $1c,$a9,$b1,$6c,$b1 .text "sed" .word n .byte $1b,$c6,$b1,$6c,$38 .text "sbc" .word ay .byte $1b,$aa,$b1,$6c,$b1 .text "nop" .word n .byte $1b,$c6,$b1,$6c,$30 .text "ins" .word ay .byte $1c,$a9,$b1,$6c,$b1 .text "nop" .word ax .byte $1b,$c6,$b1,$6c,$30 .text "sbc" .word ax .byte $1b,$aa,$b1,$6c,$b1 .text "inc" .word ax .byte $1c,$c6,$b1,$6c,$30 .text "ins" .word ax .byte $1c,$a9,$b1,$6c,$b1 .byte 0
/* * Copyright (c) 2011, Peter Thorson. 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 the WebSocket++ Project 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 PETER THORSON 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. * */ #include "hybi_util.hpp" namespace websocketpp_02 { namespace processor { namespace hybi_util { size_t prepare_masking_key(const masking_key_type& key) { size_t prepared_key = key.i; size_t wordSize = sizeof(size_t); if (wordSize == 8) { prepared_key <<= 32; prepared_key |= (static_cast<size_t>(key.i) & 0x00000000FFFFFFFFLL); } return prepared_key; } size_t circshift_prepared_key(size_t prepared_key, size_t offset) { size_t temp = prepared_key << (sizeof(size_t)-offset)*8; return (prepared_key >> offset*8) | temp; } void word_mask_exact(char* data,size_t length,const masking_key_type& key) { size_t prepared_key = prepare_masking_key(key); size_t n = length/sizeof(size_t); size_t* word_data = reinterpret_cast<size_t*>(data); for (size_t i = 0; i < n; i++) { word_data[i] ^= prepared_key; } for (size_t i = n*sizeof(size_t); i < length; i++) { data[i] ^= key.c[i%4]; } } } // namespace hybi_util } // namespace processor } // namespace websocketpp_02
#include "net_host.h" #include "../debug.h" #include "net_constants.h" #include <SFML/System/Clock.hpp> #include <thread> namespace { ENetHost* createHost(const ENetAddress* address, int connections) { return enet_host_create(address, connections, 2, 0, 0); } ENetPeer* connectHostTo(ENetHost* host, const std::string& ip) { ENetAddress address{}; address.port = DEFAULT_PORT; if (enet_address_set_host(&address, ip.c_str()) != 0) { LOG("Connection", "Failed to create address."); return nullptr; } ENetPeer* peer = enet_host_connect(host, &address, 2, 0); if (!peer) { LOG("Connection", "Failed to connect to server (Game Full)."); return nullptr; } return peer; } int getPeerIdFromServer(ENetHost* host) { int id = -1; sf::Clock test; ENetEvent event; while (test.getElapsedTime().asSeconds() < 2.0f) { enet_host_service(host, &event, 0); if (event.type == ENET_EVENT_TYPE_RECEIVE) { ClientCommand command; sf::Packet packet; packet.append(event.packet->data, event.packet->dataLength); packet >> command; if (command == ClientCommand::PeerId) { peer_id_t peerId; packet >> peerId; id = peerId; break; } } } return id; } ENetPacket* createPacket(sf::Packet& packet, u32 flags) { return enet_packet_create(packet.getData(), packet.getDataSize(), flags); } } // namespace NetworkHost::NetworkHost(std::string&& name) : m_name(std::move(name)) { } NetworkHost::~NetworkHost() { destroy(); } void NetworkHost::destroy() { if (mp_host) { enet_host_destroy(mp_host); mp_host = nullptr; } } std::optional<ENetPeer*> NetworkHost::createAsClient(const std::string& ip) { mp_host = createHost(0, 1); if (!mp_host) { LOG(m_name.c_str(), "Error: Failed to create host."); return {}; } auto server = connectHostTo(mp_host, ip); if (!server) { LOG(m_name.c_str(), "Error: Failed to connect to server."); return {}; } enet_host_flush(mp_host); int id = getPeerIdFromServer(mp_host); if (id == -1) { LOG(m_name.c_str(), "Error: Peer ID was not received from server."); return {}; } m_peerId = static_cast<peer_id_t>(id); return server; } bool NetworkHost::createAsServer(int maxConnections) { m_maxConnections = maxConnections; ENetAddress address{}; address.host = ENET_HOST_ANY; address.port = DEFAULT_PORT; mp_host = createHost(&address, maxConnections); return mp_host; } void NetworkHost::disconnectFromPeer(ENetPeer* peer) { enet_peer_disconnect(peer, static_cast<u32>(m_peerId)); ENetEvent event; while (enet_host_service(mp_host, &event, 3000) > 0) { switch (event.type) { case ENET_EVENT_TYPE_RECEIVE: enet_packet_destroy(event.packet); break; case ENET_EVENT_TYPE_DISCONNECT: enet_host_flush(mp_host); return; default: break; } } enet_peer_reset(peer); } void NetworkHost::disconnectAllPeers() { int maxConnection = getConnectedPeerCount(); int connections = maxConnection; for (int i = 0; i < maxConnection; i++) { enet_peer_disconnect(&mp_host->peers[i], 0); } ENetEvent event; LOG(m_name.c_str(), "Allowing 1 second to disconnect all peers.") while (enet_host_service(mp_host, &event, 1000) > 0 && connections > 0) { switch (event.type) { case ENET_EVENT_TYPE_RECEIVE: enet_packet_destroy(event.packet); break; case ENET_EVENT_TYPE_DISCONNECT: connections--; break; default: break; } } } int NetworkHost::getConnectedPeerCount() const { return mp_host->connectedPeers; } peer_id_t NetworkHost::getPeerId() const { return m_peerId; } int NetworkHost::getMaxConnections() const { return m_maxConnections; } void NetworkHost::sendToPeer(ENetPeer* peer, sf::Packet& packet, u8 channel, u32 flags) { ENetPacket* pkt = createPacket(packet, flags); enet_peer_send(peer, channel, pkt); } void NetworkHost::broadcastToPeers(sf::Packet& packet, u8 channel, u32 flags) { ENetPacket* pkt = createPacket(packet, flags); enet_host_broadcast(mp_host, channel, pkt); } void NetworkHost::tick() { assert(mp_host); ENetEvent event; while (enet_host_service(mp_host, &event, 0) > 0) { switch (event.type) { case ENET_EVENT_TYPE_CONNECT: onPeerConnect(event.peer); break; case ENET_EVENT_TYPE_RECEIVE: onCommandRecieve(event.peer, *event.packet); enet_packet_destroy(event.packet); break; case ENET_EVENT_TYPE_DISCONNECT: onPeerDisconnect(event.peer); break; case ENET_EVENT_TYPE_DISCONNECT_TIMEOUT: onPeerTimeout(event.peer); break; case ENET_EVENT_TYPE_NONE: break; } } } void NetworkHost::onCommandRecieve(ENetPeer* peer, const ENetPacket& enetPacket) { sf::Packet packet; packet.append(enetPacket.data, enetPacket.dataLength); command_t command; packet >> command; onCommandRecieve(peer, packet, command); }
CODE SEGMENT ASSUME CS:CODE,DS:CODE ORG 100H MAIN: MOV AX,CS MOV DS,AX MOV SI,0 MOV DI,1 L1: MOV AL,A1[SI] MOV CL,A1[DI] CMP CL,32 JE REV INC DI CMP DI,LEN JE REV JMP L1 REV: MOV BX,DI DEC DI MOV CL,A1[DI] REV1: XCHG AL,CL MOV B1[SI],AL MOV B1[DI],CL INC SI DEC DI CMP SI,DI JG DEX MOV AL,A1[SI] MOV CL,A1[DI] JMP REV1 DEX: MOV B1[BX],32 MOV SI,BX INC SI MOV DI,SI INC DI CMP DI,LEN JG FIN JMP L1 FIN: MOV AH,9 LEA DX,B1 INT 21H MOV AH,4CH INT 21H ORG 600H A1 DB 'I am not that perfect sorry','$'; user input string ; desired output string: I ma ton taht tcefrep yrros B1 DB 28 DUP (' '),'$'; length (string) + 1 LEN DW 27; length (string) CODE ENDS END MAIN
; A227804: a(1) = greatest k such that H(k) - H(8) < H(8) - H(4); a(2) = greatest k such that H(k) - H(a(1)) < H(a(1)) - H(8), and for n > 2, a(n) = greatest k such that H(k) - H(a(n-1) > H(a(n-1)) - H(a(n-2)), where H = harmonic number. ; 15,27,48,85,150,264,464,815,1431,2512,4409,7738,13580,23832,41823,73395,128800,226029,396654,696080,1221536,2143647,3761839,6601568,11584945,20330162,35676948,62608680,109870575,192809419,338356944,593775045,1042002566,1828587032,3208946544,5631308623,9882257735,17342153392,30433357673,53406819690,93722435100,164471408184,288627200959,506505428835,888855064896,1559831901917,2737314167774,4803651498528,8429820731200,14793304131647,25960439030623,45557394660800,79947654422625,140298353215074,246206446668324,432062194544200,758216295635151,1330576843394427,2334999585697904,4097638623636533,7190854504969590 add $0,4 mov $4,1 lpb $0,1 trn $0,3 add $0,2 add $2,3 add $5,3 mov $1,$5 add $3,$5 sub $3,$5 add $2,$3 sub $4,$3 add $3,$4 add $3,1 add $4,$2 add $4,1 add $5,3 sub $5,$1 lpe trn $0,5 add $0,$4 sub $0,3 add $1,$0
#To be inserted at 800e250c ########################################## ##FPSHack_TEST_HalfSomeBoomerangValueIDK## ########################################## lis r17, 0x817F lfs f17, 0x0004 (r17) fmuls f0, f0, f17 stfs f0, 0x000C (sp) #Vanilla
_echo: file format elf32-i386 Disassembly of section .text: 00000000 <main>: #include "stat.h" #include "user.h" int main(int argc, char *argv[]) { 0: 8d 4c 24 04 lea 0x4(%esp),%ecx 4: 83 e4 f0 and $0xfffffff0,%esp 7: ff 71 fc pushl -0x4(%ecx) a: 55 push %ebp b: 89 e5 mov %esp,%ebp d: 56 push %esi e: 53 push %ebx f: 51 push %ecx 10: 83 ec 0c sub $0xc,%esp 13: 8b 01 mov (%ecx),%eax 15: 8b 51 04 mov 0x4(%ecx),%edx int i; for(i = 1; i < argc; i++) 18: 83 f8 01 cmp $0x1,%eax 1b: 7e 3f jle 5c <main+0x5c> 1d: 8d 5a 04 lea 0x4(%edx),%ebx 20: 8d 34 82 lea (%edx,%eax,4),%esi 23: eb 18 jmp 3d <main+0x3d> 25: 8d 76 00 lea 0x0(%esi),%esi printf(1, "%s%s", argv[i], i+1 < argc ? " " : "\n"); 28: 68 78 07 00 00 push $0x778 2d: 50 push %eax 2e: 68 7a 07 00 00 push $0x77a 33: 6a 01 push $0x1 35: e8 e6 03 00 00 call 420 <printf> 3a: 83 c4 10 add $0x10,%esp 3d: 83 c3 04 add $0x4,%ebx 40: 8b 43 fc mov -0x4(%ebx),%eax 43: 39 f3 cmp %esi,%ebx 45: 75 e1 jne 28 <main+0x28> 47: 68 7f 07 00 00 push $0x77f 4c: 50 push %eax 4d: 68 7a 07 00 00 push $0x77a 52: 6a 01 push $0x1 54: e8 c7 03 00 00 call 420 <printf> 59: 83 c4 10 add $0x10,%esp exit(); 5c: e8 61 02 00 00 call 2c2 <exit> 61: 66 90 xchg %ax,%ax 63: 66 90 xchg %ax,%ax 65: 66 90 xchg %ax,%ax 67: 66 90 xchg %ax,%ax 69: 66 90 xchg %ax,%ax 6b: 66 90 xchg %ax,%ax 6d: 66 90 xchg %ax,%ax 6f: 90 nop 00000070 <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, const char *t) { 70: 55 push %ebp 71: 89 e5 mov %esp,%ebp 73: 53 push %ebx 74: 8b 45 08 mov 0x8(%ebp),%eax 77: 8b 4d 0c mov 0xc(%ebp),%ecx char *os; os = s; while((*s++ = *t++) != 0) 7a: 89 c2 mov %eax,%edx 7c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80: 83 c1 01 add $0x1,%ecx 83: 0f b6 59 ff movzbl -0x1(%ecx),%ebx 87: 83 c2 01 add $0x1,%edx 8a: 84 db test %bl,%bl 8c: 88 5a ff mov %bl,-0x1(%edx) 8f: 75 ef jne 80 <strcpy+0x10> ; return os; } 91: 5b pop %ebx 92: 5d pop %ebp 93: c3 ret 94: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 9a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 000000a0 <strcmp>: int strcmp(const char *p, const char *q) { a0: 55 push %ebp a1: 89 e5 mov %esp,%ebp a3: 53 push %ebx a4: 8b 55 08 mov 0x8(%ebp),%edx a7: 8b 4d 0c mov 0xc(%ebp),%ecx while(*p && *p == *q) aa: 0f b6 02 movzbl (%edx),%eax ad: 0f b6 19 movzbl (%ecx),%ebx b0: 84 c0 test %al,%al b2: 75 1c jne d0 <strcmp+0x30> b4: eb 2a jmp e0 <strcmp+0x40> b6: 8d 76 00 lea 0x0(%esi),%esi b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi p++, q++; c0: 83 c2 01 add $0x1,%edx while(*p && *p == *q) c3: 0f b6 02 movzbl (%edx),%eax p++, q++; c6: 83 c1 01 add $0x1,%ecx c9: 0f b6 19 movzbl (%ecx),%ebx while(*p && *p == *q) cc: 84 c0 test %al,%al ce: 74 10 je e0 <strcmp+0x40> d0: 38 d8 cmp %bl,%al d2: 74 ec je c0 <strcmp+0x20> return (uchar)*p - (uchar)*q; d4: 29 d8 sub %ebx,%eax } d6: 5b pop %ebx d7: 5d pop %ebp d8: c3 ret d9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi e0: 31 c0 xor %eax,%eax return (uchar)*p - (uchar)*q; e2: 29 d8 sub %ebx,%eax } e4: 5b pop %ebx e5: 5d pop %ebp e6: c3 ret e7: 89 f6 mov %esi,%esi e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 000000f0 <strlen>: uint strlen(const char *s) { f0: 55 push %ebp f1: 89 e5 mov %esp,%ebp f3: 8b 4d 08 mov 0x8(%ebp),%ecx int n; for(n = 0; s[n]; n++) f6: 80 39 00 cmpb $0x0,(%ecx) f9: 74 15 je 110 <strlen+0x20> fb: 31 d2 xor %edx,%edx fd: 8d 76 00 lea 0x0(%esi),%esi 100: 83 c2 01 add $0x1,%edx 103: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1) 107: 89 d0 mov %edx,%eax 109: 75 f5 jne 100 <strlen+0x10> ; return n; } 10b: 5d pop %ebp 10c: c3 ret 10d: 8d 76 00 lea 0x0(%esi),%esi for(n = 0; s[n]; n++) 110: 31 c0 xor %eax,%eax } 112: 5d pop %ebp 113: c3 ret 114: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 11a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 00000120 <memset>: void* memset(void *dst, int c, uint n) { 120: 55 push %ebp 121: 89 e5 mov %esp,%ebp 123: 57 push %edi 124: 8b 55 08 mov 0x8(%ebp),%edx } static inline void stosb(void *addr, int data, int cnt) { asm volatile("cld; rep stosb" : 127: 8b 4d 10 mov 0x10(%ebp),%ecx 12a: 8b 45 0c mov 0xc(%ebp),%eax 12d: 89 d7 mov %edx,%edi 12f: fc cld 130: f3 aa rep stos %al,%es:(%edi) stosb(dst, c, n); return dst; } 132: 89 d0 mov %edx,%eax 134: 5f pop %edi 135: 5d pop %ebp 136: c3 ret 137: 89 f6 mov %esi,%esi 139: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00000140 <strchr>: char* strchr(const char *s, char c) { 140: 55 push %ebp 141: 89 e5 mov %esp,%ebp 143: 53 push %ebx 144: 8b 45 08 mov 0x8(%ebp),%eax 147: 8b 5d 0c mov 0xc(%ebp),%ebx for(; *s; s++) 14a: 0f b6 10 movzbl (%eax),%edx 14d: 84 d2 test %dl,%dl 14f: 74 1d je 16e <strchr+0x2e> if(*s == c) 151: 38 d3 cmp %dl,%bl 153: 89 d9 mov %ebx,%ecx 155: 75 0d jne 164 <strchr+0x24> 157: eb 17 jmp 170 <strchr+0x30> 159: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 160: 38 ca cmp %cl,%dl 162: 74 0c je 170 <strchr+0x30> for(; *s; s++) 164: 83 c0 01 add $0x1,%eax 167: 0f b6 10 movzbl (%eax),%edx 16a: 84 d2 test %dl,%dl 16c: 75 f2 jne 160 <strchr+0x20> return (char*)s; return 0; 16e: 31 c0 xor %eax,%eax } 170: 5b pop %ebx 171: 5d pop %ebp 172: c3 ret 173: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 179: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00000180 <gets>: char* gets(char *buf, int max) { 180: 55 push %ebp 181: 89 e5 mov %esp,%ebp 183: 57 push %edi 184: 56 push %esi 185: 53 push %ebx int i, cc; char c; for(i=0; i+1 < max; ){ 186: 31 f6 xor %esi,%esi 188: 89 f3 mov %esi,%ebx { 18a: 83 ec 1c sub $0x1c,%esp 18d: 8b 7d 08 mov 0x8(%ebp),%edi for(i=0; i+1 < max; ){ 190: eb 2f jmp 1c1 <gets+0x41> 192: 8d b6 00 00 00 00 lea 0x0(%esi),%esi cc = read(0, &c, 1); 198: 8d 45 e7 lea -0x19(%ebp),%eax 19b: 83 ec 04 sub $0x4,%esp 19e: 6a 01 push $0x1 1a0: 50 push %eax 1a1: 6a 00 push $0x0 1a3: e8 32 01 00 00 call 2da <read> if(cc < 1) 1a8: 83 c4 10 add $0x10,%esp 1ab: 85 c0 test %eax,%eax 1ad: 7e 1c jle 1cb <gets+0x4b> break; buf[i++] = c; 1af: 0f b6 45 e7 movzbl -0x19(%ebp),%eax 1b3: 83 c7 01 add $0x1,%edi 1b6: 88 47 ff mov %al,-0x1(%edi) if(c == '\n' || c == '\r') 1b9: 3c 0a cmp $0xa,%al 1bb: 74 23 je 1e0 <gets+0x60> 1bd: 3c 0d cmp $0xd,%al 1bf: 74 1f je 1e0 <gets+0x60> for(i=0; i+1 < max; ){ 1c1: 83 c3 01 add $0x1,%ebx 1c4: 3b 5d 0c cmp 0xc(%ebp),%ebx 1c7: 89 fe mov %edi,%esi 1c9: 7c cd jl 198 <gets+0x18> 1cb: 89 f3 mov %esi,%ebx break; } buf[i] = '\0'; return buf; } 1cd: 8b 45 08 mov 0x8(%ebp),%eax buf[i] = '\0'; 1d0: c6 03 00 movb $0x0,(%ebx) } 1d3: 8d 65 f4 lea -0xc(%ebp),%esp 1d6: 5b pop %ebx 1d7: 5e pop %esi 1d8: 5f pop %edi 1d9: 5d pop %ebp 1da: c3 ret 1db: 90 nop 1dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 1e0: 8b 75 08 mov 0x8(%ebp),%esi 1e3: 8b 45 08 mov 0x8(%ebp),%eax 1e6: 01 de add %ebx,%esi 1e8: 89 f3 mov %esi,%ebx buf[i] = '\0'; 1ea: c6 03 00 movb $0x0,(%ebx) } 1ed: 8d 65 f4 lea -0xc(%ebp),%esp 1f0: 5b pop %ebx 1f1: 5e pop %esi 1f2: 5f pop %edi 1f3: 5d pop %ebp 1f4: c3 ret 1f5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 1f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00000200 <stat>: int stat(const char *n, struct stat *st) { 200: 55 push %ebp 201: 89 e5 mov %esp,%ebp 203: 56 push %esi 204: 53 push %ebx int fd; int r; fd = open(n, O_RDONLY); 205: 83 ec 08 sub $0x8,%esp 208: 6a 00 push $0x0 20a: ff 75 08 pushl 0x8(%ebp) 20d: e8 f0 00 00 00 call 302 <open> if(fd < 0) 212: 83 c4 10 add $0x10,%esp 215: 85 c0 test %eax,%eax 217: 78 27 js 240 <stat+0x40> return -1; r = fstat(fd, st); 219: 83 ec 08 sub $0x8,%esp 21c: ff 75 0c pushl 0xc(%ebp) 21f: 89 c3 mov %eax,%ebx 221: 50 push %eax 222: e8 f3 00 00 00 call 31a <fstat> close(fd); 227: 89 1c 24 mov %ebx,(%esp) r = fstat(fd, st); 22a: 89 c6 mov %eax,%esi close(fd); 22c: e8 b9 00 00 00 call 2ea <close> return r; 231: 83 c4 10 add $0x10,%esp } 234: 8d 65 f8 lea -0x8(%ebp),%esp 237: 89 f0 mov %esi,%eax 239: 5b pop %ebx 23a: 5e pop %esi 23b: 5d pop %ebp 23c: c3 ret 23d: 8d 76 00 lea 0x0(%esi),%esi return -1; 240: be ff ff ff ff mov $0xffffffff,%esi 245: eb ed jmp 234 <stat+0x34> 247: 89 f6 mov %esi,%esi 249: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00000250 <atoi>: int atoi(const char *s) { 250: 55 push %ebp 251: 89 e5 mov %esp,%ebp 253: 53 push %ebx 254: 8b 4d 08 mov 0x8(%ebp),%ecx int n; n = 0; while('0' <= *s && *s <= '9') 257: 0f be 11 movsbl (%ecx),%edx 25a: 8d 42 d0 lea -0x30(%edx),%eax 25d: 3c 09 cmp $0x9,%al n = 0; 25f: b8 00 00 00 00 mov $0x0,%eax while('0' <= *s && *s <= '9') 264: 77 1f ja 285 <atoi+0x35> 266: 8d 76 00 lea 0x0(%esi),%esi 269: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi n = n*10 + *s++ - '0'; 270: 8d 04 80 lea (%eax,%eax,4),%eax 273: 83 c1 01 add $0x1,%ecx 276: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax while('0' <= *s && *s <= '9') 27a: 0f be 11 movsbl (%ecx),%edx 27d: 8d 5a d0 lea -0x30(%edx),%ebx 280: 80 fb 09 cmp $0x9,%bl 283: 76 eb jbe 270 <atoi+0x20> return n; } 285: 5b pop %ebx 286: 5d pop %ebp 287: c3 ret 288: 90 nop 289: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 00000290 <memmove>: void* memmove(void *vdst, const void *vsrc, int n) { 290: 55 push %ebp 291: 89 e5 mov %esp,%ebp 293: 56 push %esi 294: 53 push %ebx 295: 8b 5d 10 mov 0x10(%ebp),%ebx 298: 8b 45 08 mov 0x8(%ebp),%eax 29b: 8b 75 0c mov 0xc(%ebp),%esi char *dst; const char *src; dst = vdst; src = vsrc; while(n-- > 0) 29e: 85 db test %ebx,%ebx 2a0: 7e 14 jle 2b6 <memmove+0x26> 2a2: 31 d2 xor %edx,%edx 2a4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi *dst++ = *src++; 2a8: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx 2ac: 88 0c 10 mov %cl,(%eax,%edx,1) 2af: 83 c2 01 add $0x1,%edx while(n-- > 0) 2b2: 39 d3 cmp %edx,%ebx 2b4: 75 f2 jne 2a8 <memmove+0x18> return vdst; } 2b6: 5b pop %ebx 2b7: 5e pop %esi 2b8: 5d pop %ebp 2b9: c3 ret 000002ba <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) 2ba: b8 01 00 00 00 mov $0x1,%eax 2bf: cd 40 int $0x40 2c1: c3 ret 000002c2 <exit>: SYSCALL(exit) 2c2: b8 02 00 00 00 mov $0x2,%eax 2c7: cd 40 int $0x40 2c9: c3 ret 000002ca <wait>: SYSCALL(wait) 2ca: b8 03 00 00 00 mov $0x3,%eax 2cf: cd 40 int $0x40 2d1: c3 ret 000002d2 <pipe>: SYSCALL(pipe) 2d2: b8 04 00 00 00 mov $0x4,%eax 2d7: cd 40 int $0x40 2d9: c3 ret 000002da <read>: SYSCALL(read) 2da: b8 05 00 00 00 mov $0x5,%eax 2df: cd 40 int $0x40 2e1: c3 ret 000002e2 <write>: SYSCALL(write) 2e2: b8 10 00 00 00 mov $0x10,%eax 2e7: cd 40 int $0x40 2e9: c3 ret 000002ea <close>: SYSCALL(close) 2ea: b8 15 00 00 00 mov $0x15,%eax 2ef: cd 40 int $0x40 2f1: c3 ret 000002f2 <kill>: SYSCALL(kill) 2f2: b8 06 00 00 00 mov $0x6,%eax 2f7: cd 40 int $0x40 2f9: c3 ret 000002fa <exec>: SYSCALL(exec) 2fa: b8 07 00 00 00 mov $0x7,%eax 2ff: cd 40 int $0x40 301: c3 ret 00000302 <open>: SYSCALL(open) 302: b8 0f 00 00 00 mov $0xf,%eax 307: cd 40 int $0x40 309: c3 ret 0000030a <mknod>: SYSCALL(mknod) 30a: b8 11 00 00 00 mov $0x11,%eax 30f: cd 40 int $0x40 311: c3 ret 00000312 <unlink>: SYSCALL(unlink) 312: b8 12 00 00 00 mov $0x12,%eax 317: cd 40 int $0x40 319: c3 ret 0000031a <fstat>: SYSCALL(fstat) 31a: b8 08 00 00 00 mov $0x8,%eax 31f: cd 40 int $0x40 321: c3 ret 00000322 <link>: SYSCALL(link) 322: b8 13 00 00 00 mov $0x13,%eax 327: cd 40 int $0x40 329: c3 ret 0000032a <mkdir>: SYSCALL(mkdir) 32a: b8 14 00 00 00 mov $0x14,%eax 32f: cd 40 int $0x40 331: c3 ret 00000332 <chdir>: SYSCALL(chdir) 332: b8 09 00 00 00 mov $0x9,%eax 337: cd 40 int $0x40 339: c3 ret 0000033a <dup>: SYSCALL(dup) 33a: b8 0a 00 00 00 mov $0xa,%eax 33f: cd 40 int $0x40 341: c3 ret 00000342 <getpid>: SYSCALL(getpid) 342: b8 0b 00 00 00 mov $0xb,%eax 347: cd 40 int $0x40 349: c3 ret 0000034a <sbrk>: SYSCALL(sbrk) 34a: b8 0c 00 00 00 mov $0xc,%eax 34f: cd 40 int $0x40 351: c3 ret 00000352 <sleep>: SYSCALL(sleep) 352: b8 0d 00 00 00 mov $0xd,%eax 357: cd 40 int $0x40 359: c3 ret 0000035a <uptime>: SYSCALL(uptime) 35a: b8 0e 00 00 00 mov $0xe,%eax 35f: cd 40 int $0x40 361: c3 ret 00000362 <cps>: SYSCALL(cps) 362: b8 16 00 00 00 mov $0x16,%eax 367: cd 40 int $0x40 369: c3 ret 0000036a <shutdown>: SYSCALL(shutdown) 36a: b8 17 00 00 00 mov $0x17,%eax 36f: cd 40 int $0x40 371: c3 ret 00000372 <chpr>: SYSCALL(chpr) 372: b8 18 00 00 00 mov $0x18,%eax 377: cd 40 int $0x40 379: c3 ret 37a: 66 90 xchg %ax,%ax 37c: 66 90 xchg %ax,%ax 37e: 66 90 xchg %ax,%ax 00000380 <printint>: write(fd, &c, 1); } static void printint(int fd, int xx, int base, int sgn) { 380: 55 push %ebp 381: 89 e5 mov %esp,%ebp 383: 57 push %edi 384: 56 push %esi 385: 53 push %ebx 386: 83 ec 3c sub $0x3c,%esp char buf[16]; int i, neg; uint x; neg = 0; if(sgn && xx < 0){ 389: 85 d2 test %edx,%edx { 38b: 89 45 c0 mov %eax,-0x40(%ebp) neg = 1; x = -xx; 38e: 89 d0 mov %edx,%eax if(sgn && xx < 0){ 390: 79 76 jns 408 <printint+0x88> 392: f6 45 08 01 testb $0x1,0x8(%ebp) 396: 74 70 je 408 <printint+0x88> x = -xx; 398: f7 d8 neg %eax neg = 1; 39a: c7 45 c4 01 00 00 00 movl $0x1,-0x3c(%ebp) } else { x = xx; } i = 0; 3a1: 31 f6 xor %esi,%esi 3a3: 8d 5d d7 lea -0x29(%ebp),%ebx 3a6: eb 0a jmp 3b2 <printint+0x32> 3a8: 90 nop 3a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi do{ buf[i++] = digits[x % base]; 3b0: 89 fe mov %edi,%esi 3b2: 31 d2 xor %edx,%edx 3b4: 8d 7e 01 lea 0x1(%esi),%edi 3b7: f7 f1 div %ecx 3b9: 0f b6 92 88 07 00 00 movzbl 0x788(%edx),%edx }while((x /= base) != 0); 3c0: 85 c0 test %eax,%eax buf[i++] = digits[x % base]; 3c2: 88 14 3b mov %dl,(%ebx,%edi,1) }while((x /= base) != 0); 3c5: 75 e9 jne 3b0 <printint+0x30> if(neg) 3c7: 8b 45 c4 mov -0x3c(%ebp),%eax 3ca: 85 c0 test %eax,%eax 3cc: 74 08 je 3d6 <printint+0x56> buf[i++] = '-'; 3ce: c6 44 3d d8 2d movb $0x2d,-0x28(%ebp,%edi,1) 3d3: 8d 7e 02 lea 0x2(%esi),%edi 3d6: 8d 74 3d d7 lea -0x29(%ebp,%edi,1),%esi 3da: 8b 7d c0 mov -0x40(%ebp),%edi 3dd: 8d 76 00 lea 0x0(%esi),%esi 3e0: 0f b6 06 movzbl (%esi),%eax write(fd, &c, 1); 3e3: 83 ec 04 sub $0x4,%esp 3e6: 83 ee 01 sub $0x1,%esi 3e9: 6a 01 push $0x1 3eb: 53 push %ebx 3ec: 57 push %edi 3ed: 88 45 d7 mov %al,-0x29(%ebp) 3f0: e8 ed fe ff ff call 2e2 <write> while(--i >= 0) 3f5: 83 c4 10 add $0x10,%esp 3f8: 39 de cmp %ebx,%esi 3fa: 75 e4 jne 3e0 <printint+0x60> putc(fd, buf[i]); } 3fc: 8d 65 f4 lea -0xc(%ebp),%esp 3ff: 5b pop %ebx 400: 5e pop %esi 401: 5f pop %edi 402: 5d pop %ebp 403: c3 ret 404: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi neg = 0; 408: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp) 40f: eb 90 jmp 3a1 <printint+0x21> 411: eb 0d jmp 420 <printf> 413: 90 nop 414: 90 nop 415: 90 nop 416: 90 nop 417: 90 nop 418: 90 nop 419: 90 nop 41a: 90 nop 41b: 90 nop 41c: 90 nop 41d: 90 nop 41e: 90 nop 41f: 90 nop 00000420 <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, const char *fmt, ...) { 420: 55 push %ebp 421: 89 e5 mov %esp,%ebp 423: 57 push %edi 424: 56 push %esi 425: 53 push %ebx 426: 83 ec 2c sub $0x2c,%esp int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 429: 8b 75 0c mov 0xc(%ebp),%esi 42c: 0f b6 1e movzbl (%esi),%ebx 42f: 84 db test %bl,%bl 431: 0f 84 b3 00 00 00 je 4ea <printf+0xca> ap = (uint*)(void*)&fmt + 1; 437: 8d 45 10 lea 0x10(%ebp),%eax 43a: 83 c6 01 add $0x1,%esi state = 0; 43d: 31 ff xor %edi,%edi ap = (uint*)(void*)&fmt + 1; 43f: 89 45 d4 mov %eax,-0x2c(%ebp) 442: eb 2f jmp 473 <printf+0x53> 444: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi c = fmt[i] & 0xff; if(state == 0){ if(c == '%'){ 448: 83 f8 25 cmp $0x25,%eax 44b: 0f 84 a7 00 00 00 je 4f8 <printf+0xd8> write(fd, &c, 1); 451: 8d 45 e2 lea -0x1e(%ebp),%eax 454: 83 ec 04 sub $0x4,%esp 457: 88 5d e2 mov %bl,-0x1e(%ebp) 45a: 6a 01 push $0x1 45c: 50 push %eax 45d: ff 75 08 pushl 0x8(%ebp) 460: e8 7d fe ff ff call 2e2 <write> 465: 83 c4 10 add $0x10,%esp 468: 83 c6 01 add $0x1,%esi for(i = 0; fmt[i]; i++){ 46b: 0f b6 5e ff movzbl -0x1(%esi),%ebx 46f: 84 db test %bl,%bl 471: 74 77 je 4ea <printf+0xca> if(state == 0){ 473: 85 ff test %edi,%edi c = fmt[i] & 0xff; 475: 0f be cb movsbl %bl,%ecx 478: 0f b6 c3 movzbl %bl,%eax if(state == 0){ 47b: 74 cb je 448 <printf+0x28> state = '%'; } else { putc(fd, c); } } else if(state == '%'){ 47d: 83 ff 25 cmp $0x25,%edi 480: 75 e6 jne 468 <printf+0x48> if(c == 'd'){ 482: 83 f8 64 cmp $0x64,%eax 485: 0f 84 05 01 00 00 je 590 <printf+0x170> printint(fd, *ap, 10, 1); ap++; } else if(c == 'x' || c == 'p'){ 48b: 81 e1 f7 00 00 00 and $0xf7,%ecx 491: 83 f9 70 cmp $0x70,%ecx 494: 74 72 je 508 <printf+0xe8> printint(fd, *ap, 16, 0); ap++; } else if(c == 's'){ 496: 83 f8 73 cmp $0x73,%eax 499: 0f 84 99 00 00 00 je 538 <printf+0x118> s = "(null)"; while(*s != 0){ putc(fd, *s); s++; } } else if(c == 'c'){ 49f: 83 f8 63 cmp $0x63,%eax 4a2: 0f 84 08 01 00 00 je 5b0 <printf+0x190> putc(fd, *ap); ap++; } else if(c == '%'){ 4a8: 83 f8 25 cmp $0x25,%eax 4ab: 0f 84 ef 00 00 00 je 5a0 <printf+0x180> write(fd, &c, 1); 4b1: 8d 45 e7 lea -0x19(%ebp),%eax 4b4: 83 ec 04 sub $0x4,%esp 4b7: c6 45 e7 25 movb $0x25,-0x19(%ebp) 4bb: 6a 01 push $0x1 4bd: 50 push %eax 4be: ff 75 08 pushl 0x8(%ebp) 4c1: e8 1c fe ff ff call 2e2 <write> 4c6: 83 c4 0c add $0xc,%esp 4c9: 8d 45 e6 lea -0x1a(%ebp),%eax 4cc: 88 5d e6 mov %bl,-0x1a(%ebp) 4cf: 6a 01 push $0x1 4d1: 50 push %eax 4d2: ff 75 08 pushl 0x8(%ebp) 4d5: 83 c6 01 add $0x1,%esi } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); putc(fd, c); } state = 0; 4d8: 31 ff xor %edi,%edi write(fd, &c, 1); 4da: e8 03 fe ff ff call 2e2 <write> for(i = 0; fmt[i]; i++){ 4df: 0f b6 5e ff movzbl -0x1(%esi),%ebx write(fd, &c, 1); 4e3: 83 c4 10 add $0x10,%esp for(i = 0; fmt[i]; i++){ 4e6: 84 db test %bl,%bl 4e8: 75 89 jne 473 <printf+0x53> } } } 4ea: 8d 65 f4 lea -0xc(%ebp),%esp 4ed: 5b pop %ebx 4ee: 5e pop %esi 4ef: 5f pop %edi 4f0: 5d pop %ebp 4f1: c3 ret 4f2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi state = '%'; 4f8: bf 25 00 00 00 mov $0x25,%edi 4fd: e9 66 ff ff ff jmp 468 <printf+0x48> 502: 8d b6 00 00 00 00 lea 0x0(%esi),%esi printint(fd, *ap, 16, 0); 508: 83 ec 0c sub $0xc,%esp 50b: b9 10 00 00 00 mov $0x10,%ecx 510: 6a 00 push $0x0 512: 8b 7d d4 mov -0x2c(%ebp),%edi 515: 8b 45 08 mov 0x8(%ebp),%eax 518: 8b 17 mov (%edi),%edx 51a: e8 61 fe ff ff call 380 <printint> ap++; 51f: 89 f8 mov %edi,%eax 521: 83 c4 10 add $0x10,%esp state = 0; 524: 31 ff xor %edi,%edi ap++; 526: 83 c0 04 add $0x4,%eax 529: 89 45 d4 mov %eax,-0x2c(%ebp) 52c: e9 37 ff ff ff jmp 468 <printf+0x48> 531: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi s = (char*)*ap; 538: 8b 45 d4 mov -0x2c(%ebp),%eax 53b: 8b 08 mov (%eax),%ecx ap++; 53d: 83 c0 04 add $0x4,%eax 540: 89 45 d4 mov %eax,-0x2c(%ebp) if(s == 0) 543: 85 c9 test %ecx,%ecx 545: 0f 84 8e 00 00 00 je 5d9 <printf+0x1b9> while(*s != 0){ 54b: 0f b6 01 movzbl (%ecx),%eax state = 0; 54e: 31 ff xor %edi,%edi s = (char*)*ap; 550: 89 cb mov %ecx,%ebx while(*s != 0){ 552: 84 c0 test %al,%al 554: 0f 84 0e ff ff ff je 468 <printf+0x48> 55a: 89 75 d0 mov %esi,-0x30(%ebp) 55d: 89 de mov %ebx,%esi 55f: 8b 5d 08 mov 0x8(%ebp),%ebx 562: 8d 7d e3 lea -0x1d(%ebp),%edi 565: 8d 76 00 lea 0x0(%esi),%esi write(fd, &c, 1); 568: 83 ec 04 sub $0x4,%esp s++; 56b: 83 c6 01 add $0x1,%esi 56e: 88 45 e3 mov %al,-0x1d(%ebp) write(fd, &c, 1); 571: 6a 01 push $0x1 573: 57 push %edi 574: 53 push %ebx 575: e8 68 fd ff ff call 2e2 <write> while(*s != 0){ 57a: 0f b6 06 movzbl (%esi),%eax 57d: 83 c4 10 add $0x10,%esp 580: 84 c0 test %al,%al 582: 75 e4 jne 568 <printf+0x148> 584: 8b 75 d0 mov -0x30(%ebp),%esi state = 0; 587: 31 ff xor %edi,%edi 589: e9 da fe ff ff jmp 468 <printf+0x48> 58e: 66 90 xchg %ax,%ax printint(fd, *ap, 10, 1); 590: 83 ec 0c sub $0xc,%esp 593: b9 0a 00 00 00 mov $0xa,%ecx 598: 6a 01 push $0x1 59a: e9 73 ff ff ff jmp 512 <printf+0xf2> 59f: 90 nop write(fd, &c, 1); 5a0: 83 ec 04 sub $0x4,%esp 5a3: 88 5d e5 mov %bl,-0x1b(%ebp) 5a6: 8d 45 e5 lea -0x1b(%ebp),%eax 5a9: 6a 01 push $0x1 5ab: e9 21 ff ff ff jmp 4d1 <printf+0xb1> putc(fd, *ap); 5b0: 8b 7d d4 mov -0x2c(%ebp),%edi write(fd, &c, 1); 5b3: 83 ec 04 sub $0x4,%esp putc(fd, *ap); 5b6: 8b 07 mov (%edi),%eax write(fd, &c, 1); 5b8: 6a 01 push $0x1 ap++; 5ba: 83 c7 04 add $0x4,%edi putc(fd, *ap); 5bd: 88 45 e4 mov %al,-0x1c(%ebp) write(fd, &c, 1); 5c0: 8d 45 e4 lea -0x1c(%ebp),%eax 5c3: 50 push %eax 5c4: ff 75 08 pushl 0x8(%ebp) 5c7: e8 16 fd ff ff call 2e2 <write> ap++; 5cc: 89 7d d4 mov %edi,-0x2c(%ebp) 5cf: 83 c4 10 add $0x10,%esp state = 0; 5d2: 31 ff xor %edi,%edi 5d4: e9 8f fe ff ff jmp 468 <printf+0x48> s = "(null)"; 5d9: bb 81 07 00 00 mov $0x781,%ebx while(*s != 0){ 5de: b8 28 00 00 00 mov $0x28,%eax 5e3: e9 72 ff ff ff jmp 55a <printf+0x13a> 5e8: 66 90 xchg %ax,%ax 5ea: 66 90 xchg %ax,%ax 5ec: 66 90 xchg %ax,%ax 5ee: 66 90 xchg %ax,%ax 000005f0 <free>: static Header base; static Header *freep; void free(void *ap) { 5f0: 55 push %ebp Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 5f1: a1 34 0a 00 00 mov 0xa34,%eax { 5f6: 89 e5 mov %esp,%ebp 5f8: 57 push %edi 5f9: 56 push %esi 5fa: 53 push %ebx 5fb: 8b 5d 08 mov 0x8(%ebp),%ebx bp = (Header*)ap - 1; 5fe: 8d 4b f8 lea -0x8(%ebx),%ecx 601: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 608: 39 c8 cmp %ecx,%eax 60a: 8b 10 mov (%eax),%edx 60c: 73 32 jae 640 <free+0x50> 60e: 39 d1 cmp %edx,%ecx 610: 72 04 jb 616 <free+0x26> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 612: 39 d0 cmp %edx,%eax 614: 72 32 jb 648 <free+0x58> break; if(bp + bp->s.size == p->s.ptr){ 616: 8b 73 fc mov -0x4(%ebx),%esi 619: 8d 3c f1 lea (%ecx,%esi,8),%edi 61c: 39 fa cmp %edi,%edx 61e: 74 30 je 650 <free+0x60> bp->s.size += p->s.ptr->s.size; bp->s.ptr = p->s.ptr->s.ptr; } else bp->s.ptr = p->s.ptr; 620: 89 53 f8 mov %edx,-0x8(%ebx) if(p + p->s.size == bp){ 623: 8b 50 04 mov 0x4(%eax),%edx 626: 8d 34 d0 lea (%eax,%edx,8),%esi 629: 39 f1 cmp %esi,%ecx 62b: 74 3a je 667 <free+0x77> p->s.size += bp->s.size; p->s.ptr = bp->s.ptr; } else p->s.ptr = bp; 62d: 89 08 mov %ecx,(%eax) freep = p; 62f: a3 34 0a 00 00 mov %eax,0xa34 } 634: 5b pop %ebx 635: 5e pop %esi 636: 5f pop %edi 637: 5d pop %ebp 638: c3 ret 639: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 640: 39 d0 cmp %edx,%eax 642: 72 04 jb 648 <free+0x58> 644: 39 d1 cmp %edx,%ecx 646: 72 ce jb 616 <free+0x26> { 648: 89 d0 mov %edx,%eax 64a: eb bc jmp 608 <free+0x18> 64c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi bp->s.size += p->s.ptr->s.size; 650: 03 72 04 add 0x4(%edx),%esi 653: 89 73 fc mov %esi,-0x4(%ebx) bp->s.ptr = p->s.ptr->s.ptr; 656: 8b 10 mov (%eax),%edx 658: 8b 12 mov (%edx),%edx 65a: 89 53 f8 mov %edx,-0x8(%ebx) if(p + p->s.size == bp){ 65d: 8b 50 04 mov 0x4(%eax),%edx 660: 8d 34 d0 lea (%eax,%edx,8),%esi 663: 39 f1 cmp %esi,%ecx 665: 75 c6 jne 62d <free+0x3d> p->s.size += bp->s.size; 667: 03 53 fc add -0x4(%ebx),%edx freep = p; 66a: a3 34 0a 00 00 mov %eax,0xa34 p->s.size += bp->s.size; 66f: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; 672: 8b 53 f8 mov -0x8(%ebx),%edx 675: 89 10 mov %edx,(%eax) } 677: 5b pop %ebx 678: 5e pop %esi 679: 5f pop %edi 67a: 5d pop %ebp 67b: c3 ret 67c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 00000680 <malloc>: return freep; } void* malloc(uint nbytes) { 680: 55 push %ebp 681: 89 e5 mov %esp,%ebp 683: 57 push %edi 684: 56 push %esi 685: 53 push %ebx 686: 83 ec 0c sub $0xc,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 689: 8b 45 08 mov 0x8(%ebp),%eax if((prevp = freep) == 0){ 68c: 8b 15 34 0a 00 00 mov 0xa34,%edx nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 692: 8d 78 07 lea 0x7(%eax),%edi 695: c1 ef 03 shr $0x3,%edi 698: 83 c7 01 add $0x1,%edi if((prevp = freep) == 0){ 69b: 85 d2 test %edx,%edx 69d: 0f 84 9d 00 00 00 je 740 <malloc+0xc0> 6a3: 8b 02 mov (%edx),%eax 6a5: 8b 48 04 mov 0x4(%eax),%ecx base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ if(p->s.size >= nunits){ 6a8: 39 cf cmp %ecx,%edi 6aa: 76 6c jbe 718 <malloc+0x98> 6ac: 81 ff 00 10 00 00 cmp $0x1000,%edi 6b2: bb 00 10 00 00 mov $0x1000,%ebx 6b7: 0f 43 df cmovae %edi,%ebx p = sbrk(nu * sizeof(Header)); 6ba: 8d 34 dd 00 00 00 00 lea 0x0(,%ebx,8),%esi 6c1: eb 0e jmp 6d1 <malloc+0x51> 6c3: 90 nop 6c4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 6c8: 8b 02 mov (%edx),%eax if(p->s.size >= nunits){ 6ca: 8b 48 04 mov 0x4(%eax),%ecx 6cd: 39 f9 cmp %edi,%ecx 6cf: 73 47 jae 718 <malloc+0x98> p->s.size = nunits; } freep = prevp; return (void*)(p + 1); } if(p == freep) 6d1: 39 05 34 0a 00 00 cmp %eax,0xa34 6d7: 89 c2 mov %eax,%edx 6d9: 75 ed jne 6c8 <malloc+0x48> p = sbrk(nu * sizeof(Header)); 6db: 83 ec 0c sub $0xc,%esp 6de: 56 push %esi 6df: e8 66 fc ff ff call 34a <sbrk> if(p == (char*)-1) 6e4: 83 c4 10 add $0x10,%esp 6e7: 83 f8 ff cmp $0xffffffff,%eax 6ea: 74 1c je 708 <malloc+0x88> hp->s.size = nu; 6ec: 89 58 04 mov %ebx,0x4(%eax) free((void*)(hp + 1)); 6ef: 83 ec 0c sub $0xc,%esp 6f2: 83 c0 08 add $0x8,%eax 6f5: 50 push %eax 6f6: e8 f5 fe ff ff call 5f0 <free> return freep; 6fb: 8b 15 34 0a 00 00 mov 0xa34,%edx if((p = morecore(nunits)) == 0) 701: 83 c4 10 add $0x10,%esp 704: 85 d2 test %edx,%edx 706: 75 c0 jne 6c8 <malloc+0x48> return 0; } } 708: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 70b: 31 c0 xor %eax,%eax } 70d: 5b pop %ebx 70e: 5e pop %esi 70f: 5f pop %edi 710: 5d pop %ebp 711: c3 ret 712: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(p->s.size == nunits) 718: 39 cf cmp %ecx,%edi 71a: 74 54 je 770 <malloc+0xf0> p->s.size -= nunits; 71c: 29 f9 sub %edi,%ecx 71e: 89 48 04 mov %ecx,0x4(%eax) p += p->s.size; 721: 8d 04 c8 lea (%eax,%ecx,8),%eax p->s.size = nunits; 724: 89 78 04 mov %edi,0x4(%eax) freep = prevp; 727: 89 15 34 0a 00 00 mov %edx,0xa34 } 72d: 8d 65 f4 lea -0xc(%ebp),%esp return (void*)(p + 1); 730: 83 c0 08 add $0x8,%eax } 733: 5b pop %ebx 734: 5e pop %esi 735: 5f pop %edi 736: 5d pop %ebp 737: c3 ret 738: 90 nop 739: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi base.s.ptr = freep = prevp = &base; 740: c7 05 34 0a 00 00 38 movl $0xa38,0xa34 747: 0a 00 00 74a: c7 05 38 0a 00 00 38 movl $0xa38,0xa38 751: 0a 00 00 base.s.size = 0; 754: b8 38 0a 00 00 mov $0xa38,%eax 759: c7 05 3c 0a 00 00 00 movl $0x0,0xa3c 760: 00 00 00 763: e9 44 ff ff ff jmp 6ac <malloc+0x2c> 768: 90 nop 769: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi prevp->s.ptr = p->s.ptr; 770: 8b 08 mov (%eax),%ecx 772: 89 0a mov %ecx,(%edx) 774: eb b1 jmp 727 <malloc+0xa7>
.global s_prepare_buffers s_prepare_buffers: ret .global s_faulty_load s_faulty_load: push %r11 push %r13 push %r15 push %r9 push %rcx push %rdi push %rsi // REPMOV lea addresses_PSE+0x4911, %rsi lea addresses_PSE+0x15a41, %rdi nop and %r13, %r13 mov $32, %rcx rep movsw nop nop nop nop nop cmp $51583, %rcx // Store lea addresses_UC+0x131e1, %rdi nop nop xor %rcx, %rcx movl $0x51525354, (%rdi) nop nop nop nop sub $65399, %rcx // Faulty Load lea addresses_PSE+0x15a41, %r15 xor %rcx, %rcx mov (%r15), %rsi lea oracles, %r13 and $0xff, %rsi shlq $12, %rsi mov (%r13,%rsi,1), %rsi pop %rsi pop %rdi pop %rcx pop %r9 pop %r15 pop %r13 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_PSE', 'AVXalign': True, 'size': 32, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} {'src': {'type': 'addresses_PSE', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_PSE', 'congruent': 0, 'same': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 3}} [Faulty Load] {'src': {'type': 'addresses_PSE', 'AVXalign': False, 'size': 8, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'33': 21829} 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 */
; A009574: Expansion of e.g.f. sinh(log(1+x))*exp(x). ; 0,1,1,3,-2,25,-129,931,-7412,66753,-667475,7342291,-88107414,1145396473,-16035550517,240533257875,-3848532125864,65425046139841,-1177650830516967,22375365779822563 add $0,6 mov $2,5 lpb $0,1 sub $0,1 mul $1,$2 sub $1,1 sub $2,1 lpe sub $1,$2 div $1,2
/** * Copyright(c) 2014 Carnegie Mellon University. All Rights Reserved. * * 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 acknowledgments and disclaimers. * * 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. The names "Carnegie Mellon University," "SEI" and/or "Software * Engineering Institute" shall not be used to endorse or promote products * derived from this software without prior written permission. For written * permission, please contact permission@sei.cmu.edu. * * 4. Products derived from this software may not be called "SEI" nor may "SEI" * appear in their names without prior written permission of * permission@sei.cmu.edu. * * 5. Redistributions of any form whatsoever must retain the following * acknowledgment: * * This material is based upon work funded and supported by the Department * of Defense under Contract No. FA8721-05-C-0003 with Carnegie Mellon * University for the operation of the Software Engineering Institute, a * federally funded research and development center. Any opinions, * findings and conclusions or recommendations expressed in this material * are those of the author(s) and do not necessarily reflect the views of * the United States Department of Defense. * * NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE ENGINEERING * INSTITUTE MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON * UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER EXPRESSED OR * IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF * FITNESS FOR PURPOSE OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS * OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES * NOT MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, * TRADEMARK, OR COPYRIGHT INFRINGEMENT. * * This material has been approved for public release and unlimited * distribution. **/ #include "gams/variables/Region.h" typedef madara::knowledge::KnowledgeRecord::Integer Integer; gams::variables::Region::Region() { } gams::variables::Region::~Region() { } void gams::variables::Region::operator=(const Region & rhs) { if(this != &rhs) { this->type = rhs.type; this->name = rhs.name; } } void gams::variables::Region::init_vars( madara::knowledge::KnowledgeBase & knowledge, const std::string & region_name) { // set the name of the region name = region_name; // swarm commands are prefixed with "swarm.movement_command" std::string prefix("region"); prefix += "."; prefix += name; // initialize the variable containers type.set_name(prefix + ".type", knowledge); } void gams::variables::Region::init_vars( madara::knowledge::Variables & knowledge, const std::string & region_name) { // set the name of the region name = region_name; // swarm commands are prefixed with "swarm.movement_command" std::string prefix("region"); prefix += "."; prefix += name; // initialize the variable containers type.set_name(prefix + ".type", knowledge); } void gams::variables::init_vars(Region & variables, madara::knowledge::KnowledgeBase & knowledge, const std::string & region_name) { variables.init_vars(knowledge, region_name); }
; A269410: Number of length-4 0..n arrays with no repeated value greater than or equal to the previous repeated value. ; Submitted by Jon Maiga ; 9,63,222,570,1215,2289,3948,6372,9765,14355,20394,28158,37947,50085,64920,82824,104193,129447,159030,193410,233079,278553,330372,389100,455325,529659,612738,705222,807795,921165,1046064,1183248,1333497,1497615,1676430,1870794,2081583,2309697,2556060,2821620,3107349,3414243,3743322,4095630,4472235,4874229,5302728,5758872,6243825,6758775,7304934,7883538,8495847,9143145,9826740,10547964,11308173,12108747,12951090,13836630,14766819,15743133,16767072,17840160,18963945,20139999,21369918,22655322 mov $1,3 add $1,$0 add $0,1 mul $1,$0 bin $0,2 pow $1,2 sub $1,$0 mov $0,$1
/*** * Bitwuzla: Satisfiability Modulo Theories (SMT) solver. * * This file is part of Bitwuzla. * * Copyright (C) 2007-2021 by the authors listed in the AUTHORS file. * * See COPYING for more information on using this software. */ #include "test.h" extern "C" { #include "bzlaexp.h" #include "utils/bzlaunionfind.h" } class TestUnionFind : public TestBzla { protected: void SetUp() override { TestBzla::SetUp(); d_mm = d_bzla->mm; d_sort = bzla_sort_bv(d_bzla, 32); } void TearDown() override { bzla_sort_release(d_bzla, d_sort); TestBzla::TearDown(); } BzlaMemMgr *d_mm = nullptr; BzlaSortId d_sort = 0; }; TEST_F(TestUnionFind, test1) { BzlaUnionFind *ufind = bzla_ufind_new(d_mm); BzlaNode *x = bzla_exp_var(d_bzla, d_sort, "x"); bzla_ufind_add(ufind, x); ASSERT_EQ(bzla_ufind_get_repr(ufind, x), x); bzla_ufind_add(ufind, x); ASSERT_EQ(bzla_ufind_get_repr(ufind, x), x); bzla_node_release(d_bzla, x); bzla_ufind_delete(ufind); } TEST_F(TestUnionFind, test2) { BzlaUnionFind *ufind = bzla_ufind_new(d_mm); BzlaNode *x = bzla_exp_var(d_bzla, d_sort, "x"); BzlaNode *y = bzla_exp_var(d_bzla, d_sort, "y"); bzla_ufind_merge(ufind, x, y); ASSERT_EQ(bzla_ufind_get_repr(ufind, x), bzla_ufind_get_repr(ufind, y)); ASSERT_TRUE(bzla_ufind_is_equal(ufind, x, y)); ASSERT_EQ(bzla_ufind_get_repr(ufind, y), x); bzla_node_release(d_bzla, x); bzla_node_release(d_bzla, y); bzla_ufind_delete(ufind); } TEST_F(TestUnionFind, test3) { BzlaUnionFind *ufind = bzla_ufind_new(d_mm); BzlaNode *x = bzla_exp_var(d_bzla, d_sort, "x"); BzlaNode *y = bzla_exp_var(d_bzla, d_sort, "y"); BzlaNode *z = bzla_exp_var(d_bzla, d_sort, "z"); bzla_ufind_merge(ufind, x, y); bzla_ufind_merge(ufind, y, z); ASSERT_EQ(bzla_ufind_get_repr(ufind, x), bzla_ufind_get_repr(ufind, z)); ASSERT_EQ(bzla_ufind_get_repr(ufind, z), x); bzla_node_release(d_bzla, x); bzla_node_release(d_bzla, y); bzla_node_release(d_bzla, z); bzla_ufind_delete(ufind); } TEST_F(TestUnionFind, test4) { BzlaUnionFind *ufind = bzla_ufind_new(d_mm); BzlaNode *w = bzla_exp_var(d_bzla, d_sort, "w"); BzlaNode *x = bzla_exp_var(d_bzla, d_sort, "x"); BzlaNode *y = bzla_exp_var(d_bzla, d_sort, "y"); BzlaNode *z = bzla_exp_var(d_bzla, d_sort, "z"); bzla_ufind_merge(ufind, w, x); bzla_ufind_merge(ufind, y, z); ASSERT_NE(bzla_ufind_get_repr(ufind, x), bzla_ufind_get_repr(ufind, y)); bzla_ufind_merge(ufind, x, z); ASSERT_EQ(bzla_ufind_get_repr(ufind, x), bzla_ufind_get_repr(ufind, y)); ASSERT_EQ(bzla_ufind_get_repr(ufind, w), bzla_ufind_get_repr(ufind, z)); bzla_node_release(d_bzla, w); bzla_node_release(d_bzla, x); bzla_node_release(d_bzla, y); bzla_node_release(d_bzla, z); bzla_ufind_delete(ufind); } TEST_F(TestUnionFind, test5) { BzlaUnionFind *ufind = bzla_ufind_new(d_mm); BzlaNode *x = bzla_exp_var(d_bzla, d_sort, "x"); BzlaNode *not_x = bzla_exp_bv_not(d_bzla, x); bzla_ufind_add(ufind, x); bzla_ufind_add(ufind, not_x); ASSERT_EQ(bzla_ufind_get_repr(ufind, x), x); ASSERT_EQ(bzla_ufind_get_repr(ufind, not_x), not_x); ASSERT_FALSE(bzla_ufind_is_equal(ufind, x, not_x)); bzla_ufind_merge(ufind, x, not_x); ASSERT_TRUE(bzla_ufind_is_equal(ufind, x, not_x)); bzla_node_release(d_bzla, x); bzla_node_release(d_bzla, not_x); bzla_ufind_delete(ufind); }
dnl AMD64 mpn_redc_1 optimised for Intel Haswell. dnl Contributed to the GNU project by Torbjörn Granlund. dnl Copyright 2013 Free Software Foundation, Inc. dnl This file is part of the GNU MP Library. dnl dnl The GNU MP Library is free software; you can redistribute it and/or modify dnl it under the terms of either: dnl dnl * the GNU Lesser General Public License as published by the Free dnl Software Foundation; either version 3 of the License, or (at your dnl option) any later version. dnl dnl or dnl dnl * the GNU General Public License as published by the Free Software dnl Foundation; either version 2 of the License, or (at your option) any dnl later version. dnl dnl or both in parallel, as here. dnl dnl The GNU MP Library is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License dnl for more details. dnl dnl You should have received copies of the GNU General Public License and the dnl GNU Lesser General Public License along with the GNU MP Library. If not, dnl see https://www.gnu.org/licenses/. include(`../config.m4') C cycles/limb C AMD K8,K9 n/a C AMD K10 n/a C AMD bull n/a C AMD pile n/a C AMD steam ? C AMD bobcat n/a C AMD jaguar ? C Intel P4 n/a C Intel core n/a C Intel NHM n/a C Intel SBR n/a C Intel IBR n/a C Intel HWL 2.32 C Intel BWL ? C Intel atom n/a C VIA nano n/a C The inner loops of this code are the result of running a code generation and C optimisation tool suite written by David Harvey and Torbjörn Granlund. C TODO C * Micro-optimise. C * Consider inlining mpn_add_n. Tests indicate that this saves just 1-2 C cycles, though. define(`rp', `%rdi') C rcx define(`up', `%rsi') C rdx define(`mp_param', `%rdx') C r8 define(`n', `%rcx') C r9 define(`u0inv_param', `%r8') C stack define(`i', `%r14') define(`j', `%r15') define(`mp', `%rdi') define(`u0inv', `(%rsp)') C stack ABI_SUPPORT(DOS64) C FIXME: needs verification ABI_SUPPORT(STD64) ASM_START() TEXT ALIGN(16) PROLOGUE(mpn_redc_1) FUNC_ENTRY(4) IFDOS(` mov 56(%rsp), %r8 ') push %rbx push %rbp push %r12 push %r13 push %r14 push %r15 push rp mov mp_param, mp C note that rp and mp shares register mov (up), %rdx neg n push %r8 C put u0inv on stack imul u0inv_param, %rdx C first iteration q0 mov n, j C outer loop induction var test $1, R8(n) jnz L(bx1) L(bx0): test $2, R8(n) jz L(o0b) cmp $-2, R32(n) jnz L(o2) C Special code for n = 2 since general code cannot handle it mov 8(%rsp), %rbx C rp lea 16(%rsp), %rsp C deallocate two slots mulx( (mp), %r9, %r12) mulx( 8,(mp), %r11, %r10) add %r12, %r11 adc $0, %r10 add (up), %r9 C = 0 adc 8(up), %r11 C r11 = up[1] adc $0, %r10 C -> up[0] mov %r11, %rdx imul u0inv_param, %rdx mulx( (mp), %r13, %r12) mulx( 8,(mp), %r14, %r15) xor R32(%rax), R32(%rax) add %r12, %r14 adc $0, %r15 add %r11, %r13 C = 0 adc 16(up), %r14 C rp[2] adc $0, %r15 C -> up[1] add %r14, %r10 adc 24(up), %r15 mov %r10, (%rbx) mov %r15, 8(%rbx) setc R8(%rax) jmp L(ret) L(o2): lea 2(n), i C inner loop induction var mulx( (mp), %r9, %r8) mulx( 8,(mp), %r11, %r10) sar $2, i add %r8, %r11 jmp L(lo2) ALIGN(16) L(tp2): adc %rax, %r9 lea 32(up), up adc %r8, %r11 L(lo2): mulx( 16,(mp), %r13, %r12) mov (up), %r8 mulx( 24,(mp), %rbx, %rax) lea 32(mp), mp adc %r10, %r13 adc %r12, %rbx adc $0, %rax mov 8(up), %r10 mov 16(up), %r12 add %r9, %r8 mov 24(up), %rbp mov %r8, (up) adc %r11, %r10 mulx( (mp), %r9, %r8) mov %r10, 8(up) adc %r13, %r12 mov %r12, 16(up) adc %rbx, %rbp mulx( 8,(mp), %r11, %r10) mov %rbp, 24(up) inc i jnz L(tp2) L(ed2): mov 56(up,n,8), %rdx C next iteration up[0] lea 16(mp,n,8), mp C mp = (last starting mp) adc %rax, %r9 adc %r8, %r11 mov 32(up), %r8 adc $0, %r10 imul u0inv, %rdx C next iteration q0 mov 40(up), %rax add %r9, %r8 mov %r8, 32(up) adc %r11, %rax mov %rax, 40(up) lea 56(up,n,8), up C up = (last starting up) + 1 adc $0, %r10 mov %r10, -8(up) inc j jnz L(o2) jmp L(cj) L(bx1): test $2, R8(n) jz L(o3a) L(o1a): cmp $-1, R32(n) jnz L(o1b) C Special code for n = 1 since general code cannot handle it mov 8(%rsp), %rbx C rp lea 16(%rsp), %rsp C deallocate two slots mulx( (mp), %r11, %r10) add (up), %r11 adc 8(up), %r10 mov %r10, (%rbx) mov $0, R32(%rax) setc R8(%rax) jmp L(ret) L(o1b): lea 24(mp), mp L(o1): lea 1(n), i C inner loop induction var mulx( -24,(mp), %r11, %r10) mulx( -16,(mp), %r13, %r12) mulx( -8,(mp), %rbx, %rax) sar $2, i add %r10, %r13 adc %r12, %rbx adc $0, %rax mov (up), %r10 mov 8(up), %r12 mov 16(up), %rbp add %r11, %r10 jmp L(lo1) ALIGN(16) L(tp1): adc %rax, %r9 lea 32(up), up adc %r8, %r11 mulx( 16,(mp), %r13, %r12) mov -8(up), %r8 mulx( 24,(mp), %rbx, %rax) lea 32(mp), mp adc %r10, %r13 adc %r12, %rbx adc $0, %rax mov (up), %r10 mov 8(up), %r12 add %r9, %r8 mov 16(up), %rbp mov %r8, -8(up) adc %r11, %r10 L(lo1): mulx( (mp), %r9, %r8) mov %r10, (up) adc %r13, %r12 mov %r12, 8(up) adc %rbx, %rbp mulx( 8,(mp), %r11, %r10) mov %rbp, 16(up) inc i jnz L(tp1) L(ed1): mov 48(up,n,8), %rdx C next iteration up[0] lea 40(mp,n,8), mp C mp = (last starting mp) adc %rax, %r9 adc %r8, %r11 mov 24(up), %r8 adc $0, %r10 imul u0inv, %rdx C next iteration q0 mov 32(up), %rax add %r9, %r8 mov %r8, 24(up) adc %r11, %rax mov %rax, 32(up) lea 48(up,n,8), up C up = (last starting up) + 1 adc $0, %r10 mov %r10, -8(up) inc j jnz L(o1) jmp L(cj) L(o3a): cmp $-3, R32(n) jnz L(o3b) C Special code for n = 3 since general code cannot handle it L(n3): mulx( (mp), %rbx, %rax) mulx( 8,(mp), %r9, %r14) add (up), %rbx mulx( 16,(mp), %r11, %r10) adc %rax, %r9 C W 1 adc %r14, %r11 C W 2 mov 8(up), %r14 mov u0inv_param, %rdx adc $0, %r10 C W 3 mov 16(up), %rax add %r9, %r14 C W 1 mov %r14, 8(up) mulx( %r14, %rdx, %r13) C next iteration q0 adc %r11, %rax C W 2 mov %rax, 16(up) adc $0, %r10 C W 3 mov %r10, (up) lea 8(up), up C up = (last starting up) + 1 inc j jnz L(n3) jmp L(cj) L(o3b): lea 8(mp), mp L(o3): lea 4(n), i C inner loop induction var mulx( -8,(mp), %rbx, %rax) mulx( (mp), %r9, %r8) mov (up), %rbp mulx( 8,(mp), %r11, %r10) sar $2, i add %rbx, %rbp nop adc %rax, %r9 jmp L(lo3) ALIGN(16) L(tp3): adc %rax, %r9 lea 32(up), up L(lo3): adc %r8, %r11 mulx( 16,(mp), %r13, %r12) mov 8(up), %r8 mulx( 24,(mp), %rbx, %rax) lea 32(mp), mp adc %r10, %r13 adc %r12, %rbx adc $0, %rax mov 16(up), %r10 mov 24(up), %r12 add %r9, %r8 mov 32(up), %rbp mov %r8, 8(up) adc %r11, %r10 mulx( (mp), %r9, %r8) mov %r10, 16(up) adc %r13, %r12 mov %r12, 24(up) adc %rbx, %rbp mulx( 8,(mp), %r11, %r10) mov %rbp, 32(up) inc i jnz L(tp3) L(ed3): mov 64(up,n,8), %rdx C next iteration up[0] lea 24(mp,n,8), mp C mp = (last starting mp) adc %rax, %r9 adc %r8, %r11 mov 40(up), %r8 adc $0, %r10 imul u0inv, %rdx C next iteration q0 mov 48(up), %rax add %r9, %r8 mov %r8, 40(up) adc %r11, %rax mov %rax, 48(up) lea 64(up,n,8), up C up = (last starting up) + 1 adc $0, %r10 mov %r10, -8(up) inc j jnz L(o3) jmp L(cj) L(o0b): lea 16(mp), mp L(o0): mov n, i C inner loop induction var mulx( -16,(mp), %r13, %r12) mulx( -8,(mp), %rbx, %rax) sar $2, i add %r12, %rbx adc $0, %rax mov (up), %r12 mov 8(up), %rbp mulx( (mp), %r9, %r8) add %r13, %r12 jmp L(lo0) ALIGN(16) L(tp0): adc %rax, %r9 lea 32(up), up adc %r8, %r11 mulx( 16,(mp), %r13, %r12) mov -16(up), %r8 mulx( 24,(mp), %rbx, %rax) lea 32(mp), mp adc %r10, %r13 adc %r12, %rbx adc $0, %rax mov -8(up), %r10 mov (up), %r12 add %r9, %r8 mov 8(up), %rbp mov %r8, -16(up) adc %r11, %r10 mulx( (mp), %r9, %r8) mov %r10, -8(up) adc %r13, %r12 mov %r12, (up) L(lo0): adc %rbx, %rbp mulx( 8,(mp), %r11, %r10) mov %rbp, 8(up) inc i jnz L(tp0) L(ed0): mov 40(up,n,8), %rdx C next iteration up[0] lea 32(mp,n,8), mp C mp = (last starting mp) adc %rax, %r9 adc %r8, %r11 mov 16(up), %r8 adc $0, %r10 imul u0inv, %rdx C next iteration q0 mov 24(up), %rax add %r9, %r8 mov %r8, 16(up) adc %r11, %rax mov %rax, 24(up) lea 40(up,n,8), up C up = (last starting up) + 1 adc $0, %r10 mov %r10, -8(up) inc j jnz L(o0) L(cj): IFSTD(` mov 8(%rsp), %rdi C param 1: rp lea 16-8(%rsp), %rsp C deallocate 2, add back for alignment lea (up,n,8), %rdx C param 3: up - n neg R32(n) ') C param 4: n IFDOS(` mov up, %rdx C param 2: up lea (up,n,8), %r8 C param 3: up - n neg R32(n) mov n, %r9 C param 4: n mov 8(%rsp), %rcx C param 1: rp lea 16-32-8(%rsp), %rsp') C deallocate 2, allocate shadow, align ASSERT(nz, `test $15, %rsp') CALL( mpn_add_n) IFSTD(` lea 8(%rsp), %rsp ') IFDOS(` lea 32+8(%rsp), %rsp') L(ret): pop %r15 pop %r14 pop %r13 pop %r12 pop %rbp pop %rbx FUNC_EXIT() ret EPILOGUE()
; ;================================================================================================== ; PARPORTPROP DRIVER ;================================================================================================== ; ; TODO: ; 1) ADD SUPPORT FOR DSKY ; PPP_IO .EQU PPIBASE + 0 ; PPP DATA I/O (PPI PORT A) PPP_CTL .EQU PPIBASE + 2 ; PPP CTL LINES (PPI PORT C) PPP_PPICTL .EQU PPIBASE + 3 ; PPI CONTROL PORT ; ; COMMAND BYTES ; PPP_CMDNOP .EQU $00 ; DO NOTHING PPP_CMDECHOBYTE .EQU $01 ; RECEIVE A BYTE, INVERT IT, SEND IT BACK PPP_CMDECHOBUF .EQU $02 ; RECEIVE 512 BYTE BUFFER, SEND IT BACK ; PPP_CMDDSKRES .EQU $10 ; RESTART SD CARD SUPPORT PPP_CMDDSKSTAT .EQU $11 ; SEND LAST SD CARD STATUS (4 BYTES) PPP_CMDDSKPUT .EQU $12 ; PPI -> SECTOR BUFFER -> PPP PPP_CMDDSKGET .EQU $13 ; PPP -> SECTOR BUFFER -> PPI PPP_CMDDSKRD .EQU $14 ; READ SCTOR FROM SD CARD INTO PPP BUFFER, RETURN 1 BYTE STATUS PPP_CMDDSKWR .EQU $15 ; WRITE SECTOR TO SD CARD FROM PPP BUFFER, RETURN 1 BYTE STATUS PPP_CMDDSKTYPE .EQU $16 ; GET SD CARD TYPE PPP_CMDDSKCAP .EQU $17 ; GET CURRENT DISK CAPACITY PPP_CMDDSKCSD .EQU $18 ; GET CURRENT SD CARD CSD REGISTER ; PPP_CMDVIDOUT .EQU $20 ; WRITE A BYTE TO THE TERMINAL EMULATOR ; PPP_CMDKBDSTAT .EQU $30 ; RETURN A BYTE WITH NUMBER OF CHARACTERS IN BUFFER PPP_CMDKBDRD .EQU $31 ; RETURN A CHARACTER, WAIT IF NECESSARY ; PPP_CMDSPKTONE .EQU $40 ; EMIT SPEAKER TONE AT SPECIFIED FREQUENCY AND DURATION ; PPP_CMDSIOINIT .EQU $50 ; RESET SERIAL PORT AND ESTABLISH A NEW BAUD RATE (4 BYTE BAUD RATE) PPP_CMDSIORX .EQU $51 ; RECEIVE A BYTE IN FROM SERIAL PORT PPP_CMDSIOTX .EQU $52 ; TRANSMIT A BYTE OUT OF THE SERIAL PORT PPP_CMDSIORXST .EQU $53 ; SERIAL PORT RECEIVE STATUS (RETURNS # BYTES OF RX BUFFER USED) PPP_CMDSIOTXST .EQU $54 ; SERIAL PORT TRANSMIT STATUS (RETURNS # BYTES OF TX BUFFER SPACE AVAILABLE) PPP_CMDSIORXFL .EQU $55 ; SERIAL PORT RECEIVE BUFFER FLUSH PPP_CMDSIOTXFL .EQU $56 ; SERIAL PORT TRANSMIT BUFFER FLUSH (NOT IMPLEMENTED) ; PPP_CMDRESET .EQU $F0 ; SOFT RESET PROPELLER PPP_CMDVER .EQU $F1 ; SEND FIRMWARE VERSION ; ; GLOBAL PARPORTPROP INITIALIZATION ; PPP_INIT: CALL NEWLINE ; FORMATTING PRTS("PPP: IO=0x$") LD A,PPIBASE CALL PRTHEXBYTE ; CALL PPP_INITPPP ; INIT PPP BOARD RET NZ ; BAIL OUT ON ERROR ; CALL PPP_DETECT ; DETECT PPP PRESENCE ;CALL PC_SPACE ; *DEBUG* ;CALL PRTHEXWORD ; *DEBUG* LD DE,PPP_STR_NOHW ; PREPARE FOR NOT PRESENT JP NZ,WRITESTR ; BAIL OUT WITH NZ IF NOT DETECTED ; CALL PPP_GETVER ; GET F/W VERSION RET NZ ; ABORT ON FAILURE ; ; PRINT FIRMWARE VERSION PRTS(" F/W=$") LD HL,PPP_FWVER CALL LD32 LD A,D CALL PRTDECB CALL PC_PERIOD LD A,E CALL PRTDECB CALL PC_PERIOD CALL PRTDEC ; ; CHECK F/W VERSION & NOTIFY USER IF UPGRADE REQUIRED LD HL,PPP_FWVER CALL LD32 XOR A CP D JR NZ,PPP_INIT1 CP E JR NZ,PPP_INIT1 LD DE,PPP_STR_UPGRADE CALL WRITESTR ; PPP_INIT1: CALL PPPCON_INIT ; CONSOLE INITIALIZATION CALL PPPSD_INIT ; SD CARD INITIALIZATION ; RET ; ; ; PPP_INITPPP: ; SETUP PARALLEL PORT (8255) LD A,%11000010 ; PPI MODE 2 (BI HANDSHAKE), PC0-2 OUT, PB IN OUT (PPP_PPICTL),A ; NOTE: ALL OUTPUTS SET TO LOGIC ZERO ON MODE CHANGE CALL DELAY ; PROBABLY NOT NEEDED ; RESET PROPELLER LD A,%00000101 ; SET PC2 (ASSERT PROP RESET LINE) OUT (PPP_PPICTL),A CALL DELAY ; PROBABLY NOT NEEDED IN A,(PPP_IO) ; CLEAR GARBAGE??? CALL DELAY ; PROBABLY NOT NEEDED LD A,%00000001 ; SET PC0 (CMD FLAG) OUT (PPP_PPICTL),A ; DO IT LD A,PPP_CMDRESET ; RESET COMMAND CALL PPP_PUTBYTE ; SEND IT CALL DELAY ; DELAY FOR PPP TO PROCESS COMMAND LD A,%00000000 ; CLEAR PC0 (CMD FLAG) OUT (PPP_PPICTL),A ; DO IT LD A,%00000100 ; CLEAR PC2 (DEASSERT PROP RESET LINE) OUT (PPP_PPICTL),A ; DO IT ;CALL DELAY ; PROBABLY NOT NEEDED LD DE,1024 ; ONE SECOND CALL VDELAY ; ... DELAY XOR A ; SIGNAL SUCCESS RET ; ; ; PPP_DETECT: LD BC,4096 ; TRY FOR ABOUT 4 SECONDS PPP_DETECT1: LD DE,64 ; 1 MS CALL VDELAY IN A,(PPP_CTL) BIT 5,A JR Z,PPP_DETECT2 IN A,(PPP_IO) ;CALL PC_SPACE ;CALL PRTHEXBYTE CP $AA RET Z ; RETURN IF MATCH ; PPP_DETECT2: DEC BC LD A,B OR C JR NZ,PPP_DETECT1 OR $FF ; SIGNAL FAILURE RET ; ; ; PPP_GETVER: #IF (PPPSDTRACE >= 3) CALL PPP_PRTPREFIX PRTS(" VER$") #ENDIF LD D,PPP_CMDVER ; COMMAND = GET VERSION CALL PPP_SNDCMD ; SEND COMMAND RET NZ LD B,4 ; GET 4 BYTES LD HL,PPP_FWVER PPP_GETVER1: CALL PPP_GETBYTE LD (HL),A INC HL DJNZ PPP_GETVER1 ; #IF (PPPSDTRACE >= 3) CALL PC_SPACE LD HL,PPP_FWVER CALL LD32 CALL PRTHEX32 #ENDIF ; XOR A ; SIGNAL SUCCESS RET ; ; ; PPP_SNDCMD: IN A,(PPP_IO) ; DISCARD ANYTHING PENDING ; WAIT FOR OBF HIGH (OUTPUT BUFFER TO BE EMPTY) IN A,(PPP_CTL) BIT 7,A JR Z,PPP_SNDCMD LD A,%00000001 ; SET CMD FLAG OUT (PPP_PPICTL),A ; SEND IT PPP_SNDCMD0: IN A,(PPP_CTL) BIT 7,A JR Z,PPP_SNDCMD0 LD A,D OUT (PPP_IO),A PPP_SNDCMD1: ; WAIT FOR OBF HIGH (BYTE HAS BEEN RECEIVED) IN A,(PPP_CTL) BIT 7,A JR Z,PPP_SNDCMD1 ; TURN OFF CMD LD A,%00000000 ; CLEAR CMD FLAG OUT (PPP_PPICTL),A XOR A ; SIGNAL SUCCESS RET ; ; ; PPP_PUTBYTE: PUSH AF PPP_PUTBYTE1: IN A,(PPP_CTL) BIT 7,A JR Z,PPP_PUTBYTE1 POP AF OUT (PPP_IO),A RET ; ; ; PPP_GETBYTE: IN A,(PPP_CTL) BIT 5,A JR Z,PPP_GETBYTE IN A,(PPP_IO) RET ; ; PRINT DIAGNONSTIC PREFIX ; PPP_PRTPREFIX: CALL NEWLINE PRTS("PPP:$") RET ; ; ; PPP_STR_NOHW .TEXT " NOT PRESENT$" PPP_STR_UPGRADE .TEXT " !!!UPGRADE REQUIRED!!!$" ; PPP_FWVER .DB $00, $00, $00, $00 ; MMNNBBB (M=MAJOR, N=MINOR, B=BUILD) ; ;================================================================================================== ; PARPORTPROP CONSOLE DRIVER ;================================================================================================== ; PPPCON_ROWS .EQU 37 ; PROPELLER VGA DISPLAY ROWS (40 - 3 STATUS LINES) PPPCON_COLS .EQU 80 ; PROPELLER VGA DISPLAY COLS ; PPPCON_INIT: CALL NEWLINE PRTS("PPPCON:$") ; ; DISPLAY CONSOLE DIMENSIONS CALL PC_SPACE LD A,PPPCON_COLS CALL PRTDECB LD A,'X' CALL COUT LD A,PPPCON_ROWS CALL PRTDECB CALL PRTSTRD .TEXT " TEXT (ANSI)$" ; ; ADD OURSELVES TO CIO DISPATCH TABLE ; LD D,0 ; PHYSICAL UNIT IS ZERO LD E,CIODEV_PPPCON ; DEVICE TYPE LD BC,PPPCON_FNTBL ; BC := FUNCTION TABLE ADDRESS CALL CIO_ADDENT ; ADD ENTRY, A := UNIT ASSIGNED LD (HCB + HCB_CRTDEV),A ; SET OURSELVES AS THE CRT DEVICE ; XOR A RET ; ; DRIVER FUNCTION TABLE ; PPPCON_FNTBL: .DW PPPCON_IN .DW PPPCON_OUT .DW PPPCON_IST .DW PPPCON_OST .DW PPPCON_INITDEV .DW PPPCON_QUERY .DW PPPCON_DEVICE #IF (($ - PPPCON_FNTBL) != (CIO_FNCNT * 2)) .ECHO "*** INVALID PPPCON FUNCTION TABLE ***\n" #ENDIF ; ; CHARACTER INPUT ; WAIT FOR A CHARACTER AND RETURN IT IN E ; PPPCON_IN: CALL PPPCON_IST ; CHECK FOR CHAR PENDING JR Z,PPPCON_IN ; WAIT FOR IT IF NECESSARY LD D,PPP_CMDKBDRD ; CMD = KEYBOARD READ CALL PPP_SNDCMD ; SEND COMMAND CALL PPP_GETBYTE ; GET CHARACTER READ LD E,A ; PUT IN E XOR A ; CLEAR A (SUCCESS) RET ; AND RETURN ; ; CHARACTER INPUT STATUS ; RETURN STATUS IN A, 0 = NOTHING PENDING, > 0 CHAR PENDING ; PPPCON_IST: LD D,PPP_CMDKBDSTAT ; CMD = KEYBOARD STATUS CALL PPP_SNDCMD ; SEND COMMAND CALL PPP_GETBYTE ; GET RESPONSE OR A ; SET FLAGS RET NZ ; A <> 0, CHAR(S) PENDING JP CIO_IDLE ; OTHERWISE RET VIA IDLE PROCESSING ; ; CHARACTER OUTPUT ; WRITE CHARACTER IN E ; PPPCON_OUT: CALL PPPCON_OST ; CHECK FOR OUTPUT READY JR Z,PPPCON_OUT ; WAIT IF NECESSARY LD D,PPP_CMDVIDOUT ; CMD = VIDEO OUTPUT CALL PPP_SNDCMD ; SEND COMMAND LD A,E ; MOVE TO A CALL PPP_PUTBYTE ; SEND IT RET ; RETURN ; ; CHARACTER OUTPUT STATUS ; RETURN STATUS IN A, 0 = NOT READY, > 0 READY TO SEND ; CONSOLE IS ALWAYS READY TO SEND (SYNCHRONOUS OUTPUT) ; PPPCON_OST: XOR A ; SET A=$01 TO SIGNAL READY INC A RET ; ; ; PPPCON_INITDEV: CALL PANIC ; ; ; PPPCON_QUERY: LD DE,0 LD HL,0 XOR A RET ; ; ; PPPCON_DEVICE: LD D,CIODEV_PPPCON ; D := DEVICE TYPE LD E,0 ; E := DEVICE NUM, ALWAYS 0 LD C,$FF ; $FF MEANS TERM W/ NO ATTACHED VDA XOR A ; SIGNAL SUCCESS RET ; ;================================================================================================== ; PARPORTPROP SD CARD DRIVER ;================================================================================================== ; ; SD CARD TYPE ; PPPSD_TYPEUNK .EQU 0 ; CARD TYPE UNKNOWN/UNDETERMINED PPPSD_TYPEMMC .EQU 1 ; MULTIMEDIA CARD (MMC STANDARD) PPPSD_TYPESDSC .EQU 2 ; SDSC CARD (V1) PPPSD_TYPESDHC .EQU 3 ; SDHC CARD (V2) PPPSD_TYPESDXC .EQU 4 ; SDXC CARD (V3) ; ; SD CARD STATUS (PPPSD_STAT) ; PPPSD_STOK .EQU 0 ; OK PPPSD_STINVUNIT .EQU -1 ; INVALID UNIT PPPSD_STRDYTO .EQU -2 ; TIMEOUT WAITING FOR CARD TO BE READY PPPSD_STINITTO .EQU -3 ; INITIALIZATOIN TIMEOUT PPPSD_STCMDTO .EQU -4 ; TIMEOUT WAITING FOR COMMAND RESPONSE PPPSD_STCMDERR .EQU -5 ; COMMAND ERROR OCCURRED (REF SD_RC) PPPSD_STDATAERR .EQU -6 ; DATA ERROR OCCURRED (REF SD_TOK) PPPSD_STDATATO .EQU -7 ; DATA TRANSFER TIMEOUT PPPSD_STCRCERR .EQU -8 ; CRC ERROR ON RECEIVED DATA PACKET PPPSD_STNOMEDIA .EQU -9 ; NO MEDIA IN CONNECTOR PPPSD_STWRTPROT .EQU -10 ; ATTEMPT TO WRITE TO WRITE PROTECTED MEDIA ; ; PPPSD DEVICE CONFIGURATION ; PPPSD_DEVCNT .EQU 1 ; ONE DEVICE SUPPORTED PPPSD_CFGSIZ .EQU 12 ; SIZE OF CFG TBL ENTRIES ; ; PER DEVICE DATA OFFSETS ; PPPSD_DEV .EQU 0 ; OFFSET OF DEVICE NUMBER (BYTE) PPPSD_STAT .EQU 1 ; LAST STATUS (BYTE) PPPSD_TYPE .EQU 2 ; DEVICE TYPE (BYTE) PPPSD_FLAGS .EQU 3 ; FLAG BITS BIT 0=CF, 1=LBA (BYTE) PPPSD_MEDCAP .EQU 4 ; MEDIA CAPACITY (DWORD) PPPSD_LBA .EQU 8 ; OFFSET OF LBA (DWORD) ; PPPSD_CFGTBL: ; DEVICE 0 .DB 0 ; DRIVER DEVICE NUMBER .DB 0 ; DEVICE STATUS .DB 0 ; DEVICE TYPE .DB 0 ; FLAGS BYTE .DW 0,0 ; DEVICE CAPACITY .DW 0,0 ; CURRENT LBA ; #IF ($ - PPPSD_CFGTBL) != (PPPSD_DEVCNT * PPPSD_CFGSIZ) .ECHO "*** INVALID PPPSD CONFIG TABLE ***\n" #ENDIF ; .DB $FF ; END MARKER ; ; SD CARD INITIALIZATION ; PPPSD_INIT: ; ; SETUP THE DISPATCH TABLE ENTRIES ; LD B,PPPSD_DEVCNT ; LOOP CONTROL LD IY,PPPSD_CFGTBL ; START OF CFG TABLE PPPSD_INIT0: PUSH BC ; SAVE LOOP CONTROL LD BC,PPPSD_FNTBL ; BC := FUNC TABLE ADR PUSH IY ; CFG ENTRY POINTER POP DE ; COPY TO DE CALL DIO_ADDENT ; ADD ENTRY, BC IS NOT DESTROYED LD BC,PPPSD_CFGSIZ ; SIZE OF CFG ENTRY ADD IY,BC ; BUMP IY TO NEXT ENTRY POP BC ; RESTORE BC DJNZ PPPSD_INIT0 ; LOOP AS NEEDED ; ; INITIALIZE INDIVIDUAL UNIT(S) AND DISPLAY DEVICE INVENTORY LD B,PPPSD_DEVCNT ; INIT LOOP COUNTER TO DEVICE COUNT LD IY,PPPSD_CFGTBL ; START OF CFG TABLE PPPSD_INIT1: PUSH BC ; SAVE LOOP COUNTER/INDEX CALL PPPSD_INITUNIT ; INITIALIZE IT #IF (PPPSDTRACE < 2) CALL NZ,PPPSD_PRTSTAT ; IF ERROR, SHOW IT #ENDIF LD BC,PPPSD_CFGSIZ ; SIZE OF CFG ENTRY ADD IY,BC ; BUMP IY TO NEXT ENTRY POP BC ; RESTORE LOOP CONTROL DJNZ PPPSD_INIT1 ; DECREMENT LOOP COUNTER AND LOOP AS NEEDED ; RET ; DONE ; ; ; PPPSD_INITUNIT: ; REINITIALIZE THE CARD HERE CALL PPPSD_INITCARD RET NZ ; CALL PPPSD_PRTPREFIX ; ; PRINT CARD TYPE PRTS(" TYPE=$") CALL PPPSD_PRTTYPE ; ; PRINT STORAGE CAPACITY (BLOCK COUNT) PRTS(" BLOCKS=0x$") ; PRINT FIELD LABEL LD A,PPPSD_MEDCAP ; OFFSET TO CAPACITY FIELD CALL LDHLIYA ; HL := IY + A, REG A TRASHED CALL LD32 ; GET THE CAPACITY VALUE CALL PRTHEX32 ; PRINT HEX VALUE ; ; PRINT STORAGE SIZE IN MB PRTS(" SIZE=$") ; PRINT FIELD LABEL LD B,11 ; 11 BIT SHIFT TO CONVERT BLOCKS --> MB CALL SRL32 ; RIGHT SHIFT CALL PRTDEC ; PRINT LOW WORD IN DECIMAL (HIGH WORD DISCARDED) PRTS("MB$") ; PRINT SUFFIX ; XOR A ; SIGNAL SUCCESS RET ; ; ; PPPSD_FNTBL: .DW PPPSD_STATUS .DW PPPSD_RESET .DW PPPSD_SEEK .DW PPPSD_READ .DW PPPSD_WRITE .DW PPPSD_VERIFY .DW PPPSD_FORMAT .DW PPPSD_DEVICE .DW PPPSD_MEDIA .DW PPPSD_DEFMED .DW PPPSD_CAP .DW PPPSD_GEOM #IF (($ - PPPSD_FNTBL) != (DIO_FNCNT * 2)) .ECHO "*** INVALID PPPSD FUNCTION TABLE ***\n" #ENDIF ; PPPSD_VERIFY: PPPSD_FORMAT: PPPSD_DEFMED: CALL PANIC ; INVALID SUB-FUNCTION ; ; ; PPPSD_READ: LD BC,PPPSD_RDSEC ; GET ADR OF SECTOR READ FUNC LD (PPPSD_IOFNADR),BC ; SAVE IT AS PENDING IO FUNC JR PPPSD_IO ; CONTINUE TO GENERIC IO ROUTINE ; ; ; PPPSD_WRITE: LD BC,PPPSD_WRSEC ; GET ADR OF SECTOR READ FUNC LD (PPPSD_IOFNADR),BC ; SAVE IT AS PENDING IO FUNC JR PPPSD_IO ; CONTINUE TO GENERIC IO ROUTINE ; ; ; PPPSD_IO: LD (PPPSD_DSKBUF),HL ; SAVE DISK BUFFER ADDRESS LD A,E ; BLOCK COUNT TO A OR A ; SET FLAGS RET Z ; ZERO SECTOR I/O, RETURN W/ E=0 & A=0 LD B,A ; INIT SECTOR DOWNCOUNTER LD C,0 ; INIT SECTOR R/W COUNTER #IF (PPPSDTRACE == 1) LD HL,PPPSD_PRTERR ; SET UP PPPSD_PRTERR PUSH HL ; ... TO FILTER ALL EXITS #ENDIF PUSH BC ; SAVE COUNTERS CALL PPPSD_CHKCARD ; CHECK / REINIT CARD AS NEEDED POP BC ; RESTORE COUNTERS JR NZ,PPPSD_IO3 ; BAIL OUT ON ERROR PPPSD_IO1: PUSH BC ; SAVE COUNTERS #IF (PPPSDTRACE >= 3) CALL PPPSD_PRTPREFIX #ENDIF LD HL,(PPPSD_IOFNADR) ; GET PENDING IO FUNCTION ADDRESS CALL JPHL ; ... AND CALL IT JR NZ,PPPSD_IO2 ; BAIL OUT ON ERROR ; INCREMENT LBA LD A,PPPSD_LBA ; LBA OFFSET CALL LDHLIYA ; HL := IY + A, REG A TRASHED CALL INC32HL ; INCREMENT THE VALUE ; INCREMENT DMA LD HL,PPPSD_DSKBUF+1 ; POINT TO MSB OF BUFFER ADR INC (HL) ; BUMP DMA BY INC (HL) ; ... 512 BYTES XOR A ; SIGNAL SUCCESS PPPSD_IO2: POP BC ; RECOVER COUNTERS JR NZ,PPPSD_IO3 ; IF ERROR PENDING, BAIL OUT INC C ; BUMP COUNT OF SECTORS READ DJNZ PPPSD_IO1 ; LOOP AS NEEDED PPPSD_IO3: LD E,C ; SECTOR READ COUNT TO E LD HL,(PPPSD_DSKBUF) ; CURRENT BUF ADR TO HL OR A ; SET FLAGS RET ; RETURN WITH A = STATUS ; ; ; PPPSD_RDSEC: ; #IF (PPPSDTRACE >= 3) PRTS(" READ$") #ENDIF LD D,PPP_CMDDSKRD ; READ COMMAND CALL PPP_SNDCMD ; ... AND SEND COMMAND RET NZ ; BAIL OUT ON ERROR CALL PPPSD_SENDBLK ; SEND THE LBA BLOCK NUMBER CALL PPP_GETBYTE ; GET READ RESULT LD (PPPSD_DSKSTAT),A ; SAVE IT #IF (PPPSDTRACE >= 3) CALL PC_SPACE CALL PRTHEXBYTE #ENDIF OR A ; SET FLAGS JR Z,PPPSD_RDSEC1 ; HANDLE ERROR CALL PPPSD_GETDSKSTAT ; GET FULL ERROR CODE JP PPPSD_ERRCMD ; RETURN VIA ERROR HANDLER PPPSD_RDSEC1: ; GET THE SECTOR DATA LD D,PPP_CMDDSKGET ; COMMAND = DSKGET CALL PPP_SNDCMD ; SEND COMMAND RET NZ ; BAIL OUT ON ERROR ; READ THE SECTOR DATA LD BC,512 LD HL,(PPPSD_DSKBUF) PPPSD_RDSEC2: CALL PPP_GETBYTE LD (HL),A INC HL DEC BC LD A,B OR C JP NZ,PPPSD_RDSEC2 XOR A ; SIGNAL SUCCESS RET ; ; ; PPPSD_WRSEC: ; #IF (PPPSDTRACE >= 3) PRTS(" WRITE$") #ENDIF ; PUT THE SECTOR DATA LD D,PPP_CMDDSKPUT ; COMMAND = DSKPUT CALL PPP_SNDCMD ; SEND COMMAND RET NZ ; SEND OVER THE SECTOR CONTENTS LD BC,512 LD HL,(PPPSD_DSKBUF) PPPSD_WRSEC1: LD A,(HL) INC HL CALL PPP_PUTBYTE DEC BC LD A,B OR C JP NZ,PPPSD_WRSEC1 ; WRITE THE SECTOR LD D,PPP_CMDDSKWR ; COMMAND = DSKWR CALL PPP_SNDCMD RET NZ CALL PPPSD_SENDBLK ; SEND THE LBA BLOCK NUMBER CALL PPP_GETBYTE LD (PPPSD_DSKSTAT),A ; SAVE IT #IF (PPPSDTRACE >= 3) CALL PC_SPACE CALL PRTHEXBYTE #ENDIF OR A ; SET FLAGS RET Z ; DONE IF NO ERRORS ; HANDLE ERROR CALL PPPSD_GETDSKSTAT ; GET FULL ERROR CODE JP PPPSD_ERRCMD ; EXIT VIA ERROR HANDLER ; ; REPORT SD CARD READY STATE ; PPPSD_STATUS: LD A,(IY+PPPSD_STAT) ; GET THE CURRENT READY STATUS OR A RET ; ; ; PPPSD_RESET: XOR A ; ALWAYS OK RET ; ; ; PPPSD_DEVICE: LD D,DIODEV_PPPSD ; D := DEVICE TYPE LD E,(IY+PPPSD_DEV) ; E := PHYSICAL DEVICE NUMBER LD C,%01010000 ; C := ATTRIBUTES, REMOVABLE, SD CARD XOR A ; SIGNAL SUCCESS RET ; ; SETUP FOR SUBSEQUENT ACCESS ; INIT CARD IF NOT READY OR ON DRIVE LOG IN ; PPPSD_MEDIA: ; REINITIALIZE THE CARD HERE TO DETERMINE PRESENCE CALL PPPSD_INITCARD #IF (PPPSDTRACE == 1) CALL PPPSD_PRTERR ; PRINT ANY ERRORS #ENDIF LD E,MID_HD ; ASSUME WE ARE OK RET Z ; RETURN IF GOOD INIT LD E,MID_NONE ; SIGNAL NO MEDA RET ; AND RETURN ; ; ; PPPSD_SEEK: BIT 7,D ; CHECK FOR LBA FLAG CALL Z,HB_CHS2LBA ; CLEAR MEANS CHS, CONVERT TO LBA RES 7,D ; CLEAR FLAG REGARDLESS (DOES NO HARM IF ALREADY LBA) LD (IY+PPPSD_LBA+0),L ; SAVE NEW LBA LD (IY+PPPSD_LBA+1),H ; ... LD (IY+PPPSD_LBA+2),E ; ... LD (IY+PPPSD_LBA+3),D ; ... XOR A ; SIGNAL SUCCESS RET ; AND RETURN ; ; ; PPPSD_CAP: LD A,PPPSD_MEDCAP ; OFFSET TO CAPACITY FIELD CALL LDHLIYA ; HL := IY + A, REG A TRASHED CALL LD32 ; GET THE CURRENT CAPACITY INTO DE:HL LD BC,512 ; 512 BYTES PER BLOCK LD A,(IY+PPPSD_STAT) ; GET CURRENT STATUS OR A ; SET FLAGS RET ; ; ; PPPSD_GEOM: ; FOR LBA, WE SIMULATE CHS ACCESS USING 16 HEADS AND 16 SECTORS ; RETURN HS:CC -> DE:HL, SET HIGH BIT OF D TO INDICATE LBA CAPABLE CALL PPPSD_CAP ; GET TOTAL BLOCKS IN DE:HL, BLOCK SIZE TO BC LD L,H ; DIVIDE BY 256 FOR # TRACKS LD H,E ; ... HIGH BYTE DISCARDED, RESULT IN HL LD D,16 | $80 ; HEADS / CYL = 16, SET LBA CAPABILITY BIT LD E,16 ; SECTORS / TRACK = 16 RET ; DONE, A STILL HAS PPPSD_CAP STATUS ; ; REINITIALIZE THE SD CARD ; PPPSD_INITCARD: ;; CLEAR ALL STATUS DATA ;LD HL,PPPSD_UNITDATA ;LD BC,PPPSD_UNITDATALEN ;XOR A ;CALL FILL ; ; RESET INTERFACE, RETURN WITH NZ ON FAILURE #IF (PPPSDTRACE >= 3) CALL PPPSD_PRTPREFIX PRTS(" RESET$") #ENDIF ; RESET & STATUS DISK LD D,PPP_CMDDSKRES ; COMMAND = DSKRESET CALL PPP_SNDCMD RET NZ CALL PPP_GETBYTE ; GET STATUS LD (PPPSD_DSKSTAT),A ; SAVE STATUS #IF (PPPSDTRACE >= 3) CALL PC_SPACE CALL PRTHEXBYTE #ENDIF OR A JR Z,PPPSD_INITCARD1 ; HANDLE ERROR CALL PPPSD_GETDSKSTAT ; GET FULL ERROR CODE ;JP PPPSD_ERRCMD ; HANDLE ERRORS JP PPPSD_NOMEDIA ; RETURN W/ NO MEDIA ERROR PPPSD_INITCARD1: #IF (PPPSDTRACE >= 3) ; GET CSD IF DEBUGGING CALL PPPSD_GETCSD RET NZ #ENDIF ; GET CARD TYPE CALL PPPSD_GETTYPE RET NZ ; GET CAPACITY CALL PPPSD_GETCAP RET NZ RET ; ; CHECK THE SD CARD, ATTEMPT TO REINITIALIZE IF NEEDED ; PPPSD_CHKCARD: LD A,(IY+PPPSD_STAT) ; GET STATUS OR A ; SET FLAGS RET Z ; IF ALL GOOD, DONE JP PPPSD_INITCARD ; OTHERWISE, REINIT ; ; ; PPPSD_GETDSKSTAT: #IF (PPPSDTRACE >= 3) CALL PPPSD_PRTPREFIX PRTS(" STAT$") #ENDIF LD D,PPP_CMDDSKSTAT ; COMMAND = GET DISK STATUS CALL PPP_SNDCMD ; SEND COMMAND RET NZ ; ABORT ON ERROR LD B,4 ; GET 4 BYTES LD HL,PPPSD_ERRCODE ; TO ERROR CODE PPPSD_GETDSKSTAT1: CALL PPP_GETBYTE LD (HL),A INC HL DJNZ PPPSD_GETDSKSTAT1 #IF (PPPSDTRACE >= 3) CALL PC_SPACE LD HL,PPPSD_ERRCODE CALL LD32 CALL PRTHEX32 #ENDIF XOR A RET ; ; ; PPPSD_GETTYPE: #IF (PPPSDTRACE >= 3) CALL PPPSD_PRTPREFIX PRTS(" TYPE$") #ENDIF LD D,PPP_CMDDSKTYPE ; COMMAND = GET DISK TYPE CALL PPP_SNDCMD ; SEND COMMAND RET NZ ; ABORT ON ERROR CALL PPP_GETBYTE ; GET DISK TYPE VALUE LD (IY+PPPSD_TYPE),A ; SAVE IT #IF (PPPSDTRACE >= 3) CALL PC_SPACE CALL PRTHEXBYTE #ENDIF XOR A ; SIGNAL SUCCESS RET ; ; ; PPPSD_GETCAP: #IF (PPPSDTRACE >= 3) CALL PPPSD_PRTPREFIX PRTS(" CAP$") #ENDIF LD D,PPP_CMDDSKCAP ; COMMAND = GET CAPACITY CALL PPP_SNDCMD ; SEND COMMAND RET NZ ; ABORT ON ERROR LD A,PPPSD_MEDCAP ; OFFSET OF CAPACITY CALL LDHLIYA ; HL := IY + A, REG A TRASHED LD B,4 ; GET 4 BYTES PPPSD_GETCAP1: CALL PPP_GETBYTE LD (HL),A INC HL DJNZ PPPSD_GETCAP1 #IF (PPPSDTRACE >= 3) CALL PC_SPACE LD A,PPPSD_MEDCAP ; OFFSET OF CAPACITY CALL LDHLIYA ; HL := IY + A, REG A TRASHED CALL LD32 CALL PRTHEX32 #ENDIF XOR A RET ; ; ; PPPSD_GETCSD: #IF (PPPSDTRACE >= 3) CALL PPPSD_PRTPREFIX PRTS(" CSD$") #ENDIF LD D,PPP_CMDDSKCSD ; COMMAND = GET CAPACITY CALL PPP_SNDCMD ; SEND COMMAND RET NZ ; ABORT ON ERROR LD B,16 ; GET 4 BYTES LD HL,PPPSD_CSDBUF PPPSD_GETCSD1: CALL PPP_GETBYTE LD (HL),A INC HL DJNZ PPPSD_GETCSD1 #IF (PPPSDTRACE >= 3) CALL PC_SPACE LD DE,PPPSD_CSDBUF LD A,16 CALL PRTHEXBUF #ENDIF XOR A RET ; ; SEND INDEX OF BLOCK TO READ FROM SD CARD ; 32 BIT VALUE (4 BYTES) ; NOTE THAT BYTES ARE SENT REVERSED, PROPELLER IS LITTLE ENDIAN ; PPPSD_SENDBLK: #IF (PPPSDTRACE >= 3) PRTS(" BLK$") #ENDIF #IF (PPPSDTRACE >= 3) CALL PC_SPACE LD A,PPPSD_LBA ; OFFSET OF LBA CALL LDHLIYA ; HL := IY + A, REG A TRASHED CALL LD32 CALL PRTHEX32 #ENDIF LD A,PPPSD_LBA ; OFFSET OF LBA CALL LDHLIYA ; HL := IY + A, REG A TRASHED LD B,4 PPPSD_SENDBLK1: LD A,(HL) ;CALL PC_SPACE ;CALL PRTHEXBYTE INC HL CALL PPP_PUTBYTE DJNZ PPPSD_SENDBLK1 RET ; ;============================================================================= ; ERROR HANDLING AND DIAGNOSTICS ;============================================================================= ; ; ERROR HANDLERS ; PPPSD_INVUNIT: LD A,PPPSD_STINVUNIT JR PPPSD_ERR2 ; SPECIAL CASE FOR INVALID UNIT ; PPPSD_ERRRDYTO: LD A,PPPSD_STRDYTO JR PPPSD_ERR ; PPPSD_ERRINITTO: LD A,PPPSD_STINITTO JR PPPSD_ERR ; PPPSD_ERRCMDTO: LD A,PPPSD_STCMDTO JR PPPSD_ERR ; PPPSD_ERRCMD: LD A,PPPSD_STCMDERR JR PPPSD_ERR ; PPPSD_ERRDATA: LD A,PPPSD_STDATAERR JR PPPSD_ERR ; PPPSD_ERRDATATO: LD A,PPPSD_STDATATO JR PPPSD_ERR ; PPPSD_ERRCRC: LD A,PPPSD_STCRCERR JR PPPSD_ERR ; PPPSD_NOMEDIA: LD A,PPPSD_STNOMEDIA JR PPPSD_ERR ; PPPSD_WRTPROT: LD A,PPPSD_STWRTPROT JR PPPSD_ERR2 ; DO NOT UPDATE UNIT STATUS! ; PPPSD_ERR: LD (IY+PPPSD_STAT),A ; UPDATE STATUS ; PPPSD_ERR2: #IF (PPPSDTRACE >= 2) CALL PPPSD_PRTSTAT #ENDIF OR A ; SET FLAGS RET ; ; ; PPPSD_PRTERR: RET Z ; DONE IF NO ERRORS ; FALL THRU TO PPPSD_PRTSTAT ; ; PRINT STATUS STRING ; PPPSD_PRTSTAT: PUSH AF PUSH DE PUSH HL OR A LD DE,PPPSD_STR_STOK JR Z,PPPSD_PRTSTAT1 INC A LD DE,PPPSD_STR_STINVUNIT JR Z,PPPSD_PRTSTAT1 ; INVALID UNIT IS SPECIAL CASE INC A LD DE,PPPSD_STR_STRDYTO JR Z,PPPSD_PRTSTAT1 INC A LD DE,PPPSD_STR_STINITTO JR Z,PPPSD_PRTSTAT1 INC A LD DE,PPPSD_STR_STCMDTO JR Z,PPPSD_PRTSTAT1 INC A LD DE,PPPSD_STR_STCMDERR JR Z,PPPSD_PRTSTAT1 INC A LD DE,PPPSD_STR_STDATAERR JR Z,PPPSD_PRTSTAT1 INC A LD DE,PPPSD_STR_STDATATO JR Z,PPPSD_PRTSTAT1 INC A LD DE,PPPSD_STR_STCRCERR JR Z,PPPSD_PRTSTAT1 INC A LD DE,PPPSD_STR_STNOMEDIA JR Z,PPPSD_PRTSTAT1 INC A LD DE,PPPSD_STR_STWRTPROT JR Z,PPPSD_PRTSTAT1 LD DE,PPPSD_STR_STUNK PPPSD_PRTSTAT1: CALL PPPSD_PRTPREFIX ; PRINT UNIT PREFIX CALL PC_SPACE ; FORMATTING CALL WRITESTR LD A,(IY+PPPSD_STAT) CP PPPSD_STCMDERR CALL Z,PPPSD_PRTSTAT2 POP HL POP DE POP AF RET PPPSD_PRTSTAT2: CALL PC_SPACE LD A,(PPPSD_DSKSTAT) CALL PRTHEXBYTE CALL PC_SPACE JP PPPSD_PRTERRCODE RET ; ; ; PPPSD_PRTERRCODE: PUSH HL PUSH DE LD HL,PPPSD_ERRCODE CALL LD32 CALL PRTHEX32 POP DE POP HL RET ; ; PRINT DIAGNONSTIC PREFIX ; PPPSD_PRTPREFIX: PUSH AF CALL NEWLINE PRTS("PPPSD$") LD A,(IY+PPPSD_DEV) ; GET CURRENT DEVICE NUM ADD A,'0' CALL COUT CALL PC_COLON POP AF RET ; ; PRINT THE CARD TYPE ; PPPSD_PRTTYPE: LD A,(IY+PPPSD_TYPE) LD DE,PPPSD_STR_TYPEMMC CP PPPSD_TYPEMMC JR Z,PPPSD_PRTTYPE1 LD DE,PPPSD_STR_TYPESDSC CP PPPSD_TYPESDSC JR Z,PPPSD_PRTTYPE1 LD DE,PPPSD_STR_TYPESDHC CP PPPSD_TYPESDHC JR Z,PPPSD_PRTTYPE1 LD DE,PPPSD_STR_TYPESDXC CP PPPSD_TYPESDXC JR Z,PPPSD_PRTTYPE1 LD DE,PPPSD_STR_TYPEUNK PPPSD_PRTTYPE1: JP WRITESTR ; ;============================================================================= ; STRING DATA ;============================================================================= ; ; PPPSD_STR_STOK .TEXT "OK$" PPPSD_STR_STINVUNIT .TEXT "INVALID UNIT$" PPPSD_STR_STRDYTO .TEXT "READY TIMEOUT$" PPPSD_STR_STINITTO .TEXT "INITIALIZATION TIMEOUT$" PPPSD_STR_STCMDTO .TEXT "COMMAND TIMEOUT$" PPPSD_STR_STCMDERR .TEXT "COMMAND ERROR$" PPPSD_STR_STDATAERR .TEXT "DATA ERROR$" PPPSD_STR_STDATATO .TEXT "DATA TIMEOUT$" PPPSD_STR_STCRCERR .TEXT "CRC ERROR$" PPPSD_STR_STNOMEDIA .TEXT "NO MEDIA$" PPPSD_STR_STWRTPROT .TEXT "WRITE PROTECTED$" PPPSD_STR_STUNK .TEXT "UNKNOWN$" ; PPPSD_STR_TYPEUNK .TEXT "UNK$" PPPSD_STR_TYPEMMC .TEXT "MMC$" PPPSD_STR_TYPESDSC .TEXT "SDSC$" PPPSD_STR_TYPESDHC .TEXT "SDHC$" PPPSD_STR_TYPESDXC .TEXT "SDXC$" ; ;============================================================================= ; DATA STORAGE ;============================================================================= ; PPPSD_IOFNADR .DW 0 ; PENDING IO FUNCTION ADDRESS ; PPPSD_DSKBUF .DW 0 ; PPPSD_DSKSTAT .DB 0 PPPSD_ERRCODE .DW 0,0 PPPSD_CSDBUF .FILL 16,0
; A280511: Index sequence of the block-fractal sequence A001468. ; 2,2,5,5,5,5,5,13,13,13,13,13,13,13,13,13,13,13,13,13,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233 add $0,2 mov $1,1 lpb $0 add $1,$2 trn $0,$1 add $2,$1 lpe
@ @ Copyright (c) 2016, Texas Instruments Incorporated @ @ 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 Texas Instruments Incorporated 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. @;******************************************************************************* @; @; ecc_a15_gcc.asm - A15 ECC assembly code @; @;****************************** Global Symbols ********************************* .global ECCA15EnableASM .global ECCA15DisableASM .global ECCA15GetEccErrStatusASM @;******************************* Code Section ********************************** @;================ ECCA15EnableASM ================ .text .func ECCA15EnableASM ECCA15EnableASM: mrc p15, #1, r0, c9, c0, #2 @ Read L2 Control Register orr r0, r0, #0x200000 @ Enable ECC and Parity for A15 push {r1-r12, lr} @ Save registers - ROM code may pollute @ our registers ldr r12, =0x105 @ Set L2 control register - value in R0 smc 0x1 @ Call ROM Code API to set control register pop {r1-r12, pc} @ Restore registers .endfunc @;================ ECCA15DisableASM ================ .text .func ECCA15DisableASM ECCA15DisableASM: mrc p15, #1, r0, c9, c0, #2 @ Read L2 Control Register and r0, r0, #0xffdfffff @ Disable ECC and Parity for A15 push {r1-r12, lr} @ Save registers - ROM code may pollute @ our registers ldr r12, =0x105 @ Set L2 control register - value in R0 smc 0x1 @ Call ROM Code API to set control register pop {r1-r12, pc} @ Restore registers .endfunc @;================ ECCA15GetErrStatusASM ================ .text .func ECCA15GetEccErrStatusASM ECCA15GetEccErrStatusASM: mrc p15, #0, r0, c5, c1, #0 @ Read Auxiliary Data Fault Status Register .endfunc
TextBoxBorder:: ; Draw a cxb text box at hl. ; top row push hl ld a, "┌" ld [hli], a inc a ; ─ call NPlaceChar inc a ; ┐ ld [hl], a pop hl ld de, 20 add hl, de ; middle rows .next push hl ld a, "│" ld [hli], a ld a, " " call NPlaceChar ld [hl], "│" pop hl ld de, 20 add hl, de dec b jr nz, .next ; bottom row ld a, "└" ld [hli], a ld a, "─" call NPlaceChar ld [hl], "┘" ret NPlaceChar:: ; Place char a c times. ld d, c .loop ld [hli], a dec d jr nz, .loop ret PlaceString:: push hl PlaceNextChar:: ld a, [de] cp "@" jr nz, Char4ETest ld b, h ld c, l pop hl ret Char4ETest:: cp $4E ; next jr nz, .char4FTest ld bc, 2 * SCREEN_WIDTH ld a, [hFlags_0xFFFA] bit 2, a jr z, .ok ld bc, SCREEN_WIDTH .ok pop hl add hl, bc push hl jp PlaceNextChar_inc .char4FTest cp $4F ; line jr nz, .next3 pop hl coord hl, 1, 16 push hl jp PlaceNextChar_inc .next3 ; Check against a dictionary dict: macro if \1 == 0 and a else cp \1 endc jp z, \2 endm dict $00, Char00 ; error dict $4C, Char4C ; autocont dict $4B, Char4B ; cont_ dict $51, Char51 ; para dict $49, Char49 ; page dict $52, Char52 ; player dict $53, Char53 ; rival dict $54, Char54 ; POKé dict $5B, Char5B ; PC dict $5E, Char5E ; ROCKET dict $5C, Char5C ; TM dict $5D, Char5D ; TRAINER dict $55, Char55 ; cont dict $56, Char56 ; 6 dots dict $57, Char57 ; done dict $58, Char58 ; prompt dict $4A, Char4A ; PKMN dict $5F, Char5F ; dex dict $59, Char59 ; TARGET dict $5A, Char5A ; USER ld [hli], a call PrintLetterDelay PlaceNextChar_inc:: inc de jp PlaceNextChar Char00:: ld b, h ld c, l pop hl ld de, Char00Text dec de ret Char00Text:: ; “%d ERROR.” TX_FAR _Char00Text db "@" Char52:: ; player’s name push de ld de, wPlayerName jr FinishDTE Char53:: ; rival’s name push de ld de, wRivalName jr FinishDTE Char5D:: ; TRAINER push de ld de, Char5DText jr FinishDTE Char5C:: ; TM push de ld de, Char5CText jr FinishDTE Char5B:: ; PC push de ld de, Char5BText jr FinishDTE Char5E:: ; ROCKET push de ld de, Char5EText jr FinishDTE Char54:: ; POKé push de ld de, Char54Text jr FinishDTE Char56:: ; …… push de ld de, Char56Text jr FinishDTE Char4A:: ; PKMN push de ld de, Char4AText jr FinishDTE Char59:: ; depending on whose turn it is, print ; enemy active monster’s name, prefixed with “Enemy ” ; or ; player active monster’s name ; (like Char5A but flipped) ld a, [H_WHOSETURN] xor 1 jr MonsterNameCharsCommon Char5A:: ; depending on whose turn it is, print ; player active monster’s name ; or ; enemy active monster’s name, prefixed with “Enemy ” ld a, [H_WHOSETURN] MonsterNameCharsCommon:: push de and a jr nz, .Enemy ld de, wBattleMonNick ; player active monster name jr FinishDTE .Enemy ; print “Enemy ” ld de, Char5AText call PlaceString ld h, b ld l, c ld de, wEnemyMonNick ; enemy active monster name FinishDTE:: call PlaceString ld h, b ld l, c pop de inc de jp PlaceNextChar Char5CText:: db "TM@" Char5DText:: db "TRAINER@" Char5BText:: db "PC@" Char5EText:: db "ROCKET@" Char54Text:: db "POKé@" Char56Text:: db "……@" Char5AText:: db "Enemy @" Char4AText:: db $E1, $E2, "@" ; PKMN Char55:: push de ld b, h ld c, l ld hl, Char55Text call TextCommandProcessor ld h, b ld l, c pop de inc de jp PlaceNextChar Char55Text:: ; equivalent to Char4B TX_FAR _Char55Text db "@" Char5F:: ; ends a Pokédex entry ld [hl], "." pop hl ret Char58:: ; prompt ld a, [wLinkState] cp LINK_STATE_BATTLING jp z, .ok ld a, $EE Coorda 18, 16 .ok call ProtectedDelay3 call ManualTextScroll ld a, " " Coorda 18, 16 Char57:: ; done pop hl ld de, Char58Text dec de ret Char58Text:: db "@" Char51:: ; para push de ld a, $EE Coorda 18, 16 call ProtectedDelay3 call ManualTextScroll coord hl, 1, 13 lb bc, 4, 18 call ClearScreenArea ld c, 20 call DelayFrames pop de coord hl, 1, 14 jp PlaceNextChar_inc Char49:: ld a, [hFlags_0xFFFA] bit 3, a jr z, .Char49 ld a, $4e jp Char4ETest .Char49 push de ld a, $EE Coorda 18, 16 call ProtectedDelay3 call ManualTextScroll coord hl, 1, 10 lb bc, 7, 18 call ClearScreenArea ld c, 20 call DelayFrames pop de pop hl coord hl, 1, 11 push hl jp PlaceNextChar_inc Char4B:: ld a, $EE Coorda 18, 16 call ProtectedDelay3 push de call ManualTextScroll pop de ld a, " " Coorda 18, 16 ;fall through Char4C:: push de call ScrollTextUpOneLine call ScrollTextUpOneLine coord hl, 1, 16 pop de jp PlaceNextChar_inc ScrollTextUpOneLine:: coord hl, 0, 14 coord de, 0, 13 ld b, 60 .next ld a, [hli] ld [de], a inc de dec b jr nz, .next coord hl, 1, 16 ld a, " " ld b, SCREEN_WIDTH - 2 .next2 ld [hli], a dec b jr nz, .next2 ; wait five frames ld b, 5 .WaitFrame call DelayFrame dec b jr nz, .WaitFrame ret ProtectedDelay3:: push bc call Delay3 pop bc ret TextCommandProcessor:: ld a, [wLetterPrintingDelayFlags] push af set 1, a ld e, a ld a, [$fff9] xor e ld [wLetterPrintingDelayFlags], a ld a, c ld [wTextDestinationTileAddrBuffer], a ld a, b ld [wTextDestinationTileAddrBuffer + 1], a NextTextCommand:: ld a, [hli] cp a, "@" ; terminator jr nz, .doTextCommand pop af ld [wLetterPrintingDelayFlags], a ret .doTextCommand push hl cp a, $17 jp z, TextCommand17 cp a, $0e jp nc, TextCommand0B ; if a != 0x17 and a >= 0xE, go to command 0xB ; if a < 0xE, use a jump table ld hl, TextCommandJumpTable push bc add a ld b, 0 ld c, a add hl, bc pop bc ld a, [hli] ld h, [hl] ld l, a jp hl ; draw box ; 04AAAABBCC ; AAAA = address of upper left corner ; BB = height ; CC = width TextCommand04:: pop hl ld a, [hli] ld e, a ld a, [hli] ld d, a ld a, [hli] ld b, a ld a, [hli] ld c, a push hl ld h, d ld l, e call TextBoxBorder pop hl jr NextTextCommand ; place string inline ; 00{string} TextCommand00:: pop hl ld d, h ld e, l ld h, b ld l, c call PlaceString ld h, d ld l, e inc hl jr NextTextCommand ; place string from RAM ; 01AAAA ; AAAA = address of string TextCommand01:: pop hl ld a, [hli] ld e, a ld a, [hli] ld d, a push hl ld h, b ld l, c call PlaceString pop hl jr NextTextCommand ; print BCD number ; 02AAAABB ; AAAA = address of BCD number ; BB ; bits 0-4 = length in bytes ; bits 5-7 = unknown flags TextCommand02:: pop hl ld a, [hli] ld e, a ld a, [hli] ld d, a ld a, [hli] push hl ld h, b ld l, c ld c, a call PrintBCDNumber ld b, h ld c, l pop hl jr NextTextCommand ; repoint destination address ; 03AAAA ; AAAA = new destination address TextCommand03:: pop hl ld a, [hli] ld [wTextDestinationTileAddrBuffer], a ld c, a ld a, [hli] ld [wTextDestinationTileAddrBuffer + 1], a ld b, a jp NextTextCommand ; repoint destination to second line of dialogue text box ; 05 ; (no arguments) TextCommand05:: pop hl coord bc, 1, 16 ; address of second line of dialogue text box jp NextTextCommand ; blink arrow and wait for A or B to be pressed ; 06 ; (no arguments) TextCommand06:: ld a, [wLinkState] cp a, LINK_STATE_BATTLING jp z, TextCommand0D ld a, $ee ; down arrow Coorda 18, 16 ; place down arrow in lower right corner of dialogue text box push bc call ManualTextScroll ; blink arrow and wait for A or B to be pressed pop bc ld a, " " Coorda 18, 16 ; overwrite down arrow with blank space pop hl jp NextTextCommand ; scroll text up one line ; 07 ; (no arguments) TextCommand07:: ld a, " " Coorda 18, 16 ; place blank space in lower right corner of dialogue text box call ScrollTextUpOneLine call ScrollTextUpOneLine pop hl coord bc, 1, 16 ; address of second line of dialogue text box jp NextTextCommand ; execute asm inline ; 08{code} TextCommand08:: pop hl ld de, NextTextCommand push de ; return address jp hl ; print decimal number (converted from binary number) ; 09AAAABB ; AAAA = address of number ; BB ; bits 0-3 = how many digits to display ; bits 4-7 = how long the number is in bytes TextCommand09:: pop hl ld a, [hli] ld e, a ld a, [hli] ld d, a ld a, [hli] push hl ld h, b ld l, c ld b, a and a, $0f ld c, a ld a, b and a, $f0 swap a set BIT_LEFT_ALIGN, a ld b, a call PrintNumber ld b, h ld c, l pop hl jp NextTextCommand ; wait half a second if the user doesn't hold A or B ; 0A ; (no arguments) TextCommand0A:: push bc call Joypad ld a, [hJoyHeld] and a, A_BUTTON | B_BUTTON jr nz, .skipDelay ld c, 30 call DelayFrames .skipDelay pop bc pop hl jp NextTextCommand ; plays sounds ; this actually handles various command ID's, not just 0B ; (no arguments) TextCommand0B:: pop hl push bc dec hl ld a, [hli] ld b, a ; b = command number that got us here push hl ld hl, TextCommandSounds .loop ld a, [hli] cp b jr z, .matchFound inc hl jr .loop .matchFound cp a, $14 jr z, .pokemonCry cp a, $15 jr z, .pokemonCry cp a, $16 jr z, .pokemonCry ld a, [hl] call PlaySound call WaitForSoundToFinish pop hl pop bc jp NextTextCommand .pokemonCry push de ld a, [hl] call PlayCry pop de pop hl pop bc jp NextTextCommand ; format: text command ID, sound ID or cry ID TextCommandSounds:: db $0B, SFX_GET_ITEM_1 db $12, SFX_TURN_OFF_PC db $0E, SFX_POKEDEX_RATING db $0F, SFX_GET_ITEM_1 db $10, SFX_GET_ITEM_2 db $11, SFX_GET_KEY_ITEM db $13, SFX_TRADE_MACHINE db $14, PIKACHU ; used in OakSpeech db $15, PIDGEOT ; used in SaffronCityText12 db $16, DEWGONG ; unused? ; draw ellipses ; 0CAA ; AA = number of ellipses to draw TextCommand0C:: pop hl ld a, [hli] ld d, a push hl ld h, b ld l, c .loop ld a, $75 ; ellipsis ld [hli], a push de call Joypad pop de ld a, [hJoyHeld] ; joypad state and a, A_BUTTON | B_BUTTON jr nz, .skipDelay ; if so, skip the delay ld c, 10 call DelayFrames .skipDelay dec d jr nz, .loop ld b, h ld c, l pop hl jp NextTextCommand ; wait for A or B to be pressed ; 0D ; (no arguments) TextCommand0D:: push bc call ManualTextScroll ; wait for A or B to be pressed pop bc pop hl jp NextTextCommand ; process text commands in another ROM bank ; 17AAAABB ; AAAA = address of text commands ; BB = bank TextCommand17:: pop hl ld a, [H_LOADEDROMBANK] push af ld a, [hli] ld e, a ld a, [hli] ld d, a ld a, [hli] ld [H_LOADEDROMBANK], a ld [MBC1RomBank], a push hl ld l, e ld h, d call TextCommandProcessor pop hl pop af ld [H_LOADEDROMBANK], a ld [MBC1RomBank], a jp NextTextCommand TextCommandJumpTable:: dw TextCommand00 dw TextCommand01 dw TextCommand02 dw TextCommand03 dw TextCommand04 dw TextCommand05 dw TextCommand06 dw TextCommand07 dw TextCommand08 dw TextCommand09 dw TextCommand0A dw TextCommand0B dw TextCommand0C dw TextCommand0D
/* * Copyright 2019 Pablo Navais * * 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. */ #include "props_cli.h" #include "props_cmd_factory.h" #include <cstring> #include <string_utils.h> #include <memory_utils.h> #include <props_config.h> /** * Parses the command line arguments to * provide the props command instance. * * @param argc the number of arguments * @param argv the array of arguments * @return the props parameter holder */ PropsCommand* PropsCLI::parse(const int& argc, char* argv[]) { PropsCommand* command = nullptr; // Check minimum options if (argc < 2) { command = PropsCommandFactory::getDefault().getCommand(p_cli::DEFAULT_HELP_CMD_ID); } else { if (strcmp(argv[1], "help")==0) { command = PropsCommandFactory::getDefault().getCommand(p_cli::DEFAULT_HELP_CMD_ID); command->parse(argc-1, argv+1); } else if ((strcmp(argv[1], "--version")==0) || (strcmp(argv[1], "-v")==0)) { command = PropsCommandFactory::getDefault().getCommand(p_cli::DEFAULT_VERSION_CMD_ID); } else { command = PropsCommandFactory::getDefault().getCommand(StringUtils::toUpper(argv[1])); if (command != nullptr) { command->parse(argc-1, argv+1); } else { // Check alias as last resort char **argv_ext; int argc_ext = PropsCLI::getAliasArgs(argc, argv, argv_ext); command = (argc_ext >= 0) ? PropsCommandFactory::getDefault().getCommand(StringUtils::toUpper(argv_ext[1])) : nullptr; if (command != nullptr) { command->parse(argc_ext-1, argv_ext+1); MemoryUtils::free2DArray<char>(argv_ext, argc_ext); } else { command = PropsCommandFactory::getDefault().getUnknownCommand(argv[1]); } } } } return (command != nullptr) ? command : nullptr; } /** * Parses the command line arguments to * provide the props command instance. * * @param argc the number of arguments * @param argv the array of arguments * @param argv_ext the new array of arguments for the alias or null * if alias not found */ int PropsCLI::getAliasArgs(const int& argc, char* argv[], char**& argv_ext) { int argc_ext = -1; const std::string* alias = PropsConfig::getDefault().getValue(std::string("alias.") + argv[1]); if (alias != nullptr) { char **argv_alias; // Split alias int ret = StringUtils::split_cmdline(*alias, argv_alias); // Replace argv with alias args if (ret >= 0) { argc_ext = ret + (argc - 1); argv_ext = new char *[argc_ext]; argv_ext[0] = new char[sizeof(argv[0])]; strcpy(argv_ext[0], argv[0]); for (int i = 0; i < ret; i++) { argv_ext[i + 1] = new char[sizeof(argv_alias[i])]; strcpy(argv_ext[i + 1], argv_alias[i]); delete[] argv_alias[i]; } delete[] argv_alias; for (int i = 2; i < argc; i++) { argv_ext[ret + i - 1] = new char[sizeof(argv[i])]; strcpy(argv_ext[ret + i - 1], argv[i]); } } else { throw InitializationException("Error parsing alias [" + *alias + "] : " + str_errors::get_error(ret)); } } return argc_ext; }
#include <Eigen/Dense> #include <iostream> using namespace Eigen; using namespace std; int main(int, char**) { cout.precision(3); Matrix<float,2,3> m = Matrix<float,2,3>::Random(); Matrix2f y = Matrix2f::Random(); cout << "Here is the matrix m:" << endl << m << endl; cout << "Here is the matrix y:" << endl << y << endl; Matrix<float,3,2> x = m.fullPivLu().solve(y); if((m*x).isApprox(y)) { cout << "Here is a solution x to the equation mx=y:" << endl << x << endl; } else cout << "The equation mx=y does not have any solution." << endl; return 0; }
; A216522: Integers of the form 2*x + 3*y with nonnegative x and y, with repetitions. ; Submitted by Jon Maiga ; 0,2,3,4,5,6,6,7,8,8,9,9,10,10,11,11,12,12,12,13,13,14,14,14,15,15,15,16,16,16,17,17,17,18,18,18,18,19,19,19,20,20,20,20,21,21,21,21,22,22,22,22,23,23,23,23,24,24,24,24,24,25,25,25,25,26,26,26,26,26,27,27,27,27,27,28,28,28,28,28,29,29,29,29,29,30,30,30,30,30,30,31,31,31,31,31,32,32,32,32 mul $0,4 add $0,2 mul $0,3 mov $1,3 lpb $0 sub $0,$1 add $1,2 lpe mov $0,$1 sub $0,5 div $0,2
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) GeoWorks 1990 -- All Rights Reserved PROJECT: PC GEOS MODULE: Printer Drivers FILE: printcomPCLText.asm AUTHOR: Dave Durran ROUTINES: REVISION HISTORY: Name Date Description ---- ---- ----------- Dave 5/92 Initial version from parsed routines DESCRIPTION: $Id: printcomPCLText.asm,v 1.1 97/04/18 11:50:08 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ include Text/textPrintStyleRunPCL.asm include Text/textPrintText.asm include Text/textPrintRaw.asm include Text/textSetFontPCL.asm include Text/textGetLineSpacing.asm include Text/textSetLineSpacing.asm include Text/textSetSymbolSet.asm include Text/textLoadNoISOSymbolSet.asm include Text/Font/fontPCLInfo.asm
#include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char *argv[]) { char *ptr; if(argc < 3) { printf("Usage: %s <env variable name> <target program name>\n", argv[0]); } else { ptr = getenv(argv[1]); /* get env var location */ int diff = (strlen(argv[0]) - strlen(argv[2]))*2; ptr += diff; /* adjust for program name */ printf("%s will be at %p with reference to %s\n", argv[1], ptr, argv[2]); } return 0; }
; A064099: a(n) = ceiling(log(3 + 2*n)/log(3)). ; 1,2,2,2,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6 mul $0,6 add $0,3 log $0,3 mov $1,$0
// Copyright (c) Microsoft Corporation. All rights reserved. // SPDX-License-Identifier: MIT #pragma once #include "azure/core/http/pipeline.hpp" #include "azure/core/response.hpp" #include "azure/storage/common/storage_credential.hpp" #include "azure/storage/files/shares/protocol/share_rest_client.hpp" #include "azure/storage/files/shares/share_client.hpp" #include "azure/storage/files/shares/share_directory_client.hpp" #include "azure/storage/files/shares/share_options.hpp" #include "azure/storage/files/shares/share_responses.hpp" #include <memory> #include <string> namespace Azure { namespace Storage { namespace Files { namespace Shares { class ShareFileClient { public: /** * @brief Create A ShareFileClient from connection string to manage a File Share File * resource. * @param connectionString Azure Storage connection string. * @param shareName The name of a file share. * @param filePath The path of a file. * @param options Optional parameters used to initialize the client. * @return ShareClient The client that can be used to manage a share resource. */ static ShareFileClient CreateFromConnectionString( const std::string& connectionString, const std::string& shareName, const std::string& filePath, const ShareClientOptions& options = ShareClientOptions()); /** * @brief Initialize a new instance of ShareFileClient using shared key authentication. * @param shareFileUri The URI of the file this client's request targets. * @param credential The shared key credential used to initialize the client. * @param options Optional parameters used to initialize the client. */ explicit ShareFileClient( const std::string& shareFileUri, std::shared_ptr<StorageSharedKeyCredential> credential, const ShareClientOptions& options = ShareClientOptions()); /** * @brief Initialize a new instance of ShareFileClient using anonymous access or shared access * signature. * @param shareFileUri The URI of the file this client's request targets. * @param options Optional parameters used to initialize the client. */ explicit ShareFileClient( const std::string& shareFileUri, const ShareClientOptions& options = ShareClientOptions()); /** * @brief Gets the file's primary uri endpoint. * * @return The file's primary uri endpoint. */ std::string GetUri() const { return m_shareFileUri.GetAbsoluteUrl(); } /** * @brief Initializes a new instance of the ShareFileClient class with an identical uri * source but the specified share snapshot timestamp. * * @param snapshot The snapshot identifier for the share snapshot. * @return A new ShareFileClient instance. * @remarks Pass empty string to remove the snapshot returning the file client without * specifying the share snapshot. */ ShareFileClient WithShareSnapshot(const std::string& shareSnapshot) const; /** * @brief Creates the file. * @param fileSize Size of the file in bytes. * @param options Optional parameters to create this file. * @return Azure::Core::Response<CreateFileResult> containing the information returned when * creating the file. */ Azure::Core::Response<Models::CreateFileResult> Create( int64_t fileSize, const CreateFileOptions& options = CreateFileOptions()) const; /** * @brief Deletes the file. * @param options Optional parameters to delete this file. * @return Azure::Core::Response<DeleteFileResult> containing the information returned when * deleting the file. */ Azure::Core::Response<Models::DeleteFileResult> Delete( const DeleteFileOptions& options = DeleteFileOptions()) const; /** * @brief Open a stream for the file's content, or a range of the file's content that can be * used to download the server end data. * @param options Optional parameters to get the content of this file. * @return Azure::Core::Response<Models::DownloadFileResult> containing the range or full * content and the information of the file. */ Azure::Core::Response<Models::DownloadFileResult> Download( const DownloadFileOptions& options = DownloadFileOptions()) const; /** * @brief Downloads a file or a file range from the service to a memory buffer using parallel * requests. * * @param buffer A memory buffer to write the file content to. * @param bufferSize Size of the memory buffer. Size must be larger or equal to size of the file * or file range. * @param options Optional parameters to execute this function. * @return Azure::Core::Response<Models::DownloadFileToResult> containing the information of the * downloaded file/file range. */ Azure::Core::Response<Models::DownloadFileToResult> DownloadTo( uint8_t* buffer, std::size_t bufferSize, const DownloadFileToOptions& options = DownloadFileToOptions()) const; /** * @brief Downloads a file or a file range from the service to a memory buffer using parallel * requests. * * @param fileName A file path to write the downloaded content to. * @param options Optional parameters to execute this function. * @return Azure::Core::Response<Models::DownloadFileToResult> containing the information of the * downloaded file/file range. */ Azure::Core::Response<Models::DownloadFileToResult> DownloadTo( const std::string& fileName, const DownloadFileToOptions& options = DownloadFileToOptions()) const; /** * @brief Creates a new file, or updates the content of an existing file. Updating * an existing file overwrites any existing metadata on the file. * * @param buffer A memory buffer containing the content to upload. * @param bufferSize Size of the memory buffer. * @param options Optional parameters to execute this function. * @return Azure::Core::Response<Models::UploadFileFromResult> describing the state of the * updated file. */ Azure::Core::Response<Models::UploadFileFromResult> UploadFrom( const uint8_t* buffer, std::size_t bufferSize, const UploadFileFromOptions& options = UploadFileFromOptions()) const; /** * @brief Creates a new file, or updates the content of an existing file. Updating * an existing file overwrites any existing metadata on the file. * * @param fileName A file containing the content to upload. * @param options Optional parameters to execute this function. * @return Azure::Core::Response<Models::UploadFileFromResult> describing the state of the * updated file. */ Azure::Core::Response<Models::UploadFileFromResult> UploadFrom( const std::string& fileName, const UploadFileFromOptions& options = UploadFileFromOptions()) const; /** * @brief Starts copy the file specified from source URI to the file this client points to. * @param copySource Specifies the URL of the source file or file, up to 2 KB in length. To copy * a file to another file within the same storage account, you may use Shared Key to * authenticate the source file. If you are copying a file from another storage account, or if * you are copying a file from the same storage account or another storage account, then you * must authenticate the source file or file using a shared access signature. If the source is a * public file, no authentication is required to perform the copy operation. A file in a share * snapshot can also be specified as a copy source. * @param options Optional parameters to copy the content of this file. * @return Azure::Core::Response<Models::StartCopyFileResult> containing the copy related * information. */ Azure::Core::Response<Models::StartCopyFileResult> StartCopy( std::string copySource, const StartCopyFileOptions& options = StartCopyFileOptions()) const; /** * @brief Aborts copying the file specified with the copy ID. * @param copyId The copy identifier provided in the StartCopyFileResult of the original * StartCopy operation. * @param options Optional parameters to abort copying the content of this file. * @return Azure::Core::Response<Models::AbortCopyFileResult> containing the abort copy related * information, current empty but preserved for future usage. */ Azure::Core::Response<Models::AbortCopyFileResult> AbortCopy( std::string copyId, const AbortCopyFileOptions& options = AbortCopyFileOptions()) const; /** * @brief Gets the properties of a file. * @param options Optional parameters to get the properties of this file. * @return Azure::Core::Response<Models::GetFilePropertiesResult> containing the file * properties. */ Azure::Core::Response<Models::GetFilePropertiesResult> GetProperties( const GetFilePropertiesOptions& options = GetFilePropertiesOptions()) const; /** * @brief Sets the properties of the file, or resize a file specifying NewSize in options. * @param httpHeaders The Http headers to be set to the file. * @param smbProperties The SMB properties to be set to the file. * @param options Optional parameters to set this file's properties. * @return Azure::Core::Response<Models::SetFilePropertiesResult> containing the properties of * the file returned from the server. */ Azure::Core::Response<Models::SetFilePropertiesResult> SetProperties( Models::FileShareHttpHeaders httpHeaders, Models::FileShareSmbProperties smbProperties, const SetFilePropertiesOptions& options = SetFilePropertiesOptions()) const; /** * @brief Sets the metadata of the file. * @param metadata User-defined metadata to be stored with the file. Note that the string * may only contain ASCII characters in the ISO-8859-1 character set. * @param options Optional parameters to set this file's metadata. * @return Azure::Core::Response<Models::SetFileMetadataResult> containing the information of * the file returned from the server. */ Azure::Core::Response<Models::SetFileMetadataResult> SetMetadata( Storage::Metadata metadata, const SetFileMetadataOptions& options = SetFileMetadataOptions()) const; /** * @brief Uploads some data to a range of the file. * @param offset Specifies the starting offset for the content to be written as a range. * @param content A BodyStream containing the content of the range to upload. * @return Azure::Core::Response<Models::UploadFileRange> containing the information of the * uploaded range and the file returned from the server. */ Azure::Core::Response<Models::UploadFileRangeResult> UploadRange( int64_t offset, Azure::Core::Http::BodyStream* content, const UploadFileRangeOptions& options = UploadFileRangeOptions()) const; /** * @brief Clears some range of data within the file. * @param offset Specifies the starting offset for the content to be cleared within the file. * @param length Specifies the length for the content to be cleared within the file. * @return Azure::Core::Response<Models::ClearFileRangeResult> containing the information of the * cleared range returned from the server. */ Azure::Core::Response<Models::ClearFileRangeResult> ClearRange( int64_t offset, int64_t length, const ClearFileRangeOptions& options = ClearFileRangeOptions()) const; /** * @brief Gets the list of valid range from the file within specified range. * @return Azure::Core::Response<Models::GetFileRangeListResult> containing the valid ranges * within the file for the specified range. */ Azure::Core::Response<Models::GetFileRangeListResult> GetRangeList( const GetFileRangeListOptions& options = GetFileRangeListOptions()) const; /** * @brief List open handles on the file. * @param options Optional parameters to list this file's open handles. * @return Azure::Core::Response<Models::ListFileHandlesSegmentResult> containing the * information of the operation and the open handles of this file */ Azure::Core::Response<Models::ListFileHandlesSegmentResult> ListHandlesSegment( const ListFileHandlesSegmentOptions& options = ListFileHandlesSegmentOptions()) const; /** * @brief Closes a handle opened on a file at the service. * @param handleId The ID of the handle to be closed. * @param options Optional parameters to close one of this file's open handles. * @return Azure::Core::Response<Models::ForceCloseFileHandleResult> containing the information * of the closed handle. Current empty but preserved for future usage. */ Azure::Core::Response<Models::ForceCloseFileHandleResult> ForceCloseHandle( const std::string& handleId, const ForceCloseFileHandleOptions& options = ForceCloseFileHandleOptions()) const; /** * @brief Closes all handles opened on a file at the service. * @param options Optional parameters to close all this file's open handles. * @return Azure::Core::Response<Models::ForceCloseAllFileHandlesResult> containing the * information of the closed handles * @remark This operation may return a marker showing that the operation can be continued. */ Azure::Core::Response<Models::ForceCloseAllFileHandlesResult> ForceCloseAllHandles( const ForceCloseAllFileHandlesOptions& options = ForceCloseAllFileHandlesOptions()) const; /** * @brief Acquires an infinite lease on the file. * * @param proposedLeaseId Proposed lease ID, in a GUID string format. * @param options Optional parameters to execute this function. * @return Azure::Core::Response<Models::AcquireFileLeaseResult> describing the lease. */ Azure::Core::Response<Models::AcquireFileLeaseResult> AcquireLease( const std::string& proposedLeaseId, const AcquireFileLeaseOptions& options = AcquireFileLeaseOptions()) const; /** * @brief Releases the file's previously-acquired lease. * * @param leaseId ID of the previously-acquired lease. * @param options Optional parameters to execute this function. * @return Azure::Core::Response<Models::ReleaseFileLeaseResult> describing the updated * container. */ Azure::Core::Response<Models::ReleaseFileLeaseResult> ReleaseLease( const std::string& leaseId, const ReleaseFileLeaseOptions& options = ReleaseFileLeaseOptions()) const; /** * @brief Changes the lease of an active lease. * * @param leaseId ID of the previously-acquired lease. * @param proposedLeaseId Proposed lease ID, in a GUID string format. * @param options Optional parameters to execute this function. * @return Azure::Core::Response<Models::ChangeFileLeaseResult> describing the changed lease. */ Azure::Core::Response<Models::ChangeFileLeaseResult> ChangeLease( const std::string& leaseId, const std::string& proposedLeaseId, const ChangeFileLeaseOptions& options = ChangeFileLeaseOptions()) const; /** * @brief Breaks the previously-acquired lease. * * @param options Optional parameters to execute this function. * @return Azure::Core::Response<Models::BreakFileLeaseResult> describing the broken lease. */ Azure::Core::Response<Models::BreakFileLeaseResult> BreakLease( const BreakFileLeaseOptions& options = BreakFileLeaseOptions()) const; private: Azure::Core::Http::Url m_shareFileUri; std::shared_ptr<Azure::Core::Http::HttpPipeline> m_pipeline; explicit ShareFileClient( Azure::Core::Http::Url shareFileUri, std::shared_ptr<Azure::Core::Http::HttpPipeline> pipeline) : m_shareFileUri(std::move(shareFileUri)), m_pipeline(std::move(pipeline)) { } friend class ShareClient; friend class ShareDirectoryClient; }; }}}} // namespace Azure::Storage::Files::Shares
<% from pwnlib.shellcraft.mips.linux import syscall %> <%page args="path, argv, envp"/> <%docstring> Invokes the syscall execve. See 'man 2 execve' for more information. Arguments: path(char): path argv(char): argv envp(char): envp </%docstring> ${syscall('SYS_execve', path, argv, envp)}
.global s_prepare_buffers s_prepare_buffers: push %r12 push %r13 push %r14 push %r8 push %rax push %rcx push %rdi push %rsi lea addresses_WT_ht+0x1586d, %r13 clflush (%r13) nop and %rax, %rax movl $0x61626364, (%r13) nop nop nop cmp %rcx, %rcx lea addresses_D_ht+0xcfad, %r14 clflush (%r14) nop nop nop nop add $1846, %r8 movups (%r14), %xmm4 vpextrq $0, %xmm4, %rsi nop nop nop nop xor $62784, %r13 lea addresses_A_ht+0x13bad, %rcx nop cmp $46265, %r12 movb (%rcx), %al nop add %rcx, %rcx lea addresses_WT_ht+0x8aed, %r12 clflush (%r12) nop nop sub %rax, %rax vmovups (%r12), %ymm0 vextracti128 $0, %ymm0, %xmm0 vpextrq $0, %xmm0, %r8 sub %r13, %r13 lea addresses_normal_ht+0xabad, %rsi lea addresses_normal_ht+0x211d, %rdi clflush (%rdi) nop nop nop cmp %r12, %r12 mov $26, %rcx rep movsb nop nop nop nop add %r14, %r14 lea addresses_UC_ht+0x1deb5, %rsi lea addresses_WT_ht+0x3ad, %rdi nop nop nop cmp $53163, %rax mov $43, %rcx rep movsq nop nop nop nop add $26976, %rsi lea addresses_A_ht+0x2fcd, %rsi lea addresses_normal_ht+0x121ad, %rdi clflush (%rdi) nop nop nop nop nop add %rax, %rax mov $95, %rcx rep movsq cmp $57706, %r12 lea addresses_WC_ht+0x3ad, %r13 nop nop nop nop cmp $2264, %r14 vmovups (%r13), %ymm0 vextracti128 $1, %ymm0, %xmm0 vpextrq $0, %xmm0, %rcx nop nop nop nop and %rsi, %rsi lea addresses_A_ht+0x113f5, %r8 nop nop nop nop cmp %rax, %rax mov $0x6162636465666768, %r13 movq %r13, (%r8) nop nop nop cmp %r8, %r8 lea addresses_normal_ht+0x1d9ad, %rsi lea addresses_normal_ht+0x73ad, %rdi nop nop cmp %r12, %r12 mov $13, %rcx rep movsq nop nop nop cmp $8594, %rax lea addresses_normal_ht+0x3bed, %rsi lea addresses_D_ht+0x15733, %rdi nop xor %r14, %r14 mov $62, %rcx rep movsq nop nop nop nop xor $43771, %rax lea addresses_D_ht+0x62bd, %rsi lea addresses_UC_ht+0x1412d, %rdi nop nop nop sub $12179, %r14 mov $16, %rcx rep movsl nop nop nop nop cmp %r14, %r14 lea addresses_WT_ht+0x143ad, %r13 nop nop nop nop xor $6402, %rax movb $0x61, (%r13) nop nop nop dec %r14 lea addresses_WC_ht+0xcfad, %r14 nop nop add $6476, %r12 mov (%r14), %si nop nop lfence lea addresses_D_ht+0x71ad, %rsi nop nop nop xor $43617, %r8 mov $0x6162636465666768, %r13 movq %r13, %xmm4 movups %xmm4, (%rsi) nop nop nop nop nop cmp $46270, %r8 pop %rsi pop %rdi pop %rcx pop %rax pop %r8 pop %r14 pop %r13 pop %r12 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r15 push %r9 push %rax push %rbx push %rdx // Store mov $0xaad, %r9 nop nop nop nop nop sub $61522, %rbx movl $0x51525354, (%r9) // Exception!!! nop nop nop nop mov (0), %rdx nop nop nop sub %r9, %r9 // Load lea addresses_PSE+0x12e2d, %r15 clflush (%r15) nop nop nop xor $14138, %r11 movb (%r15), %bl nop nop nop nop nop and %r9, %r9 // Store lea addresses_US+0x143ad, %rbx nop nop nop xor $9002, %rax movw $0x5152, (%rbx) nop nop nop add $55420, %r9 // Store lea addresses_WC+0x73d, %r12 nop nop and %rax, %rax movb $0x51, (%r12) nop nop nop add %rbx, %rbx // Store lea addresses_D+0x18fad, %r15 nop nop nop nop xor %r9, %r9 movl $0x51525354, (%r15) nop sub $27914, %r15 // Store mov $0x25c1e00000000e2d, %rbx nop nop dec %r11 mov $0x5152535455565758, %r12 movq %r12, %xmm0 vmovups %ymm0, (%rbx) nop nop nop sub %rax, %rax // Store lea addresses_WT+0x1db85, %r9 nop nop and %rbx, %rbx mov $0x5152535455565758, %rax movq %rax, %xmm5 vmovups %ymm5, (%r9) nop nop nop nop nop dec %rbx // Faulty Load lea addresses_US+0x143ad, %r11 nop nop nop xor $52539, %rbx mov (%r11), %r9d lea oracles, %rdx and $0xff, %r9 shlq $12, %r9 mov (%rdx,%r9,1), %r9 pop %rdx pop %rbx pop %rax pop %r9 pop %r15 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_US', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_P', 'NT': False, 'AVXalign': True, 'size': 4, 'congruent': 6}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 7}} {'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_US', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 3}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D', 'NT': True, 'AVXalign': False, 'size': 4, 'congruent': 10}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_NC', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 6}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_US', 'NT': False, 'AVXalign': True, 'size': 4, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 4}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 10}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 8}} {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 4}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_normal_ht'}, 'dst': {'same': True, 'congruent': 1, 'type': 'addresses_normal_ht'}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_UC_ht'}, 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_WT_ht'}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 5, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 6, 'type': 'addresses_normal_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 11}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 3}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 9, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_normal_ht'}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 5, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 0, 'type': 'addresses_D_ht'}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 4, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 2, 'type': 'addresses_UC_ht'}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 11}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 10}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 9}} {'52': 21829} 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 */
; ; Startup for CP/M ; ; Stefano Bodrato - Apr. 2000 ; Apr. 2001: Added MS-DOS protection ; ; Dominic Morris - Jan. 2001: Added argc/argv support ; - Jan. 2001: Added in malloc routines ; - Jan. 2001: File support added ; ; $Id: cpm_crt0.asm,v 1.23 2015/01/21 07:05:00 stefano Exp $ ; ; There are a couple of #pragma commands which affect ; this file: ; ; #pragma output nostreams - No stdio disc files ; #pragma output nofileio - No fileio at all ; #pragma output noprotectmsdos - strip the MS-DOS protection header ; #pragma output noredir - do not insert the file redirection option while parsing the ; command line arguments (useless if "nostreams" is set) ; ; These can cut down the size of the resultant executable MODULE cpm_crt0 ;------------------------------------------------- ; Include zcc_opt.def to find out some information ;------------------------------------------------- INCLUDE "zcc_opt.def" ;----------------------- ; Some scope definitions ;----------------------- EXTERN _main ;main() is always external to crt0 PUBLIC cleanup ;jp'd to by exit() PUBLIC l_dcal ;jp(hl) PUBLIC _vfprintf ;jp to printf core routine PUBLIC exitsp ;atexit() variables PUBLIC exitcount PUBLIC heaplast ;Near malloc heap variables PUBLIC heapblocks ; PUBLIC __sgoioblk ;std* control block PUBLIC __fcb ;file control block ;----------------------- ; Target specific labels ;----------------------- PUBLIC _vdcDispMem ; pointer to disp. memory for C128 PUBLIC snd_tick ; for sound code, if any PUBLIC bit_irqstatus ; current irq status when DI is necessary PUBLIC RG0SAV ; keeping track of VDP register values (Einstein) PUBLIC pixelbyte ; VDP gfx driver, byte temp storage PUBLIC coords org $100 ;---------------------- ; Execution starts here ;---------------------- start: IF !DEFINED_noprotectmsdos defb $eb,$04 ;DOS protection... JMPS LABE ex de,hl jp begin defb $b4,$09 ;DOS protection... MOV AH,9 defb $ba defw dosmessage ;DOS protection... MOV DX,OFFSET dosmessage defb $cd,$21 ;DOS protection... INT 21h. defb $cd,$20 ;DOS protection... INT 20h. dosmessage: defm "This program is for a CP/M system." defb 13,10,'$' begin: ENDIF ld (start1+1),sp ;Save entry stack ld a,($80) ;byte count of length of args inc a ;we can use this since args are space separated neg ld l,a ld h,-1 ;negative number ld de,-64 ;Add on space for atexit() stack add hl,de add hl,sp ld sp,hl ld (exitsp),sp ; Optional definition for auto MALLOC init ; it assumes we have free space between the end of ; the compiled program and the stack pointer IF DEFINED_USING_amalloc INCLUDE "amalloc.def" ENDIF IF !DEFINED_nostreams IF DEFINED_ANSIstdio ; Set up the std* stuff so we can be called again ld hl,__sgoioblk+2 ld (hl),19 ;stdin ld hl,__sgoioblk+6 ld (hl),21 ;stdout ld hl,__sgoioblk+10 ld (hl),21 ;stderr ENDIF ENDIF ld c,25 ;Set the default disc call 5 ld (defltdsk),a ; Push pointers to argv[n] onto the stack now ; We must start from the end ld hl,0 ;NULL pointer at end, just in case push hl ld hl,$80 ld a,(hl) ld b,0 and a jr z,argv_done ld c,a add hl,bc ;now points to the end ; Try to find the end of the arguments argv_loop_1: ld a,(hl) cp ' ' jr nz,argv_loop_2 ld (hl),0 dec hl dec c jr nz,argv_loop_1 ; We've located the end of the last argument, try to find the start argv_loop_2: ld a,(hl) cp ' ' jr nz,argv_loop_3 ;ld (hl),0 inc hl IF !DEFINED_noredir IF !DEFINED_nostreams IF DEFINED_ANSIstdio EXTERN freopen xor a add b jr nz,no_redir_stdout ld a,(hl) cp '>' jr nz,no_redir_stdout push hl inc hl cp (hl) dec hl ld de,redir_fopen_flag ; "a" or "w" jr nz,noappendb ld a,'a' ld (de),a inc hl noappendb: inc hl push bc push hl ; file name ptr push de ld de,__sgoioblk+4 ; file struct for stdout push de call freopen pop de pop de pop hl pop bc pop hl dec hl jr argv_zloop no_redir_stdout: ld a,(hl) cp '<' jr nz,no_redir_stdin push hl inc hl ld de,redir_fopen_flagr push bc push hl ; file name ptr push de ld de,__sgoioblk ; file struct for stdin push de call freopen pop de pop de pop hl pop bc pop hl dec hl jr argv_zloop no_redir_stdin: ENDIF ENDIF ENDIF push hl inc b dec hl ; skip extra blanks argv_zloop: ld (hl),0 dec c jr z,argv_done dec hl ld a,(hl) cp ' ' jr z,argv_zloop inc c inc hl argv_loop_3: dec hl dec c jr nz,argv_loop_2 argv_done: ld hl,end ;name of program (NULL) push hl inc b ld hl,0 add hl,sp ;address of argv ld c,b ld b,0 push bc ;argc push hl ;argv call _main ;Call user code pop bc ;kill argv pop bc ;kill argc ld a,(defltdsk) ;Restore default disc ld e,a ld c,14 call 5 cleanup: push hl ;Save return value IF !DEFINED_nostreams IF DEFINED_ANSIstdio EXTERN closeall ;Close any opened files call closeall ENDIF ENDIF pop bc ;Get exit() value into bc start1: ld sp,0 ;Pick up entry sp jp 0 l_dcal: jp (hl) ;Used for call by function ptr ;------------------------ ; The stdio control block ;------------------------ __sgoioblk: IF DEFINED_ANSIstdio INCLUDE "stdio_fp.asm" ELSE defw -11,-12,-10 ;Dummy values (unused by CPM port?) ENDIF ;---------------------------------------- ; Work out which vfprintf routine we need ;---------------------------------------- _vfprintf: IF DEFINED_floatstdio EXTERN vfprintf_fp jp vfprintf_fp ELSE IF DEFINED_complexstdio EXTERN vfprintf_comp jp vfprintf_comp ELSE IF DEFINED_ministdio EXTERN vfprintf_mini jp vfprintf_mini ENDIF ENDIF ENDIF ;----------------------- ; Some startup variables ;----------------------- defltdsk: defb 0 ;Default disc exitsp: defw 0 ;Address of atexit() stack exitcount: defb 0 ;Number of atexit() routinens heaplast: defw 0 ;Pointer to last free heap block heapblocks: defw 0 ;Number of heap blocks available IF DEFINED_USING_amalloc EXTERN ASMTAIL PUBLIC _heap ; The heap pointer will be wiped at startup, ; but first its value (based on ASMTAIL) ; will be kept for sbrk() to setup the malloc area _heap: defw ASMTAIL ; Location of the last program byte defw 0 ENDIF IF !DEFINED_nofileio __fcb: defs 420,0 ;file control block (10 files) (MAXFILE) ENDIF IF !DEFINED_HAVESEED PUBLIC _std_seed ;Integer rand() seed _std_seed: defw 0 ; Seed for integer rand() routines ENDIF IF DEFINED_NEED1bitsound snd_tick: defb 0 ; Sound variable bit_irqstatus: defw 0 ENDIF ;----------------------------------------------------- ; Unneccessary file signature + target specific stuff ;----------------------------------------------------- _vdcDispMem: ; Label used by "c128cpm.lib" only base_graphics: ; various gfx drivers defm "Small C+ CP/M" end: defb 0 ; null file name RG0SAV: defb 0 ; VDP graphics driver (Einstein) pixelbyte: defb 0 ; temp byte storage for VDP driver coords: defw 0 ; Current graphics xy coordinates ;---------------------------------------------- ; Floating point support routines and variables ;---------------------------------------------- IF NEED_floatpack INCLUDE "float.asm" fp_seed: defb $80,$80,0,0,0,0 ; FP seed (unused ATM) extra: defs 6 ; FP spare register fa: defs 6 ; FP accumulator fasign: defb 0 ; FP variable ENDIF IF !DEFINED_noredir IF !DEFINED_nostreams IF DEFINED_ANSIstdio redir_fopen_flag: defb 'w' defb 0 redir_fopen_flagr: defb 'r' defb 0 ENDIF ENDIF ENDIF
#pragma once #include <map> #include <memory> #include <optional> #include <string> #include <gsl/gsl> #include <nlohmann/json.hpp> #include "characters/character_manager.hpp" #include "communication/iclient.hpp" namespace d20tempest::character { class Character; class CharacterManager { private: static std::map<uint64_t, std::shared_ptr<Character>> ms_characters; static constexpr const char ms_charactersPath[] = "./characters/"; public: std::shared_ptr<Character> CreateCharacter(std::string name, std::optional<gsl::not_null<communication::IClient*>> client); std::shared_ptr<Character> LoadCharacter(std::string name, std::optional<gsl::not_null<communication::IClient*>> client); void Dump(); void Dump(uint64_t id); nlohmann::json DumpAll(); nlohmann::json ListExistingCharacters(); uint64_t CreateCharacterID(); std::optional<std::shared_ptr<Character>> operator[](uint64_t id); }; }
; ICS 331 ; Tetris ; Alex Watanabe ; Using DLX architecture ; Contains anything to do with input computation ; so I don't have to scroll through many things while working ; Function that will read inputs ; x-input returned as R2. 1 = l, 2 = n, 3 = r ; y-input returned as R3. 1 = rotL, 2 = n, 3 = rotR readIn: addi R4 R0 0x2000 lw R2 R4 0x0 lw R3 R4 0x1 jr R31 ; Function that calculates position/orientation from inputs ; Arguments Taken- ; R4 | The piece we're rotating (0x_0) ; R5 | ; R6 | : R7 | ; Arguments Passed- ; rotate | ; R4 | Sublocation pointer to rotation (0xE) ; R5 | Address of the piece rotation block (0x1300) ; R6 | The direction to shift (normally from y input) ; R7 | The piece we're rotating (0x_0) ; ; pshift | ; R4 | Sublocation pointer to current shift (0xC) ; R5 | Address of the piece rotation block (0x1300) ; R6 | The direction to shift (normally from x input) : R7 | The sublocation pointer for the piece set (the 0x_0 in R5) ; ; Temporaries- ; R8 | Returned pointer to lower row rotation ; R9 | Returned pointer to upper row rotation ; R10 | ; R11 | ; R12 | ; R13 | ; R14 | ; R15 | ; ; R16 | Saved x input ; R17 | Saved y input ; R18 | Saved current piece ; R19 | ; R20 | ; R21 | ; R22 | ; R23 | ; ; R24 | Logical temporary ; R25 | Logical temporary 2 ; Returns- ; R2 | Currentpiece lower row for 0x1202 ; R3 | Currentpiece upper row for 0x1203 ; ; Function start, get inputs getInput: sw R31 R29 0x0 jali readIn lw R31 R29 0x0 ; Set saved variables addi R16 R2 0x0 addi R17 R3 0x0 addi R18 R4 0x0 ; We check shift before rotate ; set shift arguments addi R4 R0 0xC addi R5 R0 0x1300 addi R6 R16 0x0 addi R7 R18 0x0 ; Save saved variables before function call sw R31 R29 0x0 addi R29 R29 -1 jali savesv addi R31 R2 0x0 ; Call Function jali pshift ; Load saved variables sw R31 R29 0x0 addi R29 R29 -1 jali loadsv addi R31 R2 0x0 ; set rotation arguments addi R4 R0 0xE addi R5 R0 0x1300 addi R6 R17 0x0 addi R7 R18 0x0 ; Save saved variables before function call sw R31 R29 0x0 addi R29 R29 -1 jali savesv addi R31 R2 0x0 ; Call Function jali rotate ; Handle return addi R8 R2 0x0 addi R9 R2 0x0 ; Load saved variables sw R31 R29 0x0 addi R29 R29 -1 jali loadsv addi R31 R2 0x0 ; Get return values lw R2 R8 0x0 lw R3 R9 0x0 jr R31 ;
;===================================================================== ; File Name : cstartup.asm ; Description : Startup routine for csu8rp3216 ; This file contains the CSCC startup routine ; and must usually be tailored to suit customer's hardware ; Body Name : csu8rp3216 ; Toolchain : cscc V1.0.x ; Date : 09/10/2016 ;===================================================================== ;===================================================================== ; Register define eare ;===================================================================== ind0 .equ 0x0 fsr0 .equ 0x2 status .equ 0x4 ;bsr .equ 0x8 eadrh .equ 0xA eadrl .equ 0xB edat .equ 0xC ;====================================================================== ; macro define : init bank0~1 all sram to zero ;====================================================================== init_bank01_sram_to_zero .macro bankx_start_addr, bankx_sram_sizes, temp_label movlw bankx_sram_sizes-1 ; bankx sram sizes(less than 0x100) movwf RSP ; temp var(stack var) movlw bankx_start_addr ; bankx sram start address movwf fsr0 movlw 0x00 temp_label: movwf ind0 incf fsr0,1 decfsz RSP, 1 goto temp_label .endm ;===================================================================== ; Basic Settings for User ;===================================================================== LOOP_AT_END .equ 1 ; Endless waiting after main() CPU_HALT .equ 0 ; Exception of invalid instruction BANK0_SRAM_START_ADDR .equ 0x80 ; Bank0 sram start address BANK0_SRAM_SIZES .equ 0x80 ; Bank0 sram sizes RSP .equ 0xFF ; Pseudo stack point top(only at bank0) ;===================================================================== ; GLOBAL area ;===================================================================== .global ind0 .global fsr0 .global status ;.global bsr .global eadrh .global eadrl .global edat ;===================================================================== ; EXTERN area ;===================================================================== .extern _main ; where to begin execution .extern CSCC_BANK0_INIT_TAB_START ; address of bank0 init table .extern CSCC_BANK0_INIT_TAB_SIZE ; size of bank0 init table(word as a unit) .extern CSCC_INTERRUPT_FUNCTION_ADDR ; interrupt function address ;===================================================================== ; Starting setup/reset code ; CSCC_INIT_CODE - where the execution actually begins ;===================================================================== CSCC_INIT_CODE .section rom,addr=0x00 V_RESET: goto __init_sram_to_zero .ends ;===================================================================== ; Interrupt vector section ;===================================================================== CSCC_INTERRUPT_VECTOR .section rom,addr=0x04 goto CSCC_INTERRUPT_FUNCTION_ADDR .ends ;====================================================================== ; Init all sram to zero ;====================================================================== CSCC_INIT_SRAM_TO_ZERO .section rom __init_sram_to_zero: ;init bank0 sram init_bank01_sram_to_zero BANK0_SRAM_START_ADDR, BANK0_SRAM_SIZES, temp_bank0_init_label ;goto init global var goto __init_global_var .ends ;====================================================================== ; Init all global variables ;====================================================================== CSCC_INIT_GLOBAL_VAR .section rom __init_global_var: ;set page0 valid ;bcf bsr,0 ;init bank0 global var movlw .low(CSCC_BANK0_INIT_TAB_START) ;获取初始化表的低8位地址 movwf eadrl ;给低字节地址赋值 movlw .high(CSCC_BANK0_INIT_TAB_START) ;获取初始化表的高8位地址 movwf eadrh ;给高字节地址赋值 movlw CSCC_BANK0_INIT_TAB_SIZE movwf RSP ;保存bank0初始化表的大小(word为单位) sublw 0 ;判断初始化表的大小是否大于0 btfsc status,0 ;Z标志等于0代表结果为非0 goto __sp_init bank0_init_var: ;bcf bsr,7 ;IRP0=0,间接寻址IND0时,访问bank0地址 movp ;low to w(value), high to edath(address) movfw edat ;edath store var address movwf fsr0 ;var address to fsr0 movp movwf ind0 ;init var incf eadrl,1 ;address++ (low++) movlw 0 ;set w to 0 addwfc eadrh,1 ;address high decfsz RSP,1 ;--size goto bank0_init_var __sp_init: ;sp reg init goto __program_startup .ends ;===================================================================== ; Now when we are init all global variables, then goto main function ;===================================================================== .text __program_startup: goto _main ; execute main() __program_end: ;.if LOOP_AT_END ; goto $ ; 1. Endless Loop ;.endif ;.if CPU_HALT ; halt ; 2. CPU Stop ;.endif .ends
;;; $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ;;; ;;; ASM Source code for Red GBC, by Evan Bowman, 2021 ;;; ;;; ;;; The following licence covers the source code included in this file. The ;;; game's characters and artwork belong to Evan Bowman, and should not be used ;;; without permission. ;;; ;;; ;;; 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. ;;; ;;; 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 HOLDER 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. ;;; ;;; $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ;;; $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ;;; ;;; ;;; Inventory Scene ;;; ;;; ;;; $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ InventorySceneEnter: xor a ld [var_scene_counter], a ld de, DrawonlyUpdateFn fcall SceneSetUpdateFn ld de, InventorySceneFadeinVBlank fcall SceneSetVBlankFn ret ;;; ---------------------------------------------------------------------------- InventorySceneExit: ld a, 255 ld [var_scene_counter], a fcall VBlankIntrWait fcall BlackScreenExcludeOverlay fcall VBlankIntrWait ld a, 136 ld [rWY], a ldh [hvar_overlay_y_offset], a xor a ld [var_overlay_alternate_pos], a fcall ShowOverlay fcall OverlayRepaintRow2 fcall DrawEntitiesSimple ld de, InventorySceneFadeOutVBlank fcall SceneSetVBlankFn ld de, DrawonlyUpdateFn fcall SceneSetUpdateFn ret ;;; ---------------------------------------------------------------------------- InventorySceneUpdate: ldh a, [hvar_joypad_current] and PADF_START | PADF_B jr Z, .idle fcall InventorySceneExit ret .idle: LONG_CALL r8_InventoryUpdate ret ;;; ---------------------------------------------------------------------------- InventorySceneDiscardUpdate: LONG_CALL r8_InventorySceneDiscardUpdate ret ;;; ---------------------------------------------------------------------------- InventorySceneConsumeUpdate: LONG_CALL r8_InventorySceneConsumeUpdate ret ;;; ---------------------------------------------------------------------------- InventorySceneCraftOptionUpdate: LONG_CALL r8_InventorySceneCraftOptionUpdate ret ;;; ---------------------------------------------------------------------------- InventorySceneEquipUpdate: LONG_CALL r8_InventorySceneEquipUpdate ret ;;; ---------------------------------------------------------------------------- InventorySceneUseFirewoodUpdate: LONG_CALL r8_InventorySceneUseFirewoodUpdate ret ;;; ---------------------------------------------------------------------------- InventorySceneFadeinVBlank: ld a, HIGH(var_oam_back_buffer) fcall hOAMDMA SET_BANK 7 ldh a, [hvar_overlay_y_offset] ld b, 136 cp b jr C, .inc jr .skip .inc: inc a ldh [hvar_overlay_y_offset], a .skip: ldh a, [hvar_overlay_y_offset] ld [rWY], a ld a, [var_scene_counter] ld c, a add 18 jr C, .transition jr .continue .transition: ld de, VoidVBlankFn fcall SceneSetVBlankFn ld de, InventorySceneUpdate fcall SceneSetUpdateFn ld c, 255 fcall BlackScreenExcludeOverlay LONG_CALL r8_InventoryOpen ret .continue: ld [var_scene_counter], a fcall FadeToBlackExcludeOverlay ret ;;; ---------------------------------------------------------------------------- InventorySceneFadeOutVBlank: ld a, HIGH(var_oam_back_buffer) fcall hOAMDMA SET_BANK 7 ld a, [var_scene_counter] ld c, a sub 24 jr C, .transition jr .continue .transition: fcall FadeNone ld de, OverworldSceneUpdate fcall SceneSetUpdateFn ld de, OverworldSceneOnVBlank fcall SceneSetVBlankFn ret .continue: ld [var_scene_counter], a fcall FadeToBlackExcludeOverlay ret
; ; Copyright (C) 2009-2015 Intel Corporation. ; SPDX-License-Identifier: MIT ; PUBLIC SetAppFlags_asm PUBLIC ClearAcFlag_asm PUBLIC GetFlags_asm .686 .model flat, c .code SetAppFlags_asm PROC push ebp mov ebp, esp mov eax, DWORD PTR [ebp+8h] pushfd pop ecx or ecx, eax mov edx, eax push ecx popfd leave ret SetAppFlags_asm ENDP ClearAcFlag_asm PROC pushfd pop ecx and ecx, 0fffbffffH push ecx popfd ret ClearAcFlag_asm ENDP GetFlags_asm PROC pushfd pop eax ret GetFlags_asm ENDP end
;=============================================================================== ; Copyright 2015-2021 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. ; Big Number Operations ; ; Content: ; cpMontMul1024_avx2() ; %include "asmdefs.inc" %include "ia_32e.inc" ;include pcpbnumulschool.inc ;include pcpvariant.inc %if (_IPP32E >= _IPP32E_L9) segment .text align=IPP_ALIGN_FACTOR %assign DIGIT_BITS 27 %assign DIGIT_MASK (1 << DIGIT_BITS) -1 ;************************************************************* ;* void cpMontMul1024_avx2(Ipp64u* pR, ;* const Ipp64u* pA, ;* const Ipp64u* pB, ;* const Ipp64u* pModulo, int mSize, ;* Ipp64u m0) ;************************************************************* align IPP_ALIGN_FACTOR IPPASM cpMontMul1024_avx2,PUBLIC %assign LOCAL_FRAME sizeof(ymmword) USES_GPR rsi,rdi,rbx,rbp,r12,r13,r14 USES_XMM_AVX ymm6,ymm7,ymm8,ymm9,ymm10,ymm11,ymm12,ymm13,ymm14 COMP_ABI 6 mov rbp,rdx ; pointer to B operand movsxd r8, r8d ; redLen value counter ;; clear results and buffers vzeroall ;; expands A and M operands vmovdqu ymmword [rsi+r8*sizeof(qword)], ymm0 vmovdqu ymmword [rcx+r8*sizeof(qword)], ymm0 xor r10, r10 ; ac0 = 0 vmovdqu ymmword [rsp], ymm0 ; {r3:r2:r1;R0} = 0 align IPP_ALIGN_FACTOR ;; ;; process b[] by quadruples (b[j], b[j+1], b[j+2] and b[j+3]) per pass ;; .loop4_B: mov rbx, qword [rbp] ; rbx = b[j] vpbroadcastq ymm0, qword [rbp] mov r10, rbx ; ac0 = pa[0]*b[j]+pr[0] imul r10, qword [rsi] add r10, qword [rsp] mov rdx, r10 ; y0 = (ac0*m0) & DIGIT_MASK imul edx, r9d and edx, DIGIT_MASK mov r11, rbx ; ac1 = pa[1]*b[j]+pr[1] imul r11, qword [rsi+sizeof(qword)] add r11, qword [rsp+sizeof(qword)] mov r12, rbx ; ac2 = pa[2]*b[j]+pr[2] imul r12, qword [rsi+sizeof(qword)*2] add r12, qword [rsp+sizeof(qword)*2] mov r13, rbx ; ac3 = pa[3]*b[j]+pr[3] imul r13, qword [rsi+sizeof(qword)*3] add r13, qword [rsp+sizeof(qword)*3] vmovd xmm11, edx vpbroadcastq ymm11, xmm11 vpmuludq ymm12, ymm0, ymmword [rsi+sizeof(ymmword)] vpaddq ymm1, ymm1, ymm12 vpmuludq ymm13, ymm0, ymmword [rsi+sizeof(ymmword)*2] vpaddq ymm2, ymm2, ymm13 vpmuludq ymm14, ymm0, ymmword [rsi+sizeof(ymmword)*3] vpaddq ymm3, ymm3, ymm14 vpmuludq ymm12, ymm0, ymmword [rsi+sizeof(ymmword)*4] vpaddq ymm4, ymm4, ymm12 vpmuludq ymm13, ymm0, ymmword [rsi+sizeof(ymmword)*5] vpaddq ymm5, ymm5, ymm13 vpmuludq ymm14, ymm0, ymmword [rsi+sizeof(ymmword)*6] vpaddq ymm6, ymm6, ymm14 vpmuludq ymm12, ymm0, ymmword [rsi+sizeof(ymmword)*7] vpaddq ymm7, ymm7, ymm12 vpmuludq ymm13, ymm0, ymmword [rsi+sizeof(ymmword)*8] vpaddq ymm8, ymm8, ymm13 vpmuludq ymm14, ymm0, ymmword [rsi+sizeof(ymmword)*9] vpaddq ymm9, ymm9, ymm14 mov rax, rdx ; ac0 += pn[0]*y0 imul rax, qword [rcx] add r10, rax shr r10, DIGIT_BITS mov rax, rdx ; ac1 += pn[1]*y0 imul rax, qword [rcx+sizeof(qword)] add r11, rax add r11, r10 mov rax, rdx ; ac2 += pn[2]*y0 imul rax, qword [rcx+sizeof(qword)*2] add r12, rax mov rax, rdx ; ac3 += pn[3]*y0 imul rax, qword [rcx+sizeof(qword)*3] add r13, rax vpmuludq ymm12, ymm11, ymmword [rcx+sizeof(ymmword)] vpaddq ymm1, ymm1, ymm12 vpmuludq ymm13, ymm11, ymmword [rcx+sizeof(ymmword)*2] vpaddq ymm2, ymm2, ymm13 vpmuludq ymm14, ymm11, ymmword [rcx+sizeof(ymmword)*3] vpaddq ymm3, ymm3, ymm14 vpmuludq ymm12, ymm11, ymmword [rcx+sizeof(ymmword)*4] vpaddq ymm4, ymm4, ymm12 vpmuludq ymm13, ymm11, ymmword [rcx+sizeof(ymmword)*5] vpaddq ymm5, ymm5, ymm13 vpmuludq ymm14, ymm11, ymmword [rcx+sizeof(ymmword)*6] vpaddq ymm6, ymm6, ymm14 vpmuludq ymm12, ymm11, ymmword [rcx+sizeof(ymmword)*7] vpaddq ymm7, ymm7, ymm12 vpmuludq ymm13, ymm11, ymmword [rcx+sizeof(ymmword)*8] vpaddq ymm8, ymm8, ymm13 vpmuludq ymm14, ymm11, ymmword [rcx+sizeof(ymmword)*9] vpaddq ymm9, ymm9, ymm14 ;; ------------------------------------------------------------ mov rbx, qword [rbp+sizeof(qword)] ; rbx = b[j+1] vpbroadcastq ymm0, qword [rbp+sizeof(qword)] mov rax, rbx ; ac1 += pa[0]*b[j+1] imul rax, qword [rsi] add r11, rax mov rdx, r11 ; y1 = (ac1*m0) & DIGIT_MASK imul edx, r9d and edx, DIGIT_MASK mov rax, rbx ; ac2 += pa[1]*b[j+1] imul rax, qword [rsi+sizeof(qword)] add r12, rax mov rax, rbx ; ac3 += pa[2]*b[j+1] imul rax, qword [rsi+sizeof(qword)*2] add r13, rax vmovd xmm11, edx vpbroadcastq ymm11, xmm11 vpmuludq ymm12, ymm0, ymmword [rsi+sizeof(ymmword)-sizeof(qword)] vpaddq ymm1, ymm1, ymm12 vpmuludq ymm13, ymm0, ymmword [rsi+sizeof(ymmword)*2-sizeof(qword)] vpaddq ymm2, ymm2, ymm13 vpmuludq ymm14, ymm0, ymmword [rsi+sizeof(ymmword)*3-sizeof(qword)] vpaddq ymm3, ymm3, ymm14 vpmuludq ymm12, ymm0, ymmword [rsi+sizeof(ymmword)*4-sizeof(qword)] vpaddq ymm4, ymm4, ymm12 vpmuludq ymm13, ymm0, ymmword [rsi+sizeof(ymmword)*5-sizeof(qword)] vpaddq ymm5, ymm5, ymm13 vpmuludq ymm14, ymm0, ymmword [rsi+sizeof(ymmword)*6-sizeof(qword)] vpaddq ymm6, ymm6, ymm14 vpmuludq ymm12, ymm0, ymmword [rsi+sizeof(ymmword)*7-sizeof(qword)] vpaddq ymm7, ymm7, ymm12 vpmuludq ymm13, ymm0, ymmword [rsi+sizeof(ymmword)*8-sizeof(qword)] vpaddq ymm8, ymm8, ymm13 vpmuludq ymm14, ymm0, ymmword [rsi+sizeof(ymmword)*9-sizeof(qword)] vpaddq ymm9, ymm9, ymm14 mov rax, rdx ; ac1 += pn[0]*y1 imul rax, qword [rcx] add r11, rax shr r11, DIGIT_BITS mov rax, rdx ; ac2 += pn[1]*y1 imul rax, qword [rcx+sizeof(qword)] add r12, rax add r12, r11 mov rax, rdx ; ac3 += pn[2]*y1 imul rax, qword [rcx+sizeof(qword)*2] add r13, rax vpmuludq ymm12, ymm11, ymmword [rcx+sizeof(ymmword)-sizeof(qword)] vpaddq ymm1, ymm1, ymm12 vpmuludq ymm13, ymm11, ymmword [rcx+sizeof(ymmword)*2-sizeof(qword)] vpaddq ymm2, ymm2, ymm13 vpmuludq ymm14, ymm11, ymmword [rcx+sizeof(ymmword)*3-sizeof(qword)] vpaddq ymm3, ymm3, ymm14 vpmuludq ymm12, ymm11, ymmword [rcx+sizeof(ymmword)*4-sizeof(qword)] vpaddq ymm4, ymm4, ymm12 vpmuludq ymm13, ymm11, ymmword [rcx+sizeof(ymmword)*5-sizeof(qword)] vpaddq ymm5, ymm5, ymm13 vpmuludq ymm14, ymm11, ymmword [rcx+sizeof(ymmword)*6-sizeof(qword)] vpaddq ymm6, ymm6, ymm14 vpmuludq ymm12, ymm11, ymmword [rcx+sizeof(ymmword)*7-sizeof(qword)] vpaddq ymm7, ymm7, ymm12 vpmuludq ymm13, ymm11, ymmword [rcx+sizeof(ymmword)*8-sizeof(qword)] vpaddq ymm8, ymm8, ymm13 vpmuludq ymm14, ymm11, ymmword [rcx+sizeof(ymmword)*9-sizeof(qword)] vpaddq ymm9, ymm9, ymm14 sub r8, 2 jz .exit_loop_B ;; ------------------------------------------------------------ mov rbx, qword [rbp+sizeof(qword)*2] ; rbx = b[j+2] vpbroadcastq ymm0, qword [rbp+sizeof(qword)*2] mov rax, rbx ; ac2 += pa[0]*b[j+2] imul rax, qword [rsi] add r12, rax mov rdx, r12 ; y2 = (ac2*m0) & DIGIT_MASK imul edx, r9d and edx, DIGIT_MASK mov rax, rbx ; ac2 += pa[0]*b[j+2] imul rax, qword [rsi+sizeof(qword)] add r13, rax vmovd xmm11, edx vpbroadcastq ymm11, xmm11 vpmuludq ymm12, ymm0, ymmword [rsi+sizeof(ymmword)-sizeof(qword)*2] vpaddq ymm1, ymm1, ymm12 vpmuludq ymm13, ymm0, ymmword [rsi+sizeof(ymmword)*2-sizeof(qword)*2] vpaddq ymm2, ymm2, ymm13 vpmuludq ymm14, ymm0, ymmword [rsi+sizeof(ymmword)*3-sizeof(qword)*2] vpaddq ymm3, ymm3, ymm14 vpmuludq ymm12, ymm0, ymmword [rsi+sizeof(ymmword)*4-sizeof(qword)*2] vpaddq ymm4, ymm4, ymm12 vpmuludq ymm13, ymm0, ymmword [rsi+sizeof(ymmword)*5-sizeof(qword)*2] vpaddq ymm5, ymm5, ymm13 vpmuludq ymm14, ymm0, ymmword [rsi+sizeof(ymmword)*6-sizeof(qword)*2] vpaddq ymm6, ymm6, ymm14 vpmuludq ymm12, ymm0, ymmword [rsi+sizeof(ymmword)*7-sizeof(qword)*2] vpaddq ymm7, ymm7, ymm12 vpmuludq ymm13, ymm0, ymmword [rsi+sizeof(ymmword)*8-sizeof(qword)*2] vpaddq ymm8, ymm8, ymm13 vpmuludq ymm14, ymm0, ymmword [rsi+sizeof(ymmword)*9-sizeof(qword)*2] vpaddq ymm9, ymm9, ymm14 mov rax, rdx ; ac2 += pn[0]*y2 imul rax, qword [rcx] add r12, rax shr r12, DIGIT_BITS mov rax, rdx ; ac3 += pn[1]*y2 imul rax, qword [rcx+sizeof(qword)] add r13, rax add r13, r12 vpmuludq ymm12, ymm11, ymmword [rcx+sizeof(ymmword)-sizeof(qword)*2] vpaddq ymm1, ymm1, ymm12 vpmuludq ymm13, ymm11, ymmword [rcx+sizeof(ymmword)*2-sizeof(qword)*2] vpaddq ymm2, ymm2, ymm13 vpmuludq ymm14, ymm11, ymmword [rcx+sizeof(ymmword)*3-sizeof(qword)*2] vpaddq ymm3, ymm3, ymm14 vpmuludq ymm12, ymm11, ymmword [rcx+sizeof(ymmword)*4-sizeof(qword)*2] vpaddq ymm4, ymm4, ymm12 vpmuludq ymm13, ymm11, ymmword [rcx+sizeof(ymmword)*5-sizeof(qword)*2] vpaddq ymm5, ymm5, ymm13 vpmuludq ymm14, ymm11, ymmword [rcx+sizeof(ymmword)*6-sizeof(qword)*2] vpaddq ymm6, ymm6, ymm14 vpmuludq ymm12, ymm11, ymmword [rcx+sizeof(ymmword)*7-sizeof(qword)*2] vpaddq ymm7, ymm7, ymm12 vpmuludq ymm13, ymm11, ymmword [rcx+sizeof(ymmword)*8-sizeof(qword)*2] vpaddq ymm8, ymm8, ymm13 vpmuludq ymm14, ymm11, ymmword [rcx+sizeof(ymmword)*9-sizeof(qword)*2] vpaddq ymm9, ymm9, ymm14 ;; ------------------------------------------------------------ mov rbx, qword [rbp+sizeof(qword)*3] ; rbx = b[j+3] vpbroadcastq ymm0, qword [rbp+sizeof(qword)*3] imul rbx, qword [rsi] ; ac3 += pa[0]*b[j+3] add r13, rbx mov rdx, r13 ; y3 = (ac3*m0) & DIGIT_MASK imul edx, r9d and edx, DIGIT_MASK vmovd xmm11, edx vpbroadcastq ymm11, xmm11 vpmuludq ymm12, ymm0, ymmword [rsi+sizeof(ymmword)-sizeof(qword)*3] vpaddq ymm1, ymm1, ymm12 vpmuludq ymm13, ymm0, ymmword [rsi+sizeof(ymmword)*2-sizeof(qword)*3] vpaddq ymm2, ymm2, ymm13 vpmuludq ymm14, ymm0, ymmword [rsi+sizeof(ymmword)*3-sizeof(qword)*3] vpaddq ymm3, ymm3, ymm14 vpmuludq ymm12, ymm0, ymmword [rsi+sizeof(ymmword)*4-sizeof(qword)*3] vpaddq ymm4, ymm4, ymm12 vpmuludq ymm13, ymm0, ymmword [rsi+sizeof(ymmword)*5-sizeof(qword)*3] vpaddq ymm5, ymm5, ymm13 vpmuludq ymm14, ymm0, ymmword [rsi+sizeof(ymmword)*6-sizeof(qword)*3] vpaddq ymm6, ymm6, ymm14 vpmuludq ymm12, ymm0, ymmword [rsi+sizeof(ymmword)*7-sizeof(qword)*3] vpaddq ymm7, ymm7, ymm12 vpmuludq ymm13, ymm0, ymmword [rsi+sizeof(ymmword)*8-sizeof(qword)*3] vpaddq ymm8, ymm8, ymm13 vpmuludq ymm14, ymm0, ymmword [rsi+sizeof(ymmword)*9-sizeof(qword)*3] vpaddq ymm9, ymm9, ymm14 vpmuludq ymm10, ymm0, ymmword [rsi+sizeof(ymmword)*10-sizeof(qword)*3] imul rdx, qword [rcx] ; ac3 += pn[0]*y3 add r13, rdx shr r13, DIGIT_BITS vmovq xmm14, r13 vpmuludq ymm12, ymm11, ymmword [rcx+sizeof(ymmword)-sizeof(qword)*3] vpaddq ymm1, ymm1, ymm12 vpaddq ymm1, ymm1, ymm14 vmovdqu ymmword [rsp], ymm1 vpmuludq ymm13, ymm11, ymmword [rcx+sizeof(ymmword)*2-sizeof(qword)*3] vpaddq ymm1, ymm2, ymm13 vpmuludq ymm14, ymm11, ymmword [rcx+sizeof(ymmword)*3-sizeof(qword)*3] vpaddq ymm2, ymm3, ymm14 vpmuludq ymm12, ymm11, ymmword [rcx+sizeof(ymmword)*4-sizeof(qword)*3] vpaddq ymm3, ymm4, ymm12 vpmuludq ymm13, ymm11, ymmword [rcx+sizeof(ymmword)*5-sizeof(qword)*3] vpaddq ymm4, ymm5, ymm13 vpmuludq ymm14, ymm11, ymmword [rcx+sizeof(ymmword)*6-sizeof(qword)*3] vpaddq ymm5, ymm6, ymm14 vpmuludq ymm12, ymm11, ymmword [rcx+sizeof(ymmword)*7-sizeof(qword)*3] vpaddq ymm6, ymm7, ymm12 vpmuludq ymm13, ymm11, ymmword [rcx+sizeof(ymmword)*8-sizeof(qword)*3] vpaddq ymm7, ymm8, ymm13 vpmuludq ymm14, ymm11, ymmword [rcx+sizeof(ymmword)*9-sizeof(qword)*3] vpaddq ymm8, ymm9, ymm14 vpmuludq ymm12, ymm11, ymmword [rcx+sizeof(ymmword)*10-sizeof(qword)*3] vpaddq ymm9, ymm10, ymm12 ;; ------------------------------------------------------------ add rbp, sizeof(qword)*4 sub r8, 2 jnz .loop4_B .exit_loop_B: mov qword [rdi], r12 mov qword [rdi+sizeof(qword)], r13 vmovdqu ymmword [rdi+sizeof(qword)*2], ymm1 vmovdqu ymmword [rdi+sizeof(qword)*2+sizeof(ymmword)], ymm2 vmovdqu ymmword [rdi+sizeof(qword)*2+sizeof(ymmword)*2], ymm3 vmovdqu ymmword [rdi+sizeof(qword)*2+sizeof(ymmword)*3], ymm4 vmovdqu ymmword [rdi+sizeof(qword)*2+sizeof(ymmword)*4], ymm5 vmovdqu ymmword [rdi+sizeof(qword)*2+sizeof(ymmword)*5], ymm6 vmovdqu ymmword [rdi+sizeof(qword)*2+sizeof(ymmword)*6], ymm7 vmovdqu ymmword [rdi+sizeof(qword)*2+sizeof(ymmword)*7], ymm8 vmovdqu ymmword [rdi+sizeof(qword)*2+sizeof(ymmword)*8], ymm9 ;; ;; normalize ;; mov r8, dword 38 xor rax, rax .norm_loop: add rax, qword [rdi] add rdi, sizeof(qword) mov rdx, dword DIGIT_MASK and rdx, rax shr rax, DIGIT_BITS mov qword [rdi-sizeof(qword)], rdx sub r8, 1 jg .norm_loop mov qword [rdi], rax REST_XMM_AVX REST_GPR ret ENDFUNC cpMontMul1024_avx2 %endif ; _IPP32E_L9
; A171522: Denominator of 1/n^2-1/(n+2)^2. ; 0,9,16,225,144,1225,576,3969,1600,9801,3600,20449,7056,38025,12544,65025,20736,104329,32400,159201,48400,233289,69696,330625,97344,455625,132496,613089,176400,808201,230400,1046529,295936,1334025,374544,1677025,467856,2082249,577600,2556801,705600,3108169,853776,3744225,1024144,4473225,1218816,5303809,1440000,6245001,1690000,7306209,1971216,8497225,2286144,9828225,2637376,11309769,3027600,12952801,3459600,14768649,3936256,16769025,4460544,18966025,5035536,21372129,5664400,24000201,6350400,26863489,7096896,29975625,7907344,33350625,8785296,37002889,9734400,40947201,10758400,45198729,11861136,49773025,13046544,54686025,14318656,59954049,15681600,65593801,17139600,71622369,18696976,78057225,20358144,84916225,22127616,92217609,24010000,99980001,26010000,108222409,28132416,116964225,30382144,126225225,32764176,136025569,35283600,146385801,37945600,157326849,40755456,168870025,43718544,181037025,46840336,193849929,50126400,207331201,53582400,221503689,57214096,236390625,61027344,252015625,65028096,268402689,69222400,285576201,73616400,303560929,78216336,322382025,83028544,342065025,88059456,362635849,93315600,384120801,98803600,406546569,104530176,429940225,110502144,454329225,116726416,479741409,123210000,506205001,129960000,533748609,136983616,562401225,144288144,592192225,151880976,623151369,159769600,655308801,167961600,688695049,176464656,723341025,185286544,759278025,194435136,796537729,203918400,835152201,213744400,875153889,223921296,916575625,234457344,959450625,245360896,1003812489,256640400,1049695201,268304400,1097133129,280361536,1146161025,292820544,1196814025,305690256,1249127649,318979600,1303137801,332697600,1358880769,346853376,1416393225,361456144,1475712225,376515216,1536875209,392040000,1599920001,408040000,1664884809,424524816,1731808225,441504144,1800729225,458987776,1871687169,476985600,1944721801,495507600,2019873249,514563856,2097182025,534164544,2176689025,554319936,2258435529,575040400,2342463201,596336400,2428814089,618218496,2517530625,640697344,2608655625,663783696,2702232289,687488400,2798304201,711822400,2896915329,736796736,2998110025,762422544,3101933025,788711056,3208429449,815673600,3317644801,843321600,3429624969,871666576,3544416225,900720144,3662065225,930494016,3782619009,961000000,3906125001 mov $2,$0 add $0,5 mov $3,$2 gcd $2,2 mov $4,2 add $4,$3 mul $3,2 mul $3,$4 mul $3,2 div $3,$2 mov $6,1 lpb $0,1 mov $0,2 mov $5,$3 pow $5,2 add $6,1 mul $6,$5 mov $1,$6 mov $6,3 lpe div $1,32
org $8000 start: lda #$02 sta $ff02 ldx #$00 loop: lda msg,x beq end sta $ff00 inx bra loop end: lda #$0a sta $ff00 stp int_handler: nmi_handler: rti msg: string "Hello, world!" msgend: org $fffa word int_handler word start word nmi_handler
extern printf extern scanf section .data msg db "enter character :", 0 vfmt db "vowel!", 0 nfmt db "not vowel!", 0 ifmt db "%c", 0 section .text global start start: enter 4, 0 push msg call printf add esp, 4 lea eax, [ebp - 4] push eax push ifmt call scanf add esp, 8 push dword [ebp - 4] call isvowel add esp, 4 cmp eax, 0 jz _notvowel push vfmt call printf add esp, 4 jmp _endif _notvowel: push nfmt call printf add esp, 4 _endif: leave ret isvowel: enter 0, 0 cmp dword [ebp + 8], 'a' jz _done cmp dword [ebp + 8], 'e' jz _done cmp dword [ebp + 8], 'i' jz _done jz dword [ebp + 8], 'o' jz _done cmp dword [ebp + 8], 'u' jz _done mov eax, 0 leave ret _done: mov eax, 1 leave ret
#include "rod_math_v9.h" int main(){ float m_im1[3] = {-8.78125100e-11, 1.16555800e-10, -8.71992700e-11}; float e_im1[3] = {1.34365400e-08, 6.62241900e-09, -4.68984700e-09}; float e_i[3] = {6.55867000e-09, 2.03361000e-09, 5.91157700e-09}; float m_prime[3]; rod::parallel_transport(m_im1, m_prime, e_im1, e_i); float dotprod = m_prime[rod::x]*e_i[rod::x]+m_prime[rod::y]*e_i[rod::y]+m_prime[rod::z]*e_i[rod::z]; if (dotprod < 0.01){ return 0; } else{ return 1; } }
/************************************************************************************ * * * Copyright (c) 2014 - 2018 Axel Menzel <info@rttr.org> * * * * This file is part of RTTR (Run Time Type Reflection) * * License: MIT License * * * * 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. * * * *************************************************************************************/ #include "rttr/variant_associative_view.h" #include "rttr/argument.h" #include "rttr/instance.h" using namespace std; namespace rttr { ///////////////////////////////////////////////////////////////////////////////// variant_associative_view::variant_associative_view() { } ///////////////////////////////////////////////////////////////////////////////// variant_associative_view::variant_associative_view(const variant_associative_view& other) : m_view(other.m_view) { } ///////////////////////////////////////////////////////////////////////////////// variant_associative_view::~variant_associative_view() RTTR_NOEXCEPT { } ///////////////////////////////////////////////////////////////////////////////// void variant_associative_view::swap(variant_associative_view& other) RTTR_NOEXCEPT { std::swap(m_view, other.m_view); } ///////////////////////////////////////////////////////////////////////////////// variant_associative_view& variant_associative_view::operator=(const variant_associative_view& other) RTTR_NOEXCEPT { variant_associative_view(other).swap(*this); return *this; } ///////////////////////////////////////////////////////////////////////////////////////// bool variant_associative_view::is_valid() const RTTR_NOEXCEPT { return m_view.get_type().is_valid(); } ///////////////////////////////////////////////////////////////////////////////////////// variant_associative_view::operator bool() const RTTR_NOEXCEPT { return m_view.get_type().is_valid(); } ///////////////////////////////////////////////////////////////////////////////////////// type variant_associative_view::get_type() const RTTR_NOEXCEPT { return m_view.get_type(); } ///////////////////////////////////////////////////////////////////////////////////////// type variant_associative_view::get_key_type() const RTTR_NOEXCEPT { return m_view.get_key_type(); } ///////////////////////////////////////////////////////////////////////////////////////// type variant_associative_view::get_value_type() const RTTR_NOEXCEPT { return m_view.get_value_type(); } ///////////////////////////////////////////////////////////////////////////////////////// bool variant_associative_view::is_key_only_type() const RTTR_NOEXCEPT { return (m_view.get_value_type().is_valid() == false && is_valid()); } ///////////////////////////////////////////////////////////////////////////////////////// bool variant_associative_view::is_empty() const RTTR_NOEXCEPT { return m_view.is_empty(); } ///////////////////////////////////////////////////////////////////////////////////////// std::size_t variant_associative_view::get_size() const RTTR_NOEXCEPT { return m_view.get_size(); } ///////////////////////////////////////////////////////////////////////////////////////// std::pair<variant_associative_view::const_iterator, bool> variant_associative_view::insert(argument key) { const_iterator itr(&m_view); auto success = m_view.insert(key, itr.m_itr); return {itr, success}; } ///////////////////////////////////////////////////////////////////////////////////////// std::pair<variant_associative_view::const_iterator, bool> variant_associative_view::insert(argument key, argument value) { const_iterator itr(&m_view); auto success = m_view.insert(key, value, itr.m_itr); return {itr, success}; } ///////////////////////////////////////////////////////////////////////////////////////// variant_associative_view::const_iterator variant_associative_view::find(argument arg) { const_iterator itr(&m_view); m_view.find(itr.m_itr, arg); return itr; } ///////////////////////////////////////////////////////////////////////////////////////// std::size_t variant_associative_view::erase(argument key) { return m_view.erase(key); } ///////////////////////////////////////////////////////////////////////////////////////// bool variant_associative_view::set_value(argument key, argument value) { return m_view.set_value(key, value); } ///////////////////////////////////////////////////////////////////////////////////////// void variant_associative_view::clear() { m_view.clear(); } ///////////////////////////////////////////////////////////////////////////////////////// std::pair<variant_associative_view::const_iterator, variant_associative_view::const_iterator> variant_associative_view::equal_range(argument key) { const_iterator itr_begin(&m_view); const_iterator itr_end(&m_view); m_view.equal_range(key, itr_begin.m_itr, itr_end.m_itr); return {itr_begin, itr_end}; } ///////////////////////////////////////////////////////////////////////////////////////// variant_associative_view::const_iterator variant_associative_view::begin() const { const_iterator itr(&m_view); m_view.begin(itr.m_itr); return itr; } ///////////////////////////////////////////////////////////////////////////////////////// variant_associative_view::const_iterator variant_associative_view::end() const { const_iterator itr(&m_view); m_view.end(itr.m_itr); return itr; } ///////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////// variant_associative_view::const_iterator::const_iterator(const detail::variant_associative_view_private* view) RTTR_NOEXCEPT : m_view(view) { } ///////////////////////////////////////////////////////////////////////////////////////// variant_associative_view::const_iterator::~const_iterator() { m_view->destroy(m_itr); } ///////////////////////////////////////////////////////////////////////////////////////// variant_associative_view::const_iterator::const_iterator(const const_iterator &other) : m_view(other.m_view), m_itr(other.m_itr) { m_view->copy(m_itr, other.m_itr); } ///////////////////////////////////////////////////////////////////////////////////////// variant_associative_view::const_iterator& variant_associative_view::const_iterator::operator=(const_iterator other) { swap(other); return *this; } ///////////////////////////////////////////////////////////////////////////////////////// void variant_associative_view::const_iterator::swap(const_iterator& other) { std::swap(m_itr, other.m_itr); std::swap(m_view, other.m_view); } ///////////////////////////////////////////////////////////////////////////////////////// const std::pair<variant, variant> variant_associative_view::const_iterator::operator*() const { return m_view->get_key_value(m_itr); } ///////////////////////////////////////////////////////////////////////////////////////// const variant variant_associative_view::const_iterator::get_key() const { return m_view->get_key(m_itr); } ///////////////////////////////////////////////////////////////////////////////////////// const variant variant_associative_view::const_iterator::get_value() const { return m_view->get_value(m_itr); } ///////////////////////////////////////////////////////////////////////////////////////// variant_associative_view::const_iterator& variant_associative_view::const_iterator::operator++() { m_view->advance(m_itr, 1); return *this; } ///////////////////////////////////////////////////////////////////////////////////////// variant_associative_view::const_iterator variant_associative_view::const_iterator::operator++(int) { const_iterator result(m_view); m_view->copy(result.m_itr, m_itr); m_view->advance(m_itr, 1); return result; } ///////////////////////////////////////////////////////////////////////////////////////// variant_associative_view::const_iterator& variant_associative_view::const_iterator::operator--() { m_view->advance(m_itr, -1); return *this; } ///////////////////////////////////////////////////////////////////////////////////////// variant_associative_view::const_iterator variant_associative_view::const_iterator::operator--(int) { const_iterator result(m_view); m_view->copy(result.m_itr, m_itr); m_view->advance(m_itr, -1); return result; } ///////////////////////////////////////////////////////////////////////////////////////// variant_associative_view::const_iterator& variant_associative_view::const_iterator::operator+=(int i) { m_view->advance(m_itr, i); return *this; } ///////////////////////////////////////////////////////////////////////////////////////// variant_associative_view::const_iterator& variant_associative_view::const_iterator::operator-=(int i) { m_view->advance(m_itr, -i); return *this; } ///////////////////////////////////////////////////////////////////////////////////////// variant_associative_view::const_iterator variant_associative_view::const_iterator::operator+(int i) const { const_iterator result(m_view); m_view->copy(result.m_itr, m_itr); result.m_view->advance(result.m_itr, i); return result; } ///////////////////////////////////////////////////////////////////////////////////////// variant_associative_view::const_iterator variant_associative_view::const_iterator::operator-(int i) const { const_iterator result(m_view); m_view->copy(result.m_itr, m_itr); result.m_view->advance(result.m_itr, -i); return result; } ///////////////////////////////////////////////////////////////////////////////////////// bool variant_associative_view::const_iterator::operator==(const const_iterator& other) const { return m_view->equal(m_itr, other.m_itr); } ///////////////////////////////////////////////////////////////////////////////////////// bool variant_associative_view::const_iterator::operator!=(const const_iterator& other) const { return !m_view->equal(m_itr, other.m_itr); } ///////////////////////////////////////////////////////////////////////////////////////// } // end namespace rttr
; int fsetpos_callee(FILE *stream, const fpos_t *pos) INCLUDE "config_private.inc" SECTION code_clib SECTION code_stdio ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IF __CLIB_OPT_MULTITHREAD & $02 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PUBLIC _fsetpos_callee EXTERN asm_fsetpos _fsetpos_callee: pop hl pop ix ex (sp),hl jp asm_fsetpos ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ELSE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PUBLIC _fsetpos_callee EXTERN _fsetpos_unlocked_callee defc _fsetpos_callee = _fsetpos_unlocked_callee ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ENDIF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
IF !_ZXN public _screenTab section RODATA_2 ; Screen address decoding: ; Hi Lo ; +---------------+ +---------------+ ; |7|6|5|4|3|2|1|0| |7|6|5|4|3|2|1|0| ; +---------------+ +---------------+ ; | | | | | | | | ; +---+ +---+-----+ +-----+---------+ ; | | | | | ; | | | | +-- Character column (0-31) ; | | | +----------- Character row lower bits (0-7) ; | | +------------------- Pixel row within character (0-7) ; | +------------------------ Character row upper bits (0-2) ; +------------------------------ Bank (1 or 3) ; ; The screen table contains the address of the ; first byte of each pixel row of screen memory ; _screenTab: dw 0x4000 ; Row 0 dw 0x4100 ; Row 1 dw 0x4200 ; Row 2 dw 0x4300 ; Row 3 dw 0x4400 ; Row 4 dw 0x4500 ; Row 5 dw 0x4600 ; Row 6 dw 0x4700 ; Row 7 dw 0x4020 ; Row 8 dw 0x4120 ; Row 9 dw 0x4220 ; Row 10 dw 0x4320 ; Row 11 dw 0x4420 ; Row 12 dw 0x4520 ; Row 13 dw 0x4620 ; Row 14 dw 0x4720 ; Row 15 dw 0x4040 ; Row 16 dw 0x4140 ; Row 17 dw 0x4240 ; Row 18 dw 0x4340 ; Row 19 dw 0x4440 ; Row 20 dw 0x4540 ; Row 21 dw 0x4640 ; Row 22 dw 0x4740 ; Row 23 dw 0x4060 ; Row 24 dw 0x4160 ; Row 25 dw 0x4260 ; Row 26 dw 0x4360 ; Row 27 dw 0x4460 ; Row 28 dw 0x4560 ; Row 29 dw 0x4660 ; Row 30 dw 0x4760 ; Row 31 dw 0x4080 ; Row 32 dw 0x4180 ; Row 33 dw 0x4280 ; Row 34 dw 0x4380 ; Row 35 dw 0x4480 ; Row 36 dw 0x4580 ; Row 37 dw 0x4680 ; Row 38 dw 0x4780 ; Row 39 dw 0x40a0 ; Row 40 dw 0x41a0 ; Row 41 dw 0x42a0 ; Row 42 dw 0x43a0 ; Row 43 dw 0x44a0 ; Row 44 dw 0x45a0 ; Row 45 dw 0x46a0 ; Row 46 dw 0x47a0 ; Row 47 dw 0x40c0 ; Row 48 dw 0x41c0 ; Row 49 dw 0x42c0 ; Row 50 dw 0x43c0 ; Row 51 dw 0x44c0 ; Row 52 dw 0x45c0 ; Row 53 dw 0x46c0 ; Row 54 dw 0x47c0 ; Row 55 dw 0x40e0 ; Row 56 dw 0x41e0 ; Row 57 dw 0x42e0 ; Row 58 dw 0x43e0 ; Row 59 dw 0x44e0 ; Row 60 dw 0x45e0 ; Row 61 dw 0x46e0 ; Row 62 dw 0x47e0 ; Row 63 dw 0x4800 ; Row 64 dw 0x4900 ; Row 65 dw 0x4a00 ; Row 66 dw 0x4b00 ; Row 67 dw 0x4c00 ; Row 68 dw 0x4d00 ; Row 69 dw 0x4e00 ; Row 70 dw 0x4f00 ; Row 71 dw 0x4820 ; Row 72 dw 0x4920 ; Row 73 dw 0x4a20 ; Row 74 dw 0x4b20 ; Row 75 dw 0x4c20 ; Row 76 dw 0x4d20 ; Row 77 dw 0x4e20 ; Row 78 dw 0x4f20 ; Row 79 dw 0x4840 ; Row 80 dw 0x4940 ; Row 81 dw 0x4a40 ; Row 82 dw 0x4b40 ; Row 83 dw 0x4c40 ; Row 84 dw 0x4d40 ; Row 85 dw 0x4e40 ; Row 86 dw 0x4f40 ; Row 87 dw 0x4860 ; Row 88 dw 0x4960 ; Row 89 dw 0x4a60 ; Row 90 dw 0x4b60 ; Row 91 dw 0x4c60 ; Row 92 dw 0x4d60 ; Row 93 dw 0x4e60 ; Row 94 dw 0x4f60 ; Row 95 dw 0x4880 ; Row 96 dw 0x4980 ; Row 97 dw 0x4a80 ; Row 98 dw 0x4b80 ; Row 99 dw 0x4c80 ; Row 100 dw 0x4d80 ; Row 101 dw 0x4e80 ; Row 102 dw 0x4f80 ; Row 103 dw 0x48a0 ; Row 104 dw 0x49a0 ; Row 105 dw 0x4aa0 ; Row 106 dw 0x4ba0 ; Row 107 dw 0x4ca0 ; Row 108 dw 0x4da0 ; Row 109 dw 0x4ea0 ; Row 110 dw 0x4fa0 ; Row 111 dw 0x48c0 ; Row 112 dw 0x49c0 ; Row 113 dw 0x4ac0 ; Row 114 dw 0x4bc0 ; Row 115 dw 0x4cc0 ; Row 116 dw 0x4dc0 ; Row 117 dw 0x4ec0 ; Row 118 dw 0x4fc0 ; Row 119 dw 0x48e0 ; Row 120 dw 0x49e0 ; Row 121 dw 0x4ae0 ; Row 122 dw 0x4be0 ; Row 123 dw 0x4ce0 ; Row 124 dw 0x4de0 ; Row 125 dw 0x4ee0 ; Row 126 dw 0x4fe0 ; Row 127 dw 0x5000 ; Row 128 dw 0x5100 ; Row 129 dw 0x5200 ; Row 130 dw 0x5300 ; Row 131 dw 0x5400 ; Row 132 dw 0x5500 ; Row 133 dw 0x5600 ; Row 134 dw 0x5700 ; Row 135 dw 0x5020 ; Row 136 dw 0x5120 ; Row 137 dw 0x5220 ; Row 138 dw 0x5320 ; Row 139 dw 0x5420 ; Row 140 dw 0x5520 ; Row 141 dw 0x5620 ; Row 142 dw 0x5720 ; Row 143 dw 0x5040 ; Row 144 dw 0x5140 ; Row 145 dw 0x5240 ; Row 146 dw 0x5340 ; Row 147 dw 0x5440 ; Row 148 dw 0x5540 ; Row 149 dw 0x5640 ; Row 150 dw 0x5740 ; Row 151 dw 0x5060 ; Row 152 dw 0x5160 ; Row 153 dw 0x5260 ; Row 154 dw 0x5360 ; Row 155 dw 0x5460 ; Row 156 dw 0x5560 ; Row 157 dw 0x5660 ; Row 158 dw 0x5760 ; Row 159 dw 0x5080 ; Row 160 dw 0x5180 ; Row 161 dw 0x5280 ; Row 162 dw 0x5380 ; Row 163 dw 0x5480 ; Row 164 dw 0x5580 ; Row 165 dw 0x5680 ; Row 166 dw 0x5780 ; Row 167 dw 0x50a0 ; Row 168 dw 0x51a0 ; Row 169 dw 0x52a0 ; Row 170 dw 0x53a0 ; Row 171 dw 0x54a0 ; Row 172 dw 0x55a0 ; Row 173 dw 0x56a0 ; Row 174 dw 0x57a0 ; Row 175 dw 0x50c0 ; Row 176 dw 0x51c0 ; Row 177 dw 0x52c0 ; Row 178 dw 0x53c0 ; Row 179 dw 0x54c0 ; Row 180 dw 0x55c0 ; Row 181 dw 0x56c0 ; Row 182 dw 0x57c0 ; Row 183 dw 0x50e0 ; Row 184 dw 0x51e0 ; Row 185 dw 0x52e0 ; Row 186 dw 0x53e0 ; Row 187 dw 0x54e0 ; Row 188 dw 0x55e0 ; Row 189 dw 0x56e0 ; Row 190 dw 0x57e0 ; Row 191 ENDIF
; DONE! section .data msg db '%c want to eat %x and drink %s coffee in %d cups with %x and %b classmates', 0xA, 0xD msglen equ $ - msg mystr db 'very-very hot' mystrlen equ $ - mystr STRLEN equ 22 STRHEX db '0123456789ABCDEF' section .bss buffer resb STRLEN section .text global _start _start: mov eax, msg mov ebx, msglen ;---------------------------------------------------------------------------------------------------------------------------------------------------------- ; CALL PRINTF ;---------------------------------------------------------------------------------------------------------------------------------------------------------- mov ecx, 30d push ecx mov ecx, 3565d push ecx ; fif arg mov ecx, 2d push ecx ; fouth arg mov ecx, mystr push ecx ; third mov ecx, 3802d ; sec push ecx mov ecx, 'I' push ecx ; first arg push eax ; &msg push ebx ; strlen(msg) call Printf pop ebx pop eax pop ecx jmp EndProg ;---------------------------------------------------------------------------------------------------------------------------------------------------------- ; CALL DEC ;---------------------------------------------------------------------------------------------------------------------------------------------------------- DecCall: mov ebx, buffer push ebx call Dec pop ebx pop eax jmp RetForCicle ;---------------------------------------------------------------------------------------------------------------------------------------------------------- ; CALL HEX ;---------------------------------------------------------------------------------------------------------------------------------------------------------- HexCall: mov ebx, buffer push ebx call Hex pop ebx pop eax jmp RetForCicle ;---------------------------------------------------------------------------------------------------------------------------------------------------------- ; CALL OCT ;---------------------------------------------------------------------------------------------------------------------------------------------------------- OctCall: mov ebx, buffer push ebx call Oct pop ebx pop eax jmp RetForCicle ;---------------------------------------------------------------------------------------------------------------------------------------------------------- ; CALL OCT ;---------------------------------------------------------------------------------------------------------------------------------------------------------- BinCall: mov ebx, buffer push ebx call Bin pop ebx pop eax jmp RetForCicle ;---------------------------------------------------------------------------------------------------------------------------------------------------------- ; CALL CHAR ;---------------------------------------------------------------------------------------------------------------------------------------------------------- CharCall: mov ebx, buffer push ebx call Char pop ebx pop eax jmp RetForCicle ;---------------------------------------------------------------------------------------------------------------------------------------------------------- ; StrCall ;---------------------------------------------------------------------------------------------------------------------------------------------------------- StrCall: mov ebx, mystrlen ; strlen push ebx call Str pop ebx pop eax jmp RetForCicle ;---------------------------------------------------------------------------------------------------------------------------------------------------------- ; END PROG ;---------------------------------------------------------------------------------------------------------------------------------------------------------- EndProg: xor eax, eax xor ebx, ebx mov eax, 1 mov ebx, 0 int 0x80 ; ---------------- ; | ...... | ; | [ebp] | ; | ret addr | ; | last arg | ; | prev arg | ; | ...... | ; ---------------- ;---------------------------------------------------------------------------------------------------------------------------------------------------------- ; DEC ; PRINT NUMBER IN DEC FORMAT ; ; ATTENTION!!! ; THE FIRST ARG MOVES INTO STACK BY PRINT FUNCTION!!! ; ; ENTRY: EAX = [bp+12] = NUMBER ; EBX = [bp+8] = &BUFFER ; ; EXIT: ; DESTR: EAX, EBX, ECX, EDX, EDI, ESI ;---------------------------------------------------------------------------------------------------------------------------------------------------------- Dec: push ebp mov ebp, esp xor eax, eax mov eax, [ebp + 12] ; eax = number mov edi, [ebp + 8] ; edi = adress of buffer mov esi, edi push eax ; clear buffer cld mov eax, 0 mov ecx, STRLEN repne stosb pop eax mov edi, esi ; edi -= STRLEN add edi, STRLEN - 1 ; size of buffer mov ecx, 10d std DecTran: xor edx, edx div ecx xchg eax, edx add eax, '0' stosb xchg eax, edx or eax, eax jne DecTran xor eax, eax xor ebx, ebx mov eax, 4 mov ebx, 1 xor ecx, ecx mov ecx, esi mov edx, STRLEN ; simbols to write from buffer int 80h push eax ; clear buffer cld mov eax, 0 mov ecx, STRLEN repne stosb pop eax mov edi, esi ; edi -= STRLEN pop ebp ret ;---------------------------------------------------------------------------------------------------------------------------------------------------------- ; HEX ; PRINT NUMBER IN HEX FORMAT ; ; ATTENTION!!! ; THE FIRST ARG MOVES INTO STACK BY PRINT FUNCTION!!! ; ; ENTRY: EAX = [bp+12] = NUMBER ; EBX = [bp+8] = &BUFFER ; ; EXIT: ; DESTR: EAX, EBX, ECX, EDX, EDI, ESI ;---------------------------------------------------------------------------------------------------------------------------------------------------------- Hex: push ebp mov ebp, esp xor eax, eax mov eax, [ebp + 12] ; eax = number mov edi, [ebp + 8] ; edi = adress of buffer mov esi, edi add edi, STRLEN - 1 ; size of buffer std mov edx, 1111b ; edx = mask xor cl, cl ; counter mov ebx, STRHEX ; for xlat push esi xor esi, esi HexTran: mov esi, eax and esi, edx shl edx, 4d push eax xor eax, eax shr esi, cl mov eax, esi xlat stosb pop eax add cl, 4d cmp cl, 32 jne HexTran pop esi xor eax, eax xor ebx, ebx mov eax, 4 mov ebx, 1 xor ecx, ecx mov ecx, esi ; addr buff mov edx, STRLEN ; simbols to write from buffer int 80h push eax ; clear buffer cld mov eax, 0 mov ecx, STRLEN repne stosb pop eax mov edi, esi ; edi -= STRLEN pop ebp ret ;---------------------------------------------------------------------------------------------------------------------------------------------------------- ; OCT ; PRINT NUMBER IN OCT FORMAT ; ; ATTENTION!!! ; THE FIRST ARG MOVES INTO STACK BY PRINT FUNCTION!!! ; ; ENTRY: EAX = [bp+12] = NUMBER ; EBX = [bp+8] = &BUFFER ; ; EXIT: ; DESTR: EAX, EBX, ECX, EDX, EDI, ESI ;---------------------------------------------------------------------------------------------------------------------------------------------------------- Oct: push ebp mov ebp, esp xor eax, eax mov eax, [ebp + 12] ; eax = number mov edi, [ebp + 8] ; edi = adress of buffer mov esi, edi add edi, STRLEN - 1 ; size of buffer std mov edx, 111b ; edx = mask xor cl, cl ; counter push esi xor esi, esi OctTran: mov esi, eax and esi, edx shl edx, 3d push eax xor eax, eax mov eax, '0' shr esi, cl add eax, esi stosb pop eax add cl, 3d cmp cl, 24 jne OctTran pop esi xor eax, eax xor ebx, ebx mov eax, 4 mov ebx, 1 xor ecx, ecx mov ecx, esi ; addr buff + strlen buff mov edx, STRLEN ; simbols to write from buffer int 80h pop ebp ret ;---------------------------------------------------------------------------------------------------------------------------------------------------------- ; BIN ; PRINT NUMBER IN BIN FORMAT ; ; ATTENTION!!! ; THE FIRST ARG MOVES INTO STACK BY PRINT FUNCTION!!! ; ; ENTRY: EAX = [bp+12] = NUMBER ; EBX = [bp+8] = &BUFFER ; ; EXIT: ; DESTR: EAX, EBX, ECX, EDX, EDI, ESI ;---------------------------------------------------------------------------------------------------------------------------------------------------------- Bin: push ebp mov ebp, esp xor eax, eax mov eax, [ebp + 12] ; eax = number mov edi, [ebp + 8] ; edi = adress of buffer mov esi, edi add edi, STRLEN - 1 ; size of buffer std mov ecx, 1b ; edx = mask BinTran: mov ebx, eax and ebx, ecx shl ecx, 1d push eax xor eax, eax mov eax, '0' cmp ebx, 0 je PrintBit add eax, 1 PrintBit: stosb pop eax cmp ecx, 0FFFFFFFh jl BinTran xor eax, eax xor ebx, ebx mov eax, 4 mov ebx, 1 xor ecx, ecx xor edx, edx mov ecx, esi ; addr buff + strlen buff mov edx, STRLEN ; simbols to write from buffer int 80h push eax ; clear buffer cld mov eax, 0 mov ecx, STRLEN repne stosb pop eax mov edi, esi ; edi -= STRLEN pop ebp ret ;---------------------------------------------------------------------------------------------------------------------------------------------------------- ; CHAR ; PRINT SYMBOL ; ; ATTENTION!!! ; THE FIRST ARG MOVES INTO STACK BY PRINT FUNCTION!!! ; ; ENTRY: EAX = [bp+12] = NUMBER ; EBX = [bp+8] = &BUFFER ; ; EXIT: ; DESTR: EAX, EBX, ECX, EDX, EDI, ESI ;---------------------------------------------------------------------------------------------------------------------------------------------------------- Char: push ebp mov ebp, esp xor ecx, ecx mov edi, [ebp+8] ; &buffer mov eax, [ebp+12] ; symbol mov esi, edi add edi, 2 std stosw xor eax, eax xor ebx, ebx mov eax, 4 mov ebx, 1 xor ecx, ecx mov ecx, esi ; addr buff + strlen buff mov edx, STRLEN ; simbols to write from buffer int 080x push eax ; clear buffer cld mov eax, 0 mov ecx, STRLEN repne stosb pop eax mov edi, esi ; edi -= STRLEN pop ebp ret ;---------------------------------------------------------------------------------------------------------------------------------------------------------- ; STR ; PRINT STRING ; ENTRY: EAX = [bp+12] = &STR ; EBX = [bp+8] = STRLEN ; ; EXIT: EAX = NUMBER OF WRITE FUNC, EBX = NUMBER OF EXIT FUNCTION, ECX = ADDR, EDX = LEN ; DESTR: EAX, EBX, ECX, EDX ;---------------------------------------------------------------------------------------------------------------------------------------------------------- Str: push ebp mov ebp, esp xor eax, eax mov eax, 4 mov ebx, 1 mov ecx, [ebp+12] ; ADDR mov edx, [ebp+8] ; STRLEN int 0x80 pop ebp ret ;---------------------------------------------------------------------------------------------------------------------------------------------------------- ; PRINTF ; PRINT NUMBERS FROM REGS ; ENTRY: EAX = [bp+12] = &STR ; EBX = [bp+8] = STRLEN ; ECX... = [bp+16+..] = digits ; EXIT: ; DESTR: EAX, EBX, ECX, EDX, EDI, ESI, ESP ;---------------------------------------------------------------------------------------------------------------------------------------------------------- Printf: push ebp mov ebp, esp xor ecx, ecx mov edi, [ebp + 8] ; STRLEN mov esi, [ebp + 12] ; addres of STRING xor ebx, ebx ; counter of args cld ; clear direct flag ;---------------------------------------------------------------------------------------------------------------------------------------------------------- Read: xor eax, eax lodsb ; al = symbol inc ecx ; cx ++ cmp al, '%' ; if (al == '%') {jmp JMPCALL} je Switch jne PrintLetter ;---------------------------------------------------------------------------------------------------------------------------------------------------------- RetRead: cmp ecx, edi ; if(ecx >= strlen){End} jl Read ; else{Read} jge EndProc ;---------------------------------------------------------------------------------------------------------------------------------------------------------- PrintLetter: push ebx push ecx push edx push edi push esi push eax xor edi, edi xor esi, esi mov edi, buffer mov esi, edi add edi, 2 pop eax std stosb push eax xor eax, eax xor ebx, ebx mov eax, 4 mov ebx, 1 mov ecx, esi mov edx, 4 int 0x80 cld ; clear buffer to putting new symbols mov eax, 0 mov edi, buffer stosb pop eax pop esi pop edi pop edx pop ecx pop ebx jmp RetRead Switch: push edi ; str <==> &str[ecx] push esi ; &buffer + sizebuff push ecx ; position xor ecx, ecx mov ecx, [ebp + 16 + ebx] ; bp + 16 = first arg add ebx, 4 ; count of args push ebx ; counter of % *4 push ecx ; push arg xor eax, eax lodsb cmp al, 'd' je DecCall cmp al, 'x' je HexCall cmp al, 'o' je OctCall cmp al, 'b' je BinCall cmp al, 'c' je CharCall cmp al, 's' je StrCall jne RetWrong ;---------------------------------------------------------------------------------------------------------------------------------------------------------- RetWrong: pop ecx pop ebx pop ecx pop esi pop edi jmp RetRead ;---------------------------------------------------------------------------------------------------------------------------------------------------------- RetForCicle: pop ebx ; counter of % *4 pop ecx ; position on % inc ecx ; str[ecx] = 'd' pop esi ; addres of STRING pop edi ; !!!!!!!!!!!!! ; inc esi ; *esi = d inc esi ; *esi = d cmp ecx, edi jl RetRead jge EndProc ;---------------------------------------------------------------------------------------------------------------------------------------------------------- EndProc: pop ebp ret
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r12 push %r15 push %rcx push %rdi push %rdx push %rsi lea addresses_UC_ht+0xee78, %r15 clflush (%r15) nop nop sub $63711, %r11 movl $0x61626364, (%r15) nop nop nop nop add $36106, %r12 lea addresses_WC_ht+0x1b778, %rsi lea addresses_normal_ht+0xe238, %rdi clflush (%rdi) nop nop and $17725, %r10 mov $94, %rcx rep movsb nop nop nop nop cmp %rcx, %rcx lea addresses_WT_ht+0x9a78, %rcx nop nop nop add %r11, %r11 and $0xffffffffffffffc0, %rcx movaps (%rcx), %xmm3 vpextrq $1, %xmm3, %r15 xor $31637, %r10 lea addresses_WT_ht+0xeb38, %r15 nop add $29442, %rsi mov $0x6162636465666768, %r11 movq %r11, %xmm0 movups %xmm0, (%r15) nop nop and $46975, %r12 lea addresses_UC_ht+0x1278, %rsi lea addresses_A_ht+0x125b8, %rdi nop nop nop add $40327, %rdx mov $42, %rcx rep movsq nop nop inc %r12 lea addresses_WC_ht+0x11bd0, %rdi clflush (%rdi) nop nop and %rdx, %rdx movw $0x6162, (%rdi) nop nop cmp %r11, %r11 lea addresses_D_ht+0x1afb8, %rdx nop nop nop nop sub %rdi, %rdi movb $0x61, (%rdx) nop nop nop nop and %rcx, %rcx lea addresses_UC_ht+0xbd98, %r10 nop nop nop xor $575, %rsi mov (%r10), %r12 and $46101, %rsi lea addresses_UC_ht+0x4b6b, %rcx sub %rdi, %rdi mov $0x6162636465666768, %rdx movq %rdx, %xmm1 and $0xffffffffffffffc0, %rcx movntdq %xmm1, (%rcx) nop nop nop dec %r11 lea addresses_D_ht+0x7078, %rsi lea addresses_D_ht+0x41b8, %rdi nop nop nop nop xor $5705, %rdx mov $18, %rcx rep movsw nop nop nop nop nop xor %rsi, %rsi lea addresses_D_ht+0x17778, %r10 nop nop nop nop xor %r12, %r12 mov (%r10), %r15 nop nop add %rsi, %rsi lea addresses_D_ht+0x131f4, %rdi nop and %r12, %r12 mov $0x6162636465666768, %rsi movq %rsi, %xmm1 vmovups %ymm1, (%rdi) nop nop nop nop nop sub %rcx, %rcx lea addresses_UC_ht+0x3558, %rsi lea addresses_UC_ht+0x79f8, %rdi dec %r15 mov $55, %rcx rep movsq nop nop and %rsi, %rsi pop %rsi pop %rdx pop %rdi pop %rcx pop %r15 pop %r12 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r15 push %r8 push %rax push %rbp // Faulty Load lea addresses_D+0x1da78, %r11 nop nop nop nop nop inc %r8 vmovups (%r11), %ymm0 vextracti128 $1, %ymm0, %xmm0 vpextrq $1, %xmm0, %r15 lea oracles, %r11 and $0xff, %r15 shlq $12, %r15 mov (%r11,%r15,1), %r15 pop %rbp pop %rax pop %r8 pop %r15 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_D', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC_ht', 'NT': True, 'AVXalign': False, 'size': 4, 'congruent': 8}} {'OP': 'REPM', 'src': {'same': True, 'congruent': 8, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_normal_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': True, 'size': 16, 'congruent': 10}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 4}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 11, 'type': 'addresses_UC_ht'}, 'dst': {'same': False, 'congruent': 6, 'type': 'addresses_A_ht'}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 3}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 6}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC_ht', 'NT': True, 'AVXalign': False, 'size': 8, 'congruent': 2}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC_ht', 'NT': True, 'AVXalign': False, 'size': 16, 'congruent': 0}} {'OP': 'REPM', 'src': {'same': True, 'congruent': 9, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_D_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': True, 'size': 8, 'congruent': 8}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 5, 'type': 'addresses_UC_ht'}, 'dst': {'same': False, 'congruent': 7, 'type': 'addresses_UC_ht'}} {'36': 21829} 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 */
_ps: file format elf32-i386 Disassembly of section .text: 00000000 <main>: #include "user.h" #include "fs.h" #include "ps.h" int main(int argc, char *argv[]) { 0: f3 0f 1e fb endbr32 4: 8d 4c 24 04 lea 0x4(%esp),%ecx 8: 83 e4 f0 and $0xfffffff0,%esp b: ff 71 fc pushl -0x4(%ecx) e: 55 push %ebp f: 89 e5 mov %esp,%ebp 11: 56 push %esi 12: 53 push %ebx 13: 51 push %ecx 14: 83 ec 0c sub $0xc,%esp if (argc < 1) 17: 8b 19 mov (%ecx),%ebx 19: 85 db test %ebx,%ebx 1b: 0f 8e 8f 00 00 00 jle b0 <main+0xb0> { printf(1, "Invalidarguments"); } else { struct procstatus *arr = malloc(100*sizeof(struct procstatus)); 21: 83 ec 0c sub $0xc,%esp 24: 68 70 17 00 00 push $0x1770 29: e8 d2 06 00 00 call 700 <malloc> int k=ps(arr); 2e: 89 04 24 mov %eax,(%esp) struct procstatus *arr = malloc(100*sizeof(struct procstatus)); 31: 89 c3 mov %eax,%ebx int k=ps(arr); 33: e8 ab 03 00 00 call 3e3 <ps> printf(1,"%d\n",k); 38: 83 c4 0c add $0xc,%esp 3b: 50 push %eax int k=ps(arr); 3c: 89 c6 mov %eax,%esi printf(1,"%d\n",k); 3e: 68 19 08 00 00 push $0x819 43: 6a 01 push $0x1 45: e8 56 04 00 00 call 4a0 <printf> // printf(1, "PID PRIORITY \tSTATE\t R_TIME\tW_TIME\tN_RUN\tCUR_Q\tQ0 Q1 Q2 Q3 Q4\n"); printf(1,"PID \t Priority \t State \t \t r_time \t w_time \t n_run \t cur_q \t q0 \t q1 \t q2 \t q3 \t q4 \n"); 4a: 58 pop %eax 4b: 5a pop %edx 4c: 68 20 08 00 00 push $0x820 51: 6a 01 push $0x1 53: e8 48 04 00 00 call 4a0 <printf> for(int i=0;i<k;i++) 58: 83 c4 10 add $0x10,%esp 5b: 85 f6 test %esi,%esi 5d: 7e 4c jle ab <main+0xab> 5f: 6b f6 3c imul $0x3c,%esi,%esi 62: 83 c3 04 add $0x4,%ebx 65: 01 de add %ebx,%esi 67: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 6e: 66 90 xchg %ax,%ax { // printf(1,"%d\t%d\t%s\t %d\t%d\t%d\t%d\t%d %d %d %d %d\n",arr[i].pid,arr[i].priority,arr[i].state,arr[i].rtime,arr[i].w_timeforrunning,arr[i].n_run,arr[i].cur_q,arr[i].q[0],arr[i].q[1],arr[i].q[2],arr[i].q[3],arr[i].q[4]); printf(1, "%d \t %d \t \t %s \t %d \t \t %d \t \t %d \t %d \t %d \t %d \t %d \t %d \t %d\n", arr[i].pid, arr[i].priority, arr[i].state, arr[i].rtime, arr[i].w_timeforrunning, arr[i].n_run, arr[i].cur_q, arr[i].q[0], arr[i].q[1], arr[i].q[2], arr[i].q[3], arr[i].q[4]); 70: 83 ec 08 sub $0x8,%esp 73: ff 73 34 pushl 0x34(%ebx) 76: ff 73 30 pushl 0x30(%ebx) 79: ff 73 2c pushl 0x2c(%ebx) 7c: ff 73 28 pushl 0x28(%ebx) 7f: ff 73 24 pushl 0x24(%ebx) 82: ff 73 20 pushl 0x20(%ebx) 85: ff 73 1c pushl 0x1c(%ebx) 88: ff 73 18 pushl 0x18(%ebx) 8b: ff 73 10 pushl 0x10(%ebx) 8e: 53 push %ebx 8f: 83 c3 3c add $0x3c,%ebx 92: ff 73 d8 pushl -0x28(%ebx) 95: ff 73 c0 pushl -0x40(%ebx) 98: 68 78 08 00 00 push $0x878 9d: 6a 01 push $0x1 9f: e8 fc 03 00 00 call 4a0 <printf> for(int i=0;i<k;i++) a4: 83 c4 40 add $0x40,%esp a7: 39 f3 cmp %esi,%ebx a9: 75 c5 jne 70 <main+0x70> // printf(1, "%d ", arr[i].q[2]); // printf(1, "%d ", arr[i].q[3]); // printf(1, "%d\n", arr[i].q[4]); } } exit(); ab: e8 83 02 00 00 call 333 <exit> printf(1, "Invalidarguments"); b0: 51 push %ecx b1: 51 push %ecx b2: 68 08 08 00 00 push $0x808 b7: 6a 01 push $0x1 b9: e8 e2 03 00 00 call 4a0 <printf> be: 83 c4 10 add $0x10,%esp c1: eb e8 jmp ab <main+0xab> c3: 66 90 xchg %ax,%ax c5: 66 90 xchg %ax,%ax c7: 66 90 xchg %ax,%ax c9: 66 90 xchg %ax,%ax cb: 66 90 xchg %ax,%ax cd: 66 90 xchg %ax,%ax cf: 90 nop 000000d0 <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, const char *t) { d0: f3 0f 1e fb endbr32 d4: 55 push %ebp char *os; os = s; while((*s++ = *t++) != 0) d5: 31 c0 xor %eax,%eax { d7: 89 e5 mov %esp,%ebp d9: 53 push %ebx da: 8b 4d 08 mov 0x8(%ebp),%ecx dd: 8b 5d 0c mov 0xc(%ebp),%ebx while((*s++ = *t++) != 0) e0: 0f b6 14 03 movzbl (%ebx,%eax,1),%edx e4: 88 14 01 mov %dl,(%ecx,%eax,1) e7: 83 c0 01 add $0x1,%eax ea: 84 d2 test %dl,%dl ec: 75 f2 jne e0 <strcpy+0x10> ; return os; } ee: 89 c8 mov %ecx,%eax f0: 5b pop %ebx f1: 5d pop %ebp f2: c3 ret f3: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi fa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 00000100 <strcmp>: int strcmp(const char *p, const char *q) { 100: f3 0f 1e fb endbr32 104: 55 push %ebp 105: 89 e5 mov %esp,%ebp 107: 53 push %ebx 108: 8b 4d 08 mov 0x8(%ebp),%ecx 10b: 8b 55 0c mov 0xc(%ebp),%edx while(*p && *p == *q) 10e: 0f b6 01 movzbl (%ecx),%eax 111: 0f b6 1a movzbl (%edx),%ebx 114: 84 c0 test %al,%al 116: 75 19 jne 131 <strcmp+0x31> 118: eb 26 jmp 140 <strcmp+0x40> 11a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 120: 0f b6 41 01 movzbl 0x1(%ecx),%eax p++, q++; 124: 83 c1 01 add $0x1,%ecx 127: 83 c2 01 add $0x1,%edx while(*p && *p == *q) 12a: 0f b6 1a movzbl (%edx),%ebx 12d: 84 c0 test %al,%al 12f: 74 0f je 140 <strcmp+0x40> 131: 38 d8 cmp %bl,%al 133: 74 eb je 120 <strcmp+0x20> return (uchar)*p - (uchar)*q; 135: 29 d8 sub %ebx,%eax } 137: 5b pop %ebx 138: 5d pop %ebp 139: c3 ret 13a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 140: 31 c0 xor %eax,%eax return (uchar)*p - (uchar)*q; 142: 29 d8 sub %ebx,%eax } 144: 5b pop %ebx 145: 5d pop %ebp 146: c3 ret 147: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 14e: 66 90 xchg %ax,%ax 00000150 <strlen>: uint strlen(const char *s) { 150: f3 0f 1e fb endbr32 154: 55 push %ebp 155: 89 e5 mov %esp,%ebp 157: 8b 55 08 mov 0x8(%ebp),%edx int n; for(n = 0; s[n]; n++) 15a: 80 3a 00 cmpb $0x0,(%edx) 15d: 74 21 je 180 <strlen+0x30> 15f: 31 c0 xor %eax,%eax 161: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 168: 83 c0 01 add $0x1,%eax 16b: 80 3c 02 00 cmpb $0x0,(%edx,%eax,1) 16f: 89 c1 mov %eax,%ecx 171: 75 f5 jne 168 <strlen+0x18> ; return n; } 173: 89 c8 mov %ecx,%eax 175: 5d pop %ebp 176: c3 ret 177: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 17e: 66 90 xchg %ax,%ax for(n = 0; s[n]; n++) 180: 31 c9 xor %ecx,%ecx } 182: 5d pop %ebp 183: 89 c8 mov %ecx,%eax 185: c3 ret 186: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 18d: 8d 76 00 lea 0x0(%esi),%esi 00000190 <memset>: void* memset(void *dst, int c, uint n) { 190: f3 0f 1e fb endbr32 194: 55 push %ebp 195: 89 e5 mov %esp,%ebp 197: 57 push %edi 198: 8b 55 08 mov 0x8(%ebp),%edx } static inline void stosb(void *addr, int data, int cnt) { asm volatile("cld; rep stosb" : 19b: 8b 4d 10 mov 0x10(%ebp),%ecx 19e: 8b 45 0c mov 0xc(%ebp),%eax 1a1: 89 d7 mov %edx,%edi 1a3: fc cld 1a4: f3 aa rep stos %al,%es:(%edi) stosb(dst, c, n); return dst; } 1a6: 89 d0 mov %edx,%eax 1a8: 5f pop %edi 1a9: 5d pop %ebp 1aa: c3 ret 1ab: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 1af: 90 nop 000001b0 <strchr>: char* strchr(const char *s, char c) { 1b0: f3 0f 1e fb endbr32 1b4: 55 push %ebp 1b5: 89 e5 mov %esp,%ebp 1b7: 8b 45 08 mov 0x8(%ebp),%eax 1ba: 0f b6 4d 0c movzbl 0xc(%ebp),%ecx for(; *s; s++) 1be: 0f b6 10 movzbl (%eax),%edx 1c1: 84 d2 test %dl,%dl 1c3: 75 16 jne 1db <strchr+0x2b> 1c5: eb 21 jmp 1e8 <strchr+0x38> 1c7: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 1ce: 66 90 xchg %ax,%ax 1d0: 0f b6 50 01 movzbl 0x1(%eax),%edx 1d4: 83 c0 01 add $0x1,%eax 1d7: 84 d2 test %dl,%dl 1d9: 74 0d je 1e8 <strchr+0x38> if(*s == c) 1db: 38 d1 cmp %dl,%cl 1dd: 75 f1 jne 1d0 <strchr+0x20> return (char*)s; return 0; } 1df: 5d pop %ebp 1e0: c3 ret 1e1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return 0; 1e8: 31 c0 xor %eax,%eax } 1ea: 5d pop %ebp 1eb: c3 ret 1ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 000001f0 <gets>: char* gets(char *buf, int max) { 1f0: f3 0f 1e fb endbr32 1f4: 55 push %ebp 1f5: 89 e5 mov %esp,%ebp 1f7: 57 push %edi 1f8: 56 push %esi int i, cc; char c; for(i=0; i+1 < max; ){ 1f9: 31 f6 xor %esi,%esi { 1fb: 53 push %ebx 1fc: 89 f3 mov %esi,%ebx 1fe: 83 ec 1c sub $0x1c,%esp 201: 8b 7d 08 mov 0x8(%ebp),%edi for(i=0; i+1 < max; ){ 204: eb 33 jmp 239 <gets+0x49> 206: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 20d: 8d 76 00 lea 0x0(%esi),%esi cc = read(0, &c, 1); 210: 83 ec 04 sub $0x4,%esp 213: 8d 45 e7 lea -0x19(%ebp),%eax 216: 6a 01 push $0x1 218: 50 push %eax 219: 6a 00 push $0x0 21b: e8 2b 01 00 00 call 34b <read> if(cc < 1) 220: 83 c4 10 add $0x10,%esp 223: 85 c0 test %eax,%eax 225: 7e 1c jle 243 <gets+0x53> break; buf[i++] = c; 227: 0f b6 45 e7 movzbl -0x19(%ebp),%eax 22b: 83 c7 01 add $0x1,%edi 22e: 88 47 ff mov %al,-0x1(%edi) if(c == '\n' || c == '\r') 231: 3c 0a cmp $0xa,%al 233: 74 23 je 258 <gets+0x68> 235: 3c 0d cmp $0xd,%al 237: 74 1f je 258 <gets+0x68> for(i=0; i+1 < max; ){ 239: 83 c3 01 add $0x1,%ebx 23c: 89 fe mov %edi,%esi 23e: 3b 5d 0c cmp 0xc(%ebp),%ebx 241: 7c cd jl 210 <gets+0x20> 243: 89 f3 mov %esi,%ebx break; } buf[i] = '\0'; return buf; } 245: 8b 45 08 mov 0x8(%ebp),%eax buf[i] = '\0'; 248: c6 03 00 movb $0x0,(%ebx) } 24b: 8d 65 f4 lea -0xc(%ebp),%esp 24e: 5b pop %ebx 24f: 5e pop %esi 250: 5f pop %edi 251: 5d pop %ebp 252: c3 ret 253: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 257: 90 nop 258: 8b 75 08 mov 0x8(%ebp),%esi 25b: 8b 45 08 mov 0x8(%ebp),%eax 25e: 01 de add %ebx,%esi 260: 89 f3 mov %esi,%ebx buf[i] = '\0'; 262: c6 03 00 movb $0x0,(%ebx) } 265: 8d 65 f4 lea -0xc(%ebp),%esp 268: 5b pop %ebx 269: 5e pop %esi 26a: 5f pop %edi 26b: 5d pop %ebp 26c: c3 ret 26d: 8d 76 00 lea 0x0(%esi),%esi 00000270 <stat>: int stat(const char *n, struct stat *st) { 270: f3 0f 1e fb endbr32 274: 55 push %ebp 275: 89 e5 mov %esp,%ebp 277: 56 push %esi 278: 53 push %ebx int fd; int r; fd = open(n, O_RDONLY); 279: 83 ec 08 sub $0x8,%esp 27c: 6a 00 push $0x0 27e: ff 75 08 pushl 0x8(%ebp) 281: e8 ed 00 00 00 call 373 <open> if(fd < 0) 286: 83 c4 10 add $0x10,%esp 289: 85 c0 test %eax,%eax 28b: 78 2b js 2b8 <stat+0x48> return -1; r = fstat(fd, st); 28d: 83 ec 08 sub $0x8,%esp 290: ff 75 0c pushl 0xc(%ebp) 293: 89 c3 mov %eax,%ebx 295: 50 push %eax 296: e8 f0 00 00 00 call 38b <fstat> close(fd); 29b: 89 1c 24 mov %ebx,(%esp) r = fstat(fd, st); 29e: 89 c6 mov %eax,%esi close(fd); 2a0: e8 b6 00 00 00 call 35b <close> return r; 2a5: 83 c4 10 add $0x10,%esp } 2a8: 8d 65 f8 lea -0x8(%ebp),%esp 2ab: 89 f0 mov %esi,%eax 2ad: 5b pop %ebx 2ae: 5e pop %esi 2af: 5d pop %ebp 2b0: c3 ret 2b1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 2b8: be ff ff ff ff mov $0xffffffff,%esi 2bd: eb e9 jmp 2a8 <stat+0x38> 2bf: 90 nop 000002c0 <atoi>: int atoi(const char *s) { 2c0: f3 0f 1e fb endbr32 2c4: 55 push %ebp 2c5: 89 e5 mov %esp,%ebp 2c7: 53 push %ebx 2c8: 8b 55 08 mov 0x8(%ebp),%edx int n; n = 0; while('0' <= *s && *s <= '9') 2cb: 0f be 02 movsbl (%edx),%eax 2ce: 8d 48 d0 lea -0x30(%eax),%ecx 2d1: 80 f9 09 cmp $0x9,%cl n = 0; 2d4: b9 00 00 00 00 mov $0x0,%ecx while('0' <= *s && *s <= '9') 2d9: 77 1a ja 2f5 <atoi+0x35> 2db: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 2df: 90 nop n = n*10 + *s++ - '0'; 2e0: 83 c2 01 add $0x1,%edx 2e3: 8d 0c 89 lea (%ecx,%ecx,4),%ecx 2e6: 8d 4c 48 d0 lea -0x30(%eax,%ecx,2),%ecx while('0' <= *s && *s <= '9') 2ea: 0f be 02 movsbl (%edx),%eax 2ed: 8d 58 d0 lea -0x30(%eax),%ebx 2f0: 80 fb 09 cmp $0x9,%bl 2f3: 76 eb jbe 2e0 <atoi+0x20> return n; } 2f5: 89 c8 mov %ecx,%eax 2f7: 5b pop %ebx 2f8: 5d pop %ebp 2f9: c3 ret 2fa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 00000300 <memmove>: void* memmove(void *vdst, const void *vsrc, int n) { 300: f3 0f 1e fb endbr32 304: 55 push %ebp 305: 89 e5 mov %esp,%ebp 307: 57 push %edi 308: 8b 45 10 mov 0x10(%ebp),%eax 30b: 8b 55 08 mov 0x8(%ebp),%edx 30e: 56 push %esi 30f: 8b 75 0c mov 0xc(%ebp),%esi char *dst; const char *src; dst = vdst; src = vsrc; while(n-- > 0) 312: 85 c0 test %eax,%eax 314: 7e 0f jle 325 <memmove+0x25> 316: 01 d0 add %edx,%eax dst = vdst; 318: 89 d7 mov %edx,%edi 31a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi *dst++ = *src++; 320: a4 movsb %ds:(%esi),%es:(%edi) while(n-- > 0) 321: 39 f8 cmp %edi,%eax 323: 75 fb jne 320 <memmove+0x20> return vdst; } 325: 5e pop %esi 326: 89 d0 mov %edx,%eax 328: 5f pop %edi 329: 5d pop %ebp 32a: c3 ret 0000032b <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) 32b: b8 01 00 00 00 mov $0x1,%eax 330: cd 40 int $0x40 332: c3 ret 00000333 <exit>: SYSCALL(exit) 333: b8 02 00 00 00 mov $0x2,%eax 338: cd 40 int $0x40 33a: c3 ret 0000033b <wait>: SYSCALL(wait) 33b: b8 03 00 00 00 mov $0x3,%eax 340: cd 40 int $0x40 342: c3 ret 00000343 <pipe>: SYSCALL(pipe) 343: b8 04 00 00 00 mov $0x4,%eax 348: cd 40 int $0x40 34a: c3 ret 0000034b <read>: SYSCALL(read) 34b: b8 05 00 00 00 mov $0x5,%eax 350: cd 40 int $0x40 352: c3 ret 00000353 <write>: SYSCALL(write) 353: b8 10 00 00 00 mov $0x10,%eax 358: cd 40 int $0x40 35a: c3 ret 0000035b <close>: SYSCALL(close) 35b: b8 15 00 00 00 mov $0x15,%eax 360: cd 40 int $0x40 362: c3 ret 00000363 <kill>: SYSCALL(kill) 363: b8 06 00 00 00 mov $0x6,%eax 368: cd 40 int $0x40 36a: c3 ret 0000036b <exec>: SYSCALL(exec) 36b: b8 07 00 00 00 mov $0x7,%eax 370: cd 40 int $0x40 372: c3 ret 00000373 <open>: SYSCALL(open) 373: b8 0f 00 00 00 mov $0xf,%eax 378: cd 40 int $0x40 37a: c3 ret 0000037b <mknod>: SYSCALL(mknod) 37b: b8 11 00 00 00 mov $0x11,%eax 380: cd 40 int $0x40 382: c3 ret 00000383 <unlink>: SYSCALL(unlink) 383: b8 12 00 00 00 mov $0x12,%eax 388: cd 40 int $0x40 38a: c3 ret 0000038b <fstat>: SYSCALL(fstat) 38b: b8 08 00 00 00 mov $0x8,%eax 390: cd 40 int $0x40 392: c3 ret 00000393 <link>: SYSCALL(link) 393: b8 13 00 00 00 mov $0x13,%eax 398: cd 40 int $0x40 39a: c3 ret 0000039b <mkdir>: SYSCALL(mkdir) 39b: b8 14 00 00 00 mov $0x14,%eax 3a0: cd 40 int $0x40 3a2: c3 ret 000003a3 <chdir>: SYSCALL(chdir) 3a3: b8 09 00 00 00 mov $0x9,%eax 3a8: cd 40 int $0x40 3aa: c3 ret 000003ab <dup>: SYSCALL(dup) 3ab: b8 0a 00 00 00 mov $0xa,%eax 3b0: cd 40 int $0x40 3b2: c3 ret 000003b3 <getpid>: SYSCALL(getpid) 3b3: b8 0b 00 00 00 mov $0xb,%eax 3b8: cd 40 int $0x40 3ba: c3 ret 000003bb <sbrk>: SYSCALL(sbrk) 3bb: b8 0c 00 00 00 mov $0xc,%eax 3c0: cd 40 int $0x40 3c2: c3 ret 000003c3 <sleep>: SYSCALL(sleep) 3c3: b8 0d 00 00 00 mov $0xd,%eax 3c8: cd 40 int $0x40 3ca: c3 ret 000003cb <uptime>: SYSCALL(uptime) 3cb: b8 0e 00 00 00 mov $0xe,%eax 3d0: cd 40 int $0x40 3d2: c3 ret 000003d3 <waitx>: SYSCALL(waitx) 3d3: b8 16 00 00 00 mov $0x16,%eax 3d8: cd 40 int $0x40 3da: c3 ret 000003db <set_priority>: SYSCALL(set_priority) 3db: b8 17 00 00 00 mov $0x17,%eax 3e0: cd 40 int $0x40 3e2: c3 ret 000003e3 <ps>: 3e3: b8 18 00 00 00 mov $0x18,%eax 3e8: cd 40 int $0x40 3ea: c3 ret 3eb: 66 90 xchg %ax,%ax 3ed: 66 90 xchg %ax,%ax 3ef: 90 nop 000003f0 <printint>: write(fd, &c, 1); } static void printint(int fd, int xx, int base, int sgn) { 3f0: 55 push %ebp 3f1: 89 e5 mov %esp,%ebp 3f3: 57 push %edi 3f4: 56 push %esi 3f5: 53 push %ebx 3f6: 83 ec 3c sub $0x3c,%esp 3f9: 89 4d c4 mov %ecx,-0x3c(%ebp) uint x; neg = 0; if(sgn && xx < 0){ neg = 1; x = -xx; 3fc: 89 d1 mov %edx,%ecx { 3fe: 89 45 b8 mov %eax,-0x48(%ebp) if(sgn && xx < 0){ 401: 85 d2 test %edx,%edx 403: 0f 89 7f 00 00 00 jns 488 <printint+0x98> 409: f6 45 08 01 testb $0x1,0x8(%ebp) 40d: 74 79 je 488 <printint+0x98> neg = 1; 40f: c7 45 bc 01 00 00 00 movl $0x1,-0x44(%ebp) x = -xx; 416: f7 d9 neg %ecx } else { x = xx; } i = 0; 418: 31 db xor %ebx,%ebx 41a: 8d 75 d7 lea -0x29(%ebp),%esi 41d: 8d 76 00 lea 0x0(%esi),%esi do{ buf[i++] = digits[x % base]; 420: 89 c8 mov %ecx,%eax 422: 31 d2 xor %edx,%edx 424: 89 cf mov %ecx,%edi 426: f7 75 c4 divl -0x3c(%ebp) 429: 0f b6 92 c0 08 00 00 movzbl 0x8c0(%edx),%edx 430: 89 45 c0 mov %eax,-0x40(%ebp) 433: 89 d8 mov %ebx,%eax 435: 8d 5b 01 lea 0x1(%ebx),%ebx }while((x /= base) != 0); 438: 8b 4d c0 mov -0x40(%ebp),%ecx buf[i++] = digits[x % base]; 43b: 88 14 1e mov %dl,(%esi,%ebx,1) }while((x /= base) != 0); 43e: 39 7d c4 cmp %edi,-0x3c(%ebp) 441: 76 dd jbe 420 <printint+0x30> if(neg) 443: 8b 4d bc mov -0x44(%ebp),%ecx 446: 85 c9 test %ecx,%ecx 448: 74 0c je 456 <printint+0x66> buf[i++] = '-'; 44a: c6 44 1d d8 2d movb $0x2d,-0x28(%ebp,%ebx,1) buf[i++] = digits[x % base]; 44f: 89 d8 mov %ebx,%eax buf[i++] = '-'; 451: ba 2d 00 00 00 mov $0x2d,%edx while(--i >= 0) 456: 8b 7d b8 mov -0x48(%ebp),%edi 459: 8d 5c 05 d7 lea -0x29(%ebp,%eax,1),%ebx 45d: eb 07 jmp 466 <printint+0x76> 45f: 90 nop 460: 0f b6 13 movzbl (%ebx),%edx 463: 83 eb 01 sub $0x1,%ebx write(fd, &c, 1); 466: 83 ec 04 sub $0x4,%esp 469: 88 55 d7 mov %dl,-0x29(%ebp) 46c: 6a 01 push $0x1 46e: 56 push %esi 46f: 57 push %edi 470: e8 de fe ff ff call 353 <write> while(--i >= 0) 475: 83 c4 10 add $0x10,%esp 478: 39 de cmp %ebx,%esi 47a: 75 e4 jne 460 <printint+0x70> putc(fd, buf[i]); } 47c: 8d 65 f4 lea -0xc(%ebp),%esp 47f: 5b pop %ebx 480: 5e pop %esi 481: 5f pop %edi 482: 5d pop %ebp 483: c3 ret 484: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi neg = 0; 488: c7 45 bc 00 00 00 00 movl $0x0,-0x44(%ebp) 48f: eb 87 jmp 418 <printint+0x28> 491: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 498: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 49f: 90 nop 000004a0 <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, const char *fmt, ...) { 4a0: f3 0f 1e fb endbr32 4a4: 55 push %ebp 4a5: 89 e5 mov %esp,%ebp 4a7: 57 push %edi 4a8: 56 push %esi 4a9: 53 push %ebx 4aa: 83 ec 2c sub $0x2c,%esp int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 4ad: 8b 75 0c mov 0xc(%ebp),%esi 4b0: 0f b6 1e movzbl (%esi),%ebx 4b3: 84 db test %bl,%bl 4b5: 0f 84 b4 00 00 00 je 56f <printf+0xcf> ap = (uint*)(void*)&fmt + 1; 4bb: 8d 45 10 lea 0x10(%ebp),%eax 4be: 83 c6 01 add $0x1,%esi write(fd, &c, 1); 4c1: 8d 7d e7 lea -0x19(%ebp),%edi state = 0; 4c4: 31 d2 xor %edx,%edx ap = (uint*)(void*)&fmt + 1; 4c6: 89 45 d0 mov %eax,-0x30(%ebp) 4c9: eb 33 jmp 4fe <printf+0x5e> 4cb: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 4cf: 90 nop 4d0: 89 55 d4 mov %edx,-0x2c(%ebp) c = fmt[i] & 0xff; if(state == 0){ if(c == '%'){ state = '%'; 4d3: ba 25 00 00 00 mov $0x25,%edx if(c == '%'){ 4d8: 83 f8 25 cmp $0x25,%eax 4db: 74 17 je 4f4 <printf+0x54> write(fd, &c, 1); 4dd: 83 ec 04 sub $0x4,%esp 4e0: 88 5d e7 mov %bl,-0x19(%ebp) 4e3: 6a 01 push $0x1 4e5: 57 push %edi 4e6: ff 75 08 pushl 0x8(%ebp) 4e9: e8 65 fe ff ff call 353 <write> 4ee: 8b 55 d4 mov -0x2c(%ebp),%edx } else { putc(fd, c); 4f1: 83 c4 10 add $0x10,%esp for(i = 0; fmt[i]; i++){ 4f4: 0f b6 1e movzbl (%esi),%ebx 4f7: 83 c6 01 add $0x1,%esi 4fa: 84 db test %bl,%bl 4fc: 74 71 je 56f <printf+0xcf> c = fmt[i] & 0xff; 4fe: 0f be cb movsbl %bl,%ecx 501: 0f b6 c3 movzbl %bl,%eax if(state == 0){ 504: 85 d2 test %edx,%edx 506: 74 c8 je 4d0 <printf+0x30> } } else if(state == '%'){ 508: 83 fa 25 cmp $0x25,%edx 50b: 75 e7 jne 4f4 <printf+0x54> if(c == 'd'){ 50d: 83 f8 64 cmp $0x64,%eax 510: 0f 84 9a 00 00 00 je 5b0 <printf+0x110> printint(fd, *ap, 10, 1); ap++; } else if(c == 'x' || c == 'p'){ 516: 81 e1 f7 00 00 00 and $0xf7,%ecx 51c: 83 f9 70 cmp $0x70,%ecx 51f: 74 5f je 580 <printf+0xe0> printint(fd, *ap, 16, 0); ap++; } else if(c == 's'){ 521: 83 f8 73 cmp $0x73,%eax 524: 0f 84 d6 00 00 00 je 600 <printf+0x160> s = "(null)"; while(*s != 0){ putc(fd, *s); s++; } } else if(c == 'c'){ 52a: 83 f8 63 cmp $0x63,%eax 52d: 0f 84 8d 00 00 00 je 5c0 <printf+0x120> putc(fd, *ap); ap++; } else if(c == '%'){ 533: 83 f8 25 cmp $0x25,%eax 536: 0f 84 b4 00 00 00 je 5f0 <printf+0x150> write(fd, &c, 1); 53c: 83 ec 04 sub $0x4,%esp 53f: c6 45 e7 25 movb $0x25,-0x19(%ebp) 543: 6a 01 push $0x1 545: 57 push %edi 546: ff 75 08 pushl 0x8(%ebp) 549: e8 05 fe ff ff call 353 <write> putc(fd, c); } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); putc(fd, c); 54e: 88 5d e7 mov %bl,-0x19(%ebp) write(fd, &c, 1); 551: 83 c4 0c add $0xc,%esp 554: 6a 01 push $0x1 556: 83 c6 01 add $0x1,%esi 559: 57 push %edi 55a: ff 75 08 pushl 0x8(%ebp) 55d: e8 f1 fd ff ff call 353 <write> for(i = 0; fmt[i]; i++){ 562: 0f b6 5e ff movzbl -0x1(%esi),%ebx putc(fd, c); 566: 83 c4 10 add $0x10,%esp } state = 0; 569: 31 d2 xor %edx,%edx for(i = 0; fmt[i]; i++){ 56b: 84 db test %bl,%bl 56d: 75 8f jne 4fe <printf+0x5e> } } } 56f: 8d 65 f4 lea -0xc(%ebp),%esp 572: 5b pop %ebx 573: 5e pop %esi 574: 5f pop %edi 575: 5d pop %ebp 576: c3 ret 577: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 57e: 66 90 xchg %ax,%ax printint(fd, *ap, 16, 0); 580: 83 ec 0c sub $0xc,%esp 583: b9 10 00 00 00 mov $0x10,%ecx 588: 6a 00 push $0x0 58a: 8b 5d d0 mov -0x30(%ebp),%ebx 58d: 8b 45 08 mov 0x8(%ebp),%eax 590: 8b 13 mov (%ebx),%edx 592: e8 59 fe ff ff call 3f0 <printint> ap++; 597: 89 d8 mov %ebx,%eax 599: 83 c4 10 add $0x10,%esp state = 0; 59c: 31 d2 xor %edx,%edx ap++; 59e: 83 c0 04 add $0x4,%eax 5a1: 89 45 d0 mov %eax,-0x30(%ebp) 5a4: e9 4b ff ff ff jmp 4f4 <printf+0x54> 5a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi printint(fd, *ap, 10, 1); 5b0: 83 ec 0c sub $0xc,%esp 5b3: b9 0a 00 00 00 mov $0xa,%ecx 5b8: 6a 01 push $0x1 5ba: eb ce jmp 58a <printf+0xea> 5bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi putc(fd, *ap); 5c0: 8b 5d d0 mov -0x30(%ebp),%ebx write(fd, &c, 1); 5c3: 83 ec 04 sub $0x4,%esp putc(fd, *ap); 5c6: 8b 03 mov (%ebx),%eax write(fd, &c, 1); 5c8: 6a 01 push $0x1 ap++; 5ca: 83 c3 04 add $0x4,%ebx write(fd, &c, 1); 5cd: 57 push %edi 5ce: ff 75 08 pushl 0x8(%ebp) putc(fd, *ap); 5d1: 88 45 e7 mov %al,-0x19(%ebp) write(fd, &c, 1); 5d4: e8 7a fd ff ff call 353 <write> ap++; 5d9: 89 5d d0 mov %ebx,-0x30(%ebp) 5dc: 83 c4 10 add $0x10,%esp state = 0; 5df: 31 d2 xor %edx,%edx 5e1: e9 0e ff ff ff jmp 4f4 <printf+0x54> 5e6: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 5ed: 8d 76 00 lea 0x0(%esi),%esi putc(fd, c); 5f0: 88 5d e7 mov %bl,-0x19(%ebp) write(fd, &c, 1); 5f3: 83 ec 04 sub $0x4,%esp 5f6: e9 59 ff ff ff jmp 554 <printf+0xb4> 5fb: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 5ff: 90 nop s = (char*)*ap; 600: 8b 45 d0 mov -0x30(%ebp),%eax 603: 8b 18 mov (%eax),%ebx ap++; 605: 83 c0 04 add $0x4,%eax 608: 89 45 d0 mov %eax,-0x30(%ebp) if(s == 0) 60b: 85 db test %ebx,%ebx 60d: 74 17 je 626 <printf+0x186> while(*s != 0){ 60f: 0f b6 03 movzbl (%ebx),%eax state = 0; 612: 31 d2 xor %edx,%edx while(*s != 0){ 614: 84 c0 test %al,%al 616: 0f 84 d8 fe ff ff je 4f4 <printf+0x54> 61c: 89 75 d4 mov %esi,-0x2c(%ebp) 61f: 89 de mov %ebx,%esi 621: 8b 5d 08 mov 0x8(%ebp),%ebx 624: eb 1a jmp 640 <printf+0x1a0> s = "(null)"; 626: bb b9 08 00 00 mov $0x8b9,%ebx while(*s != 0){ 62b: 89 75 d4 mov %esi,-0x2c(%ebp) 62e: b8 28 00 00 00 mov $0x28,%eax 633: 89 de mov %ebx,%esi 635: 8b 5d 08 mov 0x8(%ebp),%ebx 638: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 63f: 90 nop write(fd, &c, 1); 640: 83 ec 04 sub $0x4,%esp s++; 643: 83 c6 01 add $0x1,%esi 646: 88 45 e7 mov %al,-0x19(%ebp) write(fd, &c, 1); 649: 6a 01 push $0x1 64b: 57 push %edi 64c: 53 push %ebx 64d: e8 01 fd ff ff call 353 <write> while(*s != 0){ 652: 0f b6 06 movzbl (%esi),%eax 655: 83 c4 10 add $0x10,%esp 658: 84 c0 test %al,%al 65a: 75 e4 jne 640 <printf+0x1a0> 65c: 8b 75 d4 mov -0x2c(%ebp),%esi state = 0; 65f: 31 d2 xor %edx,%edx 661: e9 8e fe ff ff jmp 4f4 <printf+0x54> 666: 66 90 xchg %ax,%ax 668: 66 90 xchg %ax,%ax 66a: 66 90 xchg %ax,%ax 66c: 66 90 xchg %ax,%ax 66e: 66 90 xchg %ax,%ax 00000670 <free>: static Header base; static Header *freep; void free(void *ap) { 670: f3 0f 1e fb endbr32 674: 55 push %ebp Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 675: a1 70 0b 00 00 mov 0xb70,%eax { 67a: 89 e5 mov %esp,%ebp 67c: 57 push %edi 67d: 56 push %esi 67e: 53 push %ebx 67f: 8b 5d 08 mov 0x8(%ebp),%ebx 682: 8b 10 mov (%eax),%edx bp = (Header*)ap - 1; 684: 8d 4b f8 lea -0x8(%ebx),%ecx for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 687: 39 c8 cmp %ecx,%eax 689: 73 15 jae 6a0 <free+0x30> 68b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 68f: 90 nop 690: 39 d1 cmp %edx,%ecx 692: 72 14 jb 6a8 <free+0x38> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 694: 39 d0 cmp %edx,%eax 696: 73 10 jae 6a8 <free+0x38> { 698: 89 d0 mov %edx,%eax for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 69a: 8b 10 mov (%eax),%edx 69c: 39 c8 cmp %ecx,%eax 69e: 72 f0 jb 690 <free+0x20> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 6a0: 39 d0 cmp %edx,%eax 6a2: 72 f4 jb 698 <free+0x28> 6a4: 39 d1 cmp %edx,%ecx 6a6: 73 f0 jae 698 <free+0x28> break; if(bp + bp->s.size == p->s.ptr){ 6a8: 8b 73 fc mov -0x4(%ebx),%esi 6ab: 8d 3c f1 lea (%ecx,%esi,8),%edi 6ae: 39 fa cmp %edi,%edx 6b0: 74 1e je 6d0 <free+0x60> bp->s.size += p->s.ptr->s.size; bp->s.ptr = p->s.ptr->s.ptr; } else bp->s.ptr = p->s.ptr; 6b2: 89 53 f8 mov %edx,-0x8(%ebx) if(p + p->s.size == bp){ 6b5: 8b 50 04 mov 0x4(%eax),%edx 6b8: 8d 34 d0 lea (%eax,%edx,8),%esi 6bb: 39 f1 cmp %esi,%ecx 6bd: 74 28 je 6e7 <free+0x77> p->s.size += bp->s.size; p->s.ptr = bp->s.ptr; } else p->s.ptr = bp; 6bf: 89 08 mov %ecx,(%eax) freep = p; } 6c1: 5b pop %ebx freep = p; 6c2: a3 70 0b 00 00 mov %eax,0xb70 } 6c7: 5e pop %esi 6c8: 5f pop %edi 6c9: 5d pop %ebp 6ca: c3 ret 6cb: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 6cf: 90 nop bp->s.size += p->s.ptr->s.size; 6d0: 03 72 04 add 0x4(%edx),%esi 6d3: 89 73 fc mov %esi,-0x4(%ebx) bp->s.ptr = p->s.ptr->s.ptr; 6d6: 8b 10 mov (%eax),%edx 6d8: 8b 12 mov (%edx),%edx 6da: 89 53 f8 mov %edx,-0x8(%ebx) if(p + p->s.size == bp){ 6dd: 8b 50 04 mov 0x4(%eax),%edx 6e0: 8d 34 d0 lea (%eax,%edx,8),%esi 6e3: 39 f1 cmp %esi,%ecx 6e5: 75 d8 jne 6bf <free+0x4f> p->s.size += bp->s.size; 6e7: 03 53 fc add -0x4(%ebx),%edx freep = p; 6ea: a3 70 0b 00 00 mov %eax,0xb70 p->s.size += bp->s.size; 6ef: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; 6f2: 8b 53 f8 mov -0x8(%ebx),%edx 6f5: 89 10 mov %edx,(%eax) } 6f7: 5b pop %ebx 6f8: 5e pop %esi 6f9: 5f pop %edi 6fa: 5d pop %ebp 6fb: c3 ret 6fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 00000700 <malloc>: return freep; } void* malloc(uint nbytes) { 700: f3 0f 1e fb endbr32 704: 55 push %ebp 705: 89 e5 mov %esp,%ebp 707: 57 push %edi 708: 56 push %esi 709: 53 push %ebx 70a: 83 ec 1c sub $0x1c,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 70d: 8b 45 08 mov 0x8(%ebp),%eax if((prevp = freep) == 0){ 710: 8b 3d 70 0b 00 00 mov 0xb70,%edi nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 716: 8d 70 07 lea 0x7(%eax),%esi 719: c1 ee 03 shr $0x3,%esi 71c: 83 c6 01 add $0x1,%esi if((prevp = freep) == 0){ 71f: 85 ff test %edi,%edi 721: 0f 84 a9 00 00 00 je 7d0 <malloc+0xd0> base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 727: 8b 07 mov (%edi),%eax if(p->s.size >= nunits){ 729: 8b 48 04 mov 0x4(%eax),%ecx 72c: 39 f1 cmp %esi,%ecx 72e: 73 6d jae 79d <malloc+0x9d> 730: 81 fe 00 10 00 00 cmp $0x1000,%esi 736: bb 00 10 00 00 mov $0x1000,%ebx 73b: 0f 43 de cmovae %esi,%ebx p = sbrk(nu * sizeof(Header)); 73e: 8d 0c dd 00 00 00 00 lea 0x0(,%ebx,8),%ecx 745: 89 4d e4 mov %ecx,-0x1c(%ebp) 748: eb 17 jmp 761 <malloc+0x61> 74a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 750: 8b 10 mov (%eax),%edx if(p->s.size >= nunits){ 752: 8b 4a 04 mov 0x4(%edx),%ecx 755: 39 f1 cmp %esi,%ecx 757: 73 4f jae 7a8 <malloc+0xa8> 759: 8b 3d 70 0b 00 00 mov 0xb70,%edi 75f: 89 d0 mov %edx,%eax p->s.size = nunits; } freep = prevp; return (void*)(p + 1); } if(p == freep) 761: 39 c7 cmp %eax,%edi 763: 75 eb jne 750 <malloc+0x50> p = sbrk(nu * sizeof(Header)); 765: 83 ec 0c sub $0xc,%esp 768: ff 75 e4 pushl -0x1c(%ebp) 76b: e8 4b fc ff ff call 3bb <sbrk> if(p == (char*)-1) 770: 83 c4 10 add $0x10,%esp 773: 83 f8 ff cmp $0xffffffff,%eax 776: 74 1b je 793 <malloc+0x93> hp->s.size = nu; 778: 89 58 04 mov %ebx,0x4(%eax) free((void*)(hp + 1)); 77b: 83 ec 0c sub $0xc,%esp 77e: 83 c0 08 add $0x8,%eax 781: 50 push %eax 782: e8 e9 fe ff ff call 670 <free> return freep; 787: a1 70 0b 00 00 mov 0xb70,%eax if((p = morecore(nunits)) == 0) 78c: 83 c4 10 add $0x10,%esp 78f: 85 c0 test %eax,%eax 791: 75 bd jne 750 <malloc+0x50> return 0; } } 793: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 796: 31 c0 xor %eax,%eax } 798: 5b pop %ebx 799: 5e pop %esi 79a: 5f pop %edi 79b: 5d pop %ebp 79c: c3 ret if(p->s.size >= nunits){ 79d: 89 c2 mov %eax,%edx 79f: 89 f8 mov %edi,%eax 7a1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(p->s.size == nunits) 7a8: 39 ce cmp %ecx,%esi 7aa: 74 54 je 800 <malloc+0x100> p->s.size -= nunits; 7ac: 29 f1 sub %esi,%ecx 7ae: 89 4a 04 mov %ecx,0x4(%edx) p += p->s.size; 7b1: 8d 14 ca lea (%edx,%ecx,8),%edx p->s.size = nunits; 7b4: 89 72 04 mov %esi,0x4(%edx) freep = prevp; 7b7: a3 70 0b 00 00 mov %eax,0xb70 } 7bc: 8d 65 f4 lea -0xc(%ebp),%esp return (void*)(p + 1); 7bf: 8d 42 08 lea 0x8(%edx),%eax } 7c2: 5b pop %ebx 7c3: 5e pop %esi 7c4: 5f pop %edi 7c5: 5d pop %ebp 7c6: c3 ret 7c7: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 7ce: 66 90 xchg %ax,%ax base.s.ptr = freep = prevp = &base; 7d0: c7 05 70 0b 00 00 74 movl $0xb74,0xb70 7d7: 0b 00 00 base.s.size = 0; 7da: bf 74 0b 00 00 mov $0xb74,%edi base.s.ptr = freep = prevp = &base; 7df: c7 05 74 0b 00 00 74 movl $0xb74,0xb74 7e6: 0b 00 00 for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 7e9: 89 f8 mov %edi,%eax base.s.size = 0; 7eb: c7 05 78 0b 00 00 00 movl $0x0,0xb78 7f2: 00 00 00 if(p->s.size >= nunits){ 7f5: e9 36 ff ff ff jmp 730 <malloc+0x30> 7fa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi prevp->s.ptr = p->s.ptr; 800: 8b 0a mov (%edx),%ecx 802: 89 08 mov %ecx,(%eax) 804: eb b1 jmp 7b7 <malloc+0xb7>
org 100h include "emu8086.inc" MOV DX, OFFSET MAIN MOV AH, 9 INT 21H MOV DX, OFFSET MESSAGE MOV AH, 9 INT 21H CALL scan_num MOV AX, CX CALL pthis db 13,10, "THE CUBE IS = ", 0 CALL CUBE MUL CX CALL PRINT_NUM ret B DW 0 MAIN db "CALCULATES THE CUBE USING PROCEDURES. $" MESSAGE db 13,10, "THE NUMBER TO CUBE: $" DEFINE_PTHIS DEFINE_SCAN_NUM DEFINE_PRINT_NUM DEFINE_PRINT_NUM_UNS CUBE PROC MUL AX RET ENDP END
#include "benchmark/benchmark.h" #include "c4/log.hpp" #include "c4/allocator.hpp" #include "../list_types.hpp" namespace bm = benchmark; namespace c4 { template< class List > void BM_ListPushBack(bm::State& st) { List li; using T = typename List::value_type; T v{}; size_t count = 0; while(st.KeepRunning()) { for(int i = 0, e = st.range(0); i < e; ++i) { if(li.size() == li.max_size()) li.clear(); li.push_back(v); ++count; } li.clear(); } st.SetComplexityN(st.range(0)); st.SetItemsProcessed(count); st.SetBytesProcessed(count * sizeof(T)); } BENCHMARK_TEMPLATE(BM_ListPushBack, flat_list__raw< NumBytes<4096> C4_COMMA int64_t >) ->RangeMultiplier(2) ->Range(4, 1<<19) ->Complexity(); } // end namespace c4 BENCHMARK_MAIN()
_TEXT SEGMENT call_on_stack__asm PROC ; https://docs.microsoft.com/en-us/cpp/build/x64-calling-convention ; https://docs.microsoft.com/en-us/cpp/build/stack-usage ; enter mov QWORD PTR [rsp+24], r8 mov QWORD PTR [rsp+16], rdx mov QWORD PTR [rsp+8], rcx ; backup callee saved registers push rsi push rdi ; backup stack mov rsi, rsp mov rdi, rbp ; switch stack mov rsp, rcx mov rbp, rsp ; Accroding to https://docs.microsoft.com/en-us/cpp/build/stack-usage#stack-allocation, ; there is a `register parameter stack area` at the bottom of stack frame. ; To simulate it, we leave 40 bytes empty space on this stack. sub rsp, 40 mov rcx, r8 call rdx add rsp, 40 ; restore stack mov rsp, rsi mov rbp, rdi ; restore callee saved registers pop rdi pop rsi ; leave ret call_on_stack__asm ENDP _TEXT ENDS END
/*** * * Copyright (c) 1996-2001, Valve LLC. All rights reserved. * * This product contains software technology licensed from Id * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. * All Rights Reserved. * * Use, distribution, and modification of this source code and/or resulting * object code is restricted to non-commercial enhancements to products from * Valve LLC. All other use, distribution, or modification is prohibited * without written permission from Valve LLC. * ****/ #include "extdll.h" #include "util.h" #include "cbase.h" #include "player.h" #include "weapons.h" #include "gamerules.h" #include "UserMessages.h" #include "CSniperRifle.h" #ifndef CLIENT_DLL TYPEDESCRIPTION CSniperRifle::m_SaveData[] = { DEFINE_FIELD(CSniperRifle, m_flReloadStart, FIELD_TIME), DEFINE_FIELD(CSniperRifle, m_bReloading, FIELD_BOOLEAN), }; IMPLEMENT_SAVERESTORE(CSniperRifle, CSniperRifle::BaseClass); #endif LINK_ENTITY_TO_CLASS(weapon_sniperrifle, CSniperRifle); void CSniperRifle::Precache() { pev->classname = MAKE_STRING("weapon_sniperrifle"); BaseClass::Precache(); m_iId = WEAPON_SNIPERRIFLE; PRECACHE_MODEL("models/w_m40a1.mdl"); PRECACHE_MODEL("models/v_m40a1.mdl"); PRECACHE_MODEL("models/p_m40a1.mdl"); PRECACHE_SOUND("weapons/sniper_fire.wav"); PRECACHE_SOUND("weapons/sniper_zoom.wav"); PRECACHE_SOUND("weapons/sniper_reload_first_seq.wav"); PRECACHE_SOUND("weapons/sniper_reload_second_seq.wav"); PRECACHE_SOUND("weapons/sniper_miss.wav"); PRECACHE_SOUND("weapons/sniper_bolt1.wav"); PRECACHE_SOUND("weapons/sniper_bolt2.wav"); m_usSniper = PRECACHE_EVENT(1, "events/sniper.sc"); } void CSniperRifle::Spawn() { Precache(); SET_MODEL(edict(), "models/w_m40a1.mdl"); m_iDefaultAmmo = SNIPERRIFLE_DEFAULT_GIVE; FallInit(); // get ready to fall down. } bool CSniperRifle::Deploy() { return BaseClass::DefaultDeploy("models/v_m40a1.mdl", "models/p_m40a1.mdl", SNIPERRIFLE_DRAW, "bow"); } void CSniperRifle::Holster() { m_fInReload = false; // cancel any reload in progress. if (m_pPlayer->m_iFOV != 0) { SecondaryAttack(); } m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.25; SendWeaponAnim(SNIPERRIFLE_HOLSTER); } void CSniperRifle::WeaponIdle() { //Update autoaim m_pPlayer->GetAutoaimVector(AUTOAIM_2DEGREES); ResetEmptySound(); if (m_bReloading && gpGlobals->time >= m_flReloadStart + 2.324) { SendWeaponAnim(SNIPERRIFLE_RELOAD2); m_bReloading = false; } if (m_flTimeWeaponIdle < UTIL_WeaponTimeBase()) { if (0 != m_iClip) SendWeaponAnim(SNIPERRIFLE_SLOWIDLE); else SendWeaponAnim(SNIPERRIFLE_SLOWIDLE2); m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 4.348; } } void CSniperRifle::PrimaryAttack() { if (m_pPlayer->pev->waterlevel == WATERLEVEL_HEAD) { PlayEmptySound(); m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 1.0f; return; } if (0 == m_iClip) { PlayEmptySound(); return; } m_pPlayer->m_iWeaponVolume = QUIET_GUN_VOLUME; --m_iClip; m_pPlayer->SetAnimation(PLAYER_ATTACK1); Vector vecAngles = m_pPlayer->pev->v_angle + m_pPlayer->pev->punchangle; UTIL_MakeVectors(vecAngles); Vector vecSrc = m_pPlayer->GetGunPosition(); Vector vecAiming = m_pPlayer->GetAutoaimVector(AUTOAIM_2DEGREES); //TODO: 8192 constant should be defined somewhere - Solokiller Vector vecShot = m_pPlayer->FireBulletsPlayer(1, vecSrc, vecAiming, g_vecZero, 8192, BULLET_PLAYER_762, 0, 0, m_pPlayer->pev, m_pPlayer->random_seed); PLAYBACK_EVENT_FULL(UTIL_DefaultPlaybackFlags(), m_pPlayer->edict(), m_usSniper, 0, g_vecZero, g_vecZero, vecShot.x, vecShot.y, m_iClip, m_pPlayer->m_rgAmmo[PrimaryAmmoIndex()], 0, 0); m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 2.0f; m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.0f; } void CSniperRifle::SecondaryAttack() { EMIT_SOUND_DYN(m_pPlayer->edict(), CHAN_ITEM, "weapons/sniper_zoom.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM); ToggleZoom(); //TODO: this doesn't really make sense pev->nextthink = 0.1; m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.5; } void CSniperRifle::Reload() { if (m_pPlayer->ammo_762 > 0) { if (m_pPlayer->m_iFOV != 0) { ToggleZoom(); } if (0 != m_iClip) { if (DefaultReload(SNIPERRIFLE_MAX_CLIP, SNIPERRIFLE_RELOAD3, 2.324)) { m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 2.324; } } else if (DefaultReload(SNIPERRIFLE_MAX_CLIP, SNIPERRIFLE_RELOAD1, 2.324)) { m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 4.102; m_flReloadStart = gpGlobals->time; m_bReloading = true; } else { m_bReloading = false; } } m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 4.102; } int CSniperRifle::iItemSlot() { return 4; } bool CSniperRifle::GetItemInfo(ItemInfo* p) { p->pszAmmo1 = "762"; p->iMaxAmmo1 = SNIPERRIFLE_MAX_CARRY; p->pszName = STRING(pev->classname); p->pszAmmo2 = 0; p->iMaxAmmo2 = WEAPON_NOCLIP; p->iMaxClip = SNIPERRIFLE_MAX_CLIP; p->iSlot = 5; p->iPosition = 2; p->iFlags = 0; p->iId = m_iId = WEAPON_SNIPERRIFLE; p->iWeight = SNIPERRIFLE_WEIGHT; return true; } void CSniperRifle::IncrementAmmo(CBasePlayer* pPlayer) { if (pPlayer->GiveAmmo(1, "762", SNIPERRIFLE_MAX_CARRY) >= 0) { EMIT_SOUND(pPlayer->edict(), CHAN_STATIC, "ctf/pow_backpack.wav", 0.5, ATTN_NORM); } } void CSniperRifle::ToggleZoom() { if (m_pPlayer->m_iFOV == 0) { m_pPlayer->m_iFOV = 18; } else { m_pPlayer->m_iFOV = 0; } } class CSniperRifleAmmo : public CBasePlayerAmmo { public: using BaseClass = CBasePlayerAmmo; void Spawn() override { Precache(); SET_MODEL(edict(), "models/w_m40a1clip.mdl"); CBasePlayerAmmo::Spawn(); } void Precache() override { PRECACHE_MODEL("models/w_m40a1clip.mdl"); PRECACHE_SOUND("items/9mmclip1.wav"); } bool AddAmmo(CBaseEntity* pOther) override { if (pOther->GiveAmmo(AMMO_SNIPERRIFLE_GIVE, "762", SNIPERRIFLE_MAX_CARRY) != -1) { EMIT_SOUND(edict(), CHAN_ITEM, "items/9mmclip1.wav", VOL_NORM, ATTN_NORM); return true; } return false; } }; LINK_ENTITY_TO_CLASS(ammo_762, CSniperRifleAmmo);
COMMENT @---------------------------------------------------------------------- Copyright (c) GeoWorks 1988 -- All Rights Reserved PROJECT: PC GEOS MODULE: Desktop/Folder FILE: folderButton.asm AUTHOR: Brian Chin ROUTINES: INT StartFolderObjectIconMove - dragging folder object icon INT LaunchGeoApplication - attempt to launch PC/GEOS application INT BuildOpenFilePathname - build complete pathname of file to open REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 8/29/89 broken out from folderClass.asm ron 9/23/92 added code for run NewDeskBA special shadows DESCRIPTION: This file contains button handling routines for the Folder class. $Id: cfolderButton.asm,v 1.2 98/06/03 13:25:03 joon Exp $ ------------------------------------------------------------------------------@ FolderAction segment resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% StartDragMoveOrCopy %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: CALLED BY: FolderDragSelect PASS: *ds:si - folder object cx, dx - position of mouse click bp low - UIButtonFlags bp high - UIFunctionsActive dgroup variable: [fileDragging] - file drag status RETURN: carry clear if quick-transfer successfully started carry set otherwise DESTROYED: ax,bx,cx,dx,di,bp PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 10/16/89 Initial version brianc 12/8/89 changed from FolderStartDragMoveOrCopy method handler to StartDragMoveOrCopy routine %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ StartDragMoveOrCopy proc near uses si class FolderClass .enter call GetFolderDriverStrategy ; ax:bx = driver strategy ; ; allocate StartQuickTransfer parameter block on stack ; sub sp, size ClipboardQuickTransferRegionInfo ; alloc. params mov bp, sp ; ss:[bp] = params. mov ss:[bp].CQTRI_strategy.high, ax mov ss:[bp].CQTRI_strategy.low, bx mov ss:[bp].CQTRI_region.high, handle DragIconResource call SelectCorrectIconRegion DerefFolderObject ds, si, di mov di, ds:[di].DVI_gState mov ax, cx mov bx, dx call GrTransform ; doc -> screen coords mov cx, ax mov dx, bx sub ax, DRAG_REGION_WIDTH/2 sub bx, DRAG_REGION_HEIGHT/2 mov ss:[bp].CQTRI_regionPos.P_x, ax ; mouse position mov ss:[bp].CQTRI_regionPos.P_y, bx ; ; start the UI part of the quick move/copy ; cx, dx = mouse position in screen coords ; (don't push stuff as StartQuickTransfer takes stuff ; on stack) ; mov di, si ; save instance handle mov bx, handle DragIconResource ; lock icon region resource call MemLock ; to ensure in-memory ; use region and notification mov si, mask CQTF_USE_REGION or mask CQTF_NOTIFICATION mov ax, CQTF_MOVE ; initial cursor mov bx, ds:[LMBH_handle] ; bx:di = notification OD call ClipboardStartQuickTransfer mov bx, handle DragIconResource ; lock icon region resource call MemUnlock ; unlock it (preserves carry) ; restore stack pointer ; (preserves carry) lea sp, ss:[bp]+(size ClipboardQuickTransferRegionInfo) jc done ; q-t already in progress, done mov si, di ; retrieve instance handle DerefFolderObject ds, si, bx ornf ds:[bx].FOI_folderState, mask FOS_FEEDBACK_ON ; ; create and register transfer item ; *ds:si = Folder object ; call GenerateDragFileListItem ; bx:ax = transfer ; (VM file hndl):(VM blk hndl) jc quickTransferError ; error, don't register ; else, register item mov bp, mask CIF_QUICK ; not RAW, QUICK call ClipboardRegisterItem ;no error returned for quick-transfer ; jc quickTransferError ; ; successfully started quick-transfer, now allow mouse to move all ; over the screen ; if _PEN_BASED ; ; for ZMGR's START_SELECT quick-transfer, must maintain grab -- we'll ; only release as we leave the view (DesktopViewClass handles ; RAW_UNIV_LEAVE and RAW_UNIV_ENTER) ; test ss:[fileDragging], mask FDF_SELECT_MOVECOPY jnz startedQT endif mov ax, MSG_GEN_VIEW_ALLOW_GLOBAL_TRANSFER mov di, mask MF_CALL call FolderCallView startedQT:: clc jmp done quickTransferError: ; ; handle error with starting quick-transfer ; call FolderStopQuickTransferFeedback ; stop feedback call ClipboardAbortQuickTransfer ; abort our failed attempt ; (clears cursor, etc.) mov ax, ERROR_INSUFFICIENT_MEMORY ; report error call DesktopOKError stc ; indicate error done: .leave ret StartDragMoveOrCopy endp GetFolderDriverStrategy proc near class FolderClass uses cx, dx, ds, si, bp .enter DerefFolderObject ds, si, bx mov bx, ds:[bx].FOI_windowBlock ; bx:si = GenDisplay mov si, FOLDER_WINDOW_OFFSET mov ax, MSG_VIS_VUP_QUERY mov cx, VUQ_VIDEO_DRIVER call ObjMessageCall ; ax = handle mov bx, ax call GeodeInfoDriver ; ds:[si] = DriverInfoStruct mov ax, ds:[si].DIS_strategy.segment mov bx, ds:[si].DIS_strategy.offset .leave ret GetFolderDriverStrategy endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SelectCorrectIconRegion %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: CALLED BY: PASS: *ds:si - Folder object ss:bp - ClipboardQuickTransferRegionInfo ss:[fileToMoveCopy] - if select list is empty RETURN: ss:[bp].CQTRI_region.low set correclty DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- chrisb 2/11/93 added header %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SelectCorrectIconRegion proc near class FolderClass uses ax, bx, cx, si, di, es .enter call FolderLockBuffer DerefFolderObject ds, si, di mov di, ds:[di].FOI_selectList ; ds:di = head of select list cmp di, NIL ; empty select list? je 30$ ; yes, use saved file push di ; save select list head selectLoop: cmp di, ss:[fileToMoveCopy] ; is it in select list? je 25$ ; yes, use full select list ; (carry clear) mov di, es:[di].FR_selectNext ; get next in select list cmp di, NIL ; end of select list? jne selectLoop ; if not, check next stc ; else, use saved file 25$: pop di ; retrieve select list head jnc 40$ ; if C clear, use select list 30$: mov di, ss:[fileToMoveCopy] ; else, use saved file mov es:[di].FR_selectNext, NIL ; end select list with it 40$: ; ; es:di = start of drag file list ; mov cx, offset multiIconRegion ; assume multi-file cmp es:[di].FR_selectNext, NIL ; only file in select list? jne haveIconRegion ; nope, multi-file mov cx, offset folderIconRegion ; assume single folder test es:[di].FR_fileAttrs, mask FA_SUBDIR jnz haveIconRegion ; yes, single folder mov cx, offset fileIconRegion ; else, single file haveIconRegion: call FolderUnlockBuffer mov ss:[bp].CQTRI_region.low, cx ; save offset to correct icon .leave ret SelectCorrectIconRegion endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GenerateDragFileListItem %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: create transfer item for dragging files around CALLED BY: INTERNAL StartDragMoveOrCopy PASS: *ds:si - FolderClass object ss:[fileDragging] - file drag status RETURN: carry clear if successful bx:ax - transfer VM file and block handle carry set if memory allocation error (no transfer block allocated) DESTROYED: cx, dx, es, di PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 7/13/89 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GenerateDragFileListItem proc near class FolderClass uses bp .enter mov bp, ds:[LMBH_handle] ; our object block handle call FolderLockBuffer stc jz exit call BuildDragFileList ; ax = VM handle of list call FolderUnlockBuffer jc exit ; if memory error, exit push dx ; save remote flag mov dx, bp ; move block handle to dx push cx ; save feedback data push ax ; save VM handle of list mov cx, size ClipboardItemHeader call ClipboardGetClipboardFile ; bx = UI's transfer VM file call VMAlloc ; ax = VM transfer block handle push ax ; save VM block handle call VMLock ; ax = segment, bp = mem handle mov es, ax ; ds = transfer item ; ; set up header of transfer item ; mov es:[CIH_owner].handle, dx mov es:[CIH_owner].chunk, si mov es:[CIH_flags], mask CIF_QUICK mov es:[CIH_sourceID].handle, 0 ; no associated document mov es:[CIH_sourceID].chunk, 0 mov es:[CIH_formatCount], 1 mov es:[CIH_formats][0].CIFI_format.CIFID_manufacturer, \ MANUFACTURER_ID_GEOWORKS mov es:[CIH_formats][0].CIFI_format.CIFID_type, CIF_FILES pop ax ; ax = transfer VM block handle pop es:[CIH_formats][0].CIFI_vmChain.high clr es:[CIH_formats][0].CIFI_vmChain.low pop es:[CIH_formats][0].CIFI_extra1 ; feedback data pop es:[CIH_formats][0].CIFI_extra2 ; remote flag call VMUnlock ; unlock transfer item (pass bp) clc ; indicate no error exit: .leave ret GenerateDragFileListItem endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% BuildDragFileList %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: create list of files to drag for move/copy CALLED BY: INTERNAL GenerateDragFileListItem PASS: *ds:si - FolderClass object es - segment of locked folder buffer (if no file is selected, uses ss:[fileToMoveCopy]) ss:[fileDragging] - file drag status RETURN: carry clear if successful ax - VM handle of file quick transfer block cx - feedbackData (true diskhandle) dx - remote flag carry set if memory allocation error (no transfer block allocated) DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 10/16/89 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ BuildDragFileList proc near class FolderClass uses bx, bp, ds, si, es, di .enter ; ; allocate buffer for file name list (with some initial size) ; push es ; save folder buffer segment mov cx, (INIT_NUM_DRAG_FILES * size FileOperationInfoEntry) + \ size FileQuickTransferHeader push cx ; save size call ClipboardGetClipboardFile ; bx = UI's transfer VM file call VMAlloc ; ax = VM transfer block handle push ax ; save it call VMLock ; ax = segment, bp = mem handle mov bx, bp ; bx = VM mem handle pop bp ; bp = transfer VM blk handle mov es, ax ; es = buffer segment ; ; save pathname of folder containing files in header ; mov ax, ATTR_FOLDER_PATH_DATA mov dx, TEMP_FOLDER_SAVED_DISK_HANDLE mov di, offset FQTH_pathname mov cx, size FQTH_pathname push bx call GenPathGetObjectPath pop bx pop dx ; retrieve size as EOF mov es:[FQTH_diskHandle], cx ; ; init rest of header ; mov es:[FQTH_nextBlock], 0 ; no next block mov es:[FQTH_UIFA], 0 ; no flags yet mov es:[FQTH_numFiles], 0 ; no files yet ; ; go through selected files, adding the name of each to the ; filename buffer. First have to deal with ability to drag file ; that's not selected. fileToMoveCopy is the file/folder clicked on. ; if it's in the select list, we use the whole list. If it's not, ; we use just that file. ; DerefFolderObject ds, si, di mov si, ds:[di].FOI_actualDisk ; save actual disk for later mov di, ds:[di].FOI_selectList ; ds:di = head of select list pop ds ; retrieve folder buffer segment cmp di, NIL ; empty select list? je 30$ ; yes, use saved file push di ; save select list head selectLoop: cmp di, ss:[fileToMoveCopy] ; is it in select list? je 25$ ; yes, use full select list ; (carry clear) mov di, ds:[di].FR_selectNext ; get next in select list cmp di, NIL ; end of select list? jne selectLoop ; if not, check next stc ; else, use saved file 25$: pop di ; retrieve select list head jnc 40$ ; if C clear, use select list 30$: mov di, ss:[fileToMoveCopy] ; else, use saved file mov ds:[di].FR_selectNext, NIL ; end select list with it 40$: push bp ; save VM block handle mov bp, di ; ds:bp = head of select list mov di, size FileQuickTransferHeader ; es:di - skip header call GetFolderBufferNames ; pass: ds:bp, es:di, bx, dx ; ret: cx - number of files ; dx - remote flag ; destroy: bp, di jc error mov es:[FQTH_numFiles], cx ; store number of files mov cx, si ; put true diskhandle in cx error: mov bp, bx ; bp = VM mem handle call VMUnlock ; unlock filename buffer pop ax ; return VM block handle jnc done ; if no error, done call ClipboardGetClipboardFile ; bx = UI's transfer VM file call VMFree ; clean up UI's transfer VM file stc ; indicate error done: .leave ret BuildDragFileList endp FolderAction ends ;----------------------------------------------------------------------------- FolderOpenCode segment resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FileOpenESDI %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: attempt to open file; supports folders, PCGEOS applications, and MS-DOS applications CALLED BY: INTERNAL FolderObjectPress FolderOpenSelectList PASS: es:di - FolderRecord of file to open *ds:si - FolderClass object RETURN: if carry clear and a folder was opened, ^lcx:dx = optr of FolderClass object DESTROYED: ax,bx,bp PSEUDO CODE/STRATEGY: Save the OD of the opened folder or application in the FolderRecord KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 7/13/89 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ FileOpenESDI proc far uses ds, si class FolderClass .enter ; ; XXX: We should change this routine to send a ; MSG_SHELL_OBJECT_OPEN to a dummy with the correct NewDeskObjectType ; if _NEWDESK cmp es:[di].FR_desktopInfo.DI_objectType, WOT_LOGOUT jne notLogout if _NEWDESKBA mov ax, MSG_DESKTOP_CONFIRM_LOGOUT mov bx, handle 0 else mov ax, MSG_META_QUIT mov bx, handle Desktop mov si, offset Desktop endif call ObjMessageForce jmp done notLogout: if not GPC_NO_PRINT cmp es:[di].FR_desktopInfo.DI_objectType, WOT_PRINTER jne notPrinter call NDBringUpPrinterControl jmp done notPrinter: endif endif ; if _NEWDESK ; ; See if the file's a subdirectory. ; test es:[di].FR_fileAttrs, mask FA_SUBDIR jz openAppl ; ; double-click on folder, create new Folder window to show contents ; call BuildOpenFilePathname ; get complete ; pathname of sub. NOFXIP< mov dx, segment pathBuffer > FXIP < push ds > FXIP < GetResourceSegmentNS dgroup, ds > FXIP < mov dx, ds ; dx = dgroup > FXIP < pop ds > mov bp, offset pathBuffer mov bx, ss:[openFileDiskHandle] call InheritAndCreateNewFolderWindow jc done if _NEWDESK ; ; Mark this folder as opened, unless the thing is a drive, ; since we won't be able to get file change notification when ; the drive closes, for various nasty reasons. ; EC < call ECCheckFolderRecordESDI > cmp es:[di].FR_desktopInfo.DI_objectType, WOT_DRIVE je afterOpen ornf es:[di].FR_state, mask FRSF_OPENED ; ; But only redraw the thing if this constant is on, which it isn't. ; if OPEN_CLOSE_NOTIFICATION mov ax, mask DFI_CLEAR or mask DFI_DRAW call ExposeFolderObjectIcon endif afterOpen: endif ; _NEWDESK jmp done ; ; double-click on file (not folder), try to open PCGEOS/MS-DOS ; application ; openAppl: if _CONNECT_MENU or _CONNECT_TO_REMOTE ; ; don't allow if RFSD is active ; cmp ss:[connection], CT_FILE_LINKING jne notLinking mov ax, ERROR_RFSD_ACTIVE call DesktopOKError jmp done notLinking: endif test es:[di].FR_fileAttrs, mask FA_LINK jz notLink call ValidateExecutableLink jc done notLink: cmp es:[di].FR_fileType, GFT_NOT_GEOS_FILE je notGeosFile openGeosApp: call LaunchGeosFile ; GEOS appl. or datafile jmp done ; ; not a GEOS application or datafile ; might be DOS application or associated DOS datafile ; notGeosFile: BA < test es:[di].FR_fileAttrs, mask FA_LINK > BA < jnz openGeosApp > call PrepESDIForError ; save filename for ; error report if _ZMGR test es:[di].FR_state, mask FRSF_DOS_FILE_WITH_TOKEN jz cantOpenFile endif test es:[di].FR_state, mask FRSF_DOS_FILE_WITH_CREATOR jnz openGeosApp add di, offset FR_name ; es:di = name call CheckAssociation ; check if associated data file jc notDOSAssoc ; if not, check if DOS appl. call OpenAssociatedDataFile ; else, open associated appl. jmp done notDOSAssoc: ; ; not an associated DOS datafile, might be DOS executable ; if NDO_LAUNCH_DOS_EXE call CheckDOSExecutable jz openDOSAppl endif ; ; report that we can't open this file ; fileOperationInfoEntryBuffer - filename info ; if _ZMGR cantOpenFile: endif mov ax, ERROR_CANT_OPEN_FILE ; error code call DesktopOKError ; report it jmp done if NDO_LAUNCH_DOS_EXE openDOSAppl: call LaunchMSDOSApplication endif done: .leave ret FileOpenESDI endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ValidateExecutableLink %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Checks to see if the target of the link (to a supossed executable) exists, and if not puts up an error. If we are looking at a courseware link, then don't bother to validate it. We will do so later. CALLED BY: FileOpenESDI (same resource) FilePrintESDI (different resource) PASS: es:di - FolderRecord ds:si - FolderClass instance data RETURN: carry set if target was missing, error already handled DESTROYED: nothing SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- dlitwin 2/22/93 Initial version ron 6/9/93 Added hack for moved courseware %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ValidateExecutableLink proc far uses ax,bx,cx,dx,si,di,ds,es dummyPath local PathName .enter if _NEWDESKBA ; ; if this is courseware, always return clc ; clc cmp es:[di].FR_desktopInfo.DI_objectType, WOT_DOS_COURSEWARE je exit cmp es:[di].FR_desktopInfo.DI_objectType, WOT_GEOS_COURSEWARE je exit endif call BuildOpenFilePathname clr dx ; no drive name requested mov bx, ss:[openFileDiskHandle] segmov ds, ss, si mov si, offset pathBuffer ; bx, ds:si is path to construct segmov es, ss, di lea di, ss:[dummyPath] mov cx, size PathName ; es:di is destination call FileConstructActualPath jnc exit cmp ax, ERROR_PATH_NOT_FOUND je linkBogus cmp ax, ERROR_FILE_NOT_FOUND jne doError linkBogus: mov ax, ERROR_LINK_TARGET_GONE doError: call DesktopOKError stc exit: .leave ret ValidateExecutableLink endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% InheritAndCreateNewFolderWindow %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Create a new folder window with the same attributes as the current one CALLED BY: FileOpenESDI (same segment) FolderUpDir (different segment) PASS: *ds:si - FolderClass object es:di - FolderRecord dx:bp - folder's pathname bx - disk handle for folder window RETURN: carry set on error, carry clear if OK ^lcx:dx - OD of new folder object DESTROYED: ax,bx PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- cdb 7/13/92 added header %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ InheritAndCreateNewFolderWindow proc far class FolderClass uses si .enter if _NEWDESK test ss:[browseMode], mask FIBM_SINGLE jz openNewWindow ; If we're trying to open a window by opening an object on the ; desktop, then make a new window instead of trying to reuse an ; existing one. pusha ;ax, bx, cx, dx, si, bp mov bx, ds:[0] mov si, FOLDER_OBJECT_OFFSET call checkIfDesktop popa ;ax, bx, cx, dx, si, bp jc openNewWindow if 0 ; ; check if already opened ; push bx, cx, es, di mov cx, bx ; cx = disk handle mov di, mask MF_CALL or mask MF_FIXUP_DS call FindFolderWindow ; (don't need ax=obj type) call ShellFreePathBuffer pop bx, cx, es, di jc openNewWindow ; branch to front existing endif ; ; if opening wastebasket, use regular routine (will bring ; already opened wastebasket window to the front) ; push ds, si, es, di, dx, bx movdw esdi, dxbp mov dx, bx mov cx, SP_WASTE_BASKET clr ax push ax segmov ds, ss mov si, sp call FileComparePathsEvalLinks ; returns al pop cx jnc noError mov al, PCT_EQUAL ; error, don't reuse noError: cmp al, PCT_EQUAL pop ds, si, es, di, dx, bx je openNewWindow ; waste, don't reuse ; ; find any folder window other than desktop and ; wastebasket ; push cx, si, di push bx, dx, bp ; ; prefer target folder, unless wastebasket or desktop ; mov bx, ss:[targetFolder] mov si, FOLDER_OBJECT_OFFSET call checkIfDesktop jc checkOthers ; target is desktop, try others call checkIfTrash ; is target wastebasket? jnc openHere ; not trash, use it ; ; search other folders ; checkOthers: mov bp, -(size FolderTrackingEntry) ; will start at 1st one checkNext: add bp, size FolderTrackingEntry cmp bp, (size FolderTrackingEntry) * MAX_NUM_FOLDER_WINDOWS je popAndTest ; C clear movdw bxsi, ss:[folderTrackingTable][bp].FTE_folder tst bx jz checkNext call checkIfTrash jc checkNext ; don't reuse wastebasket call checkIfDesktop jc checkNext ; don't reuse Desktop ; ; must FORCE_QUEUE as caller may be looping through select ; list, so we can't go changing the folder buffer ; openHere: pop bp, cx, dx ; bp = disk, cx:dx = path push bp, cx, dx ; save again for finish push bx, ds, si movdw dssi, cxdx mov cx, ALLOC_DYNAMIC_LOCK mov ax, PATH_BUFFER_SIZE call MemAlloc jc errorPop mov es, ax clr di LocalCopyString call MemUnlock mov dx, bx ; dx = path block clc ; no error errorPop: pop bx, ds, si jc couldntOpen mov ax, MSG_FOLDER_DISPLAY_NEW_PATH call ObjMessageForce couldntOpen: stc popAndTest: pop bx, dx, bp pop cx, si, di jc short done openNewWindow: endif DerefFolderObject ds, si, si if _NEWDESK ; ; Copy the display options to dgroup for the new folder ; mov al, ds:[si].FOI_displayTypes mov ss:[defDisplayTypes], al mov al, ds:[si].FOI_displayAttrs mov ss:[defDisplayAttrs], al mov al, ds:[si].FOI_displaySort mov ss:[defDisplaySort], al mov al, ds:[si].FOI_displayMode mov ss:[defDisplayMode], al mov cx, es:[di].FR_desktopInfo.DI_objectType else EC < mov ax, NULL_SEGMENT > EC < mov es, ax > endif mov ax, di ; offset to FolderRecord call CreateNewFolderWindow done:: .leave ret if _NEWDESK checkIfTrash label near mov cx, segment NDWastebasketClass mov dx, offset NDWastebasketClass mov ax, MSG_META_IS_OBJECT_IN_CLASS call ObjMessageCallFixup ; C set if so retn checkIfDesktop label near mov cx, segment NDDesktopClass mov dx, offset NDDesktopClass mov ax, MSG_META_IS_OBJECT_IN_CLASS call ObjMessageCallFixup ; C set if so retn endif InheritAndCreateNewFolderWindow endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FolderDisplayNewPath %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: Show new path in folder window. For single window browsing mode. PASS: *ds:si - FolderClass object es - segment of FolderClass dx - path block bp - disk handle RETURN: nothing DESTROYED: ax,cx,dx,bp REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 12/22/98 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ if _NEWDESK FolderDisplayNewPath method dynamic FolderClass, MSG_FOLDER_DISPLAY_NEW_PATH ; ; Nuke various pieces of vardata that will get in the way when ; we try to set this object's path ; push cx mov bx, offset newPathNukeVarDataList mov cx, length newPathNukeVarDataList nukeLoop: mov ax, cs:[bx] call ObjVarDeleteData add bx, size word loop nukeLoop pop cx ; ; Remove this folder from the FileChangeNotification list, ; since adding the file IDs will add it back in. ; push cx, dx call UtilRemoveFromFileChangeList pop cx, dx mov bx, dx call MemLock mov cx, ax clr dx mov ax, MSG_FOLDER_SET_PATH call ObjCallInstanceNoLock mov ax, MSG_FOLDER_SET_PRIMARY_MONIKER call ObjCallInstanceNoLock mov ax, MSG_SCAN call ObjCallInstanceNoLock mov ax, MSG_REDRAW call ObjCallInstanceNoLock mov ax, MSG_FOLDER_BRING_TO_FRONT call ObjCallInstanceNoLock call MemFree ; looks like i don't have to save bx, but it says it's not destroyed... push bx, si mov ax, MSG_GEN_VIEW_SCROLL_TOP mov di, ds:[si] mov bx, ds:[di].FOI_windowBlock mov si, offset FOLDER_VIEW_OFFSET call ObjMessageForce pop bx, si ret FolderDisplayNewPath endm newPathNukeVarDataList word \ ATTR_FOLDER_PATH_DATA, TEMP_FOLDER_SAVED_DISK_HANDLE, ATTR_FOLDER_ACTUAL_PATH, TEMP_FOLDER_ACTUAL_SAVED_DISK_HANDLE, TEMP_FOLDER_PATH_IDS endif COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LaunchGeosFile %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: attempt to launch GEOS application or datafile CALLED BY: INTERNAL FileOpenESDI PASS: es:di - folder buffer entry of file to launch ds:si - instance data of parent folder object RETURN: nothing DESTROYED: bx,cx,dx PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 8/8/89 Initial version brianc 12/18/89 modified for datafiles ron 9/23/92 added code to check special links in wizardBA %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ LaunchGeosFile proc near class FolderClass uses es, di, ds, si, ax, bp .enter call PrepESDIForError ; setup filenames for error if _NEWDESKBA ; ; Is this a special Wizard item ; mov cx, es:[di].FR_desktopInfo.DI_objectType cmp cx, WOT_DOS_COURSEWARE je courseware cmp cx, WOT_GEOS_COURSEWARE jne normalGeode courseware: call ShowHourglass call LaunchSetupCoursewareLaunch call HideHourglass tst ax jnz error cmp es:[di].FR_desktopInfo.DI_objectType, WOT_GEOS_COURSEWARE je geosCourseware push bp, bx call ShowHourglass call MemLock ; Iclas ArgumentBlock mov es, ax clr bp ; es:bp = CoursewareInfoStruct call IclasExecItemLine call HideHourglass pop bp, bx call MemFree ; free IclasArgumentBlock mov bx, bp call MemFree ; free item line buffer jmp done geosCourseware: call ShowHourglass call LaunchCreateGeosCoursewareLaunchBlock call HideHourglass jmp haveLaunchBlock normalGeode: endif ; if _NEWDESKBA ; ; set up AppLaunchBlock for UserLoadApplication ; call LaunchCreateAppLaunchBlock haveLaunchBlock:: tst ax jnz error mov ax, cx ; move token to ax:bx:si ; ; dx = AppLaunchBlock ; ax:bx:si = token of application (creator or double-clicked file) ; ; send method to our process to launch application ; call GetErrFilenameBuffer ; cx = error filename buffer mov ax, ERROR_INSUFFICIENT_MEMORY ; assume error jcxz error ; (cx = 0 for MemAlloc err) mov ax, MSG_DESKTOP_LOAD_APPLICATION mov bx, handle 0 call ObjMessageForce jmp done error: call DesktopOKError done: .leave ret LaunchGeosFile endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LaunchCreateAppLaunchBlock %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Creates AppLaunchBlock for file passed. (Used for both opening & printing) CALLED BY: LaunchGeosFile, PrintGeosFile PASS: es:di - FolderRecord of file to launch ds:si - instance data of parent folder object RETURN: dx - handle of AppLaunchBlock cx:bx:si = token of application (creator or double-clicked file) NOTE: this is generally need in ax:bx:si. Caller should 'move ax, cx' after checking for error. ax - error, if any DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Doug 12/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ LaunchCreateAppLaunchBlock proc far uses bp, di, ds, es .enter ; ; set up AppLaunchBlock for UserLoadApplication ; mov ax, size AppLaunchBlock mov cx, (mask HAF_ZERO_INIT shl 8) or mask HF_SHARABLE or \ ALLOC_DYNAMIC_LOCK call MemAlloc jnc allocOK ; if no error, continue mov ax, ERROR_INSUFFICIENT_MEMORY jmp error ; else, report it allocOK: mov dx, bx ; dx = AppLaunchBlock cmp es:[di].FR_fileType, GFT_EXECUTABLE jne datafile ; ; We're launching an application, so set up the application ; pathname. ; ; es:di = entry ; ds:si = instance data ; bx = dx = AppLaunchBlock handle ; ax = AppLaunchBlock segment ; push {word}es:[di].FR_token.GT_chars[0], {word}es:[di].FR_token.GT_chars[2], es:[di].FR_token.GT_manufID call BuildOpenFilePathname ; build file pathname NOFXIP< mov si, segment pathBuffer ; ds:si = complete path > NOFXIP< mov ds, si ; of application > FXIP < mov si, bx > FXIP < GetResourceSegmentNS dgroup, ds, TRASH_BX > FXIP < mov bx, si > mov si, offset pathBuffer mov es, ax mov di, offset ALB_appRef.AIR_fileName call CopyNullTermString mov ax, ss:[openFileDiskHandle] ; store application disk handle mov es:[ALB_appRef.AIR_diskHandle], ax ; ; Have the app's initial directory be SP_DOCUMENT ; mov es:[ALB_diskHandle], SP_DOCUMENT mov {word} es:[ALB_path], C_BACKSLASH DBCS < mov es:[ALB_path][2], 0 > pop cx, bx, si jmp unlockAppLaunchBlock ; ; launching datafile ; set up datafile pathname ; figure out parent application ; ds:si = folder instance data ; es:di = entry to launch ; datafile: push es, di ; save entry mov es, ax ; es <- ALB call Folder_GetDiskAndPath lea si, ds:[bx].GFP_path ; mov es:[ALB_diskHandle], ax ; set up starting directory mov di, offset ALB_path ; call CopyNullTermString ;resolve links push dx ; save AppLaunchBlock mov bx, ax clr dx ; no drive letter mov cx, size ALB_path call FileConstructActualPath ; ignore error mov es:[ALB_diskHandle], bx pop dx ; dx = AppLaunchBlock pop ds, si ; ds:si = entry push si ; nptr to entry add si, offset FR_name mov di, offset ALB_dataFile call CopyNullTermString pop si ; nptr to entry mov cx, {word} ds:[si].FR_creator.GT_chars[0] mov bx, {word} ds:[si].FR_creator.GT_chars[2] mov si, ds:[si].FR_creator.GT_manufID mov es:[ALB_appRef].AIR_diskHandle, 0 ; Tell IACP to find it unlockAppLaunchBlock: ; dx = AppLaunchBlock ; cx:bx:si = token of application (creator or double-clicked file) xchg bx, dx ; unlock AppLaunchBlock call MemUnlock ; before running xchg bx, dx clr ax ; no error error: .leave ret LaunchCreateAppLaunchBlock endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LaunchSetupCoursewareLaunch %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Setup arguments to launch courseware CALLED BY: LaunchGeosFile PASS: es:di = folder buffer entry of file to launch cx = NewDeskObjectType RETURN: ds:dx = item line buffer bp = item line buffer block cx = item line length bx = ^h IclasArgumentBlock ax = error code if any DESTROYED: nothing SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- JS 5/17/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ if _NEWDESKBA ;-------------------------------------------------------------- LaunchSetupCoursewareLaunch proc near uses di,es .enter call SetupIclasSpawnArguments jc done mov bp, ds:[ISLIS_myHandle] ; IclasSpawnLaunchInfoStruct push ds mov bx, IGAT_COURSEWARE clr dx ; no quick transfer block call IclasBuildArguments call MemUnlock segmov es, ds ; es:0 = IclasArgumentBlock pop ds ; = CoursewareInfoStruct getGeodeName: ; ; Get Geode name from .itm file ; push bx ; bx ?= IclasArgumentBlock clr ax mov bx, ds:[ISLIS_targetDiskHandle] mov dx, offset ISLIS_coursewareTarget call IclasFileOpenAndReadReadOnlyCorrectServer xchg bp, bx ; bp = item line buffer pushf call MemFree ; IclasSpawnLaunchInfoStruct popf pop bx ; bx ?= IclasArgumentBlock mov ax, ERROR_FILE_OPEN jc done ; return with error clr ax ; no errors done: .leave ret LaunchSetupCoursewareLaunch endp endif ;---------------------------------------------------------------------- COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LaunchCreateGeosCoursewareLaunchBlock %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Create a launch block for geos courseware CALLED BY: LaunchGeosFile PASS: es:di = folder buffer entry of file to launch ds:dx = item line bp = item line buffer handle cx = length of item line bx = extra block to put is ALB RETURN: dx = handle of AppLaunchBlock cx:bx:si= token of application ax = error code if any DESTROYED: nothing SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- JS 5/16/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ if _NEWDESKBA ;-------------------------------------------------------------- LaunchCreateGeosCoursewareLaunchBlock proc near uses ds .enter push bx ; extra block for ALB call IclasGetGeodeNameFromItmLine ; ; Create and init AppLaunchBlock ; mov ax, size AppLaunchBlock mov cx, (mask HAF_ZERO_INIT shl 8) or \ mask HF_SHARABLE or ALLOC_DYNAMIC_LOCK call MemAlloc jnc allocOK mov ax, ERROR_INSUFFICIENT_MEMORY jmp done ; return with error allocOK: mov dx, bx ; dx = AppLaunchBlock pop cx ; extra block push es, di mov es, ax mov es:[ALB_extraData], cx mov di, offset ALB_appRef.AIR_fileName call CopyNullTermString EC < ; Search back for backslash > EC < std > EC < push ds, si > EC < segmov ds, es > EC < mov si, di > EC <slashLoop: > EC < lodsb > EC < cmp al, C_BACKSLASH > EC < je addEC > EC < cmp si, -1 > EC < jne slashLoop > EC < dec si > EC < ; Add 'EC ' to filename > EC <addEC: > EC < inc si > EC < inc si ; ds:si = file > EC < mov cx, size ALB_appRef.AIR_fileName - 3 > EC < sub cx, si > EC < mov si, size ALB_appRef.AIR_fileName - 4 > EC < mov di, size ALB_appRef.AIR_fileName - 1 > EC < rep movsb > EC < mov al, ' ' > EC < stosb > EC < dec di > EC < mov ax, 'EC' > EC < stosw > EC < pop ds, si > EC < cld > mov es:[ALB_appRef].AIR_diskHandle, SP_APPLICATION mov es:[ALB_diskHandle], SP_DOCUMENT mov {word} es:[ALB_path], C_BACKSLASH pop es, di call MemUnlock ; unlock AppLaunchBlock mov bx, bp call MemFree ; free itmline buffer ; ; Setup return arguments ; mov cx, {word} es:[di].FR_token.GT_chars[0] mov bx, {word} es:[di].FR_token.GT_chars[2] mov si, {word} es:[di].FR_token.GT_manufID clr ax ; no errors done: .leave ret LaunchCreateGeosCoursewareLaunchBlock endp endif ;---------------------------------------------------------------------- COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GetErrFilenameBuffer %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: build buffer containing filename to use when reporting errors CALLED BY: LaunchGeosFile PASS: fileOperationInfoEntryBuffer - 32 and 8.3 name info ax:bx:si - application token RETURN: cx = buffer containing app token and app/document name DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 01/02/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GetErrFilenameBuffer proc far uses ax, bx, dx, ds, si, es, di, bp .enter mov_tr di, ax mov dx, bx mov ax, size LoadAppData mov cx, ALLOC_DYNAMIC_LOCK call MemAlloc jc error mov es, ax mov {word}es:[LAD_token].GT_chars[0], di mov {word}es:[LAD_token].GT_chars[2], dx mov es:[LAD_token].GT_manufID, si CheckHack <offset LAD_file eq 0> clr di NOFXIP< mov si, segment fileOperationInfoEntryBuffer > NOFXIP< mov ds, si ;ds = dgroup > FXIP< mov si, bx > FXIP< GetResourceSegmentNS dgroup, ds, TRASH_BX > FXIP< mov bx, si > mov si, offset fileOperationInfoEntryBuffer.FOIE_name mov cx, size LAD_file rep movsb ; copy name into buffer call MemUnlock mov cx, bx ; cx = mem handle jmp short done error: clr cx ; error, cx = 0 done: .leave ret GetErrFilenameBuffer endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LaunchMSDOSApplication %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: attempt to launch MSDOS application CALLED BY: INTERNAL FileOpenESDI PASS: es:di - name of file to attempt to launch *ds:si - FolderClass object RETURN: nothing DESTROYED: ax,bx,cx,dx,si,di,ds,es PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 10/9/89 Initial version martin 7/19/93 Added warning dialog for Bullet %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ if NDO_LAUNCH_DOS_EXE LaunchMSDOSApplication proc near class FolderClass parentString local PathName childString local PathName DOSPathString local PathName .enter ; ; put up warning dialog if no keyboard is attached. ; if _BMGR call WarnIfNoKeyboard jc done endif call Folder_GetDiskAndPath push es, di ; save filename lea si, ds:[bx].GFP_path ; ds:si <- path mov_tr bx, ax ; bx <- disk handle ; ; copy pathname to pathname buffer for DosExec. ; segmov es, ss lea di, ss:[DOSPathString] call CopyNullTermString ; ; build parent and child strings ; lea di, ss:[parentString] call CopyNullSlashString ; (start with pathname + '\') pop ds, si ; filename to launch call CopyNullTermString ; tack on filename to launch segmov ds, ss lea di, ss:[childString] lea si, ss:[parentString] ; ; MS-DOS *.EXE or *.COM ; (ds:si) parent string = complete pathname of *.EXE or *.COM ; (es:di) child string = associated default parameters, if any ; (null otherwise) ; push bx ; save application disk handle push bp ; save locals call CheckParameters ; check for def. params mov cx, bp ; dx:cx = parameters (if any) pop bp ; retreive locals pop bx ; retrieve disk handle jnc haveParams ; if parameters, use them tst ax ; detaching? jnz noParams ; if not, skip jmp done ; else, done haveParams: push ds, si ; save appl. name mov ds, dx ; ds:si = parameters mov si, cx call CopyNullString ; put params. in child string pop ds, si ; retrieve appl. name noParams: LocalClrChar ax ; es:di = null-term ; child string LocalPutChar esdi, ax lea di, ss:[childString] mov ax, bx ; execution directory's disk ; handle is same as ; executable's disk handle push bp mov dx, ss lea bp, ss:[DOSPathString] NOTBA < call FindPromptOnReturnState > ; cl <- DosExecFlags BA < mov cx, mask DEF_FORCED_SHUTDOWN > call DosExec ; queues exit pop bp jnc done ; if no error, done cmp ax, ERROR_DOS_EXEC_IN_PROGRESS ; don't try to put up an error je done ; box if we are exiting call DesktopOKError ; report error returned in AX done: .leave ret LaunchMSDOSApplication endp endif ; NDO_LAUNCH_DOS_EXE if _BMGR COMMENT @------------------------------------------------------------------- WarnIfNoKeyboard ---------------------------------------------------------------------------- DESCRIPTION: Checks if a keyboard is attached, and warns the user if one isn't. CALLED BY: INTERNAL - LaunchMSDOSApplication PASS: nothing RETURN: CF = clear if user wants to continue operation set otherwise DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- martin 7/22/93 Initial version ---------------------------------------------------------------------------@ WarnIfNoKeyboard proc near uses ax, bx, di .enter ; ; Call keyboard driver to see if a keyboard is attached ; mov ax, GDDT_POWER_MANAGEMENT call GeodeGetDefaultDriver tst ax jz keyboardExists ; assume keyboard exists push ds, si mov_tr bx, ax call GeodeInfoDriver ; ds:si = DriverInfoStruct mov di, DR_POWER_DEVICE_ON_OFF mov ax, PDT_KEYBOARD call ds:[si].DIS_strategy pop ds, si jnc keyboardExists ; if yes, run DOS app w/o fuss ; ; Bring up dialog if necessary ; clr ax pushdw axax ; don't care about SDOP_helpContext pushdw axax ; don't care about SDOP_customTriggers pushdw axax ; don't care about SDOP_stringArg2 pushdw axax ; don't care about SDOP_stringArg1 mov bx, offset noKeyboardWarningString pushdw csbx ; save SDOP_customString mov bx, CustomDialogBoxFlags < TRUE, CDT_QUESTION, GIT_AFFIRMATION, 0 > push bx ; save SDOP_customFlags call UserStandardDialog ; ; Set carry flag correctly ; cmp ax, IC_NO stc je exit keyboardExists: clc exit: .leave ret WarnIfNoKeyboard endp noKeyboardWarningString char "You have no keyboard! ", "Do you still wish to run ", "this DOS application?",0 endif ; BMGR if not _NEWDESKBA COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FindPromptOnReturnState %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: See if prompt-on-return is set and return a DosExecFlags record accordingly. CALLED BY: LaunchMSDOSApplication PASS: nothing RETURN: cl = DosExecFlags DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- ardeb 5/28/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ FindPromptOnReturnState proc near ifndef ZMGR ifndef GEOLAUNCHER uses bx, si, dx, bp, di, ax .enter mov bx, handle OptionsList mov si, offset OptionsList mov ax, MSG_GEN_BOOLEAN_GROUP_IS_BOOLEAN_SELECTED mov cx, mask OMI_ASK_BEFORE_RETURNING call ObjMessageCall ; prompt-on-return set? mov cl, mask DEF_PROMPT ; assume yes jc done ; yes clr cl ; wrong assumption -- no prompt done: .leave else mov cl, mask DEF_PROMPT ; for GeoLauncher, always YES endif else clr cl ; no prompt on return endif ret FindPromptOnReturnState endp endif COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CheckAssociation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: check if the file we are attempting to open is a data file associated with some MS-DOS application CALLED BY: INTERNAL FileOpenESDI PASS: es:di = file name *ds:si - FolderClass object RETURN: C clear if associated data file dx:bp - MS-DOS application name C set if not an associated data file DESTROYED: preserves ds, si, es, di PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 10/23/89 Initial version brianc 1/25/90 updated to use mapping-style entries dloft 11/29/92 updated with changes to GetTailComponent %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CheckAssociation proc near class FolderClass uses ds, si, es, di .enter ; XXX: should this construct the full path? need a buffer for it ; then... ; call Folder_GetDiskAndPath lea si, ds:[bx].GFP_path ; ds:si = datafile's path mov bx, ss:[dosAssociationMapBuffer] ; lock buffer tst bx stc ; in case no buffer LONG jz done ; if no buffer, exit with C set push bx ; save handle of mapping list call MemLock ; lock mapping list mov bx, ax ; bx:cx = mappings clr cx nextMapping: ; ; bx:cx = mapping string ; es:di = datafile's name ; ds:si = datafile's path ; push ds mov ds, bx ; ds:si = mapping string xchg si, cx call GetNextMappingEntry ; mappingField1, mappingField2 xchg si, cx ; bx:cx = mapping string pop ds ; ds:si = datafile's path jc noMore ; if no more, exit with C set push ds, si, es, di ; save for next time around ; ; compare this entry with filename we want to find application for ; es:di = datafile's name ; ds:si = datafile's path ; push es, di ; save datafile's name push ds, si ; save datafile's path NOFXIP< segmov ds, dgroup, dx ; ds:dx=ds:si=mask's pathname > FXIP < mov dx, bx ; save bx value > FXIP < GetResourceSegmentNS dgroup, ds, TRASH_BX > FXIP < mov bx, dx ; restore bx > mov dx, offset mappingField1 mov si, dx call GetTailComponent ; ds:dx = mask's pathname tail cmp dx, si ; is it only a tail component? pop es, di ; es:di = datafile's path je maskOnlyTail ; only tail, handle it push ax, bx LocalClrChar ax mov bx, dx SBCS < xchg {byte} ds:[bx]-1, al ; null-term. mask's path> DBCS < xchg {wchar} ds:[bx]-2, ax ; null-term. mask's path> ; ds:si = mask's path call CompareString ; compare paths SBCS < mov {byte} ds:[bx]-1, al ; restore null'ed char > DBCS < mov {wchar} ds:[bx]-2, ax ; restore null'ed char > pop ax, bx pop es, di ; es:di = datafile's name jne checkNextEntry ; no match, try next mov si, dx ; ds:si = mask's name jmp short checkTail maskOnlyTail: pop es, di ; es:di = datafile's name checkTail: call CheckFilemaskLowFar ; matches our datafile? je foundAssoc ; yes!, found association checkNextEntry: pop ds, si, es, di ; retrieve name and path jmp short nextMapping ; ; found associated application for this datafile ; foundAssoc: add sp, 8 ; pop ds, si, es, di ; retrieve name and path ; ; return associated application name in fixed buffer (we will be ; unlocking association list buffer, so cannot return pointer into ; that) ; NOFXIP< mov dx, segment dgroup > NOFXIP< mov es, dx ; dx:bp = es:di = return buf > FXIP < GetResourceSegmentNS dgroup, es ; es = dgroup > FXIP < mov dx, es ; dx = dgroup > mov di, offset assocApplicationBuffer mov bp, di mov ds, dx ; ds:si = buffer with assoc'ed mov si, offset mappingField2 ; application call CopyNullTermString ; copy it over clc ; indicate success noMore: pop bx ; retrieve buffer handle pushf ; save status call MemUnlock ; unlock assoc. buffer popf ; retrieve status done: .leave ret CheckAssociation endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% OpenAssociatedDataFile %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: open MS-DOS application, passing data file CALLED BY: FileOpenESDI PASS: es:di = name of data file dx:bp = name of application (user entered association) *ds:si - FolderClass object RETURN: nothing DESTROYED: ax,bx,cx,dx,di,es,ds,si PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 10/23/89 Initial version chrisb 12/92 changed to use local vars %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ OpenAssociatedDataFile proc near appOffset local word push bp parentString local PathName childString local PathName DOSPathString local PathName .enter class FolderClass call Folder_GetDiskAndPath push ax ; save disk handle push es, di ; save filename lea si, ds:[bx].GFP_path ; ds:si <- path ; ; copy pathname to pathname buffer for DosExec ; segmov es, ss lea di, ss:[DOSPathString] call CopyNullTermString ; ; build child string (complete pathname of data file) ; push dx ; save assoc'd appl. name lea di, ss:[childString] ; es:di = child buffer mov ds, dx ; ds:si = assoc'd appl. name mov si, ss:[appOffset] push bp ; save locals call CheckParameters ; any associated params? mov cx, bp ; dx:cx = parameters (if any) pop bp ; retreive locals jnc haveParams ; if parameters, use them tst ax jnz OADF_noParams ; if not detaching, skip add sp, 8 ; clean up stack jmp done ; else, done haveParams: mov ds, dx ; ds:si = params. mov si, cx call CopyNullString ; copy params into child str. LocalLoadChar ax, ' ' ; delimit from data file LocalPutChar esdi, ax OADF_noParams: pop dx ; retrieve assoc'd appl. name pop ds, si ; ds:si = data file to run call CopyNullTermString ; tack it on to child string ; ; build parent string (application name) ; dx:appOffset = user-entered associated application name ; mov ds, dx ; ds:si = assoc'd appl. name mov si, appOffset lea di, ss:[parentString] ; es:di = parent buffer call CopyNullTermString ; ; do it ; mov dx, ss mov es, dx lea di, ss:[childString] ; es:di = data file pathname mov ds, dx lea si, ss:[parentString] ; ds:si = application name NOTBA < call FindPromptOnReturnState > ; cl <- DosExecFlags BA < mov cx, mask DEF_FORCED_SHUTDOWN > clr bx ; use current disk/DOS PATH ; for associated appl. pop ax ; ax = datafile disk handle push bp lea bp, ss:[DOSPathString] ; dx:bp = current directory call DosExec ; queues exit pop bp jnc done ; if no error, done call DesktopOKError ; report error returned in AX done: .leave ret OpenAssociatedDataFile endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CheckParameters %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: check if the file we are attempting to open has associated default parameters CALLED BY: INTERNAL LaunchMSDOSApplication OpenAssociatedDataFile PASS: ds:si = application name complete pathname of appl. clicked on (LaunchMSDOS...) user-entered associated appl name (OpenAssoc...) RETURN: C clear if application has parameters dx:bp - parameters for application C set if application has no parameters - or - if detaching with modal DOS parameters box up ax <> 0 if no parameters ax = 0 if detaching DESTROYED: preserves ds, si, es, di PSEUDO CODE/STRATEGY: write an inefficient, ugly routine that shows how easy it is to abuse local variables KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 10/25/89 Initial version brianc 1/25/90 updated to use mapping-style entries %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CheckParameters proc near uses ds, si, es, di .enter mov bx, ss:[dosParameterMapBuffer] ; lock buffer tst bx stc ; in case no buffer mov ax, NIL ; (not detaching) jz done ; if no buffer, exit with C set push bx ; save handle of mapping list call MemLock ; lock mapping list mov bx, ax ; bx:cx = mappings clr cx nextMapping: ; ; bx:cx = mapping string ; ds:si = application name ; push ds mov ds, bx ; ds:si = mapping string xchg si, cx call GetNextMappingEntry ; mappingField1, mappingField2 xchg si, cx ; bx:cx = mapping string pop ds ; ds:si = datafile's path mov ax, NIL ; (not detaching) jc noMore ; if no more, exit with C set ; ; compare this entry with application we want to find params for ; four possible cases: ; 1) application specified with complete pathname ; entry specified with complete pathname ; --> compare complete paths verbatim ; ; 2) application specified with complete pathname ; entry specified with just filename ; --> compare tail component of application with entry ; ; 3) application specified with just filename ; entry specified with complete pathname ; (must have come from OpenAssociatedDataFile, ; in which case, the user should specify ; the same application name in the ; dosParameters field as in the dosAssociations ; field if they want to get parameters for an ; associated application) ; --> no match ; ; 4) application specified with just filename ; entry specified with just filename ; --> compare ; FXIP < GetResourceSegmentNS dgroup, ds > FXIP < mov dx, es ; dx = dgroup > NOFXIP< segmov ds, dgroup, dx ; es:bp = dx:bp = entry-appl > mov es, dx ; es = ds mov dx, offset mappingField1 call GetTailComponent ; ds:dx = entry-appl's tail mov di, dx ; save tail cmp dx, offset mappingField1 ; is it only tail component? je entryTail ; only tail, handle 2) & 4) ; ; case 1) or case 3) ; mov dx, si ; ds:dx = appl to get params call GetTailComponent ; dx:bp = appl-param's tail cmp dx, si ; complete pathname for appl? je nextMapping ; if not, no match (case 3) ; ; case 1) (appl complete, entry complete) ; ; es:(offset mappingField1) = entry-appl ; ds:si = appl-param ; mov di, offset mappingField1 ; es:di = entry-appl push si ; save application name ; call CompareString ; compare complete pathname ;allow wildcards - 6/20/90 call CheckParamCompare pop si ; retrieve application name jne nextMapping ; if no match, try again paramFound: ; ; return associated default parameters in fixed buffer (we will be ; unlocking association list buffer, so cannot return pointer into ; that) ; push ds, si ; save application to launch FXIP < GetResourceSegmentNS dgroup, ds > FXIP < mov dx, ds > NOFXIP< segmov ds, dgroup, dx > mov es, dx ; dx:bp = es:di = return buf mov di, offset assocParametersBuffer mov bp, di ; ds:si = buffer with params mov si, offset mappingField2 LocalGetChar ax, dssi ; skip starting ", if any> SBCS < LocalCmpChar ax, C_QUOTE > DBCS < LocalCmpChar ax, C_QUOTATION_MARK > je 99$ LocalPrevChar dssi ; not ", unskip it 99$: call CopyNullString ; preserves al cmp al, '"' ; are we quoted? jne 101$ ; no, null-term LocalPrevChar esdi ; else, move back to ending " 101$: LocalClrChar ax LocalPutChar esdi, ax ; null-terminate pop ds, si ; ds:si = application to launch call AskUserForParametersIfNeeded ; returns carry clear if ; params exists ; ax = 0 if detaching noMore: pop bx ; retrieve buffer handle call MemUnlock ; unlock mapping string done: .leave ret ; <--- EXIT HERE entryTail: ; ; case 2) or case 4) ; ; (entry-appl is just tail component) ; es:di = entry-appl ; ds:si = appl-param ; push si mov dx, si ; ds:dx = appl to get params call GetTailComponent ; ds:dx = appl-param's tail mov si, dx ; ds:si = tail of appl-param ; call CompareString ; compare tails ;allow wildcards - 6/20/90 call CheckParamCompare pop si je paramFound jmp nextMapping CheckParameters endp ; ; pass: ; ds:si = filename to params for ; es:di = filename in association string (might be filemask) ; CheckParamCompare proc near uses ds, es .enter xchg si, di ; ds:si = filemask segxchg ds, es ; es:di = filename call CheckFilemaskLowFar .leave ret CheckParamCompare endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% AskUserForParametersIfNeeded %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: If geos.ini specifies '?' as the parameters for a DOS application, then we put up a dialog box asking the user for parameters when the DOS application is run. CALLED BY: INTERNAL CheckParameters PASS: dx:bp - parameters found in geos.ini file ds:si - application for which params found RETURN: carry clear if parameters available dx:bp = unchanged if '?' not specified = user entered parameters if '?' specified carry set if no parameters - or - if detaching with modal DOS parameters box up ax <> 0 if no parameters ax = 0 if detaching DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 01/26/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ AskUserForParametersIfNeeded proc near uses bx, cx, dx, ds, si, es, di, bp .enter mov es, dx ; ds:bp = geos.ini params SBCS < cmp {word} es:[bp], C_QUESTION_MARK ; ? + null > DBCS < cmp {wchar} es:[bp], C_QUESTION_MARK > DBCS < jne done > DBCS < cmp {wchar} es:[bp]+2, C_NULL > jne done ; not ?, return passed params ; ; user wants to enter parameters, put up box ; push dx, bp ; save param buffer mov dx, ds ; dx:bp = application name mov bp, si mov bx, handle MiscUI mov si, offset DosParameterApplication call CallSetText ; set application name in box ; mov bx, handle MiscUI ; put up box mov si, offset DosParameterBox call UserDoDialog pop cx, dx ; return text in param buffer ; (in case not detaching) cmp ax, OKCANCEL_OK ; run with params? je runWithParams ; yes clr ax ; else, signal detaching stc ; indicate no params jmp short exit ; detaching --> quit runWithParams: ; mov bx, handle MiscUI ; get parameters entered mov si, offset DosParameterEntry mov ax, MSG_VIS_TEXT_GET_ALL_PTR push cx, dx ; save buffer segment:offset mov bp, dx ; bp <- offset mov dx, cx ; dx <- segment call ObjMessageCall ; cx <- size pop dx, bp ; dx:bp = parameter buffer tst cx ; any parmeters? (clears carry) jnz done ; has params, exit with C clear stc ; no params, exit with C set done: mov ax, NIL ; not detaching exit: .leave ret AskUserForParametersIfNeeded endp if _NEWDESKBA COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SetupIclasSpawnArguments %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Sets up arguments based on the current folder and selection for the call to IclasBuildArguments CALLED BY: LaunchGeosFile PASS: es:di - folder buffer entry of file to launch ds:si - instance data of parent folder object RETURN: ds = ^s IclasSpawnLaunchInfoStruct (locked) carry iff error ax = possible error DESTROYED: nothing SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- RB 11/23/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ slashRootDir char C_BACKSLASH, C_NULL SetupIclasSpawnArguments proc far uses bx,cx,dx,si,di,es thisFolderRecord local fptr push es, di spawnBlock local sptr endOfPath local nptr .enter ; ------ First, Get Disk And Path of Folder ---------- ;; get path of folder launched from ; ds: = sptr of folder object call IclasCreateSpawnBlock LONG jc error call MemLock jc error mov spawnBlock, ax call Folder_GetDiskAndPath ; ax = disk handle, 0 if invalid ; ds:bx = GenFilePath clr dx lea si, ds:[bx].GFP_path ; ds:si = tail of path mov bx, ax ; disk handle of folder ; ------- Write link folder name into spawn block as courseware name ; ds:si = folder symbolic name push si clr dx ; no <disk:> mov es, spawnBlock mov di, offset ISLIS_fullSymbolicName mov cx, FILE_LONGNAME_BUFFER_SIZE + PATH_LENGTH call FileConstructFullPath jc popAndError mov endOfPath, di mov es:[ISLIS_linkDiskHandle], bx pop si ; ------- Get Actual DOS path of folder ----------------- ; ds:si = folder symbolic name mov bx, ax ; disk handle of folder mov di, offset ISLIS_actualContainingFolder call FileConstructActualPath jc noChance ; --------- Append Selected File Name after path ------------- mov di, endOfPath mov al, C_BACKSLASH cmp es:[di-1], al je gotSlash stosb gotSlash: lds si, thisFolderRecord .assert ((offset FR_name) eq 0) ; ds:si = file name LocalCopyString ; --------- Get DOS path of selected file ---------------------- mov bx, es:[ISLIS_linkDiskHandle] segmov ds, es mov si, offset ISLIS_fullSymbolicName mov di, offset ISLIS_coursewareTarget mov cx, PATH_LENGTH + FILE_LONGNAME_BUFFER_SIZE clr dx ; no drive name call FileConstructActualPath jc targetIsGone mov es:[ISLIS_targetDiskHandle], bx clr ax done: mov ds, spawnBlock .leave ret popAndError: pop ax mov ax, ERROR_LINK_TARGET_GONE jmp done error: mov ax, ERROR_INSUFFICIENT_MEMORY jmp done targetIsGone: ; ; Try to do a FileReadlink to get old .itm file ; ; go to root of drive of courseware push ds segmov ds, cs mov dx, offset slashRootDir mov bx, es:[ISLIS_linkDiskHandle] call FileSetCurrentPath pop ds mov dx, si mov cx, size ISLIS_coursewareTarget call FileReadLink jc noChance segmov ds, es mov si, offset ISLIS_actualContainingFolder ; ds:si = path of Class mov dx, offset ISLIS_fullSymbolicName call IclasFindMissingCourseware jc noChance jmp done noChance: stc mov ax, ERROR_LINK_TARGET_GONE jmp done SetupIclasSpawnArguments endp endif ; _NEWDESKBA FolderOpenCode ends
.byte $00, $00, $0D, $0B, $0C, $00, $00, $00, $00
/* * * Copyright 2018 gRPC authors. * * 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. * */ #include "test/cpp/util/channel_trace_proto_helper.h" #include <google/protobuf/text_format.h> #include <google/protobuf/util/json_util.h> #include <grpc/grpc.h> #include <grpc/support/log.h> #include <gtest/gtest.h> #include "src/proto/grpc/channelz/channelz.pb.h" namespace grpc { namespace testing { namespace { // Generic helper that takes in a json string, converts it to a proto, and // then back to json. This ensures that the json string was correctly formatted // according to https://developers.google.com/protocol-buffers/docs/proto3#json template <typename Message> void VaidateProtoJsonTranslation(char* json_c_str) { std::string json_str(json_c_str); Message msg; google::protobuf::util::JsonParseOptions parse_options; // If the following line is failing, then uncomment the last line of the // comment, and uncomment the lines that print the two strings. You can // then compare the output, and determine what fields are missing. // // parse_options.ignore_unknown_fields = true; EXPECT_EQ(google::protobuf::util::JsonStringToMessage(json_str, &msg, parse_options), google::protobuf::util::Status::OK); std::string proto_json_str; google::protobuf::util::JsonPrintOptions print_options; // We usually do not want this to be true, however it can be helpful to // uncomment and see the output produced then all fields are printed. // print_options.always_print_primitive_fields = true; EXPECT_EQ(google::protobuf::util::MessageToJsonString(msg, &proto_json_str, print_options), google::protobuf::util::Status::OK); // uncomment these to compare the the json strings. // gpr_log(GPR_ERROR, "tracer json: %s", json_str.c_str()); // gpr_log(GPR_ERROR, "proto json: %s", proto_json_str.c_str()); EXPECT_EQ(json_str, proto_json_str); } } // namespace void ValidateChannelTraceProtoJsonTranslation(char* json_c_str) { VaidateProtoJsonTranslation<grpc::channelz::v1::ChannelTrace>(json_c_str); } void ValidateChannelProtoJsonTranslation(char* json_c_str) { VaidateProtoJsonTranslation<grpc::channelz::v1::Channel>(json_c_str); } void ValidateGetTopChannelsResponseProtoJsonTranslation(char* json_c_str) { VaidateProtoJsonTranslation<grpc::channelz::v1::GetTopChannelsResponse>( json_c_str); } void ValidateGetChannelResponseProtoJsonTranslation(char* json_c_str) { VaidateProtoJsonTranslation<grpc::channelz::v1::GetChannelResponse>( json_c_str); } void ValidateGetServerResponseProtoJsonTranslation(char* json_c_str) { VaidateProtoJsonTranslation<grpc::channelz::v1::GetServerResponse>( json_c_str); } void ValidateSubchannelProtoJsonTranslation(char* json_c_str) { VaidateProtoJsonTranslation<grpc::channelz::v1::Subchannel>(json_c_str); } void ValidateServerProtoJsonTranslation(char* json_c_str) { VaidateProtoJsonTranslation<grpc::channelz::v1::Server>(json_c_str); } void ValidateGetServersResponseProtoJsonTranslation(char* json_c_str) { VaidateProtoJsonTranslation<grpc::channelz::v1::GetServersResponse>( json_c_str); } } // namespace testing } // namespace grpc
// Copyright (c) 2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "consensus/merkle.h" #include "test/test_safe.h" #include "random.h" #include <boost/test/unit_test.hpp> BOOST_FIXTURE_TEST_SUITE(merkle_tests, TestingSetup) // Older version of the merkle root computation code, for comparison. static uint256 BlockBuildMerkleTree(const CBlock& block, bool* fMutated, std::vector<uint256>& vMerkleTree) { vMerkleTree.clear(); vMerkleTree.reserve(block.vtx.size() * 2 + 16); // Safe upper bound for the number of total nodes. for (std::vector<CTransaction>::const_iterator it(block.vtx.begin()); it != block.vtx.end(); ++it) vMerkleTree.push_back(it->GetHash()); int j = 0; bool mutated = false; for (int nSize = block.vtx.size(); nSize > 1; nSize = (nSize + 1) / 2) { for (int i = 0; i < nSize; i += 2) { int i2 = std::min(i+1, nSize-1); if (i2 == i + 1 && i2 + 1 == nSize && vMerkleTree[j+i] == vMerkleTree[j+i2]) { // Two identical hashes at the end of the list at a particular level. mutated = true; } vMerkleTree.push_back(Hash(vMerkleTree[j+i].begin(), vMerkleTree[j+i].end(), vMerkleTree[j+i2].begin(), vMerkleTree[j+i2].end())); } j += nSize; } if (fMutated) { *fMutated = mutated; } return (vMerkleTree.empty() ? uint256() : vMerkleTree.back()); } // Older version of the merkle branch computation code, for comparison. static std::vector<uint256> BlockGetMerkleBranch(const CBlock& block, const std::vector<uint256>& vMerkleTree, int nIndex) { std::vector<uint256> vMerkleBranch; int j = 0; for (int nSize = block.vtx.size(); nSize > 1; nSize = (nSize + 1) / 2) { int i = std::min(nIndex^1, nSize-1); vMerkleBranch.push_back(vMerkleTree[j+i]); nIndex >>= 1; j += nSize; } return vMerkleBranch; } static inline int ctz(uint32_t i) { if (i == 0) return 0; int j = 0; while (!(i & 1)) { j++; i >>= 1; } return j; } BOOST_AUTO_TEST_CASE(merkle_test) { for (int i = 0; i < 32; i++) { // Try 32 block sizes: all sizes from 0 to 16 inclusive, and then 15 random sizes. int ntx = (i <= 16) ? i : 17 + (insecure_rand() % 4000); // Try up to 3 mutations. for (int mutate = 0; mutate <= 3; mutate++) { int duplicate1 = mutate >= 1 ? 1 << ctz(ntx) : 0; // The last how many transactions to duplicate first. if (duplicate1 >= ntx) break; // Duplication of the entire tree results in a different root (it adds a level). int ntx1 = ntx + duplicate1; // The resulting number of transactions after the first duplication. int duplicate2 = mutate >= 2 ? 1 << ctz(ntx1) : 0; // Likewise for the second mutation. if (duplicate2 >= ntx1) break; int ntx2 = ntx1 + duplicate2; int duplicate3 = mutate >= 3 ? 1 << ctz(ntx2) : 0; // And for the third mutation. if (duplicate3 >= ntx2) break; int ntx3 = ntx2 + duplicate3; // Build a block with ntx different transactions. CBlock block; block.vtx.resize(ntx); for (int j = 0; j < ntx; j++) { CMutableTransaction mtx; mtx.nLockTime = j; block.vtx[j] = mtx; } // Compute the root of the block before mutating it. bool unmutatedMutated = false; uint256 unmutatedRoot = BlockMerkleRoot(block, &unmutatedMutated); BOOST_CHECK(unmutatedMutated == false); // Optionally mutate by duplicating the last transactions, resulting in the same merkle root. block.vtx.resize(ntx3); for (int j = 0; j < duplicate1; j++) { block.vtx[ntx + j] = block.vtx[ntx + j - duplicate1]; } for (int j = 0; j < duplicate2; j++) { block.vtx[ntx1 + j] = block.vtx[ntx1 + j - duplicate2]; } for (int j = 0; j < duplicate3; j++) { block.vtx[ntx2 + j] = block.vtx[ntx2 + j - duplicate3]; } // Compute the merkle root and merkle tree using the old mechanism. bool oldMutated = false; std::vector<uint256> merkleTree; uint256 oldRoot = BlockBuildMerkleTree(block, &oldMutated, merkleTree); // Compute the merkle root using the new mechanism. bool newMutated = false; uint256 newRoot = BlockMerkleRoot(block, &newMutated); BOOST_CHECK(oldRoot == newRoot); BOOST_CHECK(newRoot == unmutatedRoot); BOOST_CHECK((newRoot == uint256()) == (ntx == 0)); BOOST_CHECK(oldMutated == newMutated); BOOST_CHECK(newMutated == !!mutate); // If no mutation was done (once for every ntx value), try up to 16 branches. if (mutate == 0) { for (int loop = 0; loop < std::min(ntx, 16); loop++) { // If ntx <= 16, try all branches. Otherise, try 16 random ones. int mtx = loop; if (ntx > 16) { mtx = insecure_rand() % ntx; } std::vector<uint256> newBranch = BlockMerkleBranch(block, mtx); std::vector<uint256> oldBranch = BlockGetMerkleBranch(block, merkleTree, mtx); BOOST_CHECK(oldBranch == newBranch); BOOST_CHECK(ComputeMerkleRootFromBranch(block.vtx[mtx].GetHash(), newBranch, mtx) == oldRoot); } } } } } BOOST_AUTO_TEST_SUITE_END()
; ---------------------------------------------------------------- ; Z88DK INTERFACE LIBRARY FOR THE BIFROST* ENGINE - RELEASE 1.2/L ; ; See "bifrost_h.h" for further details ; ---------------------------------------------------------------- ; unsigned char BIFROSTH_getAnimGroup(unsigned char tile) SECTION code_clib SECTION code_bifrost_h PUBLIC _BIFROSTH_getAnimGroup EXTERN asm_BIFROSTH_getAnimGroup _BIFROSTH_getAnimGroup: ld hl,2 add hl,sp ld l,(hl) ; L = tile jp asm_BIFROSTH_getAnimGroup
; Generated by PSoC Designer 5.4.3191 ; ;@Id: boot.tpl#903 @ ;============================================================================= ; FILENAME: boot.asm ; Version: 4.30 ; ; DESCRIPTION: ; M8C Boot Code for CY8C271xx members of the 27xxx microcontroller family. ; ; Copyright (c) Cypress Semiconductor 2015. All Rights Reserved. ; ; NOTES: ; PSoC Designer's Device Editor uses a template file, BOOT.TPL, located in ; the project's root directory to create BOOT.ASM. Any changes made to ; BOOT.ASM will be overwritten every time the project is generated; therefore ; changes should be made to BOOT.TPL not BOOT.ASM. Care must be taken when ; modifying BOOT.TPL so that replacement strings (such as @PROJECT_NAME) ; are not accidentally modified. ; ;============================================================================= include ".\lib\GlobalParams.inc" ;File generated by PSoC Designer (Project dependent) include "m8c.inc" ;Part specific file include "m8ssc.inc" ;Part specific file include "memory.inc" ;File generated by PSoC Designer (Project dependent) ;-------------------------------------- ; Export Declarations ;-------------------------------------- export __Start IF (TOOLCHAIN & HITECH) ELSE export __bss_start export __data_start export __idata_start export __func_lit_start export __text_start ENDIF export _bGetPowerSetting export bGetPowerSetting ;-------------------------------------- ; Optimization flags ;-------------------------------------- ; ; To change the value of these flags, modify the file boot.tpl, not ; boot.asm. See the notes in the banner comment at the beginning of ; this file. ; Optimization for Assembly language (only) projects and C-language projects ; that do not depend on the C compiler to initialize the values of RAM variables. ; Set to 1: Support for C Run-time Environment initialization ; Set to 0: Support for C not included. Faster start up, smaller code space. ; IF (TOOLCHAIN & HITECH) ; The C compiler will customize the startup code - it's not required here C_LANGUAGE_SUPPORT: equ 0 ELSE C_LANGUAGE_SUPPORT: equ 1 ENDIF ; The following equate is required for proper operation. Reseting its value ; is discouraged. WAIT_FOR_32K is effective only if the crystal oscillator is ; selected. If the designer chooses to not wait then stabilization of the ECO ; and PLL_Lock must take place within user code. See the family data sheet for ; the requirements of starting the ECO and PLL lock mode. ; ; Set to 1: Wait for XTAL (& PLL if selected) to stabilize before ; invoking main ; Set to 0: Boot code does not wait; clock may not have stabilized by ; the time code in main starts executing. ; WAIT_FOR_32K: equ 1 ; For historical reasons, by default the boot code uses an lcall instruction ; to invoke the user's _main code. If _main executes a return instruction, ; boot provides an infinite loop. By changing the following equate from zero ; to 1, boot's lcall will be replaced by a ljmp instruction, saving two ; bytes on the stack which are otherwise required for the return address. If ; this option is enabled, _main must not return. (Beginning with the 4.2 ; release, the C compiler automatically places an infinite loop at the end ; of main, rather than a return instruction.) ; ENABLE_LJMP_TO_MAIN: equ 0 ;----------------------------------------------------------------------------- ; Interrupt Vector Table ;----------------------------------------------------------------------------- ; ; Interrupt vector table entries are 4 bytes long. Each one contains ; a jump instruction to an ISR (Interrupt Service Routine), although ; very short ISRs could be encoded within the table itself. Normally, ; vector jump targets are modified automatically according to the user ; modules selected. This occurs when the 'Generate Application' opera- ; tion is run causing PSoC Designer to create boot.asm and the other ; configuration files. If you need to hard code a vector, update the ; file boot.tpl, not boot.asm. See the banner comment at the beginning ; of this file. ;----------------------------------------------------------------------------- AREA TOP (ROM, ABS, CON) org 0 ;Reset Interrupt Vector IF (TOOLCHAIN & HITECH) ; jmp __Start ;C compiler fills in this vector ELSE jmp __Start ;First instruction executed following a Reset ENDIF ;@PSoC_BOOT_ISR_UserCode_START@ ;--------------------------------------------------- ; Insert your custom code below this banner ;--------------------------------------------------- org 04h ;Low Voltage Detect (LVD) Interrupt Vector halt ;Stop execution if power falls too low org 08h ;Analog Column 0 Interrupt Vector // call void_handler reti org 0Ch ;Analog Column 1 Interrupt Vector // call void_handler reti org 10h ;Analog Column 2 Interrupt Vector // call void_handler reti org 14h ;Analog Column 3 Interrupt Vector // call void_handler reti org 18h ;VC3 Interrupt Vector // call void_handler reti org 1Ch ;GPIO Interrupt Vector // call void_handler reti org 20h ;PSoC Block DBB00 Interrupt Vector // call void_handler reti org 24h ;PSoC Block DBB01 Interrupt Vector // call void_handler reti org 28h ;PSoC Block DCB02 Interrupt Vector ljmp _TX8_ISR reti org 2Ch ;PSoC Block DCB03 Interrupt Vector // call void_handler reti org 30h ;PSoC Block DBB10 Interrupt Vector // call void_handler reti org 34h ;PSoC Block DBB11 Interrupt Vector // call void_handler reti org 38h ;PSoC Block DCB12 Interrupt Vector ljmp _RX8_2_ISR reti org 3Ch ;PSoC Block DCB13 Interrupt Vector ljmp _RX8_1_ISR reti org 60h ;PSoC I2C Interrupt Vector // call void_handler reti org 64h ;Sleep Timer Interrupt Vector // call void_handler reti ;--------------------------------------------------- ; Insert your custom code above this banner ;--------------------------------------------------- ;@PSoC_BOOT_ISR_UserCode_END@ ;----------------------------------------------------------------------------- ; Start of Execution. ;----------------------------------------------------------------------------- ; The Supervisory ROM SWBootReset function has already completed the ; calibrate1 process, loading trim values for 5 volt operation. ; IF (TOOLCHAIN & HITECH) AREA PD_startup(CODE, REL, CON) ELSE org 68h ENDIF __Start: ; Initialize the voltage monitoring values, ; leaving power-on reset (POR) level at the default (low) level, at ; least for now. ; M8C_SetBank1 mov reg[VLT_CR], SWITCH_MODE_PUMP_JUST | LVD_TBEN_JUST | TRIP_VOLTAGE_JUST M8C_SetBank0 M8C_ClearWDTAndSleep ; Clear WDT before enabling it. IF ( WATCHDOG_ENABLE ) ; WDT selected in Global Params M8C_EnableWatchDog ENDIF IF ( SELECT_32K ) or reg[CPU_SCR1], CPU_SCR1_ECO_ALLOWED ; ECO will be used in this project ELSE and reg[CPU_SCR1], ~CPU_SCR1_ECO_ALLOWED ; Prevent ECO from being enabled ENDIF IF (TOOLCHAIN & HITECH) ;--------------------------- ; Set up the Temporary stack ;--------------------------- ; A temporary stack is set up for the SSC instructions. ; The real stack start will be assigned later. ; global __Lstackps mov a,low __Lstackps swap a,sp ELSE ;------------------ ; Set up the stack ;------------------ mov A, __ramareas_end ; Set top of stack to end of used RAM swap SP, A ; This is only temporary if going to LMM ENDIF ;----------------------------------------------- ; Set Power-related Trim & the AGND Bypass bit. ;----------------------------------------------- M8C_ClearWDTAndSleep ; Clear WDT before enabling it. IF ( SUPPLY_VOLTAGE ) ; 1 means 5.0V IF ( AGND_BYPASS ) ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; The 5V trim has already been set, but we need to update the AGNDBYP ; bit in the write-only BDG_TR register. Recalculate the register ; value using the proper trim values. ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - M8SSC_SetTableVoltageTrim 1, SSCTBL1_TRIM_BGR_5V, AGND_BYPASS_JUST ENDIF ELSE ; 3.3 V Operation, not 5.0V M8SSC_SetTableTrims 1, SSCTBL1_TRIM_IMO_3V_24MHZ, SSCTBL1_TRIM_BGR_3V, AGND_BYPASS_JUST ENDIF ;(SUPPLY_VOLTAGE) mov [bSSC_KEY1], 0 ; Lock out Flash and Supervisiory operations mov [bSSC_KEYSP], 0 ;--------------------------------------- ; Initialize Crystal Oscillator and PLL ;--------------------------------------- IF ( SELECT_32K & WAIT_FOR_32K ) ; If the user has requested the External Crystal Oscillator (ECO) then turn it ; on and wait for it to stabilize and the system to switch over to it. The PLL ; is left off. Set the SleepTimer period is set to 1 sec to time the wait for ; the ECO to stabilize. ; M8C_SetBank1 mov reg[OSC_CR0], (SELECT_32K_JUST | OSC_CR0_SLEEP_1Hz | OSC_CR0_CPU_12MHz) M8C_SetBank0 M8C_ClearWDTAndSleep ; Reset the sleep timer to get a full second or reg[INT_MSK0], INT_MSK0_SLEEP ; Enable latching of SleepTimer interrupt mov reg[INT_VC], 0 ; Clear all pending interrupts .WaitFor1s: tst reg[INT_CLR0], INT_MSK0_SLEEP ; Test the SleepTimer Interrupt Status jz .WaitFor1s ; Interrupt will latch but will not dispatch ; since interrupts are not globally enabled ELSE ; !( SELECT_32K & WAIT_FOR_32K ) ; Either no ECO, or waiting for stable clock is to be done in main M8C_SetBank1 mov reg[OSC_CR0], (SELECT_32K_JUST | PLL_MODE_JUST | SLEEP_TIMER_JUST | OSC_CR0_CPU_12MHz) M8C_SetBank0 M8C_ClearWDTAndSleep ; Reset the watch dog ENDIF ;( SELECT_32K & WAIT_FOR_32K ) IF ( PLL_MODE ) ; Crystal is now fully operational (assuming WAIT_FOR_32K was enabled). ; Now start up PLL if selected, and wait 16 msec for it to stabilize. ; M8C_SetBank1 mov reg[OSC_CR0], (SELECT_32K_JUST | PLL_MODE_JUST | OSC_CR0_SLEEP_64Hz | OSC_CR0_CPU_3MHz) M8C_SetBank0 M8C_ClearWDTAndSleep ; Reset the sleep timer to get full period mov reg[INT_VC], 0 ; Clear all pending interrupts .WaitFor16ms: tst reg[INT_CLR0],INT_MSK0_SLEEP ; Test the SleepTimer Interrupt Status jz .WaitFor16ms M8C_SetBank1 ; continue boot at CPU Speed of SYSCLK/2 mov reg[OSC_CR0], (SELECT_32K_JUST | PLL_MODE_JUST | OSC_CR0_SLEEP_64Hz | OSC_CR0_CPU_12MHz) M8C_SetBank0 IF ( WAIT_FOR_32K ) ELSE ; !( WAIT_FOR_32K ) ; Option settings (PLL-Yes, ECO-No) are incompatible - force a syntax error ERROR_PSoC Disabling WAIT_FOR_32K requires that the PLL_Lock must be enabled in user code. ENDIF ;(WAIT_FOR_32K) ENDIF ;(PLL_MODE) ;------------------------------------------------------- ; Initialize Proper Drive Mode for External Clock Pin ;------------------------------------------------------- ; Change EXTCLK pin from Hi-Z Analog (110b) drive mode to Hi-Z (010b) drive mode IF (SYSCLK_SOURCE) and reg[PRT1DM2], ~0x10 ; Clear bit 4 of EXTCLK pin's DM2 register ENDIF ; EXTCLK pin is now in proper drive mode to input the external clock signal ;------------------------ ; Close CT leakage path. ;------------------------ mov reg[ACB00CR0], 05h mov reg[ACB01CR0], 05h mov reg[ACB02CR0], 05h mov reg[ACB03CR0], 05h ;@PSoC_BOOT_LOADCFG_UserCode_START@ ;--------------------------------------------------- ; Insert your custom code below this banner ;--------------------------------------------------- ;--------------------------------------------------- ; Insert your custom code above this banner ;--------------------------------------------------- ;@PSoC_BOOT_LOADCFG_UserCode_END@ ;------------------------- ; Load Base Configuration ;------------------------- ; Load global parameter settings and load the user modules in the ; base configuration. Exceptions: (1) Leave CPU Speed fast as possible ; to minimize start up time; (2) We may still need to play with the ; Sleep Timer. ; lcall LoadConfigInit ;----------------------------------- ; Initialize C Run-Time Environment ;----------------------------------- IF ( C_LANGUAGE_SUPPORT ) mov A,0 ; clear the 'bss' segment to zero mov [__r0],<__bss_start BssLoop: cmp [__r0],<__bss_end jz BssDone mvi [__r0],A jmp BssLoop BssDone: mov A,>__idata_start ; copy idata to data segment mov X,<__idata_start mov [__r0],<__data_start IDataLoop: cmp [__r0],<__data_end jz C_RTE_Done push A romx mvi [__r0],A pop A inc X adc A,0 jmp IDataLoop C_RTE_Done: ENDIF ; C_LANGUAGE_SUPPORT ;------------------------------- ; Set Power-On Reset (POR) Level ;------------------------------- ; The writes to the VLT_CR register below include setting the POR to VLT_CR_POR_HIGH, ; VLT_CR_POR_MID or VLT_CR_POR_LOW. Correctly setting this value is critical to the proper ; operation of the PSoC. The POR protects the M8C from mis-executing when Vdd falls low. ; These values should not be changed from the settings here. See Section "POR and LVD" of ; Technical Reference Manual #001-14463 for more information. M8C_SetBank1 IF ( SUPPLY_VOLTAGE ) ; 1 Means 5 Volts IF ( CPU_CLOCK_JUST ^ OSC_CR0_CPU_24MHz ) ; Also 24MHz? ; no, set 4.5V POR in user code, if desired ELSE ; 24HMz ; or reg[VLT_CR], VLT_CR_4V75_POR ; yes, 4.75V trip required ENDIF ; OSC_CRO_CPU_24MHz ENDIF ; 5V M8C_SetBank0 ;---------------------------- ; Wrap up and invoke "main" ;---------------------------- ; Disable the Sleep interrupt that was used for timing above. In fact, ; no interrupts should be enabled now, so may as well clear the register. ; mov reg[INT_MSK0],0 ; Everything has started OK. Now select requested CPU & sleep frequency. ; M8C_SetBank1 mov reg[OSC_CR0],(SELECT_32K_JUST | PLL_MODE_JUST | SLEEP_TIMER_JUST | CPU_CLOCK_JUST) M8C_SetBank0 ; Global Interrupt are NOT enabled, this should be done in main(). ; LVD is set but will not occur unless Global Interrupts are enabled. ; Global Interrupts should be enabled as soon as possible in main(). ; mov reg[INT_VC],0 ; Clear any pending interrupts which may IF (TOOLCHAIN & HITECH) ljmp startup ; Jump to C compiler startup code ELSE ; have been set during the boot process. IF ENABLE_LJMP_TO_MAIN ljmp _main ; goto main (no return) ELSE lcall _main ; call main .Exit: jmp .Exit ; Wait here after return till power-off or reset ENDIF ENDIF ; TOOLCHAIN ;--------------------------------- ; Library Access to Global Parms ;--------------------------------- ; bGetPowerSetting: _bGetPowerSetting: ; Synthesize the "power setting" value used by chips with SlowIMO mode. ; Returns value of POWER_SETTING in the A register. ; No inputs. No Side Effects. ; IF ( SUPPLY_VOLTAGE ) ; 1 means 5.0V mov A, POWER_SET_5V0_24MHZ ; Supply & Internal Main Oscillator speed ELSE mov A, POWER_SET_3V3_24MHZ ; Supply & Internal Main Oscillator speed ENDIF ret IF (TOOLCHAIN & HITECH) ELSE ;--------------------------------- ; Order Critical RAM & ROM AREAs ;--------------------------------- ; 'TOP' is all that has been defined so far... ; ROM AREAs for C CONST, static & global items ; AREA lit (ROM, REL, CON, LIT) ; 'const' definitions AREA idata (ROM, REL, CON, LIT) ; Constants for initializing RAM __idata_start: AREA func_lit (ROM, REL, CON, proclab) ; Function Pointers __func_lit_start: AREA psoc_config (ROM, REL, CON) ; Configuration Load & Unload AREA UserModules (ROM, REL, CON) ; User Module APIs ; CODE segment for general use ; AREA text (ROM, REL, CON) __text_start: ; RAM area usage ; AREA data (RAM, REL, CON) ; initialized RAM __data_start: AREA virtual_registers (RAM, REL, CON) ; Temp vars of C compiler AREA InterruptRAM (RAM, REL, CON) ; Interrupts, on Page 0 AREA bss (RAM, REL, CON) ; general use __bss_start: ENDIF ; TOOLCHAIN ; end of file boot.asm
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 .byte 0xe4 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 90 10 00 mov $0x109000,%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 c0 b5 10 80 mov $0x8010b5c0,%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 e0 2d 10 80 mov $0x80102de0,%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: 53 push %ebx //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++){ 80100044: bb f4 b5 10 80 mov $0x8010b5f4,%ebx { 80100049: 83 ec 14 sub $0x14,%esp initlock(&bcache.lock, "bcache"); 8010004c: c7 44 24 04 20 6e 10 movl $0x80106e20,0x4(%esp) 80100053: 80 80100054: c7 04 24 c0 b5 10 80 movl $0x8010b5c0,(%esp) 8010005b: e8 20 40 00 00 call 80104080 <initlock> bcache.head.next = &bcache.head; 80100060: ba bc fc 10 80 mov $0x8010fcbc,%edx bcache.head.prev = &bcache.head; 80100065: c7 05 0c fd 10 80 bc movl $0x8010fcbc,0x8010fd0c 8010006c: fc 10 80 bcache.head.next = &bcache.head; 8010006f: c7 05 10 fd 10 80 bc movl $0x8010fcbc,0x8010fd10 80100076: fc 10 80 80100079: eb 09 jmp 80100084 <binit+0x44> 8010007b: 90 nop 8010007c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100080: 89 da mov %ebx,%edx for(b = bcache.buf; b < bcache.buf+NBUF; b++){ 80100082: 89 c3 mov %eax,%ebx 80100084: 8d 43 0c lea 0xc(%ebx),%eax b->next = bcache.head.next; 80100087: 89 53 54 mov %edx,0x54(%ebx) b->prev = &bcache.head; 8010008a: c7 43 50 bc fc 10 80 movl $0x8010fcbc,0x50(%ebx) initsleeplock(&b->lock, "buffer"); 80100091: 89 04 24 mov %eax,(%esp) 80100094: c7 44 24 04 27 6e 10 movl $0x80106e27,0x4(%esp) 8010009b: 80 8010009c: e8 cf 3e 00 00 call 80103f70 <initsleeplock> bcache.head.next->prev = b; 801000a1: a1 10 fd 10 80 mov 0x8010fd10,%eax 801000a6: 89 58 50 mov %ebx,0x50(%eax) for(b = bcache.buf; b < bcache.buf+NBUF; b++){ 801000a9: 8d 83 5c 02 00 00 lea 0x25c(%ebx),%eax 801000af: 3d bc fc 10 80 cmp $0x8010fcbc,%eax bcache.head.next = b; 801000b4: 89 1d 10 fd 10 80 mov %ebx,0x8010fd10 for(b = bcache.buf; b < bcache.buf+NBUF; b++){ 801000ba: 75 c4 jne 80100080 <binit+0x40> } } 801000bc: 83 c4 14 add $0x14,%esp 801000bf: 5b pop %ebx 801000c0: 5d pop %ebp 801000c1: c3 ret 801000c2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801000c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801000d0 <bread>: } // Return a locked buf with the contents of the indicated block. struct buf* bread(uint dev, uint blockno) { 801000d0: 55 push %ebp 801000d1: 89 e5 mov %esp,%ebp 801000d3: 57 push %edi 801000d4: 56 push %esi 801000d5: 53 push %ebx 801000d6: 83 ec 1c sub $0x1c,%esp 801000d9: 8b 75 08 mov 0x8(%ebp),%esi acquire(&bcache.lock); 801000dc: c7 04 24 c0 b5 10 80 movl $0x8010b5c0,(%esp) { 801000e3: 8b 7d 0c mov 0xc(%ebp),%edi acquire(&bcache.lock); 801000e6: e8 85 40 00 00 call 80104170 <acquire> for(b = bcache.head.next; b != &bcache.head; b = b->next){ 801000eb: 8b 1d 10 fd 10 80 mov 0x8010fd10,%ebx 801000f1: 81 fb bc fc 10 80 cmp $0x8010fcbc,%ebx 801000f7: 75 12 jne 8010010b <bread+0x3b> 801000f9: eb 25 jmp 80100120 <bread+0x50> 801000fb: 90 nop 801000fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100100: 8b 5b 54 mov 0x54(%ebx),%ebx 80100103: 81 fb bc fc 10 80 cmp $0x8010fcbc,%ebx 80100109: 74 15 je 80100120 <bread+0x50> if(b->dev == dev && b->blockno == blockno){ 8010010b: 3b 73 04 cmp 0x4(%ebx),%esi 8010010e: 75 f0 jne 80100100 <bread+0x30> 80100110: 3b 7b 08 cmp 0x8(%ebx),%edi 80100113: 75 eb jne 80100100 <bread+0x30> b->refcnt++; 80100115: 83 43 4c 01 addl $0x1,0x4c(%ebx) 80100119: eb 3f jmp 8010015a <bread+0x8a> 8010011b: 90 nop 8010011c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(b = bcache.head.prev; b != &bcache.head; b = b->prev){ 80100120: 8b 1d 0c fd 10 80 mov 0x8010fd0c,%ebx 80100126: 81 fb bc fc 10 80 cmp $0x8010fcbc,%ebx 8010012c: 75 0d jne 8010013b <bread+0x6b> 8010012e: eb 58 jmp 80100188 <bread+0xb8> 80100130: 8b 5b 50 mov 0x50(%ebx),%ebx 80100133: 81 fb bc fc 10 80 cmp $0x8010fcbc,%ebx 80100139: 74 4d je 80100188 <bread+0xb8> if(b->refcnt == 0 && (b->flags & B_DIRTY) == 0) { 8010013b: 8b 43 4c mov 0x4c(%ebx),%eax 8010013e: 85 c0 test %eax,%eax 80100140: 75 ee jne 80100130 <bread+0x60> 80100142: f6 03 04 testb $0x4,(%ebx) 80100145: 75 e9 jne 80100130 <bread+0x60> b->dev = dev; 80100147: 89 73 04 mov %esi,0x4(%ebx) b->blockno = blockno; 8010014a: 89 7b 08 mov %edi,0x8(%ebx) b->flags = 0; 8010014d: c7 03 00 00 00 00 movl $0x0,(%ebx) b->refcnt = 1; 80100153: c7 43 4c 01 00 00 00 movl $0x1,0x4c(%ebx) release(&bcache.lock); 8010015a: c7 04 24 c0 b5 10 80 movl $0x8010b5c0,(%esp) 80100161: e8 fa 40 00 00 call 80104260 <release> acquiresleep(&b->lock); 80100166: 8d 43 0c lea 0xc(%ebx),%eax 80100169: 89 04 24 mov %eax,(%esp) 8010016c: e8 3f 3e 00 00 call 80103fb0 <acquiresleep> struct buf *b; b = bget(dev, blockno); if((b->flags & B_VALID) == 0) { 80100171: f6 03 02 testb $0x2,(%ebx) 80100174: 75 08 jne 8010017e <bread+0xae> iderw(b); 80100176: 89 1c 24 mov %ebx,(%esp) 80100179: e8 92 1f 00 00 call 80102110 <iderw> } return b; } 8010017e: 83 c4 1c add $0x1c,%esp 80100181: 89 d8 mov %ebx,%eax 80100183: 5b pop %ebx 80100184: 5e pop %esi 80100185: 5f pop %edi 80100186: 5d pop %ebp 80100187: c3 ret panic("bget: no buffers"); 80100188: c7 04 24 2e 6e 10 80 movl $0x80106e2e,(%esp) 8010018f: e8 cc 01 00 00 call 80100360 <panic> 80100194: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010019a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 801001a0 <bwrite>: // Write b's contents to disk. Must be locked. void bwrite(struct buf *b) { 801001a0: 55 push %ebp 801001a1: 89 e5 mov %esp,%ebp 801001a3: 53 push %ebx 801001a4: 83 ec 14 sub $0x14,%esp 801001a7: 8b 5d 08 mov 0x8(%ebp),%ebx if(!holdingsleep(&b->lock)) 801001aa: 8d 43 0c lea 0xc(%ebx),%eax 801001ad: 89 04 24 mov %eax,(%esp) 801001b0: e8 9b 3e 00 00 call 80104050 <holdingsleep> 801001b5: 85 c0 test %eax,%eax 801001b7: 74 10 je 801001c9 <bwrite+0x29> panic("bwrite"); b->flags |= B_DIRTY; 801001b9: 83 0b 04 orl $0x4,(%ebx) iderw(b); 801001bc: 89 5d 08 mov %ebx,0x8(%ebp) } 801001bf: 83 c4 14 add $0x14,%esp 801001c2: 5b pop %ebx 801001c3: 5d pop %ebp iderw(b); 801001c4: e9 47 1f 00 00 jmp 80102110 <iderw> panic("bwrite"); 801001c9: c7 04 24 3f 6e 10 80 movl $0x80106e3f,(%esp) 801001d0: e8 8b 01 00 00 call 80100360 <panic> 801001d5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801001d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801001e0 <brelse>: // Release a locked buffer. // Move to the head of the MRU list. void brelse(struct buf *b) { 801001e0: 55 push %ebp 801001e1: 89 e5 mov %esp,%ebp 801001e3: 56 push %esi 801001e4: 53 push %ebx 801001e5: 83 ec 10 sub $0x10,%esp 801001e8: 8b 5d 08 mov 0x8(%ebp),%ebx if(!holdingsleep(&b->lock)) 801001eb: 8d 73 0c lea 0xc(%ebx),%esi 801001ee: 89 34 24 mov %esi,(%esp) 801001f1: e8 5a 3e 00 00 call 80104050 <holdingsleep> 801001f6: 85 c0 test %eax,%eax 801001f8: 74 5b je 80100255 <brelse+0x75> panic("brelse"); releasesleep(&b->lock); 801001fa: 89 34 24 mov %esi,(%esp) 801001fd: e8 0e 3e 00 00 call 80104010 <releasesleep> acquire(&bcache.lock); 80100202: c7 04 24 c0 b5 10 80 movl $0x8010b5c0,(%esp) 80100209: e8 62 3f 00 00 call 80104170 <acquire> b->refcnt--; if (b->refcnt == 0) { 8010020e: 83 6b 4c 01 subl $0x1,0x4c(%ebx) 80100212: 75 2f jne 80100243 <brelse+0x63> // no one is waiting for it. b->next->prev = b->prev; 80100214: 8b 43 54 mov 0x54(%ebx),%eax 80100217: 8b 53 50 mov 0x50(%ebx),%edx 8010021a: 89 50 50 mov %edx,0x50(%eax) b->prev->next = b->next; 8010021d: 8b 43 50 mov 0x50(%ebx),%eax 80100220: 8b 53 54 mov 0x54(%ebx),%edx 80100223: 89 50 54 mov %edx,0x54(%eax) b->next = bcache.head.next; 80100226: a1 10 fd 10 80 mov 0x8010fd10,%eax b->prev = &bcache.head; 8010022b: c7 43 50 bc fc 10 80 movl $0x8010fcbc,0x50(%ebx) b->next = bcache.head.next; 80100232: 89 43 54 mov %eax,0x54(%ebx) bcache.head.next->prev = b; 80100235: a1 10 fd 10 80 mov 0x8010fd10,%eax 8010023a: 89 58 50 mov %ebx,0x50(%eax) bcache.head.next = b; 8010023d: 89 1d 10 fd 10 80 mov %ebx,0x8010fd10 } release(&bcache.lock); 80100243: c7 45 08 c0 b5 10 80 movl $0x8010b5c0,0x8(%ebp) } 8010024a: 83 c4 10 add $0x10,%esp 8010024d: 5b pop %ebx 8010024e: 5e pop %esi 8010024f: 5d pop %ebp release(&bcache.lock); 80100250: e9 0b 40 00 00 jmp 80104260 <release> panic("brelse"); 80100255: c7 04 24 46 6e 10 80 movl $0x80106e46,(%esp) 8010025c: e8 ff 00 00 00 call 80100360 <panic> 80100261: 66 90 xchg %ax,%ax 80100263: 66 90 xchg %ax,%ax 80100265: 66 90 xchg %ax,%ax 80100267: 66 90 xchg %ax,%ax 80100269: 66 90 xchg %ax,%ax 8010026b: 66 90 xchg %ax,%ax 8010026d: 66 90 xchg %ax,%ax 8010026f: 90 nop 80100270 <consoleread>: } } int consoleread(struct inode *ip, char *dst, int n) { 80100270: 55 push %ebp 80100271: 89 e5 mov %esp,%ebp 80100273: 57 push %edi 80100274: 56 push %esi 80100275: 53 push %ebx 80100276: 83 ec 1c sub $0x1c,%esp 80100279: 8b 7d 08 mov 0x8(%ebp),%edi 8010027c: 8b 75 0c mov 0xc(%ebp),%esi uint target; int c; iunlock(ip); 8010027f: 89 3c 24 mov %edi,(%esp) 80100282: e8 f9 14 00 00 call 80101780 <iunlock> target = n; acquire(&cons.lock); 80100287: c7 04 24 20 a5 10 80 movl $0x8010a520,(%esp) 8010028e: e8 dd 3e 00 00 call 80104170 <acquire> while(n > 0){ 80100293: 8b 55 10 mov 0x10(%ebp),%edx 80100296: 85 d2 test %edx,%edx 80100298: 0f 8e bc 00 00 00 jle 8010035a <consoleread+0xea> 8010029e: 8b 5d 10 mov 0x10(%ebp),%ebx 801002a1: eb 25 jmp 801002c8 <consoleread+0x58> 801002a3: 90 nop 801002a4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi while(input.r == input.w){ if(myproc()->killed){ 801002a8: e8 e3 33 00 00 call 80103690 <myproc> 801002ad: 8b 40 2c mov 0x2c(%eax),%eax 801002b0: 85 c0 test %eax,%eax 801002b2: 75 74 jne 80100328 <consoleread+0xb8> release(&cons.lock); ilock(ip); return -1; } sleep(&input.r, &cons.lock); 801002b4: c7 44 24 04 20 a5 10 movl $0x8010a520,0x4(%esp) 801002bb: 80 801002bc: c7 04 24 a0 ff 10 80 movl $0x8010ffa0,(%esp) 801002c3: e8 48 39 00 00 call 80103c10 <sleep> while(input.r == input.w){ 801002c8: a1 a0 ff 10 80 mov 0x8010ffa0,%eax 801002cd: 3b 05 a4 ff 10 80 cmp 0x8010ffa4,%eax 801002d3: 74 d3 je 801002a8 <consoleread+0x38> } c = input.buf[input.r++ % INPUT_BUF]; 801002d5: 8d 50 01 lea 0x1(%eax),%edx 801002d8: 89 15 a0 ff 10 80 mov %edx,0x8010ffa0 801002de: 89 c2 mov %eax,%edx 801002e0: 83 e2 7f and $0x7f,%edx 801002e3: 0f b6 8a 20 ff 10 80 movzbl -0x7fef00e0(%edx),%ecx 801002ea: 0f be d1 movsbl %cl,%edx if(c == C('D')){ // EOF 801002ed: 83 fa 04 cmp $0x4,%edx 801002f0: 74 57 je 80100349 <consoleread+0xd9> // caller gets a 0-byte result. input.r--; } break; } *dst++ = c; 801002f2: 83 c6 01 add $0x1,%esi --n; 801002f5: 83 eb 01 sub $0x1,%ebx if(c == '\n') 801002f8: 83 fa 0a cmp $0xa,%edx *dst++ = c; 801002fb: 88 4e ff mov %cl,-0x1(%esi) if(c == '\n') 801002fe: 74 53 je 80100353 <consoleread+0xe3> while(n > 0){ 80100300: 85 db test %ebx,%ebx 80100302: 75 c4 jne 801002c8 <consoleread+0x58> 80100304: 8b 45 10 mov 0x10(%ebp),%eax break; } release(&cons.lock); 80100307: c7 04 24 20 a5 10 80 movl $0x8010a520,(%esp) 8010030e: 89 45 e4 mov %eax,-0x1c(%ebp) 80100311: e8 4a 3f 00 00 call 80104260 <release> ilock(ip); 80100316: 89 3c 24 mov %edi,(%esp) 80100319: e8 82 13 00 00 call 801016a0 <ilock> 8010031e: 8b 45 e4 mov -0x1c(%ebp),%eax return target - n; 80100321: eb 1e jmp 80100341 <consoleread+0xd1> 80100323: 90 nop 80100324: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi release(&cons.lock); 80100328: c7 04 24 20 a5 10 80 movl $0x8010a520,(%esp) 8010032f: e8 2c 3f 00 00 call 80104260 <release> ilock(ip); 80100334: 89 3c 24 mov %edi,(%esp) 80100337: e8 64 13 00 00 call 801016a0 <ilock> return -1; 8010033c: b8 ff ff ff ff mov $0xffffffff,%eax } 80100341: 83 c4 1c add $0x1c,%esp 80100344: 5b pop %ebx 80100345: 5e pop %esi 80100346: 5f pop %edi 80100347: 5d pop %ebp 80100348: c3 ret if(n < target){ 80100349: 39 5d 10 cmp %ebx,0x10(%ebp) 8010034c: 76 05 jbe 80100353 <consoleread+0xe3> input.r--; 8010034e: a3 a0 ff 10 80 mov %eax,0x8010ffa0 80100353: 8b 45 10 mov 0x10(%ebp),%eax 80100356: 29 d8 sub %ebx,%eax 80100358: eb ad jmp 80100307 <consoleread+0x97> while(n > 0){ 8010035a: 31 c0 xor %eax,%eax 8010035c: eb a9 jmp 80100307 <consoleread+0x97> 8010035e: 66 90 xchg %ax,%ax 80100360 <panic>: { 80100360: 55 push %ebp 80100361: 89 e5 mov %esp,%ebp 80100363: 56 push %esi 80100364: 53 push %ebx 80100365: 83 ec 40 sub $0x40,%esp } static inline void cli(void) { asm volatile("cli"); 80100368: fa cli cons.locking = 0; 80100369: c7 05 54 a5 10 80 00 movl $0x0,0x8010a554 80100370: 00 00 00 getcallerpcs(&s, pcs); 80100373: 8d 5d d0 lea -0x30(%ebp),%ebx cprintf("lapicid %d: panic: ", lapicid()); 80100376: e8 d5 23 00 00 call 80102750 <lapicid> 8010037b: 8d 75 f8 lea -0x8(%ebp),%esi 8010037e: c7 04 24 4d 6e 10 80 movl $0x80106e4d,(%esp) 80100385: 89 44 24 04 mov %eax,0x4(%esp) 80100389: e8 c2 02 00 00 call 80100650 <cprintf> cprintf(s); 8010038e: 8b 45 08 mov 0x8(%ebp),%eax 80100391: 89 04 24 mov %eax,(%esp) 80100394: e8 b7 02 00 00 call 80100650 <cprintf> cprintf("\n"); 80100399: c7 04 24 9f 77 10 80 movl $0x8010779f,(%esp) 801003a0: e8 ab 02 00 00 call 80100650 <cprintf> getcallerpcs(&s, pcs); 801003a5: 8d 45 08 lea 0x8(%ebp),%eax 801003a8: 89 5c 24 04 mov %ebx,0x4(%esp) 801003ac: 89 04 24 mov %eax,(%esp) 801003af: e8 ec 3c 00 00 call 801040a0 <getcallerpcs> 801003b4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi cprintf(" %p", pcs[i]); 801003b8: 8b 03 mov (%ebx),%eax 801003ba: 83 c3 04 add $0x4,%ebx 801003bd: c7 04 24 61 6e 10 80 movl $0x80106e61,(%esp) 801003c4: 89 44 24 04 mov %eax,0x4(%esp) 801003c8: e8 83 02 00 00 call 80100650 <cprintf> for(i=0; i<10; i++) 801003cd: 39 f3 cmp %esi,%ebx 801003cf: 75 e7 jne 801003b8 <panic+0x58> panicked = 1; // freeze other CPU 801003d1: c7 05 58 a5 10 80 01 movl $0x1,0x8010a558 801003d8: 00 00 00 801003db: eb fe jmp 801003db <panic+0x7b> 801003dd: 8d 76 00 lea 0x0(%esi),%esi 801003e0 <consputc>: if(panicked){ 801003e0: 8b 15 58 a5 10 80 mov 0x8010a558,%edx 801003e6: 85 d2 test %edx,%edx 801003e8: 74 06 je 801003f0 <consputc+0x10> 801003ea: fa cli 801003eb: eb fe jmp 801003eb <consputc+0xb> 801003ed: 8d 76 00 lea 0x0(%esi),%esi { 801003f0: 55 push %ebp 801003f1: 89 e5 mov %esp,%ebp 801003f3: 57 push %edi 801003f4: 56 push %esi 801003f5: 53 push %ebx 801003f6: 89 c3 mov %eax,%ebx 801003f8: 83 ec 1c sub $0x1c,%esp if(c == BACKSPACE){ 801003fb: 3d 00 01 00 00 cmp $0x100,%eax 80100400: 0f 84 ac 00 00 00 je 801004b2 <consputc+0xd2> uartputc(c); 80100406: 89 04 24 mov %eax,(%esp) 80100409: e8 f2 53 00 00 call 80105800 <uartputc> asm volatile("out %0,%1" : : "a" (data), "d" (port)); 8010040e: bf d4 03 00 00 mov $0x3d4,%edi 80100413: b8 0e 00 00 00 mov $0xe,%eax 80100418: 89 fa mov %edi,%edx 8010041a: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010041b: be d5 03 00 00 mov $0x3d5,%esi 80100420: 89 f2 mov %esi,%edx 80100422: ec in (%dx),%al pos = inb(CRTPORT+1) << 8; 80100423: 0f b6 c8 movzbl %al,%ecx asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80100426: 89 fa mov %edi,%edx 80100428: c1 e1 08 shl $0x8,%ecx 8010042b: b8 0f 00 00 00 mov $0xf,%eax 80100430: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80100431: 89 f2 mov %esi,%edx 80100433: ec in (%dx),%al pos |= inb(CRTPORT+1); 80100434: 0f b6 c0 movzbl %al,%eax 80100437: 09 c1 or %eax,%ecx if(c == '\n') 80100439: 83 fb 0a cmp $0xa,%ebx 8010043c: 0f 84 0d 01 00 00 je 8010054f <consputc+0x16f> else if(c == BACKSPACE){ 80100442: 81 fb 00 01 00 00 cmp $0x100,%ebx 80100448: 0f 84 e8 00 00 00 je 80100536 <consputc+0x156> crt[pos++] = (c&0xff) | 0x0700; // black on white 8010044e: 0f b6 db movzbl %bl,%ebx 80100451: 80 cf 07 or $0x7,%bh 80100454: 8d 79 01 lea 0x1(%ecx),%edi 80100457: 66 89 9c 09 00 80 0b mov %bx,-0x7ff48000(%ecx,%ecx,1) 8010045e: 80 if(pos < 0 || pos > 25*80) 8010045f: 81 ff d0 07 00 00 cmp $0x7d0,%edi 80100465: 0f 87 bf 00 00 00 ja 8010052a <consputc+0x14a> if((pos/80) >= 24){ // Scroll up. 8010046b: 81 ff 7f 07 00 00 cmp $0x77f,%edi 80100471: 7f 68 jg 801004db <consputc+0xfb> 80100473: 89 f8 mov %edi,%eax 80100475: 89 fb mov %edi,%ebx 80100477: c1 e8 08 shr $0x8,%eax 8010047a: 89 c6 mov %eax,%esi 8010047c: 8d 8c 3f 00 80 0b 80 lea -0x7ff48000(%edi,%edi,1),%ecx asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80100483: bf d4 03 00 00 mov $0x3d4,%edi 80100488: b8 0e 00 00 00 mov $0xe,%eax 8010048d: 89 fa mov %edi,%edx 8010048f: ee out %al,(%dx) 80100490: 89 f0 mov %esi,%eax 80100492: b2 d5 mov $0xd5,%dl 80100494: ee out %al,(%dx) 80100495: b8 0f 00 00 00 mov $0xf,%eax 8010049a: 89 fa mov %edi,%edx 8010049c: ee out %al,(%dx) 8010049d: 89 d8 mov %ebx,%eax 8010049f: b2 d5 mov $0xd5,%dl 801004a1: ee out %al,(%dx) crt[pos] = ' ' | 0x0700; 801004a2: b8 20 07 00 00 mov $0x720,%eax 801004a7: 66 89 01 mov %ax,(%ecx) } 801004aa: 83 c4 1c add $0x1c,%esp 801004ad: 5b pop %ebx 801004ae: 5e pop %esi 801004af: 5f pop %edi 801004b0: 5d pop %ebp 801004b1: c3 ret uartputc('\b'); uartputc(' '); uartputc('\b'); 801004b2: c7 04 24 08 00 00 00 movl $0x8,(%esp) 801004b9: e8 42 53 00 00 call 80105800 <uartputc> 801004be: c7 04 24 20 00 00 00 movl $0x20,(%esp) 801004c5: e8 36 53 00 00 call 80105800 <uartputc> 801004ca: c7 04 24 08 00 00 00 movl $0x8,(%esp) 801004d1: e8 2a 53 00 00 call 80105800 <uartputc> 801004d6: e9 33 ff ff ff jmp 8010040e <consputc+0x2e> memmove(crt, crt+80, sizeof(crt[0])*23*80); 801004db: c7 44 24 08 60 0e 00 movl $0xe60,0x8(%esp) 801004e2: 00 pos -= 80; 801004e3: 8d 5f b0 lea -0x50(%edi),%ebx memmove(crt, crt+80, sizeof(crt[0])*23*80); 801004e6: c7 44 24 04 a0 80 0b movl $0x800b80a0,0x4(%esp) 801004ed: 80 memset(crt+pos, 0, sizeof(crt[0])*(24*80 - pos)); 801004ee: 8d b4 1b 00 80 0b 80 lea -0x7ff48000(%ebx,%ebx,1),%esi memmove(crt, crt+80, sizeof(crt[0])*23*80); 801004f5: c7 04 24 00 80 0b 80 movl $0x800b8000,(%esp) 801004fc: e8 4f 3e 00 00 call 80104350 <memmove> memset(crt+pos, 0, sizeof(crt[0])*(24*80 - pos)); 80100501: b8 d0 07 00 00 mov $0x7d0,%eax 80100506: 29 f8 sub %edi,%eax 80100508: 01 c0 add %eax,%eax 8010050a: 89 34 24 mov %esi,(%esp) 8010050d: 89 44 24 08 mov %eax,0x8(%esp) 80100511: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 80100518: 00 80100519: e8 92 3d 00 00 call 801042b0 <memset> 8010051e: 89 f1 mov %esi,%ecx 80100520: be 07 00 00 00 mov $0x7,%esi 80100525: e9 59 ff ff ff jmp 80100483 <consputc+0xa3> panic("pos under/overflow"); 8010052a: c7 04 24 65 6e 10 80 movl $0x80106e65,(%esp) 80100531: e8 2a fe ff ff call 80100360 <panic> if(pos > 0) --pos; 80100536: 85 c9 test %ecx,%ecx 80100538: 8d 79 ff lea -0x1(%ecx),%edi 8010053b: 0f 85 1e ff ff ff jne 8010045f <consputc+0x7f> 80100541: b9 00 80 0b 80 mov $0x800b8000,%ecx 80100546: 31 db xor %ebx,%ebx 80100548: 31 f6 xor %esi,%esi 8010054a: e9 34 ff ff ff jmp 80100483 <consputc+0xa3> pos += 80 - pos%80; 8010054f: 89 c8 mov %ecx,%eax 80100551: ba 67 66 66 66 mov $0x66666667,%edx 80100556: f7 ea imul %edx 80100558: c1 ea 05 shr $0x5,%edx 8010055b: 8d 04 92 lea (%edx,%edx,4),%eax 8010055e: c1 e0 04 shl $0x4,%eax 80100561: 8d 78 50 lea 0x50(%eax),%edi 80100564: e9 f6 fe ff ff jmp 8010045f <consputc+0x7f> 80100569: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80100570 <printint>: { 80100570: 55 push %ebp 80100571: 89 e5 mov %esp,%ebp 80100573: 57 push %edi 80100574: 56 push %esi 80100575: 89 d6 mov %edx,%esi 80100577: 53 push %ebx 80100578: 83 ec 1c sub $0x1c,%esp if(sign && (sign = xx < 0)) 8010057b: 85 c9 test %ecx,%ecx 8010057d: 74 61 je 801005e0 <printint+0x70> 8010057f: 85 c0 test %eax,%eax 80100581: 79 5d jns 801005e0 <printint+0x70> x = -xx; 80100583: f7 d8 neg %eax 80100585: bf 01 00 00 00 mov $0x1,%edi i = 0; 8010058a: 31 c9 xor %ecx,%ecx 8010058c: eb 04 jmp 80100592 <printint+0x22> 8010058e: 66 90 xchg %ax,%ax buf[i++] = digits[x % base]; 80100590: 89 d9 mov %ebx,%ecx 80100592: 31 d2 xor %edx,%edx 80100594: f7 f6 div %esi 80100596: 8d 59 01 lea 0x1(%ecx),%ebx 80100599: 0f b6 92 90 6e 10 80 movzbl -0x7fef9170(%edx),%edx }while((x /= base) != 0); 801005a0: 85 c0 test %eax,%eax buf[i++] = digits[x % base]; 801005a2: 88 54 1d d7 mov %dl,-0x29(%ebp,%ebx,1) }while((x /= base) != 0); 801005a6: 75 e8 jne 80100590 <printint+0x20> if(sign) 801005a8: 85 ff test %edi,%edi buf[i++] = digits[x % base]; 801005aa: 89 d8 mov %ebx,%eax if(sign) 801005ac: 74 08 je 801005b6 <printint+0x46> buf[i++] = '-'; 801005ae: 8d 59 02 lea 0x2(%ecx),%ebx 801005b1: c6 44 05 d8 2d movb $0x2d,-0x28(%ebp,%eax,1) while(--i >= 0) 801005b6: 83 eb 01 sub $0x1,%ebx 801005b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi consputc(buf[i]); 801005c0: 0f be 44 1d d8 movsbl -0x28(%ebp,%ebx,1),%eax while(--i >= 0) 801005c5: 83 eb 01 sub $0x1,%ebx consputc(buf[i]); 801005c8: e8 13 fe ff ff call 801003e0 <consputc> while(--i >= 0) 801005cd: 83 fb ff cmp $0xffffffff,%ebx 801005d0: 75 ee jne 801005c0 <printint+0x50> } 801005d2: 83 c4 1c add $0x1c,%esp 801005d5: 5b pop %ebx 801005d6: 5e pop %esi 801005d7: 5f pop %edi 801005d8: 5d pop %ebp 801005d9: c3 ret 801005da: 8d b6 00 00 00 00 lea 0x0(%esi),%esi x = xx; 801005e0: 31 ff xor %edi,%edi 801005e2: eb a6 jmp 8010058a <printint+0x1a> 801005e4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801005ea: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 801005f0 <consolewrite>: int consolewrite(struct inode *ip, char *buf, int n) { 801005f0: 55 push %ebp 801005f1: 89 e5 mov %esp,%ebp 801005f3: 57 push %edi 801005f4: 56 push %esi 801005f5: 53 push %ebx 801005f6: 83 ec 1c sub $0x1c,%esp int i; iunlock(ip); 801005f9: 8b 45 08 mov 0x8(%ebp),%eax { 801005fc: 8b 75 10 mov 0x10(%ebp),%esi iunlock(ip); 801005ff: 89 04 24 mov %eax,(%esp) 80100602: e8 79 11 00 00 call 80101780 <iunlock> acquire(&cons.lock); 80100607: c7 04 24 20 a5 10 80 movl $0x8010a520,(%esp) 8010060e: e8 5d 3b 00 00 call 80104170 <acquire> 80100613: 8b 7d 0c mov 0xc(%ebp),%edi for(i = 0; i < n; i++) 80100616: 85 f6 test %esi,%esi 80100618: 8d 1c 37 lea (%edi,%esi,1),%ebx 8010061b: 7e 12 jle 8010062f <consolewrite+0x3f> 8010061d: 8d 76 00 lea 0x0(%esi),%esi consputc(buf[i] & 0xff); 80100620: 0f b6 07 movzbl (%edi),%eax 80100623: 83 c7 01 add $0x1,%edi 80100626: e8 b5 fd ff ff call 801003e0 <consputc> for(i = 0; i < n; i++) 8010062b: 39 df cmp %ebx,%edi 8010062d: 75 f1 jne 80100620 <consolewrite+0x30> release(&cons.lock); 8010062f: c7 04 24 20 a5 10 80 movl $0x8010a520,(%esp) 80100636: e8 25 3c 00 00 call 80104260 <release> ilock(ip); 8010063b: 8b 45 08 mov 0x8(%ebp),%eax 8010063e: 89 04 24 mov %eax,(%esp) 80100641: e8 5a 10 00 00 call 801016a0 <ilock> return n; } 80100646: 83 c4 1c add $0x1c,%esp 80100649: 89 f0 mov %esi,%eax 8010064b: 5b pop %ebx 8010064c: 5e pop %esi 8010064d: 5f pop %edi 8010064e: 5d pop %ebp 8010064f: c3 ret 80100650 <cprintf>: { 80100650: 55 push %ebp 80100651: 89 e5 mov %esp,%ebp 80100653: 57 push %edi 80100654: 56 push %esi 80100655: 53 push %ebx 80100656: 83 ec 1c sub $0x1c,%esp locking = cons.locking; 80100659: a1 54 a5 10 80 mov 0x8010a554,%eax if(locking) 8010065e: 85 c0 test %eax,%eax locking = cons.locking; 80100660: 89 45 e0 mov %eax,-0x20(%ebp) if(locking) 80100663: 0f 85 27 01 00 00 jne 80100790 <cprintf+0x140> if (fmt == 0) 80100669: 8b 45 08 mov 0x8(%ebp),%eax 8010066c: 85 c0 test %eax,%eax 8010066e: 89 c1 mov %eax,%ecx 80100670: 0f 84 2b 01 00 00 je 801007a1 <cprintf+0x151> for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 80100676: 0f b6 00 movzbl (%eax),%eax 80100679: 31 db xor %ebx,%ebx 8010067b: 89 cf mov %ecx,%edi 8010067d: 8d 75 0c lea 0xc(%ebp),%esi 80100680: 85 c0 test %eax,%eax 80100682: 75 4c jne 801006d0 <cprintf+0x80> 80100684: eb 5f jmp 801006e5 <cprintf+0x95> 80100686: 66 90 xchg %ax,%ax c = fmt[++i] & 0xff; 80100688: 83 c3 01 add $0x1,%ebx 8010068b: 0f b6 14 1f movzbl (%edi,%ebx,1),%edx if(c == 0) 8010068f: 85 d2 test %edx,%edx 80100691: 74 52 je 801006e5 <cprintf+0x95> switch(c){ 80100693: 83 fa 70 cmp $0x70,%edx 80100696: 74 72 je 8010070a <cprintf+0xba> 80100698: 7f 66 jg 80100700 <cprintf+0xb0> 8010069a: 83 fa 25 cmp $0x25,%edx 8010069d: 8d 76 00 lea 0x0(%esi),%esi 801006a0: 0f 84 a2 00 00 00 je 80100748 <cprintf+0xf8> 801006a6: 83 fa 64 cmp $0x64,%edx 801006a9: 75 7d jne 80100728 <cprintf+0xd8> printint(*argp++, 10, 1); 801006ab: 8d 46 04 lea 0x4(%esi),%eax 801006ae: b9 01 00 00 00 mov $0x1,%ecx 801006b3: 89 45 e4 mov %eax,-0x1c(%ebp) 801006b6: 8b 06 mov (%esi),%eax 801006b8: ba 0a 00 00 00 mov $0xa,%edx 801006bd: e8 ae fe ff ff call 80100570 <printint> 801006c2: 8b 75 e4 mov -0x1c(%ebp),%esi for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 801006c5: 83 c3 01 add $0x1,%ebx 801006c8: 0f b6 04 1f movzbl (%edi,%ebx,1),%eax 801006cc: 85 c0 test %eax,%eax 801006ce: 74 15 je 801006e5 <cprintf+0x95> if(c != '%'){ 801006d0: 83 f8 25 cmp $0x25,%eax 801006d3: 74 b3 je 80100688 <cprintf+0x38> consputc(c); 801006d5: e8 06 fd ff ff call 801003e0 <consputc> for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 801006da: 83 c3 01 add $0x1,%ebx 801006dd: 0f b6 04 1f movzbl (%edi,%ebx,1),%eax 801006e1: 85 c0 test %eax,%eax 801006e3: 75 eb jne 801006d0 <cprintf+0x80> if(locking) 801006e5: 8b 45 e0 mov -0x20(%ebp),%eax 801006e8: 85 c0 test %eax,%eax 801006ea: 74 0c je 801006f8 <cprintf+0xa8> release(&cons.lock); 801006ec: c7 04 24 20 a5 10 80 movl $0x8010a520,(%esp) 801006f3: e8 68 3b 00 00 call 80104260 <release> } 801006f8: 83 c4 1c add $0x1c,%esp 801006fb: 5b pop %ebx 801006fc: 5e pop %esi 801006fd: 5f pop %edi 801006fe: 5d pop %ebp 801006ff: c3 ret switch(c){ 80100700: 83 fa 73 cmp $0x73,%edx 80100703: 74 53 je 80100758 <cprintf+0x108> 80100705: 83 fa 78 cmp $0x78,%edx 80100708: 75 1e jne 80100728 <cprintf+0xd8> printint(*argp++, 16, 0); 8010070a: 8d 46 04 lea 0x4(%esi),%eax 8010070d: 31 c9 xor %ecx,%ecx 8010070f: 89 45 e4 mov %eax,-0x1c(%ebp) 80100712: 8b 06 mov (%esi),%eax 80100714: ba 10 00 00 00 mov $0x10,%edx 80100719: e8 52 fe ff ff call 80100570 <printint> 8010071e: 8b 75 e4 mov -0x1c(%ebp),%esi break; 80100721: eb a2 jmp 801006c5 <cprintf+0x75> 80100723: 90 nop 80100724: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi consputc('%'); 80100728: b8 25 00 00 00 mov $0x25,%eax 8010072d: 89 55 e4 mov %edx,-0x1c(%ebp) 80100730: e8 ab fc ff ff call 801003e0 <consputc> consputc(c); 80100735: 8b 55 e4 mov -0x1c(%ebp),%edx 80100738: 89 d0 mov %edx,%eax 8010073a: e8 a1 fc ff ff call 801003e0 <consputc> 8010073f: eb 99 jmp 801006da <cprintf+0x8a> 80100741: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi consputc('%'); 80100748: b8 25 00 00 00 mov $0x25,%eax 8010074d: e8 8e fc ff ff call 801003e0 <consputc> break; 80100752: e9 6e ff ff ff jmp 801006c5 <cprintf+0x75> 80100757: 90 nop if((s = (char*)*argp++) == 0) 80100758: 8d 46 04 lea 0x4(%esi),%eax 8010075b: 8b 36 mov (%esi),%esi 8010075d: 89 45 e4 mov %eax,-0x1c(%ebp) s = "(null)"; 80100760: b8 78 6e 10 80 mov $0x80106e78,%eax 80100765: 85 f6 test %esi,%esi 80100767: 0f 44 f0 cmove %eax,%esi for(; *s; s++) 8010076a: 0f be 06 movsbl (%esi),%eax 8010076d: 84 c0 test %al,%al 8010076f: 74 16 je 80100787 <cprintf+0x137> 80100771: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80100778: 83 c6 01 add $0x1,%esi consputc(*s); 8010077b: e8 60 fc ff ff call 801003e0 <consputc> for(; *s; s++) 80100780: 0f be 06 movsbl (%esi),%eax 80100783: 84 c0 test %al,%al 80100785: 75 f1 jne 80100778 <cprintf+0x128> if((s = (char*)*argp++) == 0) 80100787: 8b 75 e4 mov -0x1c(%ebp),%esi 8010078a: e9 36 ff ff ff jmp 801006c5 <cprintf+0x75> 8010078f: 90 nop acquire(&cons.lock); 80100790: c7 04 24 20 a5 10 80 movl $0x8010a520,(%esp) 80100797: e8 d4 39 00 00 call 80104170 <acquire> 8010079c: e9 c8 fe ff ff jmp 80100669 <cprintf+0x19> panic("null fmt"); 801007a1: c7 04 24 7f 6e 10 80 movl $0x80106e7f,(%esp) 801007a8: e8 b3 fb ff ff call 80100360 <panic> 801007ad: 8d 76 00 lea 0x0(%esi),%esi 801007b0 <consoleintr>: { 801007b0: 55 push %ebp 801007b1: 89 e5 mov %esp,%ebp 801007b3: 57 push %edi 801007b4: 56 push %esi int c, doprocdump = 0; 801007b5: 31 f6 xor %esi,%esi { 801007b7: 53 push %ebx 801007b8: 83 ec 1c sub $0x1c,%esp 801007bb: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&cons.lock); 801007be: c7 04 24 20 a5 10 80 movl $0x8010a520,(%esp) 801007c5: e8 a6 39 00 00 call 80104170 <acquire> 801007ca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi while((c = getc()) >= 0){ 801007d0: ff d3 call *%ebx 801007d2: 85 c0 test %eax,%eax 801007d4: 89 c7 mov %eax,%edi 801007d6: 78 48 js 80100820 <consoleintr+0x70> switch(c){ 801007d8: 83 ff 10 cmp $0x10,%edi 801007db: 0f 84 2f 01 00 00 je 80100910 <consoleintr+0x160> 801007e1: 7e 5d jle 80100840 <consoleintr+0x90> 801007e3: 83 ff 15 cmp $0x15,%edi 801007e6: 0f 84 d4 00 00 00 je 801008c0 <consoleintr+0x110> 801007ec: 83 ff 7f cmp $0x7f,%edi 801007ef: 90 nop 801007f0: 75 53 jne 80100845 <consoleintr+0x95> if(input.e != input.w){ 801007f2: a1 a8 ff 10 80 mov 0x8010ffa8,%eax 801007f7: 3b 05 a4 ff 10 80 cmp 0x8010ffa4,%eax 801007fd: 74 d1 je 801007d0 <consoleintr+0x20> input.e--; 801007ff: 83 e8 01 sub $0x1,%eax 80100802: a3 a8 ff 10 80 mov %eax,0x8010ffa8 consputc(BACKSPACE); 80100807: b8 00 01 00 00 mov $0x100,%eax 8010080c: e8 cf fb ff ff call 801003e0 <consputc> while((c = getc()) >= 0){ 80100811: ff d3 call *%ebx 80100813: 85 c0 test %eax,%eax 80100815: 89 c7 mov %eax,%edi 80100817: 79 bf jns 801007d8 <consoleintr+0x28> 80100819: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi release(&cons.lock); 80100820: c7 04 24 20 a5 10 80 movl $0x8010a520,(%esp) 80100827: e8 34 3a 00 00 call 80104260 <release> if(doprocdump) { 8010082c: 85 f6 test %esi,%esi 8010082e: 0f 85 ec 00 00 00 jne 80100920 <consoleintr+0x170> } 80100834: 83 c4 1c add $0x1c,%esp 80100837: 5b pop %ebx 80100838: 5e pop %esi 80100839: 5f pop %edi 8010083a: 5d pop %ebp 8010083b: c3 ret 8010083c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi switch(c){ 80100840: 83 ff 08 cmp $0x8,%edi 80100843: 74 ad je 801007f2 <consoleintr+0x42> if(c != 0 && input.e-input.r < INPUT_BUF){ 80100845: 85 ff test %edi,%edi 80100847: 74 87 je 801007d0 <consoleintr+0x20> 80100849: a1 a8 ff 10 80 mov 0x8010ffa8,%eax 8010084e: 89 c2 mov %eax,%edx 80100850: 2b 15 a0 ff 10 80 sub 0x8010ffa0,%edx 80100856: 83 fa 7f cmp $0x7f,%edx 80100859: 0f 87 71 ff ff ff ja 801007d0 <consoleintr+0x20> input.buf[input.e++ % INPUT_BUF] = c; 8010085f: 8d 50 01 lea 0x1(%eax),%edx 80100862: 83 e0 7f and $0x7f,%eax c = (c == '\r') ? '\n' : c; 80100865: 83 ff 0d cmp $0xd,%edi input.buf[input.e++ % INPUT_BUF] = c; 80100868: 89 15 a8 ff 10 80 mov %edx,0x8010ffa8 c = (c == '\r') ? '\n' : c; 8010086e: 0f 84 b8 00 00 00 je 8010092c <consoleintr+0x17c> input.buf[input.e++ % INPUT_BUF] = c; 80100874: 89 f9 mov %edi,%ecx 80100876: 88 88 20 ff 10 80 mov %cl,-0x7fef00e0(%eax) consputc(c); 8010087c: 89 f8 mov %edi,%eax 8010087e: e8 5d fb ff ff call 801003e0 <consputc> if(c == '\n' || c == C('D') || input.e == input.r+INPUT_BUF){ 80100883: 83 ff 04 cmp $0x4,%edi 80100886: a1 a8 ff 10 80 mov 0x8010ffa8,%eax 8010088b: 74 19 je 801008a6 <consoleintr+0xf6> 8010088d: 83 ff 0a cmp $0xa,%edi 80100890: 74 14 je 801008a6 <consoleintr+0xf6> 80100892: 8b 0d a0 ff 10 80 mov 0x8010ffa0,%ecx 80100898: 8d 91 80 00 00 00 lea 0x80(%ecx),%edx 8010089e: 39 d0 cmp %edx,%eax 801008a0: 0f 85 2a ff ff ff jne 801007d0 <consoleintr+0x20> wakeup(&input.r); 801008a6: c7 04 24 a0 ff 10 80 movl $0x8010ffa0,(%esp) input.w = input.e; 801008ad: a3 a4 ff 10 80 mov %eax,0x8010ffa4 wakeup(&input.r); 801008b2: e8 f9 34 00 00 call 80103db0 <wakeup> 801008b7: e9 14 ff ff ff jmp 801007d0 <consoleintr+0x20> 801008bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi while(input.e != input.w && 801008c0: a1 a8 ff 10 80 mov 0x8010ffa8,%eax 801008c5: 3b 05 a4 ff 10 80 cmp 0x8010ffa4,%eax 801008cb: 75 2b jne 801008f8 <consoleintr+0x148> 801008cd: e9 fe fe ff ff jmp 801007d0 <consoleintr+0x20> 801008d2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi input.e--; 801008d8: a3 a8 ff 10 80 mov %eax,0x8010ffa8 consputc(BACKSPACE); 801008dd: b8 00 01 00 00 mov $0x100,%eax 801008e2: e8 f9 fa ff ff call 801003e0 <consputc> while(input.e != input.w && 801008e7: a1 a8 ff 10 80 mov 0x8010ffa8,%eax 801008ec: 3b 05 a4 ff 10 80 cmp 0x8010ffa4,%eax 801008f2: 0f 84 d8 fe ff ff je 801007d0 <consoleintr+0x20> input.buf[(input.e-1) % INPUT_BUF] != '\n'){ 801008f8: 83 e8 01 sub $0x1,%eax 801008fb: 89 c2 mov %eax,%edx 801008fd: 83 e2 7f and $0x7f,%edx while(input.e != input.w && 80100900: 80 ba 20 ff 10 80 0a cmpb $0xa,-0x7fef00e0(%edx) 80100907: 75 cf jne 801008d8 <consoleintr+0x128> 80100909: e9 c2 fe ff ff jmp 801007d0 <consoleintr+0x20> 8010090e: 66 90 xchg %ax,%ax doprocdump = 1; 80100910: be 01 00 00 00 mov $0x1,%esi 80100915: e9 b6 fe ff ff jmp 801007d0 <consoleintr+0x20> 8010091a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi } 80100920: 83 c4 1c add $0x1c,%esp 80100923: 5b pop %ebx 80100924: 5e pop %esi 80100925: 5f pop %edi 80100926: 5d pop %ebp procdump(); // now call procdump() wo. cons.lock held 80100927: e9 74 35 00 00 jmp 80103ea0 <procdump> input.buf[input.e++ % INPUT_BUF] = c; 8010092c: c6 80 20 ff 10 80 0a movb $0xa,-0x7fef00e0(%eax) consputc(c); 80100933: b8 0a 00 00 00 mov $0xa,%eax 80100938: e8 a3 fa ff ff call 801003e0 <consputc> 8010093d: a1 a8 ff 10 80 mov 0x8010ffa8,%eax 80100942: e9 5f ff ff ff jmp 801008a6 <consoleintr+0xf6> 80100947: 89 f6 mov %esi,%esi 80100949: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80100950 <consoleinit>: void consoleinit(void) { 80100950: 55 push %ebp 80100951: 89 e5 mov %esp,%ebp 80100953: 83 ec 18 sub $0x18,%esp initlock(&cons.lock, "console"); 80100956: c7 44 24 04 88 6e 10 movl $0x80106e88,0x4(%esp) 8010095d: 80 8010095e: c7 04 24 20 a5 10 80 movl $0x8010a520,(%esp) 80100965: e8 16 37 00 00 call 80104080 <initlock> devsw[CONSOLE].write = consolewrite; devsw[CONSOLE].read = consoleread; cons.locking = 1; ioapicenable(IRQ_KBD, 0); 8010096a: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 80100971: 00 80100972: c7 04 24 01 00 00 00 movl $0x1,(%esp) devsw[CONSOLE].write = consolewrite; 80100979: c7 05 6c 09 11 80 f0 movl $0x801005f0,0x8011096c 80100980: 05 10 80 devsw[CONSOLE].read = consoleread; 80100983: c7 05 68 09 11 80 70 movl $0x80100270,0x80110968 8010098a: 02 10 80 cons.locking = 1; 8010098d: c7 05 54 a5 10 80 01 movl $0x1,0x8010a554 80100994: 00 00 00 ioapicenable(IRQ_KBD, 0); 80100997: e8 04 19 00 00 call 801022a0 <ioapicenable> } 8010099c: c9 leave 8010099d: c3 ret 8010099e: 66 90 xchg %ax,%ax 801009a0 <exec>: #include "x86.h" #include "elf.h" int exec(char *path, char **argv) { 801009a0: 55 push %ebp 801009a1: 89 e5 mov %esp,%ebp 801009a3: 57 push %edi 801009a4: 56 push %esi 801009a5: 53 push %ebx 801009a6: 81 ec 2c 01 00 00 sub $0x12c,%esp uint argc, sz, sm, sp, ustack[3+MAXARG+1]; struct elfhdr elf; struct inode *ip; struct proghdr ph; pde_t *pgdir, *oldpgdir; struct proc *curproc = myproc(); 801009ac: e8 df 2c 00 00 call 80103690 <myproc> 801009b1: 89 85 f4 fe ff ff mov %eax,-0x10c(%ebp) begin_op(); 801009b7: e8 44 21 00 00 call 80102b00 <begin_op> if((ip = namei(path)) == 0){ 801009bc: 8b 45 08 mov 0x8(%ebp),%eax 801009bf: 89 04 24 mov %eax,(%esp) 801009c2: e8 29 15 00 00 call 80101ef0 <namei> 801009c7: 85 c0 test %eax,%eax 801009c9: 89 c3 mov %eax,%ebx 801009cb: 0f 84 47 02 00 00 je 80100c18 <exec+0x278> end_op(); cprintf("exec: fail\n"); return -1; } ilock(ip); 801009d1: 89 04 24 mov %eax,(%esp) 801009d4: e8 c7 0c 00 00 call 801016a0 <ilock> pgdir = 0; // Check ELF header if(readi(ip, (char*)&elf, 0, sizeof(elf)) != sizeof(elf)) 801009d9: 8d 85 24 ff ff ff lea -0xdc(%ebp),%eax 801009df: c7 44 24 0c 34 00 00 movl $0x34,0xc(%esp) 801009e6: 00 801009e7: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp) 801009ee: 00 801009ef: 89 44 24 04 mov %eax,0x4(%esp) 801009f3: 89 1c 24 mov %ebx,(%esp) 801009f6: e8 55 0f 00 00 call 80101950 <readi> 801009fb: 83 f8 34 cmp $0x34,%eax 801009fe: 74 20 je 80100a20 <exec+0x80> bad: if(pgdir) freevm(pgdir); if(ip){ iunlockput(ip); 80100a00: 89 1c 24 mov %ebx,(%esp) 80100a03: e8 f8 0e 00 00 call 80101900 <iunlockput> end_op(); 80100a08: e8 63 21 00 00 call 80102b70 <end_op> } return -1; 80100a0d: b8 ff ff ff ff mov $0xffffffff,%eax } 80100a12: 81 c4 2c 01 00 00 add $0x12c,%esp 80100a18: 5b pop %ebx 80100a19: 5e pop %esi 80100a1a: 5f pop %edi 80100a1b: 5d pop %ebp 80100a1c: c3 ret 80100a1d: 8d 76 00 lea 0x0(%esi),%esi if(elf.magic != ELF_MAGIC) 80100a20: 81 bd 24 ff ff ff 7f cmpl $0x464c457f,-0xdc(%ebp) 80100a27: 45 4c 46 80100a2a: 75 d4 jne 80100a00 <exec+0x60> if((pgdir = setupkvm()) == 0) 80100a2c: e8 df 5f 00 00 call 80106a10 <setupkvm> 80100a31: 85 c0 test %eax,%eax 80100a33: 89 85 f0 fe ff ff mov %eax,-0x110(%ebp) 80100a39: 74 c5 je 80100a00 <exec+0x60> for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){ 80100a3b: 66 83 bd 50 ff ff ff cmpw $0x0,-0xb0(%ebp) 80100a42: 00 80100a43: 8b b5 40 ff ff ff mov -0xc0(%ebp),%esi sz = 0; 80100a49: c7 85 ec fe ff ff 00 movl $0x0,-0x114(%ebp) 80100a50: 00 00 00 for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){ 80100a53: 0f 84 da 00 00 00 je 80100b33 <exec+0x193> 80100a59: 31 ff xor %edi,%edi 80100a5b: eb 18 jmp 80100a75 <exec+0xd5> 80100a5d: 8d 76 00 lea 0x0(%esi),%esi 80100a60: 0f b7 85 50 ff ff ff movzwl -0xb0(%ebp),%eax 80100a67: 83 c7 01 add $0x1,%edi 80100a6a: 83 c6 20 add $0x20,%esi 80100a6d: 39 f8 cmp %edi,%eax 80100a6f: 0f 8e be 00 00 00 jle 80100b33 <exec+0x193> if(readi(ip, (char*)&ph, off, sizeof(ph)) != sizeof(ph)) 80100a75: 8d 85 04 ff ff ff lea -0xfc(%ebp),%eax 80100a7b: c7 44 24 0c 20 00 00 movl $0x20,0xc(%esp) 80100a82: 00 80100a83: 89 74 24 08 mov %esi,0x8(%esp) 80100a87: 89 44 24 04 mov %eax,0x4(%esp) 80100a8b: 89 1c 24 mov %ebx,(%esp) 80100a8e: e8 bd 0e 00 00 call 80101950 <readi> 80100a93: 83 f8 20 cmp $0x20,%eax 80100a96: 0f 85 84 00 00 00 jne 80100b20 <exec+0x180> if(ph.type != ELF_PROG_LOAD) 80100a9c: 83 bd 04 ff ff ff 01 cmpl $0x1,-0xfc(%ebp) 80100aa3: 75 bb jne 80100a60 <exec+0xc0> if(ph.memsz < ph.filesz) 80100aa5: 8b 85 18 ff ff ff mov -0xe8(%ebp),%eax 80100aab: 3b 85 14 ff ff ff cmp -0xec(%ebp),%eax 80100ab1: 72 6d jb 80100b20 <exec+0x180> if(ph.vaddr + ph.memsz < ph.vaddr) 80100ab3: 03 85 0c ff ff ff add -0xf4(%ebp),%eax 80100ab9: 72 65 jb 80100b20 <exec+0x180> if((sz = allocuvm(pgdir, sz, ph.vaddr + ph.memsz)) == 0) 80100abb: 89 44 24 08 mov %eax,0x8(%esp) 80100abf: 8b 85 ec fe ff ff mov -0x114(%ebp),%eax 80100ac5: 89 44 24 04 mov %eax,0x4(%esp) 80100ac9: 8b 85 f0 fe ff ff mov -0x110(%ebp),%eax 80100acf: 89 04 24 mov %eax,(%esp) 80100ad2: e8 99 5d 00 00 call 80106870 <allocuvm> 80100ad7: 85 c0 test %eax,%eax 80100ad9: 89 85 ec fe ff ff mov %eax,-0x114(%ebp) 80100adf: 74 3f je 80100b20 <exec+0x180> if(ph.vaddr % PGSIZE != 0) 80100ae1: 8b 85 0c ff ff ff mov -0xf4(%ebp),%eax 80100ae7: a9 ff 0f 00 00 test $0xfff,%eax 80100aec: 75 32 jne 80100b20 <exec+0x180> if(loaduvm(pgdir, (char*)ph.vaddr, ip, ph.off, ph.filesz) < 0) 80100aee: 8b 95 14 ff ff ff mov -0xec(%ebp),%edx 80100af4: 89 44 24 04 mov %eax,0x4(%esp) 80100af8: 8b 85 f0 fe ff ff mov -0x110(%ebp),%eax 80100afe: 89 5c 24 08 mov %ebx,0x8(%esp) 80100b02: 89 54 24 10 mov %edx,0x10(%esp) 80100b06: 8b 95 08 ff ff ff mov -0xf8(%ebp),%edx 80100b0c: 89 04 24 mov %eax,(%esp) 80100b0f: 89 54 24 0c mov %edx,0xc(%esp) 80100b13: e8 98 5c 00 00 call 801067b0 <loaduvm> 80100b18: 85 c0 test %eax,%eax 80100b1a: 0f 89 40 ff ff ff jns 80100a60 <exec+0xc0> freevm(pgdir); 80100b20: 8b 85 f0 fe ff ff mov -0x110(%ebp),%eax 80100b26: 89 04 24 mov %eax,(%esp) 80100b29: e8 62 5e 00 00 call 80106990 <freevm> 80100b2e: e9 cd fe ff ff jmp 80100a00 <exec+0x60> iunlockput(ip); 80100b33: 89 1c 24 mov %ebx,(%esp) 80100b36: e8 c5 0d 00 00 call 80101900 <iunlockput> 80100b3b: 90 nop 80100b3c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi end_op(); 80100b40: e8 2b 20 00 00 call 80102b70 <end_op> if((sm = allocuvm(pgdir, sm - PGSIZE, sm)) == 0){ goto bad; } 80100b45: 8b 85 f0 fe ff ff mov -0x110(%ebp),%eax 80100b4b: c7 44 24 08 fc ff ff movl $0x7ffffffc,0x8(%esp) 80100b52: 7f 80100b53: c7 44 24 04 fc ef ff movl $0x7fffeffc,0x4(%esp) 80100b5a: 7f 80100b5b: 89 04 24 mov %eax,(%esp) 80100b5e: e8 0d 5d 00 00 call 80106870 <allocuvm> 80100b63: 85 c0 test %eax,%eax 80100b65: 89 85 e4 fe ff ff mov %eax,-0x11c(%ebp) 80100b6b: 0f 84 8f 00 00 00 je 80100c00 <exec+0x260> for(argc = 0; argv[argc]; argc++) { 80100b71: 8b 45 0c mov 0xc(%ebp),%eax 80100b74: 8b 00 mov (%eax),%eax 80100b76: 85 c0 test %eax,%eax 80100b78: 0f 84 9c 01 00 00 je 80100d1a <exec+0x37a> 80100b7e: 8b 4d 0c mov 0xc(%ebp),%ecx 80100b81: 31 d2 xor %edx,%edx 80100b83: 8b 9d e4 fe ff ff mov -0x11c(%ebp),%ebx 80100b89: 8d 71 04 lea 0x4(%ecx),%esi 80100b8c: 89 cf mov %ecx,%edi 80100b8e: 89 f1 mov %esi,%ecx 80100b90: 89 d6 mov %edx,%esi 80100b92: 89 ca mov %ecx,%edx 80100b94: eb 28 jmp 80100bbe <exec+0x21e> 80100b96: 66 90 xchg %ax,%ax 80100b98: 8b 95 e8 fe ff ff mov -0x118(%ebp),%edx ustack[3+argc] = sp; 80100b9e: 8d 8d 58 ff ff ff lea -0xa8(%ebp),%ecx 80100ba4: 89 9c b5 64 ff ff ff mov %ebx,-0x9c(%ebp,%esi,4) for(argc = 0; argv[argc]; argc++) { 80100bab: 83 c6 01 add $0x1,%esi 80100bae: 8b 02 mov (%edx),%eax 80100bb0: 89 d7 mov %edx,%edi 80100bb2: 85 c0 test %eax,%eax 80100bb4: 74 7d je 80100c33 <exec+0x293> 80100bb6: 83 c2 04 add $0x4,%edx if(argc >= MAXARG) 80100bb9: 83 fe 20 cmp $0x20,%esi 80100bbc: 74 42 je 80100c00 <exec+0x260> sp = (sp - (strlen(argv[argc]) + 1)) & ~3; 80100bbe: 89 04 24 mov %eax,(%esp) 80100bc1: 89 95 e8 fe ff ff mov %edx,-0x118(%ebp) 80100bc7: e8 04 39 00 00 call 801044d0 <strlen> 80100bcc: f7 d0 not %eax 80100bce: 01 c3 add %eax,%ebx if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0) 80100bd0: 8b 07 mov (%edi),%eax sp = (sp - (strlen(argv[argc]) + 1)) & ~3; 80100bd2: 83 e3 fc and $0xfffffffc,%ebx if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0) 80100bd5: 89 04 24 mov %eax,(%esp) 80100bd8: e8 f3 38 00 00 call 801044d0 <strlen> 80100bdd: 83 c0 01 add $0x1,%eax 80100be0: 89 44 24 0c mov %eax,0xc(%esp) 80100be4: 8b 07 mov (%edi),%eax 80100be6: 89 5c 24 04 mov %ebx,0x4(%esp) 80100bea: 89 44 24 08 mov %eax,0x8(%esp) 80100bee: 8b 85 f0 fe ff ff mov -0x110(%ebp),%eax 80100bf4: 89 04 24 mov %eax,(%esp) 80100bf7: e8 04 61 00 00 call 80106d00 <copyout> 80100bfc: 85 c0 test %eax,%eax 80100bfe: 79 98 jns 80100b98 <exec+0x1f8> freevm(pgdir); 80100c00: 8b 85 f0 fe ff ff mov -0x110(%ebp),%eax 80100c06: 89 04 24 mov %eax,(%esp) 80100c09: e8 82 5d 00 00 call 80106990 <freevm> return -1; 80100c0e: b8 ff ff ff ff mov $0xffffffff,%eax 80100c13: e9 fa fd ff ff jmp 80100a12 <exec+0x72> end_op(); 80100c18: e8 53 1f 00 00 call 80102b70 <end_op> cprintf("exec: fail\n"); 80100c1d: c7 04 24 a1 6e 10 80 movl $0x80106ea1,(%esp) 80100c24: e8 27 fa ff ff call 80100650 <cprintf> return -1; 80100c29: b8 ff ff ff ff mov $0xffffffff,%eax 80100c2e: e9 df fd ff ff jmp 80100a12 <exec+0x72> 80100c33: 89 f2 mov %esi,%edx ustack[3+argc] = 0; 80100c35: c7 84 95 64 ff ff ff movl $0x0,-0x9c(%ebp,%edx,4) 80100c3c: 00 00 00 00 ustack[2] = sp - (argc+1)*4; // argv pointer 80100c40: 8d 04 95 04 00 00 00 lea 0x4(,%edx,4),%eax ustack[1] = argc; 80100c47: 89 95 5c ff ff ff mov %edx,-0xa4(%ebp) ustack[2] = sp - (argc+1)*4; // argv pointer 80100c4d: 89 da mov %ebx,%edx 80100c4f: 29 c2 sub %eax,%edx sp -= (3+argc+1) * 4; 80100c51: 83 c0 0c add $0xc,%eax 80100c54: 29 c3 sub %eax,%ebx if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0) 80100c56: 89 44 24 0c mov %eax,0xc(%esp) 80100c5a: 8b 85 f0 fe ff ff mov -0x110(%ebp),%eax 80100c60: 89 4c 24 08 mov %ecx,0x8(%esp) 80100c64: 89 5c 24 04 mov %ebx,0x4(%esp) ustack[0] = 0xffffffff; // fake return PC 80100c68: c7 85 58 ff ff ff ff movl $0xffffffff,-0xa8(%ebp) 80100c6f: ff ff ff if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0) 80100c72: 89 04 24 mov %eax,(%esp) ustack[2] = sp - (argc+1)*4; // argv pointer 80100c75: 89 95 60 ff ff ff mov %edx,-0xa0(%ebp) if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0) 80100c7b: e8 80 60 00 00 call 80106d00 <copyout> 80100c80: 85 c0 test %eax,%eax 80100c82: 0f 88 78 ff ff ff js 80100c00 <exec+0x260> for(last=s=path; *s; s++) 80100c88: 8b 45 08 mov 0x8(%ebp),%eax 80100c8b: 0f b6 10 movzbl (%eax),%edx 80100c8e: 84 d2 test %dl,%dl 80100c90: 74 19 je 80100cab <exec+0x30b> 80100c92: 8b 4d 08 mov 0x8(%ebp),%ecx 80100c95: 83 c0 01 add $0x1,%eax last = s+1; 80100c98: 80 fa 2f cmp $0x2f,%dl for(last=s=path; *s; s++) 80100c9b: 0f b6 10 movzbl (%eax),%edx last = s+1; 80100c9e: 0f 44 c8 cmove %eax,%ecx 80100ca1: 83 c0 01 add $0x1,%eax for(last=s=path; *s; s++) 80100ca4: 84 d2 test %dl,%dl 80100ca6: 75 f0 jne 80100c98 <exec+0x2f8> 80100ca8: 89 4d 08 mov %ecx,0x8(%ebp) safestrcpy(curproc->name, last, sizeof(curproc->name)); 80100cab: 8b bd f4 fe ff ff mov -0x10c(%ebp),%edi 80100cb1: 8b 45 08 mov 0x8(%ebp),%eax 80100cb4: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp) 80100cbb: 00 80100cbc: 89 44 24 04 mov %eax,0x4(%esp) 80100cc0: 89 f8 mov %edi,%eax 80100cc2: 83 c0 74 add $0x74,%eax 80100cc5: 89 04 24 mov %eax,(%esp) 80100cc8: e8 c3 37 00 00 call 80104490 <safestrcpy> curproc->pgdir = pgdir; 80100ccd: 8b 8d f0 fe ff ff mov -0x110(%ebp),%ecx oldpgdir = curproc->pgdir; 80100cd3: 8b 77 0c mov 0xc(%edi),%esi curproc->spgcount = 1; 80100cd6: c7 47 08 01 00 00 00 movl $0x1,0x8(%edi) curproc->tf->eip = elf.entry; // main 80100cdd: 8b 47 20 mov 0x20(%edi),%eax curproc->pgdir = pgdir; 80100ce0: 89 4f 0c mov %ecx,0xc(%edi) curproc->sz = sz; 80100ce3: 8b 8d ec fe ff ff mov -0x114(%ebp),%ecx 80100ce9: 89 0f mov %ecx,(%edi) curproc->sm = sm; 80100ceb: 8b 8d e4 fe ff ff mov -0x11c(%ebp),%ecx 80100cf1: 89 4f 04 mov %ecx,0x4(%edi) curproc->tf->eip = elf.entry; // main 80100cf4: 8b 95 3c ff ff ff mov -0xc4(%ebp),%edx 80100cfa: 89 50 38 mov %edx,0x38(%eax) curproc->tf->esp = sp; 80100cfd: 8b 47 20 mov 0x20(%edi),%eax 80100d00: 89 58 44 mov %ebx,0x44(%eax) switchuvm(curproc); 80100d03: 89 3c 24 mov %edi,(%esp) 80100d06: e8 05 59 00 00 call 80106610 <switchuvm> freevm(oldpgdir); 80100d0b: 89 34 24 mov %esi,(%esp) 80100d0e: e8 7d 5c 00 00 call 80106990 <freevm> return 0; 80100d13: 31 c0 xor %eax,%eax 80100d15: e9 f8 fc ff ff jmp 80100a12 <exec+0x72> for(argc = 0; argv[argc]; argc++) { 80100d1a: 8b 9d e4 fe ff ff mov -0x11c(%ebp),%ebx 80100d20: 31 d2 xor %edx,%edx 80100d22: 8d 8d 58 ff ff ff lea -0xa8(%ebp),%ecx 80100d28: e9 08 ff ff ff jmp 80100c35 <exec+0x295> 80100d2d: 66 90 xchg %ax,%ax 80100d2f: 90 nop 80100d30 <fileinit>: struct file file[NFILE]; } ftable; void fileinit(void) { 80100d30: 55 push %ebp 80100d31: 89 e5 mov %esp,%ebp 80100d33: 83 ec 18 sub $0x18,%esp initlock(&ftable.lock, "ftable"); 80100d36: c7 44 24 04 ad 6e 10 movl $0x80106ead,0x4(%esp) 80100d3d: 80 80100d3e: c7 04 24 c0 ff 10 80 movl $0x8010ffc0,(%esp) 80100d45: e8 36 33 00 00 call 80104080 <initlock> } 80100d4a: c9 leave 80100d4b: c3 ret 80100d4c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100d50 <filealloc>: // Allocate a file structure. struct file* filealloc(void) { 80100d50: 55 push %ebp 80100d51: 89 e5 mov %esp,%ebp 80100d53: 53 push %ebx struct file *f; acquire(&ftable.lock); for(f = ftable.file; f < ftable.file + NFILE; f++){ 80100d54: bb f4 ff 10 80 mov $0x8010fff4,%ebx { 80100d59: 83 ec 14 sub $0x14,%esp acquire(&ftable.lock); 80100d5c: c7 04 24 c0 ff 10 80 movl $0x8010ffc0,(%esp) 80100d63: e8 08 34 00 00 call 80104170 <acquire> 80100d68: eb 11 jmp 80100d7b <filealloc+0x2b> 80100d6a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi for(f = ftable.file; f < ftable.file + NFILE; f++){ 80100d70: 83 c3 18 add $0x18,%ebx 80100d73: 81 fb 54 09 11 80 cmp $0x80110954,%ebx 80100d79: 74 25 je 80100da0 <filealloc+0x50> if(f->ref == 0){ 80100d7b: 8b 43 04 mov 0x4(%ebx),%eax 80100d7e: 85 c0 test %eax,%eax 80100d80: 75 ee jne 80100d70 <filealloc+0x20> f->ref = 1; release(&ftable.lock); 80100d82: c7 04 24 c0 ff 10 80 movl $0x8010ffc0,(%esp) f->ref = 1; 80100d89: c7 43 04 01 00 00 00 movl $0x1,0x4(%ebx) release(&ftable.lock); 80100d90: e8 cb 34 00 00 call 80104260 <release> return f; } } release(&ftable.lock); return 0; } 80100d95: 83 c4 14 add $0x14,%esp return f; 80100d98: 89 d8 mov %ebx,%eax } 80100d9a: 5b pop %ebx 80100d9b: 5d pop %ebp 80100d9c: c3 ret 80100d9d: 8d 76 00 lea 0x0(%esi),%esi release(&ftable.lock); 80100da0: c7 04 24 c0 ff 10 80 movl $0x8010ffc0,(%esp) 80100da7: e8 b4 34 00 00 call 80104260 <release> } 80100dac: 83 c4 14 add $0x14,%esp return 0; 80100daf: 31 c0 xor %eax,%eax } 80100db1: 5b pop %ebx 80100db2: 5d pop %ebp 80100db3: c3 ret 80100db4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80100dba: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80100dc0 <filedup>: // Increment ref count for file f. struct file* filedup(struct file *f) { 80100dc0: 55 push %ebp 80100dc1: 89 e5 mov %esp,%ebp 80100dc3: 53 push %ebx 80100dc4: 83 ec 14 sub $0x14,%esp 80100dc7: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&ftable.lock); 80100dca: c7 04 24 c0 ff 10 80 movl $0x8010ffc0,(%esp) 80100dd1: e8 9a 33 00 00 call 80104170 <acquire> if(f->ref < 1) 80100dd6: 8b 43 04 mov 0x4(%ebx),%eax 80100dd9: 85 c0 test %eax,%eax 80100ddb: 7e 1a jle 80100df7 <filedup+0x37> panic("filedup"); f->ref++; 80100ddd: 83 c0 01 add $0x1,%eax 80100de0: 89 43 04 mov %eax,0x4(%ebx) release(&ftable.lock); 80100de3: c7 04 24 c0 ff 10 80 movl $0x8010ffc0,(%esp) 80100dea: e8 71 34 00 00 call 80104260 <release> return f; } 80100def: 83 c4 14 add $0x14,%esp 80100df2: 89 d8 mov %ebx,%eax 80100df4: 5b pop %ebx 80100df5: 5d pop %ebp 80100df6: c3 ret panic("filedup"); 80100df7: c7 04 24 b4 6e 10 80 movl $0x80106eb4,(%esp) 80100dfe: e8 5d f5 ff ff call 80100360 <panic> 80100e03: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80100e09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80100e10 <fileclose>: // Close file f. (Decrement ref count, close when reaches 0.) void fileclose(struct file *f) { 80100e10: 55 push %ebp 80100e11: 89 e5 mov %esp,%ebp 80100e13: 57 push %edi 80100e14: 56 push %esi 80100e15: 53 push %ebx 80100e16: 83 ec 1c sub $0x1c,%esp 80100e19: 8b 7d 08 mov 0x8(%ebp),%edi struct file ff; acquire(&ftable.lock); 80100e1c: c7 04 24 c0 ff 10 80 movl $0x8010ffc0,(%esp) 80100e23: e8 48 33 00 00 call 80104170 <acquire> if(f->ref < 1) 80100e28: 8b 57 04 mov 0x4(%edi),%edx 80100e2b: 85 d2 test %edx,%edx 80100e2d: 0f 8e 89 00 00 00 jle 80100ebc <fileclose+0xac> panic("fileclose"); if(--f->ref > 0){ 80100e33: 83 ea 01 sub $0x1,%edx 80100e36: 85 d2 test %edx,%edx 80100e38: 89 57 04 mov %edx,0x4(%edi) 80100e3b: 74 13 je 80100e50 <fileclose+0x40> release(&ftable.lock); 80100e3d: c7 45 08 c0 ff 10 80 movl $0x8010ffc0,0x8(%ebp) else if(ff.type == FD_INODE){ begin_op(); iput(ff.ip); end_op(); } } 80100e44: 83 c4 1c add $0x1c,%esp 80100e47: 5b pop %ebx 80100e48: 5e pop %esi 80100e49: 5f pop %edi 80100e4a: 5d pop %ebp release(&ftable.lock); 80100e4b: e9 10 34 00 00 jmp 80104260 <release> ff = *f; 80100e50: 0f b6 47 09 movzbl 0x9(%edi),%eax 80100e54: 8b 37 mov (%edi),%esi 80100e56: 8b 5f 0c mov 0xc(%edi),%ebx f->type = FD_NONE; 80100e59: c7 07 00 00 00 00 movl $0x0,(%edi) ff = *f; 80100e5f: 88 45 e7 mov %al,-0x19(%ebp) 80100e62: 8b 47 10 mov 0x10(%edi),%eax release(&ftable.lock); 80100e65: c7 04 24 c0 ff 10 80 movl $0x8010ffc0,(%esp) ff = *f; 80100e6c: 89 45 e0 mov %eax,-0x20(%ebp) release(&ftable.lock); 80100e6f: e8 ec 33 00 00 call 80104260 <release> if(ff.type == FD_PIPE) 80100e74: 83 fe 01 cmp $0x1,%esi 80100e77: 74 0f je 80100e88 <fileclose+0x78> else if(ff.type == FD_INODE){ 80100e79: 83 fe 02 cmp $0x2,%esi 80100e7c: 74 22 je 80100ea0 <fileclose+0x90> } 80100e7e: 83 c4 1c add $0x1c,%esp 80100e81: 5b pop %ebx 80100e82: 5e pop %esi 80100e83: 5f pop %edi 80100e84: 5d pop %ebp 80100e85: c3 ret 80100e86: 66 90 xchg %ax,%ax pipeclose(ff.pipe, ff.writable); 80100e88: 0f be 75 e7 movsbl -0x19(%ebp),%esi 80100e8c: 89 1c 24 mov %ebx,(%esp) 80100e8f: 89 74 24 04 mov %esi,0x4(%esp) 80100e93: e8 b8 23 00 00 call 80103250 <pipeclose> 80100e98: eb e4 jmp 80100e7e <fileclose+0x6e> 80100e9a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi begin_op(); 80100ea0: e8 5b 1c 00 00 call 80102b00 <begin_op> iput(ff.ip); 80100ea5: 8b 45 e0 mov -0x20(%ebp),%eax 80100ea8: 89 04 24 mov %eax,(%esp) 80100eab: e8 10 09 00 00 call 801017c0 <iput> } 80100eb0: 83 c4 1c add $0x1c,%esp 80100eb3: 5b pop %ebx 80100eb4: 5e pop %esi 80100eb5: 5f pop %edi 80100eb6: 5d pop %ebp end_op(); 80100eb7: e9 b4 1c 00 00 jmp 80102b70 <end_op> panic("fileclose"); 80100ebc: c7 04 24 bc 6e 10 80 movl $0x80106ebc,(%esp) 80100ec3: e8 98 f4 ff ff call 80100360 <panic> 80100ec8: 90 nop 80100ec9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80100ed0 <filestat>: // Get metadata about file f. int filestat(struct file *f, struct stat *st) { 80100ed0: 55 push %ebp 80100ed1: 89 e5 mov %esp,%ebp 80100ed3: 53 push %ebx 80100ed4: 83 ec 14 sub $0x14,%esp 80100ed7: 8b 5d 08 mov 0x8(%ebp),%ebx if(f->type == FD_INODE){ 80100eda: 83 3b 02 cmpl $0x2,(%ebx) 80100edd: 75 31 jne 80100f10 <filestat+0x40> ilock(f->ip); 80100edf: 8b 43 10 mov 0x10(%ebx),%eax 80100ee2: 89 04 24 mov %eax,(%esp) 80100ee5: e8 b6 07 00 00 call 801016a0 <ilock> stati(f->ip, st); 80100eea: 8b 45 0c mov 0xc(%ebp),%eax 80100eed: 89 44 24 04 mov %eax,0x4(%esp) 80100ef1: 8b 43 10 mov 0x10(%ebx),%eax 80100ef4: 89 04 24 mov %eax,(%esp) 80100ef7: e8 24 0a 00 00 call 80101920 <stati> iunlock(f->ip); 80100efc: 8b 43 10 mov 0x10(%ebx),%eax 80100eff: 89 04 24 mov %eax,(%esp) 80100f02: e8 79 08 00 00 call 80101780 <iunlock> return 0; } return -1; } 80100f07: 83 c4 14 add $0x14,%esp return 0; 80100f0a: 31 c0 xor %eax,%eax } 80100f0c: 5b pop %ebx 80100f0d: 5d pop %ebp 80100f0e: c3 ret 80100f0f: 90 nop 80100f10: 83 c4 14 add $0x14,%esp return -1; 80100f13: b8 ff ff ff ff mov $0xffffffff,%eax } 80100f18: 5b pop %ebx 80100f19: 5d pop %ebp 80100f1a: c3 ret 80100f1b: 90 nop 80100f1c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100f20 <fileread>: // Read from file f. int fileread(struct file *f, char *addr, int n) { 80100f20: 55 push %ebp 80100f21: 89 e5 mov %esp,%ebp 80100f23: 57 push %edi 80100f24: 56 push %esi 80100f25: 53 push %ebx 80100f26: 83 ec 1c sub $0x1c,%esp 80100f29: 8b 5d 08 mov 0x8(%ebp),%ebx 80100f2c: 8b 75 0c mov 0xc(%ebp),%esi 80100f2f: 8b 7d 10 mov 0x10(%ebp),%edi int r; if(f->readable == 0) 80100f32: 80 7b 08 00 cmpb $0x0,0x8(%ebx) 80100f36: 74 68 je 80100fa0 <fileread+0x80> return -1; if(f->type == FD_PIPE) 80100f38: 8b 03 mov (%ebx),%eax 80100f3a: 83 f8 01 cmp $0x1,%eax 80100f3d: 74 49 je 80100f88 <fileread+0x68> return piperead(f->pipe, addr, n); if(f->type == FD_INODE){ 80100f3f: 83 f8 02 cmp $0x2,%eax 80100f42: 75 63 jne 80100fa7 <fileread+0x87> ilock(f->ip); 80100f44: 8b 43 10 mov 0x10(%ebx),%eax 80100f47: 89 04 24 mov %eax,(%esp) 80100f4a: e8 51 07 00 00 call 801016a0 <ilock> if((r = readi(f->ip, addr, f->off, n)) > 0) 80100f4f: 89 7c 24 0c mov %edi,0xc(%esp) 80100f53: 8b 43 14 mov 0x14(%ebx),%eax 80100f56: 89 74 24 04 mov %esi,0x4(%esp) 80100f5a: 89 44 24 08 mov %eax,0x8(%esp) 80100f5e: 8b 43 10 mov 0x10(%ebx),%eax 80100f61: 89 04 24 mov %eax,(%esp) 80100f64: e8 e7 09 00 00 call 80101950 <readi> 80100f69: 85 c0 test %eax,%eax 80100f6b: 89 c6 mov %eax,%esi 80100f6d: 7e 03 jle 80100f72 <fileread+0x52> f->off += r; 80100f6f: 01 43 14 add %eax,0x14(%ebx) iunlock(f->ip); 80100f72: 8b 43 10 mov 0x10(%ebx),%eax 80100f75: 89 04 24 mov %eax,(%esp) 80100f78: e8 03 08 00 00 call 80101780 <iunlock> if((r = readi(f->ip, addr, f->off, n)) > 0) 80100f7d: 89 f0 mov %esi,%eax return r; } panic("fileread"); } 80100f7f: 83 c4 1c add $0x1c,%esp 80100f82: 5b pop %ebx 80100f83: 5e pop %esi 80100f84: 5f pop %edi 80100f85: 5d pop %ebp 80100f86: c3 ret 80100f87: 90 nop return piperead(f->pipe, addr, n); 80100f88: 8b 43 0c mov 0xc(%ebx),%eax 80100f8b: 89 45 08 mov %eax,0x8(%ebp) } 80100f8e: 83 c4 1c add $0x1c,%esp 80100f91: 5b pop %ebx 80100f92: 5e pop %esi 80100f93: 5f pop %edi 80100f94: 5d pop %ebp return piperead(f->pipe, addr, n); 80100f95: e9 36 24 00 00 jmp 801033d0 <piperead> 80100f9a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return -1; 80100fa0: b8 ff ff ff ff mov $0xffffffff,%eax 80100fa5: eb d8 jmp 80100f7f <fileread+0x5f> panic("fileread"); 80100fa7: c7 04 24 c6 6e 10 80 movl $0x80106ec6,(%esp) 80100fae: e8 ad f3 ff ff call 80100360 <panic> 80100fb3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80100fb9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80100fc0 <filewrite>: //PAGEBREAK! // Write to file f. int filewrite(struct file *f, char *addr, int n) { 80100fc0: 55 push %ebp 80100fc1: 89 e5 mov %esp,%ebp 80100fc3: 57 push %edi 80100fc4: 56 push %esi 80100fc5: 53 push %ebx 80100fc6: 83 ec 2c sub $0x2c,%esp 80100fc9: 8b 45 0c mov 0xc(%ebp),%eax 80100fcc: 8b 7d 08 mov 0x8(%ebp),%edi 80100fcf: 89 45 dc mov %eax,-0x24(%ebp) 80100fd2: 8b 45 10 mov 0x10(%ebp),%eax int r; if(f->writable == 0) 80100fd5: 80 7f 09 00 cmpb $0x0,0x9(%edi) { 80100fd9: 89 45 e4 mov %eax,-0x1c(%ebp) if(f->writable == 0) 80100fdc: 0f 84 ae 00 00 00 je 80101090 <filewrite+0xd0> return -1; if(f->type == FD_PIPE) 80100fe2: 8b 07 mov (%edi),%eax 80100fe4: 83 f8 01 cmp $0x1,%eax 80100fe7: 0f 84 c2 00 00 00 je 801010af <filewrite+0xef> return pipewrite(f->pipe, addr, n); if(f->type == FD_INODE){ 80100fed: 83 f8 02 cmp $0x2,%eax 80100ff0: 0f 85 d7 00 00 00 jne 801010cd <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){ 80100ff6: 8b 45 e4 mov -0x1c(%ebp),%eax 80100ff9: 31 db xor %ebx,%ebx 80100ffb: 85 c0 test %eax,%eax 80100ffd: 7f 31 jg 80101030 <filewrite+0x70> 80100fff: e9 9c 00 00 00 jmp 801010a0 <filewrite+0xe0> 80101004: 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); 80101008: 8b 4f 10 mov 0x10(%edi),%ecx f->off += r; 8010100b: 01 47 14 add %eax,0x14(%edi) 8010100e: 89 45 e0 mov %eax,-0x20(%ebp) iunlock(f->ip); 80101011: 89 0c 24 mov %ecx,(%esp) 80101014: e8 67 07 00 00 call 80101780 <iunlock> end_op(); 80101019: e8 52 1b 00 00 call 80102b70 <end_op> 8010101e: 8b 45 e0 mov -0x20(%ebp),%eax if(r < 0) break; if(r != n1) 80101021: 39 f0 cmp %esi,%eax 80101023: 0f 85 98 00 00 00 jne 801010c1 <filewrite+0x101> panic("short filewrite"); i += r; 80101029: 01 c3 add %eax,%ebx while(i < n){ 8010102b: 39 5d e4 cmp %ebx,-0x1c(%ebp) 8010102e: 7e 70 jle 801010a0 <filewrite+0xe0> int n1 = n - i; 80101030: 8b 75 e4 mov -0x1c(%ebp),%esi 80101033: b8 00 1a 00 00 mov $0x1a00,%eax 80101038: 29 de sub %ebx,%esi 8010103a: 81 fe 00 1a 00 00 cmp $0x1a00,%esi 80101040: 0f 4f f0 cmovg %eax,%esi begin_op(); 80101043: e8 b8 1a 00 00 call 80102b00 <begin_op> ilock(f->ip); 80101048: 8b 47 10 mov 0x10(%edi),%eax 8010104b: 89 04 24 mov %eax,(%esp) 8010104e: e8 4d 06 00 00 call 801016a0 <ilock> if ((r = writei(f->ip, addr + i, f->off, n1)) > 0) 80101053: 89 74 24 0c mov %esi,0xc(%esp) 80101057: 8b 47 14 mov 0x14(%edi),%eax 8010105a: 89 44 24 08 mov %eax,0x8(%esp) 8010105e: 8b 45 dc mov -0x24(%ebp),%eax 80101061: 01 d8 add %ebx,%eax 80101063: 89 44 24 04 mov %eax,0x4(%esp) 80101067: 8b 47 10 mov 0x10(%edi),%eax 8010106a: 89 04 24 mov %eax,(%esp) 8010106d: e8 de 09 00 00 call 80101a50 <writei> 80101072: 85 c0 test %eax,%eax 80101074: 7f 92 jg 80101008 <filewrite+0x48> iunlock(f->ip); 80101076: 8b 4f 10 mov 0x10(%edi),%ecx 80101079: 89 45 e0 mov %eax,-0x20(%ebp) 8010107c: 89 0c 24 mov %ecx,(%esp) 8010107f: e8 fc 06 00 00 call 80101780 <iunlock> end_op(); 80101084: e8 e7 1a 00 00 call 80102b70 <end_op> if(r < 0) 80101089: 8b 45 e0 mov -0x20(%ebp),%eax 8010108c: 85 c0 test %eax,%eax 8010108e: 74 91 je 80101021 <filewrite+0x61> } return i == n ? n : -1; } panic("filewrite"); } 80101090: 83 c4 2c add $0x2c,%esp return -1; 80101093: b8 ff ff ff ff mov $0xffffffff,%eax } 80101098: 5b pop %ebx 80101099: 5e pop %esi 8010109a: 5f pop %edi 8010109b: 5d pop %ebp 8010109c: c3 ret 8010109d: 8d 76 00 lea 0x0(%esi),%esi return i == n ? n : -1; 801010a0: 3b 5d e4 cmp -0x1c(%ebp),%ebx 801010a3: 89 d8 mov %ebx,%eax 801010a5: 75 e9 jne 80101090 <filewrite+0xd0> } 801010a7: 83 c4 2c add $0x2c,%esp 801010aa: 5b pop %ebx 801010ab: 5e pop %esi 801010ac: 5f pop %edi 801010ad: 5d pop %ebp 801010ae: c3 ret return pipewrite(f->pipe, addr, n); 801010af: 8b 47 0c mov 0xc(%edi),%eax 801010b2: 89 45 08 mov %eax,0x8(%ebp) } 801010b5: 83 c4 2c add $0x2c,%esp 801010b8: 5b pop %ebx 801010b9: 5e pop %esi 801010ba: 5f pop %edi 801010bb: 5d pop %ebp return pipewrite(f->pipe, addr, n); 801010bc: e9 1f 22 00 00 jmp 801032e0 <pipewrite> panic("short filewrite"); 801010c1: c7 04 24 cf 6e 10 80 movl $0x80106ecf,(%esp) 801010c8: e8 93 f2 ff ff call 80100360 <panic> panic("filewrite"); 801010cd: c7 04 24 d5 6e 10 80 movl $0x80106ed5,(%esp) 801010d4: e8 87 f2 ff ff call 80100360 <panic> 801010d9: 66 90 xchg %ax,%ax 801010db: 66 90 xchg %ax,%ax 801010dd: 66 90 xchg %ax,%ax 801010df: 90 nop 801010e0 <balloc>: // Blocks. // Allocate a zeroed disk block. static uint balloc(uint dev) { 801010e0: 55 push %ebp 801010e1: 89 e5 mov %esp,%ebp 801010e3: 57 push %edi 801010e4: 56 push %esi 801010e5: 53 push %ebx 801010e6: 83 ec 2c sub $0x2c,%esp 801010e9: 89 45 d8 mov %eax,-0x28(%ebp) int b, bi, m; struct buf *bp; bp = 0; for(b = 0; b < sb.size; b += BPB){ 801010ec: a1 c0 09 11 80 mov 0x801109c0,%eax 801010f1: 85 c0 test %eax,%eax 801010f3: 0f 84 8c 00 00 00 je 80101185 <balloc+0xa5> 801010f9: c7 45 dc 00 00 00 00 movl $0x0,-0x24(%ebp) bp = bread(dev, BBLOCK(b, sb)); 80101100: 8b 75 dc mov -0x24(%ebp),%esi 80101103: 89 f0 mov %esi,%eax 80101105: c1 f8 0c sar $0xc,%eax 80101108: 03 05 d8 09 11 80 add 0x801109d8,%eax 8010110e: 89 44 24 04 mov %eax,0x4(%esp) 80101112: 8b 45 d8 mov -0x28(%ebp),%eax 80101115: 89 04 24 mov %eax,(%esp) 80101118: e8 b3 ef ff ff call 801000d0 <bread> 8010111d: 89 45 e4 mov %eax,-0x1c(%ebp) 80101120: a1 c0 09 11 80 mov 0x801109c0,%eax 80101125: 89 45 e0 mov %eax,-0x20(%ebp) for(bi = 0; bi < BPB && b + bi < sb.size; bi++){ 80101128: 31 c0 xor %eax,%eax 8010112a: eb 33 jmp 8010115f <balloc+0x7f> 8010112c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi m = 1 << (bi % 8); if((bp->data[bi/8] & m) == 0){ // Is block free? 80101130: 8b 5d e4 mov -0x1c(%ebp),%ebx 80101133: 89 c2 mov %eax,%edx m = 1 << (bi % 8); 80101135: 89 c1 mov %eax,%ecx if((bp->data[bi/8] & m) == 0){ // Is block free? 80101137: c1 fa 03 sar $0x3,%edx m = 1 << (bi % 8); 8010113a: 83 e1 07 and $0x7,%ecx 8010113d: bf 01 00 00 00 mov $0x1,%edi 80101142: d3 e7 shl %cl,%edi if((bp->data[bi/8] & m) == 0){ // Is block free? 80101144: 0f b6 5c 13 5c movzbl 0x5c(%ebx,%edx,1),%ebx m = 1 << (bi % 8); 80101149: 89 f9 mov %edi,%ecx if((bp->data[bi/8] & m) == 0){ // Is block free? 8010114b: 0f b6 fb movzbl %bl,%edi 8010114e: 85 cf test %ecx,%edi 80101150: 74 46 je 80101198 <balloc+0xb8> for(bi = 0; bi < BPB && b + bi < sb.size; bi++){ 80101152: 83 c0 01 add $0x1,%eax 80101155: 83 c6 01 add $0x1,%esi 80101158: 3d 00 10 00 00 cmp $0x1000,%eax 8010115d: 74 05 je 80101164 <balloc+0x84> 8010115f: 3b 75 e0 cmp -0x20(%ebp),%esi 80101162: 72 cc jb 80101130 <balloc+0x50> brelse(bp); bzero(dev, b + bi); return b + bi; } } brelse(bp); 80101164: 8b 45 e4 mov -0x1c(%ebp),%eax 80101167: 89 04 24 mov %eax,(%esp) 8010116a: e8 71 f0 ff ff call 801001e0 <brelse> for(b = 0; b < sb.size; b += BPB){ 8010116f: 81 45 dc 00 10 00 00 addl $0x1000,-0x24(%ebp) 80101176: 8b 45 dc mov -0x24(%ebp),%eax 80101179: 3b 05 c0 09 11 80 cmp 0x801109c0,%eax 8010117f: 0f 82 7b ff ff ff jb 80101100 <balloc+0x20> } panic("balloc: out of blocks"); 80101185: c7 04 24 df 6e 10 80 movl $0x80106edf,(%esp) 8010118c: e8 cf f1 ff ff call 80100360 <panic> 80101191: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi bp->data[bi/8] |= m; // Mark block in use. 80101198: 09 d9 or %ebx,%ecx 8010119a: 8b 5d e4 mov -0x1c(%ebp),%ebx 8010119d: 88 4c 13 5c mov %cl,0x5c(%ebx,%edx,1) log_write(bp); 801011a1: 89 1c 24 mov %ebx,(%esp) 801011a4: e8 f7 1a 00 00 call 80102ca0 <log_write> brelse(bp); 801011a9: 89 1c 24 mov %ebx,(%esp) 801011ac: e8 2f f0 ff ff call 801001e0 <brelse> bp = bread(dev, bno); 801011b1: 8b 45 d8 mov -0x28(%ebp),%eax 801011b4: 89 74 24 04 mov %esi,0x4(%esp) 801011b8: 89 04 24 mov %eax,(%esp) 801011bb: e8 10 ef ff ff call 801000d0 <bread> memset(bp->data, 0, BSIZE); 801011c0: c7 44 24 08 00 02 00 movl $0x200,0x8(%esp) 801011c7: 00 801011c8: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 801011cf: 00 bp = bread(dev, bno); 801011d0: 89 c3 mov %eax,%ebx memset(bp->data, 0, BSIZE); 801011d2: 8d 40 5c lea 0x5c(%eax),%eax 801011d5: 89 04 24 mov %eax,(%esp) 801011d8: e8 d3 30 00 00 call 801042b0 <memset> log_write(bp); 801011dd: 89 1c 24 mov %ebx,(%esp) 801011e0: e8 bb 1a 00 00 call 80102ca0 <log_write> brelse(bp); 801011e5: 89 1c 24 mov %ebx,(%esp) 801011e8: e8 f3 ef ff ff call 801001e0 <brelse> } 801011ed: 83 c4 2c add $0x2c,%esp 801011f0: 89 f0 mov %esi,%eax 801011f2: 5b pop %ebx 801011f3: 5e pop %esi 801011f4: 5f pop %edi 801011f5: 5d pop %ebp 801011f6: c3 ret 801011f7: 89 f6 mov %esi,%esi 801011f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101200 <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) { 80101200: 55 push %ebp 80101201: 89 e5 mov %esp,%ebp 80101203: 57 push %edi 80101204: 89 c7 mov %eax,%edi 80101206: 56 push %esi struct inode *ip, *empty; acquire(&icache.lock); // Is the inode already cached? empty = 0; 80101207: 31 f6 xor %esi,%esi { 80101209: 53 push %ebx for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ 8010120a: bb 14 0a 11 80 mov $0x80110a14,%ebx { 8010120f: 83 ec 1c sub $0x1c,%esp acquire(&icache.lock); 80101212: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp) { 80101219: 89 55 e4 mov %edx,-0x1c(%ebp) acquire(&icache.lock); 8010121c: e8 4f 2f 00 00 call 80104170 <acquire> for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ 80101221: 8b 55 e4 mov -0x1c(%ebp),%edx 80101224: eb 14 jmp 8010123a <iget+0x3a> 80101226: 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. 80101228: 85 f6 test %esi,%esi 8010122a: 74 3c je 80101268 <iget+0x68> for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ 8010122c: 81 c3 90 00 00 00 add $0x90,%ebx 80101232: 81 fb 34 26 11 80 cmp $0x80112634,%ebx 80101238: 74 46 je 80101280 <iget+0x80> if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){ 8010123a: 8b 4b 08 mov 0x8(%ebx),%ecx 8010123d: 85 c9 test %ecx,%ecx 8010123f: 7e e7 jle 80101228 <iget+0x28> 80101241: 39 3b cmp %edi,(%ebx) 80101243: 75 e3 jne 80101228 <iget+0x28> 80101245: 39 53 04 cmp %edx,0x4(%ebx) 80101248: 75 de jne 80101228 <iget+0x28> ip->ref++; 8010124a: 83 c1 01 add $0x1,%ecx return ip; 8010124d: 89 de mov %ebx,%esi release(&icache.lock); 8010124f: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp) ip->ref++; 80101256: 89 4b 08 mov %ecx,0x8(%ebx) release(&icache.lock); 80101259: e8 02 30 00 00 call 80104260 <release> ip->ref = 1; ip->valid = 0; release(&icache.lock); return ip; } 8010125e: 83 c4 1c add $0x1c,%esp 80101261: 89 f0 mov %esi,%eax 80101263: 5b pop %ebx 80101264: 5e pop %esi 80101265: 5f pop %edi 80101266: 5d pop %ebp 80101267: c3 ret 80101268: 85 c9 test %ecx,%ecx 8010126a: 0f 44 f3 cmove %ebx,%esi for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ 8010126d: 81 c3 90 00 00 00 add $0x90,%ebx 80101273: 81 fb 34 26 11 80 cmp $0x80112634,%ebx 80101279: 75 bf jne 8010123a <iget+0x3a> 8010127b: 90 nop 8010127c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(empty == 0) 80101280: 85 f6 test %esi,%esi 80101282: 74 29 je 801012ad <iget+0xad> ip->dev = dev; 80101284: 89 3e mov %edi,(%esi) ip->inum = inum; 80101286: 89 56 04 mov %edx,0x4(%esi) ip->ref = 1; 80101289: c7 46 08 01 00 00 00 movl $0x1,0x8(%esi) ip->valid = 0; 80101290: c7 46 4c 00 00 00 00 movl $0x0,0x4c(%esi) release(&icache.lock); 80101297: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp) 8010129e: e8 bd 2f 00 00 call 80104260 <release> } 801012a3: 83 c4 1c add $0x1c,%esp 801012a6: 89 f0 mov %esi,%eax 801012a8: 5b pop %ebx 801012a9: 5e pop %esi 801012aa: 5f pop %edi 801012ab: 5d pop %ebp 801012ac: c3 ret panic("iget: no inodes"); 801012ad: c7 04 24 f5 6e 10 80 movl $0x80106ef5,(%esp) 801012b4: e8 a7 f0 ff ff call 80100360 <panic> 801012b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801012c0 <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) { 801012c0: 55 push %ebp 801012c1: 89 e5 mov %esp,%ebp 801012c3: 57 push %edi 801012c4: 56 push %esi 801012c5: 53 push %ebx 801012c6: 89 c3 mov %eax,%ebx 801012c8: 83 ec 1c sub $0x1c,%esp uint addr, *a; struct buf *bp; if(bn < NDIRECT){ 801012cb: 83 fa 0b cmp $0xb,%edx 801012ce: 77 18 ja 801012e8 <bmap+0x28> 801012d0: 8d 34 90 lea (%eax,%edx,4),%esi if((addr = ip->addrs[bn]) == 0) 801012d3: 8b 46 5c mov 0x5c(%esi),%eax 801012d6: 85 c0 test %eax,%eax 801012d8: 74 66 je 80101340 <bmap+0x80> brelse(bp); return addr; } panic("bmap: out of range"); } 801012da: 83 c4 1c add $0x1c,%esp 801012dd: 5b pop %ebx 801012de: 5e pop %esi 801012df: 5f pop %edi 801012e0: 5d pop %ebp 801012e1: c3 ret 801012e2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi bn -= NDIRECT; 801012e8: 8d 72 f4 lea -0xc(%edx),%esi if(bn < NINDIRECT){ 801012eb: 83 fe 7f cmp $0x7f,%esi 801012ee: 77 77 ja 80101367 <bmap+0xa7> if((addr = ip->addrs[NDIRECT]) == 0) 801012f0: 8b 80 8c 00 00 00 mov 0x8c(%eax),%eax 801012f6: 85 c0 test %eax,%eax 801012f8: 74 5e je 80101358 <bmap+0x98> bp = bread(ip->dev, addr); 801012fa: 89 44 24 04 mov %eax,0x4(%esp) 801012fe: 8b 03 mov (%ebx),%eax 80101300: 89 04 24 mov %eax,(%esp) 80101303: e8 c8 ed ff ff call 801000d0 <bread> if((addr = a[bn]) == 0){ 80101308: 8d 54 b0 5c lea 0x5c(%eax,%esi,4),%edx bp = bread(ip->dev, addr); 8010130c: 89 c7 mov %eax,%edi if((addr = a[bn]) == 0){ 8010130e: 8b 32 mov (%edx),%esi 80101310: 85 f6 test %esi,%esi 80101312: 75 19 jne 8010132d <bmap+0x6d> a[bn] = addr = balloc(ip->dev); 80101314: 8b 03 mov (%ebx),%eax 80101316: 89 55 e4 mov %edx,-0x1c(%ebp) 80101319: e8 c2 fd ff ff call 801010e0 <balloc> 8010131e: 8b 55 e4 mov -0x1c(%ebp),%edx 80101321: 89 02 mov %eax,(%edx) 80101323: 89 c6 mov %eax,%esi log_write(bp); 80101325: 89 3c 24 mov %edi,(%esp) 80101328: e8 73 19 00 00 call 80102ca0 <log_write> brelse(bp); 8010132d: 89 3c 24 mov %edi,(%esp) 80101330: e8 ab ee ff ff call 801001e0 <brelse> } 80101335: 83 c4 1c add $0x1c,%esp brelse(bp); 80101338: 89 f0 mov %esi,%eax } 8010133a: 5b pop %ebx 8010133b: 5e pop %esi 8010133c: 5f pop %edi 8010133d: 5d pop %ebp 8010133e: c3 ret 8010133f: 90 nop ip->addrs[bn] = addr = balloc(ip->dev); 80101340: 8b 03 mov (%ebx),%eax 80101342: e8 99 fd ff ff call 801010e0 <balloc> 80101347: 89 46 5c mov %eax,0x5c(%esi) } 8010134a: 83 c4 1c add $0x1c,%esp 8010134d: 5b pop %ebx 8010134e: 5e pop %esi 8010134f: 5f pop %edi 80101350: 5d pop %ebp 80101351: c3 ret 80101352: 8d b6 00 00 00 00 lea 0x0(%esi),%esi ip->addrs[NDIRECT] = addr = balloc(ip->dev); 80101358: 8b 03 mov (%ebx),%eax 8010135a: e8 81 fd ff ff call 801010e0 <balloc> 8010135f: 89 83 8c 00 00 00 mov %eax,0x8c(%ebx) 80101365: eb 93 jmp 801012fa <bmap+0x3a> panic("bmap: out of range"); 80101367: c7 04 24 05 6f 10 80 movl $0x80106f05,(%esp) 8010136e: e8 ed ef ff ff call 80100360 <panic> 80101373: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80101379: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101380 <readsb>: { 80101380: 55 push %ebp 80101381: 89 e5 mov %esp,%ebp 80101383: 56 push %esi 80101384: 53 push %ebx 80101385: 83 ec 10 sub $0x10,%esp bp = bread(dev, 1); 80101388: 8b 45 08 mov 0x8(%ebp),%eax 8010138b: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp) 80101392: 00 { 80101393: 8b 75 0c mov 0xc(%ebp),%esi bp = bread(dev, 1); 80101396: 89 04 24 mov %eax,(%esp) 80101399: e8 32 ed ff ff call 801000d0 <bread> memmove(sb, bp->data, sizeof(*sb)); 8010139e: 89 34 24 mov %esi,(%esp) 801013a1: c7 44 24 08 1c 00 00 movl $0x1c,0x8(%esp) 801013a8: 00 bp = bread(dev, 1); 801013a9: 89 c3 mov %eax,%ebx memmove(sb, bp->data, sizeof(*sb)); 801013ab: 8d 40 5c lea 0x5c(%eax),%eax 801013ae: 89 44 24 04 mov %eax,0x4(%esp) 801013b2: e8 99 2f 00 00 call 80104350 <memmove> brelse(bp); 801013b7: 89 5d 08 mov %ebx,0x8(%ebp) } 801013ba: 83 c4 10 add $0x10,%esp 801013bd: 5b pop %ebx 801013be: 5e pop %esi 801013bf: 5d pop %ebp brelse(bp); 801013c0: e9 1b ee ff ff jmp 801001e0 <brelse> 801013c5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801013c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801013d0 <bfree>: { 801013d0: 55 push %ebp 801013d1: 89 e5 mov %esp,%ebp 801013d3: 57 push %edi 801013d4: 89 d7 mov %edx,%edi 801013d6: 56 push %esi 801013d7: 53 push %ebx 801013d8: 89 c3 mov %eax,%ebx 801013da: 83 ec 1c sub $0x1c,%esp readsb(dev, &sb); 801013dd: 89 04 24 mov %eax,(%esp) 801013e0: c7 44 24 04 c0 09 11 movl $0x801109c0,0x4(%esp) 801013e7: 80 801013e8: e8 93 ff ff ff call 80101380 <readsb> bp = bread(dev, BBLOCK(b, sb)); 801013ed: 89 fa mov %edi,%edx 801013ef: c1 ea 0c shr $0xc,%edx 801013f2: 03 15 d8 09 11 80 add 0x801109d8,%edx 801013f8: 89 1c 24 mov %ebx,(%esp) m = 1 << (bi % 8); 801013fb: bb 01 00 00 00 mov $0x1,%ebx bp = bread(dev, BBLOCK(b, sb)); 80101400: 89 54 24 04 mov %edx,0x4(%esp) 80101404: e8 c7 ec ff ff call 801000d0 <bread> m = 1 << (bi % 8); 80101409: 89 f9 mov %edi,%ecx bi = b % BPB; 8010140b: 81 e7 ff 0f 00 00 and $0xfff,%edi 80101411: 89 fa mov %edi,%edx m = 1 << (bi % 8); 80101413: 83 e1 07 and $0x7,%ecx if((bp->data[bi/8] & m) == 0) 80101416: c1 fa 03 sar $0x3,%edx m = 1 << (bi % 8); 80101419: d3 e3 shl %cl,%ebx bp = bread(dev, BBLOCK(b, sb)); 8010141b: 89 c6 mov %eax,%esi if((bp->data[bi/8] & m) == 0) 8010141d: 0f b6 44 10 5c movzbl 0x5c(%eax,%edx,1),%eax 80101422: 0f b6 c8 movzbl %al,%ecx 80101425: 85 d9 test %ebx,%ecx 80101427: 74 20 je 80101449 <bfree+0x79> bp->data[bi/8] &= ~m; 80101429: f7 d3 not %ebx 8010142b: 21 c3 and %eax,%ebx 8010142d: 88 5c 16 5c mov %bl,0x5c(%esi,%edx,1) log_write(bp); 80101431: 89 34 24 mov %esi,(%esp) 80101434: e8 67 18 00 00 call 80102ca0 <log_write> brelse(bp); 80101439: 89 34 24 mov %esi,(%esp) 8010143c: e8 9f ed ff ff call 801001e0 <brelse> } 80101441: 83 c4 1c add $0x1c,%esp 80101444: 5b pop %ebx 80101445: 5e pop %esi 80101446: 5f pop %edi 80101447: 5d pop %ebp 80101448: c3 ret panic("freeing free block"); 80101449: c7 04 24 18 6f 10 80 movl $0x80106f18,(%esp) 80101450: e8 0b ef ff ff call 80100360 <panic> 80101455: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101459: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101460 <iinit>: { 80101460: 55 push %ebp 80101461: 89 e5 mov %esp,%ebp 80101463: 53 push %ebx 80101464: bb 20 0a 11 80 mov $0x80110a20,%ebx 80101469: 83 ec 24 sub $0x24,%esp initlock(&icache.lock, "icache"); 8010146c: c7 44 24 04 2b 6f 10 movl $0x80106f2b,0x4(%esp) 80101473: 80 80101474: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp) 8010147b: e8 00 2c 00 00 call 80104080 <initlock> initsleeplock(&icache.inode[i].lock, "inode"); 80101480: 89 1c 24 mov %ebx,(%esp) 80101483: 81 c3 90 00 00 00 add $0x90,%ebx 80101489: c7 44 24 04 32 6f 10 movl $0x80106f32,0x4(%esp) 80101490: 80 80101491: e8 da 2a 00 00 call 80103f70 <initsleeplock> for(i = 0; i < NINODE; i++) { 80101496: 81 fb 40 26 11 80 cmp $0x80112640,%ebx 8010149c: 75 e2 jne 80101480 <iinit+0x20> readsb(dev, &sb); 8010149e: 8b 45 08 mov 0x8(%ebp),%eax 801014a1: c7 44 24 04 c0 09 11 movl $0x801109c0,0x4(%esp) 801014a8: 80 801014a9: 89 04 24 mov %eax,(%esp) 801014ac: e8 cf fe ff ff call 80101380 <readsb> cprintf("sb: size %d nblocks %d ninodes %d nlog %d logstart %d\ 801014b1: a1 d8 09 11 80 mov 0x801109d8,%eax 801014b6: c7 04 24 98 6f 10 80 movl $0x80106f98,(%esp) 801014bd: 89 44 24 1c mov %eax,0x1c(%esp) 801014c1: a1 d4 09 11 80 mov 0x801109d4,%eax 801014c6: 89 44 24 18 mov %eax,0x18(%esp) 801014ca: a1 d0 09 11 80 mov 0x801109d0,%eax 801014cf: 89 44 24 14 mov %eax,0x14(%esp) 801014d3: a1 cc 09 11 80 mov 0x801109cc,%eax 801014d8: 89 44 24 10 mov %eax,0x10(%esp) 801014dc: a1 c8 09 11 80 mov 0x801109c8,%eax 801014e1: 89 44 24 0c mov %eax,0xc(%esp) 801014e5: a1 c4 09 11 80 mov 0x801109c4,%eax 801014ea: 89 44 24 08 mov %eax,0x8(%esp) 801014ee: a1 c0 09 11 80 mov 0x801109c0,%eax 801014f3: 89 44 24 04 mov %eax,0x4(%esp) 801014f7: e8 54 f1 ff ff call 80100650 <cprintf> } 801014fc: 83 c4 24 add $0x24,%esp 801014ff: 5b pop %ebx 80101500: 5d pop %ebp 80101501: c3 ret 80101502: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80101509: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101510 <ialloc>: { 80101510: 55 push %ebp 80101511: 89 e5 mov %esp,%ebp 80101513: 57 push %edi 80101514: 56 push %esi 80101515: 53 push %ebx 80101516: 83 ec 2c sub $0x2c,%esp 80101519: 8b 45 0c mov 0xc(%ebp),%eax for(inum = 1; inum < sb.ninodes; inum++){ 8010151c: 83 3d c8 09 11 80 01 cmpl $0x1,0x801109c8 { 80101523: 8b 7d 08 mov 0x8(%ebp),%edi 80101526: 89 45 e4 mov %eax,-0x1c(%ebp) for(inum = 1; inum < sb.ninodes; inum++){ 80101529: 0f 86 a2 00 00 00 jbe 801015d1 <ialloc+0xc1> 8010152f: be 01 00 00 00 mov $0x1,%esi 80101534: bb 01 00 00 00 mov $0x1,%ebx 80101539: eb 1a jmp 80101555 <ialloc+0x45> 8010153b: 90 nop 8010153c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi brelse(bp); 80101540: 89 14 24 mov %edx,(%esp) for(inum = 1; inum < sb.ninodes; inum++){ 80101543: 83 c3 01 add $0x1,%ebx brelse(bp); 80101546: e8 95 ec ff ff call 801001e0 <brelse> for(inum = 1; inum < sb.ninodes; inum++){ 8010154b: 89 de mov %ebx,%esi 8010154d: 3b 1d c8 09 11 80 cmp 0x801109c8,%ebx 80101553: 73 7c jae 801015d1 <ialloc+0xc1> bp = bread(dev, IBLOCK(inum, sb)); 80101555: 89 f0 mov %esi,%eax 80101557: c1 e8 03 shr $0x3,%eax 8010155a: 03 05 d4 09 11 80 add 0x801109d4,%eax 80101560: 89 3c 24 mov %edi,(%esp) 80101563: 89 44 24 04 mov %eax,0x4(%esp) 80101567: e8 64 eb ff ff call 801000d0 <bread> 8010156c: 89 c2 mov %eax,%edx dip = (struct dinode*)bp->data + inum%IPB; 8010156e: 89 f0 mov %esi,%eax 80101570: 83 e0 07 and $0x7,%eax 80101573: c1 e0 06 shl $0x6,%eax 80101576: 8d 4c 02 5c lea 0x5c(%edx,%eax,1),%ecx if(dip->type == 0){ // a free inode 8010157a: 66 83 39 00 cmpw $0x0,(%ecx) 8010157e: 75 c0 jne 80101540 <ialloc+0x30> memset(dip, 0, sizeof(*dip)); 80101580: 89 0c 24 mov %ecx,(%esp) 80101583: c7 44 24 08 40 00 00 movl $0x40,0x8(%esp) 8010158a: 00 8010158b: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 80101592: 00 80101593: 89 55 dc mov %edx,-0x24(%ebp) 80101596: 89 4d e0 mov %ecx,-0x20(%ebp) 80101599: e8 12 2d 00 00 call 801042b0 <memset> dip->type = type; 8010159e: 0f b7 45 e4 movzwl -0x1c(%ebp),%eax log_write(bp); // mark it allocated on the disk 801015a2: 8b 55 dc mov -0x24(%ebp),%edx dip->type = type; 801015a5: 8b 4d e0 mov -0x20(%ebp),%ecx log_write(bp); // mark it allocated on the disk 801015a8: 89 55 e4 mov %edx,-0x1c(%ebp) dip->type = type; 801015ab: 66 89 01 mov %ax,(%ecx) log_write(bp); // mark it allocated on the disk 801015ae: 89 14 24 mov %edx,(%esp) 801015b1: e8 ea 16 00 00 call 80102ca0 <log_write> brelse(bp); 801015b6: 8b 55 e4 mov -0x1c(%ebp),%edx 801015b9: 89 14 24 mov %edx,(%esp) 801015bc: e8 1f ec ff ff call 801001e0 <brelse> } 801015c1: 83 c4 2c add $0x2c,%esp return iget(dev, inum); 801015c4: 89 f2 mov %esi,%edx } 801015c6: 5b pop %ebx return iget(dev, inum); 801015c7: 89 f8 mov %edi,%eax } 801015c9: 5e pop %esi 801015ca: 5f pop %edi 801015cb: 5d pop %ebp return iget(dev, inum); 801015cc: e9 2f fc ff ff jmp 80101200 <iget> panic("ialloc: no inodes"); 801015d1: c7 04 24 38 6f 10 80 movl $0x80106f38,(%esp) 801015d8: e8 83 ed ff ff call 80100360 <panic> 801015dd: 8d 76 00 lea 0x0(%esi),%esi 801015e0 <iupdate>: { 801015e0: 55 push %ebp 801015e1: 89 e5 mov %esp,%ebp 801015e3: 56 push %esi 801015e4: 53 push %ebx 801015e5: 83 ec 10 sub $0x10,%esp 801015e8: 8b 5d 08 mov 0x8(%ebp),%ebx bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 801015eb: 8b 43 04 mov 0x4(%ebx),%eax memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 801015ee: 83 c3 5c add $0x5c,%ebx bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 801015f1: c1 e8 03 shr $0x3,%eax 801015f4: 03 05 d4 09 11 80 add 0x801109d4,%eax 801015fa: 89 44 24 04 mov %eax,0x4(%esp) 801015fe: 8b 43 a4 mov -0x5c(%ebx),%eax 80101601: 89 04 24 mov %eax,(%esp) 80101604: e8 c7 ea ff ff call 801000d0 <bread> dip = (struct dinode*)bp->data + ip->inum%IPB; 80101609: 8b 53 a8 mov -0x58(%ebx),%edx 8010160c: 83 e2 07 and $0x7,%edx 8010160f: c1 e2 06 shl $0x6,%edx 80101612: 8d 54 10 5c lea 0x5c(%eax,%edx,1),%edx bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 80101616: 89 c6 mov %eax,%esi dip->type = ip->type; 80101618: 0f b7 43 f4 movzwl -0xc(%ebx),%eax memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 8010161c: 83 c2 0c add $0xc,%edx dip->type = ip->type; 8010161f: 66 89 42 f4 mov %ax,-0xc(%edx) dip->major = ip->major; 80101623: 0f b7 43 f6 movzwl -0xa(%ebx),%eax 80101627: 66 89 42 f6 mov %ax,-0xa(%edx) dip->minor = ip->minor; 8010162b: 0f b7 43 f8 movzwl -0x8(%ebx),%eax 8010162f: 66 89 42 f8 mov %ax,-0x8(%edx) dip->nlink = ip->nlink; 80101633: 0f b7 43 fa movzwl -0x6(%ebx),%eax 80101637: 66 89 42 fa mov %ax,-0x6(%edx) dip->size = ip->size; 8010163b: 8b 43 fc mov -0x4(%ebx),%eax 8010163e: 89 42 fc mov %eax,-0x4(%edx) memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 80101641: 89 5c 24 04 mov %ebx,0x4(%esp) 80101645: 89 14 24 mov %edx,(%esp) 80101648: c7 44 24 08 34 00 00 movl $0x34,0x8(%esp) 8010164f: 00 80101650: e8 fb 2c 00 00 call 80104350 <memmove> log_write(bp); 80101655: 89 34 24 mov %esi,(%esp) 80101658: e8 43 16 00 00 call 80102ca0 <log_write> brelse(bp); 8010165d: 89 75 08 mov %esi,0x8(%ebp) } 80101660: 83 c4 10 add $0x10,%esp 80101663: 5b pop %ebx 80101664: 5e pop %esi 80101665: 5d pop %ebp brelse(bp); 80101666: e9 75 eb ff ff jmp 801001e0 <brelse> 8010166b: 90 nop 8010166c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101670 <idup>: { 80101670: 55 push %ebp 80101671: 89 e5 mov %esp,%ebp 80101673: 53 push %ebx 80101674: 83 ec 14 sub $0x14,%esp 80101677: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&icache.lock); 8010167a: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp) 80101681: e8 ea 2a 00 00 call 80104170 <acquire> ip->ref++; 80101686: 83 43 08 01 addl $0x1,0x8(%ebx) release(&icache.lock); 8010168a: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp) 80101691: e8 ca 2b 00 00 call 80104260 <release> } 80101696: 83 c4 14 add $0x14,%esp 80101699: 89 d8 mov %ebx,%eax 8010169b: 5b pop %ebx 8010169c: 5d pop %ebp 8010169d: c3 ret 8010169e: 66 90 xchg %ax,%ax 801016a0 <ilock>: { 801016a0: 55 push %ebp 801016a1: 89 e5 mov %esp,%ebp 801016a3: 56 push %esi 801016a4: 53 push %ebx 801016a5: 83 ec 10 sub $0x10,%esp 801016a8: 8b 5d 08 mov 0x8(%ebp),%ebx if(ip == 0 || ip->ref < 1) 801016ab: 85 db test %ebx,%ebx 801016ad: 0f 84 b3 00 00 00 je 80101766 <ilock+0xc6> 801016b3: 8b 53 08 mov 0x8(%ebx),%edx 801016b6: 85 d2 test %edx,%edx 801016b8: 0f 8e a8 00 00 00 jle 80101766 <ilock+0xc6> acquiresleep(&ip->lock); 801016be: 8d 43 0c lea 0xc(%ebx),%eax 801016c1: 89 04 24 mov %eax,(%esp) 801016c4: e8 e7 28 00 00 call 80103fb0 <acquiresleep> if(ip->valid == 0){ 801016c9: 8b 43 4c mov 0x4c(%ebx),%eax 801016cc: 85 c0 test %eax,%eax 801016ce: 74 08 je 801016d8 <ilock+0x38> } 801016d0: 83 c4 10 add $0x10,%esp 801016d3: 5b pop %ebx 801016d4: 5e pop %esi 801016d5: 5d pop %ebp 801016d6: c3 ret 801016d7: 90 nop bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 801016d8: 8b 43 04 mov 0x4(%ebx),%eax 801016db: c1 e8 03 shr $0x3,%eax 801016de: 03 05 d4 09 11 80 add 0x801109d4,%eax 801016e4: 89 44 24 04 mov %eax,0x4(%esp) 801016e8: 8b 03 mov (%ebx),%eax 801016ea: 89 04 24 mov %eax,(%esp) 801016ed: e8 de e9 ff ff call 801000d0 <bread> dip = (struct dinode*)bp->data + ip->inum%IPB; 801016f2: 8b 53 04 mov 0x4(%ebx),%edx 801016f5: 83 e2 07 and $0x7,%edx 801016f8: c1 e2 06 shl $0x6,%edx 801016fb: 8d 54 10 5c lea 0x5c(%eax,%edx,1),%edx bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 801016ff: 89 c6 mov %eax,%esi ip->type = dip->type; 80101701: 0f b7 02 movzwl (%edx),%eax memmove(ip->addrs, dip->addrs, sizeof(ip->addrs)); 80101704: 83 c2 0c add $0xc,%edx ip->type = dip->type; 80101707: 66 89 43 50 mov %ax,0x50(%ebx) ip->major = dip->major; 8010170b: 0f b7 42 f6 movzwl -0xa(%edx),%eax 8010170f: 66 89 43 52 mov %ax,0x52(%ebx) ip->minor = dip->minor; 80101713: 0f b7 42 f8 movzwl -0x8(%edx),%eax 80101717: 66 89 43 54 mov %ax,0x54(%ebx) ip->nlink = dip->nlink; 8010171b: 0f b7 42 fa movzwl -0x6(%edx),%eax 8010171f: 66 89 43 56 mov %ax,0x56(%ebx) ip->size = dip->size; 80101723: 8b 42 fc mov -0x4(%edx),%eax 80101726: 89 43 58 mov %eax,0x58(%ebx) memmove(ip->addrs, dip->addrs, sizeof(ip->addrs)); 80101729: 8d 43 5c lea 0x5c(%ebx),%eax 8010172c: 89 54 24 04 mov %edx,0x4(%esp) 80101730: c7 44 24 08 34 00 00 movl $0x34,0x8(%esp) 80101737: 00 80101738: 89 04 24 mov %eax,(%esp) 8010173b: e8 10 2c 00 00 call 80104350 <memmove> brelse(bp); 80101740: 89 34 24 mov %esi,(%esp) 80101743: e8 98 ea ff ff call 801001e0 <brelse> if(ip->type == 0) 80101748: 66 83 7b 50 00 cmpw $0x0,0x50(%ebx) ip->valid = 1; 8010174d: c7 43 4c 01 00 00 00 movl $0x1,0x4c(%ebx) if(ip->type == 0) 80101754: 0f 85 76 ff ff ff jne 801016d0 <ilock+0x30> panic("ilock: no type"); 8010175a: c7 04 24 50 6f 10 80 movl $0x80106f50,(%esp) 80101761: e8 fa eb ff ff call 80100360 <panic> panic("ilock"); 80101766: c7 04 24 4a 6f 10 80 movl $0x80106f4a,(%esp) 8010176d: e8 ee eb ff ff call 80100360 <panic> 80101772: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80101779: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101780 <iunlock>: { 80101780: 55 push %ebp 80101781: 89 e5 mov %esp,%ebp 80101783: 56 push %esi 80101784: 53 push %ebx 80101785: 83 ec 10 sub $0x10,%esp 80101788: 8b 5d 08 mov 0x8(%ebp),%ebx if(ip == 0 || !holdingsleep(&ip->lock) || ip->ref < 1) 8010178b: 85 db test %ebx,%ebx 8010178d: 74 24 je 801017b3 <iunlock+0x33> 8010178f: 8d 73 0c lea 0xc(%ebx),%esi 80101792: 89 34 24 mov %esi,(%esp) 80101795: e8 b6 28 00 00 call 80104050 <holdingsleep> 8010179a: 85 c0 test %eax,%eax 8010179c: 74 15 je 801017b3 <iunlock+0x33> 8010179e: 8b 43 08 mov 0x8(%ebx),%eax 801017a1: 85 c0 test %eax,%eax 801017a3: 7e 0e jle 801017b3 <iunlock+0x33> releasesleep(&ip->lock); 801017a5: 89 75 08 mov %esi,0x8(%ebp) } 801017a8: 83 c4 10 add $0x10,%esp 801017ab: 5b pop %ebx 801017ac: 5e pop %esi 801017ad: 5d pop %ebp releasesleep(&ip->lock); 801017ae: e9 5d 28 00 00 jmp 80104010 <releasesleep> panic("iunlock"); 801017b3: c7 04 24 5f 6f 10 80 movl $0x80106f5f,(%esp) 801017ba: e8 a1 eb ff ff call 80100360 <panic> 801017bf: 90 nop 801017c0 <iput>: { 801017c0: 55 push %ebp 801017c1: 89 e5 mov %esp,%ebp 801017c3: 57 push %edi 801017c4: 56 push %esi 801017c5: 53 push %ebx 801017c6: 83 ec 1c sub $0x1c,%esp 801017c9: 8b 75 08 mov 0x8(%ebp),%esi acquiresleep(&ip->lock); 801017cc: 8d 7e 0c lea 0xc(%esi),%edi 801017cf: 89 3c 24 mov %edi,(%esp) 801017d2: e8 d9 27 00 00 call 80103fb0 <acquiresleep> if(ip->valid && ip->nlink == 0){ 801017d7: 8b 56 4c mov 0x4c(%esi),%edx 801017da: 85 d2 test %edx,%edx 801017dc: 74 07 je 801017e5 <iput+0x25> 801017de: 66 83 7e 56 00 cmpw $0x0,0x56(%esi) 801017e3: 74 2b je 80101810 <iput+0x50> releasesleep(&ip->lock); 801017e5: 89 3c 24 mov %edi,(%esp) 801017e8: e8 23 28 00 00 call 80104010 <releasesleep> acquire(&icache.lock); 801017ed: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp) 801017f4: e8 77 29 00 00 call 80104170 <acquire> ip->ref--; 801017f9: 83 6e 08 01 subl $0x1,0x8(%esi) release(&icache.lock); 801017fd: c7 45 08 e0 09 11 80 movl $0x801109e0,0x8(%ebp) } 80101804: 83 c4 1c add $0x1c,%esp 80101807: 5b pop %ebx 80101808: 5e pop %esi 80101809: 5f pop %edi 8010180a: 5d pop %ebp release(&icache.lock); 8010180b: e9 50 2a 00 00 jmp 80104260 <release> acquire(&icache.lock); 80101810: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp) 80101817: e8 54 29 00 00 call 80104170 <acquire> int r = ip->ref; 8010181c: 8b 5e 08 mov 0x8(%esi),%ebx release(&icache.lock); 8010181f: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp) 80101826: e8 35 2a 00 00 call 80104260 <release> if(r == 1){ 8010182b: 83 fb 01 cmp $0x1,%ebx 8010182e: 75 b5 jne 801017e5 <iput+0x25> 80101830: 8d 4e 30 lea 0x30(%esi),%ecx 80101833: 89 f3 mov %esi,%ebx 80101835: 89 7d e4 mov %edi,-0x1c(%ebp) 80101838: 89 cf mov %ecx,%edi 8010183a: eb 0b jmp 80101847 <iput+0x87> 8010183c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101840: 83 c3 04 add $0x4,%ebx { int i, j; struct buf *bp; uint *a; for(i = 0; i < NDIRECT; i++){ 80101843: 39 fb cmp %edi,%ebx 80101845: 74 19 je 80101860 <iput+0xa0> if(ip->addrs[i]){ 80101847: 8b 53 5c mov 0x5c(%ebx),%edx 8010184a: 85 d2 test %edx,%edx 8010184c: 74 f2 je 80101840 <iput+0x80> bfree(ip->dev, ip->addrs[i]); 8010184e: 8b 06 mov (%esi),%eax 80101850: e8 7b fb ff ff call 801013d0 <bfree> ip->addrs[i] = 0; 80101855: c7 43 5c 00 00 00 00 movl $0x0,0x5c(%ebx) 8010185c: eb e2 jmp 80101840 <iput+0x80> 8010185e: 66 90 xchg %ax,%ax } } if(ip->addrs[NDIRECT]){ 80101860: 8b 86 8c 00 00 00 mov 0x8c(%esi),%eax 80101866: 8b 7d e4 mov -0x1c(%ebp),%edi 80101869: 85 c0 test %eax,%eax 8010186b: 75 2b jne 80101898 <iput+0xd8> brelse(bp); bfree(ip->dev, ip->addrs[NDIRECT]); ip->addrs[NDIRECT] = 0; } ip->size = 0; 8010186d: c7 46 58 00 00 00 00 movl $0x0,0x58(%esi) iupdate(ip); 80101874: 89 34 24 mov %esi,(%esp) 80101877: e8 64 fd ff ff call 801015e0 <iupdate> ip->type = 0; 8010187c: 31 c0 xor %eax,%eax 8010187e: 66 89 46 50 mov %ax,0x50(%esi) iupdate(ip); 80101882: 89 34 24 mov %esi,(%esp) 80101885: e8 56 fd ff ff call 801015e0 <iupdate> ip->valid = 0; 8010188a: c7 46 4c 00 00 00 00 movl $0x0,0x4c(%esi) 80101891: e9 4f ff ff ff jmp 801017e5 <iput+0x25> 80101896: 66 90 xchg %ax,%ax bp = bread(ip->dev, ip->addrs[NDIRECT]); 80101898: 89 44 24 04 mov %eax,0x4(%esp) 8010189c: 8b 06 mov (%esi),%eax for(j = 0; j < NINDIRECT; j++){ 8010189e: 31 db xor %ebx,%ebx bp = bread(ip->dev, ip->addrs[NDIRECT]); 801018a0: 89 04 24 mov %eax,(%esp) 801018a3: e8 28 e8 ff ff call 801000d0 <bread> for(j = 0; j < NINDIRECT; j++){ 801018a8: 89 7d e0 mov %edi,-0x20(%ebp) a = (uint*)bp->data; 801018ab: 8d 48 5c lea 0x5c(%eax),%ecx bp = bread(ip->dev, ip->addrs[NDIRECT]); 801018ae: 89 45 e4 mov %eax,-0x1c(%ebp) for(j = 0; j < NINDIRECT; j++){ 801018b1: 89 cf mov %ecx,%edi 801018b3: 31 c0 xor %eax,%eax 801018b5: eb 0e jmp 801018c5 <iput+0x105> 801018b7: 90 nop 801018b8: 83 c3 01 add $0x1,%ebx 801018bb: 81 fb 80 00 00 00 cmp $0x80,%ebx 801018c1: 89 d8 mov %ebx,%eax 801018c3: 74 10 je 801018d5 <iput+0x115> if(a[j]) 801018c5: 8b 14 87 mov (%edi,%eax,4),%edx 801018c8: 85 d2 test %edx,%edx 801018ca: 74 ec je 801018b8 <iput+0xf8> bfree(ip->dev, a[j]); 801018cc: 8b 06 mov (%esi),%eax 801018ce: e8 fd fa ff ff call 801013d0 <bfree> 801018d3: eb e3 jmp 801018b8 <iput+0xf8> brelse(bp); 801018d5: 8b 45 e4 mov -0x1c(%ebp),%eax 801018d8: 8b 7d e0 mov -0x20(%ebp),%edi 801018db: 89 04 24 mov %eax,(%esp) 801018de: e8 fd e8 ff ff call 801001e0 <brelse> bfree(ip->dev, ip->addrs[NDIRECT]); 801018e3: 8b 96 8c 00 00 00 mov 0x8c(%esi),%edx 801018e9: 8b 06 mov (%esi),%eax 801018eb: e8 e0 fa ff ff call 801013d0 <bfree> ip->addrs[NDIRECT] = 0; 801018f0: c7 86 8c 00 00 00 00 movl $0x0,0x8c(%esi) 801018f7: 00 00 00 801018fa: e9 6e ff ff ff jmp 8010186d <iput+0xad> 801018ff: 90 nop 80101900 <iunlockput>: { 80101900: 55 push %ebp 80101901: 89 e5 mov %esp,%ebp 80101903: 53 push %ebx 80101904: 83 ec 14 sub $0x14,%esp 80101907: 8b 5d 08 mov 0x8(%ebp),%ebx iunlock(ip); 8010190a: 89 1c 24 mov %ebx,(%esp) 8010190d: e8 6e fe ff ff call 80101780 <iunlock> iput(ip); 80101912: 89 5d 08 mov %ebx,0x8(%ebp) } 80101915: 83 c4 14 add $0x14,%esp 80101918: 5b pop %ebx 80101919: 5d pop %ebp iput(ip); 8010191a: e9 a1 fe ff ff jmp 801017c0 <iput> 8010191f: 90 nop 80101920 <stati>: // Copy stat information from inode. // Caller must hold ip->lock. void stati(struct inode *ip, struct stat *st) { 80101920: 55 push %ebp 80101921: 89 e5 mov %esp,%ebp 80101923: 8b 55 08 mov 0x8(%ebp),%edx 80101926: 8b 45 0c mov 0xc(%ebp),%eax st->dev = ip->dev; 80101929: 8b 0a mov (%edx),%ecx 8010192b: 89 48 04 mov %ecx,0x4(%eax) st->ino = ip->inum; 8010192e: 8b 4a 04 mov 0x4(%edx),%ecx 80101931: 89 48 08 mov %ecx,0x8(%eax) st->type = ip->type; 80101934: 0f b7 4a 50 movzwl 0x50(%edx),%ecx 80101938: 66 89 08 mov %cx,(%eax) st->nlink = ip->nlink; 8010193b: 0f b7 4a 56 movzwl 0x56(%edx),%ecx 8010193f: 66 89 48 0c mov %cx,0xc(%eax) st->size = ip->size; 80101943: 8b 52 58 mov 0x58(%edx),%edx 80101946: 89 50 10 mov %edx,0x10(%eax) } 80101949: 5d pop %ebp 8010194a: c3 ret 8010194b: 90 nop 8010194c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101950 <readi>: //PAGEBREAK! // Read data from inode. // Caller must hold ip->lock. int readi(struct inode *ip, char *dst, uint off, uint n) { 80101950: 55 push %ebp 80101951: 89 e5 mov %esp,%ebp 80101953: 57 push %edi 80101954: 56 push %esi 80101955: 53 push %ebx 80101956: 83 ec 2c sub $0x2c,%esp 80101959: 8b 45 0c mov 0xc(%ebp),%eax 8010195c: 8b 7d 08 mov 0x8(%ebp),%edi 8010195f: 8b 75 10 mov 0x10(%ebp),%esi 80101962: 89 45 e0 mov %eax,-0x20(%ebp) 80101965: 8b 45 14 mov 0x14(%ebp),%eax uint tot, m; struct buf *bp; if(ip->type == T_DEV){ 80101968: 66 83 7f 50 03 cmpw $0x3,0x50(%edi) { 8010196d: 89 45 e4 mov %eax,-0x1c(%ebp) if(ip->type == T_DEV){ 80101970: 0f 84 aa 00 00 00 je 80101a20 <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) 80101976: 8b 47 58 mov 0x58(%edi),%eax 80101979: 39 f0 cmp %esi,%eax 8010197b: 0f 82 c7 00 00 00 jb 80101a48 <readi+0xf8> 80101981: 8b 5d e4 mov -0x1c(%ebp),%ebx 80101984: 89 da mov %ebx,%edx 80101986: 01 f2 add %esi,%edx 80101988: 0f 82 ba 00 00 00 jb 80101a48 <readi+0xf8> return -1; if(off + n > ip->size) n = ip->size - off; 8010198e: 89 c1 mov %eax,%ecx 80101990: 29 f1 sub %esi,%ecx 80101992: 39 d0 cmp %edx,%eax 80101994: 0f 43 cb cmovae %ebx,%ecx for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 80101997: 31 c0 xor %eax,%eax 80101999: 85 c9 test %ecx,%ecx n = ip->size - off; 8010199b: 89 4d e4 mov %ecx,-0x1c(%ebp) for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 8010199e: 74 70 je 80101a10 <readi+0xc0> 801019a0: 89 7d d8 mov %edi,-0x28(%ebp) 801019a3: 89 c7 mov %eax,%edi 801019a5: 8d 76 00 lea 0x0(%esi),%esi bp = bread(ip->dev, bmap(ip, off/BSIZE)); 801019a8: 8b 5d d8 mov -0x28(%ebp),%ebx 801019ab: 89 f2 mov %esi,%edx 801019ad: c1 ea 09 shr $0x9,%edx 801019b0: 89 d8 mov %ebx,%eax 801019b2: e8 09 f9 ff ff call 801012c0 <bmap> 801019b7: 89 44 24 04 mov %eax,0x4(%esp) 801019bb: 8b 03 mov (%ebx),%eax m = min(n - tot, BSIZE - off%BSIZE); 801019bd: bb 00 02 00 00 mov $0x200,%ebx bp = bread(ip->dev, bmap(ip, off/BSIZE)); 801019c2: 89 04 24 mov %eax,(%esp) 801019c5: e8 06 e7 ff ff call 801000d0 <bread> m = min(n - tot, BSIZE - off%BSIZE); 801019ca: 8b 4d e4 mov -0x1c(%ebp),%ecx 801019cd: 29 f9 sub %edi,%ecx bp = bread(ip->dev, bmap(ip, off/BSIZE)); 801019cf: 89 c2 mov %eax,%edx m = min(n - tot, BSIZE - off%BSIZE); 801019d1: 89 f0 mov %esi,%eax 801019d3: 25 ff 01 00 00 and $0x1ff,%eax 801019d8: 29 c3 sub %eax,%ebx memmove(dst, bp->data + off%BSIZE, m); 801019da: 8d 44 02 5c lea 0x5c(%edx,%eax,1),%eax m = min(n - tot, BSIZE - off%BSIZE); 801019de: 39 cb cmp %ecx,%ebx memmove(dst, bp->data + off%BSIZE, m); 801019e0: 89 44 24 04 mov %eax,0x4(%esp) 801019e4: 8b 45 e0 mov -0x20(%ebp),%eax m = min(n - tot, BSIZE - off%BSIZE); 801019e7: 0f 47 d9 cmova %ecx,%ebx memmove(dst, bp->data + off%BSIZE, m); 801019ea: 89 5c 24 08 mov %ebx,0x8(%esp) for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 801019ee: 01 df add %ebx,%edi 801019f0: 01 de add %ebx,%esi memmove(dst, bp->data + off%BSIZE, m); 801019f2: 89 55 dc mov %edx,-0x24(%ebp) 801019f5: 89 04 24 mov %eax,(%esp) 801019f8: e8 53 29 00 00 call 80104350 <memmove> brelse(bp); 801019fd: 8b 55 dc mov -0x24(%ebp),%edx 80101a00: 89 14 24 mov %edx,(%esp) 80101a03: e8 d8 e7 ff ff call 801001e0 <brelse> for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 80101a08: 01 5d e0 add %ebx,-0x20(%ebp) 80101a0b: 39 7d e4 cmp %edi,-0x1c(%ebp) 80101a0e: 77 98 ja 801019a8 <readi+0x58> } return n; 80101a10: 8b 45 e4 mov -0x1c(%ebp),%eax } 80101a13: 83 c4 2c add $0x2c,%esp 80101a16: 5b pop %ebx 80101a17: 5e pop %esi 80101a18: 5f pop %edi 80101a19: 5d pop %ebp 80101a1a: c3 ret 80101a1b: 90 nop 80101a1c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read) 80101a20: 0f bf 47 52 movswl 0x52(%edi),%eax 80101a24: 66 83 f8 09 cmp $0x9,%ax 80101a28: 77 1e ja 80101a48 <readi+0xf8> 80101a2a: 8b 04 c5 60 09 11 80 mov -0x7feef6a0(,%eax,8),%eax 80101a31: 85 c0 test %eax,%eax 80101a33: 74 13 je 80101a48 <readi+0xf8> return devsw[ip->major].read(ip, dst, n); 80101a35: 8b 75 e4 mov -0x1c(%ebp),%esi 80101a38: 89 75 10 mov %esi,0x10(%ebp) } 80101a3b: 83 c4 2c add $0x2c,%esp 80101a3e: 5b pop %ebx 80101a3f: 5e pop %esi 80101a40: 5f pop %edi 80101a41: 5d pop %ebp return devsw[ip->major].read(ip, dst, n); 80101a42: ff e0 jmp *%eax 80101a44: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80101a48: b8 ff ff ff ff mov $0xffffffff,%eax 80101a4d: eb c4 jmp 80101a13 <readi+0xc3> 80101a4f: 90 nop 80101a50 <writei>: // PAGEBREAK! // Write data to inode. // Caller must hold ip->lock. int writei(struct inode *ip, char *src, uint off, uint n) { 80101a50: 55 push %ebp 80101a51: 89 e5 mov %esp,%ebp 80101a53: 57 push %edi 80101a54: 56 push %esi 80101a55: 53 push %ebx 80101a56: 83 ec 2c sub $0x2c,%esp 80101a59: 8b 45 08 mov 0x8(%ebp),%eax 80101a5c: 8b 75 0c mov 0xc(%ebp),%esi 80101a5f: 8b 4d 14 mov 0x14(%ebp),%ecx uint tot, m; struct buf *bp; if(ip->type == T_DEV){ 80101a62: 66 83 78 50 03 cmpw $0x3,0x50(%eax) { 80101a67: 89 75 dc mov %esi,-0x24(%ebp) 80101a6a: 8b 75 10 mov 0x10(%ebp),%esi 80101a6d: 89 45 d8 mov %eax,-0x28(%ebp) 80101a70: 89 4d e0 mov %ecx,-0x20(%ebp) if(ip->type == T_DEV){ 80101a73: 0f 84 b7 00 00 00 je 80101b30 <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) 80101a79: 8b 45 d8 mov -0x28(%ebp),%eax 80101a7c: 39 70 58 cmp %esi,0x58(%eax) 80101a7f: 0f 82 e3 00 00 00 jb 80101b68 <writei+0x118> 80101a85: 8b 4d e0 mov -0x20(%ebp),%ecx 80101a88: 89 c8 mov %ecx,%eax 80101a8a: 01 f0 add %esi,%eax 80101a8c: 0f 82 d6 00 00 00 jb 80101b68 <writei+0x118> return -1; if(off + n > MAXFILE*BSIZE) 80101a92: 3d 00 18 01 00 cmp $0x11800,%eax 80101a97: 0f 87 cb 00 00 00 ja 80101b68 <writei+0x118> return -1; for(tot=0; tot<n; tot+=m, off+=m, src+=m){ 80101a9d: 85 c9 test %ecx,%ecx 80101a9f: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp) 80101aa6: 74 77 je 80101b1f <writei+0xcf> bp = bread(ip->dev, bmap(ip, off/BSIZE)); 80101aa8: 8b 7d d8 mov -0x28(%ebp),%edi 80101aab: 89 f2 mov %esi,%edx m = min(n - tot, BSIZE - off%BSIZE); 80101aad: bb 00 02 00 00 mov $0x200,%ebx bp = bread(ip->dev, bmap(ip, off/BSIZE)); 80101ab2: c1 ea 09 shr $0x9,%edx 80101ab5: 89 f8 mov %edi,%eax 80101ab7: e8 04 f8 ff ff call 801012c0 <bmap> 80101abc: 89 44 24 04 mov %eax,0x4(%esp) 80101ac0: 8b 07 mov (%edi),%eax 80101ac2: 89 04 24 mov %eax,(%esp) 80101ac5: e8 06 e6 ff ff call 801000d0 <bread> m = min(n - tot, BSIZE - off%BSIZE); 80101aca: 8b 4d e0 mov -0x20(%ebp),%ecx 80101acd: 2b 4d e4 sub -0x1c(%ebp),%ecx memmove(bp->data + off%BSIZE, src, m); 80101ad0: 8b 55 dc mov -0x24(%ebp),%edx bp = bread(ip->dev, bmap(ip, off/BSIZE)); 80101ad3: 89 c7 mov %eax,%edi m = min(n - tot, BSIZE - off%BSIZE); 80101ad5: 89 f0 mov %esi,%eax 80101ad7: 25 ff 01 00 00 and $0x1ff,%eax 80101adc: 29 c3 sub %eax,%ebx 80101ade: 39 cb cmp %ecx,%ebx 80101ae0: 0f 47 d9 cmova %ecx,%ebx memmove(bp->data + off%BSIZE, src, m); 80101ae3: 8d 44 07 5c lea 0x5c(%edi,%eax,1),%eax for(tot=0; tot<n; tot+=m, off+=m, src+=m){ 80101ae7: 01 de add %ebx,%esi memmove(bp->data + off%BSIZE, src, m); 80101ae9: 89 54 24 04 mov %edx,0x4(%esp) 80101aed: 89 5c 24 08 mov %ebx,0x8(%esp) 80101af1: 89 04 24 mov %eax,(%esp) 80101af4: e8 57 28 00 00 call 80104350 <memmove> log_write(bp); 80101af9: 89 3c 24 mov %edi,(%esp) 80101afc: e8 9f 11 00 00 call 80102ca0 <log_write> brelse(bp); 80101b01: 89 3c 24 mov %edi,(%esp) 80101b04: e8 d7 e6 ff ff call 801001e0 <brelse> for(tot=0; tot<n; tot+=m, off+=m, src+=m){ 80101b09: 01 5d e4 add %ebx,-0x1c(%ebp) 80101b0c: 8b 45 e4 mov -0x1c(%ebp),%eax 80101b0f: 01 5d dc add %ebx,-0x24(%ebp) 80101b12: 39 45 e0 cmp %eax,-0x20(%ebp) 80101b15: 77 91 ja 80101aa8 <writei+0x58> } if(n > 0 && off > ip->size){ 80101b17: 8b 45 d8 mov -0x28(%ebp),%eax 80101b1a: 39 70 58 cmp %esi,0x58(%eax) 80101b1d: 72 39 jb 80101b58 <writei+0x108> ip->size = off; iupdate(ip); } return n; 80101b1f: 8b 45 e0 mov -0x20(%ebp),%eax } 80101b22: 83 c4 2c add $0x2c,%esp 80101b25: 5b pop %ebx 80101b26: 5e pop %esi 80101b27: 5f pop %edi 80101b28: 5d pop %ebp 80101b29: c3 ret 80101b2a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write) 80101b30: 0f bf 40 52 movswl 0x52(%eax),%eax 80101b34: 66 83 f8 09 cmp $0x9,%ax 80101b38: 77 2e ja 80101b68 <writei+0x118> 80101b3a: 8b 04 c5 64 09 11 80 mov -0x7feef69c(,%eax,8),%eax 80101b41: 85 c0 test %eax,%eax 80101b43: 74 23 je 80101b68 <writei+0x118> return devsw[ip->major].write(ip, src, n); 80101b45: 89 4d 10 mov %ecx,0x10(%ebp) } 80101b48: 83 c4 2c add $0x2c,%esp 80101b4b: 5b pop %ebx 80101b4c: 5e pop %esi 80101b4d: 5f pop %edi 80101b4e: 5d pop %ebp return devsw[ip->major].write(ip, src, n); 80101b4f: ff e0 jmp *%eax 80101b51: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi ip->size = off; 80101b58: 8b 45 d8 mov -0x28(%ebp),%eax 80101b5b: 89 70 58 mov %esi,0x58(%eax) iupdate(ip); 80101b5e: 89 04 24 mov %eax,(%esp) 80101b61: e8 7a fa ff ff call 801015e0 <iupdate> 80101b66: eb b7 jmp 80101b1f <writei+0xcf> } 80101b68: 83 c4 2c add $0x2c,%esp return -1; 80101b6b: b8 ff ff ff ff mov $0xffffffff,%eax } 80101b70: 5b pop %ebx 80101b71: 5e pop %esi 80101b72: 5f pop %edi 80101b73: 5d pop %ebp 80101b74: c3 ret 80101b75: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101b79: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101b80 <namecmp>: //PAGEBREAK! // Directories int namecmp(const char *s, const char *t) { 80101b80: 55 push %ebp 80101b81: 89 e5 mov %esp,%ebp 80101b83: 83 ec 18 sub $0x18,%esp return strncmp(s, t, DIRSIZ); 80101b86: 8b 45 0c mov 0xc(%ebp),%eax 80101b89: c7 44 24 08 0e 00 00 movl $0xe,0x8(%esp) 80101b90: 00 80101b91: 89 44 24 04 mov %eax,0x4(%esp) 80101b95: 8b 45 08 mov 0x8(%ebp),%eax 80101b98: 89 04 24 mov %eax,(%esp) 80101b9b: e8 30 28 00 00 call 801043d0 <strncmp> } 80101ba0: c9 leave 80101ba1: c3 ret 80101ba2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80101ba9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101bb0 <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) { 80101bb0: 55 push %ebp 80101bb1: 89 e5 mov %esp,%ebp 80101bb3: 57 push %edi 80101bb4: 56 push %esi 80101bb5: 53 push %ebx 80101bb6: 83 ec 2c sub $0x2c,%esp 80101bb9: 8b 5d 08 mov 0x8(%ebp),%ebx uint off, inum; struct dirent de; if(dp->type != T_DIR) 80101bbc: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80101bc1: 0f 85 97 00 00 00 jne 80101c5e <dirlookup+0xae> panic("dirlookup not DIR"); for(off = 0; off < dp->size; off += sizeof(de)){ 80101bc7: 8b 53 58 mov 0x58(%ebx),%edx 80101bca: 31 ff xor %edi,%edi 80101bcc: 8d 75 d8 lea -0x28(%ebp),%esi 80101bcf: 85 d2 test %edx,%edx 80101bd1: 75 0d jne 80101be0 <dirlookup+0x30> 80101bd3: eb 73 jmp 80101c48 <dirlookup+0x98> 80101bd5: 8d 76 00 lea 0x0(%esi),%esi 80101bd8: 83 c7 10 add $0x10,%edi 80101bdb: 39 7b 58 cmp %edi,0x58(%ebx) 80101bde: 76 68 jbe 80101c48 <dirlookup+0x98> if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80101be0: c7 44 24 0c 10 00 00 movl $0x10,0xc(%esp) 80101be7: 00 80101be8: 89 7c 24 08 mov %edi,0x8(%esp) 80101bec: 89 74 24 04 mov %esi,0x4(%esp) 80101bf0: 89 1c 24 mov %ebx,(%esp) 80101bf3: e8 58 fd ff ff call 80101950 <readi> 80101bf8: 83 f8 10 cmp $0x10,%eax 80101bfb: 75 55 jne 80101c52 <dirlookup+0xa2> panic("dirlookup read"); if(de.inum == 0) 80101bfd: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp) 80101c02: 74 d4 je 80101bd8 <dirlookup+0x28> return strncmp(s, t, DIRSIZ); 80101c04: 8d 45 da lea -0x26(%ebp),%eax 80101c07: 89 44 24 04 mov %eax,0x4(%esp) 80101c0b: 8b 45 0c mov 0xc(%ebp),%eax 80101c0e: c7 44 24 08 0e 00 00 movl $0xe,0x8(%esp) 80101c15: 00 80101c16: 89 04 24 mov %eax,(%esp) 80101c19: e8 b2 27 00 00 call 801043d0 <strncmp> continue; if(namecmp(name, de.name) == 0){ 80101c1e: 85 c0 test %eax,%eax 80101c20: 75 b6 jne 80101bd8 <dirlookup+0x28> // entry matches path element if(poff) 80101c22: 8b 45 10 mov 0x10(%ebp),%eax 80101c25: 85 c0 test %eax,%eax 80101c27: 74 05 je 80101c2e <dirlookup+0x7e> *poff = off; 80101c29: 8b 45 10 mov 0x10(%ebp),%eax 80101c2c: 89 38 mov %edi,(%eax) inum = de.inum; 80101c2e: 0f b7 55 d8 movzwl -0x28(%ebp),%edx return iget(dp->dev, inum); 80101c32: 8b 03 mov (%ebx),%eax 80101c34: e8 c7 f5 ff ff call 80101200 <iget> } } return 0; } 80101c39: 83 c4 2c add $0x2c,%esp 80101c3c: 5b pop %ebx 80101c3d: 5e pop %esi 80101c3e: 5f pop %edi 80101c3f: 5d pop %ebp 80101c40: c3 ret 80101c41: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80101c48: 83 c4 2c add $0x2c,%esp return 0; 80101c4b: 31 c0 xor %eax,%eax } 80101c4d: 5b pop %ebx 80101c4e: 5e pop %esi 80101c4f: 5f pop %edi 80101c50: 5d pop %ebp 80101c51: c3 ret panic("dirlookup read"); 80101c52: c7 04 24 79 6f 10 80 movl $0x80106f79,(%esp) 80101c59: e8 02 e7 ff ff call 80100360 <panic> panic("dirlookup not DIR"); 80101c5e: c7 04 24 67 6f 10 80 movl $0x80106f67,(%esp) 80101c65: e8 f6 e6 ff ff call 80100360 <panic> 80101c6a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80101c70 <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) { 80101c70: 55 push %ebp 80101c71: 89 e5 mov %esp,%ebp 80101c73: 57 push %edi 80101c74: 89 cf mov %ecx,%edi 80101c76: 56 push %esi 80101c77: 53 push %ebx 80101c78: 89 c3 mov %eax,%ebx 80101c7a: 83 ec 2c sub $0x2c,%esp struct inode *ip, *next; if(*path == '/') 80101c7d: 80 38 2f cmpb $0x2f,(%eax) { 80101c80: 89 55 e0 mov %edx,-0x20(%ebp) if(*path == '/') 80101c83: 0f 84 51 01 00 00 je 80101dda <namex+0x16a> ip = iget(ROOTDEV, ROOTINO); else ip = idup(myproc()->cwd); 80101c89: e8 02 1a 00 00 call 80103690 <myproc> 80101c8e: 8b 70 70 mov 0x70(%eax),%esi acquire(&icache.lock); 80101c91: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp) 80101c98: e8 d3 24 00 00 call 80104170 <acquire> ip->ref++; 80101c9d: 83 46 08 01 addl $0x1,0x8(%esi) release(&icache.lock); 80101ca1: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp) 80101ca8: e8 b3 25 00 00 call 80104260 <release> 80101cad: eb 04 jmp 80101cb3 <namex+0x43> 80101caf: 90 nop path++; 80101cb0: 83 c3 01 add $0x1,%ebx while(*path == '/') 80101cb3: 0f b6 03 movzbl (%ebx),%eax 80101cb6: 3c 2f cmp $0x2f,%al 80101cb8: 74 f6 je 80101cb0 <namex+0x40> if(*path == 0) 80101cba: 84 c0 test %al,%al 80101cbc: 0f 84 ed 00 00 00 je 80101daf <namex+0x13f> while(*path != '/' && *path != 0) 80101cc2: 0f b6 03 movzbl (%ebx),%eax 80101cc5: 89 da mov %ebx,%edx 80101cc7: 84 c0 test %al,%al 80101cc9: 0f 84 b1 00 00 00 je 80101d80 <namex+0x110> 80101ccf: 3c 2f cmp $0x2f,%al 80101cd1: 75 0f jne 80101ce2 <namex+0x72> 80101cd3: e9 a8 00 00 00 jmp 80101d80 <namex+0x110> 80101cd8: 3c 2f cmp $0x2f,%al 80101cda: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80101ce0: 74 0a je 80101cec <namex+0x7c> path++; 80101ce2: 83 c2 01 add $0x1,%edx while(*path != '/' && *path != 0) 80101ce5: 0f b6 02 movzbl (%edx),%eax 80101ce8: 84 c0 test %al,%al 80101cea: 75 ec jne 80101cd8 <namex+0x68> 80101cec: 89 d1 mov %edx,%ecx 80101cee: 29 d9 sub %ebx,%ecx if(len >= DIRSIZ) 80101cf0: 83 f9 0d cmp $0xd,%ecx 80101cf3: 0f 8e 8f 00 00 00 jle 80101d88 <namex+0x118> memmove(name, s, DIRSIZ); 80101cf9: 89 5c 24 04 mov %ebx,0x4(%esp) 80101cfd: c7 44 24 08 0e 00 00 movl $0xe,0x8(%esp) 80101d04: 00 80101d05: 89 3c 24 mov %edi,(%esp) 80101d08: 89 55 e4 mov %edx,-0x1c(%ebp) 80101d0b: e8 40 26 00 00 call 80104350 <memmove> path++; 80101d10: 8b 55 e4 mov -0x1c(%ebp),%edx 80101d13: 89 d3 mov %edx,%ebx while(*path == '/') 80101d15: 80 3a 2f cmpb $0x2f,(%edx) 80101d18: 75 0e jne 80101d28 <namex+0xb8> 80101d1a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi path++; 80101d20: 83 c3 01 add $0x1,%ebx while(*path == '/') 80101d23: 80 3b 2f cmpb $0x2f,(%ebx) 80101d26: 74 f8 je 80101d20 <namex+0xb0> while((path = skipelem(path, name)) != 0){ ilock(ip); 80101d28: 89 34 24 mov %esi,(%esp) 80101d2b: e8 70 f9 ff ff call 801016a0 <ilock> if(ip->type != T_DIR){ 80101d30: 66 83 7e 50 01 cmpw $0x1,0x50(%esi) 80101d35: 0f 85 85 00 00 00 jne 80101dc0 <namex+0x150> iunlockput(ip); return 0; } if(nameiparent && *path == '\0'){ 80101d3b: 8b 55 e0 mov -0x20(%ebp),%edx 80101d3e: 85 d2 test %edx,%edx 80101d40: 74 09 je 80101d4b <namex+0xdb> 80101d42: 80 3b 00 cmpb $0x0,(%ebx) 80101d45: 0f 84 a5 00 00 00 je 80101df0 <namex+0x180> // Stop one level early. iunlock(ip); return ip; } if((next = dirlookup(ip, name, 0)) == 0){ 80101d4b: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp) 80101d52: 00 80101d53: 89 7c 24 04 mov %edi,0x4(%esp) 80101d57: 89 34 24 mov %esi,(%esp) 80101d5a: e8 51 fe ff ff call 80101bb0 <dirlookup> 80101d5f: 85 c0 test %eax,%eax 80101d61: 74 5d je 80101dc0 <namex+0x150> iunlock(ip); 80101d63: 89 34 24 mov %esi,(%esp) 80101d66: 89 45 e4 mov %eax,-0x1c(%ebp) 80101d69: e8 12 fa ff ff call 80101780 <iunlock> iput(ip); 80101d6e: 89 34 24 mov %esi,(%esp) 80101d71: e8 4a fa ff ff call 801017c0 <iput> iunlockput(ip); return 0; } iunlockput(ip); ip = next; 80101d76: 8b 45 e4 mov -0x1c(%ebp),%eax 80101d79: 89 c6 mov %eax,%esi 80101d7b: e9 33 ff ff ff jmp 80101cb3 <namex+0x43> while(*path != '/' && *path != 0) 80101d80: 31 c9 xor %ecx,%ecx 80101d82: 8d b6 00 00 00 00 lea 0x0(%esi),%esi memmove(name, s, len); 80101d88: 89 4c 24 08 mov %ecx,0x8(%esp) 80101d8c: 89 5c 24 04 mov %ebx,0x4(%esp) 80101d90: 89 3c 24 mov %edi,(%esp) 80101d93: 89 55 dc mov %edx,-0x24(%ebp) 80101d96: 89 4d e4 mov %ecx,-0x1c(%ebp) 80101d99: e8 b2 25 00 00 call 80104350 <memmove> name[len] = 0; 80101d9e: 8b 4d e4 mov -0x1c(%ebp),%ecx 80101da1: 8b 55 dc mov -0x24(%ebp),%edx 80101da4: c6 04 0f 00 movb $0x0,(%edi,%ecx,1) 80101da8: 89 d3 mov %edx,%ebx 80101daa: e9 66 ff ff ff jmp 80101d15 <namex+0xa5> } if(nameiparent){ 80101daf: 8b 45 e0 mov -0x20(%ebp),%eax 80101db2: 85 c0 test %eax,%eax 80101db4: 75 4c jne 80101e02 <namex+0x192> 80101db6: 89 f0 mov %esi,%eax iput(ip); return 0; } return ip; } 80101db8: 83 c4 2c add $0x2c,%esp 80101dbb: 5b pop %ebx 80101dbc: 5e pop %esi 80101dbd: 5f pop %edi 80101dbe: 5d pop %ebp 80101dbf: c3 ret iunlock(ip); 80101dc0: 89 34 24 mov %esi,(%esp) 80101dc3: e8 b8 f9 ff ff call 80101780 <iunlock> iput(ip); 80101dc8: 89 34 24 mov %esi,(%esp) 80101dcb: e8 f0 f9 ff ff call 801017c0 <iput> } 80101dd0: 83 c4 2c add $0x2c,%esp return 0; 80101dd3: 31 c0 xor %eax,%eax } 80101dd5: 5b pop %ebx 80101dd6: 5e pop %esi 80101dd7: 5f pop %edi 80101dd8: 5d pop %ebp 80101dd9: c3 ret ip = iget(ROOTDEV, ROOTINO); 80101dda: ba 01 00 00 00 mov $0x1,%edx 80101ddf: b8 01 00 00 00 mov $0x1,%eax 80101de4: e8 17 f4 ff ff call 80101200 <iget> 80101de9: 89 c6 mov %eax,%esi 80101deb: e9 c3 fe ff ff jmp 80101cb3 <namex+0x43> iunlock(ip); 80101df0: 89 34 24 mov %esi,(%esp) 80101df3: e8 88 f9 ff ff call 80101780 <iunlock> } 80101df8: 83 c4 2c add $0x2c,%esp return ip; 80101dfb: 89 f0 mov %esi,%eax } 80101dfd: 5b pop %ebx 80101dfe: 5e pop %esi 80101dff: 5f pop %edi 80101e00: 5d pop %ebp 80101e01: c3 ret iput(ip); 80101e02: 89 34 24 mov %esi,(%esp) 80101e05: e8 b6 f9 ff ff call 801017c0 <iput> return 0; 80101e0a: 31 c0 xor %eax,%eax 80101e0c: eb aa jmp 80101db8 <namex+0x148> 80101e0e: 66 90 xchg %ax,%ax 80101e10 <dirlink>: { 80101e10: 55 push %ebp 80101e11: 89 e5 mov %esp,%ebp 80101e13: 57 push %edi 80101e14: 56 push %esi 80101e15: 53 push %ebx 80101e16: 83 ec 2c sub $0x2c,%esp 80101e19: 8b 5d 08 mov 0x8(%ebp),%ebx if((ip = dirlookup(dp, name, 0)) != 0){ 80101e1c: 8b 45 0c mov 0xc(%ebp),%eax 80101e1f: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp) 80101e26: 00 80101e27: 89 1c 24 mov %ebx,(%esp) 80101e2a: 89 44 24 04 mov %eax,0x4(%esp) 80101e2e: e8 7d fd ff ff call 80101bb0 <dirlookup> 80101e33: 85 c0 test %eax,%eax 80101e35: 0f 85 8b 00 00 00 jne 80101ec6 <dirlink+0xb6> for(off = 0; off < dp->size; off += sizeof(de)){ 80101e3b: 8b 43 58 mov 0x58(%ebx),%eax 80101e3e: 31 ff xor %edi,%edi 80101e40: 8d 75 d8 lea -0x28(%ebp),%esi 80101e43: 85 c0 test %eax,%eax 80101e45: 75 13 jne 80101e5a <dirlink+0x4a> 80101e47: eb 35 jmp 80101e7e <dirlink+0x6e> 80101e49: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80101e50: 8d 57 10 lea 0x10(%edi),%edx 80101e53: 39 53 58 cmp %edx,0x58(%ebx) 80101e56: 89 d7 mov %edx,%edi 80101e58: 76 24 jbe 80101e7e <dirlink+0x6e> if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80101e5a: c7 44 24 0c 10 00 00 movl $0x10,0xc(%esp) 80101e61: 00 80101e62: 89 7c 24 08 mov %edi,0x8(%esp) 80101e66: 89 74 24 04 mov %esi,0x4(%esp) 80101e6a: 89 1c 24 mov %ebx,(%esp) 80101e6d: e8 de fa ff ff call 80101950 <readi> 80101e72: 83 f8 10 cmp $0x10,%eax 80101e75: 75 5e jne 80101ed5 <dirlink+0xc5> if(de.inum == 0) 80101e77: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp) 80101e7c: 75 d2 jne 80101e50 <dirlink+0x40> strncpy(de.name, name, DIRSIZ); 80101e7e: 8b 45 0c mov 0xc(%ebp),%eax 80101e81: c7 44 24 08 0e 00 00 movl $0xe,0x8(%esp) 80101e88: 00 80101e89: 89 44 24 04 mov %eax,0x4(%esp) 80101e8d: 8d 45 da lea -0x26(%ebp),%eax 80101e90: 89 04 24 mov %eax,(%esp) 80101e93: e8 a8 25 00 00 call 80104440 <strncpy> de.inum = inum; 80101e98: 8b 45 10 mov 0x10(%ebp),%eax if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80101e9b: c7 44 24 0c 10 00 00 movl $0x10,0xc(%esp) 80101ea2: 00 80101ea3: 89 7c 24 08 mov %edi,0x8(%esp) 80101ea7: 89 74 24 04 mov %esi,0x4(%esp) 80101eab: 89 1c 24 mov %ebx,(%esp) de.inum = inum; 80101eae: 66 89 45 d8 mov %ax,-0x28(%ebp) if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80101eb2: e8 99 fb ff ff call 80101a50 <writei> 80101eb7: 83 f8 10 cmp $0x10,%eax 80101eba: 75 25 jne 80101ee1 <dirlink+0xd1> return 0; 80101ebc: 31 c0 xor %eax,%eax } 80101ebe: 83 c4 2c add $0x2c,%esp 80101ec1: 5b pop %ebx 80101ec2: 5e pop %esi 80101ec3: 5f pop %edi 80101ec4: 5d pop %ebp 80101ec5: c3 ret iput(ip); 80101ec6: 89 04 24 mov %eax,(%esp) 80101ec9: e8 f2 f8 ff ff call 801017c0 <iput> return -1; 80101ece: b8 ff ff ff ff mov $0xffffffff,%eax 80101ed3: eb e9 jmp 80101ebe <dirlink+0xae> panic("dirlink read"); 80101ed5: c7 04 24 88 6f 10 80 movl $0x80106f88,(%esp) 80101edc: e8 7f e4 ff ff call 80100360 <panic> panic("dirlink"); 80101ee1: c7 04 24 86 75 10 80 movl $0x80107586,(%esp) 80101ee8: e8 73 e4 ff ff call 80100360 <panic> 80101eed: 8d 76 00 lea 0x0(%esi),%esi 80101ef0 <namei>: struct inode* namei(char *path) { 80101ef0: 55 push %ebp char name[DIRSIZ]; return namex(path, 0, name); 80101ef1: 31 d2 xor %edx,%edx { 80101ef3: 89 e5 mov %esp,%ebp 80101ef5: 83 ec 18 sub $0x18,%esp return namex(path, 0, name); 80101ef8: 8b 45 08 mov 0x8(%ebp),%eax 80101efb: 8d 4d ea lea -0x16(%ebp),%ecx 80101efe: e8 6d fd ff ff call 80101c70 <namex> } 80101f03: c9 leave 80101f04: c3 ret 80101f05: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101f09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101f10 <nameiparent>: struct inode* nameiparent(char *path, char *name) { 80101f10: 55 push %ebp return namex(path, 1, name); 80101f11: ba 01 00 00 00 mov $0x1,%edx { 80101f16: 89 e5 mov %esp,%ebp return namex(path, 1, name); 80101f18: 8b 4d 0c mov 0xc(%ebp),%ecx 80101f1b: 8b 45 08 mov 0x8(%ebp),%eax } 80101f1e: 5d pop %ebp return namex(path, 1, name); 80101f1f: e9 4c fd ff ff jmp 80101c70 <namex> 80101f24: 66 90 xchg %ax,%ax 80101f26: 66 90 xchg %ax,%ax 80101f28: 66 90 xchg %ax,%ax 80101f2a: 66 90 xchg %ax,%ax 80101f2c: 66 90 xchg %ax,%ax 80101f2e: 66 90 xchg %ax,%ax 80101f30 <idestart>: } // Start the request for b. Caller must hold idelock. static void idestart(struct buf *b) { 80101f30: 55 push %ebp 80101f31: 89 e5 mov %esp,%ebp 80101f33: 56 push %esi 80101f34: 89 c6 mov %eax,%esi 80101f36: 53 push %ebx 80101f37: 83 ec 10 sub $0x10,%esp if(b == 0) 80101f3a: 85 c0 test %eax,%eax 80101f3c: 0f 84 99 00 00 00 je 80101fdb <idestart+0xab> panic("idestart"); if(b->blockno >= FSSIZE) 80101f42: 8b 48 08 mov 0x8(%eax),%ecx 80101f45: 81 f9 e7 03 00 00 cmp $0x3e7,%ecx 80101f4b: 0f 87 7e 00 00 00 ja 80101fcf <idestart+0x9f> asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80101f51: ba f7 01 00 00 mov $0x1f7,%edx 80101f56: 66 90 xchg %ax,%ax 80101f58: ec in (%dx),%al while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY) 80101f59: 83 e0 c0 and $0xffffffc0,%eax 80101f5c: 3c 40 cmp $0x40,%al 80101f5e: 75 f8 jne 80101f58 <idestart+0x28> asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80101f60: 31 db xor %ebx,%ebx 80101f62: ba f6 03 00 00 mov $0x3f6,%edx 80101f67: 89 d8 mov %ebx,%eax 80101f69: ee out %al,(%dx) 80101f6a: ba f2 01 00 00 mov $0x1f2,%edx 80101f6f: b8 01 00 00 00 mov $0x1,%eax 80101f74: ee out %al,(%dx) 80101f75: 0f b6 c1 movzbl %cl,%eax 80101f78: b2 f3 mov $0xf3,%dl 80101f7a: 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); 80101f7b: 89 c8 mov %ecx,%eax 80101f7d: b2 f4 mov $0xf4,%dl 80101f7f: c1 f8 08 sar $0x8,%eax 80101f82: ee out %al,(%dx) 80101f83: b2 f5 mov $0xf5,%dl 80101f85: 89 d8 mov %ebx,%eax 80101f87: ee out %al,(%dx) outb(0x1f5, (sector >> 16) & 0xff); outb(0x1f6, 0xe0 | ((b->dev&1)<<4) | ((sector>>24)&0x0f)); 80101f88: 0f b6 46 04 movzbl 0x4(%esi),%eax 80101f8c: b2 f6 mov $0xf6,%dl 80101f8e: 83 e0 01 and $0x1,%eax 80101f91: c1 e0 04 shl $0x4,%eax 80101f94: 83 c8 e0 or $0xffffffe0,%eax 80101f97: ee out %al,(%dx) if(b->flags & B_DIRTY){ 80101f98: f6 06 04 testb $0x4,(%esi) 80101f9b: 75 13 jne 80101fb0 <idestart+0x80> 80101f9d: ba f7 01 00 00 mov $0x1f7,%edx 80101fa2: b8 20 00 00 00 mov $0x20,%eax 80101fa7: ee out %al,(%dx) outb(0x1f7, write_cmd); outsl(0x1f0, b->data, BSIZE/4); } else { outb(0x1f7, read_cmd); } } 80101fa8: 83 c4 10 add $0x10,%esp 80101fab: 5b pop %ebx 80101fac: 5e pop %esi 80101fad: 5d pop %ebp 80101fae: c3 ret 80101faf: 90 nop 80101fb0: b2 f7 mov $0xf7,%dl 80101fb2: b8 30 00 00 00 mov $0x30,%eax 80101fb7: ee out %al,(%dx) asm volatile("cld; rep outsl" : 80101fb8: b9 80 00 00 00 mov $0x80,%ecx outsl(0x1f0, b->data, BSIZE/4); 80101fbd: 83 c6 5c add $0x5c,%esi 80101fc0: ba f0 01 00 00 mov $0x1f0,%edx 80101fc5: fc cld 80101fc6: f3 6f rep outsl %ds:(%esi),(%dx) } 80101fc8: 83 c4 10 add $0x10,%esp 80101fcb: 5b pop %ebx 80101fcc: 5e pop %esi 80101fcd: 5d pop %ebp 80101fce: c3 ret panic("incorrect blockno"); 80101fcf: c7 04 24 f4 6f 10 80 movl $0x80106ff4,(%esp) 80101fd6: e8 85 e3 ff ff call 80100360 <panic> panic("idestart"); 80101fdb: c7 04 24 eb 6f 10 80 movl $0x80106feb,(%esp) 80101fe2: e8 79 e3 ff ff call 80100360 <panic> 80101fe7: 89 f6 mov %esi,%esi 80101fe9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101ff0 <ideinit>: { 80101ff0: 55 push %ebp 80101ff1: 89 e5 mov %esp,%ebp 80101ff3: 83 ec 18 sub $0x18,%esp initlock(&idelock, "ide"); 80101ff6: c7 44 24 04 06 70 10 movl $0x80107006,0x4(%esp) 80101ffd: 80 80101ffe: c7 04 24 80 a5 10 80 movl $0x8010a580,(%esp) 80102005: e8 76 20 00 00 call 80104080 <initlock> ioapicenable(IRQ_IDE, ncpu - 1); 8010200a: a1 00 2d 11 80 mov 0x80112d00,%eax 8010200f: c7 04 24 0e 00 00 00 movl $0xe,(%esp) 80102016: 83 e8 01 sub $0x1,%eax 80102019: 89 44 24 04 mov %eax,0x4(%esp) 8010201d: e8 7e 02 00 00 call 801022a0 <ioapicenable> asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102022: ba f7 01 00 00 mov $0x1f7,%edx 80102027: 90 nop 80102028: ec in (%dx),%al 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+0x38> 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 asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102040: b2 f7 mov $0xf7,%dl 80102042: eb 09 jmp 8010204d <ideinit+0x5d> 80102044: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(i=0; i<1000; i++){ 80102048: 83 e9 01 sub $0x1,%ecx 8010204b: 74 0f je 8010205c <ideinit+0x6c> 8010204d: ec in (%dx),%al if(inb(0x1f7) != 0){ 8010204e: 84 c0 test %al,%al 80102050: 74 f6 je 80102048 <ideinit+0x58> havedisk1 = 1; 80102052: c7 05 60 a5 10 80 01 movl $0x1,0x8010a560 80102059: 00 00 00 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) } 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 a5 10 80 movl $0x8010a580,(%esp) 80102080: e8 eb 20 00 00 call 80104170 <acquire> if((b = idequeue) == 0){ 80102085: 8b 1d 64 a5 10 80 mov 0x8010a564,%ebx 8010208b: 85 db test %ebx,%ebx 8010208d: 74 30 je 801020bf <ideintr+0x4f> release(&idelock); return; } idequeue = b->qnext; 8010208f: 8b 43 58 mov 0x58(%ebx),%eax 80102092: a3 64 a5 10 80 mov %eax,0x8010a564 // 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 ff 1c 00 00 call 80103db0 <wakeup> // Start disk on next buf in queue. if(idequeue != 0) 801020b1: a1 64 a5 10 80 mov 0x8010a564,%eax 801020b6: 85 c0 test %eax,%eax 801020b8: 74 05 je 801020bf <ideintr+0x4f> idestart(idequeue); 801020ba: e8 71 fe ff ff call 80101f30 <idestart> release(&idelock); 801020bf: c7 04 24 80 a5 10 80 movl $0x8010a580,(%esp) 801020c6: e8 95 21 00 00 call 80104260 <release> 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 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 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> insl(0x1f0, b->data, BSIZE/4); 801020ef: 8d 7b 5c lea 0x5c(%ebx),%edi 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(!holdingsleep(&b->lock)) 8010211a: 8d 43 0c lea 0xc(%ebx),%eax 8010211d: 89 04 24 mov %eax,(%esp) 80102120: e8 2b 1f 00 00 call 80104050 <holdingsleep> 80102125: 85 c0 test %eax,%eax 80102127: 0f 84 9e 00 00 00 je 801021cb <iderw+0xbb> panic("iderw: buf not locked"); if((b->flags & (B_VALID|B_DIRTY)) == B_VALID) 8010212d: 8b 03 mov (%ebx),%eax 8010212f: 83 e0 06 and $0x6,%eax 80102132: 83 f8 02 cmp $0x2,%eax 80102135: 0f 84 a8 00 00 00 je 801021e3 <iderw+0xd3> panic("iderw: nothing to do"); if(b->dev != 0 && !havedisk1) 8010213b: 8b 53 04 mov 0x4(%ebx),%edx 8010213e: 85 d2 test %edx,%edx 80102140: 74 0d je 8010214f <iderw+0x3f> 80102142: a1 60 a5 10 80 mov 0x8010a560,%eax 80102147: 85 c0 test %eax,%eax 80102149: 0f 84 88 00 00 00 je 801021d7 <iderw+0xc7> panic("iderw: ide disk 1 not present"); acquire(&idelock); //DOC:acquire-lock 8010214f: c7 04 24 80 a5 10 80 movl $0x8010a580,(%esp) 80102156: e8 15 20 00 00 call 80104170 <acquire> // Append b to idequeue. b->qnext = 0; for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue 8010215b: a1 64 a5 10 80 mov 0x8010a564,%eax b->qnext = 0; 80102160: c7 43 58 00 00 00 00 movl $0x0,0x58(%ebx) for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue 80102167: 85 c0 test %eax,%eax 80102169: 75 07 jne 80102172 <iderw+0x62> 8010216b: eb 4e jmp 801021bb <iderw+0xab> 8010216d: 8d 76 00 lea 0x0(%esi),%esi 80102170: 89 d0 mov %edx,%eax 80102172: 8b 50 58 mov 0x58(%eax),%edx 80102175: 85 d2 test %edx,%edx 80102177: 75 f7 jne 80102170 <iderw+0x60> 80102179: 83 c0 58 add $0x58,%eax ; *pp = b; 8010217c: 89 18 mov %ebx,(%eax) // Start disk if necessary. if(idequeue == b) 8010217e: 39 1d 64 a5 10 80 cmp %ebx,0x8010a564 80102184: 74 3c je 801021c2 <iderw+0xb2> idestart(b); // Wait for request to finish. while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){ 80102186: 8b 03 mov (%ebx),%eax 80102188: 83 e0 06 and $0x6,%eax 8010218b: 83 f8 02 cmp $0x2,%eax 8010218e: 74 1a je 801021aa <iderw+0x9a> sleep(b, &idelock); 80102190: c7 44 24 04 80 a5 10 movl $0x8010a580,0x4(%esp) 80102197: 80 80102198: 89 1c 24 mov %ebx,(%esp) 8010219b: e8 70 1a 00 00 call 80103c10 <sleep> while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){ 801021a0: 8b 13 mov (%ebx),%edx 801021a2: 83 e2 06 and $0x6,%edx 801021a5: 83 fa 02 cmp $0x2,%edx 801021a8: 75 e6 jne 80102190 <iderw+0x80> } release(&idelock); 801021aa: c7 45 08 80 a5 10 80 movl $0x8010a580,0x8(%ebp) } 801021b1: 83 c4 14 add $0x14,%esp 801021b4: 5b pop %ebx 801021b5: 5d pop %ebp release(&idelock); 801021b6: e9 a5 20 00 00 jmp 80104260 <release> for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue 801021bb: b8 64 a5 10 80 mov $0x8010a564,%eax 801021c0: eb ba jmp 8010217c <iderw+0x6c> idestart(b); 801021c2: 89 d8 mov %ebx,%eax 801021c4: e8 67 fd ff ff call 80101f30 <idestart> 801021c9: eb bb jmp 80102186 <iderw+0x76> panic("iderw: buf not locked"); 801021cb: c7 04 24 0a 70 10 80 movl $0x8010700a,(%esp) 801021d2: e8 89 e1 ff ff call 80100360 <panic> panic("iderw: ide disk 1 not present"); 801021d7: c7 04 24 35 70 10 80 movl $0x80107035,(%esp) 801021de: e8 7d e1 ff ff call 80100360 <panic> panic("iderw: nothing to do"); 801021e3: c7 04 24 20 70 10 80 movl $0x80107020,(%esp) 801021ea: e8 71 e1 ff ff call 80100360 <panic> 801021ef: 90 nop 801021f0 <ioapicinit>: ioapic->data = data; } void ioapicinit(void) { 801021f0: 55 push %ebp 801021f1: 89 e5 mov %esp,%ebp 801021f3: 56 push %esi 801021f4: 53 push %ebx 801021f5: 83 ec 10 sub $0x10,%esp int i, id, maxintr; ioapic = (volatile struct ioapic*)IOAPIC; 801021f8: c7 05 34 26 11 80 00 movl $0xfec00000,0x80112634 801021ff: 00 c0 fe ioapic->reg = reg; 80102202: c7 05 00 00 c0 fe 01 movl $0x1,0xfec00000 80102209: 00 00 00 return ioapic->data; 8010220c: 8b 15 34 26 11 80 mov 0x80112634,%edx 80102212: 8b 42 10 mov 0x10(%edx),%eax ioapic->reg = reg; 80102215: c7 02 00 00 00 00 movl $0x0,(%edx) return ioapic->data; 8010221b: 8b 1d 34 26 11 80 mov 0x80112634,%ebx maxintr = (ioapicread(REG_VER) >> 16) & 0xFF; id = ioapicread(REG_ID) >> 24; if(id != ioapicid) 80102221: 0f b6 15 60 27 11 80 movzbl 0x80112760,%edx maxintr = (ioapicread(REG_VER) >> 16) & 0xFF; 80102228: c1 e8 10 shr $0x10,%eax 8010222b: 0f b6 f0 movzbl %al,%esi return ioapic->data; 8010222e: 8b 43 10 mov 0x10(%ebx),%eax id = ioapicread(REG_ID) >> 24; 80102231: c1 e8 18 shr $0x18,%eax if(id != ioapicid) 80102234: 39 c2 cmp %eax,%edx 80102236: 74 12 je 8010224a <ioapicinit+0x5a> cprintf("ioapicinit: id isn't equal to ioapicid; not a MP\n"); 80102238: c7 04 24 54 70 10 80 movl $0x80107054,(%esp) 8010223f: e8 0c e4 ff ff call 80100650 <cprintf> 80102244: 8b 1d 34 26 11 80 mov 0x80112634,%ebx 8010224a: ba 10 00 00 00 mov $0x10,%edx 8010224f: 31 c0 xor %eax,%eax 80102251: eb 07 jmp 8010225a <ioapicinit+0x6a> 80102253: 90 nop 80102254: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102258: 89 cb mov %ecx,%ebx ioapic->reg = reg; 8010225a: 89 13 mov %edx,(%ebx) ioapic->data = data; 8010225c: 8b 1d 34 26 11 80 mov 0x80112634,%ebx 80102262: 8d 48 20 lea 0x20(%eax),%ecx // 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)); 80102265: 81 c9 00 00 01 00 or $0x10000,%ecx for(i = 0; i <= maxintr; i++){ 8010226b: 83 c0 01 add $0x1,%eax ioapic->data = data; 8010226e: 89 4b 10 mov %ecx,0x10(%ebx) 80102271: 8d 4a 01 lea 0x1(%edx),%ecx 80102274: 83 c2 02 add $0x2,%edx ioapic->reg = reg; 80102277: 89 0b mov %ecx,(%ebx) ioapic->data = data; 80102279: 8b 0d 34 26 11 80 mov 0x80112634,%ecx for(i = 0; i <= maxintr; i++){ 8010227f: 39 c6 cmp %eax,%esi ioapic->data = data; 80102281: c7 41 10 00 00 00 00 movl $0x0,0x10(%ecx) for(i = 0; i <= maxintr; i++){ 80102288: 7d ce jge 80102258 <ioapicinit+0x68> ioapicwrite(REG_TABLE+2*i+1, 0); } } 8010228a: 83 c4 10 add $0x10,%esp 8010228d: 5b pop %ebx 8010228e: 5e pop %esi 8010228f: 5d pop %ebp 80102290: c3 ret 80102291: eb 0d jmp 801022a0 <ioapicenable> 80102293: 90 nop 80102294: 90 nop 80102295: 90 nop 80102296: 90 nop 80102297: 90 nop 80102298: 90 nop 80102299: 90 nop 8010229a: 90 nop 8010229b: 90 nop 8010229c: 90 nop 8010229d: 90 nop 8010229e: 90 nop 8010229f: 90 nop 801022a0 <ioapicenable>: void ioapicenable(int irq, int cpunum) { 801022a0: 55 push %ebp 801022a1: 89 e5 mov %esp,%ebp 801022a3: 8b 55 08 mov 0x8(%ebp),%edx 801022a6: 53 push %ebx 801022a7: 8b 45 0c mov 0xc(%ebp),%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); 801022aa: 8d 5a 20 lea 0x20(%edx),%ebx 801022ad: 8d 4c 12 10 lea 0x10(%edx,%edx,1),%ecx ioapic->reg = reg; 801022b1: 8b 15 34 26 11 80 mov 0x80112634,%edx ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24); 801022b7: c1 e0 18 shl $0x18,%eax ioapic->reg = reg; 801022ba: 89 0a mov %ecx,(%edx) ioapic->data = data; 801022bc: 8b 15 34 26 11 80 mov 0x80112634,%edx ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24); 801022c2: 83 c1 01 add $0x1,%ecx ioapic->data = data; 801022c5: 89 5a 10 mov %ebx,0x10(%edx) ioapic->reg = reg; 801022c8: 89 0a mov %ecx,(%edx) ioapic->data = data; 801022ca: 8b 15 34 26 11 80 mov 0x80112634,%edx 801022d0: 89 42 10 mov %eax,0x10(%edx) } 801022d3: 5b pop %ebx 801022d4: 5d pop %ebp 801022d5: c3 ret 801022d6: 66 90 xchg %ax,%ax 801022d8: 66 90 xchg %ax,%ax 801022da: 66 90 xchg %ax,%ax 801022dc: 66 90 xchg %ax,%ax 801022de: 66 90 xchg %ax,%ax 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 f4 59 11 80 cmp $0x801159f4,%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 91 1f 00 00 call 801042b0 <memset> if(kmem.use_lock) 8010231f: 8b 15 74 26 11 80 mov 0x80112674,%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 78 26 11 80 mov 0x80112678,%eax 8010232e: 89 03 mov %eax,(%ebx) kmem.freelist = r; if(kmem.use_lock) 80102330: a1 74 26 11 80 mov 0x80112674,%eax kmem.freelist = r; 80102335: 89 1d 78 26 11 80 mov %ebx,0x80112678 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 release(&kmem.lock); 80102348: c7 45 08 40 26 11 80 movl $0x80112640,0x8(%ebp) } 8010234f: 83 c4 14 add $0x14,%esp 80102352: 5b pop %ebx 80102353: 5d pop %ebp release(&kmem.lock); 80102354: e9 07 1f 00 00 jmp 80104260 <release> 80102359: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi acquire(&kmem.lock); 80102360: c7 04 24 40 26 11 80 movl $0x80112640,(%esp) 80102367: e8 04 1e 00 00 call 80104170 <acquire> 8010236c: eb bb jmp 80102329 <kfree+0x49> panic("kfree"); 8010236e: c7 04 24 86 70 10 80 movl $0x80107086,(%esp) 80102375: e8 e6 df ff ff call 80100360 <panic> 8010237a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80102380 <freerange>: { 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 p = (char*)PGROUNDUP((uint)vstart); 80102388: 8b 45 08 mov 0x8(%ebp),%eax { 8010238b: 8b 75 0c mov 0xc(%ebp),%esi 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> 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> } 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>: { 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 8c 70 10 movl $0x8010708c,0x4(%esp) 801023e2: 80 801023e3: c7 04 24 40 26 11 80 movl $0x80112640,(%esp) 801023ea: e8 91 1c 00 00 call 80104080 <initlock> p = (char*)PGROUNDUP((uint)vstart); 801023ef: 8b 45 08 mov 0x8(%ebp),%eax kmem.use_lock = 0; 801023f2: c7 05 74 26 11 80 00 movl $0x0,0x80112674 801023f9: 00 00 00 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> 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> } 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>: { 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 p = (char*)PGROUNDUP((uint)vstart); 80102448: 8b 45 08 mov 0x8(%ebp),%eax { 8010244b: 8b 75 0c mov 0xc(%ebp),%esi 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> 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> kmem.use_lock = 1; 8010247e: c7 05 74 26 11 80 01 movl $0x1,0x80112674 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 74 26 11 80 mov 0x80112674,%eax 8010249c: 85 c0 test %eax,%eax 8010249e: 75 30 jne 801024d0 <kalloc+0x40> acquire(&kmem.lock); r = kmem.freelist; 801024a0: 8b 1d 78 26 11 80 mov 0x80112678,%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 78 26 11 80 mov %edx,0x80112678 if(kmem.use_lock) 801024b2: 85 c0 test %eax,%eax 801024b4: 74 0c je 801024c2 <kalloc+0x32> release(&kmem.lock); 801024b6: c7 04 24 40 26 11 80 movl $0x80112640,(%esp) 801024bd: e8 9e 1d 00 00 call 80104260 <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 acquire(&kmem.lock); 801024d0: c7 04 24 40 26 11 80 movl $0x80112640,(%esp) 801024d7: e8 94 1c 00 00 call 80104170 <acquire> 801024dc: a1 74 26 11 80 mov 0x80112674,%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>: 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 a5 10 80 mov 0x8010a5b4,%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 c0 71 10 80 movzbl -0x7fef8e40(%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 a5 10 80 mov %eax,0x8010a5b4 return 0; 8010253a: 31 c0 xor %eax,%eax 8010253c: c3 ret 8010253d: 8d 76 00 lea 0x0(%esi),%esi { 80102540: 55 push %ebp 80102541: 89 e5 mov %esp,%ebp 80102543: 53 push %ebx 80102544: 8b 1d b4 a5 10 80 mov 0x8010a5b4,%ebx } 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 |= 0x80; 80102555: 0f b6 c8 movzbl %al,%ecx } shift |= shiftcode[data]; 80102558: 0f b6 91 c0 71 10 80 movzbl -0x7fef8e40(%ecx),%edx shift ^= togglecode[data]; 8010255f: 0f b6 81 c0 70 10 80 movzbl -0x7fef8f40(%ecx),%eax 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 a0 70 10 80 mov -0x7fef8f60(,%eax,4),%eax shift ^= togglecode[data]; 80102576: 89 15 b4 a5 10 80 mov %edx,0x8010a5b4 if(shift & CAPSLOCK){ 8010257c: 83 e2 08 and $0x8,%edx 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 shift |= E0ESC; 80102598: 83 0d b4 a5 10 80 40 orl $0x40,0x8010a5b4 return 0; 8010259f: 31 c0 xor %eax,%eax 801025a1: c3 ret 801025a2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 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 return -1; 801025b8: b8 ff ff ff ff mov $0xffffffff,%eax 801025bd: c3 ret 801025be: 66 90 xchg %ax,%ax 801025c0 <kbdintr>: 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 de e1 ff ff call 801007b0 <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 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) 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 return inb(CMOS_RETURN); 801025f6: 0f b6 c0 movzbl %al,%eax 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) 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 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) 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 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) 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 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) 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 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) 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>: if(!lapic) 80102660: a1 7c 26 11 80 mov 0x8011267c,%eax { 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> 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 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 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 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 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 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 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> 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 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 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 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 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 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 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> 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 } 80102730: 5d pop %ebp 80102731: c3 ret 80102732: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 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 <lapicid>: if (!lapic) 80102750: a1 7c 26 11 80 mov 0x8011267c,%eax { 80102755: 55 push %ebp 80102756: 89 e5 mov %esp,%ebp if (!lapic) 80102758: 85 c0 test %eax,%eax 8010275a: 74 0c je 80102768 <lapicid+0x18> return lapic[ID] >> 24; 8010275c: 8b 40 20 mov 0x20(%eax),%eax } 8010275f: 5d pop %ebp return lapic[ID] >> 24; 80102760: c1 e8 18 shr $0x18,%eax } 80102763: c3 ret 80102764: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return 0; 80102768: 31 c0 xor %eax,%eax } 8010276a: 5d pop %ebp 8010276b: c3 ret 8010276c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102770 <lapiceoi>: if(lapic) 80102770: a1 7c 26 11 80 mov 0x8011267c,%eax { 80102775: 55 push %ebp 80102776: 89 e5 mov %esp,%ebp if(lapic) 80102778: 85 c0 test %eax,%eax 8010277a: 74 0d je 80102789 <lapiceoi+0x19> lapic[index] = value; 8010277c: c7 80 b0 00 00 00 00 movl $0x0,0xb0(%eax) 80102783: 00 00 00 lapic[ID]; // wait for write to finish, by reading 80102786: 8b 40 20 mov 0x20(%eax),%eax } 80102789: 5d pop %ebp 8010278a: c3 ret 8010278b: 90 nop 8010278c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102790 <microdelay>: { 80102790: 55 push %ebp 80102791: 89 e5 mov %esp,%ebp } 80102793: 5d pop %ebp 80102794: c3 ret 80102795: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102799: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801027a0 <lapicstartap>: { 801027a0: 55 push %ebp asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801027a1: ba 70 00 00 00 mov $0x70,%edx 801027a6: 89 e5 mov %esp,%ebp 801027a8: b8 0f 00 00 00 mov $0xf,%eax 801027ad: 53 push %ebx 801027ae: 8b 4d 08 mov 0x8(%ebp),%ecx 801027b1: 8b 5d 0c mov 0xc(%ebp),%ebx 801027b4: ee out %al,(%dx) 801027b5: b8 0a 00 00 00 mov $0xa,%eax 801027ba: b2 71 mov $0x71,%dl 801027bc: ee out %al,(%dx) wrv[0] = 0; 801027bd: 31 c0 xor %eax,%eax 801027bf: 66 a3 67 04 00 80 mov %ax,0x80000467 wrv[1] = addr >> 4; 801027c5: 89 d8 mov %ebx,%eax 801027c7: c1 e8 04 shr $0x4,%eax 801027ca: 66 a3 69 04 00 80 mov %ax,0x80000469 lapic[index] = value; 801027d0: a1 7c 26 11 80 mov 0x8011267c,%eax lapicw(ICRHI, apicid<<24); 801027d5: c1 e1 18 shl $0x18,%ecx lapicw(ICRLO, STARTUP | (addr>>12)); 801027d8: c1 eb 0c shr $0xc,%ebx lapic[index] = value; 801027db: 89 88 10 03 00 00 mov %ecx,0x310(%eax) lapic[ID]; // wait for write to finish, by reading 801027e1: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801027e4: c7 80 00 03 00 00 00 movl $0xc500,0x300(%eax) 801027eb: c5 00 00 lapic[ID]; // wait for write to finish, by reading 801027ee: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801027f1: c7 80 00 03 00 00 00 movl $0x8500,0x300(%eax) 801027f8: 85 00 00 lapic[ID]; // wait for write to finish, by reading 801027fb: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801027fe: 89 88 10 03 00 00 mov %ecx,0x310(%eax) lapic[ID]; // wait for write to finish, by reading 80102804: 8b 50 20 mov 0x20(%eax),%edx lapicw(ICRLO, STARTUP | (addr>>12)); 80102807: 89 da mov %ebx,%edx 80102809: 80 ce 06 or $0x6,%dh lapic[index] = value; 8010280c: 89 90 00 03 00 00 mov %edx,0x300(%eax) lapic[ID]; // wait for write to finish, by reading 80102812: 8b 58 20 mov 0x20(%eax),%ebx lapic[index] = value; 80102815: 89 88 10 03 00 00 mov %ecx,0x310(%eax) lapic[ID]; // wait for write to finish, by reading 8010281b: 8b 48 20 mov 0x20(%eax),%ecx lapic[index] = value; 8010281e: 89 90 00 03 00 00 mov %edx,0x300(%eax) lapic[ID]; // wait for write to finish, by reading 80102824: 8b 40 20 mov 0x20(%eax),%eax } 80102827: 5b pop %ebx 80102828: 5d pop %ebp 80102829: c3 ret 8010282a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80102830 <cmostime>: // qemu seems to use 24-hour GWT and the values are BCD encoded void cmostime(struct rtcdate *r) { 80102830: 55 push %ebp 80102831: ba 70 00 00 00 mov $0x70,%edx 80102836: 89 e5 mov %esp,%ebp 80102838: b8 0b 00 00 00 mov $0xb,%eax 8010283d: 57 push %edi 8010283e: 56 push %esi 8010283f: 53 push %ebx 80102840: 83 ec 4c sub $0x4c,%esp 80102843: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102844: b2 71 mov $0x71,%dl 80102846: ec in (%dx),%al 80102847: 88 45 b7 mov %al,-0x49(%ebp) 8010284a: 8d 5d b8 lea -0x48(%ebp),%ebx struct rtcdate t1, t2; int sb, bcd; sb = cmos_read(CMOS_STATB); bcd = (sb & (1 << 2)) == 0; 8010284d: 80 65 b7 04 andb $0x4,-0x49(%ebp) 80102851: 8d 7d d0 lea -0x30(%ebp),%edi 80102854: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102858: be 70 00 00 00 mov $0x70,%esi // make sure CMOS doesn't modify time while we read it for(;;) { fill_rtcdate(&t1); 8010285d: 89 d8 mov %ebx,%eax 8010285f: e8 7c fd ff ff call 801025e0 <fill_rtcdate> 80102864: b8 0a 00 00 00 mov $0xa,%eax 80102869: 89 f2 mov %esi,%edx 8010286b: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010286c: ba 71 00 00 00 mov $0x71,%edx 80102871: ec in (%dx),%al if(cmos_read(CMOS_STATA) & CMOS_UIP) 80102872: 84 c0 test %al,%al 80102874: 78 e7 js 8010285d <cmostime+0x2d> continue; fill_rtcdate(&t2); 80102876: 89 f8 mov %edi,%eax 80102878: e8 63 fd ff ff call 801025e0 <fill_rtcdate> if(memcmp(&t1, &t2, sizeof(t1)) == 0) 8010287d: c7 44 24 08 18 00 00 movl $0x18,0x8(%esp) 80102884: 00 80102885: 89 7c 24 04 mov %edi,0x4(%esp) 80102889: 89 1c 24 mov %ebx,(%esp) 8010288c: e8 6f 1a 00 00 call 80104300 <memcmp> 80102891: 85 c0 test %eax,%eax 80102893: 75 c3 jne 80102858 <cmostime+0x28> break; } // convert if(bcd) { 80102895: 80 7d b7 00 cmpb $0x0,-0x49(%ebp) 80102899: 75 78 jne 80102913 <cmostime+0xe3> #define CONV(x) (t1.x = ((t1.x >> 4) * 10) + (t1.x & 0xf)) CONV(second); 8010289b: 8b 45 b8 mov -0x48(%ebp),%eax 8010289e: 89 c2 mov %eax,%edx 801028a0: 83 e0 0f and $0xf,%eax 801028a3: c1 ea 04 shr $0x4,%edx 801028a6: 8d 14 92 lea (%edx,%edx,4),%edx 801028a9: 8d 04 50 lea (%eax,%edx,2),%eax 801028ac: 89 45 b8 mov %eax,-0x48(%ebp) CONV(minute); 801028af: 8b 45 bc mov -0x44(%ebp),%eax 801028b2: 89 c2 mov %eax,%edx 801028b4: 83 e0 0f and $0xf,%eax 801028b7: c1 ea 04 shr $0x4,%edx 801028ba: 8d 14 92 lea (%edx,%edx,4),%edx 801028bd: 8d 04 50 lea (%eax,%edx,2),%eax 801028c0: 89 45 bc mov %eax,-0x44(%ebp) CONV(hour ); 801028c3: 8b 45 c0 mov -0x40(%ebp),%eax 801028c6: 89 c2 mov %eax,%edx 801028c8: 83 e0 0f and $0xf,%eax 801028cb: c1 ea 04 shr $0x4,%edx 801028ce: 8d 14 92 lea (%edx,%edx,4),%edx 801028d1: 8d 04 50 lea (%eax,%edx,2),%eax 801028d4: 89 45 c0 mov %eax,-0x40(%ebp) CONV(day ); 801028d7: 8b 45 c4 mov -0x3c(%ebp),%eax 801028da: 89 c2 mov %eax,%edx 801028dc: 83 e0 0f and $0xf,%eax 801028df: c1 ea 04 shr $0x4,%edx 801028e2: 8d 14 92 lea (%edx,%edx,4),%edx 801028e5: 8d 04 50 lea (%eax,%edx,2),%eax 801028e8: 89 45 c4 mov %eax,-0x3c(%ebp) CONV(month ); 801028eb: 8b 45 c8 mov -0x38(%ebp),%eax 801028ee: 89 c2 mov %eax,%edx 801028f0: 83 e0 0f and $0xf,%eax 801028f3: c1 ea 04 shr $0x4,%edx 801028f6: 8d 14 92 lea (%edx,%edx,4),%edx 801028f9: 8d 04 50 lea (%eax,%edx,2),%eax 801028fc: 89 45 c8 mov %eax,-0x38(%ebp) CONV(year ); 801028ff: 8b 45 cc mov -0x34(%ebp),%eax 80102902: 89 c2 mov %eax,%edx 80102904: 83 e0 0f and $0xf,%eax 80102907: c1 ea 04 shr $0x4,%edx 8010290a: 8d 14 92 lea (%edx,%edx,4),%edx 8010290d: 8d 04 50 lea (%eax,%edx,2),%eax 80102910: 89 45 cc mov %eax,-0x34(%ebp) #undef CONV } *r = t1; 80102913: 8b 4d 08 mov 0x8(%ebp),%ecx 80102916: 8b 45 b8 mov -0x48(%ebp),%eax 80102919: 89 01 mov %eax,(%ecx) 8010291b: 8b 45 bc mov -0x44(%ebp),%eax 8010291e: 89 41 04 mov %eax,0x4(%ecx) 80102921: 8b 45 c0 mov -0x40(%ebp),%eax 80102924: 89 41 08 mov %eax,0x8(%ecx) 80102927: 8b 45 c4 mov -0x3c(%ebp),%eax 8010292a: 89 41 0c mov %eax,0xc(%ecx) 8010292d: 8b 45 c8 mov -0x38(%ebp),%eax 80102930: 89 41 10 mov %eax,0x10(%ecx) 80102933: 8b 45 cc mov -0x34(%ebp),%eax 80102936: 89 41 14 mov %eax,0x14(%ecx) r->year += 2000; 80102939: 81 41 14 d0 07 00 00 addl $0x7d0,0x14(%ecx) } 80102940: 83 c4 4c add $0x4c,%esp 80102943: 5b pop %ebx 80102944: 5e pop %esi 80102945: 5f pop %edi 80102946: 5d pop %ebp 80102947: c3 ret 80102948: 66 90 xchg %ax,%ax 8010294a: 66 90 xchg %ax,%ax 8010294c: 66 90 xchg %ax,%ax 8010294e: 66 90 xchg %ax,%ax 80102950 <install_trans>: } // Copy committed blocks from log to their home location static void install_trans(void) { 80102950: 55 push %ebp 80102951: 89 e5 mov %esp,%ebp 80102953: 57 push %edi 80102954: 56 push %esi 80102955: 53 push %ebx int tail; for (tail = 0; tail < log.lh.n; tail++) { 80102956: 31 db xor %ebx,%ebx { 80102958: 83 ec 1c sub $0x1c,%esp for (tail = 0; tail < log.lh.n; tail++) { 8010295b: a1 c8 26 11 80 mov 0x801126c8,%eax 80102960: 85 c0 test %eax,%eax 80102962: 7e 78 jle 801029dc <install_trans+0x8c> 80102964: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi struct buf *lbuf = bread(log.dev, log.start+tail+1); // read log block 80102968: a1 b4 26 11 80 mov 0x801126b4,%eax 8010296d: 01 d8 add %ebx,%eax 8010296f: 83 c0 01 add $0x1,%eax 80102972: 89 44 24 04 mov %eax,0x4(%esp) 80102976: a1 c4 26 11 80 mov 0x801126c4,%eax 8010297b: 89 04 24 mov %eax,(%esp) 8010297e: e8 4d d7 ff ff call 801000d0 <bread> 80102983: 89 c7 mov %eax,%edi struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst 80102985: 8b 04 9d cc 26 11 80 mov -0x7feed934(,%ebx,4),%eax for (tail = 0; tail < log.lh.n; tail++) { 8010298c: 83 c3 01 add $0x1,%ebx struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst 8010298f: 89 44 24 04 mov %eax,0x4(%esp) 80102993: a1 c4 26 11 80 mov 0x801126c4,%eax 80102998: 89 04 24 mov %eax,(%esp) 8010299b: e8 30 d7 ff ff call 801000d0 <bread> memmove(dbuf->data, lbuf->data, BSIZE); // copy block to dst 801029a0: c7 44 24 08 00 02 00 movl $0x200,0x8(%esp) 801029a7: 00 struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst 801029a8: 89 c6 mov %eax,%esi memmove(dbuf->data, lbuf->data, BSIZE); // copy block to dst 801029aa: 8d 47 5c lea 0x5c(%edi),%eax 801029ad: 89 44 24 04 mov %eax,0x4(%esp) 801029b1: 8d 46 5c lea 0x5c(%esi),%eax 801029b4: 89 04 24 mov %eax,(%esp) 801029b7: e8 94 19 00 00 call 80104350 <memmove> bwrite(dbuf); // write dst to disk 801029bc: 89 34 24 mov %esi,(%esp) 801029bf: e8 dc d7 ff ff call 801001a0 <bwrite> brelse(lbuf); 801029c4: 89 3c 24 mov %edi,(%esp) 801029c7: e8 14 d8 ff ff call 801001e0 <brelse> brelse(dbuf); 801029cc: 89 34 24 mov %esi,(%esp) 801029cf: e8 0c d8 ff ff call 801001e0 <brelse> for (tail = 0; tail < log.lh.n; tail++) { 801029d4: 39 1d c8 26 11 80 cmp %ebx,0x801126c8 801029da: 7f 8c jg 80102968 <install_trans+0x18> } } 801029dc: 83 c4 1c add $0x1c,%esp 801029df: 5b pop %ebx 801029e0: 5e pop %esi 801029e1: 5f pop %edi 801029e2: 5d pop %ebp 801029e3: c3 ret 801029e4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801029ea: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 801029f0 <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) { 801029f0: 55 push %ebp 801029f1: 89 e5 mov %esp,%ebp 801029f3: 57 push %edi 801029f4: 56 push %esi 801029f5: 53 push %ebx 801029f6: 83 ec 1c sub $0x1c,%esp struct buf *buf = bread(log.dev, log.start); 801029f9: a1 b4 26 11 80 mov 0x801126b4,%eax 801029fe: 89 44 24 04 mov %eax,0x4(%esp) 80102a02: a1 c4 26 11 80 mov 0x801126c4,%eax 80102a07: 89 04 24 mov %eax,(%esp) 80102a0a: e8 c1 d6 ff ff call 801000d0 <bread> struct logheader *hb = (struct logheader *) (buf->data); int i; hb->n = log.lh.n; 80102a0f: 8b 1d c8 26 11 80 mov 0x801126c8,%ebx for (i = 0; i < log.lh.n; i++) { 80102a15: 31 d2 xor %edx,%edx 80102a17: 85 db test %ebx,%ebx struct buf *buf = bread(log.dev, log.start); 80102a19: 89 c7 mov %eax,%edi hb->n = log.lh.n; 80102a1b: 89 58 5c mov %ebx,0x5c(%eax) 80102a1e: 8d 70 5c lea 0x5c(%eax),%esi for (i = 0; i < log.lh.n; i++) { 80102a21: 7e 17 jle 80102a3a <write_head+0x4a> 80102a23: 90 nop 80102a24: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi hb->block[i] = log.lh.block[i]; 80102a28: 8b 0c 95 cc 26 11 80 mov -0x7feed934(,%edx,4),%ecx 80102a2f: 89 4c 96 04 mov %ecx,0x4(%esi,%edx,4) for (i = 0; i < log.lh.n; i++) { 80102a33: 83 c2 01 add $0x1,%edx 80102a36: 39 da cmp %ebx,%edx 80102a38: 75 ee jne 80102a28 <write_head+0x38> } bwrite(buf); 80102a3a: 89 3c 24 mov %edi,(%esp) 80102a3d: e8 5e d7 ff ff call 801001a0 <bwrite> brelse(buf); 80102a42: 89 3c 24 mov %edi,(%esp) 80102a45: e8 96 d7 ff ff call 801001e0 <brelse> } 80102a4a: 83 c4 1c add $0x1c,%esp 80102a4d: 5b pop %ebx 80102a4e: 5e pop %esi 80102a4f: 5f pop %edi 80102a50: 5d pop %ebp 80102a51: c3 ret 80102a52: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80102a59: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102a60 <initlog>: { 80102a60: 55 push %ebp 80102a61: 89 e5 mov %esp,%ebp 80102a63: 56 push %esi 80102a64: 53 push %ebx 80102a65: 83 ec 30 sub $0x30,%esp 80102a68: 8b 5d 08 mov 0x8(%ebp),%ebx initlock(&log.lock, "log"); 80102a6b: c7 44 24 04 c0 72 10 movl $0x801072c0,0x4(%esp) 80102a72: 80 80102a73: c7 04 24 80 26 11 80 movl $0x80112680,(%esp) 80102a7a: e8 01 16 00 00 call 80104080 <initlock> readsb(dev, &sb); 80102a7f: 8d 45 dc lea -0x24(%ebp),%eax 80102a82: 89 44 24 04 mov %eax,0x4(%esp) 80102a86: 89 1c 24 mov %ebx,(%esp) 80102a89: e8 f2 e8 ff ff call 80101380 <readsb> log.start = sb.logstart; 80102a8e: 8b 45 ec mov -0x14(%ebp),%eax log.size = sb.nlog; 80102a91: 8b 55 e8 mov -0x18(%ebp),%edx struct buf *buf = bread(log.dev, log.start); 80102a94: 89 1c 24 mov %ebx,(%esp) log.dev = dev; 80102a97: 89 1d c4 26 11 80 mov %ebx,0x801126c4 struct buf *buf = bread(log.dev, log.start); 80102a9d: 89 44 24 04 mov %eax,0x4(%esp) log.size = sb.nlog; 80102aa1: 89 15 b8 26 11 80 mov %edx,0x801126b8 log.start = sb.logstart; 80102aa7: a3 b4 26 11 80 mov %eax,0x801126b4 struct buf *buf = bread(log.dev, log.start); 80102aac: e8 1f d6 ff ff call 801000d0 <bread> for (i = 0; i < log.lh.n; i++) { 80102ab1: 31 d2 xor %edx,%edx log.lh.n = lh->n; 80102ab3: 8b 58 5c mov 0x5c(%eax),%ebx 80102ab6: 8d 70 5c lea 0x5c(%eax),%esi for (i = 0; i < log.lh.n; i++) { 80102ab9: 85 db test %ebx,%ebx log.lh.n = lh->n; 80102abb: 89 1d c8 26 11 80 mov %ebx,0x801126c8 for (i = 0; i < log.lh.n; i++) { 80102ac1: 7e 17 jle 80102ada <initlog+0x7a> 80102ac3: 90 nop 80102ac4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi log.lh.block[i] = lh->block[i]; 80102ac8: 8b 4c 96 04 mov 0x4(%esi,%edx,4),%ecx 80102acc: 89 0c 95 cc 26 11 80 mov %ecx,-0x7feed934(,%edx,4) for (i = 0; i < log.lh.n; i++) { 80102ad3: 83 c2 01 add $0x1,%edx 80102ad6: 39 da cmp %ebx,%edx 80102ad8: 75 ee jne 80102ac8 <initlog+0x68> brelse(buf); 80102ada: 89 04 24 mov %eax,(%esp) 80102add: e8 fe d6 ff ff call 801001e0 <brelse> static void recover_from_log(void) { read_head(); install_trans(); // if committed, copy from log to disk 80102ae2: e8 69 fe ff ff call 80102950 <install_trans> log.lh.n = 0; 80102ae7: c7 05 c8 26 11 80 00 movl $0x0,0x801126c8 80102aee: 00 00 00 write_head(); // clear the log 80102af1: e8 fa fe ff ff call 801029f0 <write_head> } 80102af6: 83 c4 30 add $0x30,%esp 80102af9: 5b pop %ebx 80102afa: 5e pop %esi 80102afb: 5d pop %ebp 80102afc: c3 ret 80102afd: 8d 76 00 lea 0x0(%esi),%esi 80102b00 <begin_op>: } // called at the start of each FS system call. void begin_op(void) { 80102b00: 55 push %ebp 80102b01: 89 e5 mov %esp,%ebp 80102b03: 83 ec 18 sub $0x18,%esp acquire(&log.lock); 80102b06: c7 04 24 80 26 11 80 movl $0x80112680,(%esp) 80102b0d: e8 5e 16 00 00 call 80104170 <acquire> 80102b12: eb 18 jmp 80102b2c <begin_op+0x2c> 80102b14: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi while(1){ if(log.committing){ sleep(&log, &log.lock); 80102b18: c7 44 24 04 80 26 11 movl $0x80112680,0x4(%esp) 80102b1f: 80 80102b20: c7 04 24 80 26 11 80 movl $0x80112680,(%esp) 80102b27: e8 e4 10 00 00 call 80103c10 <sleep> if(log.committing){ 80102b2c: a1 c0 26 11 80 mov 0x801126c0,%eax 80102b31: 85 c0 test %eax,%eax 80102b33: 75 e3 jne 80102b18 <begin_op+0x18> } else if(log.lh.n + (log.outstanding+1)*MAXOPBLOCKS > LOGSIZE){ 80102b35: a1 bc 26 11 80 mov 0x801126bc,%eax 80102b3a: 8b 15 c8 26 11 80 mov 0x801126c8,%edx 80102b40: 83 c0 01 add $0x1,%eax 80102b43: 8d 0c 80 lea (%eax,%eax,4),%ecx 80102b46: 8d 14 4a lea (%edx,%ecx,2),%edx 80102b49: 83 fa 1e cmp $0x1e,%edx 80102b4c: 7f ca jg 80102b18 <begin_op+0x18> // this op might exhaust log space; wait for commit. sleep(&log, &log.lock); } else { log.outstanding += 1; release(&log.lock); 80102b4e: c7 04 24 80 26 11 80 movl $0x80112680,(%esp) log.outstanding += 1; 80102b55: a3 bc 26 11 80 mov %eax,0x801126bc release(&log.lock); 80102b5a: e8 01 17 00 00 call 80104260 <release> break; } } } 80102b5f: c9 leave 80102b60: c3 ret 80102b61: eb 0d jmp 80102b70 <end_op> 80102b63: 90 nop 80102b64: 90 nop 80102b65: 90 nop 80102b66: 90 nop 80102b67: 90 nop 80102b68: 90 nop 80102b69: 90 nop 80102b6a: 90 nop 80102b6b: 90 nop 80102b6c: 90 nop 80102b6d: 90 nop 80102b6e: 90 nop 80102b6f: 90 nop 80102b70 <end_op>: // called at the end of each FS system call. // commits if this was the last outstanding operation. void end_op(void) { 80102b70: 55 push %ebp 80102b71: 89 e5 mov %esp,%ebp 80102b73: 57 push %edi 80102b74: 56 push %esi 80102b75: 53 push %ebx 80102b76: 83 ec 1c sub $0x1c,%esp int do_commit = 0; acquire(&log.lock); 80102b79: c7 04 24 80 26 11 80 movl $0x80112680,(%esp) 80102b80: e8 eb 15 00 00 call 80104170 <acquire> log.outstanding -= 1; 80102b85: a1 bc 26 11 80 mov 0x801126bc,%eax if(log.committing) 80102b8a: 8b 15 c0 26 11 80 mov 0x801126c0,%edx log.outstanding -= 1; 80102b90: 83 e8 01 sub $0x1,%eax if(log.committing) 80102b93: 85 d2 test %edx,%edx log.outstanding -= 1; 80102b95: a3 bc 26 11 80 mov %eax,0x801126bc if(log.committing) 80102b9a: 0f 85 f3 00 00 00 jne 80102c93 <end_op+0x123> panic("log.committing"); if(log.outstanding == 0){ 80102ba0: 85 c0 test %eax,%eax 80102ba2: 0f 85 cb 00 00 00 jne 80102c73 <end_op+0x103> // begin_op() may be waiting for log space, // and decrementing log.outstanding has decreased // the amount of reserved space. wakeup(&log); } release(&log.lock); 80102ba8: c7 04 24 80 26 11 80 movl $0x80112680,(%esp) } static void commit() { if (log.lh.n > 0) { 80102baf: 31 db xor %ebx,%ebx log.committing = 1; 80102bb1: c7 05 c0 26 11 80 01 movl $0x1,0x801126c0 80102bb8: 00 00 00 release(&log.lock); 80102bbb: e8 a0 16 00 00 call 80104260 <release> if (log.lh.n > 0) { 80102bc0: a1 c8 26 11 80 mov 0x801126c8,%eax 80102bc5: 85 c0 test %eax,%eax 80102bc7: 0f 8e 90 00 00 00 jle 80102c5d <end_op+0xed> 80102bcd: 8d 76 00 lea 0x0(%esi),%esi struct buf *to = bread(log.dev, log.start+tail+1); // log block 80102bd0: a1 b4 26 11 80 mov 0x801126b4,%eax 80102bd5: 01 d8 add %ebx,%eax 80102bd7: 83 c0 01 add $0x1,%eax 80102bda: 89 44 24 04 mov %eax,0x4(%esp) 80102bde: a1 c4 26 11 80 mov 0x801126c4,%eax 80102be3: 89 04 24 mov %eax,(%esp) 80102be6: e8 e5 d4 ff ff call 801000d0 <bread> 80102beb: 89 c6 mov %eax,%esi struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block 80102bed: 8b 04 9d cc 26 11 80 mov -0x7feed934(,%ebx,4),%eax for (tail = 0; tail < log.lh.n; tail++) { 80102bf4: 83 c3 01 add $0x1,%ebx struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block 80102bf7: 89 44 24 04 mov %eax,0x4(%esp) 80102bfb: a1 c4 26 11 80 mov 0x801126c4,%eax 80102c00: 89 04 24 mov %eax,(%esp) 80102c03: e8 c8 d4 ff ff call 801000d0 <bread> memmove(to->data, from->data, BSIZE); 80102c08: c7 44 24 08 00 02 00 movl $0x200,0x8(%esp) 80102c0f: 00 struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block 80102c10: 89 c7 mov %eax,%edi memmove(to->data, from->data, BSIZE); 80102c12: 8d 40 5c lea 0x5c(%eax),%eax 80102c15: 89 44 24 04 mov %eax,0x4(%esp) 80102c19: 8d 46 5c lea 0x5c(%esi),%eax 80102c1c: 89 04 24 mov %eax,(%esp) 80102c1f: e8 2c 17 00 00 call 80104350 <memmove> bwrite(to); // write the log 80102c24: 89 34 24 mov %esi,(%esp) 80102c27: e8 74 d5 ff ff call 801001a0 <bwrite> brelse(from); 80102c2c: 89 3c 24 mov %edi,(%esp) 80102c2f: e8 ac d5 ff ff call 801001e0 <brelse> brelse(to); 80102c34: 89 34 24 mov %esi,(%esp) 80102c37: e8 a4 d5 ff ff call 801001e0 <brelse> for (tail = 0; tail < log.lh.n; tail++) { 80102c3c: 3b 1d c8 26 11 80 cmp 0x801126c8,%ebx 80102c42: 7c 8c jl 80102bd0 <end_op+0x60> write_log(); // Write modified blocks from cache to log write_head(); // Write header to disk -- the real commit 80102c44: e8 a7 fd ff ff call 801029f0 <write_head> install_trans(); // Now install writes to home locations 80102c49: e8 02 fd ff ff call 80102950 <install_trans> log.lh.n = 0; 80102c4e: c7 05 c8 26 11 80 00 movl $0x0,0x801126c8 80102c55: 00 00 00 write_head(); // Erase the transaction from the log 80102c58: e8 93 fd ff ff call 801029f0 <write_head> acquire(&log.lock); 80102c5d: c7 04 24 80 26 11 80 movl $0x80112680,(%esp) 80102c64: e8 07 15 00 00 call 80104170 <acquire> log.committing = 0; 80102c69: c7 05 c0 26 11 80 00 movl $0x0,0x801126c0 80102c70: 00 00 00 wakeup(&log); 80102c73: c7 04 24 80 26 11 80 movl $0x80112680,(%esp) 80102c7a: e8 31 11 00 00 call 80103db0 <wakeup> release(&log.lock); 80102c7f: c7 04 24 80 26 11 80 movl $0x80112680,(%esp) 80102c86: e8 d5 15 00 00 call 80104260 <release> } 80102c8b: 83 c4 1c add $0x1c,%esp 80102c8e: 5b pop %ebx 80102c8f: 5e pop %esi 80102c90: 5f pop %edi 80102c91: 5d pop %ebp 80102c92: c3 ret panic("log.committing"); 80102c93: c7 04 24 c4 72 10 80 movl $0x801072c4,(%esp) 80102c9a: e8 c1 d6 ff ff call 80100360 <panic> 80102c9f: 90 nop 80102ca0 <log_write>: // modify bp->data[] // log_write(bp) // brelse(bp) void log_write(struct buf *b) { 80102ca0: 55 push %ebp 80102ca1: 89 e5 mov %esp,%ebp 80102ca3: 53 push %ebx 80102ca4: 83 ec 14 sub $0x14,%esp int i; if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1) 80102ca7: a1 c8 26 11 80 mov 0x801126c8,%eax { 80102cac: 8b 5d 08 mov 0x8(%ebp),%ebx if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1) 80102caf: 83 f8 1d cmp $0x1d,%eax 80102cb2: 0f 8f 98 00 00 00 jg 80102d50 <log_write+0xb0> 80102cb8: 8b 0d b8 26 11 80 mov 0x801126b8,%ecx 80102cbe: 8d 51 ff lea -0x1(%ecx),%edx 80102cc1: 39 d0 cmp %edx,%eax 80102cc3: 0f 8d 87 00 00 00 jge 80102d50 <log_write+0xb0> panic("too big a transaction"); if (log.outstanding < 1) 80102cc9: a1 bc 26 11 80 mov 0x801126bc,%eax 80102cce: 85 c0 test %eax,%eax 80102cd0: 0f 8e 86 00 00 00 jle 80102d5c <log_write+0xbc> panic("log_write outside of trans"); acquire(&log.lock); 80102cd6: c7 04 24 80 26 11 80 movl $0x80112680,(%esp) 80102cdd: e8 8e 14 00 00 call 80104170 <acquire> for (i = 0; i < log.lh.n; i++) { 80102ce2: 8b 15 c8 26 11 80 mov 0x801126c8,%edx 80102ce8: 83 fa 00 cmp $0x0,%edx 80102ceb: 7e 54 jle 80102d41 <log_write+0xa1> if (log.lh.block[i] == b->blockno) // log absorbtion 80102ced: 8b 4b 08 mov 0x8(%ebx),%ecx for (i = 0; i < log.lh.n; i++) { 80102cf0: 31 c0 xor %eax,%eax if (log.lh.block[i] == b->blockno) // log absorbtion 80102cf2: 39 0d cc 26 11 80 cmp %ecx,0x801126cc 80102cf8: 75 0f jne 80102d09 <log_write+0x69> 80102cfa: eb 3c jmp 80102d38 <log_write+0x98> 80102cfc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102d00: 39 0c 85 cc 26 11 80 cmp %ecx,-0x7feed934(,%eax,4) 80102d07: 74 2f je 80102d38 <log_write+0x98> for (i = 0; i < log.lh.n; i++) { 80102d09: 83 c0 01 add $0x1,%eax 80102d0c: 39 d0 cmp %edx,%eax 80102d0e: 75 f0 jne 80102d00 <log_write+0x60> break; } log.lh.block[i] = b->blockno; 80102d10: 89 0c 95 cc 26 11 80 mov %ecx,-0x7feed934(,%edx,4) if (i == log.lh.n) log.lh.n++; 80102d17: 83 c2 01 add $0x1,%edx 80102d1a: 89 15 c8 26 11 80 mov %edx,0x801126c8 b->flags |= B_DIRTY; // prevent eviction 80102d20: 83 0b 04 orl $0x4,(%ebx) release(&log.lock); 80102d23: c7 45 08 80 26 11 80 movl $0x80112680,0x8(%ebp) } 80102d2a: 83 c4 14 add $0x14,%esp 80102d2d: 5b pop %ebx 80102d2e: 5d pop %ebp release(&log.lock); 80102d2f: e9 2c 15 00 00 jmp 80104260 <release> 80102d34: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi log.lh.block[i] = b->blockno; 80102d38: 89 0c 85 cc 26 11 80 mov %ecx,-0x7feed934(,%eax,4) 80102d3f: eb df jmp 80102d20 <log_write+0x80> 80102d41: 8b 43 08 mov 0x8(%ebx),%eax 80102d44: a3 cc 26 11 80 mov %eax,0x801126cc if (i == log.lh.n) 80102d49: 75 d5 jne 80102d20 <log_write+0x80> 80102d4b: eb ca jmp 80102d17 <log_write+0x77> 80102d4d: 8d 76 00 lea 0x0(%esi),%esi panic("too big a transaction"); 80102d50: c7 04 24 d3 72 10 80 movl $0x801072d3,(%esp) 80102d57: e8 04 d6 ff ff call 80100360 <panic> panic("log_write outside of trans"); 80102d5c: c7 04 24 e9 72 10 80 movl $0x801072e9,(%esp) 80102d63: e8 f8 d5 ff ff call 80100360 <panic> 80102d68: 66 90 xchg %ax,%ax 80102d6a: 66 90 xchg %ax,%ax 80102d6c: 66 90 xchg %ax,%ax 80102d6e: 66 90 xchg %ax,%ax 80102d70 <mpmain>: } // Common CPU setup code. static void mpmain(void) { 80102d70: 55 push %ebp 80102d71: 89 e5 mov %esp,%ebp 80102d73: 53 push %ebx 80102d74: 83 ec 14 sub $0x14,%esp cprintf("cpu%d: starting %d\n", cpuid(), cpuid()); 80102d77: e8 f4 08 00 00 call 80103670 <cpuid> 80102d7c: 89 c3 mov %eax,%ebx 80102d7e: e8 ed 08 00 00 call 80103670 <cpuid> 80102d83: 89 5c 24 08 mov %ebx,0x8(%esp) 80102d87: c7 04 24 04 73 10 80 movl $0x80107304,(%esp) 80102d8e: 89 44 24 04 mov %eax,0x4(%esp) 80102d92: e8 b9 d8 ff ff call 80100650 <cprintf> idtinit(); // load idt register 80102d97: e8 94 27 00 00 call 80105530 <idtinit> xchg(&(mycpu()->started), 1); // tell startothers() we're up 80102d9c: e8 4f 08 00 00 call 801035f0 <mycpu> 80102da1: 89 c2 mov %eax,%edx xchg(volatile uint *addr, uint newval) { uint result; // The + in "+m" denotes a read-modify-write operand. asm volatile("lock; xchgl %0, %1" : 80102da3: b8 01 00 00 00 mov $0x1,%eax 80102da8: f0 87 82 a0 00 00 00 lock xchg %eax,0xa0(%edx) scheduler(); // start running processes 80102daf: e8 ac 0b 00 00 call 80103960 <scheduler> 80102db4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80102dba: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80102dc0 <mpenter>: { 80102dc0: 55 push %ebp 80102dc1: 89 e5 mov %esp,%ebp 80102dc3: 83 ec 08 sub $0x8,%esp switchkvm(); 80102dc6: e8 25 38 00 00 call 801065f0 <switchkvm> seginit(); 80102dcb: e8 e0 36 00 00 call 801064b0 <seginit> lapicinit(); 80102dd0: e8 8b f8 ff ff call 80102660 <lapicinit> mpmain(); 80102dd5: e8 96 ff ff ff call 80102d70 <mpmain> 80102dda: 66 90 xchg %ax,%ax 80102ddc: 66 90 xchg %ax,%ax 80102dde: 66 90 xchg %ax,%ax 80102de0 <main>: { 80102de0: 55 push %ebp 80102de1: 89 e5 mov %esp,%ebp 80102de3: 53 push %ebx // 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++){ 80102de4: bb 80 27 11 80 mov $0x80112780,%ebx { 80102de9: 83 e4 f0 and $0xfffffff0,%esp 80102dec: 83 ec 10 sub $0x10,%esp kinit1(end, P2V(4*1024*1024)); // phys page allocator 80102def: c7 44 24 04 00 00 40 movl $0x80400000,0x4(%esp) 80102df6: 80 80102df7: c7 04 24 f4 59 11 80 movl $0x801159f4,(%esp) 80102dfe: e8 cd f5 ff ff call 801023d0 <kinit1> kvmalloc(); // kernel page table 80102e03: e8 98 3c 00 00 call 80106aa0 <kvmalloc> mpinit(); // detect other processors 80102e08: e8 73 01 00 00 call 80102f80 <mpinit> 80102e0d: 8d 76 00 lea 0x0(%esi),%esi lapicinit(); // interrupt controller 80102e10: e8 4b f8 ff ff call 80102660 <lapicinit> seginit(); // segment descriptors 80102e15: e8 96 36 00 00 call 801064b0 <seginit> picinit(); // disable pic 80102e1a: e8 21 03 00 00 call 80103140 <picinit> 80102e1f: 90 nop ioapicinit(); // another interrupt controller 80102e20: e8 cb f3 ff ff call 801021f0 <ioapicinit> consoleinit(); // console hardware 80102e25: e8 26 db ff ff call 80100950 <consoleinit> uartinit(); // serial port 80102e2a: e8 21 2a 00 00 call 80105850 <uartinit> 80102e2f: 90 nop pinit(); // process table 80102e30: e8 9b 07 00 00 call 801035d0 <pinit> shminit(); // shared memory 80102e35: e8 56 3f 00 00 call 80106d90 <shminit> tvinit(); // trap vectors 80102e3a: e8 51 26 00 00 call 80105490 <tvinit> 80102e3f: 90 nop binit(); // buffer cache 80102e40: e8 fb d1 ff ff call 80100040 <binit> fileinit(); // file table 80102e45: e8 e6 de ff ff call 80100d30 <fileinit> ideinit(); // disk 80102e4a: e8 a1 f1 ff ff call 80101ff0 <ideinit> memmove(code, _binary_entryother_start, (uint)_binary_entryother_size); 80102e4f: c7 44 24 08 8a 00 00 movl $0x8a,0x8(%esp) 80102e56: 00 80102e57: c7 44 24 04 8c a4 10 movl $0x8010a48c,0x4(%esp) 80102e5e: 80 80102e5f: c7 04 24 00 70 00 80 movl $0x80007000,(%esp) 80102e66: e8 e5 14 00 00 call 80104350 <memmove> for(c = cpus; c < cpus+ncpu; c++){ 80102e6b: 69 05 00 2d 11 80 b0 imul $0xb0,0x80112d00,%eax 80102e72: 00 00 00 80102e75: 05 80 27 11 80 add $0x80112780,%eax 80102e7a: 39 d8 cmp %ebx,%eax 80102e7c: 76 65 jbe 80102ee3 <main+0x103> 80102e7e: 66 90 xchg %ax,%ax if(c == mycpu()) // We've started already. 80102e80: e8 6b 07 00 00 call 801035f0 <mycpu> 80102e85: 39 d8 cmp %ebx,%eax 80102e87: 74 41 je 80102eca <main+0xea> 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(); 80102e89: e8 02 f6 ff ff call 80102490 <kalloc> *(void**)(code-4) = stack + KSTACKSIZE; *(void**)(code-8) = mpenter; 80102e8e: c7 05 f8 6f 00 80 c0 movl $0x80102dc0,0x80006ff8 80102e95: 2d 10 80 *(int**)(code-12) = (void *) V2P(entrypgdir); 80102e98: c7 05 f4 6f 00 80 00 movl $0x109000,0x80006ff4 80102e9f: 90 10 00 *(void**)(code-4) = stack + KSTACKSIZE; 80102ea2: 05 00 10 00 00 add $0x1000,%eax 80102ea7: a3 fc 6f 00 80 mov %eax,0x80006ffc lapicstartap(c->apicid, V2P(code)); 80102eac: 0f b6 03 movzbl (%ebx),%eax 80102eaf: c7 44 24 04 00 70 00 movl $0x7000,0x4(%esp) 80102eb6: 00 80102eb7: 89 04 24 mov %eax,(%esp) 80102eba: e8 e1 f8 ff ff call 801027a0 <lapicstartap> 80102ebf: 90 nop // wait for cpu to finish mpmain() while(c->started == 0) 80102ec0: 8b 83 a0 00 00 00 mov 0xa0(%ebx),%eax 80102ec6: 85 c0 test %eax,%eax 80102ec8: 74 f6 je 80102ec0 <main+0xe0> for(c = cpus; c < cpus+ncpu; c++){ 80102eca: 69 05 00 2d 11 80 b0 imul $0xb0,0x80112d00,%eax 80102ed1: 00 00 00 80102ed4: 81 c3 b0 00 00 00 add $0xb0,%ebx 80102eda: 05 80 27 11 80 add $0x80112780,%eax 80102edf: 39 c3 cmp %eax,%ebx 80102ee1: 72 9d jb 80102e80 <main+0xa0> kinit2(P2V(4*1024*1024), P2V(PHYSTOP)); // must come after startothers() 80102ee3: c7 44 24 04 00 00 00 movl $0x8e000000,0x4(%esp) 80102eea: 8e 80102eeb: c7 04 24 00 00 40 80 movl $0x80400000,(%esp) 80102ef2: e8 49 f5 ff ff call 80102440 <kinit2> userinit(); // first user process 80102ef7: e8 c4 07 00 00 call 801036c0 <userinit> mpmain(); // finish this processor's setup 80102efc: e8 6f fe ff ff call 80102d70 <mpmain> 80102f01: 66 90 xchg %ax,%ax 80102f03: 66 90 xchg %ax,%ax 80102f05: 66 90 xchg %ax,%ax 80102f07: 66 90 xchg %ax,%ax 80102f09: 66 90 xchg %ax,%ax 80102f0b: 66 90 xchg %ax,%ax 80102f0d: 66 90 xchg %ax,%ax 80102f0f: 90 nop 80102f10 <mpsearch1>: } // Look for an MP structure in the len bytes at addr. static struct mp* mpsearch1(uint a, int len) { 80102f10: 55 push %ebp 80102f11: 89 e5 mov %esp,%ebp 80102f13: 56 push %esi uchar *e, *p, *addr; addr = P2V(a); 80102f14: 8d b0 00 00 00 80 lea -0x80000000(%eax),%esi { 80102f1a: 53 push %ebx e = addr+len; 80102f1b: 8d 1c 16 lea (%esi,%edx,1),%ebx { 80102f1e: 83 ec 10 sub $0x10,%esp for(p = addr; p < e; p += sizeof(struct mp)) 80102f21: 39 de cmp %ebx,%esi 80102f23: 73 3c jae 80102f61 <mpsearch1+0x51> 80102f25: 8d 76 00 lea 0x0(%esi),%esi if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0) 80102f28: c7 44 24 08 04 00 00 movl $0x4,0x8(%esp) 80102f2f: 00 80102f30: c7 44 24 04 18 73 10 movl $0x80107318,0x4(%esp) 80102f37: 80 80102f38: 89 34 24 mov %esi,(%esp) 80102f3b: e8 c0 13 00 00 call 80104300 <memcmp> 80102f40: 85 c0 test %eax,%eax 80102f42: 75 16 jne 80102f5a <mpsearch1+0x4a> 80102f44: 31 c9 xor %ecx,%ecx 80102f46: 31 d2 xor %edx,%edx sum += addr[i]; 80102f48: 0f b6 04 16 movzbl (%esi,%edx,1),%eax for(i=0; i<len; i++) 80102f4c: 83 c2 01 add $0x1,%edx sum += addr[i]; 80102f4f: 01 c1 add %eax,%ecx for(i=0; i<len; i++) 80102f51: 83 fa 10 cmp $0x10,%edx 80102f54: 75 f2 jne 80102f48 <mpsearch1+0x38> if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0) 80102f56: 84 c9 test %cl,%cl 80102f58: 74 10 je 80102f6a <mpsearch1+0x5a> for(p = addr; p < e; p += sizeof(struct mp)) 80102f5a: 83 c6 10 add $0x10,%esi 80102f5d: 39 f3 cmp %esi,%ebx 80102f5f: 77 c7 ja 80102f28 <mpsearch1+0x18> return (struct mp*)p; return 0; } 80102f61: 83 c4 10 add $0x10,%esp return 0; 80102f64: 31 c0 xor %eax,%eax } 80102f66: 5b pop %ebx 80102f67: 5e pop %esi 80102f68: 5d pop %ebp 80102f69: c3 ret 80102f6a: 83 c4 10 add $0x10,%esp 80102f6d: 89 f0 mov %esi,%eax 80102f6f: 5b pop %ebx 80102f70: 5e pop %esi 80102f71: 5d pop %ebp 80102f72: c3 ret 80102f73: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80102f79: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102f80 <mpinit>: return conf; } void mpinit(void) { 80102f80: 55 push %ebp 80102f81: 89 e5 mov %esp,%ebp 80102f83: 57 push %edi 80102f84: 56 push %esi 80102f85: 53 push %ebx 80102f86: 83 ec 1c sub $0x1c,%esp if((p = ((bda[0x0F]<<8)| bda[0x0E]) << 4)){ 80102f89: 0f b6 05 0f 04 00 80 movzbl 0x8000040f,%eax 80102f90: 0f b6 15 0e 04 00 80 movzbl 0x8000040e,%edx 80102f97: c1 e0 08 shl $0x8,%eax 80102f9a: 09 d0 or %edx,%eax 80102f9c: c1 e0 04 shl $0x4,%eax 80102f9f: 85 c0 test %eax,%eax 80102fa1: 75 1b jne 80102fbe <mpinit+0x3e> p = ((bda[0x14]<<8)|bda[0x13])*1024; 80102fa3: 0f b6 05 14 04 00 80 movzbl 0x80000414,%eax 80102faa: 0f b6 15 13 04 00 80 movzbl 0x80000413,%edx 80102fb1: c1 e0 08 shl $0x8,%eax 80102fb4: 09 d0 or %edx,%eax 80102fb6: c1 e0 0a shl $0xa,%eax if((mp = mpsearch1(p-1024, 1024))) 80102fb9: 2d 00 04 00 00 sub $0x400,%eax if((mp = mpsearch1(p, 1024))) 80102fbe: ba 00 04 00 00 mov $0x400,%edx 80102fc3: e8 48 ff ff ff call 80102f10 <mpsearch1> 80102fc8: 85 c0 test %eax,%eax 80102fca: 89 c7 mov %eax,%edi 80102fcc: 0f 84 22 01 00 00 je 801030f4 <mpinit+0x174> if((mp = mpsearch()) == 0 || mp->physaddr == 0) 80102fd2: 8b 77 04 mov 0x4(%edi),%esi 80102fd5: 85 f6 test %esi,%esi 80102fd7: 0f 84 30 01 00 00 je 8010310d <mpinit+0x18d> conf = (struct mpconf*) P2V((uint) mp->physaddr); 80102fdd: 8d 86 00 00 00 80 lea -0x80000000(%esi),%eax if(memcmp(conf, "PCMP", 4) != 0) 80102fe3: c7 44 24 08 04 00 00 movl $0x4,0x8(%esp) 80102fea: 00 80102feb: c7 44 24 04 1d 73 10 movl $0x8010731d,0x4(%esp) 80102ff2: 80 80102ff3: 89 04 24 mov %eax,(%esp) conf = (struct mpconf*) P2V((uint) mp->physaddr); 80102ff6: 89 45 e4 mov %eax,-0x1c(%ebp) if(memcmp(conf, "PCMP", 4) != 0) 80102ff9: e8 02 13 00 00 call 80104300 <memcmp> 80102ffe: 85 c0 test %eax,%eax 80103000: 0f 85 07 01 00 00 jne 8010310d <mpinit+0x18d> if(conf->version != 1 && conf->version != 4) 80103006: 0f b6 86 06 00 00 80 movzbl -0x7ffffffa(%esi),%eax 8010300d: 3c 04 cmp $0x4,%al 8010300f: 0f 85 0b 01 00 00 jne 80103120 <mpinit+0x1a0> if(sum((uchar*)conf, conf->length) != 0) 80103015: 0f b7 86 04 00 00 80 movzwl -0x7ffffffc(%esi),%eax for(i=0; i<len; i++) 8010301c: 85 c0 test %eax,%eax 8010301e: 74 21 je 80103041 <mpinit+0xc1> sum = 0; 80103020: 31 c9 xor %ecx,%ecx for(i=0; i<len; i++) 80103022: 31 d2 xor %edx,%edx 80103024: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi sum += addr[i]; 80103028: 0f b6 9c 16 00 00 00 movzbl -0x80000000(%esi,%edx,1),%ebx 8010302f: 80 for(i=0; i<len; i++) 80103030: 83 c2 01 add $0x1,%edx sum += addr[i]; 80103033: 01 d9 add %ebx,%ecx for(i=0; i<len; i++) 80103035: 39 d0 cmp %edx,%eax 80103037: 7f ef jg 80103028 <mpinit+0xa8> if(sum((uchar*)conf, conf->length) != 0) 80103039: 84 c9 test %cl,%cl 8010303b: 0f 85 cc 00 00 00 jne 8010310d <mpinit+0x18d> struct mp *mp; struct mpconf *conf; struct mpproc *proc; struct mpioapic *ioapic; if((conf = mpconfig(&mp)) == 0) 80103041: 8b 45 e4 mov -0x1c(%ebp),%eax 80103044: 85 c0 test %eax,%eax 80103046: 0f 84 c1 00 00 00 je 8010310d <mpinit+0x18d> panic("Expect to run on an SMP"); ismp = 1; lapic = (uint*)conf->lapicaddr; 8010304c: 8b 86 24 00 00 80 mov -0x7fffffdc(%esi),%eax ismp = 1; 80103052: bb 01 00 00 00 mov $0x1,%ebx lapic = (uint*)conf->lapicaddr; 80103057: a3 7c 26 11 80 mov %eax,0x8011267c for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){ 8010305c: 0f b7 96 04 00 00 80 movzwl -0x7ffffffc(%esi),%edx 80103063: 8d 86 2c 00 00 80 lea -0x7fffffd4(%esi),%eax 80103069: 03 55 e4 add -0x1c(%ebp),%edx 8010306c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103070: 39 c2 cmp %eax,%edx 80103072: 76 1b jbe 8010308f <mpinit+0x10f> 80103074: 0f b6 08 movzbl (%eax),%ecx switch(*p){ 80103077: 80 f9 04 cmp $0x4,%cl 8010307a: 77 74 ja 801030f0 <mpinit+0x170> 8010307c: ff 24 8d 5c 73 10 80 jmp *-0x7fef8ca4(,%ecx,4) 80103083: 90 nop 80103084: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi p += sizeof(struct mpioapic); continue; case MPBUS: case MPIOINTR: case MPLINTR: p += 8; 80103088: 83 c0 08 add $0x8,%eax for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){ 8010308b: 39 c2 cmp %eax,%edx 8010308d: 77 e5 ja 80103074 <mpinit+0xf4> default: ismp = 0; break; } } if(!ismp) 8010308f: 85 db test %ebx,%ebx 80103091: 0f 84 93 00 00 00 je 8010312a <mpinit+0x1aa> panic("Didn't find a suitable machine"); if(mp->imcrp){ 80103097: 80 7f 0c 00 cmpb $0x0,0xc(%edi) 8010309b: 74 12 je 801030af <mpinit+0x12f> asm volatile("out %0,%1" : : "a" (data), "d" (port)); 8010309d: ba 22 00 00 00 mov $0x22,%edx 801030a2: b8 70 00 00 00 mov $0x70,%eax 801030a7: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801030a8: b2 23 mov $0x23,%dl 801030aa: 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. 801030ab: 83 c8 01 or $0x1,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801030ae: ee out %al,(%dx) } } 801030af: 83 c4 1c add $0x1c,%esp 801030b2: 5b pop %ebx 801030b3: 5e pop %esi 801030b4: 5f pop %edi 801030b5: 5d pop %ebp 801030b6: c3 ret 801030b7: 90 nop if(ncpu < NCPU) { 801030b8: 8b 35 00 2d 11 80 mov 0x80112d00,%esi 801030be: 83 fe 07 cmp $0x7,%esi 801030c1: 7f 17 jg 801030da <mpinit+0x15a> cpus[ncpu].apicid = proc->apicid; // apicid may differ from ncpu 801030c3: 0f b6 48 01 movzbl 0x1(%eax),%ecx 801030c7: 69 f6 b0 00 00 00 imul $0xb0,%esi,%esi ncpu++; 801030cd: 83 05 00 2d 11 80 01 addl $0x1,0x80112d00 cpus[ncpu].apicid = proc->apicid; // apicid may differ from ncpu 801030d4: 88 8e 80 27 11 80 mov %cl,-0x7feed880(%esi) p += sizeof(struct mpproc); 801030da: 83 c0 14 add $0x14,%eax continue; 801030dd: eb 91 jmp 80103070 <mpinit+0xf0> 801030df: 90 nop ioapicid = ioapic->apicno; 801030e0: 0f b6 48 01 movzbl 0x1(%eax),%ecx p += sizeof(struct mpioapic); 801030e4: 83 c0 08 add $0x8,%eax ioapicid = ioapic->apicno; 801030e7: 88 0d 60 27 11 80 mov %cl,0x80112760 continue; 801030ed: eb 81 jmp 80103070 <mpinit+0xf0> 801030ef: 90 nop ismp = 0; 801030f0: 31 db xor %ebx,%ebx 801030f2: eb 83 jmp 80103077 <mpinit+0xf7> return mpsearch1(0xF0000, 0x10000); 801030f4: ba 00 00 01 00 mov $0x10000,%edx 801030f9: b8 00 00 0f 00 mov $0xf0000,%eax 801030fe: e8 0d fe ff ff call 80102f10 <mpsearch1> if((mp = mpsearch()) == 0 || mp->physaddr == 0) 80103103: 85 c0 test %eax,%eax return mpsearch1(0xF0000, 0x10000); 80103105: 89 c7 mov %eax,%edi if((mp = mpsearch()) == 0 || mp->physaddr == 0) 80103107: 0f 85 c5 fe ff ff jne 80102fd2 <mpinit+0x52> panic("Expect to run on an SMP"); 8010310d: c7 04 24 22 73 10 80 movl $0x80107322,(%esp) 80103114: e8 47 d2 ff ff call 80100360 <panic> 80103119: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(conf->version != 1 && conf->version != 4) 80103120: 3c 01 cmp $0x1,%al 80103122: 0f 84 ed fe ff ff je 80103015 <mpinit+0x95> 80103128: eb e3 jmp 8010310d <mpinit+0x18d> panic("Didn't find a suitable machine"); 8010312a: c7 04 24 3c 73 10 80 movl $0x8010733c,(%esp) 80103131: e8 2a d2 ff ff call 80100360 <panic> 80103136: 66 90 xchg %ax,%ax 80103138: 66 90 xchg %ax,%ax 8010313a: 66 90 xchg %ax,%ax 8010313c: 66 90 xchg %ax,%ax 8010313e: 66 90 xchg %ax,%ax 80103140 <picinit>: #define IO_PIC2 0xA0 // Slave (IRQs 8-15) // Don't use the 8259A interrupt controllers. Xv6 assumes SMP hardware. void picinit(void) { 80103140: 55 push %ebp 80103141: ba 21 00 00 00 mov $0x21,%edx 80103146: 89 e5 mov %esp,%ebp 80103148: b8 ff ff ff ff mov $0xffffffff,%eax 8010314d: ee out %al,(%dx) 8010314e: b2 a1 mov $0xa1,%dl 80103150: ee out %al,(%dx) // mask all interrupts outb(IO_PIC1+1, 0xFF); outb(IO_PIC2+1, 0xFF); } 80103151: 5d pop %ebp 80103152: c3 ret 80103153: 66 90 xchg %ax,%ax 80103155: 66 90 xchg %ax,%ax 80103157: 66 90 xchg %ax,%ax 80103159: 66 90 xchg %ax,%ax 8010315b: 66 90 xchg %ax,%ax 8010315d: 66 90 xchg %ax,%ax 8010315f: 90 nop 80103160 <pipealloc>: int writeopen; // write fd is still open }; int pipealloc(struct file **f0, struct file **f1) { 80103160: 55 push %ebp 80103161: 89 e5 mov %esp,%ebp 80103163: 57 push %edi 80103164: 56 push %esi 80103165: 53 push %ebx 80103166: 83 ec 1c sub $0x1c,%esp 80103169: 8b 75 08 mov 0x8(%ebp),%esi 8010316c: 8b 5d 0c mov 0xc(%ebp),%ebx struct pipe *p; p = 0; *f0 = *f1 = 0; 8010316f: c7 03 00 00 00 00 movl $0x0,(%ebx) 80103175: c7 06 00 00 00 00 movl $0x0,(%esi) if((*f0 = filealloc()) == 0 || (*f1 = filealloc()) == 0) 8010317b: e8 d0 db ff ff call 80100d50 <filealloc> 80103180: 85 c0 test %eax,%eax 80103182: 89 06 mov %eax,(%esi) 80103184: 0f 84 a4 00 00 00 je 8010322e <pipealloc+0xce> 8010318a: e8 c1 db ff ff call 80100d50 <filealloc> 8010318f: 85 c0 test %eax,%eax 80103191: 89 03 mov %eax,(%ebx) 80103193: 0f 84 87 00 00 00 je 80103220 <pipealloc+0xc0> goto bad; if((p = (struct pipe*)kalloc()) == 0) 80103199: e8 f2 f2 ff ff call 80102490 <kalloc> 8010319e: 85 c0 test %eax,%eax 801031a0: 89 c7 mov %eax,%edi 801031a2: 74 7c je 80103220 <pipealloc+0xc0> goto bad; p->readopen = 1; 801031a4: c7 80 3c 02 00 00 01 movl $0x1,0x23c(%eax) 801031ab: 00 00 00 p->writeopen = 1; 801031ae: c7 80 40 02 00 00 01 movl $0x1,0x240(%eax) 801031b5: 00 00 00 p->nwrite = 0; 801031b8: c7 80 38 02 00 00 00 movl $0x0,0x238(%eax) 801031bf: 00 00 00 p->nread = 0; 801031c2: c7 80 34 02 00 00 00 movl $0x0,0x234(%eax) 801031c9: 00 00 00 initlock(&p->lock, "pipe"); 801031cc: 89 04 24 mov %eax,(%esp) 801031cf: c7 44 24 04 70 73 10 movl $0x80107370,0x4(%esp) 801031d6: 80 801031d7: e8 a4 0e 00 00 call 80104080 <initlock> (*f0)->type = FD_PIPE; 801031dc: 8b 06 mov (%esi),%eax 801031de: c7 00 01 00 00 00 movl $0x1,(%eax) (*f0)->readable = 1; 801031e4: 8b 06 mov (%esi),%eax 801031e6: c6 40 08 01 movb $0x1,0x8(%eax) (*f0)->writable = 0; 801031ea: 8b 06 mov (%esi),%eax 801031ec: c6 40 09 00 movb $0x0,0x9(%eax) (*f0)->pipe = p; 801031f0: 8b 06 mov (%esi),%eax 801031f2: 89 78 0c mov %edi,0xc(%eax) (*f1)->type = FD_PIPE; 801031f5: 8b 03 mov (%ebx),%eax 801031f7: c7 00 01 00 00 00 movl $0x1,(%eax) (*f1)->readable = 0; 801031fd: 8b 03 mov (%ebx),%eax 801031ff: c6 40 08 00 movb $0x0,0x8(%eax) (*f1)->writable = 1; 80103203: 8b 03 mov (%ebx),%eax 80103205: c6 40 09 01 movb $0x1,0x9(%eax) (*f1)->pipe = p; 80103209: 8b 03 mov (%ebx),%eax return 0; 8010320b: 31 db xor %ebx,%ebx (*f1)->pipe = p; 8010320d: 89 78 0c mov %edi,0xc(%eax) if(*f0) fileclose(*f0); if(*f1) fileclose(*f1); return -1; } 80103210: 83 c4 1c add $0x1c,%esp 80103213: 89 d8 mov %ebx,%eax 80103215: 5b pop %ebx 80103216: 5e pop %esi 80103217: 5f pop %edi 80103218: 5d pop %ebp 80103219: c3 ret 8010321a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(*f0) 80103220: 8b 06 mov (%esi),%eax 80103222: 85 c0 test %eax,%eax 80103224: 74 08 je 8010322e <pipealloc+0xce> fileclose(*f0); 80103226: 89 04 24 mov %eax,(%esp) 80103229: e8 e2 db ff ff call 80100e10 <fileclose> if(*f1) 8010322e: 8b 03 mov (%ebx),%eax return -1; 80103230: bb ff ff ff ff mov $0xffffffff,%ebx if(*f1) 80103235: 85 c0 test %eax,%eax 80103237: 74 d7 je 80103210 <pipealloc+0xb0> fileclose(*f1); 80103239: 89 04 24 mov %eax,(%esp) 8010323c: e8 cf db ff ff call 80100e10 <fileclose> } 80103241: 83 c4 1c add $0x1c,%esp 80103244: 89 d8 mov %ebx,%eax 80103246: 5b pop %ebx 80103247: 5e pop %esi 80103248: 5f pop %edi 80103249: 5d pop %ebp 8010324a: c3 ret 8010324b: 90 nop 8010324c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103250 <pipeclose>: void pipeclose(struct pipe *p, int writable) { 80103250: 55 push %ebp 80103251: 89 e5 mov %esp,%ebp 80103253: 56 push %esi 80103254: 53 push %ebx 80103255: 83 ec 10 sub $0x10,%esp 80103258: 8b 5d 08 mov 0x8(%ebp),%ebx 8010325b: 8b 75 0c mov 0xc(%ebp),%esi acquire(&p->lock); 8010325e: 89 1c 24 mov %ebx,(%esp) 80103261: e8 0a 0f 00 00 call 80104170 <acquire> if(writable){ 80103266: 85 f6 test %esi,%esi 80103268: 74 3e je 801032a8 <pipeclose+0x58> p->writeopen = 0; wakeup(&p->nread); 8010326a: 8d 83 34 02 00 00 lea 0x234(%ebx),%eax p->writeopen = 0; 80103270: c7 83 40 02 00 00 00 movl $0x0,0x240(%ebx) 80103277: 00 00 00 wakeup(&p->nread); 8010327a: 89 04 24 mov %eax,(%esp) 8010327d: e8 2e 0b 00 00 call 80103db0 <wakeup> } else { p->readopen = 0; wakeup(&p->nwrite); } if(p->readopen == 0 && p->writeopen == 0){ 80103282: 8b 93 3c 02 00 00 mov 0x23c(%ebx),%edx 80103288: 85 d2 test %edx,%edx 8010328a: 75 0a jne 80103296 <pipeclose+0x46> 8010328c: 8b 83 40 02 00 00 mov 0x240(%ebx),%eax 80103292: 85 c0 test %eax,%eax 80103294: 74 32 je 801032c8 <pipeclose+0x78> release(&p->lock); kfree((char*)p); } else release(&p->lock); 80103296: 89 5d 08 mov %ebx,0x8(%ebp) } 80103299: 83 c4 10 add $0x10,%esp 8010329c: 5b pop %ebx 8010329d: 5e pop %esi 8010329e: 5d pop %ebp release(&p->lock); 8010329f: e9 bc 0f 00 00 jmp 80104260 <release> 801032a4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi wakeup(&p->nwrite); 801032a8: 8d 83 38 02 00 00 lea 0x238(%ebx),%eax p->readopen = 0; 801032ae: c7 83 3c 02 00 00 00 movl $0x0,0x23c(%ebx) 801032b5: 00 00 00 wakeup(&p->nwrite); 801032b8: 89 04 24 mov %eax,(%esp) 801032bb: e8 f0 0a 00 00 call 80103db0 <wakeup> 801032c0: eb c0 jmp 80103282 <pipeclose+0x32> 801032c2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi release(&p->lock); 801032c8: 89 1c 24 mov %ebx,(%esp) 801032cb: e8 90 0f 00 00 call 80104260 <release> kfree((char*)p); 801032d0: 89 5d 08 mov %ebx,0x8(%ebp) } 801032d3: 83 c4 10 add $0x10,%esp 801032d6: 5b pop %ebx 801032d7: 5e pop %esi 801032d8: 5d pop %ebp kfree((char*)p); 801032d9: e9 02 f0 ff ff jmp 801022e0 <kfree> 801032de: 66 90 xchg %ax,%ax 801032e0 <pipewrite>: //PAGEBREAK: 40 int pipewrite(struct pipe *p, char *addr, int n) { 801032e0: 55 push %ebp 801032e1: 89 e5 mov %esp,%ebp 801032e3: 57 push %edi 801032e4: 56 push %esi 801032e5: 53 push %ebx 801032e6: 83 ec 1c sub $0x1c,%esp 801032e9: 8b 5d 08 mov 0x8(%ebp),%ebx int i; acquire(&p->lock); 801032ec: 89 1c 24 mov %ebx,(%esp) 801032ef: e8 7c 0e 00 00 call 80104170 <acquire> for(i = 0; i < n; i++){ 801032f4: 8b 4d 10 mov 0x10(%ebp),%ecx 801032f7: 85 c9 test %ecx,%ecx 801032f9: 0f 8e b2 00 00 00 jle 801033b1 <pipewrite+0xd1> 801032ff: 8b 4d 0c mov 0xc(%ebp),%ecx while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full if(p->readopen == 0 || myproc()->killed){ release(&p->lock); return -1; } wakeup(&p->nread); 80103302: 8d bb 34 02 00 00 lea 0x234(%ebx),%edi 80103308: 8b 83 38 02 00 00 mov 0x238(%ebx),%eax sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep 8010330e: 8d b3 38 02 00 00 lea 0x238(%ebx),%esi 80103314: 89 4d e4 mov %ecx,-0x1c(%ebp) 80103317: 03 4d 10 add 0x10(%ebp),%ecx 8010331a: 89 4d e0 mov %ecx,-0x20(%ebp) while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full 8010331d: 8b 8b 34 02 00 00 mov 0x234(%ebx),%ecx 80103323: 81 c1 00 02 00 00 add $0x200,%ecx 80103329: 39 c8 cmp %ecx,%eax 8010332b: 74 38 je 80103365 <pipewrite+0x85> 8010332d: eb 55 jmp 80103384 <pipewrite+0xa4> 8010332f: 90 nop if(p->readopen == 0 || myproc()->killed){ 80103330: e8 5b 03 00 00 call 80103690 <myproc> 80103335: 8b 40 2c mov 0x2c(%eax),%eax 80103338: 85 c0 test %eax,%eax 8010333a: 75 33 jne 8010336f <pipewrite+0x8f> wakeup(&p->nread); 8010333c: 89 3c 24 mov %edi,(%esp) 8010333f: e8 6c 0a 00 00 call 80103db0 <wakeup> sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep 80103344: 89 5c 24 04 mov %ebx,0x4(%esp) 80103348: 89 34 24 mov %esi,(%esp) 8010334b: e8 c0 08 00 00 call 80103c10 <sleep> while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full 80103350: 8b 83 34 02 00 00 mov 0x234(%ebx),%eax 80103356: 8b 93 38 02 00 00 mov 0x238(%ebx),%edx 8010335c: 05 00 02 00 00 add $0x200,%eax 80103361: 39 c2 cmp %eax,%edx 80103363: 75 23 jne 80103388 <pipewrite+0xa8> if(p->readopen == 0 || myproc()->killed){ 80103365: 8b 93 3c 02 00 00 mov 0x23c(%ebx),%edx 8010336b: 85 d2 test %edx,%edx 8010336d: 75 c1 jne 80103330 <pipewrite+0x50> release(&p->lock); 8010336f: 89 1c 24 mov %ebx,(%esp) 80103372: e8 e9 0e 00 00 call 80104260 <release> return -1; 80103377: 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; } 8010337c: 83 c4 1c add $0x1c,%esp 8010337f: 5b pop %ebx 80103380: 5e pop %esi 80103381: 5f pop %edi 80103382: 5d pop %ebp 80103383: c3 ret while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full 80103384: 89 c2 mov %eax,%edx 80103386: 66 90 xchg %ax,%ax p->data[p->nwrite++ % PIPESIZE] = addr[i]; 80103388: 8b 4d e4 mov -0x1c(%ebp),%ecx 8010338b: 8d 42 01 lea 0x1(%edx),%eax 8010338e: 81 e2 ff 01 00 00 and $0x1ff,%edx 80103394: 89 83 38 02 00 00 mov %eax,0x238(%ebx) 8010339a: 83 45 e4 01 addl $0x1,-0x1c(%ebp) 8010339e: 0f b6 09 movzbl (%ecx),%ecx 801033a1: 88 4c 13 34 mov %cl,0x34(%ebx,%edx,1) for(i = 0; i < n; i++){ 801033a5: 8b 4d e4 mov -0x1c(%ebp),%ecx 801033a8: 3b 4d e0 cmp -0x20(%ebp),%ecx 801033ab: 0f 85 6c ff ff ff jne 8010331d <pipewrite+0x3d> wakeup(&p->nread); //DOC: pipewrite-wakeup1 801033b1: 8d 83 34 02 00 00 lea 0x234(%ebx),%eax 801033b7: 89 04 24 mov %eax,(%esp) 801033ba: e8 f1 09 00 00 call 80103db0 <wakeup> release(&p->lock); 801033bf: 89 1c 24 mov %ebx,(%esp) 801033c2: e8 99 0e 00 00 call 80104260 <release> return n; 801033c7: 8b 45 10 mov 0x10(%ebp),%eax 801033ca: eb b0 jmp 8010337c <pipewrite+0x9c> 801033cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801033d0 <piperead>: int piperead(struct pipe *p, char *addr, int n) { 801033d0: 55 push %ebp 801033d1: 89 e5 mov %esp,%ebp 801033d3: 57 push %edi 801033d4: 56 push %esi 801033d5: 53 push %ebx 801033d6: 83 ec 1c sub $0x1c,%esp 801033d9: 8b 75 08 mov 0x8(%ebp),%esi 801033dc: 8b 7d 0c mov 0xc(%ebp),%edi int i; acquire(&p->lock); 801033df: 89 34 24 mov %esi,(%esp) 801033e2: e8 89 0d 00 00 call 80104170 <acquire> while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty 801033e7: 8b 86 34 02 00 00 mov 0x234(%esi),%eax 801033ed: 3b 86 38 02 00 00 cmp 0x238(%esi),%eax 801033f3: 75 5b jne 80103450 <piperead+0x80> 801033f5: 8b 9e 40 02 00 00 mov 0x240(%esi),%ebx 801033fb: 85 db test %ebx,%ebx 801033fd: 74 51 je 80103450 <piperead+0x80> if(myproc()->killed){ release(&p->lock); return -1; } sleep(&p->nread, &p->lock); //DOC: piperead-sleep 801033ff: 8d 9e 34 02 00 00 lea 0x234(%esi),%ebx 80103405: eb 25 jmp 8010342c <piperead+0x5c> 80103407: 90 nop 80103408: 89 74 24 04 mov %esi,0x4(%esp) 8010340c: 89 1c 24 mov %ebx,(%esp) 8010340f: e8 fc 07 00 00 call 80103c10 <sleep> while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty 80103414: 8b 86 34 02 00 00 mov 0x234(%esi),%eax 8010341a: 3b 86 38 02 00 00 cmp 0x238(%esi),%eax 80103420: 75 2e jne 80103450 <piperead+0x80> 80103422: 8b 96 40 02 00 00 mov 0x240(%esi),%edx 80103428: 85 d2 test %edx,%edx 8010342a: 74 24 je 80103450 <piperead+0x80> if(myproc()->killed){ 8010342c: e8 5f 02 00 00 call 80103690 <myproc> 80103431: 8b 48 2c mov 0x2c(%eax),%ecx 80103434: 85 c9 test %ecx,%ecx 80103436: 74 d0 je 80103408 <piperead+0x38> release(&p->lock); 80103438: 89 34 24 mov %esi,(%esp) 8010343b: e8 20 0e 00 00 call 80104260 <release> addr[i] = p->data[p->nread++ % PIPESIZE]; } wakeup(&p->nwrite); //DOC: piperead-wakeup release(&p->lock); return i; } 80103440: 83 c4 1c add $0x1c,%esp return -1; 80103443: b8 ff ff ff ff mov $0xffffffff,%eax } 80103448: 5b pop %ebx 80103449: 5e pop %esi 8010344a: 5f pop %edi 8010344b: 5d pop %ebp 8010344c: c3 ret 8010344d: 8d 76 00 lea 0x0(%esi),%esi for(i = 0; i < n; i++){ //DOC: piperead-copy 80103450: 8b 55 10 mov 0x10(%ebp),%edx if(p->nread == p->nwrite) 80103453: 31 db xor %ebx,%ebx for(i = 0; i < n; i++){ //DOC: piperead-copy 80103455: 85 d2 test %edx,%edx 80103457: 7f 2b jg 80103484 <piperead+0xb4> 80103459: eb 31 jmp 8010348c <piperead+0xbc> 8010345b: 90 nop 8010345c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi addr[i] = p->data[p->nread++ % PIPESIZE]; 80103460: 8d 48 01 lea 0x1(%eax),%ecx 80103463: 25 ff 01 00 00 and $0x1ff,%eax 80103468: 89 8e 34 02 00 00 mov %ecx,0x234(%esi) 8010346e: 0f b6 44 06 34 movzbl 0x34(%esi,%eax,1),%eax 80103473: 88 04 1f mov %al,(%edi,%ebx,1) for(i = 0; i < n; i++){ //DOC: piperead-copy 80103476: 83 c3 01 add $0x1,%ebx 80103479: 3b 5d 10 cmp 0x10(%ebp),%ebx 8010347c: 74 0e je 8010348c <piperead+0xbc> if(p->nread == p->nwrite) 8010347e: 8b 86 34 02 00 00 mov 0x234(%esi),%eax 80103484: 3b 86 38 02 00 00 cmp 0x238(%esi),%eax 8010348a: 75 d4 jne 80103460 <piperead+0x90> wakeup(&p->nwrite); //DOC: piperead-wakeup 8010348c: 8d 86 38 02 00 00 lea 0x238(%esi),%eax 80103492: 89 04 24 mov %eax,(%esp) 80103495: e8 16 09 00 00 call 80103db0 <wakeup> release(&p->lock); 8010349a: 89 34 24 mov %esi,(%esp) 8010349d: e8 be 0d 00 00 call 80104260 <release> } 801034a2: 83 c4 1c add $0x1c,%esp return i; 801034a5: 89 d8 mov %ebx,%eax } 801034a7: 5b pop %ebx 801034a8: 5e pop %esi 801034a9: 5f pop %edi 801034aa: 5d pop %ebp 801034ab: c3 ret 801034ac: 66 90 xchg %ax,%ax 801034ae: 66 90 xchg %ax,%ax 801034b0 <allocproc>: // If found, change state to EMBRYO and initialize // state required to run in the kernel. // Otherwise return 0. static struct proc* allocproc(void) { 801034b0: 55 push %ebp 801034b1: 89 e5 mov %esp,%ebp 801034b3: 53 push %ebx struct proc *p; char *sp; acquire(&ptable.lock); for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 801034b4: bb 54 2d 11 80 mov $0x80112d54,%ebx { 801034b9: 83 ec 14 sub $0x14,%esp acquire(&ptable.lock); 801034bc: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 801034c3: e8 a8 0c 00 00 call 80104170 <acquire> 801034c8: eb 14 jmp 801034de <allocproc+0x2e> 801034ca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 801034d0: 81 c3 84 00 00 00 add $0x84,%ebx 801034d6: 81 fb 54 4e 11 80 cmp $0x80114e54,%ebx 801034dc: 74 7a je 80103558 <allocproc+0xa8> if(p->state == UNUSED) 801034de: 8b 43 14 mov 0x14(%ebx),%eax 801034e1: 85 c0 test %eax,%eax 801034e3: 75 eb jne 801034d0 <allocproc+0x20> release(&ptable.lock); return 0; found: p->state = EMBRYO; p->pid = nextpid++; 801034e5: a1 04 a0 10 80 mov 0x8010a004,%eax release(&ptable.lock); 801034ea: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) p->state = EMBRYO; 801034f1: c7 43 14 01 00 00 00 movl $0x1,0x14(%ebx) p->pid = nextpid++; 801034f8: 8d 50 01 lea 0x1(%eax),%edx 801034fb: 89 15 04 a0 10 80 mov %edx,0x8010a004 80103501: 89 43 18 mov %eax,0x18(%ebx) release(&ptable.lock); 80103504: e8 57 0d 00 00 call 80104260 <release> // Allocate kernel stack. if((p->kstack = kalloc()) == 0){ 80103509: e8 82 ef ff ff call 80102490 <kalloc> 8010350e: 85 c0 test %eax,%eax 80103510: 89 43 10 mov %eax,0x10(%ebx) 80103513: 74 57 je 8010356c <allocproc+0xbc> return 0; } sp = p->kstack + KSTACKSIZE; // Leave room for trap frame. sp -= sizeof *p->tf; 80103515: 8d 90 b4 0f 00 00 lea 0xfb4(%eax),%edx // Set up new context to start executing at forkret, // which returns to trapret. sp -= 4; *(uint*)sp = (uint)trapret; sp -= sizeof *p->context; 8010351b: 05 9c 0f 00 00 add $0xf9c,%eax sp -= sizeof *p->tf; 80103520: 89 53 20 mov %edx,0x20(%ebx) *(uint*)sp = (uint)trapret; 80103523: c7 40 14 85 54 10 80 movl $0x80105485,0x14(%eax) p->context = (struct context*)sp; memset(p->context, 0, sizeof *p->context); 8010352a: c7 44 24 08 14 00 00 movl $0x14,0x8(%esp) 80103531: 00 80103532: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 80103539: 00 8010353a: 89 04 24 mov %eax,(%esp) p->context = (struct context*)sp; 8010353d: 89 43 24 mov %eax,0x24(%ebx) memset(p->context, 0, sizeof *p->context); 80103540: e8 6b 0d 00 00 call 801042b0 <memset> p->context->eip = (uint)forkret; 80103545: 8b 43 24 mov 0x24(%ebx),%eax 80103548: c7 40 10 80 35 10 80 movl $0x80103580,0x10(%eax) return p; 8010354f: 89 d8 mov %ebx,%eax } 80103551: 83 c4 14 add $0x14,%esp 80103554: 5b pop %ebx 80103555: 5d pop %ebp 80103556: c3 ret 80103557: 90 nop release(&ptable.lock); 80103558: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 8010355f: e8 fc 0c 00 00 call 80104260 <release> } 80103564: 83 c4 14 add $0x14,%esp return 0; 80103567: 31 c0 xor %eax,%eax } 80103569: 5b pop %ebx 8010356a: 5d pop %ebp 8010356b: c3 ret p->state = UNUSED; 8010356c: c7 43 14 00 00 00 00 movl $0x0,0x14(%ebx) return 0; 80103573: eb dc jmp 80103551 <allocproc+0xa1> 80103575: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103579: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103580 <forkret>: // A fork child's very first scheduling by scheduler() // will swtch here. "Return" to user space. void forkret(void) { 80103580: 55 push %ebp 80103581: 89 e5 mov %esp,%ebp 80103583: 83 ec 18 sub $0x18,%esp static int first = 1; // Still holding ptable.lock from scheduler. release(&ptable.lock); 80103586: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 8010358d: e8 ce 0c 00 00 call 80104260 <release> if (first) { 80103592: a1 00 a0 10 80 mov 0x8010a000,%eax 80103597: 85 c0 test %eax,%eax 80103599: 75 05 jne 801035a0 <forkret+0x20> iinit(ROOTDEV); initlog(ROOTDEV); } // Return to "caller", actually trapret (see allocproc). } 8010359b: c9 leave 8010359c: c3 ret 8010359d: 8d 76 00 lea 0x0(%esi),%esi iinit(ROOTDEV); 801035a0: c7 04 24 01 00 00 00 movl $0x1,(%esp) first = 0; 801035a7: c7 05 00 a0 10 80 00 movl $0x0,0x8010a000 801035ae: 00 00 00 iinit(ROOTDEV); 801035b1: e8 aa de ff ff call 80101460 <iinit> initlog(ROOTDEV); 801035b6: c7 04 24 01 00 00 00 movl $0x1,(%esp) 801035bd: e8 9e f4 ff ff call 80102a60 <initlog> } 801035c2: c9 leave 801035c3: c3 ret 801035c4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801035ca: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 801035d0 <pinit>: { 801035d0: 55 push %ebp 801035d1: 89 e5 mov %esp,%ebp 801035d3: 83 ec 18 sub $0x18,%esp initlock(&ptable.lock, "ptable"); 801035d6: c7 44 24 04 75 73 10 movl $0x80107375,0x4(%esp) 801035dd: 80 801035de: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 801035e5: e8 96 0a 00 00 call 80104080 <initlock> } 801035ea: c9 leave 801035eb: c3 ret 801035ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801035f0 <mycpu>: { 801035f0: 55 push %ebp 801035f1: 89 e5 mov %esp,%ebp 801035f3: 56 push %esi 801035f4: 53 push %ebx 801035f5: 83 ec 10 sub $0x10,%esp asm volatile("pushfl; popl %0" : "=r" (eflags)); 801035f8: 9c pushf 801035f9: 58 pop %eax if(readeflags()&FL_IF) 801035fa: f6 c4 02 test $0x2,%ah 801035fd: 75 57 jne 80103656 <mycpu+0x66> apicid = lapicid(); 801035ff: e8 4c f1 ff ff call 80102750 <lapicid> for (i = 0; i < ncpu; ++i) { 80103604: 8b 35 00 2d 11 80 mov 0x80112d00,%esi 8010360a: 85 f6 test %esi,%esi 8010360c: 7e 3c jle 8010364a <mycpu+0x5a> if (cpus[i].apicid == apicid) 8010360e: 0f b6 15 80 27 11 80 movzbl 0x80112780,%edx 80103615: 39 c2 cmp %eax,%edx 80103617: 74 2d je 80103646 <mycpu+0x56> 80103619: b9 30 28 11 80 mov $0x80112830,%ecx for (i = 0; i < ncpu; ++i) { 8010361e: 31 d2 xor %edx,%edx 80103620: 83 c2 01 add $0x1,%edx 80103623: 39 f2 cmp %esi,%edx 80103625: 74 23 je 8010364a <mycpu+0x5a> if (cpus[i].apicid == apicid) 80103627: 0f b6 19 movzbl (%ecx),%ebx 8010362a: 81 c1 b0 00 00 00 add $0xb0,%ecx 80103630: 39 c3 cmp %eax,%ebx 80103632: 75 ec jne 80103620 <mycpu+0x30> return &cpus[i]; 80103634: 69 c2 b0 00 00 00 imul $0xb0,%edx,%eax } 8010363a: 83 c4 10 add $0x10,%esp 8010363d: 5b pop %ebx 8010363e: 5e pop %esi 8010363f: 5d pop %ebp return &cpus[i]; 80103640: 05 80 27 11 80 add $0x80112780,%eax } 80103645: c3 ret for (i = 0; i < ncpu; ++i) { 80103646: 31 d2 xor %edx,%edx 80103648: eb ea jmp 80103634 <mycpu+0x44> panic("unknown apicid\n"); 8010364a: c7 04 24 7c 73 10 80 movl $0x8010737c,(%esp) 80103651: e8 0a cd ff ff call 80100360 <panic> panic("mycpu called with interrupts enabled\n"); 80103656: c7 04 24 58 74 10 80 movl $0x80107458,(%esp) 8010365d: e8 fe cc ff ff call 80100360 <panic> 80103662: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103669: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103670 <cpuid>: cpuid() { 80103670: 55 push %ebp 80103671: 89 e5 mov %esp,%ebp 80103673: 83 ec 08 sub $0x8,%esp return mycpu()-cpus; 80103676: e8 75 ff ff ff call 801035f0 <mycpu> } 8010367b: c9 leave return mycpu()-cpus; 8010367c: 2d 80 27 11 80 sub $0x80112780,%eax 80103681: c1 f8 04 sar $0x4,%eax 80103684: 69 c0 a3 8b 2e ba imul $0xba2e8ba3,%eax,%eax } 8010368a: c3 ret 8010368b: 90 nop 8010368c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103690 <myproc>: myproc(void) { 80103690: 55 push %ebp 80103691: 89 e5 mov %esp,%ebp 80103693: 53 push %ebx 80103694: 83 ec 04 sub $0x4,%esp pushcli(); 80103697: e8 94 0a 00 00 call 80104130 <pushcli> c = mycpu(); 8010369c: e8 4f ff ff ff call 801035f0 <mycpu> p = c->proc; 801036a1: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 801036a7: e8 44 0b 00 00 call 801041f0 <popcli> } 801036ac: 83 c4 04 add $0x4,%esp 801036af: 89 d8 mov %ebx,%eax 801036b1: 5b pop %ebx 801036b2: 5d pop %ebp 801036b3: c3 ret 801036b4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801036ba: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 801036c0 <userinit>: { 801036c0: 55 push %ebp 801036c1: 89 e5 mov %esp,%ebp 801036c3: 53 push %ebx 801036c4: 83 ec 14 sub $0x14,%esp p = allocproc(); 801036c7: e8 e4 fd ff ff call 801034b0 <allocproc> 801036cc: 89 c3 mov %eax,%ebx initproc = p; 801036ce: a3 b8 a5 10 80 mov %eax,0x8010a5b8 if((p->pgdir = setupkvm()) == 0) 801036d3: e8 38 33 00 00 call 80106a10 <setupkvm> 801036d8: 85 c0 test %eax,%eax 801036da: 89 43 0c mov %eax,0xc(%ebx) 801036dd: 0f 84 d4 00 00 00 je 801037b7 <userinit+0xf7> inituvm(p->pgdir, _binary_initcode_start, (int)_binary_initcode_size); 801036e3: 89 04 24 mov %eax,(%esp) 801036e6: c7 44 24 08 2c 00 00 movl $0x2c,0x8(%esp) 801036ed: 00 801036ee: c7 44 24 04 60 a4 10 movl $0x8010a460,0x4(%esp) 801036f5: 80 801036f6: e8 25 30 00 00 call 80106720 <inituvm> p->sz = PGSIZE; 801036fb: c7 03 00 10 00 00 movl $0x1000,(%ebx) memset(p->tf, 0, sizeof(*p->tf)); 80103701: c7 44 24 08 4c 00 00 movl $0x4c,0x8(%esp) 80103708: 00 80103709: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 80103710: 00 80103711: 8b 43 20 mov 0x20(%ebx),%eax 80103714: 89 04 24 mov %eax,(%esp) 80103717: e8 94 0b 00 00 call 801042b0 <memset> p->tf->cs = (SEG_UCODE << 3) | DPL_USER; 8010371c: 8b 43 20 mov 0x20(%ebx),%eax 8010371f: ba 1b 00 00 00 mov $0x1b,%edx p->tf->ds = (SEG_UDATA << 3) | DPL_USER; 80103724: b9 23 00 00 00 mov $0x23,%ecx p->tf->cs = (SEG_UCODE << 3) | DPL_USER; 80103729: 66 89 50 3c mov %dx,0x3c(%eax) p->tf->ds = (SEG_UDATA << 3) | DPL_USER; 8010372d: 8b 43 20 mov 0x20(%ebx),%eax 80103730: 66 89 48 2c mov %cx,0x2c(%eax) p->tf->es = p->tf->ds; 80103734: 8b 43 20 mov 0x20(%ebx),%eax 80103737: 0f b7 50 2c movzwl 0x2c(%eax),%edx 8010373b: 66 89 50 28 mov %dx,0x28(%eax) p->tf->ss = p->tf->ds; 8010373f: 8b 43 20 mov 0x20(%ebx),%eax 80103742: 0f b7 50 2c movzwl 0x2c(%eax),%edx 80103746: 66 89 50 48 mov %dx,0x48(%eax) p->tf->eflags = FL_IF; 8010374a: 8b 43 20 mov 0x20(%ebx),%eax 8010374d: c7 40 40 00 02 00 00 movl $0x200,0x40(%eax) p->tf->esp = PGSIZE; 80103754: 8b 43 20 mov 0x20(%ebx),%eax 80103757: c7 40 44 00 10 00 00 movl $0x1000,0x44(%eax) p->tf->eip = 0; // beginning of initcode.S 8010375e: 8b 43 20 mov 0x20(%ebx),%eax 80103761: c7 40 38 00 00 00 00 movl $0x0,0x38(%eax) safestrcpy(p->name, "initcode", sizeof(p->name)); 80103768: 8d 43 74 lea 0x74(%ebx),%eax 8010376b: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp) 80103772: 00 80103773: c7 44 24 04 a5 73 10 movl $0x801073a5,0x4(%esp) 8010377a: 80 8010377b: 89 04 24 mov %eax,(%esp) 8010377e: e8 0d 0d 00 00 call 80104490 <safestrcpy> p->cwd = namei("/"); 80103783: c7 04 24 ae 73 10 80 movl $0x801073ae,(%esp) 8010378a: e8 61 e7 ff ff call 80101ef0 <namei> 8010378f: 89 43 70 mov %eax,0x70(%ebx) acquire(&ptable.lock); 80103792: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103799: e8 d2 09 00 00 call 80104170 <acquire> p->state = RUNNABLE; 8010379e: c7 43 14 03 00 00 00 movl $0x3,0x14(%ebx) release(&ptable.lock); 801037a5: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 801037ac: e8 af 0a 00 00 call 80104260 <release> } 801037b1: 83 c4 14 add $0x14,%esp 801037b4: 5b pop %ebx 801037b5: 5d pop %ebp 801037b6: c3 ret panic("userinit: out of memory?"); 801037b7: c7 04 24 8c 73 10 80 movl $0x8010738c,(%esp) 801037be: e8 9d cb ff ff call 80100360 <panic> 801037c3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801037c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801037d0 <growproc>: { 801037d0: 55 push %ebp 801037d1: 89 e5 mov %esp,%ebp 801037d3: 56 push %esi 801037d4: 53 push %ebx 801037d5: 83 ec 10 sub $0x10,%esp 801037d8: 8b 75 08 mov 0x8(%ebp),%esi struct proc *curproc = myproc(); 801037db: e8 b0 fe ff ff call 80103690 <myproc> if(n > 0){ 801037e0: 83 fe 00 cmp $0x0,%esi struct proc *curproc = myproc(); 801037e3: 89 c3 mov %eax,%ebx sz = curproc->sz; 801037e5: 8b 00 mov (%eax),%eax if(n > 0){ 801037e7: 7e 2f jle 80103818 <growproc+0x48> if((sz = allocuvm(curproc->pgdir, sz, sz + n)) == 0) 801037e9: 01 c6 add %eax,%esi 801037eb: 89 74 24 08 mov %esi,0x8(%esp) 801037ef: 89 44 24 04 mov %eax,0x4(%esp) 801037f3: 8b 43 0c mov 0xc(%ebx),%eax 801037f6: 89 04 24 mov %eax,(%esp) 801037f9: e8 72 30 00 00 call 80106870 <allocuvm> 801037fe: 85 c0 test %eax,%eax 80103800: 74 36 je 80103838 <growproc+0x68> curproc->sz = sz; 80103802: 89 03 mov %eax,(%ebx) switchuvm(curproc); 80103804: 89 1c 24 mov %ebx,(%esp) 80103807: e8 04 2e 00 00 call 80106610 <switchuvm> return 0; 8010380c: 31 c0 xor %eax,%eax } 8010380e: 83 c4 10 add $0x10,%esp 80103811: 5b pop %ebx 80103812: 5e pop %esi 80103813: 5d pop %ebp 80103814: c3 ret 80103815: 8d 76 00 lea 0x0(%esi),%esi } else if(n < 0){ 80103818: 74 e8 je 80103802 <growproc+0x32> if((sz = deallocuvm(curproc->pgdir, sz, sz + n)) == 0) 8010381a: 01 c6 add %eax,%esi 8010381c: 89 74 24 08 mov %esi,0x8(%esp) 80103820: 89 44 24 04 mov %eax,0x4(%esp) 80103824: 8b 43 0c mov 0xc(%ebx),%eax 80103827: 89 04 24 mov %eax,(%esp) 8010382a: e8 41 31 00 00 call 80106970 <deallocuvm> 8010382f: 85 c0 test %eax,%eax 80103831: 75 cf jne 80103802 <growproc+0x32> 80103833: 90 nop 80103834: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80103838: b8 ff ff ff ff mov $0xffffffff,%eax 8010383d: eb cf jmp 8010380e <growproc+0x3e> 8010383f: 90 nop 80103840 <fork>: { 80103840: 55 push %ebp 80103841: 89 e5 mov %esp,%ebp 80103843: 57 push %edi 80103844: 56 push %esi 80103845: 53 push %ebx 80103846: 83 ec 2c sub $0x2c,%esp struct proc *curproc = myproc(); 80103849: e8 42 fe ff ff call 80103690 <myproc> 8010384e: 89 c3 mov %eax,%ebx if((np = allocproc()) == 0){ 80103850: e8 5b fc ff ff call 801034b0 <allocproc> 80103855: 85 c0 test %eax,%eax 80103857: 89 c7 mov %eax,%edi 80103859: 89 45 e4 mov %eax,-0x1c(%ebp) 8010385c: 0f 84 cc 00 00 00 je 8010392e <fork+0xee> if((np->pgdir = copyuvm(curproc->pgdir, curproc->sz, curproc->sm, curproc->spgcount)) == 0){ 80103862: 8b 43 08 mov 0x8(%ebx),%eax 80103865: 89 44 24 0c mov %eax,0xc(%esp) 80103869: 8b 43 04 mov 0x4(%ebx),%eax 8010386c: 89 44 24 08 mov %eax,0x8(%esp) 80103870: 8b 03 mov (%ebx),%eax 80103872: 89 44 24 04 mov %eax,0x4(%esp) 80103876: 8b 43 0c mov 0xc(%ebx),%eax 80103879: 89 04 24 mov %eax,(%esp) 8010387c: e8 6f 32 00 00 call 80106af0 <copyuvm> 80103881: 85 c0 test %eax,%eax 80103883: 89 47 0c mov %eax,0xc(%edi) 80103886: 0f 84 a9 00 00 00 je 80103935 <fork+0xf5> np->sz = curproc->sz; 8010388c: 8b 03 mov (%ebx),%eax 8010388e: 8b 4d e4 mov -0x1c(%ebp),%ecx 80103891: 89 01 mov %eax,(%ecx) *np->tf = *curproc->tf; 80103893: 8b 79 20 mov 0x20(%ecx),%edi 80103896: 89 c8 mov %ecx,%eax np->parent = curproc; 80103898: 89 59 1c mov %ebx,0x1c(%ecx) *np->tf = *curproc->tf; 8010389b: 8b 73 20 mov 0x20(%ebx),%esi 8010389e: b9 13 00 00 00 mov $0x13,%ecx 801038a3: f3 a5 rep movsl %ds:(%esi),%es:(%edi) for(i = 0; i < NOFILE; i++) 801038a5: 31 f6 xor %esi,%esi np->tf->eax = 0; 801038a7: 8b 40 20 mov 0x20(%eax),%eax 801038aa: c7 40 1c 00 00 00 00 movl $0x0,0x1c(%eax) 801038b1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(curproc->ofile[i]) 801038b8: 8b 44 b3 30 mov 0x30(%ebx,%esi,4),%eax 801038bc: 85 c0 test %eax,%eax 801038be: 74 0f je 801038cf <fork+0x8f> np->ofile[i] = filedup(curproc->ofile[i]); 801038c0: 89 04 24 mov %eax,(%esp) 801038c3: e8 f8 d4 ff ff call 80100dc0 <filedup> 801038c8: 8b 55 e4 mov -0x1c(%ebp),%edx 801038cb: 89 44 b2 30 mov %eax,0x30(%edx,%esi,4) for(i = 0; i < NOFILE; i++) 801038cf: 83 c6 01 add $0x1,%esi 801038d2: 83 fe 10 cmp $0x10,%esi 801038d5: 75 e1 jne 801038b8 <fork+0x78> np->cwd = idup(curproc->cwd); 801038d7: 8b 43 70 mov 0x70(%ebx),%eax safestrcpy(np->name, curproc->name, sizeof(curproc->name)); 801038da: 83 c3 74 add $0x74,%ebx np->cwd = idup(curproc->cwd); 801038dd: 89 04 24 mov %eax,(%esp) 801038e0: e8 8b dd ff ff call 80101670 <idup> 801038e5: 8b 7d e4 mov -0x1c(%ebp),%edi 801038e8: 89 47 70 mov %eax,0x70(%edi) safestrcpy(np->name, curproc->name, sizeof(curproc->name)); 801038eb: 8d 47 74 lea 0x74(%edi),%eax 801038ee: 89 5c 24 04 mov %ebx,0x4(%esp) 801038f2: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp) 801038f9: 00 801038fa: 89 04 24 mov %eax,(%esp) 801038fd: e8 8e 0b 00 00 call 80104490 <safestrcpy> pid = np->pid; 80103902: 8b 5f 18 mov 0x18(%edi),%ebx acquire(&ptable.lock); 80103905: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 8010390c: e8 5f 08 00 00 call 80104170 <acquire> np->state = RUNNABLE; 80103911: c7 47 14 03 00 00 00 movl $0x3,0x14(%edi) release(&ptable.lock); 80103918: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 8010391f: e8 3c 09 00 00 call 80104260 <release> return pid; 80103924: 89 d8 mov %ebx,%eax } 80103926: 83 c4 2c add $0x2c,%esp 80103929: 5b pop %ebx 8010392a: 5e pop %esi 8010392b: 5f pop %edi 8010392c: 5d pop %ebp 8010392d: c3 ret return -1; 8010392e: b8 ff ff ff ff mov $0xffffffff,%eax 80103933: eb f1 jmp 80103926 <fork+0xe6> kfree(np->kstack); 80103935: 8b 7d e4 mov -0x1c(%ebp),%edi 80103938: 8b 47 10 mov 0x10(%edi),%eax 8010393b: 89 04 24 mov %eax,(%esp) 8010393e: e8 9d e9 ff ff call 801022e0 <kfree> return -1; 80103943: b8 ff ff ff ff mov $0xffffffff,%eax np->kstack = 0; 80103948: c7 47 10 00 00 00 00 movl $0x0,0x10(%edi) np->state = UNUSED; 8010394f: c7 47 14 00 00 00 00 movl $0x0,0x14(%edi) return -1; 80103956: eb ce jmp 80103926 <fork+0xe6> 80103958: 90 nop 80103959: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103960 <scheduler>: { 80103960: 55 push %ebp 80103961: 89 e5 mov %esp,%ebp 80103963: 57 push %edi 80103964: 56 push %esi 80103965: 53 push %ebx 80103966: 83 ec 1c sub $0x1c,%esp struct cpu *c = mycpu(); 80103969: e8 82 fc ff ff call 801035f0 <mycpu> 8010396e: 89 c6 mov %eax,%esi c->proc = 0; 80103970: c7 80 ac 00 00 00 00 movl $0x0,0xac(%eax) 80103977: 00 00 00 8010397a: 8d 78 04 lea 0x4(%eax),%edi 8010397d: 8d 76 00 lea 0x0(%esi),%esi asm volatile("sti"); 80103980: fb sti acquire(&ptable.lock); 80103981: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103988: bb 54 2d 11 80 mov $0x80112d54,%ebx acquire(&ptable.lock); 8010398d: e8 de 07 00 00 call 80104170 <acquire> 80103992: eb 12 jmp 801039a6 <scheduler+0x46> 80103994: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103998: 81 c3 84 00 00 00 add $0x84,%ebx 8010399e: 81 fb 54 4e 11 80 cmp $0x80114e54,%ebx 801039a4: 74 4a je 801039f0 <scheduler+0x90> if(p->state != RUNNABLE) 801039a6: 83 7b 14 03 cmpl $0x3,0x14(%ebx) 801039aa: 75 ec jne 80103998 <scheduler+0x38> c->proc = p; 801039ac: 89 9e ac 00 00 00 mov %ebx,0xac(%esi) switchuvm(p); 801039b2: 89 1c 24 mov %ebx,(%esp) for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 801039b5: 81 c3 84 00 00 00 add $0x84,%ebx switchuvm(p); 801039bb: e8 50 2c 00 00 call 80106610 <switchuvm> swtch(&(c->scheduler), p->context); 801039c0: 8b 43 a0 mov -0x60(%ebx),%eax p->state = RUNNING; 801039c3: c7 43 90 04 00 00 00 movl $0x4,-0x70(%ebx) swtch(&(c->scheduler), p->context); 801039ca: 89 3c 24 mov %edi,(%esp) 801039cd: 89 44 24 04 mov %eax,0x4(%esp) 801039d1: e8 15 0b 00 00 call 801044eb <swtch> switchkvm(); 801039d6: e8 15 2c 00 00 call 801065f0 <switchkvm> for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 801039db: 81 fb 54 4e 11 80 cmp $0x80114e54,%ebx c->proc = 0; 801039e1: c7 86 ac 00 00 00 00 movl $0x0,0xac(%esi) 801039e8: 00 00 00 for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 801039eb: 75 b9 jne 801039a6 <scheduler+0x46> 801039ed: 8d 76 00 lea 0x0(%esi),%esi release(&ptable.lock); 801039f0: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 801039f7: e8 64 08 00 00 call 80104260 <release> } 801039fc: eb 82 jmp 80103980 <scheduler+0x20> 801039fe: 66 90 xchg %ax,%ax 80103a00 <sched>: { 80103a00: 55 push %ebp 80103a01: 89 e5 mov %esp,%ebp 80103a03: 56 push %esi 80103a04: 53 push %ebx 80103a05: 83 ec 10 sub $0x10,%esp struct proc *p = myproc(); 80103a08: e8 83 fc ff ff call 80103690 <myproc> if(!holding(&ptable.lock)) 80103a0d: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) struct proc *p = myproc(); 80103a14: 89 c3 mov %eax,%ebx if(!holding(&ptable.lock)) 80103a16: e8 e5 06 00 00 call 80104100 <holding> 80103a1b: 85 c0 test %eax,%eax 80103a1d: 74 4f je 80103a6e <sched+0x6e> if(mycpu()->ncli != 1) 80103a1f: e8 cc fb ff ff call 801035f0 <mycpu> 80103a24: 83 b8 a4 00 00 00 01 cmpl $0x1,0xa4(%eax) 80103a2b: 75 65 jne 80103a92 <sched+0x92> if(p->state == RUNNING) 80103a2d: 83 7b 14 04 cmpl $0x4,0x14(%ebx) 80103a31: 74 53 je 80103a86 <sched+0x86> asm volatile("pushfl; popl %0" : "=r" (eflags)); 80103a33: 9c pushf 80103a34: 58 pop %eax if(readeflags()&FL_IF) 80103a35: f6 c4 02 test $0x2,%ah 80103a38: 75 40 jne 80103a7a <sched+0x7a> intena = mycpu()->intena; 80103a3a: e8 b1 fb ff ff call 801035f0 <mycpu> swtch(&p->context, mycpu()->scheduler); 80103a3f: 83 c3 24 add $0x24,%ebx intena = mycpu()->intena; 80103a42: 8b b0 a8 00 00 00 mov 0xa8(%eax),%esi swtch(&p->context, mycpu()->scheduler); 80103a48: e8 a3 fb ff ff call 801035f0 <mycpu> 80103a4d: 8b 40 04 mov 0x4(%eax),%eax 80103a50: 89 1c 24 mov %ebx,(%esp) 80103a53: 89 44 24 04 mov %eax,0x4(%esp) 80103a57: e8 8f 0a 00 00 call 801044eb <swtch> mycpu()->intena = intena; 80103a5c: e8 8f fb ff ff call 801035f0 <mycpu> 80103a61: 89 b0 a8 00 00 00 mov %esi,0xa8(%eax) } 80103a67: 83 c4 10 add $0x10,%esp 80103a6a: 5b pop %ebx 80103a6b: 5e pop %esi 80103a6c: 5d pop %ebp 80103a6d: c3 ret panic("sched ptable.lock"); 80103a6e: c7 04 24 b0 73 10 80 movl $0x801073b0,(%esp) 80103a75: e8 e6 c8 ff ff call 80100360 <panic> panic("sched interruptible"); 80103a7a: c7 04 24 dc 73 10 80 movl $0x801073dc,(%esp) 80103a81: e8 da c8 ff ff call 80100360 <panic> panic("sched running"); 80103a86: c7 04 24 ce 73 10 80 movl $0x801073ce,(%esp) 80103a8d: e8 ce c8 ff ff call 80100360 <panic> panic("sched locks"); 80103a92: c7 04 24 c2 73 10 80 movl $0x801073c2,(%esp) 80103a99: e8 c2 c8 ff ff call 80100360 <panic> 80103a9e: 66 90 xchg %ax,%ax 80103aa0 <exit>: { 80103aa0: 55 push %ebp 80103aa1: 89 e5 mov %esp,%ebp 80103aa3: 56 push %esi if(curproc == initproc) 80103aa4: 31 f6 xor %esi,%esi { 80103aa6: 53 push %ebx 80103aa7: 83 ec 10 sub $0x10,%esp struct proc *curproc = myproc(); 80103aaa: e8 e1 fb ff ff call 80103690 <myproc> if(curproc == initproc) 80103aaf: 3b 05 b8 a5 10 80 cmp 0x8010a5b8,%eax struct proc *curproc = myproc(); 80103ab5: 89 c3 mov %eax,%ebx if(curproc == initproc) 80103ab7: 0f 84 fd 00 00 00 je 80103bba <exit+0x11a> 80103abd: 8d 76 00 lea 0x0(%esi),%esi if(curproc->ofile[fd]){ 80103ac0: 8b 44 b3 30 mov 0x30(%ebx,%esi,4),%eax 80103ac4: 85 c0 test %eax,%eax 80103ac6: 74 10 je 80103ad8 <exit+0x38> fileclose(curproc->ofile[fd]); 80103ac8: 89 04 24 mov %eax,(%esp) 80103acb: e8 40 d3 ff ff call 80100e10 <fileclose> curproc->ofile[fd] = 0; 80103ad0: c7 44 b3 30 00 00 00 movl $0x0,0x30(%ebx,%esi,4) 80103ad7: 00 for(fd = 0; fd < NOFILE; fd++){ 80103ad8: 83 c6 01 add $0x1,%esi 80103adb: 83 fe 10 cmp $0x10,%esi 80103ade: 75 e0 jne 80103ac0 <exit+0x20> begin_op(); 80103ae0: e8 1b f0 ff ff call 80102b00 <begin_op> iput(curproc->cwd); 80103ae5: 8b 43 70 mov 0x70(%ebx),%eax 80103ae8: 89 04 24 mov %eax,(%esp) 80103aeb: e8 d0 dc ff ff call 801017c0 <iput> end_op(); 80103af0: e8 7b f0 ff ff call 80102b70 <end_op> curproc->cwd = 0; 80103af5: c7 43 70 00 00 00 00 movl $0x0,0x70(%ebx) acquire(&ptable.lock); 80103afc: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103b03: e8 68 06 00 00 call 80104170 <acquire> wakeup1(curproc->parent); 80103b08: 8b 43 1c mov 0x1c(%ebx),%eax static void wakeup1(void *chan) { struct proc *p; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103b0b: ba 54 2d 11 80 mov $0x80112d54,%edx 80103b10: eb 14 jmp 80103b26 <exit+0x86> 80103b12: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80103b18: 81 c2 84 00 00 00 add $0x84,%edx 80103b1e: 81 fa 54 4e 11 80 cmp $0x80114e54,%edx 80103b24: 74 20 je 80103b46 <exit+0xa6> if(p->state == SLEEPING && p->chan == chan) 80103b26: 83 7a 14 02 cmpl $0x2,0x14(%edx) 80103b2a: 75 ec jne 80103b18 <exit+0x78> 80103b2c: 3b 42 28 cmp 0x28(%edx),%eax 80103b2f: 75 e7 jne 80103b18 <exit+0x78> p->state = RUNNABLE; 80103b31: c7 42 14 03 00 00 00 movl $0x3,0x14(%edx) for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103b38: 81 c2 84 00 00 00 add $0x84,%edx 80103b3e: 81 fa 54 4e 11 80 cmp $0x80114e54,%edx 80103b44: 75 e0 jne 80103b26 <exit+0x86> p->parent = initproc; 80103b46: a1 b8 a5 10 80 mov 0x8010a5b8,%eax 80103b4b: b9 54 2d 11 80 mov $0x80112d54,%ecx 80103b50: eb 14 jmp 80103b66 <exit+0xc6> 80103b52: 8d b6 00 00 00 00 lea 0x0(%esi),%esi for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103b58: 81 c1 84 00 00 00 add $0x84,%ecx 80103b5e: 81 f9 54 4e 11 80 cmp $0x80114e54,%ecx 80103b64: 74 3c je 80103ba2 <exit+0x102> if(p->parent == curproc){ 80103b66: 39 59 1c cmp %ebx,0x1c(%ecx) 80103b69: 75 ed jne 80103b58 <exit+0xb8> if(p->state == ZOMBIE) 80103b6b: 83 79 14 05 cmpl $0x5,0x14(%ecx) p->parent = initproc; 80103b6f: 89 41 1c mov %eax,0x1c(%ecx) if(p->state == ZOMBIE) 80103b72: 75 e4 jne 80103b58 <exit+0xb8> 80103b74: ba 54 2d 11 80 mov $0x80112d54,%edx 80103b79: eb 13 jmp 80103b8e <exit+0xee> 80103b7b: 90 nop 80103b7c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103b80: 81 c2 84 00 00 00 add $0x84,%edx 80103b86: 81 fa 54 4e 11 80 cmp $0x80114e54,%edx 80103b8c: 74 ca je 80103b58 <exit+0xb8> if(p->state == SLEEPING && p->chan == chan) 80103b8e: 83 7a 14 02 cmpl $0x2,0x14(%edx) 80103b92: 75 ec jne 80103b80 <exit+0xe0> 80103b94: 3b 42 28 cmp 0x28(%edx),%eax 80103b97: 75 e7 jne 80103b80 <exit+0xe0> p->state = RUNNABLE; 80103b99: c7 42 14 03 00 00 00 movl $0x3,0x14(%edx) 80103ba0: eb de jmp 80103b80 <exit+0xe0> curproc->state = ZOMBIE; 80103ba2: c7 43 14 05 00 00 00 movl $0x5,0x14(%ebx) sched(); 80103ba9: e8 52 fe ff ff call 80103a00 <sched> panic("zombie exit"); 80103bae: c7 04 24 fd 73 10 80 movl $0x801073fd,(%esp) 80103bb5: e8 a6 c7 ff ff call 80100360 <panic> panic("init exiting"); 80103bba: c7 04 24 f0 73 10 80 movl $0x801073f0,(%esp) 80103bc1: e8 9a c7 ff ff call 80100360 <panic> 80103bc6: 8d 76 00 lea 0x0(%esi),%esi 80103bc9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103bd0 <yield>: { 80103bd0: 55 push %ebp 80103bd1: 89 e5 mov %esp,%ebp 80103bd3: 83 ec 18 sub $0x18,%esp acquire(&ptable.lock); //DOC: yieldlock 80103bd6: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103bdd: e8 8e 05 00 00 call 80104170 <acquire> myproc()->state = RUNNABLE; 80103be2: e8 a9 fa ff ff call 80103690 <myproc> 80103be7: c7 40 14 03 00 00 00 movl $0x3,0x14(%eax) sched(); 80103bee: e8 0d fe ff ff call 80103a00 <sched> release(&ptable.lock); 80103bf3: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103bfa: e8 61 06 00 00 call 80104260 <release> } 80103bff: c9 leave 80103c00: c3 ret 80103c01: eb 0d jmp 80103c10 <sleep> 80103c03: 90 nop 80103c04: 90 nop 80103c05: 90 nop 80103c06: 90 nop 80103c07: 90 nop 80103c08: 90 nop 80103c09: 90 nop 80103c0a: 90 nop 80103c0b: 90 nop 80103c0c: 90 nop 80103c0d: 90 nop 80103c0e: 90 nop 80103c0f: 90 nop 80103c10 <sleep>: { 80103c10: 55 push %ebp 80103c11: 89 e5 mov %esp,%ebp 80103c13: 57 push %edi 80103c14: 56 push %esi 80103c15: 53 push %ebx 80103c16: 83 ec 1c sub $0x1c,%esp 80103c19: 8b 7d 08 mov 0x8(%ebp),%edi 80103c1c: 8b 75 0c mov 0xc(%ebp),%esi struct proc *p = myproc(); 80103c1f: e8 6c fa ff ff call 80103690 <myproc> if(p == 0) 80103c24: 85 c0 test %eax,%eax struct proc *p = myproc(); 80103c26: 89 c3 mov %eax,%ebx if(p == 0) 80103c28: 0f 84 7c 00 00 00 je 80103caa <sleep+0x9a> if(lk == 0) 80103c2e: 85 f6 test %esi,%esi 80103c30: 74 6c je 80103c9e <sleep+0x8e> if(lk != &ptable.lock){ //DOC: sleeplock0 80103c32: 81 fe 20 2d 11 80 cmp $0x80112d20,%esi 80103c38: 74 46 je 80103c80 <sleep+0x70> acquire(&ptable.lock); //DOC: sleeplock1 80103c3a: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103c41: e8 2a 05 00 00 call 80104170 <acquire> release(lk); 80103c46: 89 34 24 mov %esi,(%esp) 80103c49: e8 12 06 00 00 call 80104260 <release> p->chan = chan; 80103c4e: 89 7b 28 mov %edi,0x28(%ebx) p->state = SLEEPING; 80103c51: c7 43 14 02 00 00 00 movl $0x2,0x14(%ebx) sched(); 80103c58: e8 a3 fd ff ff call 80103a00 <sched> p->chan = 0; 80103c5d: c7 43 28 00 00 00 00 movl $0x0,0x28(%ebx) release(&ptable.lock); 80103c64: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103c6b: e8 f0 05 00 00 call 80104260 <release> acquire(lk); 80103c70: 89 75 08 mov %esi,0x8(%ebp) } 80103c73: 83 c4 1c add $0x1c,%esp 80103c76: 5b pop %ebx 80103c77: 5e pop %esi 80103c78: 5f pop %edi 80103c79: 5d pop %ebp acquire(lk); 80103c7a: e9 f1 04 00 00 jmp 80104170 <acquire> 80103c7f: 90 nop p->chan = chan; 80103c80: 89 78 28 mov %edi,0x28(%eax) p->state = SLEEPING; 80103c83: c7 40 14 02 00 00 00 movl $0x2,0x14(%eax) sched(); 80103c8a: e8 71 fd ff ff call 80103a00 <sched> p->chan = 0; 80103c8f: c7 43 28 00 00 00 00 movl $0x0,0x28(%ebx) } 80103c96: 83 c4 1c add $0x1c,%esp 80103c99: 5b pop %ebx 80103c9a: 5e pop %esi 80103c9b: 5f pop %edi 80103c9c: 5d pop %ebp 80103c9d: c3 ret panic("sleep without lk"); 80103c9e: c7 04 24 0f 74 10 80 movl $0x8010740f,(%esp) 80103ca5: e8 b6 c6 ff ff call 80100360 <panic> panic("sleep"); 80103caa: c7 04 24 09 74 10 80 movl $0x80107409,(%esp) 80103cb1: e8 aa c6 ff ff call 80100360 <panic> 80103cb6: 8d 76 00 lea 0x0(%esi),%esi 80103cb9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103cc0 <wait>: { 80103cc0: 55 push %ebp 80103cc1: 89 e5 mov %esp,%ebp 80103cc3: 56 push %esi 80103cc4: 53 push %ebx 80103cc5: 83 ec 10 sub $0x10,%esp struct proc *curproc = myproc(); 80103cc8: e8 c3 f9 ff ff call 80103690 <myproc> acquire(&ptable.lock); 80103ccd: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) struct proc *curproc = myproc(); 80103cd4: 89 c6 mov %eax,%esi acquire(&ptable.lock); 80103cd6: e8 95 04 00 00 call 80104170 <acquire> havekids = 0; 80103cdb: 31 c0 xor %eax,%eax for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103cdd: bb 54 2d 11 80 mov $0x80112d54,%ebx 80103ce2: eb 12 jmp 80103cf6 <wait+0x36> 80103ce4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103ce8: 81 c3 84 00 00 00 add $0x84,%ebx 80103cee: 81 fb 54 4e 11 80 cmp $0x80114e54,%ebx 80103cf4: 74 22 je 80103d18 <wait+0x58> if(p->parent != curproc) 80103cf6: 39 73 1c cmp %esi,0x1c(%ebx) 80103cf9: 75 ed jne 80103ce8 <wait+0x28> if(p->state == ZOMBIE){ 80103cfb: 83 7b 14 05 cmpl $0x5,0x14(%ebx) 80103cff: 74 34 je 80103d35 <wait+0x75> for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103d01: 81 c3 84 00 00 00 add $0x84,%ebx havekids = 1; 80103d07: b8 01 00 00 00 mov $0x1,%eax for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103d0c: 81 fb 54 4e 11 80 cmp $0x80114e54,%ebx 80103d12: 75 e2 jne 80103cf6 <wait+0x36> 80103d14: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(!havekids || curproc->killed){ 80103d18: 85 c0 test %eax,%eax 80103d1a: 74 6e je 80103d8a <wait+0xca> 80103d1c: 8b 46 2c mov 0x2c(%esi),%eax 80103d1f: 85 c0 test %eax,%eax 80103d21: 75 67 jne 80103d8a <wait+0xca> sleep(curproc, &ptable.lock); //DOC: wait-sleep 80103d23: c7 44 24 04 20 2d 11 movl $0x80112d20,0x4(%esp) 80103d2a: 80 80103d2b: 89 34 24 mov %esi,(%esp) 80103d2e: e8 dd fe ff ff call 80103c10 <sleep> } 80103d33: eb a6 jmp 80103cdb <wait+0x1b> kfree(p->kstack); 80103d35: 8b 43 10 mov 0x10(%ebx),%eax pid = p->pid; 80103d38: 8b 73 18 mov 0x18(%ebx),%esi kfree(p->kstack); 80103d3b: 89 04 24 mov %eax,(%esp) 80103d3e: e8 9d e5 ff ff call 801022e0 <kfree> freevm(p->pgdir); 80103d43: 8b 43 0c mov 0xc(%ebx),%eax p->kstack = 0; 80103d46: c7 43 10 00 00 00 00 movl $0x0,0x10(%ebx) freevm(p->pgdir); 80103d4d: 89 04 24 mov %eax,(%esp) 80103d50: e8 3b 2c 00 00 call 80106990 <freevm> release(&ptable.lock); 80103d55: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) p->pid = 0; 80103d5c: c7 43 18 00 00 00 00 movl $0x0,0x18(%ebx) p->parent = 0; 80103d63: c7 43 1c 00 00 00 00 movl $0x0,0x1c(%ebx) p->name[0] = 0; 80103d6a: c6 43 74 00 movb $0x0,0x74(%ebx) p->killed = 0; 80103d6e: c7 43 2c 00 00 00 00 movl $0x0,0x2c(%ebx) p->state = UNUSED; 80103d75: c7 43 14 00 00 00 00 movl $0x0,0x14(%ebx) release(&ptable.lock); 80103d7c: e8 df 04 00 00 call 80104260 <release> } 80103d81: 83 c4 10 add $0x10,%esp return pid; 80103d84: 89 f0 mov %esi,%eax } 80103d86: 5b pop %ebx 80103d87: 5e pop %esi 80103d88: 5d pop %ebp 80103d89: c3 ret release(&ptable.lock); 80103d8a: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103d91: e8 ca 04 00 00 call 80104260 <release> } 80103d96: 83 c4 10 add $0x10,%esp return -1; 80103d99: b8 ff ff ff ff mov $0xffffffff,%eax } 80103d9e: 5b pop %ebx 80103d9f: 5e pop %esi 80103da0: 5d pop %ebp 80103da1: c3 ret 80103da2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103da9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103db0 <wakeup>: } // Wake up all processes sleeping on chan. void wakeup(void *chan) { 80103db0: 55 push %ebp 80103db1: 89 e5 mov %esp,%ebp 80103db3: 53 push %ebx 80103db4: 83 ec 14 sub $0x14,%esp 80103db7: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&ptable.lock); 80103dba: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103dc1: e8 aa 03 00 00 call 80104170 <acquire> for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103dc6: b8 54 2d 11 80 mov $0x80112d54,%eax 80103dcb: eb 0f jmp 80103ddc <wakeup+0x2c> 80103dcd: 8d 76 00 lea 0x0(%esi),%esi 80103dd0: 05 84 00 00 00 add $0x84,%eax 80103dd5: 3d 54 4e 11 80 cmp $0x80114e54,%eax 80103dda: 74 24 je 80103e00 <wakeup+0x50> if(p->state == SLEEPING && p->chan == chan) 80103ddc: 83 78 14 02 cmpl $0x2,0x14(%eax) 80103de0: 75 ee jne 80103dd0 <wakeup+0x20> 80103de2: 3b 58 28 cmp 0x28(%eax),%ebx 80103de5: 75 e9 jne 80103dd0 <wakeup+0x20> p->state = RUNNABLE; 80103de7: c7 40 14 03 00 00 00 movl $0x3,0x14(%eax) for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103dee: 05 84 00 00 00 add $0x84,%eax 80103df3: 3d 54 4e 11 80 cmp $0x80114e54,%eax 80103df8: 75 e2 jne 80103ddc <wakeup+0x2c> 80103dfa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi wakeup1(chan); release(&ptable.lock); 80103e00: c7 45 08 20 2d 11 80 movl $0x80112d20,0x8(%ebp) } 80103e07: 83 c4 14 add $0x14,%esp 80103e0a: 5b pop %ebx 80103e0b: 5d pop %ebp release(&ptable.lock); 80103e0c: e9 4f 04 00 00 jmp 80104260 <release> 80103e11: eb 0d jmp 80103e20 <kill> 80103e13: 90 nop 80103e14: 90 nop 80103e15: 90 nop 80103e16: 90 nop 80103e17: 90 nop 80103e18: 90 nop 80103e19: 90 nop 80103e1a: 90 nop 80103e1b: 90 nop 80103e1c: 90 nop 80103e1d: 90 nop 80103e1e: 90 nop 80103e1f: 90 nop 80103e20 <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) { 80103e20: 55 push %ebp 80103e21: 89 e5 mov %esp,%ebp 80103e23: 53 push %ebx 80103e24: 83 ec 14 sub $0x14,%esp 80103e27: 8b 5d 08 mov 0x8(%ebp),%ebx struct proc *p; acquire(&ptable.lock); 80103e2a: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103e31: e8 3a 03 00 00 call 80104170 <acquire> for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103e36: b8 54 2d 11 80 mov $0x80112d54,%eax 80103e3b: eb 0f jmp 80103e4c <kill+0x2c> 80103e3d: 8d 76 00 lea 0x0(%esi),%esi 80103e40: 05 84 00 00 00 add $0x84,%eax 80103e45: 3d 54 4e 11 80 cmp $0x80114e54,%eax 80103e4a: 74 3c je 80103e88 <kill+0x68> if(p->pid == pid){ 80103e4c: 39 58 18 cmp %ebx,0x18(%eax) 80103e4f: 75 ef jne 80103e40 <kill+0x20> p->killed = 1; // Wake process from sleep if necessary. if(p->state == SLEEPING) 80103e51: 83 78 14 02 cmpl $0x2,0x14(%eax) p->killed = 1; 80103e55: c7 40 2c 01 00 00 00 movl $0x1,0x2c(%eax) if(p->state == SLEEPING) 80103e5c: 74 1a je 80103e78 <kill+0x58> p->state = RUNNABLE; release(&ptable.lock); 80103e5e: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103e65: e8 f6 03 00 00 call 80104260 <release> return 0; } } release(&ptable.lock); return -1; } 80103e6a: 83 c4 14 add $0x14,%esp return 0; 80103e6d: 31 c0 xor %eax,%eax } 80103e6f: 5b pop %ebx 80103e70: 5d pop %ebp 80103e71: c3 ret 80103e72: 8d b6 00 00 00 00 lea 0x0(%esi),%esi p->state = RUNNABLE; 80103e78: c7 40 14 03 00 00 00 movl $0x3,0x14(%eax) 80103e7f: eb dd jmp 80103e5e <kill+0x3e> 80103e81: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi release(&ptable.lock); 80103e88: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103e8f: e8 cc 03 00 00 call 80104260 <release> } 80103e94: 83 c4 14 add $0x14,%esp return -1; 80103e97: b8 ff ff ff ff mov $0xffffffff,%eax } 80103e9c: 5b pop %ebx 80103e9d: 5d pop %ebp 80103e9e: c3 ret 80103e9f: 90 nop 80103ea0 <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) { 80103ea0: 55 push %ebp 80103ea1: 89 e5 mov %esp,%ebp 80103ea3: 57 push %edi 80103ea4: 56 push %esi 80103ea5: 53 push %ebx 80103ea6: bb c8 2d 11 80 mov $0x80112dc8,%ebx 80103eab: 83 ec 4c sub $0x4c,%esp 80103eae: 8d 75 e8 lea -0x18(%ebp),%esi 80103eb1: eb 23 jmp 80103ed6 <procdump+0x36> 80103eb3: 90 nop 80103eb4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(p->state == SLEEPING){ getcallerpcs((uint*)p->context->ebp+2, pc); for(i=0; i<10 && pc[i] != 0; i++) cprintf(" %p", pc[i]); } cprintf("\n"); 80103eb8: c7 04 24 9f 77 10 80 movl $0x8010779f,(%esp) 80103ebf: e8 8c c7 ff ff call 80100650 <cprintf> 80103ec4: 81 c3 84 00 00 00 add $0x84,%ebx for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103eca: 81 fb c8 4e 11 80 cmp $0x80114ec8,%ebx 80103ed0: 0f 84 8a 00 00 00 je 80103f60 <procdump+0xc0> if(p->state == UNUSED) 80103ed6: 8b 43 a0 mov -0x60(%ebx),%eax 80103ed9: 85 c0 test %eax,%eax 80103edb: 74 e7 je 80103ec4 <procdump+0x24> if(p->state >= 0 && p->state < NELEM(states) && states[p->state]) 80103edd: 83 f8 05 cmp $0x5,%eax state = "???"; 80103ee0: ba 20 74 10 80 mov $0x80107420,%edx if(p->state >= 0 && p->state < NELEM(states) && states[p->state]) 80103ee5: 77 11 ja 80103ef8 <procdump+0x58> 80103ee7: 8b 14 85 80 74 10 80 mov -0x7fef8b80(,%eax,4),%edx state = "???"; 80103eee: b8 20 74 10 80 mov $0x80107420,%eax 80103ef3: 85 d2 test %edx,%edx 80103ef5: 0f 44 d0 cmove %eax,%edx cprintf("%d %s %s", p->pid, state, p->name); 80103ef8: 8b 43 a4 mov -0x5c(%ebx),%eax 80103efb: 89 5c 24 0c mov %ebx,0xc(%esp) 80103eff: 89 54 24 08 mov %edx,0x8(%esp) 80103f03: c7 04 24 24 74 10 80 movl $0x80107424,(%esp) 80103f0a: 89 44 24 04 mov %eax,0x4(%esp) 80103f0e: e8 3d c7 ff ff call 80100650 <cprintf> if(p->state == SLEEPING){ 80103f13: 83 7b a0 02 cmpl $0x2,-0x60(%ebx) 80103f17: 75 9f jne 80103eb8 <procdump+0x18> getcallerpcs((uint*)p->context->ebp+2, pc); 80103f19: 8d 45 c0 lea -0x40(%ebp),%eax 80103f1c: 89 44 24 04 mov %eax,0x4(%esp) 80103f20: 8b 43 b0 mov -0x50(%ebx),%eax 80103f23: 8d 7d c0 lea -0x40(%ebp),%edi 80103f26: 8b 40 0c mov 0xc(%eax),%eax 80103f29: 83 c0 08 add $0x8,%eax 80103f2c: 89 04 24 mov %eax,(%esp) 80103f2f: e8 6c 01 00 00 call 801040a0 <getcallerpcs> 80103f34: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(i=0; i<10 && pc[i] != 0; i++) 80103f38: 8b 17 mov (%edi),%edx 80103f3a: 85 d2 test %edx,%edx 80103f3c: 0f 84 76 ff ff ff je 80103eb8 <procdump+0x18> cprintf(" %p", pc[i]); 80103f42: 89 54 24 04 mov %edx,0x4(%esp) 80103f46: 83 c7 04 add $0x4,%edi 80103f49: c7 04 24 61 6e 10 80 movl $0x80106e61,(%esp) 80103f50: e8 fb c6 ff ff call 80100650 <cprintf> for(i=0; i<10 && pc[i] != 0; i++) 80103f55: 39 f7 cmp %esi,%edi 80103f57: 75 df jne 80103f38 <procdump+0x98> 80103f59: e9 5a ff ff ff jmp 80103eb8 <procdump+0x18> 80103f5e: 66 90 xchg %ax,%ax } } 80103f60: 83 c4 4c add $0x4c,%esp 80103f63: 5b pop %ebx 80103f64: 5e pop %esi 80103f65: 5f pop %edi 80103f66: 5d pop %ebp 80103f67: c3 ret 80103f68: 66 90 xchg %ax,%ax 80103f6a: 66 90 xchg %ax,%ax 80103f6c: 66 90 xchg %ax,%ax 80103f6e: 66 90 xchg %ax,%ax 80103f70 <initsleeplock>: #include "spinlock.h" #include "sleeplock.h" void initsleeplock(struct sleeplock *lk, char *name) { 80103f70: 55 push %ebp 80103f71: 89 e5 mov %esp,%ebp 80103f73: 53 push %ebx 80103f74: 83 ec 14 sub $0x14,%esp 80103f77: 8b 5d 08 mov 0x8(%ebp),%ebx initlock(&lk->lk, "sleep lock"); 80103f7a: c7 44 24 04 98 74 10 movl $0x80107498,0x4(%esp) 80103f81: 80 80103f82: 8d 43 04 lea 0x4(%ebx),%eax 80103f85: 89 04 24 mov %eax,(%esp) 80103f88: e8 f3 00 00 00 call 80104080 <initlock> lk->name = name; 80103f8d: 8b 45 0c mov 0xc(%ebp),%eax lk->locked = 0; 80103f90: c7 03 00 00 00 00 movl $0x0,(%ebx) lk->pid = 0; 80103f96: c7 43 3c 00 00 00 00 movl $0x0,0x3c(%ebx) lk->name = name; 80103f9d: 89 43 38 mov %eax,0x38(%ebx) } 80103fa0: 83 c4 14 add $0x14,%esp 80103fa3: 5b pop %ebx 80103fa4: 5d pop %ebp 80103fa5: c3 ret 80103fa6: 8d 76 00 lea 0x0(%esi),%esi 80103fa9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103fb0 <acquiresleep>: void acquiresleep(struct sleeplock *lk) { 80103fb0: 55 push %ebp 80103fb1: 89 e5 mov %esp,%ebp 80103fb3: 56 push %esi 80103fb4: 53 push %ebx 80103fb5: 83 ec 10 sub $0x10,%esp 80103fb8: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&lk->lk); 80103fbb: 8d 73 04 lea 0x4(%ebx),%esi 80103fbe: 89 34 24 mov %esi,(%esp) 80103fc1: e8 aa 01 00 00 call 80104170 <acquire> while (lk->locked) { 80103fc6: 8b 13 mov (%ebx),%edx 80103fc8: 85 d2 test %edx,%edx 80103fca: 74 16 je 80103fe2 <acquiresleep+0x32> 80103fcc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi sleep(lk, &lk->lk); 80103fd0: 89 74 24 04 mov %esi,0x4(%esp) 80103fd4: 89 1c 24 mov %ebx,(%esp) 80103fd7: e8 34 fc ff ff call 80103c10 <sleep> while (lk->locked) { 80103fdc: 8b 03 mov (%ebx),%eax 80103fde: 85 c0 test %eax,%eax 80103fe0: 75 ee jne 80103fd0 <acquiresleep+0x20> } lk->locked = 1; 80103fe2: c7 03 01 00 00 00 movl $0x1,(%ebx) lk->pid = myproc()->pid; 80103fe8: e8 a3 f6 ff ff call 80103690 <myproc> 80103fed: 8b 40 18 mov 0x18(%eax),%eax 80103ff0: 89 43 3c mov %eax,0x3c(%ebx) release(&lk->lk); 80103ff3: 89 75 08 mov %esi,0x8(%ebp) } 80103ff6: 83 c4 10 add $0x10,%esp 80103ff9: 5b pop %ebx 80103ffa: 5e pop %esi 80103ffb: 5d pop %ebp release(&lk->lk); 80103ffc: e9 5f 02 00 00 jmp 80104260 <release> 80104001: eb 0d jmp 80104010 <releasesleep> 80104003: 90 nop 80104004: 90 nop 80104005: 90 nop 80104006: 90 nop 80104007: 90 nop 80104008: 90 nop 80104009: 90 nop 8010400a: 90 nop 8010400b: 90 nop 8010400c: 90 nop 8010400d: 90 nop 8010400e: 90 nop 8010400f: 90 nop 80104010 <releasesleep>: void releasesleep(struct sleeplock *lk) { 80104010: 55 push %ebp 80104011: 89 e5 mov %esp,%ebp 80104013: 56 push %esi 80104014: 53 push %ebx 80104015: 83 ec 10 sub $0x10,%esp 80104018: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&lk->lk); 8010401b: 8d 73 04 lea 0x4(%ebx),%esi 8010401e: 89 34 24 mov %esi,(%esp) 80104021: e8 4a 01 00 00 call 80104170 <acquire> lk->locked = 0; 80104026: c7 03 00 00 00 00 movl $0x0,(%ebx) lk->pid = 0; 8010402c: c7 43 3c 00 00 00 00 movl $0x0,0x3c(%ebx) wakeup(lk); 80104033: 89 1c 24 mov %ebx,(%esp) 80104036: e8 75 fd ff ff call 80103db0 <wakeup> release(&lk->lk); 8010403b: 89 75 08 mov %esi,0x8(%ebp) } 8010403e: 83 c4 10 add $0x10,%esp 80104041: 5b pop %ebx 80104042: 5e pop %esi 80104043: 5d pop %ebp release(&lk->lk); 80104044: e9 17 02 00 00 jmp 80104260 <release> 80104049: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104050 <holdingsleep>: int holdingsleep(struct sleeplock *lk) { 80104050: 55 push %ebp 80104051: 89 e5 mov %esp,%ebp 80104053: 56 push %esi 80104054: 53 push %ebx 80104055: 83 ec 10 sub $0x10,%esp 80104058: 8b 5d 08 mov 0x8(%ebp),%ebx int r; acquire(&lk->lk); 8010405b: 8d 73 04 lea 0x4(%ebx),%esi 8010405e: 89 34 24 mov %esi,(%esp) 80104061: e8 0a 01 00 00 call 80104170 <acquire> r = lk->locked; 80104066: 8b 1b mov (%ebx),%ebx release(&lk->lk); 80104068: 89 34 24 mov %esi,(%esp) 8010406b: e8 f0 01 00 00 call 80104260 <release> return r; } 80104070: 83 c4 10 add $0x10,%esp 80104073: 89 d8 mov %ebx,%eax 80104075: 5b pop %ebx 80104076: 5e pop %esi 80104077: 5d pop %ebp 80104078: c3 ret 80104079: 66 90 xchg %ax,%ax 8010407b: 66 90 xchg %ax,%ax 8010407d: 66 90 xchg %ax,%ax 8010407f: 90 nop 80104080 <initlock>: #include "proc.h" #include "spinlock.h" void initlock(struct spinlock *lk, char *name) { 80104080: 55 push %ebp 80104081: 89 e5 mov %esp,%ebp 80104083: 8b 45 08 mov 0x8(%ebp),%eax lk->name = name; 80104086: 8b 55 0c mov 0xc(%ebp),%edx lk->locked = 0; 80104089: c7 00 00 00 00 00 movl $0x0,(%eax) lk->name = name; 8010408f: 89 50 04 mov %edx,0x4(%eax) lk->cpu = 0; 80104092: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax) } 80104099: 5d pop %ebp 8010409a: c3 ret 8010409b: 90 nop 8010409c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801040a0 <getcallerpcs>: } // Record the current call stack in pcs[] by following the %ebp chain. void getcallerpcs(void *v, uint pcs[]) { 801040a0: 55 push %ebp 801040a1: 89 e5 mov %esp,%ebp uint *ebp; int i; ebp = (uint*)v - 2; 801040a3: 8b 45 08 mov 0x8(%ebp),%eax { 801040a6: 8b 4d 0c mov 0xc(%ebp),%ecx 801040a9: 53 push %ebx ebp = (uint*)v - 2; 801040aa: 8d 50 f8 lea -0x8(%eax),%edx for(i = 0; i < 10; i++){ 801040ad: 31 c0 xor %eax,%eax 801040af: 90 nop if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff) 801040b0: 8d 9a 00 00 00 80 lea -0x80000000(%edx),%ebx 801040b6: 81 fb fe ff ff 7f cmp $0x7ffffffe,%ebx 801040bc: 77 1a ja 801040d8 <getcallerpcs+0x38> break; pcs[i] = ebp[1]; // saved %eip 801040be: 8b 5a 04 mov 0x4(%edx),%ebx 801040c1: 89 1c 81 mov %ebx,(%ecx,%eax,4) for(i = 0; i < 10; i++){ 801040c4: 83 c0 01 add $0x1,%eax ebp = (uint*)ebp[0]; // saved %ebp 801040c7: 8b 12 mov (%edx),%edx for(i = 0; i < 10; i++){ 801040c9: 83 f8 0a cmp $0xa,%eax 801040cc: 75 e2 jne 801040b0 <getcallerpcs+0x10> } for(; i < 10; i++) pcs[i] = 0; } 801040ce: 5b pop %ebx 801040cf: 5d pop %ebp 801040d0: c3 ret 801040d1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi pcs[i] = 0; 801040d8: c7 04 81 00 00 00 00 movl $0x0,(%ecx,%eax,4) for(; i < 10; i++) 801040df: 83 c0 01 add $0x1,%eax 801040e2: 83 f8 0a cmp $0xa,%eax 801040e5: 74 e7 je 801040ce <getcallerpcs+0x2e> pcs[i] = 0; 801040e7: c7 04 81 00 00 00 00 movl $0x0,(%ecx,%eax,4) for(; i < 10; i++) 801040ee: 83 c0 01 add $0x1,%eax 801040f1: 83 f8 0a cmp $0xa,%eax 801040f4: 75 e2 jne 801040d8 <getcallerpcs+0x38> 801040f6: eb d6 jmp 801040ce <getcallerpcs+0x2e> 801040f8: 90 nop 801040f9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104100 <holding>: // Check whether this cpu is holding the lock. int holding(struct spinlock *lock) { 80104100: 55 push %ebp return lock->locked && lock->cpu == mycpu(); 80104101: 31 c0 xor %eax,%eax { 80104103: 89 e5 mov %esp,%ebp 80104105: 53 push %ebx 80104106: 83 ec 04 sub $0x4,%esp 80104109: 8b 55 08 mov 0x8(%ebp),%edx return lock->locked && lock->cpu == mycpu(); 8010410c: 8b 0a mov (%edx),%ecx 8010410e: 85 c9 test %ecx,%ecx 80104110: 74 10 je 80104122 <holding+0x22> 80104112: 8b 5a 08 mov 0x8(%edx),%ebx 80104115: e8 d6 f4 ff ff call 801035f0 <mycpu> 8010411a: 39 c3 cmp %eax,%ebx 8010411c: 0f 94 c0 sete %al 8010411f: 0f b6 c0 movzbl %al,%eax } 80104122: 83 c4 04 add $0x4,%esp 80104125: 5b pop %ebx 80104126: 5d pop %ebp 80104127: c3 ret 80104128: 90 nop 80104129: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104130 <pushcli>: // it takes two popcli to undo two pushcli. Also, if interrupts // are off, then pushcli, popcli leaves them off. void pushcli(void) { 80104130: 55 push %ebp 80104131: 89 e5 mov %esp,%ebp 80104133: 53 push %ebx 80104134: 83 ec 04 sub $0x4,%esp 80104137: 9c pushf 80104138: 5b pop %ebx asm volatile("cli"); 80104139: fa cli int eflags; eflags = readeflags(); cli(); if(mycpu()->ncli == 0) 8010413a: e8 b1 f4 ff ff call 801035f0 <mycpu> 8010413f: 8b 80 a4 00 00 00 mov 0xa4(%eax),%eax 80104145: 85 c0 test %eax,%eax 80104147: 75 11 jne 8010415a <pushcli+0x2a> mycpu()->intena = eflags & FL_IF; 80104149: e8 a2 f4 ff ff call 801035f0 <mycpu> 8010414e: 81 e3 00 02 00 00 and $0x200,%ebx 80104154: 89 98 a8 00 00 00 mov %ebx,0xa8(%eax) mycpu()->ncli += 1; 8010415a: e8 91 f4 ff ff call 801035f0 <mycpu> 8010415f: 83 80 a4 00 00 00 01 addl $0x1,0xa4(%eax) } 80104166: 83 c4 04 add $0x4,%esp 80104169: 5b pop %ebx 8010416a: 5d pop %ebp 8010416b: c3 ret 8010416c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104170 <acquire>: { 80104170: 55 push %ebp 80104171: 89 e5 mov %esp,%ebp 80104173: 53 push %ebx 80104174: 83 ec 14 sub $0x14,%esp pushcli(); // disable interrupts to avoid deadlock. 80104177: e8 b4 ff ff ff call 80104130 <pushcli> if(holding(lk)) 8010417c: 8b 55 08 mov 0x8(%ebp),%edx return lock->locked && lock->cpu == mycpu(); 8010417f: 8b 02 mov (%edx),%eax 80104181: 85 c0 test %eax,%eax 80104183: 75 43 jne 801041c8 <acquire+0x58> asm volatile("lock; xchgl %0, %1" : 80104185: b9 01 00 00 00 mov $0x1,%ecx 8010418a: eb 07 jmp 80104193 <acquire+0x23> 8010418c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104190: 8b 55 08 mov 0x8(%ebp),%edx 80104193: 89 c8 mov %ecx,%eax 80104195: f0 87 02 lock xchg %eax,(%edx) while(xchg(&lk->locked, 1) != 0) 80104198: 85 c0 test %eax,%eax 8010419a: 75 f4 jne 80104190 <acquire+0x20> __sync_synchronize(); 8010419c: 0f ae f0 mfence lk->cpu = mycpu(); 8010419f: 8b 5d 08 mov 0x8(%ebp),%ebx 801041a2: e8 49 f4 ff ff call 801035f0 <mycpu> 801041a7: 89 43 08 mov %eax,0x8(%ebx) getcallerpcs(&lk, lk->pcs); 801041aa: 8b 45 08 mov 0x8(%ebp),%eax 801041ad: 83 c0 0c add $0xc,%eax 801041b0: 89 44 24 04 mov %eax,0x4(%esp) 801041b4: 8d 45 08 lea 0x8(%ebp),%eax 801041b7: 89 04 24 mov %eax,(%esp) 801041ba: e8 e1 fe ff ff call 801040a0 <getcallerpcs> } 801041bf: 83 c4 14 add $0x14,%esp 801041c2: 5b pop %ebx 801041c3: 5d pop %ebp 801041c4: c3 ret 801041c5: 8d 76 00 lea 0x0(%esi),%esi return lock->locked && lock->cpu == mycpu(); 801041c8: 8b 5a 08 mov 0x8(%edx),%ebx 801041cb: e8 20 f4 ff ff call 801035f0 <mycpu> if(holding(lk)) 801041d0: 39 c3 cmp %eax,%ebx 801041d2: 74 05 je 801041d9 <acquire+0x69> 801041d4: 8b 55 08 mov 0x8(%ebp),%edx 801041d7: eb ac jmp 80104185 <acquire+0x15> panic("acquire"); 801041d9: c7 04 24 a3 74 10 80 movl $0x801074a3,(%esp) 801041e0: e8 7b c1 ff ff call 80100360 <panic> 801041e5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801041e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801041f0 <popcli>: void popcli(void) { 801041f0: 55 push %ebp 801041f1: 89 e5 mov %esp,%ebp 801041f3: 83 ec 18 sub $0x18,%esp asm volatile("pushfl; popl %0" : "=r" (eflags)); 801041f6: 9c pushf 801041f7: 58 pop %eax if(readeflags()&FL_IF) 801041f8: f6 c4 02 test $0x2,%ah 801041fb: 75 49 jne 80104246 <popcli+0x56> panic("popcli - interruptible"); if(--mycpu()->ncli < 0) 801041fd: e8 ee f3 ff ff call 801035f0 <mycpu> 80104202: 8b 88 a4 00 00 00 mov 0xa4(%eax),%ecx 80104208: 8d 51 ff lea -0x1(%ecx),%edx 8010420b: 85 d2 test %edx,%edx 8010420d: 89 90 a4 00 00 00 mov %edx,0xa4(%eax) 80104213: 78 25 js 8010423a <popcli+0x4a> panic("popcli"); if(mycpu()->ncli == 0 && mycpu()->intena) 80104215: e8 d6 f3 ff ff call 801035f0 <mycpu> 8010421a: 8b 90 a4 00 00 00 mov 0xa4(%eax),%edx 80104220: 85 d2 test %edx,%edx 80104222: 74 04 je 80104228 <popcli+0x38> sti(); } 80104224: c9 leave 80104225: c3 ret 80104226: 66 90 xchg %ax,%ax if(mycpu()->ncli == 0 && mycpu()->intena) 80104228: e8 c3 f3 ff ff call 801035f0 <mycpu> 8010422d: 8b 80 a8 00 00 00 mov 0xa8(%eax),%eax 80104233: 85 c0 test %eax,%eax 80104235: 74 ed je 80104224 <popcli+0x34> asm volatile("sti"); 80104237: fb sti } 80104238: c9 leave 80104239: c3 ret panic("popcli"); 8010423a: c7 04 24 c2 74 10 80 movl $0x801074c2,(%esp) 80104241: e8 1a c1 ff ff call 80100360 <panic> panic("popcli - interruptible"); 80104246: c7 04 24 ab 74 10 80 movl $0x801074ab,(%esp) 8010424d: e8 0e c1 ff ff call 80100360 <panic> 80104252: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104259: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104260 <release>: { 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 80104268: 8b 5d 08 mov 0x8(%ebp),%ebx return lock->locked && lock->cpu == mycpu(); 8010426b: 8b 03 mov (%ebx),%eax 8010426d: 85 c0 test %eax,%eax 8010426f: 75 0f jne 80104280 <release+0x20> panic("release"); 80104271: c7 04 24 c9 74 10 80 movl $0x801074c9,(%esp) 80104278: e8 e3 c0 ff ff call 80100360 <panic> 8010427d: 8d 76 00 lea 0x0(%esi),%esi return lock->locked && lock->cpu == mycpu(); 80104280: 8b 73 08 mov 0x8(%ebx),%esi 80104283: e8 68 f3 ff ff call 801035f0 <mycpu> if(!holding(lk)) 80104288: 39 c6 cmp %eax,%esi 8010428a: 75 e5 jne 80104271 <release+0x11> lk->pcs[0] = 0; 8010428c: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) lk->cpu = 0; 80104293: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) __sync_synchronize(); 8010429a: 0f ae f0 mfence asm volatile("movl $0, %0" : "+m" (lk->locked) : ); 8010429d: c7 03 00 00 00 00 movl $0x0,(%ebx) } 801042a3: 83 c4 10 add $0x10,%esp 801042a6: 5b pop %ebx 801042a7: 5e pop %esi 801042a8: 5d pop %ebp popcli(); 801042a9: e9 42 ff ff ff jmp 801041f0 <popcli> 801042ae: 66 90 xchg %ax,%ax 801042b0 <memset>: #include "types.h" #include "x86.h" void* memset(void *dst, int c, uint n) { 801042b0: 55 push %ebp 801042b1: 89 e5 mov %esp,%ebp 801042b3: 8b 55 08 mov 0x8(%ebp),%edx 801042b6: 57 push %edi 801042b7: 8b 4d 10 mov 0x10(%ebp),%ecx 801042ba: 53 push %ebx if ((int)dst%4 == 0 && n%4 == 0){ 801042bb: f6 c2 03 test $0x3,%dl 801042be: 75 05 jne 801042c5 <memset+0x15> 801042c0: f6 c1 03 test $0x3,%cl 801042c3: 74 13 je 801042d8 <memset+0x28> asm volatile("cld; rep stosb" : 801042c5: 89 d7 mov %edx,%edi 801042c7: 8b 45 0c mov 0xc(%ebp),%eax 801042ca: fc cld 801042cb: 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; } 801042cd: 5b pop %ebx 801042ce: 89 d0 mov %edx,%eax 801042d0: 5f pop %edi 801042d1: 5d pop %ebp 801042d2: c3 ret 801042d3: 90 nop 801042d4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi c &= 0xFF; 801042d8: 0f b6 7d 0c movzbl 0xc(%ebp),%edi stosl(dst, (c<<24)|(c<<16)|(c<<8)|c, n/4); 801042dc: c1 e9 02 shr $0x2,%ecx 801042df: 89 f8 mov %edi,%eax 801042e1: 89 fb mov %edi,%ebx 801042e3: c1 e0 18 shl $0x18,%eax 801042e6: c1 e3 10 shl $0x10,%ebx 801042e9: 09 d8 or %ebx,%eax 801042eb: 09 f8 or %edi,%eax 801042ed: c1 e7 08 shl $0x8,%edi 801042f0: 09 f8 or %edi,%eax asm volatile("cld; rep stosl" : 801042f2: 89 d7 mov %edx,%edi 801042f4: fc cld 801042f5: f3 ab rep stos %eax,%es:(%edi) } 801042f7: 5b pop %ebx 801042f8: 89 d0 mov %edx,%eax 801042fa: 5f pop %edi 801042fb: 5d pop %ebp 801042fc: c3 ret 801042fd: 8d 76 00 lea 0x0(%esi),%esi 80104300 <memcmp>: int memcmp(const void *v1, const void *v2, uint n) { 80104300: 55 push %ebp 80104301: 89 e5 mov %esp,%ebp 80104303: 8b 45 10 mov 0x10(%ebp),%eax 80104306: 57 push %edi 80104307: 56 push %esi 80104308: 8b 75 0c mov 0xc(%ebp),%esi 8010430b: 53 push %ebx 8010430c: 8b 5d 08 mov 0x8(%ebp),%ebx const uchar *s1, *s2; s1 = v1; s2 = v2; while(n-- > 0){ 8010430f: 85 c0 test %eax,%eax 80104311: 8d 78 ff lea -0x1(%eax),%edi 80104314: 74 26 je 8010433c <memcmp+0x3c> if(*s1 != *s2) 80104316: 0f b6 03 movzbl (%ebx),%eax 80104319: 31 d2 xor %edx,%edx 8010431b: 0f b6 0e movzbl (%esi),%ecx 8010431e: 38 c8 cmp %cl,%al 80104320: 74 16 je 80104338 <memcmp+0x38> 80104322: eb 24 jmp 80104348 <memcmp+0x48> 80104324: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104328: 0f b6 44 13 01 movzbl 0x1(%ebx,%edx,1),%eax 8010432d: 83 c2 01 add $0x1,%edx 80104330: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx 80104334: 38 c8 cmp %cl,%al 80104336: 75 10 jne 80104348 <memcmp+0x48> while(n-- > 0){ 80104338: 39 fa cmp %edi,%edx 8010433a: 75 ec jne 80104328 <memcmp+0x28> return *s1 - *s2; s1++, s2++; } return 0; } 8010433c: 5b pop %ebx return 0; 8010433d: 31 c0 xor %eax,%eax } 8010433f: 5e pop %esi 80104340: 5f pop %edi 80104341: 5d pop %ebp 80104342: c3 ret 80104343: 90 nop 80104344: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104348: 5b pop %ebx return *s1 - *s2; 80104349: 29 c8 sub %ecx,%eax } 8010434b: 5e pop %esi 8010434c: 5f pop %edi 8010434d: 5d pop %ebp 8010434e: c3 ret 8010434f: 90 nop 80104350 <memmove>: void* memmove(void *dst, const void *src, uint n) { 80104350: 55 push %ebp 80104351: 89 e5 mov %esp,%ebp 80104353: 57 push %edi 80104354: 8b 45 08 mov 0x8(%ebp),%eax 80104357: 56 push %esi 80104358: 8b 75 0c mov 0xc(%ebp),%esi 8010435b: 53 push %ebx 8010435c: 8b 5d 10 mov 0x10(%ebp),%ebx const char *s; char *d; s = src; d = dst; if(s < d && s + n > d){ 8010435f: 39 c6 cmp %eax,%esi 80104361: 73 35 jae 80104398 <memmove+0x48> 80104363: 8d 0c 1e lea (%esi,%ebx,1),%ecx 80104366: 39 c8 cmp %ecx,%eax 80104368: 73 2e jae 80104398 <memmove+0x48> s += n; d += n; while(n-- > 0) 8010436a: 85 db test %ebx,%ebx d += n; 8010436c: 8d 3c 18 lea (%eax,%ebx,1),%edi while(n-- > 0) 8010436f: 8d 53 ff lea -0x1(%ebx),%edx 80104372: 74 1b je 8010438f <memmove+0x3f> 80104374: f7 db neg %ebx 80104376: 8d 34 19 lea (%ecx,%ebx,1),%esi 80104379: 01 fb add %edi,%ebx 8010437b: 90 nop 8010437c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi *--d = *--s; 80104380: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx 80104384: 88 0c 13 mov %cl,(%ebx,%edx,1) while(n-- > 0) 80104387: 83 ea 01 sub $0x1,%edx 8010438a: 83 fa ff cmp $0xffffffff,%edx 8010438d: 75 f1 jne 80104380 <memmove+0x30> } else while(n-- > 0) *d++ = *s++; return dst; } 8010438f: 5b pop %ebx 80104390: 5e pop %esi 80104391: 5f pop %edi 80104392: 5d pop %ebp 80104393: c3 ret 80104394: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi while(n-- > 0) 80104398: 31 d2 xor %edx,%edx 8010439a: 85 db test %ebx,%ebx 8010439c: 74 f1 je 8010438f <memmove+0x3f> 8010439e: 66 90 xchg %ax,%ax *d++ = *s++; 801043a0: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx 801043a4: 88 0c 10 mov %cl,(%eax,%edx,1) 801043a7: 83 c2 01 add $0x1,%edx while(n-- > 0) 801043aa: 39 da cmp %ebx,%edx 801043ac: 75 f2 jne 801043a0 <memmove+0x50> } 801043ae: 5b pop %ebx 801043af: 5e pop %esi 801043b0: 5f pop %edi 801043b1: 5d pop %ebp 801043b2: c3 ret 801043b3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801043b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801043c0 <memcpy>: // memcpy exists to placate GCC. Use memmove. void* memcpy(void *dst, const void *src, uint n) { 801043c0: 55 push %ebp 801043c1: 89 e5 mov %esp,%ebp return memmove(dst, src, n); } 801043c3: 5d pop %ebp return memmove(dst, src, n); 801043c4: eb 8a jmp 80104350 <memmove> 801043c6: 8d 76 00 lea 0x0(%esi),%esi 801043c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801043d0 <strncmp>: int strncmp(const char *p, const char *q, uint n) { 801043d0: 55 push %ebp 801043d1: 89 e5 mov %esp,%ebp 801043d3: 56 push %esi 801043d4: 8b 75 10 mov 0x10(%ebp),%esi 801043d7: 53 push %ebx 801043d8: 8b 4d 08 mov 0x8(%ebp),%ecx 801043db: 8b 5d 0c mov 0xc(%ebp),%ebx while(n > 0 && *p && *p == *q) 801043de: 85 f6 test %esi,%esi 801043e0: 74 30 je 80104412 <strncmp+0x42> 801043e2: 0f b6 01 movzbl (%ecx),%eax 801043e5: 84 c0 test %al,%al 801043e7: 74 2f je 80104418 <strncmp+0x48> 801043e9: 0f b6 13 movzbl (%ebx),%edx 801043ec: 38 d0 cmp %dl,%al 801043ee: 75 46 jne 80104436 <strncmp+0x66> 801043f0: 8d 51 01 lea 0x1(%ecx),%edx 801043f3: 01 ce add %ecx,%esi 801043f5: eb 14 jmp 8010440b <strncmp+0x3b> 801043f7: 90 nop 801043f8: 0f b6 02 movzbl (%edx),%eax 801043fb: 84 c0 test %al,%al 801043fd: 74 31 je 80104430 <strncmp+0x60> 801043ff: 0f b6 19 movzbl (%ecx),%ebx 80104402: 83 c2 01 add $0x1,%edx 80104405: 38 d8 cmp %bl,%al 80104407: 75 17 jne 80104420 <strncmp+0x50> n--, p++, q++; 80104409: 89 cb mov %ecx,%ebx while(n > 0 && *p && *p == *q) 8010440b: 39 f2 cmp %esi,%edx n--, p++, q++; 8010440d: 8d 4b 01 lea 0x1(%ebx),%ecx while(n > 0 && *p && *p == *q) 80104410: 75 e6 jne 801043f8 <strncmp+0x28> if(n == 0) return 0; return (uchar)*p - (uchar)*q; } 80104412: 5b pop %ebx return 0; 80104413: 31 c0 xor %eax,%eax } 80104415: 5e pop %esi 80104416: 5d pop %ebp 80104417: c3 ret 80104418: 0f b6 1b movzbl (%ebx),%ebx while(n > 0 && *p && *p == *q) 8010441b: 31 c0 xor %eax,%eax 8010441d: 8d 76 00 lea 0x0(%esi),%esi return (uchar)*p - (uchar)*q; 80104420: 0f b6 d3 movzbl %bl,%edx 80104423: 29 d0 sub %edx,%eax } 80104425: 5b pop %ebx 80104426: 5e pop %esi 80104427: 5d pop %ebp 80104428: c3 ret 80104429: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104430: 0f b6 5b 01 movzbl 0x1(%ebx),%ebx 80104434: eb ea jmp 80104420 <strncmp+0x50> while(n > 0 && *p && *p == *q) 80104436: 89 d3 mov %edx,%ebx 80104438: eb e6 jmp 80104420 <strncmp+0x50> 8010443a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104440 <strncpy>: char* strncpy(char *s, const char *t, int n) { 80104440: 55 push %ebp 80104441: 89 e5 mov %esp,%ebp 80104443: 8b 45 08 mov 0x8(%ebp),%eax 80104446: 56 push %esi 80104447: 8b 4d 10 mov 0x10(%ebp),%ecx 8010444a: 53 push %ebx 8010444b: 8b 5d 0c mov 0xc(%ebp),%ebx char *os; os = s; while(n-- > 0 && (*s++ = *t++) != 0) 8010444e: 89 c2 mov %eax,%edx 80104450: eb 19 jmp 8010446b <strncpy+0x2b> 80104452: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104458: 83 c3 01 add $0x1,%ebx 8010445b: 0f b6 4b ff movzbl -0x1(%ebx),%ecx 8010445f: 83 c2 01 add $0x1,%edx 80104462: 84 c9 test %cl,%cl 80104464: 88 4a ff mov %cl,-0x1(%edx) 80104467: 74 09 je 80104472 <strncpy+0x32> 80104469: 89 f1 mov %esi,%ecx 8010446b: 85 c9 test %ecx,%ecx 8010446d: 8d 71 ff lea -0x1(%ecx),%esi 80104470: 7f e6 jg 80104458 <strncpy+0x18> ; while(n-- > 0) 80104472: 31 c9 xor %ecx,%ecx 80104474: 85 f6 test %esi,%esi 80104476: 7e 0f jle 80104487 <strncpy+0x47> *s++ = 0; 80104478: c6 04 0a 00 movb $0x0,(%edx,%ecx,1) 8010447c: 89 f3 mov %esi,%ebx 8010447e: 83 c1 01 add $0x1,%ecx 80104481: 29 cb sub %ecx,%ebx while(n-- > 0) 80104483: 85 db test %ebx,%ebx 80104485: 7f f1 jg 80104478 <strncpy+0x38> return os; } 80104487: 5b pop %ebx 80104488: 5e pop %esi 80104489: 5d pop %ebp 8010448a: c3 ret 8010448b: 90 nop 8010448c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104490 <safestrcpy>: // Like strncpy but guaranteed to NUL-terminate. char* safestrcpy(char *s, const char *t, int n) { 80104490: 55 push %ebp 80104491: 89 e5 mov %esp,%ebp 80104493: 8b 4d 10 mov 0x10(%ebp),%ecx 80104496: 56 push %esi 80104497: 8b 45 08 mov 0x8(%ebp),%eax 8010449a: 53 push %ebx 8010449b: 8b 55 0c mov 0xc(%ebp),%edx char *os; os = s; if(n <= 0) 8010449e: 85 c9 test %ecx,%ecx 801044a0: 7e 26 jle 801044c8 <safestrcpy+0x38> 801044a2: 8d 74 0a ff lea -0x1(%edx,%ecx,1),%esi 801044a6: 89 c1 mov %eax,%ecx 801044a8: eb 17 jmp 801044c1 <safestrcpy+0x31> 801044aa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return os; while(--n > 0 && (*s++ = *t++) != 0) 801044b0: 83 c2 01 add $0x1,%edx 801044b3: 0f b6 5a ff movzbl -0x1(%edx),%ebx 801044b7: 83 c1 01 add $0x1,%ecx 801044ba: 84 db test %bl,%bl 801044bc: 88 59 ff mov %bl,-0x1(%ecx) 801044bf: 74 04 je 801044c5 <safestrcpy+0x35> 801044c1: 39 f2 cmp %esi,%edx 801044c3: 75 eb jne 801044b0 <safestrcpy+0x20> ; *s = 0; 801044c5: c6 01 00 movb $0x0,(%ecx) return os; } 801044c8: 5b pop %ebx 801044c9: 5e pop %esi 801044ca: 5d pop %ebp 801044cb: c3 ret 801044cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801044d0 <strlen>: int strlen(const char *s) { 801044d0: 55 push %ebp int n; for(n = 0; s[n]; n++) 801044d1: 31 c0 xor %eax,%eax { 801044d3: 89 e5 mov %esp,%ebp 801044d5: 8b 55 08 mov 0x8(%ebp),%edx for(n = 0; s[n]; n++) 801044d8: 80 3a 00 cmpb $0x0,(%edx) 801044db: 74 0c je 801044e9 <strlen+0x19> 801044dd: 8d 76 00 lea 0x0(%esi),%esi 801044e0: 83 c0 01 add $0x1,%eax 801044e3: 80 3c 02 00 cmpb $0x0,(%edx,%eax,1) 801044e7: 75 f7 jne 801044e0 <strlen+0x10> ; return n; } 801044e9: 5d pop %ebp 801044ea: c3 ret 801044eb <swtch>: # Save current register context in old # and then load register context from new. .globl swtch swtch: movl 4(%esp), %eax 801044eb: 8b 44 24 04 mov 0x4(%esp),%eax movl 8(%esp), %edx 801044ef: 8b 54 24 08 mov 0x8(%esp),%edx # Save old callee-save registers pushl %ebp 801044f3: 55 push %ebp pushl %ebx 801044f4: 53 push %ebx pushl %esi 801044f5: 56 push %esi pushl %edi 801044f6: 57 push %edi # Switch stacks movl %esp, (%eax) 801044f7: 89 20 mov %esp,(%eax) movl %edx, %esp 801044f9: 89 d4 mov %edx,%esp # Load new callee-save registers popl %edi 801044fb: 5f pop %edi popl %esi 801044fc: 5e pop %esi popl %ebx 801044fd: 5b pop %ebx popl %ebp 801044fe: 5d pop %ebp ret 801044ff: c3 ret 80104500 <fetchint>: // 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) { 80104500: 55 push %ebp 80104501: 89 e5 mov %esp,%ebp 80104503: 53 push %ebx 80104504: 83 ec 04 sub $0x4,%esp 80104507: 8b 5d 08 mov 0x8(%ebp),%ebx struct proc *curproc = myproc(); 8010450a: e8 81 f1 ff ff call 80103690 <myproc> if(addr >= curproc->sz || addr+4 > curproc->sz) 8010450f: 8b 00 mov (%eax),%eax 80104511: 39 d8 cmp %ebx,%eax 80104513: 76 1b jbe 80104530 <fetchint+0x30> 80104515: 8d 53 04 lea 0x4(%ebx),%edx 80104518: 39 d0 cmp %edx,%eax 8010451a: 72 14 jb 80104530 <fetchint+0x30> return -1; *ip = *(int*)(addr); 8010451c: 8b 45 0c mov 0xc(%ebp),%eax 8010451f: 8b 13 mov (%ebx),%edx 80104521: 89 10 mov %edx,(%eax) return 0; 80104523: 31 c0 xor %eax,%eax } 80104525: 83 c4 04 add $0x4,%esp 80104528: 5b pop %ebx 80104529: 5d pop %ebp 8010452a: c3 ret 8010452b: 90 nop 8010452c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80104530: b8 ff ff ff ff mov $0xffffffff,%eax 80104535: eb ee jmp 80104525 <fetchint+0x25> 80104537: 89 f6 mov %esi,%esi 80104539: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104540 <fetchstr>: // 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) { 80104540: 55 push %ebp 80104541: 89 e5 mov %esp,%ebp 80104543: 53 push %ebx 80104544: 83 ec 04 sub $0x4,%esp 80104547: 8b 5d 08 mov 0x8(%ebp),%ebx char *s, *ep; struct proc *curproc = myproc(); 8010454a: e8 41 f1 ff ff call 80103690 <myproc> if(addr >= curproc->sz) 8010454f: 39 18 cmp %ebx,(%eax) 80104551: 76 26 jbe 80104579 <fetchstr+0x39> return -1; *pp = (char*)addr; 80104553: 8b 4d 0c mov 0xc(%ebp),%ecx 80104556: 89 da mov %ebx,%edx 80104558: 89 19 mov %ebx,(%ecx) ep = (char*)curproc->sz; 8010455a: 8b 00 mov (%eax),%eax for(s = *pp; s < ep; s++){ 8010455c: 39 c3 cmp %eax,%ebx 8010455e: 73 19 jae 80104579 <fetchstr+0x39> if(*s == 0) 80104560: 80 3b 00 cmpb $0x0,(%ebx) 80104563: 75 0d jne 80104572 <fetchstr+0x32> 80104565: eb 21 jmp 80104588 <fetchstr+0x48> 80104567: 90 nop 80104568: 80 3a 00 cmpb $0x0,(%edx) 8010456b: 90 nop 8010456c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104570: 74 16 je 80104588 <fetchstr+0x48> for(s = *pp; s < ep; s++){ 80104572: 83 c2 01 add $0x1,%edx 80104575: 39 d0 cmp %edx,%eax 80104577: 77 ef ja 80104568 <fetchstr+0x28> return s - *pp; } return -1; } 80104579: 83 c4 04 add $0x4,%esp return -1; 8010457c: b8 ff ff ff ff mov $0xffffffff,%eax } 80104581: 5b pop %ebx 80104582: 5d pop %ebp 80104583: c3 ret 80104584: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104588: 83 c4 04 add $0x4,%esp return s - *pp; 8010458b: 89 d0 mov %edx,%eax 8010458d: 29 d8 sub %ebx,%eax } 8010458f: 5b pop %ebx 80104590: 5d pop %ebp 80104591: c3 ret 80104592: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104599: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801045a0 <argint>: // Fetch the nth 32-bit system call argument. int argint(int n, int *ip) { 801045a0: 55 push %ebp 801045a1: 89 e5 mov %esp,%ebp 801045a3: 56 push %esi 801045a4: 8b 75 0c mov 0xc(%ebp),%esi 801045a7: 53 push %ebx 801045a8: 8b 5d 08 mov 0x8(%ebp),%ebx return fetchint((myproc()->tf->esp) + 4 + 4*n, ip); 801045ab: e8 e0 f0 ff ff call 80103690 <myproc> 801045b0: 89 75 0c mov %esi,0xc(%ebp) 801045b3: 8b 40 20 mov 0x20(%eax),%eax 801045b6: 8b 40 44 mov 0x44(%eax),%eax 801045b9: 8d 44 98 04 lea 0x4(%eax,%ebx,4),%eax 801045bd: 89 45 08 mov %eax,0x8(%ebp) } 801045c0: 5b pop %ebx 801045c1: 5e pop %esi 801045c2: 5d pop %ebp return fetchint((myproc()->tf->esp) + 4 + 4*n, ip); 801045c3: e9 38 ff ff ff jmp 80104500 <fetchint> 801045c8: 90 nop 801045c9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801045d0 <argptr>: // Fetch the nth word-sized system call argument as a pointer // to a block of memory of size bytes. Check that the pointer // lies within the process address space. int argptr(int n, char **pp, int size) { 801045d0: 55 push %ebp 801045d1: 89 e5 mov %esp,%ebp 801045d3: 56 push %esi 801045d4: 53 push %ebx 801045d5: 83 ec 20 sub $0x20,%esp 801045d8: 8b 5d 10 mov 0x10(%ebp),%ebx int i; struct proc *curproc = myproc(); 801045db: e8 b0 f0 ff ff call 80103690 <myproc> 801045e0: 89 c6 mov %eax,%esi if(argint(n, &i) < 0) 801045e2: 8d 45 f4 lea -0xc(%ebp),%eax 801045e5: 89 44 24 04 mov %eax,0x4(%esp) 801045e9: 8b 45 08 mov 0x8(%ebp),%eax 801045ec: 89 04 24 mov %eax,(%esp) 801045ef: e8 ac ff ff ff call 801045a0 <argint> 801045f4: 85 c0 test %eax,%eax 801045f6: 78 28 js 80104620 <argptr+0x50> return -1; if(size < 0 || (uint)i >= curproc->sz || (uint)i+size > curproc->sz) 801045f8: 85 db test %ebx,%ebx 801045fa: 78 24 js 80104620 <argptr+0x50> 801045fc: 8b 55 f4 mov -0xc(%ebp),%edx 801045ff: 8b 06 mov (%esi),%eax 80104601: 39 c2 cmp %eax,%edx 80104603: 73 1b jae 80104620 <argptr+0x50> 80104605: 01 d3 add %edx,%ebx 80104607: 39 d8 cmp %ebx,%eax 80104609: 72 15 jb 80104620 <argptr+0x50> return -1; *pp = (char*)i; 8010460b: 8b 45 0c mov 0xc(%ebp),%eax 8010460e: 89 10 mov %edx,(%eax) return 0; } 80104610: 83 c4 20 add $0x20,%esp return 0; 80104613: 31 c0 xor %eax,%eax } 80104615: 5b pop %ebx 80104616: 5e pop %esi 80104617: 5d pop %ebp 80104618: c3 ret 80104619: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104620: 83 c4 20 add $0x20,%esp return -1; 80104623: b8 ff ff ff ff mov $0xffffffff,%eax } 80104628: 5b pop %ebx 80104629: 5e pop %esi 8010462a: 5d pop %ebp 8010462b: c3 ret 8010462c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104630 <argstr>: // 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) { 80104630: 55 push %ebp 80104631: 89 e5 mov %esp,%ebp 80104633: 83 ec 28 sub $0x28,%esp int addr; if(argint(n, &addr) < 0) 80104636: 8d 45 f4 lea -0xc(%ebp),%eax 80104639: 89 44 24 04 mov %eax,0x4(%esp) 8010463d: 8b 45 08 mov 0x8(%ebp),%eax 80104640: 89 04 24 mov %eax,(%esp) 80104643: e8 58 ff ff ff call 801045a0 <argint> 80104648: 85 c0 test %eax,%eax 8010464a: 78 14 js 80104660 <argstr+0x30> return -1; return fetchstr(addr, pp); 8010464c: 8b 45 0c mov 0xc(%ebp),%eax 8010464f: 89 44 24 04 mov %eax,0x4(%esp) 80104653: 8b 45 f4 mov -0xc(%ebp),%eax 80104656: 89 04 24 mov %eax,(%esp) 80104659: e8 e2 fe ff ff call 80104540 <fetchstr> } 8010465e: c9 leave 8010465f: c3 ret return -1; 80104660: b8 ff ff ff ff mov $0xffffffff,%eax } 80104665: c9 leave 80104666: c3 ret 80104667: 89 f6 mov %esi,%esi 80104669: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104670 <syscall>: [SYS_shm_close] sys_shm_close }; void syscall(void) { 80104670: 55 push %ebp 80104671: 89 e5 mov %esp,%ebp 80104673: 56 push %esi 80104674: 53 push %ebx 80104675: 83 ec 10 sub $0x10,%esp int num; struct proc *curproc = myproc(); 80104678: e8 13 f0 ff ff call 80103690 <myproc> num = curproc->tf->eax; 8010467d: 8b 70 20 mov 0x20(%eax),%esi struct proc *curproc = myproc(); 80104680: 89 c3 mov %eax,%ebx num = curproc->tf->eax; 80104682: 8b 46 1c mov 0x1c(%esi),%eax if(num > 0 && num < NELEM(syscalls) && syscalls[num]) { 80104685: 8d 50 ff lea -0x1(%eax),%edx 80104688: 83 fa 16 cmp $0x16,%edx 8010468b: 77 1b ja 801046a8 <syscall+0x38> 8010468d: 8b 14 85 00 75 10 80 mov -0x7fef8b00(,%eax,4),%edx 80104694: 85 d2 test %edx,%edx 80104696: 74 10 je 801046a8 <syscall+0x38> curproc->tf->eax = syscalls[num](); 80104698: ff d2 call *%edx 8010469a: 89 46 1c mov %eax,0x1c(%esi) } else { cprintf("%d %s: unknown sys call %d\n", curproc->pid, curproc->name, num); curproc->tf->eax = -1; } } 8010469d: 83 c4 10 add $0x10,%esp 801046a0: 5b pop %ebx 801046a1: 5e pop %esi 801046a2: 5d pop %ebp 801046a3: c3 ret 801046a4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi cprintf("%d %s: unknown sys call %d\n", 801046a8: 89 44 24 0c mov %eax,0xc(%esp) curproc->pid, curproc->name, num); 801046ac: 8d 43 74 lea 0x74(%ebx),%eax 801046af: 89 44 24 08 mov %eax,0x8(%esp) cprintf("%d %s: unknown sys call %d\n", 801046b3: 8b 43 18 mov 0x18(%ebx),%eax 801046b6: c7 04 24 d1 74 10 80 movl $0x801074d1,(%esp) 801046bd: 89 44 24 04 mov %eax,0x4(%esp) 801046c1: e8 8a bf ff ff call 80100650 <cprintf> curproc->tf->eax = -1; 801046c6: 8b 43 20 mov 0x20(%ebx),%eax 801046c9: c7 40 1c ff ff ff ff movl $0xffffffff,0x1c(%eax) } 801046d0: 83 c4 10 add $0x10,%esp 801046d3: 5b pop %ebx 801046d4: 5e pop %esi 801046d5: 5d pop %ebp 801046d6: c3 ret 801046d7: 66 90 xchg %ax,%ax 801046d9: 66 90 xchg %ax,%ax 801046db: 66 90 xchg %ax,%ax 801046dd: 66 90 xchg %ax,%ax 801046df: 90 nop 801046e0 <fdalloc>: // Allocate a file descriptor for the given file. // Takes over file reference from caller on success. static int fdalloc(struct file *f) { 801046e0: 55 push %ebp 801046e1: 89 e5 mov %esp,%ebp 801046e3: 53 push %ebx 801046e4: 89 c3 mov %eax,%ebx 801046e6: 83 ec 04 sub $0x4,%esp int fd; struct proc *curproc = myproc(); 801046e9: e8 a2 ef ff ff call 80103690 <myproc> for(fd = 0; fd < NOFILE; fd++){ 801046ee: 31 d2 xor %edx,%edx if(curproc->ofile[fd] == 0){ 801046f0: 8b 4c 90 30 mov 0x30(%eax,%edx,4),%ecx 801046f4: 85 c9 test %ecx,%ecx 801046f6: 74 18 je 80104710 <fdalloc+0x30> for(fd = 0; fd < NOFILE; fd++){ 801046f8: 83 c2 01 add $0x1,%edx 801046fb: 83 fa 10 cmp $0x10,%edx 801046fe: 75 f0 jne 801046f0 <fdalloc+0x10> curproc->ofile[fd] = f; return fd; } } return -1; } 80104700: 83 c4 04 add $0x4,%esp return -1; 80104703: b8 ff ff ff ff mov $0xffffffff,%eax } 80104708: 5b pop %ebx 80104709: 5d pop %ebp 8010470a: c3 ret 8010470b: 90 nop 8010470c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi curproc->ofile[fd] = f; 80104710: 89 5c 90 30 mov %ebx,0x30(%eax,%edx,4) } 80104714: 83 c4 04 add $0x4,%esp return fd; 80104717: 89 d0 mov %edx,%eax } 80104719: 5b pop %ebx 8010471a: 5d pop %ebp 8010471b: c3 ret 8010471c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104720 <create>: return -1; } static struct inode* create(char *path, short type, short major, short minor) { 80104720: 55 push %ebp 80104721: 89 e5 mov %esp,%ebp 80104723: 57 push %edi 80104724: 56 push %esi 80104725: 53 push %ebx 80104726: 83 ec 4c sub $0x4c,%esp 80104729: 89 4d c0 mov %ecx,-0x40(%ebp) 8010472c: 8b 4d 08 mov 0x8(%ebp),%ecx uint off; struct inode *ip, *dp; char name[DIRSIZ]; if((dp = nameiparent(path, name)) == 0) 8010472f: 8d 5d da lea -0x26(%ebp),%ebx 80104732: 89 5c 24 04 mov %ebx,0x4(%esp) 80104736: 89 04 24 mov %eax,(%esp) { 80104739: 89 55 c4 mov %edx,-0x3c(%ebp) 8010473c: 89 4d bc mov %ecx,-0x44(%ebp) if((dp = nameiparent(path, name)) == 0) 8010473f: e8 cc d7 ff ff call 80101f10 <nameiparent> 80104744: 85 c0 test %eax,%eax 80104746: 89 c7 mov %eax,%edi 80104748: 0f 84 da 00 00 00 je 80104828 <create+0x108> return 0; ilock(dp); 8010474e: 89 04 24 mov %eax,(%esp) 80104751: e8 4a cf ff ff call 801016a0 <ilock> if((ip = dirlookup(dp, name, &off)) != 0){ 80104756: 8d 45 d4 lea -0x2c(%ebp),%eax 80104759: 89 44 24 08 mov %eax,0x8(%esp) 8010475d: 89 5c 24 04 mov %ebx,0x4(%esp) 80104761: 89 3c 24 mov %edi,(%esp) 80104764: e8 47 d4 ff ff call 80101bb0 <dirlookup> 80104769: 85 c0 test %eax,%eax 8010476b: 89 c6 mov %eax,%esi 8010476d: 74 41 je 801047b0 <create+0x90> iunlockput(dp); 8010476f: 89 3c 24 mov %edi,(%esp) 80104772: e8 89 d1 ff ff call 80101900 <iunlockput> ilock(ip); 80104777: 89 34 24 mov %esi,(%esp) 8010477a: e8 21 cf ff ff call 801016a0 <ilock> if(type == T_FILE && ip->type == T_FILE) 8010477f: 66 83 7d c4 02 cmpw $0x2,-0x3c(%ebp) 80104784: 75 12 jne 80104798 <create+0x78> 80104786: 66 83 7e 50 02 cmpw $0x2,0x50(%esi) 8010478b: 89 f0 mov %esi,%eax 8010478d: 75 09 jne 80104798 <create+0x78> panic("create: dirlink"); iunlockput(dp); return ip; } 8010478f: 83 c4 4c add $0x4c,%esp 80104792: 5b pop %ebx 80104793: 5e pop %esi 80104794: 5f pop %edi 80104795: 5d pop %ebp 80104796: c3 ret 80104797: 90 nop iunlockput(ip); 80104798: 89 34 24 mov %esi,(%esp) 8010479b: e8 60 d1 ff ff call 80101900 <iunlockput> } 801047a0: 83 c4 4c add $0x4c,%esp return 0; 801047a3: 31 c0 xor %eax,%eax } 801047a5: 5b pop %ebx 801047a6: 5e pop %esi 801047a7: 5f pop %edi 801047a8: 5d pop %ebp 801047a9: c3 ret 801047aa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if((ip = ialloc(dp->dev, type)) == 0) 801047b0: 0f bf 45 c4 movswl -0x3c(%ebp),%eax 801047b4: 89 44 24 04 mov %eax,0x4(%esp) 801047b8: 8b 07 mov (%edi),%eax 801047ba: 89 04 24 mov %eax,(%esp) 801047bd: e8 4e cd ff ff call 80101510 <ialloc> 801047c2: 85 c0 test %eax,%eax 801047c4: 89 c6 mov %eax,%esi 801047c6: 0f 84 bf 00 00 00 je 8010488b <create+0x16b> ilock(ip); 801047cc: 89 04 24 mov %eax,(%esp) 801047cf: e8 cc ce ff ff call 801016a0 <ilock> ip->major = major; 801047d4: 0f b7 45 c0 movzwl -0x40(%ebp),%eax 801047d8: 66 89 46 52 mov %ax,0x52(%esi) ip->minor = minor; 801047dc: 0f b7 45 bc movzwl -0x44(%ebp),%eax 801047e0: 66 89 46 54 mov %ax,0x54(%esi) ip->nlink = 1; 801047e4: b8 01 00 00 00 mov $0x1,%eax 801047e9: 66 89 46 56 mov %ax,0x56(%esi) iupdate(ip); 801047ed: 89 34 24 mov %esi,(%esp) 801047f0: e8 eb cd ff ff call 801015e0 <iupdate> if(type == T_DIR){ // Create . and .. entries. 801047f5: 66 83 7d c4 01 cmpw $0x1,-0x3c(%ebp) 801047fa: 74 34 je 80104830 <create+0x110> if(dirlink(dp, name, ip->inum) < 0) 801047fc: 8b 46 04 mov 0x4(%esi),%eax 801047ff: 89 5c 24 04 mov %ebx,0x4(%esp) 80104803: 89 3c 24 mov %edi,(%esp) 80104806: 89 44 24 08 mov %eax,0x8(%esp) 8010480a: e8 01 d6 ff ff call 80101e10 <dirlink> 8010480f: 85 c0 test %eax,%eax 80104811: 78 6c js 8010487f <create+0x15f> iunlockput(dp); 80104813: 89 3c 24 mov %edi,(%esp) 80104816: e8 e5 d0 ff ff call 80101900 <iunlockput> } 8010481b: 83 c4 4c add $0x4c,%esp return ip; 8010481e: 89 f0 mov %esi,%eax } 80104820: 5b pop %ebx 80104821: 5e pop %esi 80104822: 5f pop %edi 80104823: 5d pop %ebp 80104824: c3 ret 80104825: 8d 76 00 lea 0x0(%esi),%esi return 0; 80104828: 31 c0 xor %eax,%eax 8010482a: e9 60 ff ff ff jmp 8010478f <create+0x6f> 8010482f: 90 nop dp->nlink++; // for ".." 80104830: 66 83 47 56 01 addw $0x1,0x56(%edi) iupdate(dp); 80104835: 89 3c 24 mov %edi,(%esp) 80104838: e8 a3 cd ff ff call 801015e0 <iupdate> if(dirlink(ip, ".", ip->inum) < 0 || dirlink(ip, "..", dp->inum) < 0) 8010483d: 8b 46 04 mov 0x4(%esi),%eax 80104840: c7 44 24 04 7c 75 10 movl $0x8010757c,0x4(%esp) 80104847: 80 80104848: 89 34 24 mov %esi,(%esp) 8010484b: 89 44 24 08 mov %eax,0x8(%esp) 8010484f: e8 bc d5 ff ff call 80101e10 <dirlink> 80104854: 85 c0 test %eax,%eax 80104856: 78 1b js 80104873 <create+0x153> 80104858: 8b 47 04 mov 0x4(%edi),%eax 8010485b: c7 44 24 04 7b 75 10 movl $0x8010757b,0x4(%esp) 80104862: 80 80104863: 89 34 24 mov %esi,(%esp) 80104866: 89 44 24 08 mov %eax,0x8(%esp) 8010486a: e8 a1 d5 ff ff call 80101e10 <dirlink> 8010486f: 85 c0 test %eax,%eax 80104871: 79 89 jns 801047fc <create+0xdc> panic("create dots"); 80104873: c7 04 24 6f 75 10 80 movl $0x8010756f,(%esp) 8010487a: e8 e1 ba ff ff call 80100360 <panic> panic("create: dirlink"); 8010487f: c7 04 24 7e 75 10 80 movl $0x8010757e,(%esp) 80104886: e8 d5 ba ff ff call 80100360 <panic> panic("create: ialloc"); 8010488b: c7 04 24 60 75 10 80 movl $0x80107560,(%esp) 80104892: e8 c9 ba ff ff call 80100360 <panic> 80104897: 89 f6 mov %esi,%esi 80104899: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801048a0 <argfd.constprop.0>: argfd(int n, int *pfd, struct file **pf) 801048a0: 55 push %ebp 801048a1: 89 e5 mov %esp,%ebp 801048a3: 56 push %esi 801048a4: 89 c6 mov %eax,%esi 801048a6: 53 push %ebx 801048a7: 89 d3 mov %edx,%ebx 801048a9: 83 ec 20 sub $0x20,%esp if(argint(n, &fd) < 0) 801048ac: 8d 45 f4 lea -0xc(%ebp),%eax 801048af: 89 44 24 04 mov %eax,0x4(%esp) 801048b3: c7 04 24 00 00 00 00 movl $0x0,(%esp) 801048ba: e8 e1 fc ff ff call 801045a0 <argint> 801048bf: 85 c0 test %eax,%eax 801048c1: 78 2d js 801048f0 <argfd.constprop.0+0x50> if(fd < 0 || fd >= NOFILE || (f=myproc()->ofile[fd]) == 0) 801048c3: 83 7d f4 0f cmpl $0xf,-0xc(%ebp) 801048c7: 77 27 ja 801048f0 <argfd.constprop.0+0x50> 801048c9: e8 c2 ed ff ff call 80103690 <myproc> 801048ce: 8b 55 f4 mov -0xc(%ebp),%edx 801048d1: 8b 44 90 30 mov 0x30(%eax,%edx,4),%eax 801048d5: 85 c0 test %eax,%eax 801048d7: 74 17 je 801048f0 <argfd.constprop.0+0x50> if(pfd) 801048d9: 85 f6 test %esi,%esi 801048db: 74 02 je 801048df <argfd.constprop.0+0x3f> *pfd = fd; 801048dd: 89 16 mov %edx,(%esi) if(pf) 801048df: 85 db test %ebx,%ebx 801048e1: 74 1d je 80104900 <argfd.constprop.0+0x60> *pf = f; 801048e3: 89 03 mov %eax,(%ebx) return 0; 801048e5: 31 c0 xor %eax,%eax } 801048e7: 83 c4 20 add $0x20,%esp 801048ea: 5b pop %ebx 801048eb: 5e pop %esi 801048ec: 5d pop %ebp 801048ed: c3 ret 801048ee: 66 90 xchg %ax,%ax 801048f0: 83 c4 20 add $0x20,%esp return -1; 801048f3: b8 ff ff ff ff mov $0xffffffff,%eax } 801048f8: 5b pop %ebx 801048f9: 5e pop %esi 801048fa: 5d pop %ebp 801048fb: c3 ret 801048fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return 0; 80104900: 31 c0 xor %eax,%eax 80104902: eb e3 jmp 801048e7 <argfd.constprop.0+0x47> 80104904: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010490a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80104910 <sys_dup>: { 80104910: 55 push %ebp if(argfd(0, 0, &f) < 0) 80104911: 31 c0 xor %eax,%eax { 80104913: 89 e5 mov %esp,%ebp 80104915: 53 push %ebx 80104916: 83 ec 24 sub $0x24,%esp if(argfd(0, 0, &f) < 0) 80104919: 8d 55 f4 lea -0xc(%ebp),%edx 8010491c: e8 7f ff ff ff call 801048a0 <argfd.constprop.0> 80104921: 85 c0 test %eax,%eax 80104923: 78 23 js 80104948 <sys_dup+0x38> if((fd=fdalloc(f)) < 0) 80104925: 8b 45 f4 mov -0xc(%ebp),%eax 80104928: e8 b3 fd ff ff call 801046e0 <fdalloc> 8010492d: 85 c0 test %eax,%eax 8010492f: 89 c3 mov %eax,%ebx 80104931: 78 15 js 80104948 <sys_dup+0x38> filedup(f); 80104933: 8b 45 f4 mov -0xc(%ebp),%eax 80104936: 89 04 24 mov %eax,(%esp) 80104939: e8 82 c4 ff ff call 80100dc0 <filedup> return fd; 8010493e: 89 d8 mov %ebx,%eax } 80104940: 83 c4 24 add $0x24,%esp 80104943: 5b pop %ebx 80104944: 5d pop %ebp 80104945: c3 ret 80104946: 66 90 xchg %ax,%ax return -1; 80104948: b8 ff ff ff ff mov $0xffffffff,%eax 8010494d: eb f1 jmp 80104940 <sys_dup+0x30> 8010494f: 90 nop 80104950 <sys_read>: { 80104950: 55 push %ebp if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) 80104951: 31 c0 xor %eax,%eax { 80104953: 89 e5 mov %esp,%ebp 80104955: 83 ec 28 sub $0x28,%esp if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) 80104958: 8d 55 ec lea -0x14(%ebp),%edx 8010495b: e8 40 ff ff ff call 801048a0 <argfd.constprop.0> 80104960: 85 c0 test %eax,%eax 80104962: 78 54 js 801049b8 <sys_read+0x68> 80104964: 8d 45 f0 lea -0x10(%ebp),%eax 80104967: 89 44 24 04 mov %eax,0x4(%esp) 8010496b: c7 04 24 02 00 00 00 movl $0x2,(%esp) 80104972: e8 29 fc ff ff call 801045a0 <argint> 80104977: 85 c0 test %eax,%eax 80104979: 78 3d js 801049b8 <sys_read+0x68> 8010497b: 8b 45 f0 mov -0x10(%ebp),%eax 8010497e: c7 04 24 01 00 00 00 movl $0x1,(%esp) 80104985: 89 44 24 08 mov %eax,0x8(%esp) 80104989: 8d 45 f4 lea -0xc(%ebp),%eax 8010498c: 89 44 24 04 mov %eax,0x4(%esp) 80104990: e8 3b fc ff ff call 801045d0 <argptr> 80104995: 85 c0 test %eax,%eax 80104997: 78 1f js 801049b8 <sys_read+0x68> return fileread(f, p, n); 80104999: 8b 45 f0 mov -0x10(%ebp),%eax 8010499c: 89 44 24 08 mov %eax,0x8(%esp) 801049a0: 8b 45 f4 mov -0xc(%ebp),%eax 801049a3: 89 44 24 04 mov %eax,0x4(%esp) 801049a7: 8b 45 ec mov -0x14(%ebp),%eax 801049aa: 89 04 24 mov %eax,(%esp) 801049ad: e8 6e c5 ff ff call 80100f20 <fileread> } 801049b2: c9 leave 801049b3: c3 ret 801049b4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; 801049b8: b8 ff ff ff ff mov $0xffffffff,%eax } 801049bd: c9 leave 801049be: c3 ret 801049bf: 90 nop 801049c0 <sys_write>: { 801049c0: 55 push %ebp if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) 801049c1: 31 c0 xor %eax,%eax { 801049c3: 89 e5 mov %esp,%ebp 801049c5: 83 ec 28 sub $0x28,%esp if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) 801049c8: 8d 55 ec lea -0x14(%ebp),%edx 801049cb: e8 d0 fe ff ff call 801048a0 <argfd.constprop.0> 801049d0: 85 c0 test %eax,%eax 801049d2: 78 54 js 80104a28 <sys_write+0x68> 801049d4: 8d 45 f0 lea -0x10(%ebp),%eax 801049d7: 89 44 24 04 mov %eax,0x4(%esp) 801049db: c7 04 24 02 00 00 00 movl $0x2,(%esp) 801049e2: e8 b9 fb ff ff call 801045a0 <argint> 801049e7: 85 c0 test %eax,%eax 801049e9: 78 3d js 80104a28 <sys_write+0x68> 801049eb: 8b 45 f0 mov -0x10(%ebp),%eax 801049ee: c7 04 24 01 00 00 00 movl $0x1,(%esp) 801049f5: 89 44 24 08 mov %eax,0x8(%esp) 801049f9: 8d 45 f4 lea -0xc(%ebp),%eax 801049fc: 89 44 24 04 mov %eax,0x4(%esp) 80104a00: e8 cb fb ff ff call 801045d0 <argptr> 80104a05: 85 c0 test %eax,%eax 80104a07: 78 1f js 80104a28 <sys_write+0x68> return filewrite(f, p, n); 80104a09: 8b 45 f0 mov -0x10(%ebp),%eax 80104a0c: 89 44 24 08 mov %eax,0x8(%esp) 80104a10: 8b 45 f4 mov -0xc(%ebp),%eax 80104a13: 89 44 24 04 mov %eax,0x4(%esp) 80104a17: 8b 45 ec mov -0x14(%ebp),%eax 80104a1a: 89 04 24 mov %eax,(%esp) 80104a1d: e8 9e c5 ff ff call 80100fc0 <filewrite> } 80104a22: c9 leave 80104a23: c3 ret 80104a24: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80104a28: b8 ff ff ff ff mov $0xffffffff,%eax } 80104a2d: c9 leave 80104a2e: c3 ret 80104a2f: 90 nop 80104a30 <sys_close>: { 80104a30: 55 push %ebp 80104a31: 89 e5 mov %esp,%ebp 80104a33: 83 ec 28 sub $0x28,%esp if(argfd(0, &fd, &f) < 0) 80104a36: 8d 55 f4 lea -0xc(%ebp),%edx 80104a39: 8d 45 f0 lea -0x10(%ebp),%eax 80104a3c: e8 5f fe ff ff call 801048a0 <argfd.constprop.0> 80104a41: 85 c0 test %eax,%eax 80104a43: 78 23 js 80104a68 <sys_close+0x38> myproc()->ofile[fd] = 0; 80104a45: e8 46 ec ff ff call 80103690 <myproc> 80104a4a: 8b 55 f0 mov -0x10(%ebp),%edx 80104a4d: c7 44 90 30 00 00 00 movl $0x0,0x30(%eax,%edx,4) 80104a54: 00 fileclose(f); 80104a55: 8b 45 f4 mov -0xc(%ebp),%eax 80104a58: 89 04 24 mov %eax,(%esp) 80104a5b: e8 b0 c3 ff ff call 80100e10 <fileclose> return 0; 80104a60: 31 c0 xor %eax,%eax } 80104a62: c9 leave 80104a63: c3 ret 80104a64: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80104a68: b8 ff ff ff ff mov $0xffffffff,%eax } 80104a6d: c9 leave 80104a6e: c3 ret 80104a6f: 90 nop 80104a70 <sys_fstat>: { 80104a70: 55 push %ebp if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0) 80104a71: 31 c0 xor %eax,%eax { 80104a73: 89 e5 mov %esp,%ebp 80104a75: 83 ec 28 sub $0x28,%esp if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0) 80104a78: 8d 55 f0 lea -0x10(%ebp),%edx 80104a7b: e8 20 fe ff ff call 801048a0 <argfd.constprop.0> 80104a80: 85 c0 test %eax,%eax 80104a82: 78 34 js 80104ab8 <sys_fstat+0x48> 80104a84: 8d 45 f4 lea -0xc(%ebp),%eax 80104a87: c7 44 24 08 14 00 00 movl $0x14,0x8(%esp) 80104a8e: 00 80104a8f: 89 44 24 04 mov %eax,0x4(%esp) 80104a93: c7 04 24 01 00 00 00 movl $0x1,(%esp) 80104a9a: e8 31 fb ff ff call 801045d0 <argptr> 80104a9f: 85 c0 test %eax,%eax 80104aa1: 78 15 js 80104ab8 <sys_fstat+0x48> return filestat(f, st); 80104aa3: 8b 45 f4 mov -0xc(%ebp),%eax 80104aa6: 89 44 24 04 mov %eax,0x4(%esp) 80104aaa: 8b 45 f0 mov -0x10(%ebp),%eax 80104aad: 89 04 24 mov %eax,(%esp) 80104ab0: e8 1b c4 ff ff call 80100ed0 <filestat> } 80104ab5: c9 leave 80104ab6: c3 ret 80104ab7: 90 nop return -1; 80104ab8: b8 ff ff ff ff mov $0xffffffff,%eax } 80104abd: c9 leave 80104abe: c3 ret 80104abf: 90 nop 80104ac0 <sys_link>: { 80104ac0: 55 push %ebp 80104ac1: 89 e5 mov %esp,%ebp 80104ac3: 57 push %edi 80104ac4: 56 push %esi 80104ac5: 53 push %ebx 80104ac6: 83 ec 3c sub $0x3c,%esp if(argstr(0, &old) < 0 || argstr(1, &new) < 0) 80104ac9: 8d 45 d4 lea -0x2c(%ebp),%eax 80104acc: 89 44 24 04 mov %eax,0x4(%esp) 80104ad0: c7 04 24 00 00 00 00 movl $0x0,(%esp) 80104ad7: e8 54 fb ff ff call 80104630 <argstr> 80104adc: 85 c0 test %eax,%eax 80104ade: 0f 88 e6 00 00 00 js 80104bca <sys_link+0x10a> 80104ae4: 8d 45 d0 lea -0x30(%ebp),%eax 80104ae7: 89 44 24 04 mov %eax,0x4(%esp) 80104aeb: c7 04 24 01 00 00 00 movl $0x1,(%esp) 80104af2: e8 39 fb ff ff call 80104630 <argstr> 80104af7: 85 c0 test %eax,%eax 80104af9: 0f 88 cb 00 00 00 js 80104bca <sys_link+0x10a> begin_op(); 80104aff: e8 fc df ff ff call 80102b00 <begin_op> if((ip = namei(old)) == 0){ 80104b04: 8b 45 d4 mov -0x2c(%ebp),%eax 80104b07: 89 04 24 mov %eax,(%esp) 80104b0a: e8 e1 d3 ff ff call 80101ef0 <namei> 80104b0f: 85 c0 test %eax,%eax 80104b11: 89 c3 mov %eax,%ebx 80104b13: 0f 84 ac 00 00 00 je 80104bc5 <sys_link+0x105> ilock(ip); 80104b19: 89 04 24 mov %eax,(%esp) 80104b1c: e8 7f cb ff ff call 801016a0 <ilock> if(ip->type == T_DIR){ 80104b21: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80104b26: 0f 84 91 00 00 00 je 80104bbd <sys_link+0xfd> ip->nlink++; 80104b2c: 66 83 43 56 01 addw $0x1,0x56(%ebx) if((dp = nameiparent(new, name)) == 0) 80104b31: 8d 7d da lea -0x26(%ebp),%edi iupdate(ip); 80104b34: 89 1c 24 mov %ebx,(%esp) 80104b37: e8 a4 ca ff ff call 801015e0 <iupdate> iunlock(ip); 80104b3c: 89 1c 24 mov %ebx,(%esp) 80104b3f: e8 3c cc ff ff call 80101780 <iunlock> if((dp = nameiparent(new, name)) == 0) 80104b44: 8b 45 d0 mov -0x30(%ebp),%eax 80104b47: 89 7c 24 04 mov %edi,0x4(%esp) 80104b4b: 89 04 24 mov %eax,(%esp) 80104b4e: e8 bd d3 ff ff call 80101f10 <nameiparent> 80104b53: 85 c0 test %eax,%eax 80104b55: 89 c6 mov %eax,%esi 80104b57: 74 4f je 80104ba8 <sys_link+0xe8> ilock(dp); 80104b59: 89 04 24 mov %eax,(%esp) 80104b5c: e8 3f cb ff ff call 801016a0 <ilock> if(dp->dev != ip->dev || dirlink(dp, name, ip->inum) < 0){ 80104b61: 8b 03 mov (%ebx),%eax 80104b63: 39 06 cmp %eax,(%esi) 80104b65: 75 39 jne 80104ba0 <sys_link+0xe0> 80104b67: 8b 43 04 mov 0x4(%ebx),%eax 80104b6a: 89 7c 24 04 mov %edi,0x4(%esp) 80104b6e: 89 34 24 mov %esi,(%esp) 80104b71: 89 44 24 08 mov %eax,0x8(%esp) 80104b75: e8 96 d2 ff ff call 80101e10 <dirlink> 80104b7a: 85 c0 test %eax,%eax 80104b7c: 78 22 js 80104ba0 <sys_link+0xe0> iunlockput(dp); 80104b7e: 89 34 24 mov %esi,(%esp) 80104b81: e8 7a cd ff ff call 80101900 <iunlockput> iput(ip); 80104b86: 89 1c 24 mov %ebx,(%esp) 80104b89: e8 32 cc ff ff call 801017c0 <iput> end_op(); 80104b8e: e8 dd df ff ff call 80102b70 <end_op> } 80104b93: 83 c4 3c add $0x3c,%esp return 0; 80104b96: 31 c0 xor %eax,%eax } 80104b98: 5b pop %ebx 80104b99: 5e pop %esi 80104b9a: 5f pop %edi 80104b9b: 5d pop %ebp 80104b9c: c3 ret 80104b9d: 8d 76 00 lea 0x0(%esi),%esi iunlockput(dp); 80104ba0: 89 34 24 mov %esi,(%esp) 80104ba3: e8 58 cd ff ff call 80101900 <iunlockput> ilock(ip); 80104ba8: 89 1c 24 mov %ebx,(%esp) 80104bab: e8 f0 ca ff ff call 801016a0 <ilock> ip->nlink--; 80104bb0: 66 83 6b 56 01 subw $0x1,0x56(%ebx) iupdate(ip); 80104bb5: 89 1c 24 mov %ebx,(%esp) 80104bb8: e8 23 ca ff ff call 801015e0 <iupdate> iunlockput(ip); 80104bbd: 89 1c 24 mov %ebx,(%esp) 80104bc0: e8 3b cd ff ff call 80101900 <iunlockput> end_op(); 80104bc5: e8 a6 df ff ff call 80102b70 <end_op> } 80104bca: 83 c4 3c add $0x3c,%esp return -1; 80104bcd: b8 ff ff ff ff mov $0xffffffff,%eax } 80104bd2: 5b pop %ebx 80104bd3: 5e pop %esi 80104bd4: 5f pop %edi 80104bd5: 5d pop %ebp 80104bd6: c3 ret 80104bd7: 89 f6 mov %esi,%esi 80104bd9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104be0 <sys_unlink>: { 80104be0: 55 push %ebp 80104be1: 89 e5 mov %esp,%ebp 80104be3: 57 push %edi 80104be4: 56 push %esi 80104be5: 53 push %ebx 80104be6: 83 ec 5c sub $0x5c,%esp if(argstr(0, &path) < 0) 80104be9: 8d 45 c0 lea -0x40(%ebp),%eax 80104bec: 89 44 24 04 mov %eax,0x4(%esp) 80104bf0: c7 04 24 00 00 00 00 movl $0x0,(%esp) 80104bf7: e8 34 fa ff ff call 80104630 <argstr> 80104bfc: 85 c0 test %eax,%eax 80104bfe: 0f 88 76 01 00 00 js 80104d7a <sys_unlink+0x19a> begin_op(); 80104c04: e8 f7 de ff ff call 80102b00 <begin_op> if((dp = nameiparent(path, name)) == 0){ 80104c09: 8b 45 c0 mov -0x40(%ebp),%eax 80104c0c: 8d 5d ca lea -0x36(%ebp),%ebx 80104c0f: 89 5c 24 04 mov %ebx,0x4(%esp) 80104c13: 89 04 24 mov %eax,(%esp) 80104c16: e8 f5 d2 ff ff call 80101f10 <nameiparent> 80104c1b: 85 c0 test %eax,%eax 80104c1d: 89 45 b4 mov %eax,-0x4c(%ebp) 80104c20: 0f 84 4f 01 00 00 je 80104d75 <sys_unlink+0x195> ilock(dp); 80104c26: 8b 75 b4 mov -0x4c(%ebp),%esi 80104c29: 89 34 24 mov %esi,(%esp) 80104c2c: e8 6f ca ff ff call 801016a0 <ilock> if(namecmp(name, ".") == 0 || namecmp(name, "..") == 0) 80104c31: c7 44 24 04 7c 75 10 movl $0x8010757c,0x4(%esp) 80104c38: 80 80104c39: 89 1c 24 mov %ebx,(%esp) 80104c3c: e8 3f cf ff ff call 80101b80 <namecmp> 80104c41: 85 c0 test %eax,%eax 80104c43: 0f 84 21 01 00 00 je 80104d6a <sys_unlink+0x18a> 80104c49: c7 44 24 04 7b 75 10 movl $0x8010757b,0x4(%esp) 80104c50: 80 80104c51: 89 1c 24 mov %ebx,(%esp) 80104c54: e8 27 cf ff ff call 80101b80 <namecmp> 80104c59: 85 c0 test %eax,%eax 80104c5b: 0f 84 09 01 00 00 je 80104d6a <sys_unlink+0x18a> if((ip = dirlookup(dp, name, &off)) == 0) 80104c61: 8d 45 c4 lea -0x3c(%ebp),%eax 80104c64: 89 5c 24 04 mov %ebx,0x4(%esp) 80104c68: 89 44 24 08 mov %eax,0x8(%esp) 80104c6c: 89 34 24 mov %esi,(%esp) 80104c6f: e8 3c cf ff ff call 80101bb0 <dirlookup> 80104c74: 85 c0 test %eax,%eax 80104c76: 89 c3 mov %eax,%ebx 80104c78: 0f 84 ec 00 00 00 je 80104d6a <sys_unlink+0x18a> ilock(ip); 80104c7e: 89 04 24 mov %eax,(%esp) 80104c81: e8 1a ca ff ff call 801016a0 <ilock> if(ip->nlink < 1) 80104c86: 66 83 7b 56 00 cmpw $0x0,0x56(%ebx) 80104c8b: 0f 8e 24 01 00 00 jle 80104db5 <sys_unlink+0x1d5> if(ip->type == T_DIR && !isdirempty(ip)){ 80104c91: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80104c96: 8d 75 d8 lea -0x28(%ebp),%esi 80104c99: 74 7d je 80104d18 <sys_unlink+0x138> memset(&de, 0, sizeof(de)); 80104c9b: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp) 80104ca2: 00 80104ca3: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 80104caa: 00 80104cab: 89 34 24 mov %esi,(%esp) 80104cae: e8 fd f5 ff ff call 801042b0 <memset> if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80104cb3: 8b 45 c4 mov -0x3c(%ebp),%eax 80104cb6: c7 44 24 0c 10 00 00 movl $0x10,0xc(%esp) 80104cbd: 00 80104cbe: 89 74 24 04 mov %esi,0x4(%esp) 80104cc2: 89 44 24 08 mov %eax,0x8(%esp) 80104cc6: 8b 45 b4 mov -0x4c(%ebp),%eax 80104cc9: 89 04 24 mov %eax,(%esp) 80104ccc: e8 7f cd ff ff call 80101a50 <writei> 80104cd1: 83 f8 10 cmp $0x10,%eax 80104cd4: 0f 85 cf 00 00 00 jne 80104da9 <sys_unlink+0x1c9> if(ip->type == T_DIR){ 80104cda: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80104cdf: 0f 84 a3 00 00 00 je 80104d88 <sys_unlink+0x1a8> iunlockput(dp); 80104ce5: 8b 45 b4 mov -0x4c(%ebp),%eax 80104ce8: 89 04 24 mov %eax,(%esp) 80104ceb: e8 10 cc ff ff call 80101900 <iunlockput> ip->nlink--; 80104cf0: 66 83 6b 56 01 subw $0x1,0x56(%ebx) iupdate(ip); 80104cf5: 89 1c 24 mov %ebx,(%esp) 80104cf8: e8 e3 c8 ff ff call 801015e0 <iupdate> iunlockput(ip); 80104cfd: 89 1c 24 mov %ebx,(%esp) 80104d00: e8 fb cb ff ff call 80101900 <iunlockput> end_op(); 80104d05: e8 66 de ff ff call 80102b70 <end_op> } 80104d0a: 83 c4 5c add $0x5c,%esp return 0; 80104d0d: 31 c0 xor %eax,%eax } 80104d0f: 5b pop %ebx 80104d10: 5e pop %esi 80104d11: 5f pop %edi 80104d12: 5d pop %ebp 80104d13: c3 ret 80104d14: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(off=2*sizeof(de); off<dp->size; off+=sizeof(de)){ 80104d18: 83 7b 58 20 cmpl $0x20,0x58(%ebx) 80104d1c: 0f 86 79 ff ff ff jbe 80104c9b <sys_unlink+0xbb> 80104d22: bf 20 00 00 00 mov $0x20,%edi 80104d27: eb 15 jmp 80104d3e <sys_unlink+0x15e> 80104d29: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104d30: 8d 57 10 lea 0x10(%edi),%edx 80104d33: 3b 53 58 cmp 0x58(%ebx),%edx 80104d36: 0f 83 5f ff ff ff jae 80104c9b <sys_unlink+0xbb> 80104d3c: 89 d7 mov %edx,%edi if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80104d3e: c7 44 24 0c 10 00 00 movl $0x10,0xc(%esp) 80104d45: 00 80104d46: 89 7c 24 08 mov %edi,0x8(%esp) 80104d4a: 89 74 24 04 mov %esi,0x4(%esp) 80104d4e: 89 1c 24 mov %ebx,(%esp) 80104d51: e8 fa cb ff ff call 80101950 <readi> 80104d56: 83 f8 10 cmp $0x10,%eax 80104d59: 75 42 jne 80104d9d <sys_unlink+0x1bd> if(de.inum != 0) 80104d5b: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp) 80104d60: 74 ce je 80104d30 <sys_unlink+0x150> iunlockput(ip); 80104d62: 89 1c 24 mov %ebx,(%esp) 80104d65: e8 96 cb ff ff call 80101900 <iunlockput> iunlockput(dp); 80104d6a: 8b 45 b4 mov -0x4c(%ebp),%eax 80104d6d: 89 04 24 mov %eax,(%esp) 80104d70: e8 8b cb ff ff call 80101900 <iunlockput> end_op(); 80104d75: e8 f6 dd ff ff call 80102b70 <end_op> } 80104d7a: 83 c4 5c add $0x5c,%esp return -1; 80104d7d: b8 ff ff ff ff mov $0xffffffff,%eax } 80104d82: 5b pop %ebx 80104d83: 5e pop %esi 80104d84: 5f pop %edi 80104d85: 5d pop %ebp 80104d86: c3 ret 80104d87: 90 nop dp->nlink--; 80104d88: 8b 45 b4 mov -0x4c(%ebp),%eax 80104d8b: 66 83 68 56 01 subw $0x1,0x56(%eax) iupdate(dp); 80104d90: 89 04 24 mov %eax,(%esp) 80104d93: e8 48 c8 ff ff call 801015e0 <iupdate> 80104d98: e9 48 ff ff ff jmp 80104ce5 <sys_unlink+0x105> panic("isdirempty: readi"); 80104d9d: c7 04 24 a0 75 10 80 movl $0x801075a0,(%esp) 80104da4: e8 b7 b5 ff ff call 80100360 <panic> panic("unlink: writei"); 80104da9: c7 04 24 b2 75 10 80 movl $0x801075b2,(%esp) 80104db0: e8 ab b5 ff ff call 80100360 <panic> panic("unlink: nlink < 1"); 80104db5: c7 04 24 8e 75 10 80 movl $0x8010758e,(%esp) 80104dbc: e8 9f b5 ff ff call 80100360 <panic> 80104dc1: eb 0d jmp 80104dd0 <sys_open> 80104dc3: 90 nop 80104dc4: 90 nop 80104dc5: 90 nop 80104dc6: 90 nop 80104dc7: 90 nop 80104dc8: 90 nop 80104dc9: 90 nop 80104dca: 90 nop 80104dcb: 90 nop 80104dcc: 90 nop 80104dcd: 90 nop 80104dce: 90 nop 80104dcf: 90 nop 80104dd0 <sys_open>: int sys_open(void) { 80104dd0: 55 push %ebp 80104dd1: 89 e5 mov %esp,%ebp 80104dd3: 57 push %edi 80104dd4: 56 push %esi 80104dd5: 53 push %ebx 80104dd6: 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) 80104dd9: 8d 45 e0 lea -0x20(%ebp),%eax 80104ddc: 89 44 24 04 mov %eax,0x4(%esp) 80104de0: c7 04 24 00 00 00 00 movl $0x0,(%esp) 80104de7: e8 44 f8 ff ff call 80104630 <argstr> 80104dec: 85 c0 test %eax,%eax 80104dee: 0f 88 d1 00 00 00 js 80104ec5 <sys_open+0xf5> 80104df4: 8d 45 e4 lea -0x1c(%ebp),%eax 80104df7: 89 44 24 04 mov %eax,0x4(%esp) 80104dfb: c7 04 24 01 00 00 00 movl $0x1,(%esp) 80104e02: e8 99 f7 ff ff call 801045a0 <argint> 80104e07: 85 c0 test %eax,%eax 80104e09: 0f 88 b6 00 00 00 js 80104ec5 <sys_open+0xf5> return -1; begin_op(); 80104e0f: e8 ec dc ff ff call 80102b00 <begin_op> if(omode & O_CREATE){ 80104e14: f6 45 e5 02 testb $0x2,-0x1b(%ebp) 80104e18: 0f 85 82 00 00 00 jne 80104ea0 <sys_open+0xd0> if(ip == 0){ end_op(); return -1; } } else { if((ip = namei(path)) == 0){ 80104e1e: 8b 45 e0 mov -0x20(%ebp),%eax 80104e21: 89 04 24 mov %eax,(%esp) 80104e24: e8 c7 d0 ff ff call 80101ef0 <namei> 80104e29: 85 c0 test %eax,%eax 80104e2b: 89 c6 mov %eax,%esi 80104e2d: 0f 84 8d 00 00 00 je 80104ec0 <sys_open+0xf0> end_op(); return -1; } ilock(ip); 80104e33: 89 04 24 mov %eax,(%esp) 80104e36: e8 65 c8 ff ff call 801016a0 <ilock> if(ip->type == T_DIR && omode != O_RDONLY){ 80104e3b: 66 83 7e 50 01 cmpw $0x1,0x50(%esi) 80104e40: 0f 84 92 00 00 00 je 80104ed8 <sys_open+0x108> end_op(); return -1; } } if((f = filealloc()) == 0 || (fd = fdalloc(f)) < 0){ 80104e46: e8 05 bf ff ff call 80100d50 <filealloc> 80104e4b: 85 c0 test %eax,%eax 80104e4d: 89 c3 mov %eax,%ebx 80104e4f: 0f 84 93 00 00 00 je 80104ee8 <sys_open+0x118> 80104e55: e8 86 f8 ff ff call 801046e0 <fdalloc> 80104e5a: 85 c0 test %eax,%eax 80104e5c: 89 c7 mov %eax,%edi 80104e5e: 0f 88 94 00 00 00 js 80104ef8 <sys_open+0x128> fileclose(f); iunlockput(ip); end_op(); return -1; } iunlock(ip); 80104e64: 89 34 24 mov %esi,(%esp) 80104e67: e8 14 c9 ff ff call 80101780 <iunlock> end_op(); 80104e6c: e8 ff dc ff ff call 80102b70 <end_op> f->type = FD_INODE; 80104e71: c7 03 02 00 00 00 movl $0x2,(%ebx) f->ip = ip; f->off = 0; f->readable = !(omode & O_WRONLY); 80104e77: 8b 45 e4 mov -0x1c(%ebp),%eax f->ip = ip; 80104e7a: 89 73 10 mov %esi,0x10(%ebx) f->off = 0; 80104e7d: c7 43 14 00 00 00 00 movl $0x0,0x14(%ebx) f->readable = !(omode & O_WRONLY); 80104e84: 89 c2 mov %eax,%edx 80104e86: 83 e2 01 and $0x1,%edx 80104e89: 83 f2 01 xor $0x1,%edx f->writable = (omode & O_WRONLY) || (omode & O_RDWR); 80104e8c: a8 03 test $0x3,%al f->readable = !(omode & O_WRONLY); 80104e8e: 88 53 08 mov %dl,0x8(%ebx) return fd; 80104e91: 89 f8 mov %edi,%eax f->writable = (omode & O_WRONLY) || (omode & O_RDWR); 80104e93: 0f 95 43 09 setne 0x9(%ebx) } 80104e97: 83 c4 2c add $0x2c,%esp 80104e9a: 5b pop %ebx 80104e9b: 5e pop %esi 80104e9c: 5f pop %edi 80104e9d: 5d pop %ebp 80104e9e: c3 ret 80104e9f: 90 nop ip = create(path, T_FILE, 0, 0); 80104ea0: 8b 45 e0 mov -0x20(%ebp),%eax 80104ea3: 31 c9 xor %ecx,%ecx 80104ea5: ba 02 00 00 00 mov $0x2,%edx 80104eaa: c7 04 24 00 00 00 00 movl $0x0,(%esp) 80104eb1: e8 6a f8 ff ff call 80104720 <create> if(ip == 0){ 80104eb6: 85 c0 test %eax,%eax ip = create(path, T_FILE, 0, 0); 80104eb8: 89 c6 mov %eax,%esi if(ip == 0){ 80104eba: 75 8a jne 80104e46 <sys_open+0x76> 80104ebc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi end_op(); 80104ec0: e8 ab dc ff ff call 80102b70 <end_op> } 80104ec5: 83 c4 2c add $0x2c,%esp return -1; 80104ec8: b8 ff ff ff ff mov $0xffffffff,%eax } 80104ecd: 5b pop %ebx 80104ece: 5e pop %esi 80104ecf: 5f pop %edi 80104ed0: 5d pop %ebp 80104ed1: c3 ret 80104ed2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(ip->type == T_DIR && omode != O_RDONLY){ 80104ed8: 8b 45 e4 mov -0x1c(%ebp),%eax 80104edb: 85 c0 test %eax,%eax 80104edd: 0f 84 63 ff ff ff je 80104e46 <sys_open+0x76> 80104ee3: 90 nop 80104ee4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi iunlockput(ip); 80104ee8: 89 34 24 mov %esi,(%esp) 80104eeb: e8 10 ca ff ff call 80101900 <iunlockput> 80104ef0: eb ce jmp 80104ec0 <sys_open+0xf0> 80104ef2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi fileclose(f); 80104ef8: 89 1c 24 mov %ebx,(%esp) 80104efb: e8 10 bf ff ff call 80100e10 <fileclose> 80104f00: eb e6 jmp 80104ee8 <sys_open+0x118> 80104f02: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104f09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104f10 <sys_mkdir>: int sys_mkdir(void) { 80104f10: 55 push %ebp 80104f11: 89 e5 mov %esp,%ebp 80104f13: 83 ec 28 sub $0x28,%esp char *path; struct inode *ip; begin_op(); 80104f16: e8 e5 db ff ff call 80102b00 <begin_op> if(argstr(0, &path) < 0 || (ip = create(path, T_DIR, 0, 0)) == 0){ 80104f1b: 8d 45 f4 lea -0xc(%ebp),%eax 80104f1e: 89 44 24 04 mov %eax,0x4(%esp) 80104f22: c7 04 24 00 00 00 00 movl $0x0,(%esp) 80104f29: e8 02 f7 ff ff call 80104630 <argstr> 80104f2e: 85 c0 test %eax,%eax 80104f30: 78 2e js 80104f60 <sys_mkdir+0x50> 80104f32: 8b 45 f4 mov -0xc(%ebp),%eax 80104f35: 31 c9 xor %ecx,%ecx 80104f37: ba 01 00 00 00 mov $0x1,%edx 80104f3c: c7 04 24 00 00 00 00 movl $0x0,(%esp) 80104f43: e8 d8 f7 ff ff call 80104720 <create> 80104f48: 85 c0 test %eax,%eax 80104f4a: 74 14 je 80104f60 <sys_mkdir+0x50> end_op(); return -1; } iunlockput(ip); 80104f4c: 89 04 24 mov %eax,(%esp) 80104f4f: e8 ac c9 ff ff call 80101900 <iunlockput> end_op(); 80104f54: e8 17 dc ff ff call 80102b70 <end_op> return 0; 80104f59: 31 c0 xor %eax,%eax } 80104f5b: c9 leave 80104f5c: c3 ret 80104f5d: 8d 76 00 lea 0x0(%esi),%esi end_op(); 80104f60: e8 0b dc ff ff call 80102b70 <end_op> return -1; 80104f65: b8 ff ff ff ff mov $0xffffffff,%eax } 80104f6a: c9 leave 80104f6b: c3 ret 80104f6c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104f70 <sys_mknod>: int sys_mknod(void) { 80104f70: 55 push %ebp 80104f71: 89 e5 mov %esp,%ebp 80104f73: 83 ec 28 sub $0x28,%esp struct inode *ip; char *path; int major, minor; begin_op(); 80104f76: e8 85 db ff ff call 80102b00 <begin_op> if((argstr(0, &path)) < 0 || 80104f7b: 8d 45 ec lea -0x14(%ebp),%eax 80104f7e: 89 44 24 04 mov %eax,0x4(%esp) 80104f82: c7 04 24 00 00 00 00 movl $0x0,(%esp) 80104f89: e8 a2 f6 ff ff call 80104630 <argstr> 80104f8e: 85 c0 test %eax,%eax 80104f90: 78 5e js 80104ff0 <sys_mknod+0x80> argint(1, &major) < 0 || 80104f92: 8d 45 f0 lea -0x10(%ebp),%eax 80104f95: 89 44 24 04 mov %eax,0x4(%esp) 80104f99: c7 04 24 01 00 00 00 movl $0x1,(%esp) 80104fa0: e8 fb f5 ff ff call 801045a0 <argint> if((argstr(0, &path)) < 0 || 80104fa5: 85 c0 test %eax,%eax 80104fa7: 78 47 js 80104ff0 <sys_mknod+0x80> argint(2, &minor) < 0 || 80104fa9: 8d 45 f4 lea -0xc(%ebp),%eax 80104fac: 89 44 24 04 mov %eax,0x4(%esp) 80104fb0: c7 04 24 02 00 00 00 movl $0x2,(%esp) 80104fb7: e8 e4 f5 ff ff call 801045a0 <argint> argint(1, &major) < 0 || 80104fbc: 85 c0 test %eax,%eax 80104fbe: 78 30 js 80104ff0 <sys_mknod+0x80> (ip = create(path, T_DEV, major, minor)) == 0){ 80104fc0: 0f bf 45 f4 movswl -0xc(%ebp),%eax argint(2, &minor) < 0 || 80104fc4: ba 03 00 00 00 mov $0x3,%edx (ip = create(path, T_DEV, major, minor)) == 0){ 80104fc9: 0f bf 4d f0 movswl -0x10(%ebp),%ecx 80104fcd: 89 04 24 mov %eax,(%esp) argint(2, &minor) < 0 || 80104fd0: 8b 45 ec mov -0x14(%ebp),%eax 80104fd3: e8 48 f7 ff ff call 80104720 <create> 80104fd8: 85 c0 test %eax,%eax 80104fda: 74 14 je 80104ff0 <sys_mknod+0x80> end_op(); return -1; } iunlockput(ip); 80104fdc: 89 04 24 mov %eax,(%esp) 80104fdf: e8 1c c9 ff ff call 80101900 <iunlockput> end_op(); 80104fe4: e8 87 db ff ff call 80102b70 <end_op> return 0; 80104fe9: 31 c0 xor %eax,%eax } 80104feb: c9 leave 80104fec: c3 ret 80104fed: 8d 76 00 lea 0x0(%esi),%esi end_op(); 80104ff0: e8 7b db ff ff call 80102b70 <end_op> return -1; 80104ff5: b8 ff ff ff ff mov $0xffffffff,%eax } 80104ffa: c9 leave 80104ffb: c3 ret 80104ffc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105000 <sys_chdir>: int sys_chdir(void) { 80105000: 55 push %ebp 80105001: 89 e5 mov %esp,%ebp 80105003: 56 push %esi 80105004: 53 push %ebx 80105005: 83 ec 20 sub $0x20,%esp char *path; struct inode *ip; struct proc *curproc = myproc(); 80105008: e8 83 e6 ff ff call 80103690 <myproc> 8010500d: 89 c6 mov %eax,%esi begin_op(); 8010500f: e8 ec da ff ff call 80102b00 <begin_op> if(argstr(0, &path) < 0 || (ip = namei(path)) == 0){ 80105014: 8d 45 f4 lea -0xc(%ebp),%eax 80105017: 89 44 24 04 mov %eax,0x4(%esp) 8010501b: c7 04 24 00 00 00 00 movl $0x0,(%esp) 80105022: e8 09 f6 ff ff call 80104630 <argstr> 80105027: 85 c0 test %eax,%eax 80105029: 78 4a js 80105075 <sys_chdir+0x75> 8010502b: 8b 45 f4 mov -0xc(%ebp),%eax 8010502e: 89 04 24 mov %eax,(%esp) 80105031: e8 ba ce ff ff call 80101ef0 <namei> 80105036: 85 c0 test %eax,%eax 80105038: 89 c3 mov %eax,%ebx 8010503a: 74 39 je 80105075 <sys_chdir+0x75> end_op(); return -1; } ilock(ip); 8010503c: 89 04 24 mov %eax,(%esp) 8010503f: e8 5c c6 ff ff call 801016a0 <ilock> if(ip->type != T_DIR){ 80105044: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) iunlockput(ip); 80105049: 89 1c 24 mov %ebx,(%esp) if(ip->type != T_DIR){ 8010504c: 75 22 jne 80105070 <sys_chdir+0x70> end_op(); return -1; } iunlock(ip); 8010504e: e8 2d c7 ff ff call 80101780 <iunlock> iput(curproc->cwd); 80105053: 8b 46 70 mov 0x70(%esi),%eax 80105056: 89 04 24 mov %eax,(%esp) 80105059: e8 62 c7 ff ff call 801017c0 <iput> end_op(); 8010505e: e8 0d db ff ff call 80102b70 <end_op> curproc->cwd = ip; return 0; 80105063: 31 c0 xor %eax,%eax curproc->cwd = ip; 80105065: 89 5e 70 mov %ebx,0x70(%esi) } 80105068: 83 c4 20 add $0x20,%esp 8010506b: 5b pop %ebx 8010506c: 5e pop %esi 8010506d: 5d pop %ebp 8010506e: c3 ret 8010506f: 90 nop iunlockput(ip); 80105070: e8 8b c8 ff ff call 80101900 <iunlockput> end_op(); 80105075: e8 f6 da ff ff call 80102b70 <end_op> } 8010507a: 83 c4 20 add $0x20,%esp return -1; 8010507d: b8 ff ff ff ff mov $0xffffffff,%eax } 80105082: 5b pop %ebx 80105083: 5e pop %esi 80105084: 5d pop %ebp 80105085: c3 ret 80105086: 8d 76 00 lea 0x0(%esi),%esi 80105089: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105090 <sys_exec>: int sys_exec(void) { 80105090: 55 push %ebp 80105091: 89 e5 mov %esp,%ebp 80105093: 57 push %edi 80105094: 56 push %esi 80105095: 53 push %ebx 80105096: 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){ 8010509c: 8d 85 5c ff ff ff lea -0xa4(%ebp),%eax 801050a2: 89 44 24 04 mov %eax,0x4(%esp) 801050a6: c7 04 24 00 00 00 00 movl $0x0,(%esp) 801050ad: e8 7e f5 ff ff call 80104630 <argstr> 801050b2: 85 c0 test %eax,%eax 801050b4: 0f 88 84 00 00 00 js 8010513e <sys_exec+0xae> 801050ba: 8d 85 60 ff ff ff lea -0xa0(%ebp),%eax 801050c0: 89 44 24 04 mov %eax,0x4(%esp) 801050c4: c7 04 24 01 00 00 00 movl $0x1,(%esp) 801050cb: e8 d0 f4 ff ff call 801045a0 <argint> 801050d0: 85 c0 test %eax,%eax 801050d2: 78 6a js 8010513e <sys_exec+0xae> return -1; } memset(argv, 0, sizeof(argv)); 801050d4: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax for(i=0;; i++){ 801050da: 31 db xor %ebx,%ebx memset(argv, 0, sizeof(argv)); 801050dc: c7 44 24 08 80 00 00 movl $0x80,0x8(%esp) 801050e3: 00 801050e4: 8d b5 68 ff ff ff lea -0x98(%ebp),%esi 801050ea: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 801050f1: 00 801050f2: 8d bd 64 ff ff ff lea -0x9c(%ebp),%edi 801050f8: 89 04 24 mov %eax,(%esp) 801050fb: e8 b0 f1 ff ff call 801042b0 <memset> if(i >= NELEM(argv)) return -1; if(fetchint(uargv+4*i, (int*)&uarg) < 0) 80105100: 8b 85 60 ff ff ff mov -0xa0(%ebp),%eax 80105106: 89 7c 24 04 mov %edi,0x4(%esp) 8010510a: 8d 04 98 lea (%eax,%ebx,4),%eax 8010510d: 89 04 24 mov %eax,(%esp) 80105110: e8 eb f3 ff ff call 80104500 <fetchint> 80105115: 85 c0 test %eax,%eax 80105117: 78 25 js 8010513e <sys_exec+0xae> return -1; if(uarg == 0){ 80105119: 8b 85 64 ff ff ff mov -0x9c(%ebp),%eax 8010511f: 85 c0 test %eax,%eax 80105121: 74 2d je 80105150 <sys_exec+0xc0> argv[i] = 0; break; } if(fetchstr(uarg, &argv[i]) < 0) 80105123: 89 74 24 04 mov %esi,0x4(%esp) 80105127: 89 04 24 mov %eax,(%esp) 8010512a: e8 11 f4 ff ff call 80104540 <fetchstr> 8010512f: 85 c0 test %eax,%eax 80105131: 78 0b js 8010513e <sys_exec+0xae> for(i=0;; i++){ 80105133: 83 c3 01 add $0x1,%ebx 80105136: 83 c6 04 add $0x4,%esi if(i >= NELEM(argv)) 80105139: 83 fb 20 cmp $0x20,%ebx 8010513c: 75 c2 jne 80105100 <sys_exec+0x70> return -1; } return exec(path, argv); } 8010513e: 81 c4 ac 00 00 00 add $0xac,%esp return -1; 80105144: b8 ff ff ff ff mov $0xffffffff,%eax } 80105149: 5b pop %ebx 8010514a: 5e pop %esi 8010514b: 5f pop %edi 8010514c: 5d pop %ebp 8010514d: c3 ret 8010514e: 66 90 xchg %ax,%ax return exec(path, argv); 80105150: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax 80105156: 89 44 24 04 mov %eax,0x4(%esp) 8010515a: 8b 85 5c ff ff ff mov -0xa4(%ebp),%eax argv[i] = 0; 80105160: c7 84 9d 68 ff ff ff movl $0x0,-0x98(%ebp,%ebx,4) 80105167: 00 00 00 00 return exec(path, argv); 8010516b: 89 04 24 mov %eax,(%esp) 8010516e: e8 2d b8 ff ff call 801009a0 <exec> } 80105173: 81 c4 ac 00 00 00 add $0xac,%esp 80105179: 5b pop %ebx 8010517a: 5e pop %esi 8010517b: 5f pop %edi 8010517c: 5d pop %ebp 8010517d: c3 ret 8010517e: 66 90 xchg %ax,%ax 80105180 <sys_pipe>: int sys_pipe(void) { 80105180: 55 push %ebp 80105181: 89 e5 mov %esp,%ebp 80105183: 53 push %ebx 80105184: 83 ec 24 sub $0x24,%esp int *fd; struct file *rf, *wf; int fd0, fd1; if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0) 80105187: 8d 45 ec lea -0x14(%ebp),%eax 8010518a: c7 44 24 08 08 00 00 movl $0x8,0x8(%esp) 80105191: 00 80105192: 89 44 24 04 mov %eax,0x4(%esp) 80105196: c7 04 24 00 00 00 00 movl $0x0,(%esp) 8010519d: e8 2e f4 ff ff call 801045d0 <argptr> 801051a2: 85 c0 test %eax,%eax 801051a4: 78 6d js 80105213 <sys_pipe+0x93> return -1; if(pipealloc(&rf, &wf) < 0) 801051a6: 8d 45 f4 lea -0xc(%ebp),%eax 801051a9: 89 44 24 04 mov %eax,0x4(%esp) 801051ad: 8d 45 f0 lea -0x10(%ebp),%eax 801051b0: 89 04 24 mov %eax,(%esp) 801051b3: e8 a8 df ff ff call 80103160 <pipealloc> 801051b8: 85 c0 test %eax,%eax 801051ba: 78 57 js 80105213 <sys_pipe+0x93> return -1; fd0 = -1; if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){ 801051bc: 8b 45 f0 mov -0x10(%ebp),%eax 801051bf: e8 1c f5 ff ff call 801046e0 <fdalloc> 801051c4: 85 c0 test %eax,%eax 801051c6: 89 c3 mov %eax,%ebx 801051c8: 78 33 js 801051fd <sys_pipe+0x7d> 801051ca: 8b 45 f4 mov -0xc(%ebp),%eax 801051cd: e8 0e f5 ff ff call 801046e0 <fdalloc> 801051d2: 85 c0 test %eax,%eax 801051d4: 78 1a js 801051f0 <sys_pipe+0x70> myproc()->ofile[fd0] = 0; fileclose(rf); fileclose(wf); return -1; } fd[0] = fd0; 801051d6: 8b 55 ec mov -0x14(%ebp),%edx 801051d9: 89 1a mov %ebx,(%edx) fd[1] = fd1; 801051db: 8b 55 ec mov -0x14(%ebp),%edx 801051de: 89 42 04 mov %eax,0x4(%edx) return 0; } 801051e1: 83 c4 24 add $0x24,%esp return 0; 801051e4: 31 c0 xor %eax,%eax } 801051e6: 5b pop %ebx 801051e7: 5d pop %ebp 801051e8: c3 ret 801051e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi myproc()->ofile[fd0] = 0; 801051f0: e8 9b e4 ff ff call 80103690 <myproc> 801051f5: c7 44 98 30 00 00 00 movl $0x0,0x30(%eax,%ebx,4) 801051fc: 00 fileclose(rf); 801051fd: 8b 45 f0 mov -0x10(%ebp),%eax 80105200: 89 04 24 mov %eax,(%esp) 80105203: e8 08 bc ff ff call 80100e10 <fileclose> fileclose(wf); 80105208: 8b 45 f4 mov -0xc(%ebp),%eax 8010520b: 89 04 24 mov %eax,(%esp) 8010520e: e8 fd bb ff ff call 80100e10 <fileclose> } 80105213: 83 c4 24 add $0x24,%esp return -1; 80105216: b8 ff ff ff ff mov $0xffffffff,%eax } 8010521b: 5b pop %ebx 8010521c: 5d pop %ebp 8010521d: c3 ret 8010521e: 66 90 xchg %ax,%ax 80105220 <sys_shm_open>: #include "param.h" #include "memlayout.h" #include "mmu.h" #include "proc.h" int sys_shm_open(void) { 80105220: 55 push %ebp 80105221: 89 e5 mov %esp,%ebp 80105223: 83 ec 28 sub $0x28,%esp int id; char **pointer; if(argint(0, &id) < 0) 80105226: 8d 45 f0 lea -0x10(%ebp),%eax 80105229: 89 44 24 04 mov %eax,0x4(%esp) 8010522d: c7 04 24 00 00 00 00 movl $0x0,(%esp) 80105234: e8 67 f3 ff ff call 801045a0 <argint> 80105239: 85 c0 test %eax,%eax 8010523b: 78 33 js 80105270 <sys_shm_open+0x50> return -1; if(argptr(1, (char **) (&pointer),4)<0) 8010523d: 8d 45 f4 lea -0xc(%ebp),%eax 80105240: c7 44 24 08 04 00 00 movl $0x4,0x8(%esp) 80105247: 00 80105248: 89 44 24 04 mov %eax,0x4(%esp) 8010524c: c7 04 24 01 00 00 00 movl $0x1,(%esp) 80105253: e8 78 f3 ff ff call 801045d0 <argptr> 80105258: 85 c0 test %eax,%eax 8010525a: 78 14 js 80105270 <sys_shm_open+0x50> return -1; return shm_open(id, pointer); 8010525c: 8b 45 f4 mov -0xc(%ebp),%eax 8010525f: 89 44 24 04 mov %eax,0x4(%esp) 80105263: 8b 45 f0 mov -0x10(%ebp),%eax 80105266: 89 04 24 mov %eax,(%esp) 80105269: e8 82 1b 00 00 call 80106df0 <shm_open> } 8010526e: c9 leave 8010526f: c3 ret return -1; 80105270: b8 ff ff ff ff mov $0xffffffff,%eax } 80105275: c9 leave 80105276: c3 ret 80105277: 89 f6 mov %esi,%esi 80105279: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105280 <sys_shm_close>: int sys_shm_close(void) { 80105280: 55 push %ebp 80105281: 89 e5 mov %esp,%ebp 80105283: 83 ec 28 sub $0x28,%esp int id; if(argint(0, &id) < 0) 80105286: 8d 45 f4 lea -0xc(%ebp),%eax 80105289: 89 44 24 04 mov %eax,0x4(%esp) 8010528d: c7 04 24 00 00 00 00 movl $0x0,(%esp) 80105294: e8 07 f3 ff ff call 801045a0 <argint> 80105299: 85 c0 test %eax,%eax 8010529b: 78 13 js 801052b0 <sys_shm_close+0x30> return -1; return shm_close(id); 8010529d: 8b 45 f4 mov -0xc(%ebp),%eax 801052a0: 89 04 24 mov %eax,(%esp) 801052a3: e8 58 1b 00 00 call 80106e00 <shm_close> } 801052a8: c9 leave 801052a9: c3 ret 801052aa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return -1; 801052b0: b8 ff ff ff ff mov $0xffffffff,%eax } 801052b5: c9 leave 801052b6: c3 ret 801052b7: 89 f6 mov %esi,%esi 801052b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801052c0 <sys_fork>: int sys_fork(void) { 801052c0: 55 push %ebp 801052c1: 89 e5 mov %esp,%ebp return fork(); } 801052c3: 5d pop %ebp return fork(); 801052c4: e9 77 e5 ff ff jmp 80103840 <fork> 801052c9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801052d0 <sys_exit>: int sys_exit(void) { 801052d0: 55 push %ebp 801052d1: 89 e5 mov %esp,%ebp 801052d3: 83 ec 08 sub $0x8,%esp exit(); 801052d6: e8 c5 e7 ff ff call 80103aa0 <exit> return 0; // not reached } 801052db: 31 c0 xor %eax,%eax 801052dd: c9 leave 801052de: c3 ret 801052df: 90 nop 801052e0 <sys_wait>: int sys_wait(void) { 801052e0: 55 push %ebp 801052e1: 89 e5 mov %esp,%ebp return wait(); } 801052e3: 5d pop %ebp return wait(); 801052e4: e9 d7 e9 ff ff jmp 80103cc0 <wait> 801052e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801052f0 <sys_kill>: int sys_kill(void) { 801052f0: 55 push %ebp 801052f1: 89 e5 mov %esp,%ebp 801052f3: 83 ec 28 sub $0x28,%esp int pid; if(argint(0, &pid) < 0) 801052f6: 8d 45 f4 lea -0xc(%ebp),%eax 801052f9: 89 44 24 04 mov %eax,0x4(%esp) 801052fd: c7 04 24 00 00 00 00 movl $0x0,(%esp) 80105304: e8 97 f2 ff ff call 801045a0 <argint> 80105309: 85 c0 test %eax,%eax 8010530b: 78 13 js 80105320 <sys_kill+0x30> return -1; return kill(pid); 8010530d: 8b 45 f4 mov -0xc(%ebp),%eax 80105310: 89 04 24 mov %eax,(%esp) 80105313: e8 08 eb ff ff call 80103e20 <kill> } 80105318: c9 leave 80105319: c3 ret 8010531a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return -1; 80105320: b8 ff ff ff ff mov $0xffffffff,%eax } 80105325: c9 leave 80105326: c3 ret 80105327: 89 f6 mov %esi,%esi 80105329: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105330 <sys_getpid>: int sys_getpid(void) { 80105330: 55 push %ebp 80105331: 89 e5 mov %esp,%ebp 80105333: 83 ec 08 sub $0x8,%esp return myproc()->pid; 80105336: e8 55 e3 ff ff call 80103690 <myproc> 8010533b: 8b 40 18 mov 0x18(%eax),%eax } 8010533e: c9 leave 8010533f: c3 ret 80105340 <sys_sbrk>: int sys_sbrk(void) { 80105340: 55 push %ebp 80105341: 89 e5 mov %esp,%ebp 80105343: 53 push %ebx 80105344: 83 ec 24 sub $0x24,%esp int addr; int n; if(argint(0, &n) < 0) 80105347: 8d 45 f4 lea -0xc(%ebp),%eax 8010534a: 89 44 24 04 mov %eax,0x4(%esp) 8010534e: c7 04 24 00 00 00 00 movl $0x0,(%esp) 80105355: e8 46 f2 ff ff call 801045a0 <argint> 8010535a: 85 c0 test %eax,%eax 8010535c: 78 22 js 80105380 <sys_sbrk+0x40> return -1; addr = myproc()->sz; 8010535e: e8 2d e3 ff ff call 80103690 <myproc> if(growproc(n) < 0) 80105363: 8b 55 f4 mov -0xc(%ebp),%edx addr = myproc()->sz; 80105366: 8b 18 mov (%eax),%ebx if(growproc(n) < 0) 80105368: 89 14 24 mov %edx,(%esp) 8010536b: e8 60 e4 ff ff call 801037d0 <growproc> 80105370: 85 c0 test %eax,%eax 80105372: 78 0c js 80105380 <sys_sbrk+0x40> return -1; return addr; 80105374: 89 d8 mov %ebx,%eax } 80105376: 83 c4 24 add $0x24,%esp 80105379: 5b pop %ebx 8010537a: 5d pop %ebp 8010537b: c3 ret 8010537c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80105380: b8 ff ff ff ff mov $0xffffffff,%eax 80105385: eb ef jmp 80105376 <sys_sbrk+0x36> 80105387: 89 f6 mov %esi,%esi 80105389: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105390 <sys_sleep>: int sys_sleep(void) { 80105390: 55 push %ebp 80105391: 89 e5 mov %esp,%ebp 80105393: 53 push %ebx 80105394: 83 ec 24 sub $0x24,%esp int n; uint ticks0; if(argint(0, &n) < 0) 80105397: 8d 45 f4 lea -0xc(%ebp),%eax 8010539a: 89 44 24 04 mov %eax,0x4(%esp) 8010539e: c7 04 24 00 00 00 00 movl $0x0,(%esp) 801053a5: e8 f6 f1 ff ff call 801045a0 <argint> 801053aa: 85 c0 test %eax,%eax 801053ac: 78 7e js 8010542c <sys_sleep+0x9c> return -1; acquire(&tickslock); 801053ae: c7 04 24 60 4e 11 80 movl $0x80114e60,(%esp) 801053b5: e8 b6 ed ff ff call 80104170 <acquire> ticks0 = ticks; while(ticks - ticks0 < n){ 801053ba: 8b 55 f4 mov -0xc(%ebp),%edx ticks0 = ticks; 801053bd: 8b 1d a0 56 11 80 mov 0x801156a0,%ebx while(ticks - ticks0 < n){ 801053c3: 85 d2 test %edx,%edx 801053c5: 75 29 jne 801053f0 <sys_sleep+0x60> 801053c7: eb 4f jmp 80105418 <sys_sleep+0x88> 801053c9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(myproc()->killed){ release(&tickslock); return -1; } sleep(&ticks, &tickslock); 801053d0: c7 44 24 04 60 4e 11 movl $0x80114e60,0x4(%esp) 801053d7: 80 801053d8: c7 04 24 a0 56 11 80 movl $0x801156a0,(%esp) 801053df: e8 2c e8 ff ff call 80103c10 <sleep> while(ticks - ticks0 < n){ 801053e4: a1 a0 56 11 80 mov 0x801156a0,%eax 801053e9: 29 d8 sub %ebx,%eax 801053eb: 3b 45 f4 cmp -0xc(%ebp),%eax 801053ee: 73 28 jae 80105418 <sys_sleep+0x88> if(myproc()->killed){ 801053f0: e8 9b e2 ff ff call 80103690 <myproc> 801053f5: 8b 40 2c mov 0x2c(%eax),%eax 801053f8: 85 c0 test %eax,%eax 801053fa: 74 d4 je 801053d0 <sys_sleep+0x40> release(&tickslock); 801053fc: c7 04 24 60 4e 11 80 movl $0x80114e60,(%esp) 80105403: e8 58 ee ff ff call 80104260 <release> return -1; 80105408: b8 ff ff ff ff mov $0xffffffff,%eax } release(&tickslock); return 0; } 8010540d: 83 c4 24 add $0x24,%esp 80105410: 5b pop %ebx 80105411: 5d pop %ebp 80105412: c3 ret 80105413: 90 nop 80105414: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi release(&tickslock); 80105418: c7 04 24 60 4e 11 80 movl $0x80114e60,(%esp) 8010541f: e8 3c ee ff ff call 80104260 <release> } 80105424: 83 c4 24 add $0x24,%esp return 0; 80105427: 31 c0 xor %eax,%eax } 80105429: 5b pop %ebx 8010542a: 5d pop %ebp 8010542b: c3 ret return -1; 8010542c: b8 ff ff ff ff mov $0xffffffff,%eax 80105431: eb da jmp 8010540d <sys_sleep+0x7d> 80105433: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80105439: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105440 <sys_uptime>: // return how many clock tick interrupts have occurred // since start. int sys_uptime(void) { 80105440: 55 push %ebp 80105441: 89 e5 mov %esp,%ebp 80105443: 53 push %ebx 80105444: 83 ec 14 sub $0x14,%esp uint xticks; acquire(&tickslock); 80105447: c7 04 24 60 4e 11 80 movl $0x80114e60,(%esp) 8010544e: e8 1d ed ff ff call 80104170 <acquire> xticks = ticks; 80105453: 8b 1d a0 56 11 80 mov 0x801156a0,%ebx release(&tickslock); 80105459: c7 04 24 60 4e 11 80 movl $0x80114e60,(%esp) 80105460: e8 fb ed ff ff call 80104260 <release> return xticks; } 80105465: 83 c4 14 add $0x14,%esp 80105468: 89 d8 mov %ebx,%eax 8010546a: 5b pop %ebx 8010546b: 5d pop %ebp 8010546c: c3 ret 8010546d <alltraps>: # vectors.S sends all traps here. .globl alltraps alltraps: # Build trap frame. pushl %ds 8010546d: 1e push %ds pushl %es 8010546e: 06 push %es pushl %fs 8010546f: 0f a0 push %fs pushl %gs 80105471: 0f a8 push %gs pushal 80105473: 60 pusha # Set up data segments. movw $(SEG_KDATA<<3), %ax 80105474: 66 b8 10 00 mov $0x10,%ax movw %ax, %ds 80105478: 8e d8 mov %eax,%ds movw %ax, %es 8010547a: 8e c0 mov %eax,%es # Call trap(tf), where tf=%esp pushl %esp 8010547c: 54 push %esp call trap 8010547d: e8 de 00 00 00 call 80105560 <trap> addl $4, %esp 80105482: 83 c4 04 add $0x4,%esp 80105485 <trapret>: # Return falls through to trapret... .globl trapret trapret: popal 80105485: 61 popa popl %gs 80105486: 0f a9 pop %gs popl %fs 80105488: 0f a1 pop %fs popl %es 8010548a: 07 pop %es popl %ds 8010548b: 1f pop %ds addl $0x8, %esp # trapno and errcode 8010548c: 83 c4 08 add $0x8,%esp iret 8010548f: cf iret 80105490 <tvinit>: void tvinit(void) { int i; for(i = 0; i < 256; i++) 80105490: 31 c0 xor %eax,%eax 80105492: 8d b6 00 00 00 00 lea 0x0(%esi),%esi SETGATE(idt[i], 0, SEG_KCODE<<3, vectors[i], 0); 80105498: 8b 14 85 08 a0 10 80 mov -0x7fef5ff8(,%eax,4),%edx 8010549f: b9 08 00 00 00 mov $0x8,%ecx 801054a4: 66 89 0c c5 a2 4e 11 mov %cx,-0x7feeb15e(,%eax,8) 801054ab: 80 801054ac: c6 04 c5 a4 4e 11 80 movb $0x0,-0x7feeb15c(,%eax,8) 801054b3: 00 801054b4: c6 04 c5 a5 4e 11 80 movb $0x8e,-0x7feeb15b(,%eax,8) 801054bb: 8e 801054bc: 66 89 14 c5 a0 4e 11 mov %dx,-0x7feeb160(,%eax,8) 801054c3: 80 801054c4: c1 ea 10 shr $0x10,%edx 801054c7: 66 89 14 c5 a6 4e 11 mov %dx,-0x7feeb15a(,%eax,8) 801054ce: 80 for(i = 0; i < 256; i++) 801054cf: 83 c0 01 add $0x1,%eax 801054d2: 3d 00 01 00 00 cmp $0x100,%eax 801054d7: 75 bf jne 80105498 <tvinit+0x8> { 801054d9: 55 push %ebp SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER); 801054da: ba 08 00 00 00 mov $0x8,%edx { 801054df: 89 e5 mov %esp,%ebp 801054e1: 83 ec 18 sub $0x18,%esp SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER); 801054e4: a1 08 a1 10 80 mov 0x8010a108,%eax initlock(&tickslock, "time"); 801054e9: c7 44 24 04 c1 75 10 movl $0x801075c1,0x4(%esp) 801054f0: 80 801054f1: c7 04 24 60 4e 11 80 movl $0x80114e60,(%esp) SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER); 801054f8: 66 89 15 a2 50 11 80 mov %dx,0x801150a2 801054ff: 66 a3 a0 50 11 80 mov %ax,0x801150a0 80105505: c1 e8 10 shr $0x10,%eax 80105508: c6 05 a4 50 11 80 00 movb $0x0,0x801150a4 8010550f: c6 05 a5 50 11 80 ef movb $0xef,0x801150a5 80105516: 66 a3 a6 50 11 80 mov %ax,0x801150a6 initlock(&tickslock, "time"); 8010551c: e8 5f eb ff ff call 80104080 <initlock> } 80105521: c9 leave 80105522: c3 ret 80105523: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80105529: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105530 <idtinit>: void idtinit(void) { 80105530: 55 push %ebp pd[0] = size-1; 80105531: b8 ff 07 00 00 mov $0x7ff,%eax 80105536: 89 e5 mov %esp,%ebp 80105538: 83 ec 10 sub $0x10,%esp 8010553b: 66 89 45 fa mov %ax,-0x6(%ebp) pd[1] = (uint)p; 8010553f: b8 a0 4e 11 80 mov $0x80114ea0,%eax 80105544: 66 89 45 fc mov %ax,-0x4(%ebp) pd[2] = (uint)p >> 16; 80105548: c1 e8 10 shr $0x10,%eax 8010554b: 66 89 45 fe mov %ax,-0x2(%ebp) asm volatile("lidt (%0)" : : "r" (pd)); 8010554f: 8d 45 fa lea -0x6(%ebp),%eax 80105552: 0f 01 18 lidtl (%eax) lidt(idt, sizeof(idt)); } 80105555: c9 leave 80105556: c3 ret 80105557: 89 f6 mov %esi,%esi 80105559: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105560 <trap>: //PAGEBREAK: 41 void trap(struct trapframe *tf) { 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 3c sub $0x3c,%esp 80105569: 8b 5d 08 mov 0x8(%ebp),%ebx if(tf->trapno == T_SYSCALL){ 8010556c: 8b 43 30 mov 0x30(%ebx),%eax 8010556f: 83 f8 40 cmp $0x40,%eax 80105572: 0f 84 a0 01 00 00 je 80105718 <trap+0x1b8> if(myproc()->killed) exit(); return; } switch(tf->trapno){ 80105578: 83 e8 20 sub $0x20,%eax 8010557b: 83 f8 1f cmp $0x1f,%eax 8010557e: 77 08 ja 80105588 <trap+0x28> 80105580: ff 24 85 68 76 10 80 jmp *-0x7fef8998(,%eax,4) 80105587: 90 nop lapiceoi(); break; //PAGEBREAK: 13 default: if(myproc() == 0 || (tf->cs&3) == 0){ 80105588: e8 03 e1 ff ff call 80103690 <myproc> 8010558d: 85 c0 test %eax,%eax 8010558f: 90 nop 80105590: 0f 84 fa 01 00 00 je 80105790 <trap+0x230> 80105596: f6 43 3c 03 testb $0x3,0x3c(%ebx) 8010559a: 0f 84 f0 01 00 00 je 80105790 <trap+0x230> static inline uint rcr2(void) { uint val; asm volatile("movl %%cr2,%0" : "=r" (val)); 801055a0: 0f 20 d1 mov %cr2,%ecx cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n", tf->trapno, cpuid(), tf->eip, rcr2()); panic("trap"); } // In user space, assume process misbehaved. cprintf("pid %d %s: trap %d err %d on cpu %d " 801055a3: 8b 53 38 mov 0x38(%ebx),%edx 801055a6: 89 4d d8 mov %ecx,-0x28(%ebp) 801055a9: 89 55 dc mov %edx,-0x24(%ebp) 801055ac: e8 bf e0 ff ff call 80103670 <cpuid> 801055b1: 8b 73 30 mov 0x30(%ebx),%esi 801055b4: 89 c7 mov %eax,%edi 801055b6: 8b 43 34 mov 0x34(%ebx),%eax 801055b9: 89 45 e4 mov %eax,-0x1c(%ebp) "eip 0x%x addr 0x%x--kill proc\n", myproc()->pid, myproc()->name, tf->trapno, 801055bc: e8 cf e0 ff ff call 80103690 <myproc> 801055c1: 89 45 e0 mov %eax,-0x20(%ebp) 801055c4: e8 c7 e0 ff ff call 80103690 <myproc> cprintf("pid %d %s: trap %d err %d on cpu %d " 801055c9: 8b 55 dc mov -0x24(%ebp),%edx 801055cc: 89 74 24 0c mov %esi,0xc(%esp) myproc()->pid, myproc()->name, tf->trapno, 801055d0: 8b 75 e0 mov -0x20(%ebp),%esi cprintf("pid %d %s: trap %d err %d on cpu %d " 801055d3: 8b 4d d8 mov -0x28(%ebp),%ecx 801055d6: 89 7c 24 14 mov %edi,0x14(%esp) 801055da: 89 54 24 18 mov %edx,0x18(%esp) 801055de: 8b 55 e4 mov -0x1c(%ebp),%edx myproc()->pid, myproc()->name, tf->trapno, 801055e1: 83 c6 74 add $0x74,%esi cprintf("pid %d %s: trap %d err %d on cpu %d " 801055e4: 89 4c 24 1c mov %ecx,0x1c(%esp) myproc()->pid, myproc()->name, tf->trapno, 801055e8: 89 74 24 08 mov %esi,0x8(%esp) cprintf("pid %d %s: trap %d err %d on cpu %d " 801055ec: 89 54 24 10 mov %edx,0x10(%esp) 801055f0: 8b 40 18 mov 0x18(%eax),%eax 801055f3: c7 04 24 24 76 10 80 movl $0x80107624,(%esp) 801055fa: 89 44 24 04 mov %eax,0x4(%esp) 801055fe: e8 4d b0 ff ff call 80100650 <cprintf> tf->err, cpuid(), tf->eip, rcr2()); myproc()->killed = 1; 80105603: e8 88 e0 ff ff call 80103690 <myproc> 80105608: c7 40 2c 01 00 00 00 movl $0x1,0x2c(%eax) 8010560f: 90 nop } // 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(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER) 80105610: e8 7b e0 ff ff call 80103690 <myproc> 80105615: 85 c0 test %eax,%eax 80105617: 74 0c je 80105625 <trap+0xc5> 80105619: e8 72 e0 ff ff call 80103690 <myproc> 8010561e: 8b 50 2c mov 0x2c(%eax),%edx 80105621: 85 d2 test %edx,%edx 80105623: 75 4b jne 80105670 <trap+0x110> exit(); // Force process to give up CPU on clock tick. // If interrupts were on while locks held, would need to check nlock. if(myproc() && myproc()->state == RUNNING && 80105625: e8 66 e0 ff ff call 80103690 <myproc> 8010562a: 85 c0 test %eax,%eax 8010562c: 74 0d je 8010563b <trap+0xdb> 8010562e: 66 90 xchg %ax,%ax 80105630: e8 5b e0 ff ff call 80103690 <myproc> 80105635: 83 78 14 04 cmpl $0x4,0x14(%eax) 80105639: 74 4d je 80105688 <trap+0x128> tf->trapno == T_IRQ0+IRQ_TIMER) yield(); // Check if the process has been killed since we yielded if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER) 8010563b: e8 50 e0 ff ff call 80103690 <myproc> 80105640: 85 c0 test %eax,%eax 80105642: 74 1d je 80105661 <trap+0x101> 80105644: e8 47 e0 ff ff call 80103690 <myproc> 80105649: 8b 40 2c mov 0x2c(%eax),%eax 8010564c: 85 c0 test %eax,%eax 8010564e: 74 11 je 80105661 <trap+0x101> 80105650: 0f b7 43 3c movzwl 0x3c(%ebx),%eax 80105654: 83 e0 03 and $0x3,%eax 80105657: 66 83 f8 03 cmp $0x3,%ax 8010565b: 0f 84 e8 00 00 00 je 80105749 <trap+0x1e9> exit(); } 80105661: 83 c4 3c add $0x3c,%esp 80105664: 5b pop %ebx 80105665: 5e pop %esi 80105666: 5f pop %edi 80105667: 5d pop %ebp 80105668: c3 ret 80105669: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER) 80105670: 0f b7 43 3c movzwl 0x3c(%ebx),%eax 80105674: 83 e0 03 and $0x3,%eax 80105677: 66 83 f8 03 cmp $0x3,%ax 8010567b: 75 a8 jne 80105625 <trap+0xc5> exit(); 8010567d: e8 1e e4 ff ff call 80103aa0 <exit> 80105682: eb a1 jmp 80105625 <trap+0xc5> 80105684: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(myproc() && myproc()->state == RUNNING && 80105688: 83 7b 30 20 cmpl $0x20,0x30(%ebx) 8010568c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105690: 75 a9 jne 8010563b <trap+0xdb> yield(); 80105692: e8 39 e5 ff ff call 80103bd0 <yield> 80105697: eb a2 jmp 8010563b <trap+0xdb> 80105699: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(cpuid() == 0){ 801056a0: e8 cb df ff ff call 80103670 <cpuid> 801056a5: 85 c0 test %eax,%eax 801056a7: 0f 84 b3 00 00 00 je 80105760 <trap+0x200> 801056ad: 8d 76 00 lea 0x0(%esi),%esi lapiceoi(); 801056b0: e8 bb d0 ff ff call 80102770 <lapiceoi> break; 801056b5: e9 56 ff ff ff jmp 80105610 <trap+0xb0> 801056ba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi kbdintr(); 801056c0: e8 fb ce ff ff call 801025c0 <kbdintr> lapiceoi(); 801056c5: e8 a6 d0 ff ff call 80102770 <lapiceoi> break; 801056ca: e9 41 ff ff ff jmp 80105610 <trap+0xb0> 801056cf: 90 nop uartintr(); 801056d0: e8 1b 02 00 00 call 801058f0 <uartintr> lapiceoi(); 801056d5: e8 96 d0 ff ff call 80102770 <lapiceoi> break; 801056da: e9 31 ff ff ff jmp 80105610 <trap+0xb0> 801056df: 90 nop cprintf("cpu%d: spurious interrupt at %x:%x\n", 801056e0: 8b 7b 38 mov 0x38(%ebx),%edi 801056e3: 0f b7 73 3c movzwl 0x3c(%ebx),%esi 801056e7: e8 84 df ff ff call 80103670 <cpuid> 801056ec: c7 04 24 cc 75 10 80 movl $0x801075cc,(%esp) 801056f3: 89 7c 24 0c mov %edi,0xc(%esp) 801056f7: 89 74 24 08 mov %esi,0x8(%esp) 801056fb: 89 44 24 04 mov %eax,0x4(%esp) 801056ff: e8 4c af ff ff call 80100650 <cprintf> lapiceoi(); 80105704: e8 67 d0 ff ff call 80102770 <lapiceoi> break; 80105709: e9 02 ff ff ff jmp 80105610 <trap+0xb0> 8010570e: 66 90 xchg %ax,%ax ideintr(); 80105710: e8 5b c9 ff ff call 80102070 <ideintr> 80105715: eb 96 jmp 801056ad <trap+0x14d> 80105717: 90 nop 80105718: 90 nop 80105719: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(myproc()->killed) 80105720: e8 6b df ff ff call 80103690 <myproc> 80105725: 8b 70 2c mov 0x2c(%eax),%esi 80105728: 85 f6 test %esi,%esi 8010572a: 75 2c jne 80105758 <trap+0x1f8> myproc()->tf = tf; 8010572c: e8 5f df ff ff call 80103690 <myproc> 80105731: 89 58 20 mov %ebx,0x20(%eax) syscall(); 80105734: e8 37 ef ff ff call 80104670 <syscall> if(myproc()->killed) 80105739: e8 52 df ff ff call 80103690 <myproc> 8010573e: 8b 48 2c mov 0x2c(%eax),%ecx 80105741: 85 c9 test %ecx,%ecx 80105743: 0f 84 18 ff ff ff je 80105661 <trap+0x101> } 80105749: 83 c4 3c add $0x3c,%esp 8010574c: 5b pop %ebx 8010574d: 5e pop %esi 8010574e: 5f pop %edi 8010574f: 5d pop %ebp exit(); 80105750: e9 4b e3 ff ff jmp 80103aa0 <exit> 80105755: 8d 76 00 lea 0x0(%esi),%esi exit(); 80105758: e8 43 e3 ff ff call 80103aa0 <exit> 8010575d: eb cd jmp 8010572c <trap+0x1cc> 8010575f: 90 nop acquire(&tickslock); 80105760: c7 04 24 60 4e 11 80 movl $0x80114e60,(%esp) 80105767: e8 04 ea ff ff call 80104170 <acquire> wakeup(&ticks); 8010576c: c7 04 24 a0 56 11 80 movl $0x801156a0,(%esp) ticks++; 80105773: 83 05 a0 56 11 80 01 addl $0x1,0x801156a0 wakeup(&ticks); 8010577a: e8 31 e6 ff ff call 80103db0 <wakeup> release(&tickslock); 8010577f: c7 04 24 60 4e 11 80 movl $0x80114e60,(%esp) 80105786: e8 d5 ea ff ff call 80104260 <release> 8010578b: e9 1d ff ff ff jmp 801056ad <trap+0x14d> 80105790: 0f 20 d7 mov %cr2,%edi cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n", 80105793: 8b 73 38 mov 0x38(%ebx),%esi 80105796: e8 d5 de ff ff call 80103670 <cpuid> 8010579b: 89 7c 24 10 mov %edi,0x10(%esp) 8010579f: 89 74 24 0c mov %esi,0xc(%esp) 801057a3: 89 44 24 08 mov %eax,0x8(%esp) 801057a7: 8b 43 30 mov 0x30(%ebx),%eax 801057aa: c7 04 24 f0 75 10 80 movl $0x801075f0,(%esp) 801057b1: 89 44 24 04 mov %eax,0x4(%esp) 801057b5: e8 96 ae ff ff call 80100650 <cprintf> panic("trap"); 801057ba: c7 04 24 c6 75 10 80 movl $0x801075c6,(%esp) 801057c1: e8 9a ab ff ff call 80100360 <panic> 801057c6: 66 90 xchg %ax,%ax 801057c8: 66 90 xchg %ax,%ax 801057ca: 66 90 xchg %ax,%ax 801057cc: 66 90 xchg %ax,%ax 801057ce: 66 90 xchg %ax,%ax 801057d0 <uartgetc>: } static int uartgetc(void) { if(!uart) 801057d0: a1 bc a5 10 80 mov 0x8010a5bc,%eax { 801057d5: 55 push %ebp 801057d6: 89 e5 mov %esp,%ebp if(!uart) 801057d8: 85 c0 test %eax,%eax 801057da: 74 14 je 801057f0 <uartgetc+0x20> asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801057dc: ba fd 03 00 00 mov $0x3fd,%edx 801057e1: ec in (%dx),%al return -1; if(!(inb(COM1+5) & 0x01)) 801057e2: a8 01 test $0x1,%al 801057e4: 74 0a je 801057f0 <uartgetc+0x20> 801057e6: b2 f8 mov $0xf8,%dl 801057e8: ec in (%dx),%al return -1; return inb(COM1+0); 801057e9: 0f b6 c0 movzbl %al,%eax } 801057ec: 5d pop %ebp 801057ed: c3 ret 801057ee: 66 90 xchg %ax,%ax return -1; 801057f0: b8 ff ff ff ff mov $0xffffffff,%eax } 801057f5: 5d pop %ebp 801057f6: c3 ret 801057f7: 89 f6 mov %esi,%esi 801057f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105800 <uartputc>: if(!uart) 80105800: a1 bc a5 10 80 mov 0x8010a5bc,%eax 80105805: 85 c0 test %eax,%eax 80105807: 74 3f je 80105848 <uartputc+0x48> { 80105809: 55 push %ebp 8010580a: 89 e5 mov %esp,%ebp 8010580c: 56 push %esi 8010580d: be fd 03 00 00 mov $0x3fd,%esi 80105812: 53 push %ebx if(!uart) 80105813: bb 80 00 00 00 mov $0x80,%ebx { 80105818: 83 ec 10 sub $0x10,%esp 8010581b: eb 14 jmp 80105831 <uartputc+0x31> 8010581d: 8d 76 00 lea 0x0(%esi),%esi microdelay(10); 80105820: c7 04 24 0a 00 00 00 movl $0xa,(%esp) 80105827: e8 64 cf ff ff call 80102790 <microdelay> for(i = 0; i < 128 && !(inb(COM1+5) & 0x20); i++) 8010582c: 83 eb 01 sub $0x1,%ebx 8010582f: 74 07 je 80105838 <uartputc+0x38> 80105831: 89 f2 mov %esi,%edx 80105833: ec in (%dx),%al 80105834: a8 20 test $0x20,%al 80105836: 74 e8 je 80105820 <uartputc+0x20> outb(COM1+0, c); 80105838: 0f b6 45 08 movzbl 0x8(%ebp),%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 8010583c: ba f8 03 00 00 mov $0x3f8,%edx 80105841: ee out %al,(%dx) } 80105842: 83 c4 10 add $0x10,%esp 80105845: 5b pop %ebx 80105846: 5e pop %esi 80105847: 5d pop %ebp 80105848: f3 c3 repz ret 8010584a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80105850 <uartinit>: { 80105850: 55 push %ebp 80105851: 31 c9 xor %ecx,%ecx 80105853: 89 e5 mov %esp,%ebp 80105855: 89 c8 mov %ecx,%eax 80105857: 57 push %edi 80105858: bf fa 03 00 00 mov $0x3fa,%edi 8010585d: 56 push %esi 8010585e: 89 fa mov %edi,%edx 80105860: 53 push %ebx 80105861: 83 ec 1c sub $0x1c,%esp 80105864: ee out %al,(%dx) 80105865: be fb 03 00 00 mov $0x3fb,%esi 8010586a: b8 80 ff ff ff mov $0xffffff80,%eax 8010586f: 89 f2 mov %esi,%edx 80105871: ee out %al,(%dx) 80105872: b8 0c 00 00 00 mov $0xc,%eax 80105877: b2 f8 mov $0xf8,%dl 80105879: ee out %al,(%dx) 8010587a: bb f9 03 00 00 mov $0x3f9,%ebx 8010587f: 89 c8 mov %ecx,%eax 80105881: 89 da mov %ebx,%edx 80105883: ee out %al,(%dx) 80105884: b8 03 00 00 00 mov $0x3,%eax 80105889: 89 f2 mov %esi,%edx 8010588b: ee out %al,(%dx) 8010588c: b2 fc mov $0xfc,%dl 8010588e: 89 c8 mov %ecx,%eax 80105890: ee out %al,(%dx) 80105891: b8 01 00 00 00 mov $0x1,%eax 80105896: 89 da mov %ebx,%edx 80105898: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80105899: b2 fd mov $0xfd,%dl 8010589b: ec in (%dx),%al if(inb(COM1+5) == 0xFF) 8010589c: 3c ff cmp $0xff,%al 8010589e: 74 42 je 801058e2 <uartinit+0x92> uart = 1; 801058a0: c7 05 bc a5 10 80 01 movl $0x1,0x8010a5bc 801058a7: 00 00 00 801058aa: 89 fa mov %edi,%edx 801058ac: ec in (%dx),%al 801058ad: b2 f8 mov $0xf8,%dl 801058af: ec in (%dx),%al ioapicenable(IRQ_COM1, 0); 801058b0: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 801058b7: 00 for(p="xv6...\n"; *p; p++) 801058b8: bb e8 76 10 80 mov $0x801076e8,%ebx ioapicenable(IRQ_COM1, 0); 801058bd: c7 04 24 04 00 00 00 movl $0x4,(%esp) 801058c4: e8 d7 c9 ff ff call 801022a0 <ioapicenable> for(p="xv6...\n"; *p; p++) 801058c9: b8 78 00 00 00 mov $0x78,%eax 801058ce: 66 90 xchg %ax,%ax uartputc(*p); 801058d0: 89 04 24 mov %eax,(%esp) for(p="xv6...\n"; *p; p++) 801058d3: 83 c3 01 add $0x1,%ebx uartputc(*p); 801058d6: e8 25 ff ff ff call 80105800 <uartputc> for(p="xv6...\n"; *p; p++) 801058db: 0f be 03 movsbl (%ebx),%eax 801058de: 84 c0 test %al,%al 801058e0: 75 ee jne 801058d0 <uartinit+0x80> } 801058e2: 83 c4 1c add $0x1c,%esp 801058e5: 5b pop %ebx 801058e6: 5e pop %esi 801058e7: 5f pop %edi 801058e8: 5d pop %ebp 801058e9: c3 ret 801058ea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801058f0 <uartintr>: void uartintr(void) { 801058f0: 55 push %ebp 801058f1: 89 e5 mov %esp,%ebp 801058f3: 83 ec 18 sub $0x18,%esp consoleintr(uartgetc); 801058f6: c7 04 24 d0 57 10 80 movl $0x801057d0,(%esp) 801058fd: e8 ae ae ff ff call 801007b0 <consoleintr> } 80105902: c9 leave 80105903: c3 ret 80105904 <vector0>: # generated by vectors.pl - do not edit # handlers .globl alltraps .globl vector0 vector0: pushl $0 80105904: 6a 00 push $0x0 pushl $0 80105906: 6a 00 push $0x0 jmp alltraps 80105908: e9 60 fb ff ff jmp 8010546d <alltraps> 8010590d <vector1>: .globl vector1 vector1: pushl $0 8010590d: 6a 00 push $0x0 pushl $1 8010590f: 6a 01 push $0x1 jmp alltraps 80105911: e9 57 fb ff ff jmp 8010546d <alltraps> 80105916 <vector2>: .globl vector2 vector2: pushl $0 80105916: 6a 00 push $0x0 pushl $2 80105918: 6a 02 push $0x2 jmp alltraps 8010591a: e9 4e fb ff ff jmp 8010546d <alltraps> 8010591f <vector3>: .globl vector3 vector3: pushl $0 8010591f: 6a 00 push $0x0 pushl $3 80105921: 6a 03 push $0x3 jmp alltraps 80105923: e9 45 fb ff ff jmp 8010546d <alltraps> 80105928 <vector4>: .globl vector4 vector4: pushl $0 80105928: 6a 00 push $0x0 pushl $4 8010592a: 6a 04 push $0x4 jmp alltraps 8010592c: e9 3c fb ff ff jmp 8010546d <alltraps> 80105931 <vector5>: .globl vector5 vector5: pushl $0 80105931: 6a 00 push $0x0 pushl $5 80105933: 6a 05 push $0x5 jmp alltraps 80105935: e9 33 fb ff ff jmp 8010546d <alltraps> 8010593a <vector6>: .globl vector6 vector6: pushl $0 8010593a: 6a 00 push $0x0 pushl $6 8010593c: 6a 06 push $0x6 jmp alltraps 8010593e: e9 2a fb ff ff jmp 8010546d <alltraps> 80105943 <vector7>: .globl vector7 vector7: pushl $0 80105943: 6a 00 push $0x0 pushl $7 80105945: 6a 07 push $0x7 jmp alltraps 80105947: e9 21 fb ff ff jmp 8010546d <alltraps> 8010594c <vector8>: .globl vector8 vector8: pushl $8 8010594c: 6a 08 push $0x8 jmp alltraps 8010594e: e9 1a fb ff ff jmp 8010546d <alltraps> 80105953 <vector9>: .globl vector9 vector9: pushl $0 80105953: 6a 00 push $0x0 pushl $9 80105955: 6a 09 push $0x9 jmp alltraps 80105957: e9 11 fb ff ff jmp 8010546d <alltraps> 8010595c <vector10>: .globl vector10 vector10: pushl $10 8010595c: 6a 0a push $0xa jmp alltraps 8010595e: e9 0a fb ff ff jmp 8010546d <alltraps> 80105963 <vector11>: .globl vector11 vector11: pushl $11 80105963: 6a 0b push $0xb jmp alltraps 80105965: e9 03 fb ff ff jmp 8010546d <alltraps> 8010596a <vector12>: .globl vector12 vector12: pushl $12 8010596a: 6a 0c push $0xc jmp alltraps 8010596c: e9 fc fa ff ff jmp 8010546d <alltraps> 80105971 <vector13>: .globl vector13 vector13: pushl $13 80105971: 6a 0d push $0xd jmp alltraps 80105973: e9 f5 fa ff ff jmp 8010546d <alltraps> 80105978 <vector14>: .globl vector14 vector14: pushl $14 80105978: 6a 0e push $0xe jmp alltraps 8010597a: e9 ee fa ff ff jmp 8010546d <alltraps> 8010597f <vector15>: .globl vector15 vector15: pushl $0 8010597f: 6a 00 push $0x0 pushl $15 80105981: 6a 0f push $0xf jmp alltraps 80105983: e9 e5 fa ff ff jmp 8010546d <alltraps> 80105988 <vector16>: .globl vector16 vector16: pushl $0 80105988: 6a 00 push $0x0 pushl $16 8010598a: 6a 10 push $0x10 jmp alltraps 8010598c: e9 dc fa ff ff jmp 8010546d <alltraps> 80105991 <vector17>: .globl vector17 vector17: pushl $17 80105991: 6a 11 push $0x11 jmp alltraps 80105993: e9 d5 fa ff ff jmp 8010546d <alltraps> 80105998 <vector18>: .globl vector18 vector18: pushl $0 80105998: 6a 00 push $0x0 pushl $18 8010599a: 6a 12 push $0x12 jmp alltraps 8010599c: e9 cc fa ff ff jmp 8010546d <alltraps> 801059a1 <vector19>: .globl vector19 vector19: pushl $0 801059a1: 6a 00 push $0x0 pushl $19 801059a3: 6a 13 push $0x13 jmp alltraps 801059a5: e9 c3 fa ff ff jmp 8010546d <alltraps> 801059aa <vector20>: .globl vector20 vector20: pushl $0 801059aa: 6a 00 push $0x0 pushl $20 801059ac: 6a 14 push $0x14 jmp alltraps 801059ae: e9 ba fa ff ff jmp 8010546d <alltraps> 801059b3 <vector21>: .globl vector21 vector21: pushl $0 801059b3: 6a 00 push $0x0 pushl $21 801059b5: 6a 15 push $0x15 jmp alltraps 801059b7: e9 b1 fa ff ff jmp 8010546d <alltraps> 801059bc <vector22>: .globl vector22 vector22: pushl $0 801059bc: 6a 00 push $0x0 pushl $22 801059be: 6a 16 push $0x16 jmp alltraps 801059c0: e9 a8 fa ff ff jmp 8010546d <alltraps> 801059c5 <vector23>: .globl vector23 vector23: pushl $0 801059c5: 6a 00 push $0x0 pushl $23 801059c7: 6a 17 push $0x17 jmp alltraps 801059c9: e9 9f fa ff ff jmp 8010546d <alltraps> 801059ce <vector24>: .globl vector24 vector24: pushl $0 801059ce: 6a 00 push $0x0 pushl $24 801059d0: 6a 18 push $0x18 jmp alltraps 801059d2: e9 96 fa ff ff jmp 8010546d <alltraps> 801059d7 <vector25>: .globl vector25 vector25: pushl $0 801059d7: 6a 00 push $0x0 pushl $25 801059d9: 6a 19 push $0x19 jmp alltraps 801059db: e9 8d fa ff ff jmp 8010546d <alltraps> 801059e0 <vector26>: .globl vector26 vector26: pushl $0 801059e0: 6a 00 push $0x0 pushl $26 801059e2: 6a 1a push $0x1a jmp alltraps 801059e4: e9 84 fa ff ff jmp 8010546d <alltraps> 801059e9 <vector27>: .globl vector27 vector27: pushl $0 801059e9: 6a 00 push $0x0 pushl $27 801059eb: 6a 1b push $0x1b jmp alltraps 801059ed: e9 7b fa ff ff jmp 8010546d <alltraps> 801059f2 <vector28>: .globl vector28 vector28: pushl $0 801059f2: 6a 00 push $0x0 pushl $28 801059f4: 6a 1c push $0x1c jmp alltraps 801059f6: e9 72 fa ff ff jmp 8010546d <alltraps> 801059fb <vector29>: .globl vector29 vector29: pushl $0 801059fb: 6a 00 push $0x0 pushl $29 801059fd: 6a 1d push $0x1d jmp alltraps 801059ff: e9 69 fa ff ff jmp 8010546d <alltraps> 80105a04 <vector30>: .globl vector30 vector30: pushl $0 80105a04: 6a 00 push $0x0 pushl $30 80105a06: 6a 1e push $0x1e jmp alltraps 80105a08: e9 60 fa ff ff jmp 8010546d <alltraps> 80105a0d <vector31>: .globl vector31 vector31: pushl $0 80105a0d: 6a 00 push $0x0 pushl $31 80105a0f: 6a 1f push $0x1f jmp alltraps 80105a11: e9 57 fa ff ff jmp 8010546d <alltraps> 80105a16 <vector32>: .globl vector32 vector32: pushl $0 80105a16: 6a 00 push $0x0 pushl $32 80105a18: 6a 20 push $0x20 jmp alltraps 80105a1a: e9 4e fa ff ff jmp 8010546d <alltraps> 80105a1f <vector33>: .globl vector33 vector33: pushl $0 80105a1f: 6a 00 push $0x0 pushl $33 80105a21: 6a 21 push $0x21 jmp alltraps 80105a23: e9 45 fa ff ff jmp 8010546d <alltraps> 80105a28 <vector34>: .globl vector34 vector34: pushl $0 80105a28: 6a 00 push $0x0 pushl $34 80105a2a: 6a 22 push $0x22 jmp alltraps 80105a2c: e9 3c fa ff ff jmp 8010546d <alltraps> 80105a31 <vector35>: .globl vector35 vector35: pushl $0 80105a31: 6a 00 push $0x0 pushl $35 80105a33: 6a 23 push $0x23 jmp alltraps 80105a35: e9 33 fa ff ff jmp 8010546d <alltraps> 80105a3a <vector36>: .globl vector36 vector36: pushl $0 80105a3a: 6a 00 push $0x0 pushl $36 80105a3c: 6a 24 push $0x24 jmp alltraps 80105a3e: e9 2a fa ff ff jmp 8010546d <alltraps> 80105a43 <vector37>: .globl vector37 vector37: pushl $0 80105a43: 6a 00 push $0x0 pushl $37 80105a45: 6a 25 push $0x25 jmp alltraps 80105a47: e9 21 fa ff ff jmp 8010546d <alltraps> 80105a4c <vector38>: .globl vector38 vector38: pushl $0 80105a4c: 6a 00 push $0x0 pushl $38 80105a4e: 6a 26 push $0x26 jmp alltraps 80105a50: e9 18 fa ff ff jmp 8010546d <alltraps> 80105a55 <vector39>: .globl vector39 vector39: pushl $0 80105a55: 6a 00 push $0x0 pushl $39 80105a57: 6a 27 push $0x27 jmp alltraps 80105a59: e9 0f fa ff ff jmp 8010546d <alltraps> 80105a5e <vector40>: .globl vector40 vector40: pushl $0 80105a5e: 6a 00 push $0x0 pushl $40 80105a60: 6a 28 push $0x28 jmp alltraps 80105a62: e9 06 fa ff ff jmp 8010546d <alltraps> 80105a67 <vector41>: .globl vector41 vector41: pushl $0 80105a67: 6a 00 push $0x0 pushl $41 80105a69: 6a 29 push $0x29 jmp alltraps 80105a6b: e9 fd f9 ff ff jmp 8010546d <alltraps> 80105a70 <vector42>: .globl vector42 vector42: pushl $0 80105a70: 6a 00 push $0x0 pushl $42 80105a72: 6a 2a push $0x2a jmp alltraps 80105a74: e9 f4 f9 ff ff jmp 8010546d <alltraps> 80105a79 <vector43>: .globl vector43 vector43: pushl $0 80105a79: 6a 00 push $0x0 pushl $43 80105a7b: 6a 2b push $0x2b jmp alltraps 80105a7d: e9 eb f9 ff ff jmp 8010546d <alltraps> 80105a82 <vector44>: .globl vector44 vector44: pushl $0 80105a82: 6a 00 push $0x0 pushl $44 80105a84: 6a 2c push $0x2c jmp alltraps 80105a86: e9 e2 f9 ff ff jmp 8010546d <alltraps> 80105a8b <vector45>: .globl vector45 vector45: pushl $0 80105a8b: 6a 00 push $0x0 pushl $45 80105a8d: 6a 2d push $0x2d jmp alltraps 80105a8f: e9 d9 f9 ff ff jmp 8010546d <alltraps> 80105a94 <vector46>: .globl vector46 vector46: pushl $0 80105a94: 6a 00 push $0x0 pushl $46 80105a96: 6a 2e push $0x2e jmp alltraps 80105a98: e9 d0 f9 ff ff jmp 8010546d <alltraps> 80105a9d <vector47>: .globl vector47 vector47: pushl $0 80105a9d: 6a 00 push $0x0 pushl $47 80105a9f: 6a 2f push $0x2f jmp alltraps 80105aa1: e9 c7 f9 ff ff jmp 8010546d <alltraps> 80105aa6 <vector48>: .globl vector48 vector48: pushl $0 80105aa6: 6a 00 push $0x0 pushl $48 80105aa8: 6a 30 push $0x30 jmp alltraps 80105aaa: e9 be f9 ff ff jmp 8010546d <alltraps> 80105aaf <vector49>: .globl vector49 vector49: pushl $0 80105aaf: 6a 00 push $0x0 pushl $49 80105ab1: 6a 31 push $0x31 jmp alltraps 80105ab3: e9 b5 f9 ff ff jmp 8010546d <alltraps> 80105ab8 <vector50>: .globl vector50 vector50: pushl $0 80105ab8: 6a 00 push $0x0 pushl $50 80105aba: 6a 32 push $0x32 jmp alltraps 80105abc: e9 ac f9 ff ff jmp 8010546d <alltraps> 80105ac1 <vector51>: .globl vector51 vector51: pushl $0 80105ac1: 6a 00 push $0x0 pushl $51 80105ac3: 6a 33 push $0x33 jmp alltraps 80105ac5: e9 a3 f9 ff ff jmp 8010546d <alltraps> 80105aca <vector52>: .globl vector52 vector52: pushl $0 80105aca: 6a 00 push $0x0 pushl $52 80105acc: 6a 34 push $0x34 jmp alltraps 80105ace: e9 9a f9 ff ff jmp 8010546d <alltraps> 80105ad3 <vector53>: .globl vector53 vector53: pushl $0 80105ad3: 6a 00 push $0x0 pushl $53 80105ad5: 6a 35 push $0x35 jmp alltraps 80105ad7: e9 91 f9 ff ff jmp 8010546d <alltraps> 80105adc <vector54>: .globl vector54 vector54: pushl $0 80105adc: 6a 00 push $0x0 pushl $54 80105ade: 6a 36 push $0x36 jmp alltraps 80105ae0: e9 88 f9 ff ff jmp 8010546d <alltraps> 80105ae5 <vector55>: .globl vector55 vector55: pushl $0 80105ae5: 6a 00 push $0x0 pushl $55 80105ae7: 6a 37 push $0x37 jmp alltraps 80105ae9: e9 7f f9 ff ff jmp 8010546d <alltraps> 80105aee <vector56>: .globl vector56 vector56: pushl $0 80105aee: 6a 00 push $0x0 pushl $56 80105af0: 6a 38 push $0x38 jmp alltraps 80105af2: e9 76 f9 ff ff jmp 8010546d <alltraps> 80105af7 <vector57>: .globl vector57 vector57: pushl $0 80105af7: 6a 00 push $0x0 pushl $57 80105af9: 6a 39 push $0x39 jmp alltraps 80105afb: e9 6d f9 ff ff jmp 8010546d <alltraps> 80105b00 <vector58>: .globl vector58 vector58: pushl $0 80105b00: 6a 00 push $0x0 pushl $58 80105b02: 6a 3a push $0x3a jmp alltraps 80105b04: e9 64 f9 ff ff jmp 8010546d <alltraps> 80105b09 <vector59>: .globl vector59 vector59: pushl $0 80105b09: 6a 00 push $0x0 pushl $59 80105b0b: 6a 3b push $0x3b jmp alltraps 80105b0d: e9 5b f9 ff ff jmp 8010546d <alltraps> 80105b12 <vector60>: .globl vector60 vector60: pushl $0 80105b12: 6a 00 push $0x0 pushl $60 80105b14: 6a 3c push $0x3c jmp alltraps 80105b16: e9 52 f9 ff ff jmp 8010546d <alltraps> 80105b1b <vector61>: .globl vector61 vector61: pushl $0 80105b1b: 6a 00 push $0x0 pushl $61 80105b1d: 6a 3d push $0x3d jmp alltraps 80105b1f: e9 49 f9 ff ff jmp 8010546d <alltraps> 80105b24 <vector62>: .globl vector62 vector62: pushl $0 80105b24: 6a 00 push $0x0 pushl $62 80105b26: 6a 3e push $0x3e jmp alltraps 80105b28: e9 40 f9 ff ff jmp 8010546d <alltraps> 80105b2d <vector63>: .globl vector63 vector63: pushl $0 80105b2d: 6a 00 push $0x0 pushl $63 80105b2f: 6a 3f push $0x3f jmp alltraps 80105b31: e9 37 f9 ff ff jmp 8010546d <alltraps> 80105b36 <vector64>: .globl vector64 vector64: pushl $0 80105b36: 6a 00 push $0x0 pushl $64 80105b38: 6a 40 push $0x40 jmp alltraps 80105b3a: e9 2e f9 ff ff jmp 8010546d <alltraps> 80105b3f <vector65>: .globl vector65 vector65: pushl $0 80105b3f: 6a 00 push $0x0 pushl $65 80105b41: 6a 41 push $0x41 jmp alltraps 80105b43: e9 25 f9 ff ff jmp 8010546d <alltraps> 80105b48 <vector66>: .globl vector66 vector66: pushl $0 80105b48: 6a 00 push $0x0 pushl $66 80105b4a: 6a 42 push $0x42 jmp alltraps 80105b4c: e9 1c f9 ff ff jmp 8010546d <alltraps> 80105b51 <vector67>: .globl vector67 vector67: pushl $0 80105b51: 6a 00 push $0x0 pushl $67 80105b53: 6a 43 push $0x43 jmp alltraps 80105b55: e9 13 f9 ff ff jmp 8010546d <alltraps> 80105b5a <vector68>: .globl vector68 vector68: pushl $0 80105b5a: 6a 00 push $0x0 pushl $68 80105b5c: 6a 44 push $0x44 jmp alltraps 80105b5e: e9 0a f9 ff ff jmp 8010546d <alltraps> 80105b63 <vector69>: .globl vector69 vector69: pushl $0 80105b63: 6a 00 push $0x0 pushl $69 80105b65: 6a 45 push $0x45 jmp alltraps 80105b67: e9 01 f9 ff ff jmp 8010546d <alltraps> 80105b6c <vector70>: .globl vector70 vector70: pushl $0 80105b6c: 6a 00 push $0x0 pushl $70 80105b6e: 6a 46 push $0x46 jmp alltraps 80105b70: e9 f8 f8 ff ff jmp 8010546d <alltraps> 80105b75 <vector71>: .globl vector71 vector71: pushl $0 80105b75: 6a 00 push $0x0 pushl $71 80105b77: 6a 47 push $0x47 jmp alltraps 80105b79: e9 ef f8 ff ff jmp 8010546d <alltraps> 80105b7e <vector72>: .globl vector72 vector72: pushl $0 80105b7e: 6a 00 push $0x0 pushl $72 80105b80: 6a 48 push $0x48 jmp alltraps 80105b82: e9 e6 f8 ff ff jmp 8010546d <alltraps> 80105b87 <vector73>: .globl vector73 vector73: pushl $0 80105b87: 6a 00 push $0x0 pushl $73 80105b89: 6a 49 push $0x49 jmp alltraps 80105b8b: e9 dd f8 ff ff jmp 8010546d <alltraps> 80105b90 <vector74>: .globl vector74 vector74: pushl $0 80105b90: 6a 00 push $0x0 pushl $74 80105b92: 6a 4a push $0x4a jmp alltraps 80105b94: e9 d4 f8 ff ff jmp 8010546d <alltraps> 80105b99 <vector75>: .globl vector75 vector75: pushl $0 80105b99: 6a 00 push $0x0 pushl $75 80105b9b: 6a 4b push $0x4b jmp alltraps 80105b9d: e9 cb f8 ff ff jmp 8010546d <alltraps> 80105ba2 <vector76>: .globl vector76 vector76: pushl $0 80105ba2: 6a 00 push $0x0 pushl $76 80105ba4: 6a 4c push $0x4c jmp alltraps 80105ba6: e9 c2 f8 ff ff jmp 8010546d <alltraps> 80105bab <vector77>: .globl vector77 vector77: pushl $0 80105bab: 6a 00 push $0x0 pushl $77 80105bad: 6a 4d push $0x4d jmp alltraps 80105baf: e9 b9 f8 ff ff jmp 8010546d <alltraps> 80105bb4 <vector78>: .globl vector78 vector78: pushl $0 80105bb4: 6a 00 push $0x0 pushl $78 80105bb6: 6a 4e push $0x4e jmp alltraps 80105bb8: e9 b0 f8 ff ff jmp 8010546d <alltraps> 80105bbd <vector79>: .globl vector79 vector79: pushl $0 80105bbd: 6a 00 push $0x0 pushl $79 80105bbf: 6a 4f push $0x4f jmp alltraps 80105bc1: e9 a7 f8 ff ff jmp 8010546d <alltraps> 80105bc6 <vector80>: .globl vector80 vector80: pushl $0 80105bc6: 6a 00 push $0x0 pushl $80 80105bc8: 6a 50 push $0x50 jmp alltraps 80105bca: e9 9e f8 ff ff jmp 8010546d <alltraps> 80105bcf <vector81>: .globl vector81 vector81: pushl $0 80105bcf: 6a 00 push $0x0 pushl $81 80105bd1: 6a 51 push $0x51 jmp alltraps 80105bd3: e9 95 f8 ff ff jmp 8010546d <alltraps> 80105bd8 <vector82>: .globl vector82 vector82: pushl $0 80105bd8: 6a 00 push $0x0 pushl $82 80105bda: 6a 52 push $0x52 jmp alltraps 80105bdc: e9 8c f8 ff ff jmp 8010546d <alltraps> 80105be1 <vector83>: .globl vector83 vector83: pushl $0 80105be1: 6a 00 push $0x0 pushl $83 80105be3: 6a 53 push $0x53 jmp alltraps 80105be5: e9 83 f8 ff ff jmp 8010546d <alltraps> 80105bea <vector84>: .globl vector84 vector84: pushl $0 80105bea: 6a 00 push $0x0 pushl $84 80105bec: 6a 54 push $0x54 jmp alltraps 80105bee: e9 7a f8 ff ff jmp 8010546d <alltraps> 80105bf3 <vector85>: .globl vector85 vector85: pushl $0 80105bf3: 6a 00 push $0x0 pushl $85 80105bf5: 6a 55 push $0x55 jmp alltraps 80105bf7: e9 71 f8 ff ff jmp 8010546d <alltraps> 80105bfc <vector86>: .globl vector86 vector86: pushl $0 80105bfc: 6a 00 push $0x0 pushl $86 80105bfe: 6a 56 push $0x56 jmp alltraps 80105c00: e9 68 f8 ff ff jmp 8010546d <alltraps> 80105c05 <vector87>: .globl vector87 vector87: pushl $0 80105c05: 6a 00 push $0x0 pushl $87 80105c07: 6a 57 push $0x57 jmp alltraps 80105c09: e9 5f f8 ff ff jmp 8010546d <alltraps> 80105c0e <vector88>: .globl vector88 vector88: pushl $0 80105c0e: 6a 00 push $0x0 pushl $88 80105c10: 6a 58 push $0x58 jmp alltraps 80105c12: e9 56 f8 ff ff jmp 8010546d <alltraps> 80105c17 <vector89>: .globl vector89 vector89: pushl $0 80105c17: 6a 00 push $0x0 pushl $89 80105c19: 6a 59 push $0x59 jmp alltraps 80105c1b: e9 4d f8 ff ff jmp 8010546d <alltraps> 80105c20 <vector90>: .globl vector90 vector90: pushl $0 80105c20: 6a 00 push $0x0 pushl $90 80105c22: 6a 5a push $0x5a jmp alltraps 80105c24: e9 44 f8 ff ff jmp 8010546d <alltraps> 80105c29 <vector91>: .globl vector91 vector91: pushl $0 80105c29: 6a 00 push $0x0 pushl $91 80105c2b: 6a 5b push $0x5b jmp alltraps 80105c2d: e9 3b f8 ff ff jmp 8010546d <alltraps> 80105c32 <vector92>: .globl vector92 vector92: pushl $0 80105c32: 6a 00 push $0x0 pushl $92 80105c34: 6a 5c push $0x5c jmp alltraps 80105c36: e9 32 f8 ff ff jmp 8010546d <alltraps> 80105c3b <vector93>: .globl vector93 vector93: pushl $0 80105c3b: 6a 00 push $0x0 pushl $93 80105c3d: 6a 5d push $0x5d jmp alltraps 80105c3f: e9 29 f8 ff ff jmp 8010546d <alltraps> 80105c44 <vector94>: .globl vector94 vector94: pushl $0 80105c44: 6a 00 push $0x0 pushl $94 80105c46: 6a 5e push $0x5e jmp alltraps 80105c48: e9 20 f8 ff ff jmp 8010546d <alltraps> 80105c4d <vector95>: .globl vector95 vector95: pushl $0 80105c4d: 6a 00 push $0x0 pushl $95 80105c4f: 6a 5f push $0x5f jmp alltraps 80105c51: e9 17 f8 ff ff jmp 8010546d <alltraps> 80105c56 <vector96>: .globl vector96 vector96: pushl $0 80105c56: 6a 00 push $0x0 pushl $96 80105c58: 6a 60 push $0x60 jmp alltraps 80105c5a: e9 0e f8 ff ff jmp 8010546d <alltraps> 80105c5f <vector97>: .globl vector97 vector97: pushl $0 80105c5f: 6a 00 push $0x0 pushl $97 80105c61: 6a 61 push $0x61 jmp alltraps 80105c63: e9 05 f8 ff ff jmp 8010546d <alltraps> 80105c68 <vector98>: .globl vector98 vector98: pushl $0 80105c68: 6a 00 push $0x0 pushl $98 80105c6a: 6a 62 push $0x62 jmp alltraps 80105c6c: e9 fc f7 ff ff jmp 8010546d <alltraps> 80105c71 <vector99>: .globl vector99 vector99: pushl $0 80105c71: 6a 00 push $0x0 pushl $99 80105c73: 6a 63 push $0x63 jmp alltraps 80105c75: e9 f3 f7 ff ff jmp 8010546d <alltraps> 80105c7a <vector100>: .globl vector100 vector100: pushl $0 80105c7a: 6a 00 push $0x0 pushl $100 80105c7c: 6a 64 push $0x64 jmp alltraps 80105c7e: e9 ea f7 ff ff jmp 8010546d <alltraps> 80105c83 <vector101>: .globl vector101 vector101: pushl $0 80105c83: 6a 00 push $0x0 pushl $101 80105c85: 6a 65 push $0x65 jmp alltraps 80105c87: e9 e1 f7 ff ff jmp 8010546d <alltraps> 80105c8c <vector102>: .globl vector102 vector102: pushl $0 80105c8c: 6a 00 push $0x0 pushl $102 80105c8e: 6a 66 push $0x66 jmp alltraps 80105c90: e9 d8 f7 ff ff jmp 8010546d <alltraps> 80105c95 <vector103>: .globl vector103 vector103: pushl $0 80105c95: 6a 00 push $0x0 pushl $103 80105c97: 6a 67 push $0x67 jmp alltraps 80105c99: e9 cf f7 ff ff jmp 8010546d <alltraps> 80105c9e <vector104>: .globl vector104 vector104: pushl $0 80105c9e: 6a 00 push $0x0 pushl $104 80105ca0: 6a 68 push $0x68 jmp alltraps 80105ca2: e9 c6 f7 ff ff jmp 8010546d <alltraps> 80105ca7 <vector105>: .globl vector105 vector105: pushl $0 80105ca7: 6a 00 push $0x0 pushl $105 80105ca9: 6a 69 push $0x69 jmp alltraps 80105cab: e9 bd f7 ff ff jmp 8010546d <alltraps> 80105cb0 <vector106>: .globl vector106 vector106: pushl $0 80105cb0: 6a 00 push $0x0 pushl $106 80105cb2: 6a 6a push $0x6a jmp alltraps 80105cb4: e9 b4 f7 ff ff jmp 8010546d <alltraps> 80105cb9 <vector107>: .globl vector107 vector107: pushl $0 80105cb9: 6a 00 push $0x0 pushl $107 80105cbb: 6a 6b push $0x6b jmp alltraps 80105cbd: e9 ab f7 ff ff jmp 8010546d <alltraps> 80105cc2 <vector108>: .globl vector108 vector108: pushl $0 80105cc2: 6a 00 push $0x0 pushl $108 80105cc4: 6a 6c push $0x6c jmp alltraps 80105cc6: e9 a2 f7 ff ff jmp 8010546d <alltraps> 80105ccb <vector109>: .globl vector109 vector109: pushl $0 80105ccb: 6a 00 push $0x0 pushl $109 80105ccd: 6a 6d push $0x6d jmp alltraps 80105ccf: e9 99 f7 ff ff jmp 8010546d <alltraps> 80105cd4 <vector110>: .globl vector110 vector110: pushl $0 80105cd4: 6a 00 push $0x0 pushl $110 80105cd6: 6a 6e push $0x6e jmp alltraps 80105cd8: e9 90 f7 ff ff jmp 8010546d <alltraps> 80105cdd <vector111>: .globl vector111 vector111: pushl $0 80105cdd: 6a 00 push $0x0 pushl $111 80105cdf: 6a 6f push $0x6f jmp alltraps 80105ce1: e9 87 f7 ff ff jmp 8010546d <alltraps> 80105ce6 <vector112>: .globl vector112 vector112: pushl $0 80105ce6: 6a 00 push $0x0 pushl $112 80105ce8: 6a 70 push $0x70 jmp alltraps 80105cea: e9 7e f7 ff ff jmp 8010546d <alltraps> 80105cef <vector113>: .globl vector113 vector113: pushl $0 80105cef: 6a 00 push $0x0 pushl $113 80105cf1: 6a 71 push $0x71 jmp alltraps 80105cf3: e9 75 f7 ff ff jmp 8010546d <alltraps> 80105cf8 <vector114>: .globl vector114 vector114: pushl $0 80105cf8: 6a 00 push $0x0 pushl $114 80105cfa: 6a 72 push $0x72 jmp alltraps 80105cfc: e9 6c f7 ff ff jmp 8010546d <alltraps> 80105d01 <vector115>: .globl vector115 vector115: pushl $0 80105d01: 6a 00 push $0x0 pushl $115 80105d03: 6a 73 push $0x73 jmp alltraps 80105d05: e9 63 f7 ff ff jmp 8010546d <alltraps> 80105d0a <vector116>: .globl vector116 vector116: pushl $0 80105d0a: 6a 00 push $0x0 pushl $116 80105d0c: 6a 74 push $0x74 jmp alltraps 80105d0e: e9 5a f7 ff ff jmp 8010546d <alltraps> 80105d13 <vector117>: .globl vector117 vector117: pushl $0 80105d13: 6a 00 push $0x0 pushl $117 80105d15: 6a 75 push $0x75 jmp alltraps 80105d17: e9 51 f7 ff ff jmp 8010546d <alltraps> 80105d1c <vector118>: .globl vector118 vector118: pushl $0 80105d1c: 6a 00 push $0x0 pushl $118 80105d1e: 6a 76 push $0x76 jmp alltraps 80105d20: e9 48 f7 ff ff jmp 8010546d <alltraps> 80105d25 <vector119>: .globl vector119 vector119: pushl $0 80105d25: 6a 00 push $0x0 pushl $119 80105d27: 6a 77 push $0x77 jmp alltraps 80105d29: e9 3f f7 ff ff jmp 8010546d <alltraps> 80105d2e <vector120>: .globl vector120 vector120: pushl $0 80105d2e: 6a 00 push $0x0 pushl $120 80105d30: 6a 78 push $0x78 jmp alltraps 80105d32: e9 36 f7 ff ff jmp 8010546d <alltraps> 80105d37 <vector121>: .globl vector121 vector121: pushl $0 80105d37: 6a 00 push $0x0 pushl $121 80105d39: 6a 79 push $0x79 jmp alltraps 80105d3b: e9 2d f7 ff ff jmp 8010546d <alltraps> 80105d40 <vector122>: .globl vector122 vector122: pushl $0 80105d40: 6a 00 push $0x0 pushl $122 80105d42: 6a 7a push $0x7a jmp alltraps 80105d44: e9 24 f7 ff ff jmp 8010546d <alltraps> 80105d49 <vector123>: .globl vector123 vector123: pushl $0 80105d49: 6a 00 push $0x0 pushl $123 80105d4b: 6a 7b push $0x7b jmp alltraps 80105d4d: e9 1b f7 ff ff jmp 8010546d <alltraps> 80105d52 <vector124>: .globl vector124 vector124: pushl $0 80105d52: 6a 00 push $0x0 pushl $124 80105d54: 6a 7c push $0x7c jmp alltraps 80105d56: e9 12 f7 ff ff jmp 8010546d <alltraps> 80105d5b <vector125>: .globl vector125 vector125: pushl $0 80105d5b: 6a 00 push $0x0 pushl $125 80105d5d: 6a 7d push $0x7d jmp alltraps 80105d5f: e9 09 f7 ff ff jmp 8010546d <alltraps> 80105d64 <vector126>: .globl vector126 vector126: pushl $0 80105d64: 6a 00 push $0x0 pushl $126 80105d66: 6a 7e push $0x7e jmp alltraps 80105d68: e9 00 f7 ff ff jmp 8010546d <alltraps> 80105d6d <vector127>: .globl vector127 vector127: pushl $0 80105d6d: 6a 00 push $0x0 pushl $127 80105d6f: 6a 7f push $0x7f jmp alltraps 80105d71: e9 f7 f6 ff ff jmp 8010546d <alltraps> 80105d76 <vector128>: .globl vector128 vector128: pushl $0 80105d76: 6a 00 push $0x0 pushl $128 80105d78: 68 80 00 00 00 push $0x80 jmp alltraps 80105d7d: e9 eb f6 ff ff jmp 8010546d <alltraps> 80105d82 <vector129>: .globl vector129 vector129: pushl $0 80105d82: 6a 00 push $0x0 pushl $129 80105d84: 68 81 00 00 00 push $0x81 jmp alltraps 80105d89: e9 df f6 ff ff jmp 8010546d <alltraps> 80105d8e <vector130>: .globl vector130 vector130: pushl $0 80105d8e: 6a 00 push $0x0 pushl $130 80105d90: 68 82 00 00 00 push $0x82 jmp alltraps 80105d95: e9 d3 f6 ff ff jmp 8010546d <alltraps> 80105d9a <vector131>: .globl vector131 vector131: pushl $0 80105d9a: 6a 00 push $0x0 pushl $131 80105d9c: 68 83 00 00 00 push $0x83 jmp alltraps 80105da1: e9 c7 f6 ff ff jmp 8010546d <alltraps> 80105da6 <vector132>: .globl vector132 vector132: pushl $0 80105da6: 6a 00 push $0x0 pushl $132 80105da8: 68 84 00 00 00 push $0x84 jmp alltraps 80105dad: e9 bb f6 ff ff jmp 8010546d <alltraps> 80105db2 <vector133>: .globl vector133 vector133: pushl $0 80105db2: 6a 00 push $0x0 pushl $133 80105db4: 68 85 00 00 00 push $0x85 jmp alltraps 80105db9: e9 af f6 ff ff jmp 8010546d <alltraps> 80105dbe <vector134>: .globl vector134 vector134: pushl $0 80105dbe: 6a 00 push $0x0 pushl $134 80105dc0: 68 86 00 00 00 push $0x86 jmp alltraps 80105dc5: e9 a3 f6 ff ff jmp 8010546d <alltraps> 80105dca <vector135>: .globl vector135 vector135: pushl $0 80105dca: 6a 00 push $0x0 pushl $135 80105dcc: 68 87 00 00 00 push $0x87 jmp alltraps 80105dd1: e9 97 f6 ff ff jmp 8010546d <alltraps> 80105dd6 <vector136>: .globl vector136 vector136: pushl $0 80105dd6: 6a 00 push $0x0 pushl $136 80105dd8: 68 88 00 00 00 push $0x88 jmp alltraps 80105ddd: e9 8b f6 ff ff jmp 8010546d <alltraps> 80105de2 <vector137>: .globl vector137 vector137: pushl $0 80105de2: 6a 00 push $0x0 pushl $137 80105de4: 68 89 00 00 00 push $0x89 jmp alltraps 80105de9: e9 7f f6 ff ff jmp 8010546d <alltraps> 80105dee <vector138>: .globl vector138 vector138: pushl $0 80105dee: 6a 00 push $0x0 pushl $138 80105df0: 68 8a 00 00 00 push $0x8a jmp alltraps 80105df5: e9 73 f6 ff ff jmp 8010546d <alltraps> 80105dfa <vector139>: .globl vector139 vector139: pushl $0 80105dfa: 6a 00 push $0x0 pushl $139 80105dfc: 68 8b 00 00 00 push $0x8b jmp alltraps 80105e01: e9 67 f6 ff ff jmp 8010546d <alltraps> 80105e06 <vector140>: .globl vector140 vector140: pushl $0 80105e06: 6a 00 push $0x0 pushl $140 80105e08: 68 8c 00 00 00 push $0x8c jmp alltraps 80105e0d: e9 5b f6 ff ff jmp 8010546d <alltraps> 80105e12 <vector141>: .globl vector141 vector141: pushl $0 80105e12: 6a 00 push $0x0 pushl $141 80105e14: 68 8d 00 00 00 push $0x8d jmp alltraps 80105e19: e9 4f f6 ff ff jmp 8010546d <alltraps> 80105e1e <vector142>: .globl vector142 vector142: pushl $0 80105e1e: 6a 00 push $0x0 pushl $142 80105e20: 68 8e 00 00 00 push $0x8e jmp alltraps 80105e25: e9 43 f6 ff ff jmp 8010546d <alltraps> 80105e2a <vector143>: .globl vector143 vector143: pushl $0 80105e2a: 6a 00 push $0x0 pushl $143 80105e2c: 68 8f 00 00 00 push $0x8f jmp alltraps 80105e31: e9 37 f6 ff ff jmp 8010546d <alltraps> 80105e36 <vector144>: .globl vector144 vector144: pushl $0 80105e36: 6a 00 push $0x0 pushl $144 80105e38: 68 90 00 00 00 push $0x90 jmp alltraps 80105e3d: e9 2b f6 ff ff jmp 8010546d <alltraps> 80105e42 <vector145>: .globl vector145 vector145: pushl $0 80105e42: 6a 00 push $0x0 pushl $145 80105e44: 68 91 00 00 00 push $0x91 jmp alltraps 80105e49: e9 1f f6 ff ff jmp 8010546d <alltraps> 80105e4e <vector146>: .globl vector146 vector146: pushl $0 80105e4e: 6a 00 push $0x0 pushl $146 80105e50: 68 92 00 00 00 push $0x92 jmp alltraps 80105e55: e9 13 f6 ff ff jmp 8010546d <alltraps> 80105e5a <vector147>: .globl vector147 vector147: pushl $0 80105e5a: 6a 00 push $0x0 pushl $147 80105e5c: 68 93 00 00 00 push $0x93 jmp alltraps 80105e61: e9 07 f6 ff ff jmp 8010546d <alltraps> 80105e66 <vector148>: .globl vector148 vector148: pushl $0 80105e66: 6a 00 push $0x0 pushl $148 80105e68: 68 94 00 00 00 push $0x94 jmp alltraps 80105e6d: e9 fb f5 ff ff jmp 8010546d <alltraps> 80105e72 <vector149>: .globl vector149 vector149: pushl $0 80105e72: 6a 00 push $0x0 pushl $149 80105e74: 68 95 00 00 00 push $0x95 jmp alltraps 80105e79: e9 ef f5 ff ff jmp 8010546d <alltraps> 80105e7e <vector150>: .globl vector150 vector150: pushl $0 80105e7e: 6a 00 push $0x0 pushl $150 80105e80: 68 96 00 00 00 push $0x96 jmp alltraps 80105e85: e9 e3 f5 ff ff jmp 8010546d <alltraps> 80105e8a <vector151>: .globl vector151 vector151: pushl $0 80105e8a: 6a 00 push $0x0 pushl $151 80105e8c: 68 97 00 00 00 push $0x97 jmp alltraps 80105e91: e9 d7 f5 ff ff jmp 8010546d <alltraps> 80105e96 <vector152>: .globl vector152 vector152: pushl $0 80105e96: 6a 00 push $0x0 pushl $152 80105e98: 68 98 00 00 00 push $0x98 jmp alltraps 80105e9d: e9 cb f5 ff ff jmp 8010546d <alltraps> 80105ea2 <vector153>: .globl vector153 vector153: pushl $0 80105ea2: 6a 00 push $0x0 pushl $153 80105ea4: 68 99 00 00 00 push $0x99 jmp alltraps 80105ea9: e9 bf f5 ff ff jmp 8010546d <alltraps> 80105eae <vector154>: .globl vector154 vector154: pushl $0 80105eae: 6a 00 push $0x0 pushl $154 80105eb0: 68 9a 00 00 00 push $0x9a jmp alltraps 80105eb5: e9 b3 f5 ff ff jmp 8010546d <alltraps> 80105eba <vector155>: .globl vector155 vector155: pushl $0 80105eba: 6a 00 push $0x0 pushl $155 80105ebc: 68 9b 00 00 00 push $0x9b jmp alltraps 80105ec1: e9 a7 f5 ff ff jmp 8010546d <alltraps> 80105ec6 <vector156>: .globl vector156 vector156: pushl $0 80105ec6: 6a 00 push $0x0 pushl $156 80105ec8: 68 9c 00 00 00 push $0x9c jmp alltraps 80105ecd: e9 9b f5 ff ff jmp 8010546d <alltraps> 80105ed2 <vector157>: .globl vector157 vector157: pushl $0 80105ed2: 6a 00 push $0x0 pushl $157 80105ed4: 68 9d 00 00 00 push $0x9d jmp alltraps 80105ed9: e9 8f f5 ff ff jmp 8010546d <alltraps> 80105ede <vector158>: .globl vector158 vector158: pushl $0 80105ede: 6a 00 push $0x0 pushl $158 80105ee0: 68 9e 00 00 00 push $0x9e jmp alltraps 80105ee5: e9 83 f5 ff ff jmp 8010546d <alltraps> 80105eea <vector159>: .globl vector159 vector159: pushl $0 80105eea: 6a 00 push $0x0 pushl $159 80105eec: 68 9f 00 00 00 push $0x9f jmp alltraps 80105ef1: e9 77 f5 ff ff jmp 8010546d <alltraps> 80105ef6 <vector160>: .globl vector160 vector160: pushl $0 80105ef6: 6a 00 push $0x0 pushl $160 80105ef8: 68 a0 00 00 00 push $0xa0 jmp alltraps 80105efd: e9 6b f5 ff ff jmp 8010546d <alltraps> 80105f02 <vector161>: .globl vector161 vector161: pushl $0 80105f02: 6a 00 push $0x0 pushl $161 80105f04: 68 a1 00 00 00 push $0xa1 jmp alltraps 80105f09: e9 5f f5 ff ff jmp 8010546d <alltraps> 80105f0e <vector162>: .globl vector162 vector162: pushl $0 80105f0e: 6a 00 push $0x0 pushl $162 80105f10: 68 a2 00 00 00 push $0xa2 jmp alltraps 80105f15: e9 53 f5 ff ff jmp 8010546d <alltraps> 80105f1a <vector163>: .globl vector163 vector163: pushl $0 80105f1a: 6a 00 push $0x0 pushl $163 80105f1c: 68 a3 00 00 00 push $0xa3 jmp alltraps 80105f21: e9 47 f5 ff ff jmp 8010546d <alltraps> 80105f26 <vector164>: .globl vector164 vector164: pushl $0 80105f26: 6a 00 push $0x0 pushl $164 80105f28: 68 a4 00 00 00 push $0xa4 jmp alltraps 80105f2d: e9 3b f5 ff ff jmp 8010546d <alltraps> 80105f32 <vector165>: .globl vector165 vector165: pushl $0 80105f32: 6a 00 push $0x0 pushl $165 80105f34: 68 a5 00 00 00 push $0xa5 jmp alltraps 80105f39: e9 2f f5 ff ff jmp 8010546d <alltraps> 80105f3e <vector166>: .globl vector166 vector166: pushl $0 80105f3e: 6a 00 push $0x0 pushl $166 80105f40: 68 a6 00 00 00 push $0xa6 jmp alltraps 80105f45: e9 23 f5 ff ff jmp 8010546d <alltraps> 80105f4a <vector167>: .globl vector167 vector167: pushl $0 80105f4a: 6a 00 push $0x0 pushl $167 80105f4c: 68 a7 00 00 00 push $0xa7 jmp alltraps 80105f51: e9 17 f5 ff ff jmp 8010546d <alltraps> 80105f56 <vector168>: .globl vector168 vector168: pushl $0 80105f56: 6a 00 push $0x0 pushl $168 80105f58: 68 a8 00 00 00 push $0xa8 jmp alltraps 80105f5d: e9 0b f5 ff ff jmp 8010546d <alltraps> 80105f62 <vector169>: .globl vector169 vector169: pushl $0 80105f62: 6a 00 push $0x0 pushl $169 80105f64: 68 a9 00 00 00 push $0xa9 jmp alltraps 80105f69: e9 ff f4 ff ff jmp 8010546d <alltraps> 80105f6e <vector170>: .globl vector170 vector170: pushl $0 80105f6e: 6a 00 push $0x0 pushl $170 80105f70: 68 aa 00 00 00 push $0xaa jmp alltraps 80105f75: e9 f3 f4 ff ff jmp 8010546d <alltraps> 80105f7a <vector171>: .globl vector171 vector171: pushl $0 80105f7a: 6a 00 push $0x0 pushl $171 80105f7c: 68 ab 00 00 00 push $0xab jmp alltraps 80105f81: e9 e7 f4 ff ff jmp 8010546d <alltraps> 80105f86 <vector172>: .globl vector172 vector172: pushl $0 80105f86: 6a 00 push $0x0 pushl $172 80105f88: 68 ac 00 00 00 push $0xac jmp alltraps 80105f8d: e9 db f4 ff ff jmp 8010546d <alltraps> 80105f92 <vector173>: .globl vector173 vector173: pushl $0 80105f92: 6a 00 push $0x0 pushl $173 80105f94: 68 ad 00 00 00 push $0xad jmp alltraps 80105f99: e9 cf f4 ff ff jmp 8010546d <alltraps> 80105f9e <vector174>: .globl vector174 vector174: pushl $0 80105f9e: 6a 00 push $0x0 pushl $174 80105fa0: 68 ae 00 00 00 push $0xae jmp alltraps 80105fa5: e9 c3 f4 ff ff jmp 8010546d <alltraps> 80105faa <vector175>: .globl vector175 vector175: pushl $0 80105faa: 6a 00 push $0x0 pushl $175 80105fac: 68 af 00 00 00 push $0xaf jmp alltraps 80105fb1: e9 b7 f4 ff ff jmp 8010546d <alltraps> 80105fb6 <vector176>: .globl vector176 vector176: pushl $0 80105fb6: 6a 00 push $0x0 pushl $176 80105fb8: 68 b0 00 00 00 push $0xb0 jmp alltraps 80105fbd: e9 ab f4 ff ff jmp 8010546d <alltraps> 80105fc2 <vector177>: .globl vector177 vector177: pushl $0 80105fc2: 6a 00 push $0x0 pushl $177 80105fc4: 68 b1 00 00 00 push $0xb1 jmp alltraps 80105fc9: e9 9f f4 ff ff jmp 8010546d <alltraps> 80105fce <vector178>: .globl vector178 vector178: pushl $0 80105fce: 6a 00 push $0x0 pushl $178 80105fd0: 68 b2 00 00 00 push $0xb2 jmp alltraps 80105fd5: e9 93 f4 ff ff jmp 8010546d <alltraps> 80105fda <vector179>: .globl vector179 vector179: pushl $0 80105fda: 6a 00 push $0x0 pushl $179 80105fdc: 68 b3 00 00 00 push $0xb3 jmp alltraps 80105fe1: e9 87 f4 ff ff jmp 8010546d <alltraps> 80105fe6 <vector180>: .globl vector180 vector180: pushl $0 80105fe6: 6a 00 push $0x0 pushl $180 80105fe8: 68 b4 00 00 00 push $0xb4 jmp alltraps 80105fed: e9 7b f4 ff ff jmp 8010546d <alltraps> 80105ff2 <vector181>: .globl vector181 vector181: pushl $0 80105ff2: 6a 00 push $0x0 pushl $181 80105ff4: 68 b5 00 00 00 push $0xb5 jmp alltraps 80105ff9: e9 6f f4 ff ff jmp 8010546d <alltraps> 80105ffe <vector182>: .globl vector182 vector182: pushl $0 80105ffe: 6a 00 push $0x0 pushl $182 80106000: 68 b6 00 00 00 push $0xb6 jmp alltraps 80106005: e9 63 f4 ff ff jmp 8010546d <alltraps> 8010600a <vector183>: .globl vector183 vector183: pushl $0 8010600a: 6a 00 push $0x0 pushl $183 8010600c: 68 b7 00 00 00 push $0xb7 jmp alltraps 80106011: e9 57 f4 ff ff jmp 8010546d <alltraps> 80106016 <vector184>: .globl vector184 vector184: pushl $0 80106016: 6a 00 push $0x0 pushl $184 80106018: 68 b8 00 00 00 push $0xb8 jmp alltraps 8010601d: e9 4b f4 ff ff jmp 8010546d <alltraps> 80106022 <vector185>: .globl vector185 vector185: pushl $0 80106022: 6a 00 push $0x0 pushl $185 80106024: 68 b9 00 00 00 push $0xb9 jmp alltraps 80106029: e9 3f f4 ff ff jmp 8010546d <alltraps> 8010602e <vector186>: .globl vector186 vector186: pushl $0 8010602e: 6a 00 push $0x0 pushl $186 80106030: 68 ba 00 00 00 push $0xba jmp alltraps 80106035: e9 33 f4 ff ff jmp 8010546d <alltraps> 8010603a <vector187>: .globl vector187 vector187: pushl $0 8010603a: 6a 00 push $0x0 pushl $187 8010603c: 68 bb 00 00 00 push $0xbb jmp alltraps 80106041: e9 27 f4 ff ff jmp 8010546d <alltraps> 80106046 <vector188>: .globl vector188 vector188: pushl $0 80106046: 6a 00 push $0x0 pushl $188 80106048: 68 bc 00 00 00 push $0xbc jmp alltraps 8010604d: e9 1b f4 ff ff jmp 8010546d <alltraps> 80106052 <vector189>: .globl vector189 vector189: pushl $0 80106052: 6a 00 push $0x0 pushl $189 80106054: 68 bd 00 00 00 push $0xbd jmp alltraps 80106059: e9 0f f4 ff ff jmp 8010546d <alltraps> 8010605e <vector190>: .globl vector190 vector190: pushl $0 8010605e: 6a 00 push $0x0 pushl $190 80106060: 68 be 00 00 00 push $0xbe jmp alltraps 80106065: e9 03 f4 ff ff jmp 8010546d <alltraps> 8010606a <vector191>: .globl vector191 vector191: pushl $0 8010606a: 6a 00 push $0x0 pushl $191 8010606c: 68 bf 00 00 00 push $0xbf jmp alltraps 80106071: e9 f7 f3 ff ff jmp 8010546d <alltraps> 80106076 <vector192>: .globl vector192 vector192: pushl $0 80106076: 6a 00 push $0x0 pushl $192 80106078: 68 c0 00 00 00 push $0xc0 jmp alltraps 8010607d: e9 eb f3 ff ff jmp 8010546d <alltraps> 80106082 <vector193>: .globl vector193 vector193: pushl $0 80106082: 6a 00 push $0x0 pushl $193 80106084: 68 c1 00 00 00 push $0xc1 jmp alltraps 80106089: e9 df f3 ff ff jmp 8010546d <alltraps> 8010608e <vector194>: .globl vector194 vector194: pushl $0 8010608e: 6a 00 push $0x0 pushl $194 80106090: 68 c2 00 00 00 push $0xc2 jmp alltraps 80106095: e9 d3 f3 ff ff jmp 8010546d <alltraps> 8010609a <vector195>: .globl vector195 vector195: pushl $0 8010609a: 6a 00 push $0x0 pushl $195 8010609c: 68 c3 00 00 00 push $0xc3 jmp alltraps 801060a1: e9 c7 f3 ff ff jmp 8010546d <alltraps> 801060a6 <vector196>: .globl vector196 vector196: pushl $0 801060a6: 6a 00 push $0x0 pushl $196 801060a8: 68 c4 00 00 00 push $0xc4 jmp alltraps 801060ad: e9 bb f3 ff ff jmp 8010546d <alltraps> 801060b2 <vector197>: .globl vector197 vector197: pushl $0 801060b2: 6a 00 push $0x0 pushl $197 801060b4: 68 c5 00 00 00 push $0xc5 jmp alltraps 801060b9: e9 af f3 ff ff jmp 8010546d <alltraps> 801060be <vector198>: .globl vector198 vector198: pushl $0 801060be: 6a 00 push $0x0 pushl $198 801060c0: 68 c6 00 00 00 push $0xc6 jmp alltraps 801060c5: e9 a3 f3 ff ff jmp 8010546d <alltraps> 801060ca <vector199>: .globl vector199 vector199: pushl $0 801060ca: 6a 00 push $0x0 pushl $199 801060cc: 68 c7 00 00 00 push $0xc7 jmp alltraps 801060d1: e9 97 f3 ff ff jmp 8010546d <alltraps> 801060d6 <vector200>: .globl vector200 vector200: pushl $0 801060d6: 6a 00 push $0x0 pushl $200 801060d8: 68 c8 00 00 00 push $0xc8 jmp alltraps 801060dd: e9 8b f3 ff ff jmp 8010546d <alltraps> 801060e2 <vector201>: .globl vector201 vector201: pushl $0 801060e2: 6a 00 push $0x0 pushl $201 801060e4: 68 c9 00 00 00 push $0xc9 jmp alltraps 801060e9: e9 7f f3 ff ff jmp 8010546d <alltraps> 801060ee <vector202>: .globl vector202 vector202: pushl $0 801060ee: 6a 00 push $0x0 pushl $202 801060f0: 68 ca 00 00 00 push $0xca jmp alltraps 801060f5: e9 73 f3 ff ff jmp 8010546d <alltraps> 801060fa <vector203>: .globl vector203 vector203: pushl $0 801060fa: 6a 00 push $0x0 pushl $203 801060fc: 68 cb 00 00 00 push $0xcb jmp alltraps 80106101: e9 67 f3 ff ff jmp 8010546d <alltraps> 80106106 <vector204>: .globl vector204 vector204: pushl $0 80106106: 6a 00 push $0x0 pushl $204 80106108: 68 cc 00 00 00 push $0xcc jmp alltraps 8010610d: e9 5b f3 ff ff jmp 8010546d <alltraps> 80106112 <vector205>: .globl vector205 vector205: pushl $0 80106112: 6a 00 push $0x0 pushl $205 80106114: 68 cd 00 00 00 push $0xcd jmp alltraps 80106119: e9 4f f3 ff ff jmp 8010546d <alltraps> 8010611e <vector206>: .globl vector206 vector206: pushl $0 8010611e: 6a 00 push $0x0 pushl $206 80106120: 68 ce 00 00 00 push $0xce jmp alltraps 80106125: e9 43 f3 ff ff jmp 8010546d <alltraps> 8010612a <vector207>: .globl vector207 vector207: pushl $0 8010612a: 6a 00 push $0x0 pushl $207 8010612c: 68 cf 00 00 00 push $0xcf jmp alltraps 80106131: e9 37 f3 ff ff jmp 8010546d <alltraps> 80106136 <vector208>: .globl vector208 vector208: pushl $0 80106136: 6a 00 push $0x0 pushl $208 80106138: 68 d0 00 00 00 push $0xd0 jmp alltraps 8010613d: e9 2b f3 ff ff jmp 8010546d <alltraps> 80106142 <vector209>: .globl vector209 vector209: pushl $0 80106142: 6a 00 push $0x0 pushl $209 80106144: 68 d1 00 00 00 push $0xd1 jmp alltraps 80106149: e9 1f f3 ff ff jmp 8010546d <alltraps> 8010614e <vector210>: .globl vector210 vector210: pushl $0 8010614e: 6a 00 push $0x0 pushl $210 80106150: 68 d2 00 00 00 push $0xd2 jmp alltraps 80106155: e9 13 f3 ff ff jmp 8010546d <alltraps> 8010615a <vector211>: .globl vector211 vector211: pushl $0 8010615a: 6a 00 push $0x0 pushl $211 8010615c: 68 d3 00 00 00 push $0xd3 jmp alltraps 80106161: e9 07 f3 ff ff jmp 8010546d <alltraps> 80106166 <vector212>: .globl vector212 vector212: pushl $0 80106166: 6a 00 push $0x0 pushl $212 80106168: 68 d4 00 00 00 push $0xd4 jmp alltraps 8010616d: e9 fb f2 ff ff jmp 8010546d <alltraps> 80106172 <vector213>: .globl vector213 vector213: pushl $0 80106172: 6a 00 push $0x0 pushl $213 80106174: 68 d5 00 00 00 push $0xd5 jmp alltraps 80106179: e9 ef f2 ff ff jmp 8010546d <alltraps> 8010617e <vector214>: .globl vector214 vector214: pushl $0 8010617e: 6a 00 push $0x0 pushl $214 80106180: 68 d6 00 00 00 push $0xd6 jmp alltraps 80106185: e9 e3 f2 ff ff jmp 8010546d <alltraps> 8010618a <vector215>: .globl vector215 vector215: pushl $0 8010618a: 6a 00 push $0x0 pushl $215 8010618c: 68 d7 00 00 00 push $0xd7 jmp alltraps 80106191: e9 d7 f2 ff ff jmp 8010546d <alltraps> 80106196 <vector216>: .globl vector216 vector216: pushl $0 80106196: 6a 00 push $0x0 pushl $216 80106198: 68 d8 00 00 00 push $0xd8 jmp alltraps 8010619d: e9 cb f2 ff ff jmp 8010546d <alltraps> 801061a2 <vector217>: .globl vector217 vector217: pushl $0 801061a2: 6a 00 push $0x0 pushl $217 801061a4: 68 d9 00 00 00 push $0xd9 jmp alltraps 801061a9: e9 bf f2 ff ff jmp 8010546d <alltraps> 801061ae <vector218>: .globl vector218 vector218: pushl $0 801061ae: 6a 00 push $0x0 pushl $218 801061b0: 68 da 00 00 00 push $0xda jmp alltraps 801061b5: e9 b3 f2 ff ff jmp 8010546d <alltraps> 801061ba <vector219>: .globl vector219 vector219: pushl $0 801061ba: 6a 00 push $0x0 pushl $219 801061bc: 68 db 00 00 00 push $0xdb jmp alltraps 801061c1: e9 a7 f2 ff ff jmp 8010546d <alltraps> 801061c6 <vector220>: .globl vector220 vector220: pushl $0 801061c6: 6a 00 push $0x0 pushl $220 801061c8: 68 dc 00 00 00 push $0xdc jmp alltraps 801061cd: e9 9b f2 ff ff jmp 8010546d <alltraps> 801061d2 <vector221>: .globl vector221 vector221: pushl $0 801061d2: 6a 00 push $0x0 pushl $221 801061d4: 68 dd 00 00 00 push $0xdd jmp alltraps 801061d9: e9 8f f2 ff ff jmp 8010546d <alltraps> 801061de <vector222>: .globl vector222 vector222: pushl $0 801061de: 6a 00 push $0x0 pushl $222 801061e0: 68 de 00 00 00 push $0xde jmp alltraps 801061e5: e9 83 f2 ff ff jmp 8010546d <alltraps> 801061ea <vector223>: .globl vector223 vector223: pushl $0 801061ea: 6a 00 push $0x0 pushl $223 801061ec: 68 df 00 00 00 push $0xdf jmp alltraps 801061f1: e9 77 f2 ff ff jmp 8010546d <alltraps> 801061f6 <vector224>: .globl vector224 vector224: pushl $0 801061f6: 6a 00 push $0x0 pushl $224 801061f8: 68 e0 00 00 00 push $0xe0 jmp alltraps 801061fd: e9 6b f2 ff ff jmp 8010546d <alltraps> 80106202 <vector225>: .globl vector225 vector225: pushl $0 80106202: 6a 00 push $0x0 pushl $225 80106204: 68 e1 00 00 00 push $0xe1 jmp alltraps 80106209: e9 5f f2 ff ff jmp 8010546d <alltraps> 8010620e <vector226>: .globl vector226 vector226: pushl $0 8010620e: 6a 00 push $0x0 pushl $226 80106210: 68 e2 00 00 00 push $0xe2 jmp alltraps 80106215: e9 53 f2 ff ff jmp 8010546d <alltraps> 8010621a <vector227>: .globl vector227 vector227: pushl $0 8010621a: 6a 00 push $0x0 pushl $227 8010621c: 68 e3 00 00 00 push $0xe3 jmp alltraps 80106221: e9 47 f2 ff ff jmp 8010546d <alltraps> 80106226 <vector228>: .globl vector228 vector228: pushl $0 80106226: 6a 00 push $0x0 pushl $228 80106228: 68 e4 00 00 00 push $0xe4 jmp alltraps 8010622d: e9 3b f2 ff ff jmp 8010546d <alltraps> 80106232 <vector229>: .globl vector229 vector229: pushl $0 80106232: 6a 00 push $0x0 pushl $229 80106234: 68 e5 00 00 00 push $0xe5 jmp alltraps 80106239: e9 2f f2 ff ff jmp 8010546d <alltraps> 8010623e <vector230>: .globl vector230 vector230: pushl $0 8010623e: 6a 00 push $0x0 pushl $230 80106240: 68 e6 00 00 00 push $0xe6 jmp alltraps 80106245: e9 23 f2 ff ff jmp 8010546d <alltraps> 8010624a <vector231>: .globl vector231 vector231: pushl $0 8010624a: 6a 00 push $0x0 pushl $231 8010624c: 68 e7 00 00 00 push $0xe7 jmp alltraps 80106251: e9 17 f2 ff ff jmp 8010546d <alltraps> 80106256 <vector232>: .globl vector232 vector232: pushl $0 80106256: 6a 00 push $0x0 pushl $232 80106258: 68 e8 00 00 00 push $0xe8 jmp alltraps 8010625d: e9 0b f2 ff ff jmp 8010546d <alltraps> 80106262 <vector233>: .globl vector233 vector233: pushl $0 80106262: 6a 00 push $0x0 pushl $233 80106264: 68 e9 00 00 00 push $0xe9 jmp alltraps 80106269: e9 ff f1 ff ff jmp 8010546d <alltraps> 8010626e <vector234>: .globl vector234 vector234: pushl $0 8010626e: 6a 00 push $0x0 pushl $234 80106270: 68 ea 00 00 00 push $0xea jmp alltraps 80106275: e9 f3 f1 ff ff jmp 8010546d <alltraps> 8010627a <vector235>: .globl vector235 vector235: pushl $0 8010627a: 6a 00 push $0x0 pushl $235 8010627c: 68 eb 00 00 00 push $0xeb jmp alltraps 80106281: e9 e7 f1 ff ff jmp 8010546d <alltraps> 80106286 <vector236>: .globl vector236 vector236: pushl $0 80106286: 6a 00 push $0x0 pushl $236 80106288: 68 ec 00 00 00 push $0xec jmp alltraps 8010628d: e9 db f1 ff ff jmp 8010546d <alltraps> 80106292 <vector237>: .globl vector237 vector237: pushl $0 80106292: 6a 00 push $0x0 pushl $237 80106294: 68 ed 00 00 00 push $0xed jmp alltraps 80106299: e9 cf f1 ff ff jmp 8010546d <alltraps> 8010629e <vector238>: .globl vector238 vector238: pushl $0 8010629e: 6a 00 push $0x0 pushl $238 801062a0: 68 ee 00 00 00 push $0xee jmp alltraps 801062a5: e9 c3 f1 ff ff jmp 8010546d <alltraps> 801062aa <vector239>: .globl vector239 vector239: pushl $0 801062aa: 6a 00 push $0x0 pushl $239 801062ac: 68 ef 00 00 00 push $0xef jmp alltraps 801062b1: e9 b7 f1 ff ff jmp 8010546d <alltraps> 801062b6 <vector240>: .globl vector240 vector240: pushl $0 801062b6: 6a 00 push $0x0 pushl $240 801062b8: 68 f0 00 00 00 push $0xf0 jmp alltraps 801062bd: e9 ab f1 ff ff jmp 8010546d <alltraps> 801062c2 <vector241>: .globl vector241 vector241: pushl $0 801062c2: 6a 00 push $0x0 pushl $241 801062c4: 68 f1 00 00 00 push $0xf1 jmp alltraps 801062c9: e9 9f f1 ff ff jmp 8010546d <alltraps> 801062ce <vector242>: .globl vector242 vector242: pushl $0 801062ce: 6a 00 push $0x0 pushl $242 801062d0: 68 f2 00 00 00 push $0xf2 jmp alltraps 801062d5: e9 93 f1 ff ff jmp 8010546d <alltraps> 801062da <vector243>: .globl vector243 vector243: pushl $0 801062da: 6a 00 push $0x0 pushl $243 801062dc: 68 f3 00 00 00 push $0xf3 jmp alltraps 801062e1: e9 87 f1 ff ff jmp 8010546d <alltraps> 801062e6 <vector244>: .globl vector244 vector244: pushl $0 801062e6: 6a 00 push $0x0 pushl $244 801062e8: 68 f4 00 00 00 push $0xf4 jmp alltraps 801062ed: e9 7b f1 ff ff jmp 8010546d <alltraps> 801062f2 <vector245>: .globl vector245 vector245: pushl $0 801062f2: 6a 00 push $0x0 pushl $245 801062f4: 68 f5 00 00 00 push $0xf5 jmp alltraps 801062f9: e9 6f f1 ff ff jmp 8010546d <alltraps> 801062fe <vector246>: .globl vector246 vector246: pushl $0 801062fe: 6a 00 push $0x0 pushl $246 80106300: 68 f6 00 00 00 push $0xf6 jmp alltraps 80106305: e9 63 f1 ff ff jmp 8010546d <alltraps> 8010630a <vector247>: .globl vector247 vector247: pushl $0 8010630a: 6a 00 push $0x0 pushl $247 8010630c: 68 f7 00 00 00 push $0xf7 jmp alltraps 80106311: e9 57 f1 ff ff jmp 8010546d <alltraps> 80106316 <vector248>: .globl vector248 vector248: pushl $0 80106316: 6a 00 push $0x0 pushl $248 80106318: 68 f8 00 00 00 push $0xf8 jmp alltraps 8010631d: e9 4b f1 ff ff jmp 8010546d <alltraps> 80106322 <vector249>: .globl vector249 vector249: pushl $0 80106322: 6a 00 push $0x0 pushl $249 80106324: 68 f9 00 00 00 push $0xf9 jmp alltraps 80106329: e9 3f f1 ff ff jmp 8010546d <alltraps> 8010632e <vector250>: .globl vector250 vector250: pushl $0 8010632e: 6a 00 push $0x0 pushl $250 80106330: 68 fa 00 00 00 push $0xfa jmp alltraps 80106335: e9 33 f1 ff ff jmp 8010546d <alltraps> 8010633a <vector251>: .globl vector251 vector251: pushl $0 8010633a: 6a 00 push $0x0 pushl $251 8010633c: 68 fb 00 00 00 push $0xfb jmp alltraps 80106341: e9 27 f1 ff ff jmp 8010546d <alltraps> 80106346 <vector252>: .globl vector252 vector252: pushl $0 80106346: 6a 00 push $0x0 pushl $252 80106348: 68 fc 00 00 00 push $0xfc jmp alltraps 8010634d: e9 1b f1 ff ff jmp 8010546d <alltraps> 80106352 <vector253>: .globl vector253 vector253: pushl $0 80106352: 6a 00 push $0x0 pushl $253 80106354: 68 fd 00 00 00 push $0xfd jmp alltraps 80106359: e9 0f f1 ff ff jmp 8010546d <alltraps> 8010635e <vector254>: .globl vector254 vector254: pushl $0 8010635e: 6a 00 push $0x0 pushl $254 80106360: 68 fe 00 00 00 push $0xfe jmp alltraps 80106365: e9 03 f1 ff ff jmp 8010546d <alltraps> 8010636a <vector255>: .globl vector255 vector255: pushl $0 8010636a: 6a 00 push $0x0 pushl $255 8010636c: 68 ff 00 00 00 push $0xff jmp alltraps 80106371: e9 f7 f0 ff ff jmp 8010546d <alltraps> 80106376: 66 90 xchg %ax,%ax 80106378: 66 90 xchg %ax,%ax 8010637a: 66 90 xchg %ax,%ax 8010637c: 66 90 xchg %ax,%ax 8010637e: 66 90 xchg %ax,%ax 80106380 <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) { 80106380: 55 push %ebp 80106381: 89 e5 mov %esp,%ebp 80106383: 57 push %edi 80106384: 56 push %esi 80106385: 89 d6 mov %edx,%esi pde_t *pde; pte_t *pgtab; pde = &pgdir[PDX(va)]; 80106387: c1 ea 16 shr $0x16,%edx { 8010638a: 53 push %ebx pde = &pgdir[PDX(va)]; 8010638b: 8d 3c 90 lea (%eax,%edx,4),%edi { 8010638e: 83 ec 1c sub $0x1c,%esp if(*pde & PTE_P){ 80106391: 8b 1f mov (%edi),%ebx 80106393: f6 c3 01 test $0x1,%bl 80106396: 74 28 je 801063c0 <walkpgdir+0x40> pgtab = (pte_t*)P2V(PTE_ADDR(*pde)); 80106398: 81 e3 00 f0 ff ff and $0xfffff000,%ebx 8010639e: 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)]; 801063a4: c1 ee 0a shr $0xa,%esi } 801063a7: 83 c4 1c add $0x1c,%esp return &pgtab[PTX(va)]; 801063aa: 89 f2 mov %esi,%edx 801063ac: 81 e2 fc 0f 00 00 and $0xffc,%edx 801063b2: 8d 04 13 lea (%ebx,%edx,1),%eax } 801063b5: 5b pop %ebx 801063b6: 5e pop %esi 801063b7: 5f pop %edi 801063b8: 5d pop %ebp 801063b9: c3 ret 801063ba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(!alloc || (pgtab = (pte_t*)kalloc()) == 0) 801063c0: 85 c9 test %ecx,%ecx 801063c2: 74 34 je 801063f8 <walkpgdir+0x78> 801063c4: e8 c7 c0 ff ff call 80102490 <kalloc> 801063c9: 85 c0 test %eax,%eax 801063cb: 89 c3 mov %eax,%ebx 801063cd: 74 29 je 801063f8 <walkpgdir+0x78> memset(pgtab, 0, PGSIZE); 801063cf: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp) 801063d6: 00 801063d7: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 801063de: 00 801063df: 89 04 24 mov %eax,(%esp) 801063e2: e8 c9 de ff ff call 801042b0 <memset> *pde = V2P(pgtab) | PTE_P | PTE_W | PTE_U; 801063e7: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax 801063ed: 83 c8 07 or $0x7,%eax 801063f0: 89 07 mov %eax,(%edi) 801063f2: eb b0 jmp 801063a4 <walkpgdir+0x24> 801063f4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi } 801063f8: 83 c4 1c add $0x1c,%esp return 0; 801063fb: 31 c0 xor %eax,%eax } 801063fd: 5b pop %ebx 801063fe: 5e pop %esi 801063ff: 5f pop %edi 80106400: 5d pop %ebp 80106401: c3 ret 80106402: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106409: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106410 <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) 80106410: 55 push %ebp 80106411: 89 e5 mov %esp,%ebp 80106413: 57 push %edi 80106414: 89 c7 mov %eax,%edi 80106416: 56 push %esi 80106417: 89 d6 mov %edx,%esi 80106419: 53 push %ebx uint a, pa; if(newsz >= oldsz) return oldsz; a = PGROUNDUP(newsz); 8010641a: 8d 99 ff 0f 00 00 lea 0xfff(%ecx),%ebx deallocuvm(pde_t *pgdir, uint oldsz, uint newsz) 80106420: 83 ec 1c sub $0x1c,%esp a = PGROUNDUP(newsz); 80106423: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for(; a < oldsz; a += PGSIZE){ 80106429: 39 d3 cmp %edx,%ebx deallocuvm(pde_t *pgdir, uint oldsz, uint newsz) 8010642b: 89 4d e0 mov %ecx,-0x20(%ebp) for(; a < oldsz; a += PGSIZE){ 8010642e: 72 3b jb 8010646b <deallocuvm.part.0+0x5b> 80106430: eb 5e jmp 80106490 <deallocuvm.part.0+0x80> 80106432: 8d b6 00 00 00 00 lea 0x0(%esi),%esi pte = walkpgdir(pgdir, (char*)a, 0); if(!pte) a = PGADDR(PDX(a) + 1, 0, 0) - PGSIZE; else if((*pte & PTE_P) != 0){ 80106438: 8b 10 mov (%eax),%edx 8010643a: f6 c2 01 test $0x1,%dl 8010643d: 74 22 je 80106461 <deallocuvm.part.0+0x51> pa = PTE_ADDR(*pte); if(pa == 0) 8010643f: 81 e2 00 f0 ff ff and $0xfffff000,%edx 80106445: 74 54 je 8010649b <deallocuvm.part.0+0x8b> panic("kfree"); char *v = P2V(pa); 80106447: 81 c2 00 00 00 80 add $0x80000000,%edx kfree(v); 8010644d: 89 14 24 mov %edx,(%esp) 80106450: 89 45 e4 mov %eax,-0x1c(%ebp) 80106453: e8 88 be ff ff call 801022e0 <kfree> *pte = 0; 80106458: 8b 45 e4 mov -0x1c(%ebp),%eax 8010645b: c7 00 00 00 00 00 movl $0x0,(%eax) for(; a < oldsz; a += PGSIZE){ 80106461: 81 c3 00 10 00 00 add $0x1000,%ebx 80106467: 39 f3 cmp %esi,%ebx 80106469: 73 25 jae 80106490 <deallocuvm.part.0+0x80> pte = walkpgdir(pgdir, (char*)a, 0); 8010646b: 31 c9 xor %ecx,%ecx 8010646d: 89 da mov %ebx,%edx 8010646f: 89 f8 mov %edi,%eax 80106471: e8 0a ff ff ff call 80106380 <walkpgdir> if(!pte) 80106476: 85 c0 test %eax,%eax 80106478: 75 be jne 80106438 <deallocuvm.part.0+0x28> a = PGADDR(PDX(a) + 1, 0, 0) - PGSIZE; 8010647a: 81 e3 00 00 c0 ff and $0xffc00000,%ebx 80106480: 81 c3 00 f0 3f 00 add $0x3ff000,%ebx for(; a < oldsz; a += PGSIZE){ 80106486: 81 c3 00 10 00 00 add $0x1000,%ebx 8010648c: 39 f3 cmp %esi,%ebx 8010648e: 72 db jb 8010646b <deallocuvm.part.0+0x5b> } } return newsz; } 80106490: 8b 45 e0 mov -0x20(%ebp),%eax 80106493: 83 c4 1c add $0x1c,%esp 80106496: 5b pop %ebx 80106497: 5e pop %esi 80106498: 5f pop %edi 80106499: 5d pop %ebp 8010649a: c3 ret panic("kfree"); 8010649b: c7 04 24 86 70 10 80 movl $0x80107086,(%esp) 801064a2: e8 b9 9e ff ff call 80100360 <panic> 801064a7: 89 f6 mov %esi,%esi 801064a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801064b0 <seginit>: { 801064b0: 55 push %ebp 801064b1: 89 e5 mov %esp,%ebp 801064b3: 83 ec 18 sub $0x18,%esp c = &cpus[cpuid()]; 801064b6: e8 b5 d1 ff ff call 80103670 <cpuid> c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0); 801064bb: 31 c9 xor %ecx,%ecx 801064bd: ba ff ff ff ff mov $0xffffffff,%edx c = &cpus[cpuid()]; 801064c2: 69 c0 b0 00 00 00 imul $0xb0,%eax,%eax 801064c8: 05 80 27 11 80 add $0x80112780,%eax c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0); 801064cd: 66 89 50 78 mov %dx,0x78(%eax) c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0); 801064d1: ba ff ff ff ff mov $0xffffffff,%edx lgdt(c->gdt, sizeof(c->gdt)); 801064d6: 83 c0 70 add $0x70,%eax c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0); 801064d9: 66 89 48 0a mov %cx,0xa(%eax) c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0); 801064dd: 31 c9 xor %ecx,%ecx 801064df: 66 89 50 10 mov %dx,0x10(%eax) c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER); 801064e3: ba ff ff ff ff mov $0xffffffff,%edx c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0); 801064e8: 66 89 48 12 mov %cx,0x12(%eax) c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER); 801064ec: 31 c9 xor %ecx,%ecx 801064ee: 66 89 50 18 mov %dx,0x18(%eax) c->gdt[SEG_UDATA] = SEG(STA_W, 0, 0xffffffff, DPL_USER); 801064f2: ba ff ff ff ff mov $0xffffffff,%edx c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER); 801064f7: 66 89 48 1a mov %cx,0x1a(%eax) c->gdt[SEG_UDATA] = SEG(STA_W, 0, 0xffffffff, DPL_USER); 801064fb: 31 c9 xor %ecx,%ecx c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0); 801064fd: c6 40 0d 9a movb $0x9a,0xd(%eax) 80106501: c6 40 0e cf movb $0xcf,0xe(%eax) c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0); 80106505: c6 40 15 92 movb $0x92,0x15(%eax) 80106509: c6 40 16 cf movb $0xcf,0x16(%eax) c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER); 8010650d: c6 40 1d fa movb $0xfa,0x1d(%eax) 80106511: c6 40 1e cf movb $0xcf,0x1e(%eax) c->gdt[SEG_UDATA] = SEG(STA_W, 0, 0xffffffff, DPL_USER); 80106515: c6 40 25 f2 movb $0xf2,0x25(%eax) 80106519: c6 40 26 cf movb $0xcf,0x26(%eax) 8010651d: 66 89 50 20 mov %dx,0x20(%eax) pd[0] = size-1; 80106521: ba 2f 00 00 00 mov $0x2f,%edx c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0); 80106526: c6 40 0c 00 movb $0x0,0xc(%eax) 8010652a: c6 40 0f 00 movb $0x0,0xf(%eax) c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0); 8010652e: c6 40 14 00 movb $0x0,0x14(%eax) 80106532: c6 40 17 00 movb $0x0,0x17(%eax) c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER); 80106536: c6 40 1c 00 movb $0x0,0x1c(%eax) 8010653a: c6 40 1f 00 movb $0x0,0x1f(%eax) c->gdt[SEG_UDATA] = SEG(STA_W, 0, 0xffffffff, DPL_USER); 8010653e: 66 89 48 22 mov %cx,0x22(%eax) 80106542: c6 40 24 00 movb $0x0,0x24(%eax) 80106546: c6 40 27 00 movb $0x0,0x27(%eax) 8010654a: 66 89 55 f2 mov %dx,-0xe(%ebp) pd[1] = (uint)p; 8010654e: 66 89 45 f4 mov %ax,-0xc(%ebp) pd[2] = (uint)p >> 16; 80106552: c1 e8 10 shr $0x10,%eax 80106555: 66 89 45 f6 mov %ax,-0xa(%ebp) asm volatile("lgdt (%0)" : : "r" (pd)); 80106559: 8d 45 f2 lea -0xe(%ebp),%eax 8010655c: 0f 01 10 lgdtl (%eax) } 8010655f: c9 leave 80106560: c3 ret 80106561: eb 0d jmp 80106570 <mappages> 80106563: 90 nop 80106564: 90 nop 80106565: 90 nop 80106566: 90 nop 80106567: 90 nop 80106568: 90 nop 80106569: 90 nop 8010656a: 90 nop 8010656b: 90 nop 8010656c: 90 nop 8010656d: 90 nop 8010656e: 90 nop 8010656f: 90 nop 80106570 <mappages>: { 80106570: 55 push %ebp 80106571: 89 e5 mov %esp,%ebp 80106573: 57 push %edi 80106574: 56 push %esi 80106575: 53 push %ebx 80106576: 83 ec 1c sub $0x1c,%esp 80106579: 8b 45 0c mov 0xc(%ebp),%eax last = (char*)PGROUNDDOWN(((uint)va) + size - 1); 8010657c: 8b 55 10 mov 0x10(%ebp),%edx { 8010657f: 8b 7d 14 mov 0x14(%ebp),%edi *pte = pa | perm | PTE_P; 80106582: 83 4d 18 01 orl $0x1,0x18(%ebp) a = (char*)PGROUNDDOWN((uint)va); 80106586: 89 c3 mov %eax,%ebx 80106588: 81 e3 00 f0 ff ff and $0xfffff000,%ebx last = (char*)PGROUNDDOWN(((uint)va) + size - 1); 8010658e: 8d 44 10 ff lea -0x1(%eax,%edx,1),%eax 80106592: 29 df sub %ebx,%edi 80106594: 89 45 e4 mov %eax,-0x1c(%ebp) 80106597: 81 65 e4 00 f0 ff ff andl $0xfffff000,-0x1c(%ebp) 8010659e: eb 15 jmp 801065b5 <mappages+0x45> if(*pte & PTE_P) 801065a0: f6 00 01 testb $0x1,(%eax) 801065a3: 75 3d jne 801065e2 <mappages+0x72> *pte = pa | perm | PTE_P; 801065a5: 0b 75 18 or 0x18(%ebp),%esi if(a == last) 801065a8: 3b 5d e4 cmp -0x1c(%ebp),%ebx *pte = pa | perm | PTE_P; 801065ab: 89 30 mov %esi,(%eax) if(a == last) 801065ad: 74 29 je 801065d8 <mappages+0x68> a += PGSIZE; 801065af: 81 c3 00 10 00 00 add $0x1000,%ebx if((pte = walkpgdir(pgdir, a, 1)) == 0) 801065b5: 8b 45 08 mov 0x8(%ebp),%eax 801065b8: b9 01 00 00 00 mov $0x1,%ecx 801065bd: 89 da mov %ebx,%edx 801065bf: 8d 34 3b lea (%ebx,%edi,1),%esi 801065c2: e8 b9 fd ff ff call 80106380 <walkpgdir> 801065c7: 85 c0 test %eax,%eax 801065c9: 75 d5 jne 801065a0 <mappages+0x30> } 801065cb: 83 c4 1c add $0x1c,%esp return -1; 801065ce: b8 ff ff ff ff mov $0xffffffff,%eax } 801065d3: 5b pop %ebx 801065d4: 5e pop %esi 801065d5: 5f pop %edi 801065d6: 5d pop %ebp 801065d7: c3 ret 801065d8: 83 c4 1c add $0x1c,%esp return 0; 801065db: 31 c0 xor %eax,%eax } 801065dd: 5b pop %ebx 801065de: 5e pop %esi 801065df: 5f pop %edi 801065e0: 5d pop %ebp 801065e1: c3 ret panic("remap"); 801065e2: c7 04 24 f0 76 10 80 movl $0x801076f0,(%esp) 801065e9: e8 72 9d ff ff call 80100360 <panic> 801065ee: 66 90 xchg %ax,%ax 801065f0 <switchkvm>: lcr3(V2P(kpgdir)); // switch to the kernel page table 801065f0: a1 a4 56 11 80 mov 0x801156a4,%eax { 801065f5: 55 push %ebp 801065f6: 89 e5 mov %esp,%ebp lcr3(V2P(kpgdir)); // switch to the kernel page table 801065f8: 05 00 00 00 80 add $0x80000000,%eax } static inline void lcr3(uint val) { asm volatile("movl %0,%%cr3" : : "r" (val)); 801065fd: 0f 22 d8 mov %eax,%cr3 } 80106600: 5d pop %ebp 80106601: c3 ret 80106602: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106609: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106610 <switchuvm>: { 80106610: 55 push %ebp 80106611: 89 e5 mov %esp,%ebp 80106613: 57 push %edi 80106614: 56 push %esi 80106615: 53 push %ebx 80106616: 83 ec 1c sub $0x1c,%esp 80106619: 8b 75 08 mov 0x8(%ebp),%esi if(p == 0) 8010661c: 85 f6 test %esi,%esi 8010661e: 0f 84 cd 00 00 00 je 801066f1 <switchuvm+0xe1> if(p->kstack == 0) 80106624: 8b 46 10 mov 0x10(%esi),%eax 80106627: 85 c0 test %eax,%eax 80106629: 0f 84 da 00 00 00 je 80106709 <switchuvm+0xf9> if(p->pgdir == 0) 8010662f: 8b 7e 0c mov 0xc(%esi),%edi 80106632: 85 ff test %edi,%edi 80106634: 0f 84 c3 00 00 00 je 801066fd <switchuvm+0xed> pushcli(); 8010663a: e8 f1 da ff ff call 80104130 <pushcli> mycpu()->gdt[SEG_TSS] = SEG16(STS_T32A, &mycpu()->ts, 8010663f: e8 ac cf ff ff call 801035f0 <mycpu> 80106644: 89 c3 mov %eax,%ebx 80106646: e8 a5 cf ff ff call 801035f0 <mycpu> 8010664b: 89 c7 mov %eax,%edi 8010664d: e8 9e cf ff ff call 801035f0 <mycpu> 80106652: 83 c7 08 add $0x8,%edi 80106655: 89 45 e4 mov %eax,-0x1c(%ebp) 80106658: e8 93 cf ff ff call 801035f0 <mycpu> 8010665d: 8b 4d e4 mov -0x1c(%ebp),%ecx 80106660: ba 67 00 00 00 mov $0x67,%edx 80106665: 66 89 93 98 00 00 00 mov %dx,0x98(%ebx) 8010666c: 66 89 bb 9a 00 00 00 mov %di,0x9a(%ebx) 80106673: c6 83 9d 00 00 00 99 movb $0x99,0x9d(%ebx) 8010667a: 83 c1 08 add $0x8,%ecx 8010667d: c1 e9 10 shr $0x10,%ecx 80106680: 83 c0 08 add $0x8,%eax 80106683: c1 e8 18 shr $0x18,%eax 80106686: 88 8b 9c 00 00 00 mov %cl,0x9c(%ebx) 8010668c: c6 83 9e 00 00 00 40 movb $0x40,0x9e(%ebx) 80106693: 88 83 9f 00 00 00 mov %al,0x9f(%ebx) mycpu()->ts.iomb = (ushort) 0xFFFF; 80106699: bb ff ff ff ff mov $0xffffffff,%ebx mycpu()->gdt[SEG_TSS].s = 0; 8010669e: e8 4d cf ff ff call 801035f0 <mycpu> 801066a3: 80 a0 9d 00 00 00 ef andb $0xef,0x9d(%eax) mycpu()->ts.ss0 = SEG_KDATA << 3; 801066aa: e8 41 cf ff ff call 801035f0 <mycpu> 801066af: b9 10 00 00 00 mov $0x10,%ecx 801066b4: 66 89 48 10 mov %cx,0x10(%eax) mycpu()->ts.esp0 = (uint)p->kstack + KSTACKSIZE; 801066b8: e8 33 cf ff ff call 801035f0 <mycpu> 801066bd: 8b 56 10 mov 0x10(%esi),%edx 801066c0: 8d 8a 00 10 00 00 lea 0x1000(%edx),%ecx 801066c6: 89 48 0c mov %ecx,0xc(%eax) mycpu()->ts.iomb = (ushort) 0xFFFF; 801066c9: e8 22 cf ff ff call 801035f0 <mycpu> 801066ce: 66 89 58 6e mov %bx,0x6e(%eax) asm volatile("ltr %0" : : "r" (sel)); 801066d2: b8 28 00 00 00 mov $0x28,%eax 801066d7: 0f 00 d8 ltr %ax lcr3(V2P(p->pgdir)); // switch to process's address space 801066da: 8b 46 0c mov 0xc(%esi),%eax 801066dd: 05 00 00 00 80 add $0x80000000,%eax asm volatile("movl %0,%%cr3" : : "r" (val)); 801066e2: 0f 22 d8 mov %eax,%cr3 } 801066e5: 83 c4 1c add $0x1c,%esp 801066e8: 5b pop %ebx 801066e9: 5e pop %esi 801066ea: 5f pop %edi 801066eb: 5d pop %ebp popcli(); 801066ec: e9 ff da ff ff jmp 801041f0 <popcli> panic("switchuvm: no process"); 801066f1: c7 04 24 f6 76 10 80 movl $0x801076f6,(%esp) 801066f8: e8 63 9c ff ff call 80100360 <panic> panic("switchuvm: no pgdir"); 801066fd: c7 04 24 21 77 10 80 movl $0x80107721,(%esp) 80106704: e8 57 9c ff ff call 80100360 <panic> panic("switchuvm: no kstack"); 80106709: c7 04 24 0c 77 10 80 movl $0x8010770c,(%esp) 80106710: e8 4b 9c ff ff call 80100360 <panic> 80106715: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80106719: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106720 <inituvm>: { 80106720: 55 push %ebp 80106721: 89 e5 mov %esp,%ebp 80106723: 57 push %edi 80106724: 56 push %esi 80106725: 53 push %ebx 80106726: 83 ec 2c sub $0x2c,%esp 80106729: 8b 75 10 mov 0x10(%ebp),%esi 8010672c: 8b 55 08 mov 0x8(%ebp),%edx 8010672f: 8b 7d 0c mov 0xc(%ebp),%edi if(sz >= PGSIZE) 80106732: 81 fe ff 0f 00 00 cmp $0xfff,%esi 80106738: 77 64 ja 8010679e <inituvm+0x7e> 8010673a: 89 55 e4 mov %edx,-0x1c(%ebp) mem = kalloc(); 8010673d: e8 4e bd ff ff call 80102490 <kalloc> memset(mem, 0, PGSIZE); 80106742: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp) 80106749: 00 8010674a: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 80106751: 00 80106752: 89 04 24 mov %eax,(%esp) mem = kalloc(); 80106755: 89 c3 mov %eax,%ebx memset(mem, 0, PGSIZE); 80106757: e8 54 db ff ff call 801042b0 <memset> mappages(pgdir, 0, PGSIZE, V2P(mem), PTE_W|PTE_U); 8010675c: 8b 55 e4 mov -0x1c(%ebp),%edx 8010675f: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax 80106765: c7 44 24 10 06 00 00 movl $0x6,0x10(%esp) 8010676c: 00 8010676d: 89 44 24 0c mov %eax,0xc(%esp) 80106771: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp) 80106778: 00 80106779: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 80106780: 00 80106781: 89 14 24 mov %edx,(%esp) 80106784: e8 e7 fd ff ff call 80106570 <mappages> memmove(mem, init, sz); 80106789: 89 75 10 mov %esi,0x10(%ebp) 8010678c: 89 7d 0c mov %edi,0xc(%ebp) 8010678f: 89 5d 08 mov %ebx,0x8(%ebp) } 80106792: 83 c4 2c add $0x2c,%esp 80106795: 5b pop %ebx 80106796: 5e pop %esi 80106797: 5f pop %edi 80106798: 5d pop %ebp memmove(mem, init, sz); 80106799: e9 b2 db ff ff jmp 80104350 <memmove> panic("inituvm: more than a page"); 8010679e: c7 04 24 35 77 10 80 movl $0x80107735,(%esp) 801067a5: e8 b6 9b ff ff call 80100360 <panic> 801067aa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801067b0 <loaduvm>: { 801067b0: 55 push %ebp 801067b1: 89 e5 mov %esp,%ebp 801067b3: 57 push %edi 801067b4: 56 push %esi 801067b5: 53 push %ebx 801067b6: 83 ec 1c sub $0x1c,%esp if((uint) addr % PGSIZE != 0) 801067b9: f7 45 0c ff 0f 00 00 testl $0xfff,0xc(%ebp) 801067c0: 0f 85 98 00 00 00 jne 8010685e <loaduvm+0xae> for(i = 0; i < sz; i += PGSIZE){ 801067c6: 8b 75 18 mov 0x18(%ebp),%esi 801067c9: 31 db xor %ebx,%ebx 801067cb: 85 f6 test %esi,%esi 801067cd: 75 1a jne 801067e9 <loaduvm+0x39> 801067cf: eb 77 jmp 80106848 <loaduvm+0x98> 801067d1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801067d8: 81 c3 00 10 00 00 add $0x1000,%ebx 801067de: 81 ee 00 10 00 00 sub $0x1000,%esi 801067e4: 39 5d 18 cmp %ebx,0x18(%ebp) 801067e7: 76 5f jbe 80106848 <loaduvm+0x98> 801067e9: 8b 55 0c mov 0xc(%ebp),%edx if((pte = walkpgdir(pgdir, addr+i, 0)) == 0) 801067ec: 31 c9 xor %ecx,%ecx 801067ee: 8b 45 08 mov 0x8(%ebp),%eax 801067f1: 01 da add %ebx,%edx 801067f3: e8 88 fb ff ff call 80106380 <walkpgdir> 801067f8: 85 c0 test %eax,%eax 801067fa: 74 56 je 80106852 <loaduvm+0xa2> pa = PTE_ADDR(*pte); 801067fc: 8b 00 mov (%eax),%eax n = PGSIZE; 801067fe: bf 00 10 00 00 mov $0x1000,%edi 80106803: 8b 4d 14 mov 0x14(%ebp),%ecx pa = PTE_ADDR(*pte); 80106806: 25 00 f0 ff ff and $0xfffff000,%eax n = PGSIZE; 8010680b: 81 fe 00 10 00 00 cmp $0x1000,%esi 80106811: 0f 42 fe cmovb %esi,%edi if(readi(ip, P2V(pa), offset+i, n) != n) 80106814: 05 00 00 00 80 add $0x80000000,%eax 80106819: 89 44 24 04 mov %eax,0x4(%esp) 8010681d: 8b 45 10 mov 0x10(%ebp),%eax 80106820: 01 d9 add %ebx,%ecx 80106822: 89 7c 24 0c mov %edi,0xc(%esp) 80106826: 89 4c 24 08 mov %ecx,0x8(%esp) 8010682a: 89 04 24 mov %eax,(%esp) 8010682d: e8 1e b1 ff ff call 80101950 <readi> 80106832: 39 f8 cmp %edi,%eax 80106834: 74 a2 je 801067d8 <loaduvm+0x28> } 80106836: 83 c4 1c add $0x1c,%esp return -1; 80106839: b8 ff ff ff ff mov $0xffffffff,%eax } 8010683e: 5b pop %ebx 8010683f: 5e pop %esi 80106840: 5f pop %edi 80106841: 5d pop %ebp 80106842: c3 ret 80106843: 90 nop 80106844: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80106848: 83 c4 1c add $0x1c,%esp return 0; 8010684b: 31 c0 xor %eax,%eax } 8010684d: 5b pop %ebx 8010684e: 5e pop %esi 8010684f: 5f pop %edi 80106850: 5d pop %ebp 80106851: c3 ret panic("loaduvm: address should exist"); 80106852: c7 04 24 4f 77 10 80 movl $0x8010774f,(%esp) 80106859: e8 02 9b ff ff call 80100360 <panic> panic("loaduvm: addr must be page aligned"); 8010685e: c7 04 24 14 78 10 80 movl $0x80107814,(%esp) 80106865: e8 f6 9a ff ff call 80100360 <panic> 8010686a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106870 <allocuvm>: { 80106870: 55 push %ebp 80106871: 89 e5 mov %esp,%ebp 80106873: 57 push %edi 80106874: 56 push %esi 80106875: 53 push %ebx 80106876: 83 ec 2c sub $0x2c,%esp 80106879: 8b 7d 10 mov 0x10(%ebp),%edi if(newsz >= KERNBASE) 8010687c: 85 ff test %edi,%edi 8010687e: 0f 88 8f 00 00 00 js 80106913 <allocuvm+0xa3> if(newsz < oldsz) 80106884: 3b 7d 0c cmp 0xc(%ebp),%edi return oldsz; 80106887: 8b 45 0c mov 0xc(%ebp),%eax if(newsz < oldsz) 8010688a: 0f 82 85 00 00 00 jb 80106915 <allocuvm+0xa5> a = PGROUNDUP(oldsz); 80106890: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 80106896: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for(; a < newsz; a += PGSIZE){ 8010689c: 39 df cmp %ebx,%edi 8010689e: 77 57 ja 801068f7 <allocuvm+0x87> 801068a0: eb 7e jmp 80106920 <allocuvm+0xb0> 801068a2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi memset(mem, 0, PGSIZE); 801068a8: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp) 801068af: 00 801068b0: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 801068b7: 00 801068b8: 89 04 24 mov %eax,(%esp) 801068bb: e8 f0 d9 ff ff call 801042b0 <memset> if(mappages(pgdir, (char*)a, PGSIZE, V2P(mem), PTE_W|PTE_U) < 0){ 801068c0: 8d 86 00 00 00 80 lea -0x80000000(%esi),%eax 801068c6: 89 44 24 0c mov %eax,0xc(%esp) 801068ca: 8b 45 08 mov 0x8(%ebp),%eax 801068cd: c7 44 24 10 06 00 00 movl $0x6,0x10(%esp) 801068d4: 00 801068d5: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp) 801068dc: 00 801068dd: 89 5c 24 04 mov %ebx,0x4(%esp) 801068e1: 89 04 24 mov %eax,(%esp) 801068e4: e8 87 fc ff ff call 80106570 <mappages> 801068e9: 85 c0 test %eax,%eax 801068eb: 78 43 js 80106930 <allocuvm+0xc0> for(; a < newsz; a += PGSIZE){ 801068ed: 81 c3 00 10 00 00 add $0x1000,%ebx 801068f3: 39 df cmp %ebx,%edi 801068f5: 76 29 jbe 80106920 <allocuvm+0xb0> mem = kalloc(); 801068f7: e8 94 bb ff ff call 80102490 <kalloc> if(mem == 0){ 801068fc: 85 c0 test %eax,%eax mem = kalloc(); 801068fe: 89 c6 mov %eax,%esi if(mem == 0){ 80106900: 75 a6 jne 801068a8 <allocuvm+0x38> cprintf("allocuvm out of memory\n"); 80106902: c7 04 24 6d 77 10 80 movl $0x8010776d,(%esp) 80106909: e8 42 9d ff ff call 80100650 <cprintf> if(newsz >= oldsz) 8010690e: 3b 7d 0c cmp 0xc(%ebp),%edi 80106911: 77 47 ja 8010695a <allocuvm+0xea> return 0; 80106913: 31 c0 xor %eax,%eax } 80106915: 83 c4 2c add $0x2c,%esp 80106918: 5b pop %ebx 80106919: 5e pop %esi 8010691a: 5f pop %edi 8010691b: 5d pop %ebp 8010691c: c3 ret 8010691d: 8d 76 00 lea 0x0(%esi),%esi 80106920: 83 c4 2c add $0x2c,%esp 80106923: 89 f8 mov %edi,%eax 80106925: 5b pop %ebx 80106926: 5e pop %esi 80106927: 5f pop %edi 80106928: 5d pop %ebp 80106929: c3 ret 8010692a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi cprintf("allocuvm out of memory (2)\n"); 80106930: c7 04 24 85 77 10 80 movl $0x80107785,(%esp) 80106937: e8 14 9d ff ff call 80100650 <cprintf> if(newsz >= oldsz) 8010693c: 3b 7d 0c cmp 0xc(%ebp),%edi 8010693f: 76 0d jbe 8010694e <allocuvm+0xde> 80106941: 8b 4d 0c mov 0xc(%ebp),%ecx 80106944: 89 fa mov %edi,%edx 80106946: 8b 45 08 mov 0x8(%ebp),%eax 80106949: e8 c2 fa ff ff call 80106410 <deallocuvm.part.0> kfree(mem); 8010694e: 89 34 24 mov %esi,(%esp) 80106951: e8 8a b9 ff ff call 801022e0 <kfree> return 0; 80106956: 31 c0 xor %eax,%eax 80106958: eb bb jmp 80106915 <allocuvm+0xa5> 8010695a: 8b 4d 0c mov 0xc(%ebp),%ecx 8010695d: 89 fa mov %edi,%edx 8010695f: 8b 45 08 mov 0x8(%ebp),%eax 80106962: e8 a9 fa ff ff call 80106410 <deallocuvm.part.0> return 0; 80106967: 31 c0 xor %eax,%eax 80106969: eb aa jmp 80106915 <allocuvm+0xa5> 8010696b: 90 nop 8010696c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80106970 <deallocuvm>: { 80106970: 55 push %ebp 80106971: 89 e5 mov %esp,%ebp 80106973: 8b 55 0c mov 0xc(%ebp),%edx 80106976: 8b 4d 10 mov 0x10(%ebp),%ecx 80106979: 8b 45 08 mov 0x8(%ebp),%eax if(newsz >= oldsz) 8010697c: 39 d1 cmp %edx,%ecx 8010697e: 73 08 jae 80106988 <deallocuvm+0x18> } 80106980: 5d pop %ebp 80106981: e9 8a fa ff ff jmp 80106410 <deallocuvm.part.0> 80106986: 66 90 xchg %ax,%ax 80106988: 89 d0 mov %edx,%eax 8010698a: 5d pop %ebp 8010698b: c3 ret 8010698c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80106990 <freevm>: // Free a page table and all the physical memory pages // in the user part. void freevm(pde_t *pgdir) { 80106990: 55 push %ebp 80106991: 89 e5 mov %esp,%ebp 80106993: 56 push %esi 80106994: 53 push %ebx 80106995: 83 ec 10 sub $0x10,%esp 80106998: 8b 75 08 mov 0x8(%ebp),%esi uint i; if(pgdir == 0) 8010699b: 85 f6 test %esi,%esi 8010699d: 74 59 je 801069f8 <freevm+0x68> 8010699f: 31 c9 xor %ecx,%ecx 801069a1: ba 00 00 00 80 mov $0x80000000,%edx 801069a6: 89 f0 mov %esi,%eax panic("freevm: no pgdir"); deallocuvm(pgdir, KERNBASE, 0); for(i = 0; i < NPDENTRIES; i++){ 801069a8: 31 db xor %ebx,%ebx 801069aa: e8 61 fa ff ff call 80106410 <deallocuvm.part.0> 801069af: eb 12 jmp 801069c3 <freevm+0x33> 801069b1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801069b8: 83 c3 01 add $0x1,%ebx 801069bb: 81 fb 00 04 00 00 cmp $0x400,%ebx 801069c1: 74 27 je 801069ea <freevm+0x5a> if(pgdir[i] & PTE_P){ 801069c3: 8b 14 9e mov (%esi,%ebx,4),%edx 801069c6: f6 c2 01 test $0x1,%dl 801069c9: 74 ed je 801069b8 <freevm+0x28> char * v = P2V(PTE_ADDR(pgdir[i])); 801069cb: 81 e2 00 f0 ff ff and $0xfffff000,%edx for(i = 0; i < NPDENTRIES; i++){ 801069d1: 83 c3 01 add $0x1,%ebx char * v = P2V(PTE_ADDR(pgdir[i])); 801069d4: 81 c2 00 00 00 80 add $0x80000000,%edx kfree(v); 801069da: 89 14 24 mov %edx,(%esp) 801069dd: e8 fe b8 ff ff call 801022e0 <kfree> for(i = 0; i < NPDENTRIES; i++){ 801069e2: 81 fb 00 04 00 00 cmp $0x400,%ebx 801069e8: 75 d9 jne 801069c3 <freevm+0x33> } } kfree((char*)pgdir); 801069ea: 89 75 08 mov %esi,0x8(%ebp) } 801069ed: 83 c4 10 add $0x10,%esp 801069f0: 5b pop %ebx 801069f1: 5e pop %esi 801069f2: 5d pop %ebp kfree((char*)pgdir); 801069f3: e9 e8 b8 ff ff jmp 801022e0 <kfree> panic("freevm: no pgdir"); 801069f8: c7 04 24 a1 77 10 80 movl $0x801077a1,(%esp) 801069ff: e8 5c 99 ff ff call 80100360 <panic> 80106a04: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106a0a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80106a10 <setupkvm>: { 80106a10: 55 push %ebp 80106a11: 89 e5 mov %esp,%ebp 80106a13: 56 push %esi 80106a14: 53 push %ebx 80106a15: 83 ec 20 sub $0x20,%esp if((pgdir = (pde_t*)kalloc()) == 0) 80106a18: e8 73 ba ff ff call 80102490 <kalloc> 80106a1d: 85 c0 test %eax,%eax 80106a1f: 89 c6 mov %eax,%esi 80106a21: 74 75 je 80106a98 <setupkvm+0x88> memset(pgdir, 0, PGSIZE); 80106a23: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp) 80106a2a: 00 for(k = kmap; k < &kmap[NELEM(kmap)]; k++) 80106a2b: bb 20 a4 10 80 mov $0x8010a420,%ebx memset(pgdir, 0, PGSIZE); 80106a30: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 80106a37: 00 80106a38: 89 04 24 mov %eax,(%esp) 80106a3b: e8 70 d8 ff ff call 801042b0 <memset> if(mappages(pgdir, k->virt, k->phys_end - k->phys_start, 80106a40: 8b 53 0c mov 0xc(%ebx),%edx 80106a43: 8b 43 04 mov 0x4(%ebx),%eax 80106a46: 89 34 24 mov %esi,(%esp) 80106a49: 89 54 24 10 mov %edx,0x10(%esp) 80106a4d: 8b 53 08 mov 0x8(%ebx),%edx 80106a50: 89 44 24 0c mov %eax,0xc(%esp) 80106a54: 29 c2 sub %eax,%edx 80106a56: 8b 03 mov (%ebx),%eax 80106a58: 89 54 24 08 mov %edx,0x8(%esp) 80106a5c: 89 44 24 04 mov %eax,0x4(%esp) 80106a60: e8 0b fb ff ff call 80106570 <mappages> 80106a65: 85 c0 test %eax,%eax 80106a67: 78 17 js 80106a80 <setupkvm+0x70> for(k = kmap; k < &kmap[NELEM(kmap)]; k++) 80106a69: 83 c3 10 add $0x10,%ebx 80106a6c: 81 fb 60 a4 10 80 cmp $0x8010a460,%ebx 80106a72: 72 cc jb 80106a40 <setupkvm+0x30> 80106a74: 89 f0 mov %esi,%eax } 80106a76: 83 c4 20 add $0x20,%esp 80106a79: 5b pop %ebx 80106a7a: 5e pop %esi 80106a7b: 5d pop %ebp 80106a7c: c3 ret 80106a7d: 8d 76 00 lea 0x0(%esi),%esi freevm(pgdir); 80106a80: 89 34 24 mov %esi,(%esp) 80106a83: e8 08 ff ff ff call 80106990 <freevm> } 80106a88: 83 c4 20 add $0x20,%esp return 0; 80106a8b: 31 c0 xor %eax,%eax } 80106a8d: 5b pop %ebx 80106a8e: 5e pop %esi 80106a8f: 5d pop %ebp 80106a90: c3 ret 80106a91: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return 0; 80106a98: 31 c0 xor %eax,%eax 80106a9a: eb da jmp 80106a76 <setupkvm+0x66> 80106a9c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80106aa0 <kvmalloc>: { 80106aa0: 55 push %ebp 80106aa1: 89 e5 mov %esp,%ebp 80106aa3: 83 ec 08 sub $0x8,%esp kpgdir = setupkvm(); 80106aa6: e8 65 ff ff ff call 80106a10 <setupkvm> 80106aab: a3 a4 56 11 80 mov %eax,0x801156a4 lcr3(V2P(kpgdir)); // switch to the kernel page table 80106ab0: 05 00 00 00 80 add $0x80000000,%eax 80106ab5: 0f 22 d8 mov %eax,%cr3 } 80106ab8: c9 leave 80106ab9: c3 ret 80106aba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106ac0 <clearpteu>: // Clear PTE_U on a page. Used to create an inaccessible // page beneath the user stack. void clearpteu(pde_t *pgdir, char *uva) { 80106ac0: 55 push %ebp pte_t *pte; pte = walkpgdir(pgdir, uva, 0); 80106ac1: 31 c9 xor %ecx,%ecx { 80106ac3: 89 e5 mov %esp,%ebp 80106ac5: 83 ec 18 sub $0x18,%esp pte = walkpgdir(pgdir, uva, 0); 80106ac8: 8b 55 0c mov 0xc(%ebp),%edx 80106acb: 8b 45 08 mov 0x8(%ebp),%eax 80106ace: e8 ad f8 ff ff call 80106380 <walkpgdir> if(pte == 0) 80106ad3: 85 c0 test %eax,%eax 80106ad5: 74 05 je 80106adc <clearpteu+0x1c> panic("clearpteu"); *pte &= ~PTE_U; 80106ad7: 83 20 fb andl $0xfffffffb,(%eax) } 80106ada: c9 leave 80106adb: c3 ret panic("clearpteu"); 80106adc: c7 04 24 b2 77 10 80 movl $0x801077b2,(%esp) 80106ae3: e8 78 98 ff ff call 80100360 <panic> 80106ae8: 90 nop 80106ae9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106af0 <copyuvm>: // Given a parent process's page table, create a copy // of it for a child. pde_t* copyuvm(pde_t *pgdir, uint sz, uint sm, uint spgcount) { 80106af0: 55 push %ebp 80106af1: 89 e5 mov %esp,%ebp 80106af3: 57 push %edi 80106af4: 56 push %esi 80106af5: 53 push %ebx 80106af6: 83 ec 2c sub $0x2c,%esp pde_t *d; pte_t *pte; uint pa, i, flags; char *mem; if((d = setupkvm()) == 0) 80106af9: e8 12 ff ff ff call 80106a10 <setupkvm> 80106afe: 85 c0 test %eax,%eax 80106b00: 89 45 e0 mov %eax,-0x20(%ebp) 80106b03: 0f 84 86 01 00 00 je 80106c8f <copyuvm+0x19f> return 0; for(i = 0; i < sz; i += PGSIZE){ 80106b09: 8b 45 0c mov 0xc(%ebp),%eax 80106b0c: 85 c0 test %eax,%eax 80106b0e: 0f 84 ac 00 00 00 je 80106bc0 <copyuvm+0xd0> 80106b14: 31 db xor %ebx,%ebx 80106b16: eb 51 jmp 80106b69 <copyuvm+0x79> panic("copyuvm(sz): page not present"); pa = PTE_ADDR(*pte); flags = PTE_FLAGS(*pte); if((mem = kalloc()) == 0) goto bad; memmove(mem, (char*)P2V(pa), PGSIZE); 80106b18: 81 c7 00 00 00 80 add $0x80000000,%edi 80106b1e: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp) 80106b25: 00 80106b26: 89 7c 24 04 mov %edi,0x4(%esp) 80106b2a: 89 04 24 mov %eax,(%esp) 80106b2d: e8 1e d8 ff ff call 80104350 <memmove> if(mappages(d, (void*)i, PGSIZE, V2P(mem), flags) < 0) 80106b32: 8b 45 e4 mov -0x1c(%ebp),%eax 80106b35: 8d 96 00 00 00 80 lea -0x80000000(%esi),%edx 80106b3b: 89 54 24 0c mov %edx,0xc(%esp) 80106b3f: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp) 80106b46: 00 80106b47: 89 5c 24 04 mov %ebx,0x4(%esp) 80106b4b: 89 44 24 10 mov %eax,0x10(%esp) 80106b4f: 8b 45 e0 mov -0x20(%ebp),%eax 80106b52: 89 04 24 mov %eax,(%esp) 80106b55: e8 16 fa ff ff call 80106570 <mappages> 80106b5a: 85 c0 test %eax,%eax 80106b5c: 78 4d js 80106bab <copyuvm+0xbb> for(i = 0; i < sz; i += PGSIZE){ 80106b5e: 81 c3 00 10 00 00 add $0x1000,%ebx 80106b64: 39 5d 0c cmp %ebx,0xc(%ebp) 80106b67: 76 57 jbe 80106bc0 <copyuvm+0xd0> if((pte = walkpgdir(pgdir, (void *) i, 0)) == 0) 80106b69: 8b 45 08 mov 0x8(%ebp),%eax 80106b6c: 31 c9 xor %ecx,%ecx 80106b6e: 89 da mov %ebx,%edx 80106b70: e8 0b f8 ff ff call 80106380 <walkpgdir> 80106b75: 85 c0 test %eax,%eax 80106b77: 0f 84 19 01 00 00 je 80106c96 <copyuvm+0x1a6> if(!(*pte & PTE_P)) 80106b7d: 8b 30 mov (%eax),%esi 80106b7f: f7 c6 01 00 00 00 test $0x1,%esi 80106b85: 0f 84 17 01 00 00 je 80106ca2 <copyuvm+0x1b2> pa = PTE_ADDR(*pte); 80106b8b: 89 f7 mov %esi,%edi flags = PTE_FLAGS(*pte); 80106b8d: 81 e6 ff 0f 00 00 and $0xfff,%esi 80106b93: 89 75 e4 mov %esi,-0x1c(%ebp) pa = PTE_ADDR(*pte); 80106b96: 81 e7 00 f0 ff ff and $0xfffff000,%edi if((mem = kalloc()) == 0) 80106b9c: e8 ef b8 ff ff call 80102490 <kalloc> 80106ba1: 85 c0 test %eax,%eax 80106ba3: 89 c6 mov %eax,%esi 80106ba5: 0f 85 6d ff ff ff jne 80106b18 <copyuvm+0x28> return d; bad: freevm(d); 80106bab: 8b 45 e0 mov -0x20(%ebp),%eax 80106bae: 89 04 24 mov %eax,(%esp) 80106bb1: e8 da fd ff ff call 80106990 <freevm> return 0; 80106bb6: 31 c0 xor %eax,%eax } 80106bb8: 83 c4 2c add $0x2c,%esp 80106bbb: 5b pop %ebx 80106bbc: 5e pop %esi 80106bbd: 5f pop %edi 80106bbe: 5d pop %ebp 80106bbf: c3 ret for(i = PGROUNDUP(sm - (spgcount * PGSIZE)); i < PGROUNDUP(sm); i += PGSIZE){ 80106bc0: 8b 45 10 mov 0x10(%ebp),%eax 80106bc3: 8b 55 14 mov 0x14(%ebp),%edx 80106bc6: 05 ff 0f 00 00 add $0xfff,%eax 80106bcb: c1 e2 0c shl $0xc,%edx 80106bce: 89 c3 mov %eax,%ebx 80106bd0: 29 d3 sub %edx,%ebx 80106bd2: 25 00 f0 ff ff and $0xfffff000,%eax 80106bd7: 81 e3 00 f0 ff ff and $0xfffff000,%ebx 80106bdd: 39 c3 cmp %eax,%ebx 80106bdf: 89 45 dc mov %eax,-0x24(%ebp) 80106be2: 72 61 jb 80106c45 <copyuvm+0x155> 80106be4: e9 9b 00 00 00 jmp 80106c84 <copyuvm+0x194> 80106be9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi memmove(mem, (char*)P2V(pa), PGSIZE); 80106bf0: 81 c7 00 00 00 80 add $0x80000000,%edi 80106bf6: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp) 80106bfd: 00 80106bfe: 89 7c 24 04 mov %edi,0x4(%esp) 80106c02: 89 04 24 mov %eax,(%esp) 80106c05: e8 46 d7 ff ff call 80104350 <memmove> if(mappages(d, (void*)i, PGSIZE, V2P(mem), flags) < 0){ 80106c0a: 8b 45 e4 mov -0x1c(%ebp),%eax 80106c0d: 8d 96 00 00 00 80 lea -0x80000000(%esi),%edx 80106c13: 89 54 24 0c mov %edx,0xc(%esp) 80106c17: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp) 80106c1e: 00 80106c1f: 89 5c 24 04 mov %ebx,0x4(%esp) 80106c23: 89 44 24 10 mov %eax,0x10(%esp) 80106c27: 8b 45 e0 mov -0x20(%ebp),%eax 80106c2a: 89 04 24 mov %eax,(%esp) 80106c2d: e8 3e f9 ff ff call 80106570 <mappages> 80106c32: 85 c0 test %eax,%eax 80106c34: 0f 88 71 ff ff ff js 80106bab <copyuvm+0xbb> for(i = PGROUNDUP(sm - (spgcount * PGSIZE)); i < PGROUNDUP(sm); i += PGSIZE){ 80106c3a: 81 c3 00 10 00 00 add $0x1000,%ebx 80106c40: 3b 5d dc cmp -0x24(%ebp),%ebx 80106c43: 73 3f jae 80106c84 <copyuvm+0x194> if((pte = walkpgdir(pgdir, (void *) i, 0)) == 0){ 80106c45: 8b 45 08 mov 0x8(%ebp),%eax 80106c48: 31 c9 xor %ecx,%ecx 80106c4a: 89 da mov %ebx,%edx 80106c4c: e8 2f f7 ff ff call 80106380 <walkpgdir> 80106c51: 85 c0 test %eax,%eax 80106c53: 74 41 je 80106c96 <copyuvm+0x1a6> if(!(*pte & PTE_P)){ 80106c55: 8b 30 mov (%eax),%esi 80106c57: f7 c6 01 00 00 00 test $0x1,%esi 80106c5d: 74 4f je 80106cae <copyuvm+0x1be> pa = PTE_ADDR(*pte); 80106c5f: 89 f7 mov %esi,%edi flags = PTE_FLAGS(*pte); 80106c61: 81 e6 ff 0f 00 00 and $0xfff,%esi 80106c67: 89 75 e4 mov %esi,-0x1c(%ebp) pa = PTE_ADDR(*pte); 80106c6a: 81 e7 00 f0 ff ff and $0xfffff000,%edi if((mem = kalloc()) == 0){ 80106c70: e8 1b b8 ff ff call 80102490 <kalloc> 80106c75: 85 c0 test %eax,%eax 80106c77: 89 c6 mov %eax,%esi 80106c79: 0f 85 71 ff ff ff jne 80106bf0 <copyuvm+0x100> 80106c7f: e9 27 ff ff ff jmp 80106bab <copyuvm+0xbb> 80106c84: 8b 45 e0 mov -0x20(%ebp),%eax } 80106c87: 83 c4 2c add $0x2c,%esp 80106c8a: 5b pop %ebx 80106c8b: 5e pop %esi 80106c8c: 5f pop %edi 80106c8d: 5d pop %ebp 80106c8e: c3 ret return 0; 80106c8f: 31 c0 xor %eax,%eax 80106c91: e9 22 ff ff ff jmp 80106bb8 <copyuvm+0xc8> panic("copyuvm: pte should exist"); 80106c96: c7 04 24 bc 77 10 80 movl $0x801077bc,(%esp) 80106c9d: e8 be 96 ff ff call 80100360 <panic> panic("copyuvm(sz): page not present"); 80106ca2: c7 04 24 d6 77 10 80 movl $0x801077d6,(%esp) 80106ca9: e8 b2 96 ff ff call 80100360 <panic> panic("copyuvm(sm): page not present"); 80106cae: c7 04 24 f4 77 10 80 movl $0x801077f4,(%esp) 80106cb5: e8 a6 96 ff ff call 80100360 <panic> 80106cba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106cc0 <uva2ka>: //PAGEBREAK! // Map user virtual address to kernel address. char* uva2ka(pde_t *pgdir, char *uva) { 80106cc0: 55 push %ebp pte_t *pte; pte = walkpgdir(pgdir, uva, 0); 80106cc1: 31 c9 xor %ecx,%ecx { 80106cc3: 89 e5 mov %esp,%ebp 80106cc5: 83 ec 08 sub $0x8,%esp pte = walkpgdir(pgdir, uva, 0); 80106cc8: 8b 55 0c mov 0xc(%ebp),%edx 80106ccb: 8b 45 08 mov 0x8(%ebp),%eax 80106cce: e8 ad f6 ff ff call 80106380 <walkpgdir> if((*pte & PTE_P) == 0) 80106cd3: 8b 00 mov (%eax),%eax 80106cd5: 89 c2 mov %eax,%edx 80106cd7: 83 e2 05 and $0x5,%edx return 0; if((*pte & PTE_U) == 0) 80106cda: 83 fa 05 cmp $0x5,%edx 80106cdd: 75 11 jne 80106cf0 <uva2ka+0x30> return 0; return (char*)P2V(PTE_ADDR(*pte)); 80106cdf: 25 00 f0 ff ff and $0xfffff000,%eax 80106ce4: 05 00 00 00 80 add $0x80000000,%eax } 80106ce9: c9 leave 80106cea: c3 ret 80106ceb: 90 nop 80106cec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return 0; 80106cf0: 31 c0 xor %eax,%eax } 80106cf2: c9 leave 80106cf3: c3 ret 80106cf4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106cfa: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80106d00 <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) { 80106d00: 55 push %ebp 80106d01: 89 e5 mov %esp,%ebp 80106d03: 57 push %edi 80106d04: 56 push %esi 80106d05: 53 push %ebx 80106d06: 83 ec 1c sub $0x1c,%esp 80106d09: 8b 5d 14 mov 0x14(%ebp),%ebx 80106d0c: 8b 4d 0c mov 0xc(%ebp),%ecx 80106d0f: 8b 7d 10 mov 0x10(%ebp),%edi char *buf, *pa0; uint n, va0; buf = (char*)p; while(len > 0){ 80106d12: 85 db test %ebx,%ebx 80106d14: 75 3a jne 80106d50 <copyout+0x50> 80106d16: eb 68 jmp 80106d80 <copyout+0x80> va0 = (uint)PGROUNDDOWN(va); pa0 = uva2ka(pgdir, (char*)va0); if(pa0 == 0) return -1; n = PGSIZE - (va - va0); 80106d18: 8b 4d e4 mov -0x1c(%ebp),%ecx 80106d1b: 89 f2 mov %esi,%edx if(n > len) n = len; memmove(pa0 + (va - va0), buf, n); 80106d1d: 89 7c 24 04 mov %edi,0x4(%esp) n = PGSIZE - (va - va0); 80106d21: 29 ca sub %ecx,%edx 80106d23: 81 c2 00 10 00 00 add $0x1000,%edx 80106d29: 39 da cmp %ebx,%edx 80106d2b: 0f 47 d3 cmova %ebx,%edx memmove(pa0 + (va - va0), buf, n); 80106d2e: 29 f1 sub %esi,%ecx 80106d30: 01 c8 add %ecx,%eax 80106d32: 89 54 24 08 mov %edx,0x8(%esp) 80106d36: 89 04 24 mov %eax,(%esp) 80106d39: 89 55 e4 mov %edx,-0x1c(%ebp) 80106d3c: e8 0f d6 ff ff call 80104350 <memmove> len -= n; buf += n; 80106d41: 8b 55 e4 mov -0x1c(%ebp),%edx va = va0 + PGSIZE; 80106d44: 8d 8e 00 10 00 00 lea 0x1000(%esi),%ecx buf += n; 80106d4a: 01 d7 add %edx,%edi while(len > 0){ 80106d4c: 29 d3 sub %edx,%ebx 80106d4e: 74 30 je 80106d80 <copyout+0x80> pa0 = uva2ka(pgdir, (char*)va0); 80106d50: 8b 45 08 mov 0x8(%ebp),%eax va0 = (uint)PGROUNDDOWN(va); 80106d53: 89 ce mov %ecx,%esi 80106d55: 81 e6 00 f0 ff ff and $0xfffff000,%esi pa0 = uva2ka(pgdir, (char*)va0); 80106d5b: 89 74 24 04 mov %esi,0x4(%esp) va0 = (uint)PGROUNDDOWN(va); 80106d5f: 89 4d e4 mov %ecx,-0x1c(%ebp) pa0 = uva2ka(pgdir, (char*)va0); 80106d62: 89 04 24 mov %eax,(%esp) 80106d65: e8 56 ff ff ff call 80106cc0 <uva2ka> if(pa0 == 0) 80106d6a: 85 c0 test %eax,%eax 80106d6c: 75 aa jne 80106d18 <copyout+0x18> } return 0; } 80106d6e: 83 c4 1c add $0x1c,%esp return -1; 80106d71: b8 ff ff ff ff mov $0xffffffff,%eax } 80106d76: 5b pop %ebx 80106d77: 5e pop %esi 80106d78: 5f pop %edi 80106d79: 5d pop %ebp 80106d7a: c3 ret 80106d7b: 90 nop 80106d7c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80106d80: 83 c4 1c add $0x1c,%esp return 0; 80106d83: 31 c0 xor %eax,%eax } 80106d85: 5b pop %ebx 80106d86: 5e pop %esi 80106d87: 5f pop %edi 80106d88: 5d pop %ebp 80106d89: c3 ret 80106d8a: 66 90 xchg %ax,%ax 80106d8c: 66 90 xchg %ax,%ax 80106d8e: 66 90 xchg %ax,%ax 80106d90 <shminit>: char *frame; int refcnt; } shm_pages[64]; } shm_table; void shminit() { 80106d90: 55 push %ebp 80106d91: 89 e5 mov %esp,%ebp 80106d93: 83 ec 18 sub $0x18,%esp int i; initlock(&(shm_table.lock), "SHM lock"); 80106d96: c7 44 24 04 38 78 10 movl $0x80107838,0x4(%esp) 80106d9d: 80 80106d9e: c7 04 24 c0 56 11 80 movl $0x801156c0,(%esp) 80106da5: e8 d6 d2 ff ff call 80104080 <initlock> acquire(&(shm_table.lock)); 80106daa: c7 04 24 c0 56 11 80 movl $0x801156c0,(%esp) 80106db1: e8 ba d3 ff ff call 80104170 <acquire> 80106db6: b8 f4 56 11 80 mov $0x801156f4,%eax 80106dbb: 90 nop 80106dbc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for (i = 0; i< 64; i++) { shm_table.shm_pages[i].id =0; 80106dc0: c7 00 00 00 00 00 movl $0x0,(%eax) 80106dc6: 83 c0 0c add $0xc,%eax shm_table.shm_pages[i].frame =0; 80106dc9: c7 40 f8 00 00 00 00 movl $0x0,-0x8(%eax) shm_table.shm_pages[i].refcnt =0; 80106dd0: c7 40 fc 00 00 00 00 movl $0x0,-0x4(%eax) for (i = 0; i< 64; i++) { 80106dd7: 3d f4 59 11 80 cmp $0x801159f4,%eax 80106ddc: 75 e2 jne 80106dc0 <shminit+0x30> } release(&(shm_table.lock)); 80106dde: c7 04 24 c0 56 11 80 movl $0x801156c0,(%esp) 80106de5: e8 76 d4 ff ff call 80104260 <release> } 80106dea: c9 leave 80106deb: c3 ret 80106dec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80106df0 <shm_open>: int shm_open(int id, char **pointer) { 80106df0: 55 push %ebp return 0; //added to remove compiler warning -- you should decide what to return } 80106df1: 31 c0 xor %eax,%eax int shm_open(int id, char **pointer) { 80106df3: 89 e5 mov %esp,%ebp } 80106df5: 5d pop %ebp 80106df6: c3 ret 80106df7: 89 f6 mov %esi,%esi 80106df9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106e00 <shm_close>: int shm_close(int id) { 80106e00: 55 push %ebp return 0; //added to remove compiler warning -- you should decide what to return } 80106e01: 31 c0 xor %eax,%eax int shm_close(int id) { 80106e03: 89 e5 mov %esp,%ebp } 80106e05: 5d pop %ebp 80106e06: c3 ret
; A090618: Highest power of 9 dividing n!. ; 0,0,0,0,0,0,1,1,1,2,2,2,2,2,2,3,3,3,4,4,4,4,4,4,5,5,5,6,6,6,7,7,7,7,7,7,8,8,8,9,9,9,9,9,9,10,10,10,11,11,11,11,11,11,13,13,13,13,13,13,14,14,14,15,15,15,15,15,15,16,16,16,17,17,17,17,17,17,18,18,18,20,20,20,20 lpb $0 div $0,3 add $1,$0 lpe div $1,2
; A044337: Numbers n such that string 0,5 occurs in the base 10 representation of n but not of n-1. ; Submitted by Christian Krause ; 105,205,305,405,505,605,705,805,905,1005,1050,1105,1205,1305,1405,1505,1605,1705,1805,1905,2005,2050,2105,2205,2305,2405,2505,2605,2705,2805,2905,3005,3050,3105,3205,3305,3405,3505 add $0,1 mul $0,10 add $0,2 mov $1,$0 add $0,9 div $0,11 mul $0,22 sub $1,3 div $1,11 add $1,3 mul $1,14 add $0,$1 add $0,$1 sub $0,8 mul $0,4 div $0,10 mul $0,5 sub $0,90
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r14 push %r15 push %rax push %rbp push %rcx push %rdi push %rsi lea addresses_WT_ht+0x19c49, %rsi lea addresses_WT_ht+0x19019, %rdi sub %r14, %r14 mov $56, %rcx rep movsq xor %r10, %r10 lea addresses_WC_ht+0x155b9, %rsi lea addresses_WT_ht+0x134d9, %rdi nop mfence mov $85, %rcx rep movsq nop nop nop nop nop and %r10, %r10 lea addresses_D_ht+0xdd51, %rdi nop nop nop nop xor $34374, %r15 mov (%rdi), %r14d and $62682, %r10 lea addresses_WT_ht+0x88d9, %rdi nop nop xor %rbp, %rbp movb (%rdi), %r10b nop nop nop nop dec %r15 lea addresses_normal_ht+0x1a839, %rsi nop sub $63471, %rcx vmovups (%rsi), %ymm4 vextracti128 $0, %ymm4, %xmm4 vpextrq $0, %xmm4, %r14 nop cmp %rsi, %rsi lea addresses_normal_ht+0x170d9, %r15 nop cmp %r10, %r10 mov $0x6162636465666768, %rcx movq %rcx, %xmm5 movups %xmm5, (%r15) nop nop nop nop nop and $1357, %r10 lea addresses_UC_ht+0x17cb5, %rsi nop nop nop nop inc %r15 movl $0x61626364, (%rsi) nop nop nop xor $20127, %r10 lea addresses_D_ht+0x63d9, %rsi lea addresses_UC_ht+0x5dbd, %rdi xor %rax, %rax mov $50, %rcx rep movsl xor $2627, %rdi lea addresses_D_ht+0x156d9, %rsi lea addresses_WT_ht+0x108d9, %rdi clflush (%rsi) cmp $31145, %r15 mov $30, %rcx rep movsb nop nop cmp $16385, %r15 lea addresses_WT_ht+0x130d9, %rax and $1722, %r14 mov (%rax), %r15w add %r14, %r14 lea addresses_D_ht+0x9fd9, %rcx clflush (%rcx) nop nop nop sub %rax, %rax mov (%rcx), %r15d nop nop nop sub %rcx, %rcx lea addresses_WC_ht+0xdc59, %rbp nop nop nop nop nop add $37712, %r10 mov (%rbp), %rcx nop nop nop nop xor $43217, %r14 lea addresses_WT_ht+0x1c38b, %r14 nop and %rdi, %rdi movb $0x61, (%r14) nop nop nop nop xor $50996, %r14 lea addresses_D_ht+0xc5d9, %rax nop nop nop nop dec %rdi movups (%rax), %xmm2 vpextrq $1, %xmm2, %rcx inc %rcx pop %rsi pop %rdi pop %rcx pop %rbp pop %rax pop %r15 pop %r14 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r13 push %r15 push %rbp push %rbx push %rdx // Store lea addresses_WC+0xfea9, %rbx nop nop nop nop sub $49305, %r10 movw $0x5152, (%rbx) and $52, %r10 // Store lea addresses_RW+0x17039, %rbx nop nop cmp %rbp, %rbp mov $0x5152535455565758, %r15 movq %r15, %xmm2 movups %xmm2, (%rbx) nop nop nop nop nop cmp %r15, %r15 // Load lea addresses_D+0x6b99, %r10 nop nop inc %rbp vmovups (%r10), %ymm0 vextracti128 $0, %ymm0, %xmm0 vpextrq $0, %xmm0, %r13 nop nop inc %r10 // Store lea addresses_WT+0x1ce39, %rbx nop nop nop nop nop xor %r11, %r11 mov $0x5152535455565758, %rdx movq %rdx, (%rbx) nop nop nop inc %rdx // Store lea addresses_normal+0x1a4d9, %r11 nop nop nop nop xor $33869, %r10 mov $0x5152535455565758, %r13 movq %r13, %xmm2 vmovntdq %ymm2, (%r11) nop nop nop nop sub $25065, %r11 // Store lea addresses_D+0xc0d9, %r11 nop nop nop xor $49179, %r15 mov $0x5152535455565758, %r13 movq %r13, %xmm3 vmovups %ymm3, (%r11) nop nop nop nop nop and $60250, %rbp // Faulty Load lea addresses_D+0xc0d9, %r11 nop nop xor $26433, %rbx mov (%r11), %r13w lea oracles, %r15 and $0xff, %r13 shlq $12, %r13 mov (%r15,%r13,1), %r13 pop %rdx pop %rbx pop %rbp pop %r15 pop %r13 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_D', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_WC', 'size': 2, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_RW', 'size': 16, 'AVXalign': False}} {'src': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_D', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 5, 'NT': True, 'type': 'addresses_WT', 'size': 8, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 7, 'NT': True, 'type': 'addresses_normal', 'size': 32, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_D', 'size': 32, 'AVXalign': False}} [Faulty Load] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_D', 'size': 2, 'AVXalign': True}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}} {'src': {'type': 'addresses_WC_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 9, 'same': True}} {'src': {'same': True, 'congruent': 1, 'NT': False, 'type': 'addresses_D_ht', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': True, 'congruent': 11, 'NT': False, 'type': 'addresses_normal_ht', 'size': 16, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_UC_ht', 'size': 4, 'AVXalign': True}} {'src': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}} {'src': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}} {'src': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_D_ht', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_WC_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False}} {'src': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_D_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'} {'58': 21829} 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 */
.size 8000 .text@48 jp lstatint .text@100 jp lbegin .data@143 c0 .text@150 lbegin: ld a, 00 ldff(ff), a ld a, 30 ldff(00), a ld a, 01 ldff(4d), a stop, 00 ld a, ff ldff(45), a ld b, 91 call lwaitly_b ld hl, fe00 ld d, 10 ld a, d ld(hl++), a ld a, 08 ld(hl++), a inc l inc l ld a, d ld(hl++), a ld(hl++), a inc l inc l ld(hl++), a ld a, 18 ld(hl++), a inc l inc l ld a, d ld(hl++), a ld a, 20 ld(hl++), a inc l inc l ld a, d ld(hl++), a ld a, 28 ld(hl++), a inc l inc l ld a, d ld(hl++), a ld a, 30 ld(hl++), a inc l inc l ld a, d ld(hl++), a ld a, 38 ld(hl++), a inc l inc l ld a, d ld(hl++), a ld a, 40 ld(hl++), a inc l inc l ld a, d ld(hl++), a ld a, 48 ld(hl++), a inc l inc l ld a, d ld(hl++), a ld a, 4a ld(hl++), a ld a, 40 ldff(41), a ld a, 02 ldff(ff), a xor a, a ldff(0f), a ei ld a, 01 ldff(45), a ld c, 41 ld a, 93 ldff(40), a .text@1000 lstatint: nop .text@10a8 ldff a, (c) and a, 03 jp lprint_a .text@7000 lprint_a: push af ld b, 91 call lwaitly_b xor a, a ldff(40), a pop af ld(9800), a ld bc, 7a00 ld hl, 8000 ld d, a0 lprint_copytiles: ld a, (bc) inc bc ld(hl++), a dec d jrnz lprint_copytiles ld a, c0 ldff(47), a ld a, 80 ldff(68), a ld a, ff ldff(69), a ldff(69), a ldff(69), a ldff(69), a ldff(69), a ldff(69), a xor a, a ldff(69), a ldff(69), a ldff(43), a ld a, 91 ldff(40), a lprint_limbo: jr lprint_limbo .text@7400 lwaitly_b: ld c, 44 lwaitly_b_loop: ldff a, (c) cmp a, b jrnz lwaitly_b_loop ret .data@7a00 00 00 7f 7f 41 41 41 41 41 41 41 41 41 41 7f 7f 00 00 08 08 08 08 08 08 08 08 08 08 08 08 08 08 00 00 7f 7f 01 01 01 01 7f 7f 40 40 40 40 7f 7f 00 00 7f 7f 01 01 01 01 3f 3f 01 01 01 01 7f 7f 00 00 41 41 41 41 41 41 7f 7f 01 01 01 01 01 01 00 00 7f 7f 40 40 40 40 7e 7e 01 01 01 01 7e 7e 00 00 7f 7f 40 40 40 40 7f 7f 41 41 41 41 7f 7f 00 00 7f 7f 01 01 02 02 04 04 08 08 10 10 10 10 00 00 3e 3e 41 41 41 41 3e 3e 41 41 41 41 3e 3e 00 00 7f 7f 41 41 41 41 7f 7f 01 01 01 01 7f 7f
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r8 push %rax push %rbx push %rcx push %rdi push %rsi lea addresses_WT_ht+0x3417, %rax nop nop nop nop xor $57153, %r12 mov $0x6162636465666768, %r11 movq %r11, %xmm1 movups %xmm1, (%rax) cmp %r8, %r8 lea addresses_A_ht+0x199db, %rsi lea addresses_WC_ht+0x1fdf, %rdi nop nop xor $36900, %rbx mov $5, %rcx rep movsl nop nop nop nop nop xor %r11, %r11 lea addresses_WC_ht+0x1eadb, %rsi lea addresses_A_ht+0x19833, %rdi nop nop nop xor %r8, %r8 mov $93, %rcx rep movsq add %r12, %r12 lea addresses_UC_ht+0x15317, %rsi lea addresses_UC_ht+0x12d33, %rdi nop nop nop sub $20889, %rbx mov $46, %rcx rep movsb nop nop dec %rbx pop %rsi pop %rdi pop %rcx pop %rbx pop %rax pop %r8 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r14 push %r15 push %rbx push %rcx push %rdx // Load lea addresses_normal+0x16edb, %r14 nop nop nop nop nop and %r15, %r15 movaps (%r14), %xmm0 vpextrq $0, %xmm0, %rcx nop nop nop add %r15, %r15 // Store lea addresses_A+0xdddb, %rbx nop nop cmp $57451, %rdx movl $0x51525354, (%rbx) nop nop cmp $11056, %r14 // Store mov $0x4db, %r12 nop and $65314, %r10 mov $0x5152535455565758, %rcx movq %rcx, (%r12) nop nop nop xor $22440, %r12 // Store lea addresses_normal+0xb073, %rdx nop dec %rcx mov $0x5152535455565758, %r14 movq %r14, %xmm0 and $0xffffffffffffffc0, %rdx vmovaps %ymm0, (%rdx) nop nop nop nop nop cmp $62460, %rcx // Store lea addresses_D+0x226c, %r15 nop nop add $16105, %r14 movw $0x5152, (%r15) nop nop add $63231, %rbx // Load lea addresses_normal+0x9db, %r12 nop nop nop nop add $11677, %rcx mov (%r12), %r14w // Exception!!! mov (0), %r14 nop nop nop nop inc %r12 // Store lea addresses_WC+0x59db, %rcx nop xor $36995, %rdx mov $0x5152535455565758, %r15 movq %r15, %xmm2 movups %xmm2, (%rcx) nop cmp $5390, %r14 // Faulty Load lea addresses_WC+0x59db, %rcx and $28362, %r14 movb (%rcx), %bl lea oracles, %r14 and $0xff, %rbx shlq $12, %rbx mov (%r14,%rbx,1), %rbx pop %rdx pop %rcx pop %rbx pop %r15 pop %r14 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': True, 'congruent': 6, 'size': 16, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 9, 'size': 4, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_P', 'AVXalign': True, 'congruent': 8, 'size': 8, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': True, 'congruent': 3, 'size': 32, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 8, 'size': 2, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': True, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 2, 'size': 16, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 3, 'same': True}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}} {'58': 6717} 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 */
; A190994: a(0)=27, a(1)=2, a(n) = a(n-1) +a(n-2) for n>=2. ; 27,2,29,31,60,91,151,242,393,635,1028,1663,2691,4354,7045,11399,18444,29843,48287,78130,126417,204547,330964,535511,866475,1401986,2268461,3670447,5938908,9609355,15548263,25157618,40705881,65863499,106569380,172432879,279002259,451435138,730437397,1181872535,1912309932,3094182467,5006492399,8100674866,13107167265,21207842131,34315009396,55522851527,89837860923,145360712450,235198573373,380559285823,615757859196,996317145019,1612075004215,2608392149234,4220467153449,6828859302683,11049326456132,17878185758815,28927512214947,46805697973762,75733210188709,122538908162471,198272118351180,320811026513651,519083144864831,839894171378482,1358977316243313,2198871487621795,3557848803865108,5756720291486903,9314569095352011,15071289386838914,24385858482190925,39457147869029839,63843006351220764,103300154220250603,167143160571471367,270443314791721970,437586475363193337,708029790154915307,1145616265518108644,1853646055673023951,2999262321191132595,4852908376864156546,7852170698055289141,12705079074919445687,20557249772974734828,33262328847894180515,53819578620868915343,87081907468763095858,140901486089632011201,227983393558395107059,368884879648027118260,596868273206422225319,965753152854449343579,1562621426060871568898,2528374578915320912477,4090996004976192481375 mov $5,$0 mov $7,2 lpb $7 sub $7,1 add $0,$7 sub $0,1 mov $2,$0 mul $2,2 mov $6,$0 max $6,0 seq $6,157681 ; Fibonacci sequence beginning 29, 31. mov $3,$6 add $3,$2 mov $4,$7 mul $4,$3 add $1,$4 mov $6,$3 lpe min $5,1 mul $5,$6 sub $1,$5 sub $1,2 mov $0,$1
; A097299: Ninth column (m=8) of (1,6)-Pascal triangle A096956. ; 6,49,225,765,2145,5247,11583,23595,45045,81510,140998,234702,377910,591090,901170,1343034,1961256,2812095,3965775,5509075,7548255,10212345,13656825,18067725,23666175,30713436,39516444,50433900,63882940 lpb $0,1 mov $2,$0 cal $2,97298 ; Eighth column (m=7) of (1,6)-Pascal triangle A096956. sub $0,1 add $1,$2 lpe add $1,6
; A165192: a(0) = 1, a(1) = 2, a(3) = 3, a(n) = a(n-1) - a(n-3). ; Submitted by Jamie Morken(s4) ; 1,2,3,2,0,-3,-5,-5,-2,3,8,10,7,-1,-11,-18,-17,-6,12,29,35,23,-6,-41,-64,-58,-17,47,105,122,75,-30,-152,-227,-197,-45,182,379,424,242,-137,-561,-803,-666,-105,698,1364,1469,771,-593,-2062,-2833,-2240,-178 mov $3,1 lpb $0 sub $0,1 add $3,1 mov $4,$1 mov $1,$3 sub $3,$2 mov $2,$4 lpe mov $0,$3
; A311440: Coordination sequence Gal.5.50.2 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings. ; 1,4,8,12,17,21,25,30,34,38,42,46,50,54,59,63,67,72,76,80,84,88,92,96,101,105,109,114,118,122,126,130,134,138,143,147,151,156,160,164,168,172,176,180,185,189,193,198,202,206 mov $1,1 mov $4,$0 mov $5,$0 lpb $0 mov $0,2 mul $0,$4 mov $2,$4 mod $2,10 add $0,$2 div $0,10 mov $1,$0 lpe mov $3,$5 mul $3,4 add $1,$3 mov $0,$1
;E:\Programmierung\Delphi7\Projects\CubeOS\CubeOOP\Works\Projects\SecondTest.OOP AT 20.08.2018 19:42:33 .486 locals jumps .model flat,STDCALL ;============== Prolog Ended Include .\include\Prolog.asm ;//Environment: CubeOOP ;//Title: ;//Autor: ;//Date: 29.07.2007 09:47:02 ;//Description: ;//************************************************************* ;Main; include .\include\win32.inc _Main: $_Main proc push offset lppaint push [hwnd] call BeginPaint mov [theDC], eax ;Var i: Int16; ;a: Int16; ;Begin ;a:= 3; Push ESI ; Entry Call_Assignment 1 Push ESI ; Entry Call_Assignment 2 POP EBX ; LOAD Basepointer ESI Push ESI ; Store LS mov ESI ,EBX; Store LS XOR EAX,EAX XOR EDX,EDX mov eax,3 POP ESI ; Restore LS mov word ptr[a], ax Pop ESI ; Exit Call_Assignment ;i := 7; Push ESI ; Entry Call_Assignment 1 Push ESI ; Entry Call_Assignment 2 POP EBX ; LOAD Basepointer ESI Push ESI ; Store LS mov ESI ,EBX; Store LS XOR EAX,EAX XOR EDX,EDX mov eax,7 POP ESI ; Restore LS mov word ptr[i], ax Pop ESI ; Exit Call_Assignment ;Writeln(a); Push esi mov ax, [a] SUB ESP,20 mov ESI,ESP push EAX ; Store Result CLD ; clear direction flag => increment EDI MOV ECX, 20 ; Count init ECX for REP MOV EAX, 32 ; Char init AL for STOSB MOV EDI, ESI ; dest init EDI for STOSB REP STOSB ; Repeat: Leerzeichen (#32) in den Speicher laden pop EAX ; Load Result mov Byte ptr[ESI],1 ; String Byte 0 mov Byte ptr[ESI+1],16 ; String Anzahl ADD ESI,18 ; Zeiger ans Ende (Zeichen rechts ausrichten) XOR ECX, ECX ; Basis 10 XOR EDX, EDX ; 0 Call $_Int32ToStr ; Konvertierung mov ESI, ESP Call $_StringWrite ADD ESP,20 Call $_NLN Pop esi ;Writeln(i); Push esi mov ax, [i] SUB ESP,20 mov ESI,ESP push EAX ; Store Result CLD ; clear direction flag => increment EDI MOV ECX, 20 ; Count init ECX for REP MOV EAX, 32 ; Char init AL for STOSB MOV EDI, ESI ; dest init EDI for STOSB REP STOSB ; Repeat: Leerzeichen (#32) in den Speicher laden pop EAX ; Load Result mov Byte ptr[ESI],1 ; String Byte 0 mov Byte ptr[ESI+1],16 ; String Anzahl ADD ESI,18 ; Zeiger ans Ende (Zeichen rechts ausrichten) XOR ECX, ECX ; Basis 10 XOR EDX, EDX ; 0 Call $_Int32ToStr ; Konvertierung mov ESI, ESP Call $_StringWrite ADD ESP,20 Call $_NLN Pop esi ;end; ; push offset lppaint push [hwnd] call EndPaint RET $_Main endp Include .\include\Lib.asm .data copyright db '(c)M.Hoeller-Schlieper CubeOS 2007',0 newhwnd dd 0 lppaint PAINTSTRUCT <?> msg MSGSTRUCT <?> wc WNDCLASS <?> hInst dd 0 szTitleName db 'CubeOS - Test Environment' szClassName db 'CubeOS',0 _Y dd 5 _X dd 5 _TextHeight dd 15 DecimalSep db ',' ThousandSep db '.' Precision dd 2 Digits dd 2 conBuffer db 1,16,' ' parstr db 127,0,127 dup(?) str db 255,0,255 dup(32) concat db 255,0,255 dup(0) cpystr db 255,0,255 dup(0) nts db 7,0,7 dup(0) zero db 0 dummystr db 1,1,0 chrchr db 1,1,32 minus db 1,1,"-" Allocated dd 0 MemBlock dd 1024 dup (0); dynamischen Speicher reservieren EndPtr dd 0 ;======== global Vars i dw 0 a dw 0 ends end start
// Copyright (c) 2013-2016 Josh Blum // SPDX-License-Identifier: BSL-1.0 #include "MainWindow/IconUtils.hpp" #include "MessageWindow/LoggerDisplay.hpp" #include "MessageWindow/LoggerChannel.hpp" #include <QPlainTextEdit> #include <QScrollBar> #include <QToolButton> #include <QTimer> #include <Poco/DateTimeFormatter.h> #include <iostream> static const long CHECK_MSGS_TIMEOUT_MS = 100; static const size_t MAX_MSGS_PER_TIMEOUT = 3; static const size_t MAX_HISTORY_MSGS = 4096; LoggerDisplay::LoggerDisplay(QWidget *parent): QStackedWidget(parent), _channel(new LoggerChannel(nullptr)), _text(new QPlainTextEdit(this)), _clearButton(new QToolButton(_text)), _timer(new QTimer(this)) { this->addWidget(_text); _text->setReadOnly(true); _text->setMaximumBlockCount(MAX_HISTORY_MSGS); _text->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); _clearButton->hide(); _clearButton->setIcon(makeIconFromTheme("edit-clear-list")); _clearButton->setToolTip(tr("Clear message history")); connect(_clearButton, SIGNAL(clicked(void)), _text, SLOT(clear(void))); connect(_timer, &QTimer::timeout, this, &LoggerDisplay::handleCheckMsgs); _timer->start(CHECK_MSGS_TIMEOUT_MS); } LoggerDisplay::~LoggerDisplay(void) { _channel->disconnect(); } void LoggerDisplay::handleCheckMsgs(void) { const bool autoScroll = _text->verticalScrollBar()->value()+50 > _text->verticalScrollBar()->maximum(); size_t numMsgs = 0; Poco::Message msg; while (_channel->pop(msg)) { this->handleLogMessage(msg); if (++numMsgs == MAX_MSGS_PER_TIMEOUT) break; } if (numMsgs != 0 and autoScroll) { auto c = _text->textCursor(); c.movePosition(QTextCursor::End); _text->setTextCursor(c); } } void LoggerDisplay::handleLogMessage(const Poco::Message &msg) { QString color; switch (msg.getPriority()) { case Poco::Message::PRIO_INFORMATION: color = "black"; break; case Poco::Message::PRIO_NOTICE: color = "green"; break; case Poco::Message::PRIO_WARNING: color = "orange"; break; case Poco::Message::PRIO_ERROR: color = "red"; break; case Poco::Message::PRIO_CRITICAL: color = "red"; break; case Poco::Message::PRIO_FATAL: color = "red"; break; default: color = "black"; } QString sep(":"); const auto timeStr = Poco::DateTimeFormatter::format(msg.getTime(), "%H:%M:%s"); auto body = QString::fromStdString(msg.getText()).toHtmlEscaped(); if (body.count("\n") > 1) { sep = " &rArr;"; body = "<pre style='background-color:#eaecee;'>"+body+"</pre><br />"; } auto line = QString("<font color=\"%1\"><b>[%2] %3%4</b></font> %5").arg( color, QString::fromStdString(timeStr), QString::fromStdString(msg.getSource()), sep, body); _text->appendHtml(line); } void LoggerDisplay::resizeEvent(QResizeEvent *event) { _clearButton->move(_text->viewport()->width()-_clearButton->width(), 0); return QStackedWidget::resizeEvent(event); } #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) void LoggerDisplay::enterEvent(QEvent *event) #else void LoggerDisplay::enterEvent(QEnterEvent *event) #endif { _clearButton->show(); _clearButton->move(_text->viewport()->width()-_clearButton->width(), 0); return QStackedWidget::enterEvent(event); } void LoggerDisplay::leaveEvent(QEvent *event) { _clearButton->hide(); return QStackedWidget::leaveEvent(event); }
; A083392: Alternating partial sums of A000217. ; 0,-1,2,-4,6,-9,12,-16,20,-25,30,-36,42,-49,56,-64,72,-81,90,-100,110,-121,132,-144,156,-169,182,-196,210,-225,240,-256,272,-289,306,-324,342,-361,380,-400,420,-441,462,-484,506,-529,552,-576,600,-625,650,-676,702,-729,756,-784,812,-841,870,-900,930,-961,992,-1024,1056,-1089,1122,-1156,1190,-1225,1260,-1296,1332,-1369,1406,-1444,1482,-1521,1560,-1600,1640,-1681,1722,-1764,1806,-1849,1892,-1936,1980,-2025,2070,-2116,2162,-2209,2256,-2304,2352,-2401,2450,-2500,2550,-2601,2652,-2704,2756,-2809,2862,-2916,2970,-3025,3080,-3136,3192,-3249,3306,-3364,3422,-3481,3540,-3600,3660,-3721,3782,-3844,3906,-3969,4032,-4096,4160,-4225,4290,-4356,4422,-4489,4556,-4624,4692,-4761,4830,-4900,4970,-5041,5112,-5184,5256,-5329,5402,-5476,5550,-5625,5700,-5776,5852,-5929,6006,-6084,6162,-6241,6320,-6400,6480,-6561,6642,-6724,6806,-6889,6972,-7056,7140,-7225,7310,-7396,7482,-7569,7656,-7744,7832,-7921,8010,-8100,8190,-8281,8372,-8464,8556,-8649,8742,-8836,8930,-9025,9120,-9216,9312,-9409,9506,-9604,9702,-9801,9900,-10000,10100,-10201,10302,-10404,10506,-10609,10712,-10816,10920,-11025,11130,-11236,11342,-11449,11556,-11664,11772,-11881,11990,-12100,12210,-12321,12432,-12544,12656,-12769,12882,-12996,13110,-13225,13340,-13456,13572,-13689,13806,-13924,14042,-14161,14280,-14400,14520,-14641,14762,-14884,15006,-15129,15252,-15376,15500,-15625 mov $2,$0 mul $2,$0 lpb $2,1 mov $3,$0 sub $0,$0 add $3,$2 sub $0,$3 sub $2,1 lpe mov $1,$0 div $1,2
[extern isr_handler] [extern irq_handler] [extern hang] isr_common_stub: pusha push ds push es push fs push gs mov ax, 0x10 mov ds, ax mov es, ax mov fs, ax mov gs, ax mov eax, esp push eax mov eax, isr_handler call eax pop eax pop gs pop fs pop es pop ds popa add esp, 8 iret irq_common_stub: pusha mov ax, ds push eax mov ax, 0x10 mov ds, ax mov es, ax mov fs, ax mov gs, ax push esp call irq_handler pop ebx pop ebx mov ds, bx mov es, bx mov fs, bx mov gs, bx popa add esp, 8 iret global isr0 global isr1 global isr2 global isr3 global isr4 global isr5 global isr6 global isr7 global isr8 global isr9 global isr10 global isr11 global isr12 global isr13 global isr14 global isr15 global isr16 global isr17 global isr18 global isr19 global isr20 global isr21 global isr22 global isr23 global isr24 global isr25 global isr26 global isr27 global isr28 global isr29 global isr30 global isr31 global irq0 global irq1 global irq2 global irq3 global irq4 global irq5 global irq6 global irq7 global irq8 global irq9 global irq10 global irq11 global irq12 global irq13 global irq14 global irq15 isr0: push byte 0 push byte 0 jmp isr_common_stub isr1: push byte 0 push byte 1 jmp isr_common_stub isr2: push byte 0 push byte 2 jmp isr_common_stub isr3: push byte 0 push byte 3 jmp isr_common_stub isr4: push byte 0 push byte 4 jmp isr_common_stub isr5: push byte 0 push byte 5 jmp isr_common_stub isr6: push byte 0 push byte 6 jmp isr_common_stub isr7: push byte 0 push byte 7 jmp isr_common_stub isr8: push byte 8 jmp isr_common_stub isr9: push byte 0 push byte 9 jmp isr_common_stub isr10: push byte 10 jmp isr_common_stub isr11: push byte 11 jmp isr_common_stub isr12: push byte 12 jmp isr_common_stub isr13: push byte 13 jmp isr_common_stub isr14: push byte 14 jmp isr_common_stub isr15: push byte 0 push byte 15 jmp isr_common_stub isr16: push byte 0 push byte 16 jmp isr_common_stub isr17: push byte 0 push byte 17 jmp isr_common_stub isr18: push byte 0 push byte 18 jmp isr_common_stub isr19: push byte 0 push byte 19 jmp isr_common_stub isr20: push byte 0 push byte 20 jmp isr_common_stub isr21: push byte 0 push byte 21 jmp isr_common_stub isr22: push byte 0 push byte 22 jmp isr_common_stub isr23: push byte 0 push byte 23 jmp isr_common_stub isr24: push byte 0 push byte 24 jmp isr_common_stub isr25: push byte 0 push byte 25 jmp isr_common_stub isr26: push byte 0 push byte 26 jmp isr_common_stub isr27: push byte 0 push byte 27 jmp isr_common_stub isr28: push byte 0 push byte 28 jmp isr_common_stub isr29: push byte 0 push byte 29 jmp isr_common_stub isr30: push byte 0 push byte 30 jmp isr_common_stub isr31: push byte 0 push byte 31 jmp isr_common_stub irq0: push byte 0 push byte 32 jmp irq_common_stub irq1: push byte 1 push byte 33 jmp irq_common_stub irq2: push byte 2 push byte 34 jmp irq_common_stub irq3: push byte 3 push byte 35 jmp irq_common_stub irq4: push byte 4 push byte 36 jmp irq_common_stub irq5: push byte 5 push byte 37 jmp irq_common_stub irq6: push byte 6 push byte 38 jmp irq_common_stub irq7: push byte 7 push byte 39 jmp irq_common_stub irq8: push byte 8 push byte 40 jmp irq_common_stub irq9: push byte 9 push byte 41 jmp irq_common_stub irq10: push byte 10 push byte 42 jmp irq_common_stub irq11: push byte 11 push byte 43 jmp irq_common_stub irq12: push byte 12 push byte 44 jmp irq_common_stub irq13: push byte 13 push byte 45 jmp irq_common_stub irq14: push byte 14 push byte 46 jmp irq_common_stub irq15: push byte 15 push byte 47 jmp irq_common_stub
export ScorePlum code proc ScorePlum 12 8 ADDRFP4 4 INDIRP4 ARGP4 CNSTI4 65 ARGI4 ADDRLP4 4 ADDRGP4 G_TempEntity CALLP4 ASGNP4 ADDRLP4 0 ADDRLP4 4 INDIRP4 ASGNP4 ADDRLP4 8 ADDRLP4 0 INDIRP4 CNSTI4 424 ADDP4 ASGNP4 ADDRLP4 8 INDIRP4 ADDRLP4 8 INDIRP4 INDIRI4 CNSTI4 256 BORI4 ASGNI4 ADDRLP4 0 INDIRP4 CNSTI4 428 ADDP4 ADDRFP4 0 INDIRP4 INDIRI4 ASGNI4 ADDRLP4 0 INDIRP4 CNSTI4 140 ADDP4 ADDRFP4 0 INDIRP4 INDIRI4 ASGNI4 ADDRLP4 0 INDIRP4 CNSTI4 84 ADDP4 ADDRFP4 8 INDIRI4 ASGNI4 LABELV $53 endproc ScorePlum 12 8 export AddScore proc AddScore 8 12 ADDRFP4 0 ADDRFP4 0 INDIRP4 ASGNP4 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CVPU4 4 CNSTU4 0 NEU4 $55 ADDRGP4 $54 JUMPV LABELV $55 ADDRGP4 level+16 INDIRI4 CNSTI4 0 EQI4 $57 ADDRGP4 $54 JUMPV LABELV $57 ADDRFP4 0 INDIRP4 ARGP4 ADDRFP4 4 INDIRP4 ARGP4 ADDRFP4 8 INDIRI4 ARGI4 ADDRGP4 ScorePlum CALLV pop ADDRLP4 0 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 248 ADDP4 ASGNP4 ADDRLP4 0 INDIRP4 ADDRLP4 0 INDIRP4 INDIRI4 ADDRFP4 8 INDIRI4 ADDI4 ASGNI4 ADDRGP4 g_gametype+12 INDIRI4 CNSTI4 3 NEI4 $60 ADDRLP4 4 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 260 ADDP4 INDIRI4 CNSTI4 2 LSHI4 ADDRGP4 level+44 ADDP4 ASGNP4 ADDRLP4 4 INDIRP4 ADDRLP4 4 INDIRP4 INDIRI4 ADDRFP4 8 INDIRI4 ADDI4 ASGNI4 LABELV $60 ADDRGP4 CalculateRanks CALLV pop LABELV $54 endproc AddScore 8 12 export TossClientItems proc TossClientItems 40 12 ADDRFP4 0 ADDRFP4 0 INDIRP4 ASGNP4 ADDRLP4 12 ADDRFP4 0 INDIRP4 CNSTI4 192 ADDP4 INDIRI4 ASGNI4 ADDRLP4 12 INDIRI4 CNSTI4 2 EQI4 $67 ADDRLP4 12 INDIRI4 CNSTI4 10 NEI4 $65 LABELV $67 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 148 ADDP4 INDIRI4 CNSTI4 2 NEI4 $68 ADDRLP4 12 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 492 ADDP4 INDIRU1 CVUI4 1 ASGNI4 LABELV $68 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 196 ADDP4 INDIRI4 CNSTI4 1 ADDRLP4 12 INDIRI4 LSHI4 BANDI4 CNSTI4 0 NEI4 $70 ADDRLP4 12 CNSTI4 0 ASGNI4 LABELV $70 LABELV $65 ADDRLP4 28 CNSTI4 2 ASGNI4 ADDRLP4 12 INDIRI4 ADDRLP4 28 INDIRI4 LEI4 $72 ADDRLP4 12 INDIRI4 CNSTI4 10 EQI4 $72 ADDRLP4 12 INDIRI4 ADDRLP4 28 INDIRI4 LSHI4 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 376 ADDP4 ADDP4 INDIRI4 CNSTI4 0 EQI4 $72 ADDRLP4 12 INDIRI4 ARGI4 ADDRLP4 32 ADDRGP4 BG_FindItemForWeapon CALLP4 ASGNP4 ADDRLP4 8 ADDRLP4 32 INDIRP4 ASGNP4 ADDRFP4 0 INDIRP4 ARGP4 ADDRLP4 8 INDIRP4 ARGP4 CNSTF4 0 ARGF4 ADDRGP4 Drop_Item CALLP4 pop LABELV $72 ADDRGP4 g_gametype+12 INDIRI4 CNSTI4 3 EQI4 $74 ADDRLP4 16 CNSTF4 1110704128 ASGNF4 ADDRLP4 0 CNSTI4 1 ASGNI4 LABELV $77 ADDRLP4 0 INDIRI4 CNSTI4 2 LSHI4 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 312 ADDP4 ADDP4 INDIRI4 ADDRGP4 level+32 INDIRI4 LEI4 $81 ADDRLP4 0 INDIRI4 ARGI4 ADDRLP4 32 ADDRGP4 BG_FindItemForPowerup CALLP4 ASGNP4 ADDRLP4 8 ADDRLP4 32 INDIRP4 ASGNP4 ADDRLP4 8 INDIRP4 CVPU4 4 CNSTU4 0 NEU4 $84 ADDRGP4 $78 JUMPV LABELV $84 ADDRFP4 0 INDIRP4 ARGP4 ADDRLP4 8 INDIRP4 ARGP4 ADDRLP4 16 INDIRF4 ARGF4 ADDRLP4 36 ADDRGP4 Drop_Item CALLP4 ASGNP4 ADDRLP4 4 ADDRLP4 36 INDIRP4 ASGNP4 ADDRLP4 4 INDIRP4 CNSTI4 756 ADDP4 ADDRLP4 0 INDIRI4 CNSTI4 2 LSHI4 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 312 ADDP4 ADDP4 INDIRI4 ADDRGP4 level+32 INDIRI4 SUBI4 CNSTI4 1000 DIVI4 ASGNI4 ADDRLP4 4 INDIRP4 CNSTI4 756 ADDP4 INDIRI4 CNSTI4 1 GEI4 $87 ADDRLP4 4 INDIRP4 CNSTI4 756 ADDP4 CNSTI4 1 ASGNI4 LABELV $87 ADDRLP4 16 ADDRLP4 16 INDIRF4 CNSTF4 1110704128 ADDF4 ASGNF4 LABELV $81 LABELV $78 ADDRLP4 0 ADDRLP4 0 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 ADDRLP4 0 INDIRI4 CNSTI4 15 LTI4 $77 LABELV $74 LABELV $64 endproc TossClientItems 40 12 export TossClientCubes proc TossClientCubes 68 16 ADDRFP4 0 ADDRFP4 0 INDIRP4 ASGNP4 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 440 ADDP4 CNSTI4 0 ASGNI4 ADDRLP4 44 ADDRGP4 G_EntitiesFree CALLI4 ASGNI4 ADDRLP4 44 INDIRI4 CNSTI4 0 NEI4 $90 ADDRGP4 $89 JUMPV LABELV $90 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 616 ADDP4 INDIRI4 CNSTI4 1 NEI4 $92 ADDRGP4 $94 ARGP4 ADDRLP4 48 ADDRGP4 BG_FindItem CALLP4 ASGNP4 ADDRLP4 40 ADDRLP4 48 INDIRP4 ASGNP4 ADDRGP4 $93 JUMPV LABELV $92 ADDRGP4 $95 ARGP4 ADDRLP4 48 ADDRGP4 BG_FindItem CALLP4 ASGNP4 ADDRLP4 40 ADDRLP4 48 INDIRP4 ASGNP4 LABELV $93 ADDRLP4 16+4 ADDRGP4 level+32 INDIRI4 CNSTI4 360 MODI4 CVIF4 4 ASGNF4 ADDRLP4 48 CNSTF4 0 ASGNF4 ADDRLP4 16 ADDRLP4 48 INDIRF4 ASGNF4 ADDRLP4 16+8 ADDRLP4 48 INDIRF4 ASGNF4 ADDRLP4 16 ARGP4 ADDRLP4 0 ARGP4 ADDRLP4 52 CNSTP4 0 ASGNP4 ADDRLP4 52 INDIRP4 ARGP4 ADDRLP4 52 INDIRP4 ARGP4 ADDRGP4 AngleVectors CALLV pop ADDRLP4 56 CNSTF4 1125515264 ASGNF4 ADDRLP4 0 ADDRLP4 56 INDIRF4 ADDRLP4 0 INDIRF4 MULF4 ASGNF4 ADDRLP4 0+4 ADDRLP4 56 INDIRF4 ADDRLP4 0+4 INDIRF4 MULF4 ASGNF4 ADDRLP4 0+8 CNSTF4 1125515264 ADDRLP4 0+8 INDIRF4 MULF4 ASGNF4 ADDRLP4 60 ADDRGP4 qk_rand CALLI4 ASGNI4 ADDRLP4 0+8 ADDRLP4 0+8 INDIRF4 CNSTF4 1112014848 CNSTF4 1073741824 ADDRLP4 60 INDIRI4 CNSTI4 32767 BANDI4 CVIF4 4 CNSTF4 1191181824 DIVF4 CNSTF4 1056964608 SUBF4 MULF4 MULF4 CNSTF4 1128792064 ADDF4 ADDF4 ASGNF4 ADDRGP4 neutralObelisk INDIRP4 CVPU4 4 CNSTU4 0 EQU4 $104 ADDRLP4 28 ADDRGP4 neutralObelisk INDIRP4 CNSTI4 24 ADDP4 INDIRB ASGNB 12 ADDRLP4 28+8 ADDRLP4 28+8 INDIRF4 CNSTF4 1110441984 ADDF4 ASGNF4 ADDRGP4 $105 JUMPV LABELV $104 ADDRLP4 64 CNSTF4 0 ASGNF4 ADDRLP4 28+8 ADDRLP4 64 INDIRF4 ASGNF4 ADDRLP4 28+4 ADDRLP4 64 INDIRF4 ASGNF4 ADDRLP4 28 ADDRLP4 64 INDIRF4 ASGNF4 LABELV $105 ADDRLP4 40 INDIRP4 ARGP4 ADDRLP4 28 ARGP4 ADDRLP4 0 ARGP4 ADDRLP4 64 ADDRGP4 LaunchItem CALLP4 ASGNP4 ADDRLP4 12 ADDRLP4 64 INDIRP4 ASGNP4 ADDRLP4 12 INDIRP4 CNSTI4 684 ADDP4 ADDRGP4 level+32 INDIRI4 CNSTI4 1000 ADDRGP4 g_cubeTimeout+12 INDIRI4 MULI4 ADDI4 ASGNI4 ADDRLP4 12 INDIRP4 CNSTI4 688 ADDP4 ADDRGP4 G_FreeEntity ASGNP4 ADDRLP4 12 INDIRP4 CNSTI4 528 ADDP4 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 616 ADDP4 INDIRI4 ASGNI4 LABELV $89 endproc TossClientCubes 68 16 export TossClientPersistantPowerups proc TossClientPersistantPowerups 12 4 ADDRFP4 0 ADDRFP4 0 INDIRP4 ASGNP4 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CVPU4 4 CNSTU4 0 NEU4 $112 ADDRGP4 $111 JUMPV LABELV $112 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 772 ADDP4 INDIRP4 CVPU4 4 CNSTU4 0 NEU4 $114 ADDRGP4 $111 JUMPV LABELV $114 ADDRLP4 0 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 772 ADDP4 INDIRP4 ASGNP4 ADDRLP4 4 ADDRLP4 0 INDIRP4 CNSTI4 424 ADDP4 ASGNP4 ADDRLP4 4 INDIRP4 ADDRLP4 4 INDIRP4 INDIRI4 CNSTI4 -2 BANDI4 ASGNI4 ADDRLP4 8 ADDRLP4 0 INDIRP4 CNSTI4 8 ADDP4 ASGNP4 ADDRLP4 8 INDIRP4 ADDRLP4 8 INDIRP4 INDIRI4 CNSTI4 -129 BANDI4 ASGNI4 ADDRLP4 0 INDIRP4 CNSTI4 460 ADDP4 CNSTI4 1073741824 ASGNI4 ADDRLP4 0 INDIRP4 ARGP4 ADDRGP4 trap_LinkEntity CALLV pop ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 192 ADDP4 CNSTI4 0 ASGNI4 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 772 ADDP4 CNSTP4 0 ASGNP4 LABELV $111 endproc TossClientPersistantPowerups 12 4 export LookAtKiller proc LookAtKiller 40 4 ADDRFP4 0 ADDRFP4 0 INDIRP4 ASGNP4 ADDRFP4 8 ADDRFP4 8 INDIRP4 ASGNP4 ADDRLP4 12 ADDRFP4 8 INDIRP4 CVPU4 4 ASGNU4 ADDRLP4 12 INDIRU4 CNSTU4 0 EQU4 $117 ADDRLP4 12 INDIRU4 ADDRFP4 0 INDIRP4 CVPU4 4 EQU4 $117 ADDRLP4 20 CNSTI4 24 ASGNI4 ADDRLP4 0 ADDRFP4 8 INDIRP4 ADDRLP4 20 INDIRI4 ADDP4 INDIRF4 ADDRFP4 0 INDIRP4 ADDRLP4 20 INDIRI4 ADDP4 INDIRF4 SUBF4 ASGNF4 ADDRLP4 28 CNSTI4 28 ASGNI4 ADDRLP4 0+4 ADDRFP4 8 INDIRP4 ADDRLP4 28 INDIRI4 ADDP4 INDIRF4 ADDRFP4 0 INDIRP4 ADDRLP4 28 INDIRI4 ADDP4 INDIRF4 SUBF4 ASGNF4 ADDRLP4 32 CNSTI4 32 ASGNI4 ADDRLP4 0+8 ADDRFP4 8 INDIRP4 ADDRLP4 32 INDIRI4 ADDP4 INDIRF4 ADDRFP4 0 INDIRP4 ADDRLP4 32 INDIRI4 ADDP4 INDIRF4 SUBF4 ASGNF4 ADDRGP4 $118 JUMPV LABELV $117 ADDRLP4 16 ADDRFP4 4 INDIRP4 CVPU4 4 ASGNU4 ADDRLP4 16 INDIRU4 CNSTU4 0 EQU4 $121 ADDRLP4 16 INDIRU4 ADDRFP4 0 INDIRP4 CVPU4 4 EQU4 $121 ADDRLP4 20 ADDRFP4 4 INDIRP4 ASGNP4 ADDRLP4 24 CNSTI4 24 ASGNI4 ADDRLP4 0 ADDRLP4 20 INDIRP4 ADDRLP4 24 INDIRI4 ADDP4 INDIRF4 ADDRFP4 0 INDIRP4 ADDRLP4 24 INDIRI4 ADDP4 INDIRF4 SUBF4 ASGNF4 ADDRLP4 32 CNSTI4 28 ASGNI4 ADDRLP4 0+4 ADDRLP4 20 INDIRP4 ADDRLP4 32 INDIRI4 ADDP4 INDIRF4 ADDRFP4 0 INDIRP4 ADDRLP4 32 INDIRI4 ADDP4 INDIRF4 SUBF4 ASGNF4 ADDRLP4 36 CNSTI4 32 ASGNI4 ADDRLP4 0+8 ADDRFP4 4 INDIRP4 ADDRLP4 36 INDIRI4 ADDP4 INDIRF4 ADDRFP4 0 INDIRP4 ADDRLP4 36 INDIRI4 ADDP4 INDIRF4 SUBF4 ASGNF4 ADDRGP4 $122 JUMPV LABELV $121 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 204 ADDP4 ADDRFP4 0 INDIRP4 CNSTI4 120 ADDP4 INDIRF4 CVFI4 4 ASGNI4 ADDRGP4 $116 JUMPV LABELV $122 LABELV $118 ADDRLP4 0 ARGP4 ADDRLP4 20 ADDRGP4 vectoyaw CALLF4 ASGNF4 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 204 ADDP4 ADDRLP4 20 INDIRF4 CVFI4 4 ASGNI4 LABELV $116 endproc LookAtKiller 40 4 export GibEntity proc GibEntity 12 12 ADDRFP4 0 ADDRFP4 0 INDIRP4 ASGNP4 ADDRFP4 0 INDIRP4 CNSTI4 8 ADDP4 INDIRI4 CNSTI4 512 BANDI4 CNSTI4 0 EQI4 $126 ADDRLP4 4 CNSTI4 0 ASGNI4 ADDRGP4 $131 JUMPV LABELV $128 ADDRLP4 0 CNSTI4 812 ADDRLP4 4 INDIRI4 MULI4 ADDRGP4 g_entities ADDP4 ASGNP4 ADDRLP4 0 INDIRP4 CNSTI4 520 ADDP4 INDIRI4 CNSTI4 0 NEI4 $133 ADDRGP4 $129 JUMPV LABELV $133 ADDRLP4 0 INDIRP4 CNSTI4 768 ADDP4 INDIRP4 CVPU4 4 ADDRFP4 0 INDIRP4 CVPU4 4 EQU4 $135 ADDRGP4 $129 JUMPV LABELV $135 ADDRLP4 0 INDIRP4 CNSTI4 524 ADDP4 INDIRP4 ARGP4 ADDRGP4 $139 ARGP4 ADDRLP4 8 ADDRGP4 qk_strcmp CALLI4 ASGNI4 ADDRLP4 8 INDIRI4 CNSTI4 0 EQI4 $137 ADDRGP4 $129 JUMPV LABELV $137 ADDRLP4 0 INDIRP4 ARGP4 ADDRGP4 G_FreeEntity CALLV pop ADDRGP4 $130 JUMPV LABELV $129 ADDRLP4 4 ADDRLP4 4 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 LABELV $131 ADDRLP4 4 INDIRI4 ADDRGP4 level+12 INDIRI4 LTI4 $128 LABELV $130 LABELV $126 ADDRFP4 0 INDIRP4 ARGP4 CNSTI4 64 ARGI4 ADDRFP4 4 INDIRI4 ARGI4 ADDRGP4 G_AddEvent CALLV pop ADDRFP4 0 INDIRP4 CNSTI4 732 ADDP4 CNSTI4 0 ASGNI4 ADDRFP4 0 INDIRP4 CNSTI4 4 ADDP4 CNSTI4 10 ASGNI4 ADDRFP4 0 INDIRP4 CNSTI4 460 ADDP4 CNSTI4 0 ASGNI4 LABELV $125 endproc GibEntity 12 12 export body_die proc body_die 0 8 ADDRFP4 0 INDIRP4 CNSTI4 728 ADDP4 INDIRI4 CNSTI4 -40 LEI4 $141 ADDRGP4 $140 JUMPV LABELV $141 ADDRGP4 g_blood+12 INDIRI4 CNSTI4 0 NEI4 $143 ADDRFP4 0 INDIRP4 CNSTI4 728 ADDP4 CNSTI4 -39 ASGNI4 ADDRGP4 $140 JUMPV LABELV $143 ADDRFP4 0 INDIRP4 ARGP4 CNSTI4 0 ARGI4 ADDRGP4 GibEntity CALLV pop LABELV $140 endproc body_die 0 8 data export modNames align 4 LABELV modNames address $146 address $147 address $148 address $149 address $150 address $151 address $152 address $153 address $154 address $155 address $156 address $157 address $158 address $159 address $160 address $161 address $162 address $163 address $164 address $165 address $166 address $167 address $168 address $169 address $170 address $171 address $172 address $173 address $174 export Kamikaze_DeathActivate code proc Kamikaze_DeathActivate 0 4 ADDRFP4 0 INDIRP4 ARGP4 ADDRGP4 G_StartKamikaze CALLV pop ADDRFP4 0 INDIRP4 ARGP4 ADDRGP4 G_FreeEntity CALLV pop LABELV $175 endproc Kamikaze_DeathActivate 0 4 export Kamikaze_DeathTimer proc Kamikaze_DeathTimer 16 0 ADDRLP4 4 ADDRGP4 G_Spawn CALLP4 ASGNP4 ADDRLP4 0 ADDRLP4 4 INDIRP4 ASGNP4 ADDRLP4 0 INDIRP4 CNSTI4 524 ADDP4 ADDRGP4 $139 ASGNP4 ADDRLP4 8 CNSTI4 24 ASGNI4 ADDRLP4 0 INDIRP4 ADDRLP4 8 INDIRI4 ADDP4 ADDRFP4 0 INDIRP4 ADDRLP4 8 INDIRI4 ADDP4 INDIRB ASGNB 12 ADDRLP4 12 ADDRLP4 0 INDIRP4 CNSTI4 424 ADDP4 ASGNP4 ADDRLP4 12 INDIRP4 ADDRLP4 12 INDIRP4 INDIRI4 CNSTI4 1 BORI4 ASGNI4 ADDRLP4 0 INDIRP4 CNSTI4 688 ADDP4 ADDRGP4 Kamikaze_DeathActivate ASGNP4 ADDRLP4 0 INDIRP4 CNSTI4 684 ADDP4 ADDRGP4 level+32 INDIRI4 CNSTI4 5000 ADDI4 ASGNI4 ADDRLP4 0 INDIRP4 CNSTI4 768 ADDP4 ADDRFP4 0 INDIRP4 ASGNP4 LABELV $176 endproc Kamikaze_DeathTimer 16 0 export CheckAlmostCapture proc CheckAlmostCapture 56 12 ADDRFP4 0 ADDRFP4 0 INDIRP4 ASGNP4 ADDRLP4 20 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 ASGNP4 ADDRLP4 24 CNSTI4 0 ASGNI4 ADDRLP4 20 INDIRP4 CNSTI4 340 ADDP4 INDIRI4 ADDRLP4 24 INDIRI4 NEI4 $182 ADDRLP4 20 INDIRP4 CNSTI4 344 ADDP4 INDIRI4 ADDRLP4 24 INDIRI4 NEI4 $182 ADDRLP4 20 INDIRP4 CNSTI4 348 ADDP4 INDIRI4 ADDRLP4 24 INDIRI4 EQI4 $179 LABELV $182 ADDRGP4 g_gametype+12 INDIRI4 CNSTI4 4 NEI4 $183 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 616 ADDP4 INDIRI4 CNSTI4 2 NEI4 $186 ADDRLP4 4 ADDRGP4 $188 ASGNP4 ADDRGP4 $184 JUMPV LABELV $186 ADDRLP4 4 ADDRGP4 $189 ASGNP4 ADDRGP4 $184 JUMPV LABELV $183 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 616 ADDP4 INDIRI4 CNSTI4 2 NEI4 $190 ADDRLP4 4 ADDRGP4 $189 ASGNP4 ADDRGP4 $191 JUMPV LABELV $190 ADDRLP4 4 ADDRGP4 $188 ASGNP4 LABELV $191 LABELV $184 ADDRLP4 0 CNSTP4 0 ASGNP4 LABELV $192 ADDRLP4 0 INDIRP4 ARGP4 CNSTI4 524 ARGI4 ADDRLP4 4 INDIRP4 ARGP4 ADDRLP4 28 ADDRGP4 G_Find CALLP4 ASGNP4 ADDRLP4 0 ADDRLP4 28 INDIRP4 ASGNP4 LABELV $193 ADDRLP4 0 INDIRP4 CVPU4 4 CNSTU4 0 EQU4 $195 ADDRLP4 0 INDIRP4 CNSTI4 536 ADDP4 INDIRI4 CNSTI4 4096 BANDI4 CNSTI4 0 NEI4 $192 LABELV $195 ADDRLP4 0 INDIRP4 CVPU4 4 CNSTU4 0 EQU4 $196 ADDRLP4 0 INDIRP4 CNSTI4 424 ADDP4 INDIRI4 CNSTI4 1 BANDI4 CNSTI4 0 NEI4 $196 ADDRLP4 36 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 ASGNP4 ADDRLP4 8 ADDRLP4 36 INDIRP4 INDIRP4 CNSTI4 20 ADDP4 INDIRF4 ADDRLP4 0 INDIRP4 CNSTI4 92 ADDP4 INDIRF4 SUBF4 ASGNF4 ADDRLP4 8+4 ADDRLP4 36 INDIRP4 INDIRP4 CNSTI4 24 ADDP4 INDIRF4 ADDRLP4 0 INDIRP4 CNSTI4 96 ADDP4 INDIRF4 SUBF4 ASGNF4 ADDRLP4 8+8 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 28 ADDP4 INDIRF4 ADDRLP4 0 INDIRP4 CNSTI4 100 ADDP4 INDIRF4 SUBF4 ASGNF4 ADDRLP4 8 ARGP4 ADDRLP4 44 ADDRGP4 VectorLength CALLF4 ASGNF4 ADDRLP4 44 INDIRF4 CNSTF4 1128792064 GEF4 $200 ADDRLP4 48 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 268 ADDP4 ASGNP4 ADDRLP4 48 INDIRP4 ADDRLP4 48 INDIRP4 INDIRI4 CNSTI4 4 BXORI4 ASGNI4 ADDRFP4 4 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CVPU4 4 CNSTU4 0 EQU4 $202 ADDRLP4 52 ADDRFP4 4 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 268 ADDP4 ASGNP4 ADDRLP4 52 INDIRP4 ADDRLP4 52 INDIRP4 INDIRI4 CNSTI4 4 BXORI4 ASGNI4 LABELV $202 LABELV $200 LABELV $196 LABELV $179 LABELV $178 endproc CheckAlmostCapture 56 12 export CheckAlmostScored proc CheckAlmostScored 44 12 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 440 ADDP4 INDIRI4 CNSTI4 0 EQI4 $205 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 616 ADDP4 INDIRI4 CNSTI4 2 NEI4 $207 ADDRLP4 16 ADDRGP4 $209 ASGNP4 ADDRGP4 $208 JUMPV LABELV $207 ADDRLP4 16 ADDRGP4 $210 ASGNP4 LABELV $208 CNSTP4 0 ARGP4 CNSTI4 524 ARGI4 ADDRLP4 16 INDIRP4 ARGP4 ADDRLP4 20 ADDRGP4 G_Find CALLP4 ASGNP4 ADDRLP4 0 ADDRLP4 20 INDIRP4 ASGNP4 ADDRLP4 0 INDIRP4 CVPU4 4 CNSTU4 0 EQU4 $211 ADDRLP4 24 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 ASGNP4 ADDRLP4 28 ADDRLP4 0 INDIRP4 ASGNP4 ADDRLP4 4 ADDRLP4 24 INDIRP4 INDIRP4 CNSTI4 20 ADDP4 INDIRF4 ADDRLP4 28 INDIRP4 CNSTI4 92 ADDP4 INDIRF4 SUBF4 ASGNF4 ADDRLP4 4+4 ADDRLP4 24 INDIRP4 INDIRP4 CNSTI4 24 ADDP4 INDIRF4 ADDRLP4 28 INDIRP4 CNSTI4 96 ADDP4 INDIRF4 SUBF4 ASGNF4 ADDRLP4 4+8 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 28 ADDP4 INDIRF4 ADDRLP4 0 INDIRP4 CNSTI4 100 ADDP4 INDIRF4 SUBF4 ASGNF4 ADDRLP4 4 ARGP4 ADDRLP4 32 ADDRGP4 VectorLength CALLF4 ASGNF4 ADDRLP4 32 INDIRF4 CNSTF4 1128792064 GEF4 $215 ADDRLP4 36 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 268 ADDP4 ASGNP4 ADDRLP4 36 INDIRP4 ADDRLP4 36 INDIRP4 INDIRI4 CNSTI4 4 BXORI4 ASGNI4 ADDRFP4 4 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CVPU4 4 CNSTU4 0 EQU4 $217 ADDRLP4 40 ADDRFP4 4 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 268 ADDP4 ASGNP4 ADDRLP4 40 INDIRP4 ADDRLP4 40 INDIRP4 INDIRI4 CNSTI4 4 BXORI4 ASGNI4 LABELV $217 LABELV $215 LABELV $211 LABELV $205 LABELV $204 endproc CheckAlmostScored 44 12 bss align 4 LABELV $286 skip 4 export player_die code proc player_die 100 28 ADDRFP4 0 ADDRFP4 0 INDIRP4 ASGNP4 ADDRFP4 8 ADDRFP4 8 INDIRP4 ASGNP4 ADDRFP4 16 ADDRFP4 16 INDIRI4 ASGNI4 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 4 ADDP4 INDIRI4 CNSTI4 3 NEI4 $220 ADDRGP4 $219 JUMPV LABELV $220 ADDRGP4 level+9128 INDIRI4 CNSTI4 0 EQI4 $222 ADDRGP4 $219 JUMPV LABELV $222 ADDRFP4 0 INDIRP4 ARGP4 ADDRFP4 8 INDIRP4 ARGP4 ADDRGP4 CheckAlmostCapture CALLV pop ADDRFP4 0 INDIRP4 ARGP4 ADDRFP4 8 INDIRP4 ARGP4 ADDRGP4 CheckAlmostScored CALLV pop ADDRLP4 28 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 ASGNP4 ADDRLP4 32 CNSTU4 0 ASGNU4 ADDRLP4 28 INDIRP4 CVPU4 4 ADDRLP4 32 INDIRU4 EQU4 $225 ADDRLP4 28 INDIRP4 CNSTI4 760 ADDP4 INDIRP4 CVPU4 4 ADDRLP4 32 INDIRU4 EQU4 $225 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 760 ADDP4 INDIRP4 ARGP4 ADDRGP4 Weapon_HookFree CALLV pop LABELV $225 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 104 ADDP4 INDIRI4 CNSTI4 2 BANDI4 CNSTI4 0 EQI4 $227 ADDRFP4 0 INDIRP4 CNSTI4 768 ADDP4 INDIRP4 CVPU4 4 CNSTU4 0 EQU4 $227 ADDRLP4 40 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 104 ADDP4 ASGNP4 ADDRLP4 40 INDIRP4 ADDRLP4 40 INDIRP4 INDIRI4 CNSTI4 -3 BANDI4 ASGNI4 ADDRFP4 0 INDIRP4 CNSTI4 768 ADDP4 INDIRP4 CNSTI4 688 ADDP4 ADDRGP4 G_FreeEntity ASGNP4 ADDRFP4 0 INDIRP4 CNSTI4 768 ADDP4 INDIRP4 CNSTI4 684 ADDP4 ADDRGP4 level+32 INDIRI4 ASGNI4 LABELV $227 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 4 ADDP4 CNSTI4 3 ASGNI4 ADDRFP4 8 INDIRP4 CVPU4 4 CNSTU4 0 EQU4 $230 ADDRLP4 4 ADDRFP4 8 INDIRP4 INDIRI4 ASGNI4 ADDRFP4 8 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CVPU4 4 CNSTU4 0 EQU4 $232 ADDRLP4 12 ADDRFP4 8 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 512 ADDP4 ASGNP4 ADDRGP4 $231 JUMPV LABELV $232 ADDRLP4 12 ADDRGP4 $234 ASGNP4 ADDRGP4 $231 JUMPV LABELV $230 ADDRLP4 4 CNSTI4 1022 ASGNI4 ADDRLP4 12 ADDRGP4 $235 ASGNP4 LABELV $231 ADDRLP4 4 INDIRI4 CNSTI4 0 LTI4 $238 ADDRLP4 4 INDIRI4 CNSTI4 64 LTI4 $236 LABELV $238 ADDRLP4 4 CNSTI4 1022 ASGNI4 ADDRLP4 12 ADDRGP4 $235 ASGNP4 LABELV $236 ADDRFP4 16 INDIRI4 CNSTI4 0 LTI4 $241 ADDRFP4 16 INDIRI4 CVIU4 4 CNSTU4 29 LTU4 $239 LABELV $241 ADDRLP4 20 ADDRGP4 $242 ASGNP4 ADDRGP4 $240 JUMPV LABELV $239 ADDRLP4 20 ADDRFP4 16 INDIRI4 CNSTI4 2 LSHI4 ADDRGP4 modNames ADDP4 INDIRP4 ASGNP4 LABELV $240 ADDRGP4 $243 ARGP4 ADDRLP4 4 INDIRI4 ARGI4 ADDRFP4 0 INDIRP4 INDIRI4 ARGI4 ADDRFP4 16 INDIRI4 ARGI4 ADDRLP4 12 INDIRP4 ARGP4 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 512 ADDP4 ARGP4 ADDRLP4 20 INDIRP4 ARGP4 ADDRGP4 G_LogPrintf CALLV pop ADDRFP4 0 INDIRP4 CNSTI4 488 ADDP4 ARGP4 CNSTI4 60 ARGI4 ADDRLP4 52 ADDRGP4 G_TempEntity CALLP4 ASGNP4 ADDRLP4 8 ADDRLP4 52 INDIRP4 ASGNP4 ADDRLP4 8 INDIRP4 CNSTI4 184 ADDP4 ADDRFP4 16 INDIRI4 ASGNI4 ADDRLP4 8 INDIRP4 CNSTI4 140 ADDP4 ADDRFP4 0 INDIRP4 INDIRI4 ASGNI4 ADDRLP4 8 INDIRP4 CNSTI4 144 ADDP4 ADDRLP4 4 INDIRI4 ASGNI4 ADDRLP4 8 INDIRP4 CNSTI4 424 ADDP4 CNSTI4 32 ASGNI4 ADDRFP4 0 INDIRP4 CNSTI4 764 ADDP4 ADDRFP4 8 INDIRP4 ASGNP4 ADDRLP4 56 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 280 ADDP4 ASGNP4 ADDRLP4 56 INDIRP4 ADDRLP4 56 INDIRP4 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 ADDRLP4 64 CNSTU4 0 ASGNU4 ADDRFP4 8 INDIRP4 CVPU4 4 ADDRLP4 64 INDIRU4 EQU4 $244 ADDRFP4 8 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CVPU4 4 ADDRLP4 64 INDIRU4 EQU4 $244 ADDRFP4 8 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 720 ADDP4 ADDRFP4 0 INDIRP4 INDIRI4 ASGNI4 ADDRFP4 8 INDIRP4 CVPU4 4 ADDRFP4 0 INDIRP4 CVPU4 4 EQU4 $248 ADDRFP4 0 INDIRP4 ARGP4 ADDRFP4 8 INDIRP4 ARGP4 ADDRLP4 76 ADDRGP4 OnSameTeam CALLI4 ASGNI4 ADDRLP4 76 INDIRI4 CNSTI4 0 EQI4 $246 LABELV $248 ADDRFP4 8 INDIRP4 ARGP4 ADDRFP4 0 INDIRP4 CNSTI4 488 ADDP4 ARGP4 CNSTI4 -1 ARGI4 ADDRGP4 AddScore CALLV pop ADDRGP4 $245 JUMPV LABELV $246 ADDRFP4 8 INDIRP4 ARGP4 ADDRFP4 0 INDIRP4 CNSTI4 488 ADDP4 ARGP4 CNSTI4 1 ARGI4 ADDRGP4 AddScore CALLV pop ADDRFP4 16 INDIRI4 CNSTI4 2 NEI4 $249 ADDRLP4 80 ADDRFP4 8 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 300 ADDP4 ASGNP4 ADDRLP4 80 INDIRP4 ADDRLP4 80 INDIRP4 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 ADDRLP4 84 ADDRFP4 8 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 104 ADDP4 ASGNP4 ADDRLP4 84 INDIRP4 ADDRLP4 84 INDIRP4 INDIRI4 CNSTI4 -231497 BANDI4 ASGNI4 ADDRLP4 88 ADDRFP4 8 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 104 ADDP4 ASGNP4 ADDRLP4 88 INDIRP4 ADDRLP4 88 INDIRP4 INDIRI4 CNSTI4 64 BORI4 ASGNI4 ADDRFP4 8 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 744 ADDP4 ADDRGP4 level+32 INDIRI4 CNSTI4 2000 ADDI4 ASGNI4 ADDRLP4 92 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 268 ADDP4 ASGNP4 ADDRLP4 92 INDIRP4 ADDRLP4 92 INDIRP4 INDIRI4 CNSTI4 2 BXORI4 ASGNI4 LABELV $249 ADDRGP4 level+32 INDIRI4 ADDRFP4 8 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 752 ADDP4 INDIRI4 SUBI4 CNSTI4 3000 GEI4 $252 ADDRLP4 80 ADDRFP4 8 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 288 ADDP4 ASGNP4 ADDRLP4 80 INDIRP4 ADDRLP4 80 INDIRP4 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 ADDRLP4 84 ADDRFP4 8 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 104 ADDP4 ASGNP4 ADDRLP4 84 INDIRP4 ADDRLP4 84 INDIRP4 INDIRI4 CNSTI4 -231497 BANDI4 ASGNI4 ADDRLP4 88 ADDRFP4 8 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 104 ADDP4 ASGNP4 ADDRLP4 88 INDIRP4 ADDRLP4 88 INDIRP4 INDIRI4 CNSTI4 8 BORI4 ASGNI4 ADDRFP4 8 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 744 ADDP4 ADDRGP4 level+32 INDIRI4 CNSTI4 2000 ADDI4 ASGNI4 LABELV $252 ADDRFP4 8 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 752 ADDP4 ADDRGP4 level+32 INDIRI4 ASGNI4 ADDRGP4 $245 JUMPV LABELV $244 ADDRFP4 0 INDIRP4 ARGP4 ADDRFP4 0 INDIRP4 CNSTI4 488 ADDP4 ARGP4 CNSTI4 -1 ARGI4 ADDRGP4 AddScore CALLV pop LABELV $245 ADDRFP4 0 INDIRP4 ARGP4 ADDRFP4 4 INDIRP4 ARGP4 ADDRFP4 8 INDIRP4 ARGP4 ADDRGP4 Team_FragBonuses CALLV pop ADDRFP4 16 INDIRI4 CNSTI4 20 NEI4 $257 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 348 ADDP4 INDIRI4 CNSTI4 0 EQI4 $259 CNSTI4 0 ARGI4 ADDRGP4 Team_ReturnFlag CALLV pop ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 348 ADDP4 CNSTI4 0 ASGNI4 ADDRGP4 $260 JUMPV LABELV $259 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 340 ADDP4 INDIRI4 CNSTI4 0 EQI4 $261 CNSTI4 1 ARGI4 ADDRGP4 Team_ReturnFlag CALLV pop ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 340 ADDP4 CNSTI4 0 ASGNI4 ADDRGP4 $262 JUMPV LABELV $261 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 344 ADDP4 INDIRI4 CNSTI4 0 EQI4 $263 CNSTI4 2 ARGI4 ADDRGP4 Team_ReturnFlag CALLV pop ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 344 ADDP4 CNSTI4 0 ASGNI4 LABELV $263 LABELV $262 LABELV $260 LABELV $257 ADDRFP4 0 INDIRP4 ARGP4 ADDRGP4 TossClientItems CALLV pop ADDRFP4 0 INDIRP4 ARGP4 ADDRGP4 TossClientPersistantPowerups CALLV pop ADDRGP4 g_gametype+12 INDIRI4 CNSTI4 7 NEI4 $265 ADDRFP4 0 INDIRP4 ARGP4 ADDRGP4 TossClientCubes CALLV pop LABELV $265 ADDRFP4 0 INDIRP4 ARGP4 ADDRGP4 Cmd_Score_f CALLV pop ADDRLP4 0 CNSTI4 0 ASGNI4 ADDRGP4 $271 JUMPV LABELV $268 ADDRLP4 68 CNSTI4 844 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 level INDIRP4 ADDP4 ASGNP4 ADDRLP4 68 INDIRP4 CNSTI4 468 ADDP4 INDIRI4 CNSTI4 2 EQI4 $273 ADDRGP4 $269 JUMPV LABELV $273 ADDRLP4 68 INDIRP4 CNSTI4 616 ADDP4 INDIRI4 CNSTI4 3 EQI4 $275 ADDRGP4 $269 JUMPV LABELV $275 ADDRLP4 68 INDIRP4 CNSTI4 628 ADDP4 INDIRI4 ADDRFP4 0 INDIRP4 INDIRI4 NEI4 $277 CNSTI4 812 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 g_entities ADDP4 ARGP4 ADDRGP4 Cmd_Score_f CALLV pop LABELV $277 LABELV $269 ADDRLP4 0 ADDRLP4 0 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 LABELV $271 ADDRLP4 0 INDIRI4 ADDRGP4 level+24 INDIRI4 LTI4 $268 ADDRFP4 0 INDIRP4 CNSTI4 732 ADDP4 CNSTI4 1 ASGNI4 ADDRFP4 0 INDIRP4 CNSTI4 192 ADDP4 CNSTI4 0 ASGNI4 ADDRFP4 0 INDIRP4 CNSTI4 188 ADDP4 CNSTI4 0 ASGNI4 ADDRFP4 0 INDIRP4 CNSTI4 460 ADDP4 CNSTI4 67108864 ASGNI4 ADDRFP4 0 INDIRP4 CNSTI4 116 ADDP4 CNSTF4 0 ASGNF4 ADDRFP4 0 INDIRP4 CNSTI4 124 ADDP4 CNSTF4 0 ASGNF4 ADDRFP4 0 INDIRP4 ARGP4 ADDRFP4 4 INDIRP4 ARGP4 ADDRFP4 8 INDIRP4 ARGP4 ADDRGP4 LookAtKiller CALLV pop ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 152 ADDP4 ADDRFP4 0 INDIRP4 CNSTI4 116 ADDP4 INDIRB ASGNB 12 ADDRFP4 0 INDIRP4 CNSTI4 156 ADDP4 CNSTI4 0 ASGNI4 ADDRFP4 0 INDIRP4 CNSTI4 456 ADDP4 CNSTF4 3238002688 ASGNF4 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 732 ADDP4 ADDRGP4 level+32 INDIRI4 CNSTI4 1700 ADDI4 ASGNI4 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 312 ADDP4 ARGP4 CNSTI4 0 ARGI4 CNSTU4 64 ARGU4 ADDRGP4 qk_memset CALLP4 pop ADDRFP4 0 INDIRP4 CNSTI4 488 ADDP4 ARGP4 CNSTI4 -1 ARGI4 ADDRLP4 72 ADDRGP4 trap_PointContents CALLI4 ASGNI4 ADDRLP4 16 ADDRLP4 72 INDIRI4 ASGNI4 ADDRFP4 0 INDIRP4 CNSTI4 728 ADDP4 INDIRI4 CNSTI4 -40 GTI4 $285 ADDRLP4 16 INDIRI4 CVIU4 4 CNSTU4 2147483648 BANDU4 CNSTU4 0 NEU4 $285 ADDRGP4 g_blood+12 INDIRI4 CNSTI4 0 NEI4 $283 LABELV $285 ADDRFP4 16 INDIRI4 CNSTI4 20 NEI4 $280 LABELV $283 ADDRFP4 0 INDIRP4 ARGP4 ADDRLP4 4 INDIRI4 ARGI4 ADDRGP4 GibEntity CALLV pop ADDRGP4 $281 JUMPV LABELV $280 ADDRLP4 76 ADDRGP4 $286 INDIRI4 ASGNI4 ADDRLP4 76 INDIRI4 CNSTI4 0 EQI4 $289 ADDRLP4 76 INDIRI4 CNSTI4 1 EQI4 $290 ADDRLP4 76 INDIRI4 CNSTI4 2 EQI4 $291 ADDRGP4 $287 JUMPV LABELV $289 ADDRLP4 24 CNSTI4 0 ASGNI4 ADDRGP4 $288 JUMPV LABELV $290 ADDRLP4 24 CNSTI4 2 ASGNI4 ADDRGP4 $288 JUMPV LABELV $291 LABELV $287 ADDRLP4 24 CNSTI4 4 ASGNI4 LABELV $288 ADDRFP4 0 INDIRP4 CNSTI4 728 ADDP4 INDIRI4 CNSTI4 -40 GTI4 $292 ADDRFP4 0 INDIRP4 CNSTI4 728 ADDP4 CNSTI4 -39 ASGNI4 LABELV $292 ADDRLP4 80 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 76 ADDP4 ASGNP4 ADDRLP4 84 CNSTI4 128 ASGNI4 ADDRLP4 80 INDIRP4 ADDRLP4 80 INDIRP4 INDIRI4 ADDRLP4 84 INDIRI4 BANDI4 ADDRLP4 84 INDIRI4 BXORI4 ADDRLP4 24 INDIRI4 BORI4 ASGNI4 ADDRLP4 88 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 84 ADDP4 ASGNP4 ADDRLP4 92 CNSTI4 128 ASGNI4 ADDRLP4 88 INDIRP4 ADDRLP4 88 INDIRP4 INDIRI4 ADDRLP4 92 INDIRI4 BANDI4 ADDRLP4 92 INDIRI4 BXORI4 ADDRLP4 24 INDIRI4 BORI4 ASGNI4 ADDRFP4 0 INDIRP4 ARGP4 ADDRGP4 $286 INDIRI4 CNSTI4 57 ADDI4 ARGI4 ADDRLP4 4 INDIRI4 ARGI4 ADDRGP4 G_AddEvent CALLV pop ADDRFP4 0 INDIRP4 CNSTI4 712 ADDP4 ADDRGP4 body_die ASGNP4 ADDRLP4 96 ADDRGP4 $286 ASGNP4 ADDRLP4 96 INDIRP4 ADDRLP4 96 INDIRP4 INDIRI4 CNSTI4 1 ADDI4 CNSTI4 3 MODI4 ASGNI4 ADDRFP4 0 INDIRP4 CNSTI4 8 ADDP4 INDIRI4 CNSTI4 512 BANDI4 CNSTI4 0 EQI4 $294 ADDRFP4 0 INDIRP4 ARGP4 ADDRGP4 Kamikaze_DeathTimer CALLV pop LABELV $294 LABELV $281 ADDRFP4 0 INDIRP4 ARGP4 ADDRGP4 trap_LinkEntity CALLV pop LABELV $219 endproc player_die 100 28 export CheckArmor proc CheckArmor 20 4 ADDRFP4 4 INDIRI4 CNSTI4 0 NEI4 $297 CNSTI4 0 RETI4 ADDRGP4 $296 JUMPV LABELV $297 ADDRLP4 4 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 ASGNP4 ADDRLP4 4 INDIRP4 CVPU4 4 CNSTU4 0 NEU4 $299 CNSTI4 0 RETI4 ADDRGP4 $296 JUMPV LABELV $299 ADDRFP4 8 INDIRI4 CNSTI4 2 BANDI4 CNSTI4 0 EQI4 $301 CNSTI4 0 RETI4 ADDRGP4 $296 JUMPV LABELV $301 ADDRLP4 8 ADDRLP4 4 INDIRP4 CNSTI4 200 ADDP4 INDIRI4 ASGNI4 CNSTF4 1059648963 ADDRFP4 4 INDIRI4 CVIF4 4 MULF4 ARGF4 ADDRLP4 12 ADDRGP4 qk_ceil CALLF4 ASGNF4 ADDRLP4 0 ADDRLP4 12 INDIRF4 CVFI4 4 ASGNI4 ADDRLP4 0 INDIRI4 ADDRLP4 8 INDIRI4 LTI4 $303 ADDRLP4 0 ADDRLP4 8 INDIRI4 ASGNI4 LABELV $303 ADDRLP4 0 INDIRI4 CNSTI4 0 NEI4 $305 CNSTI4 0 RETI4 ADDRGP4 $296 JUMPV LABELV $305 ADDRLP4 16 ADDRLP4 4 INDIRP4 CNSTI4 200 ADDP4 ASGNP4 ADDRLP4 16 INDIRP4 ADDRLP4 16 INDIRP4 INDIRI4 ADDRLP4 0 INDIRI4 SUBI4 ASGNI4 ADDRLP4 0 INDIRI4 RETI4 LABELV $296 endproc CheckArmor 20 4 export RaySphereIntersections proc RaySphereIntersections 96 4 ADDRFP4 0 ADDRFP4 0 INDIRP4 ASGNP4 ADDRFP4 8 ADDRFP4 8 INDIRP4 ASGNP4 ADDRFP4 12 ADDRFP4 12 INDIRP4 ASGNP4 ADDRFP4 16 ADDRFP4 16 INDIRP4 ASGNP4 ADDRFP4 12 INDIRP4 ARGP4 ADDRGP4 VectorNormalize CALLF4 pop ADDRLP4 28 CNSTI4 4 ASGNI4 ADDRLP4 32 ADDRFP4 8 INDIRP4 ADDRLP4 28 INDIRI4 ADDP4 ASGNP4 ADDRLP4 36 ADDRFP4 0 INDIRP4 ADDRLP4 28 INDIRI4 ADDP4 ASGNP4 ADDRLP4 40 CNSTI4 8 ASGNI4 ADDRLP4 44 ADDRFP4 8 INDIRP4 ADDRLP4 40 INDIRI4 ADDP4 ASGNP4 ADDRLP4 48 ADDRFP4 0 INDIRP4 ADDRLP4 40 INDIRI4 ADDP4 ASGNP4 ADDRLP4 4 CNSTF4 1073741824 ADDRFP4 12 INDIRP4 INDIRF4 ADDRFP4 8 INDIRP4 INDIRF4 ADDRFP4 0 INDIRP4 INDIRF4 SUBF4 MULF4 ADDRFP4 12 INDIRP4 ADDRLP4 28 INDIRI4 ADDP4 INDIRF4 ADDRLP4 32 INDIRP4 INDIRF4 ADDRLP4 36 INDIRP4 INDIRF4 SUBF4 MULF4 ADDF4 ADDRFP4 12 INDIRP4 ADDRLP4 40 INDIRI4 ADDP4 INDIRF4 ADDRLP4 44 INDIRP4 INDIRF4 ADDRLP4 48 INDIRP4 INDIRF4 SUBF4 MULF4 ADDF4 MULF4 ASGNF4 ADDRLP4 52 ADDRFP4 8 INDIRP4 INDIRF4 ADDRFP4 0 INDIRP4 INDIRF4 SUBF4 ASGNF4 ADDRLP4 56 ADDRLP4 32 INDIRP4 INDIRF4 ADDRLP4 36 INDIRP4 INDIRF4 SUBF4 ASGNF4 ADDRLP4 60 ADDRLP4 44 INDIRP4 INDIRF4 ADDRLP4 48 INDIRP4 INDIRF4 SUBF4 ASGNF4 ADDRLP4 64 ADDRFP4 4 INDIRF4 ASGNF4 ADDRLP4 12 ADDRLP4 52 INDIRF4 ADDRLP4 52 INDIRF4 MULF4 ADDRLP4 56 INDIRF4 ADDRLP4 56 INDIRF4 MULF4 ADDF4 ADDRLP4 60 INDIRF4 ADDRLP4 60 INDIRF4 MULF4 ADDF4 ADDRLP4 64 INDIRF4 ADDRLP4 64 INDIRF4 MULF4 SUBF4 ASGNF4 ADDRLP4 8 ADDRLP4 4 INDIRF4 ADDRLP4 4 INDIRF4 MULF4 CNSTF4 1082130432 ADDRLP4 12 INDIRF4 MULF4 SUBF4 ASGNF4 ADDRLP4 8 INDIRF4 CNSTF4 0 LEF4 $308 ADDRLP4 8 INDIRF4 ARGF4 ADDRLP4 72 ADDRGP4 qk_sqrt CALLF4 ASGNF4 ADDRLP4 0 ADDRLP4 4 INDIRF4 NEGF4 ADDRLP4 72 INDIRF4 ADDF4 CNSTF4 1073741824 DIVF4 ASGNF4 ADDRFP4 16 INDIRP4 ADDRFP4 8 INDIRP4 INDIRF4 ADDRFP4 12 INDIRP4 INDIRF4 ADDRLP4 0 INDIRF4 MULF4 ADDF4 ASGNF4 ADDRLP4 76 CNSTI4 4 ASGNI4 ADDRFP4 16 INDIRP4 ADDRLP4 76 INDIRI4 ADDP4 ADDRFP4 8 INDIRP4 ADDRLP4 76 INDIRI4 ADDP4 INDIRF4 ADDRFP4 12 INDIRP4 ADDRLP4 76 INDIRI4 ADDP4 INDIRF4 ADDRLP4 0 INDIRF4 MULF4 ADDF4 ASGNF4 ADDRLP4 80 CNSTI4 8 ASGNI4 ADDRFP4 16 INDIRP4 ADDRLP4 80 INDIRI4 ADDP4 ADDRFP4 8 INDIRP4 ADDRLP4 80 INDIRI4 ADDP4 INDIRF4 ADDRFP4 12 INDIRP4 ADDRLP4 80 INDIRI4 ADDP4 INDIRF4 ADDRLP4 0 INDIRF4 MULF4 ADDF4 ASGNF4 ADDRLP4 8 INDIRF4 ARGF4 ADDRLP4 84 ADDRGP4 qk_sqrt CALLF4 ASGNF4 ADDRLP4 0 ADDRLP4 4 INDIRF4 NEGF4 ADDRLP4 84 INDIRF4 SUBF4 CNSTF4 1073741824 DIVF4 ASGNF4 ADDRFP4 16 INDIRP4 CNSTI4 12 ADDP4 ADDRFP4 8 INDIRP4 INDIRF4 ADDRFP4 12 INDIRP4 INDIRF4 ADDRLP4 0 INDIRF4 MULF4 ADDF4 ASGNF4 ADDRLP4 88 CNSTI4 4 ASGNI4 ADDRFP4 16 INDIRP4 CNSTI4 16 ADDP4 ADDRFP4 8 INDIRP4 ADDRLP4 88 INDIRI4 ADDP4 INDIRF4 ADDRFP4 12 INDIRP4 ADDRLP4 88 INDIRI4 ADDP4 INDIRF4 ADDRLP4 0 INDIRF4 MULF4 ADDF4 ASGNF4 ADDRLP4 92 CNSTI4 8 ASGNI4 ADDRFP4 16 INDIRP4 CNSTI4 20 ADDP4 ADDRFP4 8 INDIRP4 ADDRLP4 92 INDIRI4 ADDP4 INDIRF4 ADDRFP4 12 INDIRP4 ADDRLP4 92 INDIRI4 ADDP4 INDIRF4 ADDRLP4 0 INDIRF4 MULF4 ADDF4 ASGNF4 CNSTI4 2 RETI4 ADDRGP4 $307 JUMPV LABELV $308 ADDRLP4 8 INDIRF4 CNSTF4 0 NEF4 $310 ADDRLP4 0 ADDRLP4 4 INDIRF4 NEGF4 CNSTF4 1073741824 DIVF4 ASGNF4 ADDRFP4 16 INDIRP4 ADDRFP4 8 INDIRP4 INDIRF4 ADDRFP4 12 INDIRP4 INDIRF4 ADDRLP4 0 INDIRF4 MULF4 ADDF4 ASGNF4 ADDRLP4 72 CNSTI4 4 ASGNI4 ADDRFP4 16 INDIRP4 ADDRLP4 72 INDIRI4 ADDP4 ADDRFP4 8 INDIRP4 ADDRLP4 72 INDIRI4 ADDP4 INDIRF4 ADDRFP4 12 INDIRP4 ADDRLP4 72 INDIRI4 ADDP4 INDIRF4 ADDRLP4 0 INDIRF4 MULF4 ADDF4 ASGNF4 ADDRLP4 76 CNSTI4 8 ASGNI4 ADDRFP4 16 INDIRP4 ADDRLP4 76 INDIRI4 ADDP4 ADDRFP4 8 INDIRP4 ADDRLP4 76 INDIRI4 ADDP4 INDIRF4 ADDRFP4 12 INDIRP4 ADDRLP4 76 INDIRI4 ADDP4 INDIRF4 ADDRLP4 0 INDIRF4 MULF4 ADDF4 ASGNF4 CNSTI4 1 RETI4 ADDRGP4 $307 JUMPV LABELV $310 CNSTI4 0 RETI4 LABELV $307 endproc RaySphereIntersections 96 4 export G_InvulnerabilityEffect proc G_InvulnerabilityEffect 64 20 ADDRFP4 0 ADDRFP4 0 INDIRP4 ASGNP4 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CVPU4 4 CNSTU4 0 NEU4 $313 CNSTI4 0 RETI4 ADDRGP4 $312 JUMPV LABELV $313 ADDRLP4 0 ADDRFP4 4 INDIRP4 INDIRB ASGNB 12 ADDRLP4 0 ARGP4 ADDRGP4 VectorInverse CALLV pop ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 20 ADDP4 ARGP4 CNSTF4 1109917696 ARGF4 ADDRFP4 8 INDIRP4 ARGP4 ADDRLP4 0 ARGP4 ADDRLP4 12 ARGP4 ADDRLP4 44 ADDRGP4 RaySphereIntersections CALLI4 ASGNI4 ADDRLP4 40 ADDRLP4 44 INDIRI4 ASGNI4 ADDRLP4 40 INDIRI4 CNSTI4 0 LEI4 $315 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 20 ADDP4 ARGP4 CNSTI4 71 ARGI4 ADDRLP4 48 ADDRGP4 G_TempEntity CALLP4 ASGNP4 ADDRLP4 36 ADDRLP4 48 INDIRP4 ASGNP4 ADDRLP4 52 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 ASGNP4 ADDRLP4 0 ADDRLP4 12 INDIRF4 ADDRLP4 52 INDIRP4 INDIRP4 CNSTI4 20 ADDP4 INDIRF4 SUBF4 ASGNF4 ADDRLP4 0+4 ADDRLP4 12+4 INDIRF4 ADDRLP4 52 INDIRP4 INDIRP4 CNSTI4 24 ADDP4 INDIRF4 SUBF4 ASGNF4 ADDRLP4 0+8 ADDRLP4 12+8 INDIRF4 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 28 ADDP4 INDIRF4 SUBF4 ASGNF4 ADDRLP4 0 ARGP4 ADDRLP4 36 INDIRP4 CNSTI4 116 ADDP4 ARGP4 ADDRGP4 vectoangles CALLV pop ADDRLP4 56 ADDRLP4 36 INDIRP4 CNSTI4 116 ADDP4 ASGNP4 ADDRLP4 56 INDIRP4 ADDRLP4 56 INDIRP4 INDIRF4 CNSTF4 1119092736 ADDF4 ASGNF4 ADDRLP4 36 INDIRP4 CNSTI4 116 ADDP4 INDIRF4 CNSTF4 1135869952 LEF4 $321 ADDRLP4 60 ADDRLP4 36 INDIRP4 CNSTI4 116 ADDP4 ASGNP4 ADDRLP4 60 INDIRP4 ADDRLP4 60 INDIRP4 INDIRF4 CNSTF4 1135869952 SUBF4 ASGNF4 LABELV $321 ADDRFP4 12 INDIRP4 CVPU4 4 CNSTU4 0 EQU4 $323 ADDRFP4 12 INDIRP4 ADDRLP4 12 INDIRB ASGNB 12 LABELV $323 ADDRFP4 16 INDIRP4 CVPU4 4 CNSTU4 0 EQU4 $325 ADDRFP4 16 INDIRP4 ADDRLP4 0 INDIRB ASGNB 12 ADDRFP4 16 INDIRP4 ARGP4 ADDRGP4 VectorNormalize CALLF4 pop LABELV $325 CNSTI4 1 RETI4 ADDRGP4 $312 JUMPV LABELV $315 CNSTI4 0 RETI4 LABELV $312 endproc G_InvulnerabilityEffect 64 20 export G_Damage proc G_Damage 104 24 ADDRFP4 0 ADDRFP4 0 INDIRP4 ASGNP4 ADDRFP4 8 ADDRFP4 8 INDIRP4 ASGNP4 ADDRFP4 12 ADDRFP4 12 INDIRP4 ASGNP4 ADDRFP4 20 ADDRFP4 20 INDIRI4 ASGNI4 ADDRFP4 24 ADDRFP4 24 INDIRI4 ASGNI4 ADDRFP4 28 ADDRFP4 28 INDIRI4 ASGNI4 ADDRFP4 0 INDIRP4 CNSTI4 732 ADDP4 INDIRI4 CNSTI4 0 NEI4 $328 ADDRGP4 $327 JUMPV LABELV $328 ADDRGP4 level+9124 INDIRI4 CNSTI4 0 EQI4 $330 ADDRGP4 $327 JUMPV LABELV $330 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CVPU4 4 CNSTU4 0 EQU4 $333 ADDRFP4 28 INDIRI4 CNSTI4 27 EQI4 $333 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 836 ADDP4 INDIRI4 ADDRGP4 level+32 INDIRI4 LEI4 $335 ADDRLP4 44 CNSTU4 0 ASGNU4 ADDRFP4 12 INDIRP4 CVPU4 4 ADDRLP4 44 INDIRU4 EQU4 $327 ADDRFP4 16 INDIRP4 CVPU4 4 ADDRLP4 44 INDIRU4 EQU4 $327 ADDRFP4 0 INDIRP4 ARGP4 ADDRFP4 12 INDIRP4 ARGP4 ADDRFP4 16 INDIRP4 ARGP4 ADDRLP4 32 ARGP4 ADDRLP4 20 ARGP4 ADDRGP4 G_InvulnerabilityEffect CALLI4 pop ADDRGP4 $327 JUMPV LABELV $335 LABELV $333 ADDRFP4 4 INDIRP4 CVPU4 4 CNSTU4 0 NEU4 $340 ADDRFP4 4 ADDRGP4 g_entities+829864 ASGNP4 LABELV $340 ADDRFP4 8 INDIRP4 CVPU4 4 CNSTU4 0 NEU4 $343 ADDRFP4 8 ADDRGP4 g_entities+829864 ASGNP4 LABELV $343 ADDRLP4 44 CNSTI4 4 ASGNI4 ADDRFP4 0 INDIRP4 ADDRLP4 44 INDIRI4 ADDP4 INDIRI4 ADDRLP4 44 INDIRI4 NEI4 $346 ADDRFP4 0 INDIRP4 CNSTI4 704 ADDP4 INDIRP4 CVPU4 4 CNSTU4 0 EQU4 $327 ADDRFP4 0 INDIRP4 CNSTI4 576 ADDP4 INDIRI4 CNSTI4 0 NEI4 $327 ADDRFP4 0 INDIRP4 ARGP4 ADDRFP4 4 INDIRP4 ARGP4 ADDRFP4 8 INDIRP4 ARGP4 ADDRFP4 0 INDIRP4 CNSTI4 704 ADDP4 INDIRP4 CALLV pop ADDRGP4 $327 JUMPV LABELV $346 ADDRGP4 g_gametype+12 INDIRI4 CNSTI4 6 NEI4 $350 ADDRFP4 0 INDIRP4 ARGP4 ADDRFP4 8 INDIRP4 ARGP4 ADDRLP4 48 ADDRGP4 CheckObeliskAttack CALLI4 ASGNI4 ADDRLP4 48 INDIRI4 CNSTI4 0 EQI4 $350 ADDRGP4 $327 JUMPV LABELV $350 ADDRFP4 8 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CVPU4 4 CNSTU4 0 EQU4 $353 ADDRFP4 8 INDIRP4 CVPU4 4 ADDRFP4 0 INDIRP4 CVPU4 4 EQU4 $353 ADDRLP4 56 ADDRFP4 8 INDIRP4 CNSTI4 516 ADDP4 ASGNP4 ADDRLP4 16 ADDRLP4 56 INDIRP4 INDIRP4 CNSTI4 212 ADDP4 INDIRI4 ASGNI4 CNSTI4 52 ADDRLP4 56 INDIRP4 INDIRP4 CNSTI4 192 ADDP4 INDIRI4 MULI4 ADDRGP4 bg_itemlist+40 ADDP4 INDIRI4 CNSTI4 11 NEI4 $355 ADDRLP4 16 ADDRLP4 16 INDIRI4 CNSTI4 2 DIVI4 ASGNI4 LABELV $355 ADDRFP4 20 ADDRFP4 20 INDIRI4 ADDRLP4 16 INDIRI4 MULI4 CNSTI4 100 DIVI4 ASGNI4 LABELV $353 ADDRLP4 0 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 ASGNP4 ADDRLP4 0 INDIRP4 CVPU4 4 CNSTU4 0 EQU4 $358 ADDRLP4 0 INDIRP4 CNSTI4 648 ADDP4 INDIRI4 CNSTI4 0 EQI4 $360 ADDRGP4 $327 JUMPV LABELV $360 LABELV $358 ADDRFP4 12 INDIRP4 CVPU4 4 CNSTU4 0 NEU4 $362 ADDRFP4 24 ADDRFP4 24 INDIRI4 CNSTI4 4 BORI4 ASGNI4 ADDRGP4 $363 JUMPV LABELV $362 ADDRFP4 12 INDIRP4 ARGP4 ADDRGP4 VectorNormalize CALLF4 pop LABELV $363 ADDRLP4 4 ADDRFP4 20 INDIRI4 ASGNI4 ADDRLP4 4 INDIRI4 CNSTI4 200 LEI4 $364 ADDRLP4 4 CNSTI4 200 ASGNI4 LABELV $364 ADDRFP4 0 INDIRP4 CNSTI4 536 ADDP4 INDIRI4 CNSTI4 2048 BANDI4 CNSTI4 0 EQI4 $366 ADDRLP4 4 CNSTI4 0 ASGNI4 LABELV $366 ADDRFP4 24 INDIRI4 CNSTI4 4 BANDI4 CNSTI4 0 EQI4 $368 ADDRLP4 4 CNSTI4 0 ASGNI4 LABELV $368 ADDRLP4 4 INDIRI4 CNSTI4 0 EQI4 $370 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CVPU4 4 CNSTU4 0 EQU4 $370 ADDRLP4 68 CNSTF4 1128792064 ASGNF4 ADDRLP4 76 ADDRLP4 4 INDIRI4 CVIF4 4 ASGNF4 ADDRLP4 80 ADDRLP4 68 INDIRF4 ASGNF4 ADDRLP4 56 ADDRFP4 12 INDIRP4 INDIRF4 ADDRGP4 g_knockback+8 INDIRF4 ADDRLP4 76 INDIRF4 MULF4 ADDRLP4 80 INDIRF4 DIVF4 MULF4 ASGNF4 ADDRLP4 56+4 ADDRFP4 12 INDIRP4 CNSTI4 4 ADDP4 INDIRF4 ADDRGP4 g_knockback+8 INDIRF4 ADDRLP4 76 INDIRF4 MULF4 ADDRLP4 80 INDIRF4 DIVF4 MULF4 ASGNF4 ADDRLP4 56+8 ADDRFP4 12 INDIRP4 CNSTI4 8 ADDP4 INDIRF4 ADDRGP4 g_knockback+8 INDIRF4 ADDRLP4 4 INDIRI4 CVIF4 4 MULF4 ADDRLP4 68 INDIRF4 DIVF4 MULF4 ASGNF4 ADDRLP4 84 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 32 ADDP4 ASGNP4 ADDRLP4 84 INDIRP4 ADDRLP4 84 INDIRP4 INDIRF4 ADDRLP4 56 INDIRF4 ADDF4 ASGNF4 ADDRLP4 88 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 36 ADDP4 ASGNP4 ADDRLP4 88 INDIRP4 ADDRLP4 88 INDIRP4 INDIRF4 ADDRLP4 56+4 INDIRF4 ADDF4 ASGNF4 ADDRLP4 92 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 40 ADDP4 ASGNP4 ADDRLP4 92 INDIRP4 ADDRLP4 92 INDIRP4 INDIRF4 ADDRLP4 56+8 INDIRF4 ADDF4 ASGNF4 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 16 ADDP4 INDIRI4 CNSTI4 0 NEI4 $379 ADDRLP4 96 ADDRLP4 4 INDIRI4 CNSTI4 1 LSHI4 ASGNI4 ADDRLP4 96 INDIRI4 CNSTI4 50 GEI4 $381 ADDRLP4 96 CNSTI4 50 ASGNI4 LABELV $381 ADDRLP4 96 INDIRI4 CNSTI4 200 LEI4 $383 ADDRLP4 96 CNSTI4 200 ASGNI4 LABELV $383 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 16 ADDP4 ADDRLP4 96 INDIRI4 ASGNI4 ADDRLP4 100 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 12 ADDP4 ASGNP4 ADDRLP4 100 INDIRP4 ADDRLP4 100 INDIRP4 INDIRI4 CNSTI4 64 BORI4 ASGNI4 LABELV $379 LABELV $370 ADDRFP4 24 INDIRI4 CNSTI4 8 BANDI4 CNSTI4 0 NEI4 $385 ADDRFP4 28 INDIRI4 CNSTI4 27 EQI4 $387 ADDRFP4 0 INDIRP4 CVPU4 4 ADDRFP4 8 INDIRP4 CVPU4 4 EQU4 $387 ADDRFP4 24 INDIRI4 CNSTI4 16 BANDI4 CNSTI4 0 NEI4 $387 ADDRFP4 0 INDIRP4 ARGP4 ADDRFP4 8 INDIRP4 ARGP4 ADDRLP4 64 ADDRGP4 OnSameTeam CALLI4 ASGNI4 ADDRLP4 64 INDIRI4 CNSTI4 0 EQI4 $387 ADDRGP4 g_friendlyFire+12 INDIRI4 CNSTI4 0 NEI4 $389 ADDRGP4 $327 JUMPV LABELV $389 LABELV $387 ADDRFP4 28 INDIRI4 CNSTI4 25 NEI4 $392 ADDRLP4 68 ADDRFP4 4 INDIRP4 ASGNP4 ADDRLP4 72 CNSTU4 0 ASGNU4 ADDRLP4 68 INDIRP4 CVPU4 4 ADDRLP4 72 INDIRU4 EQU4 $394 ADDRLP4 76 ADDRLP4 68 INDIRP4 CNSTI4 600 ADDP4 INDIRP4 ASGNP4 ADDRLP4 76 INDIRP4 CVPU4 4 ADDRLP4 72 INDIRU4 EQU4 $394 ADDRFP4 0 INDIRP4 ARGP4 ADDRLP4 76 INDIRP4 ARGP4 ADDRLP4 80 ADDRGP4 OnSameTeam CALLI4 ASGNI4 ADDRLP4 80 INDIRI4 CNSTI4 0 EQI4 $394 ADDRGP4 $327 JUMPV LABELV $394 ADDRFP4 0 INDIRP4 CVPU4 4 ADDRFP4 8 INDIRP4 CVPU4 4 NEU4 $396 ADDRGP4 $327 JUMPV LABELV $396 LABELV $392 ADDRFP4 0 INDIRP4 CNSTI4 536 ADDP4 INDIRI4 CNSTI4 16 BANDI4 CNSTI4 0 EQI4 $398 ADDRGP4 $327 JUMPV LABELV $398 LABELV $385 ADDRLP4 0 INDIRP4 CVPU4 4 CNSTU4 0 EQU4 $400 ADDRLP4 0 INDIRP4 CNSTI4 320 ADDP4 INDIRI4 CNSTI4 0 EQI4 $400 ADDRFP4 0 INDIRP4 ARGP4 CNSTI4 62 ARGI4 CNSTI4 0 ARGI4 ADDRGP4 G_AddEvent CALLV pop ADDRFP4 24 INDIRI4 CNSTI4 1 BANDI4 CNSTI4 0 NEI4 $404 ADDRFP4 28 INDIRI4 CNSTI4 19 NEI4 $402 LABELV $404 ADDRGP4 $327 JUMPV LABELV $402 ADDRFP4 20 CNSTF4 1056964608 ADDRFP4 20 INDIRI4 CVIF4 4 MULF4 CVFI4 4 ASGNI4 LABELV $400 ADDRLP4 64 CNSTU4 0 ASGNU4 ADDRFP4 8 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CVPU4 4 ADDRLP4 64 INDIRU4 EQU4 $405 ADDRLP4 0 INDIRP4 CVPU4 4 ADDRLP4 64 INDIRU4 EQU4 $405 ADDRFP4 0 INDIRP4 CVPU4 4 ADDRFP4 8 INDIRP4 CVPU4 4 EQU4 $405 ADDRLP4 72 CNSTI4 0 ASGNI4 ADDRFP4 0 INDIRP4 CNSTI4 728 ADDP4 INDIRI4 ADDRLP4 72 INDIRI4 LEI4 $405 ADDRLP4 76 ADDRFP4 0 INDIRP4 CNSTI4 4 ADDP4 INDIRI4 ASGNI4 ADDRLP4 76 INDIRI4 CNSTI4 3 EQI4 $405 ADDRLP4 76 INDIRI4 ADDRLP4 72 INDIRI4 EQI4 $405 ADDRFP4 0 INDIRP4 ARGP4 ADDRFP4 8 INDIRP4 ARGP4 ADDRLP4 80 ADDRGP4 OnSameTeam CALLI4 ASGNI4 ADDRLP4 80 INDIRI4 CNSTI4 0 EQI4 $407 ADDRLP4 84 ADDRFP4 8 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 252 ADDP4 ASGNP4 ADDRLP4 84 INDIRP4 ADDRLP4 84 INDIRP4 INDIRI4 CNSTI4 1 SUBI4 ASGNI4 ADDRGP4 $408 JUMPV LABELV $407 ADDRLP4 84 ADDRFP4 8 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 252 ADDP4 ASGNP4 ADDRLP4 84 INDIRP4 ADDRLP4 84 INDIRP4 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 LABELV $408 ADDRFP4 8 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 276 ADDP4 ADDRFP4 0 INDIRP4 CNSTI4 728 ADDP4 INDIRI4 CNSTI4 8 LSHI4 ADDRLP4 0 INDIRP4 CNSTI4 200 ADDP4 INDIRI4 BORI4 ASGNI4 LABELV $405 ADDRFP4 0 INDIRP4 CVPU4 4 ADDRFP4 8 INDIRP4 CVPU4 4 NEU4 $409 ADDRFP4 20 CNSTF4 1056964608 ADDRFP4 20 INDIRI4 CVIF4 4 MULF4 CVFI4 4 ASGNI4 LABELV $409 ADDRFP4 20 INDIRI4 CNSTI4 1 GEI4 $411 ADDRFP4 20 CNSTI4 1 ASGNI4 LABELV $411 ADDRLP4 8 ADDRFP4 20 INDIRI4 ASGNI4 ADDRFP4 0 INDIRP4 ARGP4 ADDRLP4 8 INDIRI4 ARGI4 ADDRFP4 24 INDIRI4 ARGI4 ADDRLP4 80 ADDRGP4 CheckArmor CALLI4 ASGNI4 ADDRLP4 12 ADDRLP4 80 INDIRI4 ASGNI4 ADDRLP4 8 ADDRLP4 8 INDIRI4 ADDRLP4 12 INDIRI4 SUBI4 ASGNI4 ADDRGP4 g_debugDamage+12 INDIRI4 CNSTI4 0 EQI4 $413 ADDRGP4 $416 ARGP4 ADDRGP4 level+32 INDIRI4 ARGI4 ADDRFP4 0 INDIRP4 INDIRI4 ARGI4 ADDRFP4 0 INDIRP4 CNSTI4 728 ADDP4 INDIRI4 ARGI4 ADDRLP4 8 INDIRI4 ARGI4 ADDRLP4 12 INDIRI4 ARGI4 ADDRGP4 G_Printf CALLV pop LABELV $413 ADDRLP4 0 INDIRP4 CVPU4 4 CNSTU4 0 EQU4 $418 ADDRFP4 8 INDIRP4 CVPU4 4 CNSTU4 0 EQU4 $420 ADDRLP4 0 INDIRP4 CNSTI4 272 ADDP4 ADDRFP4 8 INDIRP4 INDIRI4 ASGNI4 ADDRGP4 $421 JUMPV LABELV $420 ADDRLP4 0 INDIRP4 CNSTI4 272 ADDP4 CNSTI4 1022 ASGNI4 LABELV $421 ADDRLP4 84 ADDRLP4 0 INDIRP4 CNSTI4 680 ADDP4 ASGNP4 ADDRLP4 84 INDIRP4 ADDRLP4 84 INDIRP4 INDIRI4 ADDRLP4 12 INDIRI4 ADDI4 ASGNI4 ADDRLP4 88 ADDRLP4 0 INDIRP4 CNSTI4 684 ADDP4 ASGNP4 ADDRLP4 88 INDIRP4 ADDRLP4 88 INDIRP4 INDIRI4 ADDRLP4 8 INDIRI4 ADDI4 ASGNI4 ADDRLP4 92 ADDRLP4 0 INDIRP4 CNSTI4 688 ADDP4 ASGNP4 ADDRLP4 92 INDIRP4 ADDRLP4 92 INDIRP4 INDIRI4 ADDRLP4 4 INDIRI4 ADDI4 ASGNI4 ADDRFP4 12 INDIRP4 CVPU4 4 CNSTU4 0 EQU4 $422 ADDRLP4 0 INDIRP4 CNSTI4 692 ADDP4 ADDRFP4 12 INDIRP4 INDIRB ASGNB 12 ADDRLP4 0 INDIRP4 CNSTI4 704 ADDP4 CNSTI4 0 ASGNI4 ADDRGP4 $423 JUMPV LABELV $422 ADDRLP4 0 INDIRP4 CNSTI4 692 ADDP4 ADDRFP4 0 INDIRP4 CNSTI4 488 ADDP4 INDIRB ASGNB 12 ADDRLP4 0 INDIRP4 CNSTI4 704 ADDP4 CNSTI4 1 ASGNI4 LABELV $423 LABELV $418 ADDRGP4 g_gametype+12 INDIRI4 CNSTI4 4 EQI4 $428 ADDRGP4 g_gametype+12 INDIRI4 CNSTI4 5 NEI4 $424 LABELV $428 ADDRFP4 0 INDIRP4 ARGP4 ADDRFP4 8 INDIRP4 ARGP4 ADDRGP4 Team_CheckHurtCarrier CALLV pop LABELV $424 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CVPU4 4 CNSTU4 0 EQU4 $429 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 724 ADDP4 ADDRFP4 8 INDIRP4 INDIRI4 ASGNI4 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 728 ADDP4 ADDRFP4 28 INDIRI4 ASGNI4 LABELV $429 ADDRLP4 8 INDIRI4 CNSTI4 0 EQI4 $431 ADDRLP4 84 ADDRFP4 0 INDIRP4 CNSTI4 728 ADDP4 ASGNP4 ADDRLP4 84 INDIRP4 ADDRLP4 84 INDIRP4 INDIRI4 ADDRLP4 8 INDIRI4 SUBI4 ASGNI4 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CVPU4 4 CNSTU4 0 EQU4 $433 ADDRFP4 0 INDIRP4 CNSTI4 516 ADDP4 INDIRP4 CNSTI4 184 ADDP4 ADDRFP4 0 INDIRP4 CNSTI4 728 ADDP4 INDIRI4 ASGNI4 LABELV $433 ADDRFP4 0 INDIRP4 CNSTI4 728 ADDP4 INDIRI4 CNSTI4 0 GTI4 $435 ADDRLP4 0 INDIRP4 CVPU4 4 CNSTU4 0 EQU4 $437 ADDRLP4 88 ADDRFP4 0 INDIRP4 CNSTI4 536 ADDP4 ASGNP4 ADDRLP4 88 INDIRP4 ADDRLP4 88 INDIRP4 INDIRI4 CNSTI4 2048 BORI4 ASGNI4 LABELV $437 ADDRFP4 0 INDIRP4 CNSTI4 728 ADDP4 INDIRI4 CNSTI4 -999 GEI4 $439 ADDRFP4 0 INDIRP4 CNSTI4 728 ADDP4 CNSTI4 -999 ASGNI4 LABELV $439 ADDRFP4 0 INDIRP4 CNSTI4 764 ADDP4 ADDRFP4 8 INDIRP4 ASGNP4 ADDRFP4 0 INDIRP4 ARGP4 ADDRFP4 4 INDIRP4 ARGP4 ADDRFP4 8 INDIRP4 ARGP4 ADDRLP4 8 INDIRI4 ARGI4 ADDRFP4 28 INDIRI4 ARGI4 ADDRFP4 0 INDIRP4 CNSTI4 712 ADDP4 INDIRP4 CALLV pop ADDRGP4 $327 JUMPV LABELV $435 ADDRFP4 0 INDIRP4 CNSTI4 708 ADDP4 INDIRP4 CVPU4 4 CNSTU4 0 EQU4 $441 ADDRFP4 0 INDIRP4 ARGP4 ADDRFP4 8 INDIRP4 ARGP4 ADDRLP4 8 INDIRI4 ARGI4 ADDRFP4 0 INDIRP4 CNSTI4 708 ADDP4 INDIRP4 CALLV pop LABELV $441 LABELV $431 LABELV $327 endproc G_Damage 104 24 lit align 4 LABELV $444 byte 4 3245342720 byte 4 3245342720 byte 4 3245342720 align 4 LABELV $445 byte 4 1097859072 byte 4 1097859072 byte 4 1097859072 export CanDamage code proc CanDamage 152 28 ADDRFP4 0 ADDRFP4 0 INDIRP4 ASGNP4 ADDRFP4 4 ADDRFP4 4 INDIRP4 ASGNP4 ADDRLP4 80 ADDRGP4 $444 INDIRB ASGNB 12 ADDRLP4 92 ADDRGP4 $445 INDIRB ASGNB 12 ADDRLP4 68 ADDRFP4 0 INDIRP4 CNSTI4 464 ADDP4 INDIRF4 ADDRFP4 0 INDIRP4 CNSTI4 476 ADDP4 INDIRF4 ADDF4 ASGNF4 ADDRLP4 68+4 ADDRFP4 0 INDIRP4 CNSTI4 468 ADDP4 INDIRF4 ADDRFP4 0 INDIRP4 CNSTI4 480 ADDP4 INDIRF4 ADDF4 ASGNF4 ADDRLP4 68+8 ADDRFP4 0 INDIRP4 CNSTI4 472 ADDP4 INDIRF4 ADDRFP4 0 INDIRP4 CNSTI4 484 ADDP4 INDIRF4 ADDF4 ASGNF4 ADDRLP4 112 CNSTF4 1056964608 ASGNF4 ADDRLP4 68 ADDRLP4 112 INDIRF4 ADDRLP4 68 INDIRF4 MULF4 ASGNF4 ADDRLP4 68+4 ADDRLP4 112 INDIRF4 ADDRLP4 68+4 INDIRF4 MULF4 ASGNF4 ADDRLP4 68+8 CNSTF4 1056964608 ADDRLP4 68+8 INDIRF4 MULF4 ASGNF4 ADDRLP4 0 ADDRLP4 68 INDIRB ASGNB 12 ADDRLP4 12 ARGP4 ADDRFP4 4 INDIRP4 ARGP4 ADDRLP4 116 ADDRGP4 vec3_origin ASGNP4 ADDRLP4 116 INDIRP4 ARGP4 ADDRLP4 116 INDIRP4 ARGP4 ADDRLP4 0 ARGP4 CNSTI4 1023 ARGI4 CNSTI4 1 ARGI4 ADDRGP4 trap_Trace CALLV pop ADDRLP4 12+8 INDIRF4 CNSTF4 1065353216 EQF4 $456 ADDRLP4 12+52 INDIRI4 ADDRFP4 0 INDIRP4 INDIRI4 NEI4 $452 LABELV $456 CNSTI4 1 RETI4 ADDRGP4 $443 JUMPV LABELV $452 ADDRLP4 0 ADDRLP4 68 INDIRB ASGNB 12 ADDRLP4 0 ADDRLP4 0 INDIRF4 ADDRLP4 92 INDIRF4 ADDF4 ASGNF4 ADDRLP4 0+4 ADDRLP4 0+4 INDIRF4 ADDRLP4 92+4 INDIRF4 ADDF4 ASGNF4 ADDRLP4 0+8 ADDRLP4 0+8 INDIRF4 ADDRLP4 92+8 INDIRF4 ADDF4 ASGNF4 ADDRLP4 12 ARGP4 ADDRFP4 4 INDIRP4 ARGP4 ADDRLP4 120 ADDRGP4 vec3_origin ASGNP4 ADDRLP4 120 INDIRP4 ARGP4 ADDRLP4 120 INDIRP4 ARGP4 ADDRLP4 0 ARGP4 CNSTI4 1023 ARGI4 CNSTI4 1 ARGI4 ADDRGP4 trap_Trace CALLV pop ADDRLP4 12+8 INDIRF4 CNSTF4 1065353216 NEF4 $461 CNSTI4 1 RETI4 ADDRGP4 $443 JUMPV LABELV $461 ADDRLP4 0 ADDRLP4 68 INDIRB ASGNB 12 ADDRLP4 0 ADDRLP4 0 INDIRF4 ADDRLP4 92 INDIRF4 ADDF4 ASGNF4 ADDRLP4 0+4 ADDRLP4 0+4 INDIRF4 ADDRLP4 80+4 INDIRF4 ADDF4 ASGNF4 ADDRLP4 0+8 ADDRLP4 0+8 INDIRF4 ADDRLP4 92+8 INDIRF4 ADDF4 ASGNF4 ADDRLP4 12 ARGP4 ADDRFP4 4 INDIRP4 ARGP4 ADDRLP4 124 ADDRGP4 vec3_origin ASGNP4 ADDRLP4 124 INDIRP4 ARGP4 ADDRLP4 124 INDIRP4 ARGP4 ADDRLP4 0 ARGP4 CNSTI4 1023 ARGI4 CNSTI4 1 ARGI4 ADDRGP4 trap_Trace CALLV pop ADDRLP4 12+8 INDIRF4 CNSTF4 1065353216 NEF4 $468 CNSTI4 1 RETI4 ADDRGP4 $443 JUMPV LABELV $468 ADDRLP4 0 ADDRLP4 68 INDIRB ASGNB 12 ADDRLP4 0 ADDRLP4 0 INDIRF4 ADDRLP4 80 INDIRF4 ADDF4 ASGNF4 ADDRLP4 0+4 ADDRLP4 0+4 INDIRF4 ADDRLP4 92+4 INDIRF4 ADDF4 ASGNF4 ADDRLP4 0+8 ADDRLP4 0+8 INDIRF4 ADDRLP4 92+8 INDIRF4 ADDF4 ASGNF4 ADDRLP4 12 ARGP4 ADDRFP4 4 INDIRP4 ARGP4 ADDRLP4 128 ADDRGP4 vec3_origin ASGNP4 ADDRLP4 128 INDIRP4 ARGP4 ADDRLP4 128 INDIRP4 ARGP4 ADDRLP4 0 ARGP4 CNSTI4 1023 ARGI4 CNSTI4 1 ARGI4 ADDRGP4 trap_Trace CALLV pop ADDRLP4 12+8 INDIRF4 CNSTF4 1065353216 NEF4 $475 CNSTI4 1 RETI4 ADDRGP4 $443 JUMPV LABELV $475 ADDRLP4 0 ADDRLP4 68 INDIRB ASGNB 12 ADDRLP4 0 ADDRLP4 0 INDIRF4 ADDRLP4 80 INDIRF4 ADDF4 ASGNF4 ADDRLP4 0+4 ADDRLP4 0+4 INDIRF4 ADDRLP4 80+4 INDIRF4 ADDF4 ASGNF4 ADDRLP4 0+8 ADDRLP4 0+8 INDIRF4 ADDRLP4 92+8 INDIRF4 ADDF4 ASGNF4 ADDRLP4 12 ARGP4 ADDRFP4 4 INDIRP4 ARGP4 ADDRLP4 132 ADDRGP4 vec3_origin ASGNP4 ADDRLP4 132 INDIRP4 ARGP4 ADDRLP4 132 INDIRP4 ARGP4 ADDRLP4 0 ARGP4 CNSTI4 1023 ARGI4 CNSTI4 1 ARGI4 ADDRGP4 trap_Trace CALLV pop ADDRLP4 12+8 INDIRF4 CNSTF4 1065353216 NEF4 $482 CNSTI4 1 RETI4 ADDRGP4 $443 JUMPV LABELV $482 ADDRLP4 0 ADDRLP4 68 INDIRB ASGNB 12 ADDRLP4 0 ADDRLP4 0 INDIRF4 ADDRLP4 92 INDIRF4 ADDF4 ASGNF4 ADDRLP4 0+4 ADDRLP4 0+4 INDIRF4 ADDRLP4 92+4 INDIRF4 ADDF4 ASGNF4 ADDRLP4 0+8 ADDRLP4 0+8 INDIRF4 ADDRLP4 80+8 INDIRF4 ADDF4 ASGNF4 ADDRLP4 12 ARGP4 ADDRFP4 4 INDIRP4 ARGP4 ADDRLP4 136 ADDRGP4 vec3_origin ASGNP4 ADDRLP4 136 INDIRP4 ARGP4 ADDRLP4 136 INDIRP4 ARGP4 ADDRLP4 0 ARGP4 CNSTI4 1023 ARGI4 CNSTI4 1 ARGI4 ADDRGP4 trap_Trace CALLV pop ADDRLP4 12+8 INDIRF4 CNSTF4 1065353216 NEF4 $489 CNSTI4 1 RETI4 ADDRGP4 $443 JUMPV LABELV $489 ADDRLP4 0 ADDRLP4 68 INDIRB ASGNB 12 ADDRLP4 0 ADDRLP4 0 INDIRF4 ADDRLP4 92 INDIRF4 ADDF4 ASGNF4 ADDRLP4 0+4 ADDRLP4 0+4 INDIRF4 ADDRLP4 80+4 INDIRF4 ADDF4 ASGNF4 ADDRLP4 0+8 ADDRLP4 0+8 INDIRF4 ADDRLP4 80+8 INDIRF4 ADDF4 ASGNF4 ADDRLP4 12 ARGP4 ADDRFP4 4 INDIRP4 ARGP4 ADDRLP4 140 ADDRGP4 vec3_origin ASGNP4 ADDRLP4 140 INDIRP4 ARGP4 ADDRLP4 140 INDIRP4 ARGP4 ADDRLP4 0 ARGP4 CNSTI4 1023 ARGI4 CNSTI4 1 ARGI4 ADDRGP4 trap_Trace CALLV pop ADDRLP4 12+8 INDIRF4 CNSTF4 1065353216 NEF4 $496 CNSTI4 1 RETI4 ADDRGP4 $443 JUMPV LABELV $496 ADDRLP4 0 ADDRLP4 68 INDIRB ASGNB 12 ADDRLP4 0 ADDRLP4 0 INDIRF4 ADDRLP4 80 INDIRF4 ADDF4 ASGNF4 ADDRLP4 0+4 ADDRLP4 0+4 INDIRF4 ADDRLP4 92+4 INDIRF4 ADDF4 ASGNF4 ADDRLP4 0+8 ADDRLP4 0+8 INDIRF4 ADDRLP4 80+8 INDIRF4 ADDF4 ASGNF4 ADDRLP4 12 ARGP4 ADDRFP4 4 INDIRP4 ARGP4 ADDRLP4 144 ADDRGP4 vec3_origin ASGNP4 ADDRLP4 144 INDIRP4 ARGP4 ADDRLP4 144 INDIRP4 ARGP4 ADDRLP4 0 ARGP4 CNSTI4 1023 ARGI4 CNSTI4 1 ARGI4 ADDRGP4 trap_Trace CALLV pop ADDRLP4 12+8 INDIRF4 CNSTF4 1065353216 NEF4 $503 CNSTI4 1 RETI4 ADDRGP4 $443 JUMPV LABELV $503 ADDRLP4 0 ADDRLP4 68 INDIRB ASGNB 12 ADDRLP4 0 ADDRLP4 0 INDIRF4 ADDRLP4 80 INDIRF4 ADDF4 ASGNF4 ADDRLP4 0+4 ADDRLP4 0+4 INDIRF4 ADDRLP4 80+8 INDIRF4 ADDF4 ASGNF4 ADDRLP4 0+8 ADDRLP4 0+8 INDIRF4 ADDRLP4 80+8 INDIRF4 ADDF4 ASGNF4 ADDRLP4 12 ARGP4 ADDRFP4 4 INDIRP4 ARGP4 ADDRLP4 148 ADDRGP4 vec3_origin ASGNP4 ADDRLP4 148 INDIRP4 ARGP4 ADDRLP4 148 INDIRP4 ARGP4 ADDRLP4 0 ARGP4 CNSTI4 1023 ARGI4 CNSTI4 1 ARGI4 ADDRGP4 trap_Trace CALLV pop ADDRLP4 12+8 INDIRF4 CNSTF4 1065353216 NEF4 $510 CNSTI4 1 RETI4 ADDRGP4 $443 JUMPV LABELV $510 CNSTI4 0 RETI4 LABELV $443 endproc CanDamage 152 28 export G_RadiusDamage proc G_RadiusDamage 4196 32 ADDRFP4 0 ADDRFP4 0 INDIRP4 ASGNP4 ADDRFP4 4 ADDRFP4 4 INDIRP4 ASGNP4 ADDRFP4 8 ADDRFP4 8 INDIRF4 ASGNF4 ADDRFP4 12 ADDRFP4 12 INDIRF4 ASGNF4 ADDRFP4 16 ADDRFP4 16 INDIRP4 ASGNP4 ADDRFP4 20 ADDRFP4 20 INDIRI4 ASGNI4 ADDRLP4 4168 CNSTI4 0 ASGNI4 ADDRFP4 12 INDIRF4 CNSTF4 1065353216 GEF4 $514 ADDRFP4 12 CNSTF4 1065353216 ASGNF4 LABELV $514 ADDRLP4 0 CNSTI4 0 ASGNI4 LABELV $516 ADDRLP4 4172 ADDRLP4 0 INDIRI4 CNSTI4 2 LSHI4 ASGNI4 ADDRLP4 4172 INDIRI4 ADDRLP4 4144 ADDP4 ADDRLP4 4172 INDIRI4 ADDRFP4 0 INDIRP4 ADDP4 INDIRF4 ADDRFP4 12 INDIRF4 SUBF4 ASGNF4 ADDRLP4 4176 ADDRLP4 0 INDIRI4 CNSTI4 2 LSHI4 ASGNI4 ADDRLP4 4176 INDIRI4 ADDRLP4 4156 ADDP4 ADDRLP4 4176 INDIRI4 ADDRFP4 0 INDIRP4 ADDP4 INDIRF4 ADDRFP4 12 INDIRF4 ADDF4 ASGNF4 LABELV $517 ADDRLP4 0 ADDRLP4 0 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 ADDRLP4 0 INDIRI4 CNSTI4 3 LTI4 $516 ADDRLP4 4144 ARGP4 ADDRLP4 4156 ARGP4 ADDRLP4 44 ARGP4 CNSTI4 1024 ARGI4 ADDRLP4 4172 ADDRGP4 trap_EntitiesInBox CALLI4 ASGNI4 ADDRLP4 4140 ADDRLP4 4172 INDIRI4 ASGNI4 ADDRLP4 20 CNSTI4 0 ASGNI4 ADDRGP4 $523 JUMPV LABELV $520 ADDRLP4 4 CNSTI4 812 ADDRLP4 20 INDIRI4 CNSTI4 2 LSHI4 ADDRLP4 44 ADDP4 INDIRI4 MULI4 ADDRGP4 g_entities ADDP4 ASGNP4 ADDRLP4 4 INDIRP4 CVPU4 4 ADDRFP4 16 INDIRP4 CVPU4 4 NEU4 $524 ADDRGP4 $521 JUMPV LABELV $524 ADDRLP4 4 INDIRP4 CNSTI4 732 ADDP4 INDIRI4 CNSTI4 0 NEI4 $526 ADDRGP4 $521 JUMPV LABELV $526 ADDRLP4 0 CNSTI4 0 ASGNI4 LABELV $528 ADDRLP4 4176 ADDRLP4 0 INDIRI4 CNSTI4 2 LSHI4 ASGNI4 ADDRLP4 4176 INDIRI4 ADDRFP4 0 INDIRP4 ADDP4 INDIRF4 ADDRLP4 4176 INDIRI4 ADDRLP4 4 INDIRP4 CNSTI4 464 ADDP4 ADDP4 INDIRF4 GEF4 $532 ADDRLP4 4180 ADDRLP4 0 INDIRI4 CNSTI4 2 LSHI4 ASGNI4 ADDRLP4 4180 INDIRI4 ADDRLP4 8 ADDP4 ADDRLP4 4180 INDIRI4 ADDRLP4 4 INDIRP4 CNSTI4 464 ADDP4 ADDP4 INDIRF4 ADDRLP4 4180 INDIRI4 ADDRFP4 0 INDIRP4 ADDP4 INDIRF4 SUBF4 ASGNF4 ADDRGP4 $533 JUMPV LABELV $532 ADDRLP4 4180 ADDRLP4 0 INDIRI4 CNSTI4 2 LSHI4 ASGNI4 ADDRLP4 4180 INDIRI4 ADDRFP4 0 INDIRP4 ADDP4 INDIRF4 ADDRLP4 4180 INDIRI4 ADDRLP4 4 INDIRP4 CNSTI4 476 ADDP4 ADDP4 INDIRF4 LEF4 $534 ADDRLP4 4184 ADDRLP4 0 INDIRI4 CNSTI4 2 LSHI4 ASGNI4 ADDRLP4 4184 INDIRI4 ADDRLP4 8 ADDP4 ADDRLP4 4184 INDIRI4 ADDRFP4 0 INDIRP4 ADDP4 INDIRF4 ADDRLP4 4184 INDIRI4 ADDRLP4 4 INDIRP4 CNSTI4 476 ADDP4 ADDP4 INDIRF4 SUBF4 ASGNF4 ADDRGP4 $535 JUMPV LABELV $534 ADDRLP4 0 INDIRI4 CNSTI4 2 LSHI4 ADDRLP4 8 ADDP4 CNSTF4 0 ASGNF4 LABELV $535 LABELV $533 LABELV $529 ADDRLP4 0 ADDRLP4 0 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 ADDRLP4 0 INDIRI4 CNSTI4 3 LTI4 $528 ADDRLP4 8 ARGP4 ADDRLP4 4176 ADDRGP4 VectorLength CALLF4 ASGNF4 ADDRLP4 24 ADDRLP4 4176 INDIRF4 ASGNF4 ADDRLP4 24 INDIRF4 ADDRFP4 12 INDIRF4 LTF4 $536 ADDRGP4 $521 JUMPV LABELV $536 ADDRLP4 40 ADDRFP4 8 INDIRF4 CNSTF4 1065353216 ADDRLP4 24 INDIRF4 ADDRFP4 12 INDIRF4 DIVF4 SUBF4 MULF4 ASGNF4 ADDRLP4 4 INDIRP4 ARGP4 ADDRFP4 0 INDIRP4 ARGP4 ADDRLP4 4180 ADDRGP4 CanDamage CALLI4 ASGNI4 ADDRLP4 4180 INDIRI4 CNSTI4 0 EQI4 $538 ADDRLP4 4 INDIRP4 ARGP4 ADDRFP4 4 INDIRP4 ARGP4 ADDRLP4 4184 ADDRGP4 LogAccuracyHit CALLI4 ASGNI4 ADDRLP4 4184 INDIRI4 CNSTI4 0 EQI4 $540 ADDRLP4 4168 CNSTI4 1 ASGNI4 LABELV $540 ADDRLP4 28 ADDRLP4 4 INDIRP4 CNSTI4 488 ADDP4 INDIRF4 ADDRFP4 0 INDIRP4 INDIRF4 SUBF4 ASGNF4 ADDRLP4 28+4 ADDRLP4 4 INDIRP4 CNSTI4 492 ADDP4 INDIRF4 ADDRFP4 0 INDIRP4 CNSTI4 4 ADDP4 INDIRF4 SUBF4 ASGNF4 ADDRLP4 28+8 ADDRLP4 4 INDIRP4 CNSTI4 496 ADDP4 INDIRF4 ADDRFP4 0 INDIRP4 CNSTI4 8 ADDP4 INDIRF4 SUBF4 ASGNF4 ADDRLP4 28+8 ADDRLP4 28+8 INDIRF4 CNSTF4 1103101952 ADDF4 ASGNF4 ADDRLP4 4 INDIRP4 ARGP4 CNSTP4 0 ARGP4 ADDRFP4 4 INDIRP4 ARGP4 ADDRLP4 28 ARGP4 ADDRFP4 0 INDIRP4 ARGP4 ADDRLP4 40 INDIRF4 CVFI4 4 ARGI4 CNSTI4 1 ARGI4 ADDRFP4 20 INDIRI4 ARGI4 ADDRGP4 G_Damage CALLV pop LABELV $538 LABELV $521 ADDRLP4 20 ADDRLP4 20 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 LABELV $523 ADDRLP4 20 INDIRI4 ADDRLP4 4140 INDIRI4 LTI4 $520 ADDRLP4 4168 INDIRI4 RETI4 LABELV $513 endproc G_RadiusDamage 4196 32 import neutralObelisk import trap_SnapVector import trap_GeneticParentsAndChildSelection import trap_BotResetWeaponState import trap_BotFreeWeaponState import trap_BotAllocWeaponState import trap_BotLoadWeaponWeights import trap_BotGetWeaponInfo import trap_BotChooseBestFightWeapon import trap_BotAddAvoidSpot import trap_BotInitMoveState import trap_BotFreeMoveState import trap_BotAllocMoveState import trap_BotPredictVisiblePosition import trap_BotMovementViewTarget import trap_BotReachabilityArea import trap_BotResetLastAvoidReach import trap_BotResetAvoidReach import trap_BotMoveInDirection import trap_BotMoveToGoal import trap_BotResetMoveState import trap_BotFreeGoalState import trap_BotAllocGoalState import trap_BotMutateGoalFuzzyLogic import trap_BotSaveGoalFuzzyLogic import trap_BotInterbreedGoalFuzzyLogic import trap_BotFreeItemWeights import trap_BotLoadItemWeights import trap_BotUpdateEntityItems import trap_BotInitLevelItems import trap_BotSetAvoidGoalTime import trap_BotAvoidGoalTime import trap_BotGetLevelItemGoal import trap_BotGetMapLocationGoal import trap_BotGetNextCampSpotGoal import trap_BotItemGoalInVisButNotVisible import trap_BotTouchingGoal import trap_BotChooseNBGItem import trap_BotChooseLTGItem import trap_BotGetSecondGoal import trap_BotGetTopGoal import trap_BotGoalName import trap_BotDumpGoalStack import trap_BotDumpAvoidGoals import trap_BotEmptyGoalStack import trap_BotPopGoal import trap_BotPushGoal import trap_BotResetAvoidGoals import trap_BotRemoveFromAvoidGoals import trap_BotResetGoalState import trap_BotSetChatName import trap_BotSetChatGender import trap_BotLoadChatFile import trap_BotReplaceSynonyms import trap_UnifyWhiteSpaces import trap_BotMatchVariable import trap_BotFindMatch import trap_StringContains import trap_BotGetChatMessage import trap_BotEnterChat import trap_BotChatLength import trap_BotReplyChat import trap_BotNumInitialChats import trap_BotInitialChat import trap_BotNumConsoleMessages import trap_BotNextConsoleMessage import trap_BotRemoveConsoleMessage import trap_BotQueueConsoleMessage import trap_BotFreeChatState import trap_BotAllocChatState import trap_Characteristic_String import trap_Characteristic_BInteger import trap_Characteristic_Integer import trap_Characteristic_BFloat import trap_Characteristic_Float import trap_BotFreeCharacter import trap_BotLoadCharacter import trap_EA_ResetInput import trap_EA_GetInput import trap_EA_EndRegular import trap_EA_View import trap_EA_Move import trap_EA_DelayedJump import trap_EA_Jump import trap_EA_SelectWeapon import trap_EA_MoveRight import trap_EA_MoveLeft import trap_EA_MoveBack import trap_EA_MoveForward import trap_EA_MoveDown import trap_EA_MoveUp import trap_EA_Crouch import trap_EA_Respawn import trap_EA_Use import trap_EA_Attack import trap_EA_Talk import trap_EA_Gesture import trap_EA_Action import trap_EA_Command import trap_EA_SayTeam import trap_EA_Say import trap_AAS_PredictClientMovement import trap_AAS_Swimming import trap_AAS_AlternativeRouteGoals import trap_AAS_PredictRoute import trap_AAS_EnableRoutingArea import trap_AAS_AreaTravelTimeToGoalArea import trap_AAS_AreaReachability import trap_AAS_IntForBSPEpairKey import trap_AAS_FloatForBSPEpairKey import trap_AAS_VectorForBSPEpairKey import trap_AAS_ValueForBSPEpairKey import trap_AAS_NextBSPEntity import trap_AAS_PointContents import trap_AAS_TraceAreas import trap_AAS_PointReachabilityAreaIndex import trap_AAS_PointAreaNum import trap_AAS_Time import trap_AAS_PresenceTypeBoundingBox import trap_AAS_Initialized import trap_AAS_EntityInfo import trap_AAS_AreaInfo import trap_AAS_BBoxAreas import trap_BotUserCommand import trap_BotGetServerCommand import trap_BotGetSnapshotEntity import trap_BotLibTest import trap_BotLibUpdateEntity import trap_BotLibLoadMap import trap_BotLibStartFrame import trap_BotLibDefine import trap_BotLibVarGet import trap_BotLibVarSet import trap_BotLibShutdown import trap_BotLibSetup import trap_DebugPolygonDelete import trap_DebugPolygonCreate import trap_GetEntityToken import trap_GetUsercmd import trap_BotFreeClient import trap_BotAllocateClient import trap_EntityContact import trap_EntitiesInBox import trap_UnlinkEntity import trap_LinkEntity import trap_AreasConnected import trap_AdjustAreaPortalState import trap_InPVSIgnorePortals import trap_InPVS import trap_PointContents import trap_Trace import trap_SetBrushModel import trap_GetServerinfo import trap_SetUserinfo import trap_GetUserinfo import trap_GetConfigstring import trap_SetConfigstring import trap_SendServerCommand import trap_DropClient import trap_LocateGameData import trap_Cvar_VariableStringBuffer import trap_Cvar_VariableValue import trap_Cvar_VariableIntegerValue import trap_Cvar_Set import trap_Cvar_Update import trap_Cvar_Register import trap_SendConsoleCommand import trap_FS_Seek import trap_FS_GetFileList import trap_FS_FCloseFile import trap_FS_Write import trap_FS_Read import trap_FS_FOpenFile import trap_Args import trap_Argv import trap_Argc import trap_RealTime import trap_Milliseconds import trap_Error import trap_Print import g_proxMineTimeout import g_singlePlayer import g_enableBreath import g_enableDust import g_rankings import pmove_msec import pmove_fixed import g_smoothClients import g_blueteam import g_redteam import g_cubeTimeout import g_obeliskRespawnDelay import g_obeliskRegenAmount import g_obeliskRegenPeriod import g_obeliskHealth import g_filterBan import g_banIPs import g_teamForceBalance import g_teamAutoJoin import g_allowVote import g_blood import g_doWarmup import g_warmup import g_motd import g_synchronousClients import g_weaponTeamRespawn import g_weaponRespawn import g_debugDamage import g_debugAlloc import g_debugMove import g_inactivity import g_forcerespawn import g_quadfactor import g_knockback import g_speed import g_gravity import g_needpass import g_password import g_friendlyFire import g_capturelimit import g_timelimit import g_fraglimit import g_dmflags import g_restarted import g_maxGameClients import g_maxclients import g_cheats import g_dedicated import g_gametype import g_entities import level import Pickup_Team import CheckTeamStatus import TeamplayInfoMessage import Team_GetLocationMsg import Team_GetLocation import SelectCTFSpawnPoint import Team_FreeEntity import Team_ReturnFlag import Team_InitGame import Team_CheckHurtCarrier import Team_FragBonuses import Team_DroppedFlagThink import AddTeamScore import TeamColorString import TeamName import OtherTeam import BotTestAAS import BotAIStartFrame import BotAIShutdownClient import BotAISetupClient import BotAILoadMap import BotAIShutdown import BotAISetup import BotInterbreedEndMatch import Svcmd_BotList_f import Svcmd_AddBot_f import G_BotConnect import G_RemoveQueuedBotBegin import G_CheckBotSpawn import G_GetBotInfoByName import G_GetBotInfoByNumber import G_InitBots import Svcmd_AbortPodium_f import SpawnModelsOnVictoryPads import UpdateTournamentInfo import G_WriteSessionData import G_InitWorldSession import G_InitSessionData import G_ReadSessionData import Svcmd_GameMem_f import G_InitMemory import G_Alloc import CheckObeliskAttack import Team_CheckDroppedItem import OnSameTeam import G_RunClient import ClientEndFrame import ClientThink import ClientCommand import ClientBegin import ClientDisconnect import ClientUserinfoChanged import ClientConnect import G_Error import G_Printf import SendScoreboardMessageToAllClients import G_LogPrintf import AddTournamentQueue import G_RunThink import CheckTeamLeader import SetLeader import FindIntermissionPoint import MoveClientToIntermission import DeathmatchScoreboardMessage import G_StartKamikaze import FireWeapon import G_FilterPacket import G_ProcessIPBans import ConsoleCommand import SpotWouldTelefrag import CalculateRanks import ClientSpawn import InitBodyQue import BeginIntermission import ClientRespawn import CopyToBodyQue import SelectSpawnPoint import SetClientViewAngle import PickTeam import TeamLeader import TeamCount import Weapon_HookThink import Weapon_HookFree import CheckGauntletAttack import SnapVectorTowards import CalcMuzzlePoint import LogAccuracyHit import DropPortalDestination import DropPortalSource import TeleportPlayer import trigger_teleporter_touch import Touch_DoorTrigger import G_RunMover import fire_prox import fire_nail import fire_grapple import fire_bfg import fire_rocket import fire_grenade import fire_plasma import G_RunMissile import BuildShaderStateConfig import AddRemap import G_SetOrigin import G_AddEvent import G_AddPredictableEvent import vectoyaw import vtos import tv import G_TouchTriggers import G_EntitiesFree import G_FreeEntity import G_Sound import G_TempEntity import G_Spawn import G_InitGentity import G_SetMovedir import G_UseTargets import G_PickTarget import G_Find import G_KillBox import G_TeamCommand import G_SoundIndex import G_ModelIndex import SaveRegisteredItems import RegisterItem import ClearRegisteredItems import Touch_Item import Add_Ammo import ArmorIndex import Think_Weapon import FinishSpawningItem import G_SpawnItem import SetRespawn import LaunchItem import Drop_Item import PrecacheItem import UseHoldableItem import RespawnItem import G_RunItem import G_CheckTeamItems import Cmd_FollowCycle_f import SetTeam import BroadcastTeamChange import StopFollowing import Cmd_Score_f import G_NewString import G_SpawnEntitiesFromString import G_SpawnVector import G_SpawnInt import G_SpawnFloat import G_SpawnString import BG_PlayerTouchesItem import BG_PlayerStateToEntityStateExtraPolate import BG_PlayerStateToEntityState import BG_TouchJumpPad import BG_AddPredictableEventToPlayerstate import BG_EvaluateTrajectoryDelta import BG_EvaluateTrajectory import BG_CanItemBeGrabbed import BG_FindItemForHoldable import BG_FindItemForPowerup import BG_FindItemForWeapon import BG_FindItem import bg_numItems import bg_itemlist import Pmove import PM_UpdateViewAngles import Com_Printf import Com_Error import Info_NextPair import Info_Validate import Info_SetValueForKey_Big import Info_SetValueForKey import Info_RemoveKey_Big import Info_RemoveKey import Info_ValueForKey import Com_TruncateLongString import va import Q_CountChar import Q_CleanStr import Q_PrintStrlen import Q_strcat import Q_strncpyz import Q_stristr import Q_strupr import Q_strlwr import Q_stricmpn import Q_strncmp import Q_stricmp import Q_isintegral import Q_isanumber import Q_isalpha import Q_isupper import Q_islower import Q_isprint import Com_RandomBytes import Com_SkipCharset import Com_SkipTokens import Com_sprintf import Com_HexStrToInt import Parse3DMatrix import Parse2DMatrix import Parse1DMatrix import SkipRestOfLine import SkipBracedSection import COM_MatchToken import COM_ParseWarning import COM_ParseError import COM_Compress import COM_ParseExt import COM_Parse import COM_GetCurrentParseLine import COM_BeginParseSession import COM_DefaultExtension import COM_CompareExtension import COM_StripExtension import COM_GetExtension import COM_SkipPath import Com_Clamp import PerpendicularVector import AngleVectors import MatrixMultiply import MakeNormalVectors import RotateAroundDirection import RotatePointAroundVector import ProjectPointOnPlane import PlaneFromPoints import AngleDelta import AngleNormalize180 import AngleNormalize360 import AnglesSubtract import AngleSubtract import LerpAngle import AngleMod import BoundsIntersectPoint import BoundsIntersectSphere import BoundsIntersect import BoxOnPlaneSide import SetPlaneSignbits import AxisCopy import AxisClear import AnglesToAxis import vectoangles import Q_crandom import Q_random import Q_rand import Q_acos import Q_log2 import VectorRotate import Vector4Scale import VectorNormalize2 import VectorNormalize import CrossProduct import VectorInverse import VectorNormalizeFast import DistanceSquared import Distance import VectorLengthSquared import VectorLength import VectorCompare import AddPointToBounds import ClearBounds import RadiusFromBounds import NormalizeColor import ColorBytes4 import ColorBytes3 import _VectorMA import _VectorScale import _VectorCopy import _VectorAdd import _VectorSubtract import _DotProduct import ByteToDir import DirToByte import ClampShort import ClampChar import Q_rsqrt import Q_fabs import Q_isnan import axisDefault import vec3_origin import g_color_table import colorDkGrey import colorMdGrey import colorLtGrey import colorWhite import colorCyan import colorMagenta import colorYellow import colorBlue import colorGreen import colorRed import colorBlack import bytedirs import Hunk_AllocDebug import FloatSwap import LongSwap import ShortSwap import CopyLongSwap import CopyShortSwap import qk_acos import qk_fabs import qk_abs import qk_tan import qk_atan2 import qk_cos import qk_sin import qk_sqrt import qk_floor import qk_ceil import qk_memcpy import qk_memset import qk_memmove import qk_sscanf import qk_vsnprintf import qk_strtol import qk_atoi import qk_strtod import qk_atof import qk_toupper import qk_tolower import qk_strncpy import qk_strstr import qk_strrchr import qk_strchr import qk_strcmp import qk_strcpy import qk_strcat import qk_strlen import qk_rand import qk_srand import qk_qsort lit align 1 LABELV $416 byte 1 37 byte 1 105 byte 1 58 byte 1 32 byte 1 99 byte 1 108 byte 1 105 byte 1 101 byte 1 110 byte 1 116 byte 1 58 byte 1 37 byte 1 105 byte 1 32 byte 1 104 byte 1 101 byte 1 97 byte 1 108 byte 1 116 byte 1 104 byte 1 58 byte 1 37 byte 1 105 byte 1 32 byte 1 100 byte 1 97 byte 1 109 byte 1 97 byte 1 103 byte 1 101 byte 1 58 byte 1 37 byte 1 105 byte 1 32 byte 1 97 byte 1 114 byte 1 109 byte 1 111 byte 1 114 byte 1 58 byte 1 37 byte 1 105 byte 1 10 byte 1 0 align 1 LABELV $243 byte 1 75 byte 1 105 byte 1 108 byte 1 108 byte 1 58 byte 1 32 byte 1 37 byte 1 105 byte 1 32 byte 1 37 byte 1 105 byte 1 32 byte 1 37 byte 1 105 byte 1 58 byte 1 32 byte 1 37 byte 1 115 byte 1 32 byte 1 107 byte 1 105 byte 1 108 byte 1 108 byte 1 101 byte 1 100 byte 1 32 byte 1 37 byte 1 115 byte 1 32 byte 1 98 byte 1 121 byte 1 32 byte 1 37 byte 1 115 byte 1 10 byte 1 0 align 1 LABELV $242 byte 1 60 byte 1 98 byte 1 97 byte 1 100 byte 1 32 byte 1 111 byte 1 98 byte 1 105 byte 1 116 byte 1 117 byte 1 97 byte 1 114 byte 1 121 byte 1 62 byte 1 0 align 1 LABELV $235 byte 1 60 byte 1 119 byte 1 111 byte 1 114 byte 1 108 byte 1 100 byte 1 62 byte 1 0 align 1 LABELV $234 byte 1 60 byte 1 110 byte 1 111 byte 1 110 byte 1 45 byte 1 99 byte 1 108 byte 1 105 byte 1 101 byte 1 110 byte 1 116 byte 1 62 byte 1 0 align 1 LABELV $210 byte 1 116 byte 1 101 byte 1 97 byte 1 109 byte 1 95 byte 1 98 byte 1 108 byte 1 117 byte 1 101 byte 1 111 byte 1 98 byte 1 101 byte 1 108 byte 1 105 byte 1 115 byte 1 107 byte 1 0 align 1 LABELV $209 byte 1 116 byte 1 101 byte 1 97 byte 1 109 byte 1 95 byte 1 114 byte 1 101 byte 1 100 byte 1 111 byte 1 98 byte 1 101 byte 1 108 byte 1 105 byte 1 115 byte 1 107 byte 1 0 align 1 LABELV $189 byte 1 116 byte 1 101 byte 1 97 byte 1 109 byte 1 95 byte 1 67 byte 1 84 byte 1 70 byte 1 95 byte 1 114 byte 1 101 byte 1 100 byte 1 102 byte 1 108 byte 1 97 byte 1 103 byte 1 0 align 1 LABELV $188 byte 1 116 byte 1 101 byte 1 97 byte 1 109 byte 1 95 byte 1 67 byte 1 84 byte 1 70 byte 1 95 byte 1 98 byte 1 108 byte 1 117 byte 1 101 byte 1 102 byte 1 108 byte 1 97 byte 1 103 byte 1 0 align 1 LABELV $174 byte 1 77 byte 1 79 byte 1 68 byte 1 95 byte 1 71 byte 1 82 byte 1 65 byte 1 80 byte 1 80 byte 1 76 byte 1 69 byte 1 0 align 1 LABELV $173 byte 1 77 byte 1 79 byte 1 68 byte 1 95 byte 1 74 byte 1 85 byte 1 73 byte 1 67 byte 1 69 byte 1 68 byte 1 0 align 1 LABELV $172 byte 1 77 byte 1 79 byte 1 68 byte 1 95 byte 1 75 byte 1 65 byte 1 77 byte 1 73 byte 1 75 byte 1 65 byte 1 90 byte 1 69 byte 1 0 align 1 LABELV $171 byte 1 77 byte 1 79 byte 1 68 byte 1 95 byte 1 80 byte 1 82 byte 1 79 byte 1 88 byte 1 73 byte 1 77 byte 1 73 byte 1 84 byte 1 89 byte 1 95 byte 1 77 byte 1 73 byte 1 78 byte 1 69 byte 1 0 align 1 LABELV $170 byte 1 77 byte 1 79 byte 1 68 byte 1 95 byte 1 67 byte 1 72 byte 1 65 byte 1 73 byte 1 78 byte 1 71 byte 1 85 byte 1 78 byte 1 0 align 1 LABELV $169 byte 1 77 byte 1 79 byte 1 68 byte 1 95 byte 1 78 byte 1 65 byte 1 73 byte 1 76 byte 1 0 align 1 LABELV $168 byte 1 77 byte 1 79 byte 1 68 byte 1 95 byte 1 84 byte 1 82 byte 1 73 byte 1 71 byte 1 71 byte 1 69 byte 1 82 byte 1 95 byte 1 72 byte 1 85 byte 1 82 byte 1 84 byte 1 0 align 1 LABELV $167 byte 1 77 byte 1 79 byte 1 68 byte 1 95 byte 1 84 byte 1 65 byte 1 82 byte 1 71 byte 1 69 byte 1 84 byte 1 95 byte 1 76 byte 1 65 byte 1 83 byte 1 69 byte 1 82 byte 1 0 align 1 LABELV $166 byte 1 77 byte 1 79 byte 1 68 byte 1 95 byte 1 83 byte 1 85 byte 1 73 byte 1 67 byte 1 73 byte 1 68 byte 1 69 byte 1 0 align 1 LABELV $165 byte 1 77 byte 1 79 byte 1 68 byte 1 95 byte 1 70 byte 1 65 byte 1 76 byte 1 76 byte 1 73 byte 1 78 byte 1 71 byte 1 0 align 1 LABELV $164 byte 1 77 byte 1 79 byte 1 68 byte 1 95 byte 1 84 byte 1 69 byte 1 76 byte 1 69 byte 1 70 byte 1 82 byte 1 65 byte 1 71 byte 1 0 align 1 LABELV $163 byte 1 77 byte 1 79 byte 1 68 byte 1 95 byte 1 67 byte 1 82 byte 1 85 byte 1 83 byte 1 72 byte 1 0 align 1 LABELV $162 byte 1 77 byte 1 79 byte 1 68 byte 1 95 byte 1 76 byte 1 65 byte 1 86 byte 1 65 byte 1 0 align 1 LABELV $161 byte 1 77 byte 1 79 byte 1 68 byte 1 95 byte 1 83 byte 1 76 byte 1 73 byte 1 77 byte 1 69 byte 1 0 align 1 LABELV $160 byte 1 77 byte 1 79 byte 1 68 byte 1 95 byte 1 87 byte 1 65 byte 1 84 byte 1 69 byte 1 82 byte 1 0 align 1 LABELV $159 byte 1 77 byte 1 79 byte 1 68 byte 1 95 byte 1 66 byte 1 70 byte 1 71 byte 1 95 byte 1 83 byte 1 80 byte 1 76 byte 1 65 byte 1 83 byte 1 72 byte 1 0 align 1 LABELV $158 byte 1 77 byte 1 79 byte 1 68 byte 1 95 byte 1 66 byte 1 70 byte 1 71 byte 1 0 align 1 LABELV $157 byte 1 77 byte 1 79 byte 1 68 byte 1 95 byte 1 76 byte 1 73 byte 1 71 byte 1 72 byte 1 84 byte 1 78 byte 1 73 byte 1 78 byte 1 71 byte 1 0 align 1 LABELV $156 byte 1 77 byte 1 79 byte 1 68 byte 1 95 byte 1 82 byte 1 65 byte 1 73 byte 1 76 byte 1 71 byte 1 85 byte 1 78 byte 1 0 align 1 LABELV $155 byte 1 77 byte 1 79 byte 1 68 byte 1 95 byte 1 80 byte 1 76 byte 1 65 byte 1 83 byte 1 77 byte 1 65 byte 1 95 byte 1 83 byte 1 80 byte 1 76 byte 1 65 byte 1 83 byte 1 72 byte 1 0 align 1 LABELV $154 byte 1 77 byte 1 79 byte 1 68 byte 1 95 byte 1 80 byte 1 76 byte 1 65 byte 1 83 byte 1 77 byte 1 65 byte 1 0 align 1 LABELV $153 byte 1 77 byte 1 79 byte 1 68 byte 1 95 byte 1 82 byte 1 79 byte 1 67 byte 1 75 byte 1 69 byte 1 84 byte 1 95 byte 1 83 byte 1 80 byte 1 76 byte 1 65 byte 1 83 byte 1 72 byte 1 0 align 1 LABELV $152 byte 1 77 byte 1 79 byte 1 68 byte 1 95 byte 1 82 byte 1 79 byte 1 67 byte 1 75 byte 1 69 byte 1 84 byte 1 0 align 1 LABELV $151 byte 1 77 byte 1 79 byte 1 68 byte 1 95 byte 1 71 byte 1 82 byte 1 69 byte 1 78 byte 1 65 byte 1 68 byte 1 69 byte 1 95 byte 1 83 byte 1 80 byte 1 76 byte 1 65 byte 1 83 byte 1 72 byte 1 0 align 1 LABELV $150 byte 1 77 byte 1 79 byte 1 68 byte 1 95 byte 1 71 byte 1 82 byte 1 69 byte 1 78 byte 1 65 byte 1 68 byte 1 69 byte 1 0 align 1 LABELV $149 byte 1 77 byte 1 79 byte 1 68 byte 1 95 byte 1 77 byte 1 65 byte 1 67 byte 1 72 byte 1 73 byte 1 78 byte 1 69 byte 1 71 byte 1 85 byte 1 78 byte 1 0 align 1 LABELV $148 byte 1 77 byte 1 79 byte 1 68 byte 1 95 byte 1 71 byte 1 65 byte 1 85 byte 1 78 byte 1 84 byte 1 76 byte 1 69 byte 1 84 byte 1 0 align 1 LABELV $147 byte 1 77 byte 1 79 byte 1 68 byte 1 95 byte 1 83 byte 1 72 byte 1 79 byte 1 84 byte 1 71 byte 1 85 byte 1 78 byte 1 0 align 1 LABELV $146 byte 1 77 byte 1 79 byte 1 68 byte 1 95 byte 1 85 byte 1 78 byte 1 75 byte 1 78 byte 1 79 byte 1 87 byte 1 78 byte 1 0 align 1 LABELV $139 byte 1 107 byte 1 97 byte 1 109 byte 1 105 byte 1 107 byte 1 97 byte 1 122 byte 1 101 byte 1 32 byte 1 116 byte 1 105 byte 1 109 byte 1 101 byte 1 114 byte 1 0 align 1 LABELV $95 byte 1 66 byte 1 108 byte 1 117 byte 1 101 byte 1 32 byte 1 67 byte 1 117 byte 1 98 byte 1 101 byte 1 0 align 1 LABELV $94 byte 1 82 byte 1 101 byte 1 100 byte 1 32 byte 1 67 byte 1 117 byte 1 98 byte 1 101 byte 1 0
; A270012: Partial sums of the number of active (ON,black) cells in n-th stage of growth of two-dimensional cellular automaton defined by "Rule 7", based on the 5-celled von Neumann neighborhood. ; 1,10,10,59,59,180,180,405,405,766,766,1295,1295,2024,2024,2985,2985,4210,4210,5731,5731,7580,7580,9789,9789,12390,12390,15415,15415,18896,18896,22865,22865,27354,27354,32395,32395,38020,38020,44261,44261,51150,51150,58719,58719,67000,67000,76025,76025,85826,85826,96435,96435,107884,107884,120205,120205,133430,133430,147591,147591,162720,162720,178849,178849,196010,196010,214235,214235,233556,233556,254005,254005,275614,275614,298415,298415,322440,322440,347721,347721,374290,374290,402179,402179 lpb $0 mov $2,$0 sub $0,1 seq $2,270010 ; Number of active (ON,black) cells in n-th stage of growth of two-dimensional cellular automaton defined by "Rule 7", based on the 5-celled von Neumann neighborhood. add $1,$2 lpe add $1,1 mov $0,$1
// Copyright 2020 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "src/graphics/drivers/misc/goldfish/pipe_device.h" #include <fidl/fuchsia.hardware.goldfish/cpp/wire.h> #include <fidl/fuchsia.sysmem/cpp/wire.h> #include <fuchsia/hardware/goldfish/pipe/c/banjo.h> #include <fuchsia/hardware/sysmem/cpp/banjo-mock.h> #include <lib/async-loop/cpp/loop.h> #include <lib/ddk/platform-defs.h> #include <lib/fake-bti/bti.h> #include <lib/zx/channel.h> #include <lib/zx/vmar.h> #include <zircon/errors.h> #include <zircon/syscalls.h> #include <algorithm> #include <cstring> #include <memory> #include <set> #include <thread> #include <vector> #include <zxtest/zxtest.h> #include "src/devices/lib/acpi/mock/mock-acpi.h" #include "src/devices/testing/mock-ddk/mock-device.h" #include "src/graphics/drivers/misc/goldfish/goldfish-bind.h" namespace goldfish { using MockAcpiFidl = acpi::mock::Device; namespace { constexpr uint32_t kPipeMinDeviceVersion = 2; constexpr uint32_t kMaxSignalledPipes = 64; constexpr zx_device_prop_t kDefaultPipeDeviceProps[] = { {BIND_PLATFORM_DEV_VID, 0, PDEV_VID_GOOGLE}, {BIND_PLATFORM_DEV_PID, 0, PDEV_PID_GOLDFISH}, {BIND_PLATFORM_DEV_DID, 0, PDEV_DID_GOLDFISH_PIPE_CONTROL}, }; constexpr const char* kDefaultPipeDeviceName = "goldfish-pipe"; using fuchsia_sysmem::wire::HeapType; constexpr HeapType kSysmemHeaps[] = { HeapType::kSystemRam, HeapType::kGoldfishDeviceLocal, HeapType::kGoldfishHostVisible, }; // MMIO Registers of goldfish pipe. // The layout should match the register offsets defined in pipe_device.cc. struct Registers { uint32_t command; uint32_t signal_buffer_high; uint32_t signal_buffer_low; uint32_t signal_buffer_count; uint32_t reserved0[1]; uint32_t open_buffer_high; uint32_t open_buffer_low; uint32_t reserved1[2]; uint32_t version; uint32_t reserved2[3]; uint32_t get_signalled; void DebugPrint() const { printf( "Registers [ command %08x signal_buffer: %08x %08x count %08x open_buffer: %08x %08x " "version %08x get_signalled %08x ]\n", command, signal_buffer_high, signal_buffer_low, signal_buffer_count, open_buffer_high, open_buffer_low, version, get_signalled); } }; // A RAII memory mapping wrapper of VMO to memory. class VmoMapping { public: VmoMapping(const zx::vmo& vmo, size_t size, size_t offset = 0, zx_vm_option_t perm = ZX_VM_PERM_READ | ZX_VM_PERM_WRITE) : vmo_(vmo), size_(size), offset_(offset), perm_(perm) { map(); } ~VmoMapping() { unmap(); } void map() { if (!ptr_) { zx::vmar::root_self()->map(perm_, 0, vmo_, offset_, size_, reinterpret_cast<uintptr_t*>(&ptr_)); } } void unmap() { if (ptr_) { zx::vmar::root_self()->unmap(reinterpret_cast<uintptr_t>(ptr_), size_); ptr_ = nullptr; } } void* ptr() const { return ptr_; } private: const zx::vmo& vmo_; size_t size_ = 0u; size_t offset_ = 0u; zx_vm_option_t perm_ = 0; void* ptr_ = nullptr; }; } // namespace // Test suite creating fake PipeDevice on a mock ACPI bus. class PipeDeviceTest : public zxtest::Test { public: PipeDeviceTest() : async_loop_(&kAsyncLoopConfigNeverAttachToThread), fake_root_(MockDevice::FakeRootParent()) {} // |zxtest::Test| void SetUp() override { ASSERT_OK(async_loop_.StartThread("pipe-device-test-dispatcher")); ASSERT_OK(fake_bti_create(acpi_bti_.reset_and_get_address())); constexpr size_t kCtrlSize = 4096u; ASSERT_OK(zx::vmo::create(kCtrlSize, 0u, &vmo_control_)); zx::interrupt irq; ASSERT_OK(zx::interrupt::create(zx::resource(), 0u, ZX_INTERRUPT_VIRTUAL, &irq)); ASSERT_OK(irq.duplicate(ZX_RIGHT_SAME_RIGHTS, &irq_)); mock_acpi_fidl_.SetMapInterrupt( [this](acpi::mock::Device::MapInterruptRequestView rv, acpi::mock::Device::MapInterruptCompleter::Sync& completer) { zx::interrupt dupe; ASSERT_OK(zx::interrupt::create(zx::resource(), 0, ZX_INTERRUPT_VIRTUAL, &dupe)); ASSERT_OK(irq_.duplicate(ZX_RIGHT_SAME_RIGHTS, &dupe)); completer.ReplySuccess(std::move(dupe)); }); mock_acpi_fidl_.SetGetMmio([this](acpi::mock::Device::GetMmioRequestView rv, acpi::mock::Device::GetMmioCompleter::Sync& completer) { ASSERT_EQ(rv->index, 0); zx::vmo dupe; ASSERT_OK(vmo_control_.duplicate(ZX_RIGHT_SAME_RIGHTS, &dupe)); completer.ReplySuccess(fuchsia_mem::wire::Range{ .vmo = std::move(dupe), .offset = 0, .size = kCtrlSize, }); }); mock_acpi_fidl_.SetGetBti([this](acpi::mock::Device::GetBtiRequestView rv, acpi::mock::Device::GetBtiCompleter::Sync& completer) { ASSERT_EQ(rv->index, 0); zx::bti out_bti; ASSERT_OK(acpi_bti_.duplicate(ZX_RIGHT_SAME_RIGHTS, &out_bti)); completer.ReplySuccess(std::move(out_bti)); }); mock_sysmem_.mock_connect().ExpectCallWithMatcher([this](const zx::channel& connection) { zx_info_handle_basic_t info; connection.get_info(ZX_INFO_HANDLE_BASIC, &info, sizeof(info), nullptr, nullptr); sysmem_request_koid_ = info.koid; return ZX_OK; }); auto register_heap = [this](uint64_t heap, const zx::channel& connection) -> zx_status_t { if (sysmem_heap_request_koids_.find(heap) != sysmem_heap_request_koids_.end()) { return ZX_ERR_ALREADY_BOUND; } if (!connection.is_valid()) { return ZX_ERR_BAD_HANDLE; } zx_info_handle_basic_t info; connection.get_info(ZX_INFO_HANDLE_BASIC, &info, sizeof(info), nullptr, nullptr); sysmem_heap_request_koids_[heap] = info.koid; return ZX_OK; }; for (const auto heap : kSysmemHeaps) { uint64_t heap_id = static_cast<uint64_t>(heap); mock_sysmem_.mock_register_heap().ExpectCallWithMatcher( [register_heap, heap_id](uint64_t heap, const zx::channel& connection) { EXPECT_EQ(heap, heap_id); return register_heap(heap, connection); }); } auto acpi_client = mock_acpi_fidl_.CreateClient(async_loop_.dispatcher()); ASSERT_OK(acpi_client.status_value()); fake_root_->AddProtocol(ZX_PROTOCOL_ACPI, nullptr, nullptr, "acpi"); fake_root_->AddProtocol(ZX_PROTOCOL_SYSMEM, mock_sysmem_.GetProto()->ops, mock_sysmem_.GetProto()->ctx, "sysmem"); auto dut = std::make_unique<PipeDevice>(fake_root_.get(), std::move(acpi_client.value())); ASSERT_OK(dut->Bind()); dut_ = dut.release(); } // |zxtest::Test| void TearDown() override {} std::unique_ptr<VmoMapping> MapControlRegisters() const { return std::make_unique<VmoMapping>(vmo_control_, /*size=*/sizeof(Registers), /*offset=*/0); } template <typename T> static void Flush(const T* t) { zx_cache_flush(t, sizeof(T), ZX_CACHE_FLUSH_DATA | ZX_CACHE_FLUSH_INVALIDATE); } protected: ddk::MockSysmem mock_sysmem_; acpi::mock::Device mock_acpi_fidl_; async::Loop async_loop_; std::shared_ptr<MockDevice> fake_root_; PipeDevice* dut_; zx::bti acpi_bti_; zx::vmo vmo_control_; zx::interrupt irq_; zx_koid_t sysmem_request_koid_ = ZX_KOID_INVALID; std::map<uint64_t, zx_koid_t> sysmem_heap_request_koids_; }; TEST_F(PipeDeviceTest, Bind) { { auto mapped = MapControlRegisters(); Registers* ctrl_regs = reinterpret_cast<Registers*>(mapped->ptr()); ctrl_regs->version = kPipeMinDeviceVersion; } { auto mapped = MapControlRegisters(); Registers* ctrl_regs = reinterpret_cast<Registers*>(mapped->ptr()); Flush(ctrl_regs); zx_paddr_t signal_buffer = (static_cast<uint64_t>(ctrl_regs->signal_buffer_high) << 32u) | (ctrl_regs->signal_buffer_low); ASSERT_NE(signal_buffer, 0u); uint32_t buffer_count = ctrl_regs->signal_buffer_count; ASSERT_EQ(buffer_count, kMaxSignalledPipes); zx_paddr_t open_buffer = (static_cast<uint64_t>(ctrl_regs->open_buffer_high) << 32u) | (ctrl_regs->open_buffer_low); ASSERT_NE(open_buffer, 0u); } } TEST_F(PipeDeviceTest, Open) { auto dut_child_ptr = std::make_unique<PipeChildDevice>(dut_); ASSERT_OK(dut_child_ptr->Bind(kDefaultPipeDeviceProps, kDefaultPipeDeviceName)); auto dut_child_ = dut_child_ptr.release(); zx_device_t* instance_dev; ASSERT_OK(dut_child_->DdkOpen(&instance_dev, 0u)); ASSERT_EQ(1, fake_root_->child_count()); auto child = fake_root_->GetLatestChild(); ASSERT_EQ(1, child->child_count()); } TEST_F(PipeDeviceTest, CreatePipe) { auto dut_child_ptr = std::make_unique<PipeChildDevice>(dut_); ASSERT_OK(dut_child_ptr->Bind(kDefaultPipeDeviceProps, kDefaultPipeDeviceName)); auto dut_child_ = dut_child_ptr.release(); int32_t id; zx::vmo vmo; ASSERT_OK(dut_child_->GoldfishPipeCreate(&id, &vmo)); ASSERT_NE(id, 0u); ASSERT_TRUE(vmo.is_valid()); dut_child_->GoldfishPipeDestroy(id); } TEST_F(PipeDeviceTest, CreatePipeMultiThreading) { auto dut_child_ptr = std::make_unique<PipeChildDevice>(dut_); ASSERT_OK(dut_child_ptr->Bind(kDefaultPipeDeviceProps, kDefaultPipeDeviceName)); auto dut_child_ = dut_child_ptr.release(); auto create_pipe = [dut_child_](size_t num_pipes, std::vector<int32_t>* ids) { for (size_t i = 0; i < num_pipes; i++) { int32_t id; zx::vmo vmo; dut_child_->GoldfishPipeCreate(&id, &vmo); ids->push_back(id); } }; std::vector<int32_t> ids_1, ids_2; constexpr size_t kNumPipesPerThread = 1000u; std::thread create_pipe_thread_1( [create_pipe, ids = &ids_1]() { create_pipe(kNumPipesPerThread, ids); }); std::thread create_pipe_thread_2( [create_pipe, ids = &ids_2]() { create_pipe(kNumPipesPerThread, ids); }); create_pipe_thread_1.join(); create_pipe_thread_2.join(); std::vector<int32_t> set_intersect, set_union; std::set_intersection(ids_1.begin(), ids_1.end(), ids_2.begin(), ids_2.end(), std::back_inserter(set_intersect)); std::set_union(ids_1.begin(), ids_1.end(), ids_2.begin(), ids_2.end(), std::back_inserter(set_union)); ASSERT_EQ(set_intersect.size(), 0u); ASSERT_EQ(set_union.size(), 2 * kNumPipesPerThread); } TEST_F(PipeDeviceTest, Exec) { auto dut_child_ptr = std::make_unique<PipeChildDevice>(dut_); ASSERT_OK(dut_child_ptr->Bind(kDefaultPipeDeviceProps, kDefaultPipeDeviceName)); auto dut_child_ = dut_child_ptr.release(); int32_t id; zx::vmo vmo; ASSERT_OK(dut_child_->GoldfishPipeCreate(&id, &vmo)); ASSERT_NE(id, 0u); ASSERT_TRUE(vmo.is_valid()); dut_child_->GoldfishPipeExec(id); { auto mapped = MapControlRegisters(); Registers* ctrl_regs = reinterpret_cast<Registers*>(mapped->ptr()); ASSERT_EQ(ctrl_regs->command, static_cast<uint32_t>(id)); } dut_child_->GoldfishPipeDestroy(id); } TEST_F(PipeDeviceTest, TransferObservedSignals) { auto dut_child_ptr = std::make_unique<PipeChildDevice>(dut_); ASSERT_OK(dut_child_ptr->Bind(kDefaultPipeDeviceProps, kDefaultPipeDeviceName)); auto dut_child_ = dut_child_ptr.release(); int32_t id; zx::vmo vmo; ASSERT_OK(dut_child_->GoldfishPipeCreate(&id, &vmo)); zx::event old_event, old_event_dup; ASSERT_OK(zx::event::create(0u, &old_event)); ASSERT_OK(old_event.duplicate(ZX_RIGHT_SAME_RIGHTS, &old_event_dup)); ASSERT_OK(dut_child_->GoldfishPipeSetEvent(id, std::move(old_event_dup))); // Trigger signals on "old" event. old_event.signal(0u, fuchsia_hardware_goldfish::wire::kSignalReadable); zx::event new_event, new_event_dup; ASSERT_OK(zx::event::create(0u, &new_event)); // Clear the target signal. ASSERT_OK(new_event.signal(fuchsia_hardware_goldfish::wire::kSignalReadable, 0u)); ASSERT_OK(new_event.duplicate(ZX_RIGHT_SAME_RIGHTS, &new_event_dup)); ASSERT_OK(dut_child_->GoldfishPipeSetEvent(id, std::move(new_event_dup))); // Wait for `SIGNAL_READABLE` signal on the new event. zx_signals_t observed; ASSERT_OK(new_event.wait_one(fuchsia_hardware_goldfish::wire::kSignalReadable, zx::time::infinite_past(), &observed)); } TEST_F(PipeDeviceTest, GetBti) { auto dut_child_ptr = std::make_unique<PipeChildDevice>(dut_); ASSERT_OK(dut_child_ptr->Bind(kDefaultPipeDeviceProps, kDefaultPipeDeviceName)); auto dut_child_ = dut_child_ptr.release(); zx::bti bti; ASSERT_OK(dut_child_->GoldfishPipeGetBti(&bti)); zx_info_bti_t goldfish_bti_info, acpi_bti_info; ASSERT_OK( bti.get_info(ZX_INFO_BTI, &goldfish_bti_info, sizeof(goldfish_bti_info), nullptr, nullptr)); ASSERT_OK( acpi_bti_.get_info(ZX_INFO_BTI, &acpi_bti_info, sizeof(acpi_bti_info), nullptr, nullptr)); ASSERT_FALSE(memcmp(&goldfish_bti_info, &acpi_bti_info, sizeof(zx_info_bti_t))); } TEST_F(PipeDeviceTest, ConnectToSysmem) { auto dut_child_ptr = std::make_unique<PipeChildDevice>(dut_); ASSERT_OK(dut_child_ptr->Bind(kDefaultPipeDeviceProps, kDefaultPipeDeviceName)); auto dut_child_ = dut_child_ptr.release(); zx::channel sysmem_server, sysmem_client; zx_koid_t server_koid = ZX_KOID_INVALID; ASSERT_OK(zx::channel::create(0u, &sysmem_server, &sysmem_client)); zx_info_handle_basic_t info; ASSERT_OK(sysmem_server.get_info(ZX_INFO_HANDLE_BASIC, &info, sizeof(info), nullptr, nullptr)); server_koid = info.koid; ASSERT_OK(dut_child_->GoldfishPipeConnectSysmem(std::move(sysmem_server))); ASSERT_NE(sysmem_request_koid_, ZX_KOID_INVALID); ASSERT_EQ(sysmem_request_koid_, server_koid); for (const auto& heap : kSysmemHeaps) { zx::channel heap_server, heap_client; zx_koid_t server_koid = ZX_KOID_INVALID; ASSERT_OK(zx::channel::create(0u, &heap_server, &heap_client)); zx_info_handle_basic_t info; ASSERT_OK(heap_server.get_info(ZX_INFO_HANDLE_BASIC, &info, sizeof(info), nullptr, nullptr)); server_koid = info.koid; uint64_t heap_id = static_cast<uint64_t>(heap); ASSERT_OK(dut_child_->GoldfishPipeRegisterSysmemHeap(heap_id, std::move(heap_server))); ASSERT_TRUE(sysmem_heap_request_koids_.find(heap_id) != sysmem_heap_request_koids_.end()); ASSERT_NE(sysmem_heap_request_koids_.at(heap_id), ZX_KOID_INVALID); ASSERT_EQ(sysmem_heap_request_koids_.at(heap_id), server_koid); } } TEST_F(PipeDeviceTest, ChildDevice) { // Test creating multiple child devices. Each child device can access the // GoldfishPipe banjo protocol, and they should share the same parent device. auto child1 = std::make_unique<PipeChildDevice>(dut_); auto child2 = std::make_unique<PipeChildDevice>(dut_); constexpr zx_device_prop_t kPropsChild1[] = { {BIND_PLATFORM_DEV_VID, 0, PDEV_VID_GOOGLE}, {BIND_PLATFORM_DEV_PID, 0, PDEV_PID_GOLDFISH}, {BIND_PLATFORM_DEV_DID, 0, 0x01}, }; constexpr const char* kDeviceNameChild1 = "goldfish-pipe-child1"; ASSERT_OK(child1->Bind(kPropsChild1, kDeviceNameChild1)); child1.release(); constexpr zx_device_prop_t kPropsChild2[] = { {BIND_PLATFORM_DEV_VID, 0, PDEV_VID_GOOGLE}, {BIND_PLATFORM_DEV_PID, 0, PDEV_PID_GOLDFISH}, {BIND_PLATFORM_DEV_DID, 0, 0x02}, }; constexpr const char* kDeviceNameChild2 = "goldfish-pipe-child2"; ASSERT_OK(child2->Bind(kPropsChild2, kDeviceNameChild2)); child2.release(); auto dut_child_ptr = std::make_unique<PipeChildDevice>(dut_); int32_t id1 = 0u; zx::vmo vmo1; ASSERT_OK(dut_child_ptr->GoldfishPipeCreate(&id1, &vmo1)); ASSERT_NE(id1, 0); int32_t id2 = 0u; zx::vmo vmo2; ASSERT_OK(dut_child_ptr->GoldfishPipeCreate(&id2, &vmo2)); ASSERT_NE(id2, 0); ASSERT_NE(id1, id2); } } // namespace goldfish
; A312933: Coordination sequence Gal.6.131.3 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings. ; 1,4,9,13,18,22,27,32,36,41,45,50,54,58,63,67,72,76,81,86,90,95,99,104,108,112,117,121,126,130,135,140,144,149,153,158,162,166,171,175,180,184,189,194,198,203,207,212,216,220 mov $2,$0 add $2,1 mov $5,$0 lpb $2 mov $0,$5 sub $2,1 sub $0,$2 mov $3,$0 mov $6,$0 lpb $0 div $3,2 mov $4,$0 add $6,$0 add $0,4 pow $3,2 sub $3,$0 pow $4,2 add $4,2 sub $4,$6 sub $3,$4 add $3,1 div $3,3 gcd $3,2 mov $0,$3 mov $6,2 lpe add $0,$6 mov $6,$0 add $6,1 add $1,$6 lpe
/** * Copyright 2020 Huawei Technologies Co., Ltd * * 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. */ #include "src/runtime/kernel/opencl/kernel/arithmetic.h" #include <set> #include <vector> #include <string> #include "schema/model_generated.h" #include "src/kernel_registry.h" #include "src/runtime/kernel/opencl/utils.h" #ifndef PROGRAM_WITH_IL #include "src/runtime/kernel/opencl/cl/fp32/arithmetic_buffer.cl.inc" #include "src/runtime/kernel/opencl/cl/fp32/arithmetic_image2d.cl.inc" #endif using mindspore::kernel::KERNEL_ARCH::kGPU; using mindspore::lite::KernelRegistrar; namespace mindspore::kernel { std::vector<size_t> ArithmeticOpenCLKernel::InitGlobalSize() const { const size_t global_x = out_tensors_[0]->Width(); const size_t global_y = out_tensors_[0]->Height(); const size_t global_z = UP_ROUND_DIV(out_tensors_[0]->Channel(), 4); std::vector<size_t> global = {global_x, global_y, global_z}; return global; } void ArithmeticOpenCLKernel::Image2dGetWorkGroupSize() { size_t H = out_tensors_[0]->Batch() * out_tensors_[0]->Height(); size_t W = out_tensors_[0]->Width() * UP_DIV(out_tensors_[0]->Channel(), C4NUM); local_size_ = {16, 16}; global_size_ = {W, H}; } void ArithmeticOpenCLKernel::BufferGetWorkGroupSize() { uint32_t element_num = out_tensors_[0]->ElementsC4Num(); global_size_ = {element_num}; } int ArithmeticOpenCLKernel::GetImageSize(size_t idx, std::vector<size_t> *img_size) { size_t CO4 = UP_DIV(out_tensors_[0]->Channel(), C4NUM); int H = out_tensors_[0]->Batch() * out_tensors_[0]->Height(); int W = out_tensors_[0]->Width() * CO4; size_t im_dst_x, im_dst_y; if (in_tensors_[0]->GetFormat() == schema::Format_NHWC4) { im_dst_x = W; im_dst_y = H; } else { im_dst_y = out_tensors_[0]->Batch() * out_tensors_[0]->Height() * CO4; im_dst_x = out_tensors_[0]->Width(); } #ifdef ENABLE_FP16 size_t img_dtype = CL_HALF_FLOAT; #else size_t img_dtype = CL_FLOAT; #endif img_size->clear(); std::vector<size_t> vec{im_dst_x, im_dst_y, img_dtype}; *img_size = vec; return 0; } int ArithmeticOpenCLKernel::Init() { runtime_ = lite::opencl::OpenCLRuntime::GetInstance(); std::string kernel_name; if (in_tensors_[1]->TensorType() == schema::NodeType_ValueNode && in_tensors_[1]->Data() != nullptr) { element_flag_ = false; kernel_name = "BoardcastArith"; } else { element_flag_ = true; switch (op_parameter_->type_) { case PrimitiveType_Mul: kernel_name = "ElementMul"; break; case PrimitiveType_Add: kernel_name = "ElementAdd"; break; case PrimitiveType_Sub: kernel_name = "ElementSub"; break; case PrimitiveType_Div: kernel_name = "ElementDiv"; break; default: MS_LOG(ERROR) << "Error Operator type " << op_parameter_->type_; break; } } #ifdef PROGRAM_WITH_IL runtime_->CreateKernelFromIL(kernel_(), kernel_name); #else std::string program_name = "Arithmetic"; std::set<std::string> build_options; std::string source = arithmetic_image2d_source_fp32; runtime_->LoadSource(program_name, source); runtime_->BuildKernel(kernel_, program_name, kernel_name, build_options); #endif ori_format_ = out_tensors_[0]->GetFormat(); out_tensors_[0]->SetFormat(schema::Format_NHWC4); Image2dGetWorkGroupSize(); return 0; } int ArithmeticOpenCLKernel::Run() { MS_LOG(DEBUG) << this->name() << " Running!"; auto ocl_runtime = lite::opencl::OpenCLRuntime::GetInstance(); uint32_t element_num = out_tensors_[0]->ElementsC4Num(); int arg_idx = 0; ocl_runtime->SetKernelArg(kernel_, arg_idx++, in_tensors_[0]->Data()); if (element_flag_) { runtime_->SetKernelArg(kernel_, arg_idx++, in_tensors_[1]->Data()); } else { float value = static_cast<float *>(in_tensors_[1]->Data())[0]; switch (op_parameter_->type_) { case PrimitiveType_Mul: weight_ = value; break; case PrimitiveType_Add: bias_ = value; break; case PrimitiveType_Sub: bias_ = -1 * value; break; case PrimitiveType_Div: weight_ = 1 / value; break; default: MS_LOG(ERROR) << "Error Operator type " << op_parameter_->type_; break; } ocl_runtime->SetKernelArg(kernel_, arg_idx++, weight_); ocl_runtime->SetKernelArg(kernel_, arg_idx++, bias_); } ocl_runtime->SetKernelArg(kernel_, arg_idx++, out_tensors_[0]->Data()); int H = out_tensors_[0]->Batch() * out_tensors_[0]->Height(); int W = out_tensors_[0]->Width() * UP_DIV(out_tensors_[0]->Channel(), C4NUM); cl_int2 output_shape{W, H}; ocl_runtime->SetKernelArg(kernel_, arg_idx++, output_shape); ocl_runtime->RunKernel(kernel_, global_size_, local_size_, nullptr); return 0; } kernel::LiteKernel *OpenCLArithmeticKernelCreator(const std::vector<lite::tensor::Tensor *> &inputs, const std::vector<lite::tensor::Tensor *> &outputs, OpParameter *opParameter, const lite::Context *ctx, const kernel::KernelKey &desc, const lite::Primitive *primitive) { auto *kernel = new (std::nothrow) ArithmeticOpenCLKernel(reinterpret_cast<OpParameter *>(opParameter), inputs, outputs, ctx); if (kernel == nullptr) { MS_LOG(ERROR) << "Create OpenCL Arithmetic kernel failed!"; return nullptr; } auto ret = kernel->Init(); if (0 != ret) { MS_LOG(ERROR) << "Init kernel failed, name: Arithmetic"; delete kernel; return nullptr; } return kernel; } REG_KERNEL(kGPU, kNumberTypeFloat32, PrimitiveType_Mul, OpenCLArithmeticKernelCreator) REG_KERNEL(kGPU, kNumberTypeFloat32, PrimitiveType_Add, OpenCLArithmeticKernelCreator) REG_KERNEL(kGPU, kNumberTypeFloat32, PrimitiveType_Sub, OpenCLArithmeticKernelCreator) REG_KERNEL(kGPU, kNumberTypeFloat32, PrimitiveType_Div, OpenCLArithmeticKernelCreator) } // namespace mindspore::kernel
/*************************************************************************/ /* resource_import.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ /* */ /* 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. */ /*************************************************************************/ #include "resource_import.h" #include "os/os.h" #include "variant_parser.h" Error ResourceFormatImporter::_get_path_and_type(const String &p_path, PathAndType &r_path_and_type) const { Error err; FileAccess *f = FileAccess::open(p_path + ".import", FileAccess::READ, &err); if (!f) return err; VariantParser::StreamFile stream; stream.f = f; String assign; Variant value; VariantParser::Tag next_tag; int lines = 0; String error_text; while (true) { assign = Variant(); next_tag.fields.clear(); next_tag.name = String(); err = VariantParser::parse_tag_assign_eof(&stream, lines, error_text, next_tag, assign, value, NULL, true); if (err == ERR_FILE_EOF) { memdelete(f); return OK; } else if (err != OK) { ERR_PRINTS("ResourceFormatImporter::load - " + p_path + ".import:" + itos(lines) + " error: " + error_text); memdelete(f); return err; } if (assign != String()) { if (assign.begins_with("path.") && r_path_and_type.path == String()) { String feature = assign.get_slicec('.', 1); if (OS::get_singleton()->check_feature_support(feature)) { r_path_and_type.path = value; } } else if (assign == "path") { r_path_and_type.path = value; } else if (assign == "type") { r_path_and_type.type = value; } } else if (next_tag.name != "remap") { break; } } memdelete(f); if (r_path_and_type.path == String() || r_path_and_type.type == String()) { return ERR_FILE_CORRUPT; } return OK; } RES ResourceFormatImporter::load(const String &p_path, const String &p_original_path, Error *r_error) { PathAndType pat; Error err = _get_path_and_type(p_path, pat); if (err != OK) { if (r_error) *r_error = err; return RES(); } RES res = ResourceLoader::load(pat.path, pat.type, false, r_error); #ifdef TOOLS_ENABLED if (res.is_valid()) { res->set_import_last_modified_time(res->get_last_modified_time()); //pass this, if used res->set_import_path(pat.path); } #endif return res; } void ResourceFormatImporter::get_recognized_extensions(List<String> *p_extensions) const { Set<String> found; for (Set<Ref<ResourceImporter> >::Element *E = importers.front(); E; E = E->next()) { List<String> local_exts; E->get()->get_recognized_extensions(&local_exts); for (List<String>::Element *F = local_exts.front(); F; F = F->next()) { if (!found.has(F->get())) { p_extensions->push_back(F->get()); found.insert(F->get()); } } } } void ResourceFormatImporter::get_recognized_extensions_for_type(const String &p_type, List<String> *p_extensions) const { if (p_type == "") { return get_recognized_extensions(p_extensions); } Set<String> found; for (Set<Ref<ResourceImporter> >::Element *E = importers.front(); E; E = E->next()) { String res_type = E->get()->get_resource_type(); if (res_type == String()) continue; if (!ClassDB::is_parent_class(res_type, p_type)) continue; List<String> local_exts; E->get()->get_recognized_extensions(&local_exts); for (List<String>::Element *F = local_exts.front(); F; F = F->next()) { if (!found.has(F->get())) { p_extensions->push_back(F->get()); found.insert(F->get()); } } } } bool ResourceFormatImporter::recognize_path(const String &p_path, const String &p_for_type) const { return FileAccess::exists(p_path + ".import"); } bool ResourceFormatImporter::can_be_imported(const String &p_path) const { return ResourceFormatLoader::recognize_path(p_path); } bool ResourceFormatImporter::handles_type(const String &p_type) const { for (Set<Ref<ResourceImporter> >::Element *E = importers.front(); E; E = E->next()) { String res_type = E->get()->get_resource_type(); if (res_type == String()) continue; if (ClassDB::is_parent_class(res_type, p_type)) return true; } return true; } String ResourceFormatImporter::get_internal_resource_path(const String &p_path) const { PathAndType pat; Error err = _get_path_and_type(p_path, pat); if (err != OK) { return String(); } return pat.path; } String ResourceFormatImporter::get_resource_type(const String &p_path) const { PathAndType pat; Error err = _get_path_and_type(p_path, pat); if (err != OK) { return ""; } return pat.type; } void ResourceFormatImporter::get_dependencies(const String &p_path, List<String> *p_dependencies, bool p_add_types) { PathAndType pat; Error err = _get_path_and_type(p_path, pat); if (err != OK) { return; } return ResourceLoader::get_dependencies(pat.path, p_dependencies, p_add_types); } Ref<ResourceImporter> ResourceFormatImporter::get_importer_by_name(const String &p_name) { for (Set<Ref<ResourceImporter> >::Element *E = importers.front(); E; E = E->next()) { if (E->get()->get_importer_name() == p_name) { return E->get(); } } return Ref<ResourceImporter>(); } void ResourceFormatImporter::get_importers_for_extension(const String &p_extension, List<Ref<ResourceImporter> > *r_importers) { for (Set<Ref<ResourceImporter> >::Element *E = importers.front(); E; E = E->next()) { List<String> local_exts; E->get()->get_recognized_extensions(&local_exts); for (List<String>::Element *F = local_exts.front(); F; F = F->next()) { if (p_extension.to_lower() == F->get()) { r_importers->push_back(E->get()); } } } } Ref<ResourceImporter> ResourceFormatImporter::get_importer_by_extension(const String &p_extension) { Ref<ResourceImporter> importer; float priority = 0; for (Set<Ref<ResourceImporter> >::Element *E = importers.front(); E; E = E->next()) { List<String> local_exts; E->get()->get_recognized_extensions(&local_exts); for (List<String>::Element *F = local_exts.front(); F; F = F->next()) { if (p_extension.to_lower() == F->get() && E->get()->get_priority() > priority) { importer = E->get(); priority = E->get()->get_priority(); } } } return importer; } String ResourceFormatImporter::get_import_base_path(const String &p_for_file) const { return "res://.import/" + p_for_file.get_file() + "-" + p_for_file.md5_text(); } ResourceFormatImporter *ResourceFormatImporter::singleton = NULL; ResourceFormatImporter::ResourceFormatImporter() { singleton = this; }
; QD Driver sample - just remove control codes 1998 Jochen Merz section program include win1_keys_err include win1_keys_qdos_io include win1_keys_qdos_sms bra.s start dc.w 0,0 dc.w $4afb,9,'QD driver ' start move.w (sp),d0 subq.w #2,d0 ; right number of params bne.s die ; no, die move.l 2(sp),a4 ; input pipe move.l 6(sp),a5 ; output pipe loop bsr.s fetch_byte cmp.b #1,d1 ; start of code? bne.s send_it ; insert here any kind of control code handling skip_code bsr.s fetch_byte cmp.b #2,d1 bne.s skip_code bra.s loop send_it bsr.s send_byte bra.s loop die moveq #0,d3 moveq #sms.frjb,d0 moveq #-1,d1 trap #do.sms2 ; commit suicide fetch_byte move.l a4,a0 moveq #iob.fbyt,d0 moveq #-1,d3 trap #do.io ; fetch byte tst.l d0 bne.s die ; failed, die rts send_byte move.l a5,a0 moveq #iob.sbyt,d0 trap #do.io tst.l d0 bne.s die rts end
.data .text main: addi $a1, $zero, 50 addi $a2, $zero, 19 jal addNumbers li $v0, 1 addi $a0, $v1, 0 syscall #Tell the system that the program is done. li $v0, 10 syscall addNumbers: add $v1, $a1, $a2 jr $ra
INCLUDE "graphics/grafix.inc" PUBLIC xorpixel EXTERN pixeladdress EXTERN coords ; ; $Id: xorpixl.asm,v 1.6 2015/01/19 01:32:47 pauloscustodio Exp $ ; ; ****************************************************************** ; ; Plot pixel at (x,y) coordinate. ; ; Design & programming by Gunther Strube, Copyright (C) InterLogic 1995 ; ; The (0,0) origin is placed at the bottom left corner. ; ; in: hl = (x,y) coordinate of pixel (h,l) ; ; registers changed after return: ; ..bc..../ixiy same ; af..dehl/.... different ; ; ****************************************************************** ; ; XOR added by Stefano Bodrato (Feb 2001) ; ; ************** ; .xorpixel IF maxx <> 256 ld a,h cp maxx ret nc ENDIF ld a,l cp maxy ret nc ; y0 out of range ld (coords),hl push bc call pixeladdress ld b,a ld a,1 jr z, xor_pixel ; pixel is at bit 0... .plot_position rlca djnz plot_position .xor_pixel ex de,hl xor (hl) ld (hl),a pop bc ret
<% from pwnlib.shellcraft.arm.linux import syscall %> <%page args="file, buf"/> <%docstring> Invokes the syscall stat64. See 'man 2 stat64' for more information. Arguments: file(char): file buf(stat64): buf </%docstring> ${syscall('SYS_stat64', file, buf)}
; ; Read character from console - don't wait ; ; ; int getk() ; ; djm 17/4/2000 ; On an nc100 we have to test for "yellow" ; ; $Id: getk.asm,v 1.2 2001/04/13 14:13:59 stefano Exp $ ; XLIB getk XREF cleanup ;in crt0 .getk call $B9B3 ;kmreadchar ld hl,0 ret nc ;no key pressed ld l,c ld h,b ld a,b and a ret z ;no token sub 2 ret nz ;not b=2 ld a,c cp $FC ret nz ; We've got here so we have just received escape so check yellow push hl ;keep this in case call $B8d2 ;kmgetyellow pop hl ;get it back ret nc ;no yellow jp cleanup ;was yellow so outta here
.global s_prepare_buffers s_prepare_buffers: push %r11 push %rbp push %rcx push %rdi push %rsi lea addresses_WC_ht+0x1de39, %rsi lea addresses_WT_ht+0x19b0f, %rdi cmp %rbp, %rbp mov $55, %rcx rep movsl nop nop nop dec %r11 pop %rsi pop %rdi pop %rcx pop %rbp pop %r11 ret .global s_faulty_load s_faulty_load: push %r14 push %r8 push %rbx push %rdi push %rsi // Faulty Load lea addresses_PSE+0x1cf93, %r8 and $48279, %r14 vmovaps (%r8), %ymm4 vextracti128 $0, %ymm4, %xmm4 vpextrq $1, %xmm4, %rdi lea oracles, %r8 and $0xff, %rdi shlq $12, %rdi mov (%r8,%rdi,1), %rdi pop %rsi pop %rdi pop %rbx pop %r8 pop %r14 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_PSE', 'same': False, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_PSE', 'same': True, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM'} {'00': 2308} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */