max_stars_repo_path
stringlengths
4
261
max_stars_repo_name
stringlengths
6
106
max_stars_count
int64
0
38.8k
id
stringlengths
1
6
text
stringlengths
7
1.05M
nouse_CollatzProof.agda
righ1113/collatzProof
1
2146
<filename>nouse_CollatzProof.agda module nouse_CollatzProof where open import Data.Nat -- 偽 data ⊥ : Set where -- 真 record ⊤ : Set where -- 選言 data _∨_ (P Q : Set) : Set where ∨Intro1 : P → P ∨ Q ∨Intro2 : Q → P ∨ Q ∨Elim : {P Q R : Set} → P ∨ Q → (P → R) → (Q → R) → R ∨Elim (∨Intro1 a) prfP _ = prfP a ∨Elim (∨Intro2 b) _ prfQ = prfQ b -- 否定 ¬ : Set → Set ¬ p = p → ⊥ ⊥Elim : {P : Set} → ⊥ → P ⊥Elim () postulate LEM : (P : Set) → (P ∨ ¬ P) smaller : ℕ → Set -- n:左端からの連続するビット1 -- k+2で小さくならない→k+1で小さくならない lemma1-3 : (k : ℕ) → ¬ (smaller (suc (suc k))) → ¬ (smaller (suc k)) lemma2 : smaller 0 -- evenは小さくなる lemma3 : smaller 1 -- 4x+1は小さくなる -- 二重否定除去 DNE1 : {p : Set} → p → ¬ (¬ p) DNE1 p q = q p DNE2 : {p : Set} → ¬ (¬ p) → p DNE2 {p0} p1 = ∨Elim (LEM p0) (λ y → y) (λ z → ⊥Elim (p1 z)) -- 対偶 contraposition : {A B : Set} → (A → B) → (¬ B → ¬ A) contraposition = λ f g x → g (f x) contraposition2 : {A B : Set} → (¬ B → ¬ A) → (A → B) contraposition2 p a = let t = (contraposition p) (DNE1 a) in DNE2 t -- 本論 -- n:最下位からの連続するビット1 proof : (n : ℕ) → smaller n proof zero = lemma2 -- even proof (suc zero) = lemma3 -- 4x+1 proof (suc (suc n)) = part n (proof (suc n)) where -- (k+2で小さくならない→k+1で小さくならない)→(k+1で小さくなる→k+2で小さくなる) part : (k : ℕ) → smaller (suc k) → smaller (suc (suc k)) part k = contraposition2 (lemma1-3 k)
80_lllf.asm
feilipu/LLL-Floating-Point
8
174060
<filename>80_lllf.asm ; original LLL code restored <NAME> Feb 2015 ; ; original LLL code from "Floating Point Package for ; Intel 8008 and 8080 Microprocessors" by Maples Oct 24 1975 ; URCL-51940 publication from Lawrence Livermore Laboratory ; 171286.PDF ; ; fixes: ; 0) many lines had space in column 1! labels become operands! ; 1) added LLL square root routine ; 2) added missing "CALL SIGN" in CVRT routine ; 3) replaced ERR routine with one from LLL document ; 4) commented out "ORA A" at end of SAVEN ; ; ###S ; MODIFIED BY <NAME> FOR NON-MACRO ASSEMBLER ; CHANGES WITHIN ;###S AND ;###E LINES ; ALL ORIGINAL CODE RETAINED AS COMMENTS ; ###E ; ; //// FLOATING POINT PACKAGE FOR THE MCS8 ; //// BY <NAME> ; //// MODIFIED BY <NAME> 9/6/74 ; //// MODIFIED FOR 24 BIT MANTISSAS ; //// PLUS ADDED I/O CONVERSION ROUTINES ; //// MODIFIED BY <NAME> 6/28/75 ; ; ; Modified to run on the RC2014 and the YAZ180 by ; <NAME> @feilipu https://feilipu.me ; February / March 2017 ; MINCH .EQU 300Q ;MINIMUM CHARACTERISTIC WITH SIGN EXTENDED MAXCH .EQU 077Q ;MAXIMUM CHARACTERISTIC WITH SIGN EXTENDED ; ; ;****************************************************** ; //// RC2014 & YAZ180 DEFINES ;****************************************************** ; ; RC2014 and YAZ180 have TX0 and RX0 and RX0_CHK located at RST jumps. ; ;TXA RST 1 ;EXPECTS CHARACTER TO TX IN A, BLOCKING ;RXA RST 2 ;RETURN RX CHARACTER IN A, BLOCKING ;RXA_CHK RST 3 ;IMMEDIATELY RETURNS AVAILABLE RX CHARACTERS IN A ; CR .EQU 0DH ;CARRIAGE RETURN LF .EQU 0AH ;LINEFEED ; ; ;****************************************************** ; //// SIMPLE EXERCISE PROGRAM ;****************************************************** ; ; SCRPG .EQU 28H ;SCRATCH PAGE IS 2800H OP1 .EQU 00H ;STARTING LOCATION OF OPERAND 1 OP2 .EQU OP1+4 ;STARTING LOCATION OF OPERAND 2 RSULT .EQU OP2+4 ;STARTING LOCATION OF RESULT SCR .EQU RSULT+4 ;STARTING LOCATION OF SCRATCH AREA .ORG 3000H ;ORIGIN FOR RC2014 AND YAZ180 DURING TESTING TEST: LXI H, HELLO ;LOAD HL ADDRESS OF HELLO CALL PRINT ;PRINT IT MVI H, SCRPG ;SET H REGISTER TO RAM SCRATCH PAGE MVI L, OP1 ;POINTER TO OPERAND 1 MVI C, SCR ;SCRATCH AREA CALL INPUT ;INPUT OPERAND 1 FROM TTY ;EXAMPLE CODE - TWO OPERAND INPUT ; MVI H, SCRPG ;SET H REGISTER TO RAM SCRATCH PAGE ; MVI L, OP2 ;POINTER TO OPERAND 2 ; MVI C, SCR ;SCRATCH AREA ; CALL INPUT ;INPUT OPERAND 2 FROM TTY ; MVI L, OP1 ;OPERAND 1 POINTER IN (H)L ; MVI B, OP2 ;OPERAND 2 POINTER IN (H)B ; MVI C, RSULT ;RESULT TO (H)C POINTER ; CALL LDIV ;DIVIDE OP1 BY OP2 AND PLACE RESULT IN RSULT ; CALL LMUL ;MULTIPLY OP1 BY OP2 AND PLACE RESULT IN RSULT ;EXAMPLE CODE - ONE OPERAND INPUT MVI L, OP1 ;OPERAND 1 POINTER IN (H)L MVI B, RSULT ;RESULT TO (H)B POINTER MVI C, SCR ;SCRATCH AREA CALL DSQRT ;SQUARE ROOT OF OP1 AND PLACE RESULT IN RSULT ;EXAMPLE CODE - OUTPUT MVI L, RSULT ;(H)L POINTER NOW RSULT MVI C, SCR ;SCRATCH AREA CALL CVRT ;OUTPUT NUMBER STARTING IN LOCATION RSULT TO TTY JMP TEST ;START AGAIN HELLO: .BYTE CR,LF .BYTE "LLL Float ",0 ; ; ;****************************************************** ; //// OUTPUT SUBROUTINES ;****************************************************** ; ; OUTR OUTPUT FROM CVRT INTO TX0 OUTPUT BUFFER ; ALL REG'S MAINTAINED ; OUTR: ANI 7FH ;CLEAR HIGH BIT RST 1 ;OUTPUT THE CHARACTER TO TXA RET PRINT: MOV A, M ;Get character from HL ORA A ;Is it $00 ? RZ ;Then RETurn on terminator RST 1 ;PRINT IT INX H ;Point to next character JMP PRINT ;Continue until $00 ; ; ;****************************************************** ; //// INPUT SUBROUTINES ;****************************************************** ; ; ROUTINE TO INPUT CHAR FROM RXA INPUT BUFFER ; RXA LOOPS TILL A CHARACTER IS AVAILABLE ; INP RETURNS CHARACTER WITH HIGH BIT SET ; IN REGISTER A. ; ; ROUTINE PASSES SPACE IF THE INPUT IS NOT A NUMBER. ; NUMERICAL CHARACTERS INCLUDE 0 - 9, +, -, AND E. ; ; ROUTINE ECHOS THE CHARACTERS FORWARDED ; INP: RST 2 ;INPUT A CHARACTER FROM RX0 CPI '+' ;+? JZ INP_DONE CPI '-' ;-? JZ INP_DONE CPI '.' ;DEC. PNT.? JZ INP_DONE CPI 'E' ;E? JZ INP_DONE CPI '0' ;ASCII CNTRL.? JM SPACE CPI ':' ;DECIMAL NUMBER? JM INP_DONE SPACE: MVI A, ' ' ;SEND A SPACE INP_DONE: PUSH PSW RST 1 ;ECHO VALID INPUT CHARACTER POP PSW ORI 80H ;SET HIGH BIT RET ; ; ;****************************************************** ; //// DIVIDE SUBROUTINE ;****************************************************** ; LDIV: CALL CSIGN ;COMPUTE SIGN OF RESULT CALL ZCHK ;CHECK IF DIVIDEND = ZERO JNZ DTST2 ;IF DIVIDEND .NE. 0 CHECK DIVISOR CALL BCHK ;CHECK FOR ZERO/ZERO JZ INDFC ;ZERO/ZERO = INDEFINITE JMP WZERC ;ZERO/NONZERO = ZERO DTST2: CALL BCHK ;COME HERE IF DIVIDEND .NE. 0 JZ OFLWC ;NONZERO/ZERO = OVERFLOW ;IF WE GET HERE, THINGS LOOK OKAY MOV E,L ;SAVE BASE IN E MOV L,C ;BASE 6 TO L CALL DCLR ;CLEAR QUOTIENT MANTISSA SLOT MOV L,E ;RESTORE BASE IN L CALL ENT1 ;DO FIRST CYCLE MOV L,C ;BASE 6 TO L CALL DLST ;MOVE QUOTIENT OVER ONE PLACE MVI D,23 ;NUMBER OF ITERATIONS TO D REP3: MOV L,E CALL ENT2 DCR D ;DEC D JZ GOON MOV A,L MOV L,C ;BASE 6 TO L MOV C,A CALL DLST ;MOVE QUOTIENT MANT OVER MOV A,L ;CPTR TO A MOV E,C ;LPTR TO E MOV C,A ;CPTR TO C JMP REP3 GOON: CALL AORS ;CHECK IF RESULT IS NORMALIZED JM CRIN MOV A,L ;LPTR TO A MOV L,C ;CPTR TO L MOV C,A ;LPTR TO C CALL DLST ;SHIFT QUOTIENT LEFT MOV C,L MOV L,E CALL LDCP ;COMPUTE THE CHARACTERISTIC OF RESULT RET CRIN: CALL CFCHE ;GET A=CHAR(H,L), E=CHAR(H,B) SUB E ;NEW CHAR = CHAR(DIVIDEND) - CHAR(DVISIOR) CPI 177Q ;CHECK MAX POSITIVE NUMBER JZ OFLWC ;JUMP ON OVERFLOW ADI 1 ;ADD 1 SINCE WE DID NOT LEFTSHIFT CALL CCHK ;CHECK AND STORE CHARACTERISTIC RET ;RETURN ; ; ; ;****************************************************** ; //// ADDITION SUBROUTINE ;****************************************************** ; ; LADD: XRA A ;/***SET UP TO ADD JMP LADS ;NOW DO IT ; ; ;****************************************************** ; //// SUBTRACTION SUBROUTINE ;****************************************************** ; ; SUBROUTINE LADS ; ; FLOATING POINT ADD OR SUB ; A 128 ON ENTRY SUB ; A 0 ON ENTRY ADD ; F-S F,FIRST OPER DESTROYED ; BASE 11 USED FOR SCRATCH ; LSUB: MVI A,200Q ;/****SET UP TO SUBTRACT ; LADS: CALL ACPR ;SAVE ENTRY PNT AT BASE 6 CALL BCHK ;CHECK ADDEND/SUBTRAHEND = ZERO RZ ;IF SO, RESULT=ARG SO RETURN ;THIS WILL PREVENT UNDERFLOW INDICATION ON ;ZERO + OR - ZERO CALL CCMP JZ EQ02 ;IF EQUAL, GO ON MOV D,A ;SAVE LPTR CHAR IN D JC LLTB SUB E ;L.GT.B IF HERE ANI 127 MOV D,A ;DIFFERENCE TO D MOV E,L ;SAVE BASE IN E MOV L,C ;C PTR TO L INR L ;C PTR 1 TO L MOV M,E ;SAVE BASE IN C PTR\1 MOV L,B ;B PTR TO L JMP NCHK LLTB: MOV A,E ;L.LT.B IF HERE,BPTR TO A SUB D ;SUBTRACT LPTR CHAR FROM BPTR CHAR ANI 127 MOV D,A ;DIFFERENCE TO D NCHK: MVI A,24 CMP D JNC SH10 MVI D,24 SH10: ORA A CALL DRST DCR D JNZ SH10 EQUL: MOV A,L CMP B JNZ EQ02 ;F.GT.S IF L.NE.B MOV L,C ;C PTR TO L INR L ;C PTR\1 TO L MOV L,M ;RESTORE L EQ02: CALL LASD ;CHECK WHAT TO CALL ACPR ;SAVE ANSWER CPI 2 ;TEST FOR ZERO ANSWER JNZ NOT0 JMP WZER ;WRITE FLOATING ZERO AND RETURN NOT0: MVI D,1 ;WILL TEST FOR SUB ANA D JZ ADDZ ;LSB 1 IMPLIES SUB CALL TSTR ;CHECK NORMAL/REVERSE JZ SUBZ ;IF NORMAL,GO SUBZ MOV A,L ;OTHERWISE REVERSE MOV L,B ;ROLES MOV B,A ;OF L AND B SUBZ: CALL DSUB ;SUBTRACT SMALLER FROM BIGGER CALL MANT ;SET UP SIGN OF RESULT CALL TSTR ;SEE IF WE NEED TO INTERCHANGE ;BPTR AND LPTR JZ NORM ;NO INTERCHANGE NECESSARY, SO NORMALIZE ;AND RETURN MOV A,L ;INTERCHANGE MOV L,B ;L MOV B,A ;AND B MOV A,C ;CPTR TO A MOV C,B ;BPTR TO C MOV E,L ;LPTR TO E MOV B,A ;CPTR TO B CALL LXFR ;MOVE BPTR> TO LPTR> MOV A,B MOV B,C MOV C,A MOV L,E JMP NORM ;NORMALIZE RESULT AND RETURN ; ; COPY THE LARGER CHARACTERISTIC TO THE RESULT ; ADDZ: CALL CCMP ;COMPARE THE CHARACTERISTICS JNC ADD2 ;IF CHAR(H,L) .GE. CHAR(H,B) CONTINUE CALL BCTL ;IF CHAR(H,L) .LT. CHAR(H,B) THE COPY ;CHAR(H,B) TO CHAR(H,L) ADD2: CALL MANT ;COMPUTE SIGN OF RESULT CALL DADD ;ADD MANTISSAS JNC SCCFG ;IF THERE IS NO OVFLW - DONE CALL DRST ;IF OVERFLOW SHIFT RIGHT CALL INCR ;AND INCREMENT CHARACTERISTIC RET ;ALL DONE, SO RETURN ; ; THIS ROUTINE STORES THE MANTISSA SIGN IN THE RESULT ; THE SIGN HAS PREVIOUSLY BEEN COMPUTED BY LASD. ; MANT: MOV E,L ;SAVE L PTR MOV L,C ;C PTR TO L MOV A,M ;LOAD INDEX WORD ANI 128 ;SCARF SIGN MOV L,E ;RESTORE L PTR INR L ;L PTR 2 INR L INR L ;TO L MOV E,A ;SAVE SIGN IN E MOV A,M ANI 127 ;SCARF CHAR ADD E ;ADD SIGN MOV M,A ;STORE IT DCR L ;RESTORE DCR L DCR L ;L PTR RET ; ; ; SUBROUTINE LASD ; ; UTILITY ROUTINE FOR LADS ; CALCULATES TRUE OPER AND SGN ; RETURNS ANSWER IN ; LASD: CALL MSFH ;FETCH MANT SIGNS, F IN A,D CMP E ;COMPARE SIGNS JC ABCH ;F\,S- MEANS GO TO A BRANCH JNZ BBCH ;F- S\ MEANS GO TO B BRANCH ADD E ;SAME SIGN IF HERE, ADD SIGNS JC BMIN ;IF BOTH MINUS, WILL OVERFLOW CALL AORS ;BOTH POS IF HERE JP L000 ;IF AN ADD, LOAD 0 COM1: CALL DCMP ;COMPARE F WITH S JC L131 ;S.GT.F,SO LOAD 131 JNZ L001 ;F.GT.S,SO LOAD 1 L002: MVI A,2 ;ERROR CONDITION, ZERO ANSWER RET BMIN: CALL AORS ;CHECK FOR ADD OR SUB JP L128 ;ADD, SO LOAD 128 COM2: CALL DCMP ;COMPARE F WITH S JC L003 ;S.GT.F,SO LOAD 3 JNZ L129 ;FGT.S.SO LOAD 129 JMP L002 ;ERROR ABCH: CALL AORS ;FT,S- SO TEST FOR A/S JM L000 ;SUBTRACT, SO LOAD 0 JMP COM1 ;ADD, SO GO TO DCMP BBCH: CALL AORS ;F-,S\,SO TEST FOR A/S JM L128 ;SUB JMP COM2 ;ADD L000: XRA A RET L001: MVI A,1 RET L003: MVI A,3 RET L128: MVI A,128 RET L129: MVI A,129 RET L131: MVI A,131 RET ; ; SUBROUTINE LMCM ; COMPARES THE MAGNITUDE OF ; TWO FLOATING PNT NUMBERS ; Z[1 IF [,C[1 IF F.LT.S. ; LMCM: CALL CCMP ;CHECK CHARS RNZ ;RETURN IF NOT EQUAL CALL DCMP ;IF EQUAL, CHECK MANTS RET ; ; ; ;*************************************************** ; //// MULTIPLY SUBROUTINE ;*************************************************** ; ; SUBROUTINE LMUL ; ; FLOATING POINT MULTIPLY ; L PTR X B PTR TO C PTR ; LMUL: CALL CSIGN ;COMPUTE SIGN OF RESULT AND STORE IT CALL ZCHK ;CHECK FIRST OPERAND FOR ZERO JZ WZERC ;ZERO * ANYTHING = ZERO CALL BCHK ;CHECK SECOND OPERAND FOR ZERO JZ WZERC ;ANYTHING * ZERO = ZERO MOV E,L ;SAVE L PTR MOV L,C ;C PTR TO L CALL DCLR ;CLR PRODUCT MANT LOCS MOV L,E ;L PTR TO L MVI D,24 ;LOAD NUMBER ITERATIONS KPGO: CALL DRST ;SHIFT L PTR RIGHT JC MADD ;WILL ADD B PTR IF C[1 MOV A,L ;INTERCHANGE MOV L,C ;L AND MOV C,A ;C PTRS INTR: CALL DRST ;SHIFT PRODUCT OVER MOV A,L ;INTERCHANGE MOV L,C ;L AND C PTRS_BACK TO MOV C,A ;ORIGINAL> DCR D JNZ KPGO ;MORE CYCLES IF Z[0 CALL AORS ;TEST IF RESULT IS NORMALIZED JM LMCP ;IF NORMALIZED GO COMPUTE CHAR MOV E,L ;SAVE LPTR IN E MOV L,C ;SET L=CPTR CALL DLST ;LEFT SHIFT RESULT TO NORMALIZE MOV L,E ;RESTORE LPTR CALL CFCHE ;OTHERWISE SET A=CHAR(H,L), E=CHAR(H,B) ADD E ;CHAR(RESULT) = CHAR(H,L) + CHAR(H,B) CPI 200Q ;CHECK FOR SMALLEST NEGATIVE NUMBER JZ UFLWC ;IF SO THEN UNDERFLOW SUI 1 ;SUBTRACT 1 TO COMPENSATE FOR NORMALIZE CALL CCHK ;CHECK CHARACTERISTIC AND STORE IT RET ;RETURN MADD: MOV A,L ;INTERCHANGE MOV L,C ;L AND MOV C,A ;C PTRS CALL DADD ;ACCUMULATE PRODUCT JMP INTR ; ; SUBROUTINE NORM ; ; THIS SUBROUTINE WILL NORMALIZE A FLOATING POINT ; NUMBER, PRESERVING ITS ORIGINAL SIGN. ; WE CHECK FOR UNDERFLOW AND SET THE CONDITION ; FLAG APPROPRIATELY. (SEE ERROR RETURNS). ; THERE IS AN ENTRY POINT TO FLOAT A SIGNED INTEGER ; (FLOAT) AND AN ENTRY POINT TO FLOAT AN UNSIGNED ; INTEGER. ; ; ENTRY POINTS: ; ; NORM - NORMALIZE FLOATING PT NUMBER AT (H,L) ; FLOAT - FLOAT TRIPLE PRECISION INTEGER AT (H,L) ; PRESERVING SIGN BIT IN (H,L)+3 ; DFXL - FLOAT UNSIGNED (POSITIVE) TRIPLE PRECISION ; AT (H,L) ; ; REGISTERS ON EXIT: ; ; A = CONDITION FLAG (SEE ERROR RETURNS) ; D,E = GARBAGE ; B,C,H,L = SAME AS ON ENTRY ; NORM: MOV E,L ;SAVE L IN E NORM1: CALL GCHAR ;GET CHAR(H,L) IN A WITH SIGN EXTENDED MOV D,A ;SAVE CHAR IN D FXL1: MOV L,E ;RESTORE L FXL2: CALL ZMCHK ;CHECK FOR ZERO MANTISSA JZ WZER ;IF ZERO MANTISSA THEN ZERO RESULT REP6: MOV A,M ;GET MOST SIGNIFICANT BYTE OF ;MANTISSA ORA A ;SET FLAGS JM SCHAR ;IF MOST SIGNIFICANT BIT = 1 THEN ;NUMBER IS NORMALIZED AND WE GO TO ;STORE THE CHARACTERISTIC MOV A,D ;OTHERWISE CHECK FOR UNDERFLOW CPI MINCH ;COMPARE WITH MINIMUM CHAR JZ WUND ;IF EQUAL THEN UNDERFLOW CALL DLST ;SHIFT MANTISSA LEFT DCR D ;DECREMENT CHARACTERISTIC JMP REP6 ;LOOP AN TEST NEXT BIT SCHAR: JMP INCR3 ;STORE THE CHARACTERISTIC USING ;THE SAME CODE AS THE INCREMENT DFXL: MOV E,L ;ENTER HERE TO FLOAT UNSIGNED ;INTEGER ;FIRST SAVE L IN E INR L ;MAKE (H,L) POINT TO CHAR INR L ;MAKE (H,L) POINT TO CHAR INR L ;MAKE (H,L) POINT TO CHAR XRA A ;ZERO ACCUMULATOR MOV M,A ;STORE A PLUS (+) SIGN MOV L,E ;RESTORE L FLOAT: MVI D,24 ;ENTER HERE TO FLOAT INTEGER ;PRESERVING ORIGINAL SIGN IN (H,L)+3 ;SET UP CHARACTERISTIC JMP FXL2 ;GO FLOAT THE NUMBER ; ; ; ; ; SUBROUTINE ZCHK ; ; THIS ROUTINE SETS THE ZERO FLAG IF IT DETECTS ; A FLOATING ZERO AT (H,L). ; ; SUBROUTINE ZMCHK ; ; THIS ROUTINE SETS THE ZERO FLAG IF IT DETECTS A ; ZERO MANTISSA AT (H,L) ; ZCHK: ZMCHK: INR L ;SET L TO POINT LAST BYTE OF MANTISSA INR L ;SET L TO POINT TO LAST BYTE OF MANTISSA MOV A,M ;LOAD LEAST SIGNIFICANT BYTE DCR L ;L POINTS TO MIDDLE BYTE ORA M ;OR WITH LEAST SIGNIFICANT BYTE DCR L ;L POINTS TO MOST SIGNIFICANT BYTE ;OF MANTISSA (ORIGINAL VALUE) ORA M ;OR IN MOST SIGNIFICANT BYTE RET ;RETURNS WITH ZERO FLAG SET APPROPRIATELY ; ; SUBROUTINE BCHK ; ; THIS ROUTINE CHECKS (H,B) FOR FLOATING PT ZERO ; BCHK: MOV E,L ;SAVE LPTR IN E MOV L,B ;SET L=BPTR CALL ZCHK ;CHECK FOR ZERO MOV L,E ;RESTORE L=LPTR RET ;RETURN ; ; ; SUBROUTINE DLST ; ; SHIFTS DBL WORD ONE PLACE LF DLST: INR L INR L ;/***TP MOV A,M ;LOAD IT ORA A ;KILL CARRY RAL ;SHIFT IT LEFT MOV M,A ;STORE IT DCR L MOV A,M ;LOAD IT RAL ;SHIFT IT LEFT ; IF CARRY SET BY FIRST SHIFT ; IT WILL BE IN LSB OF SECOND MOV M,A DCR L ;/***TP EXTENSION MOV A,M RAL MOV M,A ;/***ALL DONE TP RET ; ; ; SUBROUTINE DRST ; ; SHIFTS DOUBLE WORD ONE PLACE ; TO THE RIGHT ; DOES NOT AFFECT D ; DRST: MOV E,L ;/***TP MODIFIED RIGHT SHIFT TP MOV A,M ;LOAD FIRST WORD RAR ;ROTATE IT RIGHT MOV M,A ;STORE IT INR L ;/*** TP MOV A,M ;LOAD SECOND WORD RAR ;SHIFT IT RIGHT MOV M,A ;STORE IT INR L ;/*** TP EXTENSION MOV A,M RAR MOV M,A MOV L,E ;/***TP - ALL DONE TP RET ; ; ; SUBROUTINE DADD ; ; ADDS TWO DOUBLE PRECISION ; WORDS, C=1 IF THERE IS OVRFLW ; DADD: MOV E,L ;SAVE BASE IN E MOV L,B ;BASE \3 TO L INR L ;BASE \4 TO L INR L ;/***TP MOV A,M ;LOAD S MANTB MOV L,E ;BASE TO L INR L ;BASE \1 TO L INR L ;/***TP ADD M ;ADD TWO MANTB]S MOV M,A ;STORE ANSWER MOV L,B ;/***TP EXTENSION INR L MOV A,M MOV L,E INR L ADC M MOV M,A ;/***TP - ALL DONE MOV L,B ;BASE \3 TO L MOV A,M ;MANTA OF S TO A MOV L,E ;BASE TO L ADC M ;ADD WITH CARRY MOV M,A ;STORE ANSWER RET ; ; ; SUBROUTINE DCLR ; ; CLEARS TWO SUCCESSIVE ; LOCATIONS OF MEMORY ; DCLR: XRA A MOV M,A INR L MOV M,A INR L ;/***TP EXTENSION MOV M,A ;/***TP ZERO 3 DCR L ;/***TP - ALL DONE DCR L RET ; ; ; /*****ALL NEW DSUB - SHORTER*** ; ; SUBROUTINE DSUB ; ; DOUBLE PRECISION SUBTRACT ; DSUB: MOV E,L ;SAVE BASE IN E INR L ;/***TP EXTENSION INR L ;/START WITH LOWS MOV A,M ;/GET ARG MOV L,B ;/NOW SET UP TO SUB INR L INR L SUB M ;/NOW DO IT MOV L,E ;/NOW MUST PUT IT BACK INR L INR L MOV M,A ;/PUT BACK DCR L ;/***TP - ALL DONE MOV A,M ;/GET LOW OF LOP MOV L,B ;/SET TO BOP INR L ;/SET TO BOP LOW SBB M ;/GET DIFF. OF LOWS MOV L,E ;/SAVE IN LOP LOW INR L ;/TO LOP LOW MOV M,A ;/INTO RAM DCR L ;/BACK UP TO LOP HIGH MOV A,M ;/GET LOP HIGH MOV L,B ;/SET TO BOP HIGH SBB M ;/SUB. WITH CARRY MOV L,E ;/SAVE IN LOP HIGH MOV M,A ;/INTO RAM RET ;/ALL DONE - MUCH SHORTER ; ; SUBROUTINE GCHAR ; ; THIS SUBROUTINE RETURNS THE CHARACTERISTIC OF ; THE FLOATING POINT NUMBER POINTED TO BY (H,L) ; IN THE A REGISTER WITH ITS SIGN EXTENDED INTO THE ; LEFTMOST BIT. ; ; REGISTERS ON EXIT: ; ; A = CHARACTERISTIC OF (H,L) WITH SIGN EXTENDED ; L = (ORIGINAL L) + 3 ; B,C,D,E,H = SAME AS ON ENTRY ; GCHAR: INR L ;MAKE (H,L) POINT TO CHAR INR L ;MAKE (H,L) POINT TO CHAR INR L ;MAKE (H,L) POINT TO CHAR MOV A,M ;SET A=CHAR + MANTISSA SIGN ANI 177Q ;GET RID OF MANTISSA SIGN BIT ADI 100Q ;PROPAGATE CHAR SIGN INTO LEFTMOST BIT XRI 100Q ;RESTORE ORIGINAL CHAR SIGN BIT RET ;RETURN WITH (H,L) POINTING TO THE ;CHAR = ORIGINAL (H,L)+3 ;SOMEONE ELSE WILL CLEAN UP ; ; ; SUBROUTINE CFCHE ; ; THIS SUBROUTINE RETURNS THE CHARACTERISTICS OF THE ; FLOATING POINT NUMBERS POINTED TO BY (H,L) AND ; (H,B) IN THE A AND E REGISTERS RESPECTIVELY, ; WITH THEIR SIGNS EXTENDED INTO THE LEFTMOST BIT. ; ; REGISTERS ON EXIT: ; ; A = CHARACTERISTIC OF (H,L) WITH SIGN EXTENDED ; E = CHARACTERISTIC OF (H,B) WITH SIGN EXTENDED ; B,C,H,L = SAME AS ON ENTRY ; D = A ; CFCHE: MOV E,L ;SAVE LPTR IN E MOV L,B ;SET L = BPTR CALL GCHAR ;GET CHAR(H,B) WITH SIGN EXTENDED IN A MOV L,E ;RESTORE L = LPTR MOV E,A ;SET E=CHAR(H,B) WITH SIGN EXTENDED CALL GCHAR ;SET A=CHAR(H,L) WITH SIGN EXTENDED DCR L ;RESTORE L = LPTR DCR L ;RESTORE L = LPTR DCR L ;RESTORE L = LPTR MOV D,A ;SET D=A=CHAR(H,L) WITH SIGN EXTENDED RET ; ; ; SUBROUTINE CCMP ; ; THIS SUBROUTINE COMPARES THE CHARACTERISTICS OF ; FLOATING POINT NUMBERS POINTED TO BY (H,L) AND (H,B). ; THE ZERO FLIP-FLOP IS SET IF CHAR(H,L) EQUALS ; CHAR(H,B). IF CHAR(H,L) IS LESS THAN CHAR(H,B) THEN ; THE CARRY BIT WILL BE SET. ; ; REGISTERS ON EXIT: ; ; A = CHARACTERISTIC OF (H,L) WITH SIGN EXTENDED ; E = CHARACTERISTIC OF (H,B) WITH SIGN EXTENDED ; D = A ; B,C,H,L = SAME AS ON ENTRY ; CCMP: CALL CFCHE ;FETCH CHARACTERISTICS WITH SIGN EXTENDED ;INTO A (CHAR(H,L)) AND E (CHAR(H,B)) REGISTERS MOV D,A ;SAVE CHAR (H,L) SUB E ;SUBTRACT E (CHAR(H,B)) RAL ;ROTATE SIGN BIT INTO CARRY BIT MOV A,D ;RESTORE A=CHAR(H,L) RET ;RETURN ; ; ERROR RETURNS ; ; THE FOLLOWING CODE IS USED TO RETURN VARIOUS ; ERROR CONDITIONS. IN EACH CASE A FLOATING POINT ; NUMBER IS STORED IN THE 4 WORDS POINTED TO BY (H,L) ; AND A FLAG IS STORED IN THE ACCUMULATOR. ; ; CONDITION FLAG RESULT (+) RESULT (-) ; ; UNDERFLOW 377 000 000 000 100 000 000 000 300 ; OVERFLOW 177 377 377 377 077 377 377 377 277 ; INDEFINITE 077 377 377 377 077 377 377 377 277 ; NORMAL 000 XXX XXX XXX XXX XXX XXX XXX XXX ; NORMAL ZERO 000 000 000 000 100 (ALWAYS RETURNS +0) ; ; ENTRY POINTS: ; ; WUND - WRITE UNDERFLOW ; WOVR - WRITE OVERFLOW ; WIND - WRITE INDEFINITE ; WZER - WRITE NORMAL ZERO ; ;###S ;WFLT MACRO VMANT,VCHAR,VFLAG,LABEL ;WRITE FLOATING NUMBER ; ; MVI D,VCHAR ;LOAD CHARACTERISTIC INTO D REGISTER ; CALL WCHAR ;WRITE CHARACTERISTIC ;LABEL:: MVI A,VMANT ;LOAD MANTISSA VALUE ; ;WE ASSUME HERE THAT ALL BYTES OF MANTISSA ; ;ARE THE SAME ; CALL WMANT ;WRITE THE MANTISSA ; MVI A,VFLAG ;SET ACCUMULATOR TO FLAG ; ORA A ;SET FLAGS PROPERLY ; RET ;RETURN (WMANT RESTORED (H,L)) ; ENDM ; ;WUND: WFLT 0,100Q,377Q,UFLW1 ;WRITE UNDERFLOW WUND: MVI D,100Q ;LOAD CHARACTERISTIC INTO D REGISTER CALL WCHAR ;WRITE CHARACTERISTIC UFLW1: MVI A,0 ;LOAD MANTISSA VALUE ;WE ASSUME HERE THAT ALL BYTES OF MANTISSA ;ARE THE SAME CALL WMANT ;WRITE THE MANTISSA MVI A,377Q ;SET ACCUMULATOR TO FLAG ORA A ;SET FLAGS PROPERLY RET ;RETURN (WMANT RESTORED (H,L)) ;WOVR: WFLT 377Q,77Q,177Q,OFLW1 ;WRITE OVERFLOW WOVR: MVI D,77Q ;LOAD CHARACTERISTIC INTO D REGISTER CALL WCHAR ;WRITE CHARACTERISTIC OFLW1: MVI A,377Q ;LOAD MANTISSA VALUE ;WE ASSUME HERE THAT ALL BYTES OF MANTISSA ;ARE THE SAME CALL WMANT ;WRITE THE MANTISSA MVI A,177Q ;SET ACCUMULATOR TO FLAG ORA A ;SET FLAGS PROPERLY RET ;RETURN (WMANT RESTORED (H,L)) ;WIND: WFLT 377Q,77Q,77Q,INDF1 ;WRITE INDEFINITE WIND: MVI D,77Q ;LOAD CHARACTERISTIC INTO D REGISTER CALL WCHAR ;WRITE CHARACTERISTIC INDF1: MVI A,377Q ;LOAD MANTISSA VALUE ;WE ASSUME HERE THAT ALL BYTES OF MANTISSA ;ARE THE SAME CALL WMANT ;WRITE THE MANTISSA MVI A,77Q ;SET ACCUMULATOR TO FLAG ORA A ;SET FLAGS PROPERLY RET ;RETURN (WMANT RESTORED (H,L)) ;###E ; WZER: INR L ;WRITE NORMAL ZERO INR L ; INR L ; MVI M,100Q ;STORE CHARACTERISTIC FOR ZERO XRA A ;ZERO ACCUMULATOR CALL WMANT ;STORE ZERO MANTISSA ORA A ;SET FLAGS PROPERLY RET ;RETURN ; ; ROUTINE TO WRITE MANTISSA FOR ERROR RETURNS ; WMANT: DCR L ;POINT LEAST SIGNIFICANT BYTE ;OF MANTISSA MOV M,A ;STORE LSBYTE OF MANTISSA DCR L ;POINT TO NEXT LEAST SIGNIFICANT BYTE ;OF MANTISSA MOV M,A ;STORE NLSBYTE OF MANTISSA DCR L ;POINT TO MOST SIGNIFICANT BYTE ;OF MANTISSA MOV M,A ;STORE MSBYTE OF MANTISSA RET ;RETURN (H,L) POINTS TO BEGINNING OF ;FLOATING POINT RESULT ; ; ROUTINE TO WRITE CHARACTERISTIC FOR ERROR RETURNS ; NOTE: WE PRESERVE ORIGINAL MANTISSA SIGN ; ON ENTRY D CONTAINS NEW CHARACTERISTIC TO BE STORED. ; WCHAR: INR L ;SET (H,L) TO POINT TO CHARACTERISTIC INR L ;PART OF ABOVE INR L ;PART OF ABOVE MOV A,M ;LOAD CHARACTERISTIC A ;AND MANTISSA SIGN ANI 200Q ;JUST KEEP MANTISSA SIGN ORA D ;OR IN NEW CHARACTERISTIC MOV M,A ;STORE IT BACK RET ;RETURN WITH (H,L) POINT TO CHARACTERISTIC ;OF RESULT ;SOMEONE ELSE WILL FIX UP (H,L) ; ; SUBROUTINE INDFC ; ; THIS ROUTINE WRITES A FLOATING INDEFINITE, SETS ; THIS WRITES WRITES A FLOATING POINT INDEFINITE ; AT (H,C), SETS THE CONDITION FLAG AND RETURNS ; ; INDFC: MOV E,L ;SAVE LPTR IN E MOV L,C ;SET L=CPTR SO (H,L)-ADDR OF RESULT CALL WIND ;WRITE INDEFINITE MOV L,E ;RESTORE L=LPTR RET ;RETURN ; ; ; SUBROUTINE WZERC ; ; THIS ROUTINE WRITES A NORMAL FLOATING POINT ZERO ; AT (H,C), SETS THE CONDITION FLAG AND RETURNS ; WZERC: MOV E,L ;SAVE LPTR IN E MOV L,C ;SETL=CPTR SO (H,L)=ADDR OF RESULT CALL WZER ;WRITE NORMAL ZERO MOV L,E ;RESTORE L=LPTR RET ;RETURN ; ; SUBROUTINE INCR ; ; THIS SUBROUTINE INCREMENTS THE CHARACTERISTIC ; OF THE FLOATING POINT NUMBER POINTED TO BY (H,L). ; WE TEST FOR OVERFLOW AND SET APPROPRIATE FLAG. ; (SEE ERROR RETURNS). ; ; REGISTERS ON EXIT: ; ; A = CONDITION FLAG (SEE ERROR RETURNS) ; D = CLOBBERED ; B,C,H,L = SAME AS ON ENTRY ; INCR: CALL GCHAR ;GET CHAR WITH SIGN EXTENDED CPI MAXCH ;COMPARE WITH MAX CHAR PERMITTED JZ OFLW1 ;INCREMENT WOULD CAUSE OVERFLOW MOV D,A ;SAVE IT IN D INR D ;INCREMENT IT JMP INCR2 ;JUMP AROUND ALTERNATE ENTRY POINT INCR3: INR L ;COME HERE TO STORE CHARACTERISTIC INR L ;POINT (H,L) TO CHAR INR L ;POINT (H,L) TO CHAR INCR2: MVI A,177Q ANA D ;KILL SIGN BIT MOV D,A ;BACK TO D MOV A,M ;NOW SIGN IT ANI 200Q ;GET MANTISSA SIGN ORA D ;PUT TOGETHER MOV M,A ;STORE IT BACK DCR L ;NOW BACK TO BASE DCR L ;/***TP DCR L SCCFG: XRA A ;SET SUCCESS FLAG RET ; ; SUBROUTINE DECR ; ; THIS SUBROUTINE DECREMENTS THE CHARACTERISTIC ; OF THE FLOATING POINT NUMBER POINTED TO BY (H,L). ; WE TEST FOR UNDERFLOW AND SET APPROPRIATE FLAG. ; (SEE ERROR RETURNS). ; ; REGISTERS ON EXIT: ; ; A = CONDITION FLAG (SEE ERROR RETURNS) ; D = CLOBBERED ; B,C,H,L = SAME AS ON ENTRY ; DECR: CALL GCHAR ;GET CHAR WITH SIGN EXTENDED CPI MINCH ;COMPARE WITH MIN CHAR PERMITTED JZ UFLW1 ;DECREMENT WOULD CAUSE UNDERFLOW MOV D,A ;SAVE CHARACTERISTIC IN D DCR D ;DECREMENT CHARACTERISTIC JMP INCR2 ;GO STORE IT BACK ; ; SUBROUTINE AORS ; ; RETURN S=1 IF BASE 6 ; HAS A 1 IN MSB ; AORS: MOV E,L ;SAVE BASE MOV L,C ;BASE 6 TO L MOV A,M ;LOAD IT ORA A ;SET FLAGS MOV L,E ;RESTORE BASE RET ; ; ; SUBROUTINE TSTR ; ; CHECKS C PTR TO SEE IF ; NLSB ! ; RETURNS Z=1 IF NOT ; DESTROYS E,D ; TSTR: MOV E,L ;SAVE BASE MOV L,C ;C PTR TO L MVI D,2 ;MASK TO D MOV A,M ;LOAD VALUE MOV L,E ;RESTORE BASE ANA D ;AND VALUE WITH MASK RET ; ; ; SUBROUTINE ACPR ; ; STORES A IN LOCATION OF CPTR ; LPTR IN E ; ACPR: MOV E,L ;SAVE LPTR MOV L,C ;CPTR TO L MOV M,A ;STORE A MOV L,E ;RESTORE BASE RET ; ; ; SUBROUTINE DCMP ; ; COMPARES TWO DOUBLE LENGTH ; WORDS ; DCMP: MOV A,M ;NUM MANTA TO A MOV E,L ;SAVE BASE IN E MOV L,B ;BASE 3 TO L CMP M ;COMPARE WITH DEN MANTA MOV L,E ;RETURN BASE TO L RNZ ;RETURN IF NOT THE SAME INR L ;L TO NUM MANTB MOV A,M ;LOAD IT MOV L,B ;DEN MANTB ADD TO L INR L ;BASE 4 TO L CMP M MOV L,E RNZ ;/***TP EXTENSION INR L ;NOW CHECK BYTE 3 INR L MOV A,M ;GET FOR COMPARE MOV L,B INR L INR L ;BYTE 3 NOW CMP M ;COMPARE MOV L,E ;/***TP - ALL DONE RET ; ; ; SUBROUTINE DIVC ; ; PERFORMS ONE CYCLE OF DOUBLE ; PRECISION FLOATING PT DIVIDE ; ENTER AT ENT1 ON FIRST CYCLE ; ENTER AT ENT2 ALL THEREAFTER ; ENT2: CALL DLST ;SHIFT MOVING DIVIDEND JC OVER ;IF CARRY=1,NUM.GT.D ENT1: CALL DCMP ;COMPARE NUM WITH DEN JNC OVER ;IF CARRY NOT SET,NUM.GE.DEN RET OVER: CALL DSUB ;CALL DOUBLE SUBTRACT MOV E,L ;SAVE BASE IN E MOV L,C ;BASE 6 TO L INR L ;BASE 7 TO L INR L ;/***TP MOV A,M ADI 1 ;ADD 1 MOV M,A ;PUT IT BACK MOV L,E ;RESTORE BASE TO L RET ; ; ; SUBROUTINE LXFR ; ; MOVES CPTR TO EPTR ; MOVES 3 WORDS IF ENTER AT LXFR ; LXFR: MVI D,4 ;MOVE 4 WORDS REP5: MOV L,C ;CPTR TO L MOV A,M ;CPTR> TO A MOV L,E ;EPTR TO L MOV M,A INR C ;INCREMENT C INR E ;INCREMENT E TO NEXT DCR D ;TEST FOR DONE JNZ REP5 ;GO FOR FOR TILL D=0 MOV A,E ;NOW RESET C AND E SUI 4 ;RESET BACK BY 4 MOV E,A ;PUT BACK IN E MOV A,C ;NOW RESET C SUI 4 ;BY 4 MOV C,A ;BACK TO C RET ;DONE ; ; SUBROUTINE LDCP ; ; THIS SUBROUTINE COMPUTES THE CHARACTERISTIC ; FOR THE FLOATING DIVIDE ROUTINE ; ; REGISTERS ON EXIT: ; ; A = CONDITION FLAG (SEE ERROR RETURNS) ; D,E = GARBAGE ; B,C,H,L = SAME AS ON ENTRY ; ; REGISTERS ON ENTRY: ; ; (H,B) = ADDRESS OFF DIVISOR ; (H,C) = ADDRESS OF QUOTIENT ; (H,L) = ADDRESS OF DIVIDEND ; LDCP: CALL CFCHE ;SET E=CHAR(H,B), A=CHAR(H,L) SUB E ;SUBTRACT TO GET NEW CHARACTERISTIC JMP CCHK ;GO CHECK FOR OVER/UNDERFLOW ;AND STORE CHARACTERISTIC ; ; ; SUBROUTINE LMCP ; ; THIS SUBROUTINE COMPUTES THE CHARACTERISTIC ; FOR THE FLOATING MULTIPLY ROUTINE. ; ; REGISTERS ON EXIT: ; ; A = CONDITION FLAG (SEE ERROR RETURNS) ; D,E = GARBAGE ; B,C,H,L = SAME AS ON ENTRY ; ; REGISTERS ON ENTRY: ; ; (H,B) = ADDRESS OFF MULTIPLICAND ; (H,C) = ADDRESS OF PRODUCT ; (H,L) = ADDRESS OF MULTIPLIER ; LMCP: CALL CFCHE ;SET E=CHAR(H,B), A=CHAR(H,L) ADD E ;ADD TO GET NEW CHARACTERISTIC ;NOW FALL INTO THE ROUTINE ;WHICH CHECKS FOR OVER/UNDERFLOW ;AND STORE CHARACTERISTIC ; ; ; SUBROUTINE CCHK ; ; THIS SUBROUTINE CHECKS A CHARACTERISTIC IN ; THE ACCUMULATOR FOR OVERFLOW OR UNDERFLOW. ; IT THEN STORES THE CHARACTERISTIC, PRESERVING ; THE PREVIOUSLY COMPUTED MANTISSA SIGN. ; ; REGISTERS ON ENTRY: ; ; (H,L) = ADDRESS OF ONE OPERAND ; (H,B) = ADDRESS OF OTHER OPERAND ; (H,C) = ADDRESS OF RESULT ; A = NEW CHARACTERISTIC OF RESULT ; ; REGISTERS ON EXIT: ; ; A = CONDITION FLAG (SEE ERROR RETURNS) ; D,E = GARBAGE ; B,C,H,L = SAME AS ON ENTRY ; CCHK: ;ENTER HERE TO CHECK CHARACTERISTIC CPI 100Q ;CHECK FOR 0 TO +63 JC STORC ;JUMP IF OKAY CPI 200Q ;CHECK FOR +64 TO +127 JC OFLWC ;JUMP IF OVERFLOW CPI 300Q ;CHECK FOR -128 TO -65 JC UFLWC ;JUMP IF UNDERFLOW STORC: MOV E,L ;SAVE L IN E MOV L,C ;LET L POINT TO RESULT MOV D,A ;SAVE CHARACTERISTIC IN D CALL INCR3 ;STORE CHARACTERISTIC MOV L,E ;RESTORE L RET ;RETURN ; ; SUBROUTINE OFLWC ; ; THIS ROUTINE WRITES A FLOATING POINT OVERFLOW AT (H,C) ; SETS THE CONDITION FLAG, AND RETURNS. ; OFLWC: MOV E,L ;SAVE L IN E MOV L,C ;SET L=CPTR, SO (H,L)=ADDR OF RESULT CALL WOVR ;WRITE OUT OVERFLOW MOV L,E ;RESTORE L RET ;RETURN ; ; SUBROUTINE UFLWC ; ; THIS ROUTINE WRITES A FLOATING POINT UNDERFLOW AT (H,C) ; SETS THE CONDITION FLAG, AND RETURNS. ; UFLWC: MOV E,L ;SAVE L IN E MOV L,C ;SET L=CPTR, SO (H,L)=ADDR OF RESULT CALL WUND ;WRITE OUT UNDERFLOW MOV L,E ;RESTORE L RET ;RETURN ; ; ; SUBROUTINE CSIGN ; ; THIS SUBROUTINE COMPUTES AND STORE THE MANTISSA ; SIGN FOR THE FLOATING MULTIPLY AND DIVIDE ROUTINES ; ; REGISTERS ON ENTRY: ; ; (H,L) = ADDRESS OF ONE OPERAND ; (H,B) = ADDRESS OF OTHER OPERAND ; (H,C) = ADDRESS OF RESULT ; ; REGISTERS ON EXIT: ; ; A,D,E = GARBAGE ; B,C,H,L = SAME AS ON ENTRY ; ; CSIGN: CALL MSFH ;SET A=SIGN(H,L), E=SIGN(H,B) XRA E ;EXCLUSIVE OR SIGNS TO GET NEW SIGN CALL CSTR ;STORE SIGN INTO RESULT RET ;RETURN ; ; ; SUBROUTINE CSTR ; ; STORES VALUE IN A IN ; CPTR 2 ; PUTS LPTR IN E ; CSTR: MOV E,L ;SAVE LPTR IN E MOV L,C ;CPTR TO L INR L ;CPTR\2 INR L ;TO L INR L ;/***TP MOV M,A ;STORE ANSWER MOV L,E ;LPTR BACK TO L RET ; ; SUBROUTINE MSFH ; ; THIS SUBROUTINE FETCHES THE SIGNS OF THE MANTISSAS ; OF THE FLOATING POINT NUMBERS POINTED TO BY (H,L) ; AND (H,B) INTO THE A AND E REGISTERS RESPECTIVELY. ; ; REGISTERS ON EXIT: ; ; A = SIGN OF MANTISSA OF (H,L) ; E = SIGN OF MANTISSA OF (H,B) ; B,C,D,H,L = SAME AS ON ENTRY ; MSFH: MOV E,L ;SAVE LPTR MOV L,B ;BPTR TO L INR L ;BPTR\2 INR L ;/***TP INR L ;TO L MOV A,M ;BPTR 2>TO A ANI 128 ;SAVE MANT SIGN MOV L,E ;LPTR BACK TO L MOV E,A ;STORE BPTR MANT SIGN INR L ;LPTR\2 INR L ;/***TP INR L ;TO L MOV A,M ;LPTR\2>TO A ANI 128 ;SAVE LPTR MANT SIGN DCR L ;LPTR BACK DCR L ;TO L DCR L ;/***TP RET ; ; ; SUBROUTINE BCTL ; ; MOVES BPTR CHAR TO LPTR CHAR ; DESTROYS E ; BCTL: MOV E,L ;LPTR TO E MOV L,B ;BPTR TO L INR L ;BPTR 2 INR L ;/***TP INR L ;TO L MOV A,M ;BPTR CHAR TO A MOV L,E ;LPTR TO L INR L ;LPTR 2 INR L ;TO L INR L ;/***TP MOV M,A ;STORE BPTR CHAR IN LPTR CHAR MOV L,E ;LPTR TO L RET ; ;HRJ for some reason the square root routine was not included ; ; ; SUBROUTINE DSQRT ; ; THE L REG PTS TO THE TO BE ; OPERATED ON. ; THE B REG PTS TO THE LOC WHERE ; THE RESULT IS TO BE STORED ; THE C REG PTS TO 17(10) SCRATCH ; AREA. ; WHERE: ; C = ITERATION COUNT ; C+1 = L REG ; C+2 = B REG ; C+3 TO C+6 = INTRL REG 1 ; C+7 TO C+10 = INTRL REG 2 ; C+11 TO C+14 = INTRL REG 3 ; C+15 = ; DSQRT: MOV A,L ;STORE L IN MOV L,C ;2ND WRD SCRATCH MVI M,0 ;INITIALIZE ITER COUNT INR L MOV M,A INR L ;STR B IN 3RD MOV M,B ;WRD OF SCRATCH INR L ;SET C TO INTRL MOV C,L ;REG I MOV L,A ; SET L PRT AT MOV A,H ;SET REGS FOR COPY CALL COPY ; COPY TC INTRL REG1 CALL GCHR ;PUT CHR IN A MOV B,A ;MAKE COPY ANI 200Q ;OK NEG JNZ ERSQ MOV A,B ANI 100Q ;OK NEG EXP MOV A,B JZ EPOS RAR ;DIV BY 2 ANI 177Q ORI 100Q ;SET SIGN BIT MOV M,A ;SAVE 1ST APPROX JMP AGN4 EPOS: RAR ;DIV BY 2 ANI 177Q MOV M,A ;SAVE 1ST APPROX AGN4: MOV L,C ;SET REGS MOV A,C ;TO COPY 1ST ADI 4 ;APPROX MOV C,A ;INTO INTRL REG 2 MOV A,H ;FRM INTRL REG1 CALL COPY MOV A,C SUI 4 ;MULTIPLY INTRL REG 1 MOV L,A MOV B,C ;TIME INTRL REG2 ADI 10Q ;PLACE RESULT IN MOV C,A ;INMTRL REG 3 CALL LMUL MOV A,C SUI 10Q ;COPY ORG INTO MOV C,A ;INTRL REG 1 SUI 2 MOV L,A MOV L,M MOV A,H CALL COPY MOV A,C ADI 10Q ;ADD INTRL MOV L,A ;REG3 OT MOV B,C ;INTRL REG1 ADI 4 ;ANS TO INTRL MOV C,A ;REG3 CALL LADD MOV A,L SUI 4 ;DIV INTRL REG 3 MOV B,A ;BY INTRL REG 2 SUI 4 ;PUT ANSR IN INTRL MOV C,A ;REG1 CALL LDIV CALL GCHR SUI 1 ANI 177Q MOV M,A MOV A,C SUI 3 ;C PTS TO INTRL REG 1 MOV L,A ;GET INTR MOV B,M ;COUNT NOW INCR INR B MOV M,B MOV A,B CPI 5 ;IF = 5 RTN ANS JNZ AGN4 ;OTHERWISE CONT MOV L,C ALDN: DCR L ;COPY ANS INTO MOV C,M ;LOC REQUESTED INR L MOV A,H CALL COPY RET ERSQ: MOV L,C CALL WZER ;WRITE A FLOATING ZERO JMP ALDN ; ; C+1 = L REG ; ;****************************************************** ; //// 5 DIGIT FLOATING PT. OUTPUT ;****************************************************** ; ; ; ROUTINE TO CONVERT FLOATING PT. ; NUMBERS TO ASCII AND OUTPUT THEM VIA A SUBROUTINE ; CALLED OUTR - NOTE: THIS IS CURRENTLY SET ; TO ODT'S OUTPUT ROUTINE ; CVRT: CALL ZCHK ;CHECK FOR NEW ZERO JNZ NNZRO ;NOT ZERO INR C ;IT WAS, OFFSET C BY 2 INR C MOV L,C CALL WZER ;WRITE ZERO CALL SIGN ;SEND SPACE ON POS ZERO [HRJ: was missing] INR L ;PNT TO DECIMAL EXPONENT INR L INR L INR L XRA A ;SET IT TO ZERO MOV M,A JMP MDSKP ;OUTPUT IT NNZRO: MOV D,M ;GET THE NUMBER TO CONVERT INR L MOV B,M INR L MOV E,M INR L ;4 WORD***TP MOV A,M ;/***TP INR C ;OFFSET SCRATCH POINTER BY 2 INR C MOV L,C ;L NOT NEEDED ANY MORE MOV M,D ;SAVE NUMBER IN SCRATCH INR L MOV M,B INR L MOV M,E ;/***TP INR L ;/***TP MOV B,A ;SAVE COPY OF CHAR & SIGN ANI 177Q ;GET ONLY CHAR. MOV M,A ;SAVE ABS(NUMBER) CPI 100Q ;CK FOR ZERO JZ NZRO SUI 1 ;GET SIGN OF DEC. EXP ANI 100Q ;GET SIGN OF CHAR. NZRO: RLC ;MOVE IT TO SIGN POSITION INR L ;MOVE TO DECIMAL EXP. MOV M,A ;SAVE SIGN OF EXP. MOV A,B ;GET MANT. SIGH BACK CALL SIGN ;OUTPUT SIGN MVI L,TEN5 & 377Q ;TRY MULT. OR DIV. BY 100000 FIRST CALL COPT ;MAKE A COPY IN RAM TST8: CALL GCHR ;GET CHAR. OF NUMBER MOV B,A ;SAVE A COPY ANI 100Q ;GET ABSOLUTE VALUE OF CHAR MOV A,B ;IN CASE PLUS JZ GOTV ;ALREADY PLUS MVI A,200Q ;MAKE MINUS INTO PLUS SUB B ;PLUS=200B-CHAR GOTV: CPI 22Q ;TEST FOR USE OF 100000 JM TRY1 ;WONT GO CALL MORD ;WILL GO SO DO IT ADI 5 ;INCREMENT DEC. EXPONENT BY 5 MOV M,A ;UPDATE MEM JMP TST8 ;GO TRY AGAIN TRY1: MVI L,TEN & 377Q ;NOW USE JUST TEN CALL COPT ;PUT IT IN RAM TST1: CALL GCHR ;GET CHARACTERISTIC CPI 1 ;MUST GET IN RANGE 1 TO 6 JP OK1 ;AT LEAST ITS 1 OR BIGGER MDGN: CALL MORD ;MUST MUL OF DIV BY 10 ADI 1 ;INCREMENT DECIMAL EXP. MOV M,A ;UPDATE MEM JMP TST1 ;NOW TRY AGAIN OK1: CPI 7 ;TEST FOR LESS THAN 7 JP MDGN ;NOPE - 7 OR GREATER MDSKP: MOV L,C ;SET UP DIGIT COUNT DCR L DCR L ;IN 1ST WORD OF SCRATCH MVI M,5 ;5 DIGITS MOV E,A ;SAVE CHAR. AS LEFT SHIFT COUNT CALL LSFT ;SHIFT LEFT PROPER NUMBER CPI 12Q ;TEST FOR 2 DIGITS HERE JP TWOD ;JMP IF 2 DIGITS TO OUTPUT CALL DIGO ;OUTPUT FIRST DIGIT POPD: CALL MULTT ;MULTIPLY THE NUMBER BY 10 INPOP: CALL DIGO ;PRINT DIGIT IN A JNZ POPD ;MORE DIGITS? MVI A,305Q ;NO SO PRINT E CALL OUTR ;BASIC CALL TO OUTPUT CALL GETEX ;GET DECIMAL EXP MOV B,A ;SAVE A COPY CALL SIGN ;OUTPUT SIGN MOV A,B ;GET EXP BACK ANI 77Q ;GET GOOD BITS CALL CTWO ;GO CONVERT 2 DIGITS DIGO: ADI 260Q ;MAKE A INTO ASCII CALL OUTR ;OUTPUT DIGIT MOV L,C ;GET DIGIT COUNT DCR L ;BACK UP TO DIGIT COUNT DCR L MOV A,M ;TEST FOR DECIMAL PT CPI 5 ;PRINT . AFTER 1ST DIGIT MVI A,256Q ;JUST IN CASE CZ OUTR ;OUTPUT . IF 1ST DIGIT MOV D,M ;NOW DECREMENT DIGIT COUNT DCR D MOV M,D ;UPDATE MEM AND LEAVE FLOPS SET RET ;SERVES AS TERM FOR DIGO & CVRT MULTT: MVI E,1 ;MULT. BY 10 (START WITH X2) CALL LSFT ;LEFT SHIFT 1 = X2 MOV L,C ;SAVE X2 IN "RESULT" DCR L ;SET TO TOP OF NUMBER MOV A,C ;SET C TO RESULT ADI 11Q MOV C,A ;NOW C SET RIGHT MOV A,H ;SHOW RAM TO RAM TRANSFER CALL COPY ;SAVE X2 FINALLY MOV A,C ;MUST RESET C SUI 11Q ;BACK TO NORMAL MOV C,A MVI E,2 ;NOW GET (X2)X4=X8 MOV L,C ;BUT MUST SAVE OVERFLOW DCR L CALL TLP2 ;GET X8 MOV L,C ;SET UP TO CALL DADD MOV A,C ;SET B TO X2 ADI 12Q ;TO X2 MOV B,A CALL DADD ;ADD TWO LOW WORDS DCR L ;BACK UP TO OVERFLOW MOV A,M ;GET IT MOV L,B ;NOW SET TO X2 OVERFLOW DCR L ;ITS AT B-1 ADC M ;ADD WITH CARRY - CARRY WAS PRESERVED RET ;ALL DONE, RETURN OVERFLOW IN A LSFT: MOV L,C ;SET PTR FOR LEFT SHIFT OF NUMBER DCR L ;BACK UP TO OVERFLOW XRA A ;OVERFLOW=0 1ST TIME TLOOP: MOV M,A ;SAVE OVERFLOW TLP2: DCR E ;TEST FOR DONE RM ;DONE WHEN E MINUS INR L ;MOVE TO LOW INR L INR L ;/***TP EXTENSION MOV A,M ;SHIFT LEFT 4 BYTES RAL MOV M,A ;PUT BACK DCR L ;/***TP - ALL DONE MOV A,M ;GET LOW RAL ;SHIFT LEFT 1 MOV M,A ;RESTORE IT DCR L ;BACK UP TO HIGH MOV A,M ;GET HIGH RAL ;SHIFT IT LEFT WITH CARRY MOV M,A ;PUT IT BACK DCR L ;BACK UP TO OVERFLOW MOV A,M ;GET OVERFLOW RAL ;SHIFT IT LEFT JMP TLOOP ;GO FOR MORE SIGN: ANI 200Q ;GET SIGN BIT MVI A,240Q ;SPACE INSTEAD OF PLUS JZ PLSV ;TEST FOR + MVI A,255Q ;NEGATIVE PLSV: CALL OUTR ;OUTPUT SIGN RET GCHR: MOV L,C ;GET CHARACTERISTIC GETA: INR L ;MOVE TO IT INR L INR L ;/***TP MOV A,M ;FETCH INTO A RET ;DONE MORD: CALL GETEX ;MUL OR DIV DEPENDING ON EXP MOV E,A ;SAVE DECIMAL EXP MOV B,L ;SET UP TO MULT OR DIV INR B ;NOW BOP POINTER SET MOV L,C ;L POINTS TO NUMBER TO CONVERT MOV A,C ;POINT C AT "RESULT" AREA ADI 11Q ;IN SCRATCH MOV C,A ;NOW C SET RIGHT MOV A,E ;NOW TEST FOR MUL ANI 200Q ;TEST NEGATIVE DEC. EXP. JZ DIVIT ;IF EXP IS + THEN DIVIDE CALL LMUL ;MULT. FINUP: MOV A,C ;SAVE LOC. OF RESULT MOV C,L ;C=LOC OF NUMBER (IT WAS DESTROYED) MOV L,A ;SET L TO LOC. OF RESULT MOV A,H ;SHOW RAM TO RAM TRANSFER CALL COPY ;MOVE RESULT TO NUMBER GETEX: MOV L,C ;NOW GET DECIMAL EXP INR L JMP GETA ;USE PART OF GCHR DIVIT: CALL LDIV ;DIVIDE JMP FINUP TWOD: CALL CTWO ;CONVERT TO 2 DIGITS MOV B,A ;SAVE ONES DIGIT CALL GETEX ;GET DECIMAL EXP MOV E,A ;SAVE A COPY ANI 200Q ;TEST FOR NEGATIVE JZ ADD1 ;BUMP EXP BY 1 SINCE 2 DIGITS DCR E ;DECREMENT NEGATIVE EXP SINCE 2 DIGITS FINIT: MOV M,E ;RESTORE EXP WITH NEW VALUE MOV A,B ;NOW DO 2ND DIGIT JMP INPOP ;GO OUT 2ND AND REST OF DIGITS ADD1: INR E ;COMPENSATE FOR 2 DIGITS JMP FINIT CTWO: MVI E,377Q ;CONVERT 2 DIGIT BIN TO BCD LOOP: INR E ;ADD UP TENS DIGIT SUI 12Q ;SUBTRACT 10 JP LOOP ;TILL NEGATIVE RESULT ADI 12Q ;RESTORE ONES DIGIT MOV B,A ;SAVE ONES DIGIT MOV A,E ;GET TENS DIGIT CALL DIGO ;OUTPUT IT MOV A,B ;SET A TO 2ND DIGIT RET COPT: MOV A,C ;COPY FROM 10N TO RAM ADI 5 MOV C,A ;SET C TO PLACE TO PUT MVI A,TEN5/256 CALL COPY ;COPY IT MOV A,C ;NOW RESET C SUI 5 MOV C,A ;ITS RESET RET COPY: MOV B,H ;SAVE RAM H MOV H,A ;SET TO SOURCE H MOV A,M ;GET 4 WORDS INTO THE REGS. INR L MOV D,M INR L MOV E,M INR L MOV L,M ;LAST ONE ERASES L MOV H,B ;SET TO DESTINATION RAM MOV B,L ;SAVE 4TH WORD IN B MOV L,C ;SET TO DESTINATION MOV M,A ;SAVE FIRST WORD INR L MOV A,M ;SAVE THIS WORD IN A (INPUT SAVES C HERE MOV M,D ;NOW PUT 2ND WORD INR L MOV M,E INR L MOV M,B ;ALL 4 COPIED NOW RET ;ALL DONE TEN5: .DB 303Q,120Q,0Q,21Q ;303240(8) = 100000. TEN: .DB 240Q,0Q,0Q,4Q ;12(8) = 10 ; ; SCRATCH MAP FOR I/O CONVERSION ROUTINES ; ; RELATIVE TO (C+2)USE ; C-2 DIGIT COUNT ; C-1 OVERFLOW ; C HIGH NUMBER - MANTISSA ; C+1 LOW NUMBER ; C+2 CHARACTERISTIC ; C+3 DECIMAL EXPONENT (SIGN & MAG.) ; C+4 TEN**N ; C+5 TEN**N ; C+6 TEN**N ; C+7 RESULT OF MULT & DIV ; C+8 AND TEMP FOR X2 ; C+9 " " ; C+10 L FOR NUMBER TO GO INTO (INPUT ONLY) ; C+11 DIGIT JUST INPUT (INPUT ONLY) ; ; ; /*****BEGIN INPUT************* ; ; ;HRJ was: ;ERR: ; STC ;ERROR FLAG ; RET ;AND RETURN ; replaced with code in (PDF) document HRJ ; ; ; SUBROUTINE ERR ; ERR: MVI A,277Q ;ERROR IN INPUT CALL OUTR ;SEND A ?(SPACE) MVI A,240Q ; CALL OUTR ;OUTPUT SPACE JMP PRMT ;GO PROMPT USER AND RESTART ;HRJ end replacing code ; ;******************************************************** ; //// 4 1/2 DIGIT INPUT ROUTINE ;******************************************************* ; ; ; /L POINTS TO WHERE TO PUT INPUT NUMBER ; /C POINTS TO 13(10) WORDS OF SCRATCH ; INPUT: MOV B,L ;SAVE ADDRESS WHERE DATA IS TO GO MOV A,C ;IN SCRATCH ADI 17Q ;COMPUTE LOC. IN SCRATCH MOV L,A MOV M,B ;PUT IT INR C ;OFFSET SCRATCH POINTER INR C ;BY 2 PRMT: MVI A,272Q ;PROMPT USER WITH : CALL OUTR ;OUTPUT : CALL ZROIT ;ZERO NUMBER INR L ;AND ZERO MOV M,A ;DECIMAL EXPONENT CALL GNUM ;GET INTEGER PART OF NUM CPI 376Q ;TERM=.? JZ DECPT ;YES TSTEX: CPI 25Q ;TEST FOR E JZ INEXP ;YES - HANDLE EXP CPI 360Q ;TEST FOR SPACE TERM (240B-260B) JNZ ERR ;NOT LEGAL TERM CALL FLTSGN ;FLOAT # AND SIGN IT SCALE: CALL GETEX ;GET DECIMAL EXP ANI 177Q ;GET GOOD BITS MOV E,A ;SAVE COPY ANI 100Q ;GET SIGN OF EXP RLC ;INTO SIGN BIT ORA A ;SET FLOPS MOV B,A ;SAVE SIGN MOV A,E ;GET EXP BACK JZ APLS ;JMP IS + MVI A,200Q ;MAKE MINUS + SUB E ;NOW ITS + APLS: ADD B ;SIGN NUMBER MOV M,A ;SAVE EXP (SIGN & MAG.) MVI L,TEN5 & 377Q ;TRY MORD WITH 10**5 FIRST CALL COPT ;TRANSFER TO RAM CALL GETEX ;GET DECIMAL EXP INT5: ANI 77Q ;GET MAG. OF EXP CPI 5Q ;TEST FOR USE OF 10**5 JM TRYTN ;WONT GO - TRY 10 CALL MORD ;WILL GO SO DO IT SUI 5Q ;MAG = MAG -5 MOV M,A ;UPDATE DEC. EXP IN MEM JMP INT5 ;GO TRY AGAIN TRYTN: MVI L,TEN & 377Q ;PUT TEN IN RAM CALL COPT CALL GETEX ;SET UP FOR LOOP INT1: ANI 77Q ;GET MAGNITUDE ORA A ;TEST FOR 0 JZ SAVEN ;DONE, MOVE NUM OUT AND GET OUT CALL MORD ;NOT DONE - DO 10 SUI 1Q ;EXP = EXP -1 MOV M,A ;UPDATE MEM JMP INT1 ;TRY AGAIN DECPT: MOV L,C ;ZERO DIGIT COUNT DCR L ;SINCE ITS NECESSARY DCR L ;TO COMPUTE EXP. MVI M,0 ;ZEROED CALL EP1 ;GNUM IN MIDDLE MOV E,A ;SAVE TERMINATOR MOV L,C ;MOVE DIGIT COUNT TO EXP DCR L ;BACK UP TO DIGIT COUNT DCR L MOV B,M ;GOT DIGIT COUNT CALL GETEX ;SET L TO DEC. EXP MOV M,B ;PUT EXP MOV A,E ;TERM BACK TO A JMP TSTEX ;TEST FOR E+OR-XX INEXP: CALL FLTSGN ;FLOAT AND SIGN NUMBER CALL SAVEN ;SAVE NUMBER IN (L) TEMP CALL ZROIT ;ZERO OUT NUM. FOR INPUTTING EXP CALL GNUM ;NOW INPUT EXPONENT CPI 360Q ;TEST FOR SPACE TERM. JNZ ERR ;NOT LEGAL - TRY AGAIN MOV L,C ;GET EXP OUT OF MEM INR L ;/***TP INR L ;EXP LIMITED TO 5 BITS MOV A,M ;GET LOWEST 8 BITS ANI 37Q ;GET GOOD BITS MOV B,A ;SAVE THEM INR L ;GET SIGN OF EXP MOV A,M ;INTO A ORA A ;SET FLOPS MOV A,B ;IN CASE NOTHING TO DO JM USEIT ;IF NEG. USE AS + MVI A,0Q ;IF + MAKE - SUB B ;0-X = -X USEIT: INR L ;POINT AT EXP ADD M ;GET REAL DEC. EXP MOV M,A ;PUT IN MEM MOV A,C ;NOW GET NUMBER BACK ADI 15Q ;GET ADD OF L MOV L,A ;L POINTS TO L OF NUMBER MOV L,M ;NOW L POINTS TO NUMBER MOV A,H ;RAM TO RAM COPY CALL COPY ;COPY IT BACK JMP SCALE ;NOW ADJUST FOR EXP GNUM: CALL INP ;GET A CHAR CPI 240Q ;IGNORE LEADING SPACES JZ GNUM CPI 255Q ;TEST FOR - JNZ TRYP ;NOT MINUS MOV L,C ;MINUS SO SET SIGN INR L ;IN CHAR LOC. INR L ;/***TP INR L MVI M,200Q ;SET - SIGN JMP GNUM TRYP: CPI 253Q ;IGNORE + JZ GNUM TSTN: SUI 260Q ;STRIP ASCII RM ;RETURN IF TERM CPI 12Q ;TEST FOR NUMBER RP ;ILLEGAL MOV E,A ;SAVE DIGIT CALL GETN ;LOC. OF DIGIT STORAGE TO L MOV M,E ;SAVE DIGIT CALL MULTT ;MULT NUMBER BY 10 ORA A ;TEST FOR TOO MANY DIGITS RNZ ;TOO MANY DIGITS CALL GETN ;GET DIGIT MOV L,C ;SET L TO NUMBER INR L INR L ;/***TP ADD M ;ADD IN THE DIGIT MOV M,A ;PUT RESULT BACK DCR L ;NOW DO HIGH MOV A,M ;GET HIGH TO ADD IN CARRY ACI 0Q ;ADD IN CARRY MOV M,A ;UPDATE HIGH DCR L ;/***TP EXTENSION MOV A,M ACI 0Q ;ADD IN CARRY MOV M,A ;/***TP ALL DONE RC ;OVERFLOW ERROR DCR L ;BUMP DIGIT COUNT NOW DCR L MOV B,M ;GET DIGIT COUNT INR B ;BUMP DIGIT COUNT MOV M,B ;UPDATE DIGIT COUNT EP1: CALL INP ;GET NEXT CHAR JMP TSTN ;MUST BE NUM. OR TERM FLTSGN: MOV L,C ;POINT L AT NUMBER TO FLOAT JMP FLOAT ;GO FLOAT IT SAVEN: MOV A,C ;PUT NUMBER IN (L) ADI 15Q ;GET ADD OF L MOV L,A MOV E,M ;GET L OF RESULT MOV L,E ;POINT L AT (L) INR L ;SET TO 2ND WORD TO SAVE C MOV M,C ;SAVE C IN (L) +1 SINCE IT WILL BE DESTROYED MOV L,C ;SET UP TO CALL COPY MOV C,E ;NOW L&C SET MOV A,H ;RAM TO RAM COPY CALL COPY ;COPY TO L MOV C,A ;(L)+1 RETURNED HERE SO SET AS C ;ORA A ;MAKE SURE CY=0 (NO ERROR) ;HRJ ORA above not in LLL document RET ;NOW EVERYTHING HUNKY-DORRY GETN: MOV A,C ;GET DIGIT ADI 16Q ;LAST LOC. IN SCRATCH MOV L,A ;PUT IN L MOV A,M ;GET DIGIT RET ZROIT: MOV L,C ;ZERO NUMBER XRA A MOV M,A ;/***TP INR L ;/***TP MOV M,A INR L MOV M,A INR L ;NOW SET SIGN TO + MOV M,A RET ;DONE ; ; ; END of code from LLNL PDF document ; .END
Lisp65/tests/cellTest.asm
Martin-H1/6502
3
98759
<reponame>Martin-H1/6502 ; ----------------------------------------------------------------------------- ; Test for heap functions under py65mon. ; <NAME> <<EMAIL>> ; ----------------------------------------------------------------------------- .word $8000 .org $8000 .outfile "tests/cellTest.rom" .alias RamSize $7EFF ; default $8000 for 32 kb x 8 bit RAM .alias heap_base $0400 ; The heap starts on page 4. .alias heap_size $4000 ; It's size is 16 KB. .require "../../Common/data.asm" .advance $c000 .require "../../Common/array.asm" .require "../cell.asm" .require "../../Common/conio.asm" .require "../gc.asm" .require "../../Common/heap.asm" .require "../../Common/math16.asm" .require "../../Common/print.asm" .require "../../Common/stack.asm" .require "../../Common/string.asm" .require "mockConio.asm" ; Main entry point for the test main: ldx #SP0 ; Reset stack pointer `pushi getch_impl ; Initialize the console vectors. `pushi putch_impl jsr conIoInit `pushi heap_size `pushi heap_base jsr gcInit jsr null_test jsr mknumber_test jsr mkcons_test jsr replace_test jsr mkstring_test jsr carcdr_test jsr mark_test brk .scope ; Do a set of tests that should always return null. _name: .byte "*** null test ***",0 _string1Cell: .byte C_STRING _string1: .byte "Cell Test Enter",0 null_test: `println _name ; Push a null and invoke car and cdr on it. `pushi 0 jsr cellCar jsr cellCdr `pushi _string1 jsr cellCar `pushi _string1 jsr cellCdr jsr printstack `drop `drop `drop rts .scend .scope _name: .byte "*** mknumber test ***",0 mknumber_test: `println _name ; Push a null and invoke car and cdr on it. `pushi $7e10 jsr cellMkNumber jsr cellPrint `printcr rts .scend .scope _name: .byte "*** cons test ***",0 .byte C_STRING _argA: .byte "A",0 .byte C_STRING _argB: .byte "B",0 mkcons_test: `println _name `pushi _argA `pushzero jsr cellMkCons `dup jsr cellPrint `printcr `pushi _argB `pushzero jsr cellMkCons `dup jsr cellPrint `printcr jsr printstack rts .scend .scope _name: .byte "*** mkstring test ***",0 _string1Cell: .byte C_STRING _string1: .byte "Cell Test Enter",0 _string2: .byte "Cell Test Exit",0 mkstring_test: `println _name ; Test cellPrint with a hand built cell `pushi _string1 jsr cellPrint `printcr ; Now use a cell constructor to make a cell. `pushi _string2 jsr cellMkString jsr cellPrint `printcr `printcr rts .scend .scope _name: .byte "*** car cdr test ***",0 carcdr_test: `println _name `dup `dup jsr cellCar `swap jsr cellCdr jsr printstack jsr cellPrint `printcr jsr cellPrint `printcr jsr printstack rts .scend .scope _name: .byte "*** replace test ***",0 .byte C_STRING _argC: .byte "C",0 replace_test: `println _name `over ; Test replace cdr operator jsr cellRplacd `dup jsr cellPrint `printcr `pushi _argC `over jsr cellRplaca `dup jsr cellPrint `printcr jsr printstack rts .scend .scope _name: .byte "*** mark test ***",0 _msg1: .byte "mark = ",0 mark_test: `println _name ; Call mark and see if it recursively marks other cells. `print _msg1 `cellGetMark jsr printa `printcr `dup jsr cellMark `print _msg1 `cellGetMark jsr printa `printcr `dup jsr cellCar `print _msg1 `cellGetMark jsr printa `printcr jsr printstack `printcr rts .scend .require "../../Common/vectors.asm"
oeis/057/A057656.asm
neoneye/loda-programs
22
93873
; A057656: Number of points (x,y) in square lattice with (x-1/2)^2+y^2 <= n. ; 2,6,8,12,16,16,22,26,26,30,34,38,40,44,44,48,56,56,60,60,62,70,74,74,78,82,82,86,90,94,96,104,104,104,108,108,116,120,124,128,128,128,134,138,138,142,150,150,154,158,158,166,166,166,166,174 lpb $0 mov $2,$0 sub $0,1 seq $2,8441 ; Number of ways of writing n as the sum of 2 triangular numbers. add $3,$2 lpe mov $0,$3 mul $0,2 add $0,2
kernel.asm
exceldeo/FP_SISOP20_E02
0
242514
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>: 8010000c: 0f 20 e0 mov %cr4,%eax 8010000f: 83 c8 10 or $0x10,%eax 80100012: 0f 22 e0 mov %eax,%cr4 80100015: b8 00 90 10 00 mov $0x109000,%eax 8010001a: 0f 22 d8 mov %eax,%cr3 8010001d: 0f 20 c0 mov %cr0,%eax 80100020: 0d 00 00 01 80 or $0x80010000,%eax 80100025: 0f 22 c0 mov %eax,%cr0 80100028: bc c0 b5 10 80 mov $0x8010b5c0,%esp 8010002d: b8 a0 2e 10 80 mov $0x80102ea0,%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 0c sub $0xc,%esp initlock(&bcache.lock, "bcache"); 8010004c: 68 c0 6e 10 80 push $0x80106ec0 80100051: 68 c0 b5 10 80 push $0x8010b5c0 80100056: e8 a5 41 00 00 call 80104200 <initlock> bcache.head.prev = &bcache.head; 8010005b: c7 05 0c fd 10 80 bc movl $0x8010fcbc,0x8010fd0c 80100062: fc 10 80 bcache.head.next = &bcache.head; 80100065: c7 05 10 fd 10 80 bc movl $0x8010fcbc,0x8010fd10 8010006c: fc 10 80 8010006f: 83 c4 10 add $0x10,%esp 80100072: ba bc fc 10 80 mov $0x8010fcbc,%edx 80100077: eb 09 jmp 80100082 <binit+0x42> 80100079: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80100080: 89 c3 mov %eax,%ebx b->next = bcache.head.next; b->prev = &bcache.head; initsleeplock(&b->lock, "buffer"); 80100082: 8d 43 0c lea 0xc(%ebx),%eax 80100085: 83 ec 08 sub $0x8,%esp b->next = bcache.head.next; 80100088: 89 53 54 mov %edx,0x54(%ebx) b->prev = &bcache.head; 8010008b: c7 43 50 bc fc 10 80 movl $0x8010fcbc,0x50(%ebx) initsleeplock(&b->lock, "buffer"); 80100092: 68 c7 6e 10 80 push $0x80106ec7 80100097: 50 push %eax 80100098: e8 33 40 00 00 call 801040d0 <initsleeplock> bcache.head.next->prev = b; 8010009d: a1 10 fd 10 80 mov 0x8010fd10,%eax for(b = bcache.buf; b < bcache.buf+NBUF; b++){ 801000a2: 83 c4 10 add $0x10,%esp 801000a5: 89 da mov %ebx,%edx bcache.head.next->prev = b; 801000a7: 89 58 50 mov %ebx,0x50(%eax) for(b = bcache.buf; b < bcache.buf+NBUF; b++){ 801000aa: 8d 83 5c 02 00 00 lea 0x25c(%ebx),%eax bcache.head.next = b; 801000b0: 89 1d 10 fd 10 80 mov %ebx,0x8010fd10 for(b = bcache.buf; b < bcache.buf+NBUF; b++){ 801000b6: 3d bc fc 10 80 cmp $0x8010fcbc,%eax 801000bb: 72 c3 jb 80100080 <binit+0x40> } } 801000bd: 8b 5d fc mov -0x4(%ebp),%ebx 801000c0: c9 leave 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 18 sub $0x18,%esp 801000d9: 8b 75 08 mov 0x8(%ebp),%esi 801000dc: 8b 7d 0c mov 0xc(%ebp),%edi acquire(&bcache.lock); 801000df: 68 c0 b5 10 80 push $0x8010b5c0 801000e4: e8 57 42 00 00 call 80104340 <acquire> for(b = bcache.head.next; b != &bcache.head; b = b->next){ 801000e9: 8b 1d 10 fd 10 80 mov 0x8010fd10,%ebx 801000ef: 83 c4 10 add $0x10,%esp 801000f2: 81 fb bc fc 10 80 cmp $0x8010fcbc,%ebx 801000f8: 75 11 jne 8010010b <bread+0x3b> 801000fa: eb 24 jmp 80100120 <bread+0x50> 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 60 jmp 80100190 <bread+0xc0> 80100130: 8b 5b 50 mov 0x50(%ebx),%ebx 80100133: 81 fb bc fc 10 80 cmp $0x8010fcbc,%ebx 80100139: 74 55 je 80100190 <bread+0xc0> 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: 83 ec 0c sub $0xc,%esp 8010015d: 68 c0 b5 10 80 push $0x8010b5c0 80100162: e8 99 42 00 00 call 80104400 <release> acquiresleep(&b->lock); 80100167: 8d 43 0c lea 0xc(%ebx),%eax 8010016a: 89 04 24 mov %eax,(%esp) 8010016d: e8 9e 3f 00 00 call 80104110 <acquiresleep> 80100172: 83 c4 10 add $0x10,%esp struct buf *b; b = bget(dev, blockno); if((b->flags & B_VALID) == 0) { 80100175: f6 03 02 testb $0x2,(%ebx) 80100178: 75 0c jne 80100186 <bread+0xb6> iderw(b); 8010017a: 83 ec 0c sub $0xc,%esp 8010017d: 53 push %ebx 8010017e: e8 9d 1f 00 00 call 80102120 <iderw> 80100183: 83 c4 10 add $0x10,%esp } return b; } 80100186: 8d 65 f4 lea -0xc(%ebp),%esp 80100189: 89 d8 mov %ebx,%eax 8010018b: 5b pop %ebx 8010018c: 5e pop %esi 8010018d: 5f pop %edi 8010018e: 5d pop %ebp 8010018f: c3 ret panic("bget: no buffers"); 80100190: 83 ec 0c sub $0xc,%esp 80100193: 68 ce 6e 10 80 push $0x80106ece 80100198: e8 f3 01 00 00 call 80100390 <panic> 8010019d: 8d 76 00 lea 0x0(%esi),%esi 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 10 sub $0x10,%esp 801001a7: 8b 5d 08 mov 0x8(%ebp),%ebx if(!holdingsleep(&b->lock)) 801001aa: 8d 43 0c lea 0xc(%ebx),%eax 801001ad: 50 push %eax 801001ae: e8 fd 3f 00 00 call 801041b0 <holdingsleep> 801001b3: 83 c4 10 add $0x10,%esp 801001b6: 85 c0 test %eax,%eax 801001b8: 74 0f je 801001c9 <bwrite+0x29> panic("bwrite"); b->flags |= B_DIRTY; 801001ba: 83 0b 04 orl $0x4,(%ebx) iderw(b); 801001bd: 89 5d 08 mov %ebx,0x8(%ebp) } 801001c0: 8b 5d fc mov -0x4(%ebp),%ebx 801001c3: c9 leave iderw(b); 801001c4: e9 57 1f 00 00 jmp 80102120 <iderw> panic("bwrite"); 801001c9: 83 ec 0c sub $0xc,%esp 801001cc: 68 df 6e 10 80 push $0x80106edf 801001d1: e8 ba 01 00 00 call 80100390 <panic> 801001d6: 8d 76 00 lea 0x0(%esi),%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: 8b 5d 08 mov 0x8(%ebp),%ebx if(!holdingsleep(&b->lock)) 801001e8: 83 ec 0c sub $0xc,%esp 801001eb: 8d 73 0c lea 0xc(%ebx),%esi 801001ee: 56 push %esi 801001ef: e8 bc 3f 00 00 call 801041b0 <holdingsleep> 801001f4: 83 c4 10 add $0x10,%esp 801001f7: 85 c0 test %eax,%eax 801001f9: 74 66 je 80100261 <brelse+0x81> panic("brelse"); releasesleep(&b->lock); 801001fb: 83 ec 0c sub $0xc,%esp 801001fe: 56 push %esi 801001ff: e8 6c 3f 00 00 call 80104170 <releasesleep> acquire(&bcache.lock); 80100204: c7 04 24 c0 b5 10 80 movl $0x8010b5c0,(%esp) 8010020b: e8 30 41 00 00 call 80104340 <acquire> b->refcnt--; 80100210: 8b 43 4c mov 0x4c(%ebx),%eax if (b->refcnt == 0) { 80100213: 83 c4 10 add $0x10,%esp b->refcnt--; 80100216: 83 e8 01 sub $0x1,%eax if (b->refcnt == 0) { 80100219: 85 c0 test %eax,%eax b->refcnt--; 8010021b: 89 43 4c mov %eax,0x4c(%ebx) if (b->refcnt == 0) { 8010021e: 75 2f jne 8010024f <brelse+0x6f> // no one is waiting for it. b->next->prev = b->prev; 80100220: 8b 43 54 mov 0x54(%ebx),%eax 80100223: 8b 53 50 mov 0x50(%ebx),%edx 80100226: 89 50 50 mov %edx,0x50(%eax) b->prev->next = b->next; 80100229: 8b 43 50 mov 0x50(%ebx),%eax 8010022c: 8b 53 54 mov 0x54(%ebx),%edx 8010022f: 89 50 54 mov %edx,0x54(%eax) b->next = bcache.head.next; 80100232: a1 10 fd 10 80 mov 0x8010fd10,%eax b->prev = &bcache.head; 80100237: c7 43 50 bc fc 10 80 movl $0x8010fcbc,0x50(%ebx) b->next = bcache.head.next; 8010023e: 89 43 54 mov %eax,0x54(%ebx) bcache.head.next->prev = b; 80100241: a1 10 fd 10 80 mov 0x8010fd10,%eax 80100246: 89 58 50 mov %ebx,0x50(%eax) bcache.head.next = b; 80100249: 89 1d 10 fd 10 80 mov %ebx,0x8010fd10 } release(&bcache.lock); 8010024f: c7 45 08 c0 b5 10 80 movl $0x8010b5c0,0x8(%ebp) } 80100256: 8d 65 f8 lea -0x8(%ebp),%esp 80100259: 5b pop %ebx 8010025a: 5e pop %esi 8010025b: 5d pop %ebp release(&bcache.lock); 8010025c: e9 9f 41 00 00 jmp 80104400 <release> panic("brelse"); 80100261: 83 ec 0c sub $0xc,%esp 80100264: 68 e6 6e 10 80 push $0x80106ee6 80100269: e8 22 01 00 00 call 80100390 <panic> 8010026e: 66 90 xchg %ax,%ax 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 28 sub $0x28,%esp 80100279: 8b 7d 08 mov 0x8(%ebp),%edi 8010027c: 8b 75 0c mov 0xc(%ebp),%esi uint target; int c; iunlock(ip); 8010027f: 57 push %edi 80100280: e8 db 14 00 00 call 80101760 <iunlock> target = n; acquire(&cons.lock); 80100285: c7 04 24 20 a5 10 80 movl $0x8010a520,(%esp) 8010028c: e8 af 40 00 00 call 80104340 <acquire> while(n > 0){ 80100291: 8b 5d 10 mov 0x10(%ebp),%ebx 80100294: 83 c4 10 add $0x10,%esp 80100297: 31 c0 xor %eax,%eax 80100299: 85 db test %ebx,%ebx 8010029b: 0f 8e a1 00 00 00 jle 80100342 <consoleread+0xd2> while(input.r == input.w){ 801002a1: 8b 15 a0 ff 10 80 mov 0x8010ffa0,%edx 801002a7: 39 15 a4 ff 10 80 cmp %edx,0x8010ffa4 801002ad: 74 2c je 801002db <consoleread+0x6b> 801002af: eb 5f jmp 80100310 <consoleread+0xa0> 801002b1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(myproc()->killed){ release(&cons.lock); ilock(ip); return -1; } sleep(&input.r, &cons.lock); 801002b8: 83 ec 08 sub $0x8,%esp 801002bb: 68 20 a5 10 80 push $0x8010a520 801002c0: 68 a0 ff 10 80 push $0x8010ffa0 801002c5: e8 b6 3a 00 00 call 80103d80 <sleep> while(input.r == input.w){ 801002ca: 8b 15 a0 ff 10 80 mov 0x8010ffa0,%edx 801002d0: 83 c4 10 add $0x10,%esp 801002d3: 3b 15 a4 ff 10 80 cmp 0x8010ffa4,%edx 801002d9: 75 35 jne 80100310 <consoleread+0xa0> if(myproc()->killed){ 801002db: e8 00 35 00 00 call 801037e0 <myproc> 801002e0: 8b 40 24 mov 0x24(%eax),%eax 801002e3: 85 c0 test %eax,%eax 801002e5: 74 d1 je 801002b8 <consoleread+0x48> release(&cons.lock); 801002e7: 83 ec 0c sub $0xc,%esp 801002ea: 68 20 a5 10 80 push $0x8010a520 801002ef: e8 0c 41 00 00 call 80104400 <release> ilock(ip); 801002f4: 89 3c 24 mov %edi,(%esp) 801002f7: e8 84 13 00 00 call 80101680 <ilock> return -1; 801002fc: 83 c4 10 add $0x10,%esp } release(&cons.lock); ilock(ip); return target - n; } 801002ff: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 80100302: b8 ff ff ff ff mov $0xffffffff,%eax } 80100307: 5b pop %ebx 80100308: 5e pop %esi 80100309: 5f pop %edi 8010030a: 5d pop %ebp 8010030b: c3 ret 8010030c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi c = input.buf[input.r++ % INPUT_BUF]; 80100310: 8d 42 01 lea 0x1(%edx),%eax 80100313: a3 a0 ff 10 80 mov %eax,0x8010ffa0 80100318: 89 d0 mov %edx,%eax 8010031a: 83 e0 7f and $0x7f,%eax 8010031d: 0f be 80 20 ff 10 80 movsbl -0x7fef00e0(%eax),%eax if(c == C('D')){ // EOF 80100324: 83 f8 04 cmp $0x4,%eax 80100327: 74 3f je 80100368 <consoleread+0xf8> *dst++ = c; 80100329: 83 c6 01 add $0x1,%esi --n; 8010032c: 83 eb 01 sub $0x1,%ebx if(c == '\n') 8010032f: 83 f8 0a cmp $0xa,%eax *dst++ = c; 80100332: 88 46 ff mov %al,-0x1(%esi) if(c == '\n') 80100335: 74 43 je 8010037a <consoleread+0x10a> while(n > 0){ 80100337: 85 db test %ebx,%ebx 80100339: 0f 85 62 ff ff ff jne 801002a1 <consoleread+0x31> 8010033f: 8b 45 10 mov 0x10(%ebp),%eax release(&cons.lock); 80100342: 83 ec 0c sub $0xc,%esp 80100345: 89 45 e4 mov %eax,-0x1c(%ebp) 80100348: 68 20 a5 10 80 push $0x8010a520 8010034d: e8 ae 40 00 00 call 80104400 <release> ilock(ip); 80100352: 89 3c 24 mov %edi,(%esp) 80100355: e8 26 13 00 00 call 80101680 <ilock> return target - n; 8010035a: 8b 45 e4 mov -0x1c(%ebp),%eax 8010035d: 83 c4 10 add $0x10,%esp } 80100360: 8d 65 f4 lea -0xc(%ebp),%esp 80100363: 5b pop %ebx 80100364: 5e pop %esi 80100365: 5f pop %edi 80100366: 5d pop %ebp 80100367: c3 ret 80100368: 8b 45 10 mov 0x10(%ebp),%eax 8010036b: 29 d8 sub %ebx,%eax if(n < target){ 8010036d: 3b 5d 10 cmp 0x10(%ebp),%ebx 80100370: 73 d0 jae 80100342 <consoleread+0xd2> input.r--; 80100372: 89 15 a0 ff 10 80 mov %edx,0x8010ffa0 80100378: eb c8 jmp 80100342 <consoleread+0xd2> 8010037a: 8b 45 10 mov 0x10(%ebp),%eax 8010037d: 29 d8 sub %ebx,%eax 8010037f: eb c1 jmp 80100342 <consoleread+0xd2> 80100381: eb 0d jmp 80100390 <panic> 80100383: 90 nop 80100384: 90 nop 80100385: 90 nop 80100386: 90 nop 80100387: 90 nop 80100388: 90 nop 80100389: 90 nop 8010038a: 90 nop 8010038b: 90 nop 8010038c: 90 nop 8010038d: 90 nop 8010038e: 90 nop 8010038f: 90 nop 80100390 <panic>: { 80100390: 55 push %ebp 80100391: 89 e5 mov %esp,%ebp 80100393: 56 push %esi 80100394: 53 push %ebx 80100395: 83 ec 30 sub $0x30,%esp } static inline void cli(void) { asm volatile("cli"); 80100398: fa cli cons.locking = 0; 80100399: c7 05 54 a5 10 80 00 movl $0x0,0x8010a554 801003a0: 00 00 00 getcallerpcs(&s, pcs); 801003a3: 8d 5d d0 lea -0x30(%ebp),%ebx 801003a6: 8d 75 f8 lea -0x8(%ebp),%esi cprintf("lapicid %d: panic: ", lapicid()); 801003a9: e8 82 23 00 00 call 80102730 <lapicid> 801003ae: 83 ec 08 sub $0x8,%esp 801003b1: 50 push %eax 801003b2: 68 ed 6e 10 80 push $0x80106eed 801003b7: e8 a4 02 00 00 call 80100660 <cprintf> cprintf(s); 801003bc: 58 pop %eax 801003bd: ff 75 08 pushl 0x8(%ebp) 801003c0: e8 9b 02 00 00 call 80100660 <cprintf> cprintf("\n"); 801003c5: c7 04 24 37 78 10 80 movl $0x80107837,(%esp) 801003cc: e8 8f 02 00 00 call 80100660 <cprintf> getcallerpcs(&s, pcs); 801003d1: 5a pop %edx 801003d2: 8d 45 08 lea 0x8(%ebp),%eax 801003d5: 59 pop %ecx 801003d6: 53 push %ebx 801003d7: 50 push %eax 801003d8: e8 43 3e 00 00 call 80104220 <getcallerpcs> 801003dd: 83 c4 10 add $0x10,%esp cprintf(" %p", pcs[i]); 801003e0: 83 ec 08 sub $0x8,%esp 801003e3: ff 33 pushl (%ebx) 801003e5: 83 c3 04 add $0x4,%ebx 801003e8: 68 01 6f 10 80 push $0x80106f01 801003ed: e8 6e 02 00 00 call 80100660 <cprintf> for(i=0; i<10; i++) 801003f2: 83 c4 10 add $0x10,%esp 801003f5: 39 f3 cmp %esi,%ebx 801003f7: 75 e7 jne 801003e0 <panic+0x50> panicked = 1; // freeze other CPU 801003f9: c7 05 58 a5 10 80 01 movl $0x1,0x8010a558 80100400: 00 00 00 80100403: eb fe jmp 80100403 <panic+0x73> 80100405: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100409: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80100410 <consputc>: if(panicked){ 80100410: 8b 0d 58 a5 10 80 mov 0x8010a558,%ecx 80100416: 85 c9 test %ecx,%ecx 80100418: 74 06 je 80100420 <consputc+0x10> 8010041a: fa cli 8010041b: eb fe jmp 8010041b <consputc+0xb> 8010041d: 8d 76 00 lea 0x0(%esi),%esi { 80100420: 55 push %ebp 80100421: 89 e5 mov %esp,%ebp 80100423: 57 push %edi 80100424: 56 push %esi 80100425: 53 push %ebx 80100426: 89 c6 mov %eax,%esi 80100428: 83 ec 0c sub $0xc,%esp if(c == BACKSPACE){ 8010042b: 3d 00 01 00 00 cmp $0x100,%eax 80100430: 0f 84 b1 00 00 00 je 801004e7 <consputc+0xd7> uartputc(c); 80100436: 83 ec 0c sub $0xc,%esp 80100439: 50 push %eax 8010043a: e8 81 56 00 00 call 80105ac0 <uartputc> 8010043f: 83 c4 10 add $0x10,%esp asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80100442: bb d4 03 00 00 mov $0x3d4,%ebx 80100447: b8 0e 00 00 00 mov $0xe,%eax 8010044c: 89 da mov %ebx,%edx 8010044e: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010044f: b9 d5 03 00 00 mov $0x3d5,%ecx 80100454: 89 ca mov %ecx,%edx 80100456: ec in (%dx),%al pos = inb(CRTPORT+1) << 8; 80100457: 0f b6 c0 movzbl %al,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 8010045a: 89 da mov %ebx,%edx 8010045c: c1 e0 08 shl $0x8,%eax 8010045f: 89 c7 mov %eax,%edi 80100461: b8 0f 00 00 00 mov $0xf,%eax 80100466: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80100467: 89 ca mov %ecx,%edx 80100469: ec in (%dx),%al 8010046a: 0f b6 d8 movzbl %al,%ebx pos |= inb(CRTPORT+1); 8010046d: 09 fb or %edi,%ebx if(c == '\n') 8010046f: 83 fe 0a cmp $0xa,%esi 80100472: 0f 84 f3 00 00 00 je 8010056b <consputc+0x15b> else if(c == BACKSPACE){ 80100478: 81 fe 00 01 00 00 cmp $0x100,%esi 8010047e: 0f 84 d7 00 00 00 je 8010055b <consputc+0x14b> crt[pos++] = (c&0xff) | 0x0700; // black on white 80100484: 89 f0 mov %esi,%eax 80100486: 0f b6 c0 movzbl %al,%eax 80100489: 80 cc 07 or $0x7,%ah 8010048c: 66 89 84 1b 00 80 0b mov %ax,-0x7ff48000(%ebx,%ebx,1) 80100493: 80 80100494: 83 c3 01 add $0x1,%ebx if(pos < 0 || pos > 25*80) 80100497: 81 fb d0 07 00 00 cmp $0x7d0,%ebx 8010049d: 0f 8f ab 00 00 00 jg 8010054e <consputc+0x13e> if((pos/80) >= 24){ // Scroll up. 801004a3: 81 fb 7f 07 00 00 cmp $0x77f,%ebx 801004a9: 7f 66 jg 80100511 <consputc+0x101> asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801004ab: be d4 03 00 00 mov $0x3d4,%esi 801004b0: b8 0e 00 00 00 mov $0xe,%eax 801004b5: 89 f2 mov %esi,%edx 801004b7: ee out %al,(%dx) 801004b8: b9 d5 03 00 00 mov $0x3d5,%ecx outb(CRTPORT+1, pos>>8); 801004bd: 89 d8 mov %ebx,%eax 801004bf: c1 f8 08 sar $0x8,%eax 801004c2: 89 ca mov %ecx,%edx 801004c4: ee out %al,(%dx) 801004c5: b8 0f 00 00 00 mov $0xf,%eax 801004ca: 89 f2 mov %esi,%edx 801004cc: ee out %al,(%dx) 801004cd: 89 d8 mov %ebx,%eax 801004cf: 89 ca mov %ecx,%edx 801004d1: ee out %al,(%dx) crt[pos] = ' ' | 0x0700; 801004d2: b8 20 07 00 00 mov $0x720,%eax 801004d7: 66 89 84 1b 00 80 0b mov %ax,-0x7ff48000(%ebx,%ebx,1) 801004de: 80 } 801004df: 8d 65 f4 lea -0xc(%ebp),%esp 801004e2: 5b pop %ebx 801004e3: 5e pop %esi 801004e4: 5f pop %edi 801004e5: 5d pop %ebp 801004e6: c3 ret uartputc('\b'); uartputc(' '); uartputc('\b'); 801004e7: 83 ec 0c sub $0xc,%esp 801004ea: 6a 08 push $0x8 801004ec: e8 cf 55 00 00 call 80105ac0 <uartputc> 801004f1: c7 04 24 20 00 00 00 movl $0x20,(%esp) 801004f8: e8 c3 55 00 00 call 80105ac0 <uartputc> 801004fd: c7 04 24 08 00 00 00 movl $0x8,(%esp) 80100504: e8 b7 55 00 00 call 80105ac0 <uartputc> 80100509: 83 c4 10 add $0x10,%esp 8010050c: e9 31 ff ff ff jmp 80100442 <consputc+0x32> memmove(crt, crt+80, sizeof(crt[0])*23*80); 80100511: 52 push %edx 80100512: 68 60 0e 00 00 push $0xe60 pos -= 80; 80100517: 83 eb 50 sub $0x50,%ebx memmove(crt, crt+80, sizeof(crt[0])*23*80); 8010051a: 68 a0 80 0b 80 push $0x800b80a0 8010051f: 68 00 80 0b 80 push $0x800b8000 80100524: e8 d7 3f 00 00 call 80104500 <memmove> memset(crt+pos, 0, sizeof(crt[0])*(24*80 - pos)); 80100529: b8 80 07 00 00 mov $0x780,%eax 8010052e: 83 c4 0c add $0xc,%esp 80100531: 29 d8 sub %ebx,%eax 80100533: 01 c0 add %eax,%eax 80100535: 50 push %eax 80100536: 8d 04 1b lea (%ebx,%ebx,1),%eax 80100539: 6a 00 push $0x0 8010053b: 2d 00 80 f4 7f sub $0x7ff48000,%eax 80100540: 50 push %eax 80100541: e8 0a 3f 00 00 call 80104450 <memset> 80100546: 83 c4 10 add $0x10,%esp 80100549: e9 5d ff ff ff jmp 801004ab <consputc+0x9b> panic("pos under/overflow"); 8010054e: 83 ec 0c sub $0xc,%esp 80100551: 68 05 6f 10 80 push $0x80106f05 80100556: e8 35 fe ff ff call 80100390 <panic> if(pos > 0) --pos; 8010055b: 85 db test %ebx,%ebx 8010055d: 0f 84 48 ff ff ff je 801004ab <consputc+0x9b> 80100563: 83 eb 01 sub $0x1,%ebx 80100566: e9 2c ff ff ff jmp 80100497 <consputc+0x87> pos += 80 - pos%80; 8010056b: 89 d8 mov %ebx,%eax 8010056d: b9 50 00 00 00 mov $0x50,%ecx 80100572: 99 cltd 80100573: f7 f9 idiv %ecx 80100575: 29 d1 sub %edx,%ecx 80100577: 01 cb add %ecx,%ebx 80100579: e9 19 ff ff ff jmp 80100497 <consputc+0x87> 8010057e: 66 90 xchg %ax,%ax 80100580 <printint>: { 80100580: 55 push %ebp 80100581: 89 e5 mov %esp,%ebp 80100583: 57 push %edi 80100584: 56 push %esi 80100585: 53 push %ebx 80100586: 89 d3 mov %edx,%ebx 80100588: 83 ec 2c sub $0x2c,%esp if(sign && (sign = xx < 0)) 8010058b: 85 c9 test %ecx,%ecx { 8010058d: 89 4d d4 mov %ecx,-0x2c(%ebp) if(sign && (sign = xx < 0)) 80100590: 74 04 je 80100596 <printint+0x16> 80100592: 85 c0 test %eax,%eax 80100594: 78 5a js 801005f0 <printint+0x70> x = xx; 80100596: c7 45 d4 00 00 00 00 movl $0x0,-0x2c(%ebp) i = 0; 8010059d: 31 c9 xor %ecx,%ecx 8010059f: 8d 75 d7 lea -0x29(%ebp),%esi 801005a2: eb 06 jmp 801005aa <printint+0x2a> 801005a4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi buf[i++] = digits[x % base]; 801005a8: 89 f9 mov %edi,%ecx 801005aa: 31 d2 xor %edx,%edx 801005ac: 8d 79 01 lea 0x1(%ecx),%edi 801005af: f7 f3 div %ebx 801005b1: 0f b6 92 30 6f 10 80 movzbl -0x7fef90d0(%edx),%edx }while((x /= base) != 0); 801005b8: 85 c0 test %eax,%eax buf[i++] = digits[x % base]; 801005ba: 88 14 3e mov %dl,(%esi,%edi,1) }while((x /= base) != 0); 801005bd: 75 e9 jne 801005a8 <printint+0x28> if(sign) 801005bf: 8b 45 d4 mov -0x2c(%ebp),%eax 801005c2: 85 c0 test %eax,%eax 801005c4: 74 08 je 801005ce <printint+0x4e> buf[i++] = '-'; 801005c6: c6 44 3d d8 2d movb $0x2d,-0x28(%ebp,%edi,1) 801005cb: 8d 79 02 lea 0x2(%ecx),%edi 801005ce: 8d 5c 3d d7 lea -0x29(%ebp,%edi,1),%ebx 801005d2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi consputc(buf[i]); 801005d8: 0f be 03 movsbl (%ebx),%eax 801005db: 83 eb 01 sub $0x1,%ebx 801005de: e8 2d fe ff ff call 80100410 <consputc> while(--i >= 0) 801005e3: 39 f3 cmp %esi,%ebx 801005e5: 75 f1 jne 801005d8 <printint+0x58> } 801005e7: 83 c4 2c add $0x2c,%esp 801005ea: 5b pop %ebx 801005eb: 5e pop %esi 801005ec: 5f pop %edi 801005ed: 5d pop %ebp 801005ee: c3 ret 801005ef: 90 nop x = -xx; 801005f0: f7 d8 neg %eax 801005f2: eb a9 jmp 8010059d <printint+0x1d> 801005f4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801005fa: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80100600 <consolewrite>: int consolewrite(struct inode *ip, char *buf, int n) { 80100600: 55 push %ebp 80100601: 89 e5 mov %esp,%ebp 80100603: 57 push %edi 80100604: 56 push %esi 80100605: 53 push %ebx 80100606: 83 ec 18 sub $0x18,%esp 80100609: 8b 75 10 mov 0x10(%ebp),%esi int i; iunlock(ip); 8010060c: ff 75 08 pushl 0x8(%ebp) 8010060f: e8 4c 11 00 00 call 80101760 <iunlock> acquire(&cons.lock); 80100614: c7 04 24 20 a5 10 80 movl $0x8010a520,(%esp) 8010061b: e8 20 3d 00 00 call 80104340 <acquire> for(i = 0; i < n; i++) 80100620: 83 c4 10 add $0x10,%esp 80100623: 85 f6 test %esi,%esi 80100625: 7e 18 jle 8010063f <consolewrite+0x3f> 80100627: 8b 7d 0c mov 0xc(%ebp),%edi 8010062a: 8d 1c 37 lea (%edi,%esi,1),%ebx 8010062d: 8d 76 00 lea 0x0(%esi),%esi consputc(buf[i] & 0xff); 80100630: 0f b6 07 movzbl (%edi),%eax 80100633: 83 c7 01 add $0x1,%edi 80100636: e8 d5 fd ff ff call 80100410 <consputc> for(i = 0; i < n; i++) 8010063b: 39 fb cmp %edi,%ebx 8010063d: 75 f1 jne 80100630 <consolewrite+0x30> release(&cons.lock); 8010063f: 83 ec 0c sub $0xc,%esp 80100642: 68 20 a5 10 80 push $0x8010a520 80100647: e8 b4 3d 00 00 call 80104400 <release> ilock(ip); 8010064c: 58 pop %eax 8010064d: ff 75 08 pushl 0x8(%ebp) 80100650: e8 2b 10 00 00 call 80101680 <ilock> return n; } 80100655: 8d 65 f4 lea -0xc(%ebp),%esp 80100658: 89 f0 mov %esi,%eax 8010065a: 5b pop %ebx 8010065b: 5e pop %esi 8010065c: 5f pop %edi 8010065d: 5d pop %ebp 8010065e: c3 ret 8010065f: 90 nop 80100660 <cprintf>: { 80100660: 55 push %ebp 80100661: 89 e5 mov %esp,%ebp 80100663: 57 push %edi 80100664: 56 push %esi 80100665: 53 push %ebx 80100666: 83 ec 1c sub $0x1c,%esp locking = cons.locking; 80100669: a1 54 a5 10 80 mov 0x8010a554,%eax if(locking) 8010066e: 85 c0 test %eax,%eax locking = cons.locking; 80100670: 89 45 dc mov %eax,-0x24(%ebp) if(locking) 80100673: 0f 85 6f 01 00 00 jne 801007e8 <cprintf+0x188> if (fmt == 0) 80100679: 8b 45 08 mov 0x8(%ebp),%eax 8010067c: 85 c0 test %eax,%eax 8010067e: 89 c7 mov %eax,%edi 80100680: 0f 84 77 01 00 00 je 801007fd <cprintf+0x19d> for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 80100686: 0f b6 00 movzbl (%eax),%eax argp = (uint*)(void*)(&fmt + 1); 80100689: 8d 4d 0c lea 0xc(%ebp),%ecx for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 8010068c: 31 db xor %ebx,%ebx argp = (uint*)(void*)(&fmt + 1); 8010068e: 89 4d e4 mov %ecx,-0x1c(%ebp) for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 80100691: 85 c0 test %eax,%eax 80100693: 75 56 jne 801006eb <cprintf+0x8b> 80100695: eb 79 jmp 80100710 <cprintf+0xb0> 80100697: 89 f6 mov %esi,%esi 80100699: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi c = fmt[++i] & 0xff; 801006a0: 0f b6 16 movzbl (%esi),%edx if(c == 0) 801006a3: 85 d2 test %edx,%edx 801006a5: 74 69 je 80100710 <cprintf+0xb0> 801006a7: 83 c3 02 add $0x2,%ebx switch(c){ 801006aa: 83 fa 70 cmp $0x70,%edx 801006ad: 8d 34 1f lea (%edi,%ebx,1),%esi 801006b0: 0f 84 84 00 00 00 je 8010073a <cprintf+0xda> 801006b6: 7f 78 jg 80100730 <cprintf+0xd0> 801006b8: 83 fa 25 cmp $0x25,%edx 801006bb: 0f 84 ff 00 00 00 je 801007c0 <cprintf+0x160> 801006c1: 83 fa 64 cmp $0x64,%edx 801006c4: 0f 85 8e 00 00 00 jne 80100758 <cprintf+0xf8> printint(*argp++, 10, 1); 801006ca: 8b 45 e4 mov -0x1c(%ebp),%eax 801006cd: ba 0a 00 00 00 mov $0xa,%edx 801006d2: 8d 48 04 lea 0x4(%eax),%ecx 801006d5: 8b 00 mov (%eax),%eax 801006d7: 89 4d e4 mov %ecx,-0x1c(%ebp) 801006da: b9 01 00 00 00 mov $0x1,%ecx 801006df: e8 9c fe ff ff call 80100580 <printint> for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 801006e4: 0f b6 06 movzbl (%esi),%eax 801006e7: 85 c0 test %eax,%eax 801006e9: 74 25 je 80100710 <cprintf+0xb0> 801006eb: 8d 53 01 lea 0x1(%ebx),%edx if(c != '%'){ 801006ee: 83 f8 25 cmp $0x25,%eax 801006f1: 8d 34 17 lea (%edi,%edx,1),%esi 801006f4: 74 aa je 801006a0 <cprintf+0x40> 801006f6: 89 55 e0 mov %edx,-0x20(%ebp) consputc(c); 801006f9: e8 12 fd ff ff call 80100410 <consputc> for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 801006fe: 0f b6 06 movzbl (%esi),%eax continue; 80100701: 8b 55 e0 mov -0x20(%ebp),%edx 80100704: 89 d3 mov %edx,%ebx for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 80100706: 85 c0 test %eax,%eax 80100708: 75 e1 jne 801006eb <cprintf+0x8b> 8010070a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(locking) 80100710: 8b 45 dc mov -0x24(%ebp),%eax 80100713: 85 c0 test %eax,%eax 80100715: 74 10 je 80100727 <cprintf+0xc7> release(&cons.lock); 80100717: 83 ec 0c sub $0xc,%esp 8010071a: 68 20 a5 10 80 push $0x8010a520 8010071f: e8 dc 3c 00 00 call 80104400 <release> 80100724: 83 c4 10 add $0x10,%esp } 80100727: 8d 65 f4 lea -0xc(%ebp),%esp 8010072a: 5b pop %ebx 8010072b: 5e pop %esi 8010072c: 5f pop %edi 8010072d: 5d pop %ebp 8010072e: c3 ret 8010072f: 90 nop switch(c){ 80100730: 83 fa 73 cmp $0x73,%edx 80100733: 74 43 je 80100778 <cprintf+0x118> 80100735: 83 fa 78 cmp $0x78,%edx 80100738: 75 1e jne 80100758 <cprintf+0xf8> printint(*argp++, 16, 0); 8010073a: 8b 45 e4 mov -0x1c(%ebp),%eax 8010073d: ba 10 00 00 00 mov $0x10,%edx 80100742: 8d 48 04 lea 0x4(%eax),%ecx 80100745: 8b 00 mov (%eax),%eax 80100747: 89 4d e4 mov %ecx,-0x1c(%ebp) 8010074a: 31 c9 xor %ecx,%ecx 8010074c: e8 2f fe ff ff call 80100580 <printint> break; 80100751: eb 91 jmp 801006e4 <cprintf+0x84> 80100753: 90 nop 80100754: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi consputc('%'); 80100758: b8 25 00 00 00 mov $0x25,%eax 8010075d: 89 55 e0 mov %edx,-0x20(%ebp) 80100760: e8 ab fc ff ff call 80100410 <consputc> consputc(c); 80100765: 8b 55 e0 mov -0x20(%ebp),%edx 80100768: 89 d0 mov %edx,%eax 8010076a: e8 a1 fc ff ff call 80100410 <consputc> break; 8010076f: e9 70 ff ff ff jmp 801006e4 <cprintf+0x84> 80100774: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if((s = (char*)*argp++) == 0) 80100778: 8b 45 e4 mov -0x1c(%ebp),%eax 8010077b: 8b 10 mov (%eax),%edx 8010077d: 8d 48 04 lea 0x4(%eax),%ecx 80100780: 89 4d e0 mov %ecx,-0x20(%ebp) 80100783: 85 d2 test %edx,%edx 80100785: 74 49 je 801007d0 <cprintf+0x170> for(; *s; s++) 80100787: 0f be 02 movsbl (%edx),%eax if((s = (char*)*argp++) == 0) 8010078a: 89 4d e4 mov %ecx,-0x1c(%ebp) for(; *s; s++) 8010078d: 84 c0 test %al,%al 8010078f: 0f 84 4f ff ff ff je 801006e4 <cprintf+0x84> 80100795: 89 5d e4 mov %ebx,-0x1c(%ebp) 80100798: 89 d3 mov %edx,%ebx 8010079a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801007a0: 83 c3 01 add $0x1,%ebx consputc(*s); 801007a3: e8 68 fc ff ff call 80100410 <consputc> for(; *s; s++) 801007a8: 0f be 03 movsbl (%ebx),%eax 801007ab: 84 c0 test %al,%al 801007ad: 75 f1 jne 801007a0 <cprintf+0x140> if((s = (char*)*argp++) == 0) 801007af: 8b 45 e0 mov -0x20(%ebp),%eax 801007b2: 8b 5d e4 mov -0x1c(%ebp),%ebx 801007b5: 89 45 e4 mov %eax,-0x1c(%ebp) 801007b8: e9 27 ff ff ff jmp 801006e4 <cprintf+0x84> 801007bd: 8d 76 00 lea 0x0(%esi),%esi consputc('%'); 801007c0: b8 25 00 00 00 mov $0x25,%eax 801007c5: e8 46 fc ff ff call 80100410 <consputc> break; 801007ca: e9 15 ff ff ff jmp 801006e4 <cprintf+0x84> 801007cf: 90 nop s = "(null)"; 801007d0: ba 18 6f 10 80 mov $0x80106f18,%edx for(; *s; s++) 801007d5: 89 5d e4 mov %ebx,-0x1c(%ebp) 801007d8: b8 28 00 00 00 mov $0x28,%eax 801007dd: 89 d3 mov %edx,%ebx 801007df: eb bf jmp 801007a0 <cprintf+0x140> 801007e1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi acquire(&cons.lock); 801007e8: 83 ec 0c sub $0xc,%esp 801007eb: 68 20 a5 10 80 push $0x8010a520 801007f0: e8 4b 3b 00 00 call 80104340 <acquire> 801007f5: 83 c4 10 add $0x10,%esp 801007f8: e9 7c fe ff ff jmp 80100679 <cprintf+0x19> panic("null fmt"); 801007fd: 83 ec 0c sub $0xc,%esp 80100800: 68 1f 6f 10 80 push $0x80106f1f 80100805: e8 86 fb ff ff call 80100390 <panic> 8010080a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80100810 <consoleintr>: { 80100810: 55 push %ebp 80100811: 89 e5 mov %esp,%ebp 80100813: 57 push %edi 80100814: 56 push %esi 80100815: 53 push %ebx int c, doprocdump = 0; 80100816: 31 f6 xor %esi,%esi { 80100818: 83 ec 18 sub $0x18,%esp 8010081b: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&cons.lock); 8010081e: 68 20 a5 10 80 push $0x8010a520 80100823: e8 18 3b 00 00 call 80104340 <acquire> while((c = getc()) >= 0){ 80100828: 83 c4 10 add $0x10,%esp 8010082b: 90 nop 8010082c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100830: ff d3 call *%ebx 80100832: 85 c0 test %eax,%eax 80100834: 89 c7 mov %eax,%edi 80100836: 78 48 js 80100880 <consoleintr+0x70> switch(c){ 80100838: 83 ff 10 cmp $0x10,%edi 8010083b: 0f 84 e7 00 00 00 je 80100928 <consoleintr+0x118> 80100841: 7e 5d jle 801008a0 <consoleintr+0x90> 80100843: 83 ff 15 cmp $0x15,%edi 80100846: 0f 84 ec 00 00 00 je 80100938 <consoleintr+0x128> 8010084c: 83 ff 7f cmp $0x7f,%edi 8010084f: 75 54 jne 801008a5 <consoleintr+0x95> if(input.e != input.w){ 80100851: a1 a8 ff 10 80 mov 0x8010ffa8,%eax 80100856: 3b 05 a4 ff 10 80 cmp 0x8010ffa4,%eax 8010085c: 74 d2 je 80100830 <consoleintr+0x20> input.e--; 8010085e: 83 e8 01 sub $0x1,%eax 80100861: a3 a8 ff 10 80 mov %eax,0x8010ffa8 consputc(BACKSPACE); 80100866: b8 00 01 00 00 mov $0x100,%eax 8010086b: e8 a0 fb ff ff call 80100410 <consputc> while((c = getc()) >= 0){ 80100870: ff d3 call *%ebx 80100872: 85 c0 test %eax,%eax 80100874: 89 c7 mov %eax,%edi 80100876: 79 c0 jns 80100838 <consoleintr+0x28> 80100878: 90 nop 80100879: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi release(&cons.lock); 80100880: 83 ec 0c sub $0xc,%esp 80100883: 68 20 a5 10 80 push $0x8010a520 80100888: e8 73 3b 00 00 call 80104400 <release> if(doprocdump) { 8010088d: 83 c4 10 add $0x10,%esp 80100890: 85 f6 test %esi,%esi 80100892: 0f 85 f8 00 00 00 jne 80100990 <consoleintr+0x180> } 80100898: 8d 65 f4 lea -0xc(%ebp),%esp 8010089b: 5b pop %ebx 8010089c: 5e pop %esi 8010089d: 5f pop %edi 8010089e: 5d pop %ebp 8010089f: c3 ret switch(c){ 801008a0: 83 ff 08 cmp $0x8,%edi 801008a3: 74 ac je 80100851 <consoleintr+0x41> if(c != 0 && input.e-input.r < INPUT_BUF){ 801008a5: 85 ff test %edi,%edi 801008a7: 74 87 je 80100830 <consoleintr+0x20> 801008a9: a1 a8 ff 10 80 mov 0x8010ffa8,%eax 801008ae: 89 c2 mov %eax,%edx 801008b0: 2b 15 a0 ff 10 80 sub 0x8010ffa0,%edx 801008b6: 83 fa 7f cmp $0x7f,%edx 801008b9: 0f 87 71 ff ff ff ja 80100830 <consoleintr+0x20> 801008bf: 8d 50 01 lea 0x1(%eax),%edx 801008c2: 83 e0 7f and $0x7f,%eax c = (c == '\r') ? '\n' : c; 801008c5: 83 ff 0d cmp $0xd,%edi input.buf[input.e++ % INPUT_BUF] = c; 801008c8: 89 15 a8 ff 10 80 mov %edx,0x8010ffa8 c = (c == '\r') ? '\n' : c; 801008ce: 0f 84 cc 00 00 00 je 801009a0 <consoleintr+0x190> input.buf[input.e++ % INPUT_BUF] = c; 801008d4: 89 f9 mov %edi,%ecx 801008d6: 88 88 20 ff 10 80 mov %cl,-0x7fef00e0(%eax) consputc(c); 801008dc: 89 f8 mov %edi,%eax 801008de: e8 2d fb ff ff call 80100410 <consputc> if(c == '\n' || c == C('D') || input.e == input.r+INPUT_BUF){ 801008e3: 83 ff 0a cmp $0xa,%edi 801008e6: 0f 84 c5 00 00 00 je 801009b1 <consoleintr+0x1a1> 801008ec: 83 ff 04 cmp $0x4,%edi 801008ef: 0f 84 bc 00 00 00 je 801009b1 <consoleintr+0x1a1> 801008f5: a1 a0 ff 10 80 mov 0x8010ffa0,%eax 801008fa: 83 e8 80 sub $0xffffff80,%eax 801008fd: 39 05 a8 ff 10 80 cmp %eax,0x8010ffa8 80100903: 0f 85 27 ff ff ff jne 80100830 <consoleintr+0x20> wakeup(&input.r); 80100909: 83 ec 0c sub $0xc,%esp input.w = input.e; 8010090c: a3 a4 ff 10 80 mov %eax,0x8010ffa4 wakeup(&input.r); 80100911: 68 a0 ff 10 80 push $0x8010ffa0 80100916: e8 15 36 00 00 call 80103f30 <wakeup> 8010091b: 83 c4 10 add $0x10,%esp 8010091e: e9 0d ff ff ff jmp 80100830 <consoleintr+0x20> 80100923: 90 nop 80100924: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi doprocdump = 1; 80100928: be 01 00 00 00 mov $0x1,%esi 8010092d: e9 fe fe ff ff jmp 80100830 <consoleintr+0x20> 80100932: 8d b6 00 00 00 00 lea 0x0(%esi),%esi while(input.e != input.w && 80100938: a1 a8 ff 10 80 mov 0x8010ffa8,%eax 8010093d: 39 05 a4 ff 10 80 cmp %eax,0x8010ffa4 80100943: 75 2b jne 80100970 <consoleintr+0x160> 80100945: e9 e6 fe ff ff jmp 80100830 <consoleintr+0x20> 8010094a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi input.e--; 80100950: a3 a8 ff 10 80 mov %eax,0x8010ffa8 consputc(BACKSPACE); 80100955: b8 00 01 00 00 mov $0x100,%eax 8010095a: e8 b1 fa ff ff call 80100410 <consputc> while(input.e != input.w && 8010095f: a1 a8 ff 10 80 mov 0x8010ffa8,%eax 80100964: 3b 05 a4 ff 10 80 cmp 0x8010ffa4,%eax 8010096a: 0f 84 c0 fe ff ff je 80100830 <consoleintr+0x20> input.buf[(input.e-1) % INPUT_BUF] != '\n'){ 80100970: 83 e8 01 sub $0x1,%eax 80100973: 89 c2 mov %eax,%edx 80100975: 83 e2 7f and $0x7f,%edx while(input.e != input.w && 80100978: 80 ba 20 ff 10 80 0a cmpb $0xa,-0x7fef00e0(%edx) 8010097f: 75 cf jne 80100950 <consoleintr+0x140> 80100981: e9 aa fe ff ff jmp 80100830 <consoleintr+0x20> 80100986: 8d 76 00 lea 0x0(%esi),%esi 80100989: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi } 80100990: 8d 65 f4 lea -0xc(%ebp),%esp 80100993: 5b pop %ebx 80100994: 5e pop %esi 80100995: 5f pop %edi 80100996: 5d pop %ebp procdump(); // now call procdump() wo. cons.lock held 80100997: e9 74 36 00 00 jmp 80104010 <procdump> 8010099c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi input.buf[input.e++ % INPUT_BUF] = c; 801009a0: c6 80 20 ff 10 80 0a movb $0xa,-0x7fef00e0(%eax) consputc(c); 801009a7: b8 0a 00 00 00 mov $0xa,%eax 801009ac: e8 5f fa ff ff call 80100410 <consputc> 801009b1: a1 a8 ff 10 80 mov 0x8010ffa8,%eax 801009b6: e9 4e ff ff ff jmp 80100909 <consoleintr+0xf9> 801009bb: 90 nop 801009bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801009c0 <consoleinit>: void consoleinit(void) { 801009c0: 55 push %ebp 801009c1: 89 e5 mov %esp,%ebp 801009c3: 83 ec 10 sub $0x10,%esp initlock(&cons.lock, "console"); 801009c6: 68 28 6f 10 80 push $0x80106f28 801009cb: 68 20 a5 10 80 push $0x8010a520 801009d0: e8 2b 38 00 00 call 80104200 <initlock> devsw[CONSOLE].write = consolewrite; devsw[CONSOLE].read = consoleread; cons.locking = 1; ioapicenable(IRQ_KBD, 0); 801009d5: 58 pop %eax 801009d6: 5a pop %edx 801009d7: 6a 00 push $0x0 801009d9: 6a 01 push $0x1 devsw[CONSOLE].write = consolewrite; 801009db: c7 05 6c 09 11 80 00 movl $0x80100600,0x8011096c 801009e2: 06 10 80 devsw[CONSOLE].read = consoleread; 801009e5: c7 05 68 09 11 80 70 movl $0x80100270,0x80110968 801009ec: 02 10 80 cons.locking = 1; 801009ef: c7 05 54 a5 10 80 01 movl $0x1,0x8010a554 801009f6: 00 00 00 ioapicenable(IRQ_KBD, 0); 801009f9: e8 d2 18 00 00 call 801022d0 <ioapicenable> } 801009fe: 83 c4 10 add $0x10,%esp 80100a01: c9 leave 80100a02: c3 ret 80100a03: 66 90 xchg %ax,%ax 80100a05: 66 90 xchg %ax,%ax 80100a07: 66 90 xchg %ax,%ax 80100a09: 66 90 xchg %ax,%ax 80100a0b: 66 90 xchg %ax,%ax 80100a0d: 66 90 xchg %ax,%ax 80100a0f: 90 nop 80100a10 <exec>: #include "x86.h" #include "elf.h" int exec(char *path, char **argv) { 80100a10: 55 push %ebp 80100a11: 89 e5 mov %esp,%ebp 80100a13: 57 push %edi 80100a14: 56 push %esi 80100a15: 53 push %ebx 80100a16: 81 ec 0c 01 00 00 sub $0x10c,%esp uint argc, sz, sp, ustack[3+MAXARG+1]; struct elfhdr elf; struct inode *ip; struct proghdr ph; pde_t *pgdir, *oldpgdir; struct proc *curproc = myproc(); 80100a1c: e8 bf 2d 00 00 call 801037e0 <myproc> 80100a21: 89 85 f4 fe ff ff mov %eax,-0x10c(%ebp) begin_op(); 80100a27: e8 74 21 00 00 call 80102ba0 <begin_op> if((ip = namei(path)) == 0){ 80100a2c: 83 ec 0c sub $0xc,%esp 80100a2f: ff 75 08 pushl 0x8(%ebp) 80100a32: e8 a9 14 00 00 call 80101ee0 <namei> 80100a37: 83 c4 10 add $0x10,%esp 80100a3a: 85 c0 test %eax,%eax 80100a3c: 0f 84 91 01 00 00 je 80100bd3 <exec+0x1c3> end_op(); cprintf("exec: fail\n"); return -1; } ilock(ip); 80100a42: 83 ec 0c sub $0xc,%esp 80100a45: 89 c3 mov %eax,%ebx 80100a47: 50 push %eax 80100a48: e8 33 0c 00 00 call 80101680 <ilock> pgdir = 0; // Check ELF header if(readi(ip, (char*)&elf, 0, sizeof(elf)) != sizeof(elf)) 80100a4d: 8d 85 24 ff ff ff lea -0xdc(%ebp),%eax 80100a53: 6a 34 push $0x34 80100a55: 6a 00 push $0x0 80100a57: 50 push %eax 80100a58: 53 push %ebx 80100a59: e8 02 0f 00 00 call 80101960 <readi> 80100a5e: 83 c4 20 add $0x20,%esp 80100a61: 83 f8 34 cmp $0x34,%eax 80100a64: 74 22 je 80100a88 <exec+0x78> bad: if(pgdir) freevm(pgdir); if(ip){ iunlockput(ip); 80100a66: 83 ec 0c sub $0xc,%esp 80100a69: 53 push %ebx 80100a6a: e8 a1 0e 00 00 call 80101910 <iunlockput> end_op(); 80100a6f: e8 9c 21 00 00 call 80102c10 <end_op> 80100a74: 83 c4 10 add $0x10,%esp } return -1; 80100a77: b8 ff ff ff ff mov $0xffffffff,%eax } 80100a7c: 8d 65 f4 lea -0xc(%ebp),%esp 80100a7f: 5b pop %ebx 80100a80: 5e pop %esi 80100a81: 5f pop %edi 80100a82: 5d pop %ebp 80100a83: c3 ret 80100a84: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(elf.magic != ELF_MAGIC) 80100a88: 81 bd 24 ff ff ff 7f cmpl $0x464c457f,-0xdc(%ebp) 80100a8f: 45 4c 46 80100a92: 75 d2 jne 80100a66 <exec+0x56> if((pgdir = setupkvm()) == 0) 80100a94: e8 77 61 00 00 call 80106c10 <setupkvm> 80100a99: 85 c0 test %eax,%eax 80100a9b: 89 85 f0 fe ff ff mov %eax,-0x110(%ebp) 80100aa1: 74 c3 je 80100a66 <exec+0x56> sz = 0; 80100aa3: 31 ff xor %edi,%edi for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){ 80100aa5: 66 83 bd 50 ff ff ff cmpw $0x0,-0xb0(%ebp) 80100aac: 00 80100aad: 8b 85 40 ff ff ff mov -0xc0(%ebp),%eax 80100ab3: 89 85 ec fe ff ff mov %eax,-0x114(%ebp) 80100ab9: 0f 84 8c 02 00 00 je 80100d4b <exec+0x33b> 80100abf: 31 f6 xor %esi,%esi 80100ac1: eb 7f jmp 80100b42 <exec+0x132> 80100ac3: 90 nop 80100ac4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(ph.type != ELF_PROG_LOAD) 80100ac8: 83 bd 04 ff ff ff 01 cmpl $0x1,-0xfc(%ebp) 80100acf: 75 63 jne 80100b34 <exec+0x124> if(ph.memsz < ph.filesz) 80100ad1: 8b 85 18 ff ff ff mov -0xe8(%ebp),%eax 80100ad7: 3b 85 14 ff ff ff cmp -0xec(%ebp),%eax 80100add: 0f 82 86 00 00 00 jb 80100b69 <exec+0x159> 80100ae3: 03 85 0c ff ff ff add -0xf4(%ebp),%eax 80100ae9: 72 7e jb 80100b69 <exec+0x159> if((sz = allocuvm(pgdir, sz, ph.vaddr + ph.memsz)) == 0) 80100aeb: 83 ec 04 sub $0x4,%esp 80100aee: 50 push %eax 80100aef: 57 push %edi 80100af0: ff b5 f0 fe ff ff pushl -0x110(%ebp) 80100af6: e8 35 5f 00 00 call 80106a30 <allocuvm> 80100afb: 83 c4 10 add $0x10,%esp 80100afe: 85 c0 test %eax,%eax 80100b00: 89 c7 mov %eax,%edi 80100b02: 74 65 je 80100b69 <exec+0x159> if(ph.vaddr % PGSIZE != 0) 80100b04: 8b 85 0c ff ff ff mov -0xf4(%ebp),%eax 80100b0a: a9 ff 0f 00 00 test $0xfff,%eax 80100b0f: 75 58 jne 80100b69 <exec+0x159> if(loaduvm(pgdir, (char*)ph.vaddr, ip, ph.off, ph.filesz) < 0) 80100b11: 83 ec 0c sub $0xc,%esp 80100b14: ff b5 14 ff ff ff pushl -0xec(%ebp) 80100b1a: ff b5 08 ff ff ff pushl -0xf8(%ebp) 80100b20: 53 push %ebx 80100b21: 50 push %eax 80100b22: ff b5 f0 fe ff ff pushl -0x110(%ebp) 80100b28: e8 43 5e 00 00 call 80106970 <loaduvm> 80100b2d: 83 c4 20 add $0x20,%esp 80100b30: 85 c0 test %eax,%eax 80100b32: 78 35 js 80100b69 <exec+0x159> for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){ 80100b34: 0f b7 85 50 ff ff ff movzwl -0xb0(%ebp),%eax 80100b3b: 83 c6 01 add $0x1,%esi 80100b3e: 39 f0 cmp %esi,%eax 80100b40: 7e 3d jle 80100b7f <exec+0x16f> if(readi(ip, (char*)&ph, off, sizeof(ph)) != sizeof(ph)) 80100b42: 89 f0 mov %esi,%eax 80100b44: 6a 20 push $0x20 80100b46: c1 e0 05 shl $0x5,%eax 80100b49: 03 85 ec fe ff ff add -0x114(%ebp),%eax 80100b4f: 50 push %eax 80100b50: 8d 85 04 ff ff ff lea -0xfc(%ebp),%eax 80100b56: 50 push %eax 80100b57: 53 push %ebx 80100b58: e8 03 0e 00 00 call 80101960 <readi> 80100b5d: 83 c4 10 add $0x10,%esp 80100b60: 83 f8 20 cmp $0x20,%eax 80100b63: 0f 84 5f ff ff ff je 80100ac8 <exec+0xb8> freevm(pgdir); 80100b69: 83 ec 0c sub $0xc,%esp 80100b6c: ff b5 f0 fe ff ff pushl -0x110(%ebp) 80100b72: e8 19 60 00 00 call 80106b90 <freevm> 80100b77: 83 c4 10 add $0x10,%esp 80100b7a: e9 e7 fe ff ff jmp 80100a66 <exec+0x56> 80100b7f: 81 c7 ff 0f 00 00 add $0xfff,%edi 80100b85: 81 e7 00 f0 ff ff and $0xfffff000,%edi 80100b8b: 8d b7 00 20 00 00 lea 0x2000(%edi),%esi iunlockput(ip); 80100b91: 83 ec 0c sub $0xc,%esp 80100b94: 53 push %ebx 80100b95: e8 76 0d 00 00 call 80101910 <iunlockput> end_op(); 80100b9a: e8 71 20 00 00 call 80102c10 <end_op> if((sz = allocuvm(pgdir, sz, sz + 2*PGSIZE)) == 0) 80100b9f: 83 c4 0c add $0xc,%esp 80100ba2: 56 push %esi 80100ba3: 57 push %edi 80100ba4: ff b5 f0 fe ff ff pushl -0x110(%ebp) 80100baa: e8 81 5e 00 00 call 80106a30 <allocuvm> 80100baf: 83 c4 10 add $0x10,%esp 80100bb2: 85 c0 test %eax,%eax 80100bb4: 89 c6 mov %eax,%esi 80100bb6: 75 3a jne 80100bf2 <exec+0x1e2> freevm(pgdir); 80100bb8: 83 ec 0c sub $0xc,%esp 80100bbb: ff b5 f0 fe ff ff pushl -0x110(%ebp) 80100bc1: e8 ca 5f 00 00 call 80106b90 <freevm> 80100bc6: 83 c4 10 add $0x10,%esp return -1; 80100bc9: b8 ff ff ff ff mov $0xffffffff,%eax 80100bce: e9 a9 fe ff ff jmp 80100a7c <exec+0x6c> end_op(); 80100bd3: e8 38 20 00 00 call 80102c10 <end_op> cprintf("exec: fail\n"); 80100bd8: 83 ec 0c sub $0xc,%esp 80100bdb: 68 41 6f 10 80 push $0x80106f41 80100be0: e8 7b fa ff ff call 80100660 <cprintf> return -1; 80100be5: 83 c4 10 add $0x10,%esp 80100be8: b8 ff ff ff ff mov $0xffffffff,%eax 80100bed: e9 8a fe ff ff jmp 80100a7c <exec+0x6c> clearpteu(pgdir, (char*)(sz - 2*PGSIZE)); 80100bf2: 8d 80 00 e0 ff ff lea -0x2000(%eax),%eax 80100bf8: 83 ec 08 sub $0x8,%esp for(argc = 0; argv[argc]; argc++) { 80100bfb: 31 ff xor %edi,%edi 80100bfd: 89 f3 mov %esi,%ebx clearpteu(pgdir, (char*)(sz - 2*PGSIZE)); 80100bff: 50 push %eax 80100c00: ff b5 f0 fe ff ff pushl -0x110(%ebp) 80100c06: e8 a5 60 00 00 call 80106cb0 <clearpteu> for(argc = 0; argv[argc]; argc++) { 80100c0b: 8b 45 0c mov 0xc(%ebp),%eax 80100c0e: 83 c4 10 add $0x10,%esp 80100c11: 8d 95 58 ff ff ff lea -0xa8(%ebp),%edx 80100c17: 8b 00 mov (%eax),%eax 80100c19: 85 c0 test %eax,%eax 80100c1b: 74 70 je 80100c8d <exec+0x27d> 80100c1d: 89 b5 ec fe ff ff mov %esi,-0x114(%ebp) 80100c23: 8b b5 f0 fe ff ff mov -0x110(%ebp),%esi 80100c29: eb 0a jmp 80100c35 <exec+0x225> 80100c2b: 90 nop 80100c2c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(argc >= MAXARG) 80100c30: 83 ff 20 cmp $0x20,%edi 80100c33: 74 83 je 80100bb8 <exec+0x1a8> sp = (sp - (strlen(argv[argc]) + 1)) & ~3; 80100c35: 83 ec 0c sub $0xc,%esp 80100c38: 50 push %eax 80100c39: e8 32 3a 00 00 call 80104670 <strlen> 80100c3e: f7 d0 not %eax 80100c40: 01 c3 add %eax,%ebx if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0) 80100c42: 8b 45 0c mov 0xc(%ebp),%eax 80100c45: 5a pop %edx sp = (sp - (strlen(argv[argc]) + 1)) & ~3; 80100c46: 83 e3 fc and $0xfffffffc,%ebx if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0) 80100c49: ff 34 b8 pushl (%eax,%edi,4) 80100c4c: e8 1f 3a 00 00 call 80104670 <strlen> 80100c51: 83 c0 01 add $0x1,%eax 80100c54: 50 push %eax 80100c55: 8b 45 0c mov 0xc(%ebp),%eax 80100c58: ff 34 b8 pushl (%eax,%edi,4) 80100c5b: 53 push %ebx 80100c5c: 56 push %esi 80100c5d: e8 ae 61 00 00 call 80106e10 <copyout> 80100c62: 83 c4 20 add $0x20,%esp 80100c65: 85 c0 test %eax,%eax 80100c67: 0f 88 4b ff ff ff js 80100bb8 <exec+0x1a8> for(argc = 0; argv[argc]; argc++) { 80100c6d: 8b 45 0c mov 0xc(%ebp),%eax ustack[3+argc] = sp; 80100c70: 89 9c bd 64 ff ff ff mov %ebx,-0x9c(%ebp,%edi,4) for(argc = 0; argv[argc]; argc++) { 80100c77: 83 c7 01 add $0x1,%edi ustack[3+argc] = sp; 80100c7a: 8d 95 58 ff ff ff lea -0xa8(%ebp),%edx for(argc = 0; argv[argc]; argc++) { 80100c80: 8b 04 b8 mov (%eax,%edi,4),%eax 80100c83: 85 c0 test %eax,%eax 80100c85: 75 a9 jne 80100c30 <exec+0x220> 80100c87: 8b b5 ec fe ff ff mov -0x114(%ebp),%esi ustack[2] = sp - (argc+1)*4; // argv pointer 80100c8d: 8d 04 bd 04 00 00 00 lea 0x4(,%edi,4),%eax 80100c94: 89 d9 mov %ebx,%ecx ustack[3+argc] = 0; 80100c96: c7 84 bd 64 ff ff ff movl $0x0,-0x9c(%ebp,%edi,4) 80100c9d: 00 00 00 00 ustack[0] = 0xffffffff; // fake return PC 80100ca1: c7 85 58 ff ff ff ff movl $0xffffffff,-0xa8(%ebp) 80100ca8: ff ff ff ustack[1] = argc; 80100cab: 89 bd 5c ff ff ff mov %edi,-0xa4(%ebp) ustack[2] = sp - (argc+1)*4; // argv pointer 80100cb1: 29 c1 sub %eax,%ecx sp -= (3+argc+1) * 4; 80100cb3: 83 c0 0c add $0xc,%eax 80100cb6: 29 c3 sub %eax,%ebx if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0) 80100cb8: 50 push %eax 80100cb9: 52 push %edx 80100cba: 53 push %ebx 80100cbb: ff b5 f0 fe ff ff pushl -0x110(%ebp) ustack[2] = sp - (argc+1)*4; // argv pointer 80100cc1: 89 8d 60 ff ff ff mov %ecx,-0xa0(%ebp) if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0) 80100cc7: e8 44 61 00 00 call 80106e10 <copyout> 80100ccc: 83 c4 10 add $0x10,%esp 80100ccf: 85 c0 test %eax,%eax 80100cd1: 0f 88 e1 fe ff ff js 80100bb8 <exec+0x1a8> for(last=s=path; *s; s++) 80100cd7: 8b 45 08 mov 0x8(%ebp),%eax 80100cda: 0f b6 00 movzbl (%eax),%eax 80100cdd: 84 c0 test %al,%al 80100cdf: 74 17 je 80100cf8 <exec+0x2e8> 80100ce1: 8b 55 08 mov 0x8(%ebp),%edx 80100ce4: 89 d1 mov %edx,%ecx 80100ce6: 83 c1 01 add $0x1,%ecx 80100ce9: 3c 2f cmp $0x2f,%al 80100ceb: 0f b6 01 movzbl (%ecx),%eax 80100cee: 0f 44 d1 cmove %ecx,%edx 80100cf1: 84 c0 test %al,%al 80100cf3: 75 f1 jne 80100ce6 <exec+0x2d6> 80100cf5: 89 55 08 mov %edx,0x8(%ebp) safestrcpy(curproc->name, last, sizeof(curproc->name)); 80100cf8: 8b bd f4 fe ff ff mov -0x10c(%ebp),%edi 80100cfe: 50 push %eax 80100cff: 6a 10 push $0x10 80100d01: ff 75 08 pushl 0x8(%ebp) 80100d04: 89 f8 mov %edi,%eax 80100d06: 83 c0 6c add $0x6c,%eax 80100d09: 50 push %eax 80100d0a: e8 21 39 00 00 call 80104630 <safestrcpy> curproc->pgdir = pgdir; 80100d0f: 8b 95 f0 fe ff ff mov -0x110(%ebp),%edx oldpgdir = curproc->pgdir; 80100d15: 89 f9 mov %edi,%ecx 80100d17: 8b 7f 04 mov 0x4(%edi),%edi curproc->tf->eip = elf.entry; // main 80100d1a: 8b 41 18 mov 0x18(%ecx),%eax curproc->sz = sz; 80100d1d: 89 31 mov %esi,(%ecx) curproc->pgdir = pgdir; 80100d1f: 89 51 04 mov %edx,0x4(%ecx) curproc->tf->eip = elf.entry; // main 80100d22: 8b 95 3c ff ff ff mov -0xc4(%ebp),%edx 80100d28: 89 50 38 mov %edx,0x38(%eax) curproc->tf->esp = sp; 80100d2b: 8b 41 18 mov 0x18(%ecx),%eax 80100d2e: 89 58 44 mov %ebx,0x44(%eax) switchuvm(curproc); 80100d31: 89 0c 24 mov %ecx,(%esp) 80100d34: e8 a7 5a 00 00 call 801067e0 <switchuvm> freevm(oldpgdir); 80100d39: 89 3c 24 mov %edi,(%esp) 80100d3c: e8 4f 5e 00 00 call 80106b90 <freevm> return 0; 80100d41: 83 c4 10 add $0x10,%esp 80100d44: 31 c0 xor %eax,%eax 80100d46: e9 31 fd ff ff jmp 80100a7c <exec+0x6c> for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){ 80100d4b: be 00 20 00 00 mov $0x2000,%esi 80100d50: e9 3c fe ff ff jmp 80100b91 <exec+0x181> 80100d55: 66 90 xchg %ax,%ax 80100d57: 66 90 xchg %ax,%ax 80100d59: 66 90 xchg %ax,%ax 80100d5b: 66 90 xchg %ax,%ax 80100d5d: 66 90 xchg %ax,%ax 80100d5f: 90 nop 80100d60 <fileinit>: struct file file[NFILE]; } ftable; void fileinit(void) { 80100d60: 55 push %ebp 80100d61: 89 e5 mov %esp,%ebp 80100d63: 83 ec 10 sub $0x10,%esp initlock(&ftable.lock, "ftable"); 80100d66: 68 4d 6f 10 80 push $0x80106f4d 80100d6b: 68 c0 ff 10 80 push $0x8010ffc0 80100d70: e8 8b 34 00 00 call 80104200 <initlock> } 80100d75: 83 c4 10 add $0x10,%esp 80100d78: c9 leave 80100d79: c3 ret 80100d7a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80100d80 <filealloc>: // Allocate a file structure. struct file* filealloc(void) { 80100d80: 55 push %ebp 80100d81: 89 e5 mov %esp,%ebp 80100d83: 53 push %ebx struct file *f; acquire(&ftable.lock); for(f = ftable.file; f < ftable.file + NFILE; f++){ 80100d84: bb f4 ff 10 80 mov $0x8010fff4,%ebx { 80100d89: 83 ec 10 sub $0x10,%esp acquire(&ftable.lock); 80100d8c: 68 c0 ff 10 80 push $0x8010ffc0 80100d91: e8 aa 35 00 00 call 80104340 <acquire> 80100d96: 83 c4 10 add $0x10,%esp 80100d99: eb 10 jmp 80100dab <filealloc+0x2b> 80100d9b: 90 nop 80100d9c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(f = ftable.file; f < ftable.file + NFILE; f++){ 80100da0: 83 c3 18 add $0x18,%ebx 80100da3: 81 fb 54 09 11 80 cmp $0x80110954,%ebx 80100da9: 73 25 jae 80100dd0 <filealloc+0x50> if(f->ref == 0){ 80100dab: 8b 43 04 mov 0x4(%ebx),%eax 80100dae: 85 c0 test %eax,%eax 80100db0: 75 ee jne 80100da0 <filealloc+0x20> f->ref = 1; release(&ftable.lock); 80100db2: 83 ec 0c sub $0xc,%esp f->ref = 1; 80100db5: c7 43 04 01 00 00 00 movl $0x1,0x4(%ebx) release(&ftable.lock); 80100dbc: 68 c0 ff 10 80 push $0x8010ffc0 80100dc1: e8 3a 36 00 00 call 80104400 <release> return f; } } release(&ftable.lock); return 0; } 80100dc6: 89 d8 mov %ebx,%eax return f; 80100dc8: 83 c4 10 add $0x10,%esp } 80100dcb: 8b 5d fc mov -0x4(%ebp),%ebx 80100dce: c9 leave 80100dcf: c3 ret release(&ftable.lock); 80100dd0: 83 ec 0c sub $0xc,%esp return 0; 80100dd3: 31 db xor %ebx,%ebx release(&ftable.lock); 80100dd5: 68 c0 ff 10 80 push $0x8010ffc0 80100dda: e8 21 36 00 00 call 80104400 <release> } 80100ddf: 89 d8 mov %ebx,%eax return 0; 80100de1: 83 c4 10 add $0x10,%esp } 80100de4: 8b 5d fc mov -0x4(%ebp),%ebx 80100de7: c9 leave 80100de8: c3 ret 80100de9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80100df0 <filedup>: // Increment ref count for file f. struct file* filedup(struct file *f) { 80100df0: 55 push %ebp 80100df1: 89 e5 mov %esp,%ebp 80100df3: 53 push %ebx 80100df4: 83 ec 10 sub $0x10,%esp 80100df7: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&ftable.lock); 80100dfa: 68 c0 ff 10 80 push $0x8010ffc0 80100dff: e8 3c 35 00 00 call 80104340 <acquire> if(f->ref < 1) 80100e04: 8b 43 04 mov 0x4(%ebx),%eax 80100e07: 83 c4 10 add $0x10,%esp 80100e0a: 85 c0 test %eax,%eax 80100e0c: 7e 1a jle 80100e28 <filedup+0x38> panic("filedup"); f->ref++; 80100e0e: 83 c0 01 add $0x1,%eax release(&ftable.lock); 80100e11: 83 ec 0c sub $0xc,%esp f->ref++; 80100e14: 89 43 04 mov %eax,0x4(%ebx) release(&ftable.lock); 80100e17: 68 c0 ff 10 80 push $0x8010ffc0 80100e1c: e8 df 35 00 00 call 80104400 <release> return f; } 80100e21: 89 d8 mov %ebx,%eax 80100e23: 8b 5d fc mov -0x4(%ebp),%ebx 80100e26: c9 leave 80100e27: c3 ret panic("filedup"); 80100e28: 83 ec 0c sub $0xc,%esp 80100e2b: 68 54 6f 10 80 push $0x80106f54 80100e30: e8 5b f5 ff ff call 80100390 <panic> 80100e35: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100e39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80100e40 <fileclose>: // Close file f. (Decrement ref count, close when reaches 0.) void fileclose(struct file *f) { 80100e40: 55 push %ebp 80100e41: 89 e5 mov %esp,%ebp 80100e43: 57 push %edi 80100e44: 56 push %esi 80100e45: 53 push %ebx 80100e46: 83 ec 28 sub $0x28,%esp 80100e49: 8b 5d 08 mov 0x8(%ebp),%ebx struct file ff; acquire(&ftable.lock); 80100e4c: 68 c0 ff 10 80 push $0x8010ffc0 80100e51: e8 ea 34 00 00 call 80104340 <acquire> if(f->ref < 1) 80100e56: 8b 43 04 mov 0x4(%ebx),%eax 80100e59: 83 c4 10 add $0x10,%esp 80100e5c: 85 c0 test %eax,%eax 80100e5e: 0f 8e 9b 00 00 00 jle 80100eff <fileclose+0xbf> panic("fileclose"); if(--f->ref > 0){ 80100e64: 83 e8 01 sub $0x1,%eax 80100e67: 85 c0 test %eax,%eax 80100e69: 89 43 04 mov %eax,0x4(%ebx) 80100e6c: 74 1a je 80100e88 <fileclose+0x48> release(&ftable.lock); 80100e6e: c7 45 08 c0 ff 10 80 movl $0x8010ffc0,0x8(%ebp) else if(ff.type == FD_INODE){ begin_op(); iput(ff.ip); end_op(); } } 80100e75: 8d 65 f4 lea -0xc(%ebp),%esp 80100e78: 5b pop %ebx 80100e79: 5e pop %esi 80100e7a: 5f pop %edi 80100e7b: 5d pop %ebp release(&ftable.lock); 80100e7c: e9 7f 35 00 00 jmp 80104400 <release> 80100e81: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi ff = *f; 80100e88: 0f b6 43 09 movzbl 0x9(%ebx),%eax 80100e8c: 8b 3b mov (%ebx),%edi release(&ftable.lock); 80100e8e: 83 ec 0c sub $0xc,%esp ff = *f; 80100e91: 8b 73 0c mov 0xc(%ebx),%esi f->type = FD_NONE; 80100e94: c7 03 00 00 00 00 movl $0x0,(%ebx) ff = *f; 80100e9a: 88 45 e7 mov %al,-0x19(%ebp) 80100e9d: 8b 43 10 mov 0x10(%ebx),%eax release(&ftable.lock); 80100ea0: 68 c0 ff 10 80 push $0x8010ffc0 ff = *f; 80100ea5: 89 45 e0 mov %eax,-0x20(%ebp) release(&ftable.lock); 80100ea8: e8 53 35 00 00 call 80104400 <release> if(ff.type == FD_PIPE) 80100ead: 83 c4 10 add $0x10,%esp 80100eb0: 83 ff 01 cmp $0x1,%edi 80100eb3: 74 13 je 80100ec8 <fileclose+0x88> else if(ff.type == FD_INODE){ 80100eb5: 83 ff 02 cmp $0x2,%edi 80100eb8: 74 26 je 80100ee0 <fileclose+0xa0> } 80100eba: 8d 65 f4 lea -0xc(%ebp),%esp 80100ebd: 5b pop %ebx 80100ebe: 5e pop %esi 80100ebf: 5f pop %edi 80100ec0: 5d pop %ebp 80100ec1: c3 ret 80100ec2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi pipeclose(ff.pipe, ff.writable); 80100ec8: 0f be 5d e7 movsbl -0x19(%ebp),%ebx 80100ecc: 83 ec 08 sub $0x8,%esp 80100ecf: 53 push %ebx 80100ed0: 56 push %esi 80100ed1: e8 7a 24 00 00 call 80103350 <pipeclose> 80100ed6: 83 c4 10 add $0x10,%esp 80100ed9: eb df jmp 80100eba <fileclose+0x7a> 80100edb: 90 nop 80100edc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi begin_op(); 80100ee0: e8 bb 1c 00 00 call 80102ba0 <begin_op> iput(ff.ip); 80100ee5: 83 ec 0c sub $0xc,%esp 80100ee8: ff 75 e0 pushl -0x20(%ebp) 80100eeb: e8 c0 08 00 00 call 801017b0 <iput> end_op(); 80100ef0: 83 c4 10 add $0x10,%esp } 80100ef3: 8d 65 f4 lea -0xc(%ebp),%esp 80100ef6: 5b pop %ebx 80100ef7: 5e pop %esi 80100ef8: 5f pop %edi 80100ef9: 5d pop %ebp end_op(); 80100efa: e9 11 1d 00 00 jmp 80102c10 <end_op> panic("fileclose"); 80100eff: 83 ec 0c sub $0xc,%esp 80100f02: 68 5c 6f 10 80 push $0x80106f5c 80100f07: e8 84 f4 ff ff call 80100390 <panic> 80100f0c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100f10 <filestat>: // Get metadata about file f. int filestat(struct file *f, struct stat *st) { 80100f10: 55 push %ebp 80100f11: 89 e5 mov %esp,%ebp 80100f13: 53 push %ebx 80100f14: 83 ec 04 sub $0x4,%esp 80100f17: 8b 5d 08 mov 0x8(%ebp),%ebx if(f->type == FD_INODE){ 80100f1a: 83 3b 02 cmpl $0x2,(%ebx) 80100f1d: 75 31 jne 80100f50 <filestat+0x40> ilock(f->ip); 80100f1f: 83 ec 0c sub $0xc,%esp 80100f22: ff 73 10 pushl 0x10(%ebx) 80100f25: e8 56 07 00 00 call 80101680 <ilock> stati(f->ip, st); 80100f2a: 58 pop %eax 80100f2b: 5a pop %edx 80100f2c: ff 75 0c pushl 0xc(%ebp) 80100f2f: ff 73 10 pushl 0x10(%ebx) 80100f32: e8 f9 09 00 00 call 80101930 <stati> iunlock(f->ip); 80100f37: 59 pop %ecx 80100f38: ff 73 10 pushl 0x10(%ebx) 80100f3b: e8 20 08 00 00 call 80101760 <iunlock> return 0; 80100f40: 83 c4 10 add $0x10,%esp 80100f43: 31 c0 xor %eax,%eax } return -1; } 80100f45: 8b 5d fc mov -0x4(%ebp),%ebx 80100f48: c9 leave 80100f49: c3 ret 80100f4a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return -1; 80100f50: b8 ff ff ff ff mov $0xffffffff,%eax 80100f55: eb ee jmp 80100f45 <filestat+0x35> 80100f57: 89 f6 mov %esi,%esi 80100f59: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80100f60 <fileread>: // Read from file f. int fileread(struct file *f, char *addr, int n) { 80100f60: 55 push %ebp 80100f61: 89 e5 mov %esp,%ebp 80100f63: 57 push %edi 80100f64: 56 push %esi 80100f65: 53 push %ebx 80100f66: 83 ec 0c sub $0xc,%esp 80100f69: 8b 5d 08 mov 0x8(%ebp),%ebx 80100f6c: 8b 75 0c mov 0xc(%ebp),%esi 80100f6f: 8b 7d 10 mov 0x10(%ebp),%edi int r; if(f->readable == 0) 80100f72: 80 7b 08 00 cmpb $0x0,0x8(%ebx) 80100f76: 74 60 je 80100fd8 <fileread+0x78> return -1; if(f->type == FD_PIPE) 80100f78: 8b 03 mov (%ebx),%eax 80100f7a: 83 f8 01 cmp $0x1,%eax 80100f7d: 74 41 je 80100fc0 <fileread+0x60> return piperead(f->pipe, addr, n); if(f->type == FD_INODE){ 80100f7f: 83 f8 02 cmp $0x2,%eax 80100f82: 75 5b jne 80100fdf <fileread+0x7f> ilock(f->ip); 80100f84: 83 ec 0c sub $0xc,%esp 80100f87: ff 73 10 pushl 0x10(%ebx) 80100f8a: e8 f1 06 00 00 call 80101680 <ilock> if((r = readi(f->ip, addr, f->off, n)) > 0) 80100f8f: 57 push %edi 80100f90: ff 73 14 pushl 0x14(%ebx) 80100f93: 56 push %esi 80100f94: ff 73 10 pushl 0x10(%ebx) 80100f97: e8 c4 09 00 00 call 80101960 <readi> 80100f9c: 83 c4 20 add $0x20,%esp 80100f9f: 85 c0 test %eax,%eax 80100fa1: 89 c6 mov %eax,%esi 80100fa3: 7e 03 jle 80100fa8 <fileread+0x48> f->off += r; 80100fa5: 01 43 14 add %eax,0x14(%ebx) iunlock(f->ip); 80100fa8: 83 ec 0c sub $0xc,%esp 80100fab: ff 73 10 pushl 0x10(%ebx) 80100fae: e8 ad 07 00 00 call 80101760 <iunlock> return r; 80100fb3: 83 c4 10 add $0x10,%esp } panic("fileread"); } 80100fb6: 8d 65 f4 lea -0xc(%ebp),%esp 80100fb9: 89 f0 mov %esi,%eax 80100fbb: 5b pop %ebx 80100fbc: 5e pop %esi 80100fbd: 5f pop %edi 80100fbe: 5d pop %ebp 80100fbf: c3 ret return piperead(f->pipe, addr, n); 80100fc0: 8b 43 0c mov 0xc(%ebx),%eax 80100fc3: 89 45 08 mov %eax,0x8(%ebp) } 80100fc6: 8d 65 f4 lea -0xc(%ebp),%esp 80100fc9: 5b pop %ebx 80100fca: 5e pop %esi 80100fcb: 5f pop %edi 80100fcc: 5d pop %ebp return piperead(f->pipe, addr, n); 80100fcd: e9 2e 25 00 00 jmp 80103500 <piperead> 80100fd2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return -1; 80100fd8: be ff ff ff ff mov $0xffffffff,%esi 80100fdd: eb d7 jmp 80100fb6 <fileread+0x56> panic("fileread"); 80100fdf: 83 ec 0c sub $0xc,%esp 80100fe2: 68 66 6f 10 80 push $0x80106f66 80100fe7: e8 a4 f3 ff ff call 80100390 <panic> 80100fec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100ff0 <filewrite>: //PAGEBREAK! // Write to file f. int filewrite(struct file *f, char *addr, int n) { 80100ff0: 55 push %ebp 80100ff1: 89 e5 mov %esp,%ebp 80100ff3: 57 push %edi 80100ff4: 56 push %esi 80100ff5: 53 push %ebx 80100ff6: 83 ec 1c sub $0x1c,%esp 80100ff9: 8b 75 08 mov 0x8(%ebp),%esi 80100ffc: 8b 45 0c mov 0xc(%ebp),%eax int r; if(f->writable == 0) 80100fff: 80 7e 09 00 cmpb $0x0,0x9(%esi) { 80101003: 89 45 dc mov %eax,-0x24(%ebp) 80101006: 8b 45 10 mov 0x10(%ebp),%eax 80101009: 89 45 e4 mov %eax,-0x1c(%ebp) if(f->writable == 0) 8010100c: 0f 84 aa 00 00 00 je 801010bc <filewrite+0xcc> return -1; if(f->type == FD_PIPE) 80101012: 8b 06 mov (%esi),%eax 80101014: 83 f8 01 cmp $0x1,%eax 80101017: 0f 84 c3 00 00 00 je 801010e0 <filewrite+0xf0> return pipewrite(f->pipe, addr, n); if(f->type == FD_INODE){ 8010101d: 83 f8 02 cmp $0x2,%eax 80101020: 0f 85 d9 00 00 00 jne 801010ff <filewrite+0x10f> // 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 = ((MAXOPBLOCKS-1-1-2) / 2) * 512; int i = 0; while(i < n){ 80101026: 8b 45 e4 mov -0x1c(%ebp),%eax int i = 0; 80101029: 31 ff xor %edi,%edi while(i < n){ 8010102b: 85 c0 test %eax,%eax 8010102d: 7f 34 jg 80101063 <filewrite+0x73> 8010102f: e9 9c 00 00 00 jmp 801010d0 <filewrite+0xe0> 80101034: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi n1 = max; begin_op(); ilock(f->ip); if ((r = writei(f->ip, addr + i, f->off, n1)) > 0) f->off += r; 80101038: 01 46 14 add %eax,0x14(%esi) iunlock(f->ip); 8010103b: 83 ec 0c sub $0xc,%esp 8010103e: ff 76 10 pushl 0x10(%esi) f->off += r; 80101041: 89 45 e0 mov %eax,-0x20(%ebp) iunlock(f->ip); 80101044: e8 17 07 00 00 call 80101760 <iunlock> end_op(); 80101049: e8 c2 1b 00 00 call 80102c10 <end_op> 8010104e: 8b 45 e0 mov -0x20(%ebp),%eax 80101051: 83 c4 10 add $0x10,%esp if(r < 0) break; if(r != n1) 80101054: 39 c3 cmp %eax,%ebx 80101056: 0f 85 96 00 00 00 jne 801010f2 <filewrite+0x102> panic("short filewrite"); i += r; 8010105c: 01 df add %ebx,%edi while(i < n){ 8010105e: 39 7d e4 cmp %edi,-0x1c(%ebp) 80101061: 7e 6d jle 801010d0 <filewrite+0xe0> int n1 = n - i; 80101063: 8b 5d e4 mov -0x1c(%ebp),%ebx 80101066: b8 00 06 00 00 mov $0x600,%eax 8010106b: 29 fb sub %edi,%ebx 8010106d: 81 fb 00 06 00 00 cmp $0x600,%ebx 80101073: 0f 4f d8 cmovg %eax,%ebx begin_op(); 80101076: e8 25 1b 00 00 call 80102ba0 <begin_op> ilock(f->ip); 8010107b: 83 ec 0c sub $0xc,%esp 8010107e: ff 76 10 pushl 0x10(%esi) 80101081: e8 fa 05 00 00 call 80101680 <ilock> if ((r = writei(f->ip, addr + i, f->off, n1)) > 0) 80101086: 8b 45 dc mov -0x24(%ebp),%eax 80101089: 53 push %ebx 8010108a: ff 76 14 pushl 0x14(%esi) 8010108d: 01 f8 add %edi,%eax 8010108f: 50 push %eax 80101090: ff 76 10 pushl 0x10(%esi) 80101093: e8 c8 09 00 00 call 80101a60 <writei> 80101098: 83 c4 20 add $0x20,%esp 8010109b: 85 c0 test %eax,%eax 8010109d: 7f 99 jg 80101038 <filewrite+0x48> iunlock(f->ip); 8010109f: 83 ec 0c sub $0xc,%esp 801010a2: ff 76 10 pushl 0x10(%esi) 801010a5: 89 45 e0 mov %eax,-0x20(%ebp) 801010a8: e8 b3 06 00 00 call 80101760 <iunlock> end_op(); 801010ad: e8 5e 1b 00 00 call 80102c10 <end_op> if(r < 0) 801010b2: 8b 45 e0 mov -0x20(%ebp),%eax 801010b5: 83 c4 10 add $0x10,%esp 801010b8: 85 c0 test %eax,%eax 801010ba: 74 98 je 80101054 <filewrite+0x64> } return i == n ? n : -1; } panic("filewrite"); } 801010bc: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 801010bf: bf ff ff ff ff mov $0xffffffff,%edi } 801010c4: 89 f8 mov %edi,%eax 801010c6: 5b pop %ebx 801010c7: 5e pop %esi 801010c8: 5f pop %edi 801010c9: 5d pop %ebp 801010ca: c3 ret 801010cb: 90 nop 801010cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return i == n ? n : -1; 801010d0: 39 7d e4 cmp %edi,-0x1c(%ebp) 801010d3: 75 e7 jne 801010bc <filewrite+0xcc> } 801010d5: 8d 65 f4 lea -0xc(%ebp),%esp 801010d8: 89 f8 mov %edi,%eax 801010da: 5b pop %ebx 801010db: 5e pop %esi 801010dc: 5f pop %edi 801010dd: 5d pop %ebp 801010de: c3 ret 801010df: 90 nop return pipewrite(f->pipe, addr, n); 801010e0: 8b 46 0c mov 0xc(%esi),%eax 801010e3: 89 45 08 mov %eax,0x8(%ebp) } 801010e6: 8d 65 f4 lea -0xc(%ebp),%esp 801010e9: 5b pop %ebx 801010ea: 5e pop %esi 801010eb: 5f pop %edi 801010ec: 5d pop %ebp return pipewrite(f->pipe, addr, n); 801010ed: e9 fe 22 00 00 jmp 801033f0 <pipewrite> panic("short filewrite"); 801010f2: 83 ec 0c sub $0xc,%esp 801010f5: 68 6f 6f 10 80 push $0x80106f6f 801010fa: e8 91 f2 ff ff call 80100390 <panic> panic("filewrite"); 801010ff: 83 ec 0c sub $0xc,%esp 80101102: 68 75 6f 10 80 push $0x80106f75 80101107: e8 84 f2 ff ff call 80100390 <panic> 8010110c: 66 90 xchg %ax,%ax 8010110e: 66 90 xchg %ax,%ax 80101110 <bfree>: } // Free a disk block. static void bfree(int dev, uint b) { 80101110: 55 push %ebp 80101111: 89 e5 mov %esp,%ebp 80101113: 56 push %esi 80101114: 53 push %ebx 80101115: 89 d3 mov %edx,%ebx struct buf *bp; int bi, m; bp = bread(dev, BBLOCK(b, sb)); 80101117: c1 ea 0c shr $0xc,%edx 8010111a: 03 15 d8 09 11 80 add 0x801109d8,%edx 80101120: 83 ec 08 sub $0x8,%esp 80101123: 52 push %edx 80101124: 50 push %eax 80101125: e8 a6 ef ff ff call 801000d0 <bread> bi = b % BPB; m = 1 << (bi % 8); 8010112a: 89 d9 mov %ebx,%ecx if((bp->data[bi/8] & m) == 0) 8010112c: c1 fb 03 sar $0x3,%ebx m = 1 << (bi % 8); 8010112f: ba 01 00 00 00 mov $0x1,%edx 80101134: 83 e1 07 and $0x7,%ecx if((bp->data[bi/8] & m) == 0) 80101137: 81 e3 ff 01 00 00 and $0x1ff,%ebx 8010113d: 83 c4 10 add $0x10,%esp m = 1 << (bi % 8); 80101140: d3 e2 shl %cl,%edx if((bp->data[bi/8] & m) == 0) 80101142: 0f b6 4c 18 5c movzbl 0x5c(%eax,%ebx,1),%ecx 80101147: 85 d1 test %edx,%ecx 80101149: 74 25 je 80101170 <bfree+0x60> panic("freeing free block"); bp->data[bi/8] &= ~m; 8010114b: f7 d2 not %edx 8010114d: 89 c6 mov %eax,%esi log_write(bp); 8010114f: 83 ec 0c sub $0xc,%esp bp->data[bi/8] &= ~m; 80101152: 21 ca and %ecx,%edx 80101154: 88 54 1e 5c mov %dl,0x5c(%esi,%ebx,1) log_write(bp); 80101158: 56 push %esi 80101159: e8 12 1c 00 00 call 80102d70 <log_write> brelse(bp); 8010115e: 89 34 24 mov %esi,(%esp) 80101161: e8 7a f0 ff ff call 801001e0 <brelse> } 80101166: 83 c4 10 add $0x10,%esp 80101169: 8d 65 f8 lea -0x8(%ebp),%esp 8010116c: 5b pop %ebx 8010116d: 5e pop %esi 8010116e: 5d pop %ebp 8010116f: c3 ret panic("freeing free block"); 80101170: 83 ec 0c sub $0xc,%esp 80101173: 68 7f 6f 10 80 push $0x80106f7f 80101178: e8 13 f2 ff ff call 80100390 <panic> 8010117d: 8d 76 00 lea 0x0(%esi),%esi 80101180 <balloc>: { 80101180: 55 push %ebp 80101181: 89 e5 mov %esp,%ebp 80101183: 57 push %edi 80101184: 56 push %esi 80101185: 53 push %ebx 80101186: 83 ec 1c sub $0x1c,%esp for(b = 0; b < sb.size; b += BPB){ 80101189: 8b 0d c0 09 11 80 mov 0x801109c0,%ecx { 8010118f: 89 45 d8 mov %eax,-0x28(%ebp) for(b = 0; b < sb.size; b += BPB){ 80101192: 85 c9 test %ecx,%ecx 80101194: 0f 84 87 00 00 00 je 80101221 <balloc+0xa1> 8010119a: c7 45 dc 00 00 00 00 movl $0x0,-0x24(%ebp) bp = bread(dev, BBLOCK(b, sb)); 801011a1: 8b 75 dc mov -0x24(%ebp),%esi 801011a4: 83 ec 08 sub $0x8,%esp 801011a7: 89 f0 mov %esi,%eax 801011a9: c1 f8 0c sar $0xc,%eax 801011ac: 03 05 d8 09 11 80 add 0x801109d8,%eax 801011b2: 50 push %eax 801011b3: ff 75 d8 pushl -0x28(%ebp) 801011b6: e8 15 ef ff ff call 801000d0 <bread> 801011bb: 89 45 e4 mov %eax,-0x1c(%ebp) for(bi = 0; bi < BPB && b + bi < sb.size; bi++){ 801011be: a1 c0 09 11 80 mov 0x801109c0,%eax 801011c3: 83 c4 10 add $0x10,%esp 801011c6: 89 45 e0 mov %eax,-0x20(%ebp) 801011c9: 31 c0 xor %eax,%eax 801011cb: eb 2f jmp 801011fc <balloc+0x7c> 801011cd: 8d 76 00 lea 0x0(%esi),%esi m = 1 << (bi % 8); 801011d0: 89 c1 mov %eax,%ecx if((bp->data[bi/8] & m) == 0){ // Is block free? 801011d2: 8b 55 e4 mov -0x1c(%ebp),%edx m = 1 << (bi % 8); 801011d5: bb 01 00 00 00 mov $0x1,%ebx 801011da: 83 e1 07 and $0x7,%ecx 801011dd: d3 e3 shl %cl,%ebx if((bp->data[bi/8] & m) == 0){ // Is block free? 801011df: 89 c1 mov %eax,%ecx 801011e1: c1 f9 03 sar $0x3,%ecx 801011e4: 0f b6 7c 0a 5c movzbl 0x5c(%edx,%ecx,1),%edi 801011e9: 85 df test %ebx,%edi 801011eb: 89 fa mov %edi,%edx 801011ed: 74 41 je 80101230 <balloc+0xb0> for(bi = 0; bi < BPB && b + bi < sb.size; bi++){ 801011ef: 83 c0 01 add $0x1,%eax 801011f2: 83 c6 01 add $0x1,%esi 801011f5: 3d 00 10 00 00 cmp $0x1000,%eax 801011fa: 74 05 je 80101201 <balloc+0x81> 801011fc: 39 75 e0 cmp %esi,-0x20(%ebp) 801011ff: 77 cf ja 801011d0 <balloc+0x50> brelse(bp); 80101201: 83 ec 0c sub $0xc,%esp 80101204: ff 75 e4 pushl -0x1c(%ebp) 80101207: e8 d4 ef ff ff call 801001e0 <brelse> for(b = 0; b < sb.size; b += BPB){ 8010120c: 81 45 dc 00 10 00 00 addl $0x1000,-0x24(%ebp) 80101213: 83 c4 10 add $0x10,%esp 80101216: 8b 45 dc mov -0x24(%ebp),%eax 80101219: 39 05 c0 09 11 80 cmp %eax,0x801109c0 8010121f: 77 80 ja 801011a1 <balloc+0x21> panic("balloc: out of blocks"); 80101221: 83 ec 0c sub $0xc,%esp 80101224: 68 92 6f 10 80 push $0x80106f92 80101229: e8 62 f1 ff ff call 80100390 <panic> 8010122e: 66 90 xchg %ax,%ax bp->data[bi/8] |= m; // Mark block in use. 80101230: 8b 7d e4 mov -0x1c(%ebp),%edi log_write(bp); 80101233: 83 ec 0c sub $0xc,%esp bp->data[bi/8] |= m; // Mark block in use. 80101236: 09 da or %ebx,%edx 80101238: 88 54 0f 5c mov %dl,0x5c(%edi,%ecx,1) log_write(bp); 8010123c: 57 push %edi 8010123d: e8 2e 1b 00 00 call 80102d70 <log_write> brelse(bp); 80101242: 89 3c 24 mov %edi,(%esp) 80101245: e8 96 ef ff ff call 801001e0 <brelse> bp = bread(dev, bno); 8010124a: 58 pop %eax 8010124b: 5a pop %edx 8010124c: 56 push %esi 8010124d: ff 75 d8 pushl -0x28(%ebp) 80101250: e8 7b ee ff ff call 801000d0 <bread> 80101255: 89 c3 mov %eax,%ebx memset(bp->data, 0, BSIZE); 80101257: 8d 40 5c lea 0x5c(%eax),%eax 8010125a: 83 c4 0c add $0xc,%esp 8010125d: 68 00 02 00 00 push $0x200 80101262: 6a 00 push $0x0 80101264: 50 push %eax 80101265: e8 e6 31 00 00 call 80104450 <memset> log_write(bp); 8010126a: 89 1c 24 mov %ebx,(%esp) 8010126d: e8 fe 1a 00 00 call 80102d70 <log_write> brelse(bp); 80101272: 89 1c 24 mov %ebx,(%esp) 80101275: e8 66 ef ff ff call 801001e0 <brelse> } 8010127a: 8d 65 f4 lea -0xc(%ebp),%esp 8010127d: 89 f0 mov %esi,%eax 8010127f: 5b pop %ebx 80101280: 5e pop %esi 80101281: 5f pop %edi 80101282: 5d pop %ebp 80101283: c3 ret 80101284: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010128a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80101290 <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) { 80101290: 55 push %ebp 80101291: 89 e5 mov %esp,%ebp 80101293: 57 push %edi 80101294: 56 push %esi 80101295: 53 push %ebx 80101296: 89 c7 mov %eax,%edi struct inode *ip, *empty; acquire(&icache.lock); // Is the inode already cached? empty = 0; 80101298: 31 f6 xor %esi,%esi for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ 8010129a: bb 14 0a 11 80 mov $0x80110a14,%ebx { 8010129f: 83 ec 28 sub $0x28,%esp 801012a2: 89 55 e4 mov %edx,-0x1c(%ebp) acquire(&icache.lock); 801012a5: 68 e0 09 11 80 push $0x801109e0 801012aa: e8 91 30 00 00 call 80104340 <acquire> 801012af: 83 c4 10 add $0x10,%esp for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ 801012b2: 8b 55 e4 mov -0x1c(%ebp),%edx 801012b5: eb 17 jmp 801012ce <iget+0x3e> 801012b7: 89 f6 mov %esi,%esi 801012b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801012c0: 81 c3 90 00 00 00 add $0x90,%ebx 801012c6: 81 fb 34 26 11 80 cmp $0x80112634,%ebx 801012cc: 73 22 jae 801012f0 <iget+0x60> if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){ 801012ce: 8b 4b 08 mov 0x8(%ebx),%ecx 801012d1: 85 c9 test %ecx,%ecx 801012d3: 7e 04 jle 801012d9 <iget+0x49> 801012d5: 39 3b cmp %edi,(%ebx) 801012d7: 74 4f je 80101328 <iget+0x98> ip->ref++; release(&icache.lock); return ip; } if(empty == 0 && ip->ref == 0) // Remember empty slot. 801012d9: 85 f6 test %esi,%esi 801012db: 75 e3 jne 801012c0 <iget+0x30> 801012dd: 85 c9 test %ecx,%ecx 801012df: 0f 44 f3 cmove %ebx,%esi for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ 801012e2: 81 c3 90 00 00 00 add $0x90,%ebx 801012e8: 81 fb 34 26 11 80 cmp $0x80112634,%ebx 801012ee: 72 de jb 801012ce <iget+0x3e> empty = ip; } // Recycle an inode cache entry. if(empty == 0) 801012f0: 85 f6 test %esi,%esi 801012f2: 74 5b je 8010134f <iget+0xbf> ip = empty; ip->dev = dev; ip->inum = inum; ip->ref = 1; ip->valid = 0; release(&icache.lock); 801012f4: 83 ec 0c sub $0xc,%esp ip->dev = dev; 801012f7: 89 3e mov %edi,(%esi) ip->inum = inum; 801012f9: 89 56 04 mov %edx,0x4(%esi) ip->ref = 1; 801012fc: c7 46 08 01 00 00 00 movl $0x1,0x8(%esi) ip->valid = 0; 80101303: c7 46 4c 00 00 00 00 movl $0x0,0x4c(%esi) release(&icache.lock); 8010130a: 68 e0 09 11 80 push $0x801109e0 8010130f: e8 ec 30 00 00 call 80104400 <release> return ip; 80101314: 83 c4 10 add $0x10,%esp } 80101317: 8d 65 f4 lea -0xc(%ebp),%esp 8010131a: 89 f0 mov %esi,%eax 8010131c: 5b pop %ebx 8010131d: 5e pop %esi 8010131e: 5f pop %edi 8010131f: 5d pop %ebp 80101320: c3 ret 80101321: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){ 80101328: 39 53 04 cmp %edx,0x4(%ebx) 8010132b: 75 ac jne 801012d9 <iget+0x49> release(&icache.lock); 8010132d: 83 ec 0c sub $0xc,%esp ip->ref++; 80101330: 83 c1 01 add $0x1,%ecx return ip; 80101333: 89 de mov %ebx,%esi release(&icache.lock); 80101335: 68 e0 09 11 80 push $0x801109e0 ip->ref++; 8010133a: 89 4b 08 mov %ecx,0x8(%ebx) release(&icache.lock); 8010133d: e8 be 30 00 00 call 80104400 <release> return ip; 80101342: 83 c4 10 add $0x10,%esp } 80101345: 8d 65 f4 lea -0xc(%ebp),%esp 80101348: 89 f0 mov %esi,%eax 8010134a: 5b pop %ebx 8010134b: 5e pop %esi 8010134c: 5f pop %edi 8010134d: 5d pop %ebp 8010134e: c3 ret panic("iget: no inodes"); 8010134f: 83 ec 0c sub $0xc,%esp 80101352: 68 a8 6f 10 80 push $0x80106fa8 80101357: e8 34 f0 ff ff call 80100390 <panic> 8010135c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101360 <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) { 80101360: 55 push %ebp 80101361: 89 e5 mov %esp,%ebp 80101363: 57 push %edi 80101364: 56 push %esi 80101365: 53 push %ebx 80101366: 89 c6 mov %eax,%esi 80101368: 83 ec 1c sub $0x1c,%esp uint addr, *a; struct buf *bp; if(bn < NDIRECT){ 8010136b: 83 fa 0b cmp $0xb,%edx 8010136e: 77 18 ja 80101388 <bmap+0x28> 80101370: 8d 3c 90 lea (%eax,%edx,4),%edi if((addr = ip->addrs[bn]) == 0) 80101373: 8b 5f 5c mov 0x5c(%edi),%ebx 80101376: 85 db test %ebx,%ebx 80101378: 74 76 je 801013f0 <bmap+0x90> brelse(bp); return addr; } panic("bmap: out of range"); } 8010137a: 8d 65 f4 lea -0xc(%ebp),%esp 8010137d: 89 d8 mov %ebx,%eax 8010137f: 5b pop %ebx 80101380: 5e pop %esi 80101381: 5f pop %edi 80101382: 5d pop %ebp 80101383: c3 ret 80101384: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi bn -= NDIRECT; 80101388: 8d 5a f4 lea -0xc(%edx),%ebx if(bn < NINDIRECT){ 8010138b: 83 fb 7f cmp $0x7f,%ebx 8010138e: 0f 87 90 00 00 00 ja 80101424 <bmap+0xc4> if((addr = ip->addrs[NDIRECT]) == 0) 80101394: 8b 90 8c 00 00 00 mov 0x8c(%eax),%edx 8010139a: 8b 00 mov (%eax),%eax 8010139c: 85 d2 test %edx,%edx 8010139e: 74 70 je 80101410 <bmap+0xb0> bp = bread(ip->dev, addr); 801013a0: 83 ec 08 sub $0x8,%esp 801013a3: 52 push %edx 801013a4: 50 push %eax 801013a5: e8 26 ed ff ff call 801000d0 <bread> if((addr = a[bn]) == 0){ 801013aa: 8d 54 98 5c lea 0x5c(%eax,%ebx,4),%edx 801013ae: 83 c4 10 add $0x10,%esp bp = bread(ip->dev, addr); 801013b1: 89 c7 mov %eax,%edi if((addr = a[bn]) == 0){ 801013b3: 8b 1a mov (%edx),%ebx 801013b5: 85 db test %ebx,%ebx 801013b7: 75 1d jne 801013d6 <bmap+0x76> a[bn] = addr = balloc(ip->dev); 801013b9: 8b 06 mov (%esi),%eax 801013bb: 89 55 e4 mov %edx,-0x1c(%ebp) 801013be: e8 bd fd ff ff call 80101180 <balloc> 801013c3: 8b 55 e4 mov -0x1c(%ebp),%edx log_write(bp); 801013c6: 83 ec 0c sub $0xc,%esp a[bn] = addr = balloc(ip->dev); 801013c9: 89 c3 mov %eax,%ebx 801013cb: 89 02 mov %eax,(%edx) log_write(bp); 801013cd: 57 push %edi 801013ce: e8 9d 19 00 00 call 80102d70 <log_write> 801013d3: 83 c4 10 add $0x10,%esp brelse(bp); 801013d6: 83 ec 0c sub $0xc,%esp 801013d9: 57 push %edi 801013da: e8 01 ee ff ff call 801001e0 <brelse> 801013df: 83 c4 10 add $0x10,%esp } 801013e2: 8d 65 f4 lea -0xc(%ebp),%esp 801013e5: 89 d8 mov %ebx,%eax 801013e7: 5b pop %ebx 801013e8: 5e pop %esi 801013e9: 5f pop %edi 801013ea: 5d pop %ebp 801013eb: c3 ret 801013ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi ip->addrs[bn] = addr = balloc(ip->dev); 801013f0: 8b 00 mov (%eax),%eax 801013f2: e8 89 fd ff ff call 80101180 <balloc> 801013f7: 89 47 5c mov %eax,0x5c(%edi) } 801013fa: 8d 65 f4 lea -0xc(%ebp),%esp ip->addrs[bn] = addr = balloc(ip->dev); 801013fd: 89 c3 mov %eax,%ebx } 801013ff: 89 d8 mov %ebx,%eax 80101401: 5b pop %ebx 80101402: 5e pop %esi 80101403: 5f pop %edi 80101404: 5d pop %ebp 80101405: c3 ret 80101406: 8d 76 00 lea 0x0(%esi),%esi 80101409: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi ip->addrs[NDIRECT] = addr = balloc(ip->dev); 80101410: e8 6b fd ff ff call 80101180 <balloc> 80101415: 89 c2 mov %eax,%edx 80101417: 89 86 8c 00 00 00 mov %eax,0x8c(%esi) 8010141d: 8b 06 mov (%esi),%eax 8010141f: e9 7c ff ff ff jmp 801013a0 <bmap+0x40> panic("bmap: out of range"); 80101424: 83 ec 0c sub $0xc,%esp 80101427: 68 b8 6f 10 80 push $0x80106fb8 8010142c: e8 5f ef ff ff call 80100390 <panic> 80101431: eb 0d jmp 80101440 <readsb> 80101433: 90 nop 80101434: 90 nop 80101435: 90 nop 80101436: 90 nop 80101437: 90 nop 80101438: 90 nop 80101439: 90 nop 8010143a: 90 nop 8010143b: 90 nop 8010143c: 90 nop 8010143d: 90 nop 8010143e: 90 nop 8010143f: 90 nop 80101440 <readsb>: { 80101440: 55 push %ebp 80101441: 89 e5 mov %esp,%ebp 80101443: 56 push %esi 80101444: 53 push %ebx 80101445: 8b 75 0c mov 0xc(%ebp),%esi bp = bread(dev, 1); 80101448: 83 ec 08 sub $0x8,%esp 8010144b: 6a 01 push $0x1 8010144d: ff 75 08 pushl 0x8(%ebp) 80101450: e8 7b ec ff ff call 801000d0 <bread> 80101455: 89 c3 mov %eax,%ebx memmove(sb, bp->data, sizeof(*sb)); 80101457: 8d 40 5c lea 0x5c(%eax),%eax 8010145a: 83 c4 0c add $0xc,%esp 8010145d: 6a 1c push $0x1c 8010145f: 50 push %eax 80101460: 56 push %esi 80101461: e8 9a 30 00 00 call 80104500 <memmove> brelse(bp); 80101466: 89 5d 08 mov %ebx,0x8(%ebp) 80101469: 83 c4 10 add $0x10,%esp } 8010146c: 8d 65 f8 lea -0x8(%ebp),%esp 8010146f: 5b pop %ebx 80101470: 5e pop %esi 80101471: 5d pop %ebp brelse(bp); 80101472: e9 69 ed ff ff jmp 801001e0 <brelse> 80101477: 89 f6 mov %esi,%esi 80101479: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101480 <iinit>: { 80101480: 55 push %ebp 80101481: 89 e5 mov %esp,%ebp 80101483: 53 push %ebx 80101484: bb 20 0a 11 80 mov $0x80110a20,%ebx 80101489: 83 ec 0c sub $0xc,%esp initlock(&icache.lock, "icache"); 8010148c: 68 cb 6f 10 80 push $0x80106fcb 80101491: 68 e0 09 11 80 push $0x801109e0 80101496: e8 65 2d 00 00 call 80104200 <initlock> 8010149b: 83 c4 10 add $0x10,%esp 8010149e: 66 90 xchg %ax,%ax initsleeplock(&icache.inode[i].lock, "inode"); 801014a0: 83 ec 08 sub $0x8,%esp 801014a3: 68 d2 6f 10 80 push $0x80106fd2 801014a8: 53 push %ebx 801014a9: 81 c3 90 00 00 00 add $0x90,%ebx 801014af: e8 1c 2c 00 00 call 801040d0 <initsleeplock> for(i = 0; i < NINODE; i++) { 801014b4: 83 c4 10 add $0x10,%esp 801014b7: 81 fb 40 26 11 80 cmp $0x80112640,%ebx 801014bd: 75 e1 jne 801014a0 <iinit+0x20> readsb(dev, &sb); 801014bf: 83 ec 08 sub $0x8,%esp 801014c2: 68 c0 09 11 80 push $0x801109c0 801014c7: ff 75 08 pushl 0x8(%ebp) 801014ca: e8 71 ff ff ff call 80101440 <readsb> cprintf("sb: size %d nblocks %d ninodes %d nlog %d logstart %d\ 801014cf: ff 35 d8 09 11 80 pushl 0x801109d8 801014d5: ff 35 d4 09 11 80 pushl 0x801109d4 801014db: ff 35 d0 09 11 80 pushl 0x801109d0 801014e1: ff 35 cc 09 11 80 pushl 0x801109cc 801014e7: ff 35 c8 09 11 80 pushl 0x801109c8 801014ed: ff 35 c4 09 11 80 pushl 0x801109c4 801014f3: ff 35 c0 09 11 80 pushl 0x801109c0 801014f9: 68 38 70 10 80 push $0x80107038 801014fe: e8 5d f1 ff ff call 80100660 <cprintf> } 80101503: 83 c4 30 add $0x30,%esp 80101506: 8b 5d fc mov -0x4(%ebp),%ebx 80101509: c9 leave 8010150a: c3 ret 8010150b: 90 nop 8010150c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 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 1c sub $0x1c,%esp for(inum = 1; inum < sb.ninodes; inum++){ 80101519: 83 3d c8 09 11 80 01 cmpl $0x1,0x801109c8 { 80101520: 8b 45 0c mov 0xc(%ebp),%eax 80101523: 8b 75 08 mov 0x8(%ebp),%esi 80101526: 89 45 e4 mov %eax,-0x1c(%ebp) for(inum = 1; inum < sb.ninodes; inum++){ 80101529: 0f 86 91 00 00 00 jbe 801015c0 <ialloc+0xb0> 8010152f: bb 01 00 00 00 mov $0x1,%ebx 80101534: eb 21 jmp 80101557 <ialloc+0x47> 80101536: 8d 76 00 lea 0x0(%esi),%esi 80101539: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi brelse(bp); 80101540: 83 ec 0c sub $0xc,%esp for(inum = 1; inum < sb.ninodes; inum++){ 80101543: 83 c3 01 add $0x1,%ebx brelse(bp); 80101546: 57 push %edi 80101547: e8 94 ec ff ff call 801001e0 <brelse> for(inum = 1; inum < sb.ninodes; inum++){ 8010154c: 83 c4 10 add $0x10,%esp 8010154f: 39 1d c8 09 11 80 cmp %ebx,0x801109c8 80101555: 76 69 jbe 801015c0 <ialloc+0xb0> bp = bread(dev, IBLOCK(inum, sb)); 80101557: 89 d8 mov %ebx,%eax 80101559: 83 ec 08 sub $0x8,%esp 8010155c: c1 e8 03 shr $0x3,%eax 8010155f: 03 05 d4 09 11 80 add 0x801109d4,%eax 80101565: 50 push %eax 80101566: 56 push %esi 80101567: e8 64 eb ff ff call 801000d0 <bread> 8010156c: 89 c7 mov %eax,%edi dip = (struct dinode*)bp->data + inum%IPB; 8010156e: 89 d8 mov %ebx,%eax if(dip->type == 0){ // a free inode 80101570: 83 c4 10 add $0x10,%esp dip = (struct dinode*)bp->data + inum%IPB; 80101573: 83 e0 07 and $0x7,%eax 80101576: c1 e0 06 shl $0x6,%eax 80101579: 8d 4c 07 5c lea 0x5c(%edi,%eax,1),%ecx if(dip->type == 0){ // a free inode 8010157d: 66 83 39 00 cmpw $0x0,(%ecx) 80101581: 75 bd jne 80101540 <ialloc+0x30> memset(dip, 0, sizeof(*dip)); 80101583: 83 ec 04 sub $0x4,%esp 80101586: 89 4d e0 mov %ecx,-0x20(%ebp) 80101589: 6a 40 push $0x40 8010158b: 6a 00 push $0x0 8010158d: 51 push %ecx 8010158e: e8 bd 2e 00 00 call 80104450 <memset> dip->type = type; 80101593: 0f b7 45 e4 movzwl -0x1c(%ebp),%eax 80101597: 8b 4d e0 mov -0x20(%ebp),%ecx 8010159a: 66 89 01 mov %ax,(%ecx) log_write(bp); // mark it allocated on the disk 8010159d: 89 3c 24 mov %edi,(%esp) 801015a0: e8 cb 17 00 00 call 80102d70 <log_write> brelse(bp); 801015a5: 89 3c 24 mov %edi,(%esp) 801015a8: e8 33 ec ff ff call 801001e0 <brelse> return iget(dev, inum); 801015ad: 83 c4 10 add $0x10,%esp } 801015b0: 8d 65 f4 lea -0xc(%ebp),%esp return iget(dev, inum); 801015b3: 89 da mov %ebx,%edx 801015b5: 89 f0 mov %esi,%eax } 801015b7: 5b pop %ebx 801015b8: 5e pop %esi 801015b9: 5f pop %edi 801015ba: 5d pop %ebp return iget(dev, inum); 801015bb: e9 d0 fc ff ff jmp 80101290 <iget> panic("ialloc: no inodes"); 801015c0: 83 ec 0c sub $0xc,%esp 801015c3: 68 d8 6f 10 80 push $0x80106fd8 801015c8: e8 c3 ed ff ff call 80100390 <panic> 801015cd: 8d 76 00 lea 0x0(%esi),%esi 801015d0 <iupdate>: { 801015d0: 55 push %ebp 801015d1: 89 e5 mov %esp,%ebp 801015d3: 56 push %esi 801015d4: 53 push %ebx 801015d5: 8b 5d 08 mov 0x8(%ebp),%ebx bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 801015d8: 83 ec 08 sub $0x8,%esp 801015db: 8b 43 04 mov 0x4(%ebx),%eax memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 801015de: 83 c3 5c add $0x5c,%ebx bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 801015e1: c1 e8 03 shr $0x3,%eax 801015e4: 03 05 d4 09 11 80 add 0x801109d4,%eax 801015ea: 50 push %eax 801015eb: ff 73 a4 pushl -0x5c(%ebx) 801015ee: e8 dd ea ff ff call 801000d0 <bread> 801015f3: 89 c6 mov %eax,%esi dip = (struct dinode*)bp->data + ip->inum%IPB; 801015f5: 8b 43 a8 mov -0x58(%ebx),%eax dip->type = ip->type; 801015f8: 0f b7 53 f4 movzwl -0xc(%ebx),%edx memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 801015fc: 83 c4 0c add $0xc,%esp dip = (struct dinode*)bp->data + ip->inum%IPB; 801015ff: 83 e0 07 and $0x7,%eax 80101602: c1 e0 06 shl $0x6,%eax 80101605: 8d 44 06 5c lea 0x5c(%esi,%eax,1),%eax dip->type = ip->type; 80101609: 66 89 10 mov %dx,(%eax) dip->major = ip->major; 8010160c: 0f b7 53 f6 movzwl -0xa(%ebx),%edx memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 80101610: 83 c0 0c add $0xc,%eax dip->major = ip->major; 80101613: 66 89 50 f6 mov %dx,-0xa(%eax) dip->minor = ip->minor; 80101617: 0f b7 53 f8 movzwl -0x8(%ebx),%edx 8010161b: 66 89 50 f8 mov %dx,-0x8(%eax) dip->nlink = ip->nlink; 8010161f: 0f b7 53 fa movzwl -0x6(%ebx),%edx 80101623: 66 89 50 fa mov %dx,-0x6(%eax) dip->size = ip->size; 80101627: 8b 53 fc mov -0x4(%ebx),%edx 8010162a: 89 50 fc mov %edx,-0x4(%eax) memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 8010162d: 6a 34 push $0x34 8010162f: 53 push %ebx 80101630: 50 push %eax 80101631: e8 ca 2e 00 00 call 80104500 <memmove> log_write(bp); 80101636: 89 34 24 mov %esi,(%esp) 80101639: e8 32 17 00 00 call 80102d70 <log_write> brelse(bp); 8010163e: 89 75 08 mov %esi,0x8(%ebp) 80101641: 83 c4 10 add $0x10,%esp } 80101644: 8d 65 f8 lea -0x8(%ebp),%esp 80101647: 5b pop %ebx 80101648: 5e pop %esi 80101649: 5d pop %ebp brelse(bp); 8010164a: e9 91 eb ff ff jmp 801001e0 <brelse> 8010164f: 90 nop 80101650 <idup>: { 80101650: 55 push %ebp 80101651: 89 e5 mov %esp,%ebp 80101653: 53 push %ebx 80101654: 83 ec 10 sub $0x10,%esp 80101657: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&icache.lock); 8010165a: 68 e0 09 11 80 push $0x801109e0 8010165f: e8 dc 2c 00 00 call 80104340 <acquire> ip->ref++; 80101664: 83 43 08 01 addl $0x1,0x8(%ebx) release(&icache.lock); 80101668: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp) 8010166f: e8 8c 2d 00 00 call 80104400 <release> } 80101674: 89 d8 mov %ebx,%eax 80101676: 8b 5d fc mov -0x4(%ebp),%ebx 80101679: c9 leave 8010167a: c3 ret 8010167b: 90 nop 8010167c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101680 <ilock>: { 80101680: 55 push %ebp 80101681: 89 e5 mov %esp,%ebp 80101683: 56 push %esi 80101684: 53 push %ebx 80101685: 8b 5d 08 mov 0x8(%ebp),%ebx if(ip == 0 || ip->ref < 1) 80101688: 85 db test %ebx,%ebx 8010168a: 0f 84 b7 00 00 00 je 80101747 <ilock+0xc7> 80101690: 8b 53 08 mov 0x8(%ebx),%edx 80101693: 85 d2 test %edx,%edx 80101695: 0f 8e ac 00 00 00 jle 80101747 <ilock+0xc7> acquiresleep(&ip->lock); 8010169b: 8d 43 0c lea 0xc(%ebx),%eax 8010169e: 83 ec 0c sub $0xc,%esp 801016a1: 50 push %eax 801016a2: e8 69 2a 00 00 call 80104110 <acquiresleep> if(ip->valid == 0){ 801016a7: 8b 43 4c mov 0x4c(%ebx),%eax 801016aa: 83 c4 10 add $0x10,%esp 801016ad: 85 c0 test %eax,%eax 801016af: 74 0f je 801016c0 <ilock+0x40> } 801016b1: 8d 65 f8 lea -0x8(%ebp),%esp 801016b4: 5b pop %ebx 801016b5: 5e pop %esi 801016b6: 5d pop %ebp 801016b7: c3 ret 801016b8: 90 nop 801016b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 801016c0: 8b 43 04 mov 0x4(%ebx),%eax 801016c3: 83 ec 08 sub $0x8,%esp 801016c6: c1 e8 03 shr $0x3,%eax 801016c9: 03 05 d4 09 11 80 add 0x801109d4,%eax 801016cf: 50 push %eax 801016d0: ff 33 pushl (%ebx) 801016d2: e8 f9 e9 ff ff call 801000d0 <bread> 801016d7: 89 c6 mov %eax,%esi dip = (struct dinode*)bp->data + ip->inum%IPB; 801016d9: 8b 43 04 mov 0x4(%ebx),%eax memmove(ip->addrs, dip->addrs, sizeof(ip->addrs)); 801016dc: 83 c4 0c add $0xc,%esp dip = (struct dinode*)bp->data + ip->inum%IPB; 801016df: 83 e0 07 and $0x7,%eax 801016e2: c1 e0 06 shl $0x6,%eax 801016e5: 8d 44 06 5c lea 0x5c(%esi,%eax,1),%eax ip->type = dip->type; 801016e9: 0f b7 10 movzwl (%eax),%edx memmove(ip->addrs, dip->addrs, sizeof(ip->addrs)); 801016ec: 83 c0 0c add $0xc,%eax ip->type = dip->type; 801016ef: 66 89 53 50 mov %dx,0x50(%ebx) ip->major = dip->major; 801016f3: 0f b7 50 f6 movzwl -0xa(%eax),%edx 801016f7: 66 89 53 52 mov %dx,0x52(%ebx) ip->minor = dip->minor; 801016fb: 0f b7 50 f8 movzwl -0x8(%eax),%edx 801016ff: 66 89 53 54 mov %dx,0x54(%ebx) ip->nlink = dip->nlink; 80101703: 0f b7 50 fa movzwl -0x6(%eax),%edx 80101707: 66 89 53 56 mov %dx,0x56(%ebx) ip->size = dip->size; 8010170b: 8b 50 fc mov -0x4(%eax),%edx 8010170e: 89 53 58 mov %edx,0x58(%ebx) memmove(ip->addrs, dip->addrs, sizeof(ip->addrs)); 80101711: 6a 34 push $0x34 80101713: 50 push %eax 80101714: 8d 43 5c lea 0x5c(%ebx),%eax 80101717: 50 push %eax 80101718: e8 e3 2d 00 00 call 80104500 <memmove> brelse(bp); 8010171d: 89 34 24 mov %esi,(%esp) 80101720: e8 bb ea ff ff call 801001e0 <brelse> if(ip->type == 0) 80101725: 83 c4 10 add $0x10,%esp 80101728: 66 83 7b 50 00 cmpw $0x0,0x50(%ebx) ip->valid = 1; 8010172d: c7 43 4c 01 00 00 00 movl $0x1,0x4c(%ebx) if(ip->type == 0) 80101734: 0f 85 77 ff ff ff jne 801016b1 <ilock+0x31> panic("ilock: no type"); 8010173a: 83 ec 0c sub $0xc,%esp 8010173d: 68 f0 6f 10 80 push $0x80106ff0 80101742: e8 49 ec ff ff call 80100390 <panic> panic("ilock"); 80101747: 83 ec 0c sub $0xc,%esp 8010174a: 68 ea 6f 10 80 push $0x80106fea 8010174f: e8 3c ec ff ff call 80100390 <panic> 80101754: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010175a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80101760 <iunlock>: { 80101760: 55 push %ebp 80101761: 89 e5 mov %esp,%ebp 80101763: 56 push %esi 80101764: 53 push %ebx 80101765: 8b 5d 08 mov 0x8(%ebp),%ebx if(ip == 0 || !holdingsleep(&ip->lock) || ip->ref < 1) 80101768: 85 db test %ebx,%ebx 8010176a: 74 28 je 80101794 <iunlock+0x34> 8010176c: 8d 73 0c lea 0xc(%ebx),%esi 8010176f: 83 ec 0c sub $0xc,%esp 80101772: 56 push %esi 80101773: e8 38 2a 00 00 call 801041b0 <holdingsleep> 80101778: 83 c4 10 add $0x10,%esp 8010177b: 85 c0 test %eax,%eax 8010177d: 74 15 je 80101794 <iunlock+0x34> 8010177f: 8b 43 08 mov 0x8(%ebx),%eax 80101782: 85 c0 test %eax,%eax 80101784: 7e 0e jle 80101794 <iunlock+0x34> releasesleep(&ip->lock); 80101786: 89 75 08 mov %esi,0x8(%ebp) } 80101789: 8d 65 f8 lea -0x8(%ebp),%esp 8010178c: 5b pop %ebx 8010178d: 5e pop %esi 8010178e: 5d pop %ebp releasesleep(&ip->lock); 8010178f: e9 dc 29 00 00 jmp 80104170 <releasesleep> panic("iunlock"); 80101794: 83 ec 0c sub $0xc,%esp 80101797: 68 ff 6f 10 80 push $0x80106fff 8010179c: e8 ef eb ff ff call 80100390 <panic> 801017a1: eb 0d jmp 801017b0 <iput> 801017a3: 90 nop 801017a4: 90 nop 801017a5: 90 nop 801017a6: 90 nop 801017a7: 90 nop 801017a8: 90 nop 801017a9: 90 nop 801017aa: 90 nop 801017ab: 90 nop 801017ac: 90 nop 801017ad: 90 nop 801017ae: 90 nop 801017af: 90 nop 801017b0 <iput>: { 801017b0: 55 push %ebp 801017b1: 89 e5 mov %esp,%ebp 801017b3: 57 push %edi 801017b4: 56 push %esi 801017b5: 53 push %ebx 801017b6: 83 ec 28 sub $0x28,%esp 801017b9: 8b 5d 08 mov 0x8(%ebp),%ebx acquiresleep(&ip->lock); 801017bc: 8d 7b 0c lea 0xc(%ebx),%edi 801017bf: 57 push %edi 801017c0: e8 4b 29 00 00 call 80104110 <acquiresleep> if(ip->valid && ip->nlink == 0){ 801017c5: 8b 53 4c mov 0x4c(%ebx),%edx 801017c8: 83 c4 10 add $0x10,%esp 801017cb: 85 d2 test %edx,%edx 801017cd: 74 07 je 801017d6 <iput+0x26> 801017cf: 66 83 7b 56 00 cmpw $0x0,0x56(%ebx) 801017d4: 74 32 je 80101808 <iput+0x58> releasesleep(&ip->lock); 801017d6: 83 ec 0c sub $0xc,%esp 801017d9: 57 push %edi 801017da: e8 91 29 00 00 call 80104170 <releasesleep> acquire(&icache.lock); 801017df: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp) 801017e6: e8 55 2b 00 00 call 80104340 <acquire> ip->ref--; 801017eb: 83 6b 08 01 subl $0x1,0x8(%ebx) release(&icache.lock); 801017ef: 83 c4 10 add $0x10,%esp 801017f2: c7 45 08 e0 09 11 80 movl $0x801109e0,0x8(%ebp) } 801017f9: 8d 65 f4 lea -0xc(%ebp),%esp 801017fc: 5b pop %ebx 801017fd: 5e pop %esi 801017fe: 5f pop %edi 801017ff: 5d pop %ebp release(&icache.lock); 80101800: e9 fb 2b 00 00 jmp 80104400 <release> 80101805: 8d 76 00 lea 0x0(%esi),%esi acquire(&icache.lock); 80101808: 83 ec 0c sub $0xc,%esp 8010180b: 68 e0 09 11 80 push $0x801109e0 80101810: e8 2b 2b 00 00 call 80104340 <acquire> int r = ip->ref; 80101815: 8b 73 08 mov 0x8(%ebx),%esi release(&icache.lock); 80101818: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp) 8010181f: e8 dc 2b 00 00 call 80104400 <release> if(r == 1){ 80101824: 83 c4 10 add $0x10,%esp 80101827: 83 fe 01 cmp $0x1,%esi 8010182a: 75 aa jne 801017d6 <iput+0x26> 8010182c: 8d 8b 8c 00 00 00 lea 0x8c(%ebx),%ecx 80101832: 89 7d e4 mov %edi,-0x1c(%ebp) 80101835: 8d 73 5c lea 0x5c(%ebx),%esi 80101838: 89 cf mov %ecx,%edi 8010183a: eb 0b jmp 80101847 <iput+0x97> 8010183c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101840: 83 c6 04 add $0x4,%esi { int i, j; struct buf *bp; uint *a; for(i = 0; i < NDIRECT; i++){ 80101843: 39 fe cmp %edi,%esi 80101845: 74 19 je 80101860 <iput+0xb0> if(ip->addrs[i]){ 80101847: 8b 16 mov (%esi),%edx 80101849: 85 d2 test %edx,%edx 8010184b: 74 f3 je 80101840 <iput+0x90> bfree(ip->dev, ip->addrs[i]); 8010184d: 8b 03 mov (%ebx),%eax 8010184f: e8 bc f8 ff ff call 80101110 <bfree> ip->addrs[i] = 0; 80101854: c7 06 00 00 00 00 movl $0x0,(%esi) 8010185a: eb e4 jmp 80101840 <iput+0x90> 8010185c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi } } if(ip->addrs[NDIRECT]){ 80101860: 8b 83 8c 00 00 00 mov 0x8c(%ebx),%eax 80101866: 8b 7d e4 mov -0x1c(%ebp),%edi 80101869: 85 c0 test %eax,%eax 8010186b: 75 33 jne 801018a0 <iput+0xf0> bfree(ip->dev, ip->addrs[NDIRECT]); ip->addrs[NDIRECT] = 0; } ip->size = 0; iupdate(ip); 8010186d: 83 ec 0c sub $0xc,%esp ip->size = 0; 80101870: c7 43 58 00 00 00 00 movl $0x0,0x58(%ebx) iupdate(ip); 80101877: 53 push %ebx 80101878: e8 53 fd ff ff call 801015d0 <iupdate> ip->type = 0; 8010187d: 31 c0 xor %eax,%eax 8010187f: 66 89 43 50 mov %ax,0x50(%ebx) iupdate(ip); 80101883: 89 1c 24 mov %ebx,(%esp) 80101886: e8 45 fd ff ff call 801015d0 <iupdate> ip->valid = 0; 8010188b: c7 43 4c 00 00 00 00 movl $0x0,0x4c(%ebx) 80101892: 83 c4 10 add $0x10,%esp 80101895: e9 3c ff ff ff jmp 801017d6 <iput+0x26> 8010189a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi bp = bread(ip->dev, ip->addrs[NDIRECT]); 801018a0: 83 ec 08 sub $0x8,%esp 801018a3: 50 push %eax 801018a4: ff 33 pushl (%ebx) 801018a6: e8 25 e8 ff ff call 801000d0 <bread> 801018ab: 8d 88 5c 02 00 00 lea 0x25c(%eax),%ecx 801018b1: 89 7d e0 mov %edi,-0x20(%ebp) 801018b4: 89 45 e4 mov %eax,-0x1c(%ebp) a = (uint*)bp->data; 801018b7: 8d 70 5c lea 0x5c(%eax),%esi 801018ba: 83 c4 10 add $0x10,%esp 801018bd: 89 cf mov %ecx,%edi 801018bf: eb 0e jmp 801018cf <iput+0x11f> 801018c1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801018c8: 83 c6 04 add $0x4,%esi for(j = 0; j < NINDIRECT; j++){ 801018cb: 39 fe cmp %edi,%esi 801018cd: 74 0f je 801018de <iput+0x12e> if(a[j]) 801018cf: 8b 16 mov (%esi),%edx 801018d1: 85 d2 test %edx,%edx 801018d3: 74 f3 je 801018c8 <iput+0x118> bfree(ip->dev, a[j]); 801018d5: 8b 03 mov (%ebx),%eax 801018d7: e8 34 f8 ff ff call 80101110 <bfree> 801018dc: eb ea jmp 801018c8 <iput+0x118> brelse(bp); 801018de: 83 ec 0c sub $0xc,%esp 801018e1: ff 75 e4 pushl -0x1c(%ebp) 801018e4: 8b 7d e0 mov -0x20(%ebp),%edi 801018e7: e8 f4 e8 ff ff call 801001e0 <brelse> bfree(ip->dev, ip->addrs[NDIRECT]); 801018ec: 8b 93 8c 00 00 00 mov 0x8c(%ebx),%edx 801018f2: 8b 03 mov (%ebx),%eax 801018f4: e8 17 f8 ff ff call 80101110 <bfree> ip->addrs[NDIRECT] = 0; 801018f9: c7 83 8c 00 00 00 00 movl $0x0,0x8c(%ebx) 80101900: 00 00 00 80101903: 83 c4 10 add $0x10,%esp 80101906: e9 62 ff ff ff jmp 8010186d <iput+0xbd> 8010190b: 90 nop 8010190c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101910 <iunlockput>: { 80101910: 55 push %ebp 80101911: 89 e5 mov %esp,%ebp 80101913: 53 push %ebx 80101914: 83 ec 10 sub $0x10,%esp 80101917: 8b 5d 08 mov 0x8(%ebp),%ebx iunlock(ip); 8010191a: 53 push %ebx 8010191b: e8 40 fe ff ff call 80101760 <iunlock> iput(ip); 80101920: 89 5d 08 mov %ebx,0x8(%ebp) 80101923: 83 c4 10 add $0x10,%esp } 80101926: 8b 5d fc mov -0x4(%ebp),%ebx 80101929: c9 leave iput(ip); 8010192a: e9 81 fe ff ff jmp 801017b0 <iput> 8010192f: 90 nop 80101930 <stati>: // Copy stat information from inode. // Caller must hold ip->lock. void stati(struct inode *ip, struct stat *st) { 80101930: 55 push %ebp 80101931: 89 e5 mov %esp,%ebp 80101933: 8b 55 08 mov 0x8(%ebp),%edx 80101936: 8b 45 0c mov 0xc(%ebp),%eax st->dev = ip->dev; 80101939: 8b 0a mov (%edx),%ecx 8010193b: 89 48 04 mov %ecx,0x4(%eax) st->ino = ip->inum; 8010193e: 8b 4a 04 mov 0x4(%edx),%ecx 80101941: 89 48 08 mov %ecx,0x8(%eax) st->type = ip->type; 80101944: 0f b7 4a 50 movzwl 0x50(%edx),%ecx 80101948: 66 89 08 mov %cx,(%eax) st->nlink = ip->nlink; 8010194b: 0f b7 4a 56 movzwl 0x56(%edx),%ecx 8010194f: 66 89 48 0c mov %cx,0xc(%eax) st->size = ip->size; 80101953: 8b 52 58 mov 0x58(%edx),%edx 80101956: 89 50 10 mov %edx,0x10(%eax) } 80101959: 5d pop %ebp 8010195a: c3 ret 8010195b: 90 nop 8010195c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101960 <readi>: //PAGEBREAK! // Read data from inode. // Caller must hold ip->lock. int readi(struct inode *ip, char *dst, uint off, uint n) { 80101960: 55 push %ebp 80101961: 89 e5 mov %esp,%ebp 80101963: 57 push %edi 80101964: 56 push %esi 80101965: 53 push %ebx 80101966: 83 ec 1c sub $0x1c,%esp 80101969: 8b 45 08 mov 0x8(%ebp),%eax 8010196c: 8b 75 0c mov 0xc(%ebp),%esi 8010196f: 8b 7d 14 mov 0x14(%ebp),%edi uint tot, m; struct buf *bp; if(ip->type == T_DEV){ 80101972: 66 83 78 50 03 cmpw $0x3,0x50(%eax) { 80101977: 89 75 e0 mov %esi,-0x20(%ebp) 8010197a: 89 45 d8 mov %eax,-0x28(%ebp) 8010197d: 8b 75 10 mov 0x10(%ebp),%esi 80101980: 89 7d e4 mov %edi,-0x1c(%ebp) if(ip->type == T_DEV){ 80101983: 0f 84 a7 00 00 00 je 80101a30 <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) 80101989: 8b 45 d8 mov -0x28(%ebp),%eax 8010198c: 8b 40 58 mov 0x58(%eax),%eax 8010198f: 39 c6 cmp %eax,%esi 80101991: 0f 87 ba 00 00 00 ja 80101a51 <readi+0xf1> 80101997: 8b 7d e4 mov -0x1c(%ebp),%edi 8010199a: 89 f9 mov %edi,%ecx 8010199c: 01 f1 add %esi,%ecx 8010199e: 0f 82 ad 00 00 00 jb 80101a51 <readi+0xf1> return -1; if(off + n > ip->size) n = ip->size - off; 801019a4: 89 c2 mov %eax,%edx 801019a6: 29 f2 sub %esi,%edx 801019a8: 39 c8 cmp %ecx,%eax 801019aa: 0f 43 d7 cmovae %edi,%edx for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 801019ad: 31 ff xor %edi,%edi 801019af: 85 d2 test %edx,%edx n = ip->size - off; 801019b1: 89 55 e4 mov %edx,-0x1c(%ebp) for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 801019b4: 74 6c je 80101a22 <readi+0xc2> 801019b6: 8d 76 00 lea 0x0(%esi),%esi 801019b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi bp = bread(ip->dev, bmap(ip, off/BSIZE)); 801019c0: 8b 5d d8 mov -0x28(%ebp),%ebx 801019c3: 89 f2 mov %esi,%edx 801019c5: c1 ea 09 shr $0x9,%edx 801019c8: 89 d8 mov %ebx,%eax 801019ca: e8 91 f9 ff ff call 80101360 <bmap> 801019cf: 83 ec 08 sub $0x8,%esp 801019d2: 50 push %eax 801019d3: ff 33 pushl (%ebx) 801019d5: e8 f6 e6 ff ff call 801000d0 <bread> m = min(n - tot, BSIZE - off%BSIZE); 801019da: 8b 5d e4 mov -0x1c(%ebp),%ebx bp = bread(ip->dev, bmap(ip, off/BSIZE)); 801019dd: 89 c2 mov %eax,%edx m = min(n - tot, BSIZE - off%BSIZE); 801019df: 89 f0 mov %esi,%eax 801019e1: 25 ff 01 00 00 and $0x1ff,%eax 801019e6: b9 00 02 00 00 mov $0x200,%ecx 801019eb: 83 c4 0c add $0xc,%esp 801019ee: 29 c1 sub %eax,%ecx memmove(dst, bp->data + off%BSIZE, m); 801019f0: 8d 44 02 5c lea 0x5c(%edx,%eax,1),%eax 801019f4: 89 55 dc mov %edx,-0x24(%ebp) m = min(n - tot, BSIZE - off%BSIZE); 801019f7: 29 fb sub %edi,%ebx 801019f9: 39 d9 cmp %ebx,%ecx 801019fb: 0f 46 d9 cmovbe %ecx,%ebx memmove(dst, bp->data + off%BSIZE, m); 801019fe: 53 push %ebx 801019ff: 50 push %eax for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 80101a00: 01 df add %ebx,%edi memmove(dst, bp->data + off%BSIZE, m); 80101a02: ff 75 e0 pushl -0x20(%ebp) for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 80101a05: 01 de add %ebx,%esi memmove(dst, bp->data + off%BSIZE, m); 80101a07: e8 f4 2a 00 00 call 80104500 <memmove> brelse(bp); 80101a0c: 8b 55 dc mov -0x24(%ebp),%edx 80101a0f: 89 14 24 mov %edx,(%esp) 80101a12: e8 c9 e7 ff ff call 801001e0 <brelse> for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 80101a17: 01 5d e0 add %ebx,-0x20(%ebp) 80101a1a: 83 c4 10 add $0x10,%esp 80101a1d: 39 7d e4 cmp %edi,-0x1c(%ebp) 80101a20: 77 9e ja 801019c0 <readi+0x60> } return n; 80101a22: 8b 45 e4 mov -0x1c(%ebp),%eax } 80101a25: 8d 65 f4 lea -0xc(%ebp),%esp 80101a28: 5b pop %ebx 80101a29: 5e pop %esi 80101a2a: 5f pop %edi 80101a2b: 5d pop %ebp 80101a2c: c3 ret 80101a2d: 8d 76 00 lea 0x0(%esi),%esi if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read) 80101a30: 0f bf 40 52 movswl 0x52(%eax),%eax 80101a34: 66 83 f8 09 cmp $0x9,%ax 80101a38: 77 17 ja 80101a51 <readi+0xf1> 80101a3a: 8b 04 c5 60 09 11 80 mov -0x7feef6a0(,%eax,8),%eax 80101a41: 85 c0 test %eax,%eax 80101a43: 74 0c je 80101a51 <readi+0xf1> return devsw[ip->major].read(ip, dst, n); 80101a45: 89 7d 10 mov %edi,0x10(%ebp) } 80101a48: 8d 65 f4 lea -0xc(%ebp),%esp 80101a4b: 5b pop %ebx 80101a4c: 5e pop %esi 80101a4d: 5f pop %edi 80101a4e: 5d pop %ebp return devsw[ip->major].read(ip, dst, n); 80101a4f: ff e0 jmp *%eax return -1; 80101a51: b8 ff ff ff ff mov $0xffffffff,%eax 80101a56: eb cd jmp 80101a25 <readi+0xc5> 80101a58: 90 nop 80101a59: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80101a60 <writei>: // PAGEBREAK! // Write data to inode. // Caller must hold ip->lock. int writei(struct inode *ip, char *src, uint off, uint n) { 80101a60: 55 push %ebp 80101a61: 89 e5 mov %esp,%ebp 80101a63: 57 push %edi 80101a64: 56 push %esi 80101a65: 53 push %ebx 80101a66: 83 ec 1c sub $0x1c,%esp 80101a69: 8b 45 08 mov 0x8(%ebp),%eax 80101a6c: 8b 75 0c mov 0xc(%ebp),%esi 80101a6f: 8b 7d 14 mov 0x14(%ebp),%edi uint tot, m; struct buf *bp; if(ip->type == T_DEV){ 80101a72: 66 83 78 50 03 cmpw $0x3,0x50(%eax) { 80101a77: 89 75 dc mov %esi,-0x24(%ebp) 80101a7a: 89 45 d8 mov %eax,-0x28(%ebp) 80101a7d: 8b 75 10 mov 0x10(%ebp),%esi 80101a80: 89 7d e0 mov %edi,-0x20(%ebp) if(ip->type == T_DEV){ 80101a83: 0f 84 b7 00 00 00 je 80101b40 <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) 80101a89: 8b 45 d8 mov -0x28(%ebp),%eax 80101a8c: 39 70 58 cmp %esi,0x58(%eax) 80101a8f: 0f 82 eb 00 00 00 jb 80101b80 <writei+0x120> 80101a95: 8b 7d e0 mov -0x20(%ebp),%edi 80101a98: 31 d2 xor %edx,%edx 80101a9a: 89 f8 mov %edi,%eax 80101a9c: 01 f0 add %esi,%eax 80101a9e: 0f 92 c2 setb %dl return -1; if(off + n > MAXFILE*BSIZE) 80101aa1: 3d 00 18 01 00 cmp $0x11800,%eax 80101aa6: 0f 87 d4 00 00 00 ja 80101b80 <writei+0x120> 80101aac: 85 d2 test %edx,%edx 80101aae: 0f 85 cc 00 00 00 jne 80101b80 <writei+0x120> return -1; for(tot=0; tot<n; tot+=m, off+=m, src+=m){ 80101ab4: 85 ff test %edi,%edi 80101ab6: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp) 80101abd: 74 72 je 80101b31 <writei+0xd1> 80101abf: 90 nop bp = bread(ip->dev, bmap(ip, off/BSIZE)); 80101ac0: 8b 7d d8 mov -0x28(%ebp),%edi 80101ac3: 89 f2 mov %esi,%edx 80101ac5: c1 ea 09 shr $0x9,%edx 80101ac8: 89 f8 mov %edi,%eax 80101aca: e8 91 f8 ff ff call 80101360 <bmap> 80101acf: 83 ec 08 sub $0x8,%esp 80101ad2: 50 push %eax 80101ad3: ff 37 pushl (%edi) 80101ad5: e8 f6 e5 ff ff call 801000d0 <bread> m = min(n - tot, BSIZE - off%BSIZE); 80101ada: 8b 5d e0 mov -0x20(%ebp),%ebx 80101add: 2b 5d e4 sub -0x1c(%ebp),%ebx bp = bread(ip->dev, bmap(ip, off/BSIZE)); 80101ae0: 89 c7 mov %eax,%edi m = min(n - tot, BSIZE - off%BSIZE); 80101ae2: 89 f0 mov %esi,%eax 80101ae4: b9 00 02 00 00 mov $0x200,%ecx 80101ae9: 83 c4 0c add $0xc,%esp 80101aec: 25 ff 01 00 00 and $0x1ff,%eax 80101af1: 29 c1 sub %eax,%ecx memmove(bp->data + off%BSIZE, src, m); 80101af3: 8d 44 07 5c lea 0x5c(%edi,%eax,1),%eax m = min(n - tot, BSIZE - off%BSIZE); 80101af7: 39 d9 cmp %ebx,%ecx 80101af9: 0f 46 d9 cmovbe %ecx,%ebx memmove(bp->data + off%BSIZE, src, m); 80101afc: 53 push %ebx 80101afd: ff 75 dc pushl -0x24(%ebp) for(tot=0; tot<n; tot+=m, off+=m, src+=m){ 80101b00: 01 de add %ebx,%esi memmove(bp->data + off%BSIZE, src, m); 80101b02: 50 push %eax 80101b03: e8 f8 29 00 00 call 80104500 <memmove> log_write(bp); 80101b08: 89 3c 24 mov %edi,(%esp) 80101b0b: e8 60 12 00 00 call 80102d70 <log_write> brelse(bp); 80101b10: 89 3c 24 mov %edi,(%esp) 80101b13: e8 c8 e6 ff ff call 801001e0 <brelse> for(tot=0; tot<n; tot+=m, off+=m, src+=m){ 80101b18: 01 5d e4 add %ebx,-0x1c(%ebp) 80101b1b: 01 5d dc add %ebx,-0x24(%ebp) 80101b1e: 83 c4 10 add $0x10,%esp 80101b21: 8b 45 e4 mov -0x1c(%ebp),%eax 80101b24: 39 45 e0 cmp %eax,-0x20(%ebp) 80101b27: 77 97 ja 80101ac0 <writei+0x60> } if(n > 0 && off > ip->size){ 80101b29: 8b 45 d8 mov -0x28(%ebp),%eax 80101b2c: 3b 70 58 cmp 0x58(%eax),%esi 80101b2f: 77 37 ja 80101b68 <writei+0x108> ip->size = off; iupdate(ip); } return n; 80101b31: 8b 45 e0 mov -0x20(%ebp),%eax } 80101b34: 8d 65 f4 lea -0xc(%ebp),%esp 80101b37: 5b pop %ebx 80101b38: 5e pop %esi 80101b39: 5f pop %edi 80101b3a: 5d pop %ebp 80101b3b: c3 ret 80101b3c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write) 80101b40: 0f bf 40 52 movswl 0x52(%eax),%eax 80101b44: 66 83 f8 09 cmp $0x9,%ax 80101b48: 77 36 ja 80101b80 <writei+0x120> 80101b4a: 8b 04 c5 64 09 11 80 mov -0x7feef69c(,%eax,8),%eax 80101b51: 85 c0 test %eax,%eax 80101b53: 74 2b je 80101b80 <writei+0x120> return devsw[ip->major].write(ip, src, n); 80101b55: 89 7d 10 mov %edi,0x10(%ebp) } 80101b58: 8d 65 f4 lea -0xc(%ebp),%esp 80101b5b: 5b pop %ebx 80101b5c: 5e pop %esi 80101b5d: 5f pop %edi 80101b5e: 5d pop %ebp return devsw[ip->major].write(ip, src, n); 80101b5f: ff e0 jmp *%eax 80101b61: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi ip->size = off; 80101b68: 8b 45 d8 mov -0x28(%ebp),%eax iupdate(ip); 80101b6b: 83 ec 0c sub $0xc,%esp ip->size = off; 80101b6e: 89 70 58 mov %esi,0x58(%eax) iupdate(ip); 80101b71: 50 push %eax 80101b72: e8 59 fa ff ff call 801015d0 <iupdate> 80101b77: 83 c4 10 add $0x10,%esp 80101b7a: eb b5 jmp 80101b31 <writei+0xd1> 80101b7c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80101b80: b8 ff ff ff ff mov $0xffffffff,%eax 80101b85: eb ad jmp 80101b34 <writei+0xd4> 80101b87: 89 f6 mov %esi,%esi 80101b89: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101b90 <namecmp>: //PAGEBREAK! // Directories int namecmp(const char *s, const char *t) { 80101b90: 55 push %ebp 80101b91: 89 e5 mov %esp,%ebp 80101b93: 83 ec 0c sub $0xc,%esp return strncmp(s, t, DIRSIZ); 80101b96: 6a 0e push $0xe 80101b98: ff 75 0c pushl 0xc(%ebp) 80101b9b: ff 75 08 pushl 0x8(%ebp) 80101b9e: e8 cd 29 00 00 call 80104570 <strncmp> } 80101ba3: c9 leave 80101ba4: c3 ret 80101ba5: 8d 74 26 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 1c sub $0x1c,%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 85 00 00 00 jne 80101c4c <dirlookup+0x9c> 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: 74 3e je 80101c11 <dirlookup+0x61> 80101bd3: 90 nop 80101bd4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80101bd8: 6a 10 push $0x10 80101bda: 57 push %edi 80101bdb: 56 push %esi 80101bdc: 53 push %ebx 80101bdd: e8 7e fd ff ff call 80101960 <readi> 80101be2: 83 c4 10 add $0x10,%esp 80101be5: 83 f8 10 cmp $0x10,%eax 80101be8: 75 55 jne 80101c3f <dirlookup+0x8f> panic("dirlookup read"); if(de.inum == 0) 80101bea: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp) 80101bef: 74 18 je 80101c09 <dirlookup+0x59> return strncmp(s, t, DIRSIZ); 80101bf1: 8d 45 da lea -0x26(%ebp),%eax 80101bf4: 83 ec 04 sub $0x4,%esp 80101bf7: 6a 0e push $0xe 80101bf9: 50 push %eax 80101bfa: ff 75 0c pushl 0xc(%ebp) 80101bfd: e8 6e 29 00 00 call 80104570 <strncmp> continue; if(namecmp(name, de.name) == 0){ 80101c02: 83 c4 10 add $0x10,%esp 80101c05: 85 c0 test %eax,%eax 80101c07: 74 17 je 80101c20 <dirlookup+0x70> for(off = 0; off < dp->size; off += sizeof(de)){ 80101c09: 83 c7 10 add $0x10,%edi 80101c0c: 3b 7b 58 cmp 0x58(%ebx),%edi 80101c0f: 72 c7 jb 80101bd8 <dirlookup+0x28> return iget(dp->dev, inum); } } return 0; } 80101c11: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 80101c14: 31 c0 xor %eax,%eax } 80101c16: 5b pop %ebx 80101c17: 5e pop %esi 80101c18: 5f pop %edi 80101c19: 5d pop %ebp 80101c1a: c3 ret 80101c1b: 90 nop 80101c1c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(poff) 80101c20: 8b 45 10 mov 0x10(%ebp),%eax 80101c23: 85 c0 test %eax,%eax 80101c25: 74 05 je 80101c2c <dirlookup+0x7c> *poff = off; 80101c27: 8b 45 10 mov 0x10(%ebp),%eax 80101c2a: 89 38 mov %edi,(%eax) inum = de.inum; 80101c2c: 0f b7 55 d8 movzwl -0x28(%ebp),%edx return iget(dp->dev, inum); 80101c30: 8b 03 mov (%ebx),%eax 80101c32: e8 59 f6 ff ff call 80101290 <iget> } 80101c37: 8d 65 f4 lea -0xc(%ebp),%esp 80101c3a: 5b pop %ebx 80101c3b: 5e pop %esi 80101c3c: 5f pop %edi 80101c3d: 5d pop %ebp 80101c3e: c3 ret panic("dirlookup read"); 80101c3f: 83 ec 0c sub $0xc,%esp 80101c42: 68 19 70 10 80 push $0x80107019 80101c47: e8 44 e7 ff ff call 80100390 <panic> panic("dirlookup not DIR"); 80101c4c: 83 ec 0c sub $0xc,%esp 80101c4f: 68 07 70 10 80 push $0x80107007 80101c54: e8 37 e7 ff ff call 80100390 <panic> 80101c59: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80101c60 <namex>: // If parent != 0, return the inode for the parent and copy the final // path element into name, which must have room for DIRSIZ bytes. // Must be called inside a transaction since it calls iput(). static struct inode* namex(char *path, int nameiparent, char *name) { 80101c60: 55 push %ebp 80101c61: 89 e5 mov %esp,%ebp 80101c63: 57 push %edi 80101c64: 56 push %esi 80101c65: 53 push %ebx 80101c66: 89 cf mov %ecx,%edi 80101c68: 89 c3 mov %eax,%ebx 80101c6a: 83 ec 1c sub $0x1c,%esp struct inode *ip, *next; if(*path == '/') 80101c6d: 80 38 2f cmpb $0x2f,(%eax) { 80101c70: 89 55 e0 mov %edx,-0x20(%ebp) if(*path == '/') 80101c73: 0f 84 67 01 00 00 je 80101de0 <namex+0x180> ip = iget(ROOTDEV, ROOTINO); else ip = idup(myproc()->cwd); 80101c79: e8 62 1b 00 00 call 801037e0 <myproc> acquire(&icache.lock); 80101c7e: 83 ec 0c sub $0xc,%esp ip = idup(myproc()->cwd); 80101c81: 8b 70 68 mov 0x68(%eax),%esi acquire(&icache.lock); 80101c84: 68 e0 09 11 80 push $0x801109e0 80101c89: e8 b2 26 00 00 call 80104340 <acquire> ip->ref++; 80101c8e: 83 46 08 01 addl $0x1,0x8(%esi) release(&icache.lock); 80101c92: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp) 80101c99: e8 62 27 00 00 call 80104400 <release> 80101c9e: 83 c4 10 add $0x10,%esp 80101ca1: eb 08 jmp 80101cab <namex+0x4b> 80101ca3: 90 nop 80101ca4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi path++; 80101ca8: 83 c3 01 add $0x1,%ebx while(*path == '/') 80101cab: 0f b6 03 movzbl (%ebx),%eax 80101cae: 3c 2f cmp $0x2f,%al 80101cb0: 74 f6 je 80101ca8 <namex+0x48> if(*path == 0) 80101cb2: 84 c0 test %al,%al 80101cb4: 0f 84 ee 00 00 00 je 80101da8 <namex+0x148> while(*path != '/' && *path != 0) 80101cba: 0f b6 03 movzbl (%ebx),%eax 80101cbd: 3c 2f cmp $0x2f,%al 80101cbf: 0f 84 b3 00 00 00 je 80101d78 <namex+0x118> 80101cc5: 84 c0 test %al,%al 80101cc7: 89 da mov %ebx,%edx 80101cc9: 75 09 jne 80101cd4 <namex+0x74> 80101ccb: e9 a8 00 00 00 jmp 80101d78 <namex+0x118> 80101cd0: 84 c0 test %al,%al 80101cd2: 74 0a je 80101cde <namex+0x7e> path++; 80101cd4: 83 c2 01 add $0x1,%edx while(*path != '/' && *path != 0) 80101cd7: 0f b6 02 movzbl (%edx),%eax 80101cda: 3c 2f cmp $0x2f,%al 80101cdc: 75 f2 jne 80101cd0 <namex+0x70> 80101cde: 89 d1 mov %edx,%ecx 80101ce0: 29 d9 sub %ebx,%ecx if(len >= DIRSIZ) 80101ce2: 83 f9 0d cmp $0xd,%ecx 80101ce5: 0f 8e 91 00 00 00 jle 80101d7c <namex+0x11c> memmove(name, s, DIRSIZ); 80101ceb: 83 ec 04 sub $0x4,%esp 80101cee: 89 55 e4 mov %edx,-0x1c(%ebp) 80101cf1: 6a 0e push $0xe 80101cf3: 53 push %ebx 80101cf4: 57 push %edi 80101cf5: e8 06 28 00 00 call 80104500 <memmove> path++; 80101cfa: 8b 55 e4 mov -0x1c(%ebp),%edx memmove(name, s, DIRSIZ); 80101cfd: 83 c4 10 add $0x10,%esp path++; 80101d00: 89 d3 mov %edx,%ebx while(*path == '/') 80101d02: 80 3a 2f cmpb $0x2f,(%edx) 80101d05: 75 11 jne 80101d18 <namex+0xb8> 80101d07: 89 f6 mov %esi,%esi 80101d09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi path++; 80101d10: 83 c3 01 add $0x1,%ebx while(*path == '/') 80101d13: 80 3b 2f cmpb $0x2f,(%ebx) 80101d16: 74 f8 je 80101d10 <namex+0xb0> while((path = skipelem(path, name)) != 0){ ilock(ip); 80101d18: 83 ec 0c sub $0xc,%esp 80101d1b: 56 push %esi 80101d1c: e8 5f f9 ff ff call 80101680 <ilock> if(ip->type != T_DIR){ 80101d21: 83 c4 10 add $0x10,%esp 80101d24: 66 83 7e 50 01 cmpw $0x1,0x50(%esi) 80101d29: 0f 85 91 00 00 00 jne 80101dc0 <namex+0x160> iunlockput(ip); return 0; } if(nameiparent && *path == '\0'){ 80101d2f: 8b 55 e0 mov -0x20(%ebp),%edx 80101d32: 85 d2 test %edx,%edx 80101d34: 74 09 je 80101d3f <namex+0xdf> 80101d36: 80 3b 00 cmpb $0x0,(%ebx) 80101d39: 0f 84 b7 00 00 00 je 80101df6 <namex+0x196> // Stop one level early. iunlock(ip); return ip; } if((next = dirlookup(ip, name, 0)) == 0){ 80101d3f: 83 ec 04 sub $0x4,%esp 80101d42: 6a 00 push $0x0 80101d44: 57 push %edi 80101d45: 56 push %esi 80101d46: e8 65 fe ff ff call 80101bb0 <dirlookup> 80101d4b: 83 c4 10 add $0x10,%esp 80101d4e: 85 c0 test %eax,%eax 80101d50: 74 6e je 80101dc0 <namex+0x160> iunlock(ip); 80101d52: 83 ec 0c sub $0xc,%esp 80101d55: 89 45 e4 mov %eax,-0x1c(%ebp) 80101d58: 56 push %esi 80101d59: e8 02 fa ff ff call 80101760 <iunlock> iput(ip); 80101d5e: 89 34 24 mov %esi,(%esp) 80101d61: e8 4a fa ff ff call 801017b0 <iput> 80101d66: 8b 45 e4 mov -0x1c(%ebp),%eax 80101d69: 83 c4 10 add $0x10,%esp 80101d6c: 89 c6 mov %eax,%esi 80101d6e: e9 38 ff ff ff jmp 80101cab <namex+0x4b> 80101d73: 90 nop 80101d74: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi while(*path != '/' && *path != 0) 80101d78: 89 da mov %ebx,%edx 80101d7a: 31 c9 xor %ecx,%ecx memmove(name, s, len); 80101d7c: 83 ec 04 sub $0x4,%esp 80101d7f: 89 55 dc mov %edx,-0x24(%ebp) 80101d82: 89 4d e4 mov %ecx,-0x1c(%ebp) 80101d85: 51 push %ecx 80101d86: 53 push %ebx 80101d87: 57 push %edi 80101d88: e8 73 27 00 00 call 80104500 <memmove> name[len] = 0; 80101d8d: 8b 4d e4 mov -0x1c(%ebp),%ecx 80101d90: 8b 55 dc mov -0x24(%ebp),%edx 80101d93: 83 c4 10 add $0x10,%esp 80101d96: c6 04 0f 00 movb $0x0,(%edi,%ecx,1) 80101d9a: 89 d3 mov %edx,%ebx 80101d9c: e9 61 ff ff ff jmp 80101d02 <namex+0xa2> 80101da1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return 0; } iunlockput(ip); ip = next; } if(nameiparent){ 80101da8: 8b 45 e0 mov -0x20(%ebp),%eax 80101dab: 85 c0 test %eax,%eax 80101dad: 75 5d jne 80101e0c <namex+0x1ac> iput(ip); return 0; } return ip; } 80101daf: 8d 65 f4 lea -0xc(%ebp),%esp 80101db2: 89 f0 mov %esi,%eax 80101db4: 5b pop %ebx 80101db5: 5e pop %esi 80101db6: 5f pop %edi 80101db7: 5d pop %ebp 80101db8: c3 ret 80101db9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi iunlock(ip); 80101dc0: 83 ec 0c sub $0xc,%esp 80101dc3: 56 push %esi 80101dc4: e8 97 f9 ff ff call 80101760 <iunlock> iput(ip); 80101dc9: 89 34 24 mov %esi,(%esp) return 0; 80101dcc: 31 f6 xor %esi,%esi iput(ip); 80101dce: e8 dd f9 ff ff call 801017b0 <iput> return 0; 80101dd3: 83 c4 10 add $0x10,%esp } 80101dd6: 8d 65 f4 lea -0xc(%ebp),%esp 80101dd9: 89 f0 mov %esi,%eax 80101ddb: 5b pop %ebx 80101ddc: 5e pop %esi 80101ddd: 5f pop %edi 80101dde: 5d pop %ebp 80101ddf: c3 ret ip = iget(ROOTDEV, ROOTINO); 80101de0: ba 01 00 00 00 mov $0x1,%edx 80101de5: b8 01 00 00 00 mov $0x1,%eax 80101dea: e8 a1 f4 ff ff call 80101290 <iget> 80101def: 89 c6 mov %eax,%esi 80101df1: e9 b5 fe ff ff jmp 80101cab <namex+0x4b> iunlock(ip); 80101df6: 83 ec 0c sub $0xc,%esp 80101df9: 56 push %esi 80101dfa: e8 61 f9 ff ff call 80101760 <iunlock> return ip; 80101dff: 83 c4 10 add $0x10,%esp } 80101e02: 8d 65 f4 lea -0xc(%ebp),%esp 80101e05: 89 f0 mov %esi,%eax 80101e07: 5b pop %ebx 80101e08: 5e pop %esi 80101e09: 5f pop %edi 80101e0a: 5d pop %ebp 80101e0b: c3 ret iput(ip); 80101e0c: 83 ec 0c sub $0xc,%esp 80101e0f: 56 push %esi return 0; 80101e10: 31 f6 xor %esi,%esi iput(ip); 80101e12: e8 99 f9 ff ff call 801017b0 <iput> return 0; 80101e17: 83 c4 10 add $0x10,%esp 80101e1a: eb 93 jmp 80101daf <namex+0x14f> 80101e1c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101e20 <dirlink>: { 80101e20: 55 push %ebp 80101e21: 89 e5 mov %esp,%ebp 80101e23: 57 push %edi 80101e24: 56 push %esi 80101e25: 53 push %ebx 80101e26: 83 ec 20 sub $0x20,%esp 80101e29: 8b 5d 08 mov 0x8(%ebp),%ebx if((ip = dirlookup(dp, name, 0)) != 0){ 80101e2c: 6a 00 push $0x0 80101e2e: ff 75 0c pushl 0xc(%ebp) 80101e31: 53 push %ebx 80101e32: e8 79 fd ff ff call 80101bb0 <dirlookup> 80101e37: 83 c4 10 add $0x10,%esp 80101e3a: 85 c0 test %eax,%eax 80101e3c: 75 67 jne 80101ea5 <dirlink+0x85> for(off = 0; off < dp->size; off += sizeof(de)){ 80101e3e: 8b 7b 58 mov 0x58(%ebx),%edi 80101e41: 8d 75 d8 lea -0x28(%ebp),%esi 80101e44: 85 ff test %edi,%edi 80101e46: 74 29 je 80101e71 <dirlink+0x51> 80101e48: 31 ff xor %edi,%edi 80101e4a: 8d 75 d8 lea -0x28(%ebp),%esi 80101e4d: eb 09 jmp 80101e58 <dirlink+0x38> 80101e4f: 90 nop 80101e50: 83 c7 10 add $0x10,%edi 80101e53: 3b 7b 58 cmp 0x58(%ebx),%edi 80101e56: 73 19 jae 80101e71 <dirlink+0x51> if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80101e58: 6a 10 push $0x10 80101e5a: 57 push %edi 80101e5b: 56 push %esi 80101e5c: 53 push %ebx 80101e5d: e8 fe fa ff ff call 80101960 <readi> 80101e62: 83 c4 10 add $0x10,%esp 80101e65: 83 f8 10 cmp $0x10,%eax 80101e68: 75 4e jne 80101eb8 <dirlink+0x98> if(de.inum == 0) 80101e6a: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp) 80101e6f: 75 df jne 80101e50 <dirlink+0x30> strncpy(de.name, name, DIRSIZ); 80101e71: 8d 45 da lea -0x26(%ebp),%eax 80101e74: 83 ec 04 sub $0x4,%esp 80101e77: 6a 0e push $0xe 80101e79: ff 75 0c pushl 0xc(%ebp) 80101e7c: 50 push %eax 80101e7d: e8 4e 27 00 00 call 801045d0 <strncpy> de.inum = inum; 80101e82: 8b 45 10 mov 0x10(%ebp),%eax if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80101e85: 6a 10 push $0x10 80101e87: 57 push %edi 80101e88: 56 push %esi 80101e89: 53 push %ebx de.inum = inum; 80101e8a: 66 89 45 d8 mov %ax,-0x28(%ebp) if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80101e8e: e8 cd fb ff ff call 80101a60 <writei> 80101e93: 83 c4 20 add $0x20,%esp 80101e96: 83 f8 10 cmp $0x10,%eax 80101e99: 75 2a jne 80101ec5 <dirlink+0xa5> return 0; 80101e9b: 31 c0 xor %eax,%eax } 80101e9d: 8d 65 f4 lea -0xc(%ebp),%esp 80101ea0: 5b pop %ebx 80101ea1: 5e pop %esi 80101ea2: 5f pop %edi 80101ea3: 5d pop %ebp 80101ea4: c3 ret iput(ip); 80101ea5: 83 ec 0c sub $0xc,%esp 80101ea8: 50 push %eax 80101ea9: e8 02 f9 ff ff call 801017b0 <iput> return -1; 80101eae: 83 c4 10 add $0x10,%esp 80101eb1: b8 ff ff ff ff mov $0xffffffff,%eax 80101eb6: eb e5 jmp 80101e9d <dirlink+0x7d> panic("dirlink read"); 80101eb8: 83 ec 0c sub $0xc,%esp 80101ebb: 68 28 70 10 80 push $0x80107028 80101ec0: e8 cb e4 ff ff call 80100390 <panic> panic("dirlink"); 80101ec5: 83 ec 0c sub $0xc,%esp 80101ec8: 68 1e 76 10 80 push $0x8010761e 80101ecd: e8 be e4 ff ff call 80100390 <panic> 80101ed2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80101ed9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101ee0 <namei>: struct inode* namei(char *path) { 80101ee0: 55 push %ebp char name[DIRSIZ]; return namex(path, 0, name); 80101ee1: 31 d2 xor %edx,%edx { 80101ee3: 89 e5 mov %esp,%ebp 80101ee5: 83 ec 18 sub $0x18,%esp return namex(path, 0, name); 80101ee8: 8b 45 08 mov 0x8(%ebp),%eax 80101eeb: 8d 4d ea lea -0x16(%ebp),%ecx 80101eee: e8 6d fd ff ff call 80101c60 <namex> } 80101ef3: c9 leave 80101ef4: c3 ret 80101ef5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101ef9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101f00 <nameiparent>: struct inode* nameiparent(char *path, char *name) { 80101f00: 55 push %ebp return namex(path, 1, name); 80101f01: ba 01 00 00 00 mov $0x1,%edx { 80101f06: 89 e5 mov %esp,%ebp return namex(path, 1, name); 80101f08: 8b 4d 0c mov 0xc(%ebp),%ecx 80101f0b: 8b 45 08 mov 0x8(%ebp),%eax } 80101f0e: 5d pop %ebp return namex(path, 1, name); 80101f0f: e9 4c fd ff ff jmp 80101c60 <namex> 80101f14: 66 90 xchg %ax,%ax 80101f16: 66 90 xchg %ax,%ax 80101f18: 66 90 xchg %ax,%ax 80101f1a: 66 90 xchg %ax,%ax 80101f1c: 66 90 xchg %ax,%ax 80101f1e: 66 90 xchg %ax,%ax 80101f20 <idestart>: } // Start the request for b. Caller must hold idelock. static void idestart(struct buf *b) { 80101f20: 55 push %ebp 80101f21: 89 e5 mov %esp,%ebp 80101f23: 57 push %edi 80101f24: 56 push %esi 80101f25: 53 push %ebx 80101f26: 83 ec 0c sub $0xc,%esp if(b == 0) 80101f29: 85 c0 test %eax,%eax 80101f2b: 0f 84 b4 00 00 00 je 80101fe5 <idestart+0xc5> panic("idestart"); if(b->blockno >= FSSIZE) 80101f31: 8b 58 08 mov 0x8(%eax),%ebx 80101f34: 89 c6 mov %eax,%esi 80101f36: 81 fb e7 03 00 00 cmp $0x3e7,%ebx 80101f3c: 0f 87 96 00 00 00 ja 80101fd8 <idestart+0xb8> asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80101f42: b9 f7 01 00 00 mov $0x1f7,%ecx 80101f47: 89 f6 mov %esi,%esi 80101f49: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101f50: 89 ca mov %ecx,%edx 80101f52: ec in (%dx),%al while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY) 80101f53: 83 e0 c0 and $0xffffffc0,%eax 80101f56: 3c 40 cmp $0x40,%al 80101f58: 75 f6 jne 80101f50 <idestart+0x30> asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80101f5a: 31 ff xor %edi,%edi 80101f5c: ba f6 03 00 00 mov $0x3f6,%edx 80101f61: 89 f8 mov %edi,%eax 80101f63: ee out %al,(%dx) 80101f64: b8 01 00 00 00 mov $0x1,%eax 80101f69: ba f2 01 00 00 mov $0x1f2,%edx 80101f6e: ee out %al,(%dx) 80101f6f: ba f3 01 00 00 mov $0x1f3,%edx 80101f74: 89 d8 mov %ebx,%eax 80101f76: 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); 80101f77: 89 d8 mov %ebx,%eax 80101f79: ba f4 01 00 00 mov $0x1f4,%edx 80101f7e: c1 f8 08 sar $0x8,%eax 80101f81: ee out %al,(%dx) 80101f82: ba f5 01 00 00 mov $0x1f5,%edx 80101f87: 89 f8 mov %edi,%eax 80101f89: ee out %al,(%dx) outb(0x1f5, (sector >> 16) & 0xff); outb(0x1f6, 0xe0 | ((b->dev&1)<<4) | ((sector>>24)&0x0f)); 80101f8a: 0f b6 46 04 movzbl 0x4(%esi),%eax 80101f8e: ba f6 01 00 00 mov $0x1f6,%edx 80101f93: c1 e0 04 shl $0x4,%eax 80101f96: 83 e0 10 and $0x10,%eax 80101f99: 83 c8 e0 or $0xffffffe0,%eax 80101f9c: ee out %al,(%dx) if(b->flags & B_DIRTY){ 80101f9d: f6 06 04 testb $0x4,(%esi) 80101fa0: 75 16 jne 80101fb8 <idestart+0x98> 80101fa2: b8 20 00 00 00 mov $0x20,%eax 80101fa7: 89 ca mov %ecx,%edx 80101fa9: ee out %al,(%dx) outb(0x1f7, write_cmd); outsl(0x1f0, b->data, BSIZE/4); } else { outb(0x1f7, read_cmd); } } 80101faa: 8d 65 f4 lea -0xc(%ebp),%esp 80101fad: 5b pop %ebx 80101fae: 5e pop %esi 80101faf: 5f pop %edi 80101fb0: 5d pop %ebp 80101fb1: c3 ret 80101fb2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80101fb8: b8 30 00 00 00 mov $0x30,%eax 80101fbd: 89 ca mov %ecx,%edx 80101fbf: ee out %al,(%dx) asm volatile("cld; rep outsl" : 80101fc0: b9 80 00 00 00 mov $0x80,%ecx outsl(0x1f0, b->data, BSIZE/4); 80101fc5: 83 c6 5c add $0x5c,%esi 80101fc8: ba f0 01 00 00 mov $0x1f0,%edx 80101fcd: fc cld 80101fce: f3 6f rep outsl %ds:(%esi),(%dx) } 80101fd0: 8d 65 f4 lea -0xc(%ebp),%esp 80101fd3: 5b pop %ebx 80101fd4: 5e pop %esi 80101fd5: 5f pop %edi 80101fd6: 5d pop %ebp 80101fd7: c3 ret panic("incorrect blockno"); 80101fd8: 83 ec 0c sub $0xc,%esp 80101fdb: 68 94 70 10 80 push $0x80107094 80101fe0: e8 ab e3 ff ff call 80100390 <panic> panic("idestart"); 80101fe5: 83 ec 0c sub $0xc,%esp 80101fe8: 68 8b 70 10 80 push $0x8010708b 80101fed: e8 9e e3 ff ff call 80100390 <panic> 80101ff2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80101ff9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102000 <ideinit>: { 80102000: 55 push %ebp 80102001: 89 e5 mov %esp,%ebp 80102003: 83 ec 10 sub $0x10,%esp initlock(&idelock, "ide"); 80102006: 68 a6 70 10 80 push $0x801070a6 8010200b: 68 80 a5 10 80 push $0x8010a580 80102010: e8 eb 21 00 00 call 80104200 <initlock> ioapicenable(IRQ_IDE, ncpu - 1); 80102015: 58 pop %eax 80102016: a1 00 2d 11 80 mov 0x80112d00,%eax 8010201b: 5a pop %edx 8010201c: 83 e8 01 sub $0x1,%eax 8010201f: 50 push %eax 80102020: 6a 0e push $0xe 80102022: e8 a9 02 00 00 call 801022d0 <ioapicenable> 80102027: 83 c4 10 add $0x10,%esp asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010202a: ba f7 01 00 00 mov $0x1f7,%edx 8010202f: 90 nop 80102030: ec in (%dx),%al while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY) 80102031: 83 e0 c0 and $0xffffffc0,%eax 80102034: 3c 40 cmp $0x40,%al 80102036: 75 f8 jne 80102030 <ideinit+0x30> asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102038: b8 f0 ff ff ff mov $0xfffffff0,%eax 8010203d: ba f6 01 00 00 mov $0x1f6,%edx 80102042: ee out %al,(%dx) 80102043: b9 e8 03 00 00 mov $0x3e8,%ecx asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102048: ba f7 01 00 00 mov $0x1f7,%edx 8010204d: eb 06 jmp 80102055 <ideinit+0x55> 8010204f: 90 nop for(i=0; i<1000; i++){ 80102050: 83 e9 01 sub $0x1,%ecx 80102053: 74 0f je 80102064 <ideinit+0x64> 80102055: ec in (%dx),%al if(inb(0x1f7) != 0){ 80102056: 84 c0 test %al,%al 80102058: 74 f6 je 80102050 <ideinit+0x50> havedisk1 = 1; 8010205a: c7 05 60 a5 10 80 01 movl $0x1,0x8010a560 80102061: 00 00 00 asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102064: b8 e0 ff ff ff mov $0xffffffe0,%eax 80102069: ba f6 01 00 00 mov $0x1f6,%edx 8010206e: ee out %al,(%dx) } 8010206f: c9 leave 80102070: c3 ret 80102071: eb 0d jmp 80102080 <ideintr> 80102073: 90 nop 80102074: 90 nop 80102075: 90 nop 80102076: 90 nop 80102077: 90 nop 80102078: 90 nop 80102079: 90 nop 8010207a: 90 nop 8010207b: 90 nop 8010207c: 90 nop 8010207d: 90 nop 8010207e: 90 nop 8010207f: 90 nop 80102080 <ideintr>: // Interrupt handler. void ideintr(void) { 80102080: 55 push %ebp 80102081: 89 e5 mov %esp,%ebp 80102083: 57 push %edi 80102084: 56 push %esi 80102085: 53 push %ebx 80102086: 83 ec 18 sub $0x18,%esp struct buf *b; // First queued buffer is the active request. acquire(&idelock); 80102089: 68 80 a5 10 80 push $0x8010a580 8010208e: e8 ad 22 00 00 call 80104340 <acquire> if((b = idequeue) == 0){ 80102093: 8b 1d 64 a5 10 80 mov 0x8010a564,%ebx 80102099: 83 c4 10 add $0x10,%esp 8010209c: 85 db test %ebx,%ebx 8010209e: 74 67 je 80102107 <ideintr+0x87> release(&idelock); return; } idequeue = b->qnext; 801020a0: 8b 43 58 mov 0x58(%ebx),%eax 801020a3: a3 64 a5 10 80 mov %eax,0x8010a564 // Read data if needed. if(!(b->flags & B_DIRTY) && idewait(1) >= 0) 801020a8: 8b 3b mov (%ebx),%edi 801020aa: f7 c7 04 00 00 00 test $0x4,%edi 801020b0: 75 31 jne 801020e3 <ideintr+0x63> asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801020b2: ba f7 01 00 00 mov $0x1f7,%edx 801020b7: 89 f6 mov %esi,%esi 801020b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801020c0: ec in (%dx),%al while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY) 801020c1: 89 c6 mov %eax,%esi 801020c3: 83 e6 c0 and $0xffffffc0,%esi 801020c6: 89 f1 mov %esi,%ecx 801020c8: 80 f9 40 cmp $0x40,%cl 801020cb: 75 f3 jne 801020c0 <ideintr+0x40> if(checkerr && (r & (IDE_DF|IDE_ERR)) != 0) 801020cd: a8 21 test $0x21,%al 801020cf: 75 12 jne 801020e3 <ideintr+0x63> insl(0x1f0, b->data, BSIZE/4); 801020d1: 8d 7b 5c lea 0x5c(%ebx),%edi asm volatile("cld; rep insl" : 801020d4: b9 80 00 00 00 mov $0x80,%ecx 801020d9: ba f0 01 00 00 mov $0x1f0,%edx 801020de: fc cld 801020df: f3 6d rep insl (%dx),%es:(%edi) 801020e1: 8b 3b mov (%ebx),%edi // Wake process waiting for this buf. b->flags |= B_VALID; b->flags &= ~B_DIRTY; 801020e3: 83 e7 fb and $0xfffffffb,%edi wakeup(b); 801020e6: 83 ec 0c sub $0xc,%esp b->flags &= ~B_DIRTY; 801020e9: 89 f9 mov %edi,%ecx 801020eb: 83 c9 02 or $0x2,%ecx 801020ee: 89 0b mov %ecx,(%ebx) wakeup(b); 801020f0: 53 push %ebx 801020f1: e8 3a 1e 00 00 call 80103f30 <wakeup> // Start disk on next buf in queue. if(idequeue != 0) 801020f6: a1 64 a5 10 80 mov 0x8010a564,%eax 801020fb: 83 c4 10 add $0x10,%esp 801020fe: 85 c0 test %eax,%eax 80102100: 74 05 je 80102107 <ideintr+0x87> idestart(idequeue); 80102102: e8 19 fe ff ff call 80101f20 <idestart> release(&idelock); 80102107: 83 ec 0c sub $0xc,%esp 8010210a: 68 80 a5 10 80 push $0x8010a580 8010210f: e8 ec 22 00 00 call 80104400 <release> release(&idelock); } 80102114: 8d 65 f4 lea -0xc(%ebp),%esp 80102117: 5b pop %ebx 80102118: 5e pop %esi 80102119: 5f pop %edi 8010211a: 5d pop %ebp 8010211b: c3 ret 8010211c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102120 <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) { 80102120: 55 push %ebp 80102121: 89 e5 mov %esp,%ebp 80102123: 53 push %ebx 80102124: 83 ec 10 sub $0x10,%esp 80102127: 8b 5d 08 mov 0x8(%ebp),%ebx struct buf **pp; if(!holdingsleep(&b->lock)) 8010212a: 8d 43 0c lea 0xc(%ebx),%eax 8010212d: 50 push %eax 8010212e: e8 7d 20 00 00 call 801041b0 <holdingsleep> 80102133: 83 c4 10 add $0x10,%esp 80102136: 85 c0 test %eax,%eax 80102138: 0f 84 c6 00 00 00 je 80102204 <iderw+0xe4> panic("iderw: buf not locked"); if((b->flags & (B_VALID|B_DIRTY)) == B_VALID) 8010213e: 8b 03 mov (%ebx),%eax 80102140: 83 e0 06 and $0x6,%eax 80102143: 83 f8 02 cmp $0x2,%eax 80102146: 0f 84 ab 00 00 00 je 801021f7 <iderw+0xd7> panic("iderw: nothing to do"); if(b->dev != 0 && !havedisk1) 8010214c: 8b 53 04 mov 0x4(%ebx),%edx 8010214f: 85 d2 test %edx,%edx 80102151: 74 0d je 80102160 <iderw+0x40> 80102153: a1 60 a5 10 80 mov 0x8010a560,%eax 80102158: 85 c0 test %eax,%eax 8010215a: 0f 84 b1 00 00 00 je 80102211 <iderw+0xf1> panic("iderw: ide disk 1 not present"); acquire(&idelock); //DOC:acquire-lock 80102160: 83 ec 0c sub $0xc,%esp 80102163: 68 80 a5 10 80 push $0x8010a580 80102168: e8 d3 21 00 00 call 80104340 <acquire> // Append b to idequeue. b->qnext = 0; for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue 8010216d: 8b 15 64 a5 10 80 mov 0x8010a564,%edx 80102173: 83 c4 10 add $0x10,%esp b->qnext = 0; 80102176: c7 43 58 00 00 00 00 movl $0x0,0x58(%ebx) for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue 8010217d: 85 d2 test %edx,%edx 8010217f: 75 09 jne 8010218a <iderw+0x6a> 80102181: eb 6d jmp 801021f0 <iderw+0xd0> 80102183: 90 nop 80102184: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102188: 89 c2 mov %eax,%edx 8010218a: 8b 42 58 mov 0x58(%edx),%eax 8010218d: 85 c0 test %eax,%eax 8010218f: 75 f7 jne 80102188 <iderw+0x68> 80102191: 83 c2 58 add $0x58,%edx ; *pp = b; 80102194: 89 1a mov %ebx,(%edx) // Start disk if necessary. if(idequeue == b) 80102196: 39 1d 64 a5 10 80 cmp %ebx,0x8010a564 8010219c: 74 42 je 801021e0 <iderw+0xc0> idestart(b); // Wait for request to finish. while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){ 8010219e: 8b 03 mov (%ebx),%eax 801021a0: 83 e0 06 and $0x6,%eax 801021a3: 83 f8 02 cmp $0x2,%eax 801021a6: 74 23 je 801021cb <iderw+0xab> 801021a8: 90 nop 801021a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi sleep(b, &idelock); 801021b0: 83 ec 08 sub $0x8,%esp 801021b3: 68 80 a5 10 80 push $0x8010a580 801021b8: 53 push %ebx 801021b9: e8 c2 1b 00 00 call 80103d80 <sleep> while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){ 801021be: 8b 03 mov (%ebx),%eax 801021c0: 83 c4 10 add $0x10,%esp 801021c3: 83 e0 06 and $0x6,%eax 801021c6: 83 f8 02 cmp $0x2,%eax 801021c9: 75 e5 jne 801021b0 <iderw+0x90> } release(&idelock); 801021cb: c7 45 08 80 a5 10 80 movl $0x8010a580,0x8(%ebp) } 801021d2: 8b 5d fc mov -0x4(%ebp),%ebx 801021d5: c9 leave release(&idelock); 801021d6: e9 25 22 00 00 jmp 80104400 <release> 801021db: 90 nop 801021dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi idestart(b); 801021e0: 89 d8 mov %ebx,%eax 801021e2: e8 39 fd ff ff call 80101f20 <idestart> 801021e7: eb b5 jmp 8010219e <iderw+0x7e> 801021e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue 801021f0: ba 64 a5 10 80 mov $0x8010a564,%edx 801021f5: eb 9d jmp 80102194 <iderw+0x74> panic("iderw: nothing to do"); 801021f7: 83 ec 0c sub $0xc,%esp 801021fa: 68 c0 70 10 80 push $0x801070c0 801021ff: e8 8c e1 ff ff call 80100390 <panic> panic("iderw: buf not locked"); 80102204: 83 ec 0c sub $0xc,%esp 80102207: 68 aa 70 10 80 push $0x801070aa 8010220c: e8 7f e1 ff ff call 80100390 <panic> panic("iderw: ide disk 1 not present"); 80102211: 83 ec 0c sub $0xc,%esp 80102214: 68 d5 70 10 80 push $0x801070d5 80102219: e8 72 e1 ff ff call 80100390 <panic> 8010221e: 66 90 xchg %ax,%ax 80102220 <ioapicinit>: ioapic->data = data; } void ioapicinit(void) { 80102220: 55 push %ebp int i, id, maxintr; ioapic = (volatile struct ioapic*)IOAPIC; 80102221: c7 05 34 26 11 80 00 movl $0xfec00000,0x80112634 80102228: 00 c0 fe { 8010222b: 89 e5 mov %esp,%ebp 8010222d: 56 push %esi 8010222e: 53 push %ebx ioapic->reg = reg; 8010222f: c7 05 00 00 c0 fe 01 movl $0x1,0xfec00000 80102236: 00 00 00 return ioapic->data; 80102239: a1 34 26 11 80 mov 0x80112634,%eax 8010223e: 8b 58 10 mov 0x10(%eax),%ebx ioapic->reg = reg; 80102241: c7 00 00 00 00 00 movl $0x0,(%eax) return ioapic->data; 80102247: 8b 0d 34 26 11 80 mov 0x80112634,%ecx maxintr = (ioapicread(REG_VER) >> 16) & 0xFF; id = ioapicread(REG_ID) >> 24; if(id != ioapicid) 8010224d: 0f b6 15 60 27 11 80 movzbl 0x80112760,%edx maxintr = (ioapicread(REG_VER) >> 16) & 0xFF; 80102254: c1 eb 10 shr $0x10,%ebx return ioapic->data; 80102257: 8b 41 10 mov 0x10(%ecx),%eax maxintr = (ioapicread(REG_VER) >> 16) & 0xFF; 8010225a: 0f b6 db movzbl %bl,%ebx id = ioapicread(REG_ID) >> 24; 8010225d: c1 e8 18 shr $0x18,%eax if(id != ioapicid) 80102260: 39 c2 cmp %eax,%edx 80102262: 74 16 je 8010227a <ioapicinit+0x5a> cprintf("ioapicinit: id isn't equal to ioapicid; not a MP\n"); 80102264: 83 ec 0c sub $0xc,%esp 80102267: 68 f4 70 10 80 push $0x801070f4 8010226c: e8 ef e3 ff ff call 80100660 <cprintf> 80102271: 8b 0d 34 26 11 80 mov 0x80112634,%ecx 80102277: 83 c4 10 add $0x10,%esp 8010227a: 83 c3 21 add $0x21,%ebx { 8010227d: ba 10 00 00 00 mov $0x10,%edx 80102282: b8 20 00 00 00 mov $0x20,%eax 80102287: 89 f6 mov %esi,%esi 80102289: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi ioapic->reg = reg; 80102290: 89 11 mov %edx,(%ecx) ioapic->data = data; 80102292: 8b 0d 34 26 11 80 mov 0x80112634,%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)); 80102298: 89 c6 mov %eax,%esi 8010229a: 81 ce 00 00 01 00 or $0x10000,%esi 801022a0: 83 c0 01 add $0x1,%eax ioapic->data = data; 801022a3: 89 71 10 mov %esi,0x10(%ecx) 801022a6: 8d 72 01 lea 0x1(%edx),%esi 801022a9: 83 c2 02 add $0x2,%edx for(i = 0; i <= maxintr; i++){ 801022ac: 39 d8 cmp %ebx,%eax ioapic->reg = reg; 801022ae: 89 31 mov %esi,(%ecx) ioapic->data = data; 801022b0: 8b 0d 34 26 11 80 mov 0x80112634,%ecx 801022b6: c7 41 10 00 00 00 00 movl $0x0,0x10(%ecx) for(i = 0; i <= maxintr; i++){ 801022bd: 75 d1 jne 80102290 <ioapicinit+0x70> ioapicwrite(REG_TABLE+2*i+1, 0); } } 801022bf: 8d 65 f8 lea -0x8(%ebp),%esp 801022c2: 5b pop %ebx 801022c3: 5e pop %esi 801022c4: 5d pop %ebp 801022c5: c3 ret 801022c6: 8d 76 00 lea 0x0(%esi),%esi 801022c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801022d0 <ioapicenable>: void ioapicenable(int irq, int cpunum) { 801022d0: 55 push %ebp ioapic->reg = reg; 801022d1: 8b 0d 34 26 11 80 mov 0x80112634,%ecx { 801022d7: 89 e5 mov %esp,%ebp 801022d9: 8b 45 08 mov 0x8(%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); 801022dc: 8d 50 20 lea 0x20(%eax),%edx 801022df: 8d 44 00 10 lea 0x10(%eax,%eax,1),%eax ioapic->reg = reg; 801022e3: 89 01 mov %eax,(%ecx) ioapic->data = data; 801022e5: 8b 0d 34 26 11 80 mov 0x80112634,%ecx ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24); 801022eb: 83 c0 01 add $0x1,%eax ioapic->data = data; 801022ee: 89 51 10 mov %edx,0x10(%ecx) ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24); 801022f1: 8b 55 0c mov 0xc(%ebp),%edx ioapic->reg = reg; 801022f4: 89 01 mov %eax,(%ecx) ioapic->data = data; 801022f6: a1 34 26 11 80 mov 0x80112634,%eax ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24); 801022fb: c1 e2 18 shl $0x18,%edx ioapic->data = data; 801022fe: 89 50 10 mov %edx,0x10(%eax) } 80102301: 5d pop %ebp 80102302: c3 ret 80102303: 66 90 xchg %ax,%ax 80102305: 66 90 xchg %ax,%ax 80102307: 66 90 xchg %ax,%ax 80102309: 66 90 xchg %ax,%ax 8010230b: 66 90 xchg %ax,%ax 8010230d: 66 90 xchg %ax,%ax 8010230f: 90 nop 80102310 <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) { 80102310: 55 push %ebp 80102311: 89 e5 mov %esp,%ebp 80102313: 53 push %ebx 80102314: 83 ec 04 sub $0x4,%esp 80102317: 8b 5d 08 mov 0x8(%ebp),%ebx struct run *r; if((uint)v % PGSIZE || v < end || V2P(v) >= PHYSTOP) 8010231a: f7 c3 ff 0f 00 00 test $0xfff,%ebx 80102320: 75 70 jne 80102392 <kfree+0x82> 80102322: 81 fb a8 54 11 80 cmp $0x801154a8,%ebx 80102328: 72 68 jb 80102392 <kfree+0x82> 8010232a: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax 80102330: 3d ff ff ff 0d cmp $0xdffffff,%eax 80102335: 77 5b ja 80102392 <kfree+0x82> panic("kfree"); // Fill with junk to catch dangling refs. memset(v, 1, PGSIZE); 80102337: 83 ec 04 sub $0x4,%esp 8010233a: 68 00 10 00 00 push $0x1000 8010233f: 6a 01 push $0x1 80102341: 53 push %ebx 80102342: e8 09 21 00 00 call 80104450 <memset> if(kmem.use_lock) 80102347: 8b 15 74 26 11 80 mov 0x80112674,%edx 8010234d: 83 c4 10 add $0x10,%esp 80102350: 85 d2 test %edx,%edx 80102352: 75 2c jne 80102380 <kfree+0x70> acquire(&kmem.lock); r = (struct run*)v; r->next = kmem.freelist; 80102354: a1 78 26 11 80 mov 0x80112678,%eax 80102359: 89 03 mov %eax,(%ebx) kmem.freelist = r; if(kmem.use_lock) 8010235b: a1 74 26 11 80 mov 0x80112674,%eax kmem.freelist = r; 80102360: 89 1d 78 26 11 80 mov %ebx,0x80112678 if(kmem.use_lock) 80102366: 85 c0 test %eax,%eax 80102368: 75 06 jne 80102370 <kfree+0x60> release(&kmem.lock); } 8010236a: 8b 5d fc mov -0x4(%ebp),%ebx 8010236d: c9 leave 8010236e: c3 ret 8010236f: 90 nop release(&kmem.lock); 80102370: c7 45 08 40 26 11 80 movl $0x80112640,0x8(%ebp) } 80102377: 8b 5d fc mov -0x4(%ebp),%ebx 8010237a: c9 leave release(&kmem.lock); 8010237b: e9 80 20 00 00 jmp 80104400 <release> acquire(&kmem.lock); 80102380: 83 ec 0c sub $0xc,%esp 80102383: 68 40 26 11 80 push $0x80112640 80102388: e8 b3 1f 00 00 call 80104340 <acquire> 8010238d: 83 c4 10 add $0x10,%esp 80102390: eb c2 jmp 80102354 <kfree+0x44> panic("kfree"); 80102392: 83 ec 0c sub $0xc,%esp 80102395: 68 26 71 10 80 push $0x80107126 8010239a: e8 f1 df ff ff call 80100390 <panic> 8010239f: 90 nop 801023a0 <freerange>: { 801023a0: 55 push %ebp 801023a1: 89 e5 mov %esp,%ebp 801023a3: 56 push %esi 801023a4: 53 push %ebx p = (char*)PGROUNDUP((uint)vstart); 801023a5: 8b 45 08 mov 0x8(%ebp),%eax { 801023a8: 8b 75 0c mov 0xc(%ebp),%esi p = (char*)PGROUNDUP((uint)vstart); 801023ab: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 801023b1: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 801023b7: 81 c3 00 10 00 00 add $0x1000,%ebx 801023bd: 39 de cmp %ebx,%esi 801023bf: 72 23 jb 801023e4 <freerange+0x44> 801023c1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi kfree(p); 801023c8: 8d 83 00 f0 ff ff lea -0x1000(%ebx),%eax 801023ce: 83 ec 0c sub $0xc,%esp for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 801023d1: 81 c3 00 10 00 00 add $0x1000,%ebx kfree(p); 801023d7: 50 push %eax 801023d8: e8 33 ff ff ff call 80102310 <kfree> for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 801023dd: 83 c4 10 add $0x10,%esp 801023e0: 39 f3 cmp %esi,%ebx 801023e2: 76 e4 jbe 801023c8 <freerange+0x28> } 801023e4: 8d 65 f8 lea -0x8(%ebp),%esp 801023e7: 5b pop %ebx 801023e8: 5e pop %esi 801023e9: 5d pop %ebp 801023ea: c3 ret 801023eb: 90 nop 801023ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801023f0 <kinit1>: { 801023f0: 55 push %ebp 801023f1: 89 e5 mov %esp,%ebp 801023f3: 56 push %esi 801023f4: 53 push %ebx 801023f5: 8b 75 0c mov 0xc(%ebp),%esi initlock(&kmem.lock, "kmem"); 801023f8: 83 ec 08 sub $0x8,%esp 801023fb: 68 2c 71 10 80 push $0x8010712c 80102400: 68 40 26 11 80 push $0x80112640 80102405: e8 f6 1d 00 00 call 80104200 <initlock> p = (char*)PGROUNDUP((uint)vstart); 8010240a: 8b 45 08 mov 0x8(%ebp),%eax for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 8010240d: 83 c4 10 add $0x10,%esp kmem.use_lock = 0; 80102410: c7 05 74 26 11 80 00 movl $0x0,0x80112674 80102417: 00 00 00 p = (char*)PGROUNDUP((uint)vstart); 8010241a: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 80102420: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102426: 81 c3 00 10 00 00 add $0x1000,%ebx 8010242c: 39 de cmp %ebx,%esi 8010242e: 72 1c jb 8010244c <kinit1+0x5c> kfree(p); 80102430: 8d 83 00 f0 ff ff lea -0x1000(%ebx),%eax 80102436: 83 ec 0c sub $0xc,%esp for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102439: 81 c3 00 10 00 00 add $0x1000,%ebx kfree(p); 8010243f: 50 push %eax 80102440: e8 cb fe ff ff call 80102310 <kfree> for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102445: 83 c4 10 add $0x10,%esp 80102448: 39 de cmp %ebx,%esi 8010244a: 73 e4 jae 80102430 <kinit1+0x40> } 8010244c: 8d 65 f8 lea -0x8(%ebp),%esp 8010244f: 5b pop %ebx 80102450: 5e pop %esi 80102451: 5d pop %ebp 80102452: c3 ret 80102453: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80102459: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102460 <kinit2>: { 80102460: 55 push %ebp 80102461: 89 e5 mov %esp,%ebp 80102463: 56 push %esi 80102464: 53 push %ebx p = (char*)PGROUNDUP((uint)vstart); 80102465: 8b 45 08 mov 0x8(%ebp),%eax { 80102468: 8b 75 0c mov 0xc(%ebp),%esi p = (char*)PGROUNDUP((uint)vstart); 8010246b: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 80102471: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102477: 81 c3 00 10 00 00 add $0x1000,%ebx 8010247d: 39 de cmp %ebx,%esi 8010247f: 72 23 jb 801024a4 <kinit2+0x44> 80102481: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi kfree(p); 80102488: 8d 83 00 f0 ff ff lea -0x1000(%ebx),%eax 8010248e: 83 ec 0c sub $0xc,%esp for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102491: 81 c3 00 10 00 00 add $0x1000,%ebx kfree(p); 80102497: 50 push %eax 80102498: e8 73 fe ff ff call 80102310 <kfree> for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 8010249d: 83 c4 10 add $0x10,%esp 801024a0: 39 de cmp %ebx,%esi 801024a2: 73 e4 jae 80102488 <kinit2+0x28> kmem.use_lock = 1; 801024a4: c7 05 74 26 11 80 01 movl $0x1,0x80112674 801024ab: 00 00 00 } 801024ae: 8d 65 f8 lea -0x8(%ebp),%esp 801024b1: 5b pop %ebx 801024b2: 5e pop %esi 801024b3: 5d pop %ebp 801024b4: c3 ret 801024b5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801024b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801024c0 <kalloc>: char* kalloc(void) { struct run *r; if(kmem.use_lock) 801024c0: a1 74 26 11 80 mov 0x80112674,%eax 801024c5: 85 c0 test %eax,%eax 801024c7: 75 1f jne 801024e8 <kalloc+0x28> acquire(&kmem.lock); r = kmem.freelist; 801024c9: a1 78 26 11 80 mov 0x80112678,%eax if(r) 801024ce: 85 c0 test %eax,%eax 801024d0: 74 0e je 801024e0 <kalloc+0x20> kmem.freelist = r->next; 801024d2: 8b 10 mov (%eax),%edx 801024d4: 89 15 78 26 11 80 mov %edx,0x80112678 801024da: c3 ret 801024db: 90 nop 801024dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(kmem.use_lock) release(&kmem.lock); return (char*)r; } 801024e0: f3 c3 repz ret 801024e2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi { 801024e8: 55 push %ebp 801024e9: 89 e5 mov %esp,%ebp 801024eb: 83 ec 24 sub $0x24,%esp acquire(&kmem.lock); 801024ee: 68 40 26 11 80 push $0x80112640 801024f3: e8 48 1e 00 00 call 80104340 <acquire> r = kmem.freelist; 801024f8: a1 78 26 11 80 mov 0x80112678,%eax if(r) 801024fd: 83 c4 10 add $0x10,%esp 80102500: 8b 15 74 26 11 80 mov 0x80112674,%edx 80102506: 85 c0 test %eax,%eax 80102508: 74 08 je 80102512 <kalloc+0x52> kmem.freelist = r->next; 8010250a: 8b 08 mov (%eax),%ecx 8010250c: 89 0d 78 26 11 80 mov %ecx,0x80112678 if(kmem.use_lock) 80102512: 85 d2 test %edx,%edx 80102514: 74 16 je 8010252c <kalloc+0x6c> release(&kmem.lock); 80102516: 83 ec 0c sub $0xc,%esp 80102519: 89 45 f4 mov %eax,-0xc(%ebp) 8010251c: 68 40 26 11 80 push $0x80112640 80102521: e8 da 1e 00 00 call 80104400 <release> return (char*)r; 80102526: 8b 45 f4 mov -0xc(%ebp),%eax release(&kmem.lock); 80102529: 83 c4 10 add $0x10,%esp } 8010252c: c9 leave 8010252d: c3 ret 8010252e: 66 90 xchg %ax,%ax 80102530 <kbdgetc>: asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102530: ba 64 00 00 00 mov $0x64,%edx 80102535: ec in (%dx),%al normalmap, shiftmap, ctlmap, ctlmap }; uint st, data, c; st = inb(KBSTATP); if((st & KBS_DIB) == 0) 80102536: a8 01 test $0x1,%al 80102538: 0f 84 c2 00 00 00 je 80102600 <kbdgetc+0xd0> 8010253e: ba 60 00 00 00 mov $0x60,%edx 80102543: ec in (%dx),%al return -1; data = inb(KBDATAP); 80102544: 0f b6 d0 movzbl %al,%edx 80102547: 8b 0d b4 a5 10 80 mov 0x8010a5b4,%ecx if(data == 0xE0){ 8010254d: 81 fa e0 00 00 00 cmp $0xe0,%edx 80102553: 0f 84 7f 00 00 00 je 801025d8 <kbdgetc+0xa8> { 80102559: 55 push %ebp 8010255a: 89 e5 mov %esp,%ebp 8010255c: 53 push %ebx 8010255d: 89 cb mov %ecx,%ebx 8010255f: 83 e3 40 and $0x40,%ebx shift |= E0ESC; return 0; } else if(data & 0x80){ 80102562: 84 c0 test %al,%al 80102564: 78 4a js 801025b0 <kbdgetc+0x80> // Key released data = (shift & E0ESC ? data : data & 0x7F); shift &= ~(shiftcode[data] | E0ESC); return 0; } else if(shift & E0ESC){ 80102566: 85 db test %ebx,%ebx 80102568: 74 09 je 80102573 <kbdgetc+0x43> // Last character was an E0 escape; or with 0x80 data |= 0x80; 8010256a: 83 c8 80 or $0xffffff80,%eax shift &= ~E0ESC; 8010256d: 83 e1 bf and $0xffffffbf,%ecx data |= 0x80; 80102570: 0f b6 d0 movzbl %al,%edx } shift |= shiftcode[data]; 80102573: 0f b6 82 60 72 10 80 movzbl -0x7fef8da0(%edx),%eax 8010257a: 09 c1 or %eax,%ecx shift ^= togglecode[data]; 8010257c: 0f b6 82 60 71 10 80 movzbl -0x7fef8ea0(%edx),%eax 80102583: 31 c1 xor %eax,%ecx c = charcode[shift & (CTL | SHIFT)][data]; 80102585: 89 c8 mov %ecx,%eax shift ^= togglecode[data]; 80102587: 89 0d b4 a5 10 80 mov %ecx,0x8010a5b4 c = charcode[shift & (CTL | SHIFT)][data]; 8010258d: 83 e0 03 and $0x3,%eax if(shift & CAPSLOCK){ 80102590: 83 e1 08 and $0x8,%ecx c = charcode[shift & (CTL | SHIFT)][data]; 80102593: 8b 04 85 40 71 10 80 mov -0x7fef8ec0(,%eax,4),%eax 8010259a: 0f b6 04 10 movzbl (%eax,%edx,1),%eax if(shift & CAPSLOCK){ 8010259e: 74 31 je 801025d1 <kbdgetc+0xa1> if('a' <= c && c <= 'z') 801025a0: 8d 50 9f lea -0x61(%eax),%edx 801025a3: 83 fa 19 cmp $0x19,%edx 801025a6: 77 40 ja 801025e8 <kbdgetc+0xb8> c += 'A' - 'a'; 801025a8: 83 e8 20 sub $0x20,%eax else if('A' <= c && c <= 'Z') c += 'a' - 'A'; } return c; } 801025ab: 5b pop %ebx 801025ac: 5d pop %ebp 801025ad: c3 ret 801025ae: 66 90 xchg %ax,%ax data = (shift & E0ESC ? data : data & 0x7F); 801025b0: 83 e0 7f and $0x7f,%eax 801025b3: 85 db test %ebx,%ebx 801025b5: 0f 44 d0 cmove %eax,%edx shift &= ~(shiftcode[data] | E0ESC); 801025b8: 0f b6 82 60 72 10 80 movzbl -0x7fef8da0(%edx),%eax 801025bf: 83 c8 40 or $0x40,%eax 801025c2: 0f b6 c0 movzbl %al,%eax 801025c5: f7 d0 not %eax 801025c7: 21 c1 and %eax,%ecx return 0; 801025c9: 31 c0 xor %eax,%eax shift &= ~(shiftcode[data] | E0ESC); 801025cb: 89 0d b4 a5 10 80 mov %ecx,0x8010a5b4 } 801025d1: 5b pop %ebx 801025d2: 5d pop %ebp 801025d3: c3 ret 801025d4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi shift |= E0ESC; 801025d8: 83 c9 40 or $0x40,%ecx return 0; 801025db: 31 c0 xor %eax,%eax shift |= E0ESC; 801025dd: 89 0d b4 a5 10 80 mov %ecx,0x8010a5b4 return 0; 801025e3: c3 ret 801025e4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi else if('A' <= c && c <= 'Z') 801025e8: 8d 48 bf lea -0x41(%eax),%ecx c += 'a' - 'A'; 801025eb: 8d 50 20 lea 0x20(%eax),%edx } 801025ee: 5b pop %ebx c += 'a' - 'A'; 801025ef: 83 f9 1a cmp $0x1a,%ecx 801025f2: 0f 42 c2 cmovb %edx,%eax } 801025f5: 5d pop %ebp 801025f6: c3 ret 801025f7: 89 f6 mov %esi,%esi 801025f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi return -1; 80102600: b8 ff ff ff ff mov $0xffffffff,%eax } 80102605: c3 ret 80102606: 8d 76 00 lea 0x0(%esi),%esi 80102609: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102610 <kbdintr>: void kbdintr(void) { 80102610: 55 push %ebp 80102611: 89 e5 mov %esp,%ebp 80102613: 83 ec 14 sub $0x14,%esp consoleintr(kbdgetc); 80102616: 68 30 25 10 80 push $0x80102530 8010261b: e8 f0 e1 ff ff call 80100810 <consoleintr> } 80102620: 83 c4 10 add $0x10,%esp 80102623: c9 leave 80102624: c3 ret 80102625: 66 90 xchg %ax,%ax 80102627: 66 90 xchg %ax,%ax 80102629: 66 90 xchg %ax,%ax 8010262b: 66 90 xchg %ax,%ax 8010262d: 66 90 xchg %ax,%ax 8010262f: 90 nop 80102630 <lapicinit>: } void lapicinit(void) { if(!lapic) 80102630: a1 7c 26 11 80 mov 0x8011267c,%eax { 80102635: 55 push %ebp 80102636: 89 e5 mov %esp,%ebp if(!lapic) 80102638: 85 c0 test %eax,%eax 8010263a: 0f 84 c8 00 00 00 je 80102708 <lapicinit+0xd8> lapic[index] = value; 80102640: c7 80 f0 00 00 00 3f movl $0x13f,0xf0(%eax) 80102647: 01 00 00 lapic[ID]; // wait for write to finish, by reading 8010264a: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 8010264d: c7 80 e0 03 00 00 0b movl $0xb,0x3e0(%eax) 80102654: 00 00 00 lapic[ID]; // wait for write to finish, by reading 80102657: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 8010265a: c7 80 20 03 00 00 20 movl $0x20020,0x320(%eax) 80102661: 00 02 00 lapic[ID]; // wait for write to finish, by reading 80102664: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 80102667: c7 80 80 03 00 00 80 movl $0x989680,0x380(%eax) 8010266e: 96 98 00 lapic[ID]; // wait for write to finish, by reading 80102671: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 80102674: c7 80 50 03 00 00 00 movl $0x10000,0x350(%eax) 8010267b: 00 01 00 lapic[ID]; // wait for write to finish, by reading 8010267e: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 80102681: c7 80 60 03 00 00 00 movl $0x10000,0x360(%eax) 80102688: 00 01 00 lapic[ID]; // wait for write to finish, by reading 8010268b: 8b 50 20 mov 0x20(%eax),%edx lapicw(LINT0, MASKED); lapicw(LINT1, MASKED); // Disable performance counter overflow interrupts // on machines that provide that interrupt entry. if(((lapic[VER]>>16) & 0xFF) >= 4) 8010268e: 8b 50 30 mov 0x30(%eax),%edx 80102691: c1 ea 10 shr $0x10,%edx 80102694: 80 fa 03 cmp $0x3,%dl 80102697: 77 77 ja 80102710 <lapicinit+0xe0> lapic[index] = value; 80102699: c7 80 70 03 00 00 33 movl $0x33,0x370(%eax) 801026a0: 00 00 00 lapic[ID]; // wait for write to finish, by reading 801026a3: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801026a6: c7 80 80 02 00 00 00 movl $0x0,0x280(%eax) 801026ad: 00 00 00 lapic[ID]; // wait for write to finish, by reading 801026b0: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801026b3: c7 80 80 02 00 00 00 movl $0x0,0x280(%eax) 801026ba: 00 00 00 lapic[ID]; // wait for write to finish, by reading 801026bd: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801026c0: c7 80 b0 00 00 00 00 movl $0x0,0xb0(%eax) 801026c7: 00 00 00 lapic[ID]; // wait for write to finish, by reading 801026ca: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801026cd: c7 80 10 03 00 00 00 movl $0x0,0x310(%eax) 801026d4: 00 00 00 lapic[ID]; // wait for write to finish, by reading 801026d7: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801026da: c7 80 00 03 00 00 00 movl $0x88500,0x300(%eax) 801026e1: 85 08 00 lapic[ID]; // wait for write to finish, by reading 801026e4: 8b 50 20 mov 0x20(%eax),%edx 801026e7: 89 f6 mov %esi,%esi 801026e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi lapicw(EOI, 0); // Send an Init Level De-Assert to synchronise arbitration ID's. lapicw(ICRHI, 0); lapicw(ICRLO, BCAST | INIT | LEVEL); while(lapic[ICRLO] & DELIVS) 801026f0: 8b 90 00 03 00 00 mov 0x300(%eax),%edx 801026f6: 80 e6 10 and $0x10,%dh 801026f9: 75 f5 jne 801026f0 <lapicinit+0xc0> lapic[index] = value; 801026fb: c7 80 80 00 00 00 00 movl $0x0,0x80(%eax) 80102702: 00 00 00 lapic[ID]; // wait for write to finish, by reading 80102705: 8b 40 20 mov 0x20(%eax),%eax ; // Enable interrupts on the APIC (but not on the processor). lapicw(TPR, 0); } 80102708: 5d pop %ebp 80102709: c3 ret 8010270a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi lapic[index] = value; 80102710: c7 80 40 03 00 00 00 movl $0x10000,0x340(%eax) 80102717: 00 01 00 lapic[ID]; // wait for write to finish, by reading 8010271a: 8b 50 20 mov 0x20(%eax),%edx 8010271d: e9 77 ff ff ff jmp 80102699 <lapicinit+0x69> 80102722: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80102729: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102730 <lapicid>: int lapicid(void) { if (!lapic) 80102730: 8b 15 7c 26 11 80 mov 0x8011267c,%edx { 80102736: 55 push %ebp 80102737: 31 c0 xor %eax,%eax 80102739: 89 e5 mov %esp,%ebp if (!lapic) 8010273b: 85 d2 test %edx,%edx 8010273d: 74 06 je 80102745 <lapicid+0x15> return 0; return lapic[ID] >> 24; 8010273f: 8b 42 20 mov 0x20(%edx),%eax 80102742: c1 e8 18 shr $0x18,%eax } 80102745: 5d pop %ebp 80102746: c3 ret 80102747: 89 f6 mov %esi,%esi 80102749: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102750 <lapiceoi>: // Acknowledge interrupt. void lapiceoi(void) { 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 0d je 80102769 <lapiceoi+0x19> lapic[index] = value; 8010275c: c7 80 b0 00 00 00 00 movl $0x0,0xb0(%eax) 80102763: 00 00 00 lapic[ID]; // wait for write to finish, by reading 80102766: 8b 40 20 mov 0x20(%eax),%eax lapicw(EOI, 0); } 80102769: 5d pop %ebp 8010276a: c3 ret 8010276b: 90 nop 8010276c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102770 <microdelay>: // Spin for a given number of microseconds. // On real hardware would want to tune this dynamically. void microdelay(int us) { 80102770: 55 push %ebp 80102771: 89 e5 mov %esp,%ebp } 80102773: 5d pop %ebp 80102774: c3 ret 80102775: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102779: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102780 <lapicstartap>: // Start additional processor running entry code at addr. // See Appendix B of MultiProcessor Specification. void lapicstartap(uchar apicid, uint addr) { 80102780: 55 push %ebp asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102781: b8 0f 00 00 00 mov $0xf,%eax 80102786: ba 70 00 00 00 mov $0x70,%edx 8010278b: 89 e5 mov %esp,%ebp 8010278d: 53 push %ebx 8010278e: 8b 4d 0c mov 0xc(%ebp),%ecx 80102791: 8b 5d 08 mov 0x8(%ebp),%ebx 80102794: ee out %al,(%dx) 80102795: b8 0a 00 00 00 mov $0xa,%eax 8010279a: ba 71 00 00 00 mov $0x71,%edx 8010279f: ee out %al,(%dx) // and the warm reset vector (DWORD based at 40:67) to point at // the AP startup code prior to the [universal startup algorithm]." outb(CMOS_PORT, 0xF); // offset 0xF is shutdown code outb(CMOS_PORT+1, 0x0A); wrv = (ushort*)P2V((0x40<<4 | 0x67)); // Warm reset vector wrv[0] = 0; 801027a0: 31 c0 xor %eax,%eax wrv[1] = addr >> 4; // "Universal startup algorithm." // Send INIT (level-triggered) interrupt to reset other CPU. lapicw(ICRHI, apicid<<24); 801027a2: c1 e3 18 shl $0x18,%ebx wrv[0] = 0; 801027a5: 66 a3 67 04 00 80 mov %ax,0x80000467 wrv[1] = addr >> 4; 801027ab: 89 c8 mov %ecx,%eax // when it is in the halted state due to an INIT. So the second // should be ignored, but it is part of the official Intel algorithm. // Bochs complains about the second one. Too bad for Bochs. for(i = 0; i < 2; i++){ lapicw(ICRHI, apicid<<24); lapicw(ICRLO, STARTUP | (addr>>12)); 801027ad: c1 e9 0c shr $0xc,%ecx wrv[1] = addr >> 4; 801027b0: c1 e8 04 shr $0x4,%eax lapicw(ICRHI, apicid<<24); 801027b3: 89 da mov %ebx,%edx lapicw(ICRLO, STARTUP | (addr>>12)); 801027b5: 80 cd 06 or $0x6,%ch wrv[1] = addr >> 4; 801027b8: 66 a3 69 04 00 80 mov %ax,0x80000469 lapic[index] = value; 801027be: a1 7c 26 11 80 mov 0x8011267c,%eax 801027c3: 89 98 10 03 00 00 mov %ebx,0x310(%eax) lapic[ID]; // wait for write to finish, by reading 801027c9: 8b 58 20 mov 0x20(%eax),%ebx lapic[index] = value; 801027cc: c7 80 00 03 00 00 00 movl $0xc500,0x300(%eax) 801027d3: c5 00 00 lapic[ID]; // wait for write to finish, by reading 801027d6: 8b 58 20 mov 0x20(%eax),%ebx lapic[index] = value; 801027d9: c7 80 00 03 00 00 00 movl $0x8500,0x300(%eax) 801027e0: 85 00 00 lapic[ID]; // wait for write to finish, by reading 801027e3: 8b 58 20 mov 0x20(%eax),%ebx lapic[index] = value; 801027e6: 89 90 10 03 00 00 mov %edx,0x310(%eax) lapic[ID]; // wait for write to finish, by reading 801027ec: 8b 58 20 mov 0x20(%eax),%ebx lapic[index] = value; 801027ef: 89 88 00 03 00 00 mov %ecx,0x300(%eax) lapic[ID]; // wait for write to finish, by reading 801027f5: 8b 58 20 mov 0x20(%eax),%ebx lapic[index] = value; 801027f8: 89 90 10 03 00 00 mov %edx,0x310(%eax) lapic[ID]; // wait for write to finish, by reading 801027fe: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 80102801: 89 88 00 03 00 00 mov %ecx,0x300(%eax) lapic[ID]; // wait for write to finish, by reading 80102807: 8b 40 20 mov 0x20(%eax),%eax microdelay(200); } } 8010280a: 5b pop %ebx 8010280b: 5d pop %ebp 8010280c: c3 ret 8010280d: 8d 76 00 lea 0x0(%esi),%esi 80102810 <cmostime>: } // qemu seems to use 24-hour GWT and the values are BCD encoded void cmostime(struct rtcdate *r) { 80102810: 55 push %ebp 80102811: b8 0b 00 00 00 mov $0xb,%eax 80102816: ba 70 00 00 00 mov $0x70,%edx 8010281b: 89 e5 mov %esp,%ebp 8010281d: 57 push %edi 8010281e: 56 push %esi 8010281f: 53 push %ebx 80102820: 83 ec 4c sub $0x4c,%esp 80102823: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102824: ba 71 00 00 00 mov $0x71,%edx 80102829: ec in (%dx),%al 8010282a: 83 e0 04 and $0x4,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 8010282d: bb 70 00 00 00 mov $0x70,%ebx 80102832: 88 45 b3 mov %al,-0x4d(%ebp) 80102835: 8d 76 00 lea 0x0(%esi),%esi 80102838: 31 c0 xor %eax,%eax 8010283a: 89 da mov %ebx,%edx 8010283c: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010283d: b9 71 00 00 00 mov $0x71,%ecx 80102842: 89 ca mov %ecx,%edx 80102844: ec in (%dx),%al 80102845: 88 45 b7 mov %al,-0x49(%ebp) asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102848: 89 da mov %ebx,%edx 8010284a: b8 02 00 00 00 mov $0x2,%eax 8010284f: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102850: 89 ca mov %ecx,%edx 80102852: ec in (%dx),%al 80102853: 88 45 b6 mov %al,-0x4a(%ebp) asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102856: 89 da mov %ebx,%edx 80102858: b8 04 00 00 00 mov $0x4,%eax 8010285d: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010285e: 89 ca mov %ecx,%edx 80102860: ec in (%dx),%al 80102861: 88 45 b5 mov %al,-0x4b(%ebp) asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102864: 89 da mov %ebx,%edx 80102866: b8 07 00 00 00 mov $0x7,%eax 8010286b: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010286c: 89 ca mov %ecx,%edx 8010286e: ec in (%dx),%al 8010286f: 88 45 b4 mov %al,-0x4c(%ebp) asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102872: 89 da mov %ebx,%edx 80102874: b8 08 00 00 00 mov $0x8,%eax 80102879: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010287a: 89 ca mov %ecx,%edx 8010287c: ec in (%dx),%al 8010287d: 89 c7 mov %eax,%edi asm volatile("out %0,%1" : : "a" (data), "d" (port)); 8010287f: 89 da mov %ebx,%edx 80102881: b8 09 00 00 00 mov $0x9,%eax 80102886: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102887: 89 ca mov %ecx,%edx 80102889: ec in (%dx),%al 8010288a: 89 c6 mov %eax,%esi asm volatile("out %0,%1" : : "a" (data), "d" (port)); 8010288c: 89 da mov %ebx,%edx 8010288e: b8 0a 00 00 00 mov $0xa,%eax 80102893: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102894: 89 ca mov %ecx,%edx 80102896: ec in (%dx),%al bcd = (sb & (1 << 2)) == 0; // make sure CMOS doesn't modify time while we read it for(;;) { fill_rtcdate(&t1); if(cmos_read(CMOS_STATA) & CMOS_UIP) 80102897: 84 c0 test %al,%al 80102899: 78 9d js 80102838 <cmostime+0x28> return inb(CMOS_RETURN); 8010289b: 0f b6 45 b7 movzbl -0x49(%ebp),%eax 8010289f: 89 fa mov %edi,%edx 801028a1: 0f b6 fa movzbl %dl,%edi 801028a4: 89 f2 mov %esi,%edx 801028a6: 0f b6 f2 movzbl %dl,%esi 801028a9: 89 7d c8 mov %edi,-0x38(%ebp) asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801028ac: 89 da mov %ebx,%edx 801028ae: 89 75 cc mov %esi,-0x34(%ebp) 801028b1: 89 45 b8 mov %eax,-0x48(%ebp) 801028b4: 0f b6 45 b6 movzbl -0x4a(%ebp),%eax 801028b8: 89 45 bc mov %eax,-0x44(%ebp) 801028bb: 0f b6 45 b5 movzbl -0x4b(%ebp),%eax 801028bf: 89 45 c0 mov %eax,-0x40(%ebp) 801028c2: 0f b6 45 b4 movzbl -0x4c(%ebp),%eax 801028c6: 89 45 c4 mov %eax,-0x3c(%ebp) 801028c9: 31 c0 xor %eax,%eax 801028cb: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801028cc: 89 ca mov %ecx,%edx 801028ce: ec in (%dx),%al 801028cf: 0f b6 c0 movzbl %al,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801028d2: 89 da mov %ebx,%edx 801028d4: 89 45 d0 mov %eax,-0x30(%ebp) 801028d7: b8 02 00 00 00 mov $0x2,%eax 801028dc: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801028dd: 89 ca mov %ecx,%edx 801028df: ec in (%dx),%al 801028e0: 0f b6 c0 movzbl %al,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801028e3: 89 da mov %ebx,%edx 801028e5: 89 45 d4 mov %eax,-0x2c(%ebp) 801028e8: b8 04 00 00 00 mov $0x4,%eax 801028ed: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801028ee: 89 ca mov %ecx,%edx 801028f0: ec in (%dx),%al 801028f1: 0f b6 c0 movzbl %al,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801028f4: 89 da mov %ebx,%edx 801028f6: 89 45 d8 mov %eax,-0x28(%ebp) 801028f9: b8 07 00 00 00 mov $0x7,%eax 801028fe: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801028ff: 89 ca mov %ecx,%edx 80102901: ec in (%dx),%al 80102902: 0f b6 c0 movzbl %al,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102905: 89 da mov %ebx,%edx 80102907: 89 45 dc mov %eax,-0x24(%ebp) 8010290a: b8 08 00 00 00 mov $0x8,%eax 8010290f: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102910: 89 ca mov %ecx,%edx 80102912: ec in (%dx),%al 80102913: 0f b6 c0 movzbl %al,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102916: 89 da mov %ebx,%edx 80102918: 89 45 e0 mov %eax,-0x20(%ebp) 8010291b: b8 09 00 00 00 mov $0x9,%eax 80102920: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102921: 89 ca mov %ecx,%edx 80102923: ec in (%dx),%al 80102924: 0f b6 c0 movzbl %al,%eax continue; fill_rtcdate(&t2); if(memcmp(&t1, &t2, sizeof(t1)) == 0) 80102927: 83 ec 04 sub $0x4,%esp return inb(CMOS_RETURN); 8010292a: 89 45 e4 mov %eax,-0x1c(%ebp) if(memcmp(&t1, &t2, sizeof(t1)) == 0) 8010292d: 8d 45 d0 lea -0x30(%ebp),%eax 80102930: 6a 18 push $0x18 80102932: 50 push %eax 80102933: 8d 45 b8 lea -0x48(%ebp),%eax 80102936: 50 push %eax 80102937: e8 64 1b 00 00 call 801044a0 <memcmp> 8010293c: 83 c4 10 add $0x10,%esp 8010293f: 85 c0 test %eax,%eax 80102941: 0f 85 f1 fe ff ff jne 80102838 <cmostime+0x28> break; } // convert if(bcd) { 80102947: 80 7d b3 00 cmpb $0x0,-0x4d(%ebp) 8010294b: 75 78 jne 801029c5 <cmostime+0x1b5> #define CONV(x) (t1.x = ((t1.x >> 4) * 10) + (t1.x & 0xf)) CONV(second); 8010294d: 8b 45 b8 mov -0x48(%ebp),%eax 80102950: 89 c2 mov %eax,%edx 80102952: 83 e0 0f and $0xf,%eax 80102955: c1 ea 04 shr $0x4,%edx 80102958: 8d 14 92 lea (%edx,%edx,4),%edx 8010295b: 8d 04 50 lea (%eax,%edx,2),%eax 8010295e: 89 45 b8 mov %eax,-0x48(%ebp) CONV(minute); 80102961: 8b 45 bc mov -0x44(%ebp),%eax 80102964: 89 c2 mov %eax,%edx 80102966: 83 e0 0f and $0xf,%eax 80102969: c1 ea 04 shr $0x4,%edx 8010296c: 8d 14 92 lea (%edx,%edx,4),%edx 8010296f: 8d 04 50 lea (%eax,%edx,2),%eax 80102972: 89 45 bc mov %eax,-0x44(%ebp) CONV(hour ); 80102975: 8b 45 c0 mov -0x40(%ebp),%eax 80102978: 89 c2 mov %eax,%edx 8010297a: 83 e0 0f and $0xf,%eax 8010297d: c1 ea 04 shr $0x4,%edx 80102980: 8d 14 92 lea (%edx,%edx,4),%edx 80102983: 8d 04 50 lea (%eax,%edx,2),%eax 80102986: 89 45 c0 mov %eax,-0x40(%ebp) CONV(day ); 80102989: 8b 45 c4 mov -0x3c(%ebp),%eax 8010298c: 89 c2 mov %eax,%edx 8010298e: 83 e0 0f and $0xf,%eax 80102991: c1 ea 04 shr $0x4,%edx 80102994: 8d 14 92 lea (%edx,%edx,4),%edx 80102997: 8d 04 50 lea (%eax,%edx,2),%eax 8010299a: 89 45 c4 mov %eax,-0x3c(%ebp) CONV(month ); 8010299d: 8b 45 c8 mov -0x38(%ebp),%eax 801029a0: 89 c2 mov %eax,%edx 801029a2: 83 e0 0f and $0xf,%eax 801029a5: c1 ea 04 shr $0x4,%edx 801029a8: 8d 14 92 lea (%edx,%edx,4),%edx 801029ab: 8d 04 50 lea (%eax,%edx,2),%eax 801029ae: 89 45 c8 mov %eax,-0x38(%ebp) CONV(year ); 801029b1: 8b 45 cc mov -0x34(%ebp),%eax 801029b4: 89 c2 mov %eax,%edx 801029b6: 83 e0 0f and $0xf,%eax 801029b9: c1 ea 04 shr $0x4,%edx 801029bc: 8d 14 92 lea (%edx,%edx,4),%edx 801029bf: 8d 04 50 lea (%eax,%edx,2),%eax 801029c2: 89 45 cc mov %eax,-0x34(%ebp) #undef CONV } *r = t1; 801029c5: 8b 75 08 mov 0x8(%ebp),%esi 801029c8: 8b 45 b8 mov -0x48(%ebp),%eax 801029cb: 89 06 mov %eax,(%esi) 801029cd: 8b 45 bc mov -0x44(%ebp),%eax 801029d0: 89 46 04 mov %eax,0x4(%esi) 801029d3: 8b 45 c0 mov -0x40(%ebp),%eax 801029d6: 89 46 08 mov %eax,0x8(%esi) 801029d9: 8b 45 c4 mov -0x3c(%ebp),%eax 801029dc: 89 46 0c mov %eax,0xc(%esi) 801029df: 8b 45 c8 mov -0x38(%ebp),%eax 801029e2: 89 46 10 mov %eax,0x10(%esi) 801029e5: 8b 45 cc mov -0x34(%ebp),%eax 801029e8: 89 46 14 mov %eax,0x14(%esi) r->year += 2000; 801029eb: 81 46 14 d0 07 00 00 addl $0x7d0,0x14(%esi) } 801029f2: 8d 65 f4 lea -0xc(%ebp),%esp 801029f5: 5b pop %ebx 801029f6: 5e pop %esi 801029f7: 5f pop %edi 801029f8: 5d pop %ebp 801029f9: c3 ret 801029fa: 66 90 xchg %ax,%ax 801029fc: 66 90 xchg %ax,%ax 801029fe: 66 90 xchg %ax,%ax 80102a00 <install_trans>: static void install_trans(void) { int tail; for (tail = 0; tail < log.lh.n; tail++) { 80102a00: 8b 0d c8 26 11 80 mov 0x801126c8,%ecx 80102a06: 85 c9 test %ecx,%ecx 80102a08: 0f 8e 8a 00 00 00 jle 80102a98 <install_trans+0x98> { 80102a0e: 55 push %ebp 80102a0f: 89 e5 mov %esp,%ebp 80102a11: 57 push %edi 80102a12: 56 push %esi 80102a13: 53 push %ebx for (tail = 0; tail < log.lh.n; tail++) { 80102a14: 31 db xor %ebx,%ebx { 80102a16: 83 ec 0c sub $0xc,%esp 80102a19: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi struct buf *lbuf = bread(log.dev, log.start+tail+1); // read log block 80102a20: a1 b4 26 11 80 mov 0x801126b4,%eax 80102a25: 83 ec 08 sub $0x8,%esp 80102a28: 01 d8 add %ebx,%eax 80102a2a: 83 c0 01 add $0x1,%eax 80102a2d: 50 push %eax 80102a2e: ff 35 c4 26 11 80 pushl 0x801126c4 80102a34: e8 97 d6 ff ff call 801000d0 <bread> 80102a39: 89 c7 mov %eax,%edi struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst 80102a3b: 58 pop %eax 80102a3c: 5a pop %edx 80102a3d: ff 34 9d cc 26 11 80 pushl -0x7feed934(,%ebx,4) 80102a44: ff 35 c4 26 11 80 pushl 0x801126c4 for (tail = 0; tail < log.lh.n; tail++) { 80102a4a: 83 c3 01 add $0x1,%ebx struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst 80102a4d: e8 7e d6 ff ff call 801000d0 <bread> 80102a52: 89 c6 mov %eax,%esi memmove(dbuf->data, lbuf->data, BSIZE); // copy block to dst 80102a54: 8d 47 5c lea 0x5c(%edi),%eax 80102a57: 83 c4 0c add $0xc,%esp 80102a5a: 68 00 02 00 00 push $0x200 80102a5f: 50 push %eax 80102a60: 8d 46 5c lea 0x5c(%esi),%eax 80102a63: 50 push %eax 80102a64: e8 97 1a 00 00 call 80104500 <memmove> bwrite(dbuf); // write dst to disk 80102a69: 89 34 24 mov %esi,(%esp) 80102a6c: e8 2f d7 ff ff call 801001a0 <bwrite> brelse(lbuf); 80102a71: 89 3c 24 mov %edi,(%esp) 80102a74: e8 67 d7 ff ff call 801001e0 <brelse> brelse(dbuf); 80102a79: 89 34 24 mov %esi,(%esp) 80102a7c: e8 5f d7 ff ff call 801001e0 <brelse> for (tail = 0; tail < log.lh.n; tail++) { 80102a81: 83 c4 10 add $0x10,%esp 80102a84: 39 1d c8 26 11 80 cmp %ebx,0x801126c8 80102a8a: 7f 94 jg 80102a20 <install_trans+0x20> } } 80102a8c: 8d 65 f4 lea -0xc(%ebp),%esp 80102a8f: 5b pop %ebx 80102a90: 5e pop %esi 80102a91: 5f pop %edi 80102a92: 5d pop %ebp 80102a93: c3 ret 80102a94: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102a98: f3 c3 repz ret 80102a9a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80102aa0 <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) { 80102aa0: 55 push %ebp 80102aa1: 89 e5 mov %esp,%ebp 80102aa3: 56 push %esi 80102aa4: 53 push %ebx struct buf *buf = bread(log.dev, log.start); 80102aa5: 83 ec 08 sub $0x8,%esp 80102aa8: ff 35 b4 26 11 80 pushl 0x801126b4 80102aae: ff 35 c4 26 11 80 pushl 0x801126c4 80102ab4: e8 17 d6 ff ff call 801000d0 <bread> struct logheader *hb = (struct logheader *) (buf->data); int i; hb->n = log.lh.n; 80102ab9: 8b 1d c8 26 11 80 mov 0x801126c8,%ebx for (i = 0; i < log.lh.n; i++) { 80102abf: 83 c4 10 add $0x10,%esp struct buf *buf = bread(log.dev, log.start); 80102ac2: 89 c6 mov %eax,%esi for (i = 0; i < log.lh.n; i++) { 80102ac4: 85 db test %ebx,%ebx hb->n = log.lh.n; 80102ac6: 89 58 5c mov %ebx,0x5c(%eax) for (i = 0; i < log.lh.n; i++) { 80102ac9: 7e 16 jle 80102ae1 <write_head+0x41> 80102acb: c1 e3 02 shl $0x2,%ebx 80102ace: 31 d2 xor %edx,%edx hb->block[i] = log.lh.block[i]; 80102ad0: 8b 8a cc 26 11 80 mov -0x7feed934(%edx),%ecx 80102ad6: 89 4c 16 60 mov %ecx,0x60(%esi,%edx,1) 80102ada: 83 c2 04 add $0x4,%edx for (i = 0; i < log.lh.n; i++) { 80102add: 39 da cmp %ebx,%edx 80102adf: 75 ef jne 80102ad0 <write_head+0x30> } bwrite(buf); 80102ae1: 83 ec 0c sub $0xc,%esp 80102ae4: 56 push %esi 80102ae5: e8 b6 d6 ff ff call 801001a0 <bwrite> brelse(buf); 80102aea: 89 34 24 mov %esi,(%esp) 80102aed: e8 ee d6 ff ff call 801001e0 <brelse> } 80102af2: 83 c4 10 add $0x10,%esp 80102af5: 8d 65 f8 lea -0x8(%ebp),%esp 80102af8: 5b pop %ebx 80102af9: 5e pop %esi 80102afa: 5d pop %ebp 80102afb: c3 ret 80102afc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102b00 <initlog>: { 80102b00: 55 push %ebp 80102b01: 89 e5 mov %esp,%ebp 80102b03: 53 push %ebx 80102b04: 83 ec 2c sub $0x2c,%esp 80102b07: 8b 5d 08 mov 0x8(%ebp),%ebx initlock(&log.lock, "log"); 80102b0a: 68 60 73 10 80 push $0x80107360 80102b0f: 68 80 26 11 80 push $0x80112680 80102b14: e8 e7 16 00 00 call 80104200 <initlock> readsb(dev, &sb); 80102b19: 58 pop %eax 80102b1a: 8d 45 dc lea -0x24(%ebp),%eax 80102b1d: 5a pop %edx 80102b1e: 50 push %eax 80102b1f: 53 push %ebx 80102b20: e8 1b e9 ff ff call 80101440 <readsb> log.size = sb.nlog; 80102b25: 8b 55 e8 mov -0x18(%ebp),%edx log.start = sb.logstart; 80102b28: 8b 45 ec mov -0x14(%ebp),%eax struct buf *buf = bread(log.dev, log.start); 80102b2b: 59 pop %ecx log.dev = dev; 80102b2c: 89 1d c4 26 11 80 mov %ebx,0x801126c4 log.size = sb.nlog; 80102b32: 89 15 b8 26 11 80 mov %edx,0x801126b8 log.start = sb.logstart; 80102b38: a3 b4 26 11 80 mov %eax,0x801126b4 struct buf *buf = bread(log.dev, log.start); 80102b3d: 5a pop %edx 80102b3e: 50 push %eax 80102b3f: 53 push %ebx 80102b40: e8 8b d5 ff ff call 801000d0 <bread> log.lh.n = lh->n; 80102b45: 8b 58 5c mov 0x5c(%eax),%ebx for (i = 0; i < log.lh.n; i++) { 80102b48: 83 c4 10 add $0x10,%esp 80102b4b: 85 db test %ebx,%ebx log.lh.n = lh->n; 80102b4d: 89 1d c8 26 11 80 mov %ebx,0x801126c8 for (i = 0; i < log.lh.n; i++) { 80102b53: 7e 1c jle 80102b71 <initlog+0x71> 80102b55: c1 e3 02 shl $0x2,%ebx 80102b58: 31 d2 xor %edx,%edx 80102b5a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi log.lh.block[i] = lh->block[i]; 80102b60: 8b 4c 10 60 mov 0x60(%eax,%edx,1),%ecx 80102b64: 83 c2 04 add $0x4,%edx 80102b67: 89 8a c8 26 11 80 mov %ecx,-0x7feed938(%edx) for (i = 0; i < log.lh.n; i++) { 80102b6d: 39 d3 cmp %edx,%ebx 80102b6f: 75 ef jne 80102b60 <initlog+0x60> brelse(buf); 80102b71: 83 ec 0c sub $0xc,%esp 80102b74: 50 push %eax 80102b75: e8 66 d6 ff ff call 801001e0 <brelse> static void recover_from_log(void) { read_head(); install_trans(); // if committed, copy from log to disk 80102b7a: e8 81 fe ff ff call 80102a00 <install_trans> log.lh.n = 0; 80102b7f: c7 05 c8 26 11 80 00 movl $0x0,0x801126c8 80102b86: 00 00 00 write_head(); // clear the log 80102b89: e8 12 ff ff ff call 80102aa0 <write_head> } 80102b8e: 83 c4 10 add $0x10,%esp 80102b91: 8b 5d fc mov -0x4(%ebp),%ebx 80102b94: c9 leave 80102b95: c3 ret 80102b96: 8d 76 00 lea 0x0(%esi),%esi 80102b99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102ba0 <begin_op>: } // called at the start of each FS system call. void begin_op(void) { 80102ba0: 55 push %ebp 80102ba1: 89 e5 mov %esp,%ebp 80102ba3: 83 ec 14 sub $0x14,%esp acquire(&log.lock); 80102ba6: 68 80 26 11 80 push $0x80112680 80102bab: e8 90 17 00 00 call 80104340 <acquire> 80102bb0: 83 c4 10 add $0x10,%esp 80102bb3: eb 18 jmp 80102bcd <begin_op+0x2d> 80102bb5: 8d 76 00 lea 0x0(%esi),%esi while(1){ if(log.committing){ sleep(&log, &log.lock); 80102bb8: 83 ec 08 sub $0x8,%esp 80102bbb: 68 80 26 11 80 push $0x80112680 80102bc0: 68 80 26 11 80 push $0x80112680 80102bc5: e8 b6 11 00 00 call 80103d80 <sleep> 80102bca: 83 c4 10 add $0x10,%esp if(log.committing){ 80102bcd: a1 c0 26 11 80 mov 0x801126c0,%eax 80102bd2: 85 c0 test %eax,%eax 80102bd4: 75 e2 jne 80102bb8 <begin_op+0x18> } else if(log.lh.n + (log.outstanding+1)*MAXOPBLOCKS > LOGSIZE){ 80102bd6: a1 bc 26 11 80 mov 0x801126bc,%eax 80102bdb: 8b 15 c8 26 11 80 mov 0x801126c8,%edx 80102be1: 83 c0 01 add $0x1,%eax 80102be4: 8d 0c 80 lea (%eax,%eax,4),%ecx 80102be7: 8d 14 4a lea (%edx,%ecx,2),%edx 80102bea: 83 fa 1e cmp $0x1e,%edx 80102bed: 7f c9 jg 80102bb8 <begin_op+0x18> // this op might exhaust log space; wait for commit. sleep(&log, &log.lock); } else { log.outstanding += 1; release(&log.lock); 80102bef: 83 ec 0c sub $0xc,%esp log.outstanding += 1; 80102bf2: a3 bc 26 11 80 mov %eax,0x801126bc release(&log.lock); 80102bf7: 68 80 26 11 80 push $0x80112680 80102bfc: e8 ff 17 00 00 call 80104400 <release> break; } } } 80102c01: 83 c4 10 add $0x10,%esp 80102c04: c9 leave 80102c05: c3 ret 80102c06: 8d 76 00 lea 0x0(%esi),%esi 80102c09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102c10 <end_op>: // called at the end of each FS system call. // commits if this was the last outstanding operation. void end_op(void) { 80102c10: 55 push %ebp 80102c11: 89 e5 mov %esp,%ebp 80102c13: 57 push %edi 80102c14: 56 push %esi 80102c15: 53 push %ebx 80102c16: 83 ec 18 sub $0x18,%esp int do_commit = 0; acquire(&log.lock); 80102c19: 68 80 26 11 80 push $0x80112680 80102c1e: e8 1d 17 00 00 call 80104340 <acquire> log.outstanding -= 1; 80102c23: a1 bc 26 11 80 mov 0x801126bc,%eax if(log.committing) 80102c28: 8b 35 c0 26 11 80 mov 0x801126c0,%esi 80102c2e: 83 c4 10 add $0x10,%esp log.outstanding -= 1; 80102c31: 8d 58 ff lea -0x1(%eax),%ebx if(log.committing) 80102c34: 85 f6 test %esi,%esi log.outstanding -= 1; 80102c36: 89 1d bc 26 11 80 mov %ebx,0x801126bc if(log.committing) 80102c3c: 0f 85 1a 01 00 00 jne 80102d5c <end_op+0x14c> panic("log.committing"); if(log.outstanding == 0){ 80102c42: 85 db test %ebx,%ebx 80102c44: 0f 85 ee 00 00 00 jne 80102d38 <end_op+0x128> // begin_op() may be waiting for log space, // and decrementing log.outstanding has decreased // the amount of reserved space. wakeup(&log); } release(&log.lock); 80102c4a: 83 ec 0c sub $0xc,%esp log.committing = 1; 80102c4d: c7 05 c0 26 11 80 01 movl $0x1,0x801126c0 80102c54: 00 00 00 release(&log.lock); 80102c57: 68 80 26 11 80 push $0x80112680 80102c5c: e8 9f 17 00 00 call 80104400 <release> } static void commit() { if (log.lh.n > 0) { 80102c61: 8b 0d c8 26 11 80 mov 0x801126c8,%ecx 80102c67: 83 c4 10 add $0x10,%esp 80102c6a: 85 c9 test %ecx,%ecx 80102c6c: 0f 8e 85 00 00 00 jle 80102cf7 <end_op+0xe7> struct buf *to = bread(log.dev, log.start+tail+1); // log block 80102c72: a1 b4 26 11 80 mov 0x801126b4,%eax 80102c77: 83 ec 08 sub $0x8,%esp 80102c7a: 01 d8 add %ebx,%eax 80102c7c: 83 c0 01 add $0x1,%eax 80102c7f: 50 push %eax 80102c80: ff 35 c4 26 11 80 pushl 0x801126c4 80102c86: e8 45 d4 ff ff call 801000d0 <bread> 80102c8b: 89 c6 mov %eax,%esi struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block 80102c8d: 58 pop %eax 80102c8e: 5a pop %edx 80102c8f: ff 34 9d cc 26 11 80 pushl -0x7feed934(,%ebx,4) 80102c96: ff 35 c4 26 11 80 pushl 0x801126c4 for (tail = 0; tail < log.lh.n; tail++) { 80102c9c: 83 c3 01 add $0x1,%ebx struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block 80102c9f: e8 2c d4 ff ff call 801000d0 <bread> 80102ca4: 89 c7 mov %eax,%edi memmove(to->data, from->data, BSIZE); 80102ca6: 8d 40 5c lea 0x5c(%eax),%eax 80102ca9: 83 c4 0c add $0xc,%esp 80102cac: 68 00 02 00 00 push $0x200 80102cb1: 50 push %eax 80102cb2: 8d 46 5c lea 0x5c(%esi),%eax 80102cb5: 50 push %eax 80102cb6: e8 45 18 00 00 call 80104500 <memmove> bwrite(to); // write the log 80102cbb: 89 34 24 mov %esi,(%esp) 80102cbe: e8 dd d4 ff ff call 801001a0 <bwrite> brelse(from); 80102cc3: 89 3c 24 mov %edi,(%esp) 80102cc6: e8 15 d5 ff ff call 801001e0 <brelse> brelse(to); 80102ccb: 89 34 24 mov %esi,(%esp) 80102cce: e8 0d d5 ff ff call 801001e0 <brelse> for (tail = 0; tail < log.lh.n; tail++) { 80102cd3: 83 c4 10 add $0x10,%esp 80102cd6: 3b 1d c8 26 11 80 cmp 0x801126c8,%ebx 80102cdc: 7c 94 jl 80102c72 <end_op+0x62> write_log(); // Write modified blocks from cache to log write_head(); // Write header to disk -- the real commit 80102cde: e8 bd fd ff ff call 80102aa0 <write_head> install_trans(); // Now install writes to home locations 80102ce3: e8 18 fd ff ff call 80102a00 <install_trans> log.lh.n = 0; 80102ce8: c7 05 c8 26 11 80 00 movl $0x0,0x801126c8 80102cef: 00 00 00 write_head(); // Erase the transaction from the log 80102cf2: e8 a9 fd ff ff call 80102aa0 <write_head> acquire(&log.lock); 80102cf7: 83 ec 0c sub $0xc,%esp 80102cfa: 68 80 26 11 80 push $0x80112680 80102cff: e8 3c 16 00 00 call 80104340 <acquire> wakeup(&log); 80102d04: c7 04 24 80 26 11 80 movl $0x80112680,(%esp) log.committing = 0; 80102d0b: c7 05 c0 26 11 80 00 movl $0x0,0x801126c0 80102d12: 00 00 00 wakeup(&log); 80102d15: e8 16 12 00 00 call 80103f30 <wakeup> release(&log.lock); 80102d1a: c7 04 24 80 26 11 80 movl $0x80112680,(%esp) 80102d21: e8 da 16 00 00 call 80104400 <release> 80102d26: 83 c4 10 add $0x10,%esp } 80102d29: 8d 65 f4 lea -0xc(%ebp),%esp 80102d2c: 5b pop %ebx 80102d2d: 5e pop %esi 80102d2e: 5f pop %edi 80102d2f: 5d pop %ebp 80102d30: c3 ret 80102d31: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi wakeup(&log); 80102d38: 83 ec 0c sub $0xc,%esp 80102d3b: 68 80 26 11 80 push $0x80112680 80102d40: e8 eb 11 00 00 call 80103f30 <wakeup> release(&log.lock); 80102d45: c7 04 24 80 26 11 80 movl $0x80112680,(%esp) 80102d4c: e8 af 16 00 00 call 80104400 <release> 80102d51: 83 c4 10 add $0x10,%esp } 80102d54: 8d 65 f4 lea -0xc(%ebp),%esp 80102d57: 5b pop %ebx 80102d58: 5e pop %esi 80102d59: 5f pop %edi 80102d5a: 5d pop %ebp 80102d5b: c3 ret panic("log.committing"); 80102d5c: 83 ec 0c sub $0xc,%esp 80102d5f: 68 64 73 10 80 push $0x80107364 80102d64: e8 27 d6 ff ff call 80100390 <panic> 80102d69: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80102d70 <log_write>: // modify bp->data[] // log_write(bp) // brelse(bp) void log_write(struct buf *b) { 80102d70: 55 push %ebp 80102d71: 89 e5 mov %esp,%ebp 80102d73: 53 push %ebx 80102d74: 83 ec 04 sub $0x4,%esp int i; if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1) 80102d77: 8b 15 c8 26 11 80 mov 0x801126c8,%edx { 80102d7d: 8b 5d 08 mov 0x8(%ebp),%ebx if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1) 80102d80: 83 fa 1d cmp $0x1d,%edx 80102d83: 0f 8f 9d 00 00 00 jg 80102e26 <log_write+0xb6> 80102d89: a1 b8 26 11 80 mov 0x801126b8,%eax 80102d8e: 83 e8 01 sub $0x1,%eax 80102d91: 39 c2 cmp %eax,%edx 80102d93: 0f 8d 8d 00 00 00 jge 80102e26 <log_write+0xb6> panic("too big a transaction"); if (log.outstanding < 1) 80102d99: a1 bc 26 11 80 mov 0x801126bc,%eax 80102d9e: 85 c0 test %eax,%eax 80102da0: 0f 8e 8d 00 00 00 jle 80102e33 <log_write+0xc3> panic("log_write outside of trans"); acquire(&log.lock); 80102da6: 83 ec 0c sub $0xc,%esp 80102da9: 68 80 26 11 80 push $0x80112680 80102dae: e8 8d 15 00 00 call 80104340 <acquire> for (i = 0; i < log.lh.n; i++) { 80102db3: 8b 0d c8 26 11 80 mov 0x801126c8,%ecx 80102db9: 83 c4 10 add $0x10,%esp 80102dbc: 83 f9 00 cmp $0x0,%ecx 80102dbf: 7e 57 jle 80102e18 <log_write+0xa8> if (log.lh.block[i] == b->blockno) // log absorbtion 80102dc1: 8b 53 08 mov 0x8(%ebx),%edx for (i = 0; i < log.lh.n; i++) { 80102dc4: 31 c0 xor %eax,%eax if (log.lh.block[i] == b->blockno) // log absorbtion 80102dc6: 3b 15 cc 26 11 80 cmp 0x801126cc,%edx 80102dcc: 75 0b jne 80102dd9 <log_write+0x69> 80102dce: eb 38 jmp 80102e08 <log_write+0x98> 80102dd0: 39 14 85 cc 26 11 80 cmp %edx,-0x7feed934(,%eax,4) 80102dd7: 74 2f je 80102e08 <log_write+0x98> for (i = 0; i < log.lh.n; i++) { 80102dd9: 83 c0 01 add $0x1,%eax 80102ddc: 39 c1 cmp %eax,%ecx 80102dde: 75 f0 jne 80102dd0 <log_write+0x60> break; } log.lh.block[i] = b->blockno; 80102de0: 89 14 85 cc 26 11 80 mov %edx,-0x7feed934(,%eax,4) if (i == log.lh.n) log.lh.n++; 80102de7: 83 c0 01 add $0x1,%eax 80102dea: a3 c8 26 11 80 mov %eax,0x801126c8 b->flags |= B_DIRTY; // prevent eviction 80102def: 83 0b 04 orl $0x4,(%ebx) release(&log.lock); 80102df2: c7 45 08 80 26 11 80 movl $0x80112680,0x8(%ebp) } 80102df9: 8b 5d fc mov -0x4(%ebp),%ebx 80102dfc: c9 leave release(&log.lock); 80102dfd: e9 fe 15 00 00 jmp 80104400 <release> 80102e02: 8d b6 00 00 00 00 lea 0x0(%esi),%esi log.lh.block[i] = b->blockno; 80102e08: 89 14 85 cc 26 11 80 mov %edx,-0x7feed934(,%eax,4) 80102e0f: eb de jmp 80102def <log_write+0x7f> 80102e11: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80102e18: 8b 43 08 mov 0x8(%ebx),%eax 80102e1b: a3 cc 26 11 80 mov %eax,0x801126cc if (i == log.lh.n) 80102e20: 75 cd jne 80102def <log_write+0x7f> 80102e22: 31 c0 xor %eax,%eax 80102e24: eb c1 jmp 80102de7 <log_write+0x77> panic("too big a transaction"); 80102e26: 83 ec 0c sub $0xc,%esp 80102e29: 68 73 73 10 80 push $0x80107373 80102e2e: e8 5d d5 ff ff call 80100390 <panic> panic("log_write outside of trans"); 80102e33: 83 ec 0c sub $0xc,%esp 80102e36: 68 89 73 10 80 push $0x80107389 80102e3b: e8 50 d5 ff ff call 80100390 <panic> 80102e40 <mpmain>: } // Common CPU setup code. static void mpmain(void) { 80102e40: 55 push %ebp 80102e41: 89 e5 mov %esp,%ebp 80102e43: 53 push %ebx 80102e44: 83 ec 04 sub $0x4,%esp cprintf("cpu%d: starting %d\n", cpuid(), cpuid()); 80102e47: e8 74 09 00 00 call 801037c0 <cpuid> 80102e4c: 89 c3 mov %eax,%ebx 80102e4e: e8 6d 09 00 00 call 801037c0 <cpuid> 80102e53: 83 ec 04 sub $0x4,%esp 80102e56: 53 push %ebx 80102e57: 50 push %eax 80102e58: 68 a4 73 10 80 push $0x801073a4 80102e5d: e8 fe d7 ff ff call 80100660 <cprintf> idtinit(); // load idt register 80102e62: e8 69 28 00 00 call 801056d0 <idtinit> xchg(&(mycpu()->started), 1); // tell startothers() we're up 80102e67: e8 d4 08 00 00 call 80103740 <mycpu> 80102e6c: 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" : 80102e6e: b8 01 00 00 00 mov $0x1,%eax 80102e73: f0 87 82 a0 00 00 00 lock xchg %eax,0xa0(%edx) scheduler(); // start running processes 80102e7a: e8 21 0c 00 00 call 80103aa0 <scheduler> 80102e7f: 90 nop 80102e80 <mpenter>: { 80102e80: 55 push %ebp 80102e81: 89 e5 mov %esp,%ebp 80102e83: 83 ec 08 sub $0x8,%esp switchkvm(); 80102e86: e8 35 39 00 00 call 801067c0 <switchkvm> seginit(); 80102e8b: e8 a0 38 00 00 call 80106730 <seginit> lapicinit(); 80102e90: e8 9b f7 ff ff call 80102630 <lapicinit> mpmain(); 80102e95: e8 a6 ff ff ff call 80102e40 <mpmain> 80102e9a: 66 90 xchg %ax,%ax 80102e9c: 66 90 xchg %ax,%ax 80102e9e: 66 90 xchg %ax,%ax 80102ea0 <main>: { 80102ea0: 8d 4c 24 04 lea 0x4(%esp),%ecx 80102ea4: 83 e4 f0 and $0xfffffff0,%esp 80102ea7: ff 71 fc pushl -0x4(%ecx) 80102eaa: 55 push %ebp 80102eab: 89 e5 mov %esp,%ebp 80102ead: 53 push %ebx 80102eae: 51 push %ecx kinit1(end, P2V(4*1024*1024)); // phys page allocator 80102eaf: 83 ec 08 sub $0x8,%esp 80102eb2: 68 00 00 40 80 push $0x80400000 80102eb7: 68 a8 54 11 80 push $0x801154a8 80102ebc: e8 2f f5 ff ff call 801023f0 <kinit1> kvmalloc(); // kernel page table 80102ec1: e8 ca 3d 00 00 call 80106c90 <kvmalloc> mpinit(); // detect other processors 80102ec6: e8 75 01 00 00 call 80103040 <mpinit> lapicinit(); // interrupt controller 80102ecb: e8 60 f7 ff ff call 80102630 <lapicinit> seginit(); // segment descriptors 80102ed0: e8 5b 38 00 00 call 80106730 <seginit> picinit(); // disable pic 80102ed5: e8 46 03 00 00 call 80103220 <picinit> ioapicinit(); // another interrupt controller 80102eda: e8 41 f3 ff ff call 80102220 <ioapicinit> consoleinit(); // console hardware 80102edf: e8 dc da ff ff call 801009c0 <consoleinit> uartinit(); // serial port 80102ee4: e8 17 2b 00 00 call 80105a00 <uartinit> pinit(); // process table 80102ee9: e8 32 08 00 00 call 80103720 <pinit> tvinit(); // trap vectors 80102eee: e8 5d 27 00 00 call 80105650 <tvinit> binit(); // buffer cache 80102ef3: e8 48 d1 ff ff call 80100040 <binit> fileinit(); // file table 80102ef8: e8 63 de ff ff call 80100d60 <fileinit> ideinit(); // disk 80102efd: e8 fe f0 ff ff call 80102000 <ideinit> // Write entry code to unused memory at 0x7000. // The linker has placed the image of entryother.S in // _binary_entryother_start. code = P2V(0x7000); memmove(code, _binary_entryother_start, (uint)_binary_entryother_size); 80102f02: 83 c4 0c add $0xc,%esp 80102f05: 68 8a 00 00 00 push $0x8a 80102f0a: 68 8c a4 10 80 push $0x8010a48c 80102f0f: 68 00 70 00 80 push $0x80007000 80102f14: e8 e7 15 00 00 call 80104500 <memmove> for(c = cpus; c < cpus+ncpu; c++){ 80102f19: 69 05 00 2d 11 80 b0 imul $0xb0,0x80112d00,%eax 80102f20: 00 00 00 80102f23: 83 c4 10 add $0x10,%esp 80102f26: 05 80 27 11 80 add $0x80112780,%eax 80102f2b: 3d 80 27 11 80 cmp $0x80112780,%eax 80102f30: 76 71 jbe 80102fa3 <main+0x103> 80102f32: bb 80 27 11 80 mov $0x80112780,%ebx 80102f37: 89 f6 mov %esi,%esi 80102f39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi if(c == mycpu()) // We've started already. 80102f40: e8 fb 07 00 00 call 80103740 <mycpu> 80102f45: 39 d8 cmp %ebx,%eax 80102f47: 74 41 je 80102f8a <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(); 80102f49: e8 72 f5 ff ff call 801024c0 <kalloc> *(void**)(code-4) = stack + KSTACKSIZE; 80102f4e: 05 00 10 00 00 add $0x1000,%eax *(void(**)(void))(code-8) = mpenter; 80102f53: c7 05 f8 6f 00 80 80 movl $0x80102e80,0x80006ff8 80102f5a: 2e 10 80 *(int**)(code-12) = (void *) V2P(entrypgdir); 80102f5d: c7 05 f4 6f 00 80 00 movl $0x109000,0x80006ff4 80102f64: 90 10 00 *(void**)(code-4) = stack + KSTACKSIZE; 80102f67: a3 fc 6f 00 80 mov %eax,0x80006ffc lapicstartap(c->apicid, V2P(code)); 80102f6c: 0f b6 03 movzbl (%ebx),%eax 80102f6f: 83 ec 08 sub $0x8,%esp 80102f72: 68 00 70 00 00 push $0x7000 80102f77: 50 push %eax 80102f78: e8 03 f8 ff ff call 80102780 <lapicstartap> 80102f7d: 83 c4 10 add $0x10,%esp // wait for cpu to finish mpmain() while(c->started == 0) 80102f80: 8b 83 a0 00 00 00 mov 0xa0(%ebx),%eax 80102f86: 85 c0 test %eax,%eax 80102f88: 74 f6 je 80102f80 <main+0xe0> for(c = cpus; c < cpus+ncpu; c++){ 80102f8a: 69 05 00 2d 11 80 b0 imul $0xb0,0x80112d00,%eax 80102f91: 00 00 00 80102f94: 81 c3 b0 00 00 00 add $0xb0,%ebx 80102f9a: 05 80 27 11 80 add $0x80112780,%eax 80102f9f: 39 c3 cmp %eax,%ebx 80102fa1: 72 9d jb 80102f40 <main+0xa0> kinit2(P2V(4*1024*1024), P2V(PHYSTOP)); // must come after startothers() 80102fa3: 83 ec 08 sub $0x8,%esp 80102fa6: 68 00 00 00 8e push $0x8e000000 80102fab: 68 00 00 40 80 push $0x80400000 80102fb0: e8 ab f4 ff ff call 80102460 <kinit2> userinit(); // first user process 80102fb5: e8 56 08 00 00 call 80103810 <userinit> mpmain(); // finish this processor's setup 80102fba: e8 81 fe ff ff call 80102e40 <mpmain> 80102fbf: 90 nop 80102fc0 <mpsearch1>: } // Look for an MP structure in the len bytes at addr. static struct mp* mpsearch1(uint a, int len) { 80102fc0: 55 push %ebp 80102fc1: 89 e5 mov %esp,%ebp 80102fc3: 57 push %edi 80102fc4: 56 push %esi uchar *e, *p, *addr; addr = P2V(a); 80102fc5: 8d b0 00 00 00 80 lea -0x80000000(%eax),%esi { 80102fcb: 53 push %ebx e = addr+len; 80102fcc: 8d 1c 16 lea (%esi,%edx,1),%ebx { 80102fcf: 83 ec 0c sub $0xc,%esp for(p = addr; p < e; p += sizeof(struct mp)) 80102fd2: 39 de cmp %ebx,%esi 80102fd4: 72 10 jb 80102fe6 <mpsearch1+0x26> 80102fd6: eb 50 jmp 80103028 <mpsearch1+0x68> 80102fd8: 90 nop 80102fd9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80102fe0: 39 fb cmp %edi,%ebx 80102fe2: 89 fe mov %edi,%esi 80102fe4: 76 42 jbe 80103028 <mpsearch1+0x68> if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0) 80102fe6: 83 ec 04 sub $0x4,%esp 80102fe9: 8d 7e 10 lea 0x10(%esi),%edi 80102fec: 6a 04 push $0x4 80102fee: 68 b8 73 10 80 push $0x801073b8 80102ff3: 56 push %esi 80102ff4: e8 a7 14 00 00 call 801044a0 <memcmp> 80102ff9: 83 c4 10 add $0x10,%esp 80102ffc: 85 c0 test %eax,%eax 80102ffe: 75 e0 jne 80102fe0 <mpsearch1+0x20> 80103000: 89 f1 mov %esi,%ecx 80103002: 8d b6 00 00 00 00 lea 0x0(%esi),%esi sum += addr[i]; 80103008: 0f b6 11 movzbl (%ecx),%edx 8010300b: 83 c1 01 add $0x1,%ecx 8010300e: 01 d0 add %edx,%eax for(i=0; i<len; i++) 80103010: 39 f9 cmp %edi,%ecx 80103012: 75 f4 jne 80103008 <mpsearch1+0x48> if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0) 80103014: 84 c0 test %al,%al 80103016: 75 c8 jne 80102fe0 <mpsearch1+0x20> return (struct mp*)p; return 0; } 80103018: 8d 65 f4 lea -0xc(%ebp),%esp 8010301b: 89 f0 mov %esi,%eax 8010301d: 5b pop %ebx 8010301e: 5e pop %esi 8010301f: 5f pop %edi 80103020: 5d pop %ebp 80103021: c3 ret 80103022: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80103028: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 8010302b: 31 f6 xor %esi,%esi } 8010302d: 89 f0 mov %esi,%eax 8010302f: 5b pop %ebx 80103030: 5e pop %esi 80103031: 5f pop %edi 80103032: 5d pop %ebp 80103033: c3 ret 80103034: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010303a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80103040 <mpinit>: return conf; } void mpinit(void) { 80103040: 55 push %ebp 80103041: 89 e5 mov %esp,%ebp 80103043: 57 push %edi 80103044: 56 push %esi 80103045: 53 push %ebx 80103046: 83 ec 1c sub $0x1c,%esp if((p = ((bda[0x0F]<<8)| bda[0x0E]) << 4)){ 80103049: 0f b6 05 0f 04 00 80 movzbl 0x8000040f,%eax 80103050: 0f b6 15 0e 04 00 80 movzbl 0x8000040e,%edx 80103057: c1 e0 08 shl $0x8,%eax 8010305a: 09 d0 or %edx,%eax 8010305c: c1 e0 04 shl $0x4,%eax 8010305f: 85 c0 test %eax,%eax 80103061: 75 1b jne 8010307e <mpinit+0x3e> p = ((bda[0x14]<<8)|bda[0x13])*1024; 80103063: 0f b6 05 14 04 00 80 movzbl 0x80000414,%eax 8010306a: 0f b6 15 13 04 00 80 movzbl 0x80000413,%edx 80103071: c1 e0 08 shl $0x8,%eax 80103074: 09 d0 or %edx,%eax 80103076: c1 e0 0a shl $0xa,%eax if((mp = mpsearch1(p-1024, 1024))) 80103079: 2d 00 04 00 00 sub $0x400,%eax if((mp = mpsearch1(p, 1024))) 8010307e: ba 00 04 00 00 mov $0x400,%edx 80103083: e8 38 ff ff ff call 80102fc0 <mpsearch1> 80103088: 85 c0 test %eax,%eax 8010308a: 89 45 e4 mov %eax,-0x1c(%ebp) 8010308d: 0f 84 3d 01 00 00 je 801031d0 <mpinit+0x190> if((mp = mpsearch()) == 0 || mp->physaddr == 0) 80103093: 8b 45 e4 mov -0x1c(%ebp),%eax 80103096: 8b 58 04 mov 0x4(%eax),%ebx 80103099: 85 db test %ebx,%ebx 8010309b: 0f 84 4f 01 00 00 je 801031f0 <mpinit+0x1b0> conf = (struct mpconf*) P2V((uint) mp->physaddr); 801030a1: 8d b3 00 00 00 80 lea -0x80000000(%ebx),%esi if(memcmp(conf, "PCMP", 4) != 0) 801030a7: 83 ec 04 sub $0x4,%esp 801030aa: 6a 04 push $0x4 801030ac: 68 d5 73 10 80 push $0x801073d5 801030b1: 56 push %esi 801030b2: e8 e9 13 00 00 call 801044a0 <memcmp> 801030b7: 83 c4 10 add $0x10,%esp 801030ba: 85 c0 test %eax,%eax 801030bc: 0f 85 2e 01 00 00 jne 801031f0 <mpinit+0x1b0> if(conf->version != 1 && conf->version != 4) 801030c2: 0f b6 83 06 00 00 80 movzbl -0x7ffffffa(%ebx),%eax 801030c9: 3c 01 cmp $0x1,%al 801030cb: 0f 95 c2 setne %dl 801030ce: 3c 04 cmp $0x4,%al 801030d0: 0f 95 c0 setne %al 801030d3: 20 c2 and %al,%dl 801030d5: 0f 85 15 01 00 00 jne 801031f0 <mpinit+0x1b0> if(sum((uchar*)conf, conf->length) != 0) 801030db: 0f b7 bb 04 00 00 80 movzwl -0x7ffffffc(%ebx),%edi for(i=0; i<len; i++) 801030e2: 66 85 ff test %di,%di 801030e5: 74 1a je 80103101 <mpinit+0xc1> 801030e7: 89 f0 mov %esi,%eax 801030e9: 01 f7 add %esi,%edi sum = 0; 801030eb: 31 d2 xor %edx,%edx 801030ed: 8d 76 00 lea 0x0(%esi),%esi sum += addr[i]; 801030f0: 0f b6 08 movzbl (%eax),%ecx 801030f3: 83 c0 01 add $0x1,%eax 801030f6: 01 ca add %ecx,%edx for(i=0; i<len; i++) 801030f8: 39 c7 cmp %eax,%edi 801030fa: 75 f4 jne 801030f0 <mpinit+0xb0> 801030fc: 84 d2 test %dl,%dl 801030fe: 0f 95 c2 setne %dl struct mp *mp; struct mpconf *conf; struct mpproc *proc; struct mpioapic *ioapic; if((conf = mpconfig(&mp)) == 0) 80103101: 85 f6 test %esi,%esi 80103103: 0f 84 e7 00 00 00 je 801031f0 <mpinit+0x1b0> 80103109: 84 d2 test %dl,%dl 8010310b: 0f 85 df 00 00 00 jne 801031f0 <mpinit+0x1b0> panic("Expect to run on an SMP"); ismp = 1; lapic = (uint*)conf->lapicaddr; 80103111: 8b 83 24 00 00 80 mov -0x7fffffdc(%ebx),%eax 80103117: a3 7c 26 11 80 mov %eax,0x8011267c for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){ 8010311c: 0f b7 93 04 00 00 80 movzwl -0x7ffffffc(%ebx),%edx 80103123: 8d 83 2c 00 00 80 lea -0x7fffffd4(%ebx),%eax ismp = 1; 80103129: bb 01 00 00 00 mov $0x1,%ebx for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){ 8010312e: 01 d6 add %edx,%esi 80103130: 39 c6 cmp %eax,%esi 80103132: 76 23 jbe 80103157 <mpinit+0x117> switch(*p){ 80103134: 0f b6 10 movzbl (%eax),%edx 80103137: 80 fa 04 cmp $0x4,%dl 8010313a: 0f 87 ca 00 00 00 ja 8010320a <mpinit+0x1ca> 80103140: ff 24 95 fc 73 10 80 jmp *-0x7fef8c04(,%edx,4) 80103147: 89 f6 mov %esi,%esi 80103149: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi p += sizeof(struct mpioapic); continue; case MPBUS: case MPIOINTR: case MPLINTR: p += 8; 80103150: 83 c0 08 add $0x8,%eax for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){ 80103153: 39 c6 cmp %eax,%esi 80103155: 77 dd ja 80103134 <mpinit+0xf4> default: ismp = 0; break; } } if(!ismp) 80103157: 85 db test %ebx,%ebx 80103159: 0f 84 9e 00 00 00 je 801031fd <mpinit+0x1bd> panic("Didn't find a suitable machine"); if(mp->imcrp){ 8010315f: 8b 45 e4 mov -0x1c(%ebp),%eax 80103162: 80 78 0c 00 cmpb $0x0,0xc(%eax) 80103166: 74 15 je 8010317d <mpinit+0x13d> asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80103168: b8 70 00 00 00 mov $0x70,%eax 8010316d: ba 22 00 00 00 mov $0x22,%edx 80103172: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80103173: ba 23 00 00 00 mov $0x23,%edx 80103178: 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. 80103179: 83 c8 01 or $0x1,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 8010317c: ee out %al,(%dx) } } 8010317d: 8d 65 f4 lea -0xc(%ebp),%esp 80103180: 5b pop %ebx 80103181: 5e pop %esi 80103182: 5f pop %edi 80103183: 5d pop %ebp 80103184: c3 ret 80103185: 8d 76 00 lea 0x0(%esi),%esi if(ncpu < NCPU) { 80103188: 8b 0d 00 2d 11 80 mov 0x80112d00,%ecx 8010318e: 83 f9 07 cmp $0x7,%ecx 80103191: 7f 19 jg 801031ac <mpinit+0x16c> cpus[ncpu].apicid = proc->apicid; // apicid may differ from ncpu 80103193: 0f b6 50 01 movzbl 0x1(%eax),%edx 80103197: 69 f9 b0 00 00 00 imul $0xb0,%ecx,%edi ncpu++; 8010319d: 83 c1 01 add $0x1,%ecx 801031a0: 89 0d 00 2d 11 80 mov %ecx,0x80112d00 cpus[ncpu].apicid = proc->apicid; // apicid may differ from ncpu 801031a6: 88 97 80 27 11 80 mov %dl,-0x7feed880(%edi) p += sizeof(struct mpproc); 801031ac: 83 c0 14 add $0x14,%eax continue; 801031af: e9 7c ff ff ff jmp 80103130 <mpinit+0xf0> 801031b4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi ioapicid = ioapic->apicno; 801031b8: 0f b6 50 01 movzbl 0x1(%eax),%edx p += sizeof(struct mpioapic); 801031bc: 83 c0 08 add $0x8,%eax ioapicid = ioapic->apicno; 801031bf: 88 15 60 27 11 80 mov %dl,0x80112760 continue; 801031c5: e9 66 ff ff ff jmp 80103130 <mpinit+0xf0> 801031ca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return mpsearch1(0xF0000, 0x10000); 801031d0: ba 00 00 01 00 mov $0x10000,%edx 801031d5: b8 00 00 0f 00 mov $0xf0000,%eax 801031da: e8 e1 fd ff ff call 80102fc0 <mpsearch1> if((mp = mpsearch()) == 0 || mp->physaddr == 0) 801031df: 85 c0 test %eax,%eax return mpsearch1(0xF0000, 0x10000); 801031e1: 89 45 e4 mov %eax,-0x1c(%ebp) if((mp = mpsearch()) == 0 || mp->physaddr == 0) 801031e4: 0f 85 a9 fe ff ff jne 80103093 <mpinit+0x53> 801031ea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi panic("Expect to run on an SMP"); 801031f0: 83 ec 0c sub $0xc,%esp 801031f3: 68 bd 73 10 80 push $0x801073bd 801031f8: e8 93 d1 ff ff call 80100390 <panic> panic("Didn't find a suitable machine"); 801031fd: 83 ec 0c sub $0xc,%esp 80103200: 68 dc 73 10 80 push $0x801073dc 80103205: e8 86 d1 ff ff call 80100390 <panic> ismp = 0; 8010320a: 31 db xor %ebx,%ebx 8010320c: e9 26 ff ff ff jmp 80103137 <mpinit+0xf7> 80103211: 66 90 xchg %ax,%ax 80103213: 66 90 xchg %ax,%ax 80103215: 66 90 xchg %ax,%ax 80103217: 66 90 xchg %ax,%ax 80103219: 66 90 xchg %ax,%ax 8010321b: 66 90 xchg %ax,%ax 8010321d: 66 90 xchg %ax,%ax 8010321f: 90 nop 80103220 <picinit>: #define IO_PIC2 0xA0 // Slave (IRQs 8-15) // Don't use the 8259A interrupt controllers. Xv6 assumes SMP hardware. void picinit(void) { 80103220: 55 push %ebp 80103221: b8 ff ff ff ff mov $0xffffffff,%eax 80103226: ba 21 00 00 00 mov $0x21,%edx 8010322b: 89 e5 mov %esp,%ebp 8010322d: ee out %al,(%dx) 8010322e: ba a1 00 00 00 mov $0xa1,%edx 80103233: ee out %al,(%dx) // mask all interrupts outb(IO_PIC1+1, 0xFF); outb(IO_PIC2+1, 0xFF); } 80103234: 5d pop %ebp 80103235: c3 ret 80103236: 66 90 xchg %ax,%ax 80103238: 66 90 xchg %ax,%ax 8010323a: 66 90 xchg %ax,%ax 8010323c: 66 90 xchg %ax,%ax 8010323e: 66 90 xchg %ax,%ax 80103240 <pipealloc>: int writeopen; // write fd is still open }; int pipealloc(struct file **f0, struct file **f1) { 80103240: 55 push %ebp 80103241: 89 e5 mov %esp,%ebp 80103243: 57 push %edi 80103244: 56 push %esi 80103245: 53 push %ebx 80103246: 83 ec 0c sub $0xc,%esp 80103249: 8b 5d 08 mov 0x8(%ebp),%ebx 8010324c: 8b 75 0c mov 0xc(%ebp),%esi struct pipe *p; p = 0; *f0 = *f1 = 0; 8010324f: c7 06 00 00 00 00 movl $0x0,(%esi) 80103255: c7 03 00 00 00 00 movl $0x0,(%ebx) if((*f0 = filealloc()) == 0 || (*f1 = filealloc()) == 0) 8010325b: e8 20 db ff ff call 80100d80 <filealloc> 80103260: 85 c0 test %eax,%eax 80103262: 89 03 mov %eax,(%ebx) 80103264: 74 22 je 80103288 <pipealloc+0x48> 80103266: e8 15 db ff ff call 80100d80 <filealloc> 8010326b: 85 c0 test %eax,%eax 8010326d: 89 06 mov %eax,(%esi) 8010326f: 74 3f je 801032b0 <pipealloc+0x70> goto bad; if((p = (struct pipe*)kalloc()) == 0) 80103271: e8 4a f2 ff ff call 801024c0 <kalloc> 80103276: 85 c0 test %eax,%eax 80103278: 89 c7 mov %eax,%edi 8010327a: 75 54 jne 801032d0 <pipealloc+0x90> //PAGEBREAK: 20 bad: if(p) kfree((char*)p); if(*f0) 8010327c: 8b 03 mov (%ebx),%eax 8010327e: 85 c0 test %eax,%eax 80103280: 75 34 jne 801032b6 <pipealloc+0x76> 80103282: 8d b6 00 00 00 00 lea 0x0(%esi),%esi fileclose(*f0); if(*f1) 80103288: 8b 06 mov (%esi),%eax 8010328a: 85 c0 test %eax,%eax 8010328c: 74 0c je 8010329a <pipealloc+0x5a> fileclose(*f1); 8010328e: 83 ec 0c sub $0xc,%esp 80103291: 50 push %eax 80103292: e8 a9 db ff ff call 80100e40 <fileclose> 80103297: 83 c4 10 add $0x10,%esp return -1; } 8010329a: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 8010329d: b8 ff ff ff ff mov $0xffffffff,%eax } 801032a2: 5b pop %ebx 801032a3: 5e pop %esi 801032a4: 5f pop %edi 801032a5: 5d pop %ebp 801032a6: c3 ret 801032a7: 89 f6 mov %esi,%esi 801032a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi if(*f0) 801032b0: 8b 03 mov (%ebx),%eax 801032b2: 85 c0 test %eax,%eax 801032b4: 74 e4 je 8010329a <pipealloc+0x5a> fileclose(*f0); 801032b6: 83 ec 0c sub $0xc,%esp 801032b9: 50 push %eax 801032ba: e8 81 db ff ff call 80100e40 <fileclose> if(*f1) 801032bf: 8b 06 mov (%esi),%eax fileclose(*f0); 801032c1: 83 c4 10 add $0x10,%esp if(*f1) 801032c4: 85 c0 test %eax,%eax 801032c6: 75 c6 jne 8010328e <pipealloc+0x4e> 801032c8: eb d0 jmp 8010329a <pipealloc+0x5a> 801032ca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi initlock(&p->lock, "pipe"); 801032d0: 83 ec 08 sub $0x8,%esp p->readopen = 1; 801032d3: c7 80 3c 02 00 00 01 movl $0x1,0x23c(%eax) 801032da: 00 00 00 p->writeopen = 1; 801032dd: c7 80 40 02 00 00 01 movl $0x1,0x240(%eax) 801032e4: 00 00 00 p->nwrite = 0; 801032e7: c7 80 38 02 00 00 00 movl $0x0,0x238(%eax) 801032ee: 00 00 00 p->nread = 0; 801032f1: c7 80 34 02 00 00 00 movl $0x0,0x234(%eax) 801032f8: 00 00 00 initlock(&p->lock, "pipe"); 801032fb: 68 10 74 10 80 push $0x80107410 80103300: 50 push %eax 80103301: e8 fa 0e 00 00 call 80104200 <initlock> (*f0)->type = FD_PIPE; 80103306: 8b 03 mov (%ebx),%eax return 0; 80103308: 83 c4 10 add $0x10,%esp (*f0)->type = FD_PIPE; 8010330b: c7 00 01 00 00 00 movl $0x1,(%eax) (*f0)->readable = 1; 80103311: 8b 03 mov (%ebx),%eax 80103313: c6 40 08 01 movb $0x1,0x8(%eax) (*f0)->writable = 0; 80103317: 8b 03 mov (%ebx),%eax 80103319: c6 40 09 00 movb $0x0,0x9(%eax) (*f0)->pipe = p; 8010331d: 8b 03 mov (%ebx),%eax 8010331f: 89 78 0c mov %edi,0xc(%eax) (*f1)->type = FD_PIPE; 80103322: 8b 06 mov (%esi),%eax 80103324: c7 00 01 00 00 00 movl $0x1,(%eax) (*f1)->readable = 0; 8010332a: 8b 06 mov (%esi),%eax 8010332c: c6 40 08 00 movb $0x0,0x8(%eax) (*f1)->writable = 1; 80103330: 8b 06 mov (%esi),%eax 80103332: c6 40 09 01 movb $0x1,0x9(%eax) (*f1)->pipe = p; 80103336: 8b 06 mov (%esi),%eax 80103338: 89 78 0c mov %edi,0xc(%eax) } 8010333b: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 8010333e: 31 c0 xor %eax,%eax } 80103340: 5b pop %ebx 80103341: 5e pop %esi 80103342: 5f pop %edi 80103343: 5d pop %ebp 80103344: c3 ret 80103345: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103349: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103350 <pipeclose>: void pipeclose(struct pipe *p, int writable) { 80103350: 55 push %ebp 80103351: 89 e5 mov %esp,%ebp 80103353: 56 push %esi 80103354: 53 push %ebx 80103355: 8b 5d 08 mov 0x8(%ebp),%ebx 80103358: 8b 75 0c mov 0xc(%ebp),%esi acquire(&p->lock); 8010335b: 83 ec 0c sub $0xc,%esp 8010335e: 53 push %ebx 8010335f: e8 dc 0f 00 00 call 80104340 <acquire> if(writable){ 80103364: 83 c4 10 add $0x10,%esp 80103367: 85 f6 test %esi,%esi 80103369: 74 45 je 801033b0 <pipeclose+0x60> p->writeopen = 0; wakeup(&p->nread); 8010336b: 8d 83 34 02 00 00 lea 0x234(%ebx),%eax 80103371: 83 ec 0c sub $0xc,%esp p->writeopen = 0; 80103374: c7 83 40 02 00 00 00 movl $0x0,0x240(%ebx) 8010337b: 00 00 00 wakeup(&p->nread); 8010337e: 50 push %eax 8010337f: e8 ac 0b 00 00 call 80103f30 <wakeup> 80103384: 83 c4 10 add $0x10,%esp } else { p->readopen = 0; wakeup(&p->nwrite); } if(p->readopen == 0 && p->writeopen == 0){ 80103387: 8b 93 3c 02 00 00 mov 0x23c(%ebx),%edx 8010338d: 85 d2 test %edx,%edx 8010338f: 75 0a jne 8010339b <pipeclose+0x4b> 80103391: 8b 83 40 02 00 00 mov 0x240(%ebx),%eax 80103397: 85 c0 test %eax,%eax 80103399: 74 35 je 801033d0 <pipeclose+0x80> release(&p->lock); kfree((char*)p); } else release(&p->lock); 8010339b: 89 5d 08 mov %ebx,0x8(%ebp) } 8010339e: 8d 65 f8 lea -0x8(%ebp),%esp 801033a1: 5b pop %ebx 801033a2: 5e pop %esi 801033a3: 5d pop %ebp release(&p->lock); 801033a4: e9 57 10 00 00 jmp 80104400 <release> 801033a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi wakeup(&p->nwrite); 801033b0: 8d 83 38 02 00 00 lea 0x238(%ebx),%eax 801033b6: 83 ec 0c sub $0xc,%esp p->readopen = 0; 801033b9: c7 83 3c 02 00 00 00 movl $0x0,0x23c(%ebx) 801033c0: 00 00 00 wakeup(&p->nwrite); 801033c3: 50 push %eax 801033c4: e8 67 0b 00 00 call 80103f30 <wakeup> 801033c9: 83 c4 10 add $0x10,%esp 801033cc: eb b9 jmp 80103387 <pipeclose+0x37> 801033ce: 66 90 xchg %ax,%ax release(&p->lock); 801033d0: 83 ec 0c sub $0xc,%esp 801033d3: 53 push %ebx 801033d4: e8 27 10 00 00 call 80104400 <release> kfree((char*)p); 801033d9: 89 5d 08 mov %ebx,0x8(%ebp) 801033dc: 83 c4 10 add $0x10,%esp } 801033df: 8d 65 f8 lea -0x8(%ebp),%esp 801033e2: 5b pop %ebx 801033e3: 5e pop %esi 801033e4: 5d pop %ebp kfree((char*)p); 801033e5: e9 26 ef ff ff jmp 80102310 <kfree> 801033ea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801033f0 <pipewrite>: //PAGEBREAK: 40 int pipewrite(struct pipe *p, char *addr, int n) { 801033f0: 55 push %ebp 801033f1: 89 e5 mov %esp,%ebp 801033f3: 57 push %edi 801033f4: 56 push %esi 801033f5: 53 push %ebx 801033f6: 83 ec 28 sub $0x28,%esp 801033f9: 8b 5d 08 mov 0x8(%ebp),%ebx int i; acquire(&p->lock); 801033fc: 53 push %ebx 801033fd: e8 3e 0f 00 00 call 80104340 <acquire> for(i = 0; i < n; i++){ 80103402: 8b 45 10 mov 0x10(%ebp),%eax 80103405: 83 c4 10 add $0x10,%esp 80103408: 85 c0 test %eax,%eax 8010340a: 0f 8e c9 00 00 00 jle 801034d9 <pipewrite+0xe9> 80103410: 8b 4d 0c mov 0xc(%ebp),%ecx 80103413: 8b 83 38 02 00 00 mov 0x238(%ebx),%eax while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full if(p->readopen == 0 || myproc()->killed){ release(&p->lock); return -1; } wakeup(&p->nread); 80103419: 8d bb 34 02 00 00 lea 0x234(%ebx),%edi 8010341f: 89 4d e4 mov %ecx,-0x1c(%ebp) 80103422: 03 4d 10 add 0x10(%ebp),%ecx 80103425: 89 4d e0 mov %ecx,-0x20(%ebp) while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full 80103428: 8b 8b 34 02 00 00 mov 0x234(%ebx),%ecx 8010342e: 8d 91 00 02 00 00 lea 0x200(%ecx),%edx 80103434: 39 d0 cmp %edx,%eax 80103436: 75 71 jne 801034a9 <pipewrite+0xb9> if(p->readopen == 0 || myproc()->killed){ 80103438: 8b 83 3c 02 00 00 mov 0x23c(%ebx),%eax 8010343e: 85 c0 test %eax,%eax 80103440: 74 4e je 80103490 <pipewrite+0xa0> sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep 80103442: 8d b3 38 02 00 00 lea 0x238(%ebx),%esi 80103448: eb 3a jmp 80103484 <pipewrite+0x94> 8010344a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi wakeup(&p->nread); 80103450: 83 ec 0c sub $0xc,%esp 80103453: 57 push %edi 80103454: e8 d7 0a 00 00 call 80103f30 <wakeup> sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep 80103459: 5a pop %edx 8010345a: 59 pop %ecx 8010345b: 53 push %ebx 8010345c: 56 push %esi 8010345d: e8 1e 09 00 00 call 80103d80 <sleep> while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full 80103462: 8b 83 34 02 00 00 mov 0x234(%ebx),%eax 80103468: 8b 93 38 02 00 00 mov 0x238(%ebx),%edx 8010346e: 83 c4 10 add $0x10,%esp 80103471: 05 00 02 00 00 add $0x200,%eax 80103476: 39 c2 cmp %eax,%edx 80103478: 75 36 jne 801034b0 <pipewrite+0xc0> if(p->readopen == 0 || myproc()->killed){ 8010347a: 8b 83 3c 02 00 00 mov 0x23c(%ebx),%eax 80103480: 85 c0 test %eax,%eax 80103482: 74 0c je 80103490 <pipewrite+0xa0> 80103484: e8 57 03 00 00 call 801037e0 <myproc> 80103489: 8b 40 24 mov 0x24(%eax),%eax 8010348c: 85 c0 test %eax,%eax 8010348e: 74 c0 je 80103450 <pipewrite+0x60> release(&p->lock); 80103490: 83 ec 0c sub $0xc,%esp 80103493: 53 push %ebx 80103494: e8 67 0f 00 00 call 80104400 <release> return -1; 80103499: 83 c4 10 add $0x10,%esp 8010349c: 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; } 801034a1: 8d 65 f4 lea -0xc(%ebp),%esp 801034a4: 5b pop %ebx 801034a5: 5e pop %esi 801034a6: 5f pop %edi 801034a7: 5d pop %ebp 801034a8: c3 ret while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full 801034a9: 89 c2 mov %eax,%edx 801034ab: 90 nop 801034ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi p->data[p->nwrite++ % PIPESIZE] = addr[i]; 801034b0: 8b 75 e4 mov -0x1c(%ebp),%esi 801034b3: 8d 42 01 lea 0x1(%edx),%eax 801034b6: 81 e2 ff 01 00 00 and $0x1ff,%edx 801034bc: 89 83 38 02 00 00 mov %eax,0x238(%ebx) 801034c2: 83 c6 01 add $0x1,%esi 801034c5: 0f b6 4e ff movzbl -0x1(%esi),%ecx for(i = 0; i < n; i++){ 801034c9: 3b 75 e0 cmp -0x20(%ebp),%esi 801034cc: 89 75 e4 mov %esi,-0x1c(%ebp) p->data[p->nwrite++ % PIPESIZE] = addr[i]; 801034cf: 88 4c 13 34 mov %cl,0x34(%ebx,%edx,1) for(i = 0; i < n; i++){ 801034d3: 0f 85 4f ff ff ff jne 80103428 <pipewrite+0x38> wakeup(&p->nread); //DOC: pipewrite-wakeup1 801034d9: 8d 83 34 02 00 00 lea 0x234(%ebx),%eax 801034df: 83 ec 0c sub $0xc,%esp 801034e2: 50 push %eax 801034e3: e8 48 0a 00 00 call 80103f30 <wakeup> release(&p->lock); 801034e8: 89 1c 24 mov %ebx,(%esp) 801034eb: e8 10 0f 00 00 call 80104400 <release> return n; 801034f0: 83 c4 10 add $0x10,%esp 801034f3: 8b 45 10 mov 0x10(%ebp),%eax 801034f6: eb a9 jmp 801034a1 <pipewrite+0xb1> 801034f8: 90 nop 801034f9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103500 <piperead>: int piperead(struct pipe *p, char *addr, int n) { 80103500: 55 push %ebp 80103501: 89 e5 mov %esp,%ebp 80103503: 57 push %edi 80103504: 56 push %esi 80103505: 53 push %ebx 80103506: 83 ec 18 sub $0x18,%esp 80103509: 8b 75 08 mov 0x8(%ebp),%esi 8010350c: 8b 7d 0c mov 0xc(%ebp),%edi int i; acquire(&p->lock); 8010350f: 56 push %esi 80103510: e8 2b 0e 00 00 call 80104340 <acquire> while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty 80103515: 83 c4 10 add $0x10,%esp 80103518: 8b 8e 34 02 00 00 mov 0x234(%esi),%ecx 8010351e: 3b 8e 38 02 00 00 cmp 0x238(%esi),%ecx 80103524: 75 6a jne 80103590 <piperead+0x90> 80103526: 8b 9e 40 02 00 00 mov 0x240(%esi),%ebx 8010352c: 85 db test %ebx,%ebx 8010352e: 0f 84 c4 00 00 00 je 801035f8 <piperead+0xf8> if(myproc()->killed){ release(&p->lock); return -1; } sleep(&p->nread, &p->lock); //DOC: piperead-sleep 80103534: 8d 9e 34 02 00 00 lea 0x234(%esi),%ebx 8010353a: eb 2d jmp 80103569 <piperead+0x69> 8010353c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103540: 83 ec 08 sub $0x8,%esp 80103543: 56 push %esi 80103544: 53 push %ebx 80103545: e8 36 08 00 00 call 80103d80 <sleep> while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty 8010354a: 83 c4 10 add $0x10,%esp 8010354d: 8b 8e 34 02 00 00 mov 0x234(%esi),%ecx 80103553: 3b 8e 38 02 00 00 cmp 0x238(%esi),%ecx 80103559: 75 35 jne 80103590 <piperead+0x90> 8010355b: 8b 96 40 02 00 00 mov 0x240(%esi),%edx 80103561: 85 d2 test %edx,%edx 80103563: 0f 84 8f 00 00 00 je 801035f8 <piperead+0xf8> if(myproc()->killed){ 80103569: e8 72 02 00 00 call 801037e0 <myproc> 8010356e: 8b 48 24 mov 0x24(%eax),%ecx 80103571: 85 c9 test %ecx,%ecx 80103573: 74 cb je 80103540 <piperead+0x40> release(&p->lock); 80103575: 83 ec 0c sub $0xc,%esp return -1; 80103578: bb ff ff ff ff mov $0xffffffff,%ebx release(&p->lock); 8010357d: 56 push %esi 8010357e: e8 7d 0e 00 00 call 80104400 <release> return -1; 80103583: 83 c4 10 add $0x10,%esp addr[i] = p->data[p->nread++ % PIPESIZE]; } wakeup(&p->nwrite); //DOC: piperead-wakeup release(&p->lock); return i; } 80103586: 8d 65 f4 lea -0xc(%ebp),%esp 80103589: 89 d8 mov %ebx,%eax 8010358b: 5b pop %ebx 8010358c: 5e pop %esi 8010358d: 5f pop %edi 8010358e: 5d pop %ebp 8010358f: c3 ret for(i = 0; i < n; i++){ //DOC: piperead-copy 80103590: 8b 45 10 mov 0x10(%ebp),%eax 80103593: 85 c0 test %eax,%eax 80103595: 7e 61 jle 801035f8 <piperead+0xf8> if(p->nread == p->nwrite) 80103597: 31 db xor %ebx,%ebx 80103599: eb 13 jmp 801035ae <piperead+0xae> 8010359b: 90 nop 8010359c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801035a0: 8b 8e 34 02 00 00 mov 0x234(%esi),%ecx 801035a6: 3b 8e 38 02 00 00 cmp 0x238(%esi),%ecx 801035ac: 74 1f je 801035cd <piperead+0xcd> addr[i] = p->data[p->nread++ % PIPESIZE]; 801035ae: 8d 41 01 lea 0x1(%ecx),%eax 801035b1: 81 e1 ff 01 00 00 and $0x1ff,%ecx 801035b7: 89 86 34 02 00 00 mov %eax,0x234(%esi) 801035bd: 0f b6 44 0e 34 movzbl 0x34(%esi,%ecx,1),%eax 801035c2: 88 04 1f mov %al,(%edi,%ebx,1) for(i = 0; i < n; i++){ //DOC: piperead-copy 801035c5: 83 c3 01 add $0x1,%ebx 801035c8: 39 5d 10 cmp %ebx,0x10(%ebp) 801035cb: 75 d3 jne 801035a0 <piperead+0xa0> wakeup(&p->nwrite); //DOC: piperead-wakeup 801035cd: 8d 86 38 02 00 00 lea 0x238(%esi),%eax 801035d3: 83 ec 0c sub $0xc,%esp 801035d6: 50 push %eax 801035d7: e8 54 09 00 00 call 80103f30 <wakeup> release(&p->lock); 801035dc: 89 34 24 mov %esi,(%esp) 801035df: e8 1c 0e 00 00 call 80104400 <release> return i; 801035e4: 83 c4 10 add $0x10,%esp } 801035e7: 8d 65 f4 lea -0xc(%ebp),%esp 801035ea: 89 d8 mov %ebx,%eax 801035ec: 5b pop %ebx 801035ed: 5e pop %esi 801035ee: 5f pop %edi 801035ef: 5d pop %ebp 801035f0: c3 ret 801035f1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801035f8: 31 db xor %ebx,%ebx 801035fa: eb d1 jmp 801035cd <piperead+0xcd> 801035fc: 66 90 xchg %ax,%ax 801035fe: 66 90 xchg %ax,%ax 80103600 <allocproc>: // If found, change state to EMBRYO and initialize // state required to run in the kernel. // Otherwise return 0. static struct proc* allocproc(void) { 80103600: 55 push %ebp 80103601: 89 e5 mov %esp,%ebp 80103603: 53 push %ebx struct proc *p; char *sp; acquire(&ptable.lock); for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103604: bb 54 2d 11 80 mov $0x80112d54,%ebx { 80103609: 83 ec 10 sub $0x10,%esp acquire(&ptable.lock); 8010360c: 68 20 2d 11 80 push $0x80112d20 80103611: e8 2a 0d 00 00 call 80104340 <acquire> 80103616: 83 c4 10 add $0x10,%esp 80103619: eb 10 jmp 8010362b <allocproc+0x2b> 8010361b: 90 nop 8010361c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103620: 83 c3 7c add $0x7c,%ebx 80103623: 81 fb 54 4c 11 80 cmp $0x80114c54,%ebx 80103629: 73 75 jae 801036a0 <allocproc+0xa0> if(p->state == UNUSED) 8010362b: 8b 43 0c mov 0xc(%ebx),%eax 8010362e: 85 c0 test %eax,%eax 80103630: 75 ee jne 80103620 <allocproc+0x20> release(&ptable.lock); return 0; found: p->state = EMBRYO; p->pid = nextpid++; 80103632: a1 04 a0 10 80 mov 0x8010a004,%eax release(&ptable.lock); 80103637: 83 ec 0c sub $0xc,%esp p->state = EMBRYO; 8010363a: c7 43 0c 01 00 00 00 movl $0x1,0xc(%ebx) p->pid = nextpid++; 80103641: 8d 50 01 lea 0x1(%eax),%edx 80103644: 89 43 10 mov %eax,0x10(%ebx) release(&ptable.lock); 80103647: 68 20 2d 11 80 push $0x80112d20 p->pid = nextpid++; 8010364c: 89 15 04 a0 10 80 mov %edx,0x8010a004 release(&ptable.lock); 80103652: e8 a9 0d 00 00 call 80104400 <release> // Allocate kernel stack. if((p->kstack = kalloc()) == 0){ 80103657: e8 64 ee ff ff call 801024c0 <kalloc> 8010365c: 83 c4 10 add $0x10,%esp 8010365f: 85 c0 test %eax,%eax 80103661: 89 43 08 mov %eax,0x8(%ebx) 80103664: 74 53 je 801036b9 <allocproc+0xb9> return 0; } sp = p->kstack + KSTACKSIZE; // Leave room for trap frame. sp -= sizeof *p->tf; 80103666: 8d 90 b4 0f 00 00 lea 0xfb4(%eax),%edx sp -= 4; *(uint*)sp = (uint)trapret; sp -= sizeof *p->context; p->context = (struct context*)sp; memset(p->context, 0, sizeof *p->context); 8010366c: 83 ec 04 sub $0x4,%esp sp -= sizeof *p->context; 8010366f: 05 9c 0f 00 00 add $0xf9c,%eax sp -= sizeof *p->tf; 80103674: 89 53 18 mov %edx,0x18(%ebx) *(uint*)sp = (uint)trapret; 80103677: c7 40 14 42 56 10 80 movl $0x80105642,0x14(%eax) p->context = (struct context*)sp; 8010367e: 89 43 1c mov %eax,0x1c(%ebx) memset(p->context, 0, sizeof *p->context); 80103681: 6a 14 push $0x14 80103683: 6a 00 push $0x0 80103685: 50 push %eax 80103686: e8 c5 0d 00 00 call 80104450 <memset> p->context->eip = (uint)forkret; 8010368b: 8b 43 1c mov 0x1c(%ebx),%eax return p; 8010368e: 83 c4 10 add $0x10,%esp p->context->eip = (uint)forkret; 80103691: c7 40 10 d0 36 10 80 movl $0x801036d0,0x10(%eax) } 80103698: 89 d8 mov %ebx,%eax 8010369a: 8b 5d fc mov -0x4(%ebp),%ebx 8010369d: c9 leave 8010369e: c3 ret 8010369f: 90 nop release(&ptable.lock); 801036a0: 83 ec 0c sub $0xc,%esp return 0; 801036a3: 31 db xor %ebx,%ebx release(&ptable.lock); 801036a5: 68 20 2d 11 80 push $0x80112d20 801036aa: e8 51 0d 00 00 call 80104400 <release> } 801036af: 89 d8 mov %ebx,%eax return 0; 801036b1: 83 c4 10 add $0x10,%esp } 801036b4: 8b 5d fc mov -0x4(%ebp),%ebx 801036b7: c9 leave 801036b8: c3 ret p->state = UNUSED; 801036b9: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) return 0; 801036c0: 31 db xor %ebx,%ebx 801036c2: eb d4 jmp 80103698 <allocproc+0x98> 801036c4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801036ca: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 801036d0 <forkret>: // A fork child's very first scheduling by scheduler() // will swtch here. "Return" to user space. void forkret(void) { 801036d0: 55 push %ebp 801036d1: 89 e5 mov %esp,%ebp 801036d3: 83 ec 14 sub $0x14,%esp static int first = 1; // Still holding ptable.lock from scheduler. release(&ptable.lock); 801036d6: 68 20 2d 11 80 push $0x80112d20 801036db: e8 20 0d 00 00 call 80104400 <release> if (first) { 801036e0: a1 00 a0 10 80 mov 0x8010a000,%eax 801036e5: 83 c4 10 add $0x10,%esp 801036e8: 85 c0 test %eax,%eax 801036ea: 75 04 jne 801036f0 <forkret+0x20> iinit(ROOTDEV); initlog(ROOTDEV); } // Return to "caller", actually trapret (see allocproc). } 801036ec: c9 leave 801036ed: c3 ret 801036ee: 66 90 xchg %ax,%ax iinit(ROOTDEV); 801036f0: 83 ec 0c sub $0xc,%esp first = 0; 801036f3: c7 05 00 a0 10 80 00 movl $0x0,0x8010a000 801036fa: 00 00 00 iinit(ROOTDEV); 801036fd: 6a 01 push $0x1 801036ff: e8 7c dd ff ff call 80101480 <iinit> initlog(ROOTDEV); 80103704: c7 04 24 01 00 00 00 movl $0x1,(%esp) 8010370b: e8 f0 f3 ff ff call 80102b00 <initlog> 80103710: 83 c4 10 add $0x10,%esp } 80103713: c9 leave 80103714: c3 ret 80103715: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103719: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103720 <pinit>: { 80103720: 55 push %ebp 80103721: 89 e5 mov %esp,%ebp 80103723: 83 ec 10 sub $0x10,%esp initlock(&ptable.lock, "ptable"); 80103726: 68 15 74 10 80 push $0x80107415 8010372b: 68 20 2d 11 80 push $0x80112d20 80103730: e8 cb 0a 00 00 call 80104200 <initlock> } 80103735: 83 c4 10 add $0x10,%esp 80103738: c9 leave 80103739: c3 ret 8010373a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80103740 <mycpu>: { 80103740: 55 push %ebp 80103741: 89 e5 mov %esp,%ebp 80103743: 56 push %esi 80103744: 53 push %ebx asm volatile("pushfl; popl %0" : "=r" (eflags)); 80103745: 9c pushf 80103746: 58 pop %eax if(readeflags()&FL_IF) 80103747: f6 c4 02 test $0x2,%ah 8010374a: 75 5e jne 801037aa <mycpu+0x6a> apicid = lapicid(); 8010374c: e8 df ef ff ff call 80102730 <lapicid> for (i = 0; i < ncpu; ++i) { 80103751: 8b 35 00 2d 11 80 mov 0x80112d00,%esi 80103757: 85 f6 test %esi,%esi 80103759: 7e 42 jle 8010379d <mycpu+0x5d> if (cpus[i].apicid == apicid) 8010375b: 0f b6 15 80 27 11 80 movzbl 0x80112780,%edx 80103762: 39 d0 cmp %edx,%eax 80103764: 74 30 je 80103796 <mycpu+0x56> 80103766: b9 30 28 11 80 mov $0x80112830,%ecx for (i = 0; i < ncpu; ++i) { 8010376b: 31 d2 xor %edx,%edx 8010376d: 8d 76 00 lea 0x0(%esi),%esi 80103770: 83 c2 01 add $0x1,%edx 80103773: 39 f2 cmp %esi,%edx 80103775: 74 26 je 8010379d <mycpu+0x5d> if (cpus[i].apicid == apicid) 80103777: 0f b6 19 movzbl (%ecx),%ebx 8010377a: 81 c1 b0 00 00 00 add $0xb0,%ecx 80103780: 39 c3 cmp %eax,%ebx 80103782: 75 ec jne 80103770 <mycpu+0x30> 80103784: 69 c2 b0 00 00 00 imul $0xb0,%edx,%eax 8010378a: 05 80 27 11 80 add $0x80112780,%eax } 8010378f: 8d 65 f8 lea -0x8(%ebp),%esp 80103792: 5b pop %ebx 80103793: 5e pop %esi 80103794: 5d pop %ebp 80103795: c3 ret if (cpus[i].apicid == apicid) 80103796: b8 80 27 11 80 mov $0x80112780,%eax return &cpus[i]; 8010379b: eb f2 jmp 8010378f <mycpu+0x4f> panic("unknown apicid\n"); 8010379d: 83 ec 0c sub $0xc,%esp 801037a0: 68 1c 74 10 80 push $0x8010741c 801037a5: e8 e6 cb ff ff call 80100390 <panic> panic("mycpu called with interrupts enabled\n"); 801037aa: 83 ec 0c sub $0xc,%esp 801037ad: 68 f8 74 10 80 push $0x801074f8 801037b2: e8 d9 cb ff ff call 80100390 <panic> 801037b7: 89 f6 mov %esi,%esi 801037b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801037c0 <cpuid>: cpuid() { 801037c0: 55 push %ebp 801037c1: 89 e5 mov %esp,%ebp 801037c3: 83 ec 08 sub $0x8,%esp return mycpu()-cpus; 801037c6: e8 75 ff ff ff call 80103740 <mycpu> 801037cb: 2d 80 27 11 80 sub $0x80112780,%eax } 801037d0: c9 leave return mycpu()-cpus; 801037d1: c1 f8 04 sar $0x4,%eax 801037d4: 69 c0 a3 8b 2e ba imul $0xba2e8ba3,%eax,%eax } 801037da: c3 ret 801037db: 90 nop 801037dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801037e0 <myproc>: myproc(void) { 801037e0: 55 push %ebp 801037e1: 89 e5 mov %esp,%ebp 801037e3: 53 push %ebx 801037e4: 83 ec 04 sub $0x4,%esp pushcli(); 801037e7: e8 84 0a 00 00 call 80104270 <pushcli> c = mycpu(); 801037ec: e8 4f ff ff ff call 80103740 <mycpu> p = c->proc; 801037f1: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 801037f7: e8 b4 0a 00 00 call 801042b0 <popcli> } 801037fc: 83 c4 04 add $0x4,%esp 801037ff: 89 d8 mov %ebx,%eax 80103801: 5b pop %ebx 80103802: 5d pop %ebp 80103803: c3 ret 80103804: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010380a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80103810 <userinit>: { 80103810: 55 push %ebp 80103811: 89 e5 mov %esp,%ebp 80103813: 53 push %ebx 80103814: 83 ec 04 sub $0x4,%esp p = allocproc(); 80103817: e8 e4 fd ff ff call 80103600 <allocproc> 8010381c: 89 c3 mov %eax,%ebx initproc = p; 8010381e: a3 b8 a5 10 80 mov %eax,0x8010a5b8 if((p->pgdir = setupkvm()) == 0) 80103823: e8 e8 33 00 00 call 80106c10 <setupkvm> 80103828: 85 c0 test %eax,%eax 8010382a: 89 43 04 mov %eax,0x4(%ebx) 8010382d: 0f 84 bd 00 00 00 je 801038f0 <userinit+0xe0> inituvm(p->pgdir, _binary_initcode_start, (int)_binary_initcode_size); 80103833: 83 ec 04 sub $0x4,%esp 80103836: 68 2c 00 00 00 push $0x2c 8010383b: 68 60 a4 10 80 push $0x8010a460 80103840: 50 push %eax 80103841: e8 aa 30 00 00 call 801068f0 <inituvm> memset(p->tf, 0, sizeof(*p->tf)); 80103846: 83 c4 0c add $0xc,%esp p->sz = PGSIZE; 80103849: c7 03 00 10 00 00 movl $0x1000,(%ebx) memset(p->tf, 0, sizeof(*p->tf)); 8010384f: 6a 4c push $0x4c 80103851: 6a 00 push $0x0 80103853: ff 73 18 pushl 0x18(%ebx) 80103856: e8 f5 0b 00 00 call 80104450 <memset> p->tf->cs = (SEG_UCODE << 3) | DPL_USER; 8010385b: 8b 43 18 mov 0x18(%ebx),%eax 8010385e: ba 1b 00 00 00 mov $0x1b,%edx p->tf->ds = (SEG_UDATA << 3) | DPL_USER; 80103863: b9 23 00 00 00 mov $0x23,%ecx safestrcpy(p->name, "initcode", sizeof(p->name)); 80103868: 83 c4 0c add $0xc,%esp p->tf->cs = (SEG_UCODE << 3) | DPL_USER; 8010386b: 66 89 50 3c mov %dx,0x3c(%eax) p->tf->ds = (SEG_UDATA << 3) | DPL_USER; 8010386f: 8b 43 18 mov 0x18(%ebx),%eax 80103872: 66 89 48 2c mov %cx,0x2c(%eax) p->tf->es = p->tf->ds; 80103876: 8b 43 18 mov 0x18(%ebx),%eax 80103879: 0f b7 50 2c movzwl 0x2c(%eax),%edx 8010387d: 66 89 50 28 mov %dx,0x28(%eax) p->tf->ss = p->tf->ds; 80103881: 8b 43 18 mov 0x18(%ebx),%eax 80103884: 0f b7 50 2c movzwl 0x2c(%eax),%edx 80103888: 66 89 50 48 mov %dx,0x48(%eax) p->tf->eflags = FL_IF; 8010388c: 8b 43 18 mov 0x18(%ebx),%eax 8010388f: c7 40 40 00 02 00 00 movl $0x200,0x40(%eax) p->tf->esp = PGSIZE; 80103896: 8b 43 18 mov 0x18(%ebx),%eax 80103899: c7 40 44 00 10 00 00 movl $0x1000,0x44(%eax) p->tf->eip = 0; // beginning of initcode.S 801038a0: 8b 43 18 mov 0x18(%ebx),%eax 801038a3: c7 40 38 00 00 00 00 movl $0x0,0x38(%eax) safestrcpy(p->name, "initcode", sizeof(p->name)); 801038aa: 8d 43 6c lea 0x6c(%ebx),%eax 801038ad: 6a 10 push $0x10 801038af: 68 45 74 10 80 push $0x80107445 801038b4: 50 push %eax 801038b5: e8 76 0d 00 00 call 80104630 <safestrcpy> p->cwd = namei("/"); 801038ba: c7 04 24 4e 74 10 80 movl $0x8010744e,(%esp) 801038c1: e8 1a e6 ff ff call 80101ee0 <namei> 801038c6: 89 43 68 mov %eax,0x68(%ebx) acquire(&ptable.lock); 801038c9: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 801038d0: e8 6b 0a 00 00 call 80104340 <acquire> p->state = RUNNABLE; 801038d5: c7 43 0c 03 00 00 00 movl $0x3,0xc(%ebx) release(&ptable.lock); 801038dc: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 801038e3: e8 18 0b 00 00 call 80104400 <release> } 801038e8: 83 c4 10 add $0x10,%esp 801038eb: 8b 5d fc mov -0x4(%ebp),%ebx 801038ee: c9 leave 801038ef: c3 ret panic("userinit: out of memory?"); 801038f0: 83 ec 0c sub $0xc,%esp 801038f3: 68 2c 74 10 80 push $0x8010742c 801038f8: e8 93 ca ff ff call 80100390 <panic> 801038fd: 8d 76 00 lea 0x0(%esi),%esi 80103900 <growproc>: { 80103900: 55 push %ebp 80103901: 89 e5 mov %esp,%ebp 80103903: 56 push %esi 80103904: 53 push %ebx 80103905: 8b 75 08 mov 0x8(%ebp),%esi pushcli(); 80103908: e8 63 09 00 00 call 80104270 <pushcli> c = mycpu(); 8010390d: e8 2e fe ff ff call 80103740 <mycpu> p = c->proc; 80103912: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103918: e8 93 09 00 00 call 801042b0 <popcli> if(n > 0){ 8010391d: 83 fe 00 cmp $0x0,%esi sz = curproc->sz; 80103920: 8b 03 mov (%ebx),%eax if(n > 0){ 80103922: 7f 1c jg 80103940 <growproc+0x40> } else if(n < 0){ 80103924: 75 3a jne 80103960 <growproc+0x60> switchuvm(curproc); 80103926: 83 ec 0c sub $0xc,%esp curproc->sz = sz; 80103929: 89 03 mov %eax,(%ebx) switchuvm(curproc); 8010392b: 53 push %ebx 8010392c: e8 af 2e 00 00 call 801067e0 <switchuvm> return 0; 80103931: 83 c4 10 add $0x10,%esp 80103934: 31 c0 xor %eax,%eax } 80103936: 8d 65 f8 lea -0x8(%ebp),%esp 80103939: 5b pop %ebx 8010393a: 5e pop %esi 8010393b: 5d pop %ebp 8010393c: c3 ret 8010393d: 8d 76 00 lea 0x0(%esi),%esi if((sz = allocuvm(curproc->pgdir, sz, sz + n)) == 0) 80103940: 83 ec 04 sub $0x4,%esp 80103943: 01 c6 add %eax,%esi 80103945: 56 push %esi 80103946: 50 push %eax 80103947: ff 73 04 pushl 0x4(%ebx) 8010394a: e8 e1 30 00 00 call 80106a30 <allocuvm> 8010394f: 83 c4 10 add $0x10,%esp 80103952: 85 c0 test %eax,%eax 80103954: 75 d0 jne 80103926 <growproc+0x26> return -1; 80103956: b8 ff ff ff ff mov $0xffffffff,%eax 8010395b: eb d9 jmp 80103936 <growproc+0x36> 8010395d: 8d 76 00 lea 0x0(%esi),%esi if((sz = deallocuvm(curproc->pgdir, sz, sz + n)) == 0) 80103960: 83 ec 04 sub $0x4,%esp 80103963: 01 c6 add %eax,%esi 80103965: 56 push %esi 80103966: 50 push %eax 80103967: ff 73 04 pushl 0x4(%ebx) 8010396a: e8 f1 31 00 00 call 80106b60 <deallocuvm> 8010396f: 83 c4 10 add $0x10,%esp 80103972: 85 c0 test %eax,%eax 80103974: 75 b0 jne 80103926 <growproc+0x26> 80103976: eb de jmp 80103956 <growproc+0x56> 80103978: 90 nop 80103979: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103980 <fork>: { 80103980: 55 push %ebp 80103981: 89 e5 mov %esp,%ebp 80103983: 57 push %edi 80103984: 56 push %esi 80103985: 53 push %ebx 80103986: 83 ec 1c sub $0x1c,%esp pushcli(); 80103989: e8 e2 08 00 00 call 80104270 <pushcli> c = mycpu(); 8010398e: e8 ad fd ff ff call 80103740 <mycpu> p = c->proc; 80103993: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103999: e8 12 09 00 00 call 801042b0 <popcli> if((np = allocproc()) == 0){ 8010399e: e8 5d fc ff ff call 80103600 <allocproc> 801039a3: 85 c0 test %eax,%eax 801039a5: 89 45 e4 mov %eax,-0x1c(%ebp) 801039a8: 0f 84 b7 00 00 00 je 80103a65 <fork+0xe5> if((np->pgdir = copyuvm(curproc->pgdir, curproc->sz)) == 0){ 801039ae: 83 ec 08 sub $0x8,%esp 801039b1: ff 33 pushl (%ebx) 801039b3: ff 73 04 pushl 0x4(%ebx) 801039b6: 89 c7 mov %eax,%edi 801039b8: e8 23 33 00 00 call 80106ce0 <copyuvm> 801039bd: 83 c4 10 add $0x10,%esp 801039c0: 85 c0 test %eax,%eax 801039c2: 89 47 04 mov %eax,0x4(%edi) 801039c5: 0f 84 a1 00 00 00 je 80103a6c <fork+0xec> np->sz = curproc->sz; 801039cb: 8b 03 mov (%ebx),%eax 801039cd: 8b 4d e4 mov -0x1c(%ebp),%ecx 801039d0: 89 01 mov %eax,(%ecx) np->parent = curproc; 801039d2: 89 59 14 mov %ebx,0x14(%ecx) 801039d5: 89 c8 mov %ecx,%eax *np->tf = *curproc->tf; 801039d7: 8b 79 18 mov 0x18(%ecx),%edi 801039da: 8b 73 18 mov 0x18(%ebx),%esi 801039dd: b9 13 00 00 00 mov $0x13,%ecx 801039e2: f3 a5 rep movsl %ds:(%esi),%es:(%edi) for(i = 0; i < NOFILE; i++) 801039e4: 31 f6 xor %esi,%esi np->tf->eax = 0; 801039e6: 8b 40 18 mov 0x18(%eax),%eax 801039e9: c7 40 1c 00 00 00 00 movl $0x0,0x1c(%eax) if(curproc->ofile[i]) 801039f0: 8b 44 b3 28 mov 0x28(%ebx,%esi,4),%eax 801039f4: 85 c0 test %eax,%eax 801039f6: 74 13 je 80103a0b <fork+0x8b> np->ofile[i] = filedup(curproc->ofile[i]); 801039f8: 83 ec 0c sub $0xc,%esp 801039fb: 50 push %eax 801039fc: e8 ef d3 ff ff call 80100df0 <filedup> 80103a01: 8b 55 e4 mov -0x1c(%ebp),%edx 80103a04: 83 c4 10 add $0x10,%esp 80103a07: 89 44 b2 28 mov %eax,0x28(%edx,%esi,4) for(i = 0; i < NOFILE; i++) 80103a0b: 83 c6 01 add $0x1,%esi 80103a0e: 83 fe 10 cmp $0x10,%esi 80103a11: 75 dd jne 801039f0 <fork+0x70> np->cwd = idup(curproc->cwd); 80103a13: 83 ec 0c sub $0xc,%esp 80103a16: ff 73 68 pushl 0x68(%ebx) safestrcpy(np->name, curproc->name, sizeof(curproc->name)); 80103a19: 83 c3 6c add $0x6c,%ebx np->cwd = idup(curproc->cwd); 80103a1c: e8 2f dc ff ff call 80101650 <idup> 80103a21: 8b 7d e4 mov -0x1c(%ebp),%edi safestrcpy(np->name, curproc->name, sizeof(curproc->name)); 80103a24: 83 c4 0c add $0xc,%esp np->cwd = idup(curproc->cwd); 80103a27: 89 47 68 mov %eax,0x68(%edi) safestrcpy(np->name, curproc->name, sizeof(curproc->name)); 80103a2a: 8d 47 6c lea 0x6c(%edi),%eax 80103a2d: 6a 10 push $0x10 80103a2f: 53 push %ebx 80103a30: 50 push %eax 80103a31: e8 fa 0b 00 00 call 80104630 <safestrcpy> pid = np->pid; 80103a36: 8b 5f 10 mov 0x10(%edi),%ebx acquire(&ptable.lock); 80103a39: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103a40: e8 fb 08 00 00 call 80104340 <acquire> np->state = RUNNABLE; 80103a45: c7 47 0c 03 00 00 00 movl $0x3,0xc(%edi) release(&ptable.lock); 80103a4c: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103a53: e8 a8 09 00 00 call 80104400 <release> return pid; 80103a58: 83 c4 10 add $0x10,%esp } 80103a5b: 8d 65 f4 lea -0xc(%ebp),%esp 80103a5e: 89 d8 mov %ebx,%eax 80103a60: 5b pop %ebx 80103a61: 5e pop %esi 80103a62: 5f pop %edi 80103a63: 5d pop %ebp 80103a64: c3 ret return -1; 80103a65: bb ff ff ff ff mov $0xffffffff,%ebx 80103a6a: eb ef jmp 80103a5b <fork+0xdb> kfree(np->kstack); 80103a6c: 8b 5d e4 mov -0x1c(%ebp),%ebx 80103a6f: 83 ec 0c sub $0xc,%esp 80103a72: ff 73 08 pushl 0x8(%ebx) 80103a75: e8 96 e8 ff ff call 80102310 <kfree> np->kstack = 0; 80103a7a: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) np->state = UNUSED; 80103a81: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) return -1; 80103a88: 83 c4 10 add $0x10,%esp 80103a8b: bb ff ff ff ff mov $0xffffffff,%ebx 80103a90: eb c9 jmp 80103a5b <fork+0xdb> 80103a92: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103a99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103aa0 <scheduler>: { 80103aa0: 55 push %ebp 80103aa1: 89 e5 mov %esp,%ebp 80103aa3: 57 push %edi 80103aa4: 56 push %esi 80103aa5: 53 push %ebx 80103aa6: 83 ec 0c sub $0xc,%esp struct cpu *c = mycpu(); 80103aa9: e8 92 fc ff ff call 80103740 <mycpu> 80103aae: 8d 78 04 lea 0x4(%eax),%edi 80103ab1: 89 c6 mov %eax,%esi c->proc = 0; 80103ab3: c7 80 ac 00 00 00 00 movl $0x0,0xac(%eax) 80103aba: 00 00 00 80103abd: 8d 76 00 lea 0x0(%esi),%esi asm volatile("sti"); 80103ac0: fb sti acquire(&ptable.lock); 80103ac1: 83 ec 0c sub $0xc,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103ac4: bb 54 2d 11 80 mov $0x80112d54,%ebx acquire(&ptable.lock); 80103ac9: 68 20 2d 11 80 push $0x80112d20 80103ace: e8 6d 08 00 00 call 80104340 <acquire> 80103ad3: 83 c4 10 add $0x10,%esp 80103ad6: 8d 76 00 lea 0x0(%esi),%esi 80103ad9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi if(p->state != RUNNABLE) 80103ae0: 83 7b 0c 03 cmpl $0x3,0xc(%ebx) 80103ae4: 75 33 jne 80103b19 <scheduler+0x79> switchuvm(p); 80103ae6: 83 ec 0c sub $0xc,%esp c->proc = p; 80103ae9: 89 9e ac 00 00 00 mov %ebx,0xac(%esi) switchuvm(p); 80103aef: 53 push %ebx 80103af0: e8 eb 2c 00 00 call 801067e0 <switchuvm> swtch(&(c->scheduler), p->context); 80103af5: 58 pop %eax 80103af6: 5a pop %edx 80103af7: ff 73 1c pushl 0x1c(%ebx) 80103afa: 57 push %edi p->state = RUNNING; 80103afb: c7 43 0c 04 00 00 00 movl $0x4,0xc(%ebx) swtch(&(c->scheduler), p->context); 80103b02: e8 84 0b 00 00 call 8010468b <swtch> switchkvm(); 80103b07: e8 b4 2c 00 00 call 801067c0 <switchkvm> c->proc = 0; 80103b0c: c7 86 ac 00 00 00 00 movl $0x0,0xac(%esi) 80103b13: 00 00 00 80103b16: 83 c4 10 add $0x10,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103b19: 83 c3 7c add $0x7c,%ebx 80103b1c: 81 fb 54 4c 11 80 cmp $0x80114c54,%ebx 80103b22: 72 bc jb 80103ae0 <scheduler+0x40> release(&ptable.lock); 80103b24: 83 ec 0c sub $0xc,%esp 80103b27: 68 20 2d 11 80 push $0x80112d20 80103b2c: e8 cf 08 00 00 call 80104400 <release> sti(); 80103b31: 83 c4 10 add $0x10,%esp 80103b34: eb 8a jmp 80103ac0 <scheduler+0x20> 80103b36: 8d 76 00 lea 0x0(%esi),%esi 80103b39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103b40 <sched>: { 80103b40: 55 push %ebp 80103b41: 89 e5 mov %esp,%ebp 80103b43: 56 push %esi 80103b44: 53 push %ebx pushcli(); 80103b45: e8 26 07 00 00 call 80104270 <pushcli> c = mycpu(); 80103b4a: e8 f1 fb ff ff call 80103740 <mycpu> p = c->proc; 80103b4f: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103b55: e8 56 07 00 00 call 801042b0 <popcli> if(!holding(&ptable.lock)) 80103b5a: 83 ec 0c sub $0xc,%esp 80103b5d: 68 20 2d 11 80 push $0x80112d20 80103b62: e8 a9 07 00 00 call 80104310 <holding> 80103b67: 83 c4 10 add $0x10,%esp 80103b6a: 85 c0 test %eax,%eax 80103b6c: 74 4f je 80103bbd <sched+0x7d> if(mycpu()->ncli != 1) 80103b6e: e8 cd fb ff ff call 80103740 <mycpu> 80103b73: 83 b8 a4 00 00 00 01 cmpl $0x1,0xa4(%eax) 80103b7a: 75 68 jne 80103be4 <sched+0xa4> if(p->state == RUNNING) 80103b7c: 83 7b 0c 04 cmpl $0x4,0xc(%ebx) 80103b80: 74 55 je 80103bd7 <sched+0x97> asm volatile("pushfl; popl %0" : "=r" (eflags)); 80103b82: 9c pushf 80103b83: 58 pop %eax if(readeflags()&FL_IF) 80103b84: f6 c4 02 test $0x2,%ah 80103b87: 75 41 jne 80103bca <sched+0x8a> intena = mycpu()->intena; 80103b89: e8 b2 fb ff ff call 80103740 <mycpu> swtch(&p->context, mycpu()->scheduler); 80103b8e: 83 c3 1c add $0x1c,%ebx intena = mycpu()->intena; 80103b91: 8b b0 a8 00 00 00 mov 0xa8(%eax),%esi swtch(&p->context, mycpu()->scheduler); 80103b97: e8 a4 fb ff ff call 80103740 <mycpu> 80103b9c: 83 ec 08 sub $0x8,%esp 80103b9f: ff 70 04 pushl 0x4(%eax) 80103ba2: 53 push %ebx 80103ba3: e8 e3 0a 00 00 call 8010468b <swtch> mycpu()->intena = intena; 80103ba8: e8 93 fb ff ff call 80103740 <mycpu> } 80103bad: 83 c4 10 add $0x10,%esp mycpu()->intena = intena; 80103bb0: 89 b0 a8 00 00 00 mov %esi,0xa8(%eax) } 80103bb6: 8d 65 f8 lea -0x8(%ebp),%esp 80103bb9: 5b pop %ebx 80103bba: 5e pop %esi 80103bbb: 5d pop %ebp 80103bbc: c3 ret panic("sched ptable.lock"); 80103bbd: 83 ec 0c sub $0xc,%esp 80103bc0: 68 50 74 10 80 push $0x80107450 80103bc5: e8 c6 c7 ff ff call 80100390 <panic> panic("sched interruptible"); 80103bca: 83 ec 0c sub $0xc,%esp 80103bcd: 68 7c 74 10 80 push $0x8010747c 80103bd2: e8 b9 c7 ff ff call 80100390 <panic> panic("sched running"); 80103bd7: 83 ec 0c sub $0xc,%esp 80103bda: 68 6e 74 10 80 push $0x8010746e 80103bdf: e8 ac c7 ff ff call 80100390 <panic> panic("sched locks"); 80103be4: 83 ec 0c sub $0xc,%esp 80103be7: 68 62 74 10 80 push $0x80107462 80103bec: e8 9f c7 ff ff call 80100390 <panic> 80103bf1: eb 0d jmp 80103c00 <exit> 80103bf3: 90 nop 80103bf4: 90 nop 80103bf5: 90 nop 80103bf6: 90 nop 80103bf7: 90 nop 80103bf8: 90 nop 80103bf9: 90 nop 80103bfa: 90 nop 80103bfb: 90 nop 80103bfc: 90 nop 80103bfd: 90 nop 80103bfe: 90 nop 80103bff: 90 nop 80103c00 <exit>: { 80103c00: 55 push %ebp 80103c01: 89 e5 mov %esp,%ebp 80103c03: 57 push %edi 80103c04: 56 push %esi 80103c05: 53 push %ebx 80103c06: 83 ec 0c sub $0xc,%esp pushcli(); 80103c09: e8 62 06 00 00 call 80104270 <pushcli> c = mycpu(); 80103c0e: e8 2d fb ff ff call 80103740 <mycpu> p = c->proc; 80103c13: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi popcli(); 80103c19: e8 92 06 00 00 call 801042b0 <popcli> if(curproc == initproc) 80103c1e: 39 35 b8 a5 10 80 cmp %esi,0x8010a5b8 80103c24: 8d 5e 28 lea 0x28(%esi),%ebx 80103c27: 8d 7e 68 lea 0x68(%esi),%edi 80103c2a: 0f 84 e7 00 00 00 je 80103d17 <exit+0x117> if(curproc->ofile[fd]){ 80103c30: 8b 03 mov (%ebx),%eax 80103c32: 85 c0 test %eax,%eax 80103c34: 74 12 je 80103c48 <exit+0x48> fileclose(curproc->ofile[fd]); 80103c36: 83 ec 0c sub $0xc,%esp 80103c39: 50 push %eax 80103c3a: e8 01 d2 ff ff call 80100e40 <fileclose> curproc->ofile[fd] = 0; 80103c3f: c7 03 00 00 00 00 movl $0x0,(%ebx) 80103c45: 83 c4 10 add $0x10,%esp 80103c48: 83 c3 04 add $0x4,%ebx for(fd = 0; fd < NOFILE; fd++){ 80103c4b: 39 fb cmp %edi,%ebx 80103c4d: 75 e1 jne 80103c30 <exit+0x30> begin_op(); 80103c4f: e8 4c ef ff ff call 80102ba0 <begin_op> iput(curproc->cwd); 80103c54: 83 ec 0c sub $0xc,%esp 80103c57: ff 76 68 pushl 0x68(%esi) 80103c5a: e8 51 db ff ff call 801017b0 <iput> end_op(); 80103c5f: e8 ac ef ff ff call 80102c10 <end_op> curproc->cwd = 0; 80103c64: c7 46 68 00 00 00 00 movl $0x0,0x68(%esi) acquire(&ptable.lock); 80103c6b: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103c72: e8 c9 06 00 00 call 80104340 <acquire> wakeup1(curproc->parent); 80103c77: 8b 56 14 mov 0x14(%esi),%edx 80103c7a: 83 c4 10 add $0x10,%esp static void wakeup1(void *chan) { struct proc *p; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103c7d: b8 54 2d 11 80 mov $0x80112d54,%eax 80103c82: eb 0e jmp 80103c92 <exit+0x92> 80103c84: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103c88: 83 c0 7c add $0x7c,%eax 80103c8b: 3d 54 4c 11 80 cmp $0x80114c54,%eax 80103c90: 73 1c jae 80103cae <exit+0xae> if(p->state == SLEEPING && p->chan == chan) 80103c92: 83 78 0c 02 cmpl $0x2,0xc(%eax) 80103c96: 75 f0 jne 80103c88 <exit+0x88> 80103c98: 3b 50 20 cmp 0x20(%eax),%edx 80103c9b: 75 eb jne 80103c88 <exit+0x88> p->state = RUNNABLE; 80103c9d: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103ca4: 83 c0 7c add $0x7c,%eax 80103ca7: 3d 54 4c 11 80 cmp $0x80114c54,%eax 80103cac: 72 e4 jb 80103c92 <exit+0x92> p->parent = initproc; 80103cae: 8b 0d b8 a5 10 80 mov 0x8010a5b8,%ecx for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103cb4: ba 54 2d 11 80 mov $0x80112d54,%edx 80103cb9: eb 10 jmp 80103ccb <exit+0xcb> 80103cbb: 90 nop 80103cbc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103cc0: 83 c2 7c add $0x7c,%edx 80103cc3: 81 fa 54 4c 11 80 cmp $0x80114c54,%edx 80103cc9: 73 33 jae 80103cfe <exit+0xfe> if(p->parent == curproc){ 80103ccb: 39 72 14 cmp %esi,0x14(%edx) 80103cce: 75 f0 jne 80103cc0 <exit+0xc0> if(p->state == ZOMBIE) 80103cd0: 83 7a 0c 05 cmpl $0x5,0xc(%edx) p->parent = initproc; 80103cd4: 89 4a 14 mov %ecx,0x14(%edx) if(p->state == ZOMBIE) 80103cd7: 75 e7 jne 80103cc0 <exit+0xc0> for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103cd9: b8 54 2d 11 80 mov $0x80112d54,%eax 80103cde: eb 0a jmp 80103cea <exit+0xea> 80103ce0: 83 c0 7c add $0x7c,%eax 80103ce3: 3d 54 4c 11 80 cmp $0x80114c54,%eax 80103ce8: 73 d6 jae 80103cc0 <exit+0xc0> if(p->state == SLEEPING && p->chan == chan) 80103cea: 83 78 0c 02 cmpl $0x2,0xc(%eax) 80103cee: 75 f0 jne 80103ce0 <exit+0xe0> 80103cf0: 3b 48 20 cmp 0x20(%eax),%ecx 80103cf3: 75 eb jne 80103ce0 <exit+0xe0> p->state = RUNNABLE; 80103cf5: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) 80103cfc: eb e2 jmp 80103ce0 <exit+0xe0> curproc->state = ZOMBIE; 80103cfe: c7 46 0c 05 00 00 00 movl $0x5,0xc(%esi) sched(); 80103d05: e8 36 fe ff ff call 80103b40 <sched> panic("zombie exit"); 80103d0a: 83 ec 0c sub $0xc,%esp 80103d0d: 68 9d 74 10 80 push $0x8010749d 80103d12: e8 79 c6 ff ff call 80100390 <panic> panic("init exiting"); 80103d17: 83 ec 0c sub $0xc,%esp 80103d1a: 68 90 74 10 80 push $0x80107490 80103d1f: e8 6c c6 ff ff call 80100390 <panic> 80103d24: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80103d2a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80103d30 <yield>: { 80103d30: 55 push %ebp 80103d31: 89 e5 mov %esp,%ebp 80103d33: 53 push %ebx 80103d34: 83 ec 10 sub $0x10,%esp acquire(&ptable.lock); //DOC: yieldlock 80103d37: 68 20 2d 11 80 push $0x80112d20 80103d3c: e8 ff 05 00 00 call 80104340 <acquire> pushcli(); 80103d41: e8 2a 05 00 00 call 80104270 <pushcli> c = mycpu(); 80103d46: e8 f5 f9 ff ff call 80103740 <mycpu> p = c->proc; 80103d4b: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103d51: e8 5a 05 00 00 call 801042b0 <popcli> myproc()->state = RUNNABLE; 80103d56: c7 43 0c 03 00 00 00 movl $0x3,0xc(%ebx) sched(); 80103d5d: e8 de fd ff ff call 80103b40 <sched> release(&ptable.lock); 80103d62: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103d69: e8 92 06 00 00 call 80104400 <release> } 80103d6e: 83 c4 10 add $0x10,%esp 80103d71: 8b 5d fc mov -0x4(%ebp),%ebx 80103d74: c9 leave 80103d75: c3 ret 80103d76: 8d 76 00 lea 0x0(%esi),%esi 80103d79: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103d80 <sleep>: { 80103d80: 55 push %ebp 80103d81: 89 e5 mov %esp,%ebp 80103d83: 57 push %edi 80103d84: 56 push %esi 80103d85: 53 push %ebx 80103d86: 83 ec 0c sub $0xc,%esp 80103d89: 8b 7d 08 mov 0x8(%ebp),%edi 80103d8c: 8b 75 0c mov 0xc(%ebp),%esi pushcli(); 80103d8f: e8 dc 04 00 00 call 80104270 <pushcli> c = mycpu(); 80103d94: e8 a7 f9 ff ff call 80103740 <mycpu> p = c->proc; 80103d99: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103d9f: e8 0c 05 00 00 call 801042b0 <popcli> if(p == 0) 80103da4: 85 db test %ebx,%ebx 80103da6: 0f 84 87 00 00 00 je 80103e33 <sleep+0xb3> if(lk == 0) 80103dac: 85 f6 test %esi,%esi 80103dae: 74 76 je 80103e26 <sleep+0xa6> if(lk != &ptable.lock){ //DOC: sleeplock0 80103db0: 81 fe 20 2d 11 80 cmp $0x80112d20,%esi 80103db6: 74 50 je 80103e08 <sleep+0x88> acquire(&ptable.lock); //DOC: sleeplock1 80103db8: 83 ec 0c sub $0xc,%esp 80103dbb: 68 20 2d 11 80 push $0x80112d20 80103dc0: e8 7b 05 00 00 call 80104340 <acquire> release(lk); 80103dc5: 89 34 24 mov %esi,(%esp) 80103dc8: e8 33 06 00 00 call 80104400 <release> p->chan = chan; 80103dcd: 89 7b 20 mov %edi,0x20(%ebx) p->state = SLEEPING; 80103dd0: c7 43 0c 02 00 00 00 movl $0x2,0xc(%ebx) sched(); 80103dd7: e8 64 fd ff ff call 80103b40 <sched> p->chan = 0; 80103ddc: c7 43 20 00 00 00 00 movl $0x0,0x20(%ebx) release(&ptable.lock); 80103de3: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103dea: e8 11 06 00 00 call 80104400 <release> acquire(lk); 80103def: 89 75 08 mov %esi,0x8(%ebp) 80103df2: 83 c4 10 add $0x10,%esp } 80103df5: 8d 65 f4 lea -0xc(%ebp),%esp 80103df8: 5b pop %ebx 80103df9: 5e pop %esi 80103dfa: 5f pop %edi 80103dfb: 5d pop %ebp acquire(lk); 80103dfc: e9 3f 05 00 00 jmp 80104340 <acquire> 80103e01: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi p->chan = chan; 80103e08: 89 7b 20 mov %edi,0x20(%ebx) p->state = SLEEPING; 80103e0b: c7 43 0c 02 00 00 00 movl $0x2,0xc(%ebx) sched(); 80103e12: e8 29 fd ff ff call 80103b40 <sched> p->chan = 0; 80103e17: c7 43 20 00 00 00 00 movl $0x0,0x20(%ebx) } 80103e1e: 8d 65 f4 lea -0xc(%ebp),%esp 80103e21: 5b pop %ebx 80103e22: 5e pop %esi 80103e23: 5f pop %edi 80103e24: 5d pop %ebp 80103e25: c3 ret panic("sleep without lk"); 80103e26: 83 ec 0c sub $0xc,%esp 80103e29: 68 af 74 10 80 push $0x801074af 80103e2e: e8 5d c5 ff ff call 80100390 <panic> panic("sleep"); 80103e33: 83 ec 0c sub $0xc,%esp 80103e36: 68 a9 74 10 80 push $0x801074a9 80103e3b: e8 50 c5 ff ff call 80100390 <panic> 80103e40 <wait>: { 80103e40: 55 push %ebp 80103e41: 89 e5 mov %esp,%ebp 80103e43: 56 push %esi 80103e44: 53 push %ebx pushcli(); 80103e45: e8 26 04 00 00 call 80104270 <pushcli> c = mycpu(); 80103e4a: e8 f1 f8 ff ff call 80103740 <mycpu> p = c->proc; 80103e4f: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi popcli(); 80103e55: e8 56 04 00 00 call 801042b0 <popcli> acquire(&ptable.lock); 80103e5a: 83 ec 0c sub $0xc,%esp 80103e5d: 68 20 2d 11 80 push $0x80112d20 80103e62: e8 d9 04 00 00 call 80104340 <acquire> 80103e67: 83 c4 10 add $0x10,%esp havekids = 0; 80103e6a: 31 c0 xor %eax,%eax for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103e6c: bb 54 2d 11 80 mov $0x80112d54,%ebx 80103e71: eb 10 jmp 80103e83 <wait+0x43> 80103e73: 90 nop 80103e74: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103e78: 83 c3 7c add $0x7c,%ebx 80103e7b: 81 fb 54 4c 11 80 cmp $0x80114c54,%ebx 80103e81: 73 1b jae 80103e9e <wait+0x5e> if(p->parent != curproc) 80103e83: 39 73 14 cmp %esi,0x14(%ebx) 80103e86: 75 f0 jne 80103e78 <wait+0x38> if(p->state == ZOMBIE){ 80103e88: 83 7b 0c 05 cmpl $0x5,0xc(%ebx) 80103e8c: 74 32 je 80103ec0 <wait+0x80> for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103e8e: 83 c3 7c add $0x7c,%ebx havekids = 1; 80103e91: b8 01 00 00 00 mov $0x1,%eax for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103e96: 81 fb 54 4c 11 80 cmp $0x80114c54,%ebx 80103e9c: 72 e5 jb 80103e83 <wait+0x43> if(!havekids || curproc->killed){ 80103e9e: 85 c0 test %eax,%eax 80103ea0: 74 74 je 80103f16 <wait+0xd6> 80103ea2: 8b 46 24 mov 0x24(%esi),%eax 80103ea5: 85 c0 test %eax,%eax 80103ea7: 75 6d jne 80103f16 <wait+0xd6> sleep(curproc, &ptable.lock); //DOC: wait-sleep 80103ea9: 83 ec 08 sub $0x8,%esp 80103eac: 68 20 2d 11 80 push $0x80112d20 80103eb1: 56 push %esi 80103eb2: e8 c9 fe ff ff call 80103d80 <sleep> havekids = 0; 80103eb7: 83 c4 10 add $0x10,%esp 80103eba: eb ae jmp 80103e6a <wait+0x2a> 80103ebc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi kfree(p->kstack); 80103ec0: 83 ec 0c sub $0xc,%esp 80103ec3: ff 73 08 pushl 0x8(%ebx) pid = p->pid; 80103ec6: 8b 73 10 mov 0x10(%ebx),%esi kfree(p->kstack); 80103ec9: e8 42 e4 ff ff call 80102310 <kfree> freevm(p->pgdir); 80103ece: 5a pop %edx 80103ecf: ff 73 04 pushl 0x4(%ebx) p->kstack = 0; 80103ed2: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) freevm(p->pgdir); 80103ed9: e8 b2 2c 00 00 call 80106b90 <freevm> release(&ptable.lock); 80103ede: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) p->pid = 0; 80103ee5: c7 43 10 00 00 00 00 movl $0x0,0x10(%ebx) p->parent = 0; 80103eec: c7 43 14 00 00 00 00 movl $0x0,0x14(%ebx) p->name[0] = 0; 80103ef3: c6 43 6c 00 movb $0x0,0x6c(%ebx) p->killed = 0; 80103ef7: c7 43 24 00 00 00 00 movl $0x0,0x24(%ebx) p->state = UNUSED; 80103efe: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) release(&ptable.lock); 80103f05: e8 f6 04 00 00 call 80104400 <release> return pid; 80103f0a: 83 c4 10 add $0x10,%esp } 80103f0d: 8d 65 f8 lea -0x8(%ebp),%esp 80103f10: 89 f0 mov %esi,%eax 80103f12: 5b pop %ebx 80103f13: 5e pop %esi 80103f14: 5d pop %ebp 80103f15: c3 ret release(&ptable.lock); 80103f16: 83 ec 0c sub $0xc,%esp return -1; 80103f19: be ff ff ff ff mov $0xffffffff,%esi release(&ptable.lock); 80103f1e: 68 20 2d 11 80 push $0x80112d20 80103f23: e8 d8 04 00 00 call 80104400 <release> return -1; 80103f28: 83 c4 10 add $0x10,%esp 80103f2b: eb e0 jmp 80103f0d <wait+0xcd> 80103f2d: 8d 76 00 lea 0x0(%esi),%esi 80103f30 <wakeup>: } // Wake up all processes sleeping on chan. void wakeup(void *chan) { 80103f30: 55 push %ebp 80103f31: 89 e5 mov %esp,%ebp 80103f33: 53 push %ebx 80103f34: 83 ec 10 sub $0x10,%esp 80103f37: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&ptable.lock); 80103f3a: 68 20 2d 11 80 push $0x80112d20 80103f3f: e8 fc 03 00 00 call 80104340 <acquire> 80103f44: 83 c4 10 add $0x10,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103f47: b8 54 2d 11 80 mov $0x80112d54,%eax 80103f4c: eb 0c jmp 80103f5a <wakeup+0x2a> 80103f4e: 66 90 xchg %ax,%ax 80103f50: 83 c0 7c add $0x7c,%eax 80103f53: 3d 54 4c 11 80 cmp $0x80114c54,%eax 80103f58: 73 1c jae 80103f76 <wakeup+0x46> if(p->state == SLEEPING && p->chan == chan) 80103f5a: 83 78 0c 02 cmpl $0x2,0xc(%eax) 80103f5e: 75 f0 jne 80103f50 <wakeup+0x20> 80103f60: 3b 58 20 cmp 0x20(%eax),%ebx 80103f63: 75 eb jne 80103f50 <wakeup+0x20> p->state = RUNNABLE; 80103f65: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103f6c: 83 c0 7c add $0x7c,%eax 80103f6f: 3d 54 4c 11 80 cmp $0x80114c54,%eax 80103f74: 72 e4 jb 80103f5a <wakeup+0x2a> wakeup1(chan); release(&ptable.lock); 80103f76: c7 45 08 20 2d 11 80 movl $0x80112d20,0x8(%ebp) } 80103f7d: 8b 5d fc mov -0x4(%ebp),%ebx 80103f80: c9 leave release(&ptable.lock); 80103f81: e9 7a 04 00 00 jmp 80104400 <release> 80103f86: 8d 76 00 lea 0x0(%esi),%esi 80103f89: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103f90 <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) { 80103f90: 55 push %ebp 80103f91: 89 e5 mov %esp,%ebp 80103f93: 53 push %ebx 80103f94: 83 ec 10 sub $0x10,%esp 80103f97: 8b 5d 08 mov 0x8(%ebp),%ebx struct proc *p; acquire(&ptable.lock); 80103f9a: 68 20 2d 11 80 push $0x80112d20 80103f9f: e8 9c 03 00 00 call 80104340 <acquire> 80103fa4: 83 c4 10 add $0x10,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103fa7: b8 54 2d 11 80 mov $0x80112d54,%eax 80103fac: eb 0c jmp 80103fba <kill+0x2a> 80103fae: 66 90 xchg %ax,%ax 80103fb0: 83 c0 7c add $0x7c,%eax 80103fb3: 3d 54 4c 11 80 cmp $0x80114c54,%eax 80103fb8: 73 36 jae 80103ff0 <kill+0x60> if(p->pid == pid){ 80103fba: 39 58 10 cmp %ebx,0x10(%eax) 80103fbd: 75 f1 jne 80103fb0 <kill+0x20> p->killed = 1; // Wake process from sleep if necessary. if(p->state == SLEEPING) 80103fbf: 83 78 0c 02 cmpl $0x2,0xc(%eax) p->killed = 1; 80103fc3: c7 40 24 01 00 00 00 movl $0x1,0x24(%eax) if(p->state == SLEEPING) 80103fca: 75 07 jne 80103fd3 <kill+0x43> p->state = RUNNABLE; 80103fcc: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) release(&ptable.lock); 80103fd3: 83 ec 0c sub $0xc,%esp 80103fd6: 68 20 2d 11 80 push $0x80112d20 80103fdb: e8 20 04 00 00 call 80104400 <release> return 0; 80103fe0: 83 c4 10 add $0x10,%esp 80103fe3: 31 c0 xor %eax,%eax } } release(&ptable.lock); return -1; } 80103fe5: 8b 5d fc mov -0x4(%ebp),%ebx 80103fe8: c9 leave 80103fe9: c3 ret 80103fea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi release(&ptable.lock); 80103ff0: 83 ec 0c sub $0xc,%esp 80103ff3: 68 20 2d 11 80 push $0x80112d20 80103ff8: e8 03 04 00 00 call 80104400 <release> return -1; 80103ffd: 83 c4 10 add $0x10,%esp 80104000: b8 ff ff ff ff mov $0xffffffff,%eax } 80104005: 8b 5d fc mov -0x4(%ebp),%ebx 80104008: c9 leave 80104009: c3 ret 8010400a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104010 <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) { 80104010: 55 push %ebp 80104011: 89 e5 mov %esp,%ebp 80104013: 57 push %edi 80104014: 56 push %esi 80104015: 53 push %ebx 80104016: 8d 75 e8 lea -0x18(%ebp),%esi int i; struct proc *p; char *state; uint pc[10]; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80104019: bb 54 2d 11 80 mov $0x80112d54,%ebx { 8010401e: 83 ec 3c sub $0x3c,%esp 80104021: eb 24 jmp 80104047 <procdump+0x37> 80104023: 90 nop 80104024: 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"); 80104028: 83 ec 0c sub $0xc,%esp 8010402b: 68 37 78 10 80 push $0x80107837 80104030: e8 2b c6 ff ff call 80100660 <cprintf> 80104035: 83 c4 10 add $0x10,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80104038: 83 c3 7c add $0x7c,%ebx 8010403b: 81 fb 54 4c 11 80 cmp $0x80114c54,%ebx 80104041: 0f 83 81 00 00 00 jae 801040c8 <procdump+0xb8> if(p->state == UNUSED) 80104047: 8b 43 0c mov 0xc(%ebx),%eax 8010404a: 85 c0 test %eax,%eax 8010404c: 74 ea je 80104038 <procdump+0x28> if(p->state >= 0 && p->state < NELEM(states) && states[p->state]) 8010404e: 83 f8 05 cmp $0x5,%eax state = "???"; 80104051: ba c0 74 10 80 mov $0x801074c0,%edx if(p->state >= 0 && p->state < NELEM(states) && states[p->state]) 80104056: 77 11 ja 80104069 <procdump+0x59> 80104058: 8b 14 85 20 75 10 80 mov -0x7fef8ae0(,%eax,4),%edx state = "???"; 8010405f: b8 c0 74 10 80 mov $0x801074c0,%eax 80104064: 85 d2 test %edx,%edx 80104066: 0f 44 d0 cmove %eax,%edx cprintf("%d %s %s", p->pid, state, p->name); 80104069: 8d 43 6c lea 0x6c(%ebx),%eax 8010406c: 50 push %eax 8010406d: 52 push %edx 8010406e: ff 73 10 pushl 0x10(%ebx) 80104071: 68 c4 74 10 80 push $0x801074c4 80104076: e8 e5 c5 ff ff call 80100660 <cprintf> if(p->state == SLEEPING){ 8010407b: 83 c4 10 add $0x10,%esp 8010407e: 83 7b 0c 02 cmpl $0x2,0xc(%ebx) 80104082: 75 a4 jne 80104028 <procdump+0x18> getcallerpcs((uint*)p->context->ebp+2, pc); 80104084: 8d 45 c0 lea -0x40(%ebp),%eax 80104087: 83 ec 08 sub $0x8,%esp 8010408a: 8d 7d c0 lea -0x40(%ebp),%edi 8010408d: 50 push %eax 8010408e: 8b 43 1c mov 0x1c(%ebx),%eax 80104091: 8b 40 0c mov 0xc(%eax),%eax 80104094: 83 c0 08 add $0x8,%eax 80104097: 50 push %eax 80104098: e8 83 01 00 00 call 80104220 <getcallerpcs> 8010409d: 83 c4 10 add $0x10,%esp for(i=0; i<10 && pc[i] != 0; i++) 801040a0: 8b 17 mov (%edi),%edx 801040a2: 85 d2 test %edx,%edx 801040a4: 74 82 je 80104028 <procdump+0x18> cprintf(" %p", pc[i]); 801040a6: 83 ec 08 sub $0x8,%esp 801040a9: 83 c7 04 add $0x4,%edi 801040ac: 52 push %edx 801040ad: 68 01 6f 10 80 push $0x80106f01 801040b2: e8 a9 c5 ff ff call 80100660 <cprintf> for(i=0; i<10 && pc[i] != 0; i++) 801040b7: 83 c4 10 add $0x10,%esp 801040ba: 39 fe cmp %edi,%esi 801040bc: 75 e2 jne 801040a0 <procdump+0x90> 801040be: e9 65 ff ff ff jmp 80104028 <procdump+0x18> 801040c3: 90 nop 801040c4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi } } 801040c8: 8d 65 f4 lea -0xc(%ebp),%esp 801040cb: 5b pop %ebx 801040cc: 5e pop %esi 801040cd: 5f pop %edi 801040ce: 5d pop %ebp 801040cf: c3 ret 801040d0 <initsleeplock>: #include "spinlock.h" #include "sleeplock.h" void initsleeplock(struct sleeplock *lk, char *name) { 801040d0: 55 push %ebp 801040d1: 89 e5 mov %esp,%ebp 801040d3: 53 push %ebx 801040d4: 83 ec 0c sub $0xc,%esp 801040d7: 8b 5d 08 mov 0x8(%ebp),%ebx initlock(&lk->lk, "sleep lock"); 801040da: 68 38 75 10 80 push $0x80107538 801040df: 8d 43 04 lea 0x4(%ebx),%eax 801040e2: 50 push %eax 801040e3: e8 18 01 00 00 call 80104200 <initlock> lk->name = name; 801040e8: 8b 45 0c mov 0xc(%ebp),%eax lk->locked = 0; 801040eb: c7 03 00 00 00 00 movl $0x0,(%ebx) lk->pid = 0; } 801040f1: 83 c4 10 add $0x10,%esp lk->pid = 0; 801040f4: c7 43 3c 00 00 00 00 movl $0x0,0x3c(%ebx) lk->name = name; 801040fb: 89 43 38 mov %eax,0x38(%ebx) } 801040fe: 8b 5d fc mov -0x4(%ebp),%ebx 80104101: c9 leave 80104102: c3 ret 80104103: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104109: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104110 <acquiresleep>: void acquiresleep(struct sleeplock *lk) { 80104110: 55 push %ebp 80104111: 89 e5 mov %esp,%ebp 80104113: 56 push %esi 80104114: 53 push %ebx 80104115: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&lk->lk); 80104118: 83 ec 0c sub $0xc,%esp 8010411b: 8d 73 04 lea 0x4(%ebx),%esi 8010411e: 56 push %esi 8010411f: e8 1c 02 00 00 call 80104340 <acquire> while (lk->locked) { 80104124: 8b 13 mov (%ebx),%edx 80104126: 83 c4 10 add $0x10,%esp 80104129: 85 d2 test %edx,%edx 8010412b: 74 16 je 80104143 <acquiresleep+0x33> 8010412d: 8d 76 00 lea 0x0(%esi),%esi sleep(lk, &lk->lk); 80104130: 83 ec 08 sub $0x8,%esp 80104133: 56 push %esi 80104134: 53 push %ebx 80104135: e8 46 fc ff ff call 80103d80 <sleep> while (lk->locked) { 8010413a: 8b 03 mov (%ebx),%eax 8010413c: 83 c4 10 add $0x10,%esp 8010413f: 85 c0 test %eax,%eax 80104141: 75 ed jne 80104130 <acquiresleep+0x20> } lk->locked = 1; 80104143: c7 03 01 00 00 00 movl $0x1,(%ebx) lk->pid = myproc()->pid; 80104149: e8 92 f6 ff ff call 801037e0 <myproc> 8010414e: 8b 40 10 mov 0x10(%eax),%eax 80104151: 89 43 3c mov %eax,0x3c(%ebx) release(&lk->lk); 80104154: 89 75 08 mov %esi,0x8(%ebp) } 80104157: 8d 65 f8 lea -0x8(%ebp),%esp 8010415a: 5b pop %ebx 8010415b: 5e pop %esi 8010415c: 5d pop %ebp release(&lk->lk); 8010415d: e9 9e 02 00 00 jmp 80104400 <release> 80104162: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104169: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104170 <releasesleep>: void releasesleep(struct sleeplock *lk) { 80104170: 55 push %ebp 80104171: 89 e5 mov %esp,%ebp 80104173: 56 push %esi 80104174: 53 push %ebx 80104175: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&lk->lk); 80104178: 83 ec 0c sub $0xc,%esp 8010417b: 8d 73 04 lea 0x4(%ebx),%esi 8010417e: 56 push %esi 8010417f: e8 bc 01 00 00 call 80104340 <acquire> lk->locked = 0; 80104184: c7 03 00 00 00 00 movl $0x0,(%ebx) lk->pid = 0; 8010418a: c7 43 3c 00 00 00 00 movl $0x0,0x3c(%ebx) wakeup(lk); 80104191: 89 1c 24 mov %ebx,(%esp) 80104194: e8 97 fd ff ff call 80103f30 <wakeup> release(&lk->lk); 80104199: 89 75 08 mov %esi,0x8(%ebp) 8010419c: 83 c4 10 add $0x10,%esp } 8010419f: 8d 65 f8 lea -0x8(%ebp),%esp 801041a2: 5b pop %ebx 801041a3: 5e pop %esi 801041a4: 5d pop %ebp release(&lk->lk); 801041a5: e9 56 02 00 00 jmp 80104400 <release> 801041aa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801041b0 <holdingsleep>: int holdingsleep(struct sleeplock *lk) { 801041b0: 55 push %ebp 801041b1: 89 e5 mov %esp,%ebp 801041b3: 57 push %edi 801041b4: 56 push %esi 801041b5: 53 push %ebx 801041b6: 31 ff xor %edi,%edi 801041b8: 83 ec 18 sub $0x18,%esp 801041bb: 8b 5d 08 mov 0x8(%ebp),%ebx int r; acquire(&lk->lk); 801041be: 8d 73 04 lea 0x4(%ebx),%esi 801041c1: 56 push %esi 801041c2: e8 79 01 00 00 call 80104340 <acquire> r = lk->locked && (lk->pid == myproc()->pid); 801041c7: 8b 03 mov (%ebx),%eax 801041c9: 83 c4 10 add $0x10,%esp 801041cc: 85 c0 test %eax,%eax 801041ce: 74 13 je 801041e3 <holdingsleep+0x33> 801041d0: 8b 5b 3c mov 0x3c(%ebx),%ebx 801041d3: e8 08 f6 ff ff call 801037e0 <myproc> 801041d8: 39 58 10 cmp %ebx,0x10(%eax) 801041db: 0f 94 c0 sete %al 801041de: 0f b6 c0 movzbl %al,%eax 801041e1: 89 c7 mov %eax,%edi release(&lk->lk); 801041e3: 83 ec 0c sub $0xc,%esp 801041e6: 56 push %esi 801041e7: e8 14 02 00 00 call 80104400 <release> return r; } 801041ec: 8d 65 f4 lea -0xc(%ebp),%esp 801041ef: 89 f8 mov %edi,%eax 801041f1: 5b pop %ebx 801041f2: 5e pop %esi 801041f3: 5f pop %edi 801041f4: 5d pop %ebp 801041f5: c3 ret 801041f6: 66 90 xchg %ax,%ax 801041f8: 66 90 xchg %ax,%ax 801041fa: 66 90 xchg %ax,%ax 801041fc: 66 90 xchg %ax,%ax 801041fe: 66 90 xchg %ax,%ax 80104200 <initlock>: #include "proc.h" #include "spinlock.h" void initlock(struct spinlock *lk, char *name) { 80104200: 55 push %ebp 80104201: 89 e5 mov %esp,%ebp 80104203: 8b 45 08 mov 0x8(%ebp),%eax lk->name = name; 80104206: 8b 55 0c mov 0xc(%ebp),%edx lk->locked = 0; 80104209: c7 00 00 00 00 00 movl $0x0,(%eax) lk->name = name; 8010420f: 89 50 04 mov %edx,0x4(%eax) lk->cpu = 0; 80104212: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax) } 80104219: 5d pop %ebp 8010421a: c3 ret 8010421b: 90 nop 8010421c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104220 <getcallerpcs>: } // Record the current call stack in pcs[] by following the %ebp chain. void getcallerpcs(void *v, uint pcs[]) { 80104220: 55 push %ebp uint *ebp; int i; ebp = (uint*)v - 2; for(i = 0; i < 10; i++){ 80104221: 31 d2 xor %edx,%edx { 80104223: 89 e5 mov %esp,%ebp 80104225: 53 push %ebx ebp = (uint*)v - 2; 80104226: 8b 45 08 mov 0x8(%ebp),%eax { 80104229: 8b 4d 0c mov 0xc(%ebp),%ecx ebp = (uint*)v - 2; 8010422c: 83 e8 08 sub $0x8,%eax 8010422f: 90 nop if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff) 80104230: 8d 98 00 00 00 80 lea -0x80000000(%eax),%ebx 80104236: 81 fb fe ff ff 7f cmp $0x7ffffffe,%ebx 8010423c: 77 1a ja 80104258 <getcallerpcs+0x38> break; pcs[i] = ebp[1]; // saved %eip 8010423e: 8b 58 04 mov 0x4(%eax),%ebx 80104241: 89 1c 91 mov %ebx,(%ecx,%edx,4) for(i = 0; i < 10; i++){ 80104244: 83 c2 01 add $0x1,%edx ebp = (uint*)ebp[0]; // saved %ebp 80104247: 8b 00 mov (%eax),%eax for(i = 0; i < 10; i++){ 80104249: 83 fa 0a cmp $0xa,%edx 8010424c: 75 e2 jne 80104230 <getcallerpcs+0x10> } for(; i < 10; i++) pcs[i] = 0; } 8010424e: 5b pop %ebx 8010424f: 5d pop %ebp 80104250: c3 ret 80104251: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104258: 8d 04 91 lea (%ecx,%edx,4),%eax 8010425b: 83 c1 28 add $0x28,%ecx 8010425e: 66 90 xchg %ax,%ax pcs[i] = 0; 80104260: c7 00 00 00 00 00 movl $0x0,(%eax) 80104266: 83 c0 04 add $0x4,%eax for(; i < 10; i++) 80104269: 39 c1 cmp %eax,%ecx 8010426b: 75 f3 jne 80104260 <getcallerpcs+0x40> } 8010426d: 5b pop %ebx 8010426e: 5d pop %ebp 8010426f: c3 ret 80104270 <pushcli>: // it takes two popcli to undo two pushcli. Also, if interrupts // are off, then pushcli, popcli leaves them off. void pushcli(void) { 80104270: 55 push %ebp 80104271: 89 e5 mov %esp,%ebp 80104273: 53 push %ebx 80104274: 83 ec 04 sub $0x4,%esp 80104277: 9c pushf 80104278: 5b pop %ebx asm volatile("cli"); 80104279: fa cli int eflags; eflags = readeflags(); cli(); if(mycpu()->ncli == 0) 8010427a: e8 c1 f4 ff ff call 80103740 <mycpu> 8010427f: 8b 80 a4 00 00 00 mov 0xa4(%eax),%eax 80104285: 85 c0 test %eax,%eax 80104287: 75 11 jne 8010429a <pushcli+0x2a> mycpu()->intena = eflags & FL_IF; 80104289: 81 e3 00 02 00 00 and $0x200,%ebx 8010428f: e8 ac f4 ff ff call 80103740 <mycpu> 80104294: 89 98 a8 00 00 00 mov %ebx,0xa8(%eax) mycpu()->ncli += 1; 8010429a: e8 a1 f4 ff ff call 80103740 <mycpu> 8010429f: 83 80 a4 00 00 00 01 addl $0x1,0xa4(%eax) } 801042a6: 83 c4 04 add $0x4,%esp 801042a9: 5b pop %ebx 801042aa: 5d pop %ebp 801042ab: c3 ret 801042ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801042b0 <popcli>: void popcli(void) { 801042b0: 55 push %ebp 801042b1: 89 e5 mov %esp,%ebp 801042b3: 83 ec 08 sub $0x8,%esp asm volatile("pushfl; popl %0" : "=r" (eflags)); 801042b6: 9c pushf 801042b7: 58 pop %eax if(readeflags()&FL_IF) 801042b8: f6 c4 02 test $0x2,%ah 801042bb: 75 35 jne 801042f2 <popcli+0x42> panic("popcli - interruptible"); if(--mycpu()->ncli < 0) 801042bd: e8 7e f4 ff ff call 80103740 <mycpu> 801042c2: 83 a8 a4 00 00 00 01 subl $0x1,0xa4(%eax) 801042c9: 78 34 js 801042ff <popcli+0x4f> panic("popcli"); if(mycpu()->ncli == 0 && mycpu()->intena) 801042cb: e8 70 f4 ff ff call 80103740 <mycpu> 801042d0: 8b 90 a4 00 00 00 mov 0xa4(%eax),%edx 801042d6: 85 d2 test %edx,%edx 801042d8: 74 06 je 801042e0 <popcli+0x30> sti(); } 801042da: c9 leave 801042db: c3 ret 801042dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(mycpu()->ncli == 0 && mycpu()->intena) 801042e0: e8 5b f4 ff ff call 80103740 <mycpu> 801042e5: 8b 80 a8 00 00 00 mov 0xa8(%eax),%eax 801042eb: 85 c0 test %eax,%eax 801042ed: 74 eb je 801042da <popcli+0x2a> asm volatile("sti"); 801042ef: fb sti } 801042f0: c9 leave 801042f1: c3 ret panic("popcli - interruptible"); 801042f2: 83 ec 0c sub $0xc,%esp 801042f5: 68 43 75 10 80 push $0x80107543 801042fa: e8 91 c0 ff ff call 80100390 <panic> panic("popcli"); 801042ff: 83 ec 0c sub $0xc,%esp 80104302: 68 5a 75 10 80 push $0x8010755a 80104307: e8 84 c0 ff ff call 80100390 <panic> 8010430c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104310 <holding>: { 80104310: 55 push %ebp 80104311: 89 e5 mov %esp,%ebp 80104313: 56 push %esi 80104314: 53 push %ebx 80104315: 8b 75 08 mov 0x8(%ebp),%esi 80104318: 31 db xor %ebx,%ebx pushcli(); 8010431a: e8 51 ff ff ff call 80104270 <pushcli> r = lock->locked && lock->cpu == mycpu(); 8010431f: 8b 06 mov (%esi),%eax 80104321: 85 c0 test %eax,%eax 80104323: 74 10 je 80104335 <holding+0x25> 80104325: 8b 5e 08 mov 0x8(%esi),%ebx 80104328: e8 13 f4 ff ff call 80103740 <mycpu> 8010432d: 39 c3 cmp %eax,%ebx 8010432f: 0f 94 c3 sete %bl 80104332: 0f b6 db movzbl %bl,%ebx popcli(); 80104335: e8 76 ff ff ff call 801042b0 <popcli> } 8010433a: 89 d8 mov %ebx,%eax 8010433c: 5b pop %ebx 8010433d: 5e pop %esi 8010433e: 5d pop %ebp 8010433f: c3 ret 80104340 <acquire>: { 80104340: 55 push %ebp 80104341: 89 e5 mov %esp,%ebp 80104343: 56 push %esi 80104344: 53 push %ebx pushcli(); // disable interrupts to avoid deadlock. 80104345: e8 26 ff ff ff call 80104270 <pushcli> if(holding(lk)) 8010434a: 8b 5d 08 mov 0x8(%ebp),%ebx 8010434d: 83 ec 0c sub $0xc,%esp 80104350: 53 push %ebx 80104351: e8 ba ff ff ff call 80104310 <holding> 80104356: 83 c4 10 add $0x10,%esp 80104359: 85 c0 test %eax,%eax 8010435b: 0f 85 83 00 00 00 jne 801043e4 <acquire+0xa4> 80104361: 89 c6 mov %eax,%esi asm volatile("lock; xchgl %0, %1" : 80104363: ba 01 00 00 00 mov $0x1,%edx 80104368: eb 09 jmp 80104373 <acquire+0x33> 8010436a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104370: 8b 5d 08 mov 0x8(%ebp),%ebx 80104373: 89 d0 mov %edx,%eax 80104375: f0 87 03 lock xchg %eax,(%ebx) while(xchg(&lk->locked, 1) != 0) 80104378: 85 c0 test %eax,%eax 8010437a: 75 f4 jne 80104370 <acquire+0x30> __sync_synchronize(); 8010437c: f0 83 0c 24 00 lock orl $0x0,(%esp) lk->cpu = mycpu(); 80104381: 8b 5d 08 mov 0x8(%ebp),%ebx 80104384: e8 b7 f3 ff ff call 80103740 <mycpu> getcallerpcs(&lk, lk->pcs); 80104389: 8d 53 0c lea 0xc(%ebx),%edx lk->cpu = mycpu(); 8010438c: 89 43 08 mov %eax,0x8(%ebx) ebp = (uint*)v - 2; 8010438f: 89 e8 mov %ebp,%eax 80104391: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff) 80104398: 8d 88 00 00 00 80 lea -0x80000000(%eax),%ecx 8010439e: 81 f9 fe ff ff 7f cmp $0x7ffffffe,%ecx 801043a4: 77 1a ja 801043c0 <acquire+0x80> pcs[i] = ebp[1]; // saved %eip 801043a6: 8b 48 04 mov 0x4(%eax),%ecx 801043a9: 89 0c b2 mov %ecx,(%edx,%esi,4) for(i = 0; i < 10; i++){ 801043ac: 83 c6 01 add $0x1,%esi ebp = (uint*)ebp[0]; // saved %ebp 801043af: 8b 00 mov (%eax),%eax for(i = 0; i < 10; i++){ 801043b1: 83 fe 0a cmp $0xa,%esi 801043b4: 75 e2 jne 80104398 <acquire+0x58> } 801043b6: 8d 65 f8 lea -0x8(%ebp),%esp 801043b9: 5b pop %ebx 801043ba: 5e pop %esi 801043bb: 5d pop %ebp 801043bc: c3 ret 801043bd: 8d 76 00 lea 0x0(%esi),%esi 801043c0: 8d 04 b2 lea (%edx,%esi,4),%eax 801043c3: 83 c2 28 add $0x28,%edx 801043c6: 8d 76 00 lea 0x0(%esi),%esi 801043c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi pcs[i] = 0; 801043d0: c7 00 00 00 00 00 movl $0x0,(%eax) 801043d6: 83 c0 04 add $0x4,%eax for(; i < 10; i++) 801043d9: 39 d0 cmp %edx,%eax 801043db: 75 f3 jne 801043d0 <acquire+0x90> } 801043dd: 8d 65 f8 lea -0x8(%ebp),%esp 801043e0: 5b pop %ebx 801043e1: 5e pop %esi 801043e2: 5d pop %ebp 801043e3: c3 ret panic("acquire"); 801043e4: 83 ec 0c sub $0xc,%esp 801043e7: 68 61 75 10 80 push $0x80107561 801043ec: e8 9f bf ff ff call 80100390 <panic> 801043f1: eb 0d jmp 80104400 <release> 801043f3: 90 nop 801043f4: 90 nop 801043f5: 90 nop 801043f6: 90 nop 801043f7: 90 nop 801043f8: 90 nop 801043f9: 90 nop 801043fa: 90 nop 801043fb: 90 nop 801043fc: 90 nop 801043fd: 90 nop 801043fe: 90 nop 801043ff: 90 nop 80104400 <release>: { 80104400: 55 push %ebp 80104401: 89 e5 mov %esp,%ebp 80104403: 53 push %ebx 80104404: 83 ec 10 sub $0x10,%esp 80104407: 8b 5d 08 mov 0x8(%ebp),%ebx if(!holding(lk)) 8010440a: 53 push %ebx 8010440b: e8 00 ff ff ff call 80104310 <holding> 80104410: 83 c4 10 add $0x10,%esp 80104413: 85 c0 test %eax,%eax 80104415: 74 22 je 80104439 <release+0x39> lk->pcs[0] = 0; 80104417: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) lk->cpu = 0; 8010441e: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) __sync_synchronize(); 80104425: f0 83 0c 24 00 lock orl $0x0,(%esp) asm volatile("movl $0, %0" : "+m" (lk->locked) : ); 8010442a: c7 03 00 00 00 00 movl $0x0,(%ebx) } 80104430: 8b 5d fc mov -0x4(%ebp),%ebx 80104433: c9 leave popcli(); 80104434: e9 77 fe ff ff jmp 801042b0 <popcli> panic("release"); 80104439: 83 ec 0c sub $0xc,%esp 8010443c: 68 69 75 10 80 push $0x80107569 80104441: e8 4a bf ff ff call 80100390 <panic> 80104446: 66 90 xchg %ax,%ax 80104448: 66 90 xchg %ax,%ax 8010444a: 66 90 xchg %ax,%ax 8010444c: 66 90 xchg %ax,%ax 8010444e: 66 90 xchg %ax,%ax 80104450 <memset>: #include "types.h" #include "x86.h" void* memset(void *dst, int c, uint n) { 80104450: 55 push %ebp 80104451: 89 e5 mov %esp,%ebp 80104453: 57 push %edi 80104454: 53 push %ebx 80104455: 8b 55 08 mov 0x8(%ebp),%edx 80104458: 8b 4d 10 mov 0x10(%ebp),%ecx if ((int)dst%4 == 0 && n%4 == 0){ 8010445b: f6 c2 03 test $0x3,%dl 8010445e: 75 05 jne 80104465 <memset+0x15> 80104460: f6 c1 03 test $0x3,%cl 80104463: 74 13 je 80104478 <memset+0x28> asm volatile("cld; rep stosb" : 80104465: 89 d7 mov %edx,%edi 80104467: 8b 45 0c mov 0xc(%ebp),%eax 8010446a: fc cld 8010446b: 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; } 8010446d: 5b pop %ebx 8010446e: 89 d0 mov %edx,%eax 80104470: 5f pop %edi 80104471: 5d pop %ebp 80104472: c3 ret 80104473: 90 nop 80104474: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi c &= 0xFF; 80104478: 0f b6 7d 0c movzbl 0xc(%ebp),%edi stosl(dst, (c<<24)|(c<<16)|(c<<8)|c, n/4); 8010447c: c1 e9 02 shr $0x2,%ecx 8010447f: 89 f8 mov %edi,%eax 80104481: 89 fb mov %edi,%ebx 80104483: c1 e0 18 shl $0x18,%eax 80104486: c1 e3 10 shl $0x10,%ebx 80104489: 09 d8 or %ebx,%eax 8010448b: 09 f8 or %edi,%eax 8010448d: c1 e7 08 shl $0x8,%edi 80104490: 09 f8 or %edi,%eax asm volatile("cld; rep stosl" : 80104492: 89 d7 mov %edx,%edi 80104494: fc cld 80104495: f3 ab rep stos %eax,%es:(%edi) } 80104497: 5b pop %ebx 80104498: 89 d0 mov %edx,%eax 8010449a: 5f pop %edi 8010449b: 5d pop %ebp 8010449c: c3 ret 8010449d: 8d 76 00 lea 0x0(%esi),%esi 801044a0 <memcmp>: int memcmp(const void *v1, const void *v2, uint n) { 801044a0: 55 push %ebp 801044a1: 89 e5 mov %esp,%ebp 801044a3: 57 push %edi 801044a4: 56 push %esi 801044a5: 53 push %ebx 801044a6: 8b 5d 10 mov 0x10(%ebp),%ebx 801044a9: 8b 75 08 mov 0x8(%ebp),%esi 801044ac: 8b 7d 0c mov 0xc(%ebp),%edi const uchar *s1, *s2; s1 = v1; s2 = v2; while(n-- > 0){ 801044af: 85 db test %ebx,%ebx 801044b1: 74 29 je 801044dc <memcmp+0x3c> if(*s1 != *s2) 801044b3: 0f b6 16 movzbl (%esi),%edx 801044b6: 0f b6 0f movzbl (%edi),%ecx 801044b9: 38 d1 cmp %dl,%cl 801044bb: 75 2b jne 801044e8 <memcmp+0x48> 801044bd: b8 01 00 00 00 mov $0x1,%eax 801044c2: eb 14 jmp 801044d8 <memcmp+0x38> 801044c4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801044c8: 0f b6 14 06 movzbl (%esi,%eax,1),%edx 801044cc: 83 c0 01 add $0x1,%eax 801044cf: 0f b6 4c 07 ff movzbl -0x1(%edi,%eax,1),%ecx 801044d4: 38 ca cmp %cl,%dl 801044d6: 75 10 jne 801044e8 <memcmp+0x48> while(n-- > 0){ 801044d8: 39 d8 cmp %ebx,%eax 801044da: 75 ec jne 801044c8 <memcmp+0x28> return *s1 - *s2; s1++, s2++; } return 0; } 801044dc: 5b pop %ebx return 0; 801044dd: 31 c0 xor %eax,%eax } 801044df: 5e pop %esi 801044e0: 5f pop %edi 801044e1: 5d pop %ebp 801044e2: c3 ret 801044e3: 90 nop 801044e4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return *s1 - *s2; 801044e8: 0f b6 c2 movzbl %dl,%eax } 801044eb: 5b pop %ebx return *s1 - *s2; 801044ec: 29 c8 sub %ecx,%eax } 801044ee: 5e pop %esi 801044ef: 5f pop %edi 801044f0: 5d pop %ebp 801044f1: c3 ret 801044f2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801044f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104500 <memmove>: void* memmove(void *dst, const void *src, uint n) { 80104500: 55 push %ebp 80104501: 89 e5 mov %esp,%ebp 80104503: 56 push %esi 80104504: 53 push %ebx 80104505: 8b 45 08 mov 0x8(%ebp),%eax 80104508: 8b 5d 0c mov 0xc(%ebp),%ebx 8010450b: 8b 75 10 mov 0x10(%ebp),%esi const char *s; char *d; s = src; d = dst; if(s < d && s + n > d){ 8010450e: 39 c3 cmp %eax,%ebx 80104510: 73 26 jae 80104538 <memmove+0x38> 80104512: 8d 0c 33 lea (%ebx,%esi,1),%ecx 80104515: 39 c8 cmp %ecx,%eax 80104517: 73 1f jae 80104538 <memmove+0x38> s += n; d += n; while(n-- > 0) 80104519: 85 f6 test %esi,%esi 8010451b: 8d 56 ff lea -0x1(%esi),%edx 8010451e: 74 0f je 8010452f <memmove+0x2f> *--d = *--s; 80104520: 0f b6 0c 13 movzbl (%ebx,%edx,1),%ecx 80104524: 88 0c 10 mov %cl,(%eax,%edx,1) while(n-- > 0) 80104527: 83 ea 01 sub $0x1,%edx 8010452a: 83 fa ff cmp $0xffffffff,%edx 8010452d: 75 f1 jne 80104520 <memmove+0x20> } else while(n-- > 0) *d++ = *s++; return dst; } 8010452f: 5b pop %ebx 80104530: 5e pop %esi 80104531: 5d pop %ebp 80104532: c3 ret 80104533: 90 nop 80104534: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi while(n-- > 0) 80104538: 31 d2 xor %edx,%edx 8010453a: 85 f6 test %esi,%esi 8010453c: 74 f1 je 8010452f <memmove+0x2f> 8010453e: 66 90 xchg %ax,%ax *d++ = *s++; 80104540: 0f b6 0c 13 movzbl (%ebx,%edx,1),%ecx 80104544: 88 0c 10 mov %cl,(%eax,%edx,1) 80104547: 83 c2 01 add $0x1,%edx while(n-- > 0) 8010454a: 39 d6 cmp %edx,%esi 8010454c: 75 f2 jne 80104540 <memmove+0x40> } 8010454e: 5b pop %ebx 8010454f: 5e pop %esi 80104550: 5d pop %ebp 80104551: c3 ret 80104552: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104559: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104560 <memcpy>: // memcpy exists to placate GCC. Use memmove. void* memcpy(void *dst, const void *src, uint n) { 80104560: 55 push %ebp 80104561: 89 e5 mov %esp,%ebp return memmove(dst, src, n); } 80104563: 5d pop %ebp return memmove(dst, src, n); 80104564: eb 9a jmp 80104500 <memmove> 80104566: 8d 76 00 lea 0x0(%esi),%esi 80104569: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104570 <strncmp>: int strncmp(const char *p, const char *q, uint n) { 80104570: 55 push %ebp 80104571: 89 e5 mov %esp,%ebp 80104573: 57 push %edi 80104574: 56 push %esi 80104575: 8b 7d 10 mov 0x10(%ebp),%edi 80104578: 53 push %ebx 80104579: 8b 4d 08 mov 0x8(%ebp),%ecx 8010457c: 8b 75 0c mov 0xc(%ebp),%esi while(n > 0 && *p && *p == *q) 8010457f: 85 ff test %edi,%edi 80104581: 74 2f je 801045b2 <strncmp+0x42> 80104583: 0f b6 01 movzbl (%ecx),%eax 80104586: 0f b6 1e movzbl (%esi),%ebx 80104589: 84 c0 test %al,%al 8010458b: 74 37 je 801045c4 <strncmp+0x54> 8010458d: 38 c3 cmp %al,%bl 8010458f: 75 33 jne 801045c4 <strncmp+0x54> 80104591: 01 f7 add %esi,%edi 80104593: eb 13 jmp 801045a8 <strncmp+0x38> 80104595: 8d 76 00 lea 0x0(%esi),%esi 80104598: 0f b6 01 movzbl (%ecx),%eax 8010459b: 84 c0 test %al,%al 8010459d: 74 21 je 801045c0 <strncmp+0x50> 8010459f: 0f b6 1a movzbl (%edx),%ebx 801045a2: 89 d6 mov %edx,%esi 801045a4: 38 d8 cmp %bl,%al 801045a6: 75 1c jne 801045c4 <strncmp+0x54> n--, p++, q++; 801045a8: 8d 56 01 lea 0x1(%esi),%edx 801045ab: 83 c1 01 add $0x1,%ecx while(n > 0 && *p && *p == *q) 801045ae: 39 fa cmp %edi,%edx 801045b0: 75 e6 jne 80104598 <strncmp+0x28> if(n == 0) return 0; return (uchar)*p - (uchar)*q; } 801045b2: 5b pop %ebx return 0; 801045b3: 31 c0 xor %eax,%eax } 801045b5: 5e pop %esi 801045b6: 5f pop %edi 801045b7: 5d pop %ebp 801045b8: c3 ret 801045b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801045c0: 0f b6 5e 01 movzbl 0x1(%esi),%ebx return (uchar)*p - (uchar)*q; 801045c4: 29 d8 sub %ebx,%eax } 801045c6: 5b pop %ebx 801045c7: 5e pop %esi 801045c8: 5f pop %edi 801045c9: 5d pop %ebp 801045ca: c3 ret 801045cb: 90 nop 801045cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801045d0 <strncpy>: char* strncpy(char *s, const char *t, int n) { 801045d0: 55 push %ebp 801045d1: 89 e5 mov %esp,%ebp 801045d3: 56 push %esi 801045d4: 53 push %ebx 801045d5: 8b 45 08 mov 0x8(%ebp),%eax 801045d8: 8b 5d 0c mov 0xc(%ebp),%ebx 801045db: 8b 4d 10 mov 0x10(%ebp),%ecx char *os; os = s; while(n-- > 0 && (*s++ = *t++) != 0) 801045de: 89 c2 mov %eax,%edx 801045e0: eb 19 jmp 801045fb <strncpy+0x2b> 801045e2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801045e8: 83 c3 01 add $0x1,%ebx 801045eb: 0f b6 4b ff movzbl -0x1(%ebx),%ecx 801045ef: 83 c2 01 add $0x1,%edx 801045f2: 84 c9 test %cl,%cl 801045f4: 88 4a ff mov %cl,-0x1(%edx) 801045f7: 74 09 je 80104602 <strncpy+0x32> 801045f9: 89 f1 mov %esi,%ecx 801045fb: 85 c9 test %ecx,%ecx 801045fd: 8d 71 ff lea -0x1(%ecx),%esi 80104600: 7f e6 jg 801045e8 <strncpy+0x18> ; while(n-- > 0) 80104602: 31 c9 xor %ecx,%ecx 80104604: 85 f6 test %esi,%esi 80104606: 7e 17 jle 8010461f <strncpy+0x4f> 80104608: 90 nop 80104609: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi *s++ = 0; 80104610: c6 04 0a 00 movb $0x0,(%edx,%ecx,1) 80104614: 89 f3 mov %esi,%ebx 80104616: 83 c1 01 add $0x1,%ecx 80104619: 29 cb sub %ecx,%ebx while(n-- > 0) 8010461b: 85 db test %ebx,%ebx 8010461d: 7f f1 jg 80104610 <strncpy+0x40> return os; } 8010461f: 5b pop %ebx 80104620: 5e pop %esi 80104621: 5d pop %ebp 80104622: c3 ret 80104623: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104629: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104630 <safestrcpy>: // Like strncpy but guaranteed to NUL-terminate. char* safestrcpy(char *s, const char *t, int n) { 80104630: 55 push %ebp 80104631: 89 e5 mov %esp,%ebp 80104633: 56 push %esi 80104634: 53 push %ebx 80104635: 8b 4d 10 mov 0x10(%ebp),%ecx 80104638: 8b 45 08 mov 0x8(%ebp),%eax 8010463b: 8b 55 0c mov 0xc(%ebp),%edx char *os; os = s; if(n <= 0) 8010463e: 85 c9 test %ecx,%ecx 80104640: 7e 26 jle 80104668 <safestrcpy+0x38> 80104642: 8d 74 0a ff lea -0x1(%edx,%ecx,1),%esi 80104646: 89 c1 mov %eax,%ecx 80104648: eb 17 jmp 80104661 <safestrcpy+0x31> 8010464a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return os; while(--n > 0 && (*s++ = *t++) != 0) 80104650: 83 c2 01 add $0x1,%edx 80104653: 0f b6 5a ff movzbl -0x1(%edx),%ebx 80104657: 83 c1 01 add $0x1,%ecx 8010465a: 84 db test %bl,%bl 8010465c: 88 59 ff mov %bl,-0x1(%ecx) 8010465f: 74 04 je 80104665 <safestrcpy+0x35> 80104661: 39 f2 cmp %esi,%edx 80104663: 75 eb jne 80104650 <safestrcpy+0x20> ; *s = 0; 80104665: c6 01 00 movb $0x0,(%ecx) return os; } 80104668: 5b pop %ebx 80104669: 5e pop %esi 8010466a: 5d pop %ebp 8010466b: c3 ret 8010466c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104670 <strlen>: int strlen(const char *s) { 80104670: 55 push %ebp int n; for(n = 0; s[n]; n++) 80104671: 31 c0 xor %eax,%eax { 80104673: 89 e5 mov %esp,%ebp 80104675: 8b 55 08 mov 0x8(%ebp),%edx for(n = 0; s[n]; n++) 80104678: 80 3a 00 cmpb $0x0,(%edx) 8010467b: 74 0c je 80104689 <strlen+0x19> 8010467d: 8d 76 00 lea 0x0(%esi),%esi 80104680: 83 c0 01 add $0x1,%eax 80104683: 80 3c 02 00 cmpb $0x0,(%edx,%eax,1) 80104687: 75 f7 jne 80104680 <strlen+0x10> ; return n; } 80104689: 5d pop %ebp 8010468a: c3 ret 8010468b <swtch>: 8010468b: 8b 44 24 04 mov 0x4(%esp),%eax 8010468f: 8b 54 24 08 mov 0x8(%esp),%edx 80104693: 55 push %ebp 80104694: 53 push %ebx 80104695: 56 push %esi 80104696: 57 push %edi 80104697: 89 20 mov %esp,(%eax) 80104699: 89 d4 mov %edx,%esp 8010469b: 5f pop %edi 8010469c: 5e pop %esi 8010469d: 5b pop %ebx 8010469e: 5d pop %ebp 8010469f: c3 ret 801046a0 <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) { 801046a0: 55 push %ebp 801046a1: 89 e5 mov %esp,%ebp 801046a3: 53 push %ebx 801046a4: 83 ec 04 sub $0x4,%esp 801046a7: 8b 5d 08 mov 0x8(%ebp),%ebx struct proc *curproc = myproc(); 801046aa: e8 31 f1 ff ff call 801037e0 <myproc> if(addr >= curproc->sz || addr+4 > curproc->sz) 801046af: 8b 00 mov (%eax),%eax 801046b1: 39 d8 cmp %ebx,%eax 801046b3: 76 1b jbe 801046d0 <fetchint+0x30> 801046b5: 8d 53 04 lea 0x4(%ebx),%edx 801046b8: 39 d0 cmp %edx,%eax 801046ba: 72 14 jb 801046d0 <fetchint+0x30> return -1; *ip = *(int*)(addr); 801046bc: 8b 45 0c mov 0xc(%ebp),%eax 801046bf: 8b 13 mov (%ebx),%edx 801046c1: 89 10 mov %edx,(%eax) return 0; 801046c3: 31 c0 xor %eax,%eax } 801046c5: 83 c4 04 add $0x4,%esp 801046c8: 5b pop %ebx 801046c9: 5d pop %ebp 801046ca: c3 ret 801046cb: 90 nop 801046cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; 801046d0: b8 ff ff ff ff mov $0xffffffff,%eax 801046d5: eb ee jmp 801046c5 <fetchint+0x25> 801046d7: 89 f6 mov %esi,%esi 801046d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801046e0 <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) { 801046e0: 55 push %ebp 801046e1: 89 e5 mov %esp,%ebp 801046e3: 53 push %ebx 801046e4: 83 ec 04 sub $0x4,%esp 801046e7: 8b 5d 08 mov 0x8(%ebp),%ebx char *s, *ep; struct proc *curproc = myproc(); 801046ea: e8 f1 f0 ff ff call 801037e0 <myproc> if(addr >= curproc->sz) 801046ef: 39 18 cmp %ebx,(%eax) 801046f1: 76 29 jbe 8010471c <fetchstr+0x3c> return -1; *pp = (char*)addr; 801046f3: 8b 4d 0c mov 0xc(%ebp),%ecx 801046f6: 89 da mov %ebx,%edx 801046f8: 89 19 mov %ebx,(%ecx) ep = (char*)curproc->sz; 801046fa: 8b 00 mov (%eax),%eax for(s = *pp; s < ep; s++){ 801046fc: 39 c3 cmp %eax,%ebx 801046fe: 73 1c jae 8010471c <fetchstr+0x3c> if(*s == 0) 80104700: 80 3b 00 cmpb $0x0,(%ebx) 80104703: 75 10 jne 80104715 <fetchstr+0x35> 80104705: eb 39 jmp 80104740 <fetchstr+0x60> 80104707: 89 f6 mov %esi,%esi 80104709: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104710: 80 3a 00 cmpb $0x0,(%edx) 80104713: 74 1b je 80104730 <fetchstr+0x50> for(s = *pp; s < ep; s++){ 80104715: 83 c2 01 add $0x1,%edx 80104718: 39 d0 cmp %edx,%eax 8010471a: 77 f4 ja 80104710 <fetchstr+0x30> return -1; 8010471c: b8 ff ff ff ff mov $0xffffffff,%eax return s - *pp; } return -1; } 80104721: 83 c4 04 add $0x4,%esp 80104724: 5b pop %ebx 80104725: 5d pop %ebp 80104726: c3 ret 80104727: 89 f6 mov %esi,%esi 80104729: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104730: 83 c4 04 add $0x4,%esp 80104733: 89 d0 mov %edx,%eax 80104735: 29 d8 sub %ebx,%eax 80104737: 5b pop %ebx 80104738: 5d pop %ebp 80104739: c3 ret 8010473a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(*s == 0) 80104740: 31 c0 xor %eax,%eax return s - *pp; 80104742: eb dd jmp 80104721 <fetchstr+0x41> 80104744: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010474a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80104750 <argint>: // Fetch the nth 32-bit system call argument. int argint(int n, int *ip) { 80104750: 55 push %ebp 80104751: 89 e5 mov %esp,%ebp 80104753: 56 push %esi 80104754: 53 push %ebx return fetchint((myproc()->tf->esp) + 4 + 4*n, ip); 80104755: e8 86 f0 ff ff call 801037e0 <myproc> 8010475a: 8b 40 18 mov 0x18(%eax),%eax 8010475d: 8b 55 08 mov 0x8(%ebp),%edx 80104760: 8b 40 44 mov 0x44(%eax),%eax 80104763: 8d 1c 90 lea (%eax,%edx,4),%ebx struct proc *curproc = myproc(); 80104766: e8 75 f0 ff ff call 801037e0 <myproc> if(addr >= curproc->sz || addr+4 > curproc->sz) 8010476b: 8b 00 mov (%eax),%eax return fetchint((myproc()->tf->esp) + 4 + 4*n, ip); 8010476d: 8d 73 04 lea 0x4(%ebx),%esi if(addr >= curproc->sz || addr+4 > curproc->sz) 80104770: 39 c6 cmp %eax,%esi 80104772: 73 1c jae 80104790 <argint+0x40> 80104774: 8d 53 08 lea 0x8(%ebx),%edx 80104777: 39 d0 cmp %edx,%eax 80104779: 72 15 jb 80104790 <argint+0x40> *ip = *(int*)(addr); 8010477b: 8b 45 0c mov 0xc(%ebp),%eax 8010477e: 8b 53 04 mov 0x4(%ebx),%edx 80104781: 89 10 mov %edx,(%eax) return 0; 80104783: 31 c0 xor %eax,%eax } 80104785: 5b pop %ebx 80104786: 5e pop %esi 80104787: 5d pop %ebp 80104788: c3 ret 80104789: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80104790: b8 ff ff ff ff mov $0xffffffff,%eax return fetchint((myproc()->tf->esp) + 4 + 4*n, ip); 80104795: eb ee jmp 80104785 <argint+0x35> 80104797: 89 f6 mov %esi,%esi 80104799: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801047a0 <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) { 801047a0: 55 push %ebp 801047a1: 89 e5 mov %esp,%ebp 801047a3: 56 push %esi 801047a4: 53 push %ebx 801047a5: 83 ec 10 sub $0x10,%esp 801047a8: 8b 5d 10 mov 0x10(%ebp),%ebx int i; struct proc *curproc = myproc(); 801047ab: e8 30 f0 ff ff call 801037e0 <myproc> 801047b0: 89 c6 mov %eax,%esi if(argint(n, &i) < 0) 801047b2: 8d 45 f4 lea -0xc(%ebp),%eax 801047b5: 83 ec 08 sub $0x8,%esp 801047b8: 50 push %eax 801047b9: ff 75 08 pushl 0x8(%ebp) 801047bc: e8 8f ff ff ff call 80104750 <argint> return -1; if(size < 0 || (uint)i >= curproc->sz || (uint)i+size > curproc->sz) 801047c1: 83 c4 10 add $0x10,%esp 801047c4: 85 c0 test %eax,%eax 801047c6: 78 28 js 801047f0 <argptr+0x50> 801047c8: 85 db test %ebx,%ebx 801047ca: 78 24 js 801047f0 <argptr+0x50> 801047cc: 8b 16 mov (%esi),%edx 801047ce: 8b 45 f4 mov -0xc(%ebp),%eax 801047d1: 39 c2 cmp %eax,%edx 801047d3: 76 1b jbe 801047f0 <argptr+0x50> 801047d5: 01 c3 add %eax,%ebx 801047d7: 39 da cmp %ebx,%edx 801047d9: 72 15 jb 801047f0 <argptr+0x50> return -1; *pp = (char*)i; 801047db: 8b 55 0c mov 0xc(%ebp),%edx 801047de: 89 02 mov %eax,(%edx) return 0; 801047e0: 31 c0 xor %eax,%eax } 801047e2: 8d 65 f8 lea -0x8(%ebp),%esp 801047e5: 5b pop %ebx 801047e6: 5e pop %esi 801047e7: 5d pop %ebp 801047e8: c3 ret 801047e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 801047f0: b8 ff ff ff ff mov $0xffffffff,%eax 801047f5: eb eb jmp 801047e2 <argptr+0x42> 801047f7: 89 f6 mov %esi,%esi 801047f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104800 <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) { 80104800: 55 push %ebp 80104801: 89 e5 mov %esp,%ebp 80104803: 83 ec 20 sub $0x20,%esp int addr; if(argint(n, &addr) < 0) 80104806: 8d 45 f4 lea -0xc(%ebp),%eax 80104809: 50 push %eax 8010480a: ff 75 08 pushl 0x8(%ebp) 8010480d: e8 3e ff ff ff call 80104750 <argint> 80104812: 83 c4 10 add $0x10,%esp 80104815: 85 c0 test %eax,%eax 80104817: 78 17 js 80104830 <argstr+0x30> return -1; return fetchstr(addr, pp); 80104819: 83 ec 08 sub $0x8,%esp 8010481c: ff 75 0c pushl 0xc(%ebp) 8010481f: ff 75 f4 pushl -0xc(%ebp) 80104822: e8 b9 fe ff ff call 801046e0 <fetchstr> 80104827: 83 c4 10 add $0x10,%esp } 8010482a: c9 leave 8010482b: c3 ret 8010482c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80104830: b8 ff ff ff ff mov $0xffffffff,%eax } 80104835: c9 leave 80104836: c3 ret 80104837: 89 f6 mov %esi,%esi 80104839: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104840 <syscall>: [SYS_close] sys_close, }; void syscall(void) { 80104840: 55 push %ebp 80104841: 89 e5 mov %esp,%ebp 80104843: 53 push %ebx 80104844: 83 ec 04 sub $0x4,%esp int num; struct proc *curproc = myproc(); 80104847: e8 94 ef ff ff call 801037e0 <myproc> 8010484c: 89 c3 mov %eax,%ebx num = curproc->tf->eax; 8010484e: 8b 40 18 mov 0x18(%eax),%eax 80104851: 8b 40 1c mov 0x1c(%eax),%eax if(num > 0 && num < NELEM(syscalls) && syscalls[num]) { 80104854: 8d 50 ff lea -0x1(%eax),%edx 80104857: 83 fa 14 cmp $0x14,%edx 8010485a: 77 1c ja 80104878 <syscall+0x38> 8010485c: 8b 14 85 a0 75 10 80 mov -0x7fef8a60(,%eax,4),%edx 80104863: 85 d2 test %edx,%edx 80104865: 74 11 je 80104878 <syscall+0x38> curproc->tf->eax = syscalls[num](); 80104867: ff d2 call *%edx 80104869: 8b 53 18 mov 0x18(%ebx),%edx 8010486c: 89 42 1c mov %eax,0x1c(%edx) } else { cprintf("%d %s: unknown sys call %d\n", curproc->pid, curproc->name, num); curproc->tf->eax = -1; } } 8010486f: 8b 5d fc mov -0x4(%ebp),%ebx 80104872: c9 leave 80104873: c3 ret 80104874: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi cprintf("%d %s: unknown sys call %d\n", 80104878: 50 push %eax curproc->pid, curproc->name, num); 80104879: 8d 43 6c lea 0x6c(%ebx),%eax cprintf("%d %s: unknown sys call %d\n", 8010487c: 50 push %eax 8010487d: ff 73 10 pushl 0x10(%ebx) 80104880: 68 71 75 10 80 push $0x80107571 80104885: e8 d6 bd ff ff call 80100660 <cprintf> curproc->tf->eax = -1; 8010488a: 8b 43 18 mov 0x18(%ebx),%eax 8010488d: 83 c4 10 add $0x10,%esp 80104890: c7 40 1c ff ff ff ff movl $0xffffffff,0x1c(%eax) } 80104897: 8b 5d fc mov -0x4(%ebp),%ebx 8010489a: c9 leave 8010489b: c3 ret 8010489c: 66 90 xchg %ax,%ax 8010489e: 66 90 xchg %ax,%ax 801048a0 <create>: 801048a0: 55 push %ebp 801048a1: 89 e5 mov %esp,%ebp 801048a3: 57 push %edi 801048a4: 56 push %esi 801048a5: 53 push %ebx 801048a6: 8d 75 da lea -0x26(%ebp),%esi 801048a9: 83 ec 34 sub $0x34,%esp 801048ac: 89 4d d0 mov %ecx,-0x30(%ebp) 801048af: 8b 4d 08 mov 0x8(%ebp),%ecx 801048b2: 56 push %esi 801048b3: 50 push %eax 801048b4: 89 55 d4 mov %edx,-0x2c(%ebp) 801048b7: 89 4d cc mov %ecx,-0x34(%ebp) 801048ba: e8 41 d6 ff ff call 80101f00 <nameiparent> 801048bf: 83 c4 10 add $0x10,%esp 801048c2: 85 c0 test %eax,%eax 801048c4: 0f 84 46 01 00 00 je 80104a10 <create+0x170> 801048ca: 83 ec 0c sub $0xc,%esp 801048cd: 89 c3 mov %eax,%ebx 801048cf: 50 push %eax 801048d0: e8 ab cd ff ff call 80101680 <ilock> 801048d5: 83 c4 0c add $0xc,%esp 801048d8: 6a 00 push $0x0 801048da: 56 push %esi 801048db: 53 push %ebx 801048dc: e8 cf d2 ff ff call 80101bb0 <dirlookup> 801048e1: 83 c4 10 add $0x10,%esp 801048e4: 85 c0 test %eax,%eax 801048e6: 89 c7 mov %eax,%edi 801048e8: 74 36 je 80104920 <create+0x80> 801048ea: 83 ec 0c sub $0xc,%esp 801048ed: 53 push %ebx 801048ee: e8 1d d0 ff ff call 80101910 <iunlockput> 801048f3: 89 3c 24 mov %edi,(%esp) 801048f6: e8 85 cd ff ff call 80101680 <ilock> 801048fb: 83 c4 10 add $0x10,%esp 801048fe: 66 83 7d d4 02 cmpw $0x2,-0x2c(%ebp) 80104903: 0f 85 97 00 00 00 jne 801049a0 <create+0x100> 80104909: 66 83 7f 50 02 cmpw $0x2,0x50(%edi) 8010490e: 0f 85 8c 00 00 00 jne 801049a0 <create+0x100> 80104914: 8d 65 f4 lea -0xc(%ebp),%esp 80104917: 89 f8 mov %edi,%eax 80104919: 5b pop %ebx 8010491a: 5e pop %esi 8010491b: 5f pop %edi 8010491c: 5d pop %ebp 8010491d: c3 ret 8010491e: 66 90 xchg %ax,%ax 80104920: 0f bf 45 d4 movswl -0x2c(%ebp),%eax 80104924: 83 ec 08 sub $0x8,%esp 80104927: 50 push %eax 80104928: ff 33 pushl (%ebx) 8010492a: e8 e1 cb ff ff call 80101510 <ialloc> 8010492f: 83 c4 10 add $0x10,%esp 80104932: 85 c0 test %eax,%eax 80104934: 89 c7 mov %eax,%edi 80104936: 0f 84 e8 00 00 00 je 80104a24 <create+0x184> 8010493c: 83 ec 0c sub $0xc,%esp 8010493f: 50 push %eax 80104940: e8 3b cd ff ff call 80101680 <ilock> 80104945: 0f b7 45 d0 movzwl -0x30(%ebp),%eax 80104949: 66 89 47 52 mov %ax,0x52(%edi) 8010494d: 0f b7 45 cc movzwl -0x34(%ebp),%eax 80104951: 66 89 47 54 mov %ax,0x54(%edi) 80104955: b8 01 00 00 00 mov $0x1,%eax 8010495a: 66 89 47 56 mov %ax,0x56(%edi) 8010495e: 89 3c 24 mov %edi,(%esp) 80104961: e8 6a cc ff ff call 801015d0 <iupdate> 80104966: 83 c4 10 add $0x10,%esp 80104969: 66 83 7d d4 01 cmpw $0x1,-0x2c(%ebp) 8010496e: 74 50 je 801049c0 <create+0x120> 80104970: 83 ec 04 sub $0x4,%esp 80104973: ff 77 04 pushl 0x4(%edi) 80104976: 56 push %esi 80104977: 53 push %ebx 80104978: e8 a3 d4 ff ff call 80101e20 <dirlink> 8010497d: 83 c4 10 add $0x10,%esp 80104980: 85 c0 test %eax,%eax 80104982: 0f 88 8f 00 00 00 js 80104a17 <create+0x177> 80104988: 83 ec 0c sub $0xc,%esp 8010498b: 53 push %ebx 8010498c: e8 7f cf ff ff call 80101910 <iunlockput> 80104991: 83 c4 10 add $0x10,%esp 80104994: 8d 65 f4 lea -0xc(%ebp),%esp 80104997: 89 f8 mov %edi,%eax 80104999: 5b pop %ebx 8010499a: 5e pop %esi 8010499b: 5f pop %edi 8010499c: 5d pop %ebp 8010499d: c3 ret 8010499e: 66 90 xchg %ax,%ax 801049a0: 83 ec 0c sub $0xc,%esp 801049a3: 57 push %edi 801049a4: 31 ff xor %edi,%edi 801049a6: e8 65 cf ff ff call 80101910 <iunlockput> 801049ab: 83 c4 10 add $0x10,%esp 801049ae: 8d 65 f4 lea -0xc(%ebp),%esp 801049b1: 89 f8 mov %edi,%eax 801049b3: 5b pop %ebx 801049b4: 5e pop %esi 801049b5: 5f pop %edi 801049b6: 5d pop %ebp 801049b7: c3 ret 801049b8: 90 nop 801049b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801049c0: 66 83 43 56 01 addw $0x1,0x56(%ebx) 801049c5: 83 ec 0c sub $0xc,%esp 801049c8: 53 push %ebx 801049c9: e8 02 cc ff ff call 801015d0 <iupdate> 801049ce: 83 c4 0c add $0xc,%esp 801049d1: ff 77 04 pushl 0x4(%edi) 801049d4: 68 14 76 10 80 push $0x80107614 801049d9: 57 push %edi 801049da: e8 41 d4 ff ff call 80101e20 <dirlink> 801049df: 83 c4 10 add $0x10,%esp 801049e2: 85 c0 test %eax,%eax 801049e4: 78 1c js 80104a02 <create+0x162> 801049e6: 83 ec 04 sub $0x4,%esp 801049e9: ff 73 04 pushl 0x4(%ebx) 801049ec: 68 13 76 10 80 push $0x80107613 801049f1: 57 push %edi 801049f2: e8 29 d4 ff ff call 80101e20 <dirlink> 801049f7: 83 c4 10 add $0x10,%esp 801049fa: 85 c0 test %eax,%eax 801049fc: 0f 89 6e ff ff ff jns 80104970 <create+0xd0> 80104a02: 83 ec 0c sub $0xc,%esp 80104a05: 68 07 76 10 80 push $0x80107607 80104a0a: e8 81 b9 ff ff call 80100390 <panic> 80104a0f: 90 nop 80104a10: 31 ff xor %edi,%edi 80104a12: e9 fd fe ff ff jmp 80104914 <create+0x74> 80104a17: 83 ec 0c sub $0xc,%esp 80104a1a: 68 16 76 10 80 push $0x80107616 80104a1f: e8 6c b9 ff ff call 80100390 <panic> 80104a24: 83 ec 0c sub $0xc,%esp 80104a27: 68 f8 75 10 80 push $0x801075f8 80104a2c: e8 5f b9 ff ff call 80100390 <panic> 80104a31: eb 0d jmp 80104a40 <argfd.constprop.0> 80104a33: 90 nop 80104a34: 90 nop 80104a35: 90 nop 80104a36: 90 nop 80104a37: 90 nop 80104a38: 90 nop 80104a39: 90 nop 80104a3a: 90 nop 80104a3b: 90 nop 80104a3c: 90 nop 80104a3d: 90 nop 80104a3e: 90 nop 80104a3f: 90 nop 80104a40 <argfd.constprop.0>: 80104a40: 55 push %ebp 80104a41: 89 e5 mov %esp,%ebp 80104a43: 56 push %esi 80104a44: 53 push %ebx 80104a45: 89 c3 mov %eax,%ebx 80104a47: 8d 45 f4 lea -0xc(%ebp),%eax 80104a4a: 89 d6 mov %edx,%esi 80104a4c: 83 ec 18 sub $0x18,%esp 80104a4f: 50 push %eax 80104a50: 6a 00 push $0x0 80104a52: e8 f9 fc ff ff call 80104750 <argint> 80104a57: 83 c4 10 add $0x10,%esp 80104a5a: 85 c0 test %eax,%eax 80104a5c: 78 2a js 80104a88 <argfd.constprop.0+0x48> 80104a5e: 83 7d f4 0f cmpl $0xf,-0xc(%ebp) 80104a62: 77 24 ja 80104a88 <argfd.constprop.0+0x48> 80104a64: e8 77 ed ff ff call 801037e0 <myproc> 80104a69: 8b 55 f4 mov -0xc(%ebp),%edx 80104a6c: 8b 44 90 28 mov 0x28(%eax,%edx,4),%eax 80104a70: 85 c0 test %eax,%eax 80104a72: 74 14 je 80104a88 <argfd.constprop.0+0x48> 80104a74: 85 db test %ebx,%ebx 80104a76: 74 02 je 80104a7a <argfd.constprop.0+0x3a> 80104a78: 89 13 mov %edx,(%ebx) 80104a7a: 89 06 mov %eax,(%esi) 80104a7c: 31 c0 xor %eax,%eax 80104a7e: 8d 65 f8 lea -0x8(%ebp),%esp 80104a81: 5b pop %ebx 80104a82: 5e pop %esi 80104a83: 5d pop %ebp 80104a84: c3 ret 80104a85: 8d 76 00 lea 0x0(%esi),%esi 80104a88: b8 ff ff ff ff mov $0xffffffff,%eax 80104a8d: eb ef jmp 80104a7e <argfd.constprop.0+0x3e> 80104a8f: 90 nop 80104a90 <sys_dup>: 80104a90: 55 push %ebp 80104a91: 31 c0 xor %eax,%eax 80104a93: 89 e5 mov %esp,%ebp 80104a95: 56 push %esi 80104a96: 53 push %ebx 80104a97: 8d 55 f4 lea -0xc(%ebp),%edx 80104a9a: 83 ec 10 sub $0x10,%esp 80104a9d: e8 9e ff ff ff call 80104a40 <argfd.constprop.0> 80104aa2: 85 c0 test %eax,%eax 80104aa4: 78 42 js 80104ae8 <sys_dup+0x58> 80104aa6: 8b 75 f4 mov -0xc(%ebp),%esi 80104aa9: 31 db xor %ebx,%ebx 80104aab: e8 30 ed ff ff call 801037e0 <myproc> 80104ab0: eb 0e jmp 80104ac0 <sys_dup+0x30> 80104ab2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104ab8: 83 c3 01 add $0x1,%ebx 80104abb: 83 fb 10 cmp $0x10,%ebx 80104abe: 74 28 je 80104ae8 <sys_dup+0x58> 80104ac0: 8b 54 98 28 mov 0x28(%eax,%ebx,4),%edx 80104ac4: 85 d2 test %edx,%edx 80104ac6: 75 f0 jne 80104ab8 <sys_dup+0x28> 80104ac8: 89 74 98 28 mov %esi,0x28(%eax,%ebx,4) 80104acc: 83 ec 0c sub $0xc,%esp 80104acf: ff 75 f4 pushl -0xc(%ebp) 80104ad2: e8 19 c3 ff ff call 80100df0 <filedup> 80104ad7: 83 c4 10 add $0x10,%esp 80104ada: 8d 65 f8 lea -0x8(%ebp),%esp 80104add: 89 d8 mov %ebx,%eax 80104adf: 5b pop %ebx 80104ae0: 5e pop %esi 80104ae1: 5d pop %ebp 80104ae2: c3 ret 80104ae3: 90 nop 80104ae4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104ae8: 8d 65 f8 lea -0x8(%ebp),%esp 80104aeb: bb ff ff ff ff mov $0xffffffff,%ebx 80104af0: 89 d8 mov %ebx,%eax 80104af2: 5b pop %ebx 80104af3: 5e pop %esi 80104af4: 5d pop %ebp 80104af5: c3 ret 80104af6: 8d 76 00 lea 0x0(%esi),%esi 80104af9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104b00 <sys_read>: 80104b00: 55 push %ebp 80104b01: 31 c0 xor %eax,%eax 80104b03: 89 e5 mov %esp,%ebp 80104b05: 83 ec 18 sub $0x18,%esp 80104b08: 8d 55 ec lea -0x14(%ebp),%edx 80104b0b: e8 30 ff ff ff call 80104a40 <argfd.constprop.0> 80104b10: 85 c0 test %eax,%eax 80104b12: 78 4c js 80104b60 <sys_read+0x60> 80104b14: 8d 45 f0 lea -0x10(%ebp),%eax 80104b17: 83 ec 08 sub $0x8,%esp 80104b1a: 50 push %eax 80104b1b: 6a 02 push $0x2 80104b1d: e8 2e fc ff ff call 80104750 <argint> 80104b22: 83 c4 10 add $0x10,%esp 80104b25: 85 c0 test %eax,%eax 80104b27: 78 37 js 80104b60 <sys_read+0x60> 80104b29: 8d 45 f4 lea -0xc(%ebp),%eax 80104b2c: 83 ec 04 sub $0x4,%esp 80104b2f: ff 75 f0 pushl -0x10(%ebp) 80104b32: 50 push %eax 80104b33: 6a 01 push $0x1 80104b35: e8 66 fc ff ff call 801047a0 <argptr> 80104b3a: 83 c4 10 add $0x10,%esp 80104b3d: 85 c0 test %eax,%eax 80104b3f: 78 1f js 80104b60 <sys_read+0x60> 80104b41: 83 ec 04 sub $0x4,%esp 80104b44: ff 75 f0 pushl -0x10(%ebp) 80104b47: ff 75 f4 pushl -0xc(%ebp) 80104b4a: ff 75 ec pushl -0x14(%ebp) 80104b4d: e8 0e c4 ff ff call 80100f60 <fileread> 80104b52: 83 c4 10 add $0x10,%esp 80104b55: c9 leave 80104b56: c3 ret 80104b57: 89 f6 mov %esi,%esi 80104b59: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104b60: b8 ff ff ff ff mov $0xffffffff,%eax 80104b65: c9 leave 80104b66: c3 ret 80104b67: 89 f6 mov %esi,%esi 80104b69: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104b70 <sys_write>: 80104b70: 55 push %ebp 80104b71: 31 c0 xor %eax,%eax 80104b73: 89 e5 mov %esp,%ebp 80104b75: 83 ec 18 sub $0x18,%esp 80104b78: 8d 55 ec lea -0x14(%ebp),%edx 80104b7b: e8 c0 fe ff ff call 80104a40 <argfd.constprop.0> 80104b80: 85 c0 test %eax,%eax 80104b82: 78 4c js 80104bd0 <sys_write+0x60> 80104b84: 8d 45 f0 lea -0x10(%ebp),%eax 80104b87: 83 ec 08 sub $0x8,%esp 80104b8a: 50 push %eax 80104b8b: 6a 02 push $0x2 80104b8d: e8 be fb ff ff call 80104750 <argint> 80104b92: 83 c4 10 add $0x10,%esp 80104b95: 85 c0 test %eax,%eax 80104b97: 78 37 js 80104bd0 <sys_write+0x60> 80104b99: 8d 45 f4 lea -0xc(%ebp),%eax 80104b9c: 83 ec 04 sub $0x4,%esp 80104b9f: ff 75 f0 pushl -0x10(%ebp) 80104ba2: 50 push %eax 80104ba3: 6a 01 push $0x1 80104ba5: e8 f6 fb ff ff call 801047a0 <argptr> 80104baa: 83 c4 10 add $0x10,%esp 80104bad: 85 c0 test %eax,%eax 80104baf: 78 1f js 80104bd0 <sys_write+0x60> 80104bb1: 83 ec 04 sub $0x4,%esp 80104bb4: ff 75 f0 pushl -0x10(%ebp) 80104bb7: ff 75 f4 pushl -0xc(%ebp) 80104bba: ff 75 ec pushl -0x14(%ebp) 80104bbd: e8 2e c4 ff ff call 80100ff0 <filewrite> 80104bc2: 83 c4 10 add $0x10,%esp 80104bc5: c9 leave 80104bc6: c3 ret 80104bc7: 89 f6 mov %esi,%esi 80104bc9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104bd0: b8 ff ff ff ff mov $0xffffffff,%eax 80104bd5: c9 leave 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_close>: 80104be0: 55 push %ebp 80104be1: 89 e5 mov %esp,%ebp 80104be3: 83 ec 18 sub $0x18,%esp 80104be6: 8d 55 f4 lea -0xc(%ebp),%edx 80104be9: 8d 45 f0 lea -0x10(%ebp),%eax 80104bec: e8 4f fe ff ff call 80104a40 <argfd.constprop.0> 80104bf1: 85 c0 test %eax,%eax 80104bf3: 78 2b js 80104c20 <sys_close+0x40> 80104bf5: e8 e6 eb ff ff call 801037e0 <myproc> 80104bfa: 8b 55 f0 mov -0x10(%ebp),%edx 80104bfd: 83 ec 0c sub $0xc,%esp 80104c00: c7 44 90 28 00 00 00 movl $0x0,0x28(%eax,%edx,4) 80104c07: 00 80104c08: ff 75 f4 pushl -0xc(%ebp) 80104c0b: e8 30 c2 ff ff call 80100e40 <fileclose> 80104c10: 83 c4 10 add $0x10,%esp 80104c13: 31 c0 xor %eax,%eax 80104c15: c9 leave 80104c16: c3 ret 80104c17: 89 f6 mov %esi,%esi 80104c19: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104c20: b8 ff ff ff ff mov $0xffffffff,%eax 80104c25: c9 leave 80104c26: c3 ret 80104c27: 89 f6 mov %esi,%esi 80104c29: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104c30 <sys_fstat>: 80104c30: 55 push %ebp 80104c31: 31 c0 xor %eax,%eax 80104c33: 89 e5 mov %esp,%ebp 80104c35: 83 ec 18 sub $0x18,%esp 80104c38: 8d 55 f0 lea -0x10(%ebp),%edx 80104c3b: e8 00 fe ff ff call 80104a40 <argfd.constprop.0> 80104c40: 85 c0 test %eax,%eax 80104c42: 78 2c js 80104c70 <sys_fstat+0x40> 80104c44: 8d 45 f4 lea -0xc(%ebp),%eax 80104c47: 83 ec 04 sub $0x4,%esp 80104c4a: 6a 14 push $0x14 80104c4c: 50 push %eax 80104c4d: 6a 01 push $0x1 80104c4f: e8 4c fb ff ff call 801047a0 <argptr> 80104c54: 83 c4 10 add $0x10,%esp 80104c57: 85 c0 test %eax,%eax 80104c59: 78 15 js 80104c70 <sys_fstat+0x40> 80104c5b: 83 ec 08 sub $0x8,%esp 80104c5e: ff 75 f4 pushl -0xc(%ebp) 80104c61: ff 75 f0 pushl -0x10(%ebp) 80104c64: e8 a7 c2 ff ff call 80100f10 <filestat> 80104c69: 83 c4 10 add $0x10,%esp 80104c6c: c9 leave 80104c6d: c3 ret 80104c6e: 66 90 xchg %ax,%ax 80104c70: b8 ff ff ff ff mov $0xffffffff,%eax 80104c75: c9 leave 80104c76: c3 ret 80104c77: 89 f6 mov %esi,%esi 80104c79: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104c80 <sys_link>: 80104c80: 55 push %ebp 80104c81: 89 e5 mov %esp,%ebp 80104c83: 57 push %edi 80104c84: 56 push %esi 80104c85: 53 push %ebx 80104c86: 8d 45 d4 lea -0x2c(%ebp),%eax 80104c89: 83 ec 34 sub $0x34,%esp 80104c8c: 50 push %eax 80104c8d: 6a 00 push $0x0 80104c8f: e8 6c fb ff ff call 80104800 <argstr> 80104c94: 83 c4 10 add $0x10,%esp 80104c97: 85 c0 test %eax,%eax 80104c99: 0f 88 fb 00 00 00 js 80104d9a <sys_link+0x11a> 80104c9f: 8d 45 d0 lea -0x30(%ebp),%eax 80104ca2: 83 ec 08 sub $0x8,%esp 80104ca5: 50 push %eax 80104ca6: 6a 01 push $0x1 80104ca8: e8 53 fb ff ff call 80104800 <argstr> 80104cad: 83 c4 10 add $0x10,%esp 80104cb0: 85 c0 test %eax,%eax 80104cb2: 0f 88 e2 00 00 00 js 80104d9a <sys_link+0x11a> 80104cb8: e8 e3 de ff ff call 80102ba0 <begin_op> 80104cbd: 83 ec 0c sub $0xc,%esp 80104cc0: ff 75 d4 pushl -0x2c(%ebp) 80104cc3: e8 18 d2 ff ff call 80101ee0 <namei> 80104cc8: 83 c4 10 add $0x10,%esp 80104ccb: 85 c0 test %eax,%eax 80104ccd: 89 c3 mov %eax,%ebx 80104ccf: 0f 84 ea 00 00 00 je 80104dbf <sys_link+0x13f> 80104cd5: 83 ec 0c sub $0xc,%esp 80104cd8: 50 push %eax 80104cd9: e8 a2 c9 ff ff call 80101680 <ilock> 80104cde: 83 c4 10 add $0x10,%esp 80104ce1: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80104ce6: 0f 84 bb 00 00 00 je 80104da7 <sys_link+0x127> 80104cec: 66 83 43 56 01 addw $0x1,0x56(%ebx) 80104cf1: 83 ec 0c sub $0xc,%esp 80104cf4: 8d 7d da lea -0x26(%ebp),%edi 80104cf7: 53 push %ebx 80104cf8: e8 d3 c8 ff ff call 801015d0 <iupdate> 80104cfd: 89 1c 24 mov %ebx,(%esp) 80104d00: e8 5b ca ff ff call 80101760 <iunlock> 80104d05: 58 pop %eax 80104d06: 5a pop %edx 80104d07: 57 push %edi 80104d08: ff 75 d0 pushl -0x30(%ebp) 80104d0b: e8 f0 d1 ff ff call 80101f00 <nameiparent> 80104d10: 83 c4 10 add $0x10,%esp 80104d13: 85 c0 test %eax,%eax 80104d15: 89 c6 mov %eax,%esi 80104d17: 74 5b je 80104d74 <sys_link+0xf4> 80104d19: 83 ec 0c sub $0xc,%esp 80104d1c: 50 push %eax 80104d1d: e8 5e c9 ff ff call 80101680 <ilock> 80104d22: 83 c4 10 add $0x10,%esp 80104d25: 8b 03 mov (%ebx),%eax 80104d27: 39 06 cmp %eax,(%esi) 80104d29: 75 3d jne 80104d68 <sys_link+0xe8> 80104d2b: 83 ec 04 sub $0x4,%esp 80104d2e: ff 73 04 pushl 0x4(%ebx) 80104d31: 57 push %edi 80104d32: 56 push %esi 80104d33: e8 e8 d0 ff ff call 80101e20 <dirlink> 80104d38: 83 c4 10 add $0x10,%esp 80104d3b: 85 c0 test %eax,%eax 80104d3d: 78 29 js 80104d68 <sys_link+0xe8> 80104d3f: 83 ec 0c sub $0xc,%esp 80104d42: 56 push %esi 80104d43: e8 c8 cb ff ff call 80101910 <iunlockput> 80104d48: 89 1c 24 mov %ebx,(%esp) 80104d4b: e8 60 ca ff ff call 801017b0 <iput> 80104d50: e8 bb de ff ff call 80102c10 <end_op> 80104d55: 83 c4 10 add $0x10,%esp 80104d58: 31 c0 xor %eax,%eax 80104d5a: 8d 65 f4 lea -0xc(%ebp),%esp 80104d5d: 5b pop %ebx 80104d5e: 5e pop %esi 80104d5f: 5f pop %edi 80104d60: 5d pop %ebp 80104d61: c3 ret 80104d62: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104d68: 83 ec 0c sub $0xc,%esp 80104d6b: 56 push %esi 80104d6c: e8 9f cb ff ff call 80101910 <iunlockput> 80104d71: 83 c4 10 add $0x10,%esp 80104d74: 83 ec 0c sub $0xc,%esp 80104d77: 53 push %ebx 80104d78: e8 03 c9 ff ff call 80101680 <ilock> 80104d7d: 66 83 6b 56 01 subw $0x1,0x56(%ebx) 80104d82: 89 1c 24 mov %ebx,(%esp) 80104d85: e8 46 c8 ff ff call 801015d0 <iupdate> 80104d8a: 89 1c 24 mov %ebx,(%esp) 80104d8d: e8 7e cb ff ff call 80101910 <iunlockput> 80104d92: e8 79 de ff ff call 80102c10 <end_op> 80104d97: 83 c4 10 add $0x10,%esp 80104d9a: 8d 65 f4 lea -0xc(%ebp),%esp 80104d9d: b8 ff ff ff ff mov $0xffffffff,%eax 80104da2: 5b pop %ebx 80104da3: 5e pop %esi 80104da4: 5f pop %edi 80104da5: 5d pop %ebp 80104da6: c3 ret 80104da7: 83 ec 0c sub $0xc,%esp 80104daa: 53 push %ebx 80104dab: e8 60 cb ff ff call 80101910 <iunlockput> 80104db0: e8 5b de ff ff call 80102c10 <end_op> 80104db5: 83 c4 10 add $0x10,%esp 80104db8: b8 ff ff ff ff mov $0xffffffff,%eax 80104dbd: eb 9b jmp 80104d5a <sys_link+0xda> 80104dbf: e8 4c de ff ff call 80102c10 <end_op> 80104dc4: b8 ff ff ff ff mov $0xffffffff,%eax 80104dc9: eb 8f jmp 80104d5a <sys_link+0xda> 80104dcb: 90 nop 80104dcc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104dd0 <sys_unlink>: 80104dd0: 55 push %ebp 80104dd1: 89 e5 mov %esp,%ebp 80104dd3: 57 push %edi 80104dd4: 56 push %esi 80104dd5: 53 push %ebx 80104dd6: 8d 45 c0 lea -0x40(%ebp),%eax 80104dd9: 83 ec 44 sub $0x44,%esp 80104ddc: 50 push %eax 80104ddd: 6a 00 push $0x0 80104ddf: e8 1c fa ff ff call 80104800 <argstr> 80104de4: 83 c4 10 add $0x10,%esp 80104de7: 85 c0 test %eax,%eax 80104de9: 0f 88 77 01 00 00 js 80104f66 <sys_unlink+0x196> 80104def: 8d 5d ca lea -0x36(%ebp),%ebx 80104df2: e8 a9 dd ff ff call 80102ba0 <begin_op> 80104df7: 83 ec 08 sub $0x8,%esp 80104dfa: 53 push %ebx 80104dfb: ff 75 c0 pushl -0x40(%ebp) 80104dfe: e8 fd d0 ff ff call 80101f00 <nameiparent> 80104e03: 83 c4 10 add $0x10,%esp 80104e06: 85 c0 test %eax,%eax 80104e08: 89 c6 mov %eax,%esi 80104e0a: 0f 84 60 01 00 00 je 80104f70 <sys_unlink+0x1a0> 80104e10: 83 ec 0c sub $0xc,%esp 80104e13: 50 push %eax 80104e14: e8 67 c8 ff ff call 80101680 <ilock> 80104e19: 58 pop %eax 80104e1a: 5a pop %edx 80104e1b: 68 14 76 10 80 push $0x80107614 80104e20: 53 push %ebx 80104e21: e8 6a cd ff ff call 80101b90 <namecmp> 80104e26: 83 c4 10 add $0x10,%esp 80104e29: 85 c0 test %eax,%eax 80104e2b: 0f 84 03 01 00 00 je 80104f34 <sys_unlink+0x164> 80104e31: 83 ec 08 sub $0x8,%esp 80104e34: 68 13 76 10 80 push $0x80107613 80104e39: 53 push %ebx 80104e3a: e8 51 cd ff ff call 80101b90 <namecmp> 80104e3f: 83 c4 10 add $0x10,%esp 80104e42: 85 c0 test %eax,%eax 80104e44: 0f 84 ea 00 00 00 je 80104f34 <sys_unlink+0x164> 80104e4a: 8d 45 c4 lea -0x3c(%ebp),%eax 80104e4d: 83 ec 04 sub $0x4,%esp 80104e50: 50 push %eax 80104e51: 53 push %ebx 80104e52: 56 push %esi 80104e53: e8 58 cd ff ff call 80101bb0 <dirlookup> 80104e58: 83 c4 10 add $0x10,%esp 80104e5b: 85 c0 test %eax,%eax 80104e5d: 89 c3 mov %eax,%ebx 80104e5f: 0f 84 cf 00 00 00 je 80104f34 <sys_unlink+0x164> 80104e65: 83 ec 0c sub $0xc,%esp 80104e68: 50 push %eax 80104e69: e8 12 c8 ff ff call 80101680 <ilock> 80104e6e: 83 c4 10 add $0x10,%esp 80104e71: 66 83 7b 56 00 cmpw $0x0,0x56(%ebx) 80104e76: 0f 8e 10 01 00 00 jle 80104f8c <sys_unlink+0x1bc> 80104e7c: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80104e81: 74 6d je 80104ef0 <sys_unlink+0x120> 80104e83: 8d 45 d8 lea -0x28(%ebp),%eax 80104e86: 83 ec 04 sub $0x4,%esp 80104e89: 6a 10 push $0x10 80104e8b: 6a 00 push $0x0 80104e8d: 50 push %eax 80104e8e: e8 bd f5 ff ff call 80104450 <memset> 80104e93: 8d 45 d8 lea -0x28(%ebp),%eax 80104e96: 6a 10 push $0x10 80104e98: ff 75 c4 pushl -0x3c(%ebp) 80104e9b: 50 push %eax 80104e9c: 56 push %esi 80104e9d: e8 be cb ff ff call 80101a60 <writei> 80104ea2: 83 c4 20 add $0x20,%esp 80104ea5: 83 f8 10 cmp $0x10,%eax 80104ea8: 0f 85 eb 00 00 00 jne 80104f99 <sys_unlink+0x1c9> 80104eae: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80104eb3: 0f 84 97 00 00 00 je 80104f50 <sys_unlink+0x180> 80104eb9: 83 ec 0c sub $0xc,%esp 80104ebc: 56 push %esi 80104ebd: e8 4e ca ff ff call 80101910 <iunlockput> 80104ec2: 66 83 6b 56 01 subw $0x1,0x56(%ebx) 80104ec7: 89 1c 24 mov %ebx,(%esp) 80104eca: e8 01 c7 ff ff call 801015d0 <iupdate> 80104ecf: 89 1c 24 mov %ebx,(%esp) 80104ed2: e8 39 ca ff ff call 80101910 <iunlockput> 80104ed7: e8 34 dd ff ff call 80102c10 <end_op> 80104edc: 83 c4 10 add $0x10,%esp 80104edf: 31 c0 xor %eax,%eax 80104ee1: 8d 65 f4 lea -0xc(%ebp),%esp 80104ee4: 5b pop %ebx 80104ee5: 5e pop %esi 80104ee6: 5f pop %edi 80104ee7: 5d pop %ebp 80104ee8: c3 ret 80104ee9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104ef0: 83 7b 58 20 cmpl $0x20,0x58(%ebx) 80104ef4: 76 8d jbe 80104e83 <sys_unlink+0xb3> 80104ef6: bf 20 00 00 00 mov $0x20,%edi 80104efb: eb 0f jmp 80104f0c <sys_unlink+0x13c> 80104efd: 8d 76 00 lea 0x0(%esi),%esi 80104f00: 83 c7 10 add $0x10,%edi 80104f03: 3b 7b 58 cmp 0x58(%ebx),%edi 80104f06: 0f 83 77 ff ff ff jae 80104e83 <sys_unlink+0xb3> 80104f0c: 8d 45 d8 lea -0x28(%ebp),%eax 80104f0f: 6a 10 push $0x10 80104f11: 57 push %edi 80104f12: 50 push %eax 80104f13: 53 push %ebx 80104f14: e8 47 ca ff ff call 80101960 <readi> 80104f19: 83 c4 10 add $0x10,%esp 80104f1c: 83 f8 10 cmp $0x10,%eax 80104f1f: 75 5e jne 80104f7f <sys_unlink+0x1af> 80104f21: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp) 80104f26: 74 d8 je 80104f00 <sys_unlink+0x130> 80104f28: 83 ec 0c sub $0xc,%esp 80104f2b: 53 push %ebx 80104f2c: e8 df c9 ff ff call 80101910 <iunlockput> 80104f31: 83 c4 10 add $0x10,%esp 80104f34: 83 ec 0c sub $0xc,%esp 80104f37: 56 push %esi 80104f38: e8 d3 c9 ff ff call 80101910 <iunlockput> 80104f3d: e8 ce dc ff ff call 80102c10 <end_op> 80104f42: 83 c4 10 add $0x10,%esp 80104f45: b8 ff ff ff ff mov $0xffffffff,%eax 80104f4a: eb 95 jmp 80104ee1 <sys_unlink+0x111> 80104f4c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104f50: 66 83 6e 56 01 subw $0x1,0x56(%esi) 80104f55: 83 ec 0c sub $0xc,%esp 80104f58: 56 push %esi 80104f59: e8 72 c6 ff ff call 801015d0 <iupdate> 80104f5e: 83 c4 10 add $0x10,%esp 80104f61: e9 53 ff ff ff jmp 80104eb9 <sys_unlink+0xe9> 80104f66: b8 ff ff ff ff mov $0xffffffff,%eax 80104f6b: e9 71 ff ff ff jmp 80104ee1 <sys_unlink+0x111> 80104f70: e8 9b dc ff ff call 80102c10 <end_op> 80104f75: b8 ff ff ff ff mov $0xffffffff,%eax 80104f7a: e9 62 ff ff ff jmp 80104ee1 <sys_unlink+0x111> 80104f7f: 83 ec 0c sub $0xc,%esp 80104f82: 68 38 76 10 80 push $0x80107638 80104f87: e8 04 b4 ff ff call 80100390 <panic> 80104f8c: 83 ec 0c sub $0xc,%esp 80104f8f: 68 26 76 10 80 push $0x80107626 80104f94: e8 f7 b3 ff ff call 80100390 <panic> 80104f99: 83 ec 0c sub $0xc,%esp 80104f9c: 68 4a 76 10 80 push $0x8010764a 80104fa1: e8 ea b3 ff ff call 80100390 <panic> 80104fa6: 8d 76 00 lea 0x0(%esi),%esi 80104fa9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104fb0 <sys_open>: 80104fb0: 55 push %ebp 80104fb1: 89 e5 mov %esp,%ebp 80104fb3: 57 push %edi 80104fb4: 56 push %esi 80104fb5: 53 push %ebx 80104fb6: 8d 45 e0 lea -0x20(%ebp),%eax 80104fb9: 83 ec 24 sub $0x24,%esp 80104fbc: 50 push %eax 80104fbd: 6a 00 push $0x0 80104fbf: e8 3c f8 ff ff call 80104800 <argstr> 80104fc4: 83 c4 10 add $0x10,%esp 80104fc7: 85 c0 test %eax,%eax 80104fc9: 0f 88 1d 01 00 00 js 801050ec <sys_open+0x13c> 80104fcf: 8d 45 e4 lea -0x1c(%ebp),%eax 80104fd2: 83 ec 08 sub $0x8,%esp 80104fd5: 50 push %eax 80104fd6: 6a 01 push $0x1 80104fd8: e8 73 f7 ff ff call 80104750 <argint> 80104fdd: 83 c4 10 add $0x10,%esp 80104fe0: 85 c0 test %eax,%eax 80104fe2: 0f 88 04 01 00 00 js 801050ec <sys_open+0x13c> 80104fe8: e8 b3 db ff ff call 80102ba0 <begin_op> 80104fed: f6 45 e5 02 testb $0x2,-0x1b(%ebp) 80104ff1: 0f 85 a9 00 00 00 jne 801050a0 <sys_open+0xf0> 80104ff7: 83 ec 0c sub $0xc,%esp 80104ffa: ff 75 e0 pushl -0x20(%ebp) 80104ffd: e8 de ce ff ff call 80101ee0 <namei> 80105002: 83 c4 10 add $0x10,%esp 80105005: 85 c0 test %eax,%eax 80105007: 89 c6 mov %eax,%esi 80105009: 0f 84 b2 00 00 00 je 801050c1 <sys_open+0x111> 8010500f: 83 ec 0c sub $0xc,%esp 80105012: 50 push %eax 80105013: e8 68 c6 ff ff call 80101680 <ilock> 80105018: 83 c4 10 add $0x10,%esp 8010501b: 66 83 7e 50 01 cmpw $0x1,0x50(%esi) 80105020: 0f 84 aa 00 00 00 je 801050d0 <sys_open+0x120> 80105026: e8 55 bd ff ff call 80100d80 <filealloc> 8010502b: 85 c0 test %eax,%eax 8010502d: 89 c7 mov %eax,%edi 8010502f: 0f 84 a6 00 00 00 je 801050db <sys_open+0x12b> 80105035: e8 a6 e7 ff ff call 801037e0 <myproc> 8010503a: 31 db xor %ebx,%ebx 8010503c: eb 0e jmp 8010504c <sys_open+0x9c> 8010503e: 66 90 xchg %ax,%ax 80105040: 83 c3 01 add $0x1,%ebx 80105043: 83 fb 10 cmp $0x10,%ebx 80105046: 0f 84 ac 00 00 00 je 801050f8 <sys_open+0x148> 8010504c: 8b 54 98 28 mov 0x28(%eax,%ebx,4),%edx 80105050: 85 d2 test %edx,%edx 80105052: 75 ec jne 80105040 <sys_open+0x90> 80105054: 83 ec 0c sub $0xc,%esp 80105057: 89 7c 98 28 mov %edi,0x28(%eax,%ebx,4) 8010505b: 56 push %esi 8010505c: e8 ff c6 ff ff call 80101760 <iunlock> 80105061: e8 aa db ff ff call 80102c10 <end_op> 80105066: c7 07 02 00 00 00 movl $0x2,(%edi) 8010506c: 8b 55 e4 mov -0x1c(%ebp),%edx 8010506f: 83 c4 10 add $0x10,%esp 80105072: 89 77 10 mov %esi,0x10(%edi) 80105075: c7 47 14 00 00 00 00 movl $0x0,0x14(%edi) 8010507c: 89 d0 mov %edx,%eax 8010507e: f7 d0 not %eax 80105080: 83 e0 01 and $0x1,%eax 80105083: 83 e2 03 and $0x3,%edx 80105086: 88 47 08 mov %al,0x8(%edi) 80105089: 0f 95 47 09 setne 0x9(%edi) 8010508d: 8d 65 f4 lea -0xc(%ebp),%esp 80105090: 89 d8 mov %ebx,%eax 80105092: 5b pop %ebx 80105093: 5e pop %esi 80105094: 5f pop %edi 80105095: 5d pop %ebp 80105096: c3 ret 80105097: 89 f6 mov %esi,%esi 80105099: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801050a0: 83 ec 0c sub $0xc,%esp 801050a3: 8b 45 e0 mov -0x20(%ebp),%eax 801050a6: 31 c9 xor %ecx,%ecx 801050a8: 6a 00 push $0x0 801050aa: ba 02 00 00 00 mov $0x2,%edx 801050af: e8 ec f7 ff ff call 801048a0 <create> 801050b4: 83 c4 10 add $0x10,%esp 801050b7: 85 c0 test %eax,%eax 801050b9: 89 c6 mov %eax,%esi 801050bb: 0f 85 65 ff ff ff jne 80105026 <sys_open+0x76> 801050c1: e8 4a db ff ff call 80102c10 <end_op> 801050c6: bb ff ff ff ff mov $0xffffffff,%ebx 801050cb: eb c0 jmp 8010508d <sys_open+0xdd> 801050cd: 8d 76 00 lea 0x0(%esi),%esi 801050d0: 8b 4d e4 mov -0x1c(%ebp),%ecx 801050d3: 85 c9 test %ecx,%ecx 801050d5: 0f 84 4b ff ff ff je 80105026 <sys_open+0x76> 801050db: 83 ec 0c sub $0xc,%esp 801050de: 56 push %esi 801050df: e8 2c c8 ff ff call 80101910 <iunlockput> 801050e4: e8 27 db ff ff call 80102c10 <end_op> 801050e9: 83 c4 10 add $0x10,%esp 801050ec: bb ff ff ff ff mov $0xffffffff,%ebx 801050f1: eb 9a jmp 8010508d <sys_open+0xdd> 801050f3: 90 nop 801050f4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801050f8: 83 ec 0c sub $0xc,%esp 801050fb: 57 push %edi 801050fc: e8 3f bd ff ff call 80100e40 <fileclose> 80105101: 83 c4 10 add $0x10,%esp 80105104: eb d5 jmp 801050db <sys_open+0x12b> 80105106: 8d 76 00 lea 0x0(%esi),%esi 80105109: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105110 <sys_mkdir>: 80105110: 55 push %ebp 80105111: 89 e5 mov %esp,%ebp 80105113: 83 ec 18 sub $0x18,%esp 80105116: e8 85 da ff ff call 80102ba0 <begin_op> 8010511b: 8d 45 f4 lea -0xc(%ebp),%eax 8010511e: 83 ec 08 sub $0x8,%esp 80105121: 50 push %eax 80105122: 6a 00 push $0x0 80105124: e8 d7 f6 ff ff call 80104800 <argstr> 80105129: 83 c4 10 add $0x10,%esp 8010512c: 85 c0 test %eax,%eax 8010512e: 78 30 js 80105160 <sys_mkdir+0x50> 80105130: 83 ec 0c sub $0xc,%esp 80105133: 8b 45 f4 mov -0xc(%ebp),%eax 80105136: 31 c9 xor %ecx,%ecx 80105138: 6a 00 push $0x0 8010513a: ba 01 00 00 00 mov $0x1,%edx 8010513f: e8 5c f7 ff ff call 801048a0 <create> 80105144: 83 c4 10 add $0x10,%esp 80105147: 85 c0 test %eax,%eax 80105149: 74 15 je 80105160 <sys_mkdir+0x50> 8010514b: 83 ec 0c sub $0xc,%esp 8010514e: 50 push %eax 8010514f: e8 bc c7 ff ff call 80101910 <iunlockput> 80105154: e8 b7 da ff ff call 80102c10 <end_op> 80105159: 83 c4 10 add $0x10,%esp 8010515c: 31 c0 xor %eax,%eax 8010515e: c9 leave 8010515f: c3 ret 80105160: e8 ab da ff ff call 80102c10 <end_op> 80105165: b8 ff ff ff ff mov $0xffffffff,%eax 8010516a: c9 leave 8010516b: c3 ret 8010516c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105170 <sys_mknod>: 80105170: 55 push %ebp 80105171: 89 e5 mov %esp,%ebp 80105173: 83 ec 18 sub $0x18,%esp 80105176: e8 25 da ff ff call 80102ba0 <begin_op> 8010517b: 8d 45 ec lea -0x14(%ebp),%eax 8010517e: 83 ec 08 sub $0x8,%esp 80105181: 50 push %eax 80105182: 6a 00 push $0x0 80105184: e8 77 f6 ff ff call 80104800 <argstr> 80105189: 83 c4 10 add $0x10,%esp 8010518c: 85 c0 test %eax,%eax 8010518e: 78 60 js 801051f0 <sys_mknod+0x80> 80105190: 8d 45 f0 lea -0x10(%ebp),%eax 80105193: 83 ec 08 sub $0x8,%esp 80105196: 50 push %eax 80105197: 6a 01 push $0x1 80105199: e8 b2 f5 ff ff call 80104750 <argint> 8010519e: 83 c4 10 add $0x10,%esp 801051a1: 85 c0 test %eax,%eax 801051a3: 78 4b js 801051f0 <sys_mknod+0x80> 801051a5: 8d 45 f4 lea -0xc(%ebp),%eax 801051a8: 83 ec 08 sub $0x8,%esp 801051ab: 50 push %eax 801051ac: 6a 02 push $0x2 801051ae: e8 9d f5 ff ff call 80104750 <argint> 801051b3: 83 c4 10 add $0x10,%esp 801051b6: 85 c0 test %eax,%eax 801051b8: 78 36 js 801051f0 <sys_mknod+0x80> 801051ba: 0f bf 45 f4 movswl -0xc(%ebp),%eax 801051be: 83 ec 0c sub $0xc,%esp 801051c1: 0f bf 4d f0 movswl -0x10(%ebp),%ecx 801051c5: ba 03 00 00 00 mov $0x3,%edx 801051ca: 50 push %eax 801051cb: 8b 45 ec mov -0x14(%ebp),%eax 801051ce: e8 cd f6 ff ff call 801048a0 <create> 801051d3: 83 c4 10 add $0x10,%esp 801051d6: 85 c0 test %eax,%eax 801051d8: 74 16 je 801051f0 <sys_mknod+0x80> 801051da: 83 ec 0c sub $0xc,%esp 801051dd: 50 push %eax 801051de: e8 2d c7 ff ff call 80101910 <iunlockput> 801051e3: e8 28 da ff ff call 80102c10 <end_op> 801051e8: 83 c4 10 add $0x10,%esp 801051eb: 31 c0 xor %eax,%eax 801051ed: c9 leave 801051ee: c3 ret 801051ef: 90 nop 801051f0: e8 1b da ff ff call 80102c10 <end_op> 801051f5: b8 ff ff ff ff mov $0xffffffff,%eax 801051fa: c9 leave 801051fb: c3 ret 801051fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105200 <sys_chdir>: 80105200: 55 push %ebp 80105201: 89 e5 mov %esp,%ebp 80105203: 56 push %esi 80105204: 53 push %ebx 80105205: 83 ec 10 sub $0x10,%esp 80105208: e8 d3 e5 ff ff call 801037e0 <myproc> 8010520d: 89 c6 mov %eax,%esi 8010520f: e8 8c d9 ff ff call 80102ba0 <begin_op> 80105214: 8d 45 f4 lea -0xc(%ebp),%eax 80105217: 83 ec 08 sub $0x8,%esp 8010521a: 50 push %eax 8010521b: 6a 00 push $0x0 8010521d: e8 de f5 ff ff call 80104800 <argstr> 80105222: 83 c4 10 add $0x10,%esp 80105225: 85 c0 test %eax,%eax 80105227: 78 77 js 801052a0 <sys_chdir+0xa0> 80105229: 83 ec 0c sub $0xc,%esp 8010522c: ff 75 f4 pushl -0xc(%ebp) 8010522f: e8 ac cc ff ff call 80101ee0 <namei> 80105234: 83 c4 10 add $0x10,%esp 80105237: 85 c0 test %eax,%eax 80105239: 89 c3 mov %eax,%ebx 8010523b: 74 63 je 801052a0 <sys_chdir+0xa0> 8010523d: 83 ec 0c sub $0xc,%esp 80105240: 50 push %eax 80105241: e8 3a c4 ff ff call 80101680 <ilock> 80105246: 83 c4 10 add $0x10,%esp 80105249: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 8010524e: 75 30 jne 80105280 <sys_chdir+0x80> 80105250: 83 ec 0c sub $0xc,%esp 80105253: 53 push %ebx 80105254: e8 07 c5 ff ff call 80101760 <iunlock> 80105259: 58 pop %eax 8010525a: ff 76 68 pushl 0x68(%esi) 8010525d: e8 4e c5 ff ff call 801017b0 <iput> 80105262: e8 a9 d9 ff ff call 80102c10 <end_op> 80105267: 89 5e 68 mov %ebx,0x68(%esi) 8010526a: 83 c4 10 add $0x10,%esp 8010526d: 31 c0 xor %eax,%eax 8010526f: 8d 65 f8 lea -0x8(%ebp),%esp 80105272: 5b pop %ebx 80105273: 5e pop %esi 80105274: 5d pop %ebp 80105275: c3 ret 80105276: 8d 76 00 lea 0x0(%esi),%esi 80105279: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105280: 83 ec 0c sub $0xc,%esp 80105283: 53 push %ebx 80105284: e8 87 c6 ff ff call 80101910 <iunlockput> 80105289: e8 82 d9 ff ff call 80102c10 <end_op> 8010528e: 83 c4 10 add $0x10,%esp 80105291: b8 ff ff ff ff mov $0xffffffff,%eax 80105296: eb d7 jmp 8010526f <sys_chdir+0x6f> 80105298: 90 nop 80105299: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801052a0: e8 6b d9 ff ff call 80102c10 <end_op> 801052a5: b8 ff ff ff ff mov $0xffffffff,%eax 801052aa: eb c3 jmp 8010526f <sys_chdir+0x6f> 801052ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801052b0 <sys_exec>: 801052b0: 55 push %ebp 801052b1: 89 e5 mov %esp,%ebp 801052b3: 57 push %edi 801052b4: 56 push %esi 801052b5: 53 push %ebx 801052b6: 8d 85 5c ff ff ff lea -0xa4(%ebp),%eax 801052bc: 81 ec a4 00 00 00 sub $0xa4,%esp 801052c2: 50 push %eax 801052c3: 6a 00 push $0x0 801052c5: e8 36 f5 ff ff call 80104800 <argstr> 801052ca: 83 c4 10 add $0x10,%esp 801052cd: 85 c0 test %eax,%eax 801052cf: 0f 88 87 00 00 00 js 8010535c <sys_exec+0xac> 801052d5: 8d 85 60 ff ff ff lea -0xa0(%ebp),%eax 801052db: 83 ec 08 sub $0x8,%esp 801052de: 50 push %eax 801052df: 6a 01 push $0x1 801052e1: e8 6a f4 ff ff call 80104750 <argint> 801052e6: 83 c4 10 add $0x10,%esp 801052e9: 85 c0 test %eax,%eax 801052eb: 78 6f js 8010535c <sys_exec+0xac> 801052ed: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax 801052f3: 83 ec 04 sub $0x4,%esp 801052f6: 31 db xor %ebx,%ebx 801052f8: 68 80 00 00 00 push $0x80 801052fd: 6a 00 push $0x0 801052ff: 8d bd 64 ff ff ff lea -0x9c(%ebp),%edi 80105305: 50 push %eax 80105306: e8 45 f1 ff ff call 80104450 <memset> 8010530b: 83 c4 10 add $0x10,%esp 8010530e: eb 2c jmp 8010533c <sys_exec+0x8c> 80105310: 8b 85 64 ff ff ff mov -0x9c(%ebp),%eax 80105316: 85 c0 test %eax,%eax 80105318: 74 56 je 80105370 <sys_exec+0xc0> 8010531a: 8d 8d 68 ff ff ff lea -0x98(%ebp),%ecx 80105320: 83 ec 08 sub $0x8,%esp 80105323: 8d 14 31 lea (%ecx,%esi,1),%edx 80105326: 52 push %edx 80105327: 50 push %eax 80105328: e8 b3 f3 ff ff call 801046e0 <fetchstr> 8010532d: 83 c4 10 add $0x10,%esp 80105330: 85 c0 test %eax,%eax 80105332: 78 28 js 8010535c <sys_exec+0xac> 80105334: 83 c3 01 add $0x1,%ebx 80105337: 83 fb 20 cmp $0x20,%ebx 8010533a: 74 20 je 8010535c <sys_exec+0xac> 8010533c: 8b 85 60 ff ff ff mov -0xa0(%ebp),%eax 80105342: 8d 34 9d 00 00 00 00 lea 0x0(,%ebx,4),%esi 80105349: 83 ec 08 sub $0x8,%esp 8010534c: 57 push %edi 8010534d: 01 f0 add %esi,%eax 8010534f: 50 push %eax 80105350: e8 4b f3 ff ff call 801046a0 <fetchint> 80105355: 83 c4 10 add $0x10,%esp 80105358: 85 c0 test %eax,%eax 8010535a: 79 b4 jns 80105310 <sys_exec+0x60> 8010535c: 8d 65 f4 lea -0xc(%ebp),%esp 8010535f: b8 ff ff ff ff mov $0xffffffff,%eax 80105364: 5b pop %ebx 80105365: 5e pop %esi 80105366: 5f pop %edi 80105367: 5d pop %ebp 80105368: c3 ret 80105369: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105370: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax 80105376: 83 ec 08 sub $0x8,%esp 80105379: c7 84 9d 68 ff ff ff movl $0x0,-0x98(%ebp,%ebx,4) 80105380: 00 00 00 00 80105384: 50 push %eax 80105385: ff b5 5c ff ff ff pushl -0xa4(%ebp) 8010538b: e8 80 b6 ff ff call 80100a10 <exec> 80105390: 83 c4 10 add $0x10,%esp 80105393: 8d 65 f4 lea -0xc(%ebp),%esp 80105396: 5b pop %ebx 80105397: 5e pop %esi 80105398: 5f pop %edi 80105399: 5d pop %ebp 8010539a: c3 ret 8010539b: 90 nop 8010539c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801053a0 <sys_pipe>: 801053a0: 55 push %ebp 801053a1: 89 e5 mov %esp,%ebp 801053a3: 57 push %edi 801053a4: 56 push %esi 801053a5: 53 push %ebx 801053a6: 8d 45 dc lea -0x24(%ebp),%eax 801053a9: 83 ec 20 sub $0x20,%esp 801053ac: 6a 08 push $0x8 801053ae: 50 push %eax 801053af: 6a 00 push $0x0 801053b1: e8 ea f3 ff ff call 801047a0 <argptr> 801053b6: 83 c4 10 add $0x10,%esp 801053b9: 85 c0 test %eax,%eax 801053bb: 0f 88 ae 00 00 00 js 8010546f <sys_pipe+0xcf> 801053c1: 8d 45 e4 lea -0x1c(%ebp),%eax 801053c4: 83 ec 08 sub $0x8,%esp 801053c7: 50 push %eax 801053c8: 8d 45 e0 lea -0x20(%ebp),%eax 801053cb: 50 push %eax 801053cc: e8 6f de ff ff call 80103240 <pipealloc> 801053d1: 83 c4 10 add $0x10,%esp 801053d4: 85 c0 test %eax,%eax 801053d6: 0f 88 93 00 00 00 js 8010546f <sys_pipe+0xcf> 801053dc: 8b 7d e0 mov -0x20(%ebp),%edi 801053df: 31 db xor %ebx,%ebx 801053e1: e8 fa e3 ff ff call 801037e0 <myproc> 801053e6: eb 10 jmp 801053f8 <sys_pipe+0x58> 801053e8: 90 nop 801053e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801053f0: 83 c3 01 add $0x1,%ebx 801053f3: 83 fb 10 cmp $0x10,%ebx 801053f6: 74 60 je 80105458 <sys_pipe+0xb8> 801053f8: 8b 74 98 28 mov 0x28(%eax,%ebx,4),%esi 801053fc: 85 f6 test %esi,%esi 801053fe: 75 f0 jne 801053f0 <sys_pipe+0x50> 80105400: 8d 73 08 lea 0x8(%ebx),%esi 80105403: 89 7c b0 08 mov %edi,0x8(%eax,%esi,4) 80105407: 8b 7d e4 mov -0x1c(%ebp),%edi 8010540a: e8 d1 e3 ff ff call 801037e0 <myproc> 8010540f: 31 d2 xor %edx,%edx 80105411: eb 0d jmp 80105420 <sys_pipe+0x80> 80105413: 90 nop 80105414: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105418: 83 c2 01 add $0x1,%edx 8010541b: 83 fa 10 cmp $0x10,%edx 8010541e: 74 28 je 80105448 <sys_pipe+0xa8> 80105420: 8b 4c 90 28 mov 0x28(%eax,%edx,4),%ecx 80105424: 85 c9 test %ecx,%ecx 80105426: 75 f0 jne 80105418 <sys_pipe+0x78> 80105428: 89 7c 90 28 mov %edi,0x28(%eax,%edx,4) 8010542c: 8b 45 dc mov -0x24(%ebp),%eax 8010542f: 89 18 mov %ebx,(%eax) 80105431: 8b 45 dc mov -0x24(%ebp),%eax 80105434: 89 50 04 mov %edx,0x4(%eax) 80105437: 31 c0 xor %eax,%eax 80105439: 8d 65 f4 lea -0xc(%ebp),%esp 8010543c: 5b pop %ebx 8010543d: 5e pop %esi 8010543e: 5f pop %edi 8010543f: 5d pop %ebp 80105440: c3 ret 80105441: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105448: e8 93 e3 ff ff call 801037e0 <myproc> 8010544d: c7 44 b0 08 00 00 00 movl $0x0,0x8(%eax,%esi,4) 80105454: 00 80105455: 8d 76 00 lea 0x0(%esi),%esi 80105458: 83 ec 0c sub $0xc,%esp 8010545b: ff 75 e0 pushl -0x20(%ebp) 8010545e: e8 dd b9 ff ff call 80100e40 <fileclose> 80105463: 58 pop %eax 80105464: ff 75 e4 pushl -0x1c(%ebp) 80105467: e8 d4 b9 ff ff call 80100e40 <fileclose> 8010546c: 83 c4 10 add $0x10,%esp 8010546f: b8 ff ff ff ff mov $0xffffffff,%eax 80105474: eb c3 jmp 80105439 <sys_pipe+0x99> 80105476: 66 90 xchg %ax,%ax 80105478: 66 90 xchg %ax,%ax 8010547a: 66 90 xchg %ax,%ax 8010547c: 66 90 xchg %ax,%ax 8010547e: 66 90 xchg %ax,%ax 80105480 <sys_fork>: 80105480: 55 push %ebp 80105481: 89 e5 mov %esp,%ebp 80105483: 5d pop %ebp 80105484: e9 f7 e4 ff ff jmp 80103980 <fork> 80105489: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105490 <sys_exit>: 80105490: 55 push %ebp 80105491: 89 e5 mov %esp,%ebp 80105493: 83 ec 08 sub $0x8,%esp 80105496: e8 65 e7 ff ff call 80103c00 <exit> 8010549b: 31 c0 xor %eax,%eax 8010549d: c9 leave 8010549e: c3 ret 8010549f: 90 nop 801054a0 <sys_wait>: 801054a0: 55 push %ebp 801054a1: 89 e5 mov %esp,%ebp 801054a3: 5d pop %ebp 801054a4: e9 97 e9 ff ff jmp 80103e40 <wait> 801054a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801054b0 <sys_kill>: 801054b0: 55 push %ebp 801054b1: 89 e5 mov %esp,%ebp 801054b3: 83 ec 20 sub $0x20,%esp 801054b6: 8d 45 f4 lea -0xc(%ebp),%eax 801054b9: 50 push %eax 801054ba: 6a 00 push $0x0 801054bc: e8 8f f2 ff ff call 80104750 <argint> 801054c1: 83 c4 10 add $0x10,%esp 801054c4: 85 c0 test %eax,%eax 801054c6: 78 18 js 801054e0 <sys_kill+0x30> 801054c8: 83 ec 0c sub $0xc,%esp 801054cb: ff 75 f4 pushl -0xc(%ebp) 801054ce: e8 bd ea ff ff call 80103f90 <kill> 801054d3: 83 c4 10 add $0x10,%esp 801054d6: c9 leave 801054d7: c3 ret 801054d8: 90 nop 801054d9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801054e0: b8 ff ff ff ff mov $0xffffffff,%eax 801054e5: c9 leave 801054e6: c3 ret 801054e7: 89 f6 mov %esi,%esi 801054e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801054f0 <sys_getpid>: 801054f0: 55 push %ebp 801054f1: 89 e5 mov %esp,%ebp 801054f3: 83 ec 08 sub $0x8,%esp 801054f6: e8 e5 e2 ff ff call 801037e0 <myproc> 801054fb: 8b 40 10 mov 0x10(%eax),%eax 801054fe: c9 leave 801054ff: c3 ret 80105500 <sys_sbrk>: 80105500: 55 push %ebp 80105501: 89 e5 mov %esp,%ebp 80105503: 53 push %ebx 80105504: 8d 45 f4 lea -0xc(%ebp),%eax 80105507: 83 ec 1c sub $0x1c,%esp 8010550a: 50 push %eax 8010550b: 6a 00 push $0x0 8010550d: e8 3e f2 ff ff call 80104750 <argint> 80105512: 83 c4 10 add $0x10,%esp 80105515: 85 c0 test %eax,%eax 80105517: 78 27 js 80105540 <sys_sbrk+0x40> 80105519: e8 c2 e2 ff ff call 801037e0 <myproc> 8010551e: 83 ec 0c sub $0xc,%esp 80105521: 8b 18 mov (%eax),%ebx 80105523: ff 75 f4 pushl -0xc(%ebp) 80105526: e8 d5 e3 ff ff call 80103900 <growproc> 8010552b: 83 c4 10 add $0x10,%esp 8010552e: 85 c0 test %eax,%eax 80105530: 78 0e js 80105540 <sys_sbrk+0x40> 80105532: 89 d8 mov %ebx,%eax 80105534: 8b 5d fc mov -0x4(%ebp),%ebx 80105537: c9 leave 80105538: c3 ret 80105539: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105540: bb ff ff ff ff mov $0xffffffff,%ebx 80105545: eb eb jmp 80105532 <sys_sbrk+0x32> 80105547: 89 f6 mov %esi,%esi 80105549: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105550 <sys_sleep>: 80105550: 55 push %ebp 80105551: 89 e5 mov %esp,%ebp 80105553: 53 push %ebx 80105554: 8d 45 f4 lea -0xc(%ebp),%eax 80105557: 83 ec 1c sub $0x1c,%esp 8010555a: 50 push %eax 8010555b: 6a 00 push $0x0 8010555d: e8 ee f1 ff ff call 80104750 <argint> 80105562: 83 c4 10 add $0x10,%esp 80105565: 85 c0 test %eax,%eax 80105567: 0f 88 8a 00 00 00 js 801055f7 <sys_sleep+0xa7> 8010556d: 83 ec 0c sub $0xc,%esp 80105570: 68 60 4c 11 80 push $0x80114c60 80105575: e8 c6 ed ff ff call 80104340 <acquire> 8010557a: 8b 55 f4 mov -0xc(%ebp),%edx 8010557d: 83 c4 10 add $0x10,%esp 80105580: 8b 1d a0 54 11 80 mov 0x801154a0,%ebx 80105586: 85 d2 test %edx,%edx 80105588: 75 27 jne 801055b1 <sys_sleep+0x61> 8010558a: eb 54 jmp 801055e0 <sys_sleep+0x90> 8010558c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105590: 83 ec 08 sub $0x8,%esp 80105593: 68 60 4c 11 80 push $0x80114c60 80105598: 68 a0 54 11 80 push $0x801154a0 8010559d: e8 de e7 ff ff call 80103d80 <sleep> 801055a2: a1 a0 54 11 80 mov 0x801154a0,%eax 801055a7: 83 c4 10 add $0x10,%esp 801055aa: 29 d8 sub %ebx,%eax 801055ac: 3b 45 f4 cmp -0xc(%ebp),%eax 801055af: 73 2f jae 801055e0 <sys_sleep+0x90> 801055b1: e8 2a e2 ff ff call 801037e0 <myproc> 801055b6: 8b 40 24 mov 0x24(%eax),%eax 801055b9: 85 c0 test %eax,%eax 801055bb: 74 d3 je 80105590 <sys_sleep+0x40> 801055bd: 83 ec 0c sub $0xc,%esp 801055c0: 68 60 4c 11 80 push $0x80114c60 801055c5: e8 36 ee ff ff call 80104400 <release> 801055ca: 83 c4 10 add $0x10,%esp 801055cd: b8 ff ff ff ff mov $0xffffffff,%eax 801055d2: 8b 5d fc mov -0x4(%ebp),%ebx 801055d5: c9 leave 801055d6: c3 ret 801055d7: 89 f6 mov %esi,%esi 801055d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801055e0: 83 ec 0c sub $0xc,%esp 801055e3: 68 60 4c 11 80 push $0x80114c60 801055e8: e8 13 ee ff ff call 80104400 <release> 801055ed: 83 c4 10 add $0x10,%esp 801055f0: 31 c0 xor %eax,%eax 801055f2: 8b 5d fc mov -0x4(%ebp),%ebx 801055f5: c9 leave 801055f6: c3 ret 801055f7: b8 ff ff ff ff mov $0xffffffff,%eax 801055fc: eb f4 jmp 801055f2 <sys_sleep+0xa2> 801055fe: 66 90 xchg %ax,%ax 80105600 <sys_uptime>: 80105600: 55 push %ebp 80105601: 89 e5 mov %esp,%ebp 80105603: 53 push %ebx 80105604: 83 ec 10 sub $0x10,%esp 80105607: 68 60 4c 11 80 push $0x80114c60 8010560c: e8 2f ed ff ff call 80104340 <acquire> 80105611: 8b 1d a0 54 11 80 mov 0x801154a0,%ebx 80105617: c7 04 24 60 4c 11 80 movl $0x80114c60,(%esp) 8010561e: e8 dd ed ff ff call 80104400 <release> 80105623: 89 d8 mov %ebx,%eax 80105625: 8b 5d fc mov -0x4(%ebp),%ebx 80105628: c9 leave 80105629: c3 ret 8010562a <alltraps>: 8010562a: 1e push %ds 8010562b: 06 push %es 8010562c: 0f a0 push %fs 8010562e: 0f a8 push %gs 80105630: 60 pusha 80105631: 66 b8 10 00 mov $0x10,%ax 80105635: 8e d8 mov %eax,%ds 80105637: 8e c0 mov %eax,%es 80105639: 54 push %esp 8010563a: e8 c1 00 00 00 call 80105700 <trap> 8010563f: 83 c4 04 add $0x4,%esp 80105642 <trapret>: 80105642: 61 popa 80105643: 0f a9 pop %gs 80105645: 0f a1 pop %fs 80105647: 07 pop %es 80105648: 1f pop %ds 80105649: 83 c4 08 add $0x8,%esp 8010564c: cf iret 8010564d: 66 90 xchg %ax,%ax 8010564f: 90 nop 80105650 <tvinit>: 80105650: 55 push %ebp 80105651: 31 c0 xor %eax,%eax 80105653: 89 e5 mov %esp,%ebp 80105655: 83 ec 08 sub $0x8,%esp 80105658: 90 nop 80105659: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105660: 8b 14 85 08 a0 10 80 mov -0x7fef5ff8(,%eax,4),%edx 80105667: c7 04 c5 a2 4c 11 80 movl $0x8e000008,-0x7feeb35e(,%eax,8) 8010566e: 08 00 00 8e 80105672: 66 89 14 c5 a0 4c 11 mov %dx,-0x7feeb360(,%eax,8) 80105679: 80 8010567a: c1 ea 10 shr $0x10,%edx 8010567d: 66 89 14 c5 a6 4c 11 mov %dx,-0x7feeb35a(,%eax,8) 80105684: 80 80105685: 83 c0 01 add $0x1,%eax 80105688: 3d 00 01 00 00 cmp $0x100,%eax 8010568d: 75 d1 jne 80105660 <tvinit+0x10> 8010568f: a1 08 a1 10 80 mov 0x8010a108,%eax 80105694: 83 ec 08 sub $0x8,%esp 80105697: c7 05 a2 4e 11 80 08 movl $0xef000008,0x80114ea2 8010569e: 00 00 ef 801056a1: 68 59 76 10 80 push $0x80107659 801056a6: 68 60 4c 11 80 push $0x80114c60 801056ab: 66 a3 a0 4e 11 80 mov %ax,0x80114ea0 801056b1: c1 e8 10 shr $0x10,%eax 801056b4: 66 a3 a6 4e 11 80 mov %ax,0x80114ea6 801056ba: e8 41 eb ff ff call 80104200 <initlock> 801056bf: 83 c4 10 add $0x10,%esp 801056c2: c9 leave 801056c3: c3 ret 801056c4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801056ca: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 801056d0 <idtinit>: 801056d0: 55 push %ebp 801056d1: b8 ff 07 00 00 mov $0x7ff,%eax 801056d6: 89 e5 mov %esp,%ebp 801056d8: 83 ec 10 sub $0x10,%esp 801056db: 66 89 45 fa mov %ax,-0x6(%ebp) 801056df: b8 a0 4c 11 80 mov $0x80114ca0,%eax 801056e4: 66 89 45 fc mov %ax,-0x4(%ebp) 801056e8: c1 e8 10 shr $0x10,%eax 801056eb: 66 89 45 fe mov %ax,-0x2(%ebp) 801056ef: 8d 45 fa lea -0x6(%ebp),%eax 801056f2: 0f 01 18 lidtl (%eax) 801056f5: c9 leave 801056f6: c3 ret 801056f7: 89 f6 mov %esi,%esi 801056f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105700 <trap>: 80105700: 55 push %ebp 80105701: 89 e5 mov %esp,%ebp 80105703: 57 push %edi 80105704: 56 push %esi 80105705: 53 push %ebx 80105706: 83 ec 1c sub $0x1c,%esp 80105709: 8b 7d 08 mov 0x8(%ebp),%edi 8010570c: 8b 47 30 mov 0x30(%edi),%eax 8010570f: 83 f8 40 cmp $0x40,%eax 80105712: 0f 84 f0 00 00 00 je 80105808 <trap+0x108> 80105718: 83 e8 20 sub $0x20,%eax 8010571b: 83 f8 1f cmp $0x1f,%eax 8010571e: 77 10 ja 80105730 <trap+0x30> 80105720: ff 24 85 00 77 10 80 jmp *-0x7fef8900(,%eax,4) 80105727: 89 f6 mov %esi,%esi 80105729: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105730: e8 ab e0 ff ff call 801037e0 <myproc> 80105735: 85 c0 test %eax,%eax 80105737: 8b 5f 38 mov 0x38(%edi),%ebx 8010573a: 0f 84 14 02 00 00 je 80105954 <trap+0x254> 80105740: f6 47 3c 03 testb $0x3,0x3c(%edi) 80105744: 0f 84 0a 02 00 00 je 80105954 <trap+0x254> 8010574a: 0f 20 d1 mov %cr2,%ecx 8010574d: 89 4d d8 mov %ecx,-0x28(%ebp) 80105750: e8 6b e0 ff ff call 801037c0 <cpuid> 80105755: 89 45 dc mov %eax,-0x24(%ebp) 80105758: 8b 47 34 mov 0x34(%edi),%eax 8010575b: 8b 77 30 mov 0x30(%edi),%esi 8010575e: 89 45 e4 mov %eax,-0x1c(%ebp) 80105761: e8 7a e0 ff ff call 801037e0 <myproc> 80105766: 89 45 e0 mov %eax,-0x20(%ebp) 80105769: e8 72 e0 ff ff call 801037e0 <myproc> 8010576e: 8b 4d d8 mov -0x28(%ebp),%ecx 80105771: 8b 55 dc mov -0x24(%ebp),%edx 80105774: 51 push %ecx 80105775: 53 push %ebx 80105776: 52 push %edx 80105777: 8b 55 e0 mov -0x20(%ebp),%edx 8010577a: ff 75 e4 pushl -0x1c(%ebp) 8010577d: 56 push %esi 8010577e: 83 c2 6c add $0x6c,%edx 80105781: 52 push %edx 80105782: ff 70 10 pushl 0x10(%eax) 80105785: 68 bc 76 10 80 push $0x801076bc 8010578a: e8 d1 ae ff ff call 80100660 <cprintf> 8010578f: 83 c4 20 add $0x20,%esp 80105792: e8 49 e0 ff ff call 801037e0 <myproc> 80105797: c7 40 24 01 00 00 00 movl $0x1,0x24(%eax) 8010579e: e8 3d e0 ff ff call 801037e0 <myproc> 801057a3: 85 c0 test %eax,%eax 801057a5: 74 1d je 801057c4 <trap+0xc4> 801057a7: e8 34 e0 ff ff call 801037e0 <myproc> 801057ac: 8b 50 24 mov 0x24(%eax),%edx 801057af: 85 d2 test %edx,%edx 801057b1: 74 11 je 801057c4 <trap+0xc4> 801057b3: 0f b7 47 3c movzwl 0x3c(%edi),%eax 801057b7: 83 e0 03 and $0x3,%eax 801057ba: 66 83 f8 03 cmp $0x3,%ax 801057be: 0f 84 4c 01 00 00 je 80105910 <trap+0x210> 801057c4: e8 17 e0 ff ff call 801037e0 <myproc> 801057c9: 85 c0 test %eax,%eax 801057cb: 74 0b je 801057d8 <trap+0xd8> 801057cd: e8 0e e0 ff ff call 801037e0 <myproc> 801057d2: 83 78 0c 04 cmpl $0x4,0xc(%eax) 801057d6: 74 68 je 80105840 <trap+0x140> 801057d8: e8 03 e0 ff ff call 801037e0 <myproc> 801057dd: 85 c0 test %eax,%eax 801057df: 74 19 je 801057fa <trap+0xfa> 801057e1: e8 fa df ff ff call 801037e0 <myproc> 801057e6: 8b 40 24 mov 0x24(%eax),%eax 801057e9: 85 c0 test %eax,%eax 801057eb: 74 0d je 801057fa <trap+0xfa> 801057ed: 0f b7 47 3c movzwl 0x3c(%edi),%eax 801057f1: 83 e0 03 and $0x3,%eax 801057f4: 66 83 f8 03 cmp $0x3,%ax 801057f8: 74 37 je 80105831 <trap+0x131> 801057fa: 8d 65 f4 lea -0xc(%ebp),%esp 801057fd: 5b pop %ebx 801057fe: 5e pop %esi 801057ff: 5f pop %edi 80105800: 5d pop %ebp 80105801: c3 ret 80105802: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80105808: e8 d3 df ff ff call 801037e0 <myproc> 8010580d: 8b 58 24 mov 0x24(%eax),%ebx 80105810: 85 db test %ebx,%ebx 80105812: 0f 85 e8 00 00 00 jne 80105900 <trap+0x200> 80105818: e8 c3 df ff ff call 801037e0 <myproc> 8010581d: 89 78 18 mov %edi,0x18(%eax) 80105820: e8 1b f0 ff ff call 80104840 <syscall> 80105825: e8 b6 df ff ff call 801037e0 <myproc> 8010582a: 8b 48 24 mov 0x24(%eax),%ecx 8010582d: 85 c9 test %ecx,%ecx 8010582f: 74 c9 je 801057fa <trap+0xfa> 80105831: 8d 65 f4 lea -0xc(%ebp),%esp 80105834: 5b pop %ebx 80105835: 5e pop %esi 80105836: 5f pop %edi 80105837: 5d pop %ebp 80105838: e9 c3 e3 ff ff jmp 80103c00 <exit> 8010583d: 8d 76 00 lea 0x0(%esi),%esi 80105840: 83 7f 30 20 cmpl $0x20,0x30(%edi) 80105844: 75 92 jne 801057d8 <trap+0xd8> 80105846: e8 e5 e4 ff ff call 80103d30 <yield> 8010584b: eb 8b jmp 801057d8 <trap+0xd8> 8010584d: 8d 76 00 lea 0x0(%esi),%esi 80105850: e8 6b df ff ff call 801037c0 <cpuid> 80105855: 85 c0 test %eax,%eax 80105857: 0f 84 c3 00 00 00 je 80105920 <trap+0x220> 8010585d: e8 ee ce ff ff call 80102750 <lapiceoi> 80105862: e8 79 df ff ff call 801037e0 <myproc> 80105867: 85 c0 test %eax,%eax 80105869: 0f 85 38 ff ff ff jne 801057a7 <trap+0xa7> 8010586f: e9 50 ff ff ff jmp 801057c4 <trap+0xc4> 80105874: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105878: e8 93 cd ff ff call 80102610 <kbdintr> 8010587d: e8 ce ce ff ff call 80102750 <lapiceoi> 80105882: e8 59 df ff ff call 801037e0 <myproc> 80105887: 85 c0 test %eax,%eax 80105889: 0f 85 18 ff ff ff jne 801057a7 <trap+0xa7> 8010588f: e9 30 ff ff ff jmp 801057c4 <trap+0xc4> 80105894: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105898: e8 53 02 00 00 call 80105af0 <uartintr> 8010589d: e8 ae ce ff ff call 80102750 <lapiceoi> 801058a2: e8 39 df ff ff call 801037e0 <myproc> 801058a7: 85 c0 test %eax,%eax 801058a9: 0f 85 f8 fe ff ff jne 801057a7 <trap+0xa7> 801058af: e9 10 ff ff ff jmp 801057c4 <trap+0xc4> 801058b4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801058b8: 0f b7 5f 3c movzwl 0x3c(%edi),%ebx 801058bc: 8b 77 38 mov 0x38(%edi),%esi 801058bf: e8 fc de ff ff call 801037c0 <cpuid> 801058c4: 56 push %esi 801058c5: 53 push %ebx 801058c6: 50 push %eax 801058c7: 68 64 76 10 80 push $0x80107664 801058cc: e8 8f ad ff ff call 80100660 <cprintf> 801058d1: e8 7a ce ff ff call 80102750 <lapiceoi> 801058d6: 83 c4 10 add $0x10,%esp 801058d9: e8 02 df ff ff call 801037e0 <myproc> 801058de: 85 c0 test %eax,%eax 801058e0: 0f 85 c1 fe ff ff jne 801057a7 <trap+0xa7> 801058e6: e9 d9 fe ff ff jmp 801057c4 <trap+0xc4> 801058eb: 90 nop 801058ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801058f0: e8 8b c7 ff ff call 80102080 <ideintr> 801058f5: e9 63 ff ff ff jmp 8010585d <trap+0x15d> 801058fa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80105900: e8 fb e2 ff ff call 80103c00 <exit> 80105905: e9 0e ff ff ff jmp 80105818 <trap+0x118> 8010590a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80105910: e8 eb e2 ff ff call 80103c00 <exit> 80105915: e9 aa fe ff ff jmp 801057c4 <trap+0xc4> 8010591a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80105920: 83 ec 0c sub $0xc,%esp 80105923: 68 60 4c 11 80 push $0x80114c60 80105928: e8 13 ea ff ff call 80104340 <acquire> 8010592d: c7 04 24 a0 54 11 80 movl $0x801154a0,(%esp) 80105934: 83 05 a0 54 11 80 01 addl $0x1,0x801154a0 8010593b: e8 f0 e5 ff ff call 80103f30 <wakeup> 80105940: c7 04 24 60 4c 11 80 movl $0x80114c60,(%esp) 80105947: e8 b4 ea ff ff call 80104400 <release> 8010594c: 83 c4 10 add $0x10,%esp 8010594f: e9 09 ff ff ff jmp 8010585d <trap+0x15d> 80105954: 0f 20 d6 mov %cr2,%esi 80105957: e8 64 de ff ff call 801037c0 <cpuid> 8010595c: 83 ec 0c sub $0xc,%esp 8010595f: 56 push %esi 80105960: 53 push %ebx 80105961: 50 push %eax 80105962: ff 77 30 pushl 0x30(%edi) 80105965: 68 88 76 10 80 push $0x80107688 8010596a: e8 f1 ac ff ff call 80100660 <cprintf> 8010596f: 83 c4 14 add $0x14,%esp 80105972: 68 5e 76 10 80 push $0x8010765e 80105977: e8 14 aa ff ff call 80100390 <panic> 8010597c: 66 90 xchg %ax,%ax 8010597e: 66 90 xchg %ax,%ax 80105980 <uartgetc>: 80105980: a1 bc a5 10 80 mov 0x8010a5bc,%eax 80105985: 55 push %ebp 80105986: 89 e5 mov %esp,%ebp 80105988: 85 c0 test %eax,%eax 8010598a: 74 1c je 801059a8 <uartgetc+0x28> 8010598c: ba fd 03 00 00 mov $0x3fd,%edx 80105991: ec in (%dx),%al 80105992: a8 01 test $0x1,%al 80105994: 74 12 je 801059a8 <uartgetc+0x28> 80105996: ba f8 03 00 00 mov $0x3f8,%edx 8010599b: ec in (%dx),%al 8010599c: 0f b6 c0 movzbl %al,%eax 8010599f: 5d pop %ebp 801059a0: c3 ret 801059a1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801059a8: b8 ff ff ff ff mov $0xffffffff,%eax 801059ad: 5d pop %ebp 801059ae: c3 ret 801059af: 90 nop 801059b0 <uartputc.part.0>: 801059b0: 55 push %ebp 801059b1: 89 e5 mov %esp,%ebp 801059b3: 57 push %edi 801059b4: 56 push %esi 801059b5: 53 push %ebx 801059b6: 89 c7 mov %eax,%edi 801059b8: bb 80 00 00 00 mov $0x80,%ebx 801059bd: be fd 03 00 00 mov $0x3fd,%esi 801059c2: 83 ec 0c sub $0xc,%esp 801059c5: eb 1b jmp 801059e2 <uartputc.part.0+0x32> 801059c7: 89 f6 mov %esi,%esi 801059c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801059d0: 83 ec 0c sub $0xc,%esp 801059d3: 6a 0a push $0xa 801059d5: e8 96 cd ff ff call 80102770 <microdelay> 801059da: 83 c4 10 add $0x10,%esp 801059dd: 83 eb 01 sub $0x1,%ebx 801059e0: 74 07 je 801059e9 <uartputc.part.0+0x39> 801059e2: 89 f2 mov %esi,%edx 801059e4: ec in (%dx),%al 801059e5: a8 20 test $0x20,%al 801059e7: 74 e7 je 801059d0 <uartputc.part.0+0x20> 801059e9: ba f8 03 00 00 mov $0x3f8,%edx 801059ee: 89 f8 mov %edi,%eax 801059f0: ee out %al,(%dx) 801059f1: 8d 65 f4 lea -0xc(%ebp),%esp 801059f4: 5b pop %ebx 801059f5: 5e pop %esi 801059f6: 5f pop %edi 801059f7: 5d pop %ebp 801059f8: c3 ret 801059f9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105a00 <uartinit>: 80105a00: 55 push %ebp 80105a01: 31 c9 xor %ecx,%ecx 80105a03: 89 c8 mov %ecx,%eax 80105a05: 89 e5 mov %esp,%ebp 80105a07: 57 push %edi 80105a08: 56 push %esi 80105a09: 53 push %ebx 80105a0a: bb fa 03 00 00 mov $0x3fa,%ebx 80105a0f: 89 da mov %ebx,%edx 80105a11: 83 ec 0c sub $0xc,%esp 80105a14: ee out %al,(%dx) 80105a15: bf fb 03 00 00 mov $0x3fb,%edi 80105a1a: b8 80 ff ff ff mov $0xffffff80,%eax 80105a1f: 89 fa mov %edi,%edx 80105a21: ee out %al,(%dx) 80105a22: b8 0c 00 00 00 mov $0xc,%eax 80105a27: ba f8 03 00 00 mov $0x3f8,%edx 80105a2c: ee out %al,(%dx) 80105a2d: be f9 03 00 00 mov $0x3f9,%esi 80105a32: 89 c8 mov %ecx,%eax 80105a34: 89 f2 mov %esi,%edx 80105a36: ee out %al,(%dx) 80105a37: b8 03 00 00 00 mov $0x3,%eax 80105a3c: 89 fa mov %edi,%edx 80105a3e: ee out %al,(%dx) 80105a3f: ba fc 03 00 00 mov $0x3fc,%edx 80105a44: 89 c8 mov %ecx,%eax 80105a46: ee out %al,(%dx) 80105a47: b8 01 00 00 00 mov $0x1,%eax 80105a4c: 89 f2 mov %esi,%edx 80105a4e: ee out %al,(%dx) 80105a4f: ba fd 03 00 00 mov $0x3fd,%edx 80105a54: ec in (%dx),%al 80105a55: 3c ff cmp $0xff,%al 80105a57: 74 5a je 80105ab3 <uartinit+0xb3> 80105a59: c7 05 bc a5 10 80 01 movl $0x1,0x8010a5bc 80105a60: 00 00 00 80105a63: 89 da mov %ebx,%edx 80105a65: ec in (%dx),%al 80105a66: ba f8 03 00 00 mov $0x3f8,%edx 80105a6b: ec in (%dx),%al 80105a6c: 83 ec 08 sub $0x8,%esp 80105a6f: bb 80 77 10 80 mov $0x80107780,%ebx 80105a74: 6a 00 push $0x0 80105a76: 6a 04 push $0x4 80105a78: e8 53 c8 ff ff call 801022d0 <ioapicenable> 80105a7d: 83 c4 10 add $0x10,%esp 80105a80: b8 78 00 00 00 mov $0x78,%eax 80105a85: eb 13 jmp 80105a9a <uartinit+0x9a> 80105a87: 89 f6 mov %esi,%esi 80105a89: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105a90: 83 c3 01 add $0x1,%ebx 80105a93: 0f be 03 movsbl (%ebx),%eax 80105a96: 84 c0 test %al,%al 80105a98: 74 19 je 80105ab3 <uartinit+0xb3> 80105a9a: 8b 15 bc a5 10 80 mov 0x8010a5bc,%edx 80105aa0: 85 d2 test %edx,%edx 80105aa2: 74 ec je 80105a90 <uartinit+0x90> 80105aa4: 83 c3 01 add $0x1,%ebx 80105aa7: e8 04 ff ff ff call 801059b0 <uartputc.part.0> 80105aac: 0f be 03 movsbl (%ebx),%eax 80105aaf: 84 c0 test %al,%al 80105ab1: 75 e7 jne 80105a9a <uartinit+0x9a> 80105ab3: 8d 65 f4 lea -0xc(%ebp),%esp 80105ab6: 5b pop %ebx 80105ab7: 5e pop %esi 80105ab8: 5f pop %edi 80105ab9: 5d pop %ebp 80105aba: c3 ret 80105abb: 90 nop 80105abc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105ac0 <uartputc>: 80105ac0: 8b 15 bc a5 10 80 mov 0x8010a5bc,%edx 80105ac6: 55 push %ebp 80105ac7: 89 e5 mov %esp,%ebp 80105ac9: 85 d2 test %edx,%edx 80105acb: 8b 45 08 mov 0x8(%ebp),%eax 80105ace: 74 10 je 80105ae0 <uartputc+0x20> 80105ad0: 5d pop %ebp 80105ad1: e9 da fe ff ff jmp 801059b0 <uartputc.part.0> 80105ad6: 8d 76 00 lea 0x0(%esi),%esi 80105ad9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105ae0: 5d pop %ebp 80105ae1: c3 ret 80105ae2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105ae9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105af0 <uartintr>: 80105af0: 55 push %ebp 80105af1: 89 e5 mov %esp,%ebp 80105af3: 83 ec 14 sub $0x14,%esp 80105af6: 68 80 59 10 80 push $0x80105980 80105afb: e8 10 ad ff ff call 80100810 <consoleintr> 80105b00: 83 c4 10 add $0x10,%esp 80105b03: c9 leave 80105b04: c3 ret 80105b05 <vector0>: 80105b05: 6a 00 push $0x0 80105b07: 6a 00 push $0x0 80105b09: e9 1c fb ff ff jmp 8010562a <alltraps> 80105b0e <vector1>: 80105b0e: 6a 00 push $0x0 80105b10: 6a 01 push $0x1 80105b12: e9 13 fb ff ff jmp 8010562a <alltraps> 80105b17 <vector2>: 80105b17: 6a 00 push $0x0 80105b19: 6a 02 push $0x2 80105b1b: e9 0a fb ff ff jmp 8010562a <alltraps> 80105b20 <vector3>: 80105b20: 6a 00 push $0x0 80105b22: 6a 03 push $0x3 80105b24: e9 01 fb ff ff jmp 8010562a <alltraps> 80105b29 <vector4>: 80105b29: 6a 00 push $0x0 80105b2b: 6a 04 push $0x4 80105b2d: e9 f8 fa ff ff jmp 8010562a <alltraps> 80105b32 <vector5>: 80105b32: 6a 00 push $0x0 80105b34: 6a 05 push $0x5 80105b36: e9 ef fa ff ff jmp 8010562a <alltraps> 80105b3b <vector6>: 80105b3b: 6a 00 push $0x0 80105b3d: 6a 06 push $0x6 80105b3f: e9 e6 fa ff ff jmp 8010562a <alltraps> 80105b44 <vector7>: 80105b44: 6a 00 push $0x0 80105b46: 6a 07 push $0x7 80105b48: e9 dd fa ff ff jmp 8010562a <alltraps> 80105b4d <vector8>: 80105b4d: 6a 08 push $0x8 80105b4f: e9 d6 fa ff ff jmp 8010562a <alltraps> 80105b54 <vector9>: 80105b54: 6a 00 push $0x0 80105b56: 6a 09 push $0x9 80105b58: e9 cd fa ff ff jmp 8010562a <alltraps> 80105b5d <vector10>: 80105b5d: 6a 0a push $0xa 80105b5f: e9 c6 fa ff ff jmp 8010562a <alltraps> 80105b64 <vector11>: 80105b64: 6a 0b push $0xb 80105b66: e9 bf fa ff ff jmp 8010562a <alltraps> 80105b6b <vector12>: 80105b6b: 6a 0c push $0xc 80105b6d: e9 b8 fa ff ff jmp 8010562a <alltraps> 80105b72 <vector13>: 80105b72: 6a 0d push $0xd 80105b74: e9 b1 fa ff ff jmp 8010562a <alltraps> 80105b79 <vector14>: 80105b79: 6a 0e push $0xe 80105b7b: e9 aa fa ff ff jmp 8010562a <alltraps> 80105b80 <vector15>: 80105b80: 6a 00 push $0x0 80105b82: 6a 0f push $0xf 80105b84: e9 a1 fa ff ff jmp 8010562a <alltraps> 80105b89 <vector16>: 80105b89: 6a 00 push $0x0 80105b8b: 6a 10 push $0x10 80105b8d: e9 98 fa ff ff jmp 8010562a <alltraps> 80105b92 <vector17>: 80105b92: 6a 11 push $0x11 80105b94: e9 91 fa ff ff jmp 8010562a <alltraps> 80105b99 <vector18>: 80105b99: 6a 00 push $0x0 80105b9b: 6a 12 push $0x12 80105b9d: e9 88 fa ff ff jmp 8010562a <alltraps> 80105ba2 <vector19>: 80105ba2: 6a 00 push $0x0 80105ba4: 6a 13 push $0x13 80105ba6: e9 7f fa ff ff jmp 8010562a <alltraps> 80105bab <vector20>: 80105bab: 6a 00 push $0x0 80105bad: 6a 14 push $0x14 80105baf: e9 76 fa ff ff jmp 8010562a <alltraps> 80105bb4 <vector21>: 80105bb4: 6a 00 push $0x0 80105bb6: 6a 15 push $0x15 80105bb8: e9 6d fa ff ff jmp 8010562a <alltraps> 80105bbd <vector22>: 80105bbd: 6a 00 push $0x0 80105bbf: 6a 16 push $0x16 80105bc1: e9 64 fa ff ff jmp 8010562a <alltraps> 80105bc6 <vector23>: 80105bc6: 6a 00 push $0x0 80105bc8: 6a 17 push $0x17 80105bca: e9 5b fa ff ff jmp 8010562a <alltraps> 80105bcf <vector24>: 80105bcf: 6a 00 push $0x0 80105bd1: 6a 18 push $0x18 80105bd3: e9 52 fa ff ff jmp 8010562a <alltraps> 80105bd8 <vector25>: 80105bd8: 6a 00 push $0x0 80105bda: 6a 19 push $0x19 80105bdc: e9 49 fa ff ff jmp 8010562a <alltraps> 80105be1 <vector26>: 80105be1: 6a 00 push $0x0 80105be3: 6a 1a push $0x1a 80105be5: e9 40 fa ff ff jmp 8010562a <alltraps> 80105bea <vector27>: 80105bea: 6a 00 push $0x0 80105bec: 6a 1b push $0x1b 80105bee: e9 37 fa ff ff jmp 8010562a <alltraps> 80105bf3 <vector28>: 80105bf3: 6a 00 push $0x0 80105bf5: 6a 1c push $0x1c 80105bf7: e9 2e fa ff ff jmp 8010562a <alltraps> 80105bfc <vector29>: 80105bfc: 6a 00 push $0x0 80105bfe: 6a 1d push $0x1d 80105c00: e9 25 fa ff ff jmp 8010562a <alltraps> 80105c05 <vector30>: 80105c05: 6a 00 push $0x0 80105c07: 6a 1e push $0x1e 80105c09: e9 1c fa ff ff jmp 8010562a <alltraps> 80105c0e <vector31>: 80105c0e: 6a 00 push $0x0 80105c10: 6a 1f push $0x1f 80105c12: e9 13 fa ff ff jmp 8010562a <alltraps> 80105c17 <vector32>: 80105c17: 6a 00 push $0x0 80105c19: 6a 20 push $0x20 80105c1b: e9 0a fa ff ff jmp 8010562a <alltraps> 80105c20 <vector33>: 80105c20: 6a 00 push $0x0 80105c22: 6a 21 push $0x21 80105c24: e9 01 fa ff ff jmp 8010562a <alltraps> 80105c29 <vector34>: 80105c29: 6a 00 push $0x0 80105c2b: 6a 22 push $0x22 80105c2d: e9 f8 f9 ff ff jmp 8010562a <alltraps> 80105c32 <vector35>: 80105c32: 6a 00 push $0x0 80105c34: 6a 23 push $0x23 80105c36: e9 ef f9 ff ff jmp 8010562a <alltraps> 80105c3b <vector36>: 80105c3b: 6a 00 push $0x0 80105c3d: 6a 24 push $0x24 80105c3f: e9 e6 f9 ff ff jmp 8010562a <alltraps> 80105c44 <vector37>: 80105c44: 6a 00 push $0x0 80105c46: 6a 25 push $0x25 80105c48: e9 dd f9 ff ff jmp 8010562a <alltraps> 80105c4d <vector38>: 80105c4d: 6a 00 push $0x0 80105c4f: 6a 26 push $0x26 80105c51: e9 d4 f9 ff ff jmp 8010562a <alltraps> 80105c56 <vector39>: 80105c56: 6a 00 push $0x0 80105c58: 6a 27 push $0x27 80105c5a: e9 cb f9 ff ff jmp 8010562a <alltraps> 80105c5f <vector40>: 80105c5f: 6a 00 push $0x0 80105c61: 6a 28 push $0x28 80105c63: e9 c2 f9 ff ff jmp 8010562a <alltraps> 80105c68 <vector41>: 80105c68: 6a 00 push $0x0 80105c6a: 6a 29 push $0x29 80105c6c: e9 b9 f9 ff ff jmp 8010562a <alltraps> 80105c71 <vector42>: 80105c71: 6a 00 push $0x0 80105c73: 6a 2a push $0x2a 80105c75: e9 b0 f9 ff ff jmp 8010562a <alltraps> 80105c7a <vector43>: 80105c7a: 6a 00 push $0x0 80105c7c: 6a 2b push $0x2b 80105c7e: e9 a7 f9 ff ff jmp 8010562a <alltraps> 80105c83 <vector44>: 80105c83: 6a 00 push $0x0 80105c85: 6a 2c push $0x2c 80105c87: e9 9e f9 ff ff jmp 8010562a <alltraps> 80105c8c <vector45>: 80105c8c: 6a 00 push $0x0 80105c8e: 6a 2d push $0x2d 80105c90: e9 95 f9 ff ff jmp 8010562a <alltraps> 80105c95 <vector46>: 80105c95: 6a 00 push $0x0 80105c97: 6a 2e push $0x2e 80105c99: e9 8c f9 ff ff jmp 8010562a <alltraps> 80105c9e <vector47>: 80105c9e: 6a 00 push $0x0 80105ca0: 6a 2f push $0x2f 80105ca2: e9 83 f9 ff ff jmp 8010562a <alltraps> 80105ca7 <vector48>: 80105ca7: 6a 00 push $0x0 80105ca9: 6a 30 push $0x30 80105cab: e9 7a f9 ff ff jmp 8010562a <alltraps> 80105cb0 <vector49>: 80105cb0: 6a 00 push $0x0 80105cb2: 6a 31 push $0x31 80105cb4: e9 71 f9 ff ff jmp 8010562a <alltraps> 80105cb9 <vector50>: 80105cb9: 6a 00 push $0x0 80105cbb: 6a 32 push $0x32 80105cbd: e9 68 f9 ff ff jmp 8010562a <alltraps> 80105cc2 <vector51>: 80105cc2: 6a 00 push $0x0 80105cc4: 6a 33 push $0x33 80105cc6: e9 5f f9 ff ff jmp 8010562a <alltraps> 80105ccb <vector52>: 80105ccb: 6a 00 push $0x0 80105ccd: 6a 34 push $0x34 80105ccf: e9 56 f9 ff ff jmp 8010562a <alltraps> 80105cd4 <vector53>: 80105cd4: 6a 00 push $0x0 80105cd6: 6a 35 push $0x35 80105cd8: e9 4d f9 ff ff jmp 8010562a <alltraps> 80105cdd <vector54>: 80105cdd: 6a 00 push $0x0 80105cdf: 6a 36 push $0x36 80105ce1: e9 44 f9 ff ff jmp 8010562a <alltraps> 80105ce6 <vector55>: 80105ce6: 6a 00 push $0x0 80105ce8: 6a 37 push $0x37 80105cea: e9 3b f9 ff ff jmp 8010562a <alltraps> 80105cef <vector56>: 80105cef: 6a 00 push $0x0 80105cf1: 6a 38 push $0x38 80105cf3: e9 32 f9 ff ff jmp 8010562a <alltraps> 80105cf8 <vector57>: 80105cf8: 6a 00 push $0x0 80105cfa: 6a 39 push $0x39 80105cfc: e9 29 f9 ff ff jmp 8010562a <alltraps> 80105d01 <vector58>: 80105d01: 6a 00 push $0x0 80105d03: 6a 3a push $0x3a 80105d05: e9 20 f9 ff ff jmp 8010562a <alltraps> 80105d0a <vector59>: 80105d0a: 6a 00 push $0x0 80105d0c: 6a 3b push $0x3b 80105d0e: e9 17 f9 ff ff jmp 8010562a <alltraps> 80105d13 <vector60>: 80105d13: 6a 00 push $0x0 80105d15: 6a 3c push $0x3c 80105d17: e9 0e f9 ff ff jmp 8010562a <alltraps> 80105d1c <vector61>: 80105d1c: 6a 00 push $0x0 80105d1e: 6a 3d push $0x3d 80105d20: e9 05 f9 ff ff jmp 8010562a <alltraps> 80105d25 <vector62>: 80105d25: 6a 00 push $0x0 80105d27: 6a 3e push $0x3e 80105d29: e9 fc f8 ff ff jmp 8010562a <alltraps> 80105d2e <vector63>: 80105d2e: 6a 00 push $0x0 80105d30: 6a 3f push $0x3f 80105d32: e9 f3 f8 ff ff jmp 8010562a <alltraps> 80105d37 <vector64>: 80105d37: 6a 00 push $0x0 80105d39: 6a 40 push $0x40 80105d3b: e9 ea f8 ff ff jmp 8010562a <alltraps> 80105d40 <vector65>: 80105d40: 6a 00 push $0x0 80105d42: 6a 41 push $0x41 80105d44: e9 e1 f8 ff ff jmp 8010562a <alltraps> 80105d49 <vector66>: 80105d49: 6a 00 push $0x0 80105d4b: 6a 42 push $0x42 80105d4d: e9 d8 f8 ff ff jmp 8010562a <alltraps> 80105d52 <vector67>: 80105d52: 6a 00 push $0x0 80105d54: 6a 43 push $0x43 80105d56: e9 cf f8 ff ff jmp 8010562a <alltraps> 80105d5b <vector68>: 80105d5b: 6a 00 push $0x0 80105d5d: 6a 44 push $0x44 80105d5f: e9 c6 f8 ff ff jmp 8010562a <alltraps> 80105d64 <vector69>: 80105d64: 6a 00 push $0x0 80105d66: 6a 45 push $0x45 80105d68: e9 bd f8 ff ff jmp 8010562a <alltraps> 80105d6d <vector70>: 80105d6d: 6a 00 push $0x0 80105d6f: 6a 46 push $0x46 80105d71: e9 b4 f8 ff ff jmp 8010562a <alltraps> 80105d76 <vector71>: 80105d76: 6a 00 push $0x0 80105d78: 6a 47 push $0x47 80105d7a: e9 ab f8 ff ff jmp 8010562a <alltraps> 80105d7f <vector72>: 80105d7f: 6a 00 push $0x0 80105d81: 6a 48 push $0x48 80105d83: e9 a2 f8 ff ff jmp 8010562a <alltraps> 80105d88 <vector73>: 80105d88: 6a 00 push $0x0 80105d8a: 6a 49 push $0x49 80105d8c: e9 99 f8 ff ff jmp 8010562a <alltraps> 80105d91 <vector74>: 80105d91: 6a 00 push $0x0 80105d93: 6a 4a push $0x4a 80105d95: e9 90 f8 ff ff jmp 8010562a <alltraps> 80105d9a <vector75>: 80105d9a: 6a 00 push $0x0 80105d9c: 6a 4b push $0x4b 80105d9e: e9 87 f8 ff ff jmp 8010562a <alltraps> 80105da3 <vector76>: 80105da3: 6a 00 push $0x0 80105da5: 6a 4c push $0x4c 80105da7: e9 7e f8 ff ff jmp 8010562a <alltraps> 80105dac <vector77>: 80105dac: 6a 00 push $0x0 80105dae: 6a 4d push $0x4d 80105db0: e9 75 f8 ff ff jmp 8010562a <alltraps> 80105db5 <vector78>: 80105db5: 6a 00 push $0x0 80105db7: 6a 4e push $0x4e 80105db9: e9 6c f8 ff ff jmp 8010562a <alltraps> 80105dbe <vector79>: 80105dbe: 6a 00 push $0x0 80105dc0: 6a 4f push $0x4f 80105dc2: e9 63 f8 ff ff jmp 8010562a <alltraps> 80105dc7 <vector80>: 80105dc7: 6a 00 push $0x0 80105dc9: 6a 50 push $0x50 80105dcb: e9 5a f8 ff ff jmp 8010562a <alltraps> 80105dd0 <vector81>: 80105dd0: 6a 00 push $0x0 80105dd2: 6a 51 push $0x51 80105dd4: e9 51 f8 ff ff jmp 8010562a <alltraps> 80105dd9 <vector82>: 80105dd9: 6a 00 push $0x0 80105ddb: 6a 52 push $0x52 80105ddd: e9 48 f8 ff ff jmp 8010562a <alltraps> 80105de2 <vector83>: 80105de2: 6a 00 push $0x0 80105de4: 6a 53 push $0x53 80105de6: e9 3f f8 ff ff jmp 8010562a <alltraps> 80105deb <vector84>: 80105deb: 6a 00 push $0x0 80105ded: 6a 54 push $0x54 80105def: e9 36 f8 ff ff jmp 8010562a <alltraps> 80105df4 <vector85>: 80105df4: 6a 00 push $0x0 80105df6: 6a 55 push $0x55 80105df8: e9 2d f8 ff ff jmp 8010562a <alltraps> 80105dfd <vector86>: 80105dfd: 6a 00 push $0x0 80105dff: 6a 56 push $0x56 80105e01: e9 24 f8 ff ff jmp 8010562a <alltraps> 80105e06 <vector87>: 80105e06: 6a 00 push $0x0 80105e08: 6a 57 push $0x57 80105e0a: e9 1b f8 ff ff jmp 8010562a <alltraps> 80105e0f <vector88>: 80105e0f: 6a 00 push $0x0 80105e11: 6a 58 push $0x58 80105e13: e9 12 f8 ff ff jmp 8010562a <alltraps> 80105e18 <vector89>: 80105e18: 6a 00 push $0x0 80105e1a: 6a 59 push $0x59 80105e1c: e9 09 f8 ff ff jmp 8010562a <alltraps> 80105e21 <vector90>: 80105e21: 6a 00 push $0x0 80105e23: 6a 5a push $0x5a 80105e25: e9 00 f8 ff ff jmp 8010562a <alltraps> 80105e2a <vector91>: 80105e2a: 6a 00 push $0x0 80105e2c: 6a 5b push $0x5b 80105e2e: e9 f7 f7 ff ff jmp 8010562a <alltraps> 80105e33 <vector92>: 80105e33: 6a 00 push $0x0 80105e35: 6a 5c push $0x5c 80105e37: e9 ee f7 ff ff jmp 8010562a <alltraps> 80105e3c <vector93>: 80105e3c: 6a 00 push $0x0 80105e3e: 6a 5d push $0x5d 80105e40: e9 e5 f7 ff ff jmp 8010562a <alltraps> 80105e45 <vector94>: 80105e45: 6a 00 push $0x0 80105e47: 6a 5e push $0x5e 80105e49: e9 dc f7 ff ff jmp 8010562a <alltraps> 80105e4e <vector95>: 80105e4e: 6a 00 push $0x0 80105e50: 6a 5f push $0x5f 80105e52: e9 d3 f7 ff ff jmp 8010562a <alltraps> 80105e57 <vector96>: 80105e57: 6a 00 push $0x0 80105e59: 6a 60 push $0x60 80105e5b: e9 ca f7 ff ff jmp 8010562a <alltraps> 80105e60 <vector97>: 80105e60: 6a 00 push $0x0 80105e62: 6a 61 push $0x61 80105e64: e9 c1 f7 ff ff jmp 8010562a <alltraps> 80105e69 <vector98>: 80105e69: 6a 00 push $0x0 80105e6b: 6a 62 push $0x62 80105e6d: e9 b8 f7 ff ff jmp 8010562a <alltraps> 80105e72 <vector99>: 80105e72: 6a 00 push $0x0 80105e74: 6a 63 push $0x63 80105e76: e9 af f7 ff ff jmp 8010562a <alltraps> 80105e7b <vector100>: 80105e7b: 6a 00 push $0x0 80105e7d: 6a 64 push $0x64 80105e7f: e9 a6 f7 ff ff jmp 8010562a <alltraps> 80105e84 <vector101>: 80105e84: 6a 00 push $0x0 80105e86: 6a 65 push $0x65 80105e88: e9 9d f7 ff ff jmp 8010562a <alltraps> 80105e8d <vector102>: 80105e8d: 6a 00 push $0x0 80105e8f: 6a 66 push $0x66 80105e91: e9 94 f7 ff ff jmp 8010562a <alltraps> 80105e96 <vector103>: 80105e96: 6a 00 push $0x0 80105e98: 6a 67 push $0x67 80105e9a: e9 8b f7 ff ff jmp 8010562a <alltraps> 80105e9f <vector104>: 80105e9f: 6a 00 push $0x0 80105ea1: 6a 68 push $0x68 80105ea3: e9 82 f7 ff ff jmp 8010562a <alltraps> 80105ea8 <vector105>: 80105ea8: 6a 00 push $0x0 80105eaa: 6a 69 push $0x69 80105eac: e9 79 f7 ff ff jmp 8010562a <alltraps> 80105eb1 <vector106>: 80105eb1: 6a 00 push $0x0 80105eb3: 6a 6a push $0x6a 80105eb5: e9 70 f7 ff ff jmp 8010562a <alltraps> 80105eba <vector107>: 80105eba: 6a 00 push $0x0 80105ebc: 6a 6b push $0x6b 80105ebe: e9 67 f7 ff ff jmp 8010562a <alltraps> 80105ec3 <vector108>: 80105ec3: 6a 00 push $0x0 80105ec5: 6a 6c push $0x6c 80105ec7: e9 5e f7 ff ff jmp 8010562a <alltraps> 80105ecc <vector109>: 80105ecc: 6a 00 push $0x0 80105ece: 6a 6d push $0x6d 80105ed0: e9 55 f7 ff ff jmp 8010562a <alltraps> 80105ed5 <vector110>: 80105ed5: 6a 00 push $0x0 80105ed7: 6a 6e push $0x6e 80105ed9: e9 4c f7 ff ff jmp 8010562a <alltraps> 80105ede <vector111>: 80105ede: 6a 00 push $0x0 80105ee0: 6a 6f push $0x6f 80105ee2: e9 43 f7 ff ff jmp 8010562a <alltraps> 80105ee7 <vector112>: 80105ee7: 6a 00 push $0x0 80105ee9: 6a 70 push $0x70 80105eeb: e9 3a f7 ff ff jmp 8010562a <alltraps> 80105ef0 <vector113>: 80105ef0: 6a 00 push $0x0 80105ef2: 6a 71 push $0x71 80105ef4: e9 31 f7 ff ff jmp 8010562a <alltraps> 80105ef9 <vector114>: 80105ef9: 6a 00 push $0x0 80105efb: 6a 72 push $0x72 80105efd: e9 28 f7 ff ff jmp 8010562a <alltraps> 80105f02 <vector115>: 80105f02: 6a 00 push $0x0 80105f04: 6a 73 push $0x73 80105f06: e9 1f f7 ff ff jmp 8010562a <alltraps> 80105f0b <vector116>: 80105f0b: 6a 00 push $0x0 80105f0d: 6a 74 push $0x74 80105f0f: e9 16 f7 ff ff jmp 8010562a <alltraps> 80105f14 <vector117>: 80105f14: 6a 00 push $0x0 80105f16: 6a 75 push $0x75 80105f18: e9 0d f7 ff ff jmp 8010562a <alltraps> 80105f1d <vector118>: 80105f1d: 6a 00 push $0x0 80105f1f: 6a 76 push $0x76 80105f21: e9 04 f7 ff ff jmp 8010562a <alltraps> 80105f26 <vector119>: 80105f26: 6a 00 push $0x0 80105f28: 6a 77 push $0x77 80105f2a: e9 fb f6 ff ff jmp 8010562a <alltraps> 80105f2f <vector120>: 80105f2f: 6a 00 push $0x0 80105f31: 6a 78 push $0x78 80105f33: e9 f2 f6 ff ff jmp 8010562a <alltraps> 80105f38 <vector121>: 80105f38: 6a 00 push $0x0 80105f3a: 6a 79 push $0x79 80105f3c: e9 e9 f6 ff ff jmp 8010562a <alltraps> 80105f41 <vector122>: 80105f41: 6a 00 push $0x0 80105f43: 6a 7a push $0x7a 80105f45: e9 e0 f6 ff ff jmp 8010562a <alltraps> 80105f4a <vector123>: 80105f4a: 6a 00 push $0x0 80105f4c: 6a 7b push $0x7b 80105f4e: e9 d7 f6 ff ff jmp 8010562a <alltraps> 80105f53 <vector124>: 80105f53: 6a 00 push $0x0 80105f55: 6a 7c push $0x7c 80105f57: e9 ce f6 ff ff jmp 8010562a <alltraps> 80105f5c <vector125>: 80105f5c: 6a 00 push $0x0 80105f5e: 6a 7d push $0x7d 80105f60: e9 c5 f6 ff ff jmp 8010562a <alltraps> 80105f65 <vector126>: 80105f65: 6a 00 push $0x0 80105f67: 6a 7e push $0x7e 80105f69: e9 bc f6 ff ff jmp 8010562a <alltraps> 80105f6e <vector127>: 80105f6e: 6a 00 push $0x0 80105f70: 6a 7f push $0x7f 80105f72: e9 b3 f6 ff ff jmp 8010562a <alltraps> 80105f77 <vector128>: 80105f77: 6a 00 push $0x0 80105f79: 68 80 00 00 00 push $0x80 80105f7e: e9 a7 f6 ff ff jmp 8010562a <alltraps> 80105f83 <vector129>: 80105f83: 6a 00 push $0x0 80105f85: 68 81 00 00 00 push $0x81 80105f8a: e9 9b f6 ff ff jmp 8010562a <alltraps> 80105f8f <vector130>: 80105f8f: 6a 00 push $0x0 80105f91: 68 82 00 00 00 push $0x82 80105f96: e9 8f f6 ff ff jmp 8010562a <alltraps> 80105f9b <vector131>: 80105f9b: 6a 00 push $0x0 80105f9d: 68 83 00 00 00 push $0x83 80105fa2: e9 83 f6 ff ff jmp 8010562a <alltraps> 80105fa7 <vector132>: 80105fa7: 6a 00 push $0x0 80105fa9: 68 84 00 00 00 push $0x84 80105fae: e9 77 f6 ff ff jmp 8010562a <alltraps> 80105fb3 <vector133>: 80105fb3: 6a 00 push $0x0 80105fb5: 68 85 00 00 00 push $0x85 80105fba: e9 6b f6 ff ff jmp 8010562a <alltraps> 80105fbf <vector134>: 80105fbf: 6a 00 push $0x0 80105fc1: 68 86 00 00 00 push $0x86 80105fc6: e9 5f f6 ff ff jmp 8010562a <alltraps> 80105fcb <vector135>: 80105fcb: 6a 00 push $0x0 80105fcd: 68 87 00 00 00 push $0x87 80105fd2: e9 53 f6 ff ff jmp 8010562a <alltraps> 80105fd7 <vector136>: 80105fd7: 6a 00 push $0x0 80105fd9: 68 88 00 00 00 push $0x88 80105fde: e9 47 f6 ff ff jmp 8010562a <alltraps> 80105fe3 <vector137>: 80105fe3: 6a 00 push $0x0 80105fe5: 68 89 00 00 00 push $0x89 80105fea: e9 3b f6 ff ff jmp 8010562a <alltraps> 80105fef <vector138>: 80105fef: 6a 00 push $0x0 80105ff1: 68 8a 00 00 00 push $0x8a 80105ff6: e9 2f f6 ff ff jmp 8010562a <alltraps> 80105ffb <vector139>: 80105ffb: 6a 00 push $0x0 80105ffd: 68 8b 00 00 00 push $0x8b 80106002: e9 23 f6 ff ff jmp 8010562a <alltraps> 80106007 <vector140>: 80106007: 6a 00 push $0x0 80106009: 68 8c 00 00 00 push $0x8c 8010600e: e9 17 f6 ff ff jmp 8010562a <alltraps> 80106013 <vector141>: 80106013: 6a 00 push $0x0 80106015: 68 8d 00 00 00 push $0x8d 8010601a: e9 0b f6 ff ff jmp 8010562a <alltraps> 8010601f <vector142>: 8010601f: 6a 00 push $0x0 80106021: 68 8e 00 00 00 push $0x8e 80106026: e9 ff f5 ff ff jmp 8010562a <alltraps> 8010602b <vector143>: 8010602b: 6a 00 push $0x0 8010602d: 68 8f 00 00 00 push $0x8f 80106032: e9 f3 f5 ff ff jmp 8010562a <alltraps> 80106037 <vector144>: 80106037: 6a 00 push $0x0 80106039: 68 90 00 00 00 push $0x90 8010603e: e9 e7 f5 ff ff jmp 8010562a <alltraps> 80106043 <vector145>: 80106043: 6a 00 push $0x0 80106045: 68 91 00 00 00 push $0x91 8010604a: e9 db f5 ff ff jmp 8010562a <alltraps> 8010604f <vector146>: 8010604f: 6a 00 push $0x0 80106051: 68 92 00 00 00 push $0x92 80106056: e9 cf f5 ff ff jmp 8010562a <alltraps> 8010605b <vector147>: 8010605b: 6a 00 push $0x0 8010605d: 68 93 00 00 00 push $0x93 80106062: e9 c3 f5 ff ff jmp 8010562a <alltraps> 80106067 <vector148>: 80106067: 6a 00 push $0x0 80106069: 68 94 00 00 00 push $0x94 8010606e: e9 b7 f5 ff ff jmp 8010562a <alltraps> 80106073 <vector149>: 80106073: 6a 00 push $0x0 80106075: 68 95 00 00 00 push $0x95 8010607a: e9 ab f5 ff ff jmp 8010562a <alltraps> 8010607f <vector150>: 8010607f: 6a 00 push $0x0 80106081: 68 96 00 00 00 push $0x96 80106086: e9 9f f5 ff ff jmp 8010562a <alltraps> 8010608b <vector151>: 8010608b: 6a 00 push $0x0 8010608d: 68 97 00 00 00 push $0x97 80106092: e9 93 f5 ff ff jmp 8010562a <alltraps> 80106097 <vector152>: 80106097: 6a 00 push $0x0 80106099: 68 98 00 00 00 push $0x98 8010609e: e9 87 f5 ff ff jmp 8010562a <alltraps> 801060a3 <vector153>: 801060a3: 6a 00 push $0x0 801060a5: 68 99 00 00 00 push $0x99 801060aa: e9 7b f5 ff ff jmp 8010562a <alltraps> 801060af <vector154>: 801060af: 6a 00 push $0x0 801060b1: 68 9a 00 00 00 push $0x9a 801060b6: e9 6f f5 ff ff jmp 8010562a <alltraps> 801060bb <vector155>: 801060bb: 6a 00 push $0x0 801060bd: 68 9b 00 00 00 push $0x9b 801060c2: e9 63 f5 ff ff jmp 8010562a <alltraps> 801060c7 <vector156>: 801060c7: 6a 00 push $0x0 801060c9: 68 9c 00 00 00 push $0x9c 801060ce: e9 57 f5 ff ff jmp 8010562a <alltraps> 801060d3 <vector157>: 801060d3: 6a 00 push $0x0 801060d5: 68 9d 00 00 00 push $0x9d 801060da: e9 4b f5 ff ff jmp 8010562a <alltraps> 801060df <vector158>: 801060df: 6a 00 push $0x0 801060e1: 68 9e 00 00 00 push $0x9e 801060e6: e9 3f f5 ff ff jmp 8010562a <alltraps> 801060eb <vector159>: 801060eb: 6a 00 push $0x0 801060ed: 68 9f 00 00 00 push $0x9f 801060f2: e9 33 f5 ff ff jmp 8010562a <alltraps> 801060f7 <vector160>: 801060f7: 6a 00 push $0x0 801060f9: 68 a0 00 00 00 push $0xa0 801060fe: e9 27 f5 ff ff jmp 8010562a <alltraps> 80106103 <vector161>: 80106103: 6a 00 push $0x0 80106105: 68 a1 00 00 00 push $0xa1 8010610a: e9 1b f5 ff ff jmp 8010562a <alltraps> 8010610f <vector162>: 8010610f: 6a 00 push $0x0 80106111: 68 a2 00 00 00 push $0xa2 80106116: e9 0f f5 ff ff jmp 8010562a <alltraps> 8010611b <vector163>: 8010611b: 6a 00 push $0x0 8010611d: 68 a3 00 00 00 push $0xa3 80106122: e9 03 f5 ff ff jmp 8010562a <alltraps> 80106127 <vector164>: 80106127: 6a 00 push $0x0 80106129: 68 a4 00 00 00 push $0xa4 8010612e: e9 f7 f4 ff ff jmp 8010562a <alltraps> 80106133 <vector165>: 80106133: 6a 00 push $0x0 80106135: 68 a5 00 00 00 push $0xa5 8010613a: e9 eb f4 ff ff jmp 8010562a <alltraps> 8010613f <vector166>: 8010613f: 6a 00 push $0x0 80106141: 68 a6 00 00 00 push $0xa6 80106146: e9 df f4 ff ff jmp 8010562a <alltraps> 8010614b <vector167>: 8010614b: 6a 00 push $0x0 8010614d: 68 a7 00 00 00 push $0xa7 80106152: e9 d3 f4 ff ff jmp 8010562a <alltraps> 80106157 <vector168>: 80106157: 6a 00 push $0x0 80106159: 68 a8 00 00 00 push $0xa8 8010615e: e9 c7 f4 ff ff jmp 8010562a <alltraps> 80106163 <vector169>: 80106163: 6a 00 push $0x0 80106165: 68 a9 00 00 00 push $0xa9 8010616a: e9 bb f4 ff ff jmp 8010562a <alltraps> 8010616f <vector170>: 8010616f: 6a 00 push $0x0 80106171: 68 aa 00 00 00 push $0xaa 80106176: e9 af f4 ff ff jmp 8010562a <alltraps> 8010617b <vector171>: 8010617b: 6a 00 push $0x0 8010617d: 68 ab 00 00 00 push $0xab 80106182: e9 a3 f4 ff ff jmp 8010562a <alltraps> 80106187 <vector172>: 80106187: 6a 00 push $0x0 80106189: 68 ac 00 00 00 push $0xac 8010618e: e9 97 f4 ff ff jmp 8010562a <alltraps> 80106193 <vector173>: 80106193: 6a 00 push $0x0 80106195: 68 ad 00 00 00 push $0xad 8010619a: e9 8b f4 ff ff jmp 8010562a <alltraps> 8010619f <vector174>: 8010619f: 6a 00 push $0x0 801061a1: 68 ae 00 00 00 push $0xae 801061a6: e9 7f f4 ff ff jmp 8010562a <alltraps> 801061ab <vector175>: 801061ab: 6a 00 push $0x0 801061ad: 68 af 00 00 00 push $0xaf 801061b2: e9 73 f4 ff ff jmp 8010562a <alltraps> 801061b7 <vector176>: 801061b7: 6a 00 push $0x0 801061b9: 68 b0 00 00 00 push $0xb0 801061be: e9 67 f4 ff ff jmp 8010562a <alltraps> 801061c3 <vector177>: 801061c3: 6a 00 push $0x0 801061c5: 68 b1 00 00 00 push $0xb1 801061ca: e9 5b f4 ff ff jmp 8010562a <alltraps> 801061cf <vector178>: 801061cf: 6a 00 push $0x0 801061d1: 68 b2 00 00 00 push $0xb2 801061d6: e9 4f f4 ff ff jmp 8010562a <alltraps> 801061db <vector179>: 801061db: 6a 00 push $0x0 801061dd: 68 b3 00 00 00 push $0xb3 801061e2: e9 43 f4 ff ff jmp 8010562a <alltraps> 801061e7 <vector180>: 801061e7: 6a 00 push $0x0 801061e9: 68 b4 00 00 00 push $0xb4 801061ee: e9 37 f4 ff ff jmp 8010562a <alltraps> 801061f3 <vector181>: 801061f3: 6a 00 push $0x0 801061f5: 68 b5 00 00 00 push $0xb5 801061fa: e9 2b f4 ff ff jmp 8010562a <alltraps> 801061ff <vector182>: 801061ff: 6a 00 push $0x0 80106201: 68 b6 00 00 00 push $0xb6 80106206: e9 1f f4 ff ff jmp 8010562a <alltraps> 8010620b <vector183>: 8010620b: 6a 00 push $0x0 8010620d: 68 b7 00 00 00 push $0xb7 80106212: e9 13 f4 ff ff jmp 8010562a <alltraps> 80106217 <vector184>: 80106217: 6a 00 push $0x0 80106219: 68 b8 00 00 00 push $0xb8 8010621e: e9 07 f4 ff ff jmp 8010562a <alltraps> 80106223 <vector185>: 80106223: 6a 00 push $0x0 80106225: 68 b9 00 00 00 push $0xb9 8010622a: e9 fb f3 ff ff jmp 8010562a <alltraps> 8010622f <vector186>: 8010622f: 6a 00 push $0x0 80106231: 68 ba 00 00 00 push $0xba 80106236: e9 ef f3 ff ff jmp 8010562a <alltraps> 8010623b <vector187>: 8010623b: 6a 00 push $0x0 8010623d: 68 bb 00 00 00 push $0xbb 80106242: e9 e3 f3 ff ff jmp 8010562a <alltraps> 80106247 <vector188>: 80106247: 6a 00 push $0x0 80106249: 68 bc 00 00 00 push $0xbc 8010624e: e9 d7 f3 ff ff jmp 8010562a <alltraps> 80106253 <vector189>: 80106253: 6a 00 push $0x0 80106255: 68 bd 00 00 00 push $0xbd 8010625a: e9 cb f3 ff ff jmp 8010562a <alltraps> 8010625f <vector190>: 8010625f: 6a 00 push $0x0 80106261: 68 be 00 00 00 push $0xbe 80106266: e9 bf f3 ff ff jmp 8010562a <alltraps> 8010626b <vector191>: 8010626b: 6a 00 push $0x0 8010626d: 68 bf 00 00 00 push $0xbf 80106272: e9 b3 f3 ff ff jmp 8010562a <alltraps> 80106277 <vector192>: 80106277: 6a 00 push $0x0 80106279: 68 c0 00 00 00 push $0xc0 8010627e: e9 a7 f3 ff ff jmp 8010562a <alltraps> 80106283 <vector193>: 80106283: 6a 00 push $0x0 80106285: 68 c1 00 00 00 push $0xc1 8010628a: e9 9b f3 ff ff jmp 8010562a <alltraps> 8010628f <vector194>: 8010628f: 6a 00 push $0x0 80106291: 68 c2 00 00 00 push $0xc2 80106296: e9 8f f3 ff ff jmp 8010562a <alltraps> 8010629b <vector195>: 8010629b: 6a 00 push $0x0 8010629d: 68 c3 00 00 00 push $0xc3 801062a2: e9 83 f3 ff ff jmp 8010562a <alltraps> 801062a7 <vector196>: 801062a7: 6a 00 push $0x0 801062a9: 68 c4 00 00 00 push $0xc4 801062ae: e9 77 f3 ff ff jmp 8010562a <alltraps> 801062b3 <vector197>: 801062b3: 6a 00 push $0x0 801062b5: 68 c5 00 00 00 push $0xc5 801062ba: e9 6b f3 ff ff jmp 8010562a <alltraps> 801062bf <vector198>: 801062bf: 6a 00 push $0x0 801062c1: 68 c6 00 00 00 push $0xc6 801062c6: e9 5f f3 ff ff jmp 8010562a <alltraps> 801062cb <vector199>: 801062cb: 6a 00 push $0x0 801062cd: 68 c7 00 00 00 push $0xc7 801062d2: e9 53 f3 ff ff jmp 8010562a <alltraps> 801062d7 <vector200>: 801062d7: 6a 00 push $0x0 801062d9: 68 c8 00 00 00 push $0xc8 801062de: e9 47 f3 ff ff jmp 8010562a <alltraps> 801062e3 <vector201>: 801062e3: 6a 00 push $0x0 801062e5: 68 c9 00 00 00 push $0xc9 801062ea: e9 3b f3 ff ff jmp 8010562a <alltraps> 801062ef <vector202>: 801062ef: 6a 00 push $0x0 801062f1: 68 ca 00 00 00 push $0xca 801062f6: e9 2f f3 ff ff jmp 8010562a <alltraps> 801062fb <vector203>: 801062fb: 6a 00 push $0x0 801062fd: 68 cb 00 00 00 push $0xcb 80106302: e9 23 f3 ff ff jmp 8010562a <alltraps> 80106307 <vector204>: 80106307: 6a 00 push $0x0 80106309: 68 cc 00 00 00 push $0xcc 8010630e: e9 17 f3 ff ff jmp 8010562a <alltraps> 80106313 <vector205>: 80106313: 6a 00 push $0x0 80106315: 68 cd 00 00 00 push $0xcd 8010631a: e9 0b f3 ff ff jmp 8010562a <alltraps> 8010631f <vector206>: 8010631f: 6a 00 push $0x0 80106321: 68 ce 00 00 00 push $0xce 80106326: e9 ff f2 ff ff jmp 8010562a <alltraps> 8010632b <vector207>: 8010632b: 6a 00 push $0x0 8010632d: 68 cf 00 00 00 push $0xcf 80106332: e9 f3 f2 ff ff jmp 8010562a <alltraps> 80106337 <vector208>: 80106337: 6a 00 push $0x0 80106339: 68 d0 00 00 00 push $0xd0 8010633e: e9 e7 f2 ff ff jmp 8010562a <alltraps> 80106343 <vector209>: 80106343: 6a 00 push $0x0 80106345: 68 d1 00 00 00 push $0xd1 8010634a: e9 db f2 ff ff jmp 8010562a <alltraps> 8010634f <vector210>: 8010634f: 6a 00 push $0x0 80106351: 68 d2 00 00 00 push $0xd2 80106356: e9 cf f2 ff ff jmp 8010562a <alltraps> 8010635b <vector211>: 8010635b: 6a 00 push $0x0 8010635d: 68 d3 00 00 00 push $0xd3 80106362: e9 c3 f2 ff ff jmp 8010562a <alltraps> 80106367 <vector212>: 80106367: 6a 00 push $0x0 80106369: 68 d4 00 00 00 push $0xd4 8010636e: e9 b7 f2 ff ff jmp 8010562a <alltraps> 80106373 <vector213>: 80106373: 6a 00 push $0x0 80106375: 68 d5 00 00 00 push $0xd5 8010637a: e9 ab f2 ff ff jmp 8010562a <alltraps> 8010637f <vector214>: 8010637f: 6a 00 push $0x0 80106381: 68 d6 00 00 00 push $0xd6 80106386: e9 9f f2 ff ff jmp 8010562a <alltraps> 8010638b <vector215>: 8010638b: 6a 00 push $0x0 8010638d: 68 d7 00 00 00 push $0xd7 80106392: e9 93 f2 ff ff jmp 8010562a <alltraps> 80106397 <vector216>: 80106397: 6a 00 push $0x0 80106399: 68 d8 00 00 00 push $0xd8 8010639e: e9 87 f2 ff ff jmp 8010562a <alltraps> 801063a3 <vector217>: 801063a3: 6a 00 push $0x0 801063a5: 68 d9 00 00 00 push $0xd9 801063aa: e9 7b f2 ff ff jmp 8010562a <alltraps> 801063af <vector218>: 801063af: 6a 00 push $0x0 801063b1: 68 da 00 00 00 push $0xda 801063b6: e9 6f f2 ff ff jmp 8010562a <alltraps> 801063bb <vector219>: 801063bb: 6a 00 push $0x0 801063bd: 68 db 00 00 00 push $0xdb 801063c2: e9 63 f2 ff ff jmp 8010562a <alltraps> 801063c7 <vector220>: 801063c7: 6a 00 push $0x0 801063c9: 68 dc 00 00 00 push $0xdc 801063ce: e9 57 f2 ff ff jmp 8010562a <alltraps> 801063d3 <vector221>: 801063d3: 6a 00 push $0x0 801063d5: 68 dd 00 00 00 push $0xdd 801063da: e9 4b f2 ff ff jmp 8010562a <alltraps> 801063df <vector222>: 801063df: 6a 00 push $0x0 801063e1: 68 de 00 00 00 push $0xde 801063e6: e9 3f f2 ff ff jmp 8010562a <alltraps> 801063eb <vector223>: 801063eb: 6a 00 push $0x0 801063ed: 68 df 00 00 00 push $0xdf 801063f2: e9 33 f2 ff ff jmp 8010562a <alltraps> 801063f7 <vector224>: 801063f7: 6a 00 push $0x0 801063f9: 68 e0 00 00 00 push $0xe0 801063fe: e9 27 f2 ff ff jmp 8010562a <alltraps> 80106403 <vector225>: 80106403: 6a 00 push $0x0 80106405: 68 e1 00 00 00 push $0xe1 8010640a: e9 1b f2 ff ff jmp 8010562a <alltraps> 8010640f <vector226>: 8010640f: 6a 00 push $0x0 80106411: 68 e2 00 00 00 push $0xe2 80106416: e9 0f f2 ff ff jmp 8010562a <alltraps> 8010641b <vector227>: 8010641b: 6a 00 push $0x0 8010641d: 68 e3 00 00 00 push $0xe3 80106422: e9 03 f2 ff ff jmp 8010562a <alltraps> 80106427 <vector228>: 80106427: 6a 00 push $0x0 80106429: 68 e4 00 00 00 push $0xe4 8010642e: e9 f7 f1 ff ff jmp 8010562a <alltraps> 80106433 <vector229>: 80106433: 6a 00 push $0x0 80106435: 68 e5 00 00 00 push $0xe5 8010643a: e9 eb f1 ff ff jmp 8010562a <alltraps> 8010643f <vector230>: 8010643f: 6a 00 push $0x0 80106441: 68 e6 00 00 00 push $0xe6 80106446: e9 df f1 ff ff jmp 8010562a <alltraps> 8010644b <vector231>: 8010644b: 6a 00 push $0x0 8010644d: 68 e7 00 00 00 push $0xe7 80106452: e9 d3 f1 ff ff jmp 8010562a <alltraps> 80106457 <vector232>: 80106457: 6a 00 push $0x0 80106459: 68 e8 00 00 00 push $0xe8 8010645e: e9 c7 f1 ff ff jmp 8010562a <alltraps> 80106463 <vector233>: 80106463: 6a 00 push $0x0 80106465: 68 e9 00 00 00 push $0xe9 8010646a: e9 bb f1 ff ff jmp 8010562a <alltraps> 8010646f <vector234>: 8010646f: 6a 00 push $0x0 80106471: 68 ea 00 00 00 push $0xea 80106476: e9 af f1 ff ff jmp 8010562a <alltraps> 8010647b <vector235>: 8010647b: 6a 00 push $0x0 8010647d: 68 eb 00 00 00 push $0xeb 80106482: e9 a3 f1 ff ff jmp 8010562a <alltraps> 80106487 <vector236>: 80106487: 6a 00 push $0x0 80106489: 68 ec 00 00 00 push $0xec 8010648e: e9 97 f1 ff ff jmp 8010562a <alltraps> 80106493 <vector237>: 80106493: 6a 00 push $0x0 80106495: 68 ed 00 00 00 push $0xed 8010649a: e9 8b f1 ff ff jmp 8010562a <alltraps> 8010649f <vector238>: 8010649f: 6a 00 push $0x0 801064a1: 68 ee 00 00 00 push $0xee 801064a6: e9 7f f1 ff ff jmp 8010562a <alltraps> 801064ab <vector239>: 801064ab: 6a 00 push $0x0 801064ad: 68 ef 00 00 00 push $0xef 801064b2: e9 73 f1 ff ff jmp 8010562a <alltraps> 801064b7 <vector240>: 801064b7: 6a 00 push $0x0 801064b9: 68 f0 00 00 00 push $0xf0 801064be: e9 67 f1 ff ff jmp 8010562a <alltraps> 801064c3 <vector241>: 801064c3: 6a 00 push $0x0 801064c5: 68 f1 00 00 00 push $0xf1 801064ca: e9 5b f1 ff ff jmp 8010562a <alltraps> 801064cf <vector242>: 801064cf: 6a 00 push $0x0 801064d1: 68 f2 00 00 00 push $0xf2 801064d6: e9 4f f1 ff ff jmp 8010562a <alltraps> 801064db <vector243>: 801064db: 6a 00 push $0x0 801064dd: 68 f3 00 00 00 push $0xf3 801064e2: e9 43 f1 ff ff jmp 8010562a <alltraps> 801064e7 <vector244>: 801064e7: 6a 00 push $0x0 801064e9: 68 f4 00 00 00 push $0xf4 801064ee: e9 37 f1 ff ff jmp 8010562a <alltraps> 801064f3 <vector245>: 801064f3: 6a 00 push $0x0 801064f5: 68 f5 00 00 00 push $0xf5 801064fa: e9 2b f1 ff ff jmp 8010562a <alltraps> 801064ff <vector246>: 801064ff: 6a 00 push $0x0 80106501: 68 f6 00 00 00 push $0xf6 80106506: e9 1f f1 ff ff jmp 8010562a <alltraps> 8010650b <vector247>: 8010650b: 6a 00 push $0x0 8010650d: 68 f7 00 00 00 push $0xf7 80106512: e9 13 f1 ff ff jmp 8010562a <alltraps> 80106517 <vector248>: 80106517: 6a 00 push $0x0 80106519: 68 f8 00 00 00 push $0xf8 8010651e: e9 07 f1 ff ff jmp 8010562a <alltraps> 80106523 <vector249>: 80106523: 6a 00 push $0x0 80106525: 68 f9 00 00 00 push $0xf9 8010652a: e9 fb f0 ff ff jmp 8010562a <alltraps> 8010652f <vector250>: 8010652f: 6a 00 push $0x0 80106531: 68 fa 00 00 00 push $0xfa 80106536: e9 ef f0 ff ff jmp 8010562a <alltraps> 8010653b <vector251>: 8010653b: 6a 00 push $0x0 8010653d: 68 fb 00 00 00 push $0xfb 80106542: e9 e3 f0 ff ff jmp 8010562a <alltraps> 80106547 <vector252>: 80106547: 6a 00 push $0x0 80106549: 68 fc 00 00 00 push $0xfc 8010654e: e9 d7 f0 ff ff jmp 8010562a <alltraps> 80106553 <vector253>: 80106553: 6a 00 push $0x0 80106555: 68 fd 00 00 00 push $0xfd 8010655a: e9 cb f0 ff ff jmp 8010562a <alltraps> 8010655f <vector254>: 8010655f: 6a 00 push $0x0 80106561: 68 fe 00 00 00 push $0xfe 80106566: e9 bf f0 ff ff jmp 8010562a <alltraps> 8010656b <vector255>: 8010656b: 6a 00 push $0x0 8010656d: 68 ff 00 00 00 push $0xff 80106572: e9 b3 f0 ff ff jmp 8010562a <alltraps> 80106577: 66 90 xchg %ax,%ax 80106579: 66 90 xchg %ax,%ax 8010657b: 66 90 xchg %ax,%ax 8010657d: 66 90 xchg %ax,%ax 8010657f: 90 nop 80106580 <walkpgdir>: 80106580: 55 push %ebp 80106581: 89 e5 mov %esp,%ebp 80106583: 57 push %edi 80106584: 56 push %esi 80106585: 53 push %ebx 80106586: 89 d3 mov %edx,%ebx 80106588: 89 d7 mov %edx,%edi 8010658a: c1 eb 16 shr $0x16,%ebx 8010658d: 8d 34 98 lea (%eax,%ebx,4),%esi 80106590: 83 ec 0c sub $0xc,%esp 80106593: 8b 06 mov (%esi),%eax 80106595: a8 01 test $0x1,%al 80106597: 74 27 je 801065c0 <walkpgdir+0x40> 80106599: 25 00 f0 ff ff and $0xfffff000,%eax 8010659e: 8d 98 00 00 00 80 lea -0x80000000(%eax),%ebx 801065a4: c1 ef 0a shr $0xa,%edi 801065a7: 8d 65 f4 lea -0xc(%ebp),%esp 801065aa: 89 fa mov %edi,%edx 801065ac: 81 e2 fc 0f 00 00 and $0xffc,%edx 801065b2: 8d 04 13 lea (%ebx,%edx,1),%eax 801065b5: 5b pop %ebx 801065b6: 5e pop %esi 801065b7: 5f pop %edi 801065b8: 5d pop %ebp 801065b9: c3 ret 801065ba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801065c0: 85 c9 test %ecx,%ecx 801065c2: 74 2c je 801065f0 <walkpgdir+0x70> 801065c4: e8 f7 be ff ff call 801024c0 <kalloc> 801065c9: 85 c0 test %eax,%eax 801065cb: 89 c3 mov %eax,%ebx 801065cd: 74 21 je 801065f0 <walkpgdir+0x70> 801065cf: 83 ec 04 sub $0x4,%esp 801065d2: 68 00 10 00 00 push $0x1000 801065d7: 6a 00 push $0x0 801065d9: 50 push %eax 801065da: e8 71 de ff ff call 80104450 <memset> 801065df: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax 801065e5: 83 c4 10 add $0x10,%esp 801065e8: 83 c8 07 or $0x7,%eax 801065eb: 89 06 mov %eax,(%esi) 801065ed: eb b5 jmp 801065a4 <walkpgdir+0x24> 801065ef: 90 nop 801065f0: 8d 65 f4 lea -0xc(%ebp),%esp 801065f3: 31 c0 xor %eax,%eax 801065f5: 5b pop %ebx 801065f6: 5e pop %esi 801065f7: 5f pop %edi 801065f8: 5d pop %ebp 801065f9: c3 ret 801065fa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106600 <mappages>: 80106600: 55 push %ebp 80106601: 89 e5 mov %esp,%ebp 80106603: 57 push %edi 80106604: 56 push %esi 80106605: 53 push %ebx 80106606: 89 d3 mov %edx,%ebx 80106608: 81 e3 00 f0 ff ff and $0xfffff000,%ebx 8010660e: 83 ec 1c sub $0x1c,%esp 80106611: 89 45 e4 mov %eax,-0x1c(%ebp) 80106614: 8d 44 0a ff lea -0x1(%edx,%ecx,1),%eax 80106618: 8b 7d 08 mov 0x8(%ebp),%edi 8010661b: 25 00 f0 ff ff and $0xfffff000,%eax 80106620: 89 45 e0 mov %eax,-0x20(%ebp) 80106623: 8b 45 0c mov 0xc(%ebp),%eax 80106626: 29 df sub %ebx,%edi 80106628: 83 c8 01 or $0x1,%eax 8010662b: 89 45 dc mov %eax,-0x24(%ebp) 8010662e: eb 15 jmp 80106645 <mappages+0x45> 80106630: f6 00 01 testb $0x1,(%eax) 80106633: 75 45 jne 8010667a <mappages+0x7a> 80106635: 0b 75 dc or -0x24(%ebp),%esi 80106638: 3b 5d e0 cmp -0x20(%ebp),%ebx 8010663b: 89 30 mov %esi,(%eax) 8010663d: 74 31 je 80106670 <mappages+0x70> 8010663f: 81 c3 00 10 00 00 add $0x1000,%ebx 80106645: 8b 45 e4 mov -0x1c(%ebp),%eax 80106648: b9 01 00 00 00 mov $0x1,%ecx 8010664d: 89 da mov %ebx,%edx 8010664f: 8d 34 3b lea (%ebx,%edi,1),%esi 80106652: e8 29 ff ff ff call 80106580 <walkpgdir> 80106657: 85 c0 test %eax,%eax 80106659: 75 d5 jne 80106630 <mappages+0x30> 8010665b: 8d 65 f4 lea -0xc(%ebp),%esp 8010665e: b8 ff ff ff ff mov $0xffffffff,%eax 80106663: 5b pop %ebx 80106664: 5e pop %esi 80106665: 5f pop %edi 80106666: 5d pop %ebp 80106667: c3 ret 80106668: 90 nop 80106669: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106670: 8d 65 f4 lea -0xc(%ebp),%esp 80106673: 31 c0 xor %eax,%eax 80106675: 5b pop %ebx 80106676: 5e pop %esi 80106677: 5f pop %edi 80106678: 5d pop %ebp 80106679: c3 ret 8010667a: 83 ec 0c sub $0xc,%esp 8010667d: 68 88 77 10 80 push $0x80107788 80106682: e8 09 9d ff ff call 80100390 <panic> 80106687: 89 f6 mov %esi,%esi 80106689: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106690 <deallocuvm.part.0>: 80106690: 55 push %ebp 80106691: 89 e5 mov %esp,%ebp 80106693: 57 push %edi 80106694: 56 push %esi 80106695: 53 push %ebx 80106696: 8d 99 ff 0f 00 00 lea 0xfff(%ecx),%ebx 8010669c: 89 c7 mov %eax,%edi 8010669e: 81 e3 00 f0 ff ff and $0xfffff000,%ebx 801066a4: 83 ec 1c sub $0x1c,%esp 801066a7: 89 4d e0 mov %ecx,-0x20(%ebp) 801066aa: 39 d3 cmp %edx,%ebx 801066ac: 73 66 jae 80106714 <deallocuvm.part.0+0x84> 801066ae: 89 d6 mov %edx,%esi 801066b0: eb 3d jmp 801066ef <deallocuvm.part.0+0x5f> 801066b2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801066b8: 8b 10 mov (%eax),%edx 801066ba: f6 c2 01 test $0x1,%dl 801066bd: 74 26 je 801066e5 <deallocuvm.part.0+0x55> 801066bf: 81 e2 00 f0 ff ff and $0xfffff000,%edx 801066c5: 74 58 je 8010671f <deallocuvm.part.0+0x8f> 801066c7: 83 ec 0c sub $0xc,%esp 801066ca: 81 c2 00 00 00 80 add $0x80000000,%edx 801066d0: 89 45 e4 mov %eax,-0x1c(%ebp) 801066d3: 52 push %edx 801066d4: e8 37 bc ff ff call 80102310 <kfree> 801066d9: 8b 45 e4 mov -0x1c(%ebp),%eax 801066dc: 83 c4 10 add $0x10,%esp 801066df: c7 00 00 00 00 00 movl $0x0,(%eax) 801066e5: 81 c3 00 10 00 00 add $0x1000,%ebx 801066eb: 39 f3 cmp %esi,%ebx 801066ed: 73 25 jae 80106714 <deallocuvm.part.0+0x84> 801066ef: 31 c9 xor %ecx,%ecx 801066f1: 89 da mov %ebx,%edx 801066f3: 89 f8 mov %edi,%eax 801066f5: e8 86 fe ff ff call 80106580 <walkpgdir> 801066fa: 85 c0 test %eax,%eax 801066fc: 75 ba jne 801066b8 <deallocuvm.part.0+0x28> 801066fe: 81 e3 00 00 c0 ff and $0xffc00000,%ebx 80106704: 81 c3 00 f0 3f 00 add $0x3ff000,%ebx 8010670a: 81 c3 00 10 00 00 add $0x1000,%ebx 80106710: 39 f3 cmp %esi,%ebx 80106712: 72 db jb 801066ef <deallocuvm.part.0+0x5f> 80106714: 8b 45 e0 mov -0x20(%ebp),%eax 80106717: 8d 65 f4 lea -0xc(%ebp),%esp 8010671a: 5b pop %ebx 8010671b: 5e pop %esi 8010671c: 5f pop %edi 8010671d: 5d pop %ebp 8010671e: c3 ret 8010671f: 83 ec 0c sub $0xc,%esp 80106722: 68 26 71 10 80 push $0x80107126 80106727: e8 64 9c ff ff call 80100390 <panic> 8010672c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80106730 <seginit>: 80106730: 55 push %ebp 80106731: 89 e5 mov %esp,%ebp 80106733: 83 ec 18 sub $0x18,%esp 80106736: e8 85 d0 ff ff call 801037c0 <cpuid> 8010673b: 69 c0 b0 00 00 00 imul $0xb0,%eax,%eax 80106741: ba 2f 00 00 00 mov $0x2f,%edx 80106746: 66 89 55 f2 mov %dx,-0xe(%ebp) 8010674a: c7 80 f8 27 11 80 ff movl $0xffff,-0x7feed808(%eax) 80106751: ff 00 00 80106754: c7 80 fc 27 11 80 00 movl $0xcf9a00,-0x7feed804(%eax) 8010675b: 9a cf 00 8010675e: c7 80 00 28 11 80 ff movl $0xffff,-0x7feed800(%eax) 80106765: ff 00 00 80106768: c7 80 04 28 11 80 00 movl $0xcf9200,-0x7feed7fc(%eax) 8010676f: 92 cf 00 80106772: c7 80 08 28 11 80 ff movl $0xffff,-0x7feed7f8(%eax) 80106779: ff 00 00 8010677c: c7 80 0c 28 11 80 00 movl $0xcffa00,-0x7feed7f4(%eax) 80106783: fa cf 00 80106786: c7 80 10 28 11 80 ff movl $0xffff,-0x7feed7f0(%eax) 8010678d: ff 00 00 80106790: c7 80 14 28 11 80 00 movl $0xcff200,-0x7feed7ec(%eax) 80106797: f2 cf 00 8010679a: 05 f0 27 11 80 add $0x801127f0,%eax 8010679f: 66 89 45 f4 mov %ax,-0xc(%ebp) 801067a3: c1 e8 10 shr $0x10,%eax 801067a6: 66 89 45 f6 mov %ax,-0xa(%ebp) 801067aa: 8d 45 f2 lea -0xe(%ebp),%eax 801067ad: 0f 01 10 lgdtl (%eax) 801067b0: c9 leave 801067b1: c3 ret 801067b2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801067b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801067c0 <switchkvm>: 801067c0: a1 a4 54 11 80 mov 0x801154a4,%eax 801067c5: 55 push %ebp 801067c6: 89 e5 mov %esp,%ebp 801067c8: 05 00 00 00 80 add $0x80000000,%eax 801067cd: 0f 22 d8 mov %eax,%cr3 801067d0: 5d pop %ebp 801067d1: c3 ret 801067d2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801067d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801067e0 <switchuvm>: 801067e0: 55 push %ebp 801067e1: 89 e5 mov %esp,%ebp 801067e3: 57 push %edi 801067e4: 56 push %esi 801067e5: 53 push %ebx 801067e6: 83 ec 1c sub $0x1c,%esp 801067e9: 8b 5d 08 mov 0x8(%ebp),%ebx 801067ec: 85 db test %ebx,%ebx 801067ee: 0f 84 cb 00 00 00 je 801068bf <switchuvm+0xdf> 801067f4: 8b 43 08 mov 0x8(%ebx),%eax 801067f7: 85 c0 test %eax,%eax 801067f9: 0f 84 da 00 00 00 je 801068d9 <switchuvm+0xf9> 801067ff: 8b 43 04 mov 0x4(%ebx),%eax 80106802: 85 c0 test %eax,%eax 80106804: 0f 84 c2 00 00 00 je 801068cc <switchuvm+0xec> 8010680a: e8 61 da ff ff call 80104270 <pushcli> 8010680f: e8 2c cf ff ff call 80103740 <mycpu> 80106814: 89 c6 mov %eax,%esi 80106816: e8 25 cf ff ff call 80103740 <mycpu> 8010681b: 89 c7 mov %eax,%edi 8010681d: e8 1e cf ff ff call 80103740 <mycpu> 80106822: 89 45 e4 mov %eax,-0x1c(%ebp) 80106825: 83 c7 08 add $0x8,%edi 80106828: e8 13 cf ff ff call 80103740 <mycpu> 8010682d: 8b 4d e4 mov -0x1c(%ebp),%ecx 80106830: 83 c0 08 add $0x8,%eax 80106833: ba 67 00 00 00 mov $0x67,%edx 80106838: c1 e8 18 shr $0x18,%eax 8010683b: 66 89 96 98 00 00 00 mov %dx,0x98(%esi) 80106842: 66 89 be 9a 00 00 00 mov %di,0x9a(%esi) 80106849: 88 86 9f 00 00 00 mov %al,0x9f(%esi) 8010684f: bf ff ff ff ff mov $0xffffffff,%edi 80106854: 83 c1 08 add $0x8,%ecx 80106857: c1 e9 10 shr $0x10,%ecx 8010685a: 88 8e 9c 00 00 00 mov %cl,0x9c(%esi) 80106860: b9 99 40 00 00 mov $0x4099,%ecx 80106865: 66 89 8e 9d 00 00 00 mov %cx,0x9d(%esi) 8010686c: be 10 00 00 00 mov $0x10,%esi 80106871: e8 ca ce ff ff call 80103740 <mycpu> 80106876: 80 a0 9d 00 00 00 ef andb $0xef,0x9d(%eax) 8010687d: e8 be ce ff ff call 80103740 <mycpu> 80106882: 66 89 70 10 mov %si,0x10(%eax) 80106886: 8b 73 08 mov 0x8(%ebx),%esi 80106889: e8 b2 ce ff ff call 80103740 <mycpu> 8010688e: 81 c6 00 10 00 00 add $0x1000,%esi 80106894: 89 70 0c mov %esi,0xc(%eax) 80106897: e8 a4 ce ff ff call 80103740 <mycpu> 8010689c: 66 89 78 6e mov %di,0x6e(%eax) 801068a0: b8 28 00 00 00 mov $0x28,%eax 801068a5: 0f 00 d8 ltr %ax 801068a8: 8b 43 04 mov 0x4(%ebx),%eax 801068ab: 05 00 00 00 80 add $0x80000000,%eax 801068b0: 0f 22 d8 mov %eax,%cr3 801068b3: 8d 65 f4 lea -0xc(%ebp),%esp 801068b6: 5b pop %ebx 801068b7: 5e pop %esi 801068b8: 5f pop %edi 801068b9: 5d pop %ebp 801068ba: e9 f1 d9 ff ff jmp 801042b0 <popcli> 801068bf: 83 ec 0c sub $0xc,%esp 801068c2: 68 8e 77 10 80 push $0x8010778e 801068c7: e8 c4 9a ff ff call 80100390 <panic> 801068cc: 83 ec 0c sub $0xc,%esp 801068cf: 68 b9 77 10 80 push $0x801077b9 801068d4: e8 b7 9a ff ff call 80100390 <panic> 801068d9: 83 ec 0c sub $0xc,%esp 801068dc: 68 a4 77 10 80 push $0x801077a4 801068e1: e8 aa 9a ff ff call 80100390 <panic> 801068e6: 8d 76 00 lea 0x0(%esi),%esi 801068e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801068f0 <inituvm>: 801068f0: 55 push %ebp 801068f1: 89 e5 mov %esp,%ebp 801068f3: 57 push %edi 801068f4: 56 push %esi 801068f5: 53 push %ebx 801068f6: 83 ec 1c sub $0x1c,%esp 801068f9: 8b 75 10 mov 0x10(%ebp),%esi 801068fc: 8b 45 08 mov 0x8(%ebp),%eax 801068ff: 8b 7d 0c mov 0xc(%ebp),%edi 80106902: 81 fe ff 0f 00 00 cmp $0xfff,%esi 80106908: 89 45 e4 mov %eax,-0x1c(%ebp) 8010690b: 77 49 ja 80106956 <inituvm+0x66> 8010690d: e8 ae bb ff ff call 801024c0 <kalloc> 80106912: 83 ec 04 sub $0x4,%esp 80106915: 89 c3 mov %eax,%ebx 80106917: 68 00 10 00 00 push $0x1000 8010691c: 6a 00 push $0x0 8010691e: 50 push %eax 8010691f: e8 2c db ff ff call 80104450 <memset> 80106924: 58 pop %eax 80106925: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax 8010692b: b9 00 10 00 00 mov $0x1000,%ecx 80106930: 5a pop %edx 80106931: 6a 06 push $0x6 80106933: 50 push %eax 80106934: 31 d2 xor %edx,%edx 80106936: 8b 45 e4 mov -0x1c(%ebp),%eax 80106939: e8 c2 fc ff ff call 80106600 <mappages> 8010693e: 89 75 10 mov %esi,0x10(%ebp) 80106941: 89 7d 0c mov %edi,0xc(%ebp) 80106944: 83 c4 10 add $0x10,%esp 80106947: 89 5d 08 mov %ebx,0x8(%ebp) 8010694a: 8d 65 f4 lea -0xc(%ebp),%esp 8010694d: 5b pop %ebx 8010694e: 5e pop %esi 8010694f: 5f pop %edi 80106950: 5d pop %ebp 80106951: e9 aa db ff ff jmp 80104500 <memmove> 80106956: 83 ec 0c sub $0xc,%esp 80106959: 68 cd 77 10 80 push $0x801077cd 8010695e: e8 2d 9a ff ff call 80100390 <panic> 80106963: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106969: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106970 <loaduvm>: 80106970: 55 push %ebp 80106971: 89 e5 mov %esp,%ebp 80106973: 57 push %edi 80106974: 56 push %esi 80106975: 53 push %ebx 80106976: 83 ec 0c sub $0xc,%esp 80106979: f7 45 0c ff 0f 00 00 testl $0xfff,0xc(%ebp) 80106980: 0f 85 91 00 00 00 jne 80106a17 <loaduvm+0xa7> 80106986: 8b 75 18 mov 0x18(%ebp),%esi 80106989: 31 db xor %ebx,%ebx 8010698b: 85 f6 test %esi,%esi 8010698d: 75 1a jne 801069a9 <loaduvm+0x39> 8010698f: eb 6f jmp 80106a00 <loaduvm+0x90> 80106991: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106998: 81 c3 00 10 00 00 add $0x1000,%ebx 8010699e: 81 ee 00 10 00 00 sub $0x1000,%esi 801069a4: 39 5d 18 cmp %ebx,0x18(%ebp) 801069a7: 76 57 jbe 80106a00 <loaduvm+0x90> 801069a9: 8b 55 0c mov 0xc(%ebp),%edx 801069ac: 8b 45 08 mov 0x8(%ebp),%eax 801069af: 31 c9 xor %ecx,%ecx 801069b1: 01 da add %ebx,%edx 801069b3: e8 c8 fb ff ff call 80106580 <walkpgdir> 801069b8: 85 c0 test %eax,%eax 801069ba: 74 4e je 80106a0a <loaduvm+0x9a> 801069bc: 8b 00 mov (%eax),%eax 801069be: 8b 4d 14 mov 0x14(%ebp),%ecx 801069c1: bf 00 10 00 00 mov $0x1000,%edi 801069c6: 25 00 f0 ff ff and $0xfffff000,%eax 801069cb: 81 fe ff 0f 00 00 cmp $0xfff,%esi 801069d1: 0f 46 fe cmovbe %esi,%edi 801069d4: 01 d9 add %ebx,%ecx 801069d6: 05 00 00 00 80 add $0x80000000,%eax 801069db: 57 push %edi 801069dc: 51 push %ecx 801069dd: 50 push %eax 801069de: ff 75 10 pushl 0x10(%ebp) 801069e1: e8 7a af ff ff call 80101960 <readi> 801069e6: 83 c4 10 add $0x10,%esp 801069e9: 39 f8 cmp %edi,%eax 801069eb: 74 ab je 80106998 <loaduvm+0x28> 801069ed: 8d 65 f4 lea -0xc(%ebp),%esp 801069f0: b8 ff ff ff ff mov $0xffffffff,%eax 801069f5: 5b pop %ebx 801069f6: 5e pop %esi 801069f7: 5f pop %edi 801069f8: 5d pop %ebp 801069f9: c3 ret 801069fa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106a00: 8d 65 f4 lea -0xc(%ebp),%esp 80106a03: 31 c0 xor %eax,%eax 80106a05: 5b pop %ebx 80106a06: 5e pop %esi 80106a07: 5f pop %edi 80106a08: 5d pop %ebp 80106a09: c3 ret 80106a0a: 83 ec 0c sub $0xc,%esp 80106a0d: 68 e7 77 10 80 push $0x801077e7 80106a12: e8 79 99 ff ff call 80100390 <panic> 80106a17: 83 ec 0c sub $0xc,%esp 80106a1a: 68 88 78 10 80 push $0x80107888 80106a1f: e8 6c 99 ff ff call 80100390 <panic> 80106a24: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106a2a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80106a30 <allocuvm>: 80106a30: 55 push %ebp 80106a31: 89 e5 mov %esp,%ebp 80106a33: 57 push %edi 80106a34: 56 push %esi 80106a35: 53 push %ebx 80106a36: 83 ec 1c sub $0x1c,%esp 80106a39: 8b 7d 10 mov 0x10(%ebp),%edi 80106a3c: 85 ff test %edi,%edi 80106a3e: 0f 88 8e 00 00 00 js 80106ad2 <allocuvm+0xa2> 80106a44: 3b 7d 0c cmp 0xc(%ebp),%edi 80106a47: 0f 82 93 00 00 00 jb 80106ae0 <allocuvm+0xb0> 80106a4d: 8b 45 0c mov 0xc(%ebp),%eax 80106a50: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 80106a56: 81 e3 00 f0 ff ff and $0xfffff000,%ebx 80106a5c: 39 5d 10 cmp %ebx,0x10(%ebp) 80106a5f: 0f 86 7e 00 00 00 jbe 80106ae3 <allocuvm+0xb3> 80106a65: 89 7d e4 mov %edi,-0x1c(%ebp) 80106a68: 8b 7d 08 mov 0x8(%ebp),%edi 80106a6b: eb 42 jmp 80106aaf <allocuvm+0x7f> 80106a6d: 8d 76 00 lea 0x0(%esi),%esi 80106a70: 83 ec 04 sub $0x4,%esp 80106a73: 68 00 10 00 00 push $0x1000 80106a78: 6a 00 push $0x0 80106a7a: 50 push %eax 80106a7b: e8 d0 d9 ff ff call 80104450 <memset> 80106a80: 58 pop %eax 80106a81: 8d 86 00 00 00 80 lea -0x80000000(%esi),%eax 80106a87: b9 00 10 00 00 mov $0x1000,%ecx 80106a8c: 5a pop %edx 80106a8d: 6a 06 push $0x6 80106a8f: 50 push %eax 80106a90: 89 da mov %ebx,%edx 80106a92: 89 f8 mov %edi,%eax 80106a94: e8 67 fb ff ff call 80106600 <mappages> 80106a99: 83 c4 10 add $0x10,%esp 80106a9c: 85 c0 test %eax,%eax 80106a9e: 78 50 js 80106af0 <allocuvm+0xc0> 80106aa0: 81 c3 00 10 00 00 add $0x1000,%ebx 80106aa6: 39 5d 10 cmp %ebx,0x10(%ebp) 80106aa9: 0f 86 81 00 00 00 jbe 80106b30 <allocuvm+0x100> 80106aaf: e8 0c ba ff ff call 801024c0 <kalloc> 80106ab4: 85 c0 test %eax,%eax 80106ab6: 89 c6 mov %eax,%esi 80106ab8: 75 b6 jne 80106a70 <allocuvm+0x40> 80106aba: 83 ec 0c sub $0xc,%esp 80106abd: 68 05 78 10 80 push $0x80107805 80106ac2: e8 99 9b ff ff call 80100660 <cprintf> 80106ac7: 83 c4 10 add $0x10,%esp 80106aca: 8b 45 0c mov 0xc(%ebp),%eax 80106acd: 39 45 10 cmp %eax,0x10(%ebp) 80106ad0: 77 6e ja 80106b40 <allocuvm+0x110> 80106ad2: 8d 65 f4 lea -0xc(%ebp),%esp 80106ad5: 31 ff xor %edi,%edi 80106ad7: 89 f8 mov %edi,%eax 80106ad9: 5b pop %ebx 80106ada: 5e pop %esi 80106adb: 5f pop %edi 80106adc: 5d pop %ebp 80106add: c3 ret 80106ade: 66 90 xchg %ax,%ax 80106ae0: 8b 7d 0c mov 0xc(%ebp),%edi 80106ae3: 8d 65 f4 lea -0xc(%ebp),%esp 80106ae6: 89 f8 mov %edi,%eax 80106ae8: 5b pop %ebx 80106ae9: 5e pop %esi 80106aea: 5f pop %edi 80106aeb: 5d pop %ebp 80106aec: c3 ret 80106aed: 8d 76 00 lea 0x0(%esi),%esi 80106af0: 83 ec 0c sub $0xc,%esp 80106af3: 68 1d 78 10 80 push $0x8010781d 80106af8: e8 63 9b ff ff call 80100660 <cprintf> 80106afd: 83 c4 10 add $0x10,%esp 80106b00: 8b 45 0c mov 0xc(%ebp),%eax 80106b03: 39 45 10 cmp %eax,0x10(%ebp) 80106b06: 76 0d jbe 80106b15 <allocuvm+0xe5> 80106b08: 89 c1 mov %eax,%ecx 80106b0a: 8b 55 10 mov 0x10(%ebp),%edx 80106b0d: 8b 45 08 mov 0x8(%ebp),%eax 80106b10: e8 7b fb ff ff call 80106690 <deallocuvm.part.0> 80106b15: 83 ec 0c sub $0xc,%esp 80106b18: 31 ff xor %edi,%edi 80106b1a: 56 push %esi 80106b1b: e8 f0 b7 ff ff call 80102310 <kfree> 80106b20: 83 c4 10 add $0x10,%esp 80106b23: 8d 65 f4 lea -0xc(%ebp),%esp 80106b26: 89 f8 mov %edi,%eax 80106b28: 5b pop %ebx 80106b29: 5e pop %esi 80106b2a: 5f pop %edi 80106b2b: 5d pop %ebp 80106b2c: c3 ret 80106b2d: 8d 76 00 lea 0x0(%esi),%esi 80106b30: 8b 7d e4 mov -0x1c(%ebp),%edi 80106b33: 8d 65 f4 lea -0xc(%ebp),%esp 80106b36: 5b pop %ebx 80106b37: 89 f8 mov %edi,%eax 80106b39: 5e pop %esi 80106b3a: 5f pop %edi 80106b3b: 5d pop %ebp 80106b3c: c3 ret 80106b3d: 8d 76 00 lea 0x0(%esi),%esi 80106b40: 89 c1 mov %eax,%ecx 80106b42: 8b 55 10 mov 0x10(%ebp),%edx 80106b45: 8b 45 08 mov 0x8(%ebp),%eax 80106b48: 31 ff xor %edi,%edi 80106b4a: e8 41 fb ff ff call 80106690 <deallocuvm.part.0> 80106b4f: eb 92 jmp 80106ae3 <allocuvm+0xb3> 80106b51: eb 0d jmp 80106b60 <deallocuvm> 80106b53: 90 nop 80106b54: 90 nop 80106b55: 90 nop 80106b56: 90 nop 80106b57: 90 nop 80106b58: 90 nop 80106b59: 90 nop 80106b5a: 90 nop 80106b5b: 90 nop 80106b5c: 90 nop 80106b5d: 90 nop 80106b5e: 90 nop 80106b5f: 90 nop 80106b60 <deallocuvm>: 80106b60: 55 push %ebp 80106b61: 89 e5 mov %esp,%ebp 80106b63: 8b 55 0c mov 0xc(%ebp),%edx 80106b66: 8b 4d 10 mov 0x10(%ebp),%ecx 80106b69: 8b 45 08 mov 0x8(%ebp),%eax 80106b6c: 39 d1 cmp %edx,%ecx 80106b6e: 73 10 jae 80106b80 <deallocuvm+0x20> 80106b70: 5d pop %ebp 80106b71: e9 1a fb ff ff jmp 80106690 <deallocuvm.part.0> 80106b76: 8d 76 00 lea 0x0(%esi),%esi 80106b79: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106b80: 89 d0 mov %edx,%eax 80106b82: 5d pop %ebp 80106b83: c3 ret 80106b84: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106b8a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80106b90 <freevm>: 80106b90: 55 push %ebp 80106b91: 89 e5 mov %esp,%ebp 80106b93: 57 push %edi 80106b94: 56 push %esi 80106b95: 53 push %ebx 80106b96: 83 ec 0c sub $0xc,%esp 80106b99: 8b 75 08 mov 0x8(%ebp),%esi 80106b9c: 85 f6 test %esi,%esi 80106b9e: 74 59 je 80106bf9 <freevm+0x69> 80106ba0: 31 c9 xor %ecx,%ecx 80106ba2: ba 00 00 00 80 mov $0x80000000,%edx 80106ba7: 89 f0 mov %esi,%eax 80106ba9: e8 e2 fa ff ff call 80106690 <deallocuvm.part.0> 80106bae: 89 f3 mov %esi,%ebx 80106bb0: 8d be 00 10 00 00 lea 0x1000(%esi),%edi 80106bb6: eb 0f jmp 80106bc7 <freevm+0x37> 80106bb8: 90 nop 80106bb9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106bc0: 83 c3 04 add $0x4,%ebx 80106bc3: 39 fb cmp %edi,%ebx 80106bc5: 74 23 je 80106bea <freevm+0x5a> 80106bc7: 8b 03 mov (%ebx),%eax 80106bc9: a8 01 test $0x1,%al 80106bcb: 74 f3 je 80106bc0 <freevm+0x30> 80106bcd: 25 00 f0 ff ff and $0xfffff000,%eax 80106bd2: 83 ec 0c sub $0xc,%esp 80106bd5: 83 c3 04 add $0x4,%ebx 80106bd8: 05 00 00 00 80 add $0x80000000,%eax 80106bdd: 50 push %eax 80106bde: e8 2d b7 ff ff call 80102310 <kfree> 80106be3: 83 c4 10 add $0x10,%esp 80106be6: 39 fb cmp %edi,%ebx 80106be8: 75 dd jne 80106bc7 <freevm+0x37> 80106bea: 89 75 08 mov %esi,0x8(%ebp) 80106bed: 8d 65 f4 lea -0xc(%ebp),%esp 80106bf0: 5b pop %ebx 80106bf1: 5e pop %esi 80106bf2: 5f pop %edi 80106bf3: 5d pop %ebp 80106bf4: e9 17 b7 ff ff jmp 80102310 <kfree> 80106bf9: 83 ec 0c sub $0xc,%esp 80106bfc: 68 39 78 10 80 push $0x80107839 80106c01: e8 8a 97 ff ff call 80100390 <panic> 80106c06: 8d 76 00 lea 0x0(%esi),%esi 80106c09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106c10 <setupkvm>: 80106c10: 55 push %ebp 80106c11: 89 e5 mov %esp,%ebp 80106c13: 56 push %esi 80106c14: 53 push %ebx 80106c15: e8 a6 b8 ff ff call 801024c0 <kalloc> 80106c1a: 85 c0 test %eax,%eax 80106c1c: 89 c6 mov %eax,%esi 80106c1e: 74 42 je 80106c62 <setupkvm+0x52> 80106c20: 83 ec 04 sub $0x4,%esp 80106c23: bb 20 a4 10 80 mov $0x8010a420,%ebx 80106c28: 68 00 10 00 00 push $0x1000 80106c2d: 6a 00 push $0x0 80106c2f: 50 push %eax 80106c30: e8 1b d8 ff ff call 80104450 <memset> 80106c35: 83 c4 10 add $0x10,%esp 80106c38: 8b 43 04 mov 0x4(%ebx),%eax 80106c3b: 8b 4b 08 mov 0x8(%ebx),%ecx 80106c3e: 83 ec 08 sub $0x8,%esp 80106c41: 8b 13 mov (%ebx),%edx 80106c43: ff 73 0c pushl 0xc(%ebx) 80106c46: 50 push %eax 80106c47: 29 c1 sub %eax,%ecx 80106c49: 89 f0 mov %esi,%eax 80106c4b: e8 b0 f9 ff ff call 80106600 <mappages> 80106c50: 83 c4 10 add $0x10,%esp 80106c53: 85 c0 test %eax,%eax 80106c55: 78 19 js 80106c70 <setupkvm+0x60> 80106c57: 83 c3 10 add $0x10,%ebx 80106c5a: 81 fb 60 a4 10 80 cmp $0x8010a460,%ebx 80106c60: 75 d6 jne 80106c38 <setupkvm+0x28> 80106c62: 8d 65 f8 lea -0x8(%ebp),%esp 80106c65: 89 f0 mov %esi,%eax 80106c67: 5b pop %ebx 80106c68: 5e pop %esi 80106c69: 5d pop %ebp 80106c6a: c3 ret 80106c6b: 90 nop 80106c6c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80106c70: 83 ec 0c sub $0xc,%esp 80106c73: 56 push %esi 80106c74: 31 f6 xor %esi,%esi 80106c76: e8 15 ff ff ff call 80106b90 <freevm> 80106c7b: 83 c4 10 add $0x10,%esp 80106c7e: 8d 65 f8 lea -0x8(%ebp),%esp 80106c81: 89 f0 mov %esi,%eax 80106c83: 5b pop %ebx 80106c84: 5e pop %esi 80106c85: 5d pop %ebp 80106c86: c3 ret 80106c87: 89 f6 mov %esi,%esi 80106c89: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106c90 <kvmalloc>: 80106c90: 55 push %ebp 80106c91: 89 e5 mov %esp,%ebp 80106c93: 83 ec 08 sub $0x8,%esp 80106c96: e8 75 ff ff ff call 80106c10 <setupkvm> 80106c9b: a3 a4 54 11 80 mov %eax,0x801154a4 80106ca0: 05 00 00 00 80 add $0x80000000,%eax 80106ca5: 0f 22 d8 mov %eax,%cr3 80106ca8: c9 leave 80106ca9: c3 ret 80106caa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106cb0 <clearpteu>: 80106cb0: 55 push %ebp 80106cb1: 31 c9 xor %ecx,%ecx 80106cb3: 89 e5 mov %esp,%ebp 80106cb5: 83 ec 08 sub $0x8,%esp 80106cb8: 8b 55 0c mov 0xc(%ebp),%edx 80106cbb: 8b 45 08 mov 0x8(%ebp),%eax 80106cbe: e8 bd f8 ff ff call 80106580 <walkpgdir> 80106cc3: 85 c0 test %eax,%eax 80106cc5: 74 05 je 80106ccc <clearpteu+0x1c> 80106cc7: 83 20 fb andl $0xfffffffb,(%eax) 80106cca: c9 leave 80106ccb: c3 ret 80106ccc: 83 ec 0c sub $0xc,%esp 80106ccf: 68 4a 78 10 80 push $0x8010784a 80106cd4: e8 b7 96 ff ff call 80100390 <panic> 80106cd9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106ce0 <copyuvm>: 80106ce0: 55 push %ebp 80106ce1: 89 e5 mov %esp,%ebp 80106ce3: 57 push %edi 80106ce4: 56 push %esi 80106ce5: 53 push %ebx 80106ce6: 83 ec 1c sub $0x1c,%esp 80106ce9: e8 22 ff ff ff call 80106c10 <setupkvm> 80106cee: 85 c0 test %eax,%eax 80106cf0: 89 45 e0 mov %eax,-0x20(%ebp) 80106cf3: 0f 84 9f 00 00 00 je 80106d98 <copyuvm+0xb8> 80106cf9: 8b 4d 0c mov 0xc(%ebp),%ecx 80106cfc: 85 c9 test %ecx,%ecx 80106cfe: 0f 84 94 00 00 00 je 80106d98 <copyuvm+0xb8> 80106d04: 31 ff xor %edi,%edi 80106d06: eb 4a jmp 80106d52 <copyuvm+0x72> 80106d08: 90 nop 80106d09: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106d10: 83 ec 04 sub $0x4,%esp 80106d13: 81 c3 00 00 00 80 add $0x80000000,%ebx 80106d19: 68 00 10 00 00 push $0x1000 80106d1e: 53 push %ebx 80106d1f: 50 push %eax 80106d20: e8 db d7 ff ff call 80104500 <memmove> 80106d25: 58 pop %eax 80106d26: 8d 86 00 00 00 80 lea -0x80000000(%esi),%eax 80106d2c: b9 00 10 00 00 mov $0x1000,%ecx 80106d31: 5a pop %edx 80106d32: ff 75 e4 pushl -0x1c(%ebp) 80106d35: 50 push %eax 80106d36: 89 fa mov %edi,%edx 80106d38: 8b 45 e0 mov -0x20(%ebp),%eax 80106d3b: e8 c0 f8 ff ff call 80106600 <mappages> 80106d40: 83 c4 10 add $0x10,%esp 80106d43: 85 c0 test %eax,%eax 80106d45: 78 61 js 80106da8 <copyuvm+0xc8> 80106d47: 81 c7 00 10 00 00 add $0x1000,%edi 80106d4d: 39 7d 0c cmp %edi,0xc(%ebp) 80106d50: 76 46 jbe 80106d98 <copyuvm+0xb8> 80106d52: 8b 45 08 mov 0x8(%ebp),%eax 80106d55: 31 c9 xor %ecx,%ecx 80106d57: 89 fa mov %edi,%edx 80106d59: e8 22 f8 ff ff call 80106580 <walkpgdir> 80106d5e: 85 c0 test %eax,%eax 80106d60: 74 61 je 80106dc3 <copyuvm+0xe3> 80106d62: 8b 00 mov (%eax),%eax 80106d64: a8 01 test $0x1,%al 80106d66: 74 4e je 80106db6 <copyuvm+0xd6> 80106d68: 89 c3 mov %eax,%ebx 80106d6a: 25 ff 0f 00 00 and $0xfff,%eax 80106d6f: 81 e3 00 f0 ff ff and $0xfffff000,%ebx 80106d75: 89 45 e4 mov %eax,-0x1c(%ebp) 80106d78: e8 43 b7 ff ff call 801024c0 <kalloc> 80106d7d: 85 c0 test %eax,%eax 80106d7f: 89 c6 mov %eax,%esi 80106d81: 75 8d jne 80106d10 <copyuvm+0x30> 80106d83: 83 ec 0c sub $0xc,%esp 80106d86: ff 75 e0 pushl -0x20(%ebp) 80106d89: e8 02 fe ff ff call 80106b90 <freevm> 80106d8e: 83 c4 10 add $0x10,%esp 80106d91: c7 45 e0 00 00 00 00 movl $0x0,-0x20(%ebp) 80106d98: 8b 45 e0 mov -0x20(%ebp),%eax 80106d9b: 8d 65 f4 lea -0xc(%ebp),%esp 80106d9e: 5b pop %ebx 80106d9f: 5e pop %esi 80106da0: 5f pop %edi 80106da1: 5d pop %ebp 80106da2: c3 ret 80106da3: 90 nop 80106da4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80106da8: 83 ec 0c sub $0xc,%esp 80106dab: 56 push %esi 80106dac: e8 5f b5 ff ff call 80102310 <kfree> 80106db1: 83 c4 10 add $0x10,%esp 80106db4: eb cd jmp 80106d83 <copyuvm+0xa3> 80106db6: 83 ec 0c sub $0xc,%esp 80106db9: 68 6e 78 10 80 push $0x8010786e 80106dbe: e8 cd 95 ff ff call 80100390 <panic> 80106dc3: 83 ec 0c sub $0xc,%esp 80106dc6: 68 54 78 10 80 push $0x80107854 80106dcb: e8 c0 95 ff ff call 80100390 <panic> 80106dd0 <uva2ka>: 80106dd0: 55 push %ebp 80106dd1: 31 c9 xor %ecx,%ecx 80106dd3: 89 e5 mov %esp,%ebp 80106dd5: 83 ec 08 sub $0x8,%esp 80106dd8: 8b 55 0c mov 0xc(%ebp),%edx 80106ddb: 8b 45 08 mov 0x8(%ebp),%eax 80106dde: e8 9d f7 ff ff call 80106580 <walkpgdir> 80106de3: 8b 00 mov (%eax),%eax 80106de5: c9 leave 80106de6: 89 c2 mov %eax,%edx 80106de8: 25 00 f0 ff ff and $0xfffff000,%eax 80106ded: 83 e2 05 and $0x5,%edx 80106df0: 05 00 00 00 80 add $0x80000000,%eax 80106df5: 83 fa 05 cmp $0x5,%edx 80106df8: ba 00 00 00 00 mov $0x0,%edx 80106dfd: 0f 45 c2 cmovne %edx,%eax 80106e00: c3 ret 80106e01: eb 0d jmp 80106e10 <copyout> 80106e03: 90 nop 80106e04: 90 nop 80106e05: 90 nop 80106e06: 90 nop 80106e07: 90 nop 80106e08: 90 nop 80106e09: 90 nop 80106e0a: 90 nop 80106e0b: 90 nop 80106e0c: 90 nop 80106e0d: 90 nop 80106e0e: 90 nop 80106e0f: 90 nop 80106e10 <copyout>: 80106e10: 55 push %ebp 80106e11: 89 e5 mov %esp,%ebp 80106e13: 57 push %edi 80106e14: 56 push %esi 80106e15: 53 push %ebx 80106e16: 83 ec 1c sub $0x1c,%esp 80106e19: 8b 5d 14 mov 0x14(%ebp),%ebx 80106e1c: 8b 55 0c mov 0xc(%ebp),%edx 80106e1f: 8b 7d 10 mov 0x10(%ebp),%edi 80106e22: 85 db test %ebx,%ebx 80106e24: 75 40 jne 80106e66 <copyout+0x56> 80106e26: eb 70 jmp 80106e98 <copyout+0x88> 80106e28: 90 nop 80106e29: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106e30: 8b 55 e4 mov -0x1c(%ebp),%edx 80106e33: 89 f1 mov %esi,%ecx 80106e35: 29 d1 sub %edx,%ecx 80106e37: 81 c1 00 10 00 00 add $0x1000,%ecx 80106e3d: 39 d9 cmp %ebx,%ecx 80106e3f: 0f 47 cb cmova %ebx,%ecx 80106e42: 29 f2 sub %esi,%edx 80106e44: 83 ec 04 sub $0x4,%esp 80106e47: 01 d0 add %edx,%eax 80106e49: 51 push %ecx 80106e4a: 57 push %edi 80106e4b: 50 push %eax 80106e4c: 89 4d e4 mov %ecx,-0x1c(%ebp) 80106e4f: e8 ac d6 ff ff call 80104500 <memmove> 80106e54: 8b 4d e4 mov -0x1c(%ebp),%ecx 80106e57: 83 c4 10 add $0x10,%esp 80106e5a: 8d 96 00 10 00 00 lea 0x1000(%esi),%edx 80106e60: 01 cf add %ecx,%edi 80106e62: 29 cb sub %ecx,%ebx 80106e64: 74 32 je 80106e98 <copyout+0x88> 80106e66: 89 d6 mov %edx,%esi 80106e68: 83 ec 08 sub $0x8,%esp 80106e6b: 89 55 e4 mov %edx,-0x1c(%ebp) 80106e6e: 81 e6 00 f0 ff ff and $0xfffff000,%esi 80106e74: 56 push %esi 80106e75: ff 75 08 pushl 0x8(%ebp) 80106e78: e8 53 ff ff ff call 80106dd0 <uva2ka> 80106e7d: 83 c4 10 add $0x10,%esp 80106e80: 85 c0 test %eax,%eax 80106e82: 75 ac jne 80106e30 <copyout+0x20> 80106e84: 8d 65 f4 lea -0xc(%ebp),%esp 80106e87: b8 ff ff ff ff mov $0xffffffff,%eax 80106e8c: 5b pop %ebx 80106e8d: 5e pop %esi 80106e8e: 5f pop %edi 80106e8f: 5d pop %ebp 80106e90: c3 ret 80106e91: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106e98: 8d 65 f4 lea -0xc(%ebp),%esp 80106e9b: 31 c0 xor %eax,%eax 80106e9d: 5b pop %ebx 80106e9e: 5e pop %esi 80106e9f: 5f pop %edi 80106ea0: 5d pop %ebp 80106ea1: c3 ret
src/firmware-tests/Platform/PowerManagement/InitialiseAfterPowerManagementMock.asm
pete-restall/Cluck2Sesame-Prototype
1
85548
<filename>src/firmware-tests/Platform/PowerManagement/InitialiseAfterPowerManagementMock.asm #include "Platform.inc" #include "InitialisationChain.inc" #include "TestDoubles.inc" radix decimal udata global calledInitialiseAfterPowerManagement calledInitialiseAfterPowerManagement res 1 InitialiseAfterPowerManagementMock code global initialiseInitialiseAfterPowerManagementMock global INITIALISE_AFTER_POWERMANAGEMENT initialiseInitialiseAfterPowerManagementMock: banksel calledInitialiseAfterPowerManagement clrf calledInitialiseAfterPowerManagement return INITIALISE_AFTER_POWERMANAGEMENT: mockCalled calledInitialiseAfterPowerManagement return end
test/jzas/symboltable/invalid/fail06.asm
scoffey/jz80sim
1
171024
<reponame>scoffey/jz80sim<filename>test/jzas/symboltable/invalid/fail06.asm var1: db 2.0
src/natools-chunked_strings.ads
faelys/natools
0
15215
<reponame>faelys/natools<gh_stars>0 ------------------------------------------------------------------------------ -- Copyright (c) 2011, <NAME> -- -- -- -- Permission to use, copy, modify, and distribute this software for any -- -- purpose with or without fee is hereby granted, provided that the above -- -- copyright notice and this permission notice appear in all copies. -- -- -- -- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -- -- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -- -- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -- -- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -- -- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -- -- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -- -- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -- ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- Natools.Chunked_Strings is a string container designed for large amount -- -- of data and efficient accumulation (append). Most subprograms are the -- -- direct copy of Unbounded_String equivalent from LRM, with the same -- -- semantics. -- -- -- -- The implementation uses fixed-size "chunks" of memory, so that large -- -- strings do not have to be stored in a contiguous space. This also allows -- -- more efficient appends, since only the last chunk might need dynamic -- -- resize. -- -- Moreover the last chunk is constrained to have a size multiple of -- -- Allocation_Unit, so if Allocation_Unit = Chunk_Size, no string resize -- -- ever happen. -- -- -- -- The list of chunks is stored as a usual dynamic array, so append -- -- operations are still linear (when a new chunk has to be created), they -- -- are just O(Size / Chunk_Size) instead of O(Size). For suitable values of -- -- Chunk_Size, that should be a significant improuvement. -- -- -- -- Chunk_Size and Allocation_Unit are defined per Chunked_String, which -- -- allows to use suitable parameters depending on the expected string size. -- -- Generic parameters control the default values, e.g. in operations like -- -- "&" which don't allow to specify them. -- ------------------------------------------------------------------------------ with Ada.Strings.Maps; with Natools.Accumulators; private with Ada.Finalization; generic Default_Allocation_Unit : Positive := 64; Default_Chunk_Size : Positive := 4096; package Natools.Chunked_Strings is pragma Preelaborate (Chunked_Strings); package Maps renames Ada.Strings.Maps; type Chunked_String is new Natools.Accumulators.String_Accumulator with private; function Build (Depth : Positive) return Natools.Accumulators.String_Accumulator'Class; -- Returns a new empty chunked string -- Ignores its Depth argument -- Can be used with Natools.Accumulators.String_Accumulator_Linked_Lists function Duplicate (Source : in Chunked_String) return Chunked_String; -- returns a copy of the given chunked string procedure Free_Extra_Memory (From : in out Chunked_String); -- Release as much memory as possible without altering the contents procedure Hard_Reset (Str : in out Chunked_String); -- Empty the string and free all possible memory procedure Preallocate (Str : in out Chunked_String; Size : Natural); -- Allocate enough memory to reach Size without subsequent reallocation procedure Soft_Reset (Str : in out Chunked_String); -- Empty the string for reuse procedure To_String (Source : Chunked_String; Output : out String); -- Write the contents of the chunked string into the output string, -- which must be large enough. ------------------------------------------- -- String_Accumulator specific interface -- ------------------------------------------- -- Append, Length and To_String are part of the standard interface -- Hard_Reset and Soft_Reset are already in the specific interface function Tail (Source : in Chunked_String; Size : in Natural) return String; procedure Unappend (From : in out Chunked_String; Text : in String); ------------------------ -- Standard interface -- ------------------------ -- All the following declarations are copied from Unbounded_String -- interface and have exactly the same semantics. -- Subprogram that create new Chunked_String objects also have -- Chunk_Size and Allocation_Unit optional parameters. Null_Chunked_String : constant Chunked_String; function Length (Source : in Chunked_String) return Natural; type String_Access is access all String; procedure Free (X : in out String_Access); -- Conversion, Concatenation, and Selection functions function To_Chunked_String (Source : in String; Chunk_Size : in Positive := Default_Chunk_Size; Allocation_Unit : in Positive := Default_Allocation_Unit) return Chunked_String; function To_Chunked_String (Length : in Natural; Chunk_Size : in Positive := Default_Chunk_Size; Allocation_Unit : in Positive := Default_Allocation_Unit) return Chunked_String; function To_String (Source : in Chunked_String) return String; procedure Set_Chunked_String (Target : out Chunked_String; Source : in String; Chunk_Size : in Positive := Default_Chunk_Size; Allocation_Unit : in Positive := Default_Allocation_Unit); procedure Append (Source : in out Chunked_String; New_Item : in Chunked_String); procedure Append (Source : in out Chunked_String; New_Item : in String); procedure Append (Source : in out Chunked_String; New_Item : in Character); function "&" (Left, Right : in Chunked_String) return Chunked_String; function "&" (Left : in Chunked_String; Right : in String) return Chunked_String; function "&" (Left : in String; Right : in Chunked_String) return Chunked_String; function "&" (Left : in Chunked_String; Right : in Character) return Chunked_String; function "&" (Left : in Character; Right : in Chunked_String) return Chunked_String; function Element (Source : in Chunked_String; Index : in Positive) return Character; pragma Inline (Element); procedure Replace_Element (Source : in out Chunked_String; Index : in Positive; By : in Character); function Slice (Source : in Chunked_String; Low : in Positive; High : in Natural) return String; function Chunked_Slice (Source : in Chunked_String; Low : in Positive; High : in Natural; Chunk_Size : in Positive := Default_Chunk_Size; Allocation_Unit : in Positive := Default_Allocation_Unit) return Chunked_String; procedure Chunked_Slice (Source : in Chunked_String; Target : out Chunked_String; Low : in Positive; High : in Natural; Chunk_Size : in Positive := Default_Chunk_Size; Allocation_Unit : in Positive := Default_Allocation_Unit); function "=" (Left, Right : in Chunked_String) return Boolean; function "=" (Left : in Chunked_String; Right : in String) return Boolean; function "=" (Left : in String; Right : in Chunked_String) return Boolean; function "<" (Left, Right : in Chunked_String) return Boolean; function "<" (Left : in Chunked_String; Right : in String) return Boolean; function "<" (Left : in String; Right : in Chunked_String) return Boolean; function "<=" (Left, Right : in Chunked_String) return Boolean; function "<=" (Left : in Chunked_String; Right : in String) return Boolean; function "<=" (Left : in String; Right : in Chunked_String) return Boolean; function ">" (Left, Right : in Chunked_String) return Boolean; function ">" (Left : in Chunked_String; Right : in String) return Boolean; function ">" (Left : in String; Right : in Chunked_String) return Boolean; function ">=" (Left, Right : in Chunked_String) return Boolean; function ">=" (Left : in Chunked_String; Right : in String) return Boolean; function ">=" (Left : in String; Right : in Chunked_String) return Boolean; function Index (Source : in Chunked_String; Pattern : in String; From : in Positive; Going : in Ada.Strings.Direction := Ada.Strings.Forward; Mapping : in Maps.Character_Mapping := Maps.Identity) return Natural; function Index (Source : in Chunked_String; Pattern : in String; From : in Positive; Going : in Ada.Strings.Direction := Ada.Strings.Forward; Mapping : in Maps.Character_Mapping_Function) return Natural; function Index (Source : in Chunked_String; Pattern : in String; Going : in Ada.Strings.Direction := Ada.Strings.Forward; Mapping : in Maps.Character_Mapping := Maps.Identity) return Natural; function Index (Source : in Chunked_String; Pattern : in String; Going : in Ada.Strings.Direction := Ada.Strings.Forward; Mapping : in Maps.Character_Mapping_Function) return Natural; function Index (Source : in Chunked_String; Set : in Maps.Character_Set; From : in Positive; Test : in Ada.Strings.Membership := Ada.Strings.Inside; Going : in Ada.Strings.Direction := Ada.Strings.Forward) return Natural; function Index (Source : in Chunked_String; Set : in Maps.Character_Set; Test : in Ada.Strings.Membership := Ada.Strings.Inside; Going : in Ada.Strings.Direction := Ada.Strings.Forward) return Natural; function Index_Non_Blank (Source : in Chunked_String; From : in Positive; Going : in Ada.Strings.Direction := Ada.Strings.Forward) return Natural; function Index_Non_Blank (Source : in Chunked_String; Going : in Ada.Strings.Direction := Ada.Strings.Forward) return Natural; function Count (Source : in Chunked_String; Pattern : in String; Mapping : in Maps.Character_Mapping := Maps.Identity) return Natural; function Count (Source : in Chunked_String; Pattern : in String; Mapping : in Maps.Character_Mapping_Function) return Natural; function Count (Source : in Chunked_String; Set : in Maps.Character_Set) return Natural; procedure Find_Token (Source : in Chunked_String; Set : in Maps.Character_Set; Test : in Ada.Strings.Membership; First : out Positive; Last : out Natural); -- String translation subprograms function Translate (Source : in Chunked_String; Mapping : in Maps.Character_Mapping) return Chunked_String; procedure Translate (Source : in out Chunked_String; Mapping : in Maps.Character_Mapping); function Translate (Source : in Chunked_String; Mapping : in Maps.Character_Mapping_Function) return Chunked_String; procedure Translate (Source : in out Chunked_String; Mapping : in Maps.Character_Mapping_Function); -- String transformation subprograms function Replace_Slice (Source : in Chunked_String; Low : in Positive; High : in Natural; By : in String) return Chunked_String; procedure Replace_Slice (Source : in out Chunked_String; Low : in Positive; High : in Natural; By : in String); function Insert (Source : in Chunked_String; Before : in Positive; New_Item : in String) return Chunked_String; procedure Insert (Source : in out Chunked_String; Before : in Positive; New_Item : in String); function Overwrite (Source : in Chunked_String; Position : in Positive; New_Item : in String) return Chunked_String; procedure Overwrite (Source : in out Chunked_String; Position : in Positive; New_Item : in String); function Delete (Source : in Chunked_String; From : in Positive; Through : in Natural) return Chunked_String; procedure Delete (Source : in out Chunked_String; From : in Positive; Through : in Natural); function Trim (Source : in Chunked_String; Side : in Ada.Strings.Trim_End) return Chunked_String; procedure Trim (Source : in out Chunked_String; Side : in Ada.Strings.Trim_End); function Trim (Source : in Chunked_String; Left : in Maps.Character_Set; Right : in Maps.Character_Set) return Chunked_String; procedure Trim (Source : in out Chunked_String; Left : in Maps.Character_Set; Right : in Maps.Character_Set); function Head (Source : in Chunked_String; Count : in Natural; Pad : in Character := Ada.Strings.Space; Chunk_Size : in Natural := 0; -- use value from Source Allocation_Unit : in Natural := 0) -- use value from Source return Chunked_String; procedure Head (Source : in out Chunked_String; Count : in Natural; Pad : in Character := Ada.Strings.Space); function Tail (Source : in Chunked_String; Count : in Natural; Pad : in Character := Ada.Strings.Space; Chunk_Size : in Natural := 0; -- use value from Source Allocation_Unit : in Natural := 0) -- use value from Source return Chunked_String; procedure Tail (Source : in out Chunked_String; Count : in Natural; Pad : in Character := Ada.Strings.Space); function "*" (Left : in Natural; Right : in Character) return Chunked_String; function "*" (Left : in Natural; Right : in String) return Chunked_String; function "*" (Left : in Natural; Right : in Chunked_String) return Chunked_String; private type Chunk_Array is array (Positive range <>) of String_Access; type Chunk_Array_Access is access all Chunk_Array; type Chunked_String is new Ada.Finalization.Controlled and Natools.Accumulators.String_Accumulator with record Chunk_Size : Positive := Default_Chunk_Size; Allocation_Unit : Positive := Default_Allocation_Unit; Size : Natural := 0; Data : Chunk_Array_Access := null; end record; overriding procedure Initialize (Object : in out Chunked_String); overriding procedure Adjust (Object : in out Chunked_String); overriding procedure Finalize (Object : in out Chunked_String); -- Controlled type methods function Is_Valid (Source : in Chunked_String) return Boolean; -- Internal consistency checks Null_Chunked_String : constant Chunked_String := (Ada.Finalization.Controlled with Chunk_Size => Default_Chunk_Size, Allocation_Unit => Default_Allocation_Unit, Size => 0, Data => null); end Natools.Chunked_Strings;
programs/oeis/128/A128214.asm
karttu/loda
1
97545
; A128214: Expansion of (1+2x+3x^2)/(1+x+x^2)^2. ; 1,0,0,-2,3,0,-5,6,0,-8,9,0,-11,12,0,-14,15,0,-17,18,0,-20,21,0,-23,24,0,-26,27,0,-29,30,0,-32,33,0,-35,36,0,-38,39,0,-41,42,0,-44,45,0,-47,48,0,-50,51,0,-53,54,0,-56,57,0,-59,60,0,-62,63,0,-65 mov $1,1 sub $1,$0 mov $2,$0 add $2,2 mod $2,3 sub $2,1 mul $1,$2
ln.asm
monamansouri/os2-1
0
8037
_ln: 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) if(argc != 3){ a: 83 39 03 cmpl $0x3,(%ecx) { d: 55 push %ebp e: 89 e5 mov %esp,%ebp 10: 53 push %ebx 11: 51 push %ecx 12: 8b 59 04 mov 0x4(%ecx),%ebx if(argc != 3){ 15: 74 13 je 2a <main+0x2a> printf(2, "Usage: ln old new\n"); 17: 52 push %edx 18: 52 push %edx 19: 68 98 07 00 00 push $0x798 1e: 6a 02 push $0x2 20: e8 0b 04 00 00 call 430 <printf> exit(); 25: e8 77 02 00 00 call 2a1 <exit> } if(link(argv[1], argv[2]) < 0) 2a: 50 push %eax 2b: 50 push %eax 2c: ff 73 08 pushl 0x8(%ebx) 2f: ff 73 04 pushl 0x4(%ebx) 32: e8 ca 02 00 00 call 301 <link> 37: 83 c4 10 add $0x10,%esp 3a: 85 c0 test %eax,%eax 3c: 78 05 js 43 <main+0x43> printf(2, "link %s %s: failed\n", argv[1], argv[2]); exit(); 3e: e8 5e 02 00 00 call 2a1 <exit> printf(2, "link %s %s: failed\n", argv[1], argv[2]); 43: ff 73 08 pushl 0x8(%ebx) 46: ff 73 04 pushl 0x4(%ebx) 49: 68 ab 07 00 00 push $0x7ab 4e: 6a 02 push $0x2 50: e8 db 03 00 00 call 430 <printf> 55: 83 c4 10 add $0x10,%esp 58: eb e4 jmp 3e <main+0x3e> 5a: 66 90 xchg %ax,%ax 5c: 66 90 xchg %ax,%ax 5e: 66 90 xchg %ax,%ax 00000060 <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, const char *t) { 60: 55 push %ebp char *os; os = s; while((*s++ = *t++) != 0) 61: 31 d2 xor %edx,%edx { 63: 89 e5 mov %esp,%ebp 65: 53 push %ebx 66: 8b 45 08 mov 0x8(%ebp),%eax 69: 8b 5d 0c mov 0xc(%ebp),%ebx 6c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi while((*s++ = *t++) != 0) 70: 0f b6 0c 13 movzbl (%ebx,%edx,1),%ecx 74: 88 0c 10 mov %cl,(%eax,%edx,1) 77: 83 c2 01 add $0x1,%edx 7a: 84 c9 test %cl,%cl 7c: 75 f2 jne 70 <strcpy+0x10> ; return os; } 7e: 5b pop %ebx 7f: 5d pop %ebp 80: c3 ret 81: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 88: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 8f: 90 nop 00000090 <strcmp>: int strcmp(const char *p, const char *q) { 90: 55 push %ebp 91: 89 e5 mov %esp,%ebp 93: 56 push %esi 94: 53 push %ebx 95: 8b 5d 08 mov 0x8(%ebp),%ebx 98: 8b 75 0c mov 0xc(%ebp),%esi while(*p && *p == *q) 9b: 0f b6 13 movzbl (%ebx),%edx 9e: 0f b6 0e movzbl (%esi),%ecx a1: 84 d2 test %dl,%dl a3: 74 1e je c3 <strcmp+0x33> a5: b8 01 00 00 00 mov $0x1,%eax aa: 38 ca cmp %cl,%dl ac: 74 09 je b7 <strcmp+0x27> ae: eb 20 jmp d0 <strcmp+0x40> b0: 83 c0 01 add $0x1,%eax b3: 38 ca cmp %cl,%dl b5: 75 19 jne d0 <strcmp+0x40> b7: 0f b6 14 03 movzbl (%ebx,%eax,1),%edx bb: 0f b6 0c 06 movzbl (%esi,%eax,1),%ecx bf: 84 d2 test %dl,%dl c1: 75 ed jne b0 <strcmp+0x20> c3: 31 c0 xor %eax,%eax p++, q++; return (uchar)*p - (uchar)*q; } c5: 5b pop %ebx c6: 5e pop %esi return (uchar)*p - (uchar)*q; c7: 29 c8 sub %ecx,%eax } c9: 5d pop %ebp ca: c3 ret cb: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi cf: 90 nop d0: 0f b6 c2 movzbl %dl,%eax d3: 5b pop %ebx d4: 5e pop %esi return (uchar)*p - (uchar)*q; d5: 29 c8 sub %ecx,%eax } d7: 5d pop %ebp d8: c3 ret d9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 000000e0 <strlen>: int strlen(const char *s) { e0: 55 push %ebp int n; for(n = 0; s[n]; n++) e1: 31 c0 xor %eax,%eax { e3: 89 e5 mov %esp,%ebp e5: 8b 55 08 mov 0x8(%ebp),%edx for(n = 0; s[n]; n++) e8: 80 3a 00 cmpb $0x0,(%edx) eb: 74 0c je f9 <strlen+0x19> ed: 8d 76 00 lea 0x0(%esi),%esi f0: 83 c0 01 add $0x1,%eax f3: 80 3c 02 00 cmpb $0x0,(%edx,%eax,1) f7: 75 f7 jne f0 <strlen+0x10> ; return n; } f9: 5d pop %ebp fa: c3 ret fb: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi ff: 90 nop 00000100 <memset>: void* memset(void *dst, int c, int n) { 100: 55 push %ebp 101: 89 e5 mov %esp,%ebp 103: 57 push %edi 104: 8b 55 08 mov 0x8(%ebp),%edx } static inline void stosb(void *addr, int data, int cnt) { asm volatile("cld; rep stosb" : 107: 8b 4d 10 mov 0x10(%ebp),%ecx 10a: 8b 45 0c mov 0xc(%ebp),%eax 10d: 89 d7 mov %edx,%edi 10f: fc cld 110: f3 aa rep stos %al,%es:(%edi) stosb(dst, c, n); return dst; } 112: 89 d0 mov %edx,%eax 114: 5f pop %edi 115: 5d pop %ebp 116: c3 ret 117: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 11e: 66 90 xchg %ax,%ax 00000120 <strchr>: char* strchr(const char *s, char c) { 120: 55 push %ebp 121: 89 e5 mov %esp,%ebp 123: 53 push %ebx 124: 8b 45 08 mov 0x8(%ebp),%eax 127: 8b 55 0c mov 0xc(%ebp),%edx for(; *s; s++) 12a: 0f b6 18 movzbl (%eax),%ebx 12d: 84 db test %bl,%bl 12f: 74 1d je 14e <strchr+0x2e> 131: 89 d1 mov %edx,%ecx if(*s == c) 133: 38 d3 cmp %dl,%bl 135: 75 0d jne 144 <strchr+0x24> 137: eb 17 jmp 150 <strchr+0x30> 139: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 140: 38 ca cmp %cl,%dl 142: 74 0c je 150 <strchr+0x30> for(; *s; s++) 144: 83 c0 01 add $0x1,%eax 147: 0f b6 10 movzbl (%eax),%edx 14a: 84 d2 test %dl,%dl 14c: 75 f2 jne 140 <strchr+0x20> return (char*)s; return 0; 14e: 31 c0 xor %eax,%eax } 150: 5b pop %ebx 151: 5d pop %ebp 152: c3 ret 153: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 15a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 00000160 <gets>: char* gets(char *buf, int max) { 160: 55 push %ebp 161: 89 e5 mov %esp,%ebp 163: 57 push %edi 164: 56 push %esi int i, cc; char c; for(i=0; i+1 < max; ){ 165: 31 f6 xor %esi,%esi { 167: 53 push %ebx 168: 89 f3 mov %esi,%ebx 16a: 83 ec 1c sub $0x1c,%esp 16d: 8b 7d 08 mov 0x8(%ebp),%edi for(i=0; i+1 < max; ){ 170: eb 2f jmp 1a1 <gets+0x41> 172: 8d b6 00 00 00 00 lea 0x0(%esi),%esi cc = read(0, &c, 1); 178: 83 ec 04 sub $0x4,%esp 17b: 8d 45 e7 lea -0x19(%ebp),%eax 17e: 6a 01 push $0x1 180: 50 push %eax 181: 6a 00 push $0x0 183: e8 31 01 00 00 call 2b9 <read> if(cc < 1) 188: 83 c4 10 add $0x10,%esp 18b: 85 c0 test %eax,%eax 18d: 7e 1c jle 1ab <gets+0x4b> break; buf[i++] = c; 18f: 0f b6 45 e7 movzbl -0x19(%ebp),%eax 193: 83 c7 01 add $0x1,%edi 196: 88 47 ff mov %al,-0x1(%edi) if(c == '\n' || c == '\r') 199: 3c 0a cmp $0xa,%al 19b: 74 23 je 1c0 <gets+0x60> 19d: 3c 0d cmp $0xd,%al 19f: 74 1f je 1c0 <gets+0x60> for(i=0; i+1 < max; ){ 1a1: 83 c3 01 add $0x1,%ebx 1a4: 89 fe mov %edi,%esi 1a6: 3b 5d 0c cmp 0xc(%ebp),%ebx 1a9: 7c cd jl 178 <gets+0x18> 1ab: 89 f3 mov %esi,%ebx break; } buf[i] = '\0'; return buf; } 1ad: 8b 45 08 mov 0x8(%ebp),%eax buf[i] = '\0'; 1b0: c6 03 00 movb $0x0,(%ebx) } 1b3: 8d 65 f4 lea -0xc(%ebp),%esp 1b6: 5b pop %ebx 1b7: 5e pop %esi 1b8: 5f pop %edi 1b9: 5d pop %ebp 1ba: c3 ret 1bb: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 1bf: 90 nop 1c0: 8b 75 08 mov 0x8(%ebp),%esi 1c3: 8b 45 08 mov 0x8(%ebp),%eax 1c6: 01 de add %ebx,%esi 1c8: 89 f3 mov %esi,%ebx buf[i] = '\0'; 1ca: c6 03 00 movb $0x0,(%ebx) } 1cd: 8d 65 f4 lea -0xc(%ebp),%esp 1d0: 5b pop %ebx 1d1: 5e pop %esi 1d2: 5f pop %edi 1d3: 5d pop %ebp 1d4: c3 ret 1d5: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 1dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 000001e0 <stat>: int stat(const char *n, struct stat *st) { 1e0: 55 push %ebp 1e1: 89 e5 mov %esp,%ebp 1e3: 56 push %esi 1e4: 53 push %ebx int fd; int r; fd = open(n, O_RDONLY); 1e5: 83 ec 08 sub $0x8,%esp 1e8: 6a 00 push $0x0 1ea: ff 75 08 pushl 0x8(%ebp) 1ed: e8 ef 00 00 00 call 2e1 <open> if(fd < 0) 1f2: 83 c4 10 add $0x10,%esp 1f5: 85 c0 test %eax,%eax 1f7: 78 27 js 220 <stat+0x40> return -1; r = fstat(fd, st); 1f9: 83 ec 08 sub $0x8,%esp 1fc: ff 75 0c pushl 0xc(%ebp) 1ff: 89 c3 mov %eax,%ebx 201: 50 push %eax 202: e8 f2 00 00 00 call 2f9 <fstat> close(fd); 207: 89 1c 24 mov %ebx,(%esp) r = fstat(fd, st); 20a: 89 c6 mov %eax,%esi close(fd); 20c: e8 b8 00 00 00 call 2c9 <close> return r; 211: 83 c4 10 add $0x10,%esp } 214: 8d 65 f8 lea -0x8(%ebp),%esp 217: 89 f0 mov %esi,%eax 219: 5b pop %ebx 21a: 5e pop %esi 21b: 5d pop %ebp 21c: c3 ret 21d: 8d 76 00 lea 0x0(%esi),%esi return -1; 220: be ff ff ff ff mov $0xffffffff,%esi 225: eb ed jmp 214 <stat+0x34> 227: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 22e: 66 90 xchg %ax,%ax 00000230 <atoi>: int atoi(const char *s) { 230: 55 push %ebp 231: 89 e5 mov %esp,%ebp 233: 53 push %ebx 234: 8b 4d 08 mov 0x8(%ebp),%ecx int n; n = 0; while('0' <= *s && *s <= '9') 237: 0f be 11 movsbl (%ecx),%edx 23a: 8d 42 d0 lea -0x30(%edx),%eax 23d: 3c 09 cmp $0x9,%al n = 0; 23f: b8 00 00 00 00 mov $0x0,%eax while('0' <= *s && *s <= '9') 244: 77 1f ja 265 <atoi+0x35> 246: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 24d: 8d 76 00 lea 0x0(%esi),%esi n = n*10 + *s++ - '0'; 250: 83 c1 01 add $0x1,%ecx 253: 8d 04 80 lea (%eax,%eax,4),%eax 256: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax while('0' <= *s && *s <= '9') 25a: 0f be 11 movsbl (%ecx),%edx 25d: 8d 5a d0 lea -0x30(%edx),%ebx 260: 80 fb 09 cmp $0x9,%bl 263: 76 eb jbe 250 <atoi+0x20> return n; } 265: 5b pop %ebx 266: 5d pop %ebp 267: c3 ret 268: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 26f: 90 nop 00000270 <memmove>: void* memmove(void *vdst, const void *vsrc, int n) { 270: 55 push %ebp 271: 89 e5 mov %esp,%ebp 273: 57 push %edi 274: 8b 55 10 mov 0x10(%ebp),%edx 277: 8b 45 08 mov 0x8(%ebp),%eax 27a: 56 push %esi 27b: 8b 75 0c mov 0xc(%ebp),%esi char *dst; const char *src; dst = vdst; src = vsrc; while(n-- > 0) 27e: 85 d2 test %edx,%edx 280: 7e 13 jle 295 <memmove+0x25> 282: 01 c2 add %eax,%edx dst = vdst; 284: 89 c7 mov %eax,%edi 286: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 28d: 8d 76 00 lea 0x0(%esi),%esi *dst++ = *src++; 290: a4 movsb %ds:(%esi),%es:(%edi) while(n-- > 0) 291: 39 fa cmp %edi,%edx 293: 75 fb jne 290 <memmove+0x20> return vdst; } 295: 5e pop %esi 296: 5f pop %edi 297: 5d pop %ebp 298: c3 ret 00000299 <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) 299: b8 01 00 00 00 mov $0x1,%eax 29e: cd 40 int $0x40 2a0: c3 ret 000002a1 <exit>: SYSCALL(exit) 2a1: b8 02 00 00 00 mov $0x2,%eax 2a6: cd 40 int $0x40 2a8: c3 ret 000002a9 <wait>: SYSCALL(wait) 2a9: b8 03 00 00 00 mov $0x3,%eax 2ae: cd 40 int $0x40 2b0: c3 ret 000002b1 <pipe>: SYSCALL(pipe) 2b1: b8 04 00 00 00 mov $0x4,%eax 2b6: cd 40 int $0x40 2b8: c3 ret 000002b9 <read>: SYSCALL(read) 2b9: b8 05 00 00 00 mov $0x5,%eax 2be: cd 40 int $0x40 2c0: c3 ret 000002c1 <write>: SYSCALL(write) 2c1: b8 10 00 00 00 mov $0x10,%eax 2c6: cd 40 int $0x40 2c8: c3 ret 000002c9 <close>: SYSCALL(close) 2c9: b8 15 00 00 00 mov $0x15,%eax 2ce: cd 40 int $0x40 2d0: c3 ret 000002d1 <kill>: SYSCALL(kill) 2d1: b8 06 00 00 00 mov $0x6,%eax 2d6: cd 40 int $0x40 2d8: c3 ret 000002d9 <exec>: SYSCALL(exec) 2d9: b8 07 00 00 00 mov $0x7,%eax 2de: cd 40 int $0x40 2e0: c3 ret 000002e1 <open>: SYSCALL(open) 2e1: b8 0f 00 00 00 mov $0xf,%eax 2e6: cd 40 int $0x40 2e8: c3 ret 000002e9 <mknod>: SYSCALL(mknod) 2e9: b8 11 00 00 00 mov $0x11,%eax 2ee: cd 40 int $0x40 2f0: c3 ret 000002f1 <unlink>: SYSCALL(unlink) 2f1: b8 12 00 00 00 mov $0x12,%eax 2f6: cd 40 int $0x40 2f8: c3 ret 000002f9 <fstat>: SYSCALL(fstat) 2f9: b8 08 00 00 00 mov $0x8,%eax 2fe: cd 40 int $0x40 300: c3 ret 00000301 <link>: SYSCALL(link) 301: b8 13 00 00 00 mov $0x13,%eax 306: cd 40 int $0x40 308: c3 ret 00000309 <mkdir>: SYSCALL(mkdir) 309: b8 14 00 00 00 mov $0x14,%eax 30e: cd 40 int $0x40 310: c3 ret 00000311 <chdir>: SYSCALL(chdir) 311: b8 09 00 00 00 mov $0x9,%eax 316: cd 40 int $0x40 318: c3 ret 00000319 <dup>: SYSCALL(dup) 319: b8 0a 00 00 00 mov $0xa,%eax 31e: cd 40 int $0x40 320: c3 ret 00000321 <getpid>: SYSCALL(getpid) 321: b8 0b 00 00 00 mov $0xb,%eax 326: cd 40 int $0x40 328: c3 ret 00000329 <sbrk>: SYSCALL(sbrk) 329: b8 0c 00 00 00 mov $0xc,%eax 32e: cd 40 int $0x40 330: c3 ret 00000331 <sleep>: SYSCALL(sleep) 331: b8 0d 00 00 00 mov $0xd,%eax 336: cd 40 int $0x40 338: c3 ret 00000339 <uptime>: SYSCALL(uptime) 339: b8 0e 00 00 00 mov $0xe,%eax 33e: cd 40 int $0x40 340: c3 ret 00000341 <getChild>: SYSCALL(getChild) 341: b8 16 00 00 00 mov $0x16,%eax 346: cd 40 int $0x40 348: c3 ret 00000349 <getCount>: SYSCALL(getCount) 349: b8 17 00 00 00 mov $0x17,%eax 34e: cd 40 int $0x40 350: c3 ret 00000351 <getppid>: SYSCALL(getppid) 351: b8 18 00 00 00 mov $0x18,%eax 356: cd 40 int $0x40 358: c3 ret 00000359 <changePolicy>: SYSCALL(changePolicy) 359: b8 19 00 00 00 mov $0x19,%eax 35e: cd 40 int $0x40 360: c3 ret 361: 66 90 xchg %ax,%ax 363: 66 90 xchg %ax,%ax 365: 66 90 xchg %ax,%ax 367: 66 90 xchg %ax,%ax 369: 66 90 xchg %ax,%ax 36b: 66 90 xchg %ax,%ax 36d: 66 90 xchg %ax,%ax 36f: 90 nop 00000370 <printint>: write(fd, &c, 1); } static void printint(int fd, int xx, int base, int sgn) { 370: 55 push %ebp 371: 89 e5 mov %esp,%ebp 373: 57 push %edi 374: 56 push %esi 375: 53 push %ebx uint x; neg = 0; if(sgn && xx < 0){ neg = 1; x = -xx; 376: 89 d3 mov %edx,%ebx { 378: 83 ec 3c sub $0x3c,%esp 37b: 89 45 bc mov %eax,-0x44(%ebp) if(sgn && xx < 0){ 37e: 85 d2 test %edx,%edx 380: 0f 89 92 00 00 00 jns 418 <printint+0xa8> 386: f6 45 08 01 testb $0x1,0x8(%ebp) 38a: 0f 84 88 00 00 00 je 418 <printint+0xa8> neg = 1; 390: c7 45 c0 01 00 00 00 movl $0x1,-0x40(%ebp) x = -xx; 397: f7 db neg %ebx } else { x = xx; } i = 0; 399: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp) 3a0: 8d 75 d7 lea -0x29(%ebp),%esi 3a3: eb 08 jmp 3ad <printint+0x3d> 3a5: 8d 76 00 lea 0x0(%esi),%esi do{ buf[i++] = digits[x % base]; 3a8: 89 7d c4 mov %edi,-0x3c(%ebp) }while((x /= base) != 0); 3ab: 89 c3 mov %eax,%ebx buf[i++] = digits[x % base]; 3ad: 89 d8 mov %ebx,%eax 3af: 31 d2 xor %edx,%edx 3b1: 8b 7d c4 mov -0x3c(%ebp),%edi 3b4: f7 f1 div %ecx 3b6: 83 c7 01 add $0x1,%edi 3b9: 0f b6 92 c8 07 00 00 movzbl 0x7c8(%edx),%edx 3c0: 88 14 3e mov %dl,(%esi,%edi,1) }while((x /= base) != 0); 3c3: 39 d9 cmp %ebx,%ecx 3c5: 76 e1 jbe 3a8 <printint+0x38> if(neg) 3c7: 8b 45 c0 mov -0x40(%ebp),%eax 3ca: 85 c0 test %eax,%eax 3cc: 74 0d je 3db <printint+0x6b> buf[i++] = '-'; 3ce: c6 44 3d d8 2d movb $0x2d,-0x28(%ebp,%edi,1) 3d3: ba 2d 00 00 00 mov $0x2d,%edx buf[i++] = digits[x % base]; 3d8: 89 7d c4 mov %edi,-0x3c(%ebp) 3db: 8b 45 c4 mov -0x3c(%ebp),%eax 3de: 8b 7d bc mov -0x44(%ebp),%edi 3e1: 8d 5c 05 d7 lea -0x29(%ebp,%eax,1),%ebx 3e5: eb 0f jmp 3f6 <printint+0x86> 3e7: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 3ee: 66 90 xchg %ax,%ax 3f0: 0f b6 13 movzbl (%ebx),%edx 3f3: 83 eb 01 sub $0x1,%ebx write(fd, &c, 1); 3f6: 83 ec 04 sub $0x4,%esp 3f9: 88 55 d7 mov %dl,-0x29(%ebp) 3fc: 6a 01 push $0x1 3fe: 56 push %esi 3ff: 57 push %edi 400: e8 bc fe ff ff call 2c1 <write> while(--i >= 0) 405: 83 c4 10 add $0x10,%esp 408: 39 de cmp %ebx,%esi 40a: 75 e4 jne 3f0 <printint+0x80> putc(fd, buf[i]); } 40c: 8d 65 f4 lea -0xc(%ebp),%esp 40f: 5b pop %ebx 410: 5e pop %esi 411: 5f pop %edi 412: 5d pop %ebp 413: c3 ret 414: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi neg = 0; 418: c7 45 c0 00 00 00 00 movl $0x0,-0x40(%ebp) 41f: e9 75 ff ff ff jmp 399 <printint+0x29> 424: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 42b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 42f: 90 nop 00000430 <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, const char *fmt, ...) { 430: 55 push %ebp 431: 89 e5 mov %esp,%ebp 433: 57 push %edi 434: 56 push %esi 435: 53 push %ebx 436: 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++){ 439: 8b 75 0c mov 0xc(%ebp),%esi 43c: 0f b6 1e movzbl (%esi),%ebx 43f: 84 db test %bl,%bl 441: 0f 84 b9 00 00 00 je 500 <printf+0xd0> ap = (uint*)(void*)&fmt + 1; 447: 8d 45 10 lea 0x10(%ebp),%eax 44a: 83 c6 01 add $0x1,%esi write(fd, &c, 1); 44d: 8d 7d e7 lea -0x19(%ebp),%edi state = 0; 450: 31 d2 xor %edx,%edx ap = (uint*)(void*)&fmt + 1; 452: 89 45 d0 mov %eax,-0x30(%ebp) 455: eb 38 jmp 48f <printf+0x5f> 457: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 45e: 66 90 xchg %ax,%ax 460: 89 55 d4 mov %edx,-0x2c(%ebp) c = fmt[i] & 0xff; if(state == 0){ if(c == '%'){ state = '%'; 463: ba 25 00 00 00 mov $0x25,%edx if(c == '%'){ 468: 83 f8 25 cmp $0x25,%eax 46b: 74 17 je 484 <printf+0x54> write(fd, &c, 1); 46d: 83 ec 04 sub $0x4,%esp 470: 88 5d e7 mov %bl,-0x19(%ebp) 473: 6a 01 push $0x1 475: 57 push %edi 476: ff 75 08 pushl 0x8(%ebp) 479: e8 43 fe ff ff call 2c1 <write> 47e: 8b 55 d4 mov -0x2c(%ebp),%edx } else { putc(fd, c); 481: 83 c4 10 add $0x10,%esp 484: 83 c6 01 add $0x1,%esi for(i = 0; fmt[i]; i++){ 487: 0f b6 5e ff movzbl -0x1(%esi),%ebx 48b: 84 db test %bl,%bl 48d: 74 71 je 500 <printf+0xd0> c = fmt[i] & 0xff; 48f: 0f be cb movsbl %bl,%ecx 492: 0f b6 c3 movzbl %bl,%eax if(state == 0){ 495: 85 d2 test %edx,%edx 497: 74 c7 je 460 <printf+0x30> } } else if(state == '%'){ 499: 83 fa 25 cmp $0x25,%edx 49c: 75 e6 jne 484 <printf+0x54> if(c == 'd'){ 49e: 83 f8 64 cmp $0x64,%eax 4a1: 0f 84 99 00 00 00 je 540 <printf+0x110> printint(fd, *ap, 10, 1); ap++; } else if(c == 'x' || c == 'p'){ 4a7: 81 e1 f7 00 00 00 and $0xf7,%ecx 4ad: 83 f9 70 cmp $0x70,%ecx 4b0: 74 5e je 510 <printf+0xe0> printint(fd, *ap, 16, 0); ap++; } else if(c == 's'){ 4b2: 83 f8 73 cmp $0x73,%eax 4b5: 0f 84 d5 00 00 00 je 590 <printf+0x160> s = "(null)"; while(*s != 0){ putc(fd, *s); s++; } } else if(c == 'c'){ 4bb: 83 f8 63 cmp $0x63,%eax 4be: 0f 84 8c 00 00 00 je 550 <printf+0x120> putc(fd, *ap); ap++; } else if(c == '%'){ 4c4: 83 f8 25 cmp $0x25,%eax 4c7: 0f 84 b3 00 00 00 je 580 <printf+0x150> write(fd, &c, 1); 4cd: 83 ec 04 sub $0x4,%esp 4d0: c6 45 e7 25 movb $0x25,-0x19(%ebp) 4d4: 6a 01 push $0x1 4d6: 57 push %edi 4d7: ff 75 08 pushl 0x8(%ebp) 4da: e8 e2 fd ff ff call 2c1 <write> putc(fd, c); } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); putc(fd, c); 4df: 88 5d e7 mov %bl,-0x19(%ebp) write(fd, &c, 1); 4e2: 83 c4 0c add $0xc,%esp 4e5: 6a 01 push $0x1 4e7: 83 c6 01 add $0x1,%esi 4ea: 57 push %edi 4eb: ff 75 08 pushl 0x8(%ebp) 4ee: e8 ce fd ff ff call 2c1 <write> for(i = 0; fmt[i]; i++){ 4f3: 0f b6 5e ff movzbl -0x1(%esi),%ebx putc(fd, c); 4f7: 83 c4 10 add $0x10,%esp } state = 0; 4fa: 31 d2 xor %edx,%edx for(i = 0; fmt[i]; i++){ 4fc: 84 db test %bl,%bl 4fe: 75 8f jne 48f <printf+0x5f> } } } 500: 8d 65 f4 lea -0xc(%ebp),%esp 503: 5b pop %ebx 504: 5e pop %esi 505: 5f pop %edi 506: 5d pop %ebp 507: c3 ret 508: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 50f: 90 nop printint(fd, *ap, 16, 0); 510: 83 ec 0c sub $0xc,%esp 513: b9 10 00 00 00 mov $0x10,%ecx 518: 6a 00 push $0x0 51a: 8b 5d d0 mov -0x30(%ebp),%ebx 51d: 8b 45 08 mov 0x8(%ebp),%eax 520: 8b 13 mov (%ebx),%edx 522: e8 49 fe ff ff call 370 <printint> ap++; 527: 89 d8 mov %ebx,%eax 529: 83 c4 10 add $0x10,%esp state = 0; 52c: 31 d2 xor %edx,%edx ap++; 52e: 83 c0 04 add $0x4,%eax 531: 89 45 d0 mov %eax,-0x30(%ebp) 534: e9 4b ff ff ff jmp 484 <printf+0x54> 539: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi printint(fd, *ap, 10, 1); 540: 83 ec 0c sub $0xc,%esp 543: b9 0a 00 00 00 mov $0xa,%ecx 548: 6a 01 push $0x1 54a: eb ce jmp 51a <printf+0xea> 54c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi putc(fd, *ap); 550: 8b 5d d0 mov -0x30(%ebp),%ebx write(fd, &c, 1); 553: 83 ec 04 sub $0x4,%esp putc(fd, *ap); 556: 8b 03 mov (%ebx),%eax write(fd, &c, 1); 558: 6a 01 push $0x1 ap++; 55a: 83 c3 04 add $0x4,%ebx write(fd, &c, 1); 55d: 57 push %edi 55e: ff 75 08 pushl 0x8(%ebp) putc(fd, *ap); 561: 88 45 e7 mov %al,-0x19(%ebp) write(fd, &c, 1); 564: e8 58 fd ff ff call 2c1 <write> ap++; 569: 89 5d d0 mov %ebx,-0x30(%ebp) 56c: 83 c4 10 add $0x10,%esp state = 0; 56f: 31 d2 xor %edx,%edx 571: e9 0e ff ff ff jmp 484 <printf+0x54> 576: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 57d: 8d 76 00 lea 0x0(%esi),%esi putc(fd, c); 580: 88 5d e7 mov %bl,-0x19(%ebp) write(fd, &c, 1); 583: 83 ec 04 sub $0x4,%esp 586: e9 5a ff ff ff jmp 4e5 <printf+0xb5> 58b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 58f: 90 nop s = (char*)*ap; 590: 8b 45 d0 mov -0x30(%ebp),%eax 593: 8b 18 mov (%eax),%ebx ap++; 595: 83 c0 04 add $0x4,%eax 598: 89 45 d0 mov %eax,-0x30(%ebp) if(s == 0) 59b: 85 db test %ebx,%ebx 59d: 74 17 je 5b6 <printf+0x186> while(*s != 0){ 59f: 0f b6 03 movzbl (%ebx),%eax state = 0; 5a2: 31 d2 xor %edx,%edx while(*s != 0){ 5a4: 84 c0 test %al,%al 5a6: 0f 84 d8 fe ff ff je 484 <printf+0x54> 5ac: 89 75 d4 mov %esi,-0x2c(%ebp) 5af: 89 de mov %ebx,%esi 5b1: 8b 5d 08 mov 0x8(%ebp),%ebx 5b4: eb 1a jmp 5d0 <printf+0x1a0> s = "(null)"; 5b6: bb bf 07 00 00 mov $0x7bf,%ebx while(*s != 0){ 5bb: 89 75 d4 mov %esi,-0x2c(%ebp) 5be: b8 28 00 00 00 mov $0x28,%eax 5c3: 89 de mov %ebx,%esi 5c5: 8b 5d 08 mov 0x8(%ebp),%ebx 5c8: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 5cf: 90 nop write(fd, &c, 1); 5d0: 83 ec 04 sub $0x4,%esp s++; 5d3: 83 c6 01 add $0x1,%esi 5d6: 88 45 e7 mov %al,-0x19(%ebp) write(fd, &c, 1); 5d9: 6a 01 push $0x1 5db: 57 push %edi 5dc: 53 push %ebx 5dd: e8 df fc ff ff call 2c1 <write> while(*s != 0){ 5e2: 0f b6 06 movzbl (%esi),%eax 5e5: 83 c4 10 add $0x10,%esp 5e8: 84 c0 test %al,%al 5ea: 75 e4 jne 5d0 <printf+0x1a0> 5ec: 8b 75 d4 mov -0x2c(%ebp),%esi state = 0; 5ef: 31 d2 xor %edx,%edx 5f1: e9 8e fe ff ff jmp 484 <printf+0x54> 5f6: 66 90 xchg %ax,%ax 5f8: 66 90 xchg %ax,%ax 5fa: 66 90 xchg %ax,%ax 5fc: 66 90 xchg %ax,%ax 5fe: 66 90 xchg %ax,%ax 00000600 <free>: static Header base; static Header *freep; void free(void *ap) { 600: 55 push %ebp Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 601: a1 6c 0a 00 00 mov 0xa6c,%eax { 606: 89 e5 mov %esp,%ebp 608: 57 push %edi 609: 56 push %esi 60a: 53 push %ebx 60b: 8b 5d 08 mov 0x8(%ebp),%ebx 60e: 8b 10 mov (%eax),%edx bp = (Header*)ap - 1; 610: 8d 4b f8 lea -0x8(%ebx),%ecx for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 613: 39 c8 cmp %ecx,%eax 615: 73 19 jae 630 <free+0x30> 617: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 61e: 66 90 xchg %ax,%ax 620: 39 d1 cmp %edx,%ecx 622: 72 14 jb 638 <free+0x38> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 624: 39 d0 cmp %edx,%eax 626: 73 10 jae 638 <free+0x38> { 628: 89 d0 mov %edx,%eax 62a: 8b 10 mov (%eax),%edx for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 62c: 39 c8 cmp %ecx,%eax 62e: 72 f0 jb 620 <free+0x20> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 630: 39 d0 cmp %edx,%eax 632: 72 f4 jb 628 <free+0x28> 634: 39 d1 cmp %edx,%ecx 636: 73 f0 jae 628 <free+0x28> break; if(bp + bp->s.size == p->s.ptr){ 638: 8b 73 fc mov -0x4(%ebx),%esi 63b: 8d 3c f1 lea (%ecx,%esi,8),%edi 63e: 39 fa cmp %edi,%edx 640: 74 1e je 660 <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; 642: 89 53 f8 mov %edx,-0x8(%ebx) if(p + p->s.size == bp){ 645: 8b 50 04 mov 0x4(%eax),%edx 648: 8d 34 d0 lea (%eax,%edx,8),%esi 64b: 39 f1 cmp %esi,%ecx 64d: 74 28 je 677 <free+0x77> p->s.size += bp->s.size; p->s.ptr = bp->s.ptr; } else p->s.ptr = bp; 64f: 89 08 mov %ecx,(%eax) freep = p; } 651: 5b pop %ebx freep = p; 652: a3 6c 0a 00 00 mov %eax,0xa6c } 657: 5e pop %esi 658: 5f pop %edi 659: 5d pop %ebp 65a: c3 ret 65b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 65f: 90 nop bp->s.size += p->s.ptr->s.size; 660: 03 72 04 add 0x4(%edx),%esi 663: 89 73 fc mov %esi,-0x4(%ebx) bp->s.ptr = p->s.ptr->s.ptr; 666: 8b 10 mov (%eax),%edx 668: 8b 12 mov (%edx),%edx 66a: 89 53 f8 mov %edx,-0x8(%ebx) if(p + p->s.size == bp){ 66d: 8b 50 04 mov 0x4(%eax),%edx 670: 8d 34 d0 lea (%eax,%edx,8),%esi 673: 39 f1 cmp %esi,%ecx 675: 75 d8 jne 64f <free+0x4f> p->s.size += bp->s.size; 677: 03 53 fc add -0x4(%ebx),%edx freep = p; 67a: a3 6c 0a 00 00 mov %eax,0xa6c p->s.size += bp->s.size; 67f: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; 682: 8b 53 f8 mov -0x8(%ebx),%edx 685: 89 10 mov %edx,(%eax) } 687: 5b pop %ebx 688: 5e pop %esi 689: 5f pop %edi 68a: 5d pop %ebp 68b: c3 ret 68c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 00000690 <malloc>: return freep; } void* malloc(int nbytes) { 690: 55 push %ebp 691: 89 e5 mov %esp,%ebp 693: 57 push %edi 694: 56 push %esi 695: 53 push %ebx 696: 83 ec 1c sub $0x1c,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 699: 8b 45 08 mov 0x8(%ebp),%eax if((prevp = freep) == 0){ 69c: 8b 3d 6c 0a 00 00 mov 0xa6c,%edi nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 6a2: 8d 70 07 lea 0x7(%eax),%esi 6a5: c1 ee 03 shr $0x3,%esi 6a8: 83 c6 01 add $0x1,%esi if((prevp = freep) == 0){ 6ab: 85 ff test %edi,%edi 6ad: 0f 84 ad 00 00 00 je 760 <malloc+0xd0> base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 6b3: 8b 17 mov (%edi),%edx if(p->s.size >= nunits){ 6b5: 8b 4a 04 mov 0x4(%edx),%ecx 6b8: 39 f1 cmp %esi,%ecx 6ba: 73 72 jae 72e <malloc+0x9e> 6bc: 81 fe 00 10 00 00 cmp $0x1000,%esi 6c2: bb 00 10 00 00 mov $0x1000,%ebx 6c7: 0f 43 de cmovae %esi,%ebx p = sbrk(nu * sizeof(Header)); 6ca: 8d 04 dd 00 00 00 00 lea 0x0(,%ebx,8),%eax 6d1: 89 45 e4 mov %eax,-0x1c(%ebp) 6d4: eb 1b jmp 6f1 <malloc+0x61> 6d6: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 6dd: 8d 76 00 lea 0x0(%esi),%esi for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 6e0: 8b 02 mov (%edx),%eax if(p->s.size >= nunits){ 6e2: 8b 48 04 mov 0x4(%eax),%ecx 6e5: 39 f1 cmp %esi,%ecx 6e7: 73 4f jae 738 <malloc+0xa8> 6e9: 8b 3d 6c 0a 00 00 mov 0xa6c,%edi 6ef: 89 c2 mov %eax,%edx p->s.size = nunits; } freep = prevp; return (void*)(p + 1); } if(p == freep) 6f1: 39 d7 cmp %edx,%edi 6f3: 75 eb jne 6e0 <malloc+0x50> p = sbrk(nu * sizeof(Header)); 6f5: 83 ec 0c sub $0xc,%esp 6f8: ff 75 e4 pushl -0x1c(%ebp) 6fb: e8 29 fc ff ff call 329 <sbrk> if(p == (char*)-1) 700: 83 c4 10 add $0x10,%esp 703: 83 f8 ff cmp $0xffffffff,%eax 706: 74 1c je 724 <malloc+0x94> hp->s.size = nu; 708: 89 58 04 mov %ebx,0x4(%eax) free((void*)(hp + 1)); 70b: 83 ec 0c sub $0xc,%esp 70e: 83 c0 08 add $0x8,%eax 711: 50 push %eax 712: e8 e9 fe ff ff call 600 <free> return freep; 717: 8b 15 6c 0a 00 00 mov 0xa6c,%edx if((p = morecore(nunits)) == 0) 71d: 83 c4 10 add $0x10,%esp 720: 85 d2 test %edx,%edx 722: 75 bc jne 6e0 <malloc+0x50> return 0; } } 724: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 727: 31 c0 xor %eax,%eax } 729: 5b pop %ebx 72a: 5e pop %esi 72b: 5f pop %edi 72c: 5d pop %ebp 72d: c3 ret if(p->s.size >= nunits){ 72e: 89 d0 mov %edx,%eax 730: 89 fa mov %edi,%edx 732: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(p->s.size == nunits) 738: 39 ce cmp %ecx,%esi 73a: 74 54 je 790 <malloc+0x100> p->s.size -= nunits; 73c: 29 f1 sub %esi,%ecx 73e: 89 48 04 mov %ecx,0x4(%eax) p += p->s.size; 741: 8d 04 c8 lea (%eax,%ecx,8),%eax p->s.size = nunits; 744: 89 70 04 mov %esi,0x4(%eax) freep = prevp; 747: 89 15 6c 0a 00 00 mov %edx,0xa6c } 74d: 8d 65 f4 lea -0xc(%ebp),%esp return (void*)(p + 1); 750: 83 c0 08 add $0x8,%eax } 753: 5b pop %ebx 754: 5e pop %esi 755: 5f pop %edi 756: 5d pop %ebp 757: c3 ret 758: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 75f: 90 nop base.s.ptr = freep = prevp = &base; 760: c7 05 6c 0a 00 00 70 movl $0xa70,0xa6c 767: 0a 00 00 base.s.size = 0; 76a: bf 70 0a 00 00 mov $0xa70,%edi base.s.ptr = freep = prevp = &base; 76f: c7 05 70 0a 00 00 70 movl $0xa70,0xa70 776: 0a 00 00 for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 779: 89 fa mov %edi,%edx base.s.size = 0; 77b: c7 05 74 0a 00 00 00 movl $0x0,0xa74 782: 00 00 00 if(p->s.size >= nunits){ 785: e9 32 ff ff ff jmp 6bc <malloc+0x2c> 78a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi prevp->s.ptr = p->s.ptr; 790: 8b 08 mov (%eax),%ecx 792: 89 0a mov %ecx,(%edx) 794: eb b1 jmp 747 <malloc+0xb7>
projects/batfish/src/main/antlr4/org/batfish/grammar/palo_alto/PaloAlto_application_filter.g4
nickgian/batfish
0
7085
parser grammar PaloAlto_application_filter; import PaloAlto_common; options { tokenVocab = PaloAltoLexer; } s_application_filter : APPLICATION_FILTER name = variable ( saf_category | saf_evasive | saf_excessive_bandwidth_use | saf_has_known_vulnerabilities | saf_pervasive | saf_prone_to_misuse | saf_risk | saf_subcategory | saf_technology | saf_transfers_files | saf_tunnels_other_apps | saf_used_by_malware ) ; saf_category : CATEGORY null_rest_of_line ; saf_evasive : EVASIVE YES ; saf_excessive_bandwidth_use : EXCESSIVE_BANDWIDTH_USE YES ; saf_has_known_vulnerabilities : HAS_KNOWN_VULNERABILITIES YES ; saf_pervasive : PERVASIVE YES ; saf_prone_to_misuse : PRONE_TO_MISUSE YES ; saf_risk : // 1-5 RISK DEC ; saf_subcategory : SUBCATEGORY null_rest_of_line ; saf_technology : TECHNOLOGY null_rest_of_line ; saf_transfers_files : TRANSFERS_FILES YES ; saf_tunnels_other_apps : TUNNELS_OTHER_APPS YES ; saf_used_by_malware : USED_BY_MALWARE YES ;
programs/oeis/317/A317137.asm
neoneye/loda
22
247509
<filename>programs/oeis/317/A317137.asm<gh_stars>10-100 ; A317137: a(n) is the number of nonzero triangular numbers <= n-th prime. ; 1,2,2,3,4,4,5,5,6,7,7,8,8,8,9,9,10,10,11,11,11,12,12,12,13,13,13,14,14,14,15,15,16,16,16,16,17,17,17,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,22,22,22,22,23,23,23,23,24,24,24,24,25,25,25,25,26,26,26,26,27,27,27,27,27 seq $0,6005 ; The odd prime numbers together with 1. sub $0,1 mov $1,1 lpb $0 add $1,1 sub $0,$1 lpe mov $0,$1
solitaire_operations-text_representation.adb
doug16rogers/solitaire
1
9674
with Ada.Characters.Handling; use Ada.Characters; package body Solitaire_Operations.Text_Representation is ------------------------------------------------------------------------ function Card (Name : Short_Card) return Card_Value is -- -- Returns the card for the given 2-character name. -- Upper_Card : Short_Card := Handling.To_Upper (Name); begin -- Card Find_Card : for I in Short_Card_Name'Range loop if Upper_Card = Short_Card_Name (I) then return I; end if; end loop Find_Card; raise Card_Not_Found; end Card; ------------------------------------------------------------------------ procedure Set_Deck (Deck : in out Deck_List; To : in Short_Card_Deck_String) is -- -- Sets the deck contents to the values provided in the compact list -- of 2-character names. -- Card_Index : Positive; begin -- Set_Deck Copy: for I in Deck'Range loop Card_Index := To'First + 2 * (I - Deck'First); Deck (I) := Card (To (Card_Index .. Card_Index + 1)); end loop Copy; end Set_Deck; end Solitaire_Operations.Text_Representation;
shasum/shasum-test.asm
zellyn/a2audit
22
93711
!to "shasum.o", plain * = $6000 jmp main !addr SRC = $06 !addr DST = $08 !addr SHAINPUT = $eb !addr SHALENGTH = $ee !addr PRBYTE = $FDDA !addr COUT = $FDED !macro set32 .target, .value { lda #<(.value >> 24) sta .target lda #<(.value >> 16) sta .target+1 lda #<(.value >> 8) sta .target+2 lda #<(.value) sta .target+3 } !macro setSRC .source { lda #<.source sta SRC lda #>.source sta SRC+1 } !macro setDST .dest { lda #<.dest sta DST lda #>.dest sta DST+1 } ;;; Print a string of bytes, as hex. ;;; Address in SRC, count in A. ;;; Burns A,Y. prbytes: ldy #0 - pha lda (SRC),y jsr PRBYTE iny pla adc #$ff bne - rts main: ;; Test shasum "" lda #0 sta SHAINPUT lda #$fe sta SHAINPUT+1 lda #0 sta SHALENGTH+1 lda #0 ; da39a3ee5e6b4b0d3255bfef95601890afd80709 sta SHALENGTH jsr SHASUM ; lda #$8d ; jsr COUT +setSRC SHA lda #SHALEN jsr prbytes ;; Test shasum FE00[:0x37] lda #0 sta SHAINPUT lda #$fe sta SHAINPUT+1 lda #0 sta SHALENGTH+1 lda #$37 ; 1CF73FC6156B548A949D315120B5256245EAA33E sta SHALENGTH jsr SHASUM ; lda #$8d ; jsr COUT +setSRC SHA lda #SHALEN jsr prbytes ;; Test shasum FE00[:0x100] lda #0 sta SHAINPUT lda #$fe sta SHAINPUT+1 lda #1 sta SHALENGTH+1 lda #0 ; 7B3D05347B52210065E27054FDFD0B8B699F0965 sta SHALENGTH jsr SHASUM ; lda #$8d ; jsr COUT +setSRC SHA lda #SHALEN jsr prbytes ;; Test shasum FE00[:0x1ff] lda #0 sta SHAINPUT lda #$fe sta SHAINPUT+1 lda #$1 sta SHALENGTH+1 lda #$ff ; 269CA6B0C644DAC01D908B20C10C0D5B19C52ABF sta SHALENGTH jsr SHASUM ; lda #$8d ; jsr COUT +setSRC SHA lda #SHALEN jsr prbytes ;; Test shasum FE00[:0x200] lda #0 sta SHAINPUT lda #$fe sta SHAINPUT+1 lda #2 sta SHALENGTH+1 lda #0 ; D5AC71D5EE76E31CC82CF5136151BF4CDA503601 sta SHALENGTH jsr SHASUM ; lda #$8d ; jsr COUT +setSRC SHA lda #SHALEN jsr prbytes rts !src "shasum.asm"
Projetos/src/F-Assembly/src/nasm/pow.nasm
arnaldojr/Z01.1
1
243269
<gh_stars>1-10 ; Arquivo: Pow.nasm ; Curso: Elementos de Sistemas ; Criado por: <NAME> ; Data: 27/03/2017 ; Eleva ao quadrado o valor da RAM[1] e armazena o resultado na RAM[0]. ; Só funciona com números positivos
src/base/log/util-log-appenders-files.adb
RREE/ada-util
60
13102
----------------------------------------------------------------------- -- util-log-appenders-files -- File log appenders -- Copyright (C) 2001 - 2021 <NAME> -- Written by <NAME> (<EMAIL>) -- -- 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. ----------------------------------------------------------------------- with Ada.Finalization; with Util.Properties.Basic; with Util.Log.Appenders.Formatter; package body Util.Log.Appenders.Files is use Ada; use Ada.Finalization; overriding procedure Append (Self : in out File_Appender; Message : in Util.Strings.Builders.Builder; Date : in Ada.Calendar.Time; Level : in Level_Type; Logger : in String) is procedure Write_File (Data : in String) with Inline_Always; procedure Write_File (Data : in String) is begin Text_IO.Put (Self.Output, Data); end Write_File; procedure Write is new Formatter (Write_File); begin if Self.Level >= Level then Write (Self, Message, Date, Level, Logger); Text_IO.New_Line (Self.Output); if Self.Immediate_Flush then Self.Flush; end if; end if; end Append; -- ------------------------------ -- Flush the log events. -- ------------------------------ overriding procedure Flush (Self : in out File_Appender) is begin Text_IO.Flush (Self.Output); end Flush; -- ------------------------------ -- Flush and close the file. -- ------------------------------ overriding procedure Finalize (Self : in out File_Appender) is begin Self.Flush; Text_IO.Close (File => Self.Output); end Finalize; -- ------------------------------ -- Create a file appender and configure it according to the properties -- ------------------------------ function Create (Name : in String; Properties : in Util.Properties.Manager; Default : in Level_Type) return Appender_Access is use Util.Properties.Basic; Base : constant String := "appender." & Name; Path : constant String := Properties.Get (Base & ".File", Name & ".log"); Append : constant Boolean := Boolean_Property.Get (Properties, Base & ".append", True); Result : constant File_Appender_Access := new File_Appender '(Limited_Controlled with Length => Name'Length, Name => Name, others => <>); begin Result.Set_Level (Name, Properties, Default); Result.Set_Layout (Name, Properties, FULL); Result.Set_File (Path, Append); Result.Immediate_Flush := Boolean_Property.Get (Properties, Base & ".immediateFlush", True); return Result.all'Access; end Create; -- ------------------------------ -- Set the file where the appender will write the logs. -- When <tt>Append</tt> is true, the log message are appended to the existing file. -- When set to false, the file is cleared before writing new messages. -- ------------------------------ procedure Set_File (Self : in out File_Appender; Path : in String; Append : in Boolean := True) is Mode : Text_IO.File_Mode; begin if Append then Mode := Text_IO.Append_File; else Mode := Text_IO.Out_File; end if; Text_IO.Open (File => Self.Output, Name => Path, Mode => Mode); exception when Text_IO.Name_Error => Text_IO.Create (File => Self.Output, Name => Path); end Set_File; end Util.Log.Appenders.Files;
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_1993.asm
ljhsiun2/medusa
9
12898
.global s_prepare_buffers s_prepare_buffers: ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r14 push %r8 push %r9 // Store lea addresses_normal+0x154a8, %r8 nop cmp $10559, %r10 mov $0x5152535455565758, %r9 movq %r9, (%r8) nop nop add $9769, %r10 // Faulty Load lea addresses_RW+0xa0a8, %r14 clflush (%r14) nop nop nop sub %r8, %r8 movups (%r14), %xmm4 vpextrq $1, %xmm4, %r12 lea oracles, %r9 and $0xff, %r12 shlq $12, %r12 mov (%r9,%r12,1), %r12 pop %r9 pop %r8 pop %r14 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_RW', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_normal', 'same': False, 'size': 8, 'congruent': 8, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'} [Faulty Load] {'src': {'type': 'addresses_RW', 'same': True, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'32': 21829} 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 */
Library/Kernel/Object/objectDup.asm
steakknife/pcgeos
504
12249
<reponame>steakknife/pcgeos COMMENT @---------------------------------------------------------------------- Copyright (c) GeoWorks 1989 -- All Rights Reserved PROJECT: PC GEOS MODULE: Kernel/Object FILE: objectDup.asm ROUTINES: Name Description ---- ----------- REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 2/89 Initial version DESCRIPTION: This file contains routines to load a GEODE and execute it. $Id: objectDup.asm,v 1.1 97/04/05 01:14:47 newdeal Exp $ ------------------------------------------------------------------------------@ ObjectLoad segment resource COMMENT @---------------------------------------------------------------------- FUNCTION: ObjDuplicateResource DESCRIPTION: Duplicate an object resource block. The new block will be put on the "saved blocks" list so that it will be saved by ObjDisassocVMFile. CALLED BY: GLOBAL PASS: bx - resource handle to duplicate (must not be in memory) ax - handle of geode to own new block, OR 0 to be have block owned by geode owning current running thread, OR -1 to copy owner from source block cx - handle of thread to run new block, OR 0 to have block run by current running thread, OR -1 to copy nature of thread from source block: if source is process-run, dest will be process-run. if source is ui-run, dest will be ui-run. if source run by anything else, that same thread will run the new block. RETURN: bx - handle of duplicated block DESTROYED: REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 3/89 Initial version Doug 4/92 Added ability to pass in burden thread to use Doug 6/1/92 Additions for new thread model ------------------------------------------------------------------------------@ ObjDuplicateResource proc far uses ax, cx, dx, si, di, bp, ds, es .enter EC < push bx ; For duplicated block symbols -- save source > EC < call ECCheckResourceHandle > LoadVarSeg ds ; Ensure that block to duplicate is not in memory ; EC < test ds:[bx].HM_flags,mask HF_DISCARDED > EC < ERROR_Z OBJ_DUPLICATE_BLOCK_NOT_DISCARDED > ; Get owner for new block, in AX ; tst ax jz useOwnerOfCurrentThread cmp ax, -1 jne haveOwner ;copyOwner: mov ax, ds:[bx].HM_owner ;ax = owner of block to duplicate jmp short haveOwner useOwnerOfCurrentThread: mov ax, ss:[TPD_processHandle] haveOwner: EC < xchg ax,bx > EC < call ECCheckGeodeHandle > EC < xchg ax,bx > ; Get burden thread to use, in DI ; call DetermineBurdenThreadForDuplicatedResource ; If source & new owner are both instances of the same application, ; (as being determined by their having the same executable file), then ; use the new owner when performing relocations, as some relocations ; may be to non-sharable blocks, & we want to get those blocks of the ; new owner. If the new owner is unrelated to the source, then we ; must instead relocate relative to the source, as the dest's relocation ; table has nothing to do with the block we're duplicating. ; ; Start by assuming new owner unrelated to source ; mov si, ds:[bx].HM_owner ;si = owner of block to duplicate xchg bx, si call Obj_MemLockES_save_ax ;es = core block xchg bx, si mov cx, es:[GH_geoHandle] ;cx = file handle to executable file call Obj_MemUnlockES EC < call NullES > ; If the owning geode is in the XIP resource (has GH_geoHandle = 0) then ; we know they don't come from the same executable. if _FXIP or FAULT_IN_EXECUTABLES_ON_FLOPPIES jcxz notSameExecutable endif push bx mov bx, ax ;bx = new owner call Obj_MemLockES_save_ax ;es = core block of new owner cmp cx, es:[GH_geoHandle] ;if files are the same then special case call Obj_MemUnlock EC < call NullES > pop bx jnz notSameExecutable ; ; Oh, but it is the same executable! Perform all relocations ; relative to the new owner. ; mov si, ax ; notSameExecutable: ; si = temporary owner (during RelocateObjBlock) ; di = burden thread ; ds = idata push ax ;save new owner for block push bx ;save handle to duplicate push si ;save temporary owner push di ;save burden thread ; allocate a block for the resource call GeodeDuplicateResource ;Circumvent the EC code that dies if you MemLock an object block, ; as it is OK in this case (we do the relocations below) call MemLockSkipObjCheck ;ax = segment pop ds:[bx].HM_otherInfo ;set "burden thread" for new block pop ds:[bx].HM_owner ;set temporary owner mov bp, bx ;bp = handle to copy to pop bx ;bx = block to copy from ; load in the resource ; fix up block header mov ds, ax EC < cmp ds:[LMBH_lmemType], LMEM_TYPE_OBJ_BLOCK > EC < ERROR_NZ OBJ_DUPLICATE_BLOCK_REQUIRES_AN_OBJECT_BLOCK > mov ax, ds:[LMBH_flags] ornf ax, mask LMF_DUPLICATED andnf ax, not mask LMF_IN_RESOURCE mov ds:[LMBH_flags], ax ; if an object block then store size and relocate LoadVarSeg es mov dx, es:[bp].HM_size ;dx = size (paragraphs) shl dx shl dx shl dx shl dx mov ds:[OLMBH_resourceSize], dx ;store size in bytes ; relocate the block push bx, bp ;save old handle mov cx, VMRT_RELOCATE_FROM_RESOURCE call RelocateObjBlock ;relocate objects pop bx, bp pop es:[bp].HM_owner ;set owner for new block. Saved until ; now so ORS_OWNING_GEODE_ENTRY_POINT ; relocations use the right owner in ; the case of duplicating a shared ; resource. EC < call ECLMemValidateHeapFar > ; Allocate a VM block mov bx, ds:[LMBH_handle] test ds:[LMBH_flags], mask LMF_DETACHABLE jz noVM call AllocVMAddToSavedList noVM: EC < pop cx ; Retrieve source template handle > EC < call DebugTagDuplicate ; Mark duplicate w/origin info > call Obj_MemUnlock .leave ret ObjDuplicateResource endp ;--- Obj_MemLockES_save_ax proc near uses ax .enter call Obj_MemLock mov es, ax .leave ret Obj_MemLockES_save_ax endp Obj_MemLock proc near call MemLock ret Obj_MemLock endp ;--- Obj_MemUnlockES proc near uses bx .enter mov bx, es:[LMBH_handle] call Obj_MemUnlock .leave ret Obj_MemUnlockES endp Obj_MemUnlock proc near call MemUnlock ret Obj_MemUnlock endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DebugTagDuplicate %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Tag new duplicate block w/source for the debugger's sake. We do this by adding a piece of vardata to the first object, that contains the permanent name of the geode owning the source template, & the handle of the source template, unrelocated relative to its owner. From this info, the debugger can use the symbols of the source template when printing out the objects in the duplicated block. Much better than hex numbers. CALLED BY: INTERNAL PASS: cx = source block bx = duplicated block *ds = duplicate block RETURN: nothing DESTROYED: ax, cx, dx, si, di, bp, es %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ if ERROR_CHECK DebugTagDuplicate proc near uses bx .enter if 0 mov ax, ds:[LMBH_offset] ; Get first chunk handle (flags) inc ax ; Get first object/data handle inc ax mov si, ax ; Setup *ds:si to be same call ObjGetFlags ; Get flags for the chunk test al, mask OCF_IS_OBJECT ; Only do it if is an object coming jz exit ; from resource. (An object so we ; can add vardata, and a resource test al, mask OCF_IN_RESOURCE; so we have some reassurance jz exit ; that it will stay in place) mov_tr bp, cx ; save source block in bp mov ax, DEBUG_META_OBJ_DUPLICATE_RESOURCE_INFO or \ mask VDF_SAVE_TO_STATE mov cx, size DebugObjDuplicateResourceInfo call ObjVarAddData ; ds:bx = new entry segmov es, ds ; es:di = new entry mov di, bx mov bx, bp ; get source template block in bx call MemOwnerFar call MemLock mov ds, ax ; ds:si = perm name of owner mov si, offset GH_geodeName mov cx, GEODE_NAME_SIZE ; Copy into vardata rep movsb call MemUnlock EC < call NullDS > mov cx, bp ; get source template block in cx ; bx still = owner mov al, RELOC_HANDLE ; Unrelocate it call ObjDoUnRelocation ; cx = unrelocated template handle mov ax, cx stosw ; Stuff result into vardata segmov ds, es ; Final seg in ds exit: endif .leave ret DebugTagDuplicate endp endif COMMENT @---------------------------------------------------------------------- FUNCTION: DetermineBurdenThreadForDuplicatedResource DESCRIPTION: CALLED BY: INTERNAL ObjDuplicateResource PASS: ds - kdata ax - new owner to be used for duplicated resource bx - resource to be duplicated cx - handle of thread to run new block, OR 0 to have block run by current running thread, OR -1 to copy nature of thread from source block: if source is process-run, dest will be process-run. if source is ui-run, dest will be ui-run. if source run by anything else, that same thread will run the new block. RETURN: di - burden thread to run duplicated resource, or "-2" to use as-yet-uncreated UI thread of new owner DESTROYED: nothing REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Doug 6/1/92 Broke out, extended for new thread model ------------------------------------------------------------------------------@ DetermineBurdenThreadForDuplicatedResource proc near uses bx, si, es .enter mov di, cx ; If ZERO passed, return current thread. ; tst di jne notCurrentThread mov di, ds:[currentThread] jmp short doneWithRealThread notCurrentThread: ; ; If a -1 passed, duplicate nature from source block. ; Otherwise, real thread handle passed, just return that. ; cmp di, -1 jne doneWithRealThread mov di, ds:[bx].HM_otherInfo ;di = burden thread of source mov si, ds:[bx].HM_owner ;si = owner of source ; ; if source block run by process, convert burden thread to token "-1" ; cmp di, -1 je sourceIsProcessRun cmp di, ds:[si].HM_otherInfo ;compare against 1st thread jne sourceNotProcessRun sourceIsProcessRun: mov bx, ax ;get new owner in bx mov di, ds:[bx].HM_otherInfo ;return 1st thread of new owner jmp short doneWithRealThread sourceNotProcessRun: ; ; if source block run by ui, convert burden thread to token "-2" ; cmp di, -2 je sourceIsUIRun mov bx, si ;get owner of source block in bx call Obj_MemLockES_save_ax ;es = core block of source cmp di, es:[PH_uiThread] ;compare against UI thread call Obj_MemUnlock EC < call NullES > jne sourceNotUIRun sourceIsUIRun: mov bx, ax ;get new owner in bx call Obj_MemLockES_save_ax ;es = core block of source mov di, es:[PH_uiThread] ;return UI thread of new owner call Obj_MemUnlock EC < call NullES > tst di ;... unless NULL... jnz doneWithRealThread mov di, -2 ;in which case return "-2", ;which will be converted to the ;UI thread, once one is created. jmp short done sourceNotUIRun: ; Warning! bx may be trashed at this point ; ; If source run by neither process nor UI thread, then there's no ; symbolic nature to be duplicated -- just have new duplicated resource ; run by the same exact thread as ran the source. ; doneWithRealThread: EC < xchg bx, di > EC < call ECCheckThreadHandleFar > EC < xchg bx, di > done: .leave ret DetermineBurdenThreadForDuplicatedResource endp COMMENT @---------------------------------------------------------------------- FUNCTION: FindDuplicate DESCRIPTION: Locate the saved-block handle corresponding to the given memory block. CALLED BY: FullObjLock, ObjMapSavedToState, TransferToVM PASS: bx - handle for which to search RETURN: carry - set if error (not found) ds - idata si - handle found cx - vm file handle DESTROYED: ax, es REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 3/89 Initial version ------------------------------------------------------------------------------@ FindDuplicate proc far if TEST_DUPLICATE_LIST call ECCheckMemHandleNS endif push bx LoadVarSeg ds mov bx,ds:[bx].HM_owner call Obj_MemLockES_save_ax ;es = core block pop bx mov cx,es:[PH_vmHandle] mov si, es:[PH_savedBlockPtr] ;si = handle test es:[GH_geodeAttr],mask GA_PROCESS call Obj_MemUnlockES EC < call NullES > jz retErr FD_loop: if TEST_DUPLICATE_LIST call ECCheckMemHandleNS endif tst si jz retErr cmp bx,ds:[si].HSB_handle jz FD_ret mov si, ds:[si].HSB_next jmp FD_loop retErr: stc FD_ret: ret FindDuplicate endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% AllocVMAddToSavedList %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Common code to allocate a VM block handle for a saved block in its process's state file and append the block to the list of saved blocks for the process CALLED BY: ObjSaveBlock, ObjDuplicateResource PASS: bx = handle to add RETURN: nothing DESTROYED: si, ax, cx, es, ds PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- ardeb 2/27/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ AllocVMAddToSavedList proc far .enter ; ; Fetch the segment of the owner's core block so we can get at its ; saved block list and its state file handle. ; push bx LoadVarSeg ds mov bx,ds:[bx].HM_owner call MemLock mov es, ax ;es = core block pop bx EC < test es:[GH_geodeAttr], mask GA_PROCESS > EC < ERROR_Z OBJ_BLOCK_NOT_OWNED_BY_PROCESS > mov ax, es:[PH_vmHandle] tst ax jz allocHSB ; ; Replace the VM override file so (a) bx is unmolested and (b) we ; don't unintentionally use a file we don't want to. ; mov_tr dx, ax ;dx = VM file call AllocEmptyVMBlock ; ; Create a saved block handle associated with the block. ; ax = associated vm block handle, or 0 if no state file yet ; allocHSB: call AddToSavedList push bx mov bx, es:[GH_geodeHandle] call MemUnlock EC < call NullES > pop bx ; ; Mark the block as being detachable now it is in the saved-blocks ; list for the process. ; call MemLockSkipObjCheck ;ax = segment mov ds, ax ornf ds:[LMBH_flags], mask LMF_DETACHABLE call MemUnlock .leave ret AllocVMAddToSavedList endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% AllocEmptyVMBlock %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Allocate an empty VM block in the state file for the process for a duplicated block. CALLED BY: AllocVMAddToSavedList, ObjAssocVMFile PASS: dx = handle of state file bx = handle of duplicated/saved block RETURN: ax = VM block handle for block DESTROYED: cx PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- ardeb 8/16/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ AllocEmptyVMBlock proc far uses bx, ds .enter ; ; Figure the UID for the block. ; LoadVarSeg ds call GetSavedBlockVMUserID ; ; Allocate an empty VM block handle for the thing so we can relocate ; and unrelocate references to this block. ; clr cx ;alloc VM handle only mov bx, dx call VMAlloc .leave ret AllocEmptyVMBlock endp COMMENT @---------------------------------------------------------------------- FUNCTION: AddToSavedList DESCRIPTION: Put the given handle on the saved blocks list CALLED BY: AllocSavedBlock, AllocVMAddToSavedList PASS: ax - associated VM ID (if 0 then allocate next odd id) bx - handle to put on list es - core block of owner (locked) RETURN: bx - same DESTROYED: none REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 3/89 Initial version ------------------------------------------------------------------------------@ AddToSavedList proc far uses ax, si, ds .enter push bx LoadVarSeg ds mov bx, es:[GH_geodeHandle] ;set owner for HSB call MemIntAllocHandle ;bx = new handle mov ds:[bx].HSB_handleSig,SIG_SAVED_BLOCK mov si, bx ;si = new handle INT_OFF ; prevent blocks being lost should a context ; switch to another thread of the same process ; that also performs an ObjDuplicateResource (or ; ObjSaveBlock) happen between the xchg and the mov xchg si,es:[PH_savedBlockPtr] ;put at start of list mov ds:[bx].HSB_next, si INT_ON ; if VM ID passed is 0 then substitute next odd number tst ax jnz gotID inc ax ;assume this is the first block tst si jz gotID mov ax, ds:[si].HSB_vmID inc ax inc ax gotID: mov ds:[bx].HSB_vmID, ax pop ax ;ax = handle being saved mov ds:[bx].HSB_handle,ax xchg bx,ax ;(1-byte inst) bx <- ax .leave ret AddToSavedList endp ObjectLoad ends ;------------------------------------------ ObjectFile segment resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ObjSaveBlock %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Set up an LMem block to be saved to its owner's state file CALLED BY: GLOBAL PASS: bx = handle of block to be saved. This block must be an LMem block and have LMF_HAS_FLAGS set in its LMBH_flags word (and have a flags chunk of course). RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- ardeb 2/27/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ObjSaveBlock proc far uses ax, cx, si, ds, es .enter EC < LoadVarSeg ds > EC < test ds:[bx].HM_flags, mask HF_LMEM > EC < ERROR_Z OBJ_SAVE_BLOCK_NOT_LMEM > EC < push ax > EC < call MemLock > EC < mov es, ax > EC < pop ax > EC < test es:[LMBH_flags], mask LMF_HAS_FLAGS > EC < ERROR_Z OBJ_LMEM_BLOCK_HAS_NO_FLAGS > EC < call MemUnlock > EC < call FindDuplicate > EC < ERROR_NC OBJ_SAVE_BLOCK_ALREADY_SAVED > call AllocVMAddToSavedList ; Mark that there is no other copy of this block in the state file call MemLock mov ds, ax ornf ds:LMBH_flags, mask LMF_DUPLICATED call MemUnlock .leave ret ObjSaveBlock endp COMMENT @---------------------------------------------------------------------- FUNCTION: ObjFreeDuplicate DESCRIPTION: Free a block created by ObjDuplicateResource or saved with ObjSaveBlock CALLED BY: GLOBAL PASS: bx - handle of block to free RETURN: none DESTROYED: bx REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 3/89 Initial version ------------------------------------------------------------------------------@ ObjFreeDuplicate proc far uses ax, cx, dx, si, di, bp, ds, es .enter EC < call ECCheckMemHandleFar > call ObjLockObjBlock ;lock the sucker mov ds, ax test ds:[LMBH_flags], mask LMF_DETACHABLE jz done push ax, bx LoadVarSeg ds mov bx, ds:[bx].HM_owner call MemLock mov es, ax ; es = core block pop ax, bx push es mov cx, es:[PH_vmHandle] ; cx <- state file mov di, offset PH_savedBlockPtr ; Keep interrupts off during the unlinking so that we don't context ; switch at a bad time INT_OFF findLoop: mov si, es:[di] tst si jz noVM cmp bx, ds:[si].HSB_handle jz found lea di, ds:[si].HSB_next segmov es, ds jmp findLoop ; found, es:di points at pointer to handle, si = handle found: mov ax, ds:[si].HSB_next stosw ;remove from linked list INT_ON push bx jcxz freeHSB ; if no state file, don't ; futz with VM file, as nothing's ; been allocated. mov ax, ds:[si].HSB_vmID mov bx, cx ; bx <- VM file handle call VMFree freeHSB: mov bx, si call FarFreeHandle pop bx noVM: INT_ON ;restore ints in not found case pop es ; es <- core block push bx mov bx, es:[GH_geodeHandle] call MemUnlock EC < call NullES > pop bx done: .leave GOTO MemFree ObjFreeDuplicate endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ObjMapSavedToState %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Map a saved/duplicated block to its corresponding VM block handle in the process's state file. CALLED BY: GLOBAL PASS: bx = handle to map RETURN: if block found, carry is clear and ax = VM block handle for the block if no such block is on the process's list of non-resource blocks to be saved, the carry is returned set DESTROYED: Nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- ardeb 3/ 1/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ObjMapSavedToState proc far uses ds, si, es, di, cx .enter call FindDuplicate jc done mov ax, ds:[si].HSB_vmID done: .leave ret ObjMapSavedToState endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ObjMapStateToSaved %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Map a VM block ID from a state file to the corresponding memory block handle for a process. CALLED BY: GLOBAL PASS: ax = VM block handle bx = process handle or 0 for current thread's process RETURN: if block found, carry is clear and bx = memory block handle if no such block appears on a process's saved block list, carry is set DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- ardeb 3/ 1/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ObjMapStateToSaved proc far uses ds, si .enter tst bx ; process handle passed ? jnz getAddress ; yes, so use it mov bx, ss:[TPD_processHandle] ; else get the current process getAddress: EC < call ECCheckGeodeHandle ; verify the handle > push ax call MemLock mov ds, ax pop ax EC < test ds:[GH_geodeAttr], mask GA_PROCESS > EC < ERROR_Z NOT_PROCESS_HANDLE > mov si, ds:[PH_savedBlockPtr] LoadVarSeg ds scanLoop: tst si jz fail cmp ds:[si].HSB_vmID, ax je happiness mov si, ds:[si].HSB_next jmp scanLoop happiness: mov si, ds:[si].HSB_handle done: call MemUnlock mov bx, si .leave ret fail: stc jmp done ObjMapStateToSaved endp ObjectFile ends
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_14796_1281.asm
ljhsiun2/medusa
9
4408
<reponame>ljhsiun2/medusa .global s_prepare_buffers s_prepare_buffers: push %r11 push %r9 push %rax push %rbp push %rcx push %rdi push %rsi lea addresses_A_ht+0x1cc30, %rbp clflush (%rbp) add $25099, %r11 movb (%rbp), %r9b nop and $37681, %rax lea addresses_D_ht+0x1e9d4, %rsi lea addresses_UC_ht+0x159b8, %rdi add $5417, %rbp mov $111, %rcx rep movsl nop sub $20346, %rax lea addresses_D_ht+0x19038, %rcx nop nop nop nop sub %r11, %r11 movups (%rcx), %xmm3 vpextrq $1, %xmm3, %rdi nop nop cmp $60637, %rdi pop %rsi pop %rdi pop %rcx pop %rbp pop %rax pop %r9 pop %r11 ret .global s_faulty_load s_faulty_load: push %r11 push %r14 push %rax push %rbp push %rcx push %rdi push %rdx push %rsi // Store lea addresses_WT+0x16cb8, %r11 nop xor %r14, %r14 mov $0x5152535455565758, %rcx movq %rcx, (%r11) nop nop nop dec %r14 // REPMOV lea addresses_US+0x1422c, %rsi lea addresses_PSE+0x7cb8, %rdi nop nop nop xor $37635, %rbp mov $72, %rcx rep movsw nop nop nop and %rdi, %rdi // Store lea addresses_UC+0x18888, %rdx nop xor %rcx, %rcx movl $0x51525354, (%rdx) nop nop nop xor %rbp, %rbp // Load mov $0x794, %rcx nop nop and %rax, %rax mov (%rcx), %si and $52053, %rdi // Store lea addresses_UC+0x2608, %rbp nop nop nop inc %r11 movl $0x51525354, (%rbp) inc %rdi // Faulty Load lea addresses_PSE+0x118b8, %rax nop nop nop nop nop sub %r14, %r14 movb (%rax), %dl lea oracles, %rax and $0xff, %rdx shlq $12, %rdx mov (%rax,%rdx,1), %rdx pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %rax pop %r14 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'NT': True, 'AVXalign': True, 'size': 1, 'congruent': 0, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 9, 'same': False, 'type': 'addresses_WT'}, 'OP': 'STOR'} {'src': {'congruent': 2, 'same': False, 'type': 'addresses_US'}, 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'REPM'} {'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 3, 'same': False, 'type': 'addresses_UC'}, 'OP': 'STOR'} {'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 2, 'same': False, 'type': 'addresses_P'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 2, 'same': False, 'type': 'addresses_UC'}, 'OP': 'STOR'} [Faulty Load] {'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0, 'same': True, 'type': 'addresses_PSE'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 3, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 2, 'same': False, 'type': 'addresses_D_ht'}, 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM'} {'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 6, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'} {'33': 14796} 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 */
test/Succeed/Issue5198.agda
cruhland/agda
1,989
9590
module _ (_ : Set) where open import Imports.Issue5198 Set data D : Set where r : D F : D → Set₂ F r = R f : {d : D} → F d → F d f x = x _ : R _ = f record {A = Set}
libsrc/_DEVELOPMENT/adt/b_array/c/sdcc_iy/b_array_capacity_fastcall.asm
jpoikela/z88dk
640
97916
; size_t b_array_capacity_fastcall(b_array_t *a) SECTION code_clib SECTION code_adt_b_array PUBLIC _b_array_capacity_fastcall EXTERN asm_b_array_capacity defc _b_array_capacity_fastcall = asm_b_array_capacity
tests/simpleOO/src/dds-request_reply-tests-simple.ads
persan/dds-requestreply
0
13262
<reponame>persan/dds-requestreply with DDS.DomainParticipantFactory; with DDS.DomainParticipant; package DDS.Request_Reply.Tests.Simple is pragma Elaborate_Body; Domain_Id : DDS.DomainId_T := 0; Service_Name : DDS.String := To_DDS_String ("myService"); Service_Name_Octets : DDS.String := To_DDS_String ("myOctets"); Qos_Library : DDS.String := To_DDS_String ("library"); Qos_Profile : DDS.String := To_DDS_String ("profile"); DONE : DDS.String := To_DDS_String ("<DONE>"); Factory : constant DDS.DomainParticipantFactory.Ref_Access := DDS.DomainParticipantFactory.Get_Instance; Participant : DDS.DomainParticipant.Ref_Access := Factory.Create_Participant_With_Profile (Domain_Id => Domain_Id, Library_Name => Qos_Library, Profile_Name => Qos_Profile); end DDS.Request_Reply.Tests.Simple;
test/link/group4/seg1b.asm
nigelperks/BasicAssembler
0
176014
IDEAL ASSUME CS:SEG1, DS:SEG1, ES:SEG1, SS:SEG1 SEGMENT SEG1 PUBLIC sword: DW 0DEADh DW 0FACEh DW sword ENDS GROUP ORANGE SEG1 END
Transynther/x86/_processed/AVXALIGN/_zr_un_/i7-7700_9_0xca_notsx.log_380_20.asm
ljhsiun2/medusa
9
240619
.global s_prepare_buffers s_prepare_buffers: push %r14 push %r8 push %rax push %rcx lea addresses_D_ht+0x1e6ea, %rcx add %r14, %r14 mov $0x6162636465666768, %rax movq %rax, %xmm7 vmovups %ymm7, (%rcx) nop nop sub %r8, %r8 pop %rcx pop %rax pop %r8 pop %r14 ret .global s_faulty_load s_faulty_load: push %r12 push %r8 push %r9 push %rbp push %rcx push %rdi push %rsi // Store lea addresses_A+0x288a, %r8 nop nop nop inc %rbp movw $0x5152, (%r8) nop nop nop sub %rbp, %rbp // REPMOV lea addresses_WT+0x1ea6a, %rsi lea addresses_PSE+0x16c6a, %rdi clflush (%rsi) clflush (%rdi) nop nop and %r9, %r9 mov $53, %rcx rep movsw inc %r12 // Store lea addresses_UC+0x6e6a, %r8 clflush (%r8) sub $8559, %rcx mov $0x5152535455565758, %rbp movq %rbp, (%r8) and %rbp, %rbp // Load lea addresses_PSE+0xdf6a, %rbp nop nop nop and $36611, %rdi vmovups (%rbp), %ymm6 vextracti128 $1, %ymm6, %xmm6 vpextrq $1, %xmm6, %rcx nop xor %r12, %r12 // Store lea addresses_UC+0x13aaa, %r9 nop nop nop nop nop xor $30931, %r8 movb $0x51, (%r9) nop nop nop xor $16929, %r12 // Store lea addresses_US+0xfdaa, %r9 nop nop nop nop add $7933, %rcx mov $0x5152535455565758, %rdi movq %rdi, %xmm4 movaps %xmm4, (%r9) nop nop nop and $46978, %rbp // Store lea addresses_PSE+0xe15e, %r9 sub $30971, %r8 mov $0x5152535455565758, %rsi movq %rsi, %xmm3 movups %xmm3, (%r9) nop nop cmp %r9, %r9 // Faulty Load lea addresses_WC+0x18e6a, %rdi clflush (%rdi) nop nop nop nop sub $61700, %r8 vmovntdqa (%rdi), %ymm0 vextracti128 $1, %ymm0, %xmm0 vpextrq $1, %xmm0, %rcx lea oracles, %r9 and $0xff, %rcx shlq $12, %rcx mov (%r9,%rcx,1), %rcx pop %rsi pop %rdi pop %rcx pop %rbp pop %r9 pop %r8 pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'AVXalign': True, 'size': 4, 'congruent': 0, 'same': True, 'type': 'addresses_WC'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 5, 'same': False, 'type': 'addresses_A'}, 'OP': 'STOR'} {'src': {'congruent': 10, 'same': False, 'type': 'addresses_WT'}, 'dst': {'congruent': 8, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'REPM'} {'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 11, 'same': False, 'type': 'addresses_UC'}, 'OP': 'STOR'} {'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 8, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 5, 'same': False, 'type': 'addresses_UC'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': True, 'size': 16, 'congruent': 6, 'same': False, 'type': 'addresses_US'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 1, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'STOR'} [Faulty Load] {'src': {'NT': True, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': True, 'type': 'addresses_WC'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 7, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'STOR'} {'08': 1, '00': 379} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
Print/print_string.asm
berkcetinsaya/MIPSLanguageExamples
0
173394
.data message: .asciiz "Test" # asciiz is a basic unit to store string variables. .text li $v0, 4 # service code 4 to print out .asciiz la $a0, message # load .asciiz variable by using load address (la) to $a0 # $a registers are argument registers. syscall # to execute the service
processor/processor-eclipse_mem_ref_p.adb
SMerrony/dgemua
2
16619
-- MIT License -- Copyright (c) 2021 <NAME> -- 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. with Ada.Text_IO; use Ada.Text_IO; with Debug_Logs; use Debug_Logs; with Resolver; use Resolver; package body Processor.Eclipse_Mem_Ref_P is procedure Do_Eclipse_Mem_Ref (I : in Decoded_Instr_T; CPU : in out CPU_T) is Addr : Phys_Addr_T; Ring : Phys_Addr_T := CPU.PC and 16#7000_0000#; Bit_Num : Natural; Word : Word_T; begin case I.Instruction is when I_BLM => -- AC0 - unused, AC1 - no. wds to move, AC2 - src, AC3 - dest declare Num_Wds : Word_T := DG_Types.Lower_Word(CPU.AC(1)); Src, Dest : Phys_Addr_T; begin if (Num_Wds = 0) or (Num_Wds > 32768) then Loggers.Debug_Print (Debug_Log, "WARNING: BLM called with AC1 out of bounds, No-Op"); else Src := Ring or Phys_Addr_T(DG_Types.Lower_Word(CPU.AC(2))); Dest := Ring or Phys_Addr_T(DG_Types.Lower_Word(CPU.AC(3))); if CPU.Debug_Logging then Loggers.Debug_Print (Debug_Log, "BLM moving" & Num_Wds'Image & " words from" & Src'Image & " to" & Dest'Image); end if; while Num_Wds /= 0 loop RAM.Write_Word (Dest, RAM.Read_Word(Src)); Num_Wds := Num_Wds - 1; Src := Src + 1; Dest := Dest + 1; end loop; CPU.AC(1) := 0; CPU.AC(2) := Dword_T(Src); -- TODO verify this CPU.AC(3) := Dword_T(Dest); end if; end; when I_BTO | I_BTZ => Resolve_Eclipse_Bit_Addr (CPU, I.Acd, I.Acs, Addr, Bit_Num); Addr := Addr or Ring; Word := RAM.Read_Word (Addr); if I.Instruction = I_BTO then Set_W_Bit (Word, Bit_Num); else Clear_W_Bit (Word, Bit_Num); end if; RAM.Write_Word (Addr, Word); when I_CMP => declare Byte_1, Byte_2 : Byte_T; Res : Dword_T := 0; Str_1_BP, Str_2_BP : Word_T; Str_1_Len : Integer_16 := Word_To_Integer_16(DG_Types.Lower_Word(CPU.AC(1))); Str_2_Len : Integer_16 := Word_To_Integer_16(DG_Types.Lower_Word(CPU.AC(0))); begin if (Str_1_Len = 0) and (Str_2_Len = 0) then CPU.AC(1) := 0; else Str_1_BP := DG_Types.Lower_Word(CPU.AC(3)); Str_2_BP := DG_Types.Lower_Word(CPU.AC(2)); loop if Str_1_Len = 0 then Byte_1 := 32; else Byte_1 := RAM.Read_Byte_Eclipse_BA(Ring,Str_1_BP); end if; if Str_2_Len = 0 then Byte_2 := 32; else Byte_2 := RAM.Read_Byte_Eclipse_BA(Ring,Str_2_BP); end if; if Byte_1 > Byte_2 then Res := 1; exit; end if; if Byte_1 < Byte_2 then Res := 16#ffff_ffff#; exit; end if; if Str_1_Len > 0 then Str_1_BP := Str_1_BP + 1; Str_1_Len := Str_1_Len - 1; end if; if Str_1_Len < 0 then Str_1_BP := Str_1_BP - 1; Str_1_Len := Str_1_Len + 1; end if; if Str_2_Len > 0 then Str_2_BP := Str_2_BP + 1; Str_2_Len := Str_2_Len - 1; end if; if Str_2_Len < 0 then Str_2_BP := Str_2_BP - 1; Str_2_Len := Str_2_Len + 1; end if; exit when (Str_1_Len = 0) and (Str_2_Len = 0); end loop; CPU.AC(0) := Dword_T(Str_2_Len); CPU.AC(1) := Res; CPU.AC(2) := Dword_T(Str_2_BP); CPU.AC(3) := Dword_T(Str_1_BP); end if; end; when I_CMV => declare Dest_Ascend, Src_Ascend : Boolean; Dest_Cnt, Src_Cnt : Integer_16; begin Dest_Cnt := Word_To_Integer_16(DG_Types.Lower_Word(CPU.AC(0))); if Dest_Cnt = 0 then Loggers.Debug_Print (Debug_Log, "WARNING: CMV called with AC0 = 0, not moving anything"); CPU.Carry := false; else Dest_Ascend := Dest_Cnt > 0; Src_Cnt := Word_To_Integer_16(DG_Types.Lower_Word(CPU.AC(1))); Src_Ascend := Src_Cnt > 0; CPU.Carry := (Abs Src_Cnt) > (Abs Dest_Cnt); -- move Src_Cnt bytes loop RAM.Write_Byte_Eclipse_BA(Ring, DG_Types.Lower_Word(CPU.AC(2)), RAM.Read_Byte_Eclipse_BA(Ring, DG_Types.Lower_Word(CPU.AC(3)))); if Src_Ascend then CPU.AC(3) := CPU.AC(3) + 1; Src_Cnt := Src_Cnt - 1; else CPU.AC(3) := CPU.AC(3) - 1; Src_Cnt := Src_Cnt + 1; end if; if Dest_Ascend then CPU.AC(2) := CPU.AC(2) + 1; Dest_Cnt := Dest_Cnt - 1; else CPU.AC(2) := CPU.AC(2) - 1; Dest_Cnt := Dest_Cnt + 1; end if; exit when (Src_Cnt = 0) or (Dest_Cnt = 0); end loop; -- now fill any excess bytes with ASCII spaces while Dest_Cnt /= 0 loop RAM.Write_Byte_Eclipse_BA(Ring, DG_Types.Lower_Word(CPU.AC(2)), 32); if Dest_Ascend then CPU.AC(2) := CPU.AC(2) + 1; Dest_Cnt := Dest_Cnt - 1; else CPU.AC(2) := CPU.AC(2) - 1; Dest_Cnt := Dest_Cnt + 1; end if; end loop; CPU.AC(0) := 0; CPU.AC(1) := Dword_T(Src_Cnt); end if; end; when I_ELDA => Addr := (Resolve_15bit_Disp (CPU, I.Ind, I.Mode, I.Disp_15, I.Disp_Offset) and 16#7fff#) or Ring; CPU.AC(I.Ac) := Dword_T(RAM.Read_Word(Addr)); when I_ELEF => Addr := (Resolve_15bit_Disp (CPU, I.Ind, I.Mode, I.Disp_15, I.Disp_Offset) and 16#7fff#) or Ring; CPU.AC(I.Ac) := Dword_T(Addr); when I_ESTA => Addr := (Resolve_15bit_Disp (CPU, I.Ind, I.Mode, I.Disp_15, I.Disp_Offset) and 16#7fff#) or Ring; RAM.Write_Word (Addr, DG_Types.Lower_Word(CPU.AC(I.Ac))); when I_LDB => CPU.AC(I.Acd) := Dword_T (RAM.Read_Byte_Eclipse_BA (Ring, DG_Types.Lower_Word(CPU.AC(I.Acs)))); when I_LEF => Addr := Resolve_8bit_Disp (CPU, I.Ind, I.Mode, I.Disp_15); Addr := (Addr and 16#0000_7fff#) or Ring; CPU.AC(I.Ac) := Dword_T(Addr); when I_STB => declare Low_Byte : Boolean := Test_DW_Bit(CPU.AC(I.Acs), 31); begin Addr := Shift_Right (Phys_Addr_T(DG_Types.Lower_Word(CPU.AC(I.Acs))), 1); Addr := (Addr and 16#7fff#) or Ring; RAM.Write_Byte(Addr, Low_Byte, Byte_T(CPU.AC(I.Acd))); end; when others => Put_Line ("ERROR: ECLIPSE_MEMREF instruction " & To_String(I.Mnemonic) & " not yet implemented"); raise Execution_Failure with "ERROR: ECLIPSE_MEMREF instruction " & To_String(I.Mnemonic) & " not yet implemented"; end case; CPU.PC := CPU.PC + Phys_Addr_T(I.Instr_Len); end Do_Eclipse_Mem_Ref; end Processor.Eclipse_Mem_Ref_P;
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_668.asm
ljhsiun2/medusa
9
105470
<reponame>ljhsiun2/medusa .global s_prepare_buffers s_prepare_buffers: push %r14 push %r9 push %rax push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_normal_ht+0x1591, %rsi lea addresses_normal_ht+0x191c9, %rdi and %r9, %r9 mov $92, %rcx rep movsq sub $55142, %rax lea addresses_UC_ht+0x1d3c9, %rsi lea addresses_normal_ht+0xe9c9, %rdi nop nop nop nop add $48772, %rdx mov $114, %rcx rep movsq nop nop inc %rax lea addresses_normal_ht+0x16109, %rax xor %rcx, %rcx movb $0x61, (%rax) inc %rax lea addresses_A_ht+0xe999, %rsi nop nop nop and %r14, %r14 mov (%rsi), %ax nop nop add $62985, %rsi lea addresses_A_ht+0x3829, %r9 nop nop nop nop nop xor $4299, %rdx vmovups (%r9), %ymm7 vextracti128 $0, %ymm7, %xmm7 vpextrq $1, %xmm7, %rcx cmp $34956, %rcx lea addresses_WT_ht+0x7bc9, %rsi nop nop nop dec %r14 movups (%rsi), %xmm0 vpextrq $0, %xmm0, %rax nop sub %rcx, %rcx lea addresses_normal_ht+0x2789, %rsi lea addresses_normal_ht+0x19139, %rdi clflush (%rdi) sub %rax, %rax mov $0, %rcx rep movsw nop nop inc %rcx lea addresses_WC_ht+0x3e7b, %rdx clflush (%rdx) add $26005, %rax mov $0x6162636465666768, %rsi movq %rsi, %xmm1 movups %xmm1, (%rdx) nop nop dec %rcx lea addresses_WC_ht+0x1e0c9, %rsi lea addresses_UC_ht+0x159c9, %rdi nop nop and %rbx, %rbx mov $71, %rcx rep movsq nop nop nop nop add %rcx, %rcx lea addresses_WT_ht+0x15444, %rax clflush (%rax) xor $20207, %rcx mov (%rax), %bx nop nop nop nop nop cmp $41303, %rsi lea addresses_D_ht+0xb249, %rsi lea addresses_WC_ht+0xb9f9, %rdi nop nop nop xor %rdx, %rdx mov $22, %rcx rep movsq nop nop cmp %rdx, %rdx lea addresses_WC_ht+0x1a449, %rsi dec %r9 mov $0x6162636465666768, %rbx movq %rbx, %xmm2 movups %xmm2, (%rsi) nop nop inc %rdi lea addresses_A_ht+0xc9c9, %r9 nop nop nop nop nop xor $45933, %rcx mov $0x6162636465666768, %r14 movq %r14, %xmm0 and $0xffffffffffffffc0, %r9 movntdq %xmm0, (%r9) nop nop nop dec %rax lea addresses_WT_ht+0x1269b, %rdi nop nop xor $24540, %rdx mov (%rdi), %rsi nop nop and $29437, %rcx lea addresses_D_ht+0x13549, %rsi lea addresses_WC_ht+0x1696b, %rdi nop nop xor %r14, %r14 mov $96, %rcx rep movsw nop nop nop nop sub %rbx, %rbx pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %rax pop %r9 pop %r14 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %r9 push %rax push %rdi push %rdx // Store lea addresses_WT+0x17a7b, %rax nop nop dec %rdx mov $0x5152535455565758, %r9 movq %r9, %xmm5 movups %xmm5, (%rax) nop nop nop xor %r13, %r13 // Faulty Load lea addresses_RW+0x1b1c9, %rax nop nop nop sub $42456, %r12 movups (%rax), %xmm2 vpextrq $1, %xmm2, %rdi lea oracles, %r12 and $0xff, %rdi shlq $12, %rdi mov (%r12,%rdi,1), %rdi pop %rdx pop %rdi pop %rax pop %r9 pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_RW', 'AVXalign': True, 'size': 4, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 1}} [Faulty Load] {'src': {'type': 'addresses_RW', 'AVXalign': False, 'size': 16, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': True}} {'src': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 4}} {'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 4}, 'OP': 'LOAD'} {'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 3}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 8}, 'OP': 'LOAD'} {'src': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 1}} {'src': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}} {'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} {'src': {'type': 'addresses_D_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 6}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 16, 'NT': True, 'same': False, 'congruent': 8}} {'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 1}, 'OP': 'LOAD'} {'src': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}} {'32': 21829} 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 */
src/Numeric/Nat/DivMod.agda
L-TChen/agda-prelude
111
13411
-- Evidence producing divmod. module Numeric.Nat.DivMod where open import Prelude open import Control.WellFounded open import Tactic.Nat open import Tactic.Nat.Reflect open import Tactic.Nat.Exp open import Numeric.Nat.Properties private lemModAux′ : ∀ k m b j → modAux k m (suc j + b) j ≡ modAux 0 m b m lemModAux′ k m b zero = refl lemModAux′ k m b (suc j) = lemModAux′ (suc k) m b j lemModAux : ∀ k m b j → modAux k m (suc b + j) j ≡ modAux 0 m b m lemModAux k m b j = (λ z → modAux k m (suc z) j) $≡ auto ⟨≡⟩ lemModAux′ k m b j lemDivAux′ : ∀ k m b j → divAux k m (suc j + b) j ≡ divAux (suc k) m b m lemDivAux′ k m b zero = refl lemDivAux′ k m b (suc j) = lemDivAux′ k m b j lemDivAux : ∀ k m b j → divAux k m (suc b + j) j ≡ divAux (suc k) m b m lemDivAux k m b j = (λ z → divAux k m (suc z) j) $≡ auto ⟨≡⟩ lemDivAux′ k m b j modLessAux : ∀ k m n j → k + j < suc m → modAux k m n j < suc m modLessAux k m zero j lt = by lt modLessAux k m (suc n) zero _ = modLessAux 0 m n m auto modLessAux k m (suc n) (suc j) lt = modLessAux (suc k) m n j (by lt) modLess : ∀ a b → a mod suc b < suc b modLess a b = fast-diff $ modLessAux 0 b a b auto divAuxGt : ∀ k a b j → a ≤ j → divAux k b a j ≡ k divAuxGt k zero b j lt = refl divAuxGt k (suc a) b zero lt = refute lt divAuxGt k (suc a) b (suc j) lt = divAuxGt k a b j (by lt) modAuxGt : ∀ k a b j → a ≤ j → modAux k b a j ≡ k + a modAuxGt k zero b j lt = auto modAuxGt k (suc a) b zero lt = refute lt modAuxGt k (suc a) b (suc j) lt = by (modAuxGt (suc k) a b j (by lt)) qr-mul : (b q r : Nat) → Nat qr-mul b q r = q * suc b + r divmodAux : ∀ k a b → Acc _<_ a → qr-mul b (divAux k b a b) (modAux 0 b a b) ≡ qr-mul b k a divmodAux k a b wf with compare b a divmodAux k a b wf | greater lt = let leq : a ≤ b leq = by lt in qr-mul b $≡ divAuxGt k a b b leq *≡ modAuxGt 0 a b b leq divmodAux k a .a wf | equal refl = qr-mul a $≡ divAuxGt k a a a (diff! 0) *≡ modAuxGt 0 a a a (diff! 0) divmodAux k ._ b (acc wf) | less (diff! j) = qr-mul b $≡ lemDivAux k b j b *≡ lemModAux 0 b j b ⟨≡⟩ by (divmodAux (suc k) j b (wf j auto)) divmod-spec : ∀ a b′ → let b = suc b′ in a div b * b + a mod b ≡ a divmod-spec a b = eraseEquality (divmodAux 0 a b (wfNat a)) --- Public definitions --- data DivMod (a b : Nat) : Set where qr : ∀ q r → r < b → q * b + r ≡ a → DivMod a b quot : ∀ {a b} → DivMod a b → Nat quot (qr q _ _ _) = q rem : ∀ {a b} → DivMod a b → Nat rem (qr _ r _ _) = r rem-less : ∀ {a b} (d : DivMod a b) → rem d < b rem-less (qr _ _ lt _) = lt quot-rem-sound : ∀ {a b} (d : DivMod a b) → quot d * b + rem d ≡ a quot-rem-sound (qr _ _ _ eq) = eq syntax divMod b a = a divmod b divMod : ∀ b {{_ : NonZero b}} a → DivMod a b divMod zero {{}} a divMod (suc b) a = qr (a div suc b) (a mod suc b) (modLess a b) (divmod-spec a b) {-# INLINE divMod #-} --- Properties --- mod-less : ∀ b {{_ : NonZero b}} a → a mod b < b mod-less zero {{}} _ mod-less (suc b) a = rem-less (a divmod suc b) divmod-sound : ∀ b {{_ : NonZero b}} a → (a div b) * b + a mod b ≡ a divmod-sound zero {{}} _ divmod-sound (suc b) a = quot-rem-sound (a divmod suc b) private divmod-unique′ : (b q₁ q₂ r₁ r₂ : Nat) → r₁ < b → r₂ < b → q₁ * b + r₁ ≡ q₂ * b + r₂ → q₁ ≡ q₂ × r₁ ≡ r₂ divmod-unique′ b zero zero r₁ r₂ lt₁ lt₂ eq = refl , eq divmod-unique′ b zero (suc q₂) ._ r₂ lt₁ lt₂ refl = refute lt₁ divmod-unique′ b (suc q₁) zero r₁ ._ lt₁ lt₂ refl = refute lt₂ divmod-unique′ b (suc q₁) (suc q₂) r₁ r₂ lt₁ lt₂ eq = first (cong suc) $ divmod-unique′ b q₁ q₂ r₁ r₂ lt₁ lt₂ (by eq) divmod-unique : ∀ {a b} (d₁ d₂ : DivMod a b) → quot d₁ ≡ quot d₂ × rem d₁ ≡ rem d₂ divmod-unique (qr q₁ r₁ lt₁ eq₁) (qr q₂ r₂ lt₂ eq₂) = case divmod-unique′ _ q₁ q₂ r₁ r₂ lt₁ lt₂ (eq₁ ⟨≡⟩ʳ eq₂) of λ p → eraseEquality (fst p) , eraseEquality (snd p) quot-unique : ∀ {a b} (d₁ d₂ : DivMod a b) → quot d₁ ≡ quot d₂ quot-unique d₁ d₂ = fst (divmod-unique d₁ d₂) rem-unique : ∀ {a b} (d₁ d₂ : DivMod a b) → rem d₁ ≡ rem d₂ rem-unique d₁ d₂ = snd (divmod-unique d₁ d₂) instance ShowDivMod : ∀ {a b} → Show (DivMod a b) showsPrec {{ShowDivMod {a} {b}}} p (qr q r _ _) = showParen (p >? 0) $ shows a ∘ showString " == " ∘ shows q ∘ showString " * " ∘ shows b ∘ showString " + " ∘ shows r
oeis/021/A021284.asm
neoneye/loda-programs
11
163710
<filename>oeis/021/A021284.asm ; A021284: Expansion of 1/((1-x)(1-2x)(1-9x)(1-10x)). ; Submitted by <NAME> ; 1,22,335,4400,53481,620202,6970675,76624900,828512861,8845504382,93498427815,980374738200,10212261530641,105799242660562,1091082072825755,11208627544304300,114766536787594821,1171787719977176742,11934978368683348495,121303694207038763200,1230622136752237233401,12464488119659022940922,126069281965820093260035,1273512426581269724034900,12850500728120316396814381,129543395441971736443441102,1304779447866634516846304375,13131903919688599540438519400,132076024166086284752701345761 mov $1,1 mov $3,2 lpb $0 sub $0,1 mul $1,9 sub $2,1 mul $3,5 add $3,2 sub $3,$2 add $1,$3 mul $2,2 sub $2,2 mul $3,2 lpe mov $0,$1
source/RRun/RRun.applescript
uribo/popclip-extentions
1
4052
tell application "R" activate cmd "{popclip text}" end tell
oeis/281/A281228.asm
neoneye/loda-programs
11
246190
<reponame>neoneye/loda-programs<gh_stars>10-100 ; A281228: Expansion of (Sum_{k>=0} x^(3^k))^2 [even terms only]. ; 0,1,2,1,0,2,2,0,0,1,0,0,0,0,2,2,0,0,2,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,2,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 mov $2,$0 mul $0,3 bin $0,$2 div $0,3 mod $0,3
library/fmGUI_ManageSecurity/fmGUI_ManageSecurity_PrivSet_Select.applescript
NYHTC/applescript-fm-helper
1
164
<reponame>NYHTC/applescript-fm-helper -- fmGUI_ManageSecurity_PrivSet_Select({privSetName:"Developer", fullAccessAccountName:"admin", fullAccessPassword:""}) -- <NAME>, NYHTC -- select the specified privilege set (* HISTORY: 2020-03-04 ( dshockley ): Standardized version. Corrected Requires block. 1.1.1 - 2017-09-06 ( eshagdar ): updated error message. added version to handler 1.1 - 2017-07-06 ( eshagdar ): convert params to record. use try-blcok instead of checking for existence. 1.0 - first created REQUIRES: fmGUI_AppFrontMost fmGUI_ManageSecurity_GoToTab_PrivSets *) on run fmGUI_ManageSecurity_PrivSet_Select({privSetName:"Developer", fullAccessAccountName:"admin", fullAccessPassword:""}) end run -------------------- -- START OF CODE -------------------- on fmGUI_ManageSecurity_PrivSet_Select(prefs) -- version 2020-03-04-1532 try fmGUI_AppFrontMost() fmGUI_ManageSecurity_GoToTab_PrivSets(prefs) try tell application "System Events" tell application process "FileMaker Pro Advanced" select (first row of (table 1 of scroll area 1 of tab group 1 of window 1) whose name of static text 1 is privSetName of prefs) end tell end tell return true on error return false end try on error errMsg number errNum error "unable to fmGUI_ManageSecurity_PrivSet_Select - " & errMsg number errNum end try end fmGUI_ManageSecurity_PrivSet_Select -------------------- -- END OF CODE -------------------- on fmGUI_AppFrontMost() tell application "htcLib" to fmGUI_AppFrontMost() end fmGUI_AppFrontMost on fmGUI_ManageSecurity_GoToTab_PrivSets(prefs) tell application "htcLib" to fmGUI_ManageSecurity_GoToTab_PrivSets(prefs) end fmGUI_ManageSecurity_GoToTab_PrivSets
src/ui/maps-ui.adb
thindil/steamsky
80
20947
<filename>src/ui/maps-ui.adb -- Copyright (c) 2020-2021 <NAME> <<EMAIL>> -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program 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 General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. with Ada.Characters.Handling; use Ada.Characters.Handling; with Ada.Characters.Latin_1; use Ada.Characters.Latin_1; with Ada.Strings; use Ada.Strings; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Strings.UTF_Encoding.Wide_Strings; use Ada.Strings.UTF_Encoding.Wide_Strings; with Ada.Text_IO; use Ada.Text_IO; with Interfaces.C.Strings; use Interfaces.C.Strings; with GNAT.Directory_Operations; use GNAT.Directory_Operations; with Tcl.Ada; use Tcl.Ada; with Tcl.Tk.Ada; use Tcl.Tk.Ada; with Tcl.Tk.Ada.Grid; with Tcl.Tk.Ada.Pack; with Tcl.Tk.Ada.Widgets; use Tcl.Tk.Ada.Widgets; with Tcl.Tk.Ada.Widgets.Text; use Tcl.Tk.Ada.Widgets.Text; with Tcl.Tk.Ada.Widgets.Toplevel.MainWindow; use Tcl.Tk.Ada.Widgets.Toplevel.MainWindow; with Tcl.Tk.Ada.Widgets.TtkButton; use Tcl.Tk.Ada.Widgets.TtkButton; with Tcl.Tk.Ada.Widgets.TtkEntry.TtkComboBox; use Tcl.Tk.Ada.Widgets.TtkEntry.TtkComboBox; with Tcl.Tk.Ada.Widgets.TtkFrame; use Tcl.Tk.Ada.Widgets.TtkFrame; with Tcl.Tk.Ada.Widgets.TtkLabel; use Tcl.Tk.Ada.Widgets.TtkLabel; with Tcl.Tk.Ada.Widgets.TtkPanedWindow; use Tcl.Tk.Ada.Widgets.TtkPanedWindow; with Tcl.Tk.Ada.Widgets.TtkWidget; use Tcl.Tk.Ada.Widgets.TtkWidget; with Tcl.Tk.Ada.Winfo; use Tcl.Tk.Ada.Winfo; with Tcl.Tk.Ada.Wm; use Tcl.Tk.Ada.Wm; with Tcl.Tklib.Ada.Tooltip; use Tcl.Tklib.Ada.Tooltip; with Bases; use Bases; with Bases.LootUI; with Bases.RecruitUI; with Bases.SchoolUI; with Bases.ShipyardUI; with Bases.UI; with BasesTypes; use BasesTypes; with Config; use Config; with Crafts.UI; with CoreUI; use CoreUI; with Crew; use Crew; with Dialogs; use Dialogs; with DebugUI; use DebugUI; with Factions; use Factions; with GameOptions; with Help.UI; use Help.UI; with Items; use Items; with Knowledge; use Knowledge; with Log; with Maps.UI.Commands; with Messages; use Messages; with Messages.UI; use Messages.UI; with Missions.UI; use Missions.UI; with OrdersMenu; with ShipModules; use ShipModules; with Ships.Cargo; use Ships.Cargo; with Ships.Movement; use Ships.Movement; with Ships.UI; use Ships.UI; with Statistics; use Statistics; with Statistics.UI; with Stories; use Stories; with Trades.UI; with Themes; use Themes; with Utils.UI; use Utils.UI; with WaitMenu; package body Maps.UI is procedure CreateGameMenu is begin Delete(GameMenu, "0", "end"); Menu.Add (GameMenu, "command", "-label {Ship information} -command ShowShipInfo"); Menu.Add (GameMenu, "command", "-label {Ship orders} -command ShowOrders"); Menu.Add(GameMenu, "command", "-label {Crafting} -command ShowCrafting"); Menu.Add (GameMenu, "command", "-label {Last messages} -command ShowLastMessages"); Menu.Add (GameMenu, "command", "-label {Knowledge lists} -command ShowKnowledge"); Menu.Add(GameMenu, "command", "-label {Wait orders} -command ShowWait"); Menu.Add (GameMenu, "command", "-label {Game statistics} -command ShowStats"); Menu.Add (GameMenu, "command", "-label {Help} -command {ShowHelp general}"); Menu.Add (GameMenu, "command", "-label {Game options} -command ShowOptions"); Menu.Add (GameMenu, "command", "-label {Quit from game} -command QuitGame"); Menu.Add (GameMenu, "command", "-label {Resign from game} -command ResignGame"); Menu.Add(GameMenu, "command", "-label Close -accelerator Escape"); Set_Accelerators_Loop : for I in MenuAccelerators'Range loop Entry_Configure (GameMenu, Natural'Image(I - 1), "-accelerator {" & To_String(MenuAccelerators(I)) & "}"); end loop Set_Accelerators_Loop; end CreateGameMenu; procedure UpdateHeader is HaveWorker, HaveGunner: Boolean := True; NeedCleaning, NeedRepairs, NeedWorker, HavePilot, HaveEngineer, HaveTrader, HaveUpgrader, HaveCleaner, HaveRepairman: Boolean := False; ItemAmount: Natural := 0; Label: Ttk_Label := Get_Widget(Game_Header & ".time"); Frame: constant Ttk_Frame := Get_Widget(Main_Paned & ".combat"); begin configure(Label, "-text {" & FormatedTime & "}"); if Game_Settings.Show_Numbers then configure (Label, "-text {" & FormatedTime & " Speed:" & Natural'Image((RealSpeed(Player_Ship) * 60) / 1_000) & " km/h}"); Add(Label, "Game time and current ship speed."); end if; Label.Name := New_String(Game_Header & ".nofuel"); Tcl.Tk.Ada.Grid.Grid_Remove(Label); ItemAmount := GetItemAmount(Fuel_Type); if ItemAmount = 0 then configure(Label, "-style Headerred.TLabel"); Add (Label, "You can't travel anymore, because you don't have any fuel for ship."); Tcl.Tk.Ada.Grid.Grid(Label); elsif ItemAmount <= Game_Settings.Low_Fuel then configure(Label, "-style TLabel"); Add (Label, "Low level of fuel on ship. Only" & Natural'Image(ItemAmount) & " left."); Tcl.Tk.Ada.Grid.Grid(Label); end if; Label.Name := New_String(Game_Header & ".nodrink"); Tcl.Tk.Ada.Grid.Grid_Remove(Label); ItemAmount := GetItemsAmount("Drinks"); if ItemAmount = 0 then configure(Label, "-style Headerred.TLabel"); Add (Label, "You don't have any drinks in ship but your crew needs them to live."); Tcl.Tk.Ada.Grid.Grid(Label); elsif ItemAmount <= Game_Settings.Low_Drinks then configure(Label, "-style TLabel"); Add (Label, "Low level of drinks on ship. Only" & Natural'Image(ItemAmount) & " left."); Tcl.Tk.Ada.Grid.Grid(Label); end if; Label.Name := New_String(Game_Header & ".nofood"); Tcl.Tk.Ada.Grid.Grid_Remove(Label); ItemAmount := GetItemsAmount("Food"); if ItemAmount = 0 then configure(Label, "-style Headerred.TLabel"); Add (Label, "You don't have any food in ship but your crew needs it to live."); Tcl.Tk.Ada.Grid.Grid(Label); elsif ItemAmount <= Game_Settings.Low_Food then configure(Label, "-style TLabel"); Add (Label, "Low level of food on ship. Only" & Natural'Image(ItemAmount) & " left."); Tcl.Tk.Ada.Grid.Grid(Label); end if; for Member of Player_Ship.Crew loop case Member.Order is when Pilot => HavePilot := True; when Engineer => HaveEngineer := True; when Talk => HaveTrader := True; when Upgrading => HaveUpgrader := True; when Clean => HaveCleaner := True; when Repair => HaveRepairman := True; when others => null; end case; end loop; Label.Name := New_String(Game_Header & ".overloaded"); Tcl.Tk.Ada.Grid.Grid_Remove(Label); if HavePilot and (HaveEngineer or Factions_List(Player_Ship.Crew(1).Faction).Flags.Contains (To_Unbounded_String("sentientships"))) and (Winfo_Get(Frame, "exists") = "0" or else (Winfo_Get(Frame, "ismapped") = "0")) then declare type SpeedType is digits 2; Speed: constant SpeedType := (if Player_Ship.Speed /= DOCKED then (SpeedType(RealSpeed(Player_Ship)) / 1_000.0) else (SpeedType(RealSpeed(Player_Ship, True)) / 1_000.0)); begin if Speed < 0.5 then configure(Label, "-style Headerred.TLabel"); Add (Label, "You can't fly with your ship, because it is overloaded."); Tcl.Tk.Ada.Grid.Grid(Label); end if; end; end if; Check_Workers_Loop : for Module of Player_Ship.Modules loop case Modules_List(Module.Proto_Index).MType is when GUN | HARPOON_GUN => if Module.Owner(1) = 0 then HaveGunner := False; elsif Player_Ship.Crew(Module.Owner(1)).Order /= Gunner then HaveGunner := False; end if; when ALCHEMY_LAB .. GREENHOUSE => if Module.Crafting_Index /= Null_Unbounded_String then NeedWorker := True; Check_Owners_Loop : for Owner of Module.Owner loop if Owner = 0 then HaveWorker := False; elsif Player_Ship.Crew(Owner).Order /= Craft then HaveWorker := False; end if; exit Check_Owners_Loop when not HaveWorker; end loop Check_Owners_Loop; end if; when CABIN => if Module.Cleanliness /= Module.Quality then NeedCleaning := True; end if; when others => null; end case; if Module.Durability /= Module.Max_Durability then NeedRepairs := True; end if; end loop Check_Workers_Loop; Label.Name := New_String(Game_Header & ".pilot"); if HavePilot then Tcl.Tk.Ada.Grid.Grid_Remove(Label); else if not Factions_List(Player_Ship.Crew(1).Faction).Flags.Contains (To_Unbounded_String("sentientships")) then configure(Label, "-style Headerred.TLabel"); Add(Label, "No pilot assigned. Ship can't move."); else configure(Label, "-style TLabel"); Add(Label, "No pilot assigned. Ship fly on it own."); end if; Tcl.Tk.Ada.Grid.Grid(Label); end if; Label.Name := New_String(Game_Header & ".engineer"); if HaveEngineer then Tcl.Tk.Ada.Grid.Grid_Remove(Label); else if not Factions_List(Player_Ship.Crew(1).Faction).Flags.Contains (To_Unbounded_String("sentientships")) then configure(Label, "-style Headerred.TLabel"); Add(Label, "No engineer assigned. Ship can't move."); else configure(Label, "-style TLabel"); Add(Label, "No engineer assigned. Ship fly on it own."); end if; Tcl.Tk.Ada.Grid.Grid(Label); end if; Label.Name := New_String(Game_Header & ".gunner"); if HaveGunner then Tcl.Tk.Ada.Grid.Grid_Remove(Label); else configure(Label, "-style Headerred.TLabel"); Add(Label, "One or more guns don't have a gunner."); Tcl.Tk.Ada.Grid.Grid(Label); end if; Label.Name := New_String(Game_Header & ".repairs"); if NeedRepairs then if HaveRepairman then configure(Label, "-style Headergreen.TLabel"); Add(Label, "The ship is being repaired."); else configure(Label, "-style Headerred.TLabel"); Add(Label, "The ship needs repairs but no one is working them."); end if; Tcl.Tk.Ada.Grid.Grid(Label); else Tcl.Tk.Ada.Grid.Grid_Remove(Label); end if; Label.Name := New_String(Game_Header & ".crafting"); if NeedWorker then if HaveWorker then configure(Label, "-style Headergreen.TLabel"); Add(Label, "All crafting orders are being executed."); else configure(Label, "-style Headerred.TLabel"); Add (Label, "You need to assign crew members to begin manufacturing."); end if; Tcl.Tk.Ada.Grid.Grid(Label); else Tcl.Tk.Ada.Grid.Grid_Remove(Label); end if; Label.Name := New_String(Game_Header & ".upgrade"); if Player_Ship.Upgrade_Module > 0 then if HaveUpgrader then configure(Label, "-style Headergreen.TLabel"); Add(Label, "A ship module upgrade in progress."); else configure(Label, "-style Headerred.TLabel"); Add (Label, "A ship module upgrade is in progress but no one is working on it."); end if; Tcl.Tk.Ada.Grid.Grid(Label); else Tcl.Tk.Ada.Grid.Grid_Remove(Label); end if; Label.Name := New_String(Game_Header & ".talk"); if HaveTrader then Tcl.Tk.Ada.Grid.Grid_Remove(Label); elsif SkyMap(Player_Ship.Sky_X, Player_Ship.Sky_Y).BaseIndex > 0 then configure(Label, "-style Headerred.TLabel"); Add(Label, "No trader assigned. You need one to talk/trade."); Tcl.Tk.Ada.Grid.Grid(Label); elsif SkyMap(Player_Ship.Sky_X, Player_Ship.Sky_Y).EventIndex > 0 then if Events_List (SkyMap(Player_Ship.Sky_X, Player_Ship.Sky_Y).EventIndex) .EType = FriendlyShip then configure(Label, "-style Headerred.TLabel"); Add(Label, "No trader assigned. You need one to talk/trade."); Tcl.Tk.Ada.Grid.Grid(Label); else Tcl.Tk.Ada.Grid.Grid_Remove(Label); end if; else Tcl.Tk.Ada.Grid.Grid_Remove(Label); end if; Label.Name := New_String(Game_Header & ".clean"); if NeedCleaning then if HaveCleaner then configure(Label, "-style Headergreen.TLabel"); Add(Label, "Ship is cleaned."); else configure(Label, "-style Headerred.TLabel"); Add(Label, "Ship is dirty but no one is cleaning it."); end if; Tcl.Tk.Ada.Grid.Grid(Label); else Tcl.Tk.Ada.Grid.Grid_Remove(Label); end if; if Player_Ship.Crew(1).Health = 0 then ShowQuestion ("You are dead. Would you like to see your game statistics?", "showstats"); end if; end UpdateHeader; -- ****iv* MUI/MUI.MapView -- FUNCTION -- Text widget with the sky map -- SOURCE MapView: Tk_Text; -- **** procedure DrawMap is MapChar: Wide_Character; EndX, EndY: Integer; MapHeight, MapWidth: Positive; MapTag: Unbounded_String; StoryX, StoryY: Natural := 1; CurrentTheme: constant Theme_Record := Themes_List(To_String(Game_Settings.Interface_Theme)); begin configure(MapView, "-state normal"); Delete(MapView, "1.0", "end"); MapHeight := Positive'Value(cget(MapView, "-height")); MapWidth := Positive'Value(cget(MapView, "-width")); StartY := CenterY - (MapHeight / 2); StartX := CenterX - (MapWidth / 2); EndY := CenterY + (MapHeight / 2); EndX := CenterX + (MapWidth / 2); if StartY < 1 then StartY := 1; EndY := MapHeight; end if; if StartX < 1 then StartX := 1; EndX := MapWidth; end if; if EndY > 1_024 then EndY := 1_024; StartY := 1_025 - MapHeight; end if; if EndX > 1_024 then EndX := 1_024; StartX := 1_025 - MapWidth; end if; if CurrentStory.Index /= Null_Unbounded_String then GetStoryLocation(StoryX, StoryY); if StoryX = Player_Ship.Sky_X and StoryY = Player_Ship.Sky_Y then StoryX := 0; StoryY := 0; end if; end if; if Player_Ship.Speed = DOCKED and SkyMap(Player_Ship.Sky_X, Player_Ship.Sky_Y).BaseIndex = 0 then Player_Ship.Speed := Ships.FULL_STOP; end if; Draw_Map_Loop : for Y in StartY .. EndY loop for X in StartX .. EndX loop MapTag := Null_Unbounded_String; if X = Player_Ship.Sky_X and Y = Player_Ship.Sky_Y then MapChar := CurrentTheme.Player_Ship_Icon; else MapChar := CurrentTheme.Empty_Map_Icon; MapTag := (if SkyMap(X, Y).Visited then To_Unbounded_String("black") else To_Unbounded_String("unvisited gray")); if X = Player_Ship.Destination_X and Y = Player_Ship.Destination_Y then MapChar := CurrentTheme.Target_Icon; MapTag := (if SkyMap(X, Y).Visited then Null_Unbounded_String else To_Unbounded_String("unvisited")); elsif CurrentStory.Index /= Null_Unbounded_String and then (X = StoryX and Y = StoryY) then MapChar := CurrentTheme.Story_Icon; MapTag := To_Unbounded_String("green"); elsif SkyMap(X, Y).MissionIndex > 0 then case AcceptedMissions(SkyMap(X, Y).MissionIndex).MType is when Deliver => MapChar := CurrentTheme.Deliver_Icon; MapTag := To_Unbounded_String("yellow"); when Destroy => MapChar := CurrentTheme.Destroy_Icon; MapTag := To_Unbounded_String("red"); when Patrol => MapChar := CurrentTheme.Patrol_Icon; MapTag := To_Unbounded_String("lime"); when Explore => MapChar := CurrentTheme.Explore_Icon; MapTag := To_Unbounded_String("green"); when Passenger => MapChar := CurrentTheme.Passenger_Icon; MapTag := To_Unbounded_String("cyan"); end case; if not SkyMap(X, Y).Visited then Append(MapTag, " unvisited"); end if; elsif SkyMap(X, Y).EventIndex > 0 then if SkyMap(X, Y).EventIndex > Events_List.Last_Index then SkyMap(X, Y).EventIndex := 0; else case Events_List(SkyMap(X, Y).EventIndex).EType is when EnemyShip => MapChar := CurrentTheme.Enemy_Ship_Icon; MapTag := To_Unbounded_String("red"); when AttackOnBase => MapChar := CurrentTheme.Attack_On_Base_Icon; MapTag := To_Unbounded_String("red2"); when EnemyPatrol => MapChar := CurrentTheme.Enemy_Patrol_Icon; MapTag := To_Unbounded_String("red3"); when Disease => MapChar := CurrentTheme.Disease_Icon; MapTag := To_Unbounded_String("yellow"); when FullDocks => MapChar := CurrentTheme.Full_Docks_Icon; MapTag := To_Unbounded_String("cyan"); when DoublePrice => MapChar := CurrentTheme.Double_Price_Icon; MapTag := To_Unbounded_String("lime"); when Trader => MapChar := CurrentTheme.Trader_Icon; MapTag := To_Unbounded_String("green"); when FriendlyShip => MapChar := CurrentTheme.Friendly_Ship_Icon; MapTag := To_Unbounded_String("green2"); when others => null; end case; end if; if not SkyMap(X, Y).Visited then Append(MapTag, " unvisited"); end if; elsif SkyMap(X, Y).BaseIndex > 0 then MapChar := CurrentTheme.Not_Visited_Base_Icon; if Sky_Bases(SkyMap(X, Y).BaseIndex).Known then if Sky_Bases(SkyMap(X, Y).BaseIndex).Visited.Year > 0 then MapChar := Factions_List (Sky_Bases(SkyMap(X, Y).BaseIndex).Owner) .BaseIcon; MapTag := Sky_Bases(SkyMap(X, Y).BaseIndex).Base_Type; else MapTag := To_Unbounded_String("unvisited"); end if; else MapTag := To_Unbounded_String("unvisited gray"); end if; end if; end if; Insert (MapView, "end", Encode("" & MapChar) & " [list " & To_String(MapTag) & "]"); end loop; if Y < EndY then Insert(MapView, "end", "{" & LF & "}"); end if; end loop Draw_Map_Loop; configure(MapView, "-state disable"); end DrawMap; procedure UpdateMapInfo (X: Positive := Player_Ship.Sky_X; Y: Positive := Player_Ship.Sky_Y) is MapInfoText, EventInfoText: Unbounded_String; MapInfo: constant Ttk_Label := Get_Widget(Main_Paned & ".mapframe.info.info"); EventInfo: constant Ttk_Label := Get_Widget(Main_Paned & ".mapframe.info.eventinfo"); begin Append (MapInfoText, "X:" & Positive'Image(X) & " Y:" & Positive'Image(Y)); if Player_Ship.Sky_X /= X or Player_Ship.Sky_Y /= Y then declare Distance: constant Positive := CountDistance(X, Y); begin Append(MapInfoText, LF & "Distance:" & Positive'Image(Distance)); Travel_Info(MapInfoText, Distance); end; end if; if SkyMap(X, Y).BaseIndex > 0 then declare BaseIndex: constant Bases_Range := SkyMap(X, Y).BaseIndex; begin if Sky_Bases(BaseIndex).Known then Append (MapInfoText, LF & "Base info:" & LF & To_Unbounded_String("Name: ") & Sky_Bases(BaseIndex).Name); end if; if Sky_Bases(BaseIndex).Visited.Year > 0 then Append (MapInfoText, LF & "Type: " & To_String (Bases_Types_List(Sky_Bases(BaseIndex).Base_Type).Name)); if Sky_Bases(BaseIndex).Population > 0 then Append(MapInfoText, LF); end if; if Sky_Bases(BaseIndex).Population > 0 and Sky_Bases(BaseIndex).Population < 150 then Append(MapInfoText, "Population: small"); elsif Sky_Bases(BaseIndex).Population > 149 and Sky_Bases(BaseIndex).Population < 300 then Append(MapInfoText, "Population: medium"); elsif Sky_Bases(BaseIndex).Population > 299 then Append(MapInfoText, "Population: large"); end if; Append (MapInfoText, LF & "Size: " & To_Lower(Bases_Size'Image(Sky_Bases(BaseIndex).Size)) & LF); if Sky_Bases(BaseIndex).Population > 0 then Append (MapInfoText, "Owner: " & To_String (Factions_List(Sky_Bases(BaseIndex).Owner).Name)); else Append(MapInfoText, "Base is abandoned"); end if; if Sky_Bases(BaseIndex).Population > 0 then Append(MapInfoText, LF); case Sky_Bases(BaseIndex).Reputation(1) is when -100 .. -75 => Append(MapInfoText, "You are hated here"); when -74 .. -50 => Append(MapInfoText, "You are outlawed here"); when -49 .. -25 => Append(MapInfoText, "You are disliked here"); when -24 .. -1 => Append(MapInfoText, "They are unfriendly to you"); when 0 => Append(MapInfoText, "You are unknown here"); when 1 .. 25 => Append(MapInfoText, "You are know here as visitor"); when 26 .. 50 => Append(MapInfoText, "You are know here as trader"); when 51 .. 75 => Append(MapInfoText, "You are know here as friend"); when 76 .. 100 => Append(MapInfoText, "You are well known here"); when others => null; end case; end if; if BaseIndex = Player_Ship.Home_Base then Append(MapInfoText, LF & "It is your home base"); end if; end if; end; end if; if SkyMap(X, Y).EventIndex > 0 then declare EventIndex: constant Events_Container.Extended_Index := SkyMap(X, Y).EventIndex; begin if Events_List(EventIndex).EType /= BaseRecovery then Append(EventInfoText, LF); end if; case Events_List(EventIndex).EType is when EnemyShip | Trader | FriendlyShip => Append (EventInfoText, Proto_Ships_List(Events_List(EventIndex).ShipIndex).Name); when FullDocks => Append(EventInfoText, "Full docks in base"); when AttackOnBase => Append(EventInfoText, "Base is under attack"); when Disease => Append(EventInfoText, "Disease in base"); when EnemyPatrol => Append(EventInfoText, "Enemy patrol"); when DoublePrice => Append (EventInfoText, "Double price for " & To_String (Items_List(Events_List(EventIndex).ItemIndex).Name)); when None | BaseRecovery => null; end case; if Events_List(EventIndex).EType in DoublePrice | FriendlyShip | Trader then configure (EventInfo, "-text {" & To_String(EventInfoText) & "} -style MapInfoGreen.TLabel"); else configure (EventInfo, "-text {" & To_String(EventInfoText) & "} -style MapInfoRed.TLabel"); end if; end; end if; if SkyMap(X, Y).MissionIndex > 0 then declare MissionIndex: constant Mission_Container.Extended_Index := SkyMap(X, Y).MissionIndex; begin Append(MapInfoText, LF); if SkyMap(X, Y).BaseIndex > 0 or SkyMap(X, Y).EventIndex > 0 then Append(MapInfoText, LF); end if; case AcceptedMissions(MissionIndex).MType is when Deliver => Append (MapInfoText, "Deliver " & To_String (Items_List(AcceptedMissions(MissionIndex).ItemIndex) .Name)); when Destroy => Append (MapInfoText, "Destroy " & To_String (Proto_Ships_List (AcceptedMissions(MissionIndex).ShipIndex) .Name)); when Patrol => Append(MapInfoText, "Patrol area"); when Explore => Append(MapInfoText, "Explore area"); when Passenger => Append(MapInfoText, "Transport passenger"); end case; end; end if; if CurrentStory.Index /= Null_Unbounded_String then declare StoryX, StoryY: Natural := 1; FinishCondition: StepConditionType; begin GetStoryLocation(StoryX, StoryY); if StoryX = Player_Ship.Sky_X and StoryY = Player_Ship.Sky_Y then StoryX := 0; StoryY := 0; end if; if X = StoryX and Y = StoryY then FinishCondition := (if CurrentStory.CurrentStep = 0 then Stories_List(CurrentStory.Index).StartingStep .FinishCondition elsif CurrentStory.CurrentStep > 0 then Stories_List(CurrentStory.Index).Steps (CurrentStory.CurrentStep) .FinishCondition else Stories_List(CurrentStory.Index).FinalStep .FinishCondition); if FinishCondition in ASKINBASE | DESTROYSHIP | EXPLORE then Append(MapInfoText, LF & "Story leads you here"); end if; end if; end; end if; if X = Player_Ship.Sky_X and Y = Player_Ship.Sky_Y then Append(MapInfoText, LF & "You are here"); end if; configure(MapInfo, "-text {" & To_String(MapInfoText) & "}"); if EventInfoText /= Null_Unbounded_String then Tcl.Tk.Ada.Grid.Grid(EventInfo, "-sticky nwes"); else Tcl.Tk.Ada.Grid.Grid_Remove(EventInfo); end if; end UpdateMapInfo; procedure UpdateMoveButtons is MoveButtonsNames: constant array(1 .. 8) of Unbounded_String := (To_Unbounded_String("nw"), To_Unbounded_String("n"), To_Unbounded_String("ne"), To_Unbounded_String("w"), To_Unbounded_String("e"), To_Unbounded_String("sw"), To_Unbounded_String("s"), To_Unbounded_String("se")); MoveButtonsTooltips: constant array(1 .. 8) of Unbounded_String := (To_Unbounded_String("Move ship north and west"), To_Unbounded_String("Move ship north"), To_Unbounded_String("Move ship north and east"), To_Unbounded_String("Move ship west"), To_Unbounded_String("Move ship east"), To_Unbounded_String("Move ship south and west"), To_Unbounded_String("Move ship south"), To_Unbounded_String("Move ship south and east")); Button: Ttk_Button; FrameName: constant String := Main_Paned & ".controls.buttons"; Speedbox: constant Ttk_ComboBox := Get_Widget(FrameName & ".speed"); begin Button.Interp := Get_Context; if Player_Ship.Speed = DOCKED then Tcl.Tk.Ada.Grid.Grid_Remove(Speedbox); Button.Name := New_String(FrameName & ".moveto"); Tcl.Tk.Ada.Grid.Grid_Remove(Button); Button.Name := New_String(FrameName & ".wait"); configure(Button, "-text Wait"); Add(Button, "Wait 1 minute."); Disable_Move_Buttons_Loop : for ButtonName of MoveButtonsNames loop Button.Name := New_String(FrameName & "." & To_String(ButtonName)); State(Button, "disabled"); Add (Button, "You have to give order 'Undock' from\nMenu->Ship orders first to move ship."); end loop Disable_Move_Buttons_Loop; else Current (Speedbox, Natural'Image(Ship_Speed'Pos(Player_Ship.Speed) - 1)); Tcl.Tk.Ada.Grid.Grid(Speedbox); if Player_Ship.Destination_X > 0 and Player_Ship.Destination_Y > 0 then Button.Name := New_String(FrameName & ".moveto"); Tcl.Tk.Ada.Grid.Grid(Button); Tcl.Tk.Ada.Grid.Grid_Configure(Speedbox, "-columnspan 2"); Button.Name := New_String(FrameName & ".wait"); configure(Button, "-text Move"); Add(Button, "Move ship one map field toward destination."); Tcl.Tk.Ada.Grid.Grid(Button); else Button.Name := New_String(FrameName & ".moveto"); Tcl.Tk.Ada.Grid.Grid_Remove(Button); Tcl.Tk.Ada.Grid.Grid_Configure(Speedbox, "-columnspan 3"); Button.Name := New_String(FrameName & ".wait"); configure(Button, "-text Wait"); Add(Button, "Wait 1 minute."); end if; Enable_Move_Buttons_Loop : for I in MoveButtonsNames'Range loop Button.Name := New_String(FrameName & "." & To_String(MoveButtonsNames(I))); State(Button, "!disabled"); Add(Button, To_String(MoveButtonsTooltips(I))); end loop Enable_Move_Buttons_Loop; end if; end UpdateMoveButtons; procedure CreateGameUI is use Log; GameFrame: constant Ttk_Frame := Get_Widget(".gameframe"); Paned: constant Ttk_PanedWindow := Get_Widget(GameFrame & ".paned"); Button: constant Ttk_Button := Get_Widget(Paned & ".mapframe.buttons.hide"); SteamSky_Map_Error: exception; Header: constant Ttk_Frame := Get_Widget(GameFrame & ".header"); MessagesFrame: constant Ttk_Frame := Get_Widget(Paned & ".controls.messages"); PanedPosition: Natural; begin GameMenu := Get_Widget(".gamemenu"); MapView := Get_Widget(Paned & ".mapframe.map"); if Winfo_Get(GameMenu, "exists") = "0" then declare KeysFile: File_Type; begin Open(KeysFile, In_File, To_String(Save_Directory) & "keys.cfg"); Set_Menu_Accelerators_Loop : for Key of MenuAccelerators loop Key := To_Unbounded_String(Get_Line(KeysFile)); end loop Set_Menu_Accelerators_Loop; Set_Map_Accelerators_Loop : for Key of MapAccelerators loop Key := To_Unbounded_String(Get_Line(KeysFile)); end loop Set_Map_Accelerators_Loop; FullScreenAccel := To_Unbounded_String(Get_Line(KeysFile)); Close(KeysFile); exception when others => if Dir_Separator = '\' then MapAccelerators(5) := To_Unbounded_String(Source => "Home"); MapAccelerators(6) := To_Unbounded_String(Source => "Up"); MapAccelerators(7) := To_Unbounded_String(Source => "Prior"); MapAccelerators(8) := To_Unbounded_String(Source => "Left"); MapAccelerators(9) := To_Unbounded_String(Source => "Clear"); MapAccelerators(10) := To_Unbounded_String(Source => "Right"); MapAccelerators(11) := To_Unbounded_String(Source => "End"); MapAccelerators(12) := To_Unbounded_String(Source => "Down"); MapAccelerators(13) := To_Unbounded_String(Source => "Next"); MapAccelerators(14) := To_Unbounded_String(Source => "slash"); MapAccelerators(17) := To_Unbounded_String(Source => "Shift-Home"); MapAccelerators(18) := To_Unbounded_String(Source => "Shift-Up"); MapAccelerators(19) := To_Unbounded_String(Source => "Shift-Prior"); MapAccelerators(20) := To_Unbounded_String(Source => "Shift-Left"); MapAccelerators(21) := To_Unbounded_String(Source => "Shift-Right"); MapAccelerators(22) := To_Unbounded_String(Source => "Shift-End"); MapAccelerators(23) := To_Unbounded_String(Source => "Shift-Down"); MapAccelerators(24) := To_Unbounded_String(Source => "Shift-Next"); MapAccelerators(25) := To_Unbounded_String(Source => "Control-Home"); MapAccelerators(26) := To_Unbounded_String(Source => "Control-Up"); MapAccelerators(27) := To_Unbounded_String(Source => "Control-Prior"); MapAccelerators(28) := To_Unbounded_String(Source => "Control-Left"); MapAccelerators(29) := To_Unbounded_String(Source => "Control-Right"); MapAccelerators(30) := To_Unbounded_String(Source => "Control-End"); MapAccelerators(31) := To_Unbounded_String(Source => "Control-Down"); MapAccelerators(32) := To_Unbounded_String(Source => "Control-Next"); end if; end; Tcl_EvalFile (Get_Context, To_String(Data_Directory) & "ui" & Dir_Separator & "game.tcl"); Main_Paned := Paned; Game_Header := Header; Close_Button := Get_Widget(Game_Header & ".closebutton"); Set_Theme; OrdersMenu.AddCommands; Maps.UI.Commands.AddCommands; WaitMenu.AddCommands; Help.UI.AddCommands; Ships.UI.AddCommands; Crafts.UI.AddCommands; Messages.UI.AddCommands; GameOptions.AddCommands; Trades.UI.AddCommands; SchoolUI.AddCommands; RecruitUI.AddCommands; Bases.UI.AddCommands; ShipyardUI.AddCommands; LootUI.AddCommands; Knowledge.AddCommands; Missions.UI.AddCommands; Statistics.UI.AddCommands; Bind(MessagesFrame, "<Configure>", "ResizeLastMessages"); Bind(MapView, "<Configure>", "DrawMap"); Bind(MapView, "<Motion>", "{UpdateMapInfo %x %y}"); Bind (MapView, "<Button-" & (if Game_Settings.Right_Button then "3" else "1") & ">", "{ShowDestinationMenu %X %Y}"); Bind (MapView, "<MouseWheel>", "{if {%D > 0} {ZoomMap raise} else {ZoomMap lower}}"); Bind(MapView, "<Button-4>", "{ZoomMap raise}"); Bind(MapView, "<Button-5>", "{ZoomMap lower}"); SetKeys; if Log.Debug_Mode = Log.MENU then ShowDebugUI; end if; else Tcl.Tk.Ada.Pack.Pack(GameFrame, "-fill both -expand true"); end if; Wm_Set(Get_Main_Window(Get_Context), "title", "{Steam Sky}"); if Game_Settings.Full_Screen then Wm_Set(Get_Main_Window(Get_Context), "attributes", "-fullscreen 1"); end if; CreateGameMenu; Set_Accelerators_Loop : for I in MenuAccelerators'Range loop Bind_To_Main_Window (Get_Context, "<" & To_String (Insert (MenuAccelerators(I), Index(MenuAccelerators(I), "-", Backward) + 1, "KeyPress-")) & ">", "{InvokeMenu " & To_String(MenuAccelerators(I)) & "}"); Bind (GameMenu, "<" & To_String (Insert (MenuAccelerators(I), Index(MenuAccelerators(I), "-", Backward) + 1, "KeyPress-")) & ">", "{InvokeMenu " & To_String(MenuAccelerators(I)) & "}"); end loop Set_Accelerators_Loop; Bind(GameMenu, "<KeyPress-Escape>", "{InvokeMenu 12}"); if Index (Tcl.Tk.Ada.Grid.Grid_Slaves(Get_Main_Window(Get_Context)), ".gameframe.header") = 0 then Tcl.Tk.Ada.Grid.Grid(Header); end if; UpdateHeader; CenterX := Player_Ship.Sky_X; CenterY := Player_Ship.Sky_Y; Set_Tags_Loop : for I in Bases_Types_List.Iterate loop Tag_Configure (MapView, To_String(BasesTypes_Container.Key(I)), "-foreground #" & Bases_Types_List(I).Color); end loop Set_Tags_Loop; PanedPosition := (if Game_Settings.Window_Height - Game_Settings.Messages_Position < 0 then Game_Settings.Window_Height else Game_Settings.Window_Height - Game_Settings.Messages_Position); SashPos(Paned, "0", Natural'Image(PanedPosition)); if Index (Tcl.Tk.Ada.Grid.Grid_Slaves(Get_Main_Window(Get_Context)), ".gameframe.paned") = 0 then Tcl.Tk.Ada.Grid.Grid(Paned); end if; if Invoke(Button) /= "" then raise SteamSky_Map_Error with "Can't hide map buttons"; end if; Bind_To_Main_Window (Get_Context, "<Escape>", "{InvokeButton " & Close_Button & "}"); Update_Messages; UpdateMoveButtons; UpdateMapInfo; if not Game_Settings.Show_Last_Messages then Tcl.Tk.Ada.Grid.Grid_Remove(MessagesFrame); end if; Tcl_SetVar(Get_Context, "shipname", To_String(Player_Ship.Name)); end CreateGameUI; procedure ShowSkyMap(Clear: Boolean := False) is begin if Clear then Show_Screen("mapframe"); end if; UpdateHeader; Tcl_Eval(Get_Context, "DrawMap"); UpdateMoveButtons; Tcl_Eval(Get_Context, "update"); Update_Messages; if CurrentStory.Index /= Null_Unbounded_String and CurrentStory.ShowText then if CurrentStory.CurrentStep > -2 then ShowInfo(Text => To_String(GetCurrentStoryText), Title => "Story"); else FinishStory; if Player_Ship.Crew(1).Health = 0 then ShowQuestion ("You are dead. Would you like to see your game statistics?", "showstats"); end if; end if; CurrentStory.ShowText := False; end if; end ShowSkyMap; procedure SetKeys is Commands: constant array(MapAccelerators'Range) of Unbounded_String := (To_Unbounded_String ("{if {[winfo class [focus]] != {TEntry} && [tk busy status " & Game_Header & "] == 0} {tk_popup " & GameMenu & " %X %Y}}"), To_Unbounded_String ("{" & Main_Paned & ".mapframe.buttons.wait invoke}"), To_Unbounded_String("{ZoomMap raise}"), To_Unbounded_String("{ZoomMap lower}"), To_Unbounded_String("{InvokeButton $bframe.nw}"), To_Unbounded_String("{InvokeButton $bframe.n}"), To_Unbounded_String("{InvokeButton $bframe.ne}"), To_Unbounded_String("{InvokeButton $bframe.w}"), To_Unbounded_String("{InvokeButton $bframe.wait}"), To_Unbounded_String("{InvokeButton $bframe.e}"), To_Unbounded_String("{InvokeButton $bframe.sw}"), To_Unbounded_String("{InvokeButton $bframe.s}"), To_Unbounded_String("{InvokeButton $bframe.se}"), To_Unbounded_String("{InvokeButton $bframe.moveto}"), To_Unbounded_String("{MoveMap centeronship}"), To_Unbounded_String("{MoveMap centeronhome}"), To_Unbounded_String("{MoveMap nw}"), To_Unbounded_String("{MoveMap n}"), To_Unbounded_String("{MoveMap ne}"), To_Unbounded_String("{MoveMap w}"), To_Unbounded_String("{MoveMap e}"), To_Unbounded_String("{MoveMap sw}"), To_Unbounded_String("{MoveMap s}"), To_Unbounded_String("{MoveMap se}"), To_Unbounded_String("{MoveCursor nw %x %y}"), To_Unbounded_String("{MoveCursor n %x %y}"), To_Unbounded_String("{MoveCursor ne %x %y}"), To_Unbounded_String("{MoveCursor w %x %y}"), To_Unbounded_String("{MoveCursor e %x %y}"), To_Unbounded_String("{MoveCursor sw %x %y}"), To_Unbounded_String("{MoveCursor s %x %y}"), To_Unbounded_String("{MoveCursor se %x %y}"), To_Unbounded_String("{MoveCursor click %x %y}"), To_Unbounded_String ("{" & Main_Paned & ".controls.buttons.speed current 0}"), To_Unbounded_String ("{" & Main_Paned & ".controls.buttons.speed current 1}"), To_Unbounded_String ("{" & Main_Paned & ".controls.buttons.speed current 2}"), To_Unbounded_String ("{" & Main_Paned & ".controls.buttons.speed current 3}")); begin for I in Commands'Range loop Bind_To_Main_Window (Get_Context, "<" & To_String (Insert (MapAccelerators(I), Index(MapAccelerators(I), "-", Backward) + 1, "KeyPress-")) & ">", To_String(Commands(I))); end loop; Bind_To_Main_Window (Get_Context, "<" & To_String (Insert (FullScreenAccel, Index(FullScreenAccel, "-", Backward) + 1, "KeyPress-")) & ">", "{ToggleFullScreen}"); end SetKeys; procedure FinishStory is begin GameStats.Points := GameStats.Points + (10_000 * CurrentStory.MaxSteps); ClearCurrentStory; ShowQuestion (To_String(Stories_List(CurrentStory.Index).EndText) & " Are you want to finish game?", "retire"); end FinishStory; end Maps.UI;
oeis/117/A117475.asm
neoneye/loda-programs
11
3071
; A117475: The values of c in a^2 + b^2 = c^2 where b - a = 23 and gcd(a,b,c) = 1. ; Submitted by <NAME> ; 37,65,205,373,1193,2173,6953,12665,40525,73817,236197,430237,1376657,2507605,8023745,14615393,46765813,85184753,272571133,496493125,1588660985,2893773997,9259394777,16866150857,53967707677,98303131145 mov $2,-3 lpb $0 sub $0,1 add $1,20 mov $3,$0 add $3,10 add $3,$0 mod $3,4 mul $3,$2 add $1,$3 add $2,$1 lpe add $2,$1 mov $0,$2 add $0,40
examples/boxes.asm
KCreate/stackvm
45
13501
<reponame>KCreate/stackvm .def counter_x r0 .def counter_y r1 .def comp r2 .def s_zero r3 .def s_one r4 .label setup .label entry_addr loadi counter_x, vram_width loadi counter_y, vram_height rst s_zero loadi s_one, 1 sub counter_x, s_one sub counter_y, s_one push dword, msg_welcome push dword, 29 push word, sys_write syscall push dword, msg_sleep push dword, 26 push word, sys_write syscall push float, 3.0 push word, sys_sleep syscall jmp main .label main rpush counter_x rpush counter_y push byte, 0b11100011 push dword, 9 call gfx_draw_pixel jmp check_zero_reached1 .label check_zero_reached1 cmp counter_x, s_zero jz check_zero_reached2 jmp loop .label check_zero_reached2 cmp counter_y, s_zero jz quit_program jmp loop .label loop cmp counter_x, s_zero jz br1 sub counter_x, s_one jmp br2 .label br1 sub counter_y, s_one loadi counter_x, vram_width sub counter_x, s_one .label br2 jmp main .label quit_program push byte, 0 push word, sys_exit syscall .db msg_welcome 29 "welcome to the graphics demo\n" .db msg_sleep 26 "sleeping for 3 seconds...\n" .include "graphics.asm"
src/Assembly.asm
Muetzilla/hello-world
1
95215
section .text global _start _start: mov edx, len mov ecx, msg mov ebx, 1 mov eax, 4 int 0x80 mov eax, 1 int 0x80 section .data msg db 'Hello, Assembly!',0xa len equ $ - msg
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_2626.asm
ljhsiun2/medusa
9
244745
<reponame>ljhsiun2/medusa .global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r13 push %rax push %rbp push %rcx push %rdi push %rsi lea addresses_UC_ht+0x109e9, %rcx inc %rbp vmovups (%rcx), %ymm7 vextracti128 $0, %ymm7, %xmm7 vpextrq $1, %xmm7, %r11 and %rax, %rax lea addresses_UC_ht+0x7fff, %rsi lea addresses_normal_ht+0x15429, %rdi nop nop nop nop nop add %r13, %r13 mov $69, %rcx rep movsl nop nop nop nop nop cmp $8915, %r11 lea addresses_UC_ht+0x3c29, %rcx nop nop nop nop nop cmp $60973, %rbp mov $0x6162636465666768, %r11 movq %r11, (%rcx) nop nop nop nop dec %rbp lea addresses_D_ht+0x5b30, %r13 nop nop nop add %rax, %rax mov $0x6162636465666768, %r11 movq %r11, %xmm6 movups %xmm6, (%r13) nop nop nop sub %r11, %r11 lea addresses_WT_ht+0x829, %rcx nop nop nop xor %rsi, %rsi mov (%rcx), %r11d nop add %rcx, %rcx lea addresses_UC_ht+0x7619, %rbp nop nop nop nop sub $53291, %r13 mov $0x6162636465666768, %rdi movq %rdi, %xmm3 vmovups %ymm3, (%rbp) sub $1232, %rax lea addresses_D_ht+0x33a0, %rsi lea addresses_UC_ht+0x17969, %rdi nop nop nop nop nop cmp $25163, %r10 mov $46, %rcx rep movsw nop nop nop sub $49935, %rdi lea addresses_UC_ht+0x1a429, %r11 nop nop nop nop cmp %rax, %rax movw $0x6162, (%r11) nop nop nop nop and %rsi, %rsi pop %rsi pop %rdi pop %rcx pop %rbp pop %rax pop %r13 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r13 push %r15 push %rbx push %rcx push %rdi // Store lea addresses_normal+0x7829, %rcx nop nop nop cmp %r12, %r12 mov $0x5152535455565758, %r11 movq %r11, (%rcx) nop nop nop nop nop add %r11, %r11 // Faulty Load lea addresses_UC+0x6029, %rbx nop nop cmp $46402, %rdi movups (%rbx), %xmm2 vpextrq $1, %xmm2, %r13 lea oracles, %r12 and $0xff, %r13 shlq $12, %r13 mov (%r12,%r13,1), %r13 pop %rdi pop %rcx pop %rbx pop %r15 pop %r13 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 11, 'size': 8, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 6, 'size': 32, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 0, 'same': True}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 8, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 10, 'size': 8, 'same': False, 'NT': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 7, 'size': 4, 'same': False, 'NT': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 4, 'size': 32, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 8, 'size': 2, 'same': False, 'NT': False}} {'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 */
Core/Configuration/BLOManagers/Parser/Grammar.g4
rmitache/OpenConfigurator
8
7286
<filename>Core/Configuration/BLOManagers/Parser/Grammar.g4<gh_stars>1-10 grammar Grammar; @parser::members { protected const int EOF = Eof; } @lexer::members { protected const int EOF = Eof; protected const int HIDDEN = Hidden; } options { buildAST = true; // uses CommonAST by default } /*Parser Rules**********************************************************************************************/ prog: lefthandexpr EQ righthandexpr; // Left-hand lefthandexpr: composite_selector_simple ; composite_selector_simple: feature_selector_abs DOT attribute_selector ; // Right-hand righthandexpr: sumof_function ; sumof_function: 'SumOf' LPAREN composite_selector_advanced RPAREN ; //expr: // expr op=(ADD|SUB) expr # AddSub // | INT # int // | SUMOF_KEYWORD LPAREN composite_selector_advanced RPAREN # SumOf //; composite_selector_advanced: feature_selector_abs DOT feature_selector_rel DOT attribute_selector ; feature_selector_rel: op = (DESCENDANTS_KEYWORD | ANCESTORS_KEYWORD) ; // Common feature_selector_abs : IDENTIFIER | ROOTFEATURE ; attribute_selector: IDENTIFIER ; /**********************************************************************************************************/ /*Lexer Rules**********************************************************************************************/ EQ : '='; ADD : '+'; SUB : '-'; SUMOF_KEYWORD : 'SumOf' ; DESCENDANTS_KEYWORD: '>descendants' ; ANCESTORS_KEYWORD: '>ancestors' ; ROOTFEATURE: '>root' ; IDENTIFIER : IDENTIFIERSTARTCHARACTER IDENTIFIERPARTCHARACTER* ; IDENTIFIERSTARTCHARACTER : [a-z] | [A-Z] | '_' ; IDENTIFIERPARTCHARACTER : [a-z] | [A-Z] | [0-9] | '_' ; DOT : '.'; INT : [0-9]+; LPAREN : '(' ; RPAREN : ')' ; WS : (' ' | '\r' | '\n') -> channel(HIDDEN) ; /**********************************************************************************************************/
test/interaction/Issue1619.agda
shlevy/agda
1,989
14983
<filename>test/interaction/Issue1619.agda -- Andreas, 2015-08-11, issue reported by G.Allais -- The `a` record field of `Pack` is identified as a function -- (coloured blue, put in a \AgdaFunction in the LaTeX backend) -- when it should be coloured pink. -- The problem does not show up when dropping the second record -- type or removing the module declaration. record Pack (A : Set) : Set where field a : A record Packed {A : Set} (p : Pack A) : Set where module PP = Pack p module Synchronised {A : Set} {p : Pack A} (rel : Packed p) where module M = Packed rel
oeis/332/A332048.asm
neoneye/loda-programs
11
179191
; A332048: a(n) = n! * [x^n] 1 / (1 - LambertW(x))^n. ; Submitted by <NAME>(s4) ; 1,1,2,15,104,1145,13824,208831,3536000,68918769,1489702400,35742514511,937323767808,26750313223465,824073079660544,27276657371589375,965004380380626944,36347144974616190689,1451974448007830568960,61319892272079181137679,2729671240750270054400000,127746407459947646985139161,6270132645157460835011919872,322073619554063674621968286655,17279193062583798154035801882624,966483610324135413700670878140625,56265649853131189034666554529153024,3404092243567026374455834861204696911 mov $1,$0 mov $2,1 bin $4,$0 lpb $0 mul $2,$0 sub $0,1 mul $4,$1 mov $3,$4 mov $4,$2 add $2,$3 lpe mov $0,$4
dino/lcs/base/46B.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
6
104246
copyright zengfr site:http://github.com/zengfr/romhack 006D8C tst.b ($46b,A5) 006D90 bne $6dcc 006E3A tst.b ($46b,A5) 006E3E beq $6e4a 006F70 tst.b ($46b,A5) 006F74 bne $6fa2 006FF2 tst.b ($46b,A5) 006FF6 bne $702a 0073BE tst.b ($46b,A5) 0073C2 bne $73dc 00834E tst.b ($46b,A5) 008352 bne $83cc 09887A tst.b ($46b,A5) 09887E beq $98886 09CFDA move.b D0, ($46b,A5) 09CFDE move.b ($777a,A5), D0 09D07C tst.b ($46b,A5) 09D080 bne $9d124 09D1A6 tst.b ($46b,A5) 09D1AA beq $9d1c0 09D208 tst.b ($46b,A5) 09D20C beq $9d21c 09D412 tst.b ($46b,A5) 09D416 bne $9d470 09D6D2 tst.b ($46b,A5) 09D6D6 bne $9d746 09D8EE tst.b ($46b,A5) 09D8F2 bne $9d96e copyright zengfr site:http://github.com/zengfr/romhack
uti/cv_hexda.asm
olifink/smsqe
0
6733
<filename>uti/cv_hexda.asm ; dev8_uti_cv_hexda_asm include dev8_keys_err section utility xdef cv_hexda ;+++ ; convert hex-long to decimal-ascii ; ; ENTRY EXIT ; D0 error ; D1.l hex preserved ; D2.w how many bytes smashed ; A1 buffer preserved ; ; Error return: err.imem if d2 too high ; Condition code set ;--- cvreg reg d1-d3/a2-a3/a6 stfr equ $20 cv_hexda movem.l cvreg,-(sp) sub.l #stfr,sp move.l sp,a6 ; prepare workspace moveq #err.imem,d0 ; move.l d2,d3 ; copy how many byrtes sub.l #stfr-8,d3 bhi.s convert_rts ; return with error move.l a1,a2 ; copy addr. of buffer move.l d2,d3 ; how many bytes bra.s blank_loop_end blank_loop move.b #' ',(a1)+ blank_loop_end dbra d3,blank_loop ; buffer now only blanks lea $2(a6),a1 ; our workspace move.l d2,d3 ; how many bytes bra.s zero_loop_end zero_loop move.b #'0',(a1)+ zero_loop_end dbra d3,zero_loop ; workspace now only zeros move.l a2,a1 ; restore buffer add.l #2,a1 ; .w number of chars lea $2(a6),a3 move.w d2,-(sp) move.w d2,d3 ; copy how many bytes bsr.s help_div bra.s convert_loop_end convert_loop move.b -(a1),$0(a3,d3.w) convert_loop_end subq.w #1,d3 ; sub how many bytes cmpa.l a1,a2 bne.s convert_loop move.w (sp)+,d2 ; restore how many bytes move.w d2,(a1) ; number of chars moveq #0,d0 ; no error convert_rts add.l #stfr,sp ; adjust stack movem.l (sp)+,cvreg tst.l d0 rts help_div divu #1000,d1 clr.l d2 move.w d1,d2 bsr.s help_d1 swap d1 move.w d1,d2 help_d1 movem.l d2,-(a7) divu #100,d2 ori.b #'0',d2 move.b d2,(a1)+ swap d2 andi.l #$ffff,d2 divu #10,d2 ori.b #'0',d2 move.b d2,(a1)+ swap d2 andi.l #$ffff,d2 ori.b #'0',d2 move.b d2,(a1)+ movem.l (a7)+,d2 rts end
oeis/230/A230368.asm
neoneye/loda-programs
11
174696
; A230368: A strong divisibility sequence associated with the algebraic integer 1 + i. ; Submitted by <NAME>(s2) ; 1,1,1,5,1,1,1,15,1,1,1,65,1,1,1,255,1,1,1,1025,1,1,1,4095,1,1,1,16385,1,1,1,65535,1,1,1,262145,1,1,1,1048575,1,1,1,4194305,1,1,1,16777215,1,1,1,67108865,1,1,1,268435455,1,1,1,1073741825 mov $2,$0 add $2,1 mov $5,$0 lpb $2 sub $2,1 sub $0,$2 mov $3,1 add $3,$0 mov $4,$3 sub $5,$1 mov $0,$5 add $1,$3 lpe gcd $1,$4 mov $0,$1
SiriRemote/AppleRemote_MICROPHONE_HOLD.applescript
guileschool/SiriRemoteBTT
20
3251
(* The MIT License (MIT) Copyright (c) 2015 guileschool 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. http://github.com/guileschool/SiriRemoteBTT *) -- change speaker or voice recording -- click! set playsound to POSIX path of ("/System/Library/Sounds/Tink.aiff") do shell script ("afplay " & playsound & " > /dev/null 2>&1 &") try tell application "System Events" if exists process "iTunes" then -- PLAY / PAUSE tell application "iTunes" set state to get player state if state is playing then -- switch between a speaker and headphone my changeSpeaker() --tell application "Keyboard Maestro Engine" -- do script "8E2C660F-7ECF-4E04-A865-2207A23A1CFB" --end tell else -- 마이크 음성 녹음 --tell application "Keyboard Maestro Engine" -- do script "2E79FFFC-5903-4C5F-BED3-CF245BE0A12B" --end tell end if return state end tell end if end tell end try -- change speaker on changeSpeaker() set SPEAKERS to {"Built-in Output", "Built-in Line Output", "Display Audio"} set MY_SPEAKERS to {} -- get speakers list repeat with i in SPEAKERS set IS_SPEAKER to (do shell script "/usr/local/bin/SwitchAudioSource -a | grep \"" & i & "\" > /dev/null; echo $?") as text --display notification IS_SPEAKER if IS_SPEAKER is "0" then set end of MY_SPEAKERS to i as text end if end repeat -- change speaker set current to (do shell script "/usr/local/bin/SwitchAudioSource -c") as text repeat with n from 1 to count of MY_SPEAKERS if current is (item n of MY_SPEAKERS) as text then if n is (count of MY_SPEAKERS) then set new to item 1 of MY_SPEAKERS else set new to item (n + 1) of MY_SPEAKERS end if --display notification new do shell script "/usr/local/bin/SwitchAudioSource -s '" & new & "'" end if end repeat end changeSpeaker
Data/Option/Functions.agda
Lolirofle/stuff-in-agda
6
2082
module Data.Option.Functions where import Lvl open import Data open import Data.Boolean open import Data.Either as Either using (_‖_) open import Data.Option open import Data.Tuple as Tuple using (_⨯_ ; _,_) open import Type private variable ℓ : Lvl.Level private variable T A B T₁ T₂ T₃ : Type{ℓ} -- Applies a function to the inner value of the option container. -- A functor map for options. map : (T₁ → T₂) → Option(T₁) → Option(T₂) map f(Some x) = Some(f(x)) map f(None) = None -- Either the value inside the option container or the default value when it is none. -- An option eliminator. _or_ : Option(T) → T → T _or_ (Some x) _ = x _or_ None def = def -- Either transforming the value inside the option container or the default value when it is none. -- An option eliminator. partialMap : B → (A → B) → (Option(A) → B) partialMap _ f (Some x) = f(x) partialMap def _ None = def -- If the option have a value (is Some). isSome : Option(T) → Bool isSome (Some _) = 𝑇 isSome None = 𝐹 -- If the option have no value (is None). isNone : Option(T) → Bool isNone (Some _) = 𝐹 isNone None = 𝑇 -- Passes the inner value of the option to an option-valued function. -- A monadic bind for options. _andThen_ : Option(T₁) → (T₁ → Option(T₂)) → Option(T₂) _andThen_ None _ = None _andThen_ (Some x) f = f(x) -- Combines options of different types by applying the specified binary operator when both options have a value, and none otherwise. and-combine : (T₁ → T₂ → T₃) → (Option(T₁) → Option(T₂) → Option(T₃)) and-combine (_▫_) (Some x) (Some y) = Some(x ▫ y) {-# CATCHALL #-} and-combine _ _ _ = None -- Combines options of different types by applying the specified binary operator when both options have a value, and the side functions when only the respective sides have a value. None otherwise. or-combine : (T₁ → T₂ → T₃) → (T₁ → T₃) → (T₂ → T₃) → (Option(T₁) → Option(T₂) → Option(T₃)) or-combine(_▫_) l r None None = None or-combine(_▫_) l r None (Some y) = Some(r(y)) or-combine(_▫_) l r (Some x) None = Some(l(x)) or-combine(_▫_) l r (Some x) (Some y) = Some(x ▫ y) module Same where _orₗ_ : Option(T) → Option(T) → Option(T) _orₗ_ = or-combine(\x y → x) (\x → x) (\x → x) _orᵣ_ : Option(T) → Option(T) → Option(T) _orᵣ_ = or-combine(\x y → y) (\x → x) (\x → x) _andₗ_ : Option(T) → Option(T) → Option(T) _andₗ_ = and-combine(\x y → x) _andᵣ_ : Option(T) → Option(T) → Option(T) _andᵣ_ = and-combine(\x y → y) module Different where _orₗ_ : Option(T₁) → Option(T₂) → Option(T₁ ‖ T₂) _orₗ_ = or-combine(\x y → Either.Left(x)) Either.Left Either.Right _orᵣ_ : Option(T₁) → Option(T₂) → Option(T₁ ‖ T₂) _orᵣ_ = or-combine(\x y → Either.Right(y)) Either.Left Either.Right _and_ : Option(T₁) → Option(T₂) → Option(T₁ ⨯ T₂) _and_ = and-combine(_,_)
gfx/pokemon/haunter/anim_idle.asm
Dev727/ancientplatinum
28
88775
<filename>gfx/pokemon/haunter/anim_idle.asm frame 4, 58 endanim
programs/oeis/106/A106252.asm
neoneye/loda
22
27277
<filename>programs/oeis/106/A106252.asm ; A106252: Number of positive integer triples (x,y,z), with x<=y<=z<=n, such that each of x,y and z divides the sum of the other two. ; 1,3,5,7,8,11,12,14,16,18,19,22,23,25,27,29,30,33,34,36,38,40,41,44,45,47,49,51,52,55,56,58,60,62,63,66,67,69,71,73,74,77,78,80,82,84,85,88,89,91,93,95,96,99,100,102,104,106,107,110,111,113,115,117,118,121,122 mul $0,3 add $0,3 mov $1,$0 div $0,2 div $1,9 add $0,$1
src/sparknacl-sign.adb
rod-chapman/SPARKNaCl
76
2421
<filename>src/sparknacl-sign.adb with SPARKNaCl.Utils; with SPARKNaCl.Hashing; package body SPARKNaCl.Sign with SPARK_Mode => On is pragma Warnings (GNATProve, Off, "pragma * ignored (not yet supported)"); --============================================ -- Local constants and types --============================================ GF_D : constant Normal_GF := (16#78a3#, 16#1359#, 16#4dca#, 16#75eb#, 16#d8ab#, 16#4141#, 16#0a4d#, 16#0070#, 16#e898#, 16#7779#, 16#4079#, 16#8cc7#, 16#fe73#, 16#2b6f#, 16#6cee#, 16#5203#); GF_I : constant Normal_GF := (16#a0b0#, 16#4a0e#, 16#1b27#, 16#c4ee#, 16#e478#, 16#ad2f#, 16#1806#, 16#2f43#, 16#d7a7#, 16#3dfb#, 16#0099#, 16#2b4d#, 16#df0b#, 16#4fc1#, 16#2480#, 16#2b83#); GF_X : constant Normal_GF := (16#d51a#, 16#8f25#, 16#2d60#, 16#c956#, 16#a7b2#, 16#9525#, 16#c760#, 16#692c#, 16#dc5c#, 16#fdd6#, 16#e231#, 16#c0a4#, 16#53fe#, 16#cd6e#, 16#36d3#, 16#2169#); GF_Y : constant Normal_GF := (16#6658#, 16#6666#, 16#6666#, 16#6666#, 16#6666#, 16#6666#, 16#6666#, 16#6666#, 16#6666#, 16#6666#, 16#6666#, 16#6666#, 16#6666#, 16#6666#, 16#6666#, 16#6666#); -- Original TweetNaCl code computes Q(3) by multiplying GF_X by GF_Y, -- but this is a constant (now called GF_XY), thus: GF_XY : constant Normal_GF := (16#DD90#, 16#A5B7#, 16#8AB3#, 16#6DDE#, 16#52F5#, 16#7751#, 16#9F80#, 16#20F0#, 16#E37D#, 16#64AB#, 16#4E8E#, 16#66EA#, 16#7665#, 16#D78B#, 16#5F0F#, 16#E787#); GF_D2 : constant Normal_GF := (16#f159#, 16#26b2#, 16#9b94#, 16#ebd6#, 16#b156#, 16#8283#, 16#149a#, 16#00e0#, 16#d130#, 16#eef3#, 16#80f2#, 16#198e#, 16#fce7#, 16#56df#, 16#d9dc#, 16#2406#); type GF_Vector_4 is array (Index_4) of Normal_GF; -- MBP = "Max Byte Product" MBP : constant := (255 * 255); Max_X_Limb : constant := (32 * MBP) + 255; --============================================ -- Local subprogram declarations --============================================ function ModL (X : in I64_Seq_64) return Bytes_32 with Pure_Function, Global => null, Pre => (for all K in Index_64 => X (K) in 0 .. Max_X_Limb); procedure Sanitize_GF_Vector_4 (R : out GF_Vector_4) with Global => null; -- Replaces function "add" in the TweetNaCl sources function "+" (Left, Right : in GF_Vector_4) return GF_Vector_4 with Pure_Function, Global => null; function Scalarmult (Q : in GF_Vector_4; S : in Bytes_32) return GF_Vector_4 with Pure_Function, Global => null; function Scalarbase (S : in Bytes_32) return GF_Vector_4 with Pure_Function, Global => null; function Pack (P : in GF_Vector_4) return Bytes_32 with Pure_Function, Global => null; subtype Bit is Byte range 0 .. 1; function Par_25519 (A : in Normal_GF) return Bit with Pure_Function, Global => null; -- SPARKNaCl introduces this function to combine Hash and Reduce into -- a single call. Former procedure Reduce removed. function Hash_Reduce (M : in Byte_Seq) return Bytes_32 with Pure_Function, Global => null; procedure Unpackneg (R : out GF_Vector_4; OK : out Boolean; P : in Bytes_32) with Global => null; --============================================ -- Local subprogram bodies --============================================ procedure Sanitize_GF_Vector_4 (R : out GF_Vector_4) is begin for I in R'Range loop pragma Loop_Optimize (No_Unroll); Sanitize_GF16 (R (I)); end loop; end Sanitize_GF_Vector_4; function "+" (Left, Right : in GF_Vector_4) return GF_Vector_4 is A, B, C, D, E, F, G, H : Normal_GF; function Double (X : in Normal_GF) return Normal_GF is (X + X) with Pure_Function, Global => null; begin A := (Left (1) - Left (0)) * (Right (1) - Right (0)); B := (Left (0) + Left (1)) * (Right (0) + Right (1)); C := (Left (3) * Right (3)) * GF_D2; D := Double (Left (2) * Right (2)); E := D - C; F := D + C; G := B - A; H := B + A; return GF_Vector_4'(0 => G * E, 1 => H * F, 2 => F * E, 3 => G * H); end "+"; function Scalarmult (Q : in GF_Vector_4; S : in Bytes_32) return GF_Vector_4 is CB : Byte; Swap : Boolean; LP, LQ : GF_Vector_4; procedure CSwap (P, Q : in out GF_Vector_4; Swap : in Boolean) with Global => null; procedure CSwap (P, Q : in out GF_Vector_4; Swap : in Boolean) is begin for I in Index_4 loop pragma Loop_Optimize (No_Unroll); Utils.CSwap16 (P (I), Q (I), Swap); end loop; end CSwap; begin LP := (0 => GF_0, 1 => GF_1, 2 => GF_1, 3 => GF_0); LQ := Q; -- For each byte of S, starting at the MSB for I in reverse Index_32 loop pragma Loop_Optimize (No_Unroll); CB := S (I); -- For each bit of CB, starting with bit 7 (the MSB) for J in reverse Natural range 0 .. 7 loop pragma Loop_Optimize (No_Unroll); Swap := Boolean'Val (Shift_Right (CB, J) mod 2); CSwap (LP, LQ, Swap); LQ := LQ + LP; LP := LP + LP; CSwap (LP, LQ, Swap); end loop; end loop; return LP; end Scalarmult; function Scalarbase (S : in Bytes_32) return GF_Vector_4 is begin return Scalarmult (GF_Vector_4'(GF_X, GF_Y, GF_1, GF_XY), S); end Scalarbase; function Par_25519 (A : in Normal_GF) return Bit is D : Bytes_32; begin D := Utils.Pack_25519 (A); return (D (0) mod 2); end Par_25519; function Pack (P : in GF_Vector_4) return Bytes_32 is TX, TY, ZI : Normal_GF; R : Bytes_32; begin ZI := Utils.Inv_25519 (P (2)); TX := P (0) * ZI; TY := P (1) * ZI; R := Utils.Pack_25519 (TY); R (31) := R (31) xor (Par_25519 (TX) * 128); return R; end Pack; -- RFC 7748 says the "order" of Curve25519 is -- 2^252 + 0x14def9dea2f79cd65812631a5cf5d3ed -- -- In little-endian radix 2**8 format, this is 256 bits, thus: Max_L : constant := 16#f9#; L31 : constant := 16#10#; subtype L_Limb is I64_Byte range 0 .. Max_L; type L_Table is array (Index_32) of L_Limb; L : constant L_Table := (16#ed#, 16#d3#, 16#f5#, 16#5c#, 16#1a#, 16#63#, 16#12#, 16#58#, 16#d6#, 16#9c#, 16#f7#, 16#a2#, 16#de#, 16#f9#, 16#de#, 16#14#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, L31); -- The value of 16 * L (I) can be pre-computed in a second table, -- giving a small time saving in two inner loops below. subtype L16_Limb is I64 range 0 .. (16 * Max_L); type L16_Table is array (Index_32) of L16_Limb; L16 : constant L16_Table := (16#ed0#, 16#d30#, 16#f50#, 16#5c0#, 16#1a0#, 16#630#, 16#120#, 16#580#, 16#d60#, 16#9c0#, 16#f70#, 16#a20#, 16#de0#, 16#f90#, 16#de0#, 16#140#, 16#000#, 16#000#, 16#000#, 16#000#, 16#000#, 16#000#, 16#000#, 16#000#, 16#000#, 16#000#, 16#000#, 16#000#, 16#000#, 16#000#, 16#000#, 16 * L31); function ModL (X : in I64_Seq_64) return Bytes_32 is Max_Carry : constant := 2**14; Min_Carry : constant := -2**25; subtype Carry_T is I64 range Min_Carry .. Max_Carry; Min_Adjustment : constant := (Min_Carry * 16 * Max_L); Max_Adjustment : constant := ((Max_X_Limb + Max_Carry) * 16 * Max_L); subtype Adjustment_T is I64 range Min_Adjustment .. Max_Adjustment; subtype XL_Limb is I64 range -((Max_X_Limb + Max_Carry + Max_Adjustment) * 16 * Max_L) .. ((Max_X_Limb + Max_Carry + Max_Adjustment) * 16 * Max_L); type XL_Table is array (Index_64) of XL_Limb; XL : XL_Table; -- "PRL" = "Partially Reduced Limb" subtype PRL is I64 range -129 .. 128; -- "FRL" = "Fully Reduced Limb" subtype FRL is PRL range -128 .. 127; R : Bytes_32; -- The largest value of Carry is achieved when XL (63) = 0, -- so that -- Max_L63_Carry = ASR_8 (Max_X_Limb + Max_L63_Carry + 128) -- Knowing that all the terms are positive means we can expand -- ASR_8 and simplify. -- This is declared here it can be used to derive subtype -- XL51_T and used in the post-condition of Eliminate_Limb_63 below Max_L63_Carry : constant := (Max_X_Limb + 128) / 255; subtype XL51_T is I64 range 0 .. (Max_X_Limb + Max_L63_Carry); procedure Initialize_XL with Global => (Input => X, Output => XL), Pre => (for all K in Index_64 => X (K) in 0 .. Max_X_Limb), Post => (for all K in Index_64 => XL (K) >= 0) and (for all K in Index_64 => XL (K) <= Max_X_Limb) and (for all K in Index_64 => XL (K) = XL_Limb (X (K))); procedure Eliminate_Limb_63 with Global => (Proof_In => X, In_Out => XL), Pre => (for all K in Index_64 => X (K) in 0 .. Max_X_Limb) and then (for all K in Index_64 => XL (K) >= 0) and then (for all K in Index_64 => XL (K) <= Max_X_Limb) and then (for all K in Index_64 => XL (K) = XL_Limb (X (K))), Post => (for all K in Index_64 range 0 .. 30 => XL (K) = X (K)) and (for all K in Index_64 range 31 .. 50 => XL (K) in FRL) and (XL (51) in XL51_T) and (for all K in Index_64 range 52 .. 62 => XL (K) = X (K)) and (XL (63) = 0); procedure Eliminate_Limbs_62_To_32 with Global => (Proof_In => X, In_Out => XL), Pre => ((for all K in Index_64 range 0 .. 30 => XL (K) = X (K) and XL (K) in 0 .. Max_X_Limb) and (for all K in Index_64 range 31 .. 50 => XL (K) in FRL) and (XL (51) in XL51_T) and (for all K in Index_64 range 52 .. 62 => XL (K) = X (K) and XL (K) in 0 .. Max_X_Limb) and (XL (63) = 0)), Post => ((for all K in Index_64 range 0 .. 19 => XL (K) in FRL) and (for all K in Index_64 range 20 .. 31 => XL (K) in PRL) and (for all K in Index_64 range 32 .. 63 => XL (K) = 0)); procedure Finalize with Global => (In_Out => XL, Output => R), Pre => ((for all K in Index_64 range 0 .. 19 => XL (K) in FRL) and (for all K in Index_64 range 20 .. 31 => XL (K) in PRL) and (for all K in Index_64 range 32 .. 63 => XL (K) = 0)); procedure Initialize_XL is begin XL := (others => 0); for K in Index_64 loop pragma Loop_Optimize (No_Unroll); XL (K) := XL_Limb (X (K)); pragma Loop_Invariant (for all A in Index_64 range 0 .. K => XL (A) = XL_Limb (X (A))); end loop; end Initialize_XL; procedure Eliminate_Limb_63 is Max_L63_Adjustment : constant := 16 * Max_L * Max_X_Limb; subtype L63_Adjustment_T is I64 range 0 .. Max_L63_Adjustment; -- The most negative value of Carry is when XL (63) = Max_X_Limb and -- L (J - 31) = Max_L and XL (J) = 0 -- so that -- Min_L63_Carry = -- ASR_8 (0 + Min_L63_Carry - Max_L63_Adjustment + 128) Min_L63_Carry : constant := ((128 - Max_L63_Adjustment) / 255) - 1; subtype L63_Carry_T is I64 range Min_L63_Carry .. Max_L63_Carry; Carry : L63_Carry_T; Adjustment : L63_Adjustment_T; XL63 : XL_Limb; begin Carry := 0; -- In the TweetNaCl sources, this loop interates 20 times -- covering elements of L from L (0) to L (19). -- In this implementation, though, we choose to loop over the -- first 16 elements of L first, since these are all non-zero, -- and manually unroll the final 4 iterations where L (16) -- through L (19) are all zero. XL63 := XL (63); for J in I32 range 31 .. 46 loop pragma Loop_Optimize (No_Unroll); declare XLJ : XL_Limb renames XL (J); begin Adjustment := (L16 (J - 31)) * XL63; XLJ := XLJ + Carry - Adjustment; Carry := ASR_8 (XLJ + 128); XLJ := XLJ - (Carry * 256); end; pragma Loop_Invariant ((for all K in Index_64 range 0 .. 30 => XL (K) = XL'Loop_Entry (K)) and (for all K in Index_64 range 31 .. J => XL (K) in FRL) and (for all K in Index_64 range J + 1 .. 63 => XL (K) = XL'Loop_Entry (K))); end loop; pragma Assert ((for all K in Index_64 range 0 .. 30 => XL (K) = X (K)) and (for all K in Index_64 range 31 .. 46 => XL (K) in FRL) and (for all K in Index_64 range 47 .. 63 => XL (K) = X (K))); -- Final 4 limbs of XL (47) through XL (50) -- For these limbs, we know that L (16) through L (19) -- is zero, so the calculation of Adjustment can be eliminated. -- -- As these final four limbs are processed, the upper bound -- on Carry stays the same at Max_L63_Carry, but the lower bound -- converges towards 0. declare -- Expand the definition of ASR_8 for values gives... Min_XL47_Carry : constant := ((Min_L63_Carry + 128 + 1) / 2**8) - 1; pragma Assert (Min_XL47_Carry = -127006); Min_XL48_Carry : constant := ((Min_XL47_Carry + 128 + 1) / 2**8) - 1; pragma Assert (Min_XL48_Carry = -496); Min_XL49_Carry : constant := ((Min_XL48_Carry + 128 + 1) / 2**8) - 1; pragma Assert (Min_XL49_Carry = -2); Min_XL50_Carry : constant := ((Min_XL49_Carry + 128) / 2**8); pragma Assert (Min_XL50_Carry = 0); begin XL (47) := XL (47) + Carry; Carry := ASR_8 (XL (47) + 128); XL (47) := XL (47) - (Carry * 256); pragma Assert (Carry >= Min_XL47_Carry); XL (48) := XL (48) + Carry; Carry := ASR_8 (XL (48) + 128); XL (48) := XL (48) - (Carry * 256); pragma Assert (Carry >= Min_XL48_Carry); XL (49) := XL (49) + Carry; Carry := ASR_8 (XL (49) + 128); XL (49) := XL (49) - (Carry * 256); pragma Assert (Carry >= Min_XL49_Carry); XL (50) := XL (50) + Carry; Carry := ASR_8 (XL (50) + 128); XL (50) := XL (50) - (Carry * 256); -- Lower bound on Carry should have converged to 0 pragma Assert (Min_XL50_Carry = 0); pragma Assert (Carry >= Min_XL50_Carry); end; pragma Assert ((for all K in Index_64 range 0 .. 30 => XL (K) = X (K)) and (for all K in Index_64 range 31 .. 50 => XL (K) in FRL) and (for all K in Index_64 range 51 .. 63 => XL (K) = X (K))); -- Note XL (51) is adjusted here but is NOT normalized -- to be in FRL... hence it's a special case in the post- -- condition above. XL (51) := XL (51) + Carry; pragma Assert (XL (51) in XL51_T); XL (63) := 0; end Eliminate_Limb_63; procedure Eliminate_Limbs_62_To_32 is Carry : Carry_T; Adjustment : Adjustment_T; XLI : XL_Limb; begin for I in reverse I32 range 32 .. 62 loop pragma Loop_Optimize (No_Unroll); Carry := 0; -- As above, this loop iterates over limbs 0 .. 15 of L -- leaving the final four (zero) limbs unrolled below. XLI := XL (I); for J in I32 range (I - 32) .. (I - 17) loop pragma Loop_Optimize (No_Unroll); declare -- Rename XL (J) here so can be used as both a L- and an -- R-Value below. Note also that I /= J here, so XLI and XLJ -- cannot denote the same element of XL. XLJ : XL_Limb renames XL (J); begin Adjustment := (L16 (J - (I - 32))) * XLI; XLJ := XLJ + Carry - Adjustment; Carry := ASR_8 (XLJ + 128); XLJ := XLJ - (Carry * 256); end; pragma Loop_Invariant (for all K in Index_64 range 0 .. I - 33 => XL (K) = XL'Loop_Entry (K)); pragma Loop_Invariant (for all K in Index_64 range I - 32 .. J => XL (K) in FRL); pragma Loop_Invariant (for all K in Index_64 range J + 1 .. I32'Min (50, I - 1) => XL (K) = XL'Loop_Entry (K)); pragma Loop_Invariant (for all K in Index_64 range J + 1 .. I32'Min (50, I - 1) => XL (K) in PRL); pragma Loop_Invariant (for all K in Index_64 range I32'Max (I - 11, 52) .. I - 1 => XL (K) = XL'Loop_Entry (K)); pragma Loop_Invariant (for all K in Index_64 range I + 1 .. 63 => XL (K) = 0); pragma Loop_Invariant (for all K in Index_64 => XL (K) in PRL'First .. XL51_T'Last); end loop; -- 16 elements of XL(I-32) .. XL(I-17) are in now FRL pragma Assert (for all K in Index_64 range I - 32 .. I - 17 => XL (K) in FRL); pragma Assert (XL (I - 16) in FRL); -- Carry is in Carry_T here XL (I - 16) := XL (I - 16) + Carry; Carry := ASR_8 (XL (I - 16) + 128); XL (I - 16) := XL (I - 16) - (Carry * 256); -- 17 elements of XL are in FRL pragma Assert (for all K in Index_64 range I - 32 .. I - 16 => XL (K) in FRL); pragma Assert (XL (I - 15) in FRL); -- Now we can start to prove that Carry is converging. -- Each further reduction reduces the lower and upper bound -- of Carry by about 2**8, except that the addition of 128 and -- ASR_8 actually mean that Carry converges on the range -1 .. 1 pragma Assert (Carry in -2**17 .. 64); XL (I - 15) := XL (I - 15) + Carry; Carry := ASR_8 (XL (I - 15) + 128); XL (I - 15) := XL (I - 15) - (Carry * 256); -- 18 elements of XL are in FRL pragma Assert (for all K in Index_64 range I - 32 .. I - 15 => XL (K) in FRL); pragma Assert (XL (I - 14) in FRL); pragma Assert (Carry in -512 .. 1); XL (I - 14) := XL (I - 14) + Carry; Carry := ASR_8 (XL (I - 14) + 128); XL (I - 14) := XL (I - 14) - (Carry * 256); -- 19 elements of XL are in FRL pragma Assert (for all K in Index_64 range I - 32 .. I - 14 => XL (K) in FRL); pragma Assert (XL (I - 13) in FRL); pragma Assert (Carry in -2 .. 1); XL (I - 13) := XL (I - 13) + Carry; Carry := ASR_8 (XL (I - 13) + 128); XL (I - 13) := XL (I - 13) - (Carry * 256); -- 20 elements of XL are in FRL pragma Assert (for all K in Index_64 range I - 32 .. I - 13 => XL (K) in FRL); pragma Assert (XL (I - 12) in FRL); pragma Assert (Carry in -1 .. 1); -- If Carry in -1 .. 1, then the final adjustment of -- XL (I - 12) means that this limb can end up being -- -129 or +128, so in PRL but not in FRL XL (I - 12) := XL (I - 12) + Carry; pragma Assert (XL (I - 12) in PRL); -- XL (I) is now eliminated, so it gets zeroed out now. XL (I) := 0; pragma Loop_Invariant (for all K in Index_64 range 0 .. I - 33 => XL (K) = XL'Loop_Entry (K)); pragma Loop_Invariant (for all K in Index_64 range I - 32 .. I - 13 => XL (K) in FRL); pragma Loop_Invariant (XL (I - 12) in PRL); pragma Loop_Invariant (for all K in Index_64 range I - 11 .. I32'Min (50, I - 1) => XL (K) in PRL); -- This is XL (51) for I in 52 .. 63 pragma Loop_Invariant (if I >= 52 then XL (51) >= XL'Loop_Entry (51) + Min_Carry); pragma Loop_Invariant (if I >= 52 then XL (51) <= XL'Loop_Entry (51) + Max_Carry); pragma Loop_Invariant (for all K in Index_64 range I32'Max (I - 11, 52) .. I - 1 => XL (K) = XL'Loop_Entry (K)); pragma Loop_Invariant (for all K in Index_64 range I .. 63 => XL (K) = 0); pragma Loop_Invariant (for all K in Index_64 => XL (K) in PRL'First .. XL51_T'Last); end loop; end Eliminate_Limbs_62_To_32; procedure Finalize is Final_Carry_Min : constant := -9; Final_Carry_Max : constant := 9; subtype Final_Carry_T is I64 range Final_Carry_Min .. Final_Carry_Max; subtype Step1_XL_Limb is I64 range (Final_Carry_Min * 256) .. ((Final_Carry_Max + 1) * 256) - 1; subtype Step2_XL_Limb is I64 range I64_Byte'First - (Final_Carry_Max * Max_L) .. I64_Byte'Last - (Final_Carry_Min * Max_L); Carry : Final_Carry_T; begin -- Step 1 Carry := 0; for J in Index_32 loop pragma Loop_Optimize (No_Unroll); pragma Assert (XL (31) in PRL); XL (J) := XL (J) + (Carry - ASR_4 (XL (31)) * L (J)); pragma Assert (XL (J) >= Step1_XL_Limb'First); pragma Assert (XL (J) <= Step1_XL_Limb'Last); Carry := ASR_8 (XL (J)); XL (J) := XL (J) mod 256; -- Modified limbs 0 .. J are all in I64_Byte pragma Loop_Invariant (for all K in Index_64 range 0 .. J => XL (K) in I64_Byte); -- Limbs J + 1 .. 31 are unmodified and in PRL pragma Loop_Invariant (for all K in Index_64 range J + 1 .. 31 => XL (K) = XL'Loop_Entry (K)); pragma Loop_Invariant (for all K in Index_64 range J + 1 .. 31 => XL (K) in PRL); -- Trailing 32 limbs are all 0 pragma Loop_Invariant (for all K in Index_64 range 32 .. 63 => XL (K) = 0); end loop; -- RCC Potential to split above into 0 .. 15 as above, then -- exploit that L (J) = 0 for J in 16 .. 30, then do L (31) as -- a final special case. -- Check first 32 limbs in I64_Byte pragma Assert (for all K in Index_64 range 0 .. 31 => XL (K) in I64_Byte); -- Check later 32 limbs all 0 pragma Assert (for all K in Index_64 range 32 .. 63 => XL (K) = 0); -- Step 2 -- RCC split this loop too, based on L properties? for J in Index_32 loop pragma Loop_Optimize (No_Unroll); XL (J) := XL (J) - Carry * L (J); pragma Loop_Invariant (for all K in Index_32 range 0 .. J => XL (K) in Step2_XL_Limb); pragma Loop_Invariant (for all K in Index_64 range 32 .. 63 => XL (K) = 0); end loop; pragma Assert (for all K in Index_64 => XL (K) in Step2_XL_Limb); pragma Assert (for all K in Index_64 range 32 .. 63 => XL (K) = 0); -- Step 3 - final carry chain from X (0) to X (32) and reduce -- each limb mod 256 declare -- In Step 3, XL(I+1) is added to ASR_8(XL(I)), so we need to know -- the range of the ASR_8(XL(I)). A precise characterisation -- of the bounds on XL (I+1) would be non-linear, so we fall -- back on a linear over-approximation here, which suffices. -- Max XL Carry - max magnitude of carry from XL(I) to XL(I+1) MXLC : constant := 10; -- Step 3 Carry subtype S3CT is I64 range -MXLC .. MXLC; S3C : S3CT; begin for I in Index_32 loop pragma Loop_Optimize (No_Unroll); pragma Assert (XL (I) >= Step2_XL_Limb'First - MXLC * I64 (I)); S3C := ASR_8 (XL (I)); XL (I + 1) := XL (I + 1) + S3C; R (I) := Byte (XL (I) mod 256); pragma Loop_Invariant (XL (0) = XL'Loop_Entry (0)); pragma Loop_Invariant (XL (0) in Step2_XL_Limb); pragma Loop_Invariant (if I <= 30 then XL (32) = 0); pragma Loop_Invariant (for all K in Index_32 range 1 .. 31 => XL (K) >= Step2_XL_Limb'First - (MXLC * I64 (K))); pragma Loop_Invariant (for all K in Index_32 range 1 .. 31 => XL (K) <= Step2_XL_Limb'Last + (MXLC * I64 (K))); pragma Loop_Invariant (for all K in Index_32 range I + 2 .. 31 => XL (K) in Step2_XL_Limb); end loop; end; end Finalize; begin Initialize_XL; Eliminate_Limb_63; Eliminate_Limbs_62_To_32; -- Wording of warning changed between SPARK 2020 and 2021, so two -- pragmas are needed here to get a clean analysis with both -- toolsets. pragma Warnings (GNATProve, Off, "unused assignment"); -- 2020 pragma Warnings (GNATProve, Off, "XL*not used after the call"); -- 2021 -- Unused assignment to XL here expected Finalize; return R; end ModL; function Hash_Reduce (M : in Byte_Seq) return Bytes_32 is R : Hashing.Digest; X : I64_Seq_64; begin Hashing.Hash (R, M); X := (others => 0); for I in Index_64 loop pragma Loop_Optimize (No_Unroll); X (I) := I64 (R (I)); pragma Loop_Invariant (for all K in Index_64 range 0 .. I => X (K) in I64_Byte); end loop; pragma Assert (for all K in Index_64 => X (K) in I64_Byte); return ModL (X); end Hash_Reduce; procedure Unpackneg (R : out GF_Vector_4; OK : out Boolean; P : in Bytes_32) is -- Local, time-constant equality test for GF -- In the original TweetNaCl sources, this is called eq25519 function "=" (Left, Right : in Normal_GF) return Boolean with Pure_Function, Global => null; function Pow_2523 (I : in Normal_GF) return Normal_GF with Pure_Function, Global => null; function "=" (Left, Right : in Normal_GF) return Boolean is begin return Equal (Bytes_32'(Utils.Pack_25519 (Left)), Bytes_32'(Utils.Pack_25519 (Right))); end "="; function Pow_2523 (I : in Normal_GF) return Normal_GF is C, C2 : Normal_GF; begin C := I; -- Note that 2**252 - 3 = 16#1111_1111 .. 1101# -- with only "bit 1" set to 0 for A in reverse 0 .. 250 loop pragma Loop_Optimize (No_Unroll); C2 := Square (C); if A = 1 then C := C2; else C := C2 * I; end if; end loop; return C; end Pow_2523; -- Note: refactoring here to functional/SSA form reduces the -- number of calls to "*" from 8 in the original TweetNaCl code -- to 5 from here until the initialization of R0, but only if -- "*" on GF is commutative. R1 : constant Normal_GF := Utils.Unpack_25519 (P); R2 : Normal_GF renames GF_1; R1_Squared : constant Normal_GF := Square (R1); Num : constant Normal_GF := R1_Squared - R2; Den : constant Normal_GF := R2 + (R1_Squared * GF_D); Den_Power_2 : constant Normal_GF := Square (Den); Den_Power_4 : constant Normal_GF := Square (Den_Power_2); Num_Den2 : constant Normal_GF := (Num * Den) * Den_Power_2; R0 : Normal_GF := Pow_2523 ((Den_Power_4 * Num_Den2)) * Num_Den2; Check : Normal_GF; begin Check := Square (R0) * Den; if Check /= Num then R0 := R0 * GF_I; end if; Check := Square (R0) * Den; if Check /= Num then R := (others => GF_0); OK := False; return; end if; if Par_25519 (R0) = (P (31) / 128) then R0 := GF_0 - R0; end if; R := (0 => R0, 1 => R1, 2 => R2, 3 => R0 * R1); OK := True; end Unpackneg; --============================================ -- Exported subprogram bodies --============================================ function Serialize (K : in Signing_SK) return Bytes_64 is begin return K.F; end Serialize; function Serialize (K : in Signing_PK) return Bytes_32 is begin return K.F; end Serialize; procedure Sanitize (K : out Signing_PK) is begin SPARKNaCl.Sanitize (K.F); end Sanitize; procedure Sanitize (K : out Signing_SK) is begin SPARKNaCl.Sanitize (K.F); end Sanitize; procedure Keypair (SK_Raw : in Bytes_32; -- random please! PK : out Signing_PK; SK : out Signing_SK) is D : Bytes_64; LPK : Bytes_32; begin Hashing.Hash (D, SK_Raw); D (0) := D (0) and 248; D (31) := (D (31) and 127) or 64; LPK := Pack (Scalarbase (D (0 .. 31))); PK.F := LPK; SK.F := SK_Raw & LPK; -- Sanitize intermediate values used in key generation pragma Warnings (GNATProve, Off, "statement has no effect"); Sanitize (D); Sanitize (LPK); pragma Unreferenced (D); pragma Unreferenced (LPK); end Keypair; procedure PK_From_Bytes (PK_Raw : in Bytes_32; PK : out Signing_PK) is begin PK.F := PK_Raw; end PK_From_Bytes; procedure Sign (SM : out Byte_Seq; M : in Byte_Seq; SK : in Signing_SK) is subtype Byte_Product is I64 range 0 .. MBP; D : Bytes_64; H, R : Bytes_32; X : I64_Seq_64; T : Byte_Product; P : GF_Vector_4; procedure Initialize_SM (X : out Byte_Seq) with Global => (Input => (M, D)), Depends => (X => (X, M, D)), Pre => (M'First = 0 and X'First = 0 and M'Last <= N32'Last - Sign_Bytes) and then (X'Length = M'Length + Sign_Bytes and X'Last = M'Last + Sign_Bytes), Post => (X = Zero_Bytes_32 & D (32 .. 63) & M) and X'Initialized, Relaxed_Initialization => X, Inline; procedure Initialize_SM (X : out Byte_Seq) is begin -- Precondition ensures SM is exactly 64 bytes longer than M. -- Don't use "&" here to avoid allocation of a dynamic-sized -- object on the stack. X (0 .. 31) := Zero_Bytes_32; X (32 .. 63) := D (32 .. 63); X (64 .. X'Last) := M; end Initialize_SM; begin Hashing.Hash (D, Serialize (SK) (0 .. 31)); D (0) := D (0) and 248; D (31) := (D (31) and 127) or 64; Initialize_SM (SM); R := Hash_Reduce (SM (32 .. SM'Last)); P := Scalarbase (R); SM (0 .. 31) := Pack (P); SM (32 .. 63) := Serialize (SK) (32 .. 63); H := Hash_Reduce (SM); X := (others => 0); for I in Index_32 loop pragma Loop_Optimize (No_Unroll); X (I) := I64 (R (I)); pragma Loop_Invariant ((for all K in N32 range 0 .. I => X (K) in I64_Byte) and (for all K in N32 range I + 1 .. 63 => X (K) = 0)); end loop; pragma Assert ((for all K in N32 range 0 .. 31 => X (K) in I64_Byte) and (for all K in N32 range 32 .. 63 => X (K) = 0) and (for all K in Index_64 => X (K) in I64_Byte) ); pragma Warnings (Off, "explicit membership test may be optimized"); for I in Index_32 loop pragma Loop_Optimize (No_Unroll); for J in Index_32 loop pragma Loop_Optimize (No_Unroll); T := Byte_Product (H (I)) * Byte_Product (D (J)); X (I + J) := X (I + J) + T; -- This loop invariant follows the same pattern -- as that in SPARKNaCl."*" pragma Loop_Invariant ( T in Byte_Product and -- Lower bound (for all K in Index_64 => X (K) >= 0) and -- rising from 1 to I (for all K in Index_64 range 0 .. (I - 1) => X (K) <= (I64 (K + 1) * MBP + 255)) and -- flat at I + 1, just written (for all K in Index_64 range I .. I32'Min (31, I + J) => X (K) <= (I64 (I + 1) * MBP + 255)) and -- flat at I, not written yet (for all K in Index_64 range I + J + 1 .. 31 => X (K) <= (I64 (I) * MBP + 255)) and -- falling from I to 1, just written (for all K in Index_64 range 32 .. (I + J) => X (K) <= (I64 (32 + I) - I64 (K)) * MBP + 255) and -- falling, from I to 1, but not written yet (for all K in Index_64 range I32'Max (32, I + J + 1) .. (I + 31) => X (K) <= (I64 (31 + I) - I64 (K)) * MBP + 255) and -- Zeroes - never written (for all K in Index_64 range I + 32 .. 63 => X (K) = 0) ); end loop; -- Substitute J = 31 into the above yields pragma Loop_Invariant ( T in Byte_Product and -- Lower bound (for all K in Index_64 => X (K) >= 0) and -- rising from 1 to I (for all K in Index_64 range 0 .. (I - 1) => X (K) <= (I64 (K + 1) * MBP + 255)) and -- flat at I + 1, just written (for all K in Index_64 range I .. 31 => X (K) <= (I64 (I + 1) * MBP + 255)) and -- falling from I to 1, just written (for all K in Index_64 range 32 .. (I + 31) => X (K) <= (I64 (32 + I) - I64 (K)) * MBP + 255) and -- Zeroes - never written (for all K in Index_64 range I + 32 .. 63 => X (K) = 0) ); end loop; -- Substitute I = 31 pragma Assert ( -- Lower bound (for all K in Index_64 => X (K) >= 0) and -- Upper bounds (for all K in Index_64 range 0 .. 30 => X (K) <= (I64 (K + 1) * MBP + 255)) and X (31) <= (32 * MBP + 255) and (for all K in Index_64 range 32 .. 62 => X (K) <= (63 - I64 (K)) * MBP + 255) and X (63) = 0 ); -- Simplify - this assert is equivalent to the precondition of ModL pragma Assert (for all K in Index_64 => X (K) in 0 .. (32 * MBP + 255)); SM (32 .. 63) := ModL (X); Sanitize (D); Sanitize (H); Sanitize (R); Sanitize_I64_Seq (X); pragma Unreferenced (D, H, R, X); end Sign; procedure Open (M : out Byte_Seq; Status : out Boolean; MLen : out I32; SM : in Byte_Seq; PK : in Signing_PK) is T : Bytes_32; P, Q : GF_Vector_4; LN : I32; begin MLen := -1; if SM'Length < 64 then M := (others => 0); Status := False; -- No sanitization required before this return return; end if; Unpackneg (Q, Status, Serialize (PK)); if not Status then M := (others => 0); Sanitize_GF_Vector_4 (Q); return; end if; M := SM; -- precondition ensures lengths match M (32 .. 63) := Serialize (PK); P := Scalarmult (Q, Hash_Reduce (M)); Q := Scalarbase (SM (32 .. 63)); -- Call to user-defined "+" for GF_Vector_4 P := P + Q; T := Pack (P); if not Equal (SM (0 .. 31), T) then M := (others => 0); Status := False; Sanitize (T); Sanitize_GF_Vector_4 (P); Sanitize_GF_Vector_4 (Q); return; end if; LN := I32 (I64 (SM'Length) - 64); M (0 .. LN - 1) := SM (64 .. LN + 63); MLen := LN; Status := True; Sanitize (T); Sanitize_GF_Vector_4 (P); Sanitize_GF_Vector_4 (Q); pragma Unreferenced (T, P, Q); end Open; end SPARKNaCl.Sign;
oeis/098/A098560.asm
neoneye/loda-programs
11
243962
; A098560: E.g.f. (1+4*x)/(1-4*x). ; Submitted by <NAME> ; 1,8,64,768,12288,245760,5898240,165150720,5284823040,190253629440,7610145177600,334846387814400,16072626615091200,835776583984742400,46803488703145574400,2808209322188734464000,179725396620079005696000,12221326970165372387328000,879935541851906811887616000,66875101180744917703458816000,5350008094459593416276705280000,449400679934605846967243243520000,39547259834245314533117405429760000,3638347904750568937046801299537920000,349281398856054617956492924755640320000 mov $1,1 mov $2,1 lpb $0 sub $0,1 add $2,1 mul $1,$2 mul $1,4 mov $2,$0 lpe mov $0,$1
oeis/105/A105576.asm
neoneye/loda-programs
11
240307
; A105576: a(n+3) = 2a(n+2) - 3a(n+1) + 2a(n); a(0) = 3, a(1) = 4, a(2) = 0. ; Submitted by <NAME> ; 3,4,0,-6,-4,10,20,2,-36,-38,36,114,44,-182,-268,98,636,442,-828,-1710,-52,3370,3476,-3262,-10212,-3686,16740,24114,-9364,-57590,-38860,76322,154044,1402,-306684,-309486,303884,922858,315092,-1530622,-2160804,900442,5222052,3421170 mov $1,3 mov $2,2 lpb $0 sub $0,1 mul $2,2 sub $1,$2 add $2,$1 lpe add $2,1 mov $0,$2
Driver/Font/Nimbus/nimbusUtils.asm
steakknife/pcgeos
504
81084
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) GeoWorks 1990 -- All Rights Reserved PROJECT: PC GEOS MODULE: Nimbus Font Driver FILE: nimbusUtils.asm AUTHOR: <NAME>, Feb 20, 1990 ROUTINES: Name Description ---- ----------- UTIL DoMult Multiply (short) by scale factor. UTIL MulWWFixedES Multiply WWFixed in *es:di by WWFixed in dx:cx REVISION HISTORY: Name Date Description ---- ---- ----------- Gene 2/20/90 Initial revision DESCRIPTION: Contains utility routines used in $Id: nimbusUtils.asm,v 1.1 97/04/18 11:45:30 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Mul100WWFixedES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Multiply a number by a percentage scale factor CALLED BY: AddGraphicsTransform PASS: cl <- muliplier (percentage) es:di <- current value (WWFixed) RETURN: es:di <- current * multiplier (WWFixed) DESTROYED: none PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- gene 9/ 8/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ Mul100WWFixedES proc far uses ax, bx, cx, dx .enter mov dl, cl clr dh clr cx, ax ;dx.cx <- percentage mov bx, 100 ;bx.ax <- convert % to WWFixed call GrUDivWWFixed call MulWWFixedES .leave ret Mul100WWFixedES endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% MulWWFixedES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Multiply a number by a scale factor. CALLED BY: AddGraphicsTransform PASS: dx.cx <- muliplier (WWFixed) es:di <- current value (WWFixed) RETURN: es:di <- current * multiplier (WWFixed) DESTROYED: none PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- eca 2/25/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ MulWWFixedES proc near uses ds, si .enter push dx push cx mov si, sp segmov ds, ss ;ds:si <- ptr to multiplier call GrMulWWFixedPtr mov es:[di].WWF_int, dx mov es:[di].WWF_frac, cx pop cx pop dx .leave ret MulWWFixedES endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% MulWWFixedDS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: CALLED BY: PASS: dx.cx <- multiplier (WWFixed) ds:si <- current value (WWFixed) RETURN: bx.ax <- current * multiplier (WWFixed) DESTROYED: none PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- eca 2/26/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ MulWWFixedDS proc near uses es, di .enter push dx push cx mov di, sp segmov es, ss call GrMulWWFixedPtr mov bx, dx mov ax, cx pop cx pop dx .leave ret MulWWFixedDS endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ScaleShortWBFixed %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Multiply given number by scale factor, round to WBFixed CALLED BY: INTERNAL: ConvertHeader PASS: bx - number to convert (short) ax:si - ptr to scale factor (WWFixed) ax:di - scratch register RETURN: dx:ch - scaled number (WBFixed) DESTROYED: cl PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- eca 11/ 9/89 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ScaleShortWBFixed proc near uses ds, es .enter mov es, ax mov ds, ax mov es:[di].WWF_int, bx mov es:[di].WWF_frac, 0 call GrMulWWFixedPtr ;dx.cx == scale * number rndwwbf dxcx ;dx.ch <- rounded to WBFixed .leave ret ScaleShortWBFixed endp
src/Generic/Lib/Data/Pow.agda
turion/Generic
30
661
<reponame>turion/Generic module Generic.Lib.Data.Pow where open import Generic.Lib.Intro open import Generic.Lib.Data.Nat open import Generic.Lib.Data.Product infixl 6 _^_ _^_ : ∀ {α} -> Set α -> ℕ -> Set α A ^ 0 = ⊤ A ^ suc n = A × A ^ n elimPow : ∀ {n α} {A : Set α} {b : ∀ {n} -> A ^ n -> Level} -> (B : ∀ {n} -> (xs : A ^ n) -> Set (b xs)) -> (∀ {n} {xs : A ^ n} x -> B xs -> B (x , xs)) -> B tt -> (xs : A ^ n) -> B xs elimPow {0} B f z tt = z elimPow {suc n} B f z (x , xs) = f x (elimPow B f z xs) foldPow : ∀ {n α β} {A : Set α} -> (B : ℕ -> Set β) -> (∀ {n} -> A -> B n -> B (suc n)) -> B 0 -> A ^ n -> B n foldPow B f z xs = elimPow (λ {n} _ -> B n) (λ x y -> f x y) z xs foldPow₁ : ∀ {n α} {A : Set α} -> (A -> A -> A) -> A ^ suc n -> A foldPow₁ {0} f (x , []) = x foldPow₁ {suc n} f (x , xs) = f x (foldPow₁ f xs) mapPow : ∀ {n α β} {A : Set α} {B : Set β} -> (A -> B) -> A ^ n -> B ^ n mapPow f = foldPow (_ ^_) (_,_ ∘ f) tt replicatePow : ∀ {α} {A : Set α} n -> A -> A ^ n replicatePow 0 x = tt replicatePow (suc n) x = x , replicatePow n x
oeis/083/A083045.asm
neoneye/loda-programs
11
55
; A083045: Main diagonal of table A083044. ; Submitted by <NAME>(s1) ; 1,6,17,35,68,122,224,383,656,1092,1841,2978,4859,7835,12776,20291,32664,51422,82485,129720,204821,319482,506060,789872,1237733,1927494,3024318,4687259,7274921,11271293,17578760,27133793,42125475,64909160 mov $1,3 mov $2,$0 lpb $2 add $1,$2 mul $1,3 add $1,5 div $1,2 sub $2,1 lpe mov $0,$1 sub $0,2
non_regression/switch_x86_macosx_2.s.asm
LRGH/plasmasm
1
177031
<reponame>LRGH/plasmasm .macosx_version_min 10, 12 .section __TEXT,__literal8,8byte_literals .align 3 LCPI0_0: .long 0 .long 1075576832 LCPI0_1: .long 0 .long 1067450368 # ---------------------- .section __TEXT,__text,regular,pure_instructions .align 4, 0x90 .globl _polgalois _polgalois: pushl %ebp pushl %ebx pushl %edi pushl %esi subl $124, %esp call L0$pb L0$pb: popl %edi movl %edi, 56(%esp) movl 144(%esp), %esi movl L_avma$non_lazy_ptr-L0$pb(%edi), %ebx movl %ebx, 60(%esp) movl (%ebx), %eax movl %eax, 32(%esp) movl (%esi), %ebp movl %ebp, %eax andl $-33554432, %eax cmpl $335544320, %eax je LBB0_2 leal L_.str-L0$pb(%edi), %eax movl %eax, 4(%esp) movl $22, (%esp) call _pari_err movl (%esi), %ebp LBB0_2: andl $16777215, %ebp movl %ebp, 52(%esp) movl %ebp, %eax addl $-3, %eax jle LBB0_3 cmpl $12, %eax movl %eax, 28(%esp) jl LBB0_7 leal L_.str1-L0$pb(%edi), %eax movl %eax, 4(%esp) movl $7, (%esp) jmp LBB0_6 LBB0_3: movl %eax, 28(%esp) leal L_.str-L0$pb(%edi), %eax movl %eax, 4(%esp) movl $21, (%esp) LBB0_6: call _pari_err LBB0_7: movl %esi, (%esp) call _Q_primpart movl %eax, %esi movl L_LOG2$non_lazy_ptr-L0$pb(%edi), %eax movsd LCPI0_0-L0$pb(%edi), %xmm0 divsd (%eax), %xmm0 mulsd LCPI0_1-L0$pb(%edi), %xmm0 movsd %xmm0, 40(%esp) leal L_.str3-L0$pb(%edi), %eax movl %eax, 36(%esp) jmp LBB0_8 .align 4, 0x90 LBB0_57: movl $0, (%ebx) movl $0, (%esp) call _tschirnhaus movl %eax, %esi LBB0_8: movl %esi, 68(%esp) movl %esi, (%esp) call _cauchy_bound fstpl 112(%esp) leal -7(%ebp), %eax cmpl $3, %eax ja LBB0_57 movl Ltmp0(%edi,%eax,4), %eax addl %edi, %eax jmp *%eax LBB0_10: movl %esi, 68(%esp) movl (%ebx), %eax movl L_bot$non_lazy_ptr-L0$pb(%edi), %ecx leal -28(%eax), %esi subl (%ecx), %eax cmpl $27, %eax ja LBB0_12 movl $14, (%esp) call _pari_err LBB0_12: movl %esi, (%ebx) movl $570425351, (%esi) cmpl $-9, 120(%esp) jge LBB0_13 movl $0, (%esp) call _ZX_is_squarefree testl %eax, %eax movl 68(%esp), %esi je LBB0_57 jmp LBB0_15 LBB0_31: movsd 112(%esp), %xmm0 movl (%ebx), %ecx movl %ecx, 84(%esp) leal -144(%ecx), %ebp movl L_bot$non_lazy_ptr-L0$pb(%edi), %eax subl (%eax), %ecx cmpl $143, %ecx ja LBB0_33 movl $14, (%esp) movsd %xmm0, 104(%esp) call _pari_err movsd 104(%esp), %xmm0 LBB0_33: movl %ebp, (%ebx) movl $570425380, (%ebp) movl %ebp, 64(%esp) mulsd 40(%esp), %xmm0 cvttsd2si %xmm0, %eax addl $4, %eax jmp LBB0_34 .align 4, 0x90 LBB0_43: movl 72(%esp), %eax leal -2(%eax,%eax), %eax movl 68(%esp), %esi LBB0_34: movl %eax, 72(%esp) movl %eax, 4(%esp) movl %esi, (%esp) xorl %edi, %edi movl $1, %ebx movl $5, %esi call _cleanroots movl %eax, %ecx movl %ecx, 88(%esp) .align 4, 0x90 LBB0_36: movl %esi, 80(%esp) movl %ebx, 92(%esp) leal 1(%ebx), %ebp movl %ebp, 76(%esp) .align 4, 0x90 LBB0_38: movl %edi, 96(%esp) incl %esi movl 92(%esp), %edi .align 4, 0x90 LBB0_39: movl (%ecx,%edi,4), %eax movl %ecx, %ebx movl (%ebx,%ebp,4), %ecx movl %ecx, 4(%esp) movl %eax, (%esp) call _gadd movl %ebx, %ecx movl %eax, %ebx incl %ebp decl %esi cmpl $7, %ebp jg LBB0_39 leal (%ecx,%ebp,4), %eax movl %eax, 104(%esp) movl 84(%esp), %eax movl 96(%esp), %ecx leal (%eax,%ecx,4), %eax movl %eax, 100(%esp) movl $-35, %edi .align 4, 0x90 LBB0_41: movl 104(%esp), %eax movl 140(%eax,%edi,4), %eax movl %eax, 4(%esp) movl %ebx, (%esp) call _gadd movl 100(%esp), %ecx movl %eax, (%ecx,%edi,4) leal 1(%ebp,%edi), %eax incl %edi cmpl $-27, %eax jne LBB0_41 movl 96(%esp), %edi addl %esi, %edi decl %esi cmpl $7, %ebp movl 88(%esp), %ecx jne LBB0_38 movl 80(%esp), %esi decl %esi movl 76(%esp), %ebx cmpl $6, %ebx jne LBB0_36 leal 120(%esp), %eax movl %eax, 4(%esp) movl 64(%esp), %eax movl %eax, (%esp) call _roots_to_ZX cmpl $-9, 120(%esp) jge LBB0_43 movl $0, (%esp) call _ZX_is_squarefree testl %eax, %eax movl 60(%esp), %ebx movl 56(%esp), %edi movl 52(%esp), %ebp movl 68(%esp), %esi je LBB0_57 movl $0, (%esp) call _ZX_factor movl 4(%eax), %eax movl (%eax), %ecx movl $16777215, %edx andl %edx, %ecx addl $-2, %ecx cmpl $3, %ecx jbe LBB0_46 movl 36(%esp), %eax movl %eax, 4(%esp) movl $2, (%esp) call _pari_err jmp LBB0_57 .align 4, 0x90 LBB0_13: jmp LBB0_13 LBB0_46: addl Ltmp1(%edi,%ecx,4), %edi jmp *%edi LBB0_47: movl %esi, (%esp) call _ZX_disc movl %eax, (%esp) movl $0, 4(%esp) call _Z_issquareall movl 32(%esp), %ecx movl %ecx, (%ebx) testl %eax, %eax je LBB0_49 movl 28(%esp), %eax movl %eax, (%esp) movl $6, 12(%esp) movl $1, 8(%esp) movl $2520, 4(%esp) jmp LBB0_59 LBB0_27: movl (%ebx), %eax movl L_bot$non_lazy_ptr-L0$pb(%edi), %ecx leal -28(%eax), %esi subl (%ecx), %eax cmpl $27, %eax ja LBB0_29 movl $14, (%esp) call _pari_err LBB0_29: movl %esi, (%ebx) movl $570425351, (%esi) .align 4, 0x90 LBB0_30: jmp LBB0_30 LBB0_15: movl $0, (%esp) call _ZX_factor movl 4(%eax), %eax movl $16777215, %ecx andl (%eax), %ecx cmpl $2, %ecx jne LBB0_18 movl %esi, (%esp) call _ZX_disc movl %eax, (%esp) movl $0, 4(%esp) call _Z_issquareall movl 32(%esp), %ecx movl %ecx, (%ebx) testl %eax, %eax je LBB0_58 movl 28(%esp), %eax movl %eax, (%esp) movl $4, 12(%esp) movl $1, 8(%esp) movl $12, 4(%esp) jmp LBB0_59 LBB0_50: movl 4(%eax), %ecx movl $16777215, %eax andl (%ecx), %eax movl 32(%esp), %ecx movl %ecx, (%ebx) cmpl $10, %eax je LBB0_52 cmpl $31, %eax jne LBB0_53 LBB0_52: movl 28(%esp), %eax movl %eax, (%esp) movl $5, 12(%esp) movl $1, 8(%esp) movl $168, 4(%esp) jmp LBB0_59 LBB0_54: movl 32(%esp), %eax movl %eax, (%ebx) movl 28(%esp), %eax movl %eax, (%esp) movl $3, 12(%esp) movl $1, 8(%esp) movl $21, 4(%esp) jmp LBB0_59 LBB0_55: movl 32(%esp), %eax movl %eax, (%ebx) movl 28(%esp), %eax movl %eax, (%esp) movl $2, 12(%esp) movl $-1, 8(%esp) movl $14, 4(%esp) jmp LBB0_59 LBB0_18: leal L_.str2-L0$pb(%edi), %eax movl %eax, 4(%esp) movl $2, (%esp) call _pari_err LBB0_19: movl (%ebx), %eax movl L_bot$non_lazy_ptr-L0$pb(%edi), %esi leal -28(%eax), %edi subl (%esi), %eax cmpl $27, %eax ja LBB0_21 movl $14, (%esp) call _pari_err LBB0_21: movl %edi, (%ebx) movl $570425351, (%edi) movl (%ebx), %eax leal -28(%eax), %edi subl (%esi), %eax cmpl $27, %eax ja LBB0_23 movl $14, (%esp) call _pari_err LBB0_23: movl %edi, (%ebx) movl $738197511, (%edi) movl (%ebx), %eax leal -28(%eax), %edi subl (%esi), %eax cmpl $27, %eax ja LBB0_25 movl $14, (%esp) call _pari_err LBB0_25: movl %edi, (%ebx) movl $738197511, (%edi) .align 4, 0x90 LBB0_26: jmp LBB0_26 LBB0_49: movl 28(%esp), %eax movl %eax, (%esp) movl $7, 12(%esp) movl $-1, 8(%esp) movl $5040, 4(%esp) jmp LBB0_59 LBB0_58: movl 28(%esp), %eax movl %eax, (%esp) movl $5, 12(%esp) movl $-1, 8(%esp) movl $24, 4(%esp) jmp LBB0_59 LBB0_53: movl 28(%esp), %eax movl %eax, (%esp) movl $4, 12(%esp) movl $-1, 8(%esp) movl $42, 4(%esp) LBB0_59: call _galois_res addl $124, %esp popl %esi popl %edi popl %ebx popl %ebp ret .align 2, 0x90 LJTI0_0: .long L0_0_set_10 .long L0_0_set_19 .long L0_0_set_27 .long L0_0_set_31 LJTI0_1: .long L0_1_set_47 .long L0_1_set_50 .long L0_1_set_54 .long L0_1_set_55 # ---------------------- .section __TEXT,__literal16,16byte_literals .align 4 LCPI1_0: .long -1 .long -2 .long -3 .long -4 .align 4 LCPI2_0: .long -1 .long -2 .long -3 .long -4 .align 4 LCPI3_0: .long -1 .long -2 .long -3 .long -4 .align 4 LCPI5_0: .long -1 .long -2 .long -3 .long -4 LCPI5_1: .long 0 .long 1 .long 2 .long 3 LCPI5_2: .long 4 .long 5 .long 6 .long 7 # ---------------------- .section __TEXT,__text,regular,pure_instructions .align 4, 0x90 .globl _nfpoleval _nfpoleval: pushl %ebp pushl %ebx pushl %edi pushl %esi subl $44, %esp call L1$pb L1$pb: popl %ecx movl 68(%esp), %ebp movl $16777215, %esi andl (%ebp), %esi cmpl $2, %esi jne LBB1_2 movl L_gen_0$non_lazy_ptr-L1$pb(%ecx), %eax movl (%eax), %ecx jmp LBB1_48 LBB1_2: movl 64(%esp), %edi movl L_avma$non_lazy_ptr-L1$pb(%ecx), %eax movl %ecx, 36(%esp) movl %eax, 32(%esp) movl (%eax), %ebx movl -4(%ebp,%esi,4), %eax movl %eax, 4(%esp) movl %edi, (%esp) call _nf_to_scalar_or_basis addl $-2, %esi cmpl $2, %esi jl LBB1_3 movl %ebx, 40(%esp) movl 72(%esp), %ebx .align 4, 0x90 LBB1_5: movl %eax, 8(%esp) movl %ebx, 4(%esp) movl %edi, (%esp) call _nfmul movl (%ebp,%esi,4), %ecx movl %ecx, 8(%esp) movl %eax, 4(%esp) movl %edi, (%esp) call _nfadd decl %esi cmpl $1, %esi jg LBB1_5 jmp LBB1_6 LBB1_3: movl %ebx, 40(%esp) LBB1_6: movl 36(%esp), %edx movl L_bot$non_lazy_ptr-L1$pb(%edx), %ecx cmpl (%ecx), %eax movl 40(%esp), %ebx jb LBB1_9 cmpl %eax, %ebx jbe LBB1_9 movl L_top$non_lazy_ptr-L1$pb(%edx), %ecx cmpl (%ecx), %eax jae LBB1_9 movl (%eax), %edi movl %edi, %ecx shrl $25, %ecx leal -21(%ecx), %esi cmpl $2, %esi jb LBB1_31 cmpl $2, %ecx jne LBB1_12 LBB1_31: movl %edi, %esi andl $16777215, %esi shll $2, %esi movl %ebx, %ecx subl %esi, %ecx movl %edi, %ebp andl $16777215, %ebp movl 32(%esp), %edx movl %ecx, (%edx) je LBB1_48 movl %ecx, 32(%esp) movl %edi, %ebx movl %edi, 28(%esp) orl $-16777216, %ebx movl %ebx, %edi xorl $16777215, %edi cmpl $-16777216, %ebx movl $-2, %edx movl $-2, %ecx cmove %edi, %ecx leal (%ecx,%ebp), %esi cmpl $-2, %esi jne LBB1_34 movl 32(%esp), %ecx jmp LBB1_42 LBB1_9: movl 32(%esp), %ecx movl %ebx, (%ecx) movl %eax, %ecx LBB1_48: movl %ecx, %eax LBB1_49: addl $44, %esp popl %esi popl %edi popl %ebx popl %ebp ret LBB1_12: cmpl $1, %ecx jne LBB1_50 movl 4(%eax), %edi movl %edi, %esi andl $16777215, %esi movl %esi, 28(%esp) leal 0(,%esi,4), %edx movl %ebx, %ecx movl %edi, %ebx subl %edx, %ecx cmpl $2, %esi jb LBB1_30 movl %ebx, %ebp andl $16777215, %ebp movl %ebp, %edi negl %edi cmpl $-3, %edi movl $-2, %esi cmovg %edi, %esi addl %ebp, %esi cmpl $-1, %esi movl 28(%esp), %edx je LBB1_23 movl %ebx, 24(%esp) incl %esi cmpl $-3, %edi movl $-2, %edx cmovg %edi, %edx movl %edi, 16(%esp) movl %esi, %ebx andl $-8, %ebx je LBB1_16 movl %ebx, 12(%esp) movl %esi, 20(%esp) movl %edx, %ebx notl %ebx leal (%eax,%ebx,4), %esi movl 40(%esp), %ebx leal -4(%ebx), %edi cmpl %esi, %edi movl $0, %esi ja LBB1_19 leal -4(%eax,%ebp,4), %edi addl %ebp, %edx notl %edx leal (%ebx,%edx,4), %edx cmpl %edx, %edi movl 28(%esp), %edx jbe LBB1_22 LBB1_19: movl 28(%esp), %edx subl 12(%esp), %edx movl 16(%esp), %esi cmpl $-3, %esi movl $-2, %edi cmovg %esi, %edi leal 1(%edi,%ebp), %esi andl $-8, %esi movl 36(%esp), %edi movdqa LCPI1_0-L1$pb(%edi), %xmm0 LBB1_20: movd %ebp, %xmm1 pshufd $0, %xmm1, %xmm1 paddd %xmm0, %xmm1 movd %xmm1, %edi movups -12(%eax,%edi,4), %xmm1 movups -28(%eax,%edi,4), %xmm2 subl 28(%esp), %edi movups %xmm1, -12(%ebx,%edi,4) movups %xmm2, -28(%ebx,%edi,4) addl $-8, %ebp addl $-8, %esi jne LBB1_20 movl 12(%esp), %esi jmp LBB1_22 LBB1_34: movl %ecx, 20(%esp) addl $2, %esi cmpl $-16777216, %ebx cmovne %edx, %edi xorl %ecx, %ecx movl %esi, %edx andl $-8, %edx je LBB1_35 movl %edx, 12(%esp) movl %esi, 24(%esp) movl $-2, %esi movl $-2, %ebx subl %edi, %ebx leal (%eax,%ebx,4), %edx movl %edx, 16(%esp) movl 40(%esp), %edx leal -4(%edx), %ebx cmpl 16(%esp), %ebx ja LBB1_38 leal -4(%eax,%ebp,4), %ebx addl %ebp, %edi subl %edi, %esi movl 40(%esp), %edx leal (%edx,%esi,4), %edi cmpl %edi, %ebx jbe LBB1_41 LBB1_38: movl %ebp, %ecx subl 12(%esp), %ecx movl %ecx, 16(%esp) movl 20(%esp), %ecx leal 2(%ecx,%ebp), %esi andl $-8, %esi movl 36(%esp), %edx movdqa LCPI1_0-L1$pb(%edx), %xmm0 movl %ebp, %ebx movl 40(%esp), %edx .align 4, 0x90 LBB1_39: movd %ebx, %xmm1 pshufd $0, %xmm1, %xmm1 paddd %xmm0, %xmm1 movd %xmm1, %edi movups -12(%eax,%edi,4), %xmm1 movups -28(%eax,%edi,4), %xmm2 subl %ebp, %edi movups %xmm1, -12(%edx,%edi,4) movups %xmm2, -28(%edx,%edi,4) addl $-8, %ebx addl $-8, %esi jne LBB1_39 movl 16(%esp), %ebp movl 12(%esp), %ecx jmp LBB1_41 LBB1_50: andl $16777215, %edi leal (%eax,%edi,4), %ecx movl %eax, 8(%esp) movl %ebx, (%esp) movl %ecx, 4(%esp) call _gerepile jmp LBB1_49 LBB1_35: movl %esi, 24(%esp) LBB1_41: cmpl %ecx, 24(%esp) movl $-2, %edx movl 32(%esp), %ecx je LBB1_48 LBB1_42: movl %ebp, %ebx notl %ebx cmpl $-3, %ebx cmovg %ebx, %edx leal 2(%ebp,%edx), %esi leal 1(%ebp,%edx), %edx movl %edx, 36(%esp) movl %esi, %edx testb $3, %dl je LBB1_45 movl 28(%esp), %edi notl %edi orl $1056964608, %edi movl 40(%esp), %edx leal (%edx,%edi,4), %edi cmpl $-3, %ebx movl $-2, %esi cmovg %ebx, %esi leal 2(%ebp,%esi), %ebx andl $3, %ebx negl %ebx .align 4, 0x90 LBB1_44: movl -4(%eax,%ebp,4), %esi movl %esi, (%edi,%ebp,4) leal -1(%ebp), %ebp incl %ebx jne LBB1_44 LBB1_45: cmpl $3, 36(%esp) jb LBB1_48 incl %ebp movl 28(%esp), %edx andl $16777215, %edx movl $-4, %esi subl %edx, %esi movl 40(%esp), %edx leal (%edx,%esi,4), %edx .align 4, 0x90 LBB1_47: movl -8(%eax,%ebp,4), %esi movl %esi, 8(%edx,%ebp,4) movl -12(%eax,%ebp,4), %esi movl %esi, 4(%edx,%ebp,4) movl -16(%eax,%ebp,4), %esi movl %esi, (%edx,%ebp,4) movl -20(%eax,%ebp,4), %esi movl %esi, -4(%edx,%ebp,4) addl $-4, %ebp cmpl $1, %ebp jg LBB1_47 jmp LBB1_48 LBB1_16: movl %esi, 20(%esp) movl 28(%esp), %edx xorl %esi, %esi LBB1_22: cmpl %esi, 20(%esp) movl 24(%esp), %ebx je LBB1_30 LBB1_23: movl %ebx, %esi movl %edx, %ebp negl %ebp cmpl $-3, %ebp movl $-2, %ebx cmovg %ebp, %ebx leal (%edx,%ebx), %edi leal 1(%edx,%ebx), %ebx testb $3, %bl je LBB1_24 movl %edi, 36(%esp) movl %esi, 24(%esp) movl %esi, %edi notl %edi orl $1056964608, %edi movl 40(%esp), %esi leal (%esi,%edi,4), %edi cmpl $-3, %ebp movl $-2, %ebx cmovg %ebp, %ebx leal 1(%edx,%ebx), %ebx andl $3, %ebx negl %ebx LBB1_26: movl -4(%eax,%edx,4), %ebp movl %ebp, (%edi,%edx,4) leal -1(%edx), %edx incl %ebx jne LBB1_26 jmp LBB1_27 LBB1_24: movl %edi, 36(%esp) movl %esi, 24(%esp) LBB1_27: cmpl $3, 36(%esp) movl 40(%esp), %esi movl 24(%esp), %edi jb LBB1_30 notl %edi orl $1056964608, %edi leal (%esi,%edi,4), %esi LBB1_29: movl -4(%eax,%edx,4), %edi movl %edi, (%esi,%edx,4) movl -8(%eax,%edx,4), %edi movl %edi, -4(%esi,%edx,4) movl -12(%eax,%edx,4), %edi movl %edi, -8(%esi,%edx,4) movl -16(%eax,%edx,4), %edi movl %edi, -12(%esi,%edx,4) leal -4(%edx), %edx cmpl $1, %edx jg LBB1_29 LBB1_30: movl 28(%esp), %eax orl $33554432, %eax movl %eax, (%ecx) movl 32(%esp), %eax movl %ecx, (%eax) jmp LBB1_48 # ---------------------- .align 4, 0x90 .globl _FpX_FpC_nfpoleval _FpX_FpC_nfpoleval: pushl %ebp pushl %ebx pushl %edi pushl %esi subl $92, %esp call L2$pb L2$pb: popl %ebx movl 116(%esp), %ecx movl 112(%esp), %eax movl L_avma$non_lazy_ptr-L2$pb(%ebx), %edx movl %edx, 88(%esp) movl $16777215, %edi andl (%ecx), %edi movl 4(%eax), %ecx movl (%ecx), %ecx movl %ecx, %esi andl $16777215, %esi cmpl $2, %edi movl (%edx), %edx leal -3(%esi), %ebp jne LBB2_13 movl %ecx, 72(%esp) movl %ebp, 76(%esp) leal -2(%esi), %ebp movl $2, %eax subl %esi, %eax leal (%edx,%eax,4), %eax movl %eax, 80(%esp) movl L_bot$non_lazy_ptr-L2$pb(%ebx), %eax movl %ebx, 84(%esp) movl %edx, %ecx subl (%eax), %ecx shrl $2, %ecx cmpl %ebp, %ecx movl %edx, %edi jae LBB2_3 movl $14, (%esp) call _pari_err LBB2_3: movl 88(%esp), %eax movl 80(%esp), %ecx movl %ecx, (%eax) cmpl $16777216, %ebp movl %ecx, %ebx jb LBB2_5 movl 84(%esp), %eax leal L_.str7-L2$pb(%eax), %eax movl %eax, 4(%esp) movl $15, (%esp) call _pari_err LBB2_5: orl $603979776, %ebp movl %ebp, (%ebx) movl 76(%esp), %edx testl %edx, %edx jle LBB2_117 leal -4(%esi), %ecx movl $1, %eax testb $3, %dl je LBB2_10 movl $3, %eax subl %esi, %eax leal (%edi,%eax,4), %edx movl %edi, 60(%esp) movl 72(%esp), %eax incb %al movzbl %al, %ebx andl $3, %ebx xorl %eax, %eax movl 84(%esp), %edi movl L_gen_0$non_lazy_ptr-L2$pb(%edi), %ebp .align 4, 0x90 LBB2_8: movl (%ebp), %edi movl %edi, (%edx,%eax,4) incl %eax cmpl %eax, %ebx jne LBB2_8 incl %eax movl 60(%esp), %edi movl 80(%esp), %ebx LBB2_10: cmpl $3, %ecx jb LBB2_117 addl $2, %eax subl %esi, %eax movl 84(%esp), %ecx movl L_gen_0$non_lazy_ptr-L2$pb(%ecx), %ecx .align 4, 0x90 LBB2_12: movl (%ecx), %edx movl %edx, (%edi,%eax,4) movl (%ecx), %edx movl %edx, 4(%edi,%eax,4) movl (%ecx), %edx movl %edx, 8(%edi,%eax,4) movl (%ecx), %edx movl %edx, 12(%edi,%eax,4) addl $4, %eax jne LBB2_12 jmp LBB2_117 LBB2_13: movl %ebx, 84(%esp) movl %edx, 60(%esp) movl 124(%esp), %esi movl 120(%esp), %ecx movl %ecx, 4(%esp) movl %eax, (%esp) call _zk_multable movl %esi, 4(%esp) movl %eax, (%esp) call _FpM_red movl %eax, %ebx movl %ebx, 80(%esp) movl 116(%esp), %eax movl -4(%eax,%edi,4), %eax movl %ebp, 4(%esp) movl %eax, (%esp) call _scalarcol movl %eax, %ebp addl $-2, %edi cmpl $2, %edi jl LBB2_73 movl 84(%esp), %eax movdqa LCPI2_0-L2$pb(%eax), %xmm0 movdqa %xmm0, 32(%esp) .align 4, 0x90 LBB2_15: movl %esi, 8(%esp) movl %ebp, 4(%esp) movl %ebx, (%esp) call _FpM_FpC_mul movl %eax, %ebp movl 4(%ebp), %eax movl 116(%esp), %ecx movl (%ecx,%edi,4), %ecx movl 88(%esp), %edx movl (%edx), %ebx movl 4(%eax), %edx sarl $30, %edx movl 4(%ecx), %esi sarl $30, %esi movl %esi, 12(%esp) movl %ecx, 8(%esp) movl %edx, 4(%esp) movl %eax, (%esp) call _addii_sign movl %eax, %edx movl 4(%edx), %eax sarl $30, %eax testl %eax, %eax je LBB2_16 jle LBB2_47 movl 124(%esp), %esi cmpl %esi, %edx je LBB2_19 movl %ebp, 76(%esp) movl 4(%esi), %ecx sarl $30, %ecx negl %ecx movl %ecx, 12(%esp) movl %esi, 8(%esp) movl %eax, 4(%esp) movl %edx, (%esp) movl %edx, 72(%esp) call _addii_sign movl %eax, %ebp jmp LBB2_21 .align 4, 0x90 LBB2_16: movl 124(%esp), %esi jmp LBB2_72 .align 4, 0x90 LBB2_47: movl 124(%esp), %eax movl %eax, 4(%esp) movl %edx, (%esp) call _modii movl 84(%esp), %esi jmp LBB2_48 LBB2_19: movl %edx, 72(%esp) movl %ebp, 76(%esp) movl 84(%esp), %eax movl L_gen_0$non_lazy_ptr-L2$pb(%eax), %eax movl (%eax), %ebp LBB2_21: movl 4(%ebp), %eax sarl $30, %eax testl %eax, %eax je LBB2_22 js LBB2_24 movl %esi, 4(%esp) movl %ebp, (%esp) call _cmpii testl %eax, %eax movl %esi, %eax movl 84(%esp), %esi js LBB2_26 movl %eax, 4(%esp) movl %ebp, (%esp) movl $1, 8(%esp) call _dvmdii movl 76(%esp), %ebp LBB2_48: movl L_bot$non_lazy_ptr-L2$pb(%esi), %ecx cmpl (%ecx), %eax jb LBB2_49 cmpl %eax, %ebx jbe LBB2_49 movl L_top$non_lazy_ptr-L2$pb(%esi), %ecx cmpl (%ecx), %eax jae LBB2_49 movl %esi, 84(%esp) movl %ebp, 76(%esp) movl 4(%eax), %ebp movl %ebp, 64(%esp) andl $16777215, %ebp movl %ebp, 68(%esp) leal 0(,%ebp,4), %edx movl %ebx, %esi subl %edx, %esi movl %esi, 72(%esp) cmpl $2, %ebp jb LBB2_69 movl 64(%esp), %edx andl $16777215, %edx movl %edx, %ecx negl %ecx cmpl $-3, %ecx movl $-2, %esi cmovg %ecx, %esi leal (%esi,%edx), %ebp cmpl $-1, %ebp movl 68(%esp), %ebp je LBB2_62 movl %ebx, 56(%esp) leal 1(%esi,%edx), %ebx movl %ebx, 48(%esp) movl 64(%esp), %ebp leal 1(%ebp,%esi), %ebp andl $7, %ebp cmpl $-3, %ecx movl $-2, %esi cmovg %ecx, %esi movl $0, 52(%esp) subl %ebp, %ebx jne LBB2_56 movl 68(%esp), %ecx movl %ecx, %ebp jmp LBB2_61 .align 4, 0x90 LBB2_49: movl %esi, 84(%esp) movl %eax, %edx jmp LBB2_71 LBB2_22: movl 88(%esp), %eax movl %ebx, (%eax) movl 84(%esp), %eax movl L_gen_0$non_lazy_ptr-L2$pb(%eax), %eax movl (%eax), %edx movl 76(%esp), %ebp jmp LBB2_72 LBB2_24: movl 88(%esp), %eax movl 72(%esp), %edx movl %edx, (%eax) movl 76(%esp), %ebp jmp LBB2_72 LBB2_26: movl L_bot$non_lazy_ptr-L2$pb(%esi), %eax cmpl (%eax), %ebp jb LBB2_27 cmpl %ebp, %ebx jbe LBB2_27 movl L_top$non_lazy_ptr-L2$pb(%esi), %eax cmpl (%eax), %ebp jae LBB2_27 movl 4(%ebp), %esi movl %esi, 64(%esp) andl $16777215, %esi movl %esi, 68(%esp) leal 0(,%esi,4), %ecx movl %ebx, %edx subl %ecx, %edx movl %edx, 72(%esp) cmpl $2, %esi jb LBB2_69 movl 64(%esp), %ecx andl $16777215, %ecx movl %ecx, %eax negl %eax cmpl $-3, %eax movl $-2, %esi cmovg %eax, %esi leal (%esi,%ecx), %edx cmpl $-1, %edx movl 68(%esp), %edx je LBB2_39 movl %ebx, 56(%esp) leal 1(%esi,%ecx), %ebx movl %ebx, 48(%esp) movl 64(%esp), %edx leal 1(%edx,%esi), %esi andl $7, %esi cmpl $-3, %eax movl $-2, %edx cmovg %eax, %edx movl $0, 52(%esp) subl %esi, %ebx jne LBB2_34 movl 68(%esp), %edx jmp LBB2_38 LBB2_27: movl %ebp, %edx jmp LBB2_70 LBB2_56: movl %ecx, 24(%esp) movl %ebx, 28(%esp) movl %esi, %ebp notl %ebp leal (%eax,%ebp,4), %ebx movl 56(%esp), %ecx leal -4(%ecx), %ebp cmpl %ebx, %ebp movl 68(%esp), %ecx ja LBB2_58 leal -4(%eax,%edx,4), %ebp addl %edx, %esi notl %esi movl 56(%esp), %ebx leal (%ebx,%esi,4), %esi cmpl %esi, %ebp movl %ecx, %ebp jbe LBB2_61 LBB2_58: movl %ecx, %ebp subl 28(%esp), %ebp movl 24(%esp), %ebx cmpl $-3, %ebx movl $-2, %ecx cmovle %ecx, %ebx movl 64(%esp), %ecx leal 1(%ecx,%ebx), %esi andl $7, %esi subl %ebx, %esi decl %esi movdqa 32(%esp), %xmm2 movl 56(%esp), %ebx .align 4, 0x90 LBB2_59: movd %edx, %xmm0 pshufd $0, %xmm0, %xmm0 paddd %xmm2, %xmm0 movd %xmm0, %ecx movdqu -12(%eax,%ecx,4), %xmm0 movups -28(%eax,%ecx,4), %xmm1 subl 68(%esp), %ecx movdqu %xmm0, -12(%ebx,%ecx,4) movups %xmm1, -28(%ebx,%ecx,4) addl $-8, %edx cmpl %edx, %esi jne LBB2_59 movl 28(%esp), %ecx movl %ecx, 52(%esp) movl 68(%esp), %ecx LBB2_61: movl %ecx, 68(%esp) movl 52(%esp), %ecx cmpl %ecx, 48(%esp) movl 56(%esp), %ebx je LBB2_69 LBB2_62: movl %ebp, %edx negl %edx cmpl $-3, %edx movl $-2, %esi cmovg %edx, %esi leal 1(%ebp,%esi), %ecx addl %ebp, %esi testb $3, %cl je LBB2_63 movl %esi, 56(%esp) movl 64(%esp), %ecx andl $16777215, %ecx shll $2, %ecx movl %ebx, %esi subl %ecx, %esi addl $-4, %esi cmpl $-3, %edx movl $-2, %ecx cmovle %ecx, %edx leal 1(%ebp,%edx), %edx andl $3, %edx negl %edx .align 4, 0x90 LBB2_65: movl -4(%eax,%ebp,4), %ecx movl %ecx, (%esi,%ebp,4) leal -1(%ebp), %ebp incl %edx jne LBB2_65 jmp LBB2_66 LBB2_63: movl %esi, 56(%esp) LBB2_66: cmpl $3, 56(%esp) movl 64(%esp), %ecx jb LBB2_69 andl $16777215, %ecx shll $2, %ecx subl %ecx, %ebx addl $-4, %ebx .align 4, 0x90 LBB2_68: movl -4(%eax,%ebp,4), %ecx movl %ecx, (%ebx,%ebp,4) movl -8(%eax,%ebp,4), %ecx movl %ecx, -4(%ebx,%ebp,4) movl -12(%eax,%ebp,4), %ecx movl %ecx, -8(%ebx,%ebp,4) movl -16(%eax,%ebp,4), %ecx movl %ecx, -12(%ebx,%ebp,4) leal -4(%ebp), %ebp cmpl $1, %ebp jg LBB2_68 jmp LBB2_69 LBB2_34: movl %eax, 24(%esp) movl %edx, %esi notl %esi leal (%ebp,%esi,4), %eax movl %eax, 28(%esp) movl 56(%esp), %eax leal -4(%eax), %esi cmpl 28(%esp), %esi ja LBB2_36 leal -4(%ebp,%ecx,4), %esi addl %ecx, %edx notl %edx movl 56(%esp), %eax leal (%eax,%edx,4), %edx cmpl %edx, %esi movl 68(%esp), %edx jbe LBB2_38 LBB2_36: movl 68(%esp), %edx subl %ebx, %edx movl %ebx, 52(%esp) movl 24(%esp), %ebx cmpl $-3, %ebx movl $-2, %eax cmovle %eax, %ebx movl 64(%esp), %eax leal 1(%eax,%ebx), %esi andl $7, %esi subl %ebx, %esi decl %esi movdqa 32(%esp), %xmm2 movl 56(%esp), %ebx .align 4, 0x90 LBB2_37: movd %ecx, %xmm0 pshufd $0, %xmm0, %xmm0 paddd %xmm2, %xmm0 movd %xmm0, %eax movdqu -12(%ebp,%eax,4), %xmm0 movups -28(%ebp,%eax,4), %xmm1 subl 68(%esp), %eax movdqu %xmm0, -12(%ebx,%eax,4) movups %xmm1, -28(%ebx,%eax,4) addl $-8, %ecx cmpl %ecx, %esi jne LBB2_37 LBB2_38: movl 52(%esp), %eax cmpl %eax, 48(%esp) movl 56(%esp), %ebx je LBB2_69 LBB2_39: movl %edx, %esi negl %esi cmpl $-3, %esi movl $-2, %ecx cmovg %esi, %ecx leal 1(%edx,%ecx), %eax addl %edx, %ecx testb $3, %al je LBB2_40 movl %ecx, 56(%esp) movl 64(%esp), %eax andl $16777215, %eax shll $2, %eax movl %ebx, %ecx subl %eax, %ecx addl $-4, %ecx cmpl $-3, %esi movl $-2, %eax cmovle %eax, %esi leal 1(%edx,%esi), %esi andl $3, %esi negl %esi .align 4, 0x90 LBB2_42: movl -4(%ebp,%edx,4), %eax movl %eax, (%ecx,%edx,4) leal -1(%edx), %edx incl %esi jne LBB2_42 jmp LBB2_43 LBB2_40: movl %ecx, 56(%esp) LBB2_43: cmpl $3, 56(%esp) movl 64(%esp), %eax jb LBB2_69 andl $16777215, %eax shll $2, %eax subl %eax, %ebx addl $-4, %ebx .align 4, 0x90 LBB2_45: movl -4(%ebp,%edx,4), %eax movl %eax, (%ebx,%edx,4) movl -8(%ebp,%edx,4), %eax movl %eax, -4(%ebx,%edx,4) movl -12(%ebp,%edx,4), %eax movl %eax, -8(%ebx,%edx,4) movl -16(%ebp,%edx,4), %eax movl %eax, -12(%ebx,%edx,4) leal -4(%edx), %edx cmpl $1, %edx jg LBB2_45 LBB2_69: movl 68(%esp), %eax orl $33554432, %eax movl 72(%esp), %edx movl %eax, (%edx) movl %edx, %ebx LBB2_70: movl 76(%esp), %ebp LBB2_71: movl 124(%esp), %esi movl 88(%esp), %eax movl %ebx, (%eax) LBB2_72: movl %edx, 4(%ebp) decl %edi cmpl $1, %edi movl 80(%esp), %ebx jg LBB2_15 LBB2_73: movl 84(%esp), %ecx movl L_bot$non_lazy_ptr-L2$pb(%ecx), %eax cmpl (%eax), %ebp movl 60(%esp), %esi jb LBB2_76 cmpl %ebp, %esi jbe LBB2_76 movl L_top$non_lazy_ptr-L2$pb(%ecx), %eax cmpl (%eax), %ebp jae LBB2_76 movl (%ebp), %edx movl %edx, %eax shrl $25, %eax leal -21(%eax), %ecx cmpl $2, %ecx jb LBB2_98 cmpl $2, %eax jne LBB2_79 LBB2_98: movl %edx, %eax andl $16777215, %eax shll $2, %eax movl %esi, %ebx subl %eax, %ebx movl %edx, %ecx andl $16777215, %ecx movl 88(%esp), %eax movl %ebx, (%eax) je LBB2_117 movl %ebx, 80(%esp) movl %ebp, 76(%esp) movl %edx, %eax orl $-16777216, %eax movl %eax, %ebx xorl $16777215, %ebx cmpl $-16777216, %eax movl $-2, %esi movl $-2, %ebp cmove %ebx, %ebp leal (%ebp,%ecx), %edi cmpl $-2, %edi jne LBB2_106 movl 76(%esp), %ebp jmp LBB2_101 LBB2_76: movl 88(%esp), %eax movl %esi, (%eax) movl %ebp, %ebx LBB2_117: movl %ebx, %eax LBB2_118: addl $92, %esp popl %esi popl %edi popl %ebx popl %ebp ret LBB2_79: cmpl $1, %eax jne LBB2_119 movl 4(%ebp), %ecx movl %ecx, %edi andl $16777215, %edi leal 0(,%edi,4), %edx subl %edx, %esi movl %esi, 80(%esp) cmpl $2, %edi movl %ebp, 76(%esp) jb LBB2_97 movl %ecx, %ebp andl $16777215, %ebp movl %ebp, %esi negl %esi cmpl $-3, %esi movl $-2, %ebx movl $-2, %eax cmovg %esi, %eax addl %ebp, %eax cmpl $-1, %eax movl %edi, %edx je LBB2_90 incl %eax cmpl $-3, %esi movl $-2, %edx cmovg %esi, %edx movl $0, 68(%esp) movl %eax, %ebx andl $-8, %ebx je LBB2_83 movl %ebx, 56(%esp) movl %eax, 64(%esp) movl %ecx, 72(%esp) movl %edi, %ebx movl %edx, %edi notl %edi movl 76(%esp), %eax leal (%eax,%edi,4), %eax movl 60(%esp), %ecx leal -4(%ecx), %edi cmpl %eax, %edi movl %ebx, %edi ja LBB2_86 movl 76(%esp), %eax movl %edi, %ebx leal -4(%eax,%ebp,4), %edi addl %ebp, %edx notl %edx movl 60(%esp), %ecx leal (%ecx,%edx,4), %edx cmpl %edx, %edi movl %ebx, %edi movl %edi, %edx jbe LBB2_89 LBB2_86: movl %edi, %edx subl 56(%esp), %edx cmpl $-3, %esi movl %edi, %ebx movl $-2, %edi cmovg %esi, %edi leal 1(%edi,%ebp), %esi andl $-8, %esi movl 84(%esp), %eax movdqa LCPI2_0-L2$pb(%eax), %xmm0 movl 60(%esp), %ecx movl 76(%esp), %eax LBB2_87: movd %ebp, %xmm1 pshufd $0, %xmm1, %xmm1 paddd %xmm0, %xmm1 movd %xmm1, %edi movups -12(%eax,%edi,4), %xmm1 movdqu -28(%eax,%edi,4), %xmm2 subl %ebx, %edi movups %xmm1, -12(%ecx,%edi,4) movdqu %xmm2, -28(%ecx,%edi,4) addl $-8, %ebp addl $-8, %esi jne LBB2_87 movl 56(%esp), %eax movl %eax, 68(%esp) movl %ebx, %edi jmp LBB2_89 LBB2_106: addl $2, %edi cmpl $-16777216, %eax cmovne %esi, %ebx xorl %esi, %esi movl %edi, %eax andl $-8, %eax je LBB2_107 movl %eax, 72(%esp) movl %edi, 88(%esp) movl $-2, %eax movl $-2, %edi subl %ebx, %edi movl 76(%esp), %esi leal (%esi,%edi,4), %esi movl 60(%esp), %edi leal -4(%edi), %edi cmpl %esi, %edi ja LBB2_110 movl 76(%esp), %esi leal -4(%esi,%ecx,4), %edi xorl %esi, %esi addl %ecx, %ebx subl %ebx, %eax movl 60(%esp), %ebx leal (%ebx,%eax,4), %eax cmpl %eax, %edi jbe LBB2_113 LBB2_110: movl %ecx, %eax subl 72(%esp), %eax movl %eax, 68(%esp) leal 2(%ebp,%ecx), %ebp andl $-8, %ebp movl 84(%esp), %eax movdqa LCPI2_0-L2$pb(%eax), %xmm0 movl %ecx, %ebx movl 60(%esp), %edi movl 76(%esp), %esi .align 4, 0x90 LBB2_111: movd %ebx, %xmm1 pshufd $0, %xmm1, %xmm1 paddd %xmm0, %xmm1 movd %xmm1, %eax movups -12(%esi,%eax,4), %xmm1 movdqu -28(%esi,%eax,4), %xmm2 subl %ecx, %eax movups %xmm1, -12(%edi,%eax,4) movdqu %xmm2, -28(%edi,%eax,4) addl $-8, %ebx addl $-8, %ebp jne LBB2_111 movl 68(%esp), %ecx movl 72(%esp), %esi jmp LBB2_113 LBB2_119: andl $16777215, %edx leal (%ebp,%edx,4), %eax movl %ebp, 8(%esp) movl %esi, (%esp) movl %eax, 4(%esp) call _gerepile jmp LBB2_118 LBB2_107: movl %edi, 88(%esp) LBB2_113: cmpl %esi, 88(%esp) movl 76(%esp), %ebp movl $-2, %esi jne LBB2_101 movl 80(%esp), %ebx jmp LBB2_117 LBB2_101: movl %ecx, %ebx notl %ebx cmpl $-3, %ebx cmovg %ebx, %esi leal 2(%ecx,%esi), %eax leal 1(%ecx,%esi), %edi testb $3, %al je LBB2_104 movl %edx, %eax notl %eax orl $1056964608, %eax movl 60(%esp), %esi leal (%esi,%eax,4), %esi cmpl $-3, %ebx movl $-2, %eax cmovg %ebx, %eax leal 2(%ecx,%eax), %ebx andl $3, %ebx negl %ebx .align 4, 0x90 LBB2_103: movl -4(%ebp,%ecx,4), %eax movl %eax, (%esi,%ecx,4) leal -1(%ecx), %ecx incl %ebx jne LBB2_103 LBB2_104: cmpl $3, %edi jae LBB2_115 movl 80(%esp), %ebx jmp LBB2_117 LBB2_115: incl %ecx andl $16777215, %edx movl $-4, %eax subl %edx, %eax movl 60(%esp), %edx leal (%edx,%eax,4), %eax movl 80(%esp), %ebx .align 4, 0x90 LBB2_116: movl -8(%ebp,%ecx,4), %edx movl %edx, 8(%eax,%ecx,4) movl -12(%ebp,%ecx,4), %edx movl %edx, 4(%eax,%ecx,4) movl -16(%ebp,%ecx,4), %edx movl %edx, (%eax,%ecx,4) movl -20(%ebp,%ecx,4), %edx movl %edx, -4(%eax,%ecx,4) addl $-4, %ecx cmpl $1, %ecx jg LBB2_116 jmp LBB2_117 LBB2_83: movl %eax, 64(%esp) movl %ecx, 72(%esp) movl %edi, %edx LBB2_89: movl 68(%esp), %eax cmpl %eax, 64(%esp) movl 72(%esp), %ecx movl $-2, %ebx je LBB2_97 LBB2_90: movl 76(%esp), %eax movl %edx, %ebp negl %ebp cmpl $-3, %ebp cmovg %ebp, %ebx leal (%edx,%ebx), %esi leal 1(%edx,%ebx), %ebx testb $3, %bl je LBB2_91 movl %edi, 84(%esp) movl %ecx, %edi movl %ecx, 72(%esp) notl %edi orl $1056964608, %edi movl 60(%esp), %ecx leal (%ecx,%edi,4), %ebx cmpl $-3, %ebp movl $-2, %edi cmovg %ebp, %edi leal 1(%edx,%edi), %ebp andl $3, %ebp negl %ebp LBB2_93: movl -4(%eax,%edx,4), %edi movl %edi, (%ebx,%edx,4) leal -1(%edx), %edx incl %ebp jne LBB2_93 jmp LBB2_94 LBB2_91: movl %ecx, 72(%esp) movl %edi, 84(%esp) LBB2_94: cmpl $3, %esi movl 84(%esp), %edi movl 72(%esp), %esi jb LBB2_97 notl %esi orl $1056964608, %esi movl 60(%esp), %ecx leal (%ecx,%esi,4), %ecx LBB2_96: movl -4(%eax,%edx,4), %esi movl %esi, (%ecx,%edx,4) movl -8(%eax,%edx,4), %esi movl %esi, -4(%ecx,%edx,4) movl -12(%eax,%edx,4), %esi movl %esi, -8(%ecx,%edx,4) movl -16(%eax,%edx,4), %esi movl %esi, -12(%ecx,%edx,4) leal -4(%edx), %edx cmpl $1, %edx jg LBB2_96 LBB2_97: orl $33554432, %edi movl 80(%esp), %ebx movl %edi, (%ebx) movl 88(%esp), %eax movl %ebx, (%eax) jmp LBB2_117 # ---------------------- .align 4, 0x90 .globl _galoisapply _galoisapply: pushl %ebp pushl %ebx pushl %edi pushl %esi subl $76, %esp call L3$pb L3$pb: popl %ecx movl %ecx, 72(%esp) movl 104(%esp), %ebp movl 100(%esp), %esi movl 96(%esp), %eax movl L_avma$non_lazy_ptr-L3$pb(%ecx), %ecx movl %ecx, 68(%esp) movl (%ecx), %ecx movl %ecx, 64(%esp) movl %eax, (%esp) call _checknf movl %eax, %edi movl (%ebp), %ebx movl %ebx, %eax shrl $25, %eax cmpl $16, %eax jg LBB3_3 decl %eax cmpl $9, %eax ja LBB3_397 movl 72(%esp), %ecx movl Ltmp2(%ecx,%eax,4), %eax addl %ecx, %eax jmp *%eax LBB3_10: movl 4(%ebp), %edi movl %edi, 64(%esp) andl $16777215, %edi movl 68(%esp), %eax movl (%eax), %esi leal 0(,%edi,4), %eax movl %esi, %ecx subl %eax, %ecx movl %ecx, %ebx movl 72(%esp), %eax movl L_bot$non_lazy_ptr-L3$pb(%eax), %eax movl %esi, %ecx subl (%eax), %ecx shrl $2, %ecx cmpl %edi, %ecx jae LBB3_12 movl $14, (%esp) call _pari_err LBB3_12: movl %ebx, 60(%esp) movl 68(%esp), %eax movl %ebx, (%eax) movl %edi, %eax orl $33554432, %eax movl %eax, (%ebx) cmpl $2, %edi jb LBB3_13 movl 64(%esp), %edx andl $16777215, %edx movl %edx, %eax negl %eax cmpl $-3, %eax movl $-2, %ebx movl $-2, %ecx cmovg %eax, %ecx addl %edx, %ecx cmpl $-1, %ecx je LBB3_24 incl %ecx movl %ecx, 68(%esp) cmpl $-3, %eax movl %ecx, %ebx movl $-2, %ecx cmovg %eax, %ecx andl $-8, %ebx je LBB3_16 movl %ebx, 52(%esp) movl %ecx, %ebx notl %ebx leal (%ebp,%ebx,4), %ebx movl %ebx, 56(%esp) leal -4(%esi), %ebx cmpl 56(%esp), %ebx ja LBB3_19 leal -4(%ebp,%edx,4), %ebx addl %edx, %ecx notl %ecx leal (%esi,%ecx,4), %ecx cmpl %ecx, %ebx ja LBB3_19 LBB3_16: movl $-2, %ebx xorl %eax, %eax jmp LBB3_22 LBB3_3: cmpl $17, %eax je LBB3_86 cmpl $18, %eax jne LBB3_5 movl %esi, 4(%esp) movl %edi, (%esp) call _algtobasis movl %eax, %esi movl %ebp, 4(%esp) movl %edi, (%esp) call _nf_to_scalar_or_alg movl $-33554432, %ecx andl (%eax), %ecx cmpl $335544320, %ecx jne LBB3_297 movl %esi, 8(%esp) movl %eax, 4(%esp) movl %edi, (%esp) call _nfpoleval jmp LBB3_298 LBB3_86: movl %esi, 4(%esp) movl %edi, (%esp) call _algtobasis movl %eax, %ebx movl $16777215, %eax andl (%ebp), %eax cmpl $3, %eax jne LBB3_87 movl %ebx, 56(%esp) movl 68(%esp), %ebx movl (%ebx), %esi leal -12(%esi), %eax movl %eax, 60(%esp) movl 72(%esp), %eax movl L_bot$non_lazy_ptr-L3$pb(%eax), %edx movl %edx, 48(%esp) movl %esi, %eax subl (%edx), %eax cmpl $11, %eax ja LBB3_110 movl $14, (%esp) call _pari_err LBB3_110: movl 60(%esp), %eax movl %eax, (%ebx) movl %esi, 44(%esp) movl $570425347, -12(%esi) movl 4(%ebp), %eax movl %eax, 8(%esp) movl 56(%esp), %eax movl %eax, 4(%esp) movl %edi, (%esp) call _galoisapply movl %eax, -8(%esi) movl 8(%ebp), %edx movl (%ebx), %ebp movl (%edx), %eax movl %eax, %ecx shrl $25, %ecx cmpl $17, %ecx movl 64(%esp), %ebx jg LBB3_113 decl %ecx cmpl $9, %ecx movl 72(%esp), %esi ja LBB3_249 movl Ltmp3(%esi,%ecx,4), %eax addl %esi, %eax jmp *%eax LBB3_117: movl 4(%edx), %ebx movl %ebx, 52(%esp) movl %edx, 40(%esp) andl $16777215, %ebx leal 0(,%ebx,4), %eax movl %ebp, %ecx subl %eax, %ecx movl %ebp, %eax movl %ebp, 36(%esp) movl 48(%esp), %edx subl (%edx), %eax shrl $2, %eax cmpl %ebx, %eax jae LBB3_119 movl $14, (%esp) movl %edx, %esi movl %ecx, %edi call _pari_err movl %edi, %ecx movl %esi, %edx LBB3_119: movl 68(%esp), %eax movl %ecx, (%eax) movl %ebx, %eax orl $33554432, %eax movl %eax, (%ecx) cmpl $2, %ebx movl 60(%esp), %esi jb LBB3_120 movl 52(%esp), %edx andl $16777215, %edx movl %edx, %ebp negl %ebp cmpl $-3, %ebp movl $-2, %eax cmovg %ebp, %eax addl %edx, %eax cmpl $-1, %eax je LBB3_122 movl %ecx, 56(%esp) incl %eax movl %eax, 32(%esp) cmpl $-3, %ebp movl %eax, %ecx movl $-2, %eax cmovg %ebp, %eax andl $-8, %ecx je LBB3_126 movl %ecx, 24(%esp) movl %eax, %esi notl %esi movl 40(%esp), %ecx leal (%ecx,%esi,4), %esi movl %esi, 28(%esp) movl 36(%esp), %edi leal -4(%edi), %esi cmpl 28(%esp), %esi ja LBB3_131 leal -4(%ecx,%edx,4), %esi addl %edx, %eax notl %eax leal (%edi,%eax,4), %eax cmpl %eax, %esi ja LBB3_131 movl 60(%esp), %eax jmp LBB3_130 LBB3_5: cmpl $19, %eax jne LBB3_397 andl $16777215, %ebx cmpl $1, %ebx jne LBB3_343 movl 68(%esp), %edi movl (%edi), %eax movl 72(%esp), %ecx movl L_bot$non_lazy_ptr-L3$pb(%ecx), %ecx leal -4(%eax), %esi subl (%ecx), %eax cmpl $3, %eax ja LBB3_9 movl $14, (%esp) call _pari_err LBB3_9: movl %esi, (%edi) movl $637534209, (%esi) jmp LBB3_398 LBB3_297: movl 4(%edi), %ecx movl $16777215, %edx andl (%ecx), %edx addl $-3, %edx movl %edx, 4(%esp) movl %eax, (%esp) call _scalarcol LBB3_298: movl 64(%esp), %edi movl 68(%esp), %ebx movl 72(%esp), %edx movl L_bot$non_lazy_ptr-L3$pb(%edx), %ecx cmpl (%ecx), %eax jb LBB3_301 cmpl %eax, %edi jbe LBB3_301 movl L_top$non_lazy_ptr-L3$pb(%edx), %ecx cmpl (%ecx), %eax jae LBB3_301 movl (%eax), %esi movl %esi, %ecx shrl $25, %ecx leal -21(%ecx), %edx cmpl $2, %edx jb LBB3_322 cmpl $2, %ecx jne LBB3_304 LBB3_322: movl %esi, %ecx andl $16777215, %ecx shll $2, %ecx subl %ecx, %edi movl %edi, 60(%esp) movl %esi, %edx andl $16777215, %edx movl %edi, (%ebx) je LBB3_323 movl %esi, %ecx movl %esi, 68(%esp) orl $-16777216, %ecx movl %ecx, %ebx xorl $16777215, %ebx cmpl $-16777216, %ecx movl $-2, %edi movl $-2, %ebp cmove %ebx, %ebp leal (%ebp,%edx), %esi cmpl $-2, %esi jne LBB3_331 movl 68(%esp), %esi jmp LBB3_326 LBB3_301: movl %edi, (%ebx) movl %eax, %esi jmp LBB3_398 LBB3_87: cmpl $6, %eax jne LBB3_397 movl 20(%ebp), %eax movl $-33554432, %ecx andl (%eax), %ecx cmpl $33554432, %ecx jne LBB3_90 movl 68(%esp), %esi jmp LBB3_93 LBB3_32: movl %ebp, (%esp) call _gcopy jmp LBB3_399 LBB3_33: movl 8(%ebp), %ebp LBB3_34: movl %esi, 4(%esp) movl %edi, (%esp) call _algtobasis movl %eax, %esi movl %ebp, 4(%esp) movl %edi, (%esp) call _nf_to_scalar_or_alg movl $-33554432, %ecx andl (%eax), %ecx cmpl $335544320, %ecx jne LBB3_36 movl %esi, 8(%esp) movl %eax, 4(%esp) movl %edi, (%esp) call _nfpoleval jmp LBB3_37 LBB3_36: movl 4(%edi), %ecx movl $16777215, %edx andl (%ecx), %edx addl $-3, %edx movl %edx, 4(%esp) movl %eax, (%esp) call _scalarcol LBB3_37: movl 64(%esp), %ebx movl 72(%esp), %esi movl %eax, 4(%esp) movl %edi, (%esp) call _basistoalg movl L_bot$non_lazy_ptr-L3$pb(%esi), %ecx cmpl (%ecx), %eax jb LBB3_40 cmpl %eax, %ebx jbe LBB3_40 movl L_top$non_lazy_ptr-L3$pb(%esi), %ecx cmpl (%ecx), %eax jae LBB3_40 movl (%eax), %esi movl %esi, %ecx shrl $25, %ecx leal -21(%ecx), %edx cmpl $2, %edx jb LBB3_62 cmpl $2, %ecx jne LBB3_43 LBB3_62: movl %esi, %ecx andl $16777215, %ecx shll $2, %ecx subl %ecx, %ebx movl %ebx, 60(%esp) movl %esi, %edx andl $16777215, %edx movl 68(%esp), %ecx movl %ebx, (%ecx) je LBB3_63 movl %esi, %ecx movl %esi, 68(%esp) orl $-16777216, %ecx movl %ecx, %ebx xorl $16777215, %ebx cmpl $-16777216, %ecx movl $-2, %edi movl $-2, %ebp cmove %ebx, %ebp leal (%ebp,%edx), %esi cmpl $-2, %esi jne LBB3_71 movl 68(%esp), %esi jmp LBB3_66 LBB3_40: movl 68(%esp), %ecx movl %ebx, (%ecx) movl %eax, %esi jmp LBB3_398 LBB3_113: cmpl $18, %ecx movl 72(%esp), %esi jne LBB3_114 movl %edx, 4(%esp) movl %edi, (%esp) call _nf_to_scalar_or_alg movl $-33554432, %ecx andl (%eax), %ecx cmpl $335544320, %ecx jne LBB3_191 movl 56(%esp), %ecx movl %ecx, 8(%esp) movl %eax, 4(%esp) movl %edi, (%esp) call _nfpoleval jmp LBB3_192 LBB3_343: movl 4(%ebp), %eax movl $16777215, %ecx movl (%eax), %eax andl %ecx, %eax movl 4(%edi), %edx andl (%edx), %ecx addl $-2, %ecx cmpl %ecx, %eax jne LBB3_397 movl %esi, 4(%esp) movl %edi, (%esp) call _algtobasis movl %eax, 56(%esp) movl 68(%esp), %eax movl (%eax), %eax leal 0(,%ebx,4), %ecx movl %eax, %edx subl %ecx, %edx movl %edx, %esi movl 72(%esp), %ecx movl L_bot$non_lazy_ptr-L3$pb(%ecx), %ecx movl %ecx, 48(%esp) subl (%ecx), %eax shrl $2, %eax cmpl %ebx, %eax jae LBB3_346 movl $14, (%esp) call _pari_err LBB3_346: movl 68(%esp), %eax movl %esi, 60(%esp) movl %esi, (%eax) movl %ebx, %eax orl $637534208, %eax movl %eax, (%esi) cmpl $2, %ebx jb LBB3_352 movl $1, %esi .align 4, 0x90 LBB3_348: movl (%ebp,%esi,4), %eax movl %eax, 4(%esp) movl %edi, (%esp) call _nf_to_scalar_or_alg movl (%eax), %ecx movl $-33554432, %edx andl %edx, %ecx cmpl $335544320, %ecx jne LBB3_350 movl 56(%esp), %ecx movl %ecx, 8(%esp) movl %eax, 4(%esp) movl %edi, (%esp) call _nfpoleval jmp LBB3_351 LBB3_350: movl 4(%edi), %ecx movl (%ecx), %ecx movl $16777215, %edx andl %edx, %ecx addl $-3, %ecx movl %ecx, 4(%esp) movl %eax, (%esp) call _scalarcol LBB3_351: movl 60(%esp), %ecx movl %eax, (%ecx,%esi,4) incl %esi cmpl %ebx, %esi jl LBB3_348 LBB3_352: movl 60(%esp), %eax movl %eax, 4(%esp) movl %edi, (%esp) call _idealhnf_shallow movl 48(%esp), %ecx cmpl (%ecx), %eax movl 64(%esp), %edi jb LBB3_355 cmpl %eax, %edi jbe LBB3_355 movl 72(%esp), %ecx movl L_top$non_lazy_ptr-L3$pb(%ecx), %ecx cmpl (%ecx), %eax jae LBB3_355 movl (%eax), %esi movl %esi, %ecx shrl $25, %ecx leal -21(%ecx), %edx cmpl $2, %edx movl 68(%esp), %ebx jb LBB3_375 cmpl $2, %ecx jne LBB3_358 LBB3_375: movl %esi, %ecx andl $16777215, %ecx shll $2, %ecx subl %ecx, %edi movl %edi, 60(%esp) movl %esi, %edx andl $16777215, %edx movl %edi, (%ebx) je LBB3_376 movl %esi, %ecx movl %esi, 68(%esp) orl $-16777216, %ecx movl %ecx, %ebx xorl $16777215, %ebx cmpl $-16777216, %ecx movl $-2, %edi movl $-2, %ebp cmove %ebx, %ebp leal (%ebp,%edx), %esi cmpl $-2, %esi jne LBB3_384 movl 68(%esp), %esi jmp LBB3_379 LBB3_397: movl 72(%esp), %eax leal L_.str4-L3$pb(%eax), %eax movl %eax, 4(%esp) movl $11, (%esp) call _pari_err xorl %esi, %esi LBB3_398: movl %esi, %eax LBB3_399: addl $76, %esp popl %esi popl %edi popl %ebx popl %ebp ret LBB3_13: movl 60(%esp), %esi jmp LBB3_398 LBB3_90: movl 4(%ebp), %esi movl 8(%ebp), %eax movl 28(%edi), %ecx movl %eax, 4(%esp) movl %ecx, (%esp) call _gmul movl %esi, 4(%esp) movl %ebx, (%esp) movl %edi, %ecx movl %eax, %edx call _QX_galoisapplymod movl %eax, 60(%esp) movl %eax, 4(%esp) movl %edi, (%esp) call _zk_multable movl %esi, 4(%esp) movl %eax, (%esp) call _FpM_deplin movl %eax, %edx movl 68(%esp), %eax movl (%eax), %edi movl 72(%esp), %eax movl L_bot$non_lazy_ptr-L3$pb(%eax), %eax movl %edi, %ecx subl (%eax), %ecx movl 12(%ebp), %ebx movl 16(%ebp), %eax movl %eax, 56(%esp) cmpl $23, %ecx leal -24(%edi), %ebp ja LBB3_92 movl $14, (%esp) movl %edx, 52(%esp) call _pari_err movl 52(%esp), %edx LBB3_92: movl 68(%esp), %eax movl %ebp, (%eax) movl $570425350, -24(%edi) movl %esi, -20(%edi) movl 60(%esp), %ecx movl %ecx, -16(%edi) movl %ebx, -12(%edi) movl %eax, %esi movl 56(%esp), %eax movl %eax, -8(%edi) movl %edx, -4(%edi) LBB3_93: movl %ebp, (%esp) call _copy_bin movl %eax, %edi movl 64(%esp), %ebx movl %ebx, (%esi) movl 4(%edi), %eax testl %eax, %eax je LBB3_94 movl (%edi), %esi movl %esi, 60(%esp) movl %eax, 56(%esp) movl %eax, %ebp subl 8(%edi), %ebp sarl $2, %ebp leal 0(,%esi,4), %eax movl %eax, 52(%esp) movl 72(%esp), %eax movl L_bot$non_lazy_ptr-L3$pb(%eax), %eax movl %ebx, %ecx subl (%eax), %ecx movl 52(%esp), %edx subl %edx, %ebx shrl $2, %ecx cmpl %esi, %ecx jae LBB3_100 movl $14, (%esp) movl %edx, %esi call _pari_err movl %esi, %edx LBB3_100: movl 68(%esp), %eax movl %ebx, (%eax) movl %edi, %eax addl $16, %eax movl %edx, 8(%esp) movl %eax, 4(%esp) movl %ebx, (%esp) call _memcpy subl 60(%esp), %ebp movl 64(%esp), %eax leal (%eax,%ebp,4), %ecx movl %ecx, %eax subl 56(%esp), %eax cmpl $0, 12(%edi) je LBB3_102 movl %eax, 4(%esp) movl %ecx, (%esp) movl %ecx, 60(%esp) call _shiftaddress_canon jmp LBB3_103 LBB3_114: cmpl $19, %ecx jne LBB3_249 andl $16777215, %eax cmpl $3, %eax jne LBB3_236 movl 68(%esp), %ebx jmp LBB3_241 LBB3_249: leal L_.str4-L3$pb(%esi), %eax movl %eax, 4(%esp) movl $11, (%esp) call _pari_err xorl %ecx, %ecx LBB3_250: movl 48(%esp), %edx jmp LBB3_251 LBB3_355: movl 68(%esp), %ecx movl %edi, (%ecx) movl %eax, %esi jmp LBB3_398 LBB3_94: movl 72(%esp), %ebp movl L_PARI_SIGINT_block$non_lazy_ptr-L3$pb(%ebp), %esi movl (%esi), %ebx movl $1, (%esi) movl %edi, (%esp) call _free movl %ebx, (%esi) testl %ebx, %ebx jne LBB3_97 movl L_PARI_SIGINT_pending$non_lazy_ptr-L3$pb(%ebp), %eax cmpl $0, (%eax) je LBB3_97 movl (%eax), %ecx movl $0, (%eax) movl %ecx, (%esp) call _raise LBB3_97: movl L_gen_0$non_lazy_ptr-L3$pb(%ebp), %eax movl (%eax), %esi jmp LBB3_398 LBB3_323: movl 60(%esp), %esi jmp LBB3_398 LBB3_304: cmpl $1, %ecx jne LBB3_396 movl 4(%eax), %ecx movl %ecx, 56(%esp) andl $16777215, %ecx leal 0(,%ecx,4), %esi subl %esi, %edi movl %edi, 60(%esp) cmpl $2, %ecx jb LBB3_321 movl 56(%esp), %ebp andl $16777215, %ebp movl %ebp, %edx negl %edx cmpl $-3, %edx movl $-2, %edi cmovg %edx, %edi addl %ebp, %edi cmpl $-1, %edi movl %ecx, %esi je LBB3_315 incl %edi movl %edi, 48(%esp) cmpl $-3, %edx movl $-2, %esi cmovg %edx, %esi movl $0, 52(%esp) andl $-8, %edi je LBB3_308 movl %edx, 40(%esp) movl %esi, %edx notl %esi leal (%eax,%esi,4), %esi movl %esi, 44(%esp) movl 64(%esp), %esi leal -4(%esi), %esi cmpl 44(%esp), %esi ja LBB3_311 leal -4(%eax,%ebp,4), %esi movl %esi, 44(%esp) addl %ebp, %edx notl %edx movl %ebx, %esi movl 64(%esp), %ebx leal (%ebx,%edx,4), %edx movl %esi, %ebx cmpl %edx, 44(%esp) movl %ecx, %esi jbe LBB3_314 LBB3_311: movl %ecx, %esi subl %edi, %esi movl %edi, 52(%esp) movl 40(%esp), %edi cmpl $-3, %edi movl $-2, %edx cmovg %edi, %edx leal 1(%edx,%ebp), %edi andl $-8, %edi movl 72(%esp), %edx movdqa LCPI3_0-L3$pb(%edx), %xmm0 movl 64(%esp), %ebx LBB3_312: movd %ebp, %xmm1 pshufd $0, %xmm1, %xmm1 paddd %xmm0, %xmm1 movd %xmm1, %edx movups -12(%eax,%edx,4), %xmm1 movups -28(%eax,%edx,4), %xmm2 subl %ecx, %edx movups %xmm1, -12(%ebx,%edx,4) movups %xmm2, -28(%ebx,%edx,4) addl $-8, %ebp addl $-8, %edi jne LBB3_312 movl 68(%esp), %ebx jmp LBB3_314 LBB3_191: movl 4(%edi), %ecx movl $16777215, %edx andl (%ecx), %edx addl $-3, %edx movl %edx, 4(%esp) movl %eax, (%esp) call _scalarcol LBB3_192: movl 48(%esp), %edx cmpl (%edx), %eax jb LBB3_151 cmpl %eax, %ebp jbe LBB3_151 movl 72(%esp), %ecx movl L_top$non_lazy_ptr-L3$pb(%ecx), %ecx cmpl (%ecx), %eax jae LBB3_151 movl (%eax), %edi movl %edi, %ecx shrl $25, %ecx leal -21(%ecx), %edx cmpl $2, %edx jb LBB3_214 cmpl $2, %ecx jne LBB3_197 LBB3_214: movl %edi, %ecx andl $16777215, %ecx shll $2, %ecx movl %ebp, %esi subl %ecx, %esi movl %esi, 56(%esp) movl %edi, %edx andl $16777215, %edx movl 68(%esp), %ecx movl %esi, (%ecx) je LBB3_215 movl %ebp, 36(%esp) movl %edi, %ecx movl %edi, 52(%esp) orl $-16777216, %ecx movl %ecx, %esi xorl $16777215, %esi cmpl $-16777216, %ecx movl $-2, %ebx movl $-2, %ebp cmove %esi, %ebp leal (%ebp,%edx), %edi cmpl $-2, %edi jne LBB3_223 movl 56(%esp), %ecx jmp LBB3_218 LBB3_331: addl $2, %esi movl %esi, 56(%esp) cmpl $-16777216, %ecx cmovne %edi, %ebx xorl %ecx, %ecx andl $-8, %esi je LBB3_332 movl %esi, 52(%esp) movl $-2, %edi movl $-2, %ecx subl %ebx, %ecx leal (%eax,%ecx,4), %esi movl 64(%esp), %ecx leal -4(%ecx), %ecx cmpl %esi, %ecx movl 68(%esp), %esi ja LBB3_335 leal -4(%eax,%edx,4), %ecx addl %edx, %ebx subl %ebx, %edi movl %edi, %ebx movl 64(%esp), %edi leal (%edi,%ebx,4), %ebx movl $-2, %edi cmpl %ebx, %ecx movl $0, %ecx jbe LBB3_338 LBB3_335: movl %edx, %ecx subl 52(%esp), %ecx movl %ecx, 48(%esp) leal 2(%ebp,%edx), %ebp andl $-8, %ebp movl 72(%esp), %ecx movdqa LCPI3_0-L3$pb(%ecx), %xmm0 movl %edx, %ebx movl 64(%esp), %edi LBB3_336: movd %ebx, %xmm1 pshufd $0, %xmm1, %xmm1 paddd %xmm0, %xmm1 movd %xmm1, %ecx movups -12(%eax,%ecx,4), %xmm1 movups -28(%eax,%ecx,4), %xmm2 subl %edx, %ecx movups %xmm1, -12(%edi,%ecx,4) movups %xmm2, -28(%edi,%ecx,4) addl $-8, %ebx addl $-8, %ebp jne LBB3_336 movl 48(%esp), %edx movl 52(%esp), %ecx movl $-2, %edi jmp LBB3_338 LBB3_102: movl %eax, 4(%esp) movl %ecx, (%esp) movl %ecx, 60(%esp) call _shiftaddress LBB3_103: movl 72(%esp), %ebp movl L_PARI_SIGINT_block$non_lazy_ptr-L3$pb(%ebp), %esi movl (%esi), %ebx movl $1, (%esi) movl %edi, (%esp) call _free movl %ebx, (%esi) testl %ebx, %ebx je LBB3_105 movl 60(%esp), %esi jmp LBB3_398 LBB3_105: movl L_PARI_SIGINT_pending$non_lazy_ptr-L3$pb(%ebp), %eax cmpl $0, (%eax) je LBB3_106 movl (%eax), %ecx movl $0, (%eax) movl %ecx, (%esp) call _raise movl 60(%esp), %esi jmp LBB3_398 LBB3_63: movl 60(%esp), %esi jmp LBB3_398 LBB3_43: cmpl $1, %ecx jne LBB3_83 movl 4(%eax), %ecx movl %ecx, 56(%esp) andl $16777215, %ecx leal 0(,%ecx,4), %esi subl %esi, %ebx movl %ebx, 60(%esp) cmpl $2, %ecx jb LBB3_60 movl 56(%esp), %ebp andl $16777215, %ebp movl %ebp, %edi negl %edi cmpl $-3, %edi movl $-2, %ebx movl $-2, %edx cmovg %edi, %edx addl %ebp, %edx cmpl $-1, %edx movl %ecx, %esi je LBB3_54 incl %edx movl %edx, 48(%esp) cmpl $-3, %edi movl %edx, %esi movl $-2, %edx cmovg %edi, %edx movl $0, 52(%esp) andl $-8, %esi je LBB3_47 movl %esi, 44(%esp) movl %edx, %esi notl %esi leal (%eax,%esi,4), %ebx movl 64(%esp), %esi leal -4(%esi), %esi cmpl %ebx, %esi ja LBB3_50 leal -4(%eax,%ebp,4), %esi addl %ebp, %edx notl %edx movl 64(%esp), %ebx leal (%ebx,%edx,4), %edx movl $-2, %ebx cmpl %edx, %esi movl %ecx, %esi jbe LBB3_53 LBB3_50: movl %ecx, %esi subl 44(%esp), %esi cmpl $-3, %edi movl $-2, %edx cmovg %edi, %edx leal 1(%edx,%ebp), %edi andl $-8, %edi movl 72(%esp), %edx movdqa LCPI3_0-L3$pb(%edx), %xmm0 movl 64(%esp), %ebx LBB3_51: movd %ebp, %xmm1 pshufd $0, %xmm1, %xmm1 paddd %xmm0, %xmm1 movd %xmm1, %edx movups -12(%eax,%edx,4), %xmm1 movups -28(%eax,%edx,4), %xmm2 subl %ecx, %edx movups %xmm1, -12(%ebx,%edx,4) movups %xmm2, -28(%ebx,%edx,4) addl $-8, %ebp addl $-8, %edi jne LBB3_51 movl 44(%esp), %edx movl %edx, 52(%esp) movl $-2, %ebx jmp LBB3_53 LBB3_71: addl $2, %esi movl %esi, 56(%esp) cmpl $-16777216, %ecx cmovne %edi, %ebx xorl %ecx, %ecx andl $-8, %esi je LBB3_72 movl %esi, 52(%esp) movl $-2, %edi movl $-2, %ecx subl %ebx, %ecx leal (%eax,%ecx,4), %esi movl 64(%esp), %ecx leal -4(%ecx), %ecx cmpl %esi, %ecx movl 68(%esp), %esi ja LBB3_75 leal -4(%eax,%edx,4), %ecx addl %edx, %ebx subl %ebx, %edi movl %edi, %ebx movl 64(%esp), %edi leal (%edi,%ebx,4), %ebx movl $-2, %edi cmpl %ebx, %ecx movl $0, %ecx jbe LBB3_78 LBB3_75: movl %edx, %ecx subl 52(%esp), %ecx movl %ecx, 48(%esp) leal 2(%ebp,%edx), %ebp andl $-8, %ebp movl 72(%esp), %ecx movdqa LCPI3_0-L3$pb(%ecx), %xmm0 movl %edx, %ebx movl 64(%esp), %edi LBB3_76: movd %ebx, %xmm1 pshufd $0, %xmm1, %xmm1 paddd %xmm0, %xmm1 movd %xmm1, %ecx movups -12(%eax,%ecx,4), %xmm1 movups -28(%eax,%ecx,4), %xmm2 subl %edx, %ecx movups %xmm1, -12(%edi,%ecx,4) movups %xmm2, -28(%edi,%ecx,4) addl $-8, %ebx addl $-8, %ebp jne LBB3_76 movl 48(%esp), %edx movl 52(%esp), %ecx movl $-2, %edi jmp LBB3_78 LBB3_236: movl %edx, 40(%esp) cmpl $1, %eax jne LBB3_240 leal -4(%ebp), %ecx movl 48(%esp), %edx subl (%edx), %ebp cmpl $3, %ebp ja LBB3_239 movl $14, (%esp) movl %edx, %esi movl %ecx, %edi call _pari_err movl %edi, %ecx movl %esi, %edx LBB3_239: movl 68(%esp), %eax movl %ecx, (%eax) movl $637534209, (%ecx) jmp LBB3_251 LBB3_19: movl %edi, %ecx subl 52(%esp), %ecx movl %ecx, 56(%esp) cmpl $-3, %eax movl $-2, %ecx cmovg %eax, %ecx leal 1(%ecx,%edx), %eax andl $-8, %eax movl 72(%esp), %ecx movdqa LCPI3_0-L3$pb(%ecx), %xmm0 movl $-2, %ebx LBB3_20: movd %edx, %xmm1 pshufd $0, %xmm1, %xmm1 paddd %xmm0, %xmm1 movd %xmm1, %ecx movups -12(%ebp,%ecx,4), %xmm1 movups -28(%ebp,%ecx,4), %xmm2 subl %edi, %ecx movups %xmm1, -12(%esi,%ecx,4) movups %xmm2, -28(%esi,%ecx,4) addl $-8, %edx addl $-8, %eax jne LBB3_20 movl 56(%esp), %edi movl 52(%esp), %eax LBB3_22: cmpl %eax, 68(%esp) jne LBB3_24 movl 60(%esp), %esi jmp LBB3_398 LBB3_24: movl %edi, %edx negl %edx cmpl $-3, %edx cmovg %edx, %ebx leal (%edi,%ebx), %eax leal 1(%edi,%ebx), %ecx testb $3, %cl je LBB3_27 movl 64(%esp), %ecx notl %ecx orl $1056964608, %ecx leal (%esi,%ecx,4), %ecx cmpl $-3, %edx movl $-2, %ebx cmovg %edx, %ebx leal 1(%edi,%ebx), %edx andl $3, %edx negl %edx .align 4, 0x90 LBB3_26: movl -4(%ebp,%edi,4), %ebx movl %ebx, (%ecx,%edi,4) leal -1(%edi), %edi incl %edx jne LBB3_26 LBB3_27: cmpl $3, %eax jae LBB3_29 movl 60(%esp), %esi jmp LBB3_398 LBB3_29: movl 64(%esp), %eax notl %eax orl $1056964608, %eax leal (%esi,%eax,4), %eax .align 4, 0x90 LBB3_30: movl -4(%ebp,%edi,4), %ecx movl %ecx, (%eax,%edi,4) movl -8(%ebp,%edi,4), %ecx movl %ecx, -4(%eax,%edi,4) movl -12(%ebp,%edi,4), %ecx movl %ecx, -8(%eax,%edi,4) movl -16(%ebp,%edi,4), %ecx movl %ecx, -12(%eax,%edi,4) leal -4(%edi), %edi cmpl $1, %edi jg LBB3_30 movl 60(%esp), %esi jmp LBB3_398 LBB3_142: movl %edx, (%esp) call _gcopy movl %eax, %ecx jmp LBB3_250 LBB3_144: movl 8(%edx), %edx LBB3_145: movl %edx, 4(%esp) movl %edi, (%esp) call _nf_to_scalar_or_alg movl $-33554432, %ecx andl (%eax), %ecx cmpl $335544320, %ecx jne LBB3_147 movl 56(%esp), %ecx movl %ecx, 8(%esp) movl %eax, 4(%esp) movl %edi, (%esp) call _nfpoleval jmp LBB3_148 LBB3_147: movl 4(%edi), %ecx movl $16777215, %edx andl (%ecx), %edx addl $-3, %edx movl %edx, 4(%esp) movl %eax, (%esp) call _scalarcol LBB3_148: movl %eax, 4(%esp) movl %edi, (%esp) call _basistoalg movl 48(%esp), %edx cmpl (%edx), %eax jb LBB3_151 cmpl %eax, %ebp jbe LBB3_151 movl 72(%esp), %ecx movl L_top$non_lazy_ptr-L3$pb(%ecx), %ecx cmpl (%ecx), %eax jae LBB3_151 movl (%eax), %edi movl %edi, %ecx shrl $25, %ecx leal -21(%ecx), %edx cmpl $2, %edx jb LBB3_172 cmpl $2, %ecx jne LBB3_154 LBB3_172: movl %edi, %ecx andl $16777215, %ecx shll $2, %ecx movl %ebp, %esi subl %ecx, %esi movl %edi, %edx andl $16777215, %edx movl 68(%esp), %ecx movl %esi, (%ecx) movl %esi, %ecx je LBB3_250 movl %ecx, 56(%esp) movl %ebp, 36(%esp) movl %edi, %ecx movl %edi, 52(%esp) orl $-16777216, %ecx movl %ecx, %esi xorl $16777215, %esi cmpl $-16777216, %ecx movl $-2, %ebx movl $-2, %ebp cmove %esi, %ebp leal (%ebp,%edx), %edi cmpl $-2, %edi je LBB3_182 addl $2, %edi movl %edi, 32(%esp) cmpl $-16777216, %ecx cmovne %ebx, %esi movl $0, 40(%esp) movl %edi, %ecx andl $-8, %ecx je LBB3_180 movl %ecx, 28(%esp) movl $-2, %ecx subl %esi, %ecx leal (%eax,%ecx,4), %edi movl 36(%esp), %ecx leal -4(%ecx), %ecx cmpl %edi, %ecx ja LBB3_177 leal -4(%eax,%edx,4), %edi addl %edx, %esi movl $-2, %ecx subl %esi, %ecx movl 36(%esp), %esi leal (%esi,%ecx,4), %esi cmpl %esi, %edi jbe LBB3_180 LBB3_177: movl %edx, %ecx subl 28(%esp), %ecx movl %ecx, 40(%esp) leal 2(%ebp,%edx), %ebp andl $-8, %ebp movl 72(%esp), %ecx movdqa LCPI3_0-L3$pb(%ecx), %xmm0 movl %edx, %esi movl 36(%esp), %ebx LBB3_178: movd %esi, %xmm1 pshufd $0, %xmm1, %xmm1 paddd %xmm0, %xmm1 movd %xmm1, %ecx movups -12(%eax,%ecx,4), %xmm1 movups -28(%eax,%ecx,4), %xmm2 subl %edx, %ecx movups %xmm1, -12(%ebx,%ecx,4) movups %xmm2, -28(%ebx,%ecx,4) addl $-8, %esi addl $-8, %ebp jne LBB3_178 movl 40(%esp), %edx movl 28(%esp), %ecx movl %ecx, 40(%esp) movl $-2, %ebx LBB3_180: movl 32(%esp), %ecx cmpl 40(%esp), %ecx je LBB3_181 LBB3_182: movl %edx, %ebp notl %ebp cmpl $-3, %ebp cmovg %ebp, %ebx leal 2(%edx,%ebx), %ecx leal 1(%edx,%ebx), %esi testb $3, %cl je LBB3_185 movl 52(%esp), %ecx notl %ecx orl $1056964608, %ecx movl 36(%esp), %ebx leal (%ebx,%ecx,4), %ebx cmpl $-3, %ebp movl $-2, %ecx cmovg %ebp, %ecx leal 2(%edx,%ecx), %ebp andl $3, %ebp negl %ebp LBB3_184: movl -4(%eax,%edx,4), %ecx movl %ecx, (%ebx,%edx,4) leal -1(%edx), %edx incl %ebp jne LBB3_184 LBB3_185: cmpl $3, %esi jb LBB3_181 incl %edx movl 52(%esp), %esi andl $16777215, %esi movl $-4, %ecx subl %esi, %ecx movl 36(%esp), %esi leal (%esi,%ecx,4), %ecx movl 64(%esp), %ebx LBB3_187: movl -8(%eax,%edx,4), %esi movl %esi, 8(%ecx,%edx,4) movl -12(%eax,%edx,4), %esi movl %esi, 4(%ecx,%edx,4) movl -16(%eax,%edx,4), %esi movl %esi, (%ecx,%edx,4) movl -20(%eax,%edx,4), %esi movl %esi, -4(%ecx,%edx,4) addl $-4, %edx cmpl $1, %edx jg LBB3_187 jmp LBB3_188 LBB3_151: movl 68(%esp), %ecx movl %ebp, (%ecx) movl %eax, %ecx jmp LBB3_251 LBB3_332: movl 68(%esp), %esi LBB3_338: cmpl %ecx, 56(%esp) jne LBB3_326 movl 60(%esp), %esi jmp LBB3_398 LBB3_326: movl %edx, %ebx notl %ebx cmpl $-3, %ebx cmovg %ebx, %edi leal 2(%edx,%edi), %ecx leal 1(%edx,%edi), %ebp testb $3, %cl je LBB3_329 movl %esi, %ecx notl %ecx orl $1056964608, %ecx movl 64(%esp), %edi leal (%edi,%ecx,4), %edi cmpl $-3, %ebx movl $-2, %ecx cmovg %ebx, %ecx leal 2(%edx,%ecx), %ebx andl $3, %ebx negl %ebx .align 4, 0x90 LBB3_328: movl -4(%eax,%edx,4), %ecx movl %ecx, (%edi,%edx,4) leal -1(%edx), %edx incl %ebx jne LBB3_328 LBB3_329: cmpl $3, %ebp jae LBB3_340 movl 60(%esp), %esi jmp LBB3_398 LBB3_340: incl %edx andl $16777215, %esi movl $-4, %ecx subl %esi, %ecx movl 64(%esp), %esi leal (%esi,%ecx,4), %ecx .align 4, 0x90 LBB3_341: movl -8(%eax,%edx,4), %esi movl %esi, 8(%ecx,%edx,4) movl -12(%eax,%edx,4), %esi movl %esi, 4(%ecx,%edx,4) movl -16(%eax,%edx,4), %esi movl %esi, (%ecx,%edx,4) movl -20(%eax,%edx,4), %esi movl %esi, -4(%ecx,%edx,4) addl $-4, %edx cmpl $1, %edx jg LBB3_341 movl 60(%esp), %esi jmp LBB3_398 LBB3_106: movl 60(%esp), %esi jmp LBB3_398 LBB3_83: andl $16777215, %esi leal (%eax,%esi,4), %ecx movl %eax, 8(%esp) movl %ebx, (%esp) jmp LBB3_84 LBB3_240: leal L_.str4-L3$pb(%esi), %eax movl %eax, 4(%esp) movl $11, (%esp) call _pari_err movl 68(%esp), %ebx movl (%ebx), %ebp movl 40(%esp), %edx LBB3_241: movl %edx, 40(%esp) movl 4(%edx), %edx movl (%edx), %esi andl $16777215, %esi leal 0(,%esi,4), %eax movl %ebp, %ecx subl %eax, %ebp movl 48(%esp), %eax subl (%eax), %ecx shrl $2, %ecx cmpl %esi, %ecx movl %esi, %ecx jae LBB3_243 movl $14, (%esp) movl %edx, %esi movl %ebp, 36(%esp) movl %ecx, %ebp call _pari_err movl %ebp, %ecx movl 36(%esp), %ebp movl %esi, %edx LBB3_243: movl %ebp, (%ebx) movl %ebx, 68(%esp) movl $-16777217, %eax andl (%edx), %eax movl %eax, (%ebp) cmpl $2, %ecx movl 56(%esp), %esi jb LBB3_246 movl $1, %ebx LBB3_245: movl %edi, 52(%esp) movl (%edx,%ebx,4), %eax movl %eax, 8(%esp) movl %esi, 4(%esp) movl %edi, (%esp) movl %ebp, %esi movl %ecx, %ebp movl %edx, %edi call _galoisapply movl %edi, %edx movl 52(%esp), %edi movl %ebp, %ecx movl %esi, %ebp movl 56(%esp), %esi movl %eax, (%ebp,%ebx,4) incl %ebx cmpl %ecx, %ebx jl LBB3_245 LBB3_246: movl %edx, %edi movl 40(%esp), %eax movl 8(%eax), %eax movl %eax, (%esp) call _ZC_copy movl %eax, %ebx movl 68(%esp), %eax movl (%eax), %esi leal -12(%esi), %ecx movl %esi, %eax movl 48(%esp), %edx subl (%edx), %eax cmpl $11, %eax ja LBB3_248 movl $14, (%esp) movl %ecx, %ebp call _pari_err movl %ebp, %ecx movl 48(%esp), %edx LBB3_248: movl 68(%esp), %eax movl %ecx, (%eax) movl $637534211, -12(%esi) movl %edi, -8(%esi) movl %ebx, -4(%esi) movl 64(%esp), %ebx LBB3_251: movl 60(%esp), %esi LBB3_252: movl 44(%esp), %eax movl %ecx, -4(%eax) movl %eax, %edi cmpl (%edx), %esi jb LBB3_255 cmpl %esi, %ebx jbe LBB3_255 movl 72(%esp), %eax movl L_top$non_lazy_ptr-L3$pb(%eax), %eax cmpl (%eax), %esi jae LBB3_255 movl (%esi), %ecx movl %ecx, %eax shrl $25, %eax leal -21(%eax), %edx cmpl $2, %edx jb LBB3_275 cmpl $2, %eax jne LBB3_258 LBB3_275: movl %ecx, %eax andl $16777215, %eax shll $2, %eax movl %ebx, %esi subl %eax, %esi movl %ecx, %eax andl $16777215, %eax movl 68(%esp), %edx movl %esi, (%edx) je LBB3_398 movl %esi, 60(%esp) orl $-16777216, %ecx movl %ecx, %ebp xorl $16777215, %ebp cmpl $-16777216, %ecx movl $-2, %edx movl $-2, %ebx cmove %ebp, %ebx leal (%ebx,%eax), %esi cmpl $-2, %esi jne LBB3_280 movl %eax, %ecx jmp LBB3_278 LBB3_255: movl 68(%esp), %eax movl %ebx, (%eax) jmp LBB3_398 LBB3_258: cmpl $1, %eax jne LBB3_294 movl %ebx, %edx movl -8(%edi), %ebx movl %ebx, %eax andl $16777215, %eax leal 0(,%eax,4), %ecx subl %ecx, %edx movl %edx, 60(%esp) cmpl $2, %eax movl %edi, %esi jb LBB3_274 movl %ebx, %ecx andl $16777215, %ecx movl %ecx, %ebp negl %ebp cmpl $-3, %ebp movl $-2, %edi cmovg %ebp, %edi addl %ecx, %edi cmpl $-1, %edi movl %eax, %edx je LBB3_269 incl %edi cmpl $-3, %ebp movl $-2, %edx cmovg %ebp, %edx movl $0, 72(%esp) movl %edi, %esi andl $-8, %esi je LBB3_262 movl %esi, 48(%esp) movl $-4, %esi subl %edx, %esi movl %ebx, 56(%esp) movl 44(%esp), %ebx leal (%ebx,%esi,4), %esi movl %esi, 52(%esp) movl 56(%esp), %ebx movl 64(%esp), %esi leal -4(%esi), %esi cmpl 52(%esp), %esi ja LBB3_265 movl 44(%esp), %esi leal -16(%esi,%ecx,4), %esi movl %esi, 52(%esp) addl %ecx, %edx notl %edx movl 64(%esp), %esi leal (%esi,%edx,4), %edx cmpl %edx, 52(%esp) movl %eax, %edx jbe LBB3_268 LBB3_265: movl %eax, %edx subl 48(%esp), %edx cmpl $-3, %ebp movl $-2, %esi cmovg %ebp, %esi movl 64(%esp), %ebp leal -16(%ebp), %ebp leal 1(%esi,%ecx), %esi movl 44(%esp), %ebx leal -28(%ebx,%ecx,4), %ecx andl $-8, %esi LBB3_266: movdqu -16(%ecx), %xmm0 movups (%ecx), %xmm1 movups %xmm1, (%ebp) movdqu %xmm0, -16(%ebp) addl $-32, %ebp addl $-32, %ecx addl $-8, %esi jne LBB3_266 movl 48(%esp), %ecx movl %ecx, 72(%esp) movl 56(%esp), %ebx jmp LBB3_268 LBB3_280: addl $2, %esi cmpl $-16777216, %ecx cmovne %edx, %ebp movl $0, 72(%esp) movl %esi, %ecx andl $-8, %ecx je LBB3_281 movl %ecx, 68(%esp) movl $-5, %ecx subl %ebp, %ecx leal (%edi,%ecx,4), %ecx movl 64(%esp), %edi leal -4(%edi), %edi cmpl %ecx, %edi ja LBB3_284 movl 44(%esp), %ecx leal -16(%ecx,%eax,4), %ecx addl %eax, %ebp movl $-2, %edi subl %ebp, %edi movl 64(%esp), %ebp leal (%ebp,%edi,4), %edi cmpl %edi, %ecx movl %eax, %ecx jbe LBB3_287 LBB3_284: movl %eax, %ecx subl 68(%esp), %ecx movl 64(%esp), %edi leal -16(%edi), %ebp movl 44(%esp), %edi leal -28(%edi,%eax,4), %edi leal 2(%ebx,%eax), %ebx andl $-8, %ebx LBB3_285: movdqu -16(%edi), %xmm0 movups (%edi), %xmm1 movups %xmm1, (%ebp) movdqu %xmm0, -16(%ebp) addl $-32, %ebp addl $-32, %edi addl $-8, %ebx jne LBB3_285 movl 68(%esp), %edi movl %edi, 72(%esp) jmp LBB3_287 LBB3_294: andl $16777215, %ecx leal -12(%edi,%ecx,4), %eax movl %esi, 8(%esp) movl %ebx, (%esp) movl %eax, 4(%esp) call _gerepile jmp LBB3_399 LBB3_72: movl 68(%esp), %esi LBB3_78: cmpl %ecx, 56(%esp) jne LBB3_66 movl 60(%esp), %esi jmp LBB3_398 LBB3_66: movl %edx, %ebx notl %ebx cmpl $-3, %ebx cmovg %ebx, %edi leal 2(%edx,%edi), %ecx leal 1(%edx,%edi), %ebp testb $3, %cl je LBB3_69 movl %esi, %ecx notl %ecx orl $1056964608, %ecx movl 64(%esp), %edi leal (%edi,%ecx,4), %edi cmpl $-3, %ebx movl $-2, %ecx cmovg %ebx, %ecx leal 2(%edx,%ecx), %ebx andl $3, %ebx negl %ebx LBB3_68: movl -4(%eax,%edx,4), %ecx movl %ecx, (%edi,%edx,4) leal -1(%edx), %edx incl %ebx jne LBB3_68 LBB3_69: cmpl $3, %ebp jae LBB3_80 movl 60(%esp), %esi jmp LBB3_398 LBB3_80: incl %edx andl $16777215, %esi movl $-4, %ecx subl %esi, %ecx movl 64(%esp), %esi leal (%esi,%ecx,4), %ecx LBB3_81: movl -8(%eax,%edx,4), %esi movl %esi, 8(%ecx,%edx,4) movl -12(%eax,%edx,4), %esi movl %esi, 4(%ecx,%edx,4) movl -16(%eax,%edx,4), %esi movl %esi, (%ecx,%edx,4) movl -20(%eax,%edx,4), %esi movl %esi, -4(%ecx,%edx,4) addl $-4, %edx cmpl $1, %edx jg LBB3_81 movl 60(%esp), %esi jmp LBB3_398 LBB3_120: movl 64(%esp), %ebx jmp LBB3_252 LBB3_281: movl %eax, %ecx LBB3_287: cmpl 72(%esp), %esi jne LBB3_278 movl 60(%esp), %esi jmp LBB3_398 LBB3_278: movl %ecx, %esi notl %esi cmpl $-3, %esi cmovg %esi, %edx leal 2(%ecx,%edx), %ebx leal 1(%ecx,%edx), %edx testb $1, %bl je LBB3_279 movl 44(%esp), %esi movl -16(%esi,%ecx,4), %esi decl %ecx movl %ecx, %edi subl %eax, %edi movl 64(%esp), %ebx movl %esi, (%ebx,%edi,4) jmp LBB3_290 LBB3_279: movl 64(%esp), %ebx LBB3_290: movl 60(%esp), %esi testl %edx, %edx je LBB3_398 movl %esi, %edi incl %ecx movl $-2, %edx subl %eax, %edx leal (%ebx,%edx,4), %eax movl 44(%esp), %esi LBB3_292: movl -20(%esi,%ecx,4), %edx movl %edx, (%eax,%ecx,4) movl -24(%esi,%ecx,4), %edx movl %edx, -4(%eax,%ecx,4) addl $-2, %ecx cmpl $1, %ecx jg LBB3_292 movl %edi, %esi jmp LBB3_398 LBB3_376: movl 60(%esp), %esi jmp LBB3_398 LBB3_215: movl 48(%esp), %edx movl 60(%esp), %esi movl 56(%esp), %ecx jmp LBB3_252 LBB3_358: cmpl $1, %ecx jne LBB3_396 movl 4(%eax), %ecx movl %ecx, 56(%esp) andl $16777215, %ecx leal 0(,%ecx,4), %esi subl %esi, %edi movl %edi, 60(%esp) cmpl $2, %ecx jb LBB3_321 movl 56(%esp), %ebp andl $16777215, %ebp movl %ebp, %edx negl %edx cmpl $-3, %edx movl $-2, %edi cmovg %edx, %edi addl %ebp, %edi cmpl $-1, %edi movl %ecx, %esi je LBB3_369 incl %edi movl %edi, 52(%esp) cmpl $-3, %edx movl $-2, %esi cmovg %edx, %esi movl %edx, 48(%esp) xorl %edx, %edx andl $-8, %edi je LBB3_362 movl %esi, %edx notl %esi leal (%eax,%esi,4), %esi movl %esi, 44(%esp) movl 64(%esp), %esi leal -4(%esi), %esi cmpl 44(%esp), %esi ja LBB3_365 leal -4(%eax,%ebp,4), %esi movl %esi, 44(%esp) addl %ebp, %edx notl %edx movl %ebx, %esi movl 64(%esp), %ebx leal (%ebx,%edx,4), %edx movl %esi, %ebx cmpl %edx, 44(%esp) movl $0, %edx movl %ecx, %esi jbe LBB3_368 LBB3_365: movl %ecx, %esi subl %edi, %esi movl %edi, 44(%esp) movl 48(%esp), %edi cmpl $-3, %edi movl $-2, %edx cmovg %edi, %edx leal 1(%edx,%ebp), %edi andl $-8, %edi movl 72(%esp), %edx movdqa LCPI3_0-L3$pb(%edx), %xmm0 movl 64(%esp), %ebx LBB3_366: movd %ebp, %xmm1 pshufd $0, %xmm1, %xmm1 paddd %xmm0, %xmm1 movd %xmm1, %edx movups -12(%eax,%edx,4), %xmm1 movups -28(%eax,%edx,4), %xmm2 subl %ecx, %edx movups %xmm1, -12(%ebx,%edx,4) movups %xmm2, -28(%ebx,%edx,4) addl $-8, %ebp addl $-8, %edi jne LBB3_366 movl 44(%esp), %edx movl 68(%esp), %ebx jmp LBB3_368 LBB3_396: andl $16777215, %esi leal (%eax,%esi,4), %ecx movl %eax, 8(%esp) movl %edi, (%esp) LBB3_84: movl %ecx, 4(%esp) call _gerepile jmp LBB3_399 LBB3_197: cmpl $1, %ecx jne LBB3_235 movl 4(%eax), %ecx movl %ecx, 52(%esp) andl $16777215, %ecx leal 0(,%ecx,4), %edx movl %ebp, %esi movl %ebp, 36(%esp) subl %edx, %esi movl %esi, %edi cmpl $2, %ecx jb LBB3_171 movl 52(%esp), %edx andl $16777215, %edx movl %edx, %ebx negl %ebx cmpl $-3, %ebx movl $-2, %ebp cmovg %ebx, %ebp addl %edx, %ebp cmpl $-1, %ebp movl %ecx, %esi je LBB3_208 incl %ebp movl %ebp, 32(%esp) cmpl $-3, %ebx movl %ebp, %esi movl $-2, %ebp cmovg %ebx, %ebp movl $0, 40(%esp) andl $-8, %esi movl %esi, 28(%esp) je LBB3_201 movl %ebp, %esi notl %esi leal (%eax,%esi,4), %esi movl %esi, 24(%esp) movl %ecx, 56(%esp) movl 36(%esp), %ecx leal -4(%ecx), %esi movl 56(%esp), %ecx cmpl 24(%esp), %esi ja LBB3_204 leal -4(%eax,%edx,4), %esi movl %esi, 24(%esp) addl %edx, %ebp notl %ebp movl %ecx, %esi movl 36(%esp), %ecx leal (%ecx,%ebp,4), %ebp movl %esi, %ecx cmpl %ebp, 24(%esp) jbe LBB3_207 LBB3_204: movl %ecx, 56(%esp) movl %ecx, %esi subl 28(%esp), %esi cmpl $-3, %ebx movl $-2, %ebp cmovg %ebx, %ebp leal 1(%ebp,%edx), %ebx andl $-8, %ebx movl 72(%esp), %ebp movdqa LCPI3_0-L3$pb(%ebp), %xmm0 movl 36(%esp), %ecx LBB3_205: movd %edx, %xmm1 pshufd $0, %xmm1, %xmm1 paddd %xmm0, %xmm1 movd %xmm1, %ebp movups -12(%eax,%ebp,4), %xmm1 movups -28(%eax,%ebp,4), %xmm2 subl 56(%esp), %ebp movups %xmm1, -12(%ecx,%ebp,4) movups %xmm2, -28(%ecx,%ebp,4) addl $-8, %edx addl $-8, %ebx jne LBB3_205 movl 28(%esp), %ecx movl %ecx, 40(%esp) movl 56(%esp), %ecx jmp LBB3_207 LBB3_384: addl $2, %esi movl %esi, 56(%esp) cmpl $-16777216, %ecx cmovne %edi, %ebx xorl %ecx, %ecx andl $-8, %esi je LBB3_385 movl %esi, 52(%esp) movl $-2, %edi movl $-2, %ecx subl %ebx, %ecx leal (%eax,%ecx,4), %esi movl 64(%esp), %ecx leal -4(%ecx), %ecx cmpl %esi, %ecx movl 68(%esp), %esi ja LBB3_388 leal -4(%eax,%edx,4), %ecx addl %edx, %ebx subl %ebx, %edi movl %edi, %ebx movl 64(%esp), %edi leal (%edi,%ebx,4), %ebx movl $-2, %edi cmpl %ebx, %ecx movl $0, %ecx jbe LBB3_391 LBB3_388: movl %edx, %ecx subl 52(%esp), %ecx movl %ecx, 48(%esp) leal 2(%ebp,%edx), %ebp andl $-8, %ebp movl 72(%esp), %ecx movdqa LCPI3_0-L3$pb(%ecx), %xmm0 movl %edx, %ebx movl 64(%esp), %edi LBB3_389: movd %ebx, %xmm1 pshufd $0, %xmm1, %xmm1 paddd %xmm0, %xmm1 movd %xmm1, %ecx movups -12(%eax,%ecx,4), %xmm1 movups -28(%eax,%ecx,4), %xmm2 subl %edx, %ecx movups %xmm1, -12(%edi,%ecx,4) movups %xmm2, -28(%edi,%ecx,4) addl $-8, %ebx addl $-8, %ebp jne LBB3_389 movl 48(%esp), %edx movl 52(%esp), %ecx movl $-2, %edi jmp LBB3_391 LBB3_223: addl $2, %edi cmpl $-16777216, %ecx cmovne %ebx, %esi movl $0, 40(%esp) movl %edi, %ecx andl $-8, %ecx je LBB3_224 movl %ecx, 24(%esp) movl $-2, %ecx subl %esi, %ecx leal (%eax,%ecx,4), %ecx movl %ecx, 28(%esp) movl 36(%esp), %ecx leal -4(%ecx), %ecx cmpl 28(%esp), %ecx ja LBB3_227 movl %edi, 32(%esp) leal -4(%eax,%edx,4), %edi addl %edx, %esi movl $-2, %ecx subl %esi, %ecx movl 36(%esp), %esi leal (%esi,%ecx,4), %esi cmpl %esi, %edi movl 56(%esp), %ecx movl 32(%esp), %edi jbe LBB3_230 LBB3_227: movl %edi, 32(%esp) movl %edx, %edi subl 24(%esp), %edi leal 2(%ebp,%edx), %ebp andl $-8, %ebp movl 72(%esp), %ecx movdqa LCPI3_0-L3$pb(%ecx), %xmm0 movl %edx, %esi movl 36(%esp), %ebx LBB3_228: movd %esi, %xmm1 pshufd $0, %xmm1, %xmm1 paddd %xmm0, %xmm1 movd %xmm1, %ecx movups -12(%eax,%ecx,4), %xmm1 movups -28(%eax,%ecx,4), %xmm2 subl %edx, %ecx movups %xmm1, -12(%ebx,%ecx,4) movups %xmm2, -28(%ebx,%ecx,4) addl $-8, %esi addl $-8, %ebp jne LBB3_228 movl %edi, %edx movl 24(%esp), %ecx movl %ecx, 40(%esp) movl $-2, %ebx movl 56(%esp), %ecx movl 32(%esp), %edi jmp LBB3_230 LBB3_122: movl %ecx, 56(%esp) movl %esi, %eax movl 36(%esp), %edi movl $-2, %ecx jmp LBB3_123 LBB3_308: movl %ecx, %esi LBB3_314: movl 52(%esp), %edx cmpl %edx, 48(%esp) je LBB3_321 LBB3_315: movl %esi, %ebp negl %ebp cmpl $-3, %ebp movl $-2, %edx cmovg %ebp, %edx leal (%esi,%edx), %edi leal 1(%esi,%edx), %edx testb $3, %dl je LBB3_318 movl 56(%esp), %edx notl %edx orl $1056964608, %edx movl 64(%esp), %ebx leal (%ebx,%edx,4), %ebx cmpl $-3, %ebp movl $-2, %edx cmovg %ebp, %edx leal 1(%esi,%edx), %ebp andl $3, %ebp negl %ebp LBB3_317: movl -4(%eax,%esi,4), %edx movl %edx, (%ebx,%esi,4) leal -1(%esi), %esi incl %ebp jne LBB3_317 LBB3_318: cmpl $3, %edi movl 68(%esp), %ebx jb LBB3_321 movl 56(%esp), %edi notl %edi orl $1056964608, %edi movl 64(%esp), %edx leal (%edx,%edi,4), %edx LBB3_320: movl -4(%eax,%esi,4), %edi movl %edi, (%edx,%esi,4) movl -8(%eax,%esi,4), %edi movl %edi, -4(%edx,%esi,4) movl -12(%eax,%esi,4), %edi movl %edi, -8(%edx,%esi,4) movl -16(%eax,%esi,4), %edi movl %edi, -12(%edx,%esi,4) leal -4(%esi), %esi cmpl $1, %esi jg LBB3_320 jmp LBB3_321 LBB3_154: cmpl $1, %ecx jne LBB3_235 movl 4(%eax), %ecx movl %ecx, 52(%esp) andl $16777215, %ecx leal 0(,%ecx,4), %edx movl %ebp, %esi movl %ebp, 36(%esp) subl %edx, %esi movl %esi, %edi cmpl $2, %ecx jb LBB3_171 movl 52(%esp), %edx andl $16777215, %edx movl %edx, %ebx negl %ebx cmpl $-3, %ebx movl $-2, %ebp cmovg %ebx, %ebp addl %edx, %ebp cmpl $-1, %ebp movl %ecx, %esi je LBB3_165 movl %edi, 56(%esp) movl %ecx, 40(%esp) incl %ebp movl %ebp, 32(%esp) cmpl $-3, %ebx movl %ebp, %ecx movl $-2, %ebp cmovg %ebx, %ebp xorl %edi, %edi movl %ecx, %esi andl $-8, %esi movl %esi, 28(%esp) je LBB3_158 movl %ebp, %esi notl %esi leal (%eax,%esi,4), %ecx movl %ecx, 24(%esp) movl 36(%esp), %ecx leal -4(%ecx), %esi cmpl 24(%esp), %esi ja LBB3_161 leal -4(%eax,%edx,4), %esi addl %edx, %ebp notl %ebp movl 36(%esp), %ecx leal (%ecx,%ebp,4), %ebp cmpl %ebp, %esi movl 40(%esp), %esi jbe LBB3_164 LBB3_161: movl 40(%esp), %edi movl %edi, %esi subl 28(%esp), %esi cmpl $-3, %ebx movl $-2, %ebp cmovg %ebx, %ebp leal 1(%ebp,%edx), %ebx andl $-8, %ebx movl 72(%esp), %ebp movdqa LCPI3_0-L3$pb(%ebp), %xmm0 movl 36(%esp), %ecx LBB3_162: movd %edx, %xmm1 pshufd $0, %xmm1, %xmm1 paddd %xmm0, %xmm1 movd %xmm1, %ebp movups -12(%eax,%ebp,4), %xmm1 movups -28(%eax,%ebp,4), %xmm2 subl %edi, %ebp movups %xmm1, -12(%ecx,%ebp,4) movups %xmm2, -28(%ecx,%ebp,4) addl $-8, %edx addl $-8, %ebx jne LBB3_162 movl 28(%esp), %edi jmp LBB3_164 LBB3_235: andl $16777215, %edi leal (%eax,%edi,4), %ecx movl %eax, 8(%esp) movl %ebp, (%esp) movl %ecx, 4(%esp) call _gerepile movl %eax, %ecx jmp LBB3_250 LBB3_126: movl %esi, %eax movl 36(%esp), %edi LBB3_130: movl $-2, %ecx xorl %edx, %edx jmp LBB3_134 LBB3_385: movl 68(%esp), %esi LBB3_391: cmpl %ecx, 56(%esp) jne LBB3_379 movl 60(%esp), %esi jmp LBB3_398 LBB3_379: movl %edx, %ebx notl %ebx cmpl $-3, %ebx cmovg %ebx, %edi leal 2(%edx,%edi), %ecx leal 1(%edx,%edi), %ebp testb $3, %cl je LBB3_382 movl %esi, %ecx notl %ecx orl $1056964608, %ecx movl 64(%esp), %edi leal (%edi,%ecx,4), %edi cmpl $-3, %ebx movl $-2, %ecx cmovg %ebx, %ecx leal 2(%edx,%ecx), %ebx andl $3, %ebx negl %ebx LBB3_381: movl -4(%eax,%edx,4), %ecx movl %ecx, (%edi,%edx,4) leal -1(%edx), %edx incl %ebx jne LBB3_381 LBB3_382: cmpl $3, %ebp jae LBB3_393 movl 60(%esp), %esi jmp LBB3_398 LBB3_393: incl %edx andl $16777215, %esi movl $-4, %ecx subl %esi, %ecx movl 64(%esp), %esi leal (%esi,%ecx,4), %ecx LBB3_394: movl -8(%eax,%edx,4), %esi movl %esi, 8(%ecx,%edx,4) movl -12(%eax,%edx,4), %esi movl %esi, 4(%ecx,%edx,4) movl -16(%eax,%edx,4), %esi movl %esi, (%ecx,%edx,4) movl -20(%eax,%edx,4), %esi movl %esi, -4(%ecx,%edx,4) addl $-4, %edx cmpl $1, %edx jg LBB3_394 movl 60(%esp), %esi jmp LBB3_398 LBB3_224: movl 56(%esp), %ecx LBB3_230: cmpl 40(%esp), %edi je LBB3_231 LBB3_218: movl %ecx, %edi movl %edx, %ebp notl %ebp cmpl $-3, %ebp cmovg %ebp, %ebx leal 2(%edx,%ebx), %ecx leal 1(%edx,%ebx), %esi testb $3, %cl je LBB3_221 movl 52(%esp), %ecx notl %ecx orl $1056964608, %ecx movl 36(%esp), %ebx leal (%ebx,%ecx,4), %ebx cmpl $-3, %ebp movl $-2, %ecx cmovg %ebp, %ecx leal 2(%edx,%ecx), %ebp andl $3, %ebp negl %ebp LBB3_220: movl -4(%eax,%edx,4), %ecx movl %ecx, (%ebx,%edx,4) leal -1(%edx), %edx incl %ebp jne LBB3_220 LBB3_221: cmpl $3, %esi jae LBB3_232 movl 64(%esp), %ebx jmp LBB3_234 LBB3_232: incl %edx movl 52(%esp), %esi andl $16777215, %esi movl $-4, %ecx subl %esi, %ecx movl 36(%esp), %esi leal (%esi,%ecx,4), %ecx movl 64(%esp), %ebx LBB3_233: movl -8(%eax,%edx,4), %esi movl %esi, 8(%ecx,%edx,4) movl -12(%eax,%edx,4), %esi movl %esi, 4(%ecx,%edx,4) movl -16(%eax,%edx,4), %esi movl %esi, (%ecx,%edx,4) movl -20(%eax,%edx,4), %esi movl %esi, -4(%ecx,%edx,4) addl $-4, %edx cmpl $1, %edx jg LBB3_233 LBB3_234: movl 60(%esp), %esi movl 48(%esp), %edx movl %edi, %ecx jmp LBB3_252 LBB3_131: movl %ebx, %eax subl 24(%esp), %eax movl %eax, 28(%esp) cmpl $-3, %ebp movl $-2, %eax cmovg %ebp, %eax leal 1(%eax,%edx), %ebp andl $-8, %ebp movl 72(%esp), %eax movdqa LCPI3_0-L3$pb(%eax), %xmm0 LBB3_132: movd %edx, %xmm1 pshufd $0, %xmm1, %xmm1 paddd %xmm0, %xmm1 movd %xmm1, %eax movups -12(%ecx,%eax,4), %xmm1 movups -28(%ecx,%eax,4), %xmm2 subl %ebx, %eax movups %xmm1, -12(%edi,%eax,4) movups %xmm2, -28(%edi,%eax,4) addl $-8, %edx addl $-8, %ebp jne LBB3_132 movl 28(%esp), %ebx movl 24(%esp), %edx movl 60(%esp), %eax movl $-2, %ecx LBB3_134: cmpl %edx, 32(%esp) jne LBB3_123 movl 64(%esp), %ebx movl 48(%esp), %edx movl %eax, %esi movl 56(%esp), %ecx jmp LBB3_252 LBB3_123: movl %eax, 60(%esp) movl %ebx, %edx negl %edx cmpl $-3, %edx cmovg %edx, %ecx movl %ecx, %eax leal (%ebx,%eax), %ecx leal 1(%ebx,%eax), %eax testb $3, %al je LBB3_124 movl 52(%esp), %eax notl %eax orl $1056964608, %eax leal (%edi,%eax,4), %eax cmpl $-3, %edx movl $-2, %esi cmovg %edx, %esi leal 1(%ebx,%esi), %edx andl $3, %edx negl %edx movl 40(%esp), %ebp LBB3_137: movl -4(%ebp,%ebx,4), %esi movl %esi, (%eax,%ebx,4) leal -1(%ebx), %ebx incl %edx jne LBB3_137 jmp LBB3_138 LBB3_124: movl 40(%esp), %ebp LBB3_138: cmpl $3, %ecx jae LBB3_139 LBB3_181: movl 64(%esp), %ebx LBB3_188: movl 60(%esp), %esi movl 48(%esp), %edx movl 56(%esp), %ecx jmp LBB3_252 LBB3_139: movl 52(%esp), %ecx notl %ecx orl $1056964608, %ecx movl 36(%esp), %eax leal (%eax,%ecx,4), %eax movl 60(%esp), %esi movl 48(%esp), %edx LBB3_140: movl -4(%ebp,%ebx,4), %ecx movl %ecx, (%eax,%ebx,4) movl -8(%ebp,%ebx,4), %ecx movl %ecx, -4(%eax,%ebx,4) movl -12(%ebp,%ebx,4), %ecx movl %ecx, -8(%eax,%ebx,4) movl -16(%ebp,%ebx,4), %ecx movl %ecx, -12(%eax,%ebx,4) leal -4(%ebx), %ebx cmpl $1, %ebx jg LBB3_140 movl 64(%esp), %ebx movl 56(%esp), %ecx jmp LBB3_252 LBB3_47: movl %ecx, %esi LBB3_53: movl 52(%esp), %edx cmpl %edx, 48(%esp) je LBB3_60 LBB3_54: movl %esi, %ebp negl %ebp cmpl $-3, %ebp cmovg %ebp, %ebx leal (%esi,%ebx), %edi leal 1(%esi,%ebx), %edx testb $3, %dl je LBB3_57 movl 56(%esp), %edx notl %edx orl $1056964608, %edx movl 64(%esp), %ebx leal (%ebx,%edx,4), %ebx cmpl $-3, %ebp movl $-2, %edx cmovg %ebp, %edx leal 1(%esi,%edx), %ebp andl $3, %ebp negl %ebp LBB3_56: movl -4(%eax,%esi,4), %edx movl %edx, (%ebx,%esi,4) leal -1(%esi), %esi incl %ebp jne LBB3_56 LBB3_57: cmpl $3, %edi jb LBB3_60 movl 56(%esp), %edi notl %edi orl $1056964608, %edi movl 64(%esp), %edx leal (%edx,%edi,4), %edx LBB3_59: movl -4(%eax,%esi,4), %edi movl %edi, (%edx,%esi,4) movl -8(%eax,%esi,4), %edi movl %edi, -4(%edx,%esi,4) movl -12(%eax,%esi,4), %edi movl %edi, -8(%edx,%esi,4) movl -16(%eax,%esi,4), %edi movl %edi, -12(%edx,%esi,4) leal -4(%esi), %esi cmpl $1, %esi jg LBB3_59 LBB3_60: orl $33554432, %ecx movl 60(%esp), %esi movl %ecx, (%esi) jmp LBB3_61 LBB3_262: movl %eax, %edx LBB3_268: cmpl 72(%esp), %edi movl 44(%esp), %esi je LBB3_274 LBB3_269: movl %edx, %ecx negl %ecx cmpl $-3, %ecx movl $-2, %edi cmovg %ecx, %edi leal (%edx,%edi), %ebp leal 1(%edx,%edi), %ecx testb $1, %cl je LBB3_271 movl -16(%esi,%edx,4), %ecx movl %ecx, 72(%esp) decl %edx movl %edx, %edi subl %eax, %edi movl %ebp, 56(%esp) movl 64(%esp), %ebp movl 72(%esp), %ecx movl %ecx, (%ebp,%edi,4) movl 56(%esp), %ebp LBB3_271: testl %ebp, %ebp movl %esi, %edi je LBB3_274 notl %ebx orl $1056964608, %ebx movl 64(%esp), %ecx leal (%ecx,%ebx,4), %ecx LBB3_273: movl -16(%edi,%edx,4), %esi movl %esi, (%ecx,%edx,4) movl -20(%edi,%edx,4), %esi movl %esi, -4(%ecx,%edx,4) leal -2(%edx), %edx cmpl $1, %edx jg LBB3_273 LBB3_274: orl $33554432, %eax movl 60(%esp), %esi movl %eax, (%esi) LBB3_61: movl 68(%esp), %eax movl %esi, (%eax) jmp LBB3_398 LBB3_362: movl %ecx, %esi LBB3_368: cmpl %edx, 52(%esp) je LBB3_321 LBB3_369: movl %esi, %ebp negl %ebp cmpl $-3, %ebp movl $-2, %edx cmovg %ebp, %edx leal (%esi,%edx), %edi leal 1(%esi,%edx), %edx testb $3, %dl je LBB3_372 movl 56(%esp), %edx notl %edx orl $1056964608, %edx movl 64(%esp), %ebx leal (%ebx,%edx,4), %ebx cmpl $-3, %ebp movl $-2, %edx cmovg %ebp, %edx leal 1(%esi,%edx), %ebp andl $3, %ebp negl %ebp LBB3_371: movl -4(%eax,%esi,4), %edx movl %edx, (%ebx,%esi,4) leal -1(%esi), %esi incl %ebp jne LBB3_371 LBB3_372: cmpl $3, %edi movl 68(%esp), %ebx jb LBB3_321 movl 56(%esp), %edi notl %edi orl $1056964608, %edi movl 64(%esp), %edx leal (%edx,%edi,4), %edx LBB3_374: movl -4(%eax,%esi,4), %edi movl %edi, (%edx,%esi,4) movl -8(%eax,%esi,4), %edi movl %edi, -4(%edx,%esi,4) movl -12(%eax,%esi,4), %edi movl %edi, -8(%edx,%esi,4) movl -16(%eax,%esi,4), %edi movl %edi, -12(%edx,%esi,4) leal -4(%esi), %esi cmpl $1, %esi jg LBB3_374 LBB3_321: orl $33554432, %ecx movl 60(%esp), %esi movl %ecx, (%esi) movl %esi, (%ebx) jmp LBB3_398 LBB3_201: movl %ecx, %esi LBB3_207: movl 40(%esp), %edx cmpl %edx, 32(%esp) je LBB3_171 LBB3_208: movl %esi, %ebp negl %ebp cmpl $-3, %ebp movl $-2, %edx cmovg %ebp, %edx leal (%esi,%edx), %ebx movl %ebx, 40(%esp) leal 1(%esi,%edx), %ebx testb $3, %bl je LBB3_211 movl 52(%esp), %ebx notl %ebx orl $1056964608, %ebx movl %ecx, %edx movl 36(%esp), %ecx leal (%ecx,%ebx,4), %ebx movl %edx, %ecx cmpl $-3, %ebp movl $-2, %edx cmovg %ebp, %edx leal 1(%esi,%edx), %ebp andl $3, %ebp negl %ebp LBB3_210: movl -4(%eax,%esi,4), %edx movl %edx, (%ebx,%esi,4) leal -1(%esi), %esi incl %ebp jne LBB3_210 LBB3_211: cmpl $3, 40(%esp) jb LBB3_171 movl 52(%esp), %edx notl %edx orl $1056964608, %edx movl %ecx, %ebx movl 36(%esp), %ecx leal (%ecx,%edx,4), %edx movl %ebx, %ecx LBB3_213: movl -4(%eax,%esi,4), %ebx movl %ebx, (%edx,%esi,4) movl -8(%eax,%esi,4), %ebx movl %ebx, -4(%edx,%esi,4) movl -12(%eax,%esi,4), %ebx movl %ebx, -8(%edx,%esi,4) movl -16(%eax,%esi,4), %ebx movl %ebx, -12(%edx,%esi,4) leal -4(%esi), %esi cmpl $1, %esi jg LBB3_213 jmp LBB3_171 LBB3_158: movl 40(%esp), %esi LBB3_164: cmpl %edi, 32(%esp) movl 40(%esp), %ecx movl 56(%esp), %edi je LBB3_171 LBB3_165: movl %ecx, 40(%esp) movl %esi, %ebp negl %ebp cmpl $-3, %ebp movl $-2, %ecx cmovg %ebp, %ecx leal (%esi,%ecx), %edx movl %edx, 56(%esp) leal 1(%esi,%ecx), %ebx testb $3, %bl je LBB3_168 movl 52(%esp), %ebx notl %ebx orl $1056964608, %ebx movl 36(%esp), %ecx leal (%ecx,%ebx,4), %ebx cmpl $-3, %ebp movl $-2, %edx cmovg %ebp, %edx leal 1(%esi,%edx), %ebp andl $3, %ebp negl %ebp LBB3_167: movl -4(%eax,%esi,4), %edx movl %edx, (%ebx,%esi,4) leal -1(%esi), %esi incl %ebp jne LBB3_167 LBB3_168: cmpl $3, 56(%esp) movl 40(%esp), %ecx jb LBB3_171 movl 52(%esp), %edx notl %edx orl $1056964608, %edx movl %ecx, %ebx movl 36(%esp), %ecx leal (%ecx,%edx,4), %edx movl %ebx, %ecx LBB3_170: movl -4(%eax,%esi,4), %ebx movl %ebx, (%edx,%esi,4) movl -8(%eax,%esi,4), %ebx movl %ebx, -4(%edx,%esi,4) movl -12(%eax,%esi,4), %ebx movl %ebx, -8(%edx,%esi,4) movl -16(%eax,%esi,4), %ebx movl %ebx, -12(%edx,%esi,4) leal -4(%esi), %esi cmpl $1, %esi jg LBB3_170 LBB3_171: orl $33554432, %ecx movl %ecx, (%edi) movl %edi, %ecx movl 68(%esp), %eax movl %ecx, (%eax) LBB3_231: movl 64(%esp), %ebx movl 60(%esp), %esi movl 48(%esp), %edx jmp LBB3_252 .align 2, 0x90 LJTI3_0: .long L3_0_set_10 .long L3_0_set_397 .long L3_0_set_397 .long L3_0_set_32 .long L3_0_set_397 .long L3_0_set_397 .long L3_0_set_397 .long L3_0_set_397 .long L3_0_set_33 .long L3_0_set_34 LJTI3_1: .long L3_1_set_117 .long L3_1_set_249 .long L3_1_set_249 .long L3_1_set_142 .long L3_1_set_249 .long L3_1_set_249 .long L3_1_set_249 .long L3_1_set_249 .long L3_1_set_144 .long L3_1_set_145 # ---------------------- .align 4, 0x90 .globl _nfgaloismatrix _nfgaloismatrix: pushl %ebp pushl %ebx pushl %edi pushl %esi subl $60, %esp call L4$pb L4$pb: popl %ebp movl 84(%esp), %esi movl 80(%esp), %eax movl %eax, (%esp) call _checknf movl %eax, %edi movl 28(%edi), %ebx movl (%esi), %ecx movl %ecx, %eax andl $-33554432, %eax cmpl $603979776, %eax jne LBB4_2 movl %esi, 52(%esp) jmp LBB4_3 LBB4_2: movl %esi, 4(%esp) movl %edi, (%esp) call _algtobasis movl %eax, 52(%esp) movl (%eax), %ecx LBB4_3: movl %ecx, 24(%esp) andl $16777215, %ecx movl %ebp, %esi movl %esi, 36(%esp) movl L_avma$non_lazy_ptr-L4$pb(%esi), %eax movl %eax, 40(%esp) movl (%eax), %edx movl %edx, 32(%esp) movl %ecx, %eax negl %eax movl %eax, 44(%esp) leal 0(,%ecx,4), %eax movl %edx, %ebp subl %eax, %ebp movl %ebp, 56(%esp) movl L_bot$non_lazy_ptr-L4$pb(%esi), %esi movl %esi, 28(%esp) subl (%esi), %edx shrl $2, %edx cmpl %ecx, %edx movl %ecx, %esi jae LBB4_5 movl $14, (%esp) call _pari_err LBB4_5: movl 56(%esp), %ebp movl 40(%esp), %ecx movl %ebp, (%ecx) movl %esi, %eax orl $637534208, %eax movl %eax, (%ebp) movl (%ecx), %ebp movl 44(%esp), %eax leal (%ebp,%eax,4), %eax movl %eax, 44(%esp) movl %ebp, %eax movl 28(%esp), %ecx subl (%ecx), %eax shrl $2, %eax cmpl %esi, %eax jae LBB4_7 movl $14, (%esp) call _pari_err LBB4_7: movl 44(%esp), %ecx movl 40(%esp), %eax movl %ecx, (%eax) movl %esi, 48(%esp) movl %esi, %eax orl $603979776, %eax movl %eax, (%ecx) cmpl $2, %esi jb LBB4_15 movl 48(%esp), %eax leal -1(%eax), %ecx leal -2(%eax), %edx movl $1, %eax testb $3, %cl je LBB4_12 movl %edx, 28(%esp) movl %ebx, 40(%esp) movl $1, %eax subl 48(%esp), %eax leal (%ebp,%eax,4), %edx movl 24(%esp), %eax addb $3, %al movzbl %al, %ecx andl $3, %ecx xorl %eax, %eax movl 36(%esp), %esi movl L_gen_0$non_lazy_ptr-L4$pb(%esi), %ebx .align 4, 0x90 LBB4_10: movl (%ebx), %esi movl %esi, (%edx,%eax,4) incl %eax cmpl %eax, %ecx jne LBB4_10 incl %eax movl 40(%esp), %ebx movl 28(%esp), %edx LBB4_12: cmpl $3, %edx jb LBB4_15 subl 48(%esp), %eax movl 36(%esp), %ecx movl L_gen_0$non_lazy_ptr-L4$pb(%ecx), %ecx .align 4, 0x90 LBB4_14: movl (%ecx), %edx movl %edx, (%ebp,%eax,4) movl (%ecx), %edx movl %edx, 4(%ebp,%eax,4) movl (%ecx), %edx movl %edx, 8(%ebp,%eax,4) movl (%ecx), %edx movl %edx, 12(%ebp,%eax,4) addl $4, %eax jne LBB4_14 LBB4_15: movl 36(%esp), %eax movl L_gen_1$non_lazy_ptr-L4$pb(%eax), %eax movl (%eax), %eax movl $1, %ecx movl 48(%esp), %edx subl %edx, %ecx movl %eax, (%ebp,%ecx,4) movl 32(%esp), %eax movl 44(%esp), %esi movl %esi, (%eax,%ecx,4) cmpl $3, %edx movl %edx, %esi jb LBB4_21 movl $2, %ebp .align 4, 0x90 LBB4_17: movl (%ebx,%ebp,4), %eax movl %eax, 4(%esp) movl %edi, (%esp) call _nf_to_scalar_or_alg movl (%eax), %ecx movl $-33554432, %edx andl %edx, %ecx cmpl $335544320, %ecx jne LBB4_19 movl 52(%esp), %ecx movl %ecx, 8(%esp) movl %eax, 4(%esp) movl %edi, (%esp) call _nfpoleval jmp LBB4_20 .align 4, 0x90 LBB4_19: movl 4(%edi), %ecx movl (%ecx), %ecx movl $16777215, %edx andl %edx, %ecx addl $-3, %ecx movl %ecx, 4(%esp) movl %eax, (%esp) call _scalarcol LBB4_20: movl 56(%esp), %ecx movl %eax, (%ecx,%ebp,4) incl %ebp cmpl %esi, %ebp jl LBB4_17 LBB4_21: movl 56(%esp), %eax addl $60, %esp popl %esi popl %edi popl %ebx popl %ebp ret # ---------------------- .align 4, 0x90 .globl _idealfrobenius _idealfrobenius: pushl %ebp pushl %ebx pushl %edi pushl %esi subl $92, %esp call L5$pb L5$pb: popl %edi movl 120(%esp), %ebp movl 116(%esp), %esi movl 112(%esp), %eax movl %ebp, 88(%esp) movl L_avma$non_lazy_ptr-L5$pb(%edi), %ecx movl %ecx, 72(%esp) movl (%ecx), %ecx movl %ecx, 44(%esp) movl %eax, (%esp) call _checknf movl %eax, %ebx movl %esi, (%esp) call _checkgal movl %ebp, (%esp) call _checkprid movl 4(%ebx), %eax movl 4(%esi), %ecx movl %ecx, 4(%esp) movl %eax, (%esp) call _gequal testl %eax, %eax jne LBB5_2 leal L_.str5-L5$pb(%edi), %eax movl %eax, 4(%esp) movl $5, (%esp) call _pari_err LBB5_2: movl 12(%ebp), %eax cmpl $2, 8(%eax) jl LBB5_4 leal L_.str6-L5$pb(%edi), %eax movl %eax, 4(%esp) movl $5, (%esp) call _pari_err LBB5_4: movl %edi, 48(%esp) movl 16(%ebp), %eax movl 8(%eax), %eax cmpl $1, %eax jne LBB5_25 movl 4(%ebx), %eax movl (%eax), %edi movl %edi, %esi andl $16777215, %esi leal -2(%esi), %ebx movl 48(%esp), %eax movl L_bot$non_lazy_ptr-L5$pb(%eax), %eax movl 44(%esp), %edx movl %edx, %ecx subl (%eax), %ecx movl $2, %eax subl %esi, %eax shrl $2, %ecx cmpl %ebx, %ecx movl 72(%esp), %ecx movl %edx, (%ecx) leal (%edx,%eax,4), %edx jae LBB5_7 movl $14, (%esp) movl %edx, %ebp call _pari_err movl %ebp, %edx movl 72(%esp), %ecx LBB5_7: leal -3(%esi), %ebp movl %edx, (%ecx) cmpl $16777216, %ebx jb LBB5_9 movl 48(%esp), %eax leal L_.str7-L5$pb(%eax), %eax movl %eax, 4(%esp) movl $15, (%esp) movl %edx, 76(%esp) call _pari_err movl 76(%esp), %edx LBB5_9: movl %ebx, %eax orl $738197504, %eax movl %eax, (%edx) testl %ebp, %ebp jle LBB5_85 movl $1, %eax cmpl $3, %esi je LBB5_16 addl $5, %edi andl $7, %edi movl %ebp, %ecx subl %edi, %ecx movl $1, %eax je LBB5_15 movl %edx, 76(%esp) incl %ecx movl %ecx, 72(%esp) movl $7, %eax subl %esi, %eax movl 44(%esp), %ecx leal (%ecx,%eax,4), %eax negl %edi leal -3(%esi,%edi), %edx xorl %edi, %edi movl 48(%esp), %ecx movdqa LCPI5_1-L5$pb(%ecx), %xmm0 movdqa LCPI5_2-L5$pb(%ecx), %xmm1 .align 4, 0x90 LBB5_13: leal 1(%edi), %ecx movd %ecx, %xmm2 pshufd $0, %xmm2, %xmm2 movdqa %xmm2, %xmm3 paddd %xmm0, %xmm3 paddd %xmm1, %xmm2 movdqu %xmm3, -16(%eax,%edi,4) movdqu %xmm2, (%eax,%edi,4) addl $8, %edi cmpl %edi, %edx jne LBB5_13 movl 72(%esp), %eax movl 76(%esp), %edx LBB5_15: cmpl %eax, %ebx je LBB5_85 LBB5_16: subl %eax, %ebx movl %ebp, %ecx subl %eax, %ecx testb $3, %bl je LBB5_17 movl %edx, 76(%esp) movl $2, %edx subl %esi, %edx movl 44(%esp), %edi leal (%edi,%edx,4), %edx andl $3, %ebx negl %ebx .align 4, 0x90 LBB5_19: movl %eax, (%edx,%eax,4) incl %eax incl %ebx jne LBB5_19 jmp LBB5_20 LBB5_25: movl %eax, 36(%esp) leal 80(%esp), %eax movl %eax, 12(%esp) leal 84(%esp), %eax movl %eax, 8(%esp) leal 88(%esp), %eax movl %eax, 4(%esp) movl %ebx, %edi movl %edi, (%esp) call _nf_to_Fq_init movl %eax, 32(%esp) movl 4(%edi), %eax movl $16777215, %ecx andl (%eax), %ecx movl $0, 40(%esp) addl $-3, %ecx movl %ecx, 76(%esp) movl $0, %ebx jle LBB5_32 movl 88(%esp), %ecx movl %ecx, 60(%esp) movl 72(%esp), %eax movl (%eax), %eax movl %eax, 52(%esp) movl 8(%ecx), %eax movl %eax, 56(%esp) movl 16(%ecx), %eax movl 8(%eax), %eax movl %eax, 68(%esp) movl 116(%esp), %eax movl 24(%eax), %eax movl %eax, 64(%esp) xorl %ebp, %ebp xorl %ebx, %ebx .align 4, 0x90 LBB5_27: movl 64(%esp), %eax movl 4(%eax,%ebp,4), %esi movl %esi, (%esp) call _perm_order cmpl 68(%esp), %eax jne LBB5_31 movl %esi, 4(%esp) movl 116(%esp), %eax movl %eax, (%esp) call _galoispermtopol movl %eax, 4(%esp) movl %edi, (%esp) call _poltobasis movl %eax, %ebx movl 56(%esp), %eax movl %eax, 8(%esp) movl %ebx, 4(%esp) movl %edi, (%esp) call _galoisapply movl 60(%esp), %ecx movl %ecx, 8(%esp) movl %eax, 4(%esp) movl %edi, (%esp) call _idealval cmpl $1, %eax je LBB5_29 movl 72(%esp), %eax movl 52(%esp), %ecx movl %ecx, (%eax) LBB5_31: incl %ebp cmpl 76(%esp), %ebp jl LBB5_27 LBB5_32: movl 48(%esp), %ebp leal L_.str8-L5$pb(%ebp), %eax movl %eax, 4(%esp) movl $5, (%esp) call _pari_err movl 72(%esp), %ecx jmp LBB5_33 LBB5_29: movl %esi, 40(%esp) movl 72(%esp), %ecx movl 48(%esp), %ebp LBB5_33: movl %edi, %eax movl %eax, 28(%esp) movl 4(%eax), %eax movl $1073676288, %edi andl 4(%eax), %edi movl (%ecx), %esi movl L_bot$non_lazy_ptr-L5$pb(%ebp), %edx movl %edx, 76(%esp) movl %esi, %eax subl (%edx), %eax cmpl $15, %eax movl %ebp, %edx leal -16(%esi), %ebp ja LBB5_35 movl $14, (%esp) call _pari_err movl 48(%esp), %edx movl 72(%esp), %ecx LBB5_35: movl %ecx, 72(%esp) movl %ebp, (%ecx) movl $335544324, -16(%esi) orl $1073741824, %edi movl %edi, -12(%esi) movl L_gen_0$non_lazy_ptr-L5$pb(%edx), %eax movl (%eax), %eax movl %eax, -8(%esi) movl L_gen_1$non_lazy_ptr-L5$pb(%edx), %eax movl %edx, 48(%esp) movl (%eax), %eax movl %eax, -4(%esi) movl 32(%esp), %esi movl %esi, (%esp) call _modpr_genFq movl 80(%esp), %ecx movl %ecx, 4(%esp) movl %ebx, (%esp) movl 28(%esp), %edi movl %edi, %ecx movl %eax, %edx call _QX_galoisapplymod movl %esi, 8(%esp) movl %eax, 4(%esp) movl %edi, (%esp) call _nf_to_Fq movl %eax, %esi movl %esi, 4(%esp) movl %ebp, (%esp) call _ZX_equal xorl %edi, %edi jmp LBB5_37 .align 4, 0x90 LBB5_36: movl 80(%esp), %eax movl 84(%esp), %ecx movl %eax, 12(%esp) movl %ecx, 8(%esp) movl %eax, 4(%esp) movl %ebp, (%esp) call _Fq_pow movl %eax, %ebp incl %edi movl %esi, 4(%esp) movl %ebp, (%esp) call _ZX_equal LBB5_37: testl %eax, %eax je LBB5_36 movl 36(%esp), %eax movl %eax, 4(%esp) movl %edi, (%esp) call _Fl_inv movl %eax, 4(%esp) movl 40(%esp), %eax movl %eax, (%esp) call _perm_pow movl 76(%esp), %ecx cmpl (%ecx), %eax movl 44(%esp), %edi jb LBB5_41 cmpl %eax, %edi jbe LBB5_41 movl 48(%esp), %ecx movl L_top$non_lazy_ptr-L5$pb(%ecx), %ecx cmpl (%ecx), %eax jae LBB5_41 movl (%eax), %esi movl %esi, %ecx shrl $25, %ecx leal -21(%ecx), %edx cmpl $2, %edx jb LBB5_62 cmpl $2, %ecx jne LBB5_44 LBB5_62: movl %esi, %ecx andl $16777215, %ecx shll $2, %ecx subl %ecx, %edi movl %edi, 76(%esp) movl %esi, %edx andl $16777215, %edx movl 72(%esp), %ecx movl %edi, (%ecx) je LBB5_63 movl %esi, %ecx movl %esi, 72(%esp) orl $-16777216, %ecx movl %ecx, %ebx xorl $16777215, %ebx cmpl $-16777216, %ecx movl $-2, %edi movl $-2, %ebp cmove %ebx, %ebp leal (%ebp,%edx), %esi cmpl $-2, %esi jne LBB5_71 movl 72(%esp), %esi jmp LBB5_66 LBB5_41: movl 72(%esp), %ecx movl %edi, (%ecx) LBB5_84: movl %eax, %edx jmp LBB5_85 LBB5_17: movl %edx, 76(%esp) LBB5_20: cmpl $3, %ecx jae LBB5_22 movl 76(%esp), %edx jmp LBB5_85 LBB5_22: movl $5, %ecx subl %esi, %ecx movl 44(%esp), %edx leal (%edx,%ecx,4), %ecx .align 4, 0x90 LBB5_23: movl %eax, -12(%ecx,%eax,4) leal 1(%eax), %edx movl %edx, -8(%ecx,%eax,4) leal 2(%eax), %edx movl %edx, -4(%ecx,%eax,4) leal 3(%eax), %edx movl %edx, (%ecx,%eax,4) addl $4, %eax cmpl %ebp, %edx jne LBB5_23 movl 76(%esp), %edx jmp LBB5_85 LBB5_63: movl 76(%esp), %edx jmp LBB5_85 LBB5_44: cmpl $1, %ecx jne LBB5_83 movl 4(%eax), %ecx movl %ecx, %edx andl $16777215, %edx movl %edx, 68(%esp) leal 0(,%edx,4), %esi subl %esi, %edi movl %edi, 76(%esp) cmpl $2, %edx jb LBB5_61 movl %ecx, %edi andl $16777215, %edi movl %edi, %ebx negl %ebx cmpl $-3, %ebx movl $-2, %edx movl $-2, %ebp cmovg %ebx, %ebp addl %edi, %ebp cmpl $-1, %ebp movl 68(%esp), %esi je LBB5_55 incl %ebp cmpl $-3, %ebx movl $-2, %edx cmovg %ebx, %edx movl $0, 64(%esp) movl %ebp, %esi andl $-8, %esi je LBB5_48 movl %esi, 56(%esp) movl %ebp, 60(%esp) movl %edx, %esi notl %esi leal (%eax,%esi,4), %ebp movl 44(%esp), %esi leal -4(%esi), %esi cmpl %ebp, %esi ja LBB5_51 leal -4(%eax,%edi,4), %esi movl %esi, 52(%esp) addl %edi, %edx notl %edx movl 44(%esp), %ebp leal (%ebp,%edx,4), %edx cmpl %edx, 52(%esp) movl 68(%esp), %esi jbe LBB5_54 LBB5_51: movl %ecx, 40(%esp) movl 68(%esp), %ecx movl %ecx, %esi subl 56(%esp), %esi cmpl $-3, %ebx movl $-2, %edx cmovg %ebx, %edx leal 1(%edx,%edi), %ebx andl $-8, %ebx movl 48(%esp), %edx movdqa LCPI5_0-L5$pb(%edx), %xmm0 movl 44(%esp), %ebp LBB5_52: movd %edi, %xmm1 pshufd $0, %xmm1, %xmm1 paddd %xmm0, %xmm1 movd %xmm1, %edx movdqu -12(%eax,%edx,4), %xmm1 movdqu -28(%eax,%edx,4), %xmm2 subl %ecx, %edx movdqu %xmm1, -12(%ebp,%edx,4) movdqu %xmm2, -28(%ebp,%edx,4) addl $-8, %edi addl $-8, %ebx jne LBB5_52 movl 56(%esp), %ecx movl %ecx, 64(%esp) movl 40(%esp), %ecx jmp LBB5_54 LBB5_71: addl $2, %esi cmpl $-16777216, %ecx cmovne %edi, %ebx movl $0, 68(%esp) movl %esi, %ecx andl $-8, %ecx je LBB5_72 movl %ecx, 60(%esp) movl %esi, 64(%esp) movl $-2, %edi movl $-2, %ecx subl %ebx, %ecx leal (%eax,%ecx,4), %esi movl 44(%esp), %ecx leal -4(%ecx), %ecx cmpl %esi, %ecx movl 72(%esp), %esi ja LBB5_75 leal -4(%eax,%edx,4), %ecx addl %edx, %ebx subl %ebx, %edi movl %edi, %ebx movl 44(%esp), %edi leal (%edi,%ebx,4), %ebx movl $-2, %edi cmpl %ebx, %ecx jbe LBB5_78 LBB5_75: movl %edx, %ecx subl 60(%esp), %ecx movl %ecx, 68(%esp) leal 2(%ebp,%edx), %ebp andl $-8, %ebp movl 48(%esp), %ecx movdqa LCPI5_0-L5$pb(%ecx), %xmm0 movl %edx, %ebx movl 44(%esp), %edi .align 4, 0x90 LBB5_76: movd %ebx, %xmm1 pshufd $0, %xmm1, %xmm1 paddd %xmm0, %xmm1 movd %xmm1, %ecx movdqu -12(%eax,%ecx,4), %xmm1 movdqu -28(%eax,%ecx,4), %xmm2 subl %edx, %ecx movdqu %xmm1, -12(%edi,%ecx,4) movdqu %xmm2, -28(%edi,%ecx,4) addl $-8, %ebx addl $-8, %ebp jne LBB5_76 movl 68(%esp), %edx movl 60(%esp), %ecx movl %ecx, 68(%esp) movl $-2, %edi jmp LBB5_78 LBB5_83: andl $16777215, %esi leal (%eax,%esi,4), %ecx movl %eax, 8(%esp) movl %edi, (%esp) movl %ecx, 4(%esp) call _gerepile jmp LBB5_84 LBB5_72: movl %esi, 64(%esp) movl 72(%esp), %esi LBB5_78: movl 68(%esp), %ecx cmpl %ecx, 64(%esp) jne LBB5_66 movl 76(%esp), %edx jmp LBB5_85 LBB5_66: movl %edx, %ebx notl %ebx cmpl $-3, %ebx cmovg %ebx, %edi leal 2(%edx,%edi), %ecx leal 1(%edx,%edi), %ebp testb $3, %cl je LBB5_69 movl %esi, %ecx notl %ecx orl $1056964608, %ecx movl 44(%esp), %edi leal (%edi,%ecx,4), %edi cmpl $-3, %ebx movl $-2, %ecx cmovg %ebx, %ecx leal 2(%edx,%ecx), %ebx andl $3, %ebx negl %ebx .align 4, 0x90 LBB5_68: movl -4(%eax,%edx,4), %ecx movl %ecx, (%edi,%edx,4) leal -1(%edx), %edx incl %ebx jne LBB5_68 LBB5_69: cmpl $3, %ebp jae LBB5_80 movl 76(%esp), %edx jmp LBB5_85 LBB5_80: incl %edx andl $16777215, %esi movl $-4, %ecx subl %esi, %ecx movl 44(%esp), %esi leal (%esi,%ecx,4), %ecx .align 4, 0x90 LBB5_81: movl -8(%eax,%edx,4), %esi movl %esi, 8(%ecx,%edx,4) movl -12(%eax,%edx,4), %esi movl %esi, 4(%ecx,%edx,4) movl -16(%eax,%edx,4), %esi movl %esi, (%ecx,%edx,4) movl -20(%eax,%edx,4), %esi movl %esi, -4(%ecx,%edx,4) addl $-4, %edx cmpl $1, %edx jg LBB5_81 movl 76(%esp), %edx jmp LBB5_85 LBB5_48: movl %ebp, 60(%esp) movl 68(%esp), %esi LBB5_54: movl 64(%esp), %edx cmpl %edx, 60(%esp) movl $-2, %edx je LBB5_61 LBB5_55: movl %ecx, %edi movl %esi, %ebp negl %ebp cmpl $-3, %ebp cmovg %ebp, %edx leal (%esi,%edx), %ecx leal 1(%esi,%edx), %edx testb $3, %dl je LBB5_58 movl %edi, %edx notl %edx orl $1056964608, %edx movl 44(%esp), %ebx leal (%ebx,%edx,4), %ebx cmpl $-3, %ebp movl $-2, %edx cmovg %ebp, %edx leal 1(%esi,%edx), %ebp andl $3, %ebp negl %ebp LBB5_57: movl -4(%eax,%esi,4), %edx movl %edx, (%ebx,%esi,4) leal -1(%esi), %esi incl %ebp jne LBB5_57 LBB5_58: cmpl $3, %ecx jb LBB5_61 notl %edi orl $1056964608, %edi movl 44(%esp), %edx leal (%edx,%edi,4), %edx LBB5_60: movl -4(%eax,%esi,4), %edi movl %edi, (%edx,%esi,4) movl -8(%eax,%esi,4), %edi movl %edi, -4(%edx,%esi,4) movl -12(%eax,%esi,4), %edi movl %edi, -8(%edx,%esi,4) movl -16(%eax,%esi,4), %edi movl %edi, -12(%edx,%esi,4) leal -4(%esi), %esi cmpl $1, %esi jg LBB5_60 LBB5_61: movl 68(%esp), %eax orl $33554432, %eax movl 76(%esp), %edx movl %eax, (%edx) movl 72(%esp), %eax movl %edx, (%eax) LBB5_85: movl %edx, %eax addl $92, %esp popl %esi popl %edi popl %ebx popl %ebp ret .align 4, 0x90 _QX_galoisapplymod: pushl %ebp pushl %ebx pushl %edi pushl %esi subl $28, %esp movl %ecx, %ebx call L6$pb L6$pb: popl %edi movl 52(%esp), %esi leal 20(%esp), %eax movl %eax, 4(%esp) movl %edx, (%esp) call _Q_remove_denom movl %eax, %ebp movl 20(%esp), %eax testl %eax, %eax je LBB6_4 movl %ebx, 16(%esp) movl %esi, 4(%esp) movl %eax, (%esp) call _Z_pval movl %eax, 4(%esp) movl %esi, (%esp) call _powiu movl %eax, %edi movl %esi, 4(%esp) movl %edi, (%esp) call _mulii movl %eax, %esi movl 20(%esp), %eax movl %edi, 4(%esp) movl %eax, (%esp) call _diviiexact leal 24(%esp), %ecx movl %ecx, 8(%esp) movl %esi, 4(%esp) movl %eax, (%esp) call _invmod testl %eax, %eax jne LBB6_3 movl 24(%esp), %eax movl %esi, 4(%esp) movl %eax, (%esp) call _gmodulo movl %eax, 4(%esp) movl $20, (%esp) call _pari_err LBB6_3: movl 24(%esp), %ebx jmp LBB6_5 LBB6_4: movl %ebx, 16(%esp) movl L_gen_1$non_lazy_ptr-L6$pb(%edi), %eax movl (%eax), %ebx movl %ebx, %edi LBB6_5: movl %esi, 4(%esp) movl %ebp, (%esp) call _FpX_red movl %eax, %ebp movl %esi, 4(%esp) movl 48(%esp), %eax movl %eax, (%esp) call _FpC_red movl %esi, 12(%esp) movl %eax, 8(%esp) movl %ebp, 4(%esp) movl 16(%esp), %eax movl %eax, (%esp) call _FpX_FpC_nfpoleval movl %esi, 8(%esp) movl %ebx, 4(%esp) movl %eax, (%esp) call _FpC_Fp_mul movl %edi, 4(%esp) movl %eax, (%esp) call _gdivexact addl $28, %esp popl %esi popl %edi popl %ebx popl %ebp ret # ---------------------- .section __TEXT,__cstring,cstring_literals L_.str: .asciz "galois" L_.str1: .asciz "galois of degree higher than 11" L_.str2: .asciz "galois (bug1)" L_.str3: .asciz "galois (bug2)" L_.str4: .asciz "galoisapply" L_.str5: .asciz "incompatible data in idealfrobenius" L_.str6: .asciz "ramified prime in idealfrobenius" L_.str7: .asciz "lg()" L_.str8: .asciz "Frobenius element not found" # ---------------------- .section __IMPORT,__pointers,non_lazy_symbol_pointers L_LOG2$non_lazy_ptr: .indirect_symbol _LOG2 .long 0 # ---------------------- L_PARI_SIGINT_block$non_lazy_ptr: .indirect_symbol _PARI_SIGINT_block .long 0 # ---------------------- L_PARI_SIGINT_pending$non_lazy_ptr: .indirect_symbol _PARI_SIGINT_pending .long 0 # ---------------------- L_avma$non_lazy_ptr: .indirect_symbol _avma .long 0 # ---------------------- L_bot$non_lazy_ptr: .indirect_symbol _bot .long 0 # ---------------------- L_gen_0$non_lazy_ptr: .indirect_symbol _gen_0 .long 0 # ---------------------- L_gen_1$non_lazy_ptr: .indirect_symbol _gen_1 .long 0 # ---------------------- L_top$non_lazy_ptr: .indirect_symbol _top .long 0 # ---------------------- .set Ltmp0,LJTI0_0-L0$pb .set Ltmp1,LJTI0_1-L0$pb .set L0_0_set_10,LBB0_10-L0$pb .set L0_0_set_19,LBB0_19-L0$pb .set L0_0_set_27,LBB0_27-L0$pb .set L0_0_set_31,LBB0_31-L0$pb .set L0_1_set_47,LBB0_47-L0$pb .set L0_1_set_50,LBB0_50-L0$pb .set L0_1_set_54,LBB0_54-L0$pb .set L0_1_set_55,LBB0_55-L0$pb .set Ltmp2,LJTI3_0-L3$pb .set Ltmp3,LJTI3_1-L3$pb .set L3_0_set_10,LBB3_10-L3$pb .set L3_0_set_397,LBB3_397-L3$pb .set L3_0_set_32,LBB3_32-L3$pb .set L3_0_set_33,LBB3_33-L3$pb .set L3_0_set_34,LBB3_34-L3$pb .set L3_1_set_117,LBB3_117-L3$pb .set L3_1_set_249,LBB3_249-L3$pb .set L3_1_set_142,LBB3_142-L3$pb .set L3_1_set_144,LBB3_144-L3$pb .set L3_1_set_145,LBB3_145-L3$pb .subsections_via_symbols
Terminal Velocity Launcher/TerminalVelocityLauncher.applescript
adfernandes/terminal-velocity
0
1279
<reponame>adfernandes/terminal-velocity -- Created by <NAME> on 2015/08/01. -- Copyright (c) 2015 Pharynks Corporation. All rights reserved. use framework "Foundation" use scripting additions script TerminalVelocityLauncher property parent : class "NSObject" -- handler on getFinderSelections() set theArray to init() of alloc() of class "NSMutableArray" of current application tell application "Finder" if the selection is {} then try set finderSelection to {folder of the front Finder window as alias} on error beep return theArray end try else -- various bugs in Finder and AppleScript relating to 'as alias list' -- coercion and/or using it on 'selection' property, so get a list of -- Finder references and coerce them one at a time in AppleScript set finderSelection to selection repeat with itemRef in finderSelection set itemRef's contents to itemRef as alias end repeat end if end tell repeat with theSelectionAlias in finderSelection theArray's addObject_(POSIX path of theSelectionAlias) end repeat return theArray end getFinderSelections -- handler on launchTerminalWindowsFor:(directories) tell application "Terminal" activate repeat with directory in directories set theDirectory to (the directory as string) do script "cd " & (the quoted form of theDirectory) & "; clear; pwd" end repeat end tell end launchTerminalWindowsFor -- handler on launchTerminalTabsFor:(paths) set theDelay to 0.5 set directories to {} repeat with path in paths copy (the quoted form of (the path as string)) to the end of directories end repeat tell application "Terminal" activate if the (count of directories) > 0 then do script "cd " & (item 1 of directories) & "; clear; pwd" delay theDelay set theWindow to the front window repeat with i from 2 to the count of directories tell application "System Events" to tell process "Terminal" to keystroke "t" using command down delay theDelay do script "cd " & (item i of directories) & "; clear; pwd" in (tab i of theWindow) delay theDelay end repeat end if end tell end launchTerminalTabsFor -- handler on launchITerm2WindowsFor:(directories) tell application "iTerm" activate repeat with directory in directories set theDirectory to (the directory as string) tell the current session of (create window with default profile) write text "cd " & (the quoted form of theDirectory) & "; clear; pwd" end tell end repeat end tell end launchITerm2WindowsFor -- handler on launchITerm2TabsFor:(paths) set directories to {} repeat with path in paths copy (the quoted form of (the path as string)) to the end of directories end repeat tell application "iTerm" activate if the (count of directories) > 0 then set theWindow to (create window with default profile) tell the current session of theWindow write text "cd " & (item 1 of directories) & "; clear; pwd" end tell repeat with i from 2 to the count of directories tell theWindow set theTab to (create tab with default profile) tell theTab's session write text "cd " & (item i of directories) & "; clear; pwd" end tell end tell end repeat end if end tell end launchITerm2TabsFor -- end script
samplebot.asm
YellowberryHN/nanorg-stuff
1
6612
info: AJOSampleBot, <NAME> main: // select a random direction and distance to move rand [dir], 4 rand [count], 10 //edit add [count], 1 //edit loop: // check if I'm top of food and eat if so sense r2 jns noFood eat noFood: // see if we're over a collection point and // release some energy energy r0 cmp r0, 2000 jl notEnufEnergy sense r5 cmp r5, 0xFFFF // are we on a colleciton point? jne notEnufEnergy release 500 //edit // drain my energy by 500, but get 500 points, assuming // that we're releasing on a collection point notEnufEnergy: // move me cmp [count], 0 // moved enough in this direction; try a new one je newDir travel [dir] jns newDir // bumped into another org or the wall sub [count], 1 jmp loop newDir: rand [dir], 4 // select a new direction rand [count], 10 //edit // select a new count between 0 and 9 jmp loop dir: data { 0 } // our initial direction count: // our initial count of how far to move in the cur dir data { 0 }
svalbard/odata/src/main/antlr4/org/n52/svalbard/odata/grammar/STAQueryOptionsGrammar.g4
52North/arctic-sea
19
2387
/* * Copyright 2015-2020 52°North Initiative for Geospatial Open Source * Software GmbH * * 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. */ /* ---------------------------------------------------------------------------- * odata-v4.0-abnf subset for parsing Query Parameters expanded with * OGC SensorthingsAPI specific functionality. Based on examples given * in odata svn repository <a href="https://tools.oasis-open.org/version * -control/browse/wsvn/odata/trunk/spec/grammar/ANTLR/#_trunk_spec_grammar_ANTLR_"/a> * by <NAME> <<EMAIL>>. * modified by <NAME> <<EMAIL>> * ---------------------------------------------------------------------------- */ parser grammar STAQueryOptionsGrammar; options { tokenVocab = STAQueryOptionsLexer; } queryOptions : systemQueryOption? (AMPERSAND systemQueryOption)* EOF ; systemQueryOption : expand | filter | orderby | count | skip | top | select ; count : QO_COUNT EQ (True_LLC | False_LLC) ; expand : QO_EXPAND EQ expandItem (COMMA (SP)* expandItem)* ; expandItem : memberExpr (OP systemQueryOption (SEMI systemQueryOption)* CP)? ; filter : QO_FILTER EQ boolExpr ; orderby : QO_ORDERBY EQ orderbyItem (COMMA (SP)* orderbyItem)* ; orderbyItem : memberExpr (SP (ASC_LLC | DESC_LLC))? ; skip : QO_SKIP EQ decimalLiteral ; top : QO_TOP EQ decimalLiteral ; select : QO_SELECT EQ selectItem (COMMA (SP)* selectItem)* ; selectItem : ALPHAPLUS ; /* ---------------------------------------------------------------------------- * 3. Expressions * ---------------------------------------------------------------------------- */ boolExpr : (boolMethodCallExpr | notExpr | anyExpr (eqExpr | neExpr | ltExpr | leExpr | gtExpr | geExpr) | boolParenExpr) (andExpr | orExpr)? ; boolParenExpr : OP (SP)* boolExpr (SP)* CP ; anyExpr : memberExpr | arithmeticExpr | geoExpr | timeExpr | textExpr | parenExpr ; parenExpr : OP (SP)* anyExpr (SP)* CP ; arithmeticExpr : (OP (SP)*)? (numericLiteral | memberExpr | negateExpr | arithmeticMethodCallExpr) (addExpr | subExpr | mulExpr | divExpr | modExpr)? (OP (SP)*)? ; timeExpr : temporalOrMemberOrISO8601Timestamp ; textExpr : escapedString | textMethodCallExpr ; geoExpr : geographyCollection | geographyLineString | geographyMultiLineString | geographyMultiPoint | geographyMultiPolygon | geographyPoint | geographyPolygon | geometryCollection | geometryLineString | geometryMultiLineString | geometryMultiPoint | geometryMultiPolygon | geometryPoint | geometryPolygon ; memberExpr : (ALPHAPLUS SLASH)* (ALPHAPLUS | Time_LLC) ; textMethodCallExpr : toLowerMethodCallExpr | toUpperMethodCallExpr | trimMethodCallExpr | substringMethodCallExpr | concatMethodCallExpr ; arithmeticMethodCallExpr : lengthMethodCallExpr | indexOfMethodCallExpr | yearMethodCallExpr | monthMethodCallExpr | dayMethodCallExpr | daysMethodCallExpr | hourMethodCallExpr | minuteMethodCallExpr | secondMethodCallExpr | dateMethodCallExpr | roundMethodCallExpr | floorMethodCallExpr | ceilingMethodCallExpr | distanceMethodCallExpr | geoLengthMethodCallExpr | totalOffsetMinutesExpr ; temporalMethodCallExpr : timeMethodCallExpr | nowDate | minDate | maxDate ; boolMethodCallExpr : endsWithMethodCallExpr | startsWithMethodCallExpr | substringOfMethodCallExpr | intersectsMethodCallExpr | st_equalsMethodCallExpr | st_disjointMethodCallExpr | st_touchesMethodCallExpr | st_withinMethodCallExpr | st_overlapsMethodCallExpr | st_crossesMethodCallExpr | st_intersectsMethodCallExpr | st_containsMethodCallExpr | st_relateMethodCallExpr | containsMethodCallExpr ; textOrMember : (textExpr | memberExpr) ; temporalOrMemberOrISO8601Timestamp : (temporalMethodCallExpr | memberExpr | iso8601Timestamp) ; geoOrMember : (geoExpr | memberExpr) ; iso8601Timestamp : DIGIT4MINUS DIGIT2 MINUS DIGIT2 T DIGIT2 COLON DIGIT2 COLON (DIGIT2 | (DIGIT2 DOT DIGIT3)) iso8601Timezone ; iso8601Timezone : Z | SIGN DIGIT2 (COLON DIGIT2)? ; substringMethodCallExpr : Substring_LLC OP (SP)* textOrMember (SP)* COMMA (SP)* arithmeticExpr CP ; toLowerMethodCallExpr : ToLower_LLC OP (SP)* textOrMember (SP)* CP ; toUpperMethodCallExpr : ToUpper_LLC OP (SP)* textOrMember (SP)* CP ; trimMethodCallExpr : Trim_LLC OP (SP)* textOrMember (SP)* CP ; concatMethodCallExpr : Concat_LLC OP (SP)* textOrMember (SP)* COMMA (SP)* textOrMember (SP)* CP ; substringOfMethodCallExpr : SubStringOf_LLC OP (SP)* textOrMember (SP)* COMMA (SP)* textOrMember (SP)* CP ; startsWithMethodCallExpr : StartsWith_LLC OP (SP)* textOrMember (SP)* COMMA (SP)* textOrMember (SP)* CP ; endsWithMethodCallExpr : EndsWith_LLC OP (SP)* textOrMember (SP)* COMMA (SP)* textOrMember (SP)* CP ; containsMethodCallExpr : Contains_LLC OP (SP)* memberExpr (SP)* COMMA (SP)* boolExpr (SP)* COMMA (SP)* boolExpr (SP)* CP ; intersectsMethodCallExpr : GeoDotIntersects_LLC OP (SP)* geoOrMember (SP)* COMMA (SP)* geoOrMember (SP)* CP ; // Spatial Relationship Functions st_commonMethodCallExpr : OP (SP)* geoOrMember (SP)* COMMA (SP)* geoOrMember (SP)* CP ; st_equalsMethodCallExpr : ST_equals_LLC st_commonMethodCallExpr ; st_disjointMethodCallExpr : ST_disjoint_LLC st_commonMethodCallExpr ; st_touchesMethodCallExpr : ST_touches_LLC st_commonMethodCallExpr ; st_withinMethodCallExpr : ST_within_LLC st_commonMethodCallExpr ; st_overlapsMethodCallExpr : ST_overlaps_LLC st_commonMethodCallExpr ; st_crossesMethodCallExpr : ST_crosses_LLC st_commonMethodCallExpr ; st_intersectsMethodCallExpr : ST_intersects_LLC st_commonMethodCallExpr ; st_containsMethodCallExpr : ST_contains_LLC st_commonMethodCallExpr ; st_relateMethodCallExpr : ST_relate_LLC OP (SP)* geoOrMember (SP)* COMMA (SP)* geoOrMember (SP)* COMMA (SP)* escapedString (SP)* CP ; lengthMethodCallExpr : Length_LLC OP (SP)* textOrMember (SP)* CP ; indexOfMethodCallExpr : IndexOf_LLC OP (SP)* textOrMember (SP)* COMMA (SP)* textOrMember (SP)* CP ; yearMethodCallExpr : Year_LLC OP (SP)* temporalOrMemberOrISO8601Timestamp (SP)* CP ; monthMethodCallExpr : Month_LLC OP (SP)* temporalOrMemberOrISO8601Timestamp (SP)* CP ; dayMethodCallExpr : Day_LLC OP (SP)* temporalOrMemberOrISO8601Timestamp (SP)* CP ; daysMethodCallExpr : Days_LLC OP (SP)* temporalOrMemberOrISO8601Timestamp (SP)* CP ; hourMethodCallExpr : Hour_LLC OP (SP)* temporalOrMemberOrISO8601Timestamp (SP)* CP ; minuteMethodCallExpr : Minute_LLC OP (SP)* temporalOrMemberOrISO8601Timestamp (SP)* CP ; secondMethodCallExpr : Second_LLC OP (SP)* temporalOrMemberOrISO8601Timestamp (SP)* CP ; timeMethodCallExpr : Time_LLC OP (SP)* temporalOrMemberOrISO8601Timestamp (SP)* CP ; dateMethodCallExpr : Date_LLC OP (SP)* temporalOrMemberOrISO8601Timestamp (SP)* CP ; roundMethodCallExpr : Round_LLC OP (SP)* arithmeticExpr (SP)* CP ; floorMethodCallExpr : Floor_LLC OP (SP)* arithmeticExpr (SP)* CP ; ceilingMethodCallExpr : Ceiling_LLC OP (SP)* arithmeticExpr (SP)* CP ; totalOffsetMinutesExpr : TotalOffsetMinutes_LLC OP (SP)* temporalOrMemberOrISO8601Timestamp (SP)* CP ; distanceMethodCallExpr : GeoDotDistance_LLC OP (SP)* geoOrMember (SP)* COMMA (SP)* geoOrMember (SP)* CP ; geoLengthMethodCallExpr : GeoLength_LLC OP (SP)* geoOrMember (SP)* CP ; minDate : MinDateTime_LLC OP (SP)* CP ; maxDate : MaxDateTime_LLC OP (SP)* CP ; nowDate : Now_LLC OP (SP)* CP ; andExpr : SP And_LLC SP boolExpr ; orExpr : SP Or_LLC SP boolExpr ; notExpr : Not_LLC SP boolExpr ; eqExpr : SP Eq_LLC SP anyExpr ; neExpr : SP Ne_LLC SP anyExpr ; ltExpr : SP Lt_LLC SP anyExpr ; leExpr : SP Le_LLC SP anyExpr ; gtExpr : SP Gt_LLC SP anyExpr ; geExpr : SP Ge_LLC SP anyExpr ; addExpr : SP Add_LLC SP arithmeticExpr ; subExpr : SP Sub_LLC SP arithmeticExpr ; mulExpr : SP Mul_LLC SP arithmeticExpr ; divExpr : SP Div_LLC SP arithmeticExpr ; modExpr : SP Mod_LLC SP arithmeticExpr ; negateExpr : MINUS (SP)* arithmeticExpr ; //TODO(specki): What part of this do we want to do? Do we need "single" which was previously detected here or is "number" enough numericLiteral : decimalLiteral | FILTER_FloatingPointLiteral ; decimalLiteral : DIGIT | DIGITPLUS ; escapedString : LITERAL | DIGIT | DIGITPLUS ; geographyCollection : geographyPrefix fullCollectionLiteral SQ ; fullCollectionLiteral : (sridLiteral)? collectionLiteral ; collectionLiteral : CollectionOP_LUC (SP)* geoLiteral (COMMA geoLiteral)* (SP)* CP ; geoLiteral : collectionLiteral | lineStringLiteral | multiPointLiteral | multiLineStringLiteral | multiPolygonLiteral | pointLiteral | polygonLiteral ; geographyLineString : geographyPrefix fullLineStringLiteral SQ ; fullLineStringLiteral : (sridLiteral)? lineStringLiteral ; lineStringLiteral : LineString_LUC (SP)* lineStringData (SP)* ; lineStringData : OP positionLiteral (COMMA (SP)? positionLiteral)+ CP ; geographyMultiLineString : geographyPrefix fullMultiLineStringLiteral SQ ; fullMultiLineStringLiteral : (sridLiteral)? multiLineStringLiteral ; multiLineStringLiteral : MultiLineStringOP_LUC (SP)* (lineStringData (COMMA (SP)? lineStringData)*)? (SP)* CP ; geographyMultiPoint : geographyPrefix fullMultiPointLiteral SQ ; fullMultiPointLiteral : (sridLiteral)? multiPointLiteral ; multiPointLiteral : MultiPointOP_LUC (SP)* (pointData* (COMMA (SP)? pointData))? (SP)* CP ; geographyMultiPolygon : geographyPrefix fullMultiPolygonLiteral SQ ; fullMultiPolygonLiteral : (sridLiteral)? multiPolygonLiteral ; multiPolygonLiteral : MultiPolygonOP_LUC (SP)* (polygonData (COMMA (SP)? polygonData)*)? (SP)* CP ; geographyPoint : geographyPrefix fullPointLiteral SQ ; fullPointLiteral : (sridLiteral)? pointLiteral ; sridLiteral : SRID_LLC EQ DIGIT5 SEMI ; pointLiteral : Point_LUC (SP)* pointData (SP)* ; pointData : OP positionLiteral CP ; positionLiteral : coordinate SP coordinate ; //TODO: add validation that coordinates are in possible range e.g. <=180 coordinate : (MINUS)? (decimalLiteral DOT decimalLiteral | decimalLiteral) ; geographyPolygon : geographyPrefix fullPolygonLiteral SQ ; fullPolygonLiteral : (sridLiteral)? polygonLiteral ; polygonLiteral : Polygon_LUC (SP)* polygonData (SP)* ; polygonData : OP ringLiteral (COMMA (SP)? ringLiteral)* CP ; ringLiteral : OP positionLiteral (COMMA (SP)? positionLiteral)* CP ; geometryCollection : geometryPrefix fullCollectionLiteral SQ ; geometryLineString : geometryPrefix fullLineStringLiteral SQ ; geometryMultiLineString : geometryPrefix fullMultiLineStringLiteral SQ ; geometryMultiPoint : geometryPrefix fullMultiPointLiteral SQ ; geometryMultiPolygon : geometryPrefix fullMultiPolygonLiteral SQ ; geometryPoint : geometryPrefix fullPointLiteral SQ ; geometryPolygon : geometryPrefix fullPolygonLiteral SQ ; geographyPrefix : Geography_LLC ; geometryPrefix : Geometry_LLC ;
Transynther/x86/_processed/NC/_zr_/i9-9900K_12_0xa0.log_21829_335.asm
ljhsiun2/medusa
9
174203
<filename>Transynther/x86/_processed/NC/_zr_/i9-9900K_12_0xa0.log_21829_335.asm .global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r13 push %r8 push %r9 push %rcx push %rdi push %rsi lea addresses_UC_ht+0x3798, %r12 nop cmp $25443, %r13 movb (%r12), %r8b nop cmp %r9, %r9 lea addresses_UC_ht+0x18598, %rsi lea addresses_D_ht+0x10c78, %rdi nop nop nop sub %r11, %r11 mov $98, %rcx rep movsq nop nop nop nop cmp $54865, %r9 lea addresses_WC_ht+0x1e798, %r8 nop nop nop nop nop sub $63029, %rdi mov $0x6162636465666768, %r12 movq %r12, %xmm4 and $0xffffffffffffffc0, %r8 vmovaps %ymm4, (%r8) nop nop nop nop nop dec %rcx lea addresses_UC_ht+0x1bf78, %r8 nop add $28938, %rsi mov (%r8), %r11d nop nop nop nop sub $30868, %r12 lea addresses_WC_ht+0x1e498, %r9 nop nop nop nop nop inc %r13 movw $0x6162, (%r9) nop nop nop nop nop inc %r13 lea addresses_UC_ht+0xd598, %r11 nop dec %r8 mov (%r11), %r9 nop nop xor $8754, %rcx lea addresses_UC_ht+0x1ef98, %rsi lea addresses_WC_ht+0xbc68, %rdi clflush (%rdi) nop nop xor %r12, %r12 mov $102, %rcx rep movsw nop nop nop nop nop cmp $39836, %r9 lea addresses_A_ht+0x2ed8, %r11 clflush (%r11) nop nop nop nop nop add $49486, %r13 mov (%r11), %r12w nop nop nop sub $1866, %r13 lea addresses_normal_ht+0x5f98, %rsi lea addresses_normal_ht+0xde98, %rdi add %r9, %r9 mov $45, %rcx rep movsb nop xor %rdi, %rdi lea addresses_D_ht+0x498, %r11 xor $12086, %rcx mov (%r11), %rdi nop nop nop dec %r8 pop %rsi pop %rdi pop %rcx pop %r9 pop %r8 pop %r13 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r14 push %r15 push %rbp // Faulty Load mov $0x6468230000000f98, %r14 nop nop and $2747, %r15 movb (%r14), %r10b lea oracles, %r15 and $0xff, %r10 shlq $12, %r10 mov (%r15,%r10,1), %r10 pop %rbp pop %r15 pop %r14 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_NC', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'} [Faulty Load] {'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_NC', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'NT': True, 'same': False, 'congruent': 11, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 6, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 5, 'type': 'addresses_D_ht'}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_WC_ht', 'AVXalign': True, 'size': 32}} {'src': {'NT': False, 'same': True, 'congruent': 3, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': True, 'congruent': 4, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 2}} {'src': {'NT': False, 'same': False, 'congruent': 8, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 10, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_WC_ht'}} {'src': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 9, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 8, 'type': 'addresses_normal_ht'}} {'src': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 8}, '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 */
src/AssocFree/STLambdaC/NF.agda
agda/agda-assoc-free
3
6431
<filename>src/AssocFree/STLambdaC/NF.agda import AssocFree.STLambdaC.Typ import AssocFree.STLambdaC.Exp module AssocFree.STLambdaC.NF (TConst : Set) (Const : AssocFree.STLambdaC.Typ.Typ TConst → Set) where open module Typ = AssocFree.STLambdaC.Typ TConst using ( Typ ; Ctxt ; const ; _⇝_ ; [_] ; [] ; _∷_ ; _++_ ; case ; singleton ; _≪_ ) open module Exp = AssocFree.STLambdaC.Exp TConst Const using ( Exp ; const ; abs ; app ; var ; var₀ ; weaken+ ; weaken* ; xweaken+ ) mutual -- Normal forms data Atom {Γ : Ctxt} {T : Typ} : Exp Γ T → Set where const : ∀ c → Atom (const c) var : ∀ x → Atom (var x) app : ∀ {U M} {N : Exp Γ U} → Atom M → NF N → Atom (app M N) data NF {Γ : Ctxt} : ∀ {T} → Exp Γ T → Set where atom : ∀ {C} {M : Exp Γ (const C)} → Atom M → NF M abs : ∀ T {U} {M : Exp (T ∷ Γ) U} → NF M → NF (abs {Γ} T M) -- Shorthand atom₀ : ∀ {Γ T} → Atom (var₀ {Γ} {T}) atom₀ {Γ} {T} = var (singleton T ≪ Γ) -- Weakening mutual aweaken+ : ∀ B Γ Δ {T M} → Atom M → Atom (weaken+ B Γ Δ {T} M) aweaken+ B Γ Δ (const c) = const c aweaken+ B Γ Δ (app M N) = app (aweaken+ B Γ Δ M) (nweaken+ B Γ Δ N) aweaken+ B Γ Δ (var x) = var (xweaken+ B Γ Δ x) nweaken+ : ∀ B Γ Δ {T M} → NF M → NF (weaken+ B Γ Δ {T} M) nweaken+ B Γ Δ (atom N) = atom (aweaken+ B Γ Δ N) nweaken+ B Γ Δ (abs T N) = abs T (nweaken+ (T ∷ B) Γ Δ N) aweaken* : ∀ Γ {Δ T M} → Atom M → Atom (weaken* Γ {Δ} {T} M) aweaken* Γ {Δ} = aweaken+ [] Γ Δ
src/Categories/Category/Construction/MonoidAsCategory.agda
Trebor-Huang/agda-categories
5
11409
<filename>src/Categories/Category/Construction/MonoidAsCategory.agda {-# OPTIONS --safe --without-K #-} open import Algebra.Bundles using (Monoid) module Categories.Category.Construction.MonoidAsCategory o {c ℓ} (M : Monoid c ℓ) where open import Data.Unit.Polymorphic open import Level open import Categories.Category.Core open Monoid M -- A monoid is a category with one object MonoidAsCategory : Category o c ℓ MonoidAsCategory = record { Obj = ⊤ ; assoc = assoc _ _ _ ; sym-assoc = sym (assoc _ _ _) ; identityˡ = identityˡ _ ; identityʳ = identityʳ _ ; identity² = identityˡ _ ; equiv = isEquivalence ; ∘-resp-≈ = ∙-cong }
src/MFORTH/answords/tools-ext.asm
malyn/MFORTH
10
7792
<filename>src/MFORTH/answords/tools-ext.asm ; Copyright (c) 2009-2010, <NAME> <<EMAIL>>. ; 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 ; unmodified, this list of conditions, and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright notice, ; this list of conditions and the following disclaimer in the documentation ; and/or other materials provided with the distribution. ; 3. Neither the name of <NAME> nor the names of the contributors ; to this software may be used to endorse or promote products derived from ; this software without specific prior written permission. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. ; ====================================================================== ; TOOLS EXT Words ; ====================================================================== ; ---------------------------------------------------------------------- ; ASSEMBLER [TOOLS EXT] 15.6.2.0740 ( -- ) ; ; Replace the first word list in the search order with the ASSEMBLER ; word list. LINKTO(LINK_TOOLSEXT,0,9,'R',"ELBMESSA") ASSEMBLER: JMP ENTER .WORD LIT,ASSEMBLERWL,LIT,SOESTART,STORE,EXIT ; ---------------------------------------------------------------------- ; BYE [TOOLS EXT] 15.6.2.0830 ( -- ) ; ; Return control to the host operating system, if any. LINKTO(ASSEMBLER,0,3,'E',"YB") BYE: LHLD BOPSTK ; Load the SP on entry into MFORTH SPHL ; ..and restore that SP. CALL STDCALL ; Call the .WORD 5797h ; ..main menu routine (never returns). ; ---------------------------------------------------------------------- ; CODE [TOOLS EXT] 15.6.2.0930 ( "<spaces>name" -- ) ; ; Skip leading space delimiters. Parse name delimited by a space. ; Create a definition for name, called a "code definition", with the ; execution semantics defined below. ; ; Subsequent characters in the parse area typically represent source ; code in a programming language, usually some form of assembly ; language. Those characters are processed in an implementation-defined ; manner, generating the corresponding machine code. The process ; continues, refilling the input buffer as needed, until an ; implementation-defined ending sequence is processed. ; ; name Execution: ( -- a-addr ) ; Execute the machine code sequence that was generated following ; CODE. ; ; --- ; : CODE ( "<spaces>name" -- ) ; CREATE CFASZ NEGATE ALLOT ALSO ASSEMBLER ; LINKTO(BYE,0,4,'E',"DOC") LAST_TOOLSEXT: CODE: JMP ENTER .WORD CREATE,LIT,-CFASZ,ALLOT,ALSO,ASSEMBLER .WORD EXIT
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_1255.asm
ljhsiun2/medusa
9
241349
<filename>Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_1255.asm .global s_prepare_buffers s_prepare_buffers: push %r13 push %r14 push %r9 push %rax push %rbx push %rcx push %rdi push %rsi lea addresses_WC_ht+0x2343, %rsi lea addresses_normal_ht+0xb783, %rdi clflush (%rsi) nop nop sub %r13, %r13 mov $77, %rcx rep movsw xor %rdi, %rdi lea addresses_D_ht+0xd743, %r14 nop nop dec %r9 mov (%r14), %bx nop nop nop add %r9, %r9 lea addresses_WC_ht+0xb8fe, %rdi nop nop dec %r9 movl $0x61626364, (%rdi) nop inc %rbx lea addresses_D_ht+0xcf43, %rsi lea addresses_WT_ht+0x6c39, %rdi nop nop nop nop add $1109, %rax mov $12, %rcx rep movsl nop nop sub %rax, %rax lea addresses_D_ht+0xbd83, %rax inc %rdi movb (%rax), %r13b nop nop nop nop xor %rdi, %rdi lea addresses_WT_ht+0x111c7, %rsi lea addresses_A_ht+0x11b43, %rdi nop sub %rax, %rax mov $43, %rcx rep movsb nop nop nop nop nop inc %rcx lea addresses_D_ht+0x13ab, %rdi clflush (%rdi) nop nop nop sub %rcx, %rcx mov (%rdi), %esi nop and %rbx, %rbx lea addresses_WC_ht+0x1c27, %rax nop nop nop nop sub $48679, %r9 mov $0x6162636465666768, %r14 movq %r14, %xmm5 movups %xmm5, (%rax) nop nop and $15773, %rcx lea addresses_D_ht+0x9f43, %rbx nop nop nop nop nop xor $52628, %rsi movl $0x61626364, (%rbx) nop and $13226, %r13 lea addresses_normal_ht+0xb943, %rsi nop and %r13, %r13 mov (%rsi), %ecx nop nop nop nop nop inc %rdi pop %rsi pop %rdi pop %rcx pop %rbx pop %rax pop %r9 pop %r14 pop %r13 ret .global s_faulty_load s_faulty_load: push %r11 push %r13 push %r8 push %r9 push %rcx push %rdi push %rsi // Store lea addresses_normal+0x5743, %rcx nop nop nop nop nop add $56834, %r13 mov $0x5152535455565758, %r11 movq %r11, %xmm7 vmovups %ymm7, (%rcx) nop nop nop nop xor %r13, %r13 // REPMOV lea addresses_WT+0x39e7, %rsi lea addresses_WC+0xdd43, %rdi nop nop nop nop xor %r11, %r11 mov $4, %rcx rep movsl nop cmp $53663, %rsi // Store lea addresses_WT+0x1b43, %rdi nop xor %rsi, %rsi mov $0x5152535455565758, %r11 movq %r11, %xmm4 vmovups %ymm4, (%rdi) sub %rdi, %rdi // Store lea addresses_WT+0x179c3, %r13 nop nop and $21280, %r8 mov $0x5152535455565758, %rdi movq %rdi, (%r13) nop xor %rdi, %rdi // Load lea addresses_UC+0x10503, %rsi nop nop nop sub $62220, %r13 movb (%rsi), %cl sub $18738, %rdi // Load lea addresses_RW+0xad08, %r9 nop nop nop nop nop cmp $10220, %r8 mov (%r9), %r13d nop nop nop inc %r8 // Faulty Load lea addresses_UC+0x13743, %r9 nop nop nop nop nop sub $42922, %r13 vmovups (%r9), %ymm2 vextracti128 $0, %ymm2, %xmm2 vpextrq $1, %xmm2, %r11 lea oracles, %rdi and $0xff, %r11 shlq $12, %r11 mov (%rdi,%r11,1), %r11 pop %rsi pop %rdi pop %rcx pop %r9 pop %r8 pop %r13 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_UC', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_normal', 'same': False, 'size': 32, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_WT', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_WC', 'congruent': 8, 'same': False}, 'OP': 'REPM'} {'dst': {'type': 'addresses_WT', 'same': False, 'size': 32, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_WT', 'same': False, 'size': 8, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_UC', 'same': False, 'size': 1, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_RW', 'same': False, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_UC', 'same': True, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_D_ht', 'same': False, 'size': 2, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_WC_ht', 'same': False, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_D_ht', 'congruent': 11, 'same': True}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_D_ht', 'same': False, 'size': 1, 'congruent': 6, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_D_ht', 'same': False, 'size': 4, 'congruent': 3, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_WC_ht', 'same': False, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 4, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_normal_ht', 'same': True, 'size': 4, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'37': 21829} 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 */
programs/oeis/070/A070564.asm
karttu/loda
0
20755
; A070564: Partial sums of A070563. ; 0,1,1,1,2,2,2,3,3,3,3,3,3,4,4,4,5,5,5,6,6,6,6,6,6,7,7,7,8,8,8,9,9,9,9,9,9,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,13,13,13,14,14,14,15,15,15,15,15,15,16,16 mov $2,$0 mov $4,$0 lpb $2,1 mov $0,$4 sub $2,1 sub $0,$2 sub $0,1 cal $0,70563 ; a(n) = 0 if 3 divides the Ramanujan number tau(n) (A000594(n)), otherwise 1. mov $3,$0 mul $3,3 div $3,2 add $1,$3 lpe
programs/oeis/286/A286444.asm
karttu/loda
0
85477
; A286444: Number of non-equivalent ways to tile an n X n X n triangular area with two 2 X 2 X 2 triangular tiles and an appropriate number (= n^2-8) of 1 X 1 X 1 tiles. ; 0,3,10,32,70,143,252,424,660,995,1430,2008,2730,3647,4760,6128,7752,9699,11970,14640,17710,21263,25300,29912,35100,40963,47502,54824,62930,71935,81840,92768,104720,117827,132090,147648,164502,182799,202540,223880,246820,271523,297990,326392,356730,389183,423752,460624,499800,541475,585650,632528,682110,734607,790020,848568,910252,975299,1043710,1115720,1191330,1270783,1354080,1441472,1532960,1628803,1729002,1833824,1943270,2057615,2176860,2301288,2430900,2565987,2706550,2852888,3005002,3163199,3327480,3498160,3675240,3859043,4049570,4247152,4451790,4663823,4883252,5110424,5345340,5588355,5839470,6099048,6367090,6643967,6929680,7224608,7528752,7842499 mov $12,$0 mov $14,$0 lpb $14,1 clr $0,12 mov $0,$12 sub $14,1 sub $0,$14 mov $9,$0 mov $11,$0 lpb $11,1 mov $0,$9 sub $11,1 sub $0,$11 mov $4,$0 mod $0,2 mul $0,2 add $0,$4 mul $0,$4 add $10,$0 lpe add $13,$10 lpe mov $1,$13
Task/Forward-difference/AppleScript/forward-difference.applescript
LaudateCorpus1/RosettaCodeData
1
1975
<filename>Task/Forward-difference/AppleScript/forward-difference.applescript -- FORWARD DIFFERENCE -------------------------------------------------------- -- forwardDifference :: Int -> [Int] -> [Int] on forwardDifference(n, xs) set lng to length of xs -- atLength :: [Int] -> Bool script atLength property fullLength : lng property ndx : n on |λ|(ds) (atLength's fullLength) - (length of ds) ≥ atLength's ndx end |λ| end script -- fd :: [Int] -> [Int] script fd on |λ|(xs) script minus on |λ|(a, b) a - b end |λ| end script zipWith(minus, tail(xs), xs) end |λ| end script |until|(atLength, fd, xs) end forwardDifference -- TEST ---------------------------------------------------------------------- on run set xs to {90, 47, 58, 29, 22, 32, 55, 5, 55, 73} script test on |λ|(n) intercalate(" -> [", ¬ {{n}} & intercalate(", ", forwardDifference(n, xs))) & "]" end |λ| end script intercalate(linefeed, map(test, enumFromTo(1, 9))) end run -- GENERIC FUNCTIONS --------------------------------------------------------- -- enumFromTo :: Int -> Int -> [Int] on enumFromTo(m, n) if m > n then set d to -1 else set d to 1 end if set lst to {} repeat with i from m to n by d set end of lst to i end repeat return lst end enumFromTo -- intercalate :: Text -> [Text] -> Text on intercalate(strText, lstText) set {dlm, my text item delimiters} to {my text item delimiters, strText} set strJoined to lstText as text set my text item delimiters to dlm return strJoined end intercalate -- map :: (a -> b) -> [a] -> [b] on map(f, xs) tell mReturn(f) set lng to length of xs set lst to {} repeat with i from 1 to lng set end of lst to |λ|(item i of xs, i, xs) end repeat return lst end tell end map -- min :: Ord a => a -> a -> a on min(x, y) if y < x then y else x end if end min -- Lift 2nd class handler function into 1st class script wrapper -- mReturn :: Handler -> Script on mReturn(f) if class of f is script then f else script property |λ| : f end script end if end mReturn -- tail :: [a] -> [a] on tail(xs) if length of xs > 1 then items 2 thru -1 of xs else {} end if end tail -- until :: (a -> Bool) -> (a -> a) -> a -> a on |until|(p, f, x) set mp to mReturn(p) set v to x tell mReturn(f) repeat until mp's |λ|(v) set v to |λ|(v) end repeat end tell return v end |until| -- zipWith :: (a -> b -> c) -> [a] -> [b] -> [c] on zipWith(f, xs, ys) set lng to min(length of xs, length of ys) set lst to {} tell mReturn(f) repeat with i from 1 to lng set end of lst to |λ|(item i of xs, item i of ys) end repeat return lst end tell end zipWith
src/gnat/sinput-p.adb
Letractively/ada-gen
0
3676
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S I N P U T . P -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2010, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING3. If not, go to -- -- http://www.gnu.org/licenses for a complete copy of the license. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Ada.Unchecked_Conversion; with Ada.Unchecked_Deallocation; with Prj.Err; with Sinput.C; with System; package body Sinput.P is First : Boolean := True; -- Flag used when Load_Project_File is called the first time, -- to set Main_Source_File. -- The flag is reset to False at the first call to Load_Project_File. -- Calling Reset_First sets it back to True. procedure Free is new Ada.Unchecked_Deallocation (Lines_Table_Type, Lines_Table_Ptr); procedure Free is new Ada.Unchecked_Deallocation (Logical_Lines_Table_Type, Logical_Lines_Table_Ptr); ----------------------------- -- Clear_Source_File_Table -- ----------------------------- procedure Clear_Source_File_Table is use System; begin for X in 1 .. Source_File.Last loop declare S : Source_File_Record renames Source_File.Table (X); Lo : constant Source_Ptr := S.Source_First; Hi : constant Source_Ptr := S.Source_Last; subtype Actual_Source_Buffer is Source_Buffer (Lo .. Hi); -- Physical buffer allocated type Actual_Source_Ptr is access Actual_Source_Buffer; -- This is the pointer type for the physical buffer allocated procedure Free is new Ada.Unchecked_Deallocation (Actual_Source_Buffer, Actual_Source_Ptr); pragma Suppress (All_Checks); pragma Warnings (Off); -- The following unchecked conversion is aliased safe, since it -- is not used to create improperly aliased pointer values. function To_Actual_Source_Ptr is new Ada.Unchecked_Conversion (Address, Actual_Source_Ptr); pragma Warnings (On); Actual_Ptr : Actual_Source_Ptr := To_Actual_Source_Ptr (S.Source_Text (Lo)'Address); begin Free (Actual_Ptr); Free (S.Lines_Table); Free (S.Logical_Lines_Table); end; end loop; Source_File.Free; Sinput.Initialize; end Clear_Source_File_Table; ----------------------- -- Load_Project_File -- ----------------------- function Load_Project_File (Path : String) return Source_File_Index is X : Source_File_Index; begin X := Sinput.C.Load_File (Path); if First then Main_Source_File := X; First := False; end if; return X; end Load_Project_File; ----------------- -- Reset_First -- ----------------- procedure Reset_First is begin First := True; end Reset_First; -------------------------------- -- Restore_Project_Scan_State -- -------------------------------- procedure Restore_Project_Scan_State (Saved_State : Saved_Project_Scan_State) is begin Restore_Scan_State (Saved_State.Scan_State); Source := Saved_State.Source; Current_Source_File := Saved_State.Current_Source_File; end Restore_Project_Scan_State; ----------------------------- -- Save_Project_Scan_State -- ----------------------------- procedure Save_Project_Scan_State (Saved_State : out Saved_Project_Scan_State) is begin Save_Scan_State (Saved_State.Scan_State); Saved_State.Source := Source; Saved_State.Current_Source_File := Current_Source_File; end Save_Project_Scan_State; ---------------------------- -- Source_File_Is_Subunit -- ---------------------------- function Source_File_Is_Subunit (X : Source_File_Index) return Boolean is begin -- Nothing to do if X is no source file, so simply return False if X = No_Source_File then return False; end if; Prj.Err.Scanner.Initialize_Scanner (X); -- No error for special characters that are used for preprocessing Prj.Err.Scanner.Set_Special_Character ('#'); Prj.Err.Scanner.Set_Special_Character ('$'); -- We scan past junk to the first interesting compilation unit token, to -- see if it is SEPARATE. We ignore WITH keywords during this and also -- PRIVATE. The reason for ignoring PRIVATE is that it handles some -- error situations, and also to handle PRIVATE WITH in Ada 2005 mode. while Token = Tok_With or else Token = Tok_Private or else (Token not in Token_Class_Cunit and then Token /= Tok_EOF) loop Prj.Err.Scanner.Scan; end loop; Prj.Err.Scanner.Reset_Special_Characters; return Token = Tok_Separate; end Source_File_Is_Subunit; end Sinput.P;
programs/oeis/099/A099903.asm
karttu/loda
0
23232
; A099903: Sum of all matrix elements of n X n matrix M(i,j) = i^3+j^3, (i,j = 1..n). a(n) = n^3*(n+1)^2/2. ; 2,36,216,800,2250,5292,10976,20736,36450,60500,95832,146016,215306,308700,432000,591872,795906,1052676,1371800,1764000,2241162,2816396,3504096,4320000,5281250,6406452,7715736,9230816,10975050,12973500 add $0,1 mov $2,$0 lpb $0,1 lpb $0,1 sub $0,1 add $4,$2 add $3,$4 lpe add $4,$2 lpb $4,1 add $1,$3 sub $4,1 lpe lpe
oeis/052/A052665.asm
neoneye/loda-programs
11
1537
; A052665: a(0)=0, for n >= 1, a(n) = ((2^(n-1)-1)*n!. ; Submitted by <NAME>(s2) ; 0,0,2,18,168,1800,22320,317520,5120640,92534400,1854316800,40834886400,980516275200,25499650176000,714077383219200,21423629170944000,685577056260096000,23309975600271360000 sub $0,1 mov $1,1 mov $2,1 lpb $0 sub $0,1 add $2,1 mul $1,$2 mul $3,2 add $3,1 lpe mul $1,$3 mov $0,$1
source/league/ucd/matreshka-internals-unicode-ucd-core_00a8.ads
svn2github/matreshka
24
14473
<gh_stars>10-100 ------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2012-2015, <NAME> <<EMAIL>> -- -- 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 Vadim Godunko, IE 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 -- -- 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. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ pragma Restrictions (No_Elaboration_Code); -- GNAT: enforce generation of preinitialized data section instead of -- generation of elaboration code. package Matreshka.Internals.Unicode.Ucd.Core_00A8 is pragma Preelaborate; Group_00A8 : aliased constant Core_Second_Stage := (16#02# => -- A802 (Nonspacing_Mark, Neutral, Extend, Extend, Extend, Combining_Mark, (Case_Ignorable | Grapheme_Extend | ID_Continue | XID_Continue => True, others => False)), 16#06# => -- A806 (Nonspacing_Mark, Neutral, Extend, Extend, Extend, Combining_Mark, (Case_Ignorable | Grapheme_Extend | Grapheme_Link | ID_Continue | XID_Continue => True, others => False)), 16#0B# => -- A80B (Nonspacing_Mark, Neutral, Extend, Extend, Extend, Combining_Mark, (Case_Ignorable | Grapheme_Extend | ID_Continue | XID_Continue => True, others => False)), 16#23# .. 16#24# => -- A823 .. A824 (Spacing_Mark, Neutral, Spacing_Mark, Extend, Extend, Combining_Mark, (Other_Alphabetic | Alphabetic | Grapheme_Base | ID_Continue | XID_Continue => True, others => False)), 16#25# .. 16#26# => -- A825 .. A826 (Nonspacing_Mark, Neutral, Extend, Extend, Extend, Combining_Mark, (Other_Alphabetic | Alphabetic | Case_Ignorable | Grapheme_Extend | ID_Continue | XID_Continue => True, others => False)), 16#27# => -- A827 (Spacing_Mark, Neutral, Spacing_Mark, Extend, Extend, Combining_Mark, (Other_Alphabetic | Alphabetic | Grapheme_Base | ID_Continue | XID_Continue => True, others => False)), 16#28# .. 16#2B# => -- A828 .. A82B (Other_Symbol, Neutral, Other, Other, Other, Alphabetic, (Grapheme_Base => True, others => False)), 16#2C# .. 16#2F# => -- A82C .. A82F (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#30# .. 16#35# => -- A830 .. A835 (Other_Number, Neutral, Other, Other, Other, Alphabetic, (Grapheme_Base => True, others => False)), 16#36# .. 16#37# => -- A836 .. A837 (Other_Symbol, Neutral, Other, Other, Other, Alphabetic, (Grapheme_Base => True, others => False)), 16#38# => -- A838 (Currency_Symbol, Neutral, Other, Other, Other, Postfix_Numeric, (Grapheme_Base => True, others => False)), 16#39# => -- A839 (Other_Symbol, Neutral, Other, Other, Other, Alphabetic, (Grapheme_Base => True, others => False)), 16#3A# .. 16#3F# => -- A83A .. A83F (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#74# .. 16#75# => -- A874 .. A875 (Other_Punctuation, Neutral, Other, Other, Other, Break_Before, (Grapheme_Base => True, others => False)), 16#76# .. 16#77# => -- A876 .. A877 (Other_Punctuation, Neutral, Other, Other, S_Term, Exclamation, (STerm | Terminal_Punctuation | Grapheme_Base => True, others => False)), 16#78# .. 16#7F# => -- A878 .. A87F (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#80# .. 16#81# => -- A880 .. A881 (Spacing_Mark, Neutral, Spacing_Mark, Extend, Extend, Combining_Mark, (Other_Alphabetic | Alphabetic | Grapheme_Base | ID_Continue | XID_Continue => True, others => False)), 16#B4# .. 16#C3# => -- A8B4 .. A8C3 (Spacing_Mark, Neutral, Spacing_Mark, Extend, Extend, Combining_Mark, (Other_Alphabetic | Alphabetic | Grapheme_Base | ID_Continue | XID_Continue => True, others => False)), 16#C4# => -- A8C4 (Nonspacing_Mark, Neutral, Extend, Extend, Extend, Combining_Mark, (Diacritic | Case_Ignorable | Grapheme_Extend | Grapheme_Link | ID_Continue | XID_Continue => True, others => False)), 16#C5# .. 16#CD# => -- A8C5 .. A8CD (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#CE# .. 16#CF# => -- A8CE .. A8CF (Other_Punctuation, Neutral, Other, Other, S_Term, Break_After, (STerm | Terminal_Punctuation | Grapheme_Base => True, others => False)), 16#D0# .. 16#D9# => -- A8D0 .. A8D9 (Decimal_Number, Neutral, Other, Numeric, Numeric, Numeric, (Grapheme_Base | ID_Continue | XID_Continue => True, others => False)), 16#DA# .. 16#DF# => -- A8DA .. A8DF (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#E0# .. 16#F1# => -- A8E0 .. A8F1 (Nonspacing_Mark, Neutral, Extend, Extend, Extend, Combining_Mark, (Diacritic | Case_Ignorable | Grapheme_Extend | ID_Continue | XID_Continue => True, others => False)), 16#F8# .. 16#FA# => -- A8F8 .. A8FA (Other_Punctuation, Neutral, Other, Other, Other, Alphabetic, (Grapheme_Base => True, others => False)), 16#FC# .. 16#FF# => -- A8FC .. A8FF (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), others => (Other_Letter, Neutral, Other, A_Letter, O_Letter, Alphabetic, (Alphabetic | Grapheme_Base | ID_Continue | ID_Start | XID_Continue | XID_Start => True, others => False))); end Matreshka.Internals.Unicode.Ucd.Core_00A8;
oeis/025/A025941.asm
neoneye/loda-programs
11
80
<reponame>neoneye/loda-programs ; A025941: Expansion of 1/((1-2x)(1-3x)(1-6x)(1-11x)). ; Submitted by <NAME> ; 1,22,327,4172,49553,567714,6382699,71043064,786493125,8681598926,95678810591,1053554778276,11595631317817,127591121803258,1403737417995603,15442522109891408,169876206409453229 mov $1,1 mov $2,$0 mov $3,$0 lpb $2 mov $0,$3 sub $2,1 sub $0,$2 seq $0,16308 ; Expansion of 1/((1-2*x)*(1-6*x)*(1-11*x)). mul $1,3 add $1,$0 lpe mov $0,$1
src_68k/func/fix.asm
sheng007/freemlib-neogeo
26
242784
; freemlib for Neo-Geo - Fix Layer Functions ;==============================================================================; ; [Ranges/Valid Values] ; Combined Cell Location $XXYY, where XX=$0-$27,YY=$00-$1F ; Raw VRAM Address $7000-$74FF ; [Notes] ; Most of these functions change LSPC_INCR values, so it's up to the caller to ; reset LSPC_INCR after calling any function in this file. ; todo: ; * fix_Draw8x16 needs to be easier to use ; * ability to use multiple pages in a single string (currently limited to 1) ; * test fix_ClearAll ; * finish writing fix_Draw16x16 ; * finish writing vram <-> 68k ram routines ; * routine for taking a "nametable" and writing it to the fix layer ;==============================================================================; ; fixmac_CalcVRAMAddr ; This macro is slightly complicated... ; 1) Determine if the param passed in is a combined cell location or VRAM address. ; 2) If it's a combined cell location, calculate the VRAM address; otherwise, do nothing. ; (Params) ; d0 [word] Combined cell location (x,y) or raw VRAM address ($7000-$74FF) ; (Combined cell location format: $XXYY, where XX=$00-$27,YY=$00-$1F) ; Note: No sanity checking is done here with the ranges. ; (Output) ; d0 [word] output VRAM address ; (Clobbers) ; d5 Used for converting X/Y location to VRAM address ; d6 Used for calculating X coordinate ; d7 Used for calculating Y coordinate fixmac_CalcVRAMAddr: macro ; 1) do check for vram addr or cell location (d0 >= $7000) cmpi.w #$7000,d0 bge .fm_CVA_end\@ ; no need to process values $7000 or greater ; 2) Calculate VRAM address from cell location move.w d0,d7 ; put combined cell location in d7 andi.w #$00FF,d7 ; mask for Y position move.w d0,d6 ; put combined cell location in d6 andi.w #$FF00,d6 ; mask for X position asr.w #8,d6 ; shift over ; convert to vram address ; VRAM Address from Cells = $7000 + (X*$20) + (Y) move.w #$0020,d5 ; store $20 for multiplying mulu.w d5,d6 ; do X*20 add.w d7,d6 ; add Y addi.w #$7000,d6 ; add $7000 move.w d6,d0 ; = new value in d0 (other fix functions depend on this) .fm_CVA_end\@: endm ;==============================================================================; ; fix_UpdateTile ; Change the tile number and palette index of a fix map location. ; (Params) ; d0 [word] Combined cell location (x,y) or raw VRAM address ($7000-$74FF) ; d1 [word] New palette index (pppp) and tile number (TTTT tttttttt) fix_UpdateTile: fixmac_CalcVRAMAddr ; VRAM address check/combined cell loc. conversion move.w d0,LSPC_ADDR ; set vram address move.w d1,LSPC_DATA ; change tile number and palette index rts ;==============================================================================; ; fix_ChangeTile ; Change the tile number of a fix map location. ; (Params) ; d0 [word] Combined cell location (x,y) or raw VRAM address ($7000-$74FF) ; d1 [word] New tile number ($000-$FFF) ; (Clobbers) ; d2 Used for reading from VRAM fix_ChangeTile: fixmac_CalcVRAMAddr ; VRAM address check/combined cell loc. conversion move.w d0,LSPC_ADDR ; set vram address move.w LSPC_DATA,d2 ; get current data andi.w #$F000,d2 ; mask for palette or.w d2,d1 ; OR with new tile data move.w d1,LSPC_DATA ; change tile number rts ;==============================================================================; ; fix_ChangePal ; Change the palette index of a fix map location. ; (Params) ; d0 [word] Combined cell location (x,y) or raw VRAM address ($7000-$74FF) ; d1 [word] New palette number ($0000-$F000, only incrementing the first value) ; (Clobbers) ; d2 Used for reading from VRAM fix_ChangePal: fixmac_CalcVRAMAddr ; VRAM address check/combined cell loc. conversion move.w d0,LSPC_ADDR ; set vram address move.w LSPC_DATA,d2 ; get current data andi.w #$0FFF,d2 ; mask for tile index or.w d2,d1 ; OR with new palette move.w d1,LSPC_DATA ; change palette index rts ;==============================================================================; ; fix_DrawString ; Draws horizontal text to the screen manually. End code is $FF. ; (Params) ; d0 [word] Combined cell location (x,y) or raw VRAM address ($7000-$74FF) ; d1 [word] Palette index and tile number MSB ; a0 [long] Pointer to string to draw ; (Clobbers) ; d2 Byte for writing ; d3 Used for temporary tile assembly fix_DrawString: fixmac_CalcVRAMAddr ; VRAM address check/combined cell loc. conversion move.w d0,LSPC_ADDR ; set new VRAM address move.w #$20,LSPC_INCR ; set VRAM increment +$20 (horiz. writing) moveq #0,d2 ; set up d2 ; set up d3 moveq #0,d3 move.w d1,d3 ; get pal. index and tile number MSB lsl.w #8,d3 ; shift into upper byte of word .fix_DrawString_Loop: cmpi.b #$FF,(a0) beq.b .fix_DrawString_End move.b (a0)+,d2 ; read byte from string, increment read position or.w d3,d2 ; OR with shifted pal. index and tile number MSB move.w d2,LSPC_DATA ; write combined tile to VRAM bra.b .fix_DrawString_Loop ; loop until finding $FF .fix_DrawString_End: rts ;==============================================================================; ; todo: fix_DrawStringJP (8x8, horizontal version) ; The major difference between this and fix_DrawString is the ability to draw ; dakuten and handakuten (Japanese modifier marks) "properly". ; This was originally coded for FM Studio, but for a more portable solution, ; the IDs of the tenten and maru (dakuten/handakuten) need to be configurable. ; (Params) ; d0 [word] Combined cell location (x,y) or raw VRAM address ($7000-$74FF) ; d1 [word] Palette index and tile number MSB ; a0 [long] Pointer to string to draw ; (Clobbers) ; d2 Byte for writing ; d3 Used for temporary tile assembly fix_DrawStringJP: rts ;==============================================================================; ; fix_Draw8x16 ; Draws "normal" 8x16 text to the screen horizontally. End code is $FF. ; "normal 8x16 text" means this font layout: ; A B C D <- top half ; A B C D <- bottom half ; (Params) ; d0 [word] Combined cell location (x,y) or raw VRAM address ($7000-$74FF) ; d1 [byte] Palette index ; a0 [long] Pointer to string to draw ; a1 [long] Pointer to character map ; (Clobbers) ; a2 Used for original string pointer ; d2 Byte for writing ; d3 Used for temporary tile assembly and VRAM address changing fix_Draw8x16: fixmac_CalcVRAMAddr ; VRAM address check/combined cell loc. conversion move.w d0,LSPC_ADDR ; set new VRAM address move.w #$20,LSPC_INCR ; set VRAM increment +$20 (horiz. writing) movea.l a0,a2 ; copy original string pointer for later ; set up d3 moveq #0,d3 move.b d1,d3 ; get pal. index andi.w #$F0,d3 ; mask for palette lsl.w #8,d3 ; shift into upper byte of word ; draw top line .fix_d8x16_TopLoop: ; check for end code cmpi.b #$FF,(a0) beq.b .fix_d8x16_FinishTop moveq #0,d2 ; set up d2 move.b (a0)+,d2 ; read byte from string, increment read position lsl.w #1,d2 move.w (a1,d2),d2 or.w d3,d2 ; OR with shifted pal. index move.w d2,LSPC_DATA ; write combined tile to VRAM bra.b .fix_d8x16_TopLoop ; loop until finding $FF .fix_d8x16_FinishTop: ; prepare to draw bottom line ; change VRAM address move.w d0,d3 ; get original VRAM position addi.w #$01,d3 ; add +1 for next vertical line move.w d3,LSPC_ADDR ; set new VRAM address ; reset original string pointer movea.l a2,a0 ; set up d3 moveq #0,d3 move.b d1,d3 ; get pal. index andi.w #$F0,d3 ; mask for palette lsl.w #8,d3 ; shift into upper byte of word ; draw bottom line .fix_d8x16_BotLoop: ; check for end code cmpi.b #$FF,(a0) beq.b .fix_d8x16_End moveq #0,d2 ; set up d2 move.b (a0)+,d2 ; read byte from string, increment read position lsl.w #1,d2 move.w (a1,d2),d2 addi.b #$10,d2 ; bottom tile is $10 below top tile or.w d3,d2 ; OR with shifted pal. index move.w d2,LSPC_DATA ; write combined tile to VRAM bra.b .fix_d8x16_BotLoop ; loop until finding $FF .fix_d8x16_End: rts ;==============================================================================; ; fix_Draw16x16 ; Draws "normal" 16x16 text to the screen horizontally. End code is $FF. ; "normal 16x16 text" means this font layout: ; A A <- top left, top right ; A A <- bottom left, bottom right ; (Params) ; d0 [word] Combined cell location (x,y) or raw VRAM address ($7000-$74FF) ; d1 Palette index ; a0 [long] Pointer to string to draw ; a1 [long] Pointer to character map fix_Draw16x16: fixmac_CalcVRAMAddr ; VRAM address check/combined cell loc. conversion move.w d0,LSPC_ADDR ; set new VRAM address move.w #$20,LSPC_INCR ; set VRAM increment +$20 (horiz. writing) ; draw top line .fix_d16x16_TopLoop: ; check for end code cmpi.b #$FF,(a0) beq.b .fix_d16x16_FinishTop ;char and char+1 bra.b .fix_d16x16_TopLoop ; loop until finding $FF .fix_d16x16_FinishTop: ; prepare to draw bottom line ; change VRAM address move.w d0,d3 ; get original VRAM position addi.w #$01,d3 ; add +1 for next vertical line move.w d3,LSPC_ADDR ; set new VRAM address ; reset loop vars ; draw bottom line .fix_d16x16_BotLoop: ; check for end code cmpi.b #$FF,(a0) beq.b .fix_d16x16_End ;char+$10 and char+$11 bra.b .fix_d16x16_BotLoop ; loop until finding $FF .fix_d16x16_End: rts ;==============================================================================; ; fix_DrawRegion ; Draws a rectangular region of tiles using a single palette and tile number MSB. ; (Params) ; d0 [word] Combined cell location (x,y) or raw VRAM address ($7000-$74FF) ; d1 [word] Combined rows/columns size ($YYXX) ; d2 [byte] Palette index and tile number MSB ; a0 [long] Pointer to data to draw ; (Clobbers) ; d5 Combined value to write to VRAM ; d6 Used for column/X size ; d7 Used for row/Y size fix_DrawRegion: fixmac_CalcVRAMAddr ; VRAM address check/combined cell loc. conversion move.w d0,LSPC_ADDR ; set initial VRAM address move.w #$20,LSPC_INCR ; set VRAM increment +$20 (horiz. writing) ; get rows move.w d1,d7 andi.w #$FF00,d7 lsr.w #8,d7 ; shift right ; loop 1 (row/Y) .fix_DrawRegion_Rows: ; get cols move.w d1,d6 andi.w #$00FF,d6 ; loop 2 (column/X) .fix_DrawRegion_Cols: moveq #0,d5 ; clear d5 for combiation move.b d2,d5 ; copy d2 to d5 lsl.w #8,d5 ; shift d2 to upper byte move.b (a0)+,d5 ; get byte from data ; write data move.w d5,LSPC_DATA ; loop cols dbra d6,.fix_DrawRegion_Cols ; update vram address addi.w #1,d0 move.w d0,LSPC_ADDR ; loop rows dbra d7,.fix_DrawRegion_Rows .fix_DrawRegion_End: rts ;==============================================================================; ; fix_FillRegion ; Fills a rectangular region of tiles with the specified tile. ; (Params) ; d0 [word] Combined cell location (x,y) or raw VRAM address ($7000-$74FF) ; d1 [word] Combined rows/columns size ($YYXX) ; d2 [word] Tile data to use for filling. fix_FillRegion: fixmac_CalcVRAMAddr ; VRAM address check/combined cell loc. conversion move.w d0,LSPC_ADDR ; set initial VRAM address move.w #$20,LSPC_INCR ; set VRAM increment +$20 (horiz. writing) ; get rows move.w d1,d7 andi.w #$FF00,d7 lsr.w #8,d7 ; shift right ; loop 1 (row/Y) .fix_FillRegion_Rows: ; get cols move.w d1,d6 andi.w #$00FF,d6 ; loop 2 (column/X) .fix_FillRegion_Cols: move.w d2,LSPC_DATA ; write data ; loop cols dbra d6,.fix_FillRegion_Cols ; update vram address addi.w #1,d0 move.w d0,LSPC_ADDR ; loop rows dbra d7,.fix_FillRegion_Rows .fix_FillRegion_End: rts ;------------------------------------------------------------------------------; ; fix_ClearRegion ; Macro for clearing a region using tile $00FF. ; (Params) ; d0 [word] Starting combined cell location (x,y) or raw VRAM address ($7000-$74FF) ; d1 [word] Combined rows/columns size ($YYXX) fix_ClearRegion: macro move.w #$00FF,d2 ; clear tile jsr fix_FillRegion endm ;==============================================================================; ; fix_CopyToRAM ; Copies Fix tilemap data from VRAM to 68K RAM. ; (Params) ; a? [long] Starting 68K RAM location ; d? [word] Starting combined cell location (x,y) or raw VRAM address ($7000-$74FF) ; d? [word] Copy region size ($XXYY) fix_CopyToRAM: ; force MESS_OUT busy? (don't modify while we read) .fix_CopyToRAM_End: rts ;==============================================================================; ; fix_WriteFromRAM ; Writes Fix tilemap data from 68K RAM to VRAM. ; (Params) ; a? [long] Starting 68K RAM location ; d? [word] Starting combined cell location (x,y) or raw VRAM address ($7000-$74FF) ; d? [word] Write region size ($XXYY) fix_WriteFromRAM: ; force MESS_OUT busy? (don't modify while we write) .fix_WriteFromRAM_End: rts ;==============================================================================; ; fix_ClearAll ; Clears all tiles on the fix layer, including the leftmost and rightmost columns. ; Uses tile number $0FF, palette 0. ; (Clobbers) ; d7 Loop counter fix_ClearAll: move.w #$7000,LSPC_ADDR ; start at $7000 (end at $74FF) move.w #1,LSPC_INCR ; VRAM increment +1 move.w #$4FF,d7 ; loop counter (xxx: does it need to be $4FF-1?) .fix_ClearAll_Loop: move.w #$00FF,LSPC_DATA ; write blank tile (palette 0, tile $0FF) dbra d7,.fix_ClearAll_Loop ;loop rts
spec/arm_linux_gnueabihf_asm_posix_types_h.ads
0xA1/pi-spi
0
22369
<filename>spec/arm_linux_gnueabihf_asm_posix_types_h.ads pragma Ada_2005; pragma Style_Checks (Off); with Interfaces.C; use Interfaces.C; package arm_linux_gnueabihf_asm_posix_types_h is -- * arch/arm/include/asm/posix_types.h -- * -- * Copyright (C) 1996-1998 <NAME>. -- * -- * This program is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License version 2 as -- * published by the Free Software Foundation. -- * -- * Changelog: -- * 27-06-1996 RMK Created -- -- * This file is generally used by user-level software, so you need to -- * be a little careful about namespace pollution etc. Also, we cannot -- * assume GCC is being used. -- subtype uu_kernel_mode_t is unsigned_short; -- /usr/include/arm-linux-gnueabihf/asm/posix_types.h:22 subtype uu_kernel_ipc_pid_t is unsigned_short; -- /usr/include/arm-linux-gnueabihf/asm/posix_types.h:25 subtype uu_kernel_uid_t is unsigned_short; -- /usr/include/arm-linux-gnueabihf/asm/posix_types.h:28 subtype uu_kernel_gid_t is unsigned_short; -- /usr/include/arm-linux-gnueabihf/asm/posix_types.h:29 subtype uu_kernel_old_dev_t is unsigned_short; -- /usr/include/arm-linux-gnueabihf/asm/posix_types.h:32 end arm_linux_gnueabihf_asm_posix_types_h;
src/Ch2-9.agda
banacorn/hott
0
11381
<filename>src/Ch2-9.agda {-# OPTIONS --without-K --no-pattern-matching #-} module Ch2-9 where open import Level hiding (lift) open import Ch2-1 open import Ch2-2 open import Ch2-3 open import Ch2-4 open import Ch2-5 open import Ch2-6 open import Ch2-7 open import Ch2-8 open import Data.Product open import Function using (id; _∘_) -- happly (Definition 2.9.2) happly : ∀ {a} {b} {A : Set a} {B : A → Set b} → {f g : (x : A) → B x} → (f ≡ g) → (f ~ g) happly {_} {_} {A} {B} {f} {g} p = J ((x : A) → B x) D d f g p where D : (f g : (x : A) → B x) (p : f ≡ g) → Set _ D f g p = f ~ g d : (x : (x : A) → B x) → D x x refl d f x = refl postulate funext : ∀ {a} {b} {A : Set a} {B : A → Set b} → {f g : (x : A) → B x} → (f ~ g) → (f ≡ g) Theorem-2-9-1 : ∀ {a} {b} {A : Set a} {B : A → Set b} → (f g : (x : A) → B x) → (f ≡ g) ≅ (f ~ g) Theorem-2-9-1 {_} {_} {A} {B} f g = happly , (funext , α) , (funext , {! !}) where α : happly ∘ funext ~ id α p = J {! !} D {! !} f g (funext p) -- J ((x : A) → B x) D d f g (funext p) -- where D : (f g : (x : A) → B x) (p : {! !}) → Set _ D f g p = {! !} -- ((λ {x} → happly) ∘ funext) p ≡ id p -- ((λ {x} → happly) ∘ funext) p ≡ id p -- happly ∘ funext ~ id -- d : (x : (x : A) → B x) → D x x refl -- d x = refl -- happly-isequiv : isequiv (happly f g) -- happly-isequiv = -- where -- f : x ≡ y → ⊤ -- f p = tt -- -- f' : ⊤ → x ≡ y -- f' x = refl -- -- α : (λ _ → f refl) ~ id -- α w = refl -- -- β : (λ _ → refl) ~ id -- β w = J ⊤ D d x y w -- where -- D : (x y : ⊤) (p : x ≡ y) → Set _ -- D x y p = refl ≡ id p -- -- d : (x : ⊤) → D x x refl -- d x = refl -- -- f-isequiv : isequiv f -- f-isequiv = (f' , α) , f' , β
3-mid/opengl/source/platform/egl/private/opengl-display-privvy.ads
charlie5/lace
20
25887
with eGL; package opengl.Display.privvy is function to_eGL (Self : in Display.item'Class) return eGL.EGLDisplay; end opengl.Display.privvy;
llvm-gcc-4.2-2.9/gcc/ada/gnatbind.adb
vidkidz/crossbridge
1
3627
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- G N A T B I N D -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2006, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with ALI; use ALI; with ALI.Util; use ALI.Util; with Bcheck; use Bcheck; with Binde; use Binde; with Binderr; use Binderr; with Bindgen; use Bindgen; with Bindusg; with Butil; use Butil; with Casing; use Casing; with Csets; with Debug; use Debug; with Fmap; with Gnatvsn; use Gnatvsn; with Namet; use Namet; with Opt; use Opt; with Osint; use Osint; with Osint.B; use Osint.B; with Output; use Output; with Rident; use Rident; with Snames; with Switch; use Switch; with Switch.B; use Switch.B; with Targparm; use Targparm; with Types; use Types; with System.Case_Util; use System.Case_Util; procedure Gnatbind is Total_Errors : Nat := 0; -- Counts total errors in all files Total_Warnings : Nat := 0; -- Total warnings in all files Main_Lib_File : File_Name_Type; -- Current main library file Std_Lib_File : File_Name_Type; -- Standard library Text : Text_Buffer_Ptr; Next_Arg : Positive; Output_File_Name_Seen : Boolean := False; Output_File_Name : String_Ptr := new String'(""); L_Switch_Seen : Boolean := False; Mapping_File : String_Ptr := null; function Gnatbind_Supports_Auto_Init return Boolean; -- Indicates if automatic initialization of elaboration procedure -- through the constructor mechanism is possible on the platform. procedure List_Applicable_Restrictions; -- List restrictions that apply to this partition if option taken procedure Scan_Bind_Arg (Argv : String); -- Scan and process binder specific arguments. Argv is a single argument. -- All the one character arguments are still handled by Switch. This -- routine handles -aO -aI and -I-. function Is_Cross_Compiler return Boolean; -- Returns True iff this is a cross-compiler --------------------------------- -- Gnatbind_Supports_Auto_Init -- --------------------------------- function Gnatbind_Supports_Auto_Init return Boolean is function gnat_binder_supports_auto_init return Integer; pragma Import (C, gnat_binder_supports_auto_init, "__gnat_binder_supports_auto_init"); begin return gnat_binder_supports_auto_init /= 0; end Gnatbind_Supports_Auto_Init; ----------------------- -- Is_Cross_Compiler -- ----------------------- function Is_Cross_Compiler return Boolean is Cross_Compiler : Integer; pragma Import (C, Cross_Compiler, "__gnat_is_cross_compiler"); begin return Cross_Compiler = 1; end Is_Cross_Compiler; ---------------------------------- -- List_Applicable_Restrictions -- ---------------------------------- procedure List_Applicable_Restrictions is -- Define those restrictions that should be output if the gnatbind -- -r switch is used. Not all restrictions are output for the reasons -- given above in the list, and this array is used to test whether -- the corresponding pragma should be listed. True means that it -- should not be listed. No_Restriction_List : constant array (All_Restrictions) of Boolean := (No_Exceptions => True, -- Has unexpected Suppress (All_Checks) effect No_Implicit_Conditionals => True, -- This could modify and pessimize generated code No_Implicit_Dynamic_Code => True, -- This could modify and pessimize generated code No_Implicit_Loops => True, -- This could modify and pessimize generated code No_Recursion => True, -- Not checkable at compile time No_Reentrancy => True, -- Not checkable at compile time Max_Entry_Queue_Length => True, -- Not checkable at compile time Max_Storage_At_Blocking => True, -- Not checkable at compile time others => False); Additional_Restrictions_Listed : Boolean := False; -- Set True if we have listed header for restrictions begin -- Loop through restrictions for R in All_Restrictions loop if not No_Restriction_List (R) then -- We list a restriction if it is not violated, or if -- it is violated but the violation count is exactly known. if Cumulative_Restrictions.Violated (R) = False or else (R in All_Parameter_Restrictions and then Cumulative_Restrictions.Unknown (R) = False) then if not Additional_Restrictions_Listed then Write_Eol; Write_Line ("The following additional restrictions may be" & " applied to this partition:"); Additional_Restrictions_Listed := True; end if; Write_Str ("pragma Restrictions ("); declare S : constant String := Restriction_Id'Image (R); begin Name_Len := S'Length; Name_Buffer (1 .. Name_Len) := S; end; Set_Casing (Mixed_Case); Write_Str (Name_Buffer (1 .. Name_Len)); if R in All_Parameter_Restrictions then Write_Str (" => "); Write_Int (Int (Cumulative_Restrictions.Count (R))); end if; Write_Str (");"); Write_Eol; end if; end if; end loop; end List_Applicable_Restrictions; ------------------- -- Scan_Bind_Arg -- ------------------- procedure Scan_Bind_Arg (Argv : String) is -- LLVM local pragma Assert (Argv'First = 1); begin -- Now scan arguments that are specific to the binder and are not -- handled by the common circuitry in Switch. if Opt.Output_File_Name_Present and then not Output_File_Name_Seen then Output_File_Name_Seen := True; if Argv'Length = 0 or else (Argv'Length >= 1 and then Argv (1) = '-') then Fail ("output File_Name missing after -o"); else Output_File_Name := new String'(Argv); end if; elsif Argv'Length >= 2 and then Argv (1) = '-' then -- -I- if Argv (2 .. Argv'Last) = "I-" then Opt.Look_In_Primary_Dir := False; -- -Idir elsif Argv (2) = 'I' then Add_Src_Search_Dir (Argv (3 .. Argv'Last)); Add_Lib_Search_Dir (Argv (3 .. Argv'Last)); -- -Ldir elsif Argv (2) = 'L' then if Argv'Length >= 3 then -- Remember that the -L switch was specified, so that if this -- is on OpenVMS, the export names are put in uppercase. -- This is not known before the target parameters are read. L_Switch_Seen := True; Opt.Bind_For_Library := True; Opt.Ada_Init_Name := new String'(Argv (3 .. Argv'Last) & Opt.Ada_Init_Suffix); Opt.Ada_Final_Name := new String'(Argv (3 .. Argv'Last) & Opt.Ada_Final_Suffix); Opt.Ada_Main_Name := new String'(Argv (3 .. Argv'Last) & Opt.Ada_Main_Name_Suffix); -- This option (-Lxxx) implies -n Opt.Bind_Main_Program := False; else Fail ("Prefix of initialization and finalization " & "procedure names missing in -L"); end if; -- -Sin -Slo -Shi -Sxx elsif Argv'Length = 4 and then Argv (2) = 'S' then declare C1 : Character := Argv (3); C2 : Character := Argv (4); begin -- Fold to upper case if C1 in 'a' .. 'z' then C1 := Character'Val (Character'Pos (C1) - 32); end if; if C2 in 'a' .. 'z' then C2 := Character'Val (Character'Pos (C2) - 32); end if; -- Test valid option and set mode accordingly if C1 = 'E' and then C2 = 'V' then null; elsif C1 = 'I' and then C2 = 'N' then null; elsif C1 = 'L' and then C2 = 'O' then null; elsif C1 = 'H' and then C2 = 'I' then null; elsif (C1 in '0' .. '9' or else C1 in 'A' .. 'F') and then (C2 in '0' .. '9' or else C2 in 'A' .. 'F') then null; -- Invalid -S switch, let Switch give error, set defalut of IN else Scan_Binder_Switches (Argv); C1 := 'I'; C2 := 'N'; end if; Initialize_Scalars_Mode1 := C1; Initialize_Scalars_Mode2 := C2; end; -- -aIdir elsif Argv'Length >= 3 and then Argv (2 .. 3) = "aI" then Add_Src_Search_Dir (Argv (4 .. Argv'Last)); -- -aOdir elsif Argv'Length >= 3 and then Argv (2 .. 3) = "aO" then Add_Lib_Search_Dir (Argv (4 .. Argv'Last)); -- -nostdlib elsif Argv (2 .. Argv'Last) = "nostdlib" then Opt.No_Stdlib := True; -- -nostdinc elsif Argv (2 .. Argv'Last) = "nostdinc" then Opt.No_Stdinc := True; -- -static elsif Argv (2 .. Argv'Last) = "static" then Opt.Shared_Libgnat := False; -- -shared elsif Argv (2 .. Argv'Last) = "shared" then Opt.Shared_Libgnat := True; -- -F=mapping_file elsif Argv'Length >= 4 and then Argv (2 .. 3) = "F=" then if Mapping_File /= null then Fail ("cannot specify several mapping files"); end if; Mapping_File := new String'(Argv (4 .. Argv'Last)); -- -Mname elsif Argv'Length >= 3 and then Argv (2) = 'M' then if not Is_Cross_Compiler then Write_Line ("gnatbind: -M not expected to be used on native platforms"); end if; Opt.Bind_Alternate_Main_Name := True; Opt.Alternate_Main_Name := new String'(Argv (3 .. Argv'Last)); -- All other options are single character and are handled by -- Scan_Binder_Switches. else Scan_Binder_Switches (Argv); end if; -- Not a switch, so must be a file name (if non-empty) elsif Argv'Length /= 0 then if Argv'Length > 4 and then Argv (Argv'Last - 3 .. Argv'Last) = ".ali" then Add_File (Argv); else Add_File (Argv & ".ali"); end if; end if; end Scan_Bind_Arg; -- Start of processing for Gnatbind begin -- Set default for Shared_Libgnat option declare Shared_Libgnat_Default : Character; pragma Import (C, Shared_Libgnat_Default, "__gnat_shared_libgnat_default"); SHARED : constant Character := 'H'; STATIC : constant Character := 'T'; begin pragma Assert (Shared_Libgnat_Default = SHARED or else Shared_Libgnat_Default = STATIC); Shared_Libgnat := (Shared_Libgnat_Default = SHARED); end; -- Use low level argument routines to avoid dragging in the secondary stack Next_Arg := 1; Scan_Args : while Next_Arg < Arg_Count loop declare Next_Argv : String (1 .. Len_Arg (Next_Arg)); begin Fill_Arg (Next_Argv'Address, Next_Arg); Scan_Bind_Arg (Next_Argv); end; Next_Arg := Next_Arg + 1; end loop Scan_Args; if Use_Pragma_Linker_Constructor then if Bind_Main_Program then Fail ("switch -a must be used in conjunction with -n or -Lxxx"); elsif not Gnatbind_Supports_Auto_Init then Fail ("automatic initialisation of elaboration " & "not supported on this platform"); end if; end if; -- Test for trailing -o switch if Opt.Output_File_Name_Present and then not Output_File_Name_Seen then Fail ("output file name missing after -o"); end if; -- Output usage if requested if Usage_Requested then Bindusg; end if; -- Check that the Ada binder file specified has extension .adb and that -- the C binder file has extension .c if Opt.Output_File_Name_Present and then Output_File_Name_Seen then Check_Extensions : declare Length : constant Natural := Output_File_Name'Length; Last : constant Natural := Output_File_Name'Last; begin if Ada_Bind_File then if Length <= 4 or else Output_File_Name (Last - 3 .. Last) /= ".adb" then Fail ("output file name should have .adb extension"); end if; else if Length <= 2 or else Output_File_Name (Last - 1 .. Last) /= ".c" then Fail ("output file name should have .c extension"); end if; end if; end Check_Extensions; end if; Osint.Add_Default_Search_Dirs; -- Carry out package initializations. These are initializations which -- might logically be performed at elaboration time, but Namet at least -- can't be done that way (because it is used in the Compiler), and we -- decide to be consistent. Like elaboration, the order in which these -- calls are made is in some cases important. Csets.Initialize; Namet.Initialize; Snames.Initialize; -- Acquire target parameters Targparm.Get_Target_Parameters; -- Initialize Cumulative_Restrictions with the restrictions on the target -- scanned from the system.ads file. Then as we read ALI files, we will -- accumulate additional restrictions specified in other files. Cumulative_Restrictions := Targparm.Restrictions_On_Target; -- On OpenVMS, when -L is used, all external names used in pragmas Export -- are in upper case. The reason is that on OpenVMS, the macro-assembler -- MACASM-32, used to build Stand-Alone Libraries, only understands -- uppercase. if L_Switch_Seen and then OpenVMS_On_Target then To_Upper (Opt.Ada_Init_Name.all); To_Upper (Opt.Ada_Final_Name.all); To_Upper (Opt.Ada_Main_Name.all); end if; -- Acquire configurable run-time mode if Configurable_Run_Time_On_Target then Configurable_Run_Time_Mode := True; end if; -- Output copyright notice if in verbose mode if Verbose_Mode then Write_Eol; Write_Str ("GNATBIND "); Write_Str (Gnat_Version_String); Write_Eol; Write_Str ("Copyright 1995-" & Current_Year & ", Free Software Foundation, Inc."); Write_Eol; end if; -- Output usage information if no files if not More_Lib_Files then Bindusg; Exit_Program (E_Fatal); end if; -- If a mapping file was specified, initialize the file mapping if Mapping_File /= null then Fmap.Initialize (Mapping_File.all); end if; -- The block here is to catch the Unrecoverable_Error exception in the -- case where we exceed the maximum number of permissible errors or some -- other unrecoverable error occurs. begin -- Initialize binder packages Initialize_Binderr; Initialize_ALI; Initialize_ALI_Source; if Verbose_Mode then Write_Eol; end if; -- Input ALI files while More_Lib_Files loop Main_Lib_File := Next_Main_Lib_File; if Verbose_Mode then if Check_Only then Write_Str ("Checking: "); else Write_Str ("Binding: "); end if; Write_Name (Main_Lib_File); Write_Eol; end if; Text := Read_Library_Info (Main_Lib_File, True); declare Id : ALI_Id; pragma Warnings (Off, Id); begin Id := Scan_ALI (F => Main_Lib_File, T => Text, Ignore_ED => False, Err => False, Ignore_Errors => Debug_Flag_I); end; Free (Text); end loop; -- No_Run_Time mode if No_Run_Time_Mode then -- Set standard configuration parameters Suppress_Standard_Library_On_Target := True; Configurable_Run_Time_Mode := True; end if; -- For main ALI files, even if they are interfaces, we get their -- dependencies. To be sure, we reset the Interface flag for all main -- ALI files. for Index in ALIs.First .. ALIs.Last loop ALIs.Table (Index).SAL_Interface := False; end loop; -- Add System.Standard_Library to list to ensure that these files are -- included in the bind, even if not directly referenced from Ada code -- This is suppressed if the appropriate targparm switch is set. if not Suppress_Standard_Library_On_Target then Name_Buffer (1 .. 12) := "s-stalib.ali"; Name_Len := 12; Std_Lib_File := Name_Find; Text := Read_Library_Info (Std_Lib_File, True); declare Id : ALI_Id; pragma Warnings (Off, Id); begin Id := Scan_ALI (F => Std_Lib_File, T => Text, Ignore_ED => False, Err => False, Ignore_Errors => Debug_Flag_I); end; Free (Text); end if; -- Acquire all information in ALI files that have been read in for Index in ALIs.First .. ALIs.Last loop Read_ALI (Index); end loop; -- Quit if some file needs compiling if No_Object_Specified then raise Unrecoverable_Error; end if; -- Build source file table from the ALI files we have read in Set_Source_Table; -- Check that main library file is a suitable main program if Bind_Main_Program and then ALIs.Table (ALIs.First).Main_Program = None and then not No_Main_Subprogram then Error_Msg_Name_1 := Main_Lib_File; Error_Msg ("% does not contain a unit that can be a main program"); end if; -- Perform consistency and correctness checks Check_Duplicated_Subunits; Check_Versions; Check_Consistency; Check_Configuration_Consistency; -- List restrictions that could be applied to this partition if List_Restrictions then List_Applicable_Restrictions; end if; -- Complete bind if no errors if Errors_Detected = 0 then Find_Elab_Order; if Errors_Detected = 0 then if Elab_Order_Output then Write_Eol; Write_Str ("ELABORATION ORDER"); Write_Eol; for J in Elab_Order.First .. Elab_Order.Last loop if not Units.Table (Elab_Order.Table (J)).SAL_Interface then Write_Str (" "); Write_Unit_Name (Units.Table (Elab_Order.Table (J)).Uname); Write_Eol; end if; end loop; Write_Eol; end if; if not Check_Only then Gen_Output_File (Output_File_Name.all); end if; end if; end if; Total_Errors := Total_Errors + Errors_Detected; Total_Warnings := Total_Warnings + Warnings_Detected; exception when Unrecoverable_Error => Total_Errors := Total_Errors + Errors_Detected; Total_Warnings := Total_Warnings + Warnings_Detected; end; -- All done. Set proper exit status Finalize_Binderr; Namet.Finalize; if Total_Errors > 0 then Exit_Program (E_Errors); elsif Total_Warnings > 0 then Exit_Program (E_Warnings); else -- Do not call Exit_Program (E_Success), so that finalization occurs -- normally. null; end if; end Gnatbind;
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c8/c83f03b.ada
best08618/asylo
7
11468
<reponame>best08618/asylo -- C83F03B.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- CHECK THAT IF A PACKAGE BODY IS NESTED INSIDE ANOTHER PACKAGE BODY -- THE INNER PACKAGE BODY CAN CONTAIN A LABEL IDENTIFIER IDENTICAL -- TO A LABEL IDENTIFIER IN THE OUTER PACKAGE BODY, TO AN IDENTI- -- FIER DECLARED IN THE OUTER PACKAGE BODY OR IN ITS SPECIFICATION, -- OR TO A LABEL IDENTIFIER OR OTHER IDENTIFIER IN THE -- ENVIRONMENT SURROUNDING THE OUTER PACKAGE BODY. -- INTERACTIONS WITH SEPARATE COMPILATION ARE TESTED IN C83F03C , -- C83F03D . -- RM 04 SEPTEMBER 1980 WITH REPORT; PROCEDURE C83F03B IS USE REPORT; X1 , X2 : INTEGER RANGE 1..23 := 17 ; TYPE T1 IS ( A , B , C) ; Z : T1 := A ; FLOW_INDEX : INTEGER := 0 ; BEGIN TEST( "C83F03B" , "CHECK THAT IF A PACKAGE BODY IS NESTED" & " INSIDE ANOTHER PACKAGE BODY, THE INNER" & " PACKAGE BODY CAN CONTAIN A LABEL IDENTIFIER" & " IDENTICAL TO A LABEL IDENTIFIER IN THE OUTER" & " PACKAGE BODY, TO AN IDENTIFIER DECLARED IN" & " THE OUTER PACKAGE BODY OR IN ITS SPECIFICA" & "TION, OR TO A LABEL IDENTIFIER OR OTHER" & " IDENTIFIER IN THE ENVIRONMENT SURROUNDING" & " THE OUTER PACKAGE BODY" ) ; DECLARE Y1 , Y2 : INTEGER := 100 ; X2 : INTEGER := 100 ; PROCEDURE BUMP IS BEGIN FLOW_INDEX := FLOW_INDEX + 1 ; END BUMP ; PACKAGE OUTER IS Y3 : INTEGER := 100 ; TYPE T3 IS ( D , E , F ) ; PACKAGE P IS AA : BOOLEAN := FALSE ; END P ; END OUTER ; PACKAGE BODY OUTER IS Y4 : INTEGER := 200 ; TYPE T4 IS ( G , H , I ) ; PACKAGE BODY P IS BEGIN GOTO X1 ; BUMP ; BUMP ; <<X1>> BUMP ; GOTO X2 ; BUMP ; <<T1>> BUMP ; GOTO Z ; BUMP ; <<Y1>> BUMP ; GOTO Y2 ; BUMP ; <<Y2>> BUMP ; GOTO T1 ; BUMP ; <<X2>> BUMP ; GOTO Y1 ; BUMP ; <<Z >> BUMP ; GOTO T3 ; BUMP ; <<T3>> BUMP ; GOTO T4 ; BUMP ; <<LABEL_IN_OUTER>> BUMP ; GOTO LABEL_IN_MAIN ; BUMP ; <<Y3>> BUMP ; GOTO Y4 ; BUMP ; <<Y4>> BUMP ; GOTO LABEL_IN_OUTER ; BUMP ; <<T4>> BUMP ; GOTO Y3 ; BUMP ; <<LABEL_IN_MAIN >> BUMP ; GOTO ENDING ; BUMP ; << ENDING >> NULL; END P ; BEGIN << LABEL_IN_OUTER >> NULL ; END OUTER ; BEGIN << LABEL_IN_MAIN >> IF FLOW_INDEX /= 12 THEN FAILED( "INCORRECT FLOW OF CONTROL" ); END IF; END ; RESULT; -- POSS. ERROR DURING ELABORATION OF P END C83F03B;
experiments/realbugs/dll9.als
kaiyuanw/AlloyFLCore
1
3633
<reponame>kaiyuanw/AlloyFLCore one sig DLL { header: lone Node } sig Node { pre, nxt: lone Node, elem: Int } // All nodes are reachable from the header along the nxt. fact Reachable { Node = DLL.header.*nxt all n : Node - DLL.header | some nxt.n } // Part (a) fact Acyclic { // The list has no directed cycle along nxt, i.e., no node is // reachable from itself following one or more traversals along nxt. no n:Node | n in n.^nxt } // Part (b) pred UniqueElem() { // Unique nodes contain unique elements. all disj n1, n2 : Node | disj [n1.elem, n2.elem] } // Part (c) pred Sorted() { // The list is sorted in ascending order (<=) along nxt. // Fix: all n: Node | some n.nxt => n.elem <= n.nxt.elem #Node.pre <= #Node.nxt } // Part (d) pred ConsistentPreAndNxt() { // For any node n1 and n2, if n1.nxt = n2, then n2.pre = n1; and vice versa. all n1, n2: Node | n1.nxt = n2 implies n2.pre = n1//As I understand p implies q means if p then q all n1, n2: Node | n2.pre = n1 implies n1.nxt = n2 } pred RepOk() { UniqueElem Sorted ConsistentPreAndNxt } run RepOk for 5
tests/fn_le/24.asm
NullMember/customasm
414
29937
#d le(-0x01) ; error: unsized
programs/oeis/079/A079326.asm
karttu/loda
1
175347
; A079326: a(n) = the largest number m such that if m monominoes are removed from an n X n square then an L-triomino must remain. ; 1,2,7,9,17,20,31,35,49,54,71,77,97,104,127,135,161,170,199,209,241,252,287,299,337,350,391,405,449,464,511,527,577,594,647,665,721,740,799,819,881,902,967,989,1057,1080,1151,1175,1249,1274,1351,1377,1457 add $0,2 mov $1,$0 div $1,2 mul $1,$0 sub $1,1
programs/oeis/045/A045544.asm
neoneye/loda
22
169022
<reponame>neoneye/loda<gh_stars>10-100 ; A045544: Odd values of n for which a regular n-gon can be constructed by compass and straightedge. ; 3,5,15,17,51,85,255,257,771,1285,3855,4369,13107,21845,65535,65537,196611,327685,983055,1114129,3342387,5570645,16711935,16843009,50529027,84215045,252645135,286331153,858993459,1431655765,4294967295 mov $1,3 lpb $0 sub $0,1 seq $1,48724 ; Write n and 2n in binary and add them mod 2. lpe mov $0,$1
source/amf/mof/cmof/amf-cmof-named_elements.ads
svn2github/matreshka
24
11896
<reponame>svn2github/matreshka ------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011, <NAME> <<EMAIL>> -- -- 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 Vadim Godunko, IE 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 -- -- 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. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ -- A named element is an element in a model that may have a name. ------------------------------------------------------------------------------ with AMF.CMOF.Elements; limited with AMF.CMOF.Namespaces.Collections; with League.Strings; package AMF.CMOF.Named_Elements is pragma Preelaborate; type CMOF_Named_Element is limited interface and AMF.CMOF.Elements.CMOF_Element; type CMOF_Named_Element_Access is access all CMOF_Named_Element'Class; for CMOF_Named_Element_Access'Storage_Size use 0; not overriding function Get_Name (Self : not null access constant CMOF_Named_Element) return AMF.Optional_String is abstract; -- Getter of NamedElement::name. -- -- The name of the NamedElement. not overriding procedure Set_Name (Self : not null access CMOF_Named_Element; To : AMF.Optional_String) is abstract; -- Setter of NamedElement::name. -- -- The name of the NamedElement. not overriding function Get_Visibility (Self : not null access constant CMOF_Named_Element) return AMF.CMOF.Optional_CMOF_Visibility_Kind is abstract; -- Getter of NamedElement::visibility. -- -- Determines where the NamedElement appears within different Namespaces -- within the overall model, and its accessibility. not overriding procedure Set_Visibility (Self : not null access CMOF_Named_Element; To : AMF.CMOF.Optional_CMOF_Visibility_Kind) is abstract; -- Setter of NamedElement::visibility. -- -- Determines where the NamedElement appears within different Namespaces -- within the overall model, and its accessibility. not overriding function Get_Namespace (Self : not null access constant CMOF_Named_Element) return AMF.CMOF.Namespaces.CMOF_Namespace_Access is abstract; -- Getter of NamedElement::namespace. -- -- Specifies the namespace that owns the NamedElement. not overriding function Get_Qualified_Name (Self : not null access constant CMOF_Named_Element) return AMF.Optional_String is abstract; -- Getter of NamedElement::qualifiedName. -- -- A name which allows the NamedElement to be identified within a -- hierarchy of nested Namespaces. It is constructed from the names of the -- containing namespaces starting at the root of the hierarchy and ending -- with the name of the NamedElement itself. not overriding function All_Namespaces (Self : not null access constant CMOF_Named_Element) return AMF.CMOF.Namespaces.Collections.Ordered_Set_Of_CMOF_Namespace is abstract; -- Operation NamedElement::allNamespaces. -- -- The query allNamespaces() gives the sequence of namespaces in which the -- NamedElement is nested, working outwards. not overriding function Is_Distinguishable_From (Self : not null access constant CMOF_Named_Element; N : AMF.CMOF.Named_Elements.CMOF_Named_Element_Access; Ns : AMF.CMOF.Namespaces.CMOF_Namespace_Access) return Boolean is abstract; -- Operation NamedElement::isDistinguishableFrom. -- -- The query isDistinguishableFrom() determines whether two NamedElements -- may logically co-exist within a Namespace. By default, two named -- elements are distinguishable if (a) they have unrelated types or (b) -- they have related types but different names. not overriding function Separator (Self : not null access constant CMOF_Named_Element) return League.Strings.Universal_String is abstract; -- Operation NamedElement::separator. -- -- The query separator() gives the string that is used to separate names -- when constructing a qualified name. not overriding function Qualified_Name (Self : not null access constant CMOF_Named_Element) return League.Strings.Universal_String is abstract; -- Operation NamedElement::qualifiedName. -- -- When there is a name, and all of the containing namespaces have a name, -- the qualified name is constructed from the names of the containing -- namespaces. end AMF.CMOF.Named_Elements;
AppleScript/export_coverpages.applescript
aaronpriven/actium
1
3260
set CoverPageFileFolder to "Bireme:Actium:tableart:CoverPages:" tell application "Adobe InDesign CC 2017" set lastPageNum to document offset of last page of active document repeat with PageNum from 1 to lastPageNum set LineGroupFrame to (item 1 of (all page items of (page PageNum of active document)) whose label is "linegroup") set linegroup to contents of contents of LineGroupFrame -- For the life of me I don't understand why the duplicate contents is necessary, but it is tell AppleScript to set text item delimiters to "_" set linegroup to ((words of linegroup) as string) tell PDF export preferences set page range to PageNum as string set view PDF to false end tell set pep to PDF export preset "[High Quality Print]" tell active document set filestring to (CoverPageFileFolder & linegroup & ".pdf") export format PDF type to filestring using pep end tell end repeat end tell (* =head1 NAME <name> - <brief description> =head1 VERSION This documentation refers to version 0.003 =head1 DESCRIPTION A full description of the module and its features. =head1 DIAGNOSTICS A list of every error and warning message that the application can generate (even the ones that will "never happen"), with a full explanation of each problem, one or more likely causes, and any suggested remedies. If the application generates exit status codes, then list the exit status associated with each error. =head1 CONFIGURATION AND ENVIRONMENT A full explanation of any configuration system(s) used by the application, including the names and locations of any configuration files, and the meaning of any environment variables or properties that can be se. These descriptions must also include details of any configuration language used. =head1 DEPENDENCIES List its dependencies. =head1 AUTHOR <NAME> <<EMAIL>> =head1 COPYRIGHT & LICENSE Copyright 2017 This program is free software; you can redistribute it and/or modify it under the terms of either: =over 4 =item * the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or =item * the Artistic License version 2.0. =back This program 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. *)
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c3/c34011b.ada
best08618/asylo
7
29954
-- C34011B.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- OBJECTIVE: -- CHECK THAT A DERIVED TYPE DECLARATION IS NOT CONSIDERED EXACTLY -- EQUIVALENT TO AN ANONYMOUS DECLARATION OF THE DERIVED TYPE -- FOLLOWED BY A SUBTYPE DECLARATION OF THE DERIVED SUBTYPE. IN -- PARTICULAR, CHECK THAT CONSTRAINT_ERROR CAN BE RAISED WHEN THE -- SUBTYPE INDICATION OF THE DERIVED TYPE DECLARATION IS ELABORATED -- (EVEN THOUGH THE CONSTRAINT WOULD SATISFY THE DERIVED (BASE) -- TYPE). -- HISTORY: -- JRK 09/04/87 CREATED ORIGINAL TEST. -- EDS 07/29/98 AVOID OPTIMIZATION WITH REPORT; USE REPORT; PROCEDURE C34011B IS SUBTYPE BOOL IS BOOLEAN RANGE FALSE .. FALSE; SUBTYPE FLT IS FLOAT RANGE -10.0 .. 10.0; SUBTYPE DUR IS DURATION RANGE 0.0 .. 10.0; SUBTYPE INT IS INTEGER RANGE 0 .. 10; TYPE ARR IS ARRAY (INT RANGE <>) OF INTEGER; TYPE REC (D : INT := 0) IS RECORD I : INTEGER; END RECORD; PACKAGE PT IS TYPE PRIV (D : POSITIVE := 1) IS PRIVATE; PRIVATE TYPE PRIV (D : POSITIVE := 1) IS RECORD I : INTEGER; END RECORD; END PT; USE PT; TYPE ACC_ARR IS ACCESS ARR; TYPE ACC_REC IS ACCESS REC; BEGIN TEST ("C34011B", "CHECK THAT CONSTRAINT_ERROR CAN BE RAISED " & "WHEN THE SUBTYPE INDICATION OF A DERIVED TYPE " & "DECLARATION IS ELABORATED"); BEGIN DECLARE TYPE T IS NEW BOOL RANGE FALSE .. BOOL(IDENT_BOOL(TRUE)); BEGIN DECLARE -- DEFINE AN OBJECT OF TYPE T AND USE IT TO AVOID OPTIMIZATION T1 : T := T(IDENT_BOOL(TRUE)); BEGIN FAILED ("DID NOT RAISE CONSTRAINT_ERROR AT PROPER PLACE"); EXCEPTION WHEN OTHERS => FAILED ("DID NOT RAISE CONSTRAINT_ERROR" & " AT PROPER PLACE - BOOL " & T'IMAGE(T1) ); --USE T1); END; FAILED ("EXCEPTION NOT RAISED - BOOL"); EXCEPTION WHEN OTHERS => FAILED ("WRONG HANDLER ENTERED - BOOL"); END; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED - BOOL"); END; BEGIN DECLARE TYPE T IS NEW POSITIVE RANGE IDENT_INT (0) .. 10; BEGIN DECLARE -- DEFINE AN OBJECT OF TYPE T AND USE IT TO AVOID OPTIMIZATION T1 : T := T(IDENT_INT(1)); BEGIN FAILED ("DID NOT RAISE CONSTRAINT_ERROR AT PROPER PLACE"); EXCEPTION WHEN OTHERS => FAILED ("DID NOT RAISE CONSTRAINT_ERROR - POSITIVE " & T'IMAGE(T1)); --USE T1 END; FAILED ("EXCEPTION NOT RAISED - POSITIVE" ); EXCEPTION WHEN OTHERS => FAILED ("WRONG HANDLER ENTERED - POSITIVE"); END; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED - POSITIVE"); END; BEGIN DECLARE TYPE T IS NEW FLT RANGE 0.0 .. FLT(IDENT_INT(20)); BEGIN DECLARE -- DEFINE AN OBJECT OF TYPE T AND USE IT TO AVOID OPTIMIZATION T1 : T := T(IDENT_INT(0)); BEGIN FAILED ("DID NOT RAISE CONSTRAINT_ERROR" & " AT PROPER PLACE " & T'IMAGE(T1) ); --USE T1 EXCEPTION WHEN OTHERS => FAILED ("DID NOT RAISE CONSTRAINT_ERROR" & " AT PROPER PLACE "); END; FAILED ("EXCEPTION NOT RAISED - FLT" ); EXCEPTION WHEN OTHERS => FAILED ("WRONG HANDLER ENTERED - FLT"); END; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED - FLT"); END; BEGIN DECLARE TYPE T IS NEW DUR RANGE DUR(IDENT_INT(-1)) .. 5.0; BEGIN DECLARE -- DEFINE AN OBJECT OF TYPE T AND USE IT TO AVOID OPTIMIZATION T1 : T := T(IDENT_INT(2)); BEGIN FAILED ("DID NOT RAISE CONSTRAINT_ERROR" & " AT PROPER PLACE " & T'IMAGE(T1) ); -- USE T1 EXCEPTION WHEN OTHERS => FAILED ("DID NOT RAISE CONSTRAINT_ERROR AT PROPER PLACE"); END; FAILED ("EXCEPTION NOT RAISED - DUR " ); EXCEPTION WHEN OTHERS => FAILED ("WRONG HANDLER ENTERED - DUR"); END; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED - DUR"); END; BEGIN DECLARE TYPE T IS NEW ARR (IDENT_INT (-1) .. 10); BEGIN DECLARE -- DEFINE AN OBJECT OF TYPE T AND USE IT TO AVOID OPTIMIZATION T1 : T := (OTHERS => IDENT_INT(3)); BEGIN FAILED ("DID NOT RAISE CONSTRAINT_ERROR " & "AT PROPER PLACE " & INTEGER'IMAGE(T1(1)) ); --USE T1 EXCEPTION WHEN OTHERS => FAILED ("DID NOT RAISE CONSTRAINT_ERROR AT PROPER PLACE"); END; FAILED ("EXCEPTION NOT RAISED - ARR " ); EXCEPTION WHEN OTHERS => FAILED ("WRONG HANDLER ENTERED - ARR"); END; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED - ARR"); END; BEGIN DECLARE TYPE T IS NEW REC (IDENT_INT (11)); BEGIN DECLARE -- DEFINE AN OBJECT OF TYPE T AND USE IT TO AVOID OPTIMIZATION T1 : T; BEGIN FAILED ("DID NOT RAISE CONSTRAINT_ERROR AT PROPER PLACE"); EXCEPTION WHEN OTHERS => FAILED ("DID NOT RAISE CONSTRAINT_ERROR " & "AT PROPER PLACE " & INTEGER'IMAGE(T1.D) ); --USE T1 END; FAILED ("EXCEPTION NOT RAISED - REC " ); EXCEPTION WHEN OTHERS => FAILED ("WRONG HANDLER ENTERED - REC"); END; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED - REC"); END; BEGIN DECLARE TYPE T IS NEW PRIV (IDENT_INT (0)); --RAISES C_E BEGIN DECLARE -- DEFINE AN OBJECT OF TYPE T AND USE IT TO AVOID OPTIMIZATION T1 : T; BEGIN FAILED ("DID NOT RAISE CONSTRAINT_ERROR AT PROPER PLACE"); EXCEPTION WHEN OTHERS => FAILED ("DID NOT RAISE CONSTRAINT_ERROR " & "AT PROPER PLACE " & INTEGER'IMAGE(T1.D) ); --USE T1 END; FAILED ("EXCEPTION NOT RAISED - PRIV " ); EXCEPTION WHEN OTHERS => FAILED ("WRONG HANDLER ENTERED - PRIV"); END; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED - PRIV"); END; BEGIN DECLARE TYPE T IS NEW ACC_ARR (0 .. IDENT_INT (11)); --RAISES C_E BEGIN DECLARE -- DEFINE AN OBJECT OF TYPE T AND USE IT TO AVOID OPTIMIZATION T1 : T; BEGIN FAILED ("DID NOT RAISE CONSTRAINT_ERROR AT PROPER PLACE"); EXCEPTION WHEN OTHERS => FAILED ("DID NOT RAISE CONSTRAINT_ERROR " & "AT PROPER PLACE " & INTEGER'IMAGE(T1(1)) ); --USE T1 END; FAILED ("EXCEPTION NOT RAISED - ACC_ARR " ); EXCEPTION WHEN OTHERS => FAILED ("WRONG HANDLER ENTERED - ACC_ARR"); END; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED - ACC_ARR"); END; BEGIN DECLARE TYPE T IS NEW ACC_REC (IDENT_INT (-1)); --RAISES C_E BEGIN DECLARE -- DEFINE AN OBJECT OF TYPE T AND USE IT TO AVOID OPTIMIZATION T1 : T; BEGIN FAILED ("DID NOT RAISE CONSTRAINT_ERROR AT PROPER PLACE"); EXCEPTION WHEN OTHERS => FAILED ("DID NOT RAISE CONSTRAINT_ERROR " & "AT PROPER PLACE " & INTEGER'IMAGE(T1.D) ); --USE T1 END; FAILED ("EXCEPTION NOT RAISED - ACC_REC " ); EXCEPTION WHEN OTHERS => FAILED ("WRONG HANDLER ENTERED - ACC_REC"); END; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED - ACC_REC"); END; RESULT; END C34011B;
llvm-gcc-4.2-2.9/gcc/ada/mlib-tgt-aix.adb
vidkidz/crossbridge
1
8414
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- M L I B . T G T -- -- (AIX Version) -- -- -- -- B o d y -- -- -- -- Copyright (C) 2003-2005, AdaCore -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This package provides a set of target dependent routines to build -- static, dynamic or relocatable libraries. -- This is the AIX version of the body with Ada.Strings.Fixed; use Ada.Strings.Fixed; with MLib.Fil; with MLib.Utl; with Namet; use Namet; with Opt; with Output; use Output; with Prj.Com; with Prj.Util; use Prj.Util; package body MLib.Tgt is No_Arguments : aliased Argument_List := (1 .. 0 => null); Empty_Argument_List : constant Argument_List_Access := No_Arguments'Access; Bexpall : aliased String := "-Wl,-bexpall"; Bexpall_Option : constant String_Access := Bexpall'Access; -- The switch to export all symbols Lpthreads : aliased String := "-lpthreads"; Native_Thread_Options : aliased Argument_List := (1 => Lpthreads'Access); -- The switch to use when linking a library against libgnarl when using -- Native threads. Lgthreads : aliased String := "-lgthreads"; Lmalloc : aliased String := "-lmalloc"; FSU_Thread_Options : aliased Argument_List := (1 => Lgthreads'Access, 2 => Lmalloc'Access); -- The switches to use when linking a library against libgnarl when using -- FSU threads. Thread_Options : Argument_List_Access := Empty_Argument_List; -- Designate the thread switches to used when linking a library against -- libgnarl. Depends on the thread library (Native or FSU). Resolved for -- the first library linked against libgnarl. --------------------- -- Archive_Builder -- --------------------- function Archive_Builder return String is begin return "ar"; end Archive_Builder; ----------------------------- -- Archive_Builder_Options -- ----------------------------- function Archive_Builder_Options return String_List_Access is begin return new String_List'(1 => new String'("cr")); end Archive_Builder_Options; ----------------- -- Archive_Ext -- ----------------- function Archive_Ext return String is begin return "a"; end Archive_Ext; --------------------- -- Archive_Indexer -- --------------------- function Archive_Indexer return String is begin return "ranlib"; end Archive_Indexer; ----------------------------- -- Archive_Indexer_Options -- ----------------------------- function Archive_Indexer_Options return String_List_Access is begin return new String_List (1 .. 0); end Archive_Indexer_Options; --------------------------- -- Build_Dynamic_Library -- --------------------------- procedure Build_Dynamic_Library (Ofiles : Argument_List; Foreign : Argument_List; Afiles : Argument_List; Options : Argument_List; Options_2 : Argument_List; Interfaces : Argument_List; Lib_Filename : String; Lib_Dir : String; Symbol_Data : Symbol_Record; Driver_Name : Name_Id := No_Name; Lib_Version : String := ""; Auto_Init : Boolean := False) is pragma Unreferenced (Foreign); pragma Unreferenced (Afiles); pragma Unreferenced (Interfaces); pragma Unreferenced (Symbol_Data); pragma Unreferenced (Lib_Version); pragma Unreferenced (Auto_Init); Lib_File : constant String := Lib_Dir & Directory_Separator & "lib" & MLib.Fil.Ext_To (Lib_Filename, DLL_Ext); -- The file name of the library Thread_Opts : Argument_List_Access := Empty_Argument_List; -- Set to Thread_Options if -lgnarl is found in the Options begin if Opt.Verbose_Mode then Write_Str ("building relocatable shared library "); Write_Line (Lib_File); end if; -- Look for -lgnarl in Options. If found, set the thread options for J in Options'Range loop if Options (J).all = "-lgnarl" then -- If Thread_Options is null, read s-osinte.ads to discover the -- thread library and set Thread_Options accordingly. if Thread_Options = null then declare File : Text_File; Line : String (1 .. 100); Last : Natural; begin Open (File, Include_Dir_Default_Prefix & "/s-osinte.ads"); while not End_Of_File (File) loop Get_Line (File, Line, Last); if Index (Line (1 .. Last), "-lpthreads") /= 0 then Thread_Options := Native_Thread_Options'Access; exit; elsif Index (Line (1 .. Last), "-lgthreads") /= 0 then Thread_Options := FSU_Thread_Options'Access; exit; end if; end loop; Close (File); if Thread_Options = null then Prj.Com.Fail ("cannot find the thread library in use"); end if; exception when others => Prj.Com.Fail ("cannot open s-osinte.ads"); end; end if; Thread_Opts := Thread_Options; exit; end if; end loop; -- Finally, call GCC (or the driver specified) to build the library MLib.Utl.Gcc (Output_File => Lib_File, Objects => Ofiles, Options => Options & Bexpall_Option, Driver_Name => Driver_Name, Options_2 => Options_2 & Thread_Opts.all); end Build_Dynamic_Library; ------------- -- DLL_Ext -- ------------- function DLL_Ext return String is begin return "a"; end DLL_Ext; ---------------- -- DLL_Prefix -- ---------------- function DLL_Prefix return String is begin return "lib"; end DLL_Prefix; -------------------- -- Dynamic_Option -- -------------------- function Dynamic_Option return String is begin return "-shared"; end Dynamic_Option; ------------------- -- Is_Object_Ext -- ------------------- function Is_Object_Ext (Ext : String) return Boolean is begin return Ext = ".o"; end Is_Object_Ext; -------------- -- Is_C_Ext -- -------------- function Is_C_Ext (Ext : String) return Boolean is begin return Ext = ".c"; end Is_C_Ext; -------------------- -- Is_Archive_Ext -- -------------------- function Is_Archive_Ext (Ext : String) return Boolean is begin return Ext = ".a"; end Is_Archive_Ext; ------------- -- Libgnat -- ------------- function Libgnat return String is begin return "libgnat.a"; end Libgnat; ------------------------ -- Library_Exists_For -- ------------------------ function Library_Exists_For (Project : Project_Id; In_Tree : Project_Tree_Ref) return Boolean is begin if not In_Tree.Projects.Table (Project).Library then Prj.Com.Fail ("INTERNAL ERROR: Library_Exists_For called " & "for non library project"); return False; else declare Lib_Dir : constant String := Get_Name_String (In_Tree.Projects.Table (Project).Library_Dir); Lib_Name : constant String := Get_Name_String (In_Tree.Projects.Table (Project).Library_Name); begin if In_Tree.Projects.Table (Project).Library_Kind = Static then return Is_Regular_File (Lib_Dir & Directory_Separator & "lib" & Fil.Ext_To (Lib_Name, Archive_Ext)); else return Is_Regular_File (Lib_Dir & Directory_Separator & "lib" & Fil.Ext_To (Lib_Name, DLL_Ext)); end if; end; end if; end Library_Exists_For; --------------------------- -- Library_File_Name_For -- --------------------------- function Library_File_Name_For (Project : Project_Id; In_Tree : Project_Tree_Ref) return Name_Id is begin if not In_Tree.Projects.Table (Project).Library then Prj.Com.Fail ("INTERNAL ERROR: Library_File_Name_For called " & "for non library project"); return No_Name; else declare Lib_Name : constant String := Get_Name_String (In_Tree.Projects.Table (Project).Library_Name); begin Name_Len := 3; Name_Buffer (1 .. Name_Len) := "lib"; if In_Tree.Projects.Table (Project).Library_Kind = Static then Add_Str_To_Name_Buffer (Fil.Ext_To (Lib_Name, Archive_Ext)); else Add_Str_To_Name_Buffer (Fil.Ext_To (Lib_Name, DLL_Ext)); end if; return Name_Find; end; end if; end Library_File_Name_For; ---------------- -- Object_Ext -- ---------------- function Object_Ext return String is begin return "o"; end Object_Ext; ---------------- -- PIC_Option -- ---------------- function PIC_Option return String is begin return "-fPIC"; end PIC_Option; ----------------------------------------------- -- Standalone_Library_Auto_Init_Is_Supported -- ----------------------------------------------- function Standalone_Library_Auto_Init_Is_Supported return Boolean is begin return True; end Standalone_Library_Auto_Init_Is_Supported; --------------------------- -- Support_For_Libraries -- --------------------------- function Support_For_Libraries return Library_Support is begin return Static_Only; end Support_For_Libraries; end MLib.Tgt;
test/Fail/ConstructorHeadedPointlessForRecordPatterns.agda
cruhland/agda
1,989
2354
<reponame>cruhland/agda -- Andreas, 2014-06-12 -- No inversion on one clause functions with record patterns only! {-# OPTIONS -v tc.inj:40 #-} -- KEEP! module _ where open import Common.Product -- No inverse should be created for swap by -- checkInjectivity, since we are dealing with a record constructor. swap : ∀{A B} → A × B → B × A swap (a , b) = b , a -- The internal representation is -- -- swap p = (snd p, fst p) -- -- so trying to use injectivity is pointless here. -- The expected output should mention that injectivity for swap is pointless. -- ... -- Injectivity of ConstructorHeadedPointlessForRecordPatterns.swap would be pointless. -- Crash after typechecking swap. KEEP! CRASH : Set CRASH = Set
gfx/pokemon/idle_pointers.asm
Dev727/ancientplatinum
28
241283
AnimationIdlePointers: dw BulbasaurAnimationIdle dw IvysaurAnimationIdle dw VenusaurAnimationIdle dw CharmanderAnimationIdle dw CharmeleonAnimationIdle dw CharizardAnimationIdle dw SquirtleAnimationIdle dw WartortleAnimationIdle dw BlastoiseAnimationIdle dw CaterpieAnimationIdle dw MetapodAnimationIdle dw ButterfreeAnimationIdle dw WeedleAnimationIdle dw KakunaAnimationIdle dw BeedrillAnimationIdle dw PidgeyAnimationIdle dw PidgeottoAnimationIdle dw PidgeotAnimationIdle dw RattataAnimationIdle dw RaticateAnimationIdle dw SpearowAnimationIdle dw FearowAnimationIdle dw EkansAnimationIdle dw ArbokAnimationIdle dw PikachuAnimationIdle dw RaichuAnimationIdle dw SandshrewAnimationIdle dw SandslashAnimationIdle dw NidoranFAnimationIdle dw NidorinaAnimationIdle dw NidoqueenAnimationIdle dw NidoranMAnimationIdle dw NidorinoAnimationIdle dw NidokingAnimationIdle dw ClefairyAnimationIdle dw ClefableAnimationIdle dw VulpixAnimationIdle dw NinetalesAnimationIdle dw JigglypuffAnimationIdle dw WigglytuffAnimationIdle dw ZubatAnimationIdle dw GolbatAnimationIdle dw OddishAnimationIdle dw GloomAnimationIdle dw VileplumeAnimationIdle dw ParasAnimationIdle dw ParasectAnimationIdle dw VenonatAnimationIdle dw VenomothAnimationIdle dw DiglettAnimationIdle dw DugtrioAnimationIdle dw MeowthAnimationIdle dw PersianAnimationIdle dw PsyduckAnimationIdle dw GolduckAnimationIdle dw MankeyAnimationIdle dw PrimeapeAnimationIdle dw GrowlitheAnimationIdle dw ArcanineAnimationIdle dw PoliwagAnimationIdle dw PoliwhirlAnimationIdle dw PoliwrathAnimationIdle dw AbraAnimationIdle dw KadabraAnimationIdle dw AlakazamAnimationIdle dw MachopAnimationIdle dw MachokeAnimationIdle dw MachampAnimationIdle dw BellsproutAnimationIdle dw WeepinbellAnimationIdle dw VictreebelAnimationIdle dw TentacoolAnimationIdle dw TentacruelAnimationIdle dw GeodudeAnimationIdle dw GravelerAnimationIdle dw GolemAnimationIdle dw PonytaAnimationIdle dw RapidashAnimationIdle dw SlowpokeAnimationIdle dw SlowbroAnimationIdle dw MagnemiteAnimationIdle dw MagnetonAnimationIdle dw FarfetchDAnimationIdle dw DoduoAnimationIdle dw DodrioAnimationIdle dw SeelAnimationIdle dw DewgongAnimationIdle dw GrimerAnimationIdle dw MukAnimationIdle dw ShellderAnimationIdle dw CloysterAnimationIdle dw GastlyAnimationIdle dw HaunterAnimationIdle dw GengarAnimationIdle dw OnixAnimationIdle dw DrowzeeAnimationIdle dw HypnoAnimationIdle dw KrabbyAnimationIdle dw KinglerAnimationIdle dw VoltorbAnimationIdle dw ElectrodeAnimationIdle dw ExeggcuteAnimationIdle dw ExeggutorAnimationIdle dw CuboneAnimationIdle dw MarowakAnimationIdle dw HitmonleeAnimationIdle dw HitmonchanAnimationIdle dw LickitungAnimationIdle dw KoffingAnimationIdle dw WeezingAnimationIdle dw RhyhornAnimationIdle dw RhydonAnimationIdle dw ChanseyAnimationIdle dw TangelaAnimationIdle dw KangaskhanAnimationIdle dw HorseaAnimationIdle dw SeadraAnimationIdle dw GoldeenAnimationIdle dw SeakingAnimationIdle dw StaryuAnimationIdle dw StarmieAnimationIdle dw MrMimeAnimationIdle dw ScytherAnimationIdle dw JynxAnimationIdle dw ElectabuzzAnimationIdle dw MagmarAnimationIdle dw PinsirAnimationIdle dw TaurosAnimationIdle dw MagikarpAnimationIdle dw GyaradosAnimationIdle dw LaprasAnimationIdle dw DittoAnimationIdle dw EeveeAnimationIdle dw VaporeonAnimationIdle dw JolteonAnimationIdle dw FlareonAnimationIdle dw PorygonAnimationIdle dw OmanyteAnimationIdle dw OmastarAnimationIdle dw KabutoAnimationIdle dw KabutopsAnimationIdle dw AerodactylAnimationIdle dw SnorlaxAnimationIdle dw ArticunoAnimationIdle dw ZapdosAnimationIdle dw MoltresAnimationIdle dw DratiniAnimationIdle dw DragonairAnimationIdle dw DragoniteAnimationIdle dw MewtwoAnimationIdle dw MewAnimationIdle dw ChikoritaAnimationIdle dw BayleefAnimationIdle dw MeganiumAnimationIdle dw CyndaquilAnimationIdle dw QuilavaAnimationIdle dw TyphlosionAnimationIdle dw TotodileAnimationIdle dw CroconawAnimationIdle dw FeraligatrAnimationIdle dw SentretAnimationIdle dw FurretAnimationIdle dw HoothootAnimationIdle dw NoctowlAnimationIdle dw LedybaAnimationIdle dw LedianAnimationIdle dw SpinarakAnimationIdle dw AriadosAnimationIdle dw CrobatAnimationIdle dw ChinchouAnimationIdle dw LanturnAnimationIdle dw PichuAnimationIdle dw CleffaAnimationIdle dw IgglybuffAnimationIdle dw TogepiAnimationIdle dw TogeticAnimationIdle dw NatuAnimationIdle dw XatuAnimationIdle dw MareepAnimationIdle dw FlaaffyAnimationIdle dw AmpharosAnimationIdle dw BellossomAnimationIdle dw MarillAnimationIdle dw AzumarillAnimationIdle dw SudowoodoAnimationIdle dw PolitoedAnimationIdle dw HoppipAnimationIdle dw SkiploomAnimationIdle dw JumpluffAnimationIdle dw AipomAnimationIdle dw SunkernAnimationIdle dw SunfloraAnimationIdle dw YanmaAnimationIdle dw WooperAnimationIdle dw QuagsireAnimationIdle dw EspeonAnimationIdle dw UmbreonAnimationIdle dw MurkrowAnimationIdle dw SlowkingAnimationIdle dw MisdreavusAnimationIdle dw UnownAnimationIdle dw WobbuffetAnimationIdle dw GirafarigAnimationIdle dw PinecoAnimationIdle dw ForretressAnimationIdle dw DunsparceAnimationIdle dw GligarAnimationIdle dw SteelixAnimationIdle dw SnubbullAnimationIdle dw GranbullAnimationIdle dw QwilfishAnimationIdle dw ScizorAnimationIdle dw ShuckleAnimationIdle dw HeracrossAnimationIdle dw SneaselAnimationIdle dw TeddiursaAnimationIdle dw UrsaringAnimationIdle dw SlugmaAnimationIdle dw MagcargoAnimationIdle dw SwinubAnimationIdle dw PiloswineAnimationIdle dw CorsolaAnimationIdle dw RemoraidAnimationIdle dw OctilleryAnimationIdle dw DelibirdAnimationIdle dw MantineAnimationIdle dw SkarmoryAnimationIdle dw HoundourAnimationIdle dw HoundoomAnimationIdle dw KingdraAnimationIdle dw PhanpyAnimationIdle dw DonphanAnimationIdle dw Porygon2AnimationIdle dw StantlerAnimationIdle dw SmeargleAnimationIdle dw TyrogueAnimationIdle dw HitmontopAnimationIdle dw SmoochumAnimationIdle dw ElekidAnimationIdle dw MagbyAnimationIdle dw MiltankAnimationIdle dw BlisseyAnimationIdle dw RaikouAnimationIdle dw EnteiAnimationIdle dw SuicuneAnimationIdle dw LarvitarAnimationIdle dw PupitarAnimationIdle dw TyranitarAnimationIdle dw LugiaAnimationIdle dw HoOhAnimationIdle dw CelebiAnimationIdle
source/libgela/gela-hash-crc-b16.adb
faelys/gela-asis
4
21788
<reponame>faelys/gela-asis ------------------------------------------------------------------------------ -- G E L A A S I S -- -- ASIS implementation for Gela project, a portable Ada compiler -- -- http://gela.ada-ru.org -- -- - - - - - - - - - - - - - - - -- -- Read copyright and license at the end of this file -- ------------------------------------------------------------------------------ -- $Revision: 209 $ $Date: 2013-11-30 21:03:24 +0200 (Сб., 30 нояб. 2013) $ with Ada.Unchecked_Conversion; package body Gela.Hash.CRC.b16 is Keys : constant array (CRC16 range 0 .. 255) of CRC16 := (0, 4129, 8258, 12387, 16516, 20645, 24774, 28903, 33032, 37161, 41290, 45419, 49548, 53677, 57806, 61935, 4657, 528, 12915, 8786, 21173, 17044, 29431, 25302, 37689, 33560, 45947, 41818, 54205, 50076, 62463, 58334, 9314, 13379, 1056, 5121, 25830, 29895, 17572, 21637, 42346, 46411, 34088, 38153, 58862, 62927, 50604, 54669, 13907, 9842, 5649, 1584, 30423, 26358, 22165, 18100, 46939, 42874, 38681, 34616, 63455, 59390, 55197, 51132, 18628, 22757, 26758, 30887, 2112, 6241, 10242, 14371, 51660, 55789, 59790, 63919, 35144, 39273, 43274, 47403, 23285, 19156, 31415, 27286, 6769, 2640, 14899, 10770, 56317, 52188, 64447, 60318, 39801, 35672, 47931, 43802, 27814, 31879, 19684, 23749, 11298, 15363, 3168, 7233, 60846, 64911, 52716, 56781, 44330, 48395, 36200, 40265, 32407, 28342, 24277, 20212, 15891, 11826, 7761, 3696, 65439, 61374, 57309, 53244, 48923, 44858, 40793, 36728, 37256, 33193, 45514, 41451, 53516, 49453, 61774, 57711, 4224, 161, 12482, 8419, 20484, 16421, 28742, 24679, 33721, 37784, 41979, 46042, 49981, 54044, 58239, 62302, 689, 4752, 8947, 13010, 16949, 21012, 25207, 29270, 46570, 42443, 38312, 34185, 62830, 58703, 54572, 50445, 13538, 9411, 5280, 1153, 29798, 25671, 21540, 17413, 42971, 47098, 34713, 38840, 59231, 63358, 50973, 55100, 9939, 14066, 1681, 5808, 26199, 30326, 17941, 22068, 55628, 51565, 63758, 59695, 39368, 35305, 47498, 43435, 22596, 18533, 30726, 26663, 6336, 2273, 14466, 10403, 52093, 56156, 60223, 64286, 35833, 39896, 43963, 48026, 19061, 23124, 27191, 31254, 2801, 6864, 10931, 14994, 64814, 60687, 56684, 52557, 48554, 44427, 40424, 36297, 31782, 27655, 23652, 19525, 15522, 11395, 7392, 3265, 61215, 65342, 53085, 57212, 44955, 49082, 36825, 40952, 28183, 32310, 20053, 24180, 11923, 16050, 3793, 7920); type Byte_Array is array (Natural range <>) of Interfaces.Unsigned_8; procedure Update (This : in out Hasher; Value : in Byte_Array); ------------ -- Update -- ------------ procedure Update (This : in out Hasher; Value : in String) is subtype C_Array is Byte_Array (1 .. Value'Size / Interfaces.Unsigned_8'Size); function To_Array is new Ada.Unchecked_Conversion (String, C_Array); begin Update (This, To_Array (Value)); end Update; ----------------- -- Wide_Update -- ----------------- procedure Wide_Update (This : in out Hasher; Value : in Wide_String) is subtype C_Array is Byte_Array (1 .. Value'Size / Interfaces.Unsigned_8'Size); function To_Array is new Ada.Unchecked_Conversion (Wide_String, C_Array); begin Update (This, To_Array (Value)); end Wide_Update; ---------------------- -- Wide_Wide_Update -- ---------------------- procedure Wide_Wide_Update (This : in out Hasher; Value : in Wide_Wide_String) is subtype C_Array is Byte_Array (1 .. Value'Size / Interfaces.Unsigned_8'Size); function To_Array is new Ada.Unchecked_Conversion (Wide_Wide_String, C_Array); begin Update (This, To_Array (Value)); end Wide_Wide_Update; ------------ -- Update -- ------------ procedure Update (This : in out Hasher; Value : in Ada.Streams.Stream_Element_Array) is subtype C_Array is Byte_Array (1 .. Value'Size / Interfaces.Unsigned_8'Size); function To_Array is new Ada.Unchecked_Conversion (Ada.Streams.Stream_Element_Array, C_Array); begin Update (This, To_Array (Value)); end Update; ------------ -- Result -- ------------ function Result (This : in Hasher) return CRC16 is begin return This.Cm_Reg; end Result; -- Calculate -- function Calculate (Value : in String) return CRC16 is H : Hasher; begin Update (H, Value); return Result (H); end Calculate; -- Wide_Calculate -- function Wide_Calculate (Value : in Wide_String) return CRC16 is H : Hasher; begin Wide_Update (H, Value); return Result (H); end Wide_Calculate; -- Wide_Wide_Calculate -- function Wide_Wide_Calculate (Value : in Wide_Wide_String) return CRC16 is H : Hasher; begin Wide_Wide_Update (H, Value); return Result (H); end Wide_Wide_Calculate; -- Calculate -- function Calculate (Value : in Ada.Streams.Stream_Element_Array) return CRC16 is H : Hasher; begin Update (H, Value); return Result (H); end Calculate; -- To_Hash -- function To_Hash (T : in CRC16) return Hash_Type is begin return Hash_Type (T); end To_Hash; -- Calculate -- function Calculate (Value : in String) return Hash_Type is begin return To_Hash (Calculate (Value)); end Calculate; -- Wide_Calculate -- function Wide_Calculate (Value : in Wide_String) return Hash_Type is begin return To_Hash (Wide_Calculate (Value)); end Wide_Calculate; -- Calculate -- function Wide_Wide_Calculate (Value : in Wide_Wide_String) return Hash_Type is begin return To_Hash (Wide_Wide_Calculate (Value)); end Wide_Wide_Calculate; -- Calculate -- function Calculate (Value : in Ada.Streams.Stream_Element_Array) return Hash_Type is begin return To_Hash (Calculate (Value)); end Calculate; ------------ -- Update -- ------------ procedure Update (This : in out Hasher; Value : in Byte_Array) is use Interfaces; Reg : CRC16 := This.Cm_Reg; begin This.Length := This.Length + Value'Length; if This.Length > Maximum_Length then raise Maximum_Length_Error; end if; for Index in Value'Range loop Reg := Shift_Left (Reg, 8) xor Keys (Shift_Right (Reg, 8) xor CRC16 (Value (Index))); end loop; This.Cm_Reg := Reg; end Update; end Gela.Hash.CRC.b16; ------------------------------------------------------------------------------ -- Copyright (c) 2006, <NAME> -- 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. -- -- 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. ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- Copyright (c) 2006-2013, <NAME> -- 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 <NAME>, IE 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. ------------------------------------------------------------------------------
Math/NumberTheory/Product/Nat/Properties.agda
rei1024/agda-misc
3
8010
{-# OPTIONS --without-K --safe #-} module Math.NumberTheory.Product.Nat.Properties where open import Data.Nat.Properties open import Math.NumberTheory.Product.Generic.Properties -- TODO rename _≈_ to _≡_ open CommutativeMonoidProductProperties *-1-commutativeMonoid public
Chapter2/#2.agda
CodaFi/HoTT-Exercises
0
3082
module #2 where open import Relation.Binary.PropositionalEquality open import #1 {- Exercise 2.2. Show that the three equalities of proofs constructed in the previous exercise form a commutative triangle. In other words, if the three definitions of concatenation are denoted by (p ∘ q), (p ∘ q), and (p ∘ q), then the concatenated equality (p ∘ q) = (p ∘ q) = (p ∘ q) is equal to the equality (p ∘ q) = (p ∘ q). -} composite-commutative-triangle : ∀ {i} {A : Set i}{x y z : A} → (p : x ≡ y) (q : y ≡ z) → composite (composite=composite' p q) (composite'=composite'' p q) ≡ composite=composite'' p q composite-commutative-triangle refl refl = refl
3-mid/opengl/source/lean/model/opengl-model-hexagon-lit_colored_textured.adb
charlie5/lace
20
5071
with openGL.Geometry.lit_colored_textured, openGL.Primitive.indexed; package body openGL.Model.hexagon.lit_colored_textured is type Geometry_view is access all Geometry.lit_colored_textured.item'Class; --------- --- Forge -- function new_Hexagon (Radius : in Real; Face : in lit_colored_textured.Face) return View is Self : constant View := new Item; begin Self.Radius := Radius; Self.Face := Face; return Self; end new_Hexagon; -------------- --- Attributes -- overriding function to_GL_Geometries (Self : access Item; Textures : access Texture.name_Map_of_texture'Class; Fonts : in Font.font_id_Map_of_font) return Geometry.views is pragma unreferenced (Textures, Fonts); use Geometry.lit_colored_textured, Texture; the_Sites : constant hexagon.Sites := vertex_Sites (Self.Radius); the_Indices : aliased constant Indices := (1, 2, 3, 4, 5, 6, 7, 2); function new_Face (Vertices : in geometry.lit_colored_textured.Vertex_array) return Geometry_view is use Primitive; the_Geometry : constant Geometry_view := Geometry.lit_colored_textured.new_Geometry (texture_is_Alpha => False); the_Primitive : constant Primitive.indexed.view := Primitive.indexed.new_Primitive (triangle_Fan, the_Indices); begin the_Geometry.Vertices_are (Vertices); the_Geometry.add (Primitive.view (the_Primitive)); return the_Geometry; end new_Face; upper_Face : Geometry_view; begin -- Upper Face -- declare the_Vertices : constant Geometry.lit_colored_textured.Vertex_array := (1 => (Site => (0.0, 0.0, 0.0), Normal => Normal, Color => Self.Face.center_Color, Coords => (0.0, 0.0)), 2 => (Site => the_Sites (1), Normal => Normal, Color => Self.Face.Colors (1), Coords => (0.0, 0.0)), 3 => (Site => the_Sites (2), Normal => Normal, Color => Self.Face.Colors (2), Coords => (1.0, 0.0)), 4 => (Site => the_Sites (3), Normal => Normal, Color => Self.Face.Colors (3), Coords => (1.0, 1.0)), 5 => (Site => the_Sites (4), Normal => Normal, Color => Self.Face.Colors (4), Coords => (0.0, 1.0)), 6 => (Site => the_Sites (5), Normal => Normal, color => Self.Face.Colors (5), Coords => (0.0, 1.0)), 7 => (Site => the_Sites (6), Normal => Normal, Color => Self.Face.Colors (6), Coords => (0.0, 1.0))); begin upper_Face := new_Face (Vertices => the_Vertices); if Self.Face.Texture /= null_Object then upper_Face.Texture_is (Self.Face.Texture); end if; end; return (1 => upper_Face.all'Access); end to_GL_Geometries; end openGL.Model.hexagon.lit_colored_textured;
programs/oeis/236/A236840.asm
neoneye/loda
22
92233
<filename>programs/oeis/236/A236840.asm ; A236840: n minus number of runs in the binary expansion of n: a(n) = n - A005811(n). ; 0,0,0,2,2,2,4,6,6,6,6,8,10,10,12,14,14,14,14,16,16,16,18,20,22,22,22,24,26,26,28,30,30,30,30,32,32,32,34,36,36,36,36,38,40,40,42,44,46,46,46,48,48,48,50,52,54,54,54,56,58,58,60,62,62,62,62,64,64,64,66,68,68,68,68,70,72,72,74,76,76,76,76,78,78,78,80,82,84,84,84,86,88,88,90,92,94,94,94,96 lpb $0 add $1,$2 mov $2,$0 div $0,2 sub $2,$0 div $2,2 lpe mul $1,2 mov $0,$1
programs/oeis/172/A172486.asm
neoneye/loda
22
23380
<reponame>neoneye/loda ; A172486: Number of prime knots up to nine crossings with determinant 2n+1 and signature 6. ; 0,1,0,1,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,1 add $0,28 mov $1,1 mov $2,$0 gcd $2,120 bin $1,$2 mov $0,$1
src/commands.ads
bracke/websitegenerator
1
13247
<reponame>bracke/websitegenerator<gh_stars>1-10 with Version; with CLIC.Subcommand; private with CLIC.Subcommand.Instance; private with Ada.Text_IO; private with CLIC.TTY; private with GNAT.OS_Lib; with Templates_Parser; package Commands is Translations : Templates_Parser.Translate_Set; Wrong_Command_Arguments : exception; Child_Failed : exception; -- Used to notify that a subprocess completed with non-zero error Command_Failed : exception; -- Signals "normal" command completion with failure -- (i.e., no need to print stack trace). ------------- -- Execute -- ------------- procedure Execute; -- Entry point into WebsiteGenerator, -- will parse the command line and proceed as needed. ------------- -- Command -- ------------- type Command is abstract limited new CLIC.Subcommand.Command with private; -- This type encapsulates configuration and execution of a specific -- command. private type Command is abstract limited new CLIC.Subcommand.Command with null record; procedure Set_Global_Switches (Config : in out CLIC.Subcommand.Switches_Configuration); package Sub_Cmd is new CLIC.Subcommand.Instance (Main_Command_Name => "websitegenerator", Version => Version.Current, Put => Ada.Text_IO.Put, Put_Line => Ada.Text_IO.Put_Line, Put_Error => Ada.Text_IO.Put_Line, Error_Exit => GNAT.OS_Lib.OS_Exit, Set_Global_Switches => Set_Global_Switches, TTY_Chapter => CLIC.TTY.Bold, TTY_Description => CLIC.TTY.Description, TTY_Version => CLIC.TTY.Version, TTY_Underline => CLIC.TTY.Underline, TTY_Emph => CLIC.TTY.Emph); end Commands;
test/asset/agda-stdlib-1.0/Data/ReflexiveClosure.agda
omega12345/agda-mode
0
5770
<filename>test/asset/agda-stdlib-1.0/Data/ReflexiveClosure.agda ------------------------------------------------------------------------ -- The Agda standard library -- -- Reflexive closures -- -- This module is DEPRECATED. Please use the -- Relation.Binary.Construct.Closure.Reflexive module directly. ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} module Data.ReflexiveClosure where open import Relation.Binary.Construct.Closure.Reflexive public
src/frontend/Experimental_Ada_ROSE_Connection/parser/ada_main/source/run_parser_adapter.adb
ouankou/rose
488
24202
with Ada.Command_Line; with Ada.Text_IO; with GNAT.Command_Line; with GNAT.OS_Lib; with GNAT.Strings; with Asis_Adapter.Tool; procedure Run_Parser_Adapter is package ACL renames Ada.Command_Line; package GCL renames GNAT.Command_Line; type Options_Record is record -- Initialized Config : GCL.Command_Line_Configuration; -- Initialized Debug : aliased Boolean := False; File_Name : aliased GNAT.Strings.String_Access; -- Initialized GNAT_Home : aliased GNAT.Strings.String_Access; -- Initialized AsisArgs : aliased GNAT.Strings.String_Access; -- Initialized Output_Dir : aliased GNAT.Strings.String_Access; -- Initialized Process_Predefined_Units : aliased Boolean := False; Process_Implementation_Units : aliased Boolean := False; end record; Options : aliased Options_Record; -- Initialized Tool : Asis_Adapter.Tool.Class; -- Initialized procedure Log (Message : in String; Debug : in Boolean) is begin if Debug then Ada.Text_Io.Put_Line ("Run_Asis_Adapter: " & Message); end if; end; procedure Get_Options is begin GCL.Define_Switch (Options.Config, Options.Debug'Access, "-d", Long_Switch => "--debug", Help => "Output debug information"); GCL.Define_Switch (Options.Config, Options.File_Name'Access, "-f:", Long_Switch => "--file=", Help => "File to process"); GCL.Define_Switch (Options.Config, Options.Gnat_Home'Access, "-g:", Long_Switch => "--gnat_home=", Help => "GNAT home directory"); GCL.Define_Switch (Options.Config, Options.AsisArgs'Access, "-a:", Long_Switch => "--asis_arg=", Help => "ASIS Argument"); GCL.Define_Switch (Options.Config, Options.Output_Dir'Access, "-o:", Long_Switch => "--output_dir=", Help => "Output directory"); GCL.Define_Switch (Options.Config, Options.Process_Predefined_Units'Access, "-p", Long_Switch => "--process_predefined_units", Help =>"Process Ada predefined language environment units"); GCL.Define_Switch (Options.Config, Options.Process_Implementation_Units'Access, "-i", Long_Switch => "--process_implementation_units", Help =>"Process implementation specific library units"); GCL.Getopt (Options.Config); exception when X : GNAT.Command_Line.Exit_From_Command_Line => Log ("*** GNAT.Command_Line raised Exit_From_Command_Line. Program will exit now.", Options.Debug); raise; end Get_Options; procedure asis_adapterinit; pragma Import (C, asis_adapterinit); procedure asis_adapterfinal; pragma Import (C, asis_adapterfinal); begin Get_Options; Log ("BEGIN", Options.Debug); asis_adapterinit; Tool.Process (File_Name => Options.File_Name.all, Output_Dir => Options.Output_Dir.all, GNAT_Home => Options.GNAT_Home.all, AsisArgs => Options.AsisArgs.all, Process_Predefined_Units => Options.Process_Predefined_Units, Process_Implementation_Units => Options.Process_Implementation_Units, Debug => Options.Debug); asis_adapterfinal; Log ("END", Options.Debug); end Run_Parser_Adapter;
Etapa 01/Aula 03 - Registradores e Instr. MOV/codes/a03e03.asm
bellorini/unioeste
6
407
; Aula 03 - Registradores e MOV ; arquivo: a03e03.asm ; objetivo: acesso aos dados dos registradores e transferencias ; nasm -f elf64 a03e03.asm ; ld a03e03.o -o a03e03.x section .data v1: dq 0x1111111122334455 v2: dq 0x0000000000000000 v3: dq 0x0000000000000000 section .text global _start _start: pt1: mov al , [v1] mov ebx, [v1] mov rcx, [v1] pt2: mov [v2], al mov [v2], ebx mov [v2], rcx pt3: mov al , 0x10 mov ebx, 0x20202020 mov rcx, 0x3030303030303030 pt4: mov byte [v3], 0x10 mov word [v3], 0x1515 mov dword [v3], 0x20202020 fim: mov rax, 60 mov rdi, 0 syscall
programs/oeis/319/A319697.asm
jmorken/loda
1
96403
; A319697: Sum of even squarefree divisors of n. ; 0,2,0,2,0,8,0,2,0,12,0,8,0,16,0,2,0,8,0,12,0,24,0,8,0,28,0,16,0,48,0,2,0,36,0,8,0,40,0,12,0,64,0,24,0,48,0,8,0,12,0,28,0,8,0,16,0,60,0,48,0,64,0,2,0,96,0,36,0,96,0,8,0,76,0,40,0,112,0,12,0,84,0,64,0,88,0,24,0,48,0,48,0,96,0,8,0,16,0,12,0,144,0,28,0,108,0,8,0,144,0,16,0,160,0,60,0,120,0,48,0,124,0,64,0,64,0,2,0,168,0,96,0,136,0,36,0,192,0,96,0,144,0,8,0,148,0,76,0,48,0,40,0,192,0,112,0,160,0,12,0,8,0,84,0,168,0,64,0,216,0,88,0,240,0,24,0,180,0,48,0,224,0,48,0,256,0,96,0,240,0,8,0,196,0,16,0,96,0,12,0,204,0,144,0,208,0,28,0,384,0,108,0,216,0,8,0,220,0,144,0,304,0,16,0,228,0,160,0,288,0,60,0,112,0,120,0,288,0,48,0,24,0,124,0,336,0,64,0,12 mov $8,$0 mov $10,2 lpb $10 clr $0,8 mov $0,$8 sub $10,1 add $0,$10 sub $0,1 mov $5,$0 mov $7,$0 add $7,1 lpb $7 mov $0,$5 sub $7,2 sub $0,$7 cal $0,48250 ; Sum of squarefree divisors of n. add $6,$0 lpe mov $1,$6 mov $11,$10 lpb $11 mov $9,$1 sub $11,1 lpe lpe lpb $8 mov $8,0 sub $9,$1 lpe mov $1,$9 div $1,3 mul $1,2
Tradutor/Arquivos_teste/Fibonacci.asm
PedroAcA/SB_T2_Bruno
0
20906
;Acho que esse fibonacci ta errado (nao deu para copiar o exemplo do slide do bruno direito) SECTION TEXT COPY ZERO,OLDER COPY ONE,OLD INPUT LIMIT OUTPUT OLD FRONT: LOAD OLDER ADD OLD STORE NEW SUB LIMIT JMPP FINAL OUTPUT NEW COPY OLD,OLDER COPY NEW,OLD JMP FRONT FINAL: OUTPUT LIMIT ADD ZERO SUB ONE STOP SECTION DATA ZERO: CONST 0 ONE: CONST 1 OLDER: SPACE OLD: SPACE NEW: SPACE LIMIT: SPACE
tests/src/maths_test.adb
Fabien-Chouteau/GESTE
13
4531
with Ada.Text_IO; use Ada.Text_IO; with GESTE.Maths_Types; use GESTE.Maths_Types; with GESTE.Maths; use GESTE.Maths; procedure Maths_Test is Sqrt_Values : array (Natural range <>) of Value := (0.0, 1.0, 1.00001, 2.0, 4.0, 25.0, 80.0, 81.0, 100.0); Cos_Values : array (Natural range <>) of Value := (0.0, Pi, Pi / 2.0, -Pi / 2.0, Pi / 3.0, Pi * 10.0); Sin_Values : array (Natural range <>) of Value := (0.0, Pi, Pi / 2.0, -Pi / 2.0, Pi / 6.0, Pi * 10.0); To_Rad_Values : array (Natural range <>) of Value := (0.0, 180.0, 360.0); To_Degrees_Values : array (Natural range <>) of Value := (0.0, Pi, Pi * 2.0, Pi * 10.0); begin Put_Line ("Value'First'Img => " & Value'First'Img); Put_Line ("Value'Last'Img => " & Value'Last'Img); Put_Line ("Value'Small'Img => " & Value'Small'Img); for X of Sqrt_Values loop Put_Line ("Sqrt (" & X'Img & ") => " & Sqrt (X)'Img); end loop; for X of Cos_Values loop Put_Line ("Cos (" & X'Img & ") => " & Cos (X)'Img); end loop; for X of Sin_Values loop Put_Line ("Sin (" & X'Img & ") => " & Sin (X)'Img); end loop; for X of To_Rad_Values loop Put_Line ("To_Rad (" & X'Img & ") => " & To_Rad (X)'Img); end loop; for X of To_Degrees_Values loop Put_Line ("To_Degrees (" & X'Img & ") => " & To_Degrees (X)'Img); end loop; Put_Line ("Magnitude (Vect (0.0, 5.0)) =>" & Magnitude (Vect'(0.0, 5.0))'Img); Put_Line ("Magnitude (Vect (5.0, 0.0)) =>" & Magnitude (Vect'(5.0, 0.0))'Img); Put_Line ("Magnitude (Vect (5.0, 5.0)) =>" & Magnitude (Vect'(5.0, 5.0))'Img); end Maths_Test;
data/mapHeaders/mtmoon2.asm
adhi-thirumala/EvoYellow
16
179292
<reponame>adhi-thirumala/EvoYellow MtMoon2_h: db CAVERN ; tileset db MT_MOON_2_HEIGHT, MT_MOON_2_WIDTH ; dimensions (y, x) dw MtMoon2Blocks, MtMoon2TextPointers, MtMoon2Script ; blocks, texts, scripts db $00 ; connections dw MtMoon2Object ; objects