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
virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/oldgrammars/OpTemplate.g4
msmygit/nosqlbench
115
7701
grammar OpTemplate; // https://www.youtube.com/watch?v=eW4WFgRtFeY opTemplate : (modifiers)? template; modifiers : '(' modifier? (',' modifier )* ')'; modifier : mname (':'|'=') mval; mname: ID; template: ( ~('\n'|'\r')+ ) NEWLINE; ID: IDPART ('.' IDPART)* ; IDPART: ( ( [a-zA-Z] [0-9a-zA-Z_]* ) | ( [a-zA-Z] [0-9a-zA-Z_]* '-' [0-9a-zA-Z_]) ) ; NEWLINE : '\r' '\n' | '\n' | '\r'; mval : ( floatValue | doubleValue | integerValue | longValue | stringValue | booleanValue); stringValue : SSTRING_LITERAL | DSTRING_LITERAL ; longValue: LONG; doubleValue: DOUBLE; integerValue: INTEGER; floatValue: FLOAT; booleanValue: BOOLEAN; LONG : '-'? INT ('l'|'L') ; DOUBLE : ('-'? INT '.' '0'* INT EXP? | '-'? INT EXP | '-'? INT ) ('d'|'D') ; INTEGER : '-'? INT ; FLOAT : '-'? INT '.' ZINT EXP? // 1.35, 1.35E-9, 0.3, -4.5 | '-'? INT EXP // 1e10 -3e4 | '-'? INT // -3, 45 ; BOOLEAN : 'true' | 'false'; fragment INT : '0' | [1-9] [0-9]* ; // no leading zeros fragment ZINT : [0-9]* ; // leading zeroes fragment EXP : [Ee] [+\-]? INT ; SSTRING_LITERAL : '\'' (~('\'' | '\\' | '\r' | '\n') | '\\' ('\'' | '\\' | . ))* '\''; DSTRING_LITERAL : '"' (~('"' | '\\' | '\r' | '\n') | '\\' ('"' | '\\' | .))* '"'; WS : [\u000C \t\n]+ -> channel(HIDDEN);
mc-sema/validator/x86_64/tests/SHL16r1.asm
randolphwong/mcsema
2
93044
<reponame>randolphwong/mcsema BITS 64 ;TEST_FILE_META_BEGIN ;TEST_TYPE=TEST_F ;TEST_IGNOREFLAGS=FLAG_AF|FLAG_OF ;TEST_FILE_META_END ; SHL16r1 mov ax, 0x7 ;TEST_BEGIN_RECORDING shl ax, 0x1 ;TEST_END_RECORDING
programs/oeis/146/A146079.asm
karttu/loda
1
21614
<filename>programs/oeis/146/A146079.asm ; A146079: Period 9: repeat 2,4,8,5,4,5,8,4,2. ; 2,4,8,5,4,5,8,4,2,2,4,8,5,4,5,8,4,2,2,4,8,5,4,5,8,4,2,2,4,8,5,4,5,8,4,2,2,4,8,5,4,5,8,4,2,2,4,8,5,4,5,8,4,2,2,4,8,5,4,5,8,4,2,2,4,8,5,4,5,8,4,2,2,4,8,5,4,5,8,4,2,2,4,8,5,4,5,8,4,2,2,4,8,5,4,5,8,4,2,2,4,8,5,4,5 mov $1,$0 add $0,1 mul $1,$0 mod $1,9 add $1,2
Engine/SpecParser.g4
kaby76/Piggy
31
5681
// Piggy parser grammar--turns DFS tree visitors for conversion inside out! grammar SpecParser; options { tokenVocab=SpecLexer; } spec : c* using* template* (application |) EOF ; application : APPLICATION apply_pass* SEMI ; apply_pass : ID DOT ID ; c : c_file | c_option ; /* Specifies an input file for the Clang compiler. Use forward slashes for directory * delimiters. * Example: * import_file 'c:/Program Files/NVIDIA GPU Computing Toolkit/cuda/v10.0/include/cuda.h'; */ c_file : C_FILE StringLiteral SEMI ; /* Specifies an additional Clang compiler option. Use forward slashes for directory * delimiters. Use multiple times to specify more than one option. * Example: * compiler_options '--target=x86_64'; * compiler_options '-Ic:/Program Files/NVIDIA GPU Computing Toolkit/cuda/v10.0/include'; */ c_option : C_OPTION StringLiteral SEMI ; using : USING StringLiteral SEMI ; template : TEMPLATE ID extends LCURLY header init pass* RCURLY ; extends : COLON ID | ; header : HEADER code | ; init : INIT code | ; /* Specifies the pass for pattern matching. Templates are associated with a * pass, matched only for that pass. When the next pass occurs, the pattern matcher * is output and reset. * It is not required. * Example: * pass Enums; */ pass : PASS ID LCURLY pattern* RCURLY ; // Note: the regular expression grammar is based on that of Cameron. pattern : basic ; rexp : simple_rexp (OR simple_rexp)* ; simple_rexp : basic_rexp ; basic_rexp : star_rexp | plus_rexp | elementary_rexp ; star_rexp : elementary_rexp STAR ; plus_rexp : elementary_rexp PLUS ; elementary_rexp : group_rexp | basic ; group_rexp : OPEN_RE rexp CLOSE_RE ; basic : simple_basic | kleene_star_basic ; simple_basic : (NOT |) OPEN_PAREN id_or_star_or_empty more* CLOSE_PAREN ; kleene_star_basic : OPEN_KLEENE_STAR_PAREN id_or_star_or_empty more* CLOSE_KLEENE_STAR_PAREN ; id_or_star_or_empty : ID | STAR | /* epsilon */ ; more : rexp | text | code | attr | grammar_sym ; grammar_sym : OPEN_ANGLE ID CLOSE_ANGLE ; code : LDCURLY OTHER* RDCURLY ; text : LANG OTHER_ANG* RANG ; attr : ID EQ (StringLiteral | STAR) | NOT ID ;
ada/src/afrl/cmasi/afrl-cmasi.ads
joffreyhuguet/LmcpGen
0
25278
with avtas.lmcp.object; use avtas.lmcp.object; with avtas.lmcp.types; use avtas.lmcp.types; package afrl.cmasi is end afrl.cmasi;
cpuid.data.asm
BernardTatin/asm_required
0
7521
<reponame>BernardTatin/asm_required<filename>cpuid.data.asm ; ---------------------------------------------------------------------- ; cpuid.data.asm ; ; A CPUID ; To assemble and run: ; ; nasm -felf64 cpuid.asm \ ; && ld -o cpuid cpuid.o && ./cpuid ; ---------------------------------------------------------------------- %define DATA %include "cpuid.inc.asm" ; ---------------------------------------------------------------------- section .data title db 'A simple CPUID', 10 Ltitle dq $-title model db 'Model: ' efmodel db '00.' ; bits 20-27 / 8 eemodel db '0.' ; bits 16-19 / 4 ptmodel db '0.' ; bits 12-13 / 2 fmodel db '0.' ; bits 8-11 / 4 mmodel db '0.' ; bits 4- 7 / 4 smodel db '0' ; bits 0- 3 / 4 db 10 Lmodel dq $-model hexdump db '0123456789abcdef'
src/Conat.agda
nad/equality
3
5801
------------------------------------------------------------------------ -- Conatural numbers ------------------------------------------------------------------------ {-# OPTIONS --without-K --sized-types #-} open import Equality module Conat {c⁺} (eq : ∀ {a p} → Equality-with-J a p c⁺) where open Derived-definitions-and-properties eq open import Logical-equivalence using (_⇔_) open import Prelude hiding (_+_; _∸_; _*_) open import Prelude.Size open import Function-universe eq hiding (_∘_) open import Nat eq as Nat using (_≤_) ------------------------------------------------------------------------ -- The type -- Conats. mutual data Conat (i : Size) : Type where zero : Conat i suc : Conat′ i → Conat i record Conat′ (i : Size) : Type where coinductive field force : {j : Size< i} → Conat j open Conat′ public ------------------------------------------------------------------------ -- Bisimilarity -- Bisimilarity is only defined for fully defined conatural numbers -- (of size ∞). mutual infix 4 [_]_∼_ [_]_∼′_ data [_]_∼_ (i : Size) : Conat ∞ → Conat ∞ → Type where zero : [ i ] zero ∼ zero suc : ∀ {m n} → [ i ] force m ∼′ force n → [ i ] suc m ∼ suc n record [_]_∼′_ (i : Size) (m n : Conat ∞) : Type where coinductive field force : {j : Size< i} → [ j ] m ∼ n open [_]_∼′_ public -- Bisimilarity is an equivalence relation. reflexive-∼ : ∀ {i} n → [ i ] n ∼ n reflexive-∼ zero = zero reflexive-∼ (suc n) = suc λ { .force → reflexive-∼ (force n) } symmetric-∼ : ∀ {i m n} → [ i ] m ∼ n → [ i ] n ∼ m symmetric-∼ zero = zero symmetric-∼ (suc p) = suc λ { .force → symmetric-∼ (force p) } transitive-∼ : ∀ {i m n o} → [ i ] m ∼ n → [ i ] n ∼ o → [ i ] m ∼ o transitive-∼ zero zero = zero transitive-∼ (suc p) (suc q) = suc λ { .force → transitive-∼ (force p) (force q) } -- Equational reasoning combinators. infix -1 finally-∼ _∎∼ infixr -2 step-∼ step-≡∼ _≡⟨⟩∼_ _∎∼ : ∀ {i} n → [ i ] n ∼ n _∎∼ = reflexive-∼ -- For an explanation of why step-∼ is defined in this way, see -- Equality.step-≡. step-∼ : ∀ {i} m {n o} → [ i ] n ∼ o → [ i ] m ∼ n → [ i ] m ∼ o step-∼ _ n∼o m∼n = transitive-∼ m∼n n∼o syntax step-∼ m n∼o m∼n = m ∼⟨ m∼n ⟩ n∼o step-≡∼ : ∀ {i} m {n o} → [ i ] n ∼ o → m ≡ n → [ i ] m ∼ o step-≡∼ {i} _ n∼o m≡n = subst ([ i ]_∼ _) (sym m≡n) n∼o syntax step-≡∼ m n∼o m≡n = m ≡⟨ m≡n ⟩∼ n∼o _≡⟨⟩∼_ : ∀ {i} m {n} → [ i ] m ∼ n → [ i ] m ∼ n _ ≡⟨⟩∼ m∼n = m∼n finally-∼ : ∀ {i} m n → [ i ] m ∼ n → [ i ] m ∼ n finally-∼ _ _ m∼n = m∼n syntax finally-∼ m n m∼n = m ∼⟨ m∼n ⟩∎ n ∎∼ ------------------------------------------------------------------------ -- Some operations -- The largest conatural number. infinity : ∀ {i} → Conat i infinity = suc λ { .force → infinity } mutual -- Turns natural numbers into conatural numbers. ⌜_⌝ : ∀ {i} → ℕ → Conat i ⌜ zero ⌝ = zero ⌜ suc n ⌝ = suc ⌜ n ⌝′ ⌜_⌝′ : ∀ {i} → ℕ → Conat′ i force ⌜ n ⌝′ = ⌜ n ⌝ -- ⌜_⌝ maps equal numbers to bisimilar numbers. ⌜⌝-cong : ∀ {i m n} → m ≡ n → [ i ] ⌜ m ⌝ ∼ ⌜ n ⌝ ⌜⌝-cong {m = m} {n} m≡n = ⌜ m ⌝ ≡⟨ cong ⌜_⌝ m≡n ⟩∼ ⌜ n ⌝ ∎∼ -- Truncated predecessor. pred : ∀ {i} {j : Size< i} → Conat i → Conat j pred zero = zero pred (suc n) = force n -- The pred function preserves bisimilarity. pred-cong : ∀ {n₁ n₂ i} {j : Size< i} → [ i ] n₁ ∼ n₂ → [ j ] pred n₁ ∼ pred n₂ pred-cong zero = zero pred-cong (suc p) = force p -- ⌜_⌝ is homomorphic with respect to pred. ⌜⌝-pred : ∀ n {i} → [ i ] ⌜ Nat.pred n ⌝ ∼ pred ⌜ n ⌝ ⌜⌝-pred zero = zero ∎∼ ⌜⌝-pred (suc n) = ⌜ n ⌝ ∎∼ -- Addition. infixl 6 _+_ _+_ : ∀ {i} → Conat i → Conat i → Conat i zero + n = n suc m + n = suc λ { .force → force m + n } -- Zero is a left and right identity of addition (up to bisimilarity). +-left-identity : ∀ {i} n → [ i ] zero + n ∼ n +-left-identity = reflexive-∼ +-right-identity : ∀ {i} n → [ i ] n + zero ∼ n +-right-identity zero = zero +-right-identity (suc n) = suc λ { .force → +-right-identity (force n) } -- Infinity is a left and right zero of addition (up to bisimilarity). +-left-zero : ∀ {i n} → [ i ] infinity + n ∼ infinity +-left-zero = suc λ { .force → +-left-zero } +-right-zero : ∀ {i} n → [ i ] n + infinity ∼ infinity +-right-zero zero = reflexive-∼ _ +-right-zero (suc n) = suc λ { .force → +-right-zero (force n) } -- Addition is associative. +-assoc : ∀ m {n o i} → [ i ] m + (n + o) ∼ (m + n) + o +-assoc zero = reflexive-∼ _ +-assoc (suc m) = suc λ { .force → +-assoc (force m) } mutual -- The successor constructor can be moved from one side of _+_ to the -- other. suc+∼+suc : ∀ {m n i} → [ i ] suc m + force n ∼ force m + suc n suc+∼+suc {m} {n} = suc m + force n ∼⟨ (suc λ { .force → reflexive-∼ _ }) ⟩ ⌜ 1 ⌝ + force m + force n ∼⟨ 1++∼+suc _ ⟩∎ force m + suc n ∎∼ 1++∼+suc : ∀ m {n i} → [ i ] ⌜ 1 ⌝ + m + force n ∼ m + suc n 1++∼+suc zero = suc λ { .force → reflexive-∼ _ } 1++∼+suc (suc _) = suc λ { .force → suc+∼+suc } -- Addition is commutative. +-comm : ∀ m {n i} → [ i ] m + n ∼ n + m +-comm zero {n} = zero + n ∼⟨ symmetric-∼ (+-right-identity _) ⟩∎ n + zero ∎∼ +-comm (suc m) {n} = suc m + n ∼⟨ (suc λ { .force → +-comm (force m) }) ⟩ ⌜ 1 ⌝ + n + force m ∼⟨ 1++∼+suc _ ⟩∎ n + suc m ∎∼ -- Addition preserves bisimilarity. infixl 6 _+-cong_ _+-cong_ : ∀ {i m₁ m₂ n₁ n₂} → [ i ] m₁ ∼ m₂ → [ i ] n₁ ∼ n₂ → [ i ] m₁ + n₁ ∼ m₂ + n₂ zero +-cong q = q suc p +-cong q = suc λ { .force → force p +-cong q } -- ⌜_⌝ is homomorphic with respect to addition. ⌜⌝-+ : ∀ m {n i} → [ i ] ⌜ m Prelude.+ n ⌝ ∼ ⌜ m ⌝ + ⌜ n ⌝ ⌜⌝-+ zero = reflexive-∼ _ ⌜⌝-+ (suc m) = suc λ { .force → ⌜⌝-+ m } -- Truncated subtraction of a natural number. infixl 6 _∸_ _∸_ : Conat ∞ → ℕ → Conat ∞ m ∸ zero = m zero ∸ suc n = zero suc m ∸ suc n = force m ∸ n -- Infinity is a left zero of _∸_ (up to bisimilarity). ∸-left-zero-infinity : ∀ {i} n → [ i ] infinity ∸ n ∼ infinity ∸-left-zero-infinity zero = reflexive-∼ _ ∸-left-zero-infinity (suc n) = ∸-left-zero-infinity n -- Zero is a left zero of _∸_ (up to bisimilarity). ∸-left-zero-zero : ∀ {i} n → [ i ] zero ∸ n ∼ zero ∸-left-zero-zero zero = reflexive-∼ _ ∸-left-zero-zero (suc n) = reflexive-∼ _ -- Zero is a right identity of subtraction (up to bisimilarity). ∸-right-identity : ∀ {i} n → [ i ] n ∸ zero ∼ n ∸-right-identity = reflexive-∼ -- Subtraction preserves bisimilarity and equality. infixl 6 _∸-cong_ _∸-cong_ : ∀ {i m₁ m₂ n₁ n₂} → [ ∞ ] m₁ ∼ m₂ → n₁ ≡ n₂ → [ i ] m₁ ∸ n₁ ∼ m₂ ∸ n₂ _∸-cong_ {m₁ = m₁} {m₂} {zero} {n₂} p eq = m₁ ∼⟨ p ⟩ m₂ ≡⟨⟩∼ m₂ ∸ zero ≡⟨ cong (_ ∸_) eq ⟩∼ m₂ ∸ n₂ ∎∼ _∸-cong_ {n₁ = suc n₁} {n₂} zero eq = zero ≡⟨⟩∼ zero ∸ suc n₁ ≡⟨ cong (_ ∸_) eq ⟩∼ zero ∸ n₂ ∎∼ _∸-cong_ {n₁ = suc n₁} {n₂} (suc {m = m₁} {n = m₂} p) eq = force m₁ ∸ n₁ ∼⟨ force p ∸-cong refl n₁ ⟩ force m₂ ∸ n₁ ≡⟨⟩∼ suc m₂ ∸ suc n₁ ≡⟨ cong (_ ∸_) eq ⟩∼ suc m₂ ∸ n₂ ∎∼ -- ⌜_⌝ is homomorphic with respect to subtraction. ⌜⌝-∸ : ∀ m n {i} → [ i ] ⌜ m Prelude.∸ n ⌝ ∼ ⌜ m ⌝ ∸ n ⌜⌝-∸ m zero = reflexive-∼ _ ⌜⌝-∸ zero (suc n) = reflexive-∼ _ ⌜⌝-∸ (suc m) (suc n) = ⌜⌝-∸ m n -- Multiplication. infixl 7 _*_ _*_ : ∀ {i} → Conat i → Conat i → Conat i zero * n = zero m * zero = zero suc m * suc n = suc λ { .force → n .force + m .force * suc n } -- One is a left and right identity of multiplication (up to -- bisimilarity). *-left-identity : ∀ {i} n → [ i ] ⌜ 1 ⌝ * n ∼ n *-left-identity zero = reflexive-∼ _ *-left-identity (suc n) = suc λ { .force → n .force + zero ∼⟨ +-right-identity _ ⟩ n .force ∎∼ } *-right-identity : ∀ {i} n → [ i ] n * ⌜ 1 ⌝ ∼ n *-right-identity zero = reflexive-∼ _ *-right-identity (suc n) = suc λ { .force → *-right-identity _ } -- Zero is a left and right zero of multiplication (up to -- bisimilarity). *-left-zero : ∀ {i n} → [ i ] zero * n ∼ zero *-left-zero = reflexive-∼ _ *-right-zero : ∀ {i n} → [ i ] n * zero ∼ zero *-right-zero {n = zero} = reflexive-∼ _ *-right-zero {n = suc n} = reflexive-∼ _ -- An unfolding lemma for multiplication. suc*∼+* : ∀ {m n i} → [ i ] suc m * n ∼ n + m .force * n suc*∼+* {m} {zero} = zero ∼⟨ symmetric-∼ *-right-zero ⟩ m .force * zero ∎∼ suc*∼+* {m} {suc n} = suc λ { .force → reflexive-∼ _ } -- Multiplication distributes over addition. *-+-distribˡ : ∀ m {n o i} → [ i ] m * (n + o) ∼ m * n + m * o *-+-distribˡ zero = reflexive-∼ _ *-+-distribˡ (suc m) {zero} {o} = reflexive-∼ _ *-+-distribˡ (suc m) {suc n} {o} = suc λ { .force → n .force + o + m .force * (suc n + o) ∼⟨ (_ ∎∼) +-cong *-+-distribˡ (m .force) ⟩ n .force + o + (m .force * suc n + m .force * o) ∼⟨ symmetric-∼ (+-assoc (n .force)) ⟩ n .force + (o + (m .force * suc n + m .force * o)) ∼⟨ (n .force ∎∼) +-cong +-assoc o ⟩ n .force + ((o + m .force * suc n) + m .force * o) ∼⟨ (n .force ∎∼) +-cong (+-comm o +-cong (_ ∎∼)) ⟩ n .force + ((m .force * suc n + o) + m .force * o) ∼⟨ (n .force ∎∼) +-cong symmetric-∼ (+-assoc (m .force * _)) ⟩ n .force + (m .force * suc n + (o + m .force * o)) ∼⟨ +-assoc (n .force) ⟩ n .force + m .force * suc n + (o + m .force * o) ∼⟨ (n .force + _ ∎∼) +-cong symmetric-∼ suc*∼+* ⟩ n .force + m .force * suc n + suc m * o ∎∼ } *-+-distribʳ : ∀ m {n o i} → [ i ] (m + n) * o ∼ m * o + n * o *-+-distribʳ zero = reflexive-∼ _ *-+-distribʳ (suc m) {n} {zero} = zero ∼⟨ symmetric-∼ *-right-zero ⟩ n * zero ∎∼ *-+-distribʳ (suc m) {n} {suc o} = suc λ { .force → o .force + (m .force + n) * suc o ∼⟨ (_ ∎∼) +-cong *-+-distribʳ (m .force) ⟩ o .force + (m .force * suc o + n * suc o) ∼⟨ +-assoc (o .force) ⟩ o .force + m .force * suc o + n * suc o ∎∼ } -- Multiplication is associative. *-assoc : ∀ m {n o i} → [ i ] m * (n * o) ∼ (m * n) * o *-assoc zero = reflexive-∼ _ *-assoc (suc m) {zero} = reflexive-∼ _ *-assoc (suc m) {suc n} {zero} = reflexive-∼ _ *-assoc (suc m) {suc n} {suc o} = suc λ { .force → o .force + n .force * suc o + m .force * (suc n * suc o) ∼⟨ symmetric-∼ (+-assoc (o .force)) ⟩ o .force + (n .force * suc o + m .force * (suc n * suc o)) ∼⟨ (o .force ∎∼) +-cong ((_ ∎∼) +-cong *-assoc (m .force)) ⟩ o .force + (n .force * suc o + (m .force * suc n) * suc o) ∼⟨ (o .force ∎∼) +-cong symmetric-∼ (*-+-distribʳ (n .force)) ⟩ o .force + (n .force + m .force * suc n) * suc o ∎∼ } -- Multiplication is commutative. *-comm : ∀ m {n i} → [ i ] m * n ∼ n * m *-comm zero {n} = zero ∼⟨ symmetric-∼ *-right-zero ⟩ n * zero ∎∼ *-comm (suc m) {zero} = reflexive-∼ _ *-comm (suc m) {suc n} = suc λ { .force → n .force + m .force * suc n ∼⟨ (_ ∎∼) +-cong *-comm (m .force) ⟩ n .force + suc n * m .force ∼⟨ (n .force ∎∼) +-cong suc*∼+* ⟩ n .force + (m .force + n .force * m .force) ∼⟨ +-assoc (n .force) ⟩ (n .force + m .force) + n .force * m .force ∼⟨ +-comm (n .force) +-cong *-comm _ ⟩ (m .force + n .force) + m .force * n .force ∼⟨ symmetric-∼ (+-assoc (m .force)) ⟩ m .force + (n .force + m .force * n .force) ∼⟨ (m .force ∎∼) +-cong symmetric-∼ suc*∼+* ⟩ m .force + suc m * n .force ∼⟨ (m .force ∎∼) +-cong *-comm (suc m) ⟩ m .force + n .force * suc m ∎∼ } -- An unfolding lemma for multiplication. *suc∼+* : ∀ {m n i} → [ i ] m * suc n ∼ m + m * n .force *suc∼+* {m} {n} = m * suc n ∼⟨ *-comm _ ⟩ suc n * m ∼⟨ suc*∼+* ⟩ m + n .force * m ∼⟨ (_ ∎∼) +-cong *-comm (n .force) ⟩ m + m * n .force ∎∼ -- Multiplication preserves bisimilarity. infixl 7 _*-cong_ _*-cong_ : ∀ {i m₁ m₂ n₁ n₂} → [ i ] m₁ ∼ m₂ → [ i ] n₁ ∼ n₂ → [ i ] m₁ * n₁ ∼ m₂ * n₂ zero *-cong _ = zero suc p *-cong zero = zero suc p *-cong suc q = suc λ { .force → q .force +-cong p .force *-cong suc q } -- ⌜_⌝ is homomorphic with respect to multiplication. ⌜⌝-* : ∀ m {n i} → [ i ] ⌜ m Prelude.* n ⌝ ∼ ⌜ m ⌝ * ⌜ n ⌝ ⌜⌝-* zero = reflexive-∼ _ ⌜⌝-* (suc m) {n} = ⌜ n Prelude.+ m Prelude.* n ⌝ ∼⟨ ⌜⌝-+ n ⟩ ⌜ n ⌝ + ⌜ m Prelude.* n ⌝ ∼⟨ reflexive-∼ _ +-cong ⌜⌝-* m ⟩ ⌜ n ⌝ + ⌜ m ⌝ * ⌜ n ⌝ ∼⟨ symmetric-∼ suc*∼+* ⟩ ⌜ suc m ⌝ * ⌜ n ⌝ ∎∼ ------------------------------------------------------------------------ -- Ordering -- [ ∞ ] m ≤ n means that m is less than or equal to n. mutual infix 4 [_]_≤_ [_]_≤′_ data [_]_≤_ (i : Size) : Conat ∞ → Conat ∞ → Type where zero : ∀ {n} → [ i ] zero ≤ n suc : ∀ {m n} → [ i ] force m ≤′ force n → [ i ] suc m ≤ suc n record [_]_≤′_ (i : Size) (m n : Conat ∞) : Type where coinductive field force : {j : Size< i} → [ j ] m ≤ n open [_]_≤′_ public -- [ ∞ ] m < n means that m is less than n (if n is finite). infix 4 [_]_<_ [_]_<_ : Size → Conat′ ∞ → Conat ∞ → Type [ i ] m < n = [ i ] suc m ≤ n -- Every conatural number is less than or equal to infinity. infix 4 _≤infinity _≤infinity : ∀ {i} n → [ i ] n ≤ infinity zero ≤infinity = zero suc n ≤infinity = suc λ { .force → force n ≤infinity } -- No natural number is greater than or equal to infinity. infinity≰⌜⌝ : ∀ n → ¬ [ ∞ ] infinity ≤ ⌜ n ⌝ infinity≰⌜⌝ zero () infinity≰⌜⌝ (suc n) (suc p) = infinity≰⌜⌝ n (force p) -- No number is less than zero. ≮0 : ∀ {n i} → ¬ [ i ] n < zero ≮0 () -- If a number is not bounded from above by any natural number, then -- it is bisimilar to infinity. ¬≤⌜⌝→∼∞ : ∀ {i} m → (∀ n → ¬ [ ∞ ] m ≤ ⌜ n ⌝) → [ i ] m ∼ infinity ¬≤⌜⌝→∼∞ zero zero≰ = ⊥-elim (zero≰ 0 zero) ¬≤⌜⌝→∼∞ (suc m) hyp = suc λ { .force → ¬≤⌜⌝→∼∞ (force m) λ n → [ ∞ ] force m ≤ ⌜ n ⌝ ↝⟨ (λ p → suc λ { .force → p }) ⟩ [ ∞ ] suc m ≤ ⌜ suc n ⌝ ↝⟨ hyp (suc n) ⟩□ ⊥ □ } -- The ordering relation is a partial order (with respect to -- bisimilarity). reflexive-≤ : ∀ {i} n → [ i ] n ≤ n reflexive-≤ zero = zero reflexive-≤ (suc n) = suc λ { .force → reflexive-≤ (force n) } transitive-≤ : ∀ {i m n o} → [ i ] m ≤ n → [ i ] n ≤ o → [ i ] m ≤ o transitive-≤ zero _ = zero transitive-≤ (suc p) (suc q) = suc λ { .force → transitive-≤ (force p) (force q) } antisymmetric-≤ : ∀ {i m n} → [ i ] m ≤ n → [ i ] n ≤ m → [ i ] m ∼ n antisymmetric-≤ zero zero = zero antisymmetric-≤ (suc p) (suc q) = suc λ { .force → antisymmetric-≤ (force p) (force q) } -- Bisimilarity is contained in the ordering relation. ∼→≤ : ∀ {i m n} → [ i ] m ∼ n → [ i ] m ≤ n ∼→≤ zero = zero ∼→≤ (suc p) = suc λ { .force → ∼→≤ (force p) } -- "Equational" reasoning combinators. infix -1 finally-≤ _∎≤ infixr -2 step-≤ step-∼≤ _≡⟨⟩≤_ _∎≤ : ∀ {i} n → [ i ] n ≤ n _∎≤ = reflexive-≤ step-≤ : ∀ {i} m {n o} → [ i ] n ≤ o → [ i ] m ≤ n → [ i ] m ≤ o step-≤ _ n≤o m≤n = transitive-≤ m≤n n≤o syntax step-≤ m n≤o m≤n = m ≤⟨ m≤n ⟩ n≤o step-∼≤ : ∀ {i} m {n o} → [ i ] n ≤ o → [ i ] m ∼ n → [ i ] m ≤ o step-∼≤ _ n≤o m∼n = step-≤ _ n≤o (∼→≤ m∼n) syntax step-∼≤ m n≤o m∼n = m ∼⟨ m∼n ⟩≤ n≤o _≡⟨⟩≤_ : ∀ {i} m {n} → [ i ] m ≤ n → [ i ] m ≤ n _ ≡⟨⟩≤ m≤n = m≤n finally-≤ : ∀ {i} m n → [ i ] m ≤ n → [ i ] m ≤ n finally-≤ _ _ m≤n = m≤n syntax finally-≤ m n m≤n = m ≤⟨ m≤n ⟩∎ n ∎≤ -- The ordering relation respects the ordering relation -- (contravariantly in the first argument). infix 4 _≤-cong-≤_ _≤-cong-≤_ : ∀ {m m′ n n′ i} → [ i ] m′ ≤ m → [ i ] n ≤ n′ → [ i ] m ≤ n → [ i ] m′ ≤ n′ _≤-cong-≤_ {m} {m′} {n} {n′} m≥m′ n≤n′ m≤n = m′ ≤⟨ m≥m′ ⟩ m ≤⟨ m≤n ⟩ n ≤⟨ n≤n′ ⟩ n′ ∎≤ -- A kind of preservation result for bisimilarity, ordering and -- logical equivalence. infix 4 _≤-cong-∼_ _≤-cong-∼_ : ∀ {m m′ n n′ i} → [ i ] m ∼ m′ → [ i ] n ∼ n′ → [ i ] m ≤ n ⇔ [ i ] m′ ≤ n′ m∼m′ ≤-cong-∼ n∼n′ = record { to = ∼→≤ (symmetric-∼ m∼m′) ≤-cong-≤ ∼→≤ n∼n′ ; from = ∼→≤ m∼m′ ≤-cong-≤ ∼→≤ (symmetric-∼ n∼n′) } -- Some inversion lemmas. cancel-suc-≤ : ∀ {i m n} → [ i ] suc m ≤ suc n → [ i ] force m ≤′ force n cancel-suc-≤ (suc p) = p cancel-pred-≤ : ∀ {m n i} → [ i ] ⌜ 1 ⌝ ≤ n → [ i ] pred m ≤′ pred n → [ i ] m ≤ n cancel-pred-≤ {zero} (suc _) = λ _ → zero cancel-pred-≤ {suc _} (suc _) = suc cancel-∸-suc-≤ : ∀ {m n o i} → [ ∞ ] ⌜ o ⌝′ < n → [ i ] m ∸ suc o ≤′ n ∸ suc o → [ i ] m ∸ o ≤ n ∸ o cancel-∸-suc-≤ {zero} {n} {o} _ _ = zero ∸ o ∼⟨ ∸-left-zero-zero o ⟩≤ zero ≤⟨ zero ⟩∎ n ∸ o ∎≤ cancel-∸-suc-≤ {suc _} {_} {zero} (suc _) = suc cancel-∸-suc-≤ {suc m} {suc n} {suc o} (suc o<n) = cancel-∸-suc-≤ (force o<n) -- The successor of a number is greater than or equal to the number. ≤suc : ∀ {i n} → [ i ] force n ≤ suc n ≤suc = helper _ (refl _) where helper : ∀ {i} m {n} → m ≡ force n → [ i ] m ≤ suc n helper zero _ = zero helper (suc m) 1+m≡ = suc λ { .force {j = j} → subst ([ j ] _ ≤_) 1+m≡ ≤suc } -- If a number is less than or equal to another, then it is also less -- than or equal to the other's successor. ≤-step : ∀ {m n i} → [ i ] m ≤′ force n → [ i ] m ≤ suc n ≤-step {zero} _ = zero ≤-step {suc m} {n} p = suc λ { .force → force m ≤⟨ ≤suc ⟩ suc m ≤⟨ force p ⟩∎ force n ∎≤ } -- If m is less than n, then m is less than or equal to n. <→≤ : ∀ {i m n} → [ i ] m < n → [ i ] force m ≤ n <→≤ (suc p) = ≤-step p -- If you add something to a number, then you get something that is -- greater than or equal to what you started with. m≤n+m : ∀ {i m n} → [ i ] m ≤ n + m m≤n+m {n = zero} = reflexive-≤ _ m≤n+m {n = suc n} = ≤-step λ { .force → m≤n+m } m≤m+n : ∀ {m n i} → [ i ] m ≤ m + n m≤m+n {m} {n} = m ≤⟨ m≤n+m ⟩ n + m ≤⟨ ∼→≤ (+-comm n) ⟩∎ m + n ∎≤ -- A form of associativity for _∸_. ∸-∸-assoc : ∀ {m} n {k i} → [ i ] (m ∸ n) ∸ k ∼ m ∸ (n Prelude.+ k) ∸-∸-assoc zero = _ ∎∼ ∸-∸-assoc {zero} (suc _) {zero} = _ ∎∼ ∸-∸-assoc {zero} (suc _) {suc _} = _ ∎∼ ∸-∸-assoc {suc _} (suc n) = ∸-∸-assoc n -- A limited form of associativity for _+_ and _∸_. +-∸-assoc : ∀ {m n k i} → [ ∞ ] ⌜ k ⌝ ≤ n → [ i ] (m + n) ∸ k ∼ m + (n ∸ k) +-∸-assoc {m} {n} {zero} zero = m + n ∸ 0 ≡⟨⟩∼ m + n ≡⟨⟩∼ m + (n ∸ 0) ∎∼ +-∸-assoc {m} {suc n} {suc k} (suc k≤n) = m + suc n ∸ suc k ∼⟨ symmetric-∼ (1++∼+suc m) ∸-cong refl (suc k) ⟩ ⌜ 1 ⌝ + m + force n ∸ suc k ≡⟨⟩∼ m + force n ∸ k ∼⟨ +-∸-assoc (force k≤n) ⟩ m + (force n ∸ k) ≡⟨⟩∼ m + (suc n ∸ suc k) ∎∼ -- If you subtract a number and then add it again, then you get back -- what you started with if the number is less than or equal to the -- number that you started with. ∸+≡ : ∀ {m n i} → [ i ] ⌜ n ⌝ ≤ m → [ i ] (m ∸ n) + ⌜ n ⌝ ∼ m ∸+≡ {m} {zero} zero = m + zero ∼⟨ +-right-identity _ ⟩∎ m ∎∼ ∸+≡ {.suc m} {suc n} (suc p) = force m ∸ n + ⌜ suc n ⌝ ∼⟨ symmetric-∼ (1++∼+suc _) ⟩ ⌜ 1 ⌝ + (force m ∸ n) + ⌜ n ⌝ ∼⟨ symmetric-∼ (+-assoc ⌜ 1 ⌝) ⟩ ⌜ 1 ⌝ + (force m ∸ n + ⌜ n ⌝) ∼⟨ (suc λ { .force → ∸+≡ (force p) }) ⟩ ⌜ 1 ⌝ + force m ∼⟨ (suc λ { .force → _ ∎∼ }) ⟩∎ suc m ∎∼ -- If you subtract a natural number and then add it again, then you -- get something that is greater than or equal to what you started -- with. ≤∸+ : ∀ m n {i} → [ i ] m ≤ (m ∸ n) + ⌜ n ⌝ ≤∸+ m zero = m ∼⟨ symmetric-∼ (+-right-identity _) ⟩≤ m + ⌜ 0 ⌝ ∎≤ ≤∸+ zero (suc n) = zero ≤∸+ (suc m) (suc n) = suc m ≤⟨ (suc λ { .force → ≤∸+ (force m) n }) ⟩ ⌜ 1 ⌝ + (force m ∸ n + ⌜ n ⌝) ∼⟨ +-assoc ⌜ 1 ⌝ ⟩≤ ⌜ 1 ⌝ + (force m ∸ n) + ⌜ n ⌝ ∼⟨ 1++∼+suc _ ⟩≤ force m ∸ n + ⌜ suc n ⌝ ≡⟨⟩≤ suc m ∸ suc n + ⌜ suc n ⌝ ∎≤ -- If you subtract something from a number you get a number that is -- less than or equal to the one you started with. ∸≤ : ∀ {m} n {i} → [ i ] m ∸ n ≤ m ∸≤ zero = _ ∎≤ ∸≤ {zero} (suc _) = _ ∎≤ ∸≤ {suc m} (suc n) = ≤-step λ { .force → ∸≤ n } -- Lemmas relating the ordering relation, subtraction and the -- successor function. ∸suc≤→∸≤suc : ∀ {i} m n {o} → [ i ] m ∸ suc n ≤ force o → [ ssuc i ] m ∸ n ≤ suc o ∸suc≤→∸≤suc zero zero p = zero ∸suc≤→∸≤suc zero (suc n) p = zero ∸suc≤→∸≤suc (suc m) zero p = suc λ { .force → p } ∸suc≤→∸≤suc (suc m) (suc n) p = ∸suc≤→∸≤suc (force m) n p ∸≤suc→∸suc≤ : ∀ {i} {j : Size< i} m n {o} → [ i ] m ∸ n ≤ suc o → [ j ] m ∸ suc n ≤ force o ∸≤suc→∸suc≤ zero zero p = zero ∸≤suc→∸suc≤ zero (suc n) p = zero ∸≤suc→∸suc≤ (suc m) zero (suc p) = force p ∸≤suc→∸suc≤ (suc m) (suc n) p = ∸≤suc→∸suc≤ (force m) n p -- One can decide whether a natural number is greater than or equal -- to, or less than, any number. ≤⌜⌝⊎>⌜⌝ : ∀ {i} m n → [ i ] m ≤ ⌜ n ⌝ ⊎ [ i ] ⌜ n ⌝′ < m ≤⌜⌝⊎>⌜⌝ zero _ = inj₁ zero ≤⌜⌝⊎>⌜⌝ (suc m) zero = inj₂ (suc λ { .force → zero }) ≤⌜⌝⊎>⌜⌝ (suc m) (suc n) = ⊎-map (λ (p : [ _ ] _ ≤ _) → suc λ { .force → p }) (λ (p : [ _ ] _ < _) → suc λ { .force → p }) (≤⌜⌝⊎>⌜⌝ (force m) n) -- One can decide whether a natural number is less than or equal to, -- or greater than, any number. ⌜⌝≤⊎⌜⌝> : ∀ {i} m n → [ i ] ⌜ m ⌝ ≤ n ⊎ [ i ] ⌜ 1 ⌝ + n ≤ ⌜ m ⌝ ⌜⌝≤⊎⌜⌝> zero _ = inj₁ zero ⌜⌝≤⊎⌜⌝> (suc m) zero = inj₂ (suc λ { .force → zero }) ⌜⌝≤⊎⌜⌝> (suc m) (suc n) = ⊎-map (λ (p : [ _ ] _ ≤ _) → suc λ { .force → p }) (λ p → suc λ { .force → suc n ≤⟨ (suc λ { .force → _ ∎≤ }) ⟩ ⌜ 1 ⌝ + force n ≤⟨ p ⟩∎ ⌜ m ⌝ ∎≤ }) (⌜⌝≤⊎⌜⌝> m (force n)) -- ⌜_⌝ is monotone. ⌜⌝-mono : ∀ {m n i} → m ≤ n → [ i ] ⌜ m ⌝ ≤ ⌜ n ⌝ ⌜⌝-mono {zero} m≤n = zero ⌜⌝-mono {suc _} {zero} m≤n = ⊥-elim (Nat.≮0 _ m≤n) ⌜⌝-mono {suc _} {suc _} m≤n = suc λ { .force → ⌜⌝-mono (Nat.suc≤suc⁻¹ m≤n) } -- If two natural numbers are related by [ ∞ ]_≤_, then they are also -- related by _≤_. ⌜⌝-mono⁻¹ : ∀ {m n} → [ ∞ ] ⌜ m ⌝ ≤ ⌜ n ⌝ → m ≤ n ⌜⌝-mono⁻¹ {zero} zero = Nat.zero≤ _ ⌜⌝-mono⁻¹ {suc _} {zero} () ⌜⌝-mono⁻¹ {suc _} {suc _} (suc m≤n) = Nat.suc≤suc (⌜⌝-mono⁻¹ (force m≤n)) -- The pred function is monotone. pred-mono : ∀ {m n} → [ ∞ ] m ≤ n → [ ∞ ] pred m ≤ pred n pred-mono zero = zero pred-mono (suc p) = force p -- Addition is monotone. infixl 6 _+-mono_ _+-mono_ : ∀ {i m₁ m₂ n₁ n₂} → [ i ] m₁ ≤ m₂ → [ i ] n₁ ≤ n₂ → [ i ] m₁ + n₁ ≤ m₂ + n₂ _+-mono_ {m₁ = m₁} {m₂} {n₁} {n₂} zero q = zero + n₁ ≡⟨⟩≤ n₁ ≤⟨ q ⟩ n₂ ≤⟨ m≤n+m ⟩∎ m₂ + n₂ ∎≤ suc p +-mono q = suc λ { .force → force p +-mono q } -- Subtraction is monotone in its first argument and antitone in its -- second argument. infixl 6 _∸-mono_ _∸-mono_ : ∀ {m₁ m₂ n₁ n₂ i} → [ ∞ ] m₁ ≤ m₂ → n₂ ≤ n₁ → [ i ] m₁ ∸ n₁ ≤ m₂ ∸ n₂ _∸-mono_ {n₁ = zero} {zero} p _ = p _∸-mono_ {n₁ = zero} {suc _} _ q = ⊥-elim (Nat.≮0 _ q) _∸-mono_ {zero} {n₁ = suc n₁} _ _ = zero _∸-mono_ {suc _} {zero} {suc _} () _ _∸-mono_ {suc m₁} {suc m₂} {suc n₁} {zero} p _ = force m₁ ∸ n₁ ≤⟨ ∸≤ n₁ ⟩ force m₁ ≤⟨ ≤suc ⟩ suc m₁ ≤⟨ p ⟩∎ suc m₂ ∎≤ _∸-mono_ {suc _} {suc _} {suc _} {suc _} p q = force (cancel-suc-≤ p) ∸-mono Nat.suc≤suc⁻¹ q -- Multiplication is monotone. infixl 7 _*-mono_ _*-mono_ : ∀ {i m₁ m₂ n₁ n₂} → [ i ] m₁ ≤ m₂ → [ i ] n₁ ≤ n₂ → [ i ] m₁ * n₁ ≤ m₂ * n₂ zero *-mono _ = zero suc _ *-mono zero = zero suc p *-mono suc q = suc λ { .force → q .force +-mono p .force *-mono suc q } ------------------------------------------------------------------------ -- Minimum and maximum -- The smallest number. min : ∀ {i} → Conat i → Conat i → Conat i min zero n = zero min m zero = zero min (suc m) (suc n) = suc λ { .force → min (force m) (force n) } -- The largest number. max : ∀ {i} → Conat i → Conat i → Conat i max zero n = n max (suc m) n = suc λ { .force → max (force m) (pred n) } -- The minimum of two numbers is less than or equal to both of them. min≤ˡ : ∀ {i} m n → [ i ] min m n ≤ m min≤ˡ zero _ = zero min≤ˡ (suc _) zero = zero min≤ˡ (suc m) (suc n) = suc λ { .force → min≤ˡ (force m) (force n) } min≤ʳ : ∀ {i} m n → [ i ] min m n ≤ n min≤ʳ zero _ = zero min≤ʳ (suc _) zero = zero min≤ʳ (suc m) (suc n) = suc λ { .force → min≤ʳ (force m) (force n) } -- The maximum of two numbers is greater than or equal to both of -- them. ˡ≤max : ∀ {i} m n → [ i ] m ≤ max m n ˡ≤max zero _ = zero ˡ≤max (suc m) n = suc λ { .force → ˡ≤max (force m) (pred n) } ʳ≤max : ∀ {i} m n → [ i ] n ≤ max m n ʳ≤max zero _ = reflexive-≤ _ ʳ≤max (suc _) zero = zero ʳ≤max (suc m) (suc n) = suc λ { .force → ʳ≤max (force m) (force n) } -- The min and max functions preserve bisimilarity. min-cong : ∀ {i m₁ m₂ n₁ n₂} → [ i ] m₁ ∼ m₂ → [ i ] n₁ ∼ n₂ → [ i ] min m₁ n₁ ∼ min m₂ n₂ min-cong zero q = zero min-cong (suc p) zero = zero min-cong (suc p) (suc q) = suc λ { .force → min-cong (force p) (force q) } max-cong : ∀ {i m₁ m₂ n₁ n₂} → [ i ] m₁ ∼ m₂ → [ i ] n₁ ∼ n₂ → [ i ] max m₁ n₁ ∼ max m₂ n₂ max-cong zero q = q max-cong (suc p) q = suc λ { .force → max-cong (force p) (pred-cong q) } ------------------------------------------------------------------------ -- Finite and infinite numbers -- A number is finite if it is bisimilar to a natural number. Finite : Conat ∞ → Type Finite m = ∃ λ n → [ ∞ ] m ∼ ⌜ n ⌝ -- Numbers that are not finite are infinite. Infinite : Conat ∞ → Type Infinite n = ¬ Finite n -- The value infinity is infinite. Infinite-infinity : Infinite infinity Infinite-infinity = uncurry λ n → [ ∞ ] infinity ∼ ⌜ n ⌝ ↝⟨ ∼→≤ ⟩ [ ∞ ] infinity ≤ ⌜ n ⌝ ↝⟨ infinity≰⌜⌝ _ ⟩ ⊥ □ -- Infinite numbers are bisimilar to infinity. Infinite→∼infinity : ∀ {n i} → Infinite n → [ i ] n ∼ infinity Infinite→∼infinity {zero} inf = ⊥-elim (inf (_ , zero)) Infinite→∼infinity {suc n} inf = suc λ { .force → Infinite→∼infinity (inf ∘ Σ-map suc suc′) } where suc′ : ∀ {m} → [ ∞ ] force n ∼ ⌜ m ⌝ → [ ∞ ] suc n ∼ ⌜ suc m ⌝ suc′ p = suc λ { .force → p } -- If m is bounded from above by some natural number, then m is -- finite. ≤⌜⌝→Finite : ∀ {m n} → [ ∞ ] m ≤ ⌜ n ⌝ → Finite m ≤⌜⌝→Finite {.zero} {zero} zero = zero , zero ≤⌜⌝→Finite {.zero} {suc n} zero = zero , zero ≤⌜⌝→Finite {.suc m} {suc n} (suc m≤n) = Σ-map suc (λ (hyp : [ _ ] _ ∼ _) → suc λ { .force → hyp }) (≤⌜⌝→Finite (force m≤n)) ------------------------------------------------------------------------ -- Functions and proofs related to addition of strictly positive -- numbers -- The function _⁺+_ adds two numbers, given that the first one is -- positive. This fact allows the second number to have type Conat′ i, -- rather than Conat i. This can be convenient in corecursive -- definitions. infixl 6 _⁺+_ _⁺+_ : ∀ {m i} → [ i ] ⌜ 1 ⌝ ≤ m → Conat′ i → Conat i _⁺+_ {zero} () _ _⁺+_ {suc m} _ n = suc λ { .force → force m + force n } -- The definition of _⁺+_ is correct. ⁺+∼+ : ∀ {m i} (1≤m : [ ∞ ] ⌜ 1 ⌝ ≤ m) n → [ i ] 1≤m ⁺+ n ∼ m + force n ⁺+∼+ {zero} () _ ⁺+∼+ {suc _} _ _ = suc λ { .force → _ ∎∼ } -- _⁺+_ preserves bisimilarity. ⁺+-cong : ∀ {m₁ m₂ n₁ n₂ i} (1≤m₁ : [ ∞ ] ⌜ 1 ⌝ ≤ m₁) (1≤m₂ : [ ∞ ] ⌜ 1 ⌝ ≤ m₂) → [ i ] m₁ ∼ m₂ → [ i ] force n₁ ∼′ force n₂ → [ i ] 1≤m₁ ⁺+ n₁ ∼ 1≤m₂ ⁺+ n₂ ⁺+-cong {zero} () _ _ _ ⁺+-cong {suc _} {zero} _ () _ _ ⁺+-cong {suc _} {suc _} _ _ (suc m₁∼m₂) n₁∼n₂ = suc λ { .force → force m₁∼m₂ +-cong force n₁∼n₂ } -- _⁺+_ is monotone. ⁺+-mono : ∀ {m₁ m₂ n₁ n₂ i} (1≤m₁ : [ ∞ ] ⌜ 1 ⌝ ≤ m₁) (1≤m₂ : [ ∞ ] ⌜ 1 ⌝ ≤ m₂) → [ i ] m₁ ≤ m₂ → [ i ] force n₁ ≤′ force n₂ → [ i ] 1≤m₁ ⁺+ n₁ ≤ 1≤m₂ ⁺+ n₂ ⁺+-mono {zero} () _ _ _ ⁺+-mono {suc _} {zero} _ () _ _ ⁺+-mono {suc _} {suc _} _ _ (suc m₁∼m₂) n₁∼n₂ = suc λ { .force → force m₁∼m₂ +-mono force n₁∼n₂ } -- Variants of _+-cong_ that can be used when one or more of the -- numbers are known to be positive. With this information at hand it -- suffices for some of the proofs to be "primed". 1≤+-cong : ∀ {m₁ m₂ n₁ n₂ i} → [ i ] ⌜ 1 ⌝ ≤ m₁ → [ i ] m₁ ∼ m₂ → [ i ] n₁ ∼′ n₂ → [ i ] m₁ + n₁ ∼ m₂ + n₂ 1≤+-cong {zero} () _ _ 1≤+-cong {suc _} {zero} _ () _ 1≤+-cong {suc _} {suc _} _ (suc m₁∼m₂) n₁∼n₂ = suc λ { .force → force m₁∼m₂ +-cong force n₁∼n₂ } +1≤-cong : ∀ {m₁ m₂ n₁ n₂ i} → [ i ] ⌜ 1 ⌝ ≤ n₁ → [ i ] m₁ ∼′ m₂ → [ i ] n₁ ∼ n₂ → [ i ] m₁ + n₁ ∼ m₂ + n₂ +1≤-cong {m₁} {m₂} {n₁} {n₂} 1≤n₁ m₁∼m₂ n₁∼n₂ = m₁ + n₁ ∼⟨ +-comm m₁ ⟩ n₁ + m₁ ∼⟨ 1≤+-cong 1≤n₁ n₁∼n₂ m₁∼m₂ ⟩ n₂ + m₂ ∼⟨ +-comm n₂ ⟩∎ m₂ + n₂ ∎∼ 1≤+1≤-cong : ∀ {m₁ m₂ n₁ n₂ i} → [ i ] ⌜ 1 ⌝ ≤ m₁ → [ i ] ⌜ 1 ⌝ ≤ n₂ → [ i ] m₁ ∼′ m₂ → [ i ] n₁ ∼′ n₂ → [ i ] m₁ + n₁ ∼ m₂ + n₂ 1≤+1≤-cong {m₁} {m₂} {n₁} {n₂} 1≤m₁ 1≤n₂ m₁∼m₂ n₁∼n₂ = m₁ + n₁ ∼⟨ 1≤+-cong 1≤m₁ (_ ∎∼) n₁∼n₂ ⟩ m₁ + n₂ ∼⟨ +1≤-cong 1≤n₂ m₁∼m₂ (_ ∎∼) ⟩∎ m₂ + n₂ ∎∼ -- Variants of _+-mono_ that can be used when one or more of the -- numbers are known to be positive. With this information at hand it -- suffices for some of the proofs to be "primed". 1≤+-mono : ∀ {m₁ m₂ n₁ n₂ i} → [ i ] ⌜ 1 ⌝ ≤ m₁ → [ i ] m₁ ≤ m₂ → [ i ] n₁ ≤′ n₂ → [ i ] m₁ + n₁ ≤ m₂ + n₂ 1≤+-mono {zero} () _ _ 1≤+-mono {suc _} {zero} _ () _ 1≤+-mono {suc _} {suc _} _ (suc m₁≤m₂) n₁≤n₂ = suc λ { .force → force m₁≤m₂ +-mono force n₁≤n₂ } +1≤-mono : ∀ {m₁ m₂ n₁ n₂ i} → [ i ] ⌜ 1 ⌝ ≤ n₁ → [ i ] m₁ ≤′ m₂ → [ i ] n₁ ≤ n₂ → [ i ] m₁ + n₁ ≤ m₂ + n₂ +1≤-mono {m₁} {m₂} {n₁} {n₂} 1≤n₁ m₁≤m₂ n₁≤n₂ = m₁ + n₁ ∼⟨ +-comm m₁ ⟩≤ n₁ + m₁ ≤⟨ 1≤+-mono 1≤n₁ n₁≤n₂ m₁≤m₂ ⟩ n₂ + m₂ ∼⟨ +-comm n₂ ⟩≤ m₂ + n₂ ∎≤ 1≤+1≤-mono : ∀ {m₁ m₂ n₁ n₂ i} → [ i ] ⌜ 1 ⌝ ≤ m₁ → [ i ] ⌜ 1 ⌝ ≤ n₂ → [ i ] m₁ ≤′ m₂ → [ i ] n₁ ≤′ n₂ → [ i ] m₁ + n₁ ≤ m₂ + n₂ 1≤+1≤-mono {m₁} {m₂} {n₁} {n₂} 1≤m₁ 1≤n₂ m₁≤m₂ n₁≤n₂ = m₁ + n₁ ≤⟨ 1≤+-mono 1≤m₁ (_ ∎≤) n₁≤n₂ ⟩ m₁ + n₂ ≤⟨ +1≤-mono 1≤n₂ m₁≤m₂ (_ ∎≤) ⟩∎ m₂ + n₂ ∎≤ ------------------------------------------------------------------------ -- Some negative results -- It is impossible to define a strengthening function that, for any -- size i, takes strong bisimilarity of size i between 2 and 1 into -- ordering of size ssuc i between 2 and 1. no-strengthening-21 : ¬ (∀ {i} → [ i ] ⌜ 2 ⌝ ∼ ⌜ 1 ⌝ → [ ssuc i ] ⌜ 2 ⌝ ≤ ⌜ 1 ⌝) no-strengthening-21 strengthen = contradiction ∞ where 2≁1 : ∀ i → ¬ [ i ] ⌜ 2 ⌝ ∼ ⌜ 1 ⌝ 2≁1 i = [ i ] ⌜ 2 ⌝ ∼ ⌜ 1 ⌝ ↝⟨ strengthen ⟩ [ ssuc i ] ⌜ 2 ⌝ ≤ ⌜ 1 ⌝ ↝⟨ (λ hyp → cancel-suc-≤ hyp .force) ⟩ [ i ] ⌜ 1 ⌝ ≤ ⌜ 0 ⌝ ↝⟨ ≮0 ⟩□ ⊥ □ mutual 2∼1 : ∀ i → [ i ] ⌜ 2 ⌝ ∼ ⌜ 1 ⌝ 2∼1 i = suc λ { .force {j} → ⊥-elim (contradiction j) } contradiction : Size → ⊥ contradiction i = 2≁1 i (2∼1 i) -- It is impossible to define a strengthening function that, for any -- size i, takes strong bisimilarity of size i between 2 and 1 into -- strong bisimilarity of size ssuc i between 2 and 1. no-strengthening-∼-21 : ¬ (∀ {i} → [ i ] ⌜ 2 ⌝ ∼ ⌜ 1 ⌝ → [ ssuc i ] ⌜ 2 ⌝ ∼ ⌜ 1 ⌝) no-strengthening-∼-21 = (∀ {i} → [ i ] ⌜ 2 ⌝ ∼ ⌜ 1 ⌝ → [ ssuc i ] ⌜ 2 ⌝ ∼ ⌜ 1 ⌝) ↝⟨ ∼→≤ ∘_ ⟩ (∀ {i} → [ i ] ⌜ 2 ⌝ ∼ ⌜ 1 ⌝ → [ ssuc i ] ⌜ 2 ⌝ ≤ ⌜ 1 ⌝) ↝⟨ no-strengthening-21 ⟩□ ⊥ □ -- It is impossible to define a strengthening function that, for any -- size i, takes ordering of size i between 2 and 1 into ordering of -- size ssuc i between 2 and 1. no-strengthening-≤-21 : ¬ (∀ {i} → [ i ] ⌜ 2 ⌝ ≤ ⌜ 1 ⌝ → [ ssuc i ] ⌜ 2 ⌝ ≤ ⌜ 1 ⌝) no-strengthening-≤-21 = (∀ {i} → [ i ] ⌜ 2 ⌝ ≤ ⌜ 1 ⌝ → [ ssuc i ] ⌜ 2 ⌝ ≤ ⌜ 1 ⌝) ↝⟨ _∘ ∼→≤ ⟩ (∀ {i} → [ i ] ⌜ 2 ⌝ ∼ ⌜ 1 ⌝ → [ ssuc i ] ⌜ 2 ⌝ ≤ ⌜ 1 ⌝) ↝⟨ no-strengthening-21 ⟩□ ⊥ □
server/src/main/antlr4/org/eclipse/lsp/cobol/core/parser/CobolLexer.g4
SWETAS04/che-che4z-lsp-for-cobol
0
1362
/* * Copyright (c) 2020 Broadcom. * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 * which is available at https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Broadcom, Inc. - initial API and implementation */ lexer grammar CobolLexer; channels{COMMENTS, TECHNICAL} import IdmsLexer; EJECT: E J E C T DOT_FS? -> channel(HIDDEN); SKIP1 : S K I P '1' DOT_FS? -> channel(HIDDEN); SKIP2 : S K I P '2' DOT_FS? -> channel(HIDDEN); SKIP3 : S K I P '3' DOT_FS? -> channel(HIDDEN); // keywords ABD: A B D; ACCEPT : A C C E P T; ACCESS : A C C E S S; ADATA : A D A T A; ADD : A D D; ADDRESS : A D D R E S S; ADEXIT : A D E X I T; ADV : A D V; ADVANCING : A D V A N C I N G; ADX : A D X; AFP : A F P; AFTER : A F T E R; ALIAS : A L I A S; ALL : A L L; ALPHABET : A L P H A B E T; ALPHABETIC : A L P H A B E T I C; ALPHABETIC_LOWER : A L P H A B E T I C MINUSCHAR L O W E R; ALPHABETIC_UPPER : A L P H A B E T I C MINUSCHAR U P P E R; ALPHANUMERIC : A L P H A N U M E R I C; ALPHANUMERIC_EDITED : A L P H A N U M E R I C MINUSCHAR E D I T E D; ALPHNUM : A L P H N U M; ALSO : A L S O; ALTER : A L T E R; ALTERNATE : A L T E R N A T E; AND : A N D; ANSI : A N S I; ANY : A N Y; APOST : A P O S T; APPLY : A P P L Y; AR : A R; ARCH : A R C H; ARE : A R E; AREA : A R E A; AREAS : A R E A S; ARITH : A R I T H; ASCENDING : A S C E N D I N G; ASCII : A S C I I; ASSIGN : A S S I G N; ASSOCIATED_DATA : A S S O C I A T E D UNDERSCORECHAR D A T A; ASSOCIATED_DATA_LENGTH : A S S O C I A T E D UNDERSCORECHAR D A T A UNDERSCORECHAR L E N G T H; AT : A T; ATTACH : A T T A C H; ATTRIBUTES : A T T R I B U T E S; AUTHOR : <NAME>; AUTO : A U T O; AWO : A W O; BEFORE : B E F O R E; BELOW : B E L O W; BIN : B I N; BINARY : B I N A R Y; BLANK : B L A N K; BLOCK : B L O C K; BLOCK0 : B L O C K '0'; BOTTOM : B O T T O M; BUF : B U F; BUFFER : B U F F E R; BUFSIZE : B U F S I Z E; BY : B Y; BYFUNCTION : B Y F U N C T I O N; BYTITLE : B Y T I T L E; CALL : C A L L; CANCEL : C A N C E L; CAPABLE : C A P A B L E; CBL : C B L; CCSVERSION : C C S V E R S I O N; CHAINING : C H A I N I N G; CHANGE : C H A N G E; CHANGED : C H A N G E D; CHANNEL : C H A N N E L; CHARACTER : C H A R A C T E R; CHARACTERS : C H A R A C T E R S; CHECK : C H E C K; CICS : C I C S; CLASS : C L A S S; CLEANSIGN : C L E A N S I G N; CLEAR : C L E A R; CLOCK_UNITS : C L O C K MINUSCHAR U N I T S; CLOSE : C L O S E; CLOSE_DISPOSITION : C L O S E MINUSCHAR D I S P O S I T I O N; CO : C O; CODE : C O D E; CODEPAGE : C O D E P A G E; CODE_SET : C O D E MINUSCHAR S E T; COLLATING : C O L L A T I N G; COMMA : C O M M A; COMMIT : C O M M I T; COMMITMENT : C O M M I T M E N T; COMMON : C O M M O N; COMP : C O M P; COMPAT : C O M P A T; COMPILE : C O M P I L E; COMPUTATIONAL : C O M P U T A T I O N A L; COMPUTATIONAL_1 : C O M P U T A T I O N A L MINUSCHAR '1'; COMPUTATIONAL_2 : C O M P U T A T I O N A L MINUSCHAR '2'; COMPUTATIONAL_3 : C O M P U T A T I O N A L MINUSCHAR '3'; COMPUTATIONAL_4 : C O M P U T A T I O N A L MINUSCHAR '4'; COMPUTATIONAL_5 : C O M P U T A T I O N A L MINUSCHAR '5'; COMPUTE : C O M P U T E; COMP_1 : C O M P MINUSCHAR '1'; COMP_2 : C O M P MINUSCHAR '2'; COMP_3 : C O M P MINUSCHAR '3'; COMP_4 : C O M P MINUSCHAR '4'; COMP_5 : C O M P MINUSCHAR '5'; CONFIGURATION : C O N F I G U R A T I O N; CONNECT : C O N N E C T; CONTAINS : C O N T A I N S; CONTENT : C O N T E N T; CONTINUE : C O N T I N U E; CONTROL : C O N T R O L; CONVERTING : C O N V E R T I N G; COPYENTRY : (' *>CPYENTER<URI>' .*? '</URI>') -> channel(TECHNICAL); COPYEXIT : '*>CPYEXIT' + NEWLINE -> channel(TECHNICAL); COPYLOC : C O P Y L O C; COPYRIGHT : C O P Y R I G H T; CORR : C O R R; CORRESPONDING : C O R R E S P O N D I N G; COUNT : C O U N T; CP : C P; CPLC : C P L C; CPYR : C P Y R; CR : C R; CRUNCH : C R U N C H; CS : C S; CURR : C U R R; CURRENCY : C U R R E N C Y; CURRENT : C U R R E N T; CURSOR : C U R S O R; C_CHAR : C; DATA : D A T A; DATE : D A T E; DATE_COMPILED : D A T E MINUSCHAR C O M P I L E D; DATE_WRITTEN : D A T E MINUSCHAR W R I T T E N; DAY : D A Y; DAY_OF_WEEK : D A Y MINUSCHAR O F MINUSCHAR W E E K; DB : D B; DBCS : D B C S; DEBUG : D E B U G; DEBUGGING : D E B U G G I N G; DEBUG_CONTENTS : D E B U G MINUSCHAR C O N T E N T S; DEBUG_ITEM : D E B U G MINUSCHAR I T E M; DEBUG_LINE : D E B U G MINUSCHAR L I N E; DEBUG_NAME : D E B U G MINUSCHAR N A M E; DEBUG_SUB_1 : D E B U G MINUSCHAR S U B MINUSCHAR '1'; DEBUG_SUB_2 : D E B U G MINUSCHAR S U B MINUSCHAR '2'; DEBUG_SUB_3 : D E B U G MINUSCHAR S U B MINUSCHAR '3'; DEC : D E C; DECIMAL_POINT : D E C I M A L MINUSCHAR P O I N T; DECK : D E C K; DECLARATIVES : D E C L A R A T I V E S; DEF : D E F; DEFAULT : D E F A U L T; DEFAULT_DISPLAY : D E F A U L T MINUSCHAR D I S P L A Y; DEFINE : D E F I N E; DEFINITION : D E F I N I T I O N; DELETE : D E L E T E; DELIMITED : D E L I M I T E D; DELIMITER : D E L I M I T E R; DEPENDING : D E P E N D I N G; DESCENDING : D E S C E N D I N G; DESTINATION : D E S T I N A T I O N; DETAIL : D E T A I L; DFHRESP : D F H R E S P; DFHVALUE : D F H V A L U E; DIAGTRUNC : D I A G T R U N C; DISABLE : D I S A B L E; DISCONNECT : D I S C O N N E C T; DISK : D I S K; DISPLAY : D I S P L A Y; DISPLAY_1 : D I S P L A Y MINUSCHAR '1'; DISPSIGN : D I S P S I G N; DIVIDE : D I V I D E; DIVISION : D I V I S I O N; DLL : D L L; DN : D N; DOWN : D O W N; DS : D S; DSN : D S N; DSNAME : D S N A M E; DTR : D T R; DU : D U; DUMP : D U M P; DUPLICATES : D U P L I C A T E S; DWARF : D W A R F; DYN : D Y N; DYNAM : D Y N A M; DYNAMIC : D Y N A M I C; D_CHAR : D; EBCDIC : E B C D I C; EGCS : E G C S; EGI : E G I; EJPD : E J P D; ELSE : E L S E; EMI : E M I; EMPTY : E M P T Y; EN : E N; ENABLE : E N A B L E; ENCODING: E N C O D I N G; END : E N D; ENDP : E N D P; ENDPERIOD : E N D P E R I O D; END_ACCEPT : E N D MINUSCHAR A C C E P T; END_ADD : E N D MINUSCHAR A D D; END_CALL : E N D MINUSCHAR C A L L; END_COMPUTE : E N D MINUSCHAR C O M P U T E; END_DELETE : E N D MINUSCHAR D E L E T E; END_DIVIDE : E N D MINUSCHAR D I V I D E; END_EVALUATE : E N D MINUSCHAR E V A L U A T E; END_EXEC : E N D MINUSCHAR E X E C; END_IF : E N D MINUSCHAR I F; END_MULTIPLY : E N D MINUSCHAR M U L T I P L Y; END_OF_PAGE : E N D MINUSCHAR O F MINUSCHAR P A G E; END_PERFORM : E N D MINUSCHAR P E R F O R M; END_READ : E N D MINUSCHAR R E A D; END_RECEIVE : E N D MINUSCHAR R E C E I V E; END_RETURN : E N D MINUSCHAR R E T U R N; END_REWRITE : E N D MINUSCHAR R E W R I T E; END_SEARCH : E N D MINUSCHAR S E A R C H; END_START : E N D MINUSCHAR S T A R T; END_STRING : E N D MINUSCHAR S T R I N G; END_SUBTRACT : E N D MINUSCHAR S U B T R A C T; END_UNSTRING : E N D MINUSCHAR U N S T R I N G; END_WRITE : E N D MINUSCHAR W R I T E; END_XML : E N D MINUSCHAR X M L; ENGLISH : E N G L I S H; ENTER : E N T E R; ENTRY : E N T R Y; ENVIRONMENT : E N V I R O N M E N T; EOC : E O C; EODS : E O D S; EOP : E O P; EQUAL : E Q U A L; ERASE : E R A S E; ERROR : E R R O R; ESCAPE : E S C A P E; ESI : E S I; EVALUATE : E V A L U A T E; EVENP : E V E N P; EVENPACK : E V E N P A C K; EVENT : E V E N T; EVERY : E V E R Y; EX : E X; EXCEPT : E X C E P T; EXCEPTION : E X C E P T I O N; EXCLUSIVE : E X C L U S I V E; EXEC : E X E C; EXHIBIT : E X H I B I T; EXIT : E X I T; EXP : E X P; EXPORTALL : E X P O R T A L L; EXTEND : E X T E N D; EXTENDED : E X T E N D E D; EXTERNAL : E X T E R N A L; E_CHAR : E; FALSE : F A L S E; FASTSRT : F A S T S R T; FD : F D; FILE : F I L E; FILE_CONTROL : F I L E MINUSCHAR C O N T R O L; FILLER : F I L L E R; FINISH : F I N I S H; FIRST : F I R S T; FLAG : F L A G; FLAGSTD : F L A G S T D; FNC : F N C; FOOTING : F O O T I N G; FOR : F O R; FORCENUMCMP : F O R C E N U M C M P; FREE : F R E E; FROM : F R O M; FSRT : F S R T; FULL : F U L L; FUNCTION : F U N C T I O N; FUNCTION_POINTER : F U N C T I O N MINUSCHAR P O I N T E R; F_CHAR : F; GENERATE : G E N E R A T E; GIVING : G I V I N G; GLOBAL : G L O B A L; GO : G O; GOBACK : G O B A C K; GREATER : G R E A T E R; GROUP_USAGE : G R O U P MINUSCHAR U S A G E; G_CHAR: G; HEADER : H E A D E R; HEX : H E X; HGPR : H G P R; HIGH_VALUE : H I G H MINUSCHAR V A L U E; HIGH_VALUES : H I G H MINUSCHAR V A L U E S; HOLD : H O L D; H_CHAR : H; IC : I C; ID : I D; IDENTIFICATION : I D E N T I F I C A T I O N; IF : I F; IGNORED : I G N O R E D; IMMEDIATE : I M M E D I A T E; IMPLICIT : I M P L I C I T; IN : I N; INDEX : I N D E X; INDEXED : I N D E X E D; INEXIT : I N E X I T; INITCHECK : I N I T C H E C K; INITIAL : I N I T I A L; INITIALIZE : I N I T I A L I Z E; INITIATE : I N I T I A T E; INL : I N L; INLINE : I N L I N E; INPUT : I N P U T; INPUT_OUTPUT : I N P U T MINUSCHAR O U T P U T; INSPECT : I N S P E C T; INSTALLATION : I N S T A L L A T I O N; INTDATE : I N T D A T E; INTEGER : I N T E G E R; INTERVAL : I N T E R V A L; INTO : I N T O; INVALID : I N V A L I D; INVD : I N V D; INVDATA : I N V D A T A; INVMPSZ : I N V M P S Z; INVOKED : I N V O K E D; INVPARTN : I N V P A R T N; INVREQ : I N V R E Q; INX : I N X; IO : I O; IS : I S; I_CHAR : I; I_O : I MINUSCHAR O; I_O_CONTROL : I MINUSCHAR O MINUSCHAR C O N T R O L; JA : J A; JAPANESE : J A P A N E S E; JNIENVPTR: J N I E N V P T R; JP : J P; JUST : J U S T; JUSTIFIED : J U S T I F I E D; JUSTIFY : J U S T I F Y; KANJI : K A N J I; KEEP : K E E P; KEPT : K E P T; KEY : K E Y; KEYBOARD : K E Y B O A R D; K_CHAR : K; LABEL : L A B E L; LANG : L A N G; LANGUAGE : L A N G U A G E; LAST : L A S T; LAX : L A X; LAXPERF : L A X P E R F; LAXREDEF : L A X R E D E F; LC : L C; LEADING : L E A D I N G; LEFT : L E F T; LENGTH : L E N G T H; LESS : L E S S; LIBEXIT : L I B E X I T; LIBRARY : L I B R A R Y; LIBX : L I B X; LILIAN : L I L I A N; LIMIT : L I M I T; LINAGE : L I N A G E; LINAGE_COUNTER : L I N A G E MINUSCHAR C O U N T E R; LINE : L I N E; LINECOUNT : L I N E C O U N T; LINES : L I N E S; LINE_COUNTER : L I N E MINUSCHAR C O U N T E R; LINK : L I N K; LINKAGE : L I N K A G E; LIST : L I S T; LITERALS : L I T E R A L S; LM : L M; LOAD : L O A D; LOCAL : L O C A L; LOCAL_STORAGE : L O C A L MINUSCHAR S T O R A G E; LOCK : L O C K; LONG : L O N G; LONGMIXED : L O N G M I X E D; LONGUPPER : L O N G U P P E R; LOW_VALUE : L O W MINUSCHAR V A L U E; LOW_VALUES : L O W MINUSCHAR V A L U E S; LP : L P; LTERM : L T E R M; LU : L U; LXPRF : L X P R F; LXRDF : L X R D F; MANUAL : M A N U A L; MAPFAIL : M A P F A I L; MAX : M A X; MAXPCF : M A X P C F; MD : M D; MDECK : M D E C K; MEMBER : M E M B E R; MEMORY : M E M O R Y; MERGE : M E R G E; MESSAGE : M E S S A G E; MIG : M I G; MIXED : M I X E D; MMDDYYYY : M M D D Y Y Y Y; MODE : M O D E; MODULES : M O D U L E S; MOVE : M O V E; MSG : M S G; MSGEXIT : M S G E X I T; MSGX : M S G X; MULTIPLE : M U L T I P L E; MULTIPLY : M U L T I P L Y; M_CHAR : M; NAME : N A M E; NAMED : N A M E D; NAT : N A T; NATIONAL : N A T I O N A L; NATIONAL_EDITED : N A T I O N A L MINUSCHAR E D I T E D; NATIVE : N A T I V E; NC : N C; ND : N D; NEGATIVE : N E G A T I V E; NETWORK : N E T W O R K; NEW : N E W; NEXT : N E X T; NLCR : N L C R; NO : N O; NOADATA : N O A D A T A; NOADEXIT : N O A D E X I T; NOADV : N O A D V; NOADX : N O A D X; NOALIAS : N O A L I A S; NOALPHNUM : N O A L P H N U M; NOAWO : N O A W O; NOBIN : N O B I N; NOBLOCK0 : N O B L O C K '0'; NOC : N O C; NOCICS : N O C I C S; NOCLEANSIGN : N O C L E A N S I G N; NOCOMPILE : N O C O M P I L E; NOCOPYLOC : N O C O P Y L O C; NOCOPYRIGHT : N O C O P Y R I G H T; NOCPLC : N O C P L C; NOCPYR : N O C P Y R; NOCS : N O C S; NOCURR : N O C U R R; NOCURRENCY : N O C U R R E N C Y; NOD : N O D; NODBCS : N O D B C S; NODECK : N O D E C K; NODEF : N O D E F; NODEFINE : N O D E F I N E; NODIAGTRUNC : N O D I A G T R U N C; NODLL : N O D L L; NODSNAME : N O D S N A M E; NODTR : N O D T R; NODU : N O D U; NODUMP : N O D U M P; NODWARF : N O D W A R F; NODYN : N O D Y N; NODYNAM : N O D Y N A M; NOEJPD : N O E J P D; NOENDPERIOD : N O E N D P E R I O D; NOEVENPACK : N O E V E N P A C K; NOEX : N O E X; NOEXIT : N O E X I T; NOEXP : N O E X P; NOEXPORTALL : N O E X P O R T A L L; NOF : N O F; NOFASTSRT : N O F A S T S R T; NOFLAG : N O F L A G; NOFLAGSTD : N O F L A G S T D; NOFNC : N O F N C; NOFORCENUMCMP : N O F O R C E N U M C M P; NOFSRT : N O F S R T; NOIC : N O I C; NOINEXIT : N O I N E X I T; NOINITCHECK : N O I N I T C H E C K; NOINITIAL : N O I N I T I A L; NOINL : N O I N L; NOINLINE : N O I N L I N E; NOINVD : N O I N V D; NOINVDATA : N O I N V D A T A; NOINX : N O I N X; NOLAXPERF : N O L A X P E R F; NOLAXREDEF : N O L A X R E D E F; NOLIBEXIT : N O L I B E X I T; NOLIBX : N O L I B X; NOLIST : N O L I S T; NOMAP : N O M A P; NOMD : N O M D; NOMDECK : N O M D E C K; NOMSGEXIT : N O M S G E X I T; NOMSGX : N O M S G X; NONAME : N O N A M E; NONC : N O N C; NONE : N O N E; NONUM : N O N U M; NONUMBER : N O N U M B E R; NONUMCHECK : N O N U M C H E C K; NOOBJ : N O O B J; NOOBJECT : N O O B J E C T; NOOFF : N O O F F; NOOFFSET : N O O F F S E T; NOOMITODOMIN : N O O M I T O D O M I N; NOPAC : N O P A C; NOPARMCHECK : N O P A R M C H E C K; NOPC : N O P C; NOPFD : N O P F D; NOPRESERVE : N O P R E S E R V E; NOPRTEXIT : N O P R T E X I T; NOPRTX : N O P R T X; NORENT : N O R E N T; NORULES : N O R U L E S; NOS : N O S; NOSEP : N O S E P; NOSEPARATE : N O S E P A R A T E; NOSEQ : N O S E Q; NOSEQUENCE : N O S E Q U E N C E; NOSERV : N O S E R V; NOSERVICE : N O S E R V I C E; NOSLACKBYTES : N O S L A C K B Y T E S; NOSO : N O S O; NOSOURCE : N O S O U R C E; NOSQL : N O S Q L; NOSQLC : N O S Q L C; NOSQLCCSID : N O S Q L C C S I D; NOSQLIMS : N O S Q L I M S; NOSSR : N O S S R; NOSSRANGE : N O S S R A N G E; NOSTGOPT : N O S T G O P T; NOSUPP : N O S U P P; NOSUPPRESS : N O S U P P R E S S; NOT : N O T; NOTERM : N O T E R M; NOTERMINAL : N O T E R M I N A L; NOTEST : N O T E S T; NOTHREAD : N O T H R E A D; NOTRUNCBIN : N O T R U N C B I N; NOUNRA : N O U N R A; NOUNREFALL : N O U N R E F A L L; NOUNREFSOURCE : N O U N R E F S O U R C E; NOUNRS : N O U N R S; NOVBREF : N O V B R E F; NOVOLATILE : N O V O L A T I L E; NOWAIT : N O W A I T; NOWD : N O W D; NOWORD : N O W O R D; NOWRITE : N O W R I T E; NOX : N O X; NOXREF : N O X R E F; NOZC : N O Z C; NOZLEN : N O Z L E N; NOZON : N O Z O N; NOZONECHECK : N O Z O N E C H E C K; NOZWB : N O Z W B; NS : N S; NSYMBOL : N S Y M B O L; NULL : N U L L; NULLS : N U L L S; NUM : N U M; NUMBER : N U M B E R; NUMCHECK : N U M C H E C K; NUMERIC : N U M E R I C; NUMERIC_EDITED : N U M E R I C MINUSCHAR E D I T E D; NUMPROC : N U M P R O C; N_CHAR : N; OBJ : O B J; OBJECT : O B J E C T; OBJECT_COMPUTER : O B J E C T MINUSCHAR C O M P U T E R; OCCURS : O C C U R S; ODT : O D T; OF : O F; OFF : O F F; OFFSET : O F F S E T; OMITODOMIN : O M I T O D O M I N; OMITTED : O M I T T E D; ON : O N; ONLY : O N L Y; OOM : O O M; OPEN : O P E N; OPT : O P T; OPTFILE : O P T F I L E; OPTIMIZE : O P T I M I Z E; OPTIONAL : O P T I O N A L; OR : O R; ORDER : O R D E R; ORDERLY : O R D E R L Y; ORGANIZATION : O R G A N I Z A T I O N; OTHER : O T H E R; OUT : O U T; OUTDD : O U T D D; OUTPUT : O U T P U T; OVERFLOW : O V E R F L O W; O_CHAR : O; PAC : P A C; PACKED_DECIMAL : P A C K E D MINUSCHAR D E C I M A L; PAD : P A D; PADDING : P A D D I N G; PAGE : P A G E; PAGE_COUNTER : P A G E MINUSCHAR C O U N T E R; PAGING : P A G I N G; PARMCHECK : P A R M C H E C K; PARSE: P A R S E; PARTNFAIL : P A R T N F A I L; PASSWORD : <NAME>; PATH : P A T H; PC : P C; PERFORM : P E R F O R M; PFD : P F D; PGMN : P G M N; PGMNAME : P G M N A M E; PIC : P I C -> pushMode(PICTURECLAUSE); PICTURE : P I C T U R E -> pushMode(PICTURECLAUSE); POINTER : P O I N T E R; POINTER_32 : P O I N T E R MINUSCHAR '3' '2'; PORT : P O R T; POSITION : P O S I T I O N; POSITIVE : P O S I T I V E; POST : P O S T; PREFIX : P R E F I X; PRESERVE : P R E S E R V E; PRINTER : P R I N T E R; PRIORITY : P R I O R I T Y; PROCEDURE : P R O C E D U R E; PROCEDURES : P R O C E D U R E S; PROCEDURE_POINTER : P R O C E D U R E MINUSCHAR P O I N T E R; PROCEED : P R O C E E D; PROCESS : P R O C E S S; PROCESSING: P R O C E S S I N G; PROGRAM : P R O G R A M; PROGRAM_ID : P R O G R A M MINUSCHAR I D; PRTEXIT : P R T E X I T; PRTX : P R T X; PTERM : P T E R M; PURGE : P U R G E; PUT : P U T; QUA : Q U A; QUALIFY : Q U A L I F Y; QUEUE : Q U E U E; QUOTE : Q U O T E; QUOTES : Q U O T E S; Q_CHAR : Q; RANDOM : R A N D O M; RDATT : R D A T T; READ : R E A D; READER : R E A D E R; READY : R E A D Y; RECEIVE : R E C E I V E; RECORD : R E C O R D; RECORDING : R E C O R D I N G; RECORDS : R E C O R D S; RECURSIVE : R E C U R S I V E; REDEFINES : R E D E F I N E S; REEL : R E E L; REFERENCE : R E F E R E N C E; REFERENCES : R E F E R E N C E S; RELATIVE : R E L A T I V E; RELEASE : R E L E A S E; RELOAD: R E L O A D; REMAINDER : R E M A I N D E R; REMARKS : R E M A R K S; REMOTE : R E M O T E; REMOVAL : R E M O V A L; REMOVE : R E M O V E; RENAMES : R E N A M E S; RENT : R E N T; REPLACE : R E P L A C E; REPLACING : R E P L A C I N G; REPORT : R E P O R T; REPORTS : R E P O R T S; REQUIRED : R E Q U I R E D; RERUN : R E R U N; RESERVE : R E S E R V E; RESET : R E S E T; RESUME : R E S U M E; RETURN : R E T U R N; RETURNING: R E T U R N I N G; RETURN_CODE : R E T U R N MINUSCHAR C O D E; REVERSED : R E V E R S E D; REWIND : R E W I N D; REWRITE : R E W R I T E; RIGHT : R I G H T; RMODE : R M O D E; ROLLBACK : R O L L B A C K; ROUNDED : R O U N D E D; RULES : R U L E S; RUN : R U N; SAME : S A M E; SAVE : S A V E; SCREENSIZE : S C R E E N S I Z E; SD : S D; SEARCH : S E A R C H; SECONDS : S E C O N D S; SECTION : S E C T I O N; SECURITY : S E C U R I T Y; SEGMENT : S E G M E N T; SEGMENT_LIMIT : S E G M E N T MINUSCHAR L I M I T; SELECT : S E L E C T; SEND : S E N D; SENTENCE : S E N T E N C E; SEP : S E P; SEPARATE : S E P A R A T E; SEQ : S E Q; SEQUENCE : S E Q U E N C E; SEQUENTIAL : S E Q U E N T I A L; SERV : S E R V; SERVICE : S E R V I C E; SESSION : S E S S I O N; SET : S E T; SHARE : S H A R E; SHARED : S H A R E D; SHIFT_IN : S H I F T MINUSCHAR I N; SHIFT_OUT : S H I F T MINUSCHAR O U T; SIGN : S I G N; SIZE : S I Z E; SKIPCHAR : S K I P; SLACKBYTES : S L A C K B Y T E S; SLCKB : S L C K B; SN : S N; SNAP : S N A P; SO : S O; SOME : S O M E; SORT : S O R T; SORT_CONTROL : S O R T MINUSCHAR C O N T R O L; SORT_CORE_SIZE : S O R T MINUSCHAR C O R E MINUSCHAR S I Z E; SORT_FILE_SIZE : S O R T MINUSCHAR F I L E MINUSCHAR S I Z E; SORT_MERGE : S O R T MINUSCHAR M E R G E; SORT_MESSAGE : S O R T MINUSCHAR M E S S A G E; SORT_MODE_SIZE : S O R T MINUSCHAR M O D E MINUSCHAR S I Z E; SORT_RETURN : S O R T MINUSCHAR R E T U R N; SOURCE : S O U R C E; SOURCE_COMPUTER : S O U R C E MINUSCHAR C O M P U T E R; SPACE : S P A C E; SPACES : S P A C E S; SPECIAL_NAMES : S P E C I A L MINUSCHAR N A M E S; SQL : S Q L; SQLC : S Q L C; SQLCCSID : S Q L C C S I D; SQLIMS : S Q L I M S; SSR : S S R; SSRANGE : S S R A N G E; STANDARD : S T A N D A R D; STANDARD_1 : S T A N D A R D MINUSCHAR '1'; STANDARD_2 : S T A N D A R D MINUSCHAR '2'; START : S T A R T; STATISTICS : S T A T I S T I C S; STATUS : S T A T U S; STD : S T D; STGOPT : S T G O P T; STOP : S T O P; STORAGE : S T O R A G E; STRICT : S T R I C T; STRING : S T R I N G; SUBTRACT : S U B T R A C T; SUCC : S U C C; SUM : S U M; SUPP : S U P P; SUPPRESS : S U P P R E S S; SYMBOL : S Y M B O L; SYMBOLIC : S Y M B O L I C; SYNC : S Y N C; SYNCHRONIZED : S Y N C H R O N I Z E D; SYSLIB : S Y S L I B; SYSTEM : S Y S T E M; SYSVERSION : S Y S V E R S I O N; S_CHAR : S; TABLE : T A B L E; TALLY : T A L L Y; TALLYING : T A L L Y I N G; TAPE : T A P E; TASK : T A S K; TEMPORARY : T E M P O R A R Y; TERM : T E R M; TERMINAL : T E R M I N A L; TERMINATE : T E R M I N A T E; TEST : T E S T; TEXT : T E X T; THAN : T H A N; THEN : T H E N; THREAD : T H R E A D; THROUGH : T H R O U G H; THRU : T H R U; TIME : T I M E; TIMEOUT : T I M E O U T; TIMES : T I M E S; TITLE : T I T L E; TO : T O; TODAYS_DATE : T O D A Y S MINUSCHAR D A T E; TODAYS_NAME : T O D A Y S MINUSCHAR N A M E; TOP : T O P; TRACE : T R A C E; TRAILING : T R A I L I N G; TRANSACTION : T R A N S A C T I O N; TRANSFER : T R A N S F E R; TRUE : T R U E; TRUNC : T R U N C; TRUNCATED : T R U N C A T E D; TRUNCBIN : T R U N C B I N; TUNE : T U N E; TYPE : T Y P E; UE : U E; UENGLISH : U E N G L I S H; UNEXPIN : U N E X P I N; UNIT : U N I T; UNREF : U N R E F; UNSTRING : U N S T R I N G; UNTIL : U N T I L; UP : U P; UPDATE : U P D A T E; UPON : U P O N; UPPER : U P P E R; USAGE : U S A G E; USE : U S E; USER : U S E R; USING : U S I N G; UTF_8 : U T F MINUSCHAR '8'; U_CHAR : U; VALIDATING: V A L I D A T I N G; VALUE : V A L U E; VALUES : V A L U E S; VARYING : V A R Y I N G; VBREF : V B R E F; VIRTUAL : V I R T U A L; VLR : V L R; VOLATILE : V O L A T I L E; VS : V S; VSAMOPENFS : V S A M O P E N F S; WAIT : W A I T; WD : W D; WHEN : W H E N; WHEN_COMPILED : W H E N MINUSCHAR C O M P I L E D; WITH : W I T H; WORD : W O R D; WORDS : W O R D S; WORKING_STORAGE : W O R K I N G MINUSCHAR S T O R A G E; WRITE : W R I T E; WRITE_ONLY : W R I T E MINUSCHAR O N L Y; W_CHAR : W; XCTL : X C T L; XML : X M L; XMLPARSE : X M L P A R S E; XMLSS : X M L S S; XP : X P; XREF : X R E F; X_CHAR : X; YEAR : Y E A R; YES : Y E S; YYYYDDD : Y Y Y Y D D D; YYYYMMDD : Y Y Y Y M M D D; ZC : Z C; ZD : Z D; ZERO : Z E R O; ZEROES : Z E R O E S; ZEROS : Z E R O S; ZLEN : Z L E N; ZON : Z O N; ZONECHECK : Z O N E C H E C K; ZONEDATA : Z O N E D A T A; ZWB : Z W B; UNDERSCORECHAR : '_'; INTEGERLITERAL_WITH_K: INTEGERLITERAL ('K' | 'k'); CURRENCY_SYMBOL : [\p{Sc}]; mode PICTURECLAUSE; FINALCHARSTRING: CHARSTRING+ ->popMode; CHARSTRING: PICTURECHARSGROUP1+ PICTURECHARSGROUP2? LParIntegralRPar? '.'? (PICTURECHARSGROUP1|PICTURECHARSGROUP2) PICTURECHARSGROUP1+ PICTURECHARSGROUP2? LParIntegralRPar?| PICTURECHARSGROUP1* '.' PICTUREPeriodAcceptables+ LParIntegralRPar?| PICTURECHARSGROUP1* PICTURECHARSGROUP2? PICTURECHARSGROUP1+ LParIntegralRPar? '.'? (PICTURECHARSGROUP1|PICTURECHARSGROUP2)| PICTURECHARSGROUP1* PICTURECHARSGROUP2? PICTURECHARSGROUP1+ LParIntegralRPar?| PICTURECHARSGROUP2 PICTURECHARSGROUP1* LParIntegralRPar? '.'? (PICTURECHARSGROUP1|PICTURECHARSGROUP2)| PICTURECHARSGROUP2 PICTURECHARSGROUP1* LParIntegralRPar? ; PICTURECHARSGROUP1: PICTURECharAcceptedMultipleTime+; PICTURECHARSGROUP2: PICTURECharAcceptedOneTime+; WS2 : [ \t\f]+ -> channel(HIDDEN); LParIntegralRPar: LPARENCHAR INTEGERLITERAL RPARENCHAR; fragment PICTUREPeriodAcceptables: ('0'|'9'|B|Z|CR|DB|ASTERISKCHAR|COMMACHAR|MINUSCHAR|PLUSCHAR|SLASHCHAR); fragment PICTURECharAcceptedMultipleTime: (A|G|N|P|X|DOLLARCHAR|PICTUREPeriodAcceptables); fragment PICTURECharAcceptedOneTime: (V|E|S|CR|DB);
tests/nonsmoke/functional/CompileTests/experimental_ada_tests/tests/type_conversion.adb
sourceryinstitute/rose-sourcery-institute
0
12081
procedure Type_Conversion is X : Integer; Y : Float; begin X := 1; Y := Float (X); end Type_Conversion;
oeis/182/A182093.asm
neoneye/loda-programs
11
96265
<reponame>neoneye/loda-programs ; A182093: Partial sums of A005590. ; Submitted by <NAME> ; 0,1,2,2,3,2,2,3,4,2,1,2,2,3,4,4,5,2,0,1,0,2,3,2,2,3,4,4,5,4,4,5,6,2,-1,0,-2,1,2,0,-1,2,4,3,4,2,1,2,2,3,4,4,5,4,4,5,6,4,3,4,4,5,6,6,7,2,-2,-1,-4,0,1,-2,-4,1,4,2,3,0,-2,-1,-2,2,5,4,6,3,2,4,5,2,0,1,0,2,3,2,2,3,4,4 lpb $0 mov $2,$0 sub $0,1 seq $2,5590 ; a(0) = 0, a(1) = 1, a(2n) = a(n), a(2n+1) = a(n+1) - a(n). add $3,$2 lpe mov $0,$3
examples/examplesPaperJFP/Object.agda
agda/ooAgda
23
5625
<reponame>agda/ooAgda module examplesPaperJFP.Object where open import Data.Product open import Data.String.Base open import examplesPaperJFP.NativeIOSafe open import examplesPaperJFP.BasicIO hiding (main) open import examplesPaperJFP.Console hiding (main) record Interface : Set₁ where field Method : Set Result : (m : Method) → Set open Interface public record Object (I : Interface) : Set where coinductive field objectMethod : (m : Method I) → Result I m × Object I open Object public record IOObject (Iᵢₒ : IOInterface) (I : Interface) : Set where coinductive field method : (m : Method I) → IO Iᵢₒ (Result I m × IOObject Iᵢₒ I) open IOObject public data CellMethod A : Set where get : CellMethod A put : A → CellMethod A CellResult : ∀{A} → CellMethod A → Set CellResult {A} get = A CellResult (put _) = Unit cellJ : (A : Set) → Interface Method (cellJ A) = CellMethod A Result (cellJ A) m = CellResult m CellC : Set CellC = IOObject ConsoleInterface (cellJ String) simpleCell : (s : String) → CellC force (method (simpleCell s) get) = exec′ (putStrLn ("getting (" ++ s ++ ")")) λ _ → delay (return′ (s , simpleCell s)) force (method (simpleCell s) (put x)) = exec′ (putStrLn ("putting (" ++ x ++ ")")) λ _ → delay (return′ (unit , simpleCell x)) {-# TERMINATING #-} program : IOConsole Unit force program = let c₁ = simpleCell "Start" in exec′ getLine λ{ nothing → return unit; (just s) → method c₁ (put s) >>= λ{ (_ , c₂) → method c₂ get >>= λ{ (s′ , _ ) → exec (putStrLn s′) λ _ → program }}} main : NativeIO Unit main = translateIOConsole program
source alpha1_5.asm
overloadwolf/CompetitiveAnsweringScoreBoard
0
174581
;****** 中断源矢量表设置 ************************************************** ORG 0000H ;复位入口 LJMP MAIN ;转到主程序 ORG 0003H ;INT0矢量地址 LJMP RACE ;由开始抢答按钮引起的开始抢答阶段中断处理 ORG 0013H ;INT1矢量地址 LJMP ADJ1 ;由打开计分板按钮引起的查看计分板处理 ORG 000BH ;T0中断入口 LJMP TT0 ;转到T0中断服务程序 ORG 001BH ;T1中断入口 LJMP TT1 ;转到T1中断服务程序 ;****** 主程序开始 ************************************************** ORGH 0040h ;主程序入口 MAIN: MOV SP,#0A0H ;设置堆栈指针 MOV 20H,#0AH ;设置中断次数 MOV R7,#03H ;设置半秒标志 MOV 30H,#00H ;分单元清0 MOV 31H,#00H ;秒单元清0 MOV 32H,#00H ;毫秒单元清0 MOV 33H,#00H ;目标选手单元清0 MOV 34H,#00H ;1号选手计分单元清0 MOV 35H,#00H ;2号选手计分单元清0 MOV 36H,#00H ;3号选手计分单元清0 MOV 37H,#00H ;4号选手计分单元清0 MOV DPTR,#SEGTAB ;DPTR指向LED段码表首地址SEGTAB MOV TMOD,#11H ;设置T0、T1工作方式都为1 SETB EX0 ;允许INT0中断 CLR IT0 ;设INT0用负边沿触发 CLR IT1 ;设INT1用负边沿触发 SETB ET0 ;允许T0中断 SETB ET1 ;允许T1中断 SETB EA ;中断总控开启 CLR P1 LOP: SJMP LOP ;****** 计时判定阶段开始 ************************************************** ADJ1: PUSH PSW ;保护中断现场(PSW数据进栈) PUSH ACC ;保护中断现场(ACC数据进栈) MOV R0,#34H ;将R0指针赋初值为1号选手 DIS1: MOV R1,@R0 ;将目标位得分存入R1 ;显示选手x编号及分数------------------- PREV1: JB P3.4,NEXT1 ;上一位键未按下,则转跳到判下一位键 JNB P3.4,$ ;上一位键按下,则等待放开上一位键 MOV A,R0 ;将当前选手编号,送到A寄存器 DEC A ;上一位 DA A ;十进制调整 MOV R0,A ;存回选手指针 CJNE A,#033H,DIS1 ;防止R0指针溢出 MOV R0,#37H SJMP DIS1 ;返回主程序 NEXT1: JB P3.5,INC1 ;下一位未按下,则转跳到判增量键 JNB P3.5,$ ;下一位按下,则等待放开下一位键 MOV A,R0 ;将当前选手编号,送到A寄存器 INC A ;下一位 DA A ;十进制调整 MOV R0,A ;存回选手指针 CJNE A,#038H,DIS1 ;防止R0指针溢出 MOV R0,#34H SJMP DIS1 ;返回主程序 INC1: JB P3.6,DES1 ;增量键未按下,则转跳到减量键 JNB P3.6,$ ;增量键按下,则等待放开增量键 MOV A,@R0 ;将当前选手分数,送到A寄存器 INC A ;分数加一 DA A ;十进制调整 MOV @R0,A ;存回分数 CJNE A,#064H,DIS1 ;防止分数溢出 MOV R0,#63H SJMP DIS1 ;返回主程序 DES1: JB P3.7,BKTM ;减量键未按下,则转跳到返回键判定 JNB P3.7,$ ;减量键按下,则等待放开减量键 MOV A,@R0 ;将当前选手分数,送到A寄存器 CJNE A,#00H,DIS1 ;为0不处理直接跳转 DEC A ;分数减一 DA A ;十进制调整 MOV @R0,A ;存回分数 SJMP DIS1 ;返回主程序 BKTM: JB P3.1,DIS1 ;返回键未按下,则转跳到DIS1等待按键 JNB P3.1,$ ;返回键按下,则等待放开返回键 SJMP RETI1 ;直接返回主程序 RETI1: POP ACC ;恢复中断入口时现场ACC POP PSW ;恢复中断入口时现场PSW RETI ;****** 计时抢答阶段开始 ************************************************** RACE: PUSH PSW ;保护中断现场(PSW数据进栈) PUSH ACC ;保护中断现场(ACC数据进栈) SETB TR0 ;T0开始计时 LOP2: ;显示时间 C1: JB P1.0,C2 ;1号未按下,则转跳判2号 MOV 33H,#01H ;选中1号选手 MOV R0,#34H MOV P1,#02H ;点亮1号灯 LJMP ADJ2 C2: JB P1.2,C3 ;2号未按下,则转跳判3号 MOV 33H,#02H; 选中2号选手 MOV R0,#35H MOV P1,#080H ;点亮2号灯 LJMP ADJ2 C3: JB P1.4,C4 ;3号未按下,则转跳判4号 MOV 33H,#03H ;选中3号选手 MOV R0,#36H MOV P1,#020H ;点亮3号灯 LJMP ADJ2 C4: JB P1.6,LOP2 ;4号未按下,跳回循环 MOV 33H,#04H ;选中4号选手 MOV R0,#37H MOV P1,#080H ;点亮4号灯 LJMP ADJ2 ;****** 计时判定阶段开始 ************************************************** ADJ2: CLR TR0 ;暂停T0计时 ;蜂鸣器响若干秒------------ DIS2: MOV R1,@R0 ;将目标位得分存入R1 ;显示选手x编号及分数------------------- PREV2: JB P3.4,NEXT2 ;上一位键未按下,则转跳到判下一位键 JNB P3.4,$ ;上一位键按下,则等待放开上一位键 MOV A,R0 ;将当前选手编号,送到A寄存器 DEC A ;上一位 DA A ;十进制调整 MOV R0,A ;存回选手指针 CJNE A,#033H,DIS2 ;防止R0指针溢出 MOV R0,#37H SJMP DIS2 ;返回DIS2等待按键 NEXT2: JB P3.5,INC2 ;下一位未按下,则转跳到判增量键 JNB P3.5,$ ;下一位按下,则等待放开下一位键 MOV A,R0 ;将当前选手编号,送到A寄存器 INC A ;下一位 DA A ;十进制调整 MOV R0,A ;存回选手指针 CJNE A,#038H,DIS2 ;防止R0指针溢出 MOV R0,#34H SJMP DIS2 ;返回DIS2等待按键 INC2: JB P3.6,DECC2 ;增量键未按下,则转跳到减量键 JNB P3.6,$ ;增量键按下,则等待放开增量键 MOV A,@R0 ;将当前选手分数,送到A寄存器 INC A ;分数加一 DA A ;十进制调整 MOV @R0,A ;存回分数 CJNE A,#064H,RETI2 ;防止分数溢出 MOV R0,#63H SJMP RETI2 ;返回主程序 DES2: JB P3.7,COTN ;减量键未按下,则转跳到继续计时判定 JNB P3.7,$ ;减量键按下,则等待放开减量键 MOV A,@R0 ;将当前选手分数,送到A寄存器 CJNE A,#00H,RETI2 ;为0不处理直接跳转 DEC A ;分数减一 DA A ;十进制调整 MOV @R0,A ;存回分数 SJMP RETI2 ;返回主程序 COTN: JB P3.0,BKTM ;继续计时键未按下,则转跳到返回键判定 JNB P3.0,$ ;继续计时键按下,则等待放开继续计时键 SETB TR0 ;开启T0 CLR P1 ;重置P0输入 LJMP LOP2 ;继续进入等待回答阶段 BKTM: JB P3.1,ADJ2 ;返回键未按下,则转跳到ADJ2等待按键 JNB P3.1,$ ;返回键按下,则等待放开返回键 SJMP RETI2 ;直接返回主程序 RETI2: ;显示屏内容不变 亮若干秒-------------------- MOV 30H,#00H ;分单元清0 MOV 31H,#00H ;秒单元清0 MOV 32H,#00H ;毫秒单元清0 CLR P1 ;灭灯 POP ACC ;恢复中断入口时现场ACC POP PSW ;恢复中断入口时现场PSW RETI ;****** LED数码管段码表 ************************************************** ORG 2000H ;段码表定位在2000H开始的内存处 SEGTAB1: DB 00H,00H,00H,00H,050H,04CH,041H,059H,045H,052H,00H,00H,,00H,00H,00H,00H ;第一行段码表 player
Transynther/x86/_processed/AVXALIGN/_ht_zr_un_/i3-7100_9_0x84_notsx.log_21829_1083.asm
ljhsiun2/medusa
9
25673
.global s_prepare_buffers s_prepare_buffers: push %r13 push %r8 push %r9 push %rbp push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_normal_ht+0x19e92, %rbp nop nop nop nop xor $21689, %rdx and $0xffffffffffffffc0, %rbp movaps (%rbp), %xmm0 vpextrq $1, %xmm0, %r9 nop nop dec %r8 lea addresses_UC_ht+0x51f2, %r8 xor $18028, %rbx mov $0x6162636465666768, %rcx movq %rcx, %xmm1 vmovups %ymm1, (%r8) nop nop nop nop cmp %rbx, %rbx lea addresses_D_ht+0x13bf2, %rdx nop nop nop nop and %r13, %r13 mov (%rdx), %ebp nop nop nop nop xor %rcx, %rcx lea addresses_UC_ht+0x1d2f2, %rsi lea addresses_normal_ht+0xc740, %rdi nop nop nop nop sub $32699, %rdx mov $39, %rcx rep movsq nop nop nop inc %rbp pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %rbp pop %r9 pop %r8 pop %r13 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r13 push %r8 push %rcx push %rdx // Load lea addresses_D+0xb5f2, %r13 nop cmp $59651, %r12 mov (%r13), %r11 nop nop xor $34292, %r13 // Faulty Load lea addresses_WC+0x187f2, %rcx cmp %r12, %r12 movaps (%rcx), %xmm7 vpextrq $1, %xmm7, %rdx lea oracles, %r8 and $0xff, %rdx shlq $12, %rdx mov (%r8,%rdx,1), %rdx pop %rdx pop %rcx pop %r8 pop %r13 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_WC', 'same': False, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_D', 'same': False, 'size': 8, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_WC', 'same': True, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 16, 'congruent': 4, 'NT': True, 'AVXalign': True}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 32, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_D_ht', 'same': False, 'size': 4, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_UC_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM'} {'00': 18870, '99': 1, '44': 2958} 00 44 44 00 00 44 00 00 00 44 00 00 00 00 00 44 00 44 00 00 00 00 00 44 00 00 00 00 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 44 00 44 00 00 00 00 00 00 00 00 44 00 44 00 00 44 00 00 44 00 00 00 00 44 00 00 44 00 44 44 00 44 44 00 44 00 44 00 00 44 00 00 00 00 00 00 00 00 00 00 44 00 00 00 00 00 44 00 00 44 00 00 00 00 00 00 00 44 00 00 00 00 44 00 00 00 00 00 00 00 00 00 00 44 00 00 00 00 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 44 00 00 00 00 00 00 44 00 00 44 00 00 00 00 00 00 00 00 00 00 44 00 00 44 00 44 00 00 00 00 00 00 00 00 00 00 00 00 44 00 00 00 00 00 00 00 44 00 00 00 00 00 44 00 44 00 00 00 00 00 00 00 00 00 44 00 00 44 44 00 44 00 00 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 44 00 00 00 00 00 00 00 00 00 00 44 00 00 00 00 44 00 00 00 00 00 00 00 44 00 00 00 00 00 44 00 00 00 00 00 00 44 00 00 00 00 00 00 44 00 00 00 44 00 44 00 44 00 00 00 00 00 00 00 00 00 00 44 00 00 00 00 00 00 00 00 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 44 00 44 00 00 00 00 00 00 00 00 44 00 44 00 00 00 00 44 00 00 00 00 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 44 00 00 00 00 44 00 00 00 00 00 00 00 00 00 00 00 44 00 00 00 00 00 44 00 44 00 00 44 00 44 00 44 00 00 00 00 00 44 00 44 00 00 44 00 00 00 00 44 00 00 00 00 00 00 00 44 00 00 00 00 00 00 00 44 00 00 00 00 00 44 00 44 00 00 00 00 00 00 00 44 00 00 00 00 00 44 00 44 00 44 44 00 00 00 00 00 44 00 00 44 00 00 00 00 00 00 00 00 44 44 00 00 00 00 44 44 00 00 00 00 00 44 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 44 44 00 00 00 00 00 00 44 44 00 00 44 00 00 44 00 00 00 00 00 00 00 00 00 00 44 00 00 44 00 00 00 00 00 00 44 00 44 44 44 00 00 00 00 44 44 00 00 00 00 00 00 00 00 00 00 00 00 00 44 00 00 00 00 44 00 00 00 44 00 00 00 44 44 00 44 44 00 44 00 00 00 00 00 00 00 44 44 44 44 00 00 00 44 00 00 00 00 00 00 00 00 44 00 00 44 00 44 00 00 00 00 00 00 44 00 44 44 00 44 00 00 00 44 00 00 00 44 00 44 00 00 00 00 00 00 00 00 00 00 00 44 00 00 00 00 00 00 00 00 00 00 00 44 44 00 00 00 44 00 00 00 00 44 00 00 44 00 00 00 00 00 00 44 00 00 44 00 00 00 00 44 00 00 00 00 00 44 44 44 00 00 44 00 00 00 44 44 00 00 00 44 44 00 00 00 00 44 00 00 00 00 44 44 00 00 44 00 00 00 00 00 00 00 00 44 00 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 44 00 00 00 00 44 44 00 00 00 00 00 00 00 00 44 00 00 44 00 00 00 00 00 00 00 44 44 00 00 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 44 00 00 00 00 00 00 44 00 00 00 00 00 44 00 00 00 00 00 00 00 44 00 44 00 44 00 00 00 00 00 00 00 00 00 44 00 00 00 00 00 00 00 00 00 00 00 00 00 44 00 00 00 44 00 00 00 00 00 00 00 00 00 44 00 00 00 00 44 00 00 00 00 00 00 00 44 00 00 00 00 00 00 44 00 00 00 00 44 00 00 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 44 44 00 44 44 00 00 00 00 44 44 00 00 00 00 00 00 00 00 00 00 00 44 00 44 00 00 00 00 00 00 00 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 44 44 00 00 00 00 44 00 44 00 00 44 */
audio/sfx/cry0f_2.asm
AmateurPanda92/pokemon-rby-dx
9
100335
SFX_Cry0F_2_Ch4: dutycycle 241 squarenote 4, 15, 7, 1984 squarenote 12, 14, 6, 1986 squarenote 6, 11, 5, 1664 squarenote 4, 12, 4, 1648 squarenote 4, 11, 5, 1632 squarenote 8, 12, 1, 1600 endchannel SFX_Cry0F_2_Ch5: dutycycle 204 squarenote 3, 12, 7, 1921 squarenote 12, 11, 6, 1920 squarenote 6, 10, 5, 1601 squarenote 4, 12, 4, 1586 squarenote 6, 11, 5, 1569 squarenote 8, 10, 1, 1538 endchannel SFX_Cry0F_2_Ch7: noisenote 3, 14, 4, 60 noisenote 12, 13, 6, 44 noisenote 4, 14, 4, 60 noisenote 8, 11, 7, 92 noisenote 15, 12, 2, 93 endchannel
test/succeed/EqTest.agda
larrytheliquid/agda
1
14592
<reponame>larrytheliquid/agda module EqTest where import Common.Level data _≡_ {a : Set} (x : a) : a -> Set where refl : x ≡ x data Maybe (a : Set) : Set where just : a -> Maybe a nothing : Maybe a data ℕ : Set where zero : ℕ suc : ℕ -> ℕ _≟_ : (x y : ℕ) -> Maybe (x ≡ y) suc m ≟ suc n with m ≟ n suc .n ≟ suc n | just refl = just refl suc m ≟ suc n | nothing = nothing zero ≟ suc _ = nothing suc m ≟ zero = nothing zero ≟ zero = just refl
oeis/279/A279512.asm
neoneye/loda-programs
11
81783
<filename>oeis/279/A279512.asm ; A279512: Sierpinski octahedron numbers a(n) = 2*6^n + 3*2^n + 1. ; Submitted by <NAME>(s4) ; 6,19,85,457,2641,15649,93505,560257,3360001,20156929,120935425,725600257,4353576961,26121412609,156728377345,940370067457,5642220011521,33853319282689,203119914123265,1218719481593857,7312316883271681,43873901287047169,263243407697117185,1579460446132371457,9476762676693565441,56860576059960066049,341163456359357743105,2046980738155341152257,12281884428930436300801,73691306573579396579329,442147839441469937025025,2652887036648806737248257,15917322219892814653685761,95503933319356836382507009 mov $1,6 pow $1,$0 mov $2,2 pow $2,$0 add $1,$2 mul $1,2 add $2,$1 mov $0,$2 add $0,1
oeis/062/A062032.asm
neoneye/loda-programs
11
11125
<reponame>neoneye/loda-programs ; A062032: Group odd numbers into (1), (3,5), (7,9,11),(13,15,17,19),...; a(n) = product of n-th group. ; Submitted by <NAME> ; 1,15,693,62985,9454725,2118331215,662496582825,275735605996305,147364622598587625,98358760729571316975,80185770642041047108125,78405694972326706112753625,90569612902695107431619494125,122020670469540010360975931523375,189638875693941730653122520269900625,336765794407897713089531089975166606625,677666308748522374466718750262522792940625,1533902160855603325142021857396482577844919375,3880026105376272217523401585679893053989818453125,10904030528404354017880431725709033730338309610355625 mov $4,$0 add $4,1 mov $5,$0 lpb $4 mov $0,$5 sub $4,1 sub $0,$4 add $0,1 mov $1,1 lpb $0 mov $3,$2 lpb $3 add $2,1 div $3,$2 lpe sub $0,1 add $2,1 mul $1,$2 lpe lpe mov $0,$1
tests/docs_examples/po_disp.asm
fengjixuchui/sjasmplus
220
100240
DEVICE ZXSPECTRUM48 SCREEN EQU $4000 ORG $8000 LD HL,BEGIN LD DE,SCREEN LD BC,ENDOFPROG-BEGIN LDIR JP SCREEN BEGIN DISP SCREEN ;code will compile for address $4000, but to the current ORG MARKA DEC A HALT JP NZ,MARKA DI HALT ENT ENDOFPROG ASSERT $800E == BEGIN && $8015 == ENDOFPROG && $4000 == MARKA ASSERT $76 == {B $800F} ; HALT instruction lands at $800F (BEGIN+1)
programs/oeis/130/A130750.asm
neoneye/loda
22
84922
; A130750: Binomial transform of A010882. ; 1,3,8,17,33,64,127,255,512,1025,2049,4096,8191,16383,32768,65537,131073,262144,524287,1048575,2097152,4194305,8388609,16777216,33554431,67108863,134217728,268435457,536870913,1073741824,2147483647,4294967295,8589934592,17179869185,34359738369,68719476736,137438953471,274877906943,549755813888,1099511627777,2199023255553,4398046511104,8796093022207,17592186044415,35184372088832,70368744177665,140737488355329,281474976710656,562949953421311,1125899906842623,2251799813685248,4503599627370497,9007199254740993,18014398509481984,36028797018963967,72057594037927935,144115188075855872,288230376151711745,576460752303423489,1152921504606846976,2305843009213693951,4611686018427387903,9223372036854775808,18446744073709551617,36893488147419103233,73786976294838206464,147573952589676412927,295147905179352825855,590295810358705651712,1180591620717411303425,2361183241434822606849,4722366482869645213696,9444732965739290427391,18889465931478580854783,37778931862957161709568,75557863725914323419137,151115727451828646838273,302231454903657293676544,604462909807314587353087,1208925819614629174706175,2417851639229258349412352,4835703278458516698824705,9671406556917033397649409,19342813113834066795298816,38685626227668133590597631,77371252455336267181195263,154742504910672534362390528,309485009821345068724781057,618970019642690137449562113,1237940039285380274899124224,2475880078570760549798248447,4951760157141521099596496895,9903520314283042199192993792,19807040628566084398385987585,39614081257132168796771975169,79228162514264337593543950336,158456325028528675187087900671,316912650057057350374175801343,633825300114114700748351602688,1267650600228229401496703205377 mov $4,$0 add $4,1 sub $4,$0 mul $0,2 add $0,1 mov $1,1 mov $2,$4 add $2,2 mov $3,$4 lpb $0 trn $0,2 sub $3,$1 add $1,$3 add $3,$2 mul $2,2 lpe mov $0,$1
src/rendering.asm
Gegel85/BTTGB
1
87439
; Load all sprites and put thems inside the VRam ; Params: ; None ; Return: ; None ; Registers: ; af -> Not preserved ; bc -> Not preserved ; de -> Not preserved ; hl -> Not preserved loadSprites:: ld de, VRAM_START + $10 ld bc, $10 ld a, $FF call fillMemory ; Load font into VRAM ld a, 1 ld hl, textAssets + $20 * $08 ld bc, textAssetsEnd - (textAssets + $20 * $08) ld de, VRAM_START + $20 * $10 call uncompress ld bc, $20 xor a call fillMemory xor a ld de, $8800 ld hl, EpitechLogo ld bc, EpitechLogoEnd - EpitechLogo call uncompress ; Load JAM letters into VRAM xor a ld hl, JAMLetters ld bc, JAMLettersEnd - JAMLetters jp uncompress ; Change the GBC palette ; Params: ; a -> The index of the palette ; hl -> New palette to load ; e -> The lowest byte of the address to stream palette index ; bc -> The size of the palette ; Return: ; None ; Registers: ; af -> Not preserved ; bc -> Not preserved ; de -> Not preserved ; hl -> Not preserved setGBCPalette:: ; Check if on Gameboy or Gameboy Color ld d, a ld a, [HARDWARE_TYPE] or a ; If we are on Gameboy, no need to change palette ret z .noCheck: ld a, d ; Enable auto increment set 7, a ; Load index to palette index ld d, $FF ld [de], a ; Stream data to the palette data inc de jp copyMemorySingleAddr
3term/Programming/5/lab.asm
nik-sergeson/bsuir-informatics-labs
0
168878
.model small .stack 100h .data file_name db 'input.txt',0 output_file db 'output.txt',0 string dw 80 dup(0) outstr dw 80 dup(0) endline db 13,10,'$' numerator dw 80 dup(0) nnumetatot dw 2,4,8,3,6,9,1,1,7 denominator dw 80 dup(0) rows db ? cols db ? size db ? curopnum dw ? curopden dw ? factornum dw 1 factordenom dw 1 needswap db 0 swaptime db 0 digit DW 10 negvalue db 0 .code gcd proc PUSH AX PUSH BX PUSH CX PUSH DX PUSH BP MOV BP,SP xor BX,BX mov DX,[BP+12] mov CX,[BP+14] cmp CX,0 je zeronum test CX,CX jns posit inc BX neg CX posit: cmp DX,CX jg greater jmp gcdcycle greater: mov AX,CX mov CX,DX mov DX,AX xor AX,AX gcdcycle: mov AX,CX mov CX,DX xor DX,DX idiv CX cmp DX,0 je endgcd jmp gcdcycle endgcd: xor DX,DX mov AX,[BP+12] idiv CX mov [BP+12],AX xor DX,DX mov AX,[BP+14] test AX,AX jns notpos neg AX mov BX,1 notpos: idiv CX cmp BX,1 jne truenotposit neg AX truenotposit: mov [BP+14],AX jmp backup zeronum: mov [BP+12],DX mov [BP+14],CX backup: MOV SP,BP POP BP POP DX POP CX POP BX POP AX RET gcd endp swap proc PUSH AX PUSH BX PUSH CX PUSH DX push DI push SI mov SI,DI mov BL,[rows] sub BX,CX xor AX,AX mov AL,[rows] xor DX,DX mov DL,[swaptime] movecycle: dec DX add SI,AX add SI,AX cmp DX,0 jne movecycle swapcycle: mov AX,numerator[SI] mov CX,numerator[DI] mov numerator[SI],CX mov numerator[DI],AX mov AX,denominator[SI] mov CX,denominator[DI] mov denominator[SI],CX mov denominator[DI],AX dec BX cmp BX,0 je endswap add SI,2 add DI,2 jmp swapcycle endswap: pop SI pop DI POP DX POP CX POP BX POP AX RET swap endp findsi proc push BX xor BX,BX MOV BL,[cols] dec CX mov AX,CX imul BL add AX,CX mov BL,2 imul BL mov SI,AX inc CX pop BX RET findsi endp Outsymbol PROC PUSH AX PUSH BX PUSH CX PUSH DX PUSH BP MOV BP,SP MOV CX,0 MOV DX,0 MOV AX,[BP+12] TEST AX,AX JNS Out_a MOV SI,1 NEG AX Out_a: DIV digit PUSH DX MOV DX,0 INC CX CMP AX,0 JE Out_end JMP Out_a Out_end: CMP SI,1 JNE Print MOV DL,45 MOV AH,02h int 21h mov AX,DX stosb Print: POP DX ADD DX,48 mov AX,DX stosb MOV AH,02h int 21h LOOP Print MOV SP,BP POP BP POP DX POP CX POP BX POP AX RET Outsymbol ENDP start: mov AX, @data mov DS, AX mov ES, AX mov AH,3Dh xor AL,AL mov DX,offset file_name int 21h jc exit xor CX,CX mov BX,AX mov ah,3FH mov DX,offset string mov CX,80 int 21h cmp ax,cx;jnz close mov [size],AL add bx,ax mov byte ptr string[bx],'$' mov SI,offset string XOR CX,CX xor DX,DX sizeloop1: xor AX,AX lodsb cmp AL,' ' je endsizeloop1 mov CX,AX sub CX,48 mov AL,10 mul DL mov DL,AL add DX,CX jmp sizeloop1 endsizeloop1: MOV [rows], DL XOR CX,CX xor DX,DX sizeloop2: xor AX,AX lodsb cmp AL,' ' je endsizeloop2 mov CX,AX sub CX,48 mov AL,10 mul DL mov DL,AL add DX,CX jmp sizeloop2 endsizeloop2: MOV [cols], DL XOR AX,AX mov BL,[size] sub BX,3 MOV DI,0 inarr: XOR CX,CX xor DX,DX numloop: dec BX cmp BX,0 je endnum xor AX,AX lodsb push DX push AX mov DX,AX mov AH,02h int 21h pop AX pop DX cmp AL,' ' je endnum cmp AL,'-' jne notnegative xor AX,AX mov AL,1 mov [negvalue],AL jmp numloop notnegative: mov CX,AX sub CX,48 mov AL,10 mul DL mov DL,AL add DX,CX jmp numloop endnum: mov numerator[DI],DX mov denominator[DI],1 xor AX,AX mov AL,[negvalue] cmp AL,1 jne endenter neg DX mov numerator[DI],DX xor DX,DX mov [negvalue],DL endenter: mov AX,DI mov DL,2 div DL xor AH,AH mov DL,[rows] div DL inc AH cmp AH,[rows] jne noenter mov AH,9 mov DX,offset endline int 21h noenter: XOR DX,DX ADD DI,2 cmp BX,0 je endinarr jmp numloop endinarr: xor DX,DX xor AX,CX xor BX,DX xor CX,CX mov DI,CX detercycle: inc CX cmp CL,[rows] je enddetcycle call findsi cmp numerator[SI],0 jne valrow mov CL,[swaptime] inc CX mov [swaptime],CL cmp CL,[rows] jne notdetnull xor CX,CX mov [factordenom],CX jmp enddetcycle notdetnull: dec CX mov DI,SI call swap mov DX,[factornum] neg DX mov [factornum],DX jmp detercycle valrow: xor AX,AX mov [swaptime],AL xor DX,DX mov AX,[factornum] mov BX,numerator[SI] imul BX mov [factornum],AX xor AX,AX xor DX,DX mov AX,[factordenom] mov BX,denominator[SI] mul BX mov [factordenom],AX mov BL,[cols] sub BX,CX mov DI,SI normrow: add DI,2 push BX mov AX,denominator[SI] mov BX,numerator[DI] imul BX mov numerator[DI],AX pop BX dec BX cmp BX,0 ja normrow mov BL,[cols] sub BX,CX mov DI,SI normrow2: add DI,2 push BX mov AX,numerator[SI] test AX,AX jns plussign1 neg AX mov BX,numerator[DI] neg BX mov numerator[DI],BX plussign1: mov BX,denominator[DI] mul BX mov denominator[DI],AX pop BX dec BX cmp BX,0 ja normrow2 mov numerator[SI],1 mov denominator[SI],1 add SI,2 mov BL,[cols] sub BX,CX optimrow: mov AX,numerator[SI] mov DX,denominator[SI] push AX push DX call gcd pop DX pop AX mov numerator[SI],AX mov denominator[SI],DX dec BX add SI,2 cmp BX,0 ja optimrow call findsi mov DI,SI XOR DX,DX mov DL,[cols] add DI, DX add DI, DX sub DI,CX sub DI,CX matradd: ;;;;;;;;;;;;;;;;;; call findsi add DI,CX add DI,CX mov BL,[cols] sub BX,CX inc BX mov AX,numerator[DI] mov DX,denominator[DI] mov [curopnum],AX mov [curopden],DX xor AX,AX xor DX,DX push CX rowadd: push BX mov AX,numerator[DI] mov BX,denominator[SI] imul BX mov BX,[curopden] imul BX mov CX,AX xor AX,AX mov AX,numerator[SI] mov BX,[curopnum] imul BX mov BX,denominator[DI] imul BX sub CX,AX mov numerator[DI],CX xor AX,AX xor DX,DX mov AX,denominator[DI] mov BX,denominator[SI] imul BX mov BX,[curopden] imul BX mov denominator[DI],AX pop BX mov AX,numerator[DI] mov DX,denominator[DI];; push AX push DX call gcd pop DX pop AX mov numerator[DI],AX mov denominator[DI],DX xor CX,CX mov CL,[rows] inc CX add CX,CX mov AX,DI div CL pop CX cmp AX,CX jne notcentral push CX mov DX,numerator[DI] cmp DX,0 jne notcentral mov CX,2 mov [needswap],CL notcentral: push CX dec BX cmp BX,0 je endrowadd add SI,2 add DI,2 jmp rowadd endrowadd: mov DL,[needswap] dec DX cmp DX,0 jne nocycle mov [needswap],DL pop CX push CX push DI mov DL,[rows] sub DI,DX sub DI,DX sub DI,DX sub DI,DX add DI,2 add DI,CX add DI,CX xor DX,DX mov DL,1 mov [swaptime],DL call swap xor DX,DX mov [swaptime],DL xor DX,DX mov DX,[factornum] neg DX mov [factornum],DX pop DI jmp noswap nocycle: mov [needswap],DL noswap: mov AL,[rows] mov DL,AL mul DL add AX,AX sub AX,2 pop CX push CX cmp AX,DI ja matradd pop CX jmp detercycle enddetcycle: xor AX,AX xor DX,DX mov DL,[rows] mov AL,[cols] mul DL mov CX,AX dec CX mov SI,CX add SI,CX mov AX,[factornum] mov BX,numerator[SI] imul BX push AX mov AX,[factordenom] mov BX, denominator[SI] mul BX push AX call gcd pop CX pop BX xor SI,SI mov DI,offset outstr test BX,BX push BX call outsymbol pop BX mov ah,3Ch mov dx,offset output_file xor CX,CX int 21h mov BX,AX mov AH,40h mov DX,offset outstr mov CL,[size] int 21h closefile: mov AH,3Eh int 21h MOV AH,01h int 21h exit: mov ax,4Ch int 21h end start
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_1838.asm
ljhsiun2/medusa
9
28437
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r14 push %r9 push %rcx push %rdi push %rdx push %rsi lea addresses_UC_ht+0xab9b, %r10 nop sub $18332, %rcx mov $0x6162636465666768, %rsi movq %rsi, %xmm2 movups %xmm2, (%r10) nop nop nop nop cmp %r9, %r9 lea addresses_normal_ht+0x1881b, %rsi lea addresses_WT_ht+0x117a5, %rdi inc %r9 mov $38, %rcx rep movsb nop nop nop dec %rsi lea addresses_WC_ht+0x1e81b, %rsi lea addresses_WC_ht+0x1cf3, %rdi nop nop nop add $40192, %r11 mov $30, %rcx rep movsl nop nop nop nop nop cmp $42756, %r10 lea addresses_A_ht+0xc61b, %rsi lea addresses_UC_ht+0xde5b, %rdi nop nop nop nop cmp %r14, %r14 mov $32, %rcx rep movsl nop sub %r11, %r11 lea addresses_normal_ht+0x14903, %r10 nop nop nop nop cmp %rcx, %rcx mov $0x6162636465666768, %rsi movq %rsi, %xmm7 movups %xmm7, (%r10) nop nop nop add $59529, %rdi lea addresses_normal_ht+0xe91b, %rdi nop nop nop nop and %r10, %r10 mov $0x6162636465666768, %rcx movq %rcx, %xmm3 vmovups %ymm3, (%rdi) nop nop and $38748, %rcx lea addresses_normal_ht+0xbddb, %rsi lea addresses_D_ht+0x421b, %rdi nop and $13716, %rdx mov $103, %rcx rep movsl nop and %r11, %r11 pop %rsi pop %rdx pop %rdi pop %rcx pop %r9 pop %r14 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r12 push %r8 push %rax push %rcx push %rsi // Faulty Load lea addresses_WT+0xc61b, %rax nop nop nop nop nop sub %r8, %r8 movups (%rax), %xmm2 vpextrq $1, %xmm2, %rsi lea oracles, %rax and $0xff, %rsi shlq $12, %rsi mov (%rax,%rsi,1), %rsi pop %rsi pop %rcx pop %rax pop %r8 pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 4}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 9, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_WT_ht'}} {'OP': 'REPM', 'src': {'same': True, 'congruent': 9, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_WC_ht'}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 11, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 6, 'type': 'addresses_UC_ht'}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 3}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 8}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 8, 'type': 'addresses_D_ht'}} {'39': 21829} 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 */
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/specs/access1.ads
best08618/asylo
7
21872
-- { dg-do compile } package Access1 is type R; type S is access R; type R is new S; end Access1;
3-mid/opengl/source/lean/renderer/opengl-culler.adb
charlie5/lace
20
8311
package body openGL.Culler is procedure Viewer_is (Self : in out Item'Class; Now : in Renderer.lean.view) is begin Self.Viewer := Now.all'Access; end Viewer_is; function Viewer (Self : in Item'Class) return Renderer.lean.view is begin return Self.Viewer; end Viewer; end openGL.Culler;
Transynther/x86/_processed/US/_zr_/i7-8650U_0xd2.log_15641_1313.asm
ljhsiun2/medusa
9
245037
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r13 push %rax push %rcx push %rdi push %rdx push %rsi lea addresses_D_ht+0xcdbe, %rax clflush (%rax) nop nop nop nop nop and $36870, %rsi mov (%rax), %rdi nop nop xor $47658, %rdx lea addresses_WC_ht+0xc022, %r10 nop nop nop add %r11, %r11 movb (%r10), %r13b nop xor $50820, %rdx lea addresses_WT_ht+0x3dbe, %rsi lea addresses_normal_ht+0x1a83e, %rdi clflush (%rdi) nop nop nop nop nop add $49183, %r13 mov $109, %rcx rep movsw and $19332, %r10 lea addresses_UC_ht+0x17856, %rax nop nop nop dec %rdx mov $0x6162636465666768, %r11 movq %r11, %xmm2 vmovups %ymm2, (%rax) nop add $63663, %r11 lea addresses_UC_ht+0x668e, %rsi lea addresses_A_ht+0x3dfe, %rdi nop nop nop nop nop and %r10, %r10 mov $13, %rcx rep movsb cmp %rdx, %rdx lea addresses_D_ht+0x11dbe, %rdi nop nop nop nop nop and %rdx, %rdx movb $0x61, (%rdi) nop nop nop nop cmp $51178, %r13 lea addresses_WT_ht+0x12dbe, %rsi lea addresses_A_ht+0xbe, %rdi nop nop nop nop nop add $53505, %rdx mov $44, %rcx rep movsw nop add $49003, %rcx pop %rsi pop %rdx pop %rdi pop %rcx pop %rax pop %r13 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %r14 push %r15 push %r9 push %rbx push %rdx // Store lea addresses_D+0x1743a, %rbx sub %r15, %r15 movl $0x51525354, (%rbx) nop cmp $6436, %r12 // Store lea addresses_normal+0xdbe, %rbx nop nop nop nop nop dec %rdx movl $0x51525354, (%rbx) nop cmp %r14, %r14 // Load lea addresses_WC+0x266e, %r14 sub $17088, %r15 vmovups (%r14), %ymm0 vextracti128 $0, %ymm0, %xmm0 vpextrq $1, %xmm0, %r12 nop nop nop xor %r14, %r14 // Faulty Load lea addresses_US+0x15dbe, %rbx xor $23310, %r9 movups (%rbx), %xmm3 vpextrq $1, %xmm3, %rdx lea oracles, %r14 and $0xff, %rdx shlq $12, %rdx mov (%r14,%rdx,1), %rdx pop %rdx pop %rbx pop %r9 pop %r15 pop %r14 pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D', 'size': 4, 'AVXalign': False, 'NT': True, 'congruent': 2, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 1, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}} {'00': 15641} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 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/main/antlr4/AlogicParser.g4
peterderivaz/alogic-1
0
4899
<reponame>peterderivaz/alogic-1 //////////////////////////////////////////////////////////////////////////////// // Argon Design Ltd. Project P8009 Alogic // Copyright (c) 2017-2019 Argon Design Ltd. All rights reserved. // // This file is covered by the BSD (with attribution) license. // See the LICENSE file for the precise wording of the license. // // Module: Alogic Compiler // Author: <NAME>/<NAME> // // DESCRIPTION: // // Antlr4 parser grammar for Alogic //////////////////////////////////////////////////////////////////////////////// parser grammar AlogicParser; options { tokenVocab = AlogicLexer; contextSuperClass = com.argondesign.alogic.antlr.AlogicParserRuleContext; } //////////////////////////////////////////////////////////////////////////////// // Start rule for whole source file (aka package, but 'package' is a keyword) //////////////////////////////////////////////////////////////////////////////// file : pkg* EOF ; //////////////////////////////////////////////////////////////////////////////// // Identifiers //////////////////////////////////////////////////////////////////////////////// ident : IDENTIFIER ('#' '[' expr (',' expr)* ']')? ; //////////////////////////////////////////////////////////////////////////////// // Descriptions (introducing a name) //////////////////////////////////////////////////////////////////////////////// desc : attributes? descbase ; attributes : '(*' attr (',' attr)* '*)' ; attr : IDENTIFIER # AttrBool | IDENTIFIER '=' expr # AttrExpr ; descbase : (sttc='static')? expr ident ('=' init=expr)? ';' # DescVar | in='in' fct? (spec=expr | 'pipeline') ident? ';' # DescIn | out='out' fct? stt? (spec=expr | 'pipeline') ident? ('=' init=expr)? ';' # DescOut | 'pipeline' expr ident ';' # DescPipeVar | 'param' expr ident ('=' init=expr)? ';' # DescParam | 'param' 'type' ident ('=' init=expr)? ';' # DescParamType | 'const' expr ident '=' expr ';' # DescConst | expr ident '[' expr ']' ';' # DescArr | 'sram' (wire='wire')? expr ident '[' expr ']' ';' # DescSram | 'typedef' expr ident ';' # DescType | entity_keyword ident '{' ent* '}' # DescEntity | 'struct' ident '{' rec* '}' # DescRecord | ident '=' 'new' expr ';' # DescInstance | 'new' entity_keyword ident '{' ent* '}' # DescSingleton | (stat='static')? expr ident '(' formal_arguments? cpar=')' '{' stmt* '}' # DescFuncAlogic | 'import' expr IDENTIFIER '('formal_arguments? ')' ';' # DescFuncImport | 'gen' 'if' '(' conds+=expr cpar=')' (':' ident)? '{' thenItemss+=genitems '}' ('else' 'if' '(' conds+=expr ')' '{' thenItemss+=genitems '}')* ('else' '{' elseItems=genitems '}')? # DescGenIf | 'gen' 'for' '(' ginits ';' expr ';' lsteps cpar=')' (':' ident)? '{' genitems '}' # DescGenFor | 'gen' 'for' '(' expr IDENTIFIER op=('<' | '<=') expr cpar=')' (':' ident)? '{' genitems '}' # DescGenRange ; fct : 'sync' # FCTSync | SYNC_READY # FCTSyncReady ; slices : (slice+=('bubble' | 'fslice' | 'bslice'))+ ; stt : 'wire' # STTWire | slices # STTSlices ; entity_keyword : 'fsm' | 'network' | 'verbatim' 'entity' ; formal_arguments : expr IDENTIFIER (',' expr IDENTIFIER)* ; genitems : genitem* ; genitem : desc # GenItemDesc | imprt # GenItemImport | using # GenItemUsing | from # GenItemFrom | assertion # GenItemAssertion | pkg # GenItemPkg | ent # GenItemEnt | rec # GenItemRec | stmt # GenItemStmt | kase # GenItemCase ; ginits : ginit (',' ginit)* ; ginit : expr IDENTIFIER point='=' expr ; //////////////////////////////////////////////////////////////////////////////// // Imports //////////////////////////////////////////////////////////////////////////////// imprt : 'import' STRING 'as' ident ';' # ImportOne ; //////////////////////////////////////////////////////////////////////////////// // Using //////////////////////////////////////////////////////////////////////////////// using : 'using' expr ('as' ident)? ';' # UsingOne | 'using' expr '.' '*' ';' # UsingAll ; //////////////////////////////////////////////////////////////////////////////// // From (sugar for import + using) //////////////////////////////////////////////////////////////////////////////// from : 'from' STRING 'import' expr ('as' ident)? ';' # FromOne | 'from' STRING 'import' '*' ';' # FromAll ; //////////////////////////////////////////////////////////////////////////////// // Assertions //////////////////////////////////////////////////////////////////////////////// assertion : 'assert' expr (',' STRING)? ';' # AssertionAssert | 'static' 'assert' expr (',' STRING)? ';' # AssertionStatic ; //////////////////////////////////////////////////////////////////////////////// // Package (file) contents //////////////////////////////////////////////////////////////////////////////// pkg : desc # PkgDesc | imprt # PkgImport | using # PkgUsing | from # PkgFrom | assertion # PkgAssertion | 'compile' expr ('as' ident)? ';' # PkgCompile ; //////////////////////////////////////////////////////////////////////////////// // Entity contents //////////////////////////////////////////////////////////////////////////////// ent : desc # EntDesc | imprt # EntImport | using # EntUsing | from # EntFrom | assertion # EntAssertion | lhs=expr point='->' rhs+=expr (',' rhs+=expr)* ';' # EntConnect | 'fence' '{' stmt* '}' # EntFenceBlock | 'verbatim' IDENTIFIER VERBATIM_BODY # EntVerbatimBlock ; //////////////////////////////////////////////////////////////////////////////// // Record contents //////////////////////////////////////////////////////////////////////////////// rec : desc # RecDesc | imprt # RecImport | using # RecUsing | from # RecFrom | assertion # RecAssertion ; //////////////////////////////////////////////////////////////////////////////// // Statements //////////////////////////////////////////////////////////////////////////////// stmt : desc # StmtDesc | imprt # StmtImport | using # StmtUsing | from # StmtFrom | assertion # StmtAssertion | '{' stmt* '}' # StmtBlock | 'if' '(' expr ')' thenStmt=stmt ('else' elseStmt=stmt)? # StmtIf | 'case' '(' expr ')' '{' kase* '}' # StmtCase | 'loop' '{' stmt* '}' # StmtLoop | 'do' '{' stmt* '}' 'while' '(' expr ')' ';' # StmtDo | 'while' '(' expr ')' '{' stmt* '}' # StmtWhile | 'for' '(' linits? ';' expr? ';' lsteps? ')' '{' stmt* '}' # StmtFor | 'let' '(' linits ')' stmt # StmtLet | 'fence' ';' # StmtFence | 'break' ';' # StmtBreak | 'continue' ';' # StmtContinue | 'goto' expr ';' # StmtGoto | 'return' expr? ';' # StmtReturn | expr point='=' expr ';' # StmtAssign | expr ASSIGNOP expr ';' # StmtUpdate | expr op=('++'|'--') ';' # StmtPost | expr ';' # StmtExpr | 'wait' expr? ';' # StmtWait ; kase : desc # CaseDesc // This is here to supprot 'gen' only | expr (',' expr)* ':' stmt # CaseRegular | 'default' ':' stmt # CaseDefault ; linits : linit (',' linit)* ; linit : expr point='=' expr # LoopInitAssign | expr IDENTIFIER point='=' expr # LoopInitDesc ; lsteps : lstep (',' lstep)* ; lstep : expr point='=' expr # LoopStepAssign | expr ASSIGNOP expr # LoopStepUpdate | expr op=('++'|'--') # LoopStepPost ; //////////////////////////////////////////////////////////////////////////////// // Expressions //////////////////////////////////////////////////////////////////////////////// expr : '(' expr ')' # ExprBracket // Literals | 'true' # ExprLitTrue | 'false' # ExprLitFalse | sign=('+' | '-')? SIZEDINT # ExprLitSizedInt | sign=('+' | '-')? UNSIZEDINT # ExprLitUnsizedInt | STRING # ExprLitString // Primitive types | 'bool' # ExprTypeBool | INTTYPE # ExprTypeSInt | UINTTYPE # ExprTypeUInt | 'int' # ExprTypeSNum | 'uint' # ExprTypeUNum | 'void' # ExprTypeVoid // Keywords | ('in' | 'out') # ExprKeyword | 'this' # ExprThis // Names | ident # ExprIdent | ATID # ExprAtid | DOLLARID # ExprDollarid // Call | expr point='(' args? ')' # ExprCall // Index/Slice | expr point='[' idx=expr ']' # ExprIndex | expr point='[' lidx=expr op=(':' | '-:' | '+:') ridx=expr ']' # ExprSlice // Select | expr point='.' (ident | inout=('in' | 'out')) # ExprDot // Operators | op=('+' | '-' | '~' | '!' | '&' | '|' | '^' | '\'' ) expr # ExprUnary | expr op='\'' expr # ExprBinary | expr op=('*' | '/' | '%') expr # ExprBinary | expr op=('+' | '-') expr # ExprBinary | expr op=('<<' | '>>' | '>>>' | '<<<' ) expr # ExprBinary | expr op=('>' | '>=' | '<' | '<=') expr # ExprBinary | expr op=('==' | '!=') expr # ExprBinary | expr op='&' expr # ExprBinary | expr op='^' expr # ExprBinary | expr op='|' expr # ExprBinary | expr op='&&' expr # ExprBinary | expr op='||' expr # ExprBinary |<assoc=right> expr point='?' expr ':' expr # ExprTernary | '{' expr s='{' expr (',' expr)* e='}' '}' # ExprRep | '{' expr (',' expr)* '}' # ExprCat ; args : arg (',' arg)* ; arg : ident point='=' expr # ArgNamed | expr # ArgPositional ;
oeis/052/A052225.asm
neoneye/loda-programs
11
166403
<reponame>neoneye/loda-programs<filename>oeis/052/A052225.asm ; A052225: (n+1)!*(n+3)-3. ; Submitted by <NAME> ; 5,27,141,837,5757,45357,403197,3991677,43545597,518918397,6706022397,93405311997,1394852659197,22230464255997,376610217983997,6758061133823997,128047474114559997,2554547108585471997 mov $1,$0 add $0,4 add $1,2 lpb $1 mul $0,$1 sub $1,1 lpe sub $0,3
examples/compiler/Not-named-according-to-the-Haskell-lexical-syntax.agda
redfish64/autonomic-agda
1
14876
module Not-named-according-to-the-Haskell-lexical-syntax where postulate IO : Set -> Set {-# BUILTIN IO IO #-} {-# COMPILED_TYPE IO IO #-} postulate return : {A : Set} -> A -> IO A {-# COMPILED return (\_ -> return :: a -> IO a) #-} {-# COMPILED_EPIC return (u1 : Unit, a : Any) -> Any = ioreturn(a) #-} data Unit : Set where unit : Unit {-# COMPILED_DATA Unit () () #-}
attic/asis/adam-assist.ads
charlie5/aIDE
3
23079
<filename>attic/asis/adam-assist.ads with AdaM.a_Type, AdaM.Environment; package AdaM.Assist is -- function known_Types return AdaM.a_Type.Vector; -- function known_Environment return AdaM.Environment.item; function known_Entities return AdaM.Environment.item; function Tail_of (the_full_Name : in String) return String; function strip_Tail_of (the_full_Name : in String) return String; function type_button_Name_of (the_full_Name : in String) return String; function Split (the_Text : in String) return text_Lines; end AdaM.Assist;
oeis/142/A142609.asm
neoneye/loda-programs
11
22639
; A142609: Primes congruent to 12 mod 55. ; Submitted by <NAME> ; 67,397,617,727,947,1277,1607,2267,2377,2707,2927,3037,3257,3697,3917,4027,4357,5237,5347,5897,6007,6337,6997,7547,7877,8317,8537,8647,8867,9857,9967,10627,10847,10957,11177,11287,11617,12277,12497,13267,13487,13597,15137,15467,15797,15907,16127,16567,16787,17117,18217,19207,19427,19867,20747,20857,21187,21407,21517,21737,22067,22397,22727,23057,23167,23497,23827,25037,25147,25367,26357,26687,27017,27127,27457,28447,29327,29437,30097,30427,30757,30977,31307,32077,32297,32957,33287,33617,34057 mov $1,15 mov $2,$0 add $2,2 pow $2,2 lpb $2 add $1,18 sub $2,2 mov $3,$1 mul $3,2 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $0,$3 add $1,37 mov $4,$0 max $4,0 cmp $4,$0 mul $2,$4 lpe mov $0,$1 mul $0,2 sub $0,73
setup.scpt
L3rchal/WallpDesk
2
4428
<filename>setup.scpt tell application "System Events" tell current desktop set picture rotation to 1 -- (0=off, 1=interval, 2=login, 3=sleep) set random order to true set pictures folder to alias "Macintosh HD:Users:ales:.walld:current:" set change interval to 5.0 end tell end tell
src/main/fragment/mos6502-common/vwum1=vwum1_setbyte0_vbuyy.asm
jbrandwood/kickc
2
13992
<reponame>jbrandwood/kickc<filename>src/main/fragment/mos6502-common/vwum1=vwum1_setbyte0_vbuyy.asm sty {m1}
test/Fail/Issue1651.agda
shlevy/agda
1,989
11917
<filename>test/Fail/Issue1651.agda -- Andreas, 2015-09-18, issue reported by <NAME> {-# OPTIONS --rewriting #-} data _==_ {A : Set} (a : A) : A → Set where idp : a == a {-# BUILTIN REWRITE _==_ #-} postulate A : Set a b : A r : a == b {-# REWRITE r #-} r = idp -- Should not work, as this behavior is confusing the users. -- Instead, should give an error that rewrite rule -- can only be added after function body.
src/devices/cpu/interrupts.asm
solson/oos
9
171662
bits 32 section .text ;;; ;;; Exceptions, ISRs, IRQs, Syscalls ;;; extern isrHandler extern irqHandler global isrSyscall isrSyscall: cli push 0 push 0x80 jmp isrCommon iret %macro HANDLER_COMMON 1 %1Common: pusha push ds push es push fs push gs mov ax, 0x10 mov ds, ax mov es, ax mov fs, ax mov gs, ax mov eax, esp push eax mov eax, %1Handler call eax pop eax pop gs pop fs pop es pop ds popa add esp, 8 iret %endmacro ;;; ISRs %macro ISR_COMMON 1 global isr%1 isr%1: cli push byte 0 push byte %1 jmp isrCommon iret %endmacro %macro ISR_ABORT 1 ISR_COMMON %1 %endmacro %macro ISR_FAULT 1 ISR_COMMON %1 %endmacro %macro ISR_INTR 1 ISR_COMMON %1 %endmacro %macro ISR_RESV 1 ISR_COMMON %1 %endmacro %macro ISR_TRAP 1 ISR_COMMON %1 %endmacro section .text ISR_FAULT 0 ISR_FAULT 1 ISR_INTR 2 ISR_TRAP 3 ISR_TRAP 4 ISR_FAULT 5 ISR_FAULT 6 ISR_FAULT 7 ISR_ABORT 8 ISR_FAULT 9 ISR_FAULT 10 ISR_FAULT 11 ISR_FAULT 12 ISR_FAULT 13 ISR_FAULT 14 ISR_FAULT 15 ISR_FAULT 16 ISR_FAULT 17 ISR_ABORT 18 ISR_FAULT 19 ISR_RESV 20 ISR_RESV 21 ISR_RESV 22 ISR_RESV 23 ISR_RESV 24 ISR_RESV 25 ISR_RESV 26 ISR_RESV 27 ISR_RESV 28 ISR_RESV 29 ISR_RESV 30 ISR_RESV 31 HANDLER_COMMON isr ;;; IRQs %macro IRQ_COMMON 2 global irq%1 irq%1: cli push byte 0 push byte %2 jmp irqCommon iret %endmacro IRQ_COMMON 0, 32 IRQ_COMMON 1, 33 IRQ_COMMON 2, 34 IRQ_COMMON 3, 35 IRQ_COMMON 4, 36 IRQ_COMMON 5, 37 IRQ_COMMON 6, 38 IRQ_COMMON 7, 39 IRQ_COMMON 8, 40 IRQ_COMMON 9, 41 IRQ_COMMON 10, 42 IRQ_COMMON 11, 43 IRQ_COMMON 12, 44 IRQ_COMMON 13, 45 IRQ_COMMON 14, 46 IRQ_COMMON 15, 47 HANDLER_COMMON irq
oeis/301/A301683.asm
neoneye/loda-programs
11
86369
<reponame>neoneye/loda-programs<filename>oeis/301/A301683.asm ; A301683: Partial sums of A301682. ; Submitted by <NAME>(s1) ; 1,7,13,31,49,67,103,133,163,217,259,301,373,427,481,571,637,703,811,889,967,1093,1183,1273,1417,1519,1621,1783,1897,2011,2191,2317,2443,2641,2779,2917,3133,3283,3433,3667,3829,3991,4243,4417,4591,4861,5047,5233,5521,5719,5917,6223,6433,6643,6967,7189,7411,7753,7987 mul $0,7 div $0,3 add $0,2 bin $0,2 add $0,2 div $0,7 mul $0,6 add $0,1
oeis/309/A309732.asm
neoneye/loda-programs
11
177709
; A309732: Expansion of Sum_{k>=1} k^2 * x^k/(1 - x^k)^3. ; Submitted by <NAME> ; 1,7,15,38,40,108,77,188,180,290,187,600,260,560,630,888,442,1323,551,1620,1218,1364,805,3024,1325,1898,1998,3136,1276,4680,1457,4080,2970,3230,3290,7470,2072,4028,4134,8200,2542,9072,2795,7656,7830,5888,3337,14496,4998,9825,7038,10660,4240,14904,8030,15904,8778,9338,5251,26640,5612,10664,15183,18400,11180,22176,6767,18156,12834,24640,7597,38124,8030,15170,21525,22648,15554,30888,9401,39440,21303,18614,10375,51744,19040,20468,20358,38896,11926,59130,21658,33120,23250,24440,23750,67392,14162 mov $2,$0 seq $0,152211 ; a(n) = n * sigma_0(n) + sigma_1(n). add $2,1 mul $0,$2 div $0,2
programs/oeis/069/A069205.asm
neoneye/loda
22
240267
; A069205: a(n) = Sum_{k=1..n} 2^bigomega(k). ; 1,3,5,9,11,15,17,25,29,33,35,43,45,49,53,69,71,79,81,89,93,97,99,115,119,123,131,139,141,149,151,183,187,191,195,211,213,217,221,237,239,247,249,257,265,269,271,303,307,315,319,327,329,345,349,365,369,373,375,391,393,397,405,469,473,481,483,491,495,503,505,537,539,543,551,559,563,571,573,605,621,625,627,643,647,651,655,671,673,689,693,701,705,709,713,777,779,787,795,811 lpb $0 mov $2,$0 sub $0,1 seq $2,61142 ; Replace each prime factor of n with 2: a(n) = 2^bigomega(n), where bigomega = A001222, number of prime factors counted with multiplicity. add $1,$2 lpe add $1,1 mov $0,$1
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0xca_notsx.log_1056_1069.asm
ljhsiun2/medusa
9
245196
.global s_prepare_buffers s_prepare_buffers: push %r13 push %r8 push %r9 push %rcx push %rdi push %rsi lea addresses_normal_ht+0x71bc, %rsi lea addresses_A_ht+0x793c, %rdi clflush (%rsi) nop nop nop nop xor %r9, %r9 mov $68, %rcx rep movsl and %r13, %r13 lea addresses_A_ht+0xa13c, %r8 nop nop nop nop nop xor $5196, %r13 movw $0x6162, (%r8) nop nop nop xor %rsi, %rsi pop %rsi pop %rdi pop %rcx pop %r9 pop %r8 pop %r13 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r12 push %r9 push %rax push %rdi push %rsi // Store lea addresses_UC+0x1c05c, %rdi sub $29492, %rsi mov $0x5152535455565758, %r12 movq %r12, %xmm5 vmovaps %ymm5, (%rdi) nop nop nop xor $25935, %r12 // Store lea addresses_US+0x101c4, %rdi cmp %r11, %r11 mov $0x5152535455565758, %r12 movq %r12, %xmm0 vmovups %ymm0, (%rdi) nop nop nop nop nop xor $6979, %rsi // Faulty Load mov $0x3c, %rax clflush (%rax) nop nop nop nop nop sub $61246, %r10 movaps (%rax), %xmm6 vpextrq $0, %xmm6, %rdi lea oracles, %rax and $0xff, %rdi shlq $12, %rdi mov (%rax,%rdi,1), %rdi pop %rsi pop %rdi pop %rax pop %r9 pop %r12 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': True, 'type': 'addresses_P'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': True, 'size': 32, 'congruent': 5, 'same': False, 'type': 'addresses_UC'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 3, 'same': False, 'type': 'addresses_US'}, 'OP': 'STOR'} [Faulty Load] {'src': {'NT': False, 'AVXalign': True, 'size': 16, 'congruent': 0, 'same': True, 'type': 'addresses_P'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'congruent': 7, 'same': False, 'type': 'addresses_normal_ht'}, 'dst': {'congruent': 8, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM'} {'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 8, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'} {'00': 1056} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
oeis/257/A257181.asm
neoneye/loda-programs
11
84666
; A257181: Expansion of (1 - x) * (1 + x^4) / (1 + x^5) in powers of x. ; Submitted by <NAME> ; 1,-1,0,0,1,-2,1,0,0,-1,2,-1,0,0,1,-2,1,0,0,-1,2,-1,0,0,1,-2,1,0,0,-1,2,-1,0,0,1,-2,1,0,0,-1,2,-1,0,0,1,-2,1,0,0,-1,2,-1,0,0,1,-2,1,0,0,-1,2,-1,0,0,1,-2,1,0,0,-1,2,-1,0,0,1,-2,1,0,0,-1,2,-1,0,0,1,-2,1,0,0,-1,2,-1,0,0,1,-2,1,0,0,-1 mov $1,-1 pow $1,$0 seq $0,164116 ; Expansion of (1 - x) * (1 - x^4) / (1 - x^5) in powers of x. dif $1,$0 mul $0,$1
oeis/213/A213574.asm
neoneye/loda-programs
11
97142
; A213574: Principal diagonal of the convolution array A213573. ; Submitted by <NAME> ; 1,17,93,349,1093,3093,8221,20957,51861,125509,298477,699789,1621285,3718325,8453181,19069885,42728245,95156901,210762253,464517485,1019214021,2227173397,4848613213,10519312029,22749902293,49056576773,105495131181,226291086157,484257559141,1034013372789,2203318218877,4685809315709,9947144253045,21079699484005,44598940396621,94214402599725,198736726714885,418639052269781,880708813842333,1850478069540445,3883475069297941,8140784092046277,17046828277031533,35659361112023309,74520500084137893 mov $2,$0 add $2,1 mov $3,$0 lpb $2 mov $0,$3 mul $0,2 sub $2,1 sub $0,$2 mul $1,2 mov $4,$0 add $4,1 pow $4,2 add $1,$4 lpe mov $0,$1
solutions/38 - Seek and Destroy 3/size-14_speed-29.asm
michaelgundlach/7billionhumans
45
87151
<reponame>michaelgundlach/7billionhumans -- 7 Billion Humans (2144) -- -- 38: Seek and Destroy 3 -- -- Author: tiansh -- Size: 14 -- Speed: 29 -- Speed Tests: 29, 29, 29, 29, 29, 28, 29, 29, 29, 28, 29, 29 -- Success Rate: 227/300 a: step n if c <= mem1 or mem1 != datacube: mem1 = set c endif if n == wall: pickup mem1 mem4 = nearest shredder b: mem2 = nearest worker if mem2 == nothing: giveto mem4 endif if myitem >= mem2 or myitem == nothing: mem4 = nearest hole step mem4 endif jump b endif jump a
oeis/027/A027806.asm
neoneye/loda-programs
11
1827
<reponame>neoneye/loda-programs<filename>oeis/027/A027806.asm ; A027806: 30*(n+1)*C(n+4,10). ; 210,2640,17820,85800,330330,1081080,3123120,8168160,19691100,44341440,94225560,190466640,368588220,686439600,1235591280,2157381600,3665097150,6074125200,9842332500,15623407800,24336462150,37255818600,56125648800,83304936000,121949170200,176236220160,251644987440,355296738720,496370443800,686605027680,940903186080,1278053325120,1721588278410,2300801739600,3051945836940,4019635980360,5258492043090,6835048111320,8829966459600,11340595099680,14483912219700,18399905092800,23255435603400 mov $1,$0 add $0,10 bin $0,$1 add $1,7 mul $0,$1 mul $0,30
libsrc/_DEVELOPMENT/math/float/math32/lm32/z80/asm_dmul10a.asm
jpoikela/z88dk
0
244213
<reponame>jpoikela/z88dk SECTION code_clib SECTION code_fp_math32 PUBLIC asm_dmul10a EXTERN m32_fsmul10a_fastcall ; multiply DEHL' by 10 and make positive ; ; enter : DEHL'= float x ; ; exit : success ; ; DEHL'= abs(x) * 10 ; carry reset ; ; fail if overflow ; ; DEHL'= +inf ; carry set, errno set ; ; uses : af, af', bc', de', hl' .asm_dmul10a push bc push de push hl exx call m32_fsmul10a_fastcall exx pop hl pop de pop bc ret
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/cd/cd2a53e.ada
best08618/asylo
7
2911
-- CD2A53E.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 WHEN SIZE AND SMALL SPECIFICATIONS ARE GIVEN FOR A -- FIXED POINT TYPE, THEN OPERATIONS ON VALUES OF SUCH A TYPE -- ARE NOT AFFECTED BY THE REPRESENTATION CLAUSE WHEN THE TYPE -- IS PASSED AS A GENERIC ACTUAL PARAMETER. -- HISTORY: -- BCB 08/24/87 CREATED ORIGINAL TEST. -- DHH 04/12/89 CHANGED EXTENSION FROM '.DEP' TO '.ADA' AND CHANGED -- OPERATORS ON 'SIZE TESTS. -- WMC 04/01/92 ELIMINATED TEST REDUNDANCIES. -- MRM 07/16/92 FIX ALIGNMENT OF BLOCK BODY -- PWN 02/02/95 REMOVED INCONSISTENCIES WITH ADA 9X. WITH REPORT; USE REPORT; PROCEDURE CD2A53E IS BASIC_SIZE : CONSTANT := INTEGER'SIZE/2; BASIC_SMALL : CONSTANT := 2.0 ** (-4); B : BOOLEAN; TYPE CHECK_TYPE IS DELTA 1.0 RANGE -4.0 .. 4.0; FOR CHECK_TYPE'SMALL USE BASIC_SMALL; FOR CHECK_TYPE'SIZE USE BASIC_SIZE; BEGIN TEST ("CD2A53E", "CHECK THAT WHEN SIZE AND SMALL SPECIFICATIONS " & "ARE GIVEN FOR A FIXED POINT TYPE, THEN " & "OPERATIONS ON VALUES OF SUCH A TYPE ARE NOT " & "AFFECTED BY THE REPRESENTATION CLAUSE WHEN " & "THE TYPE IS PASSED AS A GENERIC ACTUAL " & "PARAMETER"); DECLARE GENERIC TYPE FIXED_ELEMENT IS DELTA <>; FUNCTION FUNC RETURN BOOLEAN; FUNCTION FUNC RETURN BOOLEAN IS ZERO : CONSTANT := 0.0; TYPE BASIC_TYPE IS DELTA 2.0 ** (-4) RANGE -4.0 .. 4.0; CNEG1 : FIXED_ELEMENT := -3.5; CNEG2 : FIXED_ELEMENT := FIXED_ELEMENT (-1.0/3.0); CPOS1 : FIXED_ELEMENT := FIXED_ELEMENT (4.0/6.0); CPOS2 : FIXED_ELEMENT := 3.5; CZERO : FIXED_ELEMENT; TYPE ARRAY_TYPE IS ARRAY (0 .. 3) OF FIXED_ELEMENT; CHARRAY : ARRAY_TYPE := (-3.5, FIXED_ELEMENT (-1.0/3.0), FIXED_ELEMENT (4.0/6.0), 3.5); TYPE REC_TYPE IS RECORD COMPF : FIXED_ELEMENT := -3.5; COMPN : FIXED_ELEMENT := FIXED_ELEMENT (-1.0/3.0); COMPP : FIXED_ELEMENT := FIXED_ELEMENT (4.0/6.0); COMPL : FIXED_ELEMENT := 3.5; END RECORD; CHREC : REC_TYPE; FUNCTION IDENT (FX : FIXED_ELEMENT) RETURN FIXED_ELEMENT IS BEGIN IF EQUAL (3, 3) THEN RETURN FX; ELSE RETURN 0.0; END IF; END IDENT; PROCEDURE PROC (CN1IN, CP1IN : FIXED_ELEMENT; CN2INOUT,CP2INOUT : IN OUT FIXED_ELEMENT; CZOUT : OUT FIXED_ELEMENT) IS BEGIN IF +IDENT (CN2INOUT) NOT IN -0.375 .. -0.3125 OR IDENT (-CP1IN) NOT IN -0.6875 .. -0.625 THEN FAILED ("INCORRECT RESULTS FOR " & "UNARY ADDING OPERATORS - 1"); END IF; IF ABS IDENT (CN2INOUT) NOT IN 0.3125 .. 0.375 OR IDENT (ABS CP1IN) NOT IN 0.625 .. 0.6875 THEN FAILED ("INCORRECT RESULTS FOR " & "ABSOLUTE VALUE OPERATORS - 1"); END IF; CZOUT := 0.0; END PROC; BEGIN -- FUNC PROC (CNEG1, CPOS1, CNEG2, CPOS2, CZERO); IF IDENT (CZERO) /= ZERO THEN FAILED ("INCORRECT VALUE FOR OUT PARAMETER"); END IF; IF FIXED_ELEMENT'LAST < IDENT (3.9375) THEN FAILED ("INCORRECT VALUE FOR FIXED_ELEMENT'LAST"); END IF; IF FIXED_ELEMENT'SIZE /= IDENT_INT (BASIC_SIZE) THEN FAILED ("INCORRECT VALUE FOR FIXED_ELEMENT'SIZE"); END IF; IF FIXED_ELEMENT'SMALL /= BASIC_SMALL THEN FAILED ("INCORRECT VALUE FOR FIXED_ELEMENT'SMALL"); END IF; IF FIXED_ELEMENT'AFT /= 1 THEN FAILED ("INCORRECT VALUE FOR FIXED_ELEMENT'AFT"); END IF; IF CNEG1'SIZE < IDENT_INT(BASIC_SIZE) THEN FAILED ("INCORRECT VALUE FOR CNEG1'SIZE"); END IF; IF IDENT (CNEG1) + CPOS1 NOT IN -2.875 .. -2.8125 OR CPOS2 - IDENT (CPOS1) NOT IN 2.8125 .. 2.875 THEN FAILED ("INCORRECT RESULTS FOR BINARY ADDING " & "OPERATORS - 2"); END IF; IF FIXED_ELEMENT (CNEG1 * IDENT (CPOS1)) NOT IN -2.4375 .. -2.1875 OR FIXED_ELEMENT (IDENT (CNEG2) / CPOS2) NOT IN -0.125 .. -0.0625 THEN FAILED ("INCORRECT RESULTS FOR MULTIPLYING " & "OPERATORS - 2"); END IF; IF IDENT (CPOS1) NOT IN 0.625 .. 0.6875 OR CNEG2 IN -0.25 .. 0.0 OR IDENT (CNEG2) IN -1.0 .. -0.4375 THEN FAILED ("INCORRECT RESULTS FOR MEMBERSHIP " & "OPERATORS - 2"); END IF; IF CHARRAY(1)'SIZE < IDENT_INT(BASIC_SIZE) THEN FAILED ("INCORRECT VALUE FOR CHARRAY(1)'SIZE"); END IF; IF +IDENT (CHARRAY (1)) NOT IN -0.375 .. -0.3125 OR IDENT (-CHARRAY (2)) NOT IN -0.6875 .. -0.625 THEN FAILED ("INCORRECT RESULTS FOR UNARY ADDING " & "OPERATORS - 3"); END IF; IF ABS IDENT (CHARRAY (1)) NOT IN 0.3125 .. 0.375 OR IDENT (ABS CHARRAY (2)) NOT IN 0.625 .. 0.6875 THEN FAILED ("INCORRECT RESULTS FOR ABSOLUTE VALUE " & "OPERATORS - 3"); END IF; IF IDENT (CHARRAY (2)) NOT IN 0.625 .. 0.6875 OR CHARRAY (1) IN -0.25 .. 0.0 OR IDENT (CHARRAY (1)) IN -1.0 .. -0.4375 THEN FAILED ("INCORRECT RESULTS FOR MEMBERSHIP " & "OPERATORS - 3"); END IF; IF CHREC.COMPP'SIZE < IDENT_INT(BASIC_SIZE) THEN FAILED ("INCORRECT VALUE FOR CHREC.COMPP'SIZE"); END IF; IF IDENT (CHREC.COMPF) + CHREC.COMPP NOT IN -2.875 .. -2.8125 OR CHREC.COMPL - IDENT (CHREC.COMPP) NOT IN 2.8125 .. 2.875 THEN FAILED ("INCORRECT RESULTS FOR BINARY ADDING " & "OPERATORS - 4"); END IF; IF FIXED_ELEMENT (CHREC.COMPF * IDENT (CHREC.COMPP)) NOT IN -2.4375 .. -2.1875 OR FIXED_ELEMENT (IDENT (CHREC.COMPN) / CHREC.COMPL) NOT IN -0.125 .. -0.0625 THEN FAILED ("INCORRECT RESULTS FOR MULTIPLYING " & "OPERATORS - 4"); END IF; IF IDENT (CHREC.COMPP) NOT IN 0.625 .. 0.6875 OR CHREC.COMPN IN -0.25 .. 0.0 OR IDENT (CHREC.COMPN) IN -1.0 .. -0.4375 THEN FAILED ("INCORRECT RESULTS FOR MEMBERSHIP " & "OPERATORS - 4"); END IF; RETURN TRUE; END FUNC; FUNCTION NEWFUNC IS NEW FUNC(CHECK_TYPE); BEGIN B := NEWFUNC; END; RESULT; END CD2A53E;
vendor/stdlib/src/Data/Integer/Divisibility.agda
isabella232/Lemmachine
56
212
<gh_stars>10-100 ------------------------------------------------------------------------ -- Divisibility and coprimality ------------------------------------------------------------------------ module Data.Integer.Divisibility where open import Data.Function open import Data.Integer open import Data.Integer.Properties import Data.Nat.Divisibility as ℕ import Data.Nat.Coprimality as ℕ open import Relation.Binary open import Relation.Binary.PropositionalEquality -- Divisibility. infix 4 _∣_ _∣_ : Rel ℤ _∣_ = ℕ._∣_ on₁ ∣_∣ -- Coprimality. Coprime : Rel ℤ Coprime = ℕ.Coprime on₁ ∣_∣ -- If i divides jk and is coprime to j, then it divides k. coprime-divisor : ∀ i j k → Coprime i j → i ∣ j * k → i ∣ k coprime-divisor i j k c eq = ℕ.coprime-divisor c (subst (ℕ._∣_ ∣ i ∣) (abs-*-commute j k) eq)
annis-visualizers/src/main/antlr4/annis/visualizers/htmlvis/HTMLVisConfig.g4
thomaskrause/ANNIS
0
6071
/* * Copyright 2013 SFB 632. * * 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. */ grammar HTMLVisConfig; WS: [ \t]+; SEMICOLON : ';'; EQUALS : '='; TOK : 'tok'; VALUE : 'value'; ANNO : 'anno'; STYLE : 'style'; COLON : ':'; QUOTE : '"'; NEWLINE : '\n'; COMMENT : '#' ~('\n')+ -> skip; ID: [a-zA-Z\_\-*?]+;// [a-zA-Z_\-*?0-9.]*; TXT : (.)+?; innervalue: ~(QUOTE)+; value : QUOTE innervalue QUOTE; innertype: ~(QUOTE)+; type : VALUE # typeValue | ANNO # typeAnno | QUOTE innertype QUOTE # typeConstant ; element : ID # elementNoStyle | ID COLON ID # elementNoStyleAttribute | ID SEMICOLON WS? STYLE EQUALS value # elementWithStyle | ID COLON ID SEMICOLON WS? STYLE EQUALS value # elementWithStyleAttribute ; condition : ID # conditionName | TOK # conditionTok | ID EQUALS value # conditionNameAndValue | EQUALS value # conditionValue ; vis : condition WS element (WS type)? WS? NEWLINE* ; start : NEWLINE* vis (NEWLINE+ vis)* EOF ;
src/BreathOfTheWild/Mods/DayLength/patch_DayTime.asm
UltraDragonZord/cemu_graphic_packs
1,002
82319
<reponame>UltraDragonZord/cemu_graphic_packs [BotW_DayTime_V208] moduleMatches = 0x6267BFD0 .origin = codecave const_timeMultiplier: .float $timeMultiplier const_cloudMultiplier: .float $cloudMultiplier ; Normal Time Mode - Time multiplyTimeStep: lfs f7, 0xA4(r30) ; original instruction to load timestep lis r9, const_timeMultiplier@ha lfs f8, const_timeMultiplier@l(r9) fmuls f7, f7, f8 lwz r9, 0(r6) ; repeat prior instruction for free r9 register blr 0x0365FF78 = bla multiplyTimeStep ; Normal Time Mode - Clouds multiplyCloudStep: lis r4, const_cloudMultiplier@ha lfs f11, const_cloudMultiplier@l(r4) fmuls f6, f6, f11 stfs f6, 0xB0(r30) blr 0x03660018 = bla multiplyCloudStep ; OnlyUpdateTimeOfDay Mode - Time & Clouds multiplyOnlyTimeStep: lfs f9, 0xA4(r30) lis r4, const_timeMultiplier@ha lfs f6, const_timeMultiplier@l(r4) fmuls f9, f9, f6 blr 0x03660154 = bla multiplyOnlyTimeStep ; Change mode to one of the forced ones when forced time is enabled calcForceTime: li r12, $timeCycleMode cmpwi r12, 1 beq noForcedTime li r12, $dayTimeEnum cmpwi r0, 0 blr noForcedTime: lbz r12, 0x129(r30) cmpwi r0, 0 blr 0x0365FB18 = bla calcForceTime calcForceTime2: li r12, $timeCycleMode cmpwi r12, 1 beq noForcedTime1 li r12, $dayTimeEnum ; Load forced time cmpwi r0, 0 blr noForcedTime1: lbz r12, 0x129(r30) ; Normal load instruction cmpwi r0, 0 blr 0x0365FE0C = bla calcForceTime2
Cats/Functor/Yoneda.agda
alessio-b-zak/cats
0
3177
module Cats.Functor.Yoneda where open import Data.Product using (_,_) open import Relation.Binary using (Rel ; Setoid ; IsEquivalence) open import Relation.Binary.PropositionalEquality using (_≡_ ; refl) open import Cats.Bifunctor using (transposeBifunctor₂) open import Cats.Category open import Cats.Category.Cat.Facts.Exponential using (Eval) open import Cats.Category.Cat.Facts.Product using (First ; Swap) open import Cats.Category.Fun using (Fun ; Trans ; ≈-intro ; ≈-elim) open import Cats.Category.Fun.Facts using (NatIso→≅) open import Cats.Category.Op using (_ᵒᵖ) open import Cats.Category.Product.Binary using (_×_) open import Cats.Category.Setoids using (Setoids ; ≈-intro ; ≈-elim ; ≈-elim′) open import Cats.Functor using ( Functor ; _∘_ ; IsFull ; IsFaithful ; IsEmbedding ; Embedding→Full ; Embedding→Faithful ) open import Cats.Functor.Op using (Op) open import Cats.Functor.Representable using (Hom[_]) open import Cats.Util.SetoidMorphism.Iso using (IsIso-resp) import Cats.Util.SetoidReasoning as SetoidReasoning import Cats.Category.Constructions.Iso open Functor open Trans open Cats.Category.Setoids._⇒_ open Setoid using (Carrier) -- We force C to be at l/l/l. Can we generalise to lo/la/l≈? module _ {l} {C : Category l l l} where private Sets : Category _ _ _ Sets = Setoids l l Presheaves : Category _ _ _ Presheaves = Fun (C ᵒᵖ) Sets Funs : Category _ _ _ Funs = Fun ((C ᵒᵖ) × Presheaves) Sets module C = Category C module Sets = Category Sets module Pre = Category Presheaves module Funs = Category Funs y : Functor C Presheaves y = transposeBifunctor₂ Hom[ C ] module _ (c : C.Obj) (F : Functor (C ᵒᵖ) (Sets)) where private module ycc≈ = Setoid (fobj (fobj y c) c) module Fc≈ = Setoid (fobj F c) forth : Pre.Hom (fobj y c) F Sets.⇒ fobj F c forth = record { arr = λ f → arr (component f c) C.id ; resp = λ f≈g → ≈-elim′ (≈-elim f≈g) } back-θ-component : Carrier (fobj F c) → (c′ : C.Obj) → C.Hom c′ c Sets.⇒ fobj F c′ back-θ-component a c′ = record { arr = λ h → arr (fmap F h) a ; resp = λ f≈g → ≈-elim′ (fmap-resp F f≈g) } back-θ : Carrier (fobj F c) → fobj y c Pre.⇒ F back-θ a = record { component = back-θ-component a ; natural = λ {c′} {d′} {f} → ≈-intro λ {g} {g′} g≈g′ → let open Setoid (fobj F d′) using (sym) in begin⟨ fobj F d′ ⟩ arr (back-θ-component a d′ Sets.∘ fmap (fobj y c) f) g ≡⟨⟩ arr (fmap F (C.id C.∘ g C.∘ f)) a ≈⟨ ≈-elim′ (fmap-resp F (C.≈.trans C.id-l (C.∘-resp-l g≈g′))) ⟩ arr (fmap F (g′ C.∘ f)) a ≈⟨ sym (≈-elim′ (fmap-∘ F)) ⟩ arr (fmap F f Sets.∘ fmap F g′) a ≡⟨⟩ arr (fmap F f Sets.∘ back-θ-component a c′) g′ ∎ } where open SetoidReasoning back : fobj F c Sets.⇒ Pre.Hom (fobj y c) F back = record { arr = back-θ ; resp = λ f≈g → ≈-intro (≈-intro λ x≈y → ≈-elim (fmap-resp F x≈y) f≈g) } back-forth : back Sets.∘ forth Sets.≈ Sets.id back-forth = ≈-intro λ {θ} {θ′} θ≈θ′ → ≈-intro λ {c′} → ≈-intro λ {f} {g} f≈g → begin⟨ fobj F c′ ⟩ arr (component (arr (back Sets.∘ forth) θ) c′) f ≡⟨⟩ arr (fmap F f Sets.∘ component θ c) C.id ≈⟨ ≈-elim′ (Sets.≈.sym (natural θ)) ⟩ arr (component θ c′ Sets.∘ fmap (fobj y c) f) C.id ≡⟨⟩ arr (component θ c′) (C.id C.∘ C.id C.∘ f) ≈⟨ resp (component θ c′) (C.≈.trans C.id-l C.id-l) ⟩ arr (component θ c′) f ≈⟨ ≈-elim (≈-elim θ≈θ′) f≈g ⟩ arr (component θ′ c′) g ∎ where open SetoidReasoning forth-back : forth Sets.∘ back Sets.≈ Sets.id forth-back = ≈-intro λ x≈y → ≈-elim (fmap-id F) x≈y iso : fobj Hom[ Presheaves ] (fobj y c , F) Sets.≅ fobj F c iso = record { forth = forth ; back = back ; back-forth = back-forth ; forth-back = forth-back } yoneda : (Hom[ Presheaves ] ∘ First (Op y)) Funs.≅ (Eval ∘ Swap) yoneda = NatIso→≅ record { iso = λ { {c , F} → iso c F } ; forth-natural = λ where {c , F} {c′ , F′} {f , θ} → ≈-intro λ {ι} {τ} ι≈τ → let module S = Setoid (fobj F′ c′) in triangle (fobj F′ c′) (arr (component (θ Pre.∘ ι) c′) f) ( begin⟨ fobj F′ c′ ⟩ arr (forth c′ F′ Sets.∘ fmap Hom[ Presheaves ] (fmap (First {D = Presheaves ᵒᵖ} (Op y)) (f , θ))) ι ≡⟨⟩ arr (component (Pre.id Pre.∘ θ Pre.∘ ι) c′) (f C.∘ C.id C.∘ C.id) ≈⟨ ≈-elim (≈-elim (Pre.id-l {f = θ Pre.∘ ι})) (C.≈.trans (C.∘-resp-r C.id-r) C.id-r) ⟩ arr (component (θ Pre.∘ ι) c′) f ∎ ) ( begin⟨ fobj F′ c′ ⟩ arr (fmap F′ f Sets.∘ component θ c Sets.∘ forth c F) τ ≡⟨⟩ arr (fmap F′ f Sets.∘ component (θ Pre.∘ τ) c) C.id ≈⟨ S.sym (≈-elim′ (natural (θ Pre.∘ τ))) ⟩ arr (component (θ Pre.∘ τ) c′ Sets.∘ fmap (fobj y c) f) C.id ≡⟨⟩ arr (component (θ Pre.∘ τ) c′) (C.id C.∘ C.id C.∘ f) ≈⟨ ≈-elim (≈-elim (Pre.∘-resp-r {f = θ} (Pre.≈.sym {i = ι} {τ} ι≈τ))) (C.≈.trans C.id-l C.id-l) ⟩ arr (component (θ Pre.∘ ι) c′) f ∎ ) } where open SetoidReasoning back≈sfmap : ∀ {a b} → back a (fobj y b) Sets.≈ sfmap y back≈sfmap {a} {b} = ≈-intro λ {f} {g} f≈g → ≈-intro (≈-intro λ {x} {y} x≈y → begin C.id C.∘ f C.∘ x ≈⟨ C.id-l ⟩ f C.∘ x ≈⟨ C.∘-resp f≈g x≈y ⟩ g C.∘ y ≈⟨ C.≈.sym C.id-r ⟩ (g C.∘ y) C.∘ C.id ≈⟨ C.assoc ⟩ g C.∘ y C.∘ C.id ∎) where open C.≈-Reasoning y-Embedding : IsEmbedding y y-Embedding {a} {b} = IsIso-resp back≈sfmap record { back = forth a (fobj y b) ; forth-back = back-forth a (fobj y b) ; back-forth = forth-back a (fobj y b) } y-Full : IsFull y y-Full = Embedding→Full y y-Embedding y-Faithful : IsFaithful y y-Faithful = Embedding→Faithful y y-Embedding
libsrc/target/zx81/zx_setcursorpos_callee.asm
jpoikela/z88dk
38
241920
<reponame>jpoikela/z88dk ; ; ZX 81 specific routines ; by <NAME>, Oct 2007 ; ; Copy a string to a BASIC variable ; ; int __CALLEE__ zx_setstr_callee(char variable, char *value); ; ; ; $Id: zx_setcursorpos_callee.asm,v 1.8 2016-06-26 20:32:08 dom Exp $ ; SECTION code_clib PUBLIC zx_setcursorpos_callee PUBLIC _zx_setcursorpos_callee PUBLIC ASMDISP_ZX_SETCURSORPOS_CALLEE EXTERN zx_dfile_addr EXTERN zx_coord_adj IF FORzx80 DEFC COLUMN=$4024 ; S_POSN_x ELSE DEFC COLUMN=$4039 ; S_POSN_x ENDIF zx_setcursorpos_callee: _zx_setcursorpos_callee: pop bc pop de pop hl push bc ; enter : l = x ; e = y .asmentry ;jr asmentry ld d,l ld (COLUMN),de call zx_coord_adj jp zx_dfile_addr DEFC ASMDISP_ZX_SETCURSORPOS_CALLEE = asmentry - zx_setcursorpos_callee
programs/oeis/123/A123868.asm
neoneye/loda
22
1449
; A123868: a(n) = n^12 - 1. ; 0,4095,531440,16777215,244140624,2176782335,13841287200,68719476735,282429536480,999999999999,3138428376720,8916100448255,23298085122480,56693912375295,129746337890624,281474976710655,582622237229760,1156831381426175,2213314919066160,4095999999999999,7355827511386640,12855002631049215,21914624432020320,36520347436056575,59604644775390624,95428956661682175,150094635296999120,232218265089212415,353814783205469040,531440999999999999,787662783788549760,1152921504606846975,1667889514952984960,2386420683693101055,3379220508056640624,4738381338321616895,6582952005840035280,9065737908494995455,12381557655576425120,16777215999999999999,22563490300366186080,30129469486639681535,39959630797262576400,52654090776777588735,68952523554931640624,89762301673555234815,116191483108948578240,149587343098087735295,191581231380566414400,244140624999999999999,309629344375621415600,390877006486250192895,491258904256726154640,614787626176508399615,766217865410400390624,951166013805414055935,1176246293903439668000,1449225352009601191935,1779197418239532716880,2176782335999999999999,2654348974297586158320,3226266762397899821055,3909188328478827879680,4722366482869645213695,5688009063105712890624,6831675453247426400255,8182718904632857144560,9774779120406941925375,11646329922777311412560,13841287200999999999999,16409682740640811134240,19408409961765342806015,22902048046490258711520,26963771415920784510975,31676352024078369140624,37133262473195501387775,43439888521963583647920,50714860157241037295615,59091511031674153381440,68719476735999999999999,79766443076872509863360,92420056270299898187775,106890007738661124410160,123410307017276135571455,142241757136172119140624,163674647745587512938495,188031682201497672618080,215671155821681003462655,246990403565262140303520,282429536480999999999999,322475487413604782665680,367666387654882241806335,418596297479370673535600,475920314814253376475135,540360087662636962890624,612709757329767363772415,693842360995438000295040,784716723734800033386495,886384871716129280658800,999999999999999999999999 add $0,1 pow $0,12 sub $0,1
data segment.asm
rikoras/rikoras.github.io
0
24542
data segment n equ 25 strl db n, ?, n, dup(?), 0ah, 0dh, '$'
programs/oeis/063/A063197.asm
jmorken/loda
1
87487
; A063197: Dimension of the space of weight 2n cuspidal newforms for Gamma_0( 9 ). ; 0,1,1,3,3,4,5,6,6,8,8,9,10,11,11,13,13,14,15,16,16,18,18,19,20,21,21,23,23,24,25,26,26,28,28,29,30,31,31,33,33,34,35,36,36,38,38,39,40,41,41,43,43,44,45,46,46,48,48,49,50,51,51,53,53,54,55,56,56,58,58,59,60,61,61,63,63,64,65,66,66,68,68,69,70,71,71,73,73,74,75,76,76,78,78,79,80,81,81,83,83,84,85,86,86,88,88,89,90,91,91,93,93,94,95,96,96,98,98,99,100,101,101,103,103,104,105,106,106,108,108,109,110,111,111,113,113,114,115,116,116,118,118,119,120,121,121,123,123,124,125,126,126,128,128,129,130,131,131,133,133,134,135,136,136,138,138,139,140,141,141,143,143,144,145,146,146,148,148,149,150,151,151,153,153,154,155,156,156,158,158,159,160,161,161,163,163,164,165,166,166,168,168,169,170,171,171,173,173,174,175,176,176,178,178,179,180,181,181,183,183,184,185,186,186,188,188,189,190,191,191,193,193,194,195,196,196,198,198,199,200,201,201,203,203,204,205,206,206,208 mov $1,$0 add $0,1 div $0,2 div $1,3 add $1,$0
tb/tprog/asm/test.sllv.asm
mshaklunov/mips_onemore
0
168624
#SLLV INSTRUCTION #RUN ALL SHIFTING MODES (0-31) #EACH RESULT'S BIT GO THROUGH 0 AND 1 lui $1 0xFFFF ori $1 0xFFFF lui $2 0x8000 ori $2 0x0000 lui $4 0x0000 ori $4 31 sllv_loop: sllv $3 $1 $4 bne $3 $2 fail sll $0 $0 0 beq $4 $0 sllv_end addiu $4 $4 -1 sra $2 $2 1 j sllv_loop sll $0 $0 0 sllv_end: lui $1 0xFFFF ori $1 0xFFFE lui $4 0x0000 ori $4 31 sllv $3 $1 $4 bne $3 $0 fail sll $0 $0 0
oeis/076/A076006.asm
neoneye/loda-programs
11
17437
<filename>oeis/076/A076006.asm ; A076006: Sixth column of triangle A075503. ; Submitted by <NAME> ; 1,168,17024,1354752,93499392,5881430016,346987429888,19548208103424,1064285732077568,56464495286943744,2936605030892961792,150373246607730671616,7606369972746352328704,381025640076812853706752,18938335262382167410343936,935400438453715177127804928,45966366588922981827320217600,2249480140084210033346677309440,109711938970834623755581936107520,5336069049730417348477648329768960,258940620893664695740420371362349056,12541953452165996488944802740157022208,606539726541533238177664993558731423744 mov $2,8 pow $2,$0 seq $0,770 ; Stirling numbers of the second kind, S(n,6). mul $0,$2
src/arch/x86_64/long_mode_init.asm
thelostt/ruke
1
102002
global long_mode_start section .text bits 64 long_mode_start: extern kmain call setup_SSE call kmain .os_returned: ; rust main returned, print `OS returned!` mov rax, 0x4f724f204f534f4f mov [0xb8000], rax mov rax, 0x4f724f754f744f65 mov [0xb8008], rax mov rax, 0x4f214f644f654f6e mov [0xb8010], rax ;mov rax, 0x2f592f412f4b2f4f ;mov qword [0xb8000], rax hlt ; Check for SSE and enable it. If it's not supported throw error "a". setup_SSE: ; check for SSE mov rax, 0x1 cpuid test edx, 1<<25 jz .no_SSE ; enable SSE mov rax, cr0 and ax, 0xFFFB ; clear coprocessor emulation CR0.EM or ax, 0x2 ; set coprocessor monitoring CR0.MP mov cr0, rax mov rax, cr4 or ax, 3 << 9 ; set CR4.OSFXSR and CR4.OSXMMEXCPT at the same time mov cr4, rax ret .no_SSE: mov al, "a" jmp error ; Prints `ERROR: ` and the given error code to screen and hangs. ; parameter: error code (in ascii) in al error: mov rbx, 0x4f4f4f524f524f45 mov [0xb8000], rbx mov rbx, 0x4f204f204f3a4f52 mov [0xb8008], rbx mov byte [0xb800e], al hlt jmp error
programs/oeis/081/A081626.asm
jmorken/loda
1
5406
; A081626: 2*6^n-4^n. ; 1,8,56,368,2336,14528,89216,543488,3293696,19893248,119883776,721399808,4336787456,26054279168,156459892736,939296227328,5637924847616,33836139020288,203051193860096,1218444602114048,7311217368498176 mov $1,3 mov $2,$0 mov $3,3 lpb $2 add $1,$3 mul $1,4 sub $2,1 mul $3,6 lpe sub $1,3 div $1,3 add $1,1
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/source_ref1.adb
best08618/asylo
7
7281
pragma Source_Reference (3, "p1.adb"); procedure Source_Ref1 is begin null; end;
oeis/008/A008911.asm
neoneye/loda-programs
11
169341
; A008911: a(n) = n^2*(n^2 - 1)/6. ; 0,0,2,12,40,100,210,392,672,1080,1650,2420,3432,4732,6370,8400,10880,13872,17442,21660,26600,32340,38962,46552,55200,65000,76050,88452,102312,117740,134850,153760,174592,197472,222530,249900,279720,312132,347282,385320,426400,470680,518322,569492,624360,683100,745890,812912,884352,960400,1041250,1127100,1218152,1314612,1416690,1524600,1638560,1758792,1885522,2018980,2159400,2307020,2462082,2624832,2795520,2974400,3161730,3357772,3562792,3777060,4000850,4234440,4478112,4732152,4996850,5272500 pow $0,2 bin $0,2 div $0,3
Week_8-9/17 - idiv_8_bit_0.asm
iamruveyda/KBU-Mikro
1
23680
<filename>Week_8-9/17 - idiv_8_bit_0.asm<gh_stars>1-10 .model small .data .code main proc mov al, -48 mov bl, 05H div bl endp end main
src/glfw/v2/glfw-events-keys.ads
Roldak/OpenGLAda
0
21691
-- part of OpenGLAda, (c) 2017 <NAME> -- released under the terms of the MIT license, see the file "COPYING" package Glfw.Events.Keys is -- Not all values are actually used. -- For non-special keys, the ASCII capital representation is used as value. -- For special keys, the values defined as constants below are used. type Key is range 32 .. 325; Esc : constant := 257; F1 : constant := 258; F2 : constant := 259; F3 : constant := 260; F4 : constant := 261; F5 : constant := 262; F6 : constant := 263; F7 : constant := 264; F8 : constant := 265; F9 : constant := 266; F10 : constant := 267; F11 : constant := 268; F12 : constant := 269; F13 : constant := 270; F14 : constant := 271; F15 : constant := 272; F16 : constant := 273; F17 : constant := 274; F18 : constant := 275; F19 : constant := 276; F20 : constant := 277; F21 : constant := 278; F22 : constant := 279; F23 : constant := 280; F24 : constant := 281; F25 : constant := 282; Up : constant := 283; Down : constant := 284; Left : constant := 285; Right : constant := 286; L_Shift : constant := 287; R_Shift : constant := 288; L_Ctrl : constant := 289; R_Ctrl : constant := 290; L_Alt : constant := 291; R_Alt : constant := 292; Tab : constant := 293; Enter : constant := 294; Backspace : constant := 295; Insert : constant := 296; Del : constant := 297; Page_Up : constant := 298; Page_Down : constant := 299; Home : constant := 300; End_Key : constant := 301; KP_0 : constant := 302; KP_1 : constant := 303; KP_2 : constant := 304; KP_3 : constant := 305; KP_4 : constant := 306; KP_5 : constant := 307; KP_6 : constant := 308; KP_7 : constant := 309; KP_8 : constant := 310; KP_9 : constant := 311; KP_Divide : constant := 312; KP_Multiply : constant := 313; KP_Substract : constant := 314; KP_Add : constant := 315; KP_Decimal : constant := 316; KP_Equal : constant := 317; KP_Enter : constant := 318; KP_Num_Lock : constant := 319; Caps_Lock : constant := 320; Scroll_Lock : constant := 321; Pause : constant := 322; L_Super : constant := 323; R_Super : constant := 324; Menu : constant := 325; type Unicode_Character is range 0 .. Interfaces.C.int'Last; type Key_Callback is access procedure (Subject : Key; Action : Button_State); type Character_Callback is access procedure (Unicode_Char : Unicode_Character; Action : Button_State); -- Get a String representation of the key. Can be used for displaying the -- key's name on the screen. The key name will be in English. function Name (Query : Key) return String; function Pressed (Query : Key) return Boolean; procedure Set_Key_Callback (Callback : Key_Callback); procedure Set_Character_Callback (Callback : Character_Callback); procedure Toggle_Key_Repeat (Enable : Boolean); procedure Toggle_Sticky_Keys (Enable : Boolean); procedure Toggle_System_Keys (Enable : Boolean); private for Key'Size use C.int'Size; for Unicode_Character'Size use C.int'Size; end Glfw.Events.Keys;
src/MultiSorted/Completeness.agda
cilinder/formaltt
21
6625
<gh_stars>10-100 open import Agda.Primitive using (_⊔_; lsuc; lzero) import Categories.Category as Category import Categories.Category.Cartesian as Cartesian import MultiSorted.Model as Model import MultiSorted.Interpretation as Interpretation import MultiSorted.UniversalModel as UniversalModel import MultiSorted.SyntacticCategory as SyntacticCategory import MultiSorted.UniversalModel as UniversalModel open import MultiSorted.AlgebraicTheory module MultiSorted.Completeness {ℓt} {𝓈 ℴ} {Σ : Signature {𝓈} {ℴ}} (T : Theory ℓt Σ) where open Theory T open UniversalModel T -- An equation is semantically valid when it holds in all models valid : ∀ (ε : Equation Σ) → Set (lsuc (lsuc ℓt ⊔ lsuc 𝓈 ⊔ lsuc ℴ)) valid ε = ∀ {𝒞 : Category.Category 𝓈 (lsuc ℴ) (lsuc (ℓt ⊔ 𝓈 ⊔ ℴ))} {cartesian-𝒞 : Cartesian.Cartesian 𝒞} {I : Interpretation.Interpretation Σ cartesian-𝒞} (M : Model.Model T I) → Interpretation.Interpretation.⊨_ I ε -- Completeness: semantic validity implies provability valid-⊢ : ∀ (ε : Equation Σ) → valid ε → ⊢ ε valid-⊢ ε v = universality ε (v 𝒰)
oeis/087/A087105.asm
neoneye/loda-programs
11
175972
; A087105: (prime(n-1) + 1)*(prime(n+1) - 1). ; Submitted by <NAME> ; 12,24,60,96,192,252,396,560,720,1080,1280,1596,1932,2288,2784,3240,3960,4340,4896,5616,6068,7040,8064,9000,9996,10812,11232,12096,13860,14820,17408,18216,20424,21000,23400,24624,26228,28208,29904,31320,34200,34944,37632,38412,41580,44400,47912,51072,52896,54740,56160,60000,61952,66024,69144,71280,74520,76160,78396,82344,86904,91140,96096,98592,103620,106848,114872,117624,122496,125300,129564,133920,139104,142868,147440,152064,156000,162384,168036,172200,180600,182304,189216,191828,197120,202464 mov $2,$0 add $0,2 seq $0,40 ; The prime numbers. div $0,2 seq $2,40 ; The prime numbers. add $2,1 mul $0,$2 div $0,2 mul $0,4
hott/level/closure/lift.agda
HoTT/M-types
27
7064
<reponame>HoTT/M-types<gh_stars>10-100 {-# OPTIONS --without-K #-} module hott.level.closure.lift where open import level open import function.isomorphism.lift open import hott.level.core open import hott.level.closure.core -- lifting preserves h-levels ↑-level : ∀ {i n} j {X : Set i} → h n X → h n (↑ j X) ↑-level j {X} = iso-level (lift-iso j X)
src/fractal_impl.adb
Robert-Tice/EmbeddedFractal
0
21695
package body Fractal_Impl is procedure Init (Viewport : Viewport_Info) is begin Float_Julia_Fractal.Init (Viewport => Viewport); Fixed_Julia_Fractal.Init (Viewport => Viewport); end Init; procedure Compute_Image (Buffer : in out Buffer_Access) is begin case Current_Computation is when Fixed_Type => -- Fixed_Julia_Fractal.Increment_Frame; Fixed_Julia_Fractal.Calculate_Image (Buffer => Buffer); when Float_Type => -- Float_Julia_Fractal.Increment_Frame; Float_Julia_Fractal.Calculate_Image (Buffer => Buffer); end case; end Compute_Image; procedure Increment_Frame is begin if Cnt_Up then if Frame_Counter = UInt5'Last then Cnt_Up := not Cnt_Up; return; else Frame_Counter := Frame_Counter + 1; return; end if; end if; if Frame_Counter = UInt5'First then Cnt_Up := not Cnt_Up; return; end if; Frame_Counter := Frame_Counter - 1; end Increment_Frame; procedure RGB565_Color_Pixel (Z_Escape : Boolean; Iter_Escape : Natural; Px : out RGB565_Pixel) is Value : constant Integer := 765 * (Iter_Escape - 1) / Max_Iterations; begin if Z_Escape then if Value > 510 then Px := RGB565_Pixel'(Red => UInt5'Last - Frame_Counter, Green => UInt6'Last, Blue => UInt5 (Value rem Integer (UInt5'Last))); elsif Value > 255 then Px := RGB565_Pixel'(Red => UInt5'Last - Frame_Counter, Green => UInt6 (Value rem Integer (UInt6'Last)), Blue => UInt5'First + Frame_Counter); else Px := RGB565_Pixel'(Red => UInt5 (Value rem Integer (UInt5'Last)), Green => UInt6'First + UInt6 (Frame_Counter), Blue => UInt5'First); end if; else Px := RGB565_Pixel'(Red => UInt5'First + Frame_Counter, Green => UInt6'First + UInt6 (Frame_Counter), Blue => UInt5'First + Frame_Counter); end if; end RGB565_Color_Pixel; procedure Set_Computation_Type (Comp_Type : Computation_Enum) is begin Current_Computation := Comp_Type; end Set_Computation_Type; procedure Compute_Row (Row : Natural; Buffer : in out Buffer_Access) is begin case Current_Computation is when Fixed_Type => -- Fixed_Julia_Fractal.Increment_Frame; Fixed_Julia_Fractal.Calculate_Row (Y => Row, Idx => Buffer'First, Buffer => Buffer); when Float_Type => -- Float_Julia_Fractal.Increment_Frame; Float_Julia_Fractal.Calculate_Row (Y => Row, Idx => Buffer'First, Buffer => Buffer); end case; end Compute_Row; end Fractal_Impl;
linear_algebra/crout_lu.ads
jscparker/math_packages
30
13405
<reponame>jscparker/math_packages<gh_stars>10-100 -- PACKAGE Crout_LU -- -- LU decomposition and linear equation solving, with partial pivoting, -- for square, real valued matrices. -- -- A square (N X N) matrix with elements of generic type Real -- is input as "A" and returned in LU form, along with an array -- containing information on the permutation of the rows of the -- matrix that occurred during pivoting. -- -- The decomposition can be performed on arbitrary diagonal blocks of A. -- -- If Scaling_Desired = True, then matrices are scaled prior to LU -- decomposition. First all the columns are scaled to near unity (in -- 1-norm). Then the process is repeated for the rows. It's not fast -- but occasionally improves the decomposition. -- -- The LU form of A can then be used to solve simultaneous linear -- equations of the form A X = B. Column vector B is input -- into procedure Solve, and the solution is returned as X. -- generic type Real is digits <>; type Index is range <>; -- Defines the maximum size of the matrix: (N X N) where -- N = Index'Last - Index'First + 1. This is storage -- set aside for the matrix, but the routines operate on -- arbitrary diagonal blocks of the Matrix. type Matrix is array(Index, Index) of Real; package Crout_LU is type Row_Vector is array(Index) of Real; subtype Col_Vector is Row_Vector; type Rearrangement is array(Index) of Index; type Scale_id is (Diag_Inverse, For_Rows, For_Cols); type Scale_Vectors is array (Scale_id) of Row_Vector; procedure LU_Decompose (A : in out Matrix; -- A is overwritten with L and U Scalings : out Scale_Vectors; Row_Permutation : out Rearrangement; Final_Index : in Index := Index'Last; Starting_Index : in Index := Index'First; Scaling_Desired : in Boolean := False); -- In the output matrix A, the lower triangular matrix L is stored -- in the lower triangular region of A, and the upper, U, is stored -- in the upper triangular region of A. -- The diagonal of L is assumed to be entirely 1.0, so the output -- matrix A stores the diagonal elements of U along its diagonal. -- The matrix to be decomposed is (M X M) where -- M = Final_Index - Index'First + 1. The Matrix A can be much larger -- than M X M, but all values of A with row or column -- greater than Final_Index are ignored. procedure LU_Solve (X : out Row_Vector; B : in Row_Vector; A_LU : in Matrix; Scalings : in Scale_Vectors; Row_Permutation : in Rearrangement; Final_Index : in Index := Index'Last; Starting_Index : in Index := Index'First); -- Solve for X in the equation A X = B. The matrix LU_of_A is the LU decomp -- of matrix A. Its top triangular part is U, and its lower triangular -- is L, where L*U = A. -- The output of LU_Decompose is in suitable form for "Solve". function Product (A : Matrix; V : Row_Vector; Final_Index : Index := Index'Last; Starting_Index : Index := Index'First) return Row_Vector; function "-"(A, B : in Col_Vector) return Col_Vector; procedure Scale_Cols_Then_Rows (A : in out Matrix; Scalings : out Scale_Vectors; Final_Index : in Index := Index'Last; Starting_Index : in Index := Index'First); -- Returns the matrix A in its scaled form. The only purpose -- is for testing. end Crout_LU;
utils/dumpcs/dumpcs.asm
martinlindhe/dustbox-rs
38
20440
<filename>utils/dumpcs/dumpcs.asm org 0x100 section .text ; create file mov ah, 3ch mov cx, 0 mov dx, filename int 21h mov [handle], ax ; write data mov ah, 40h mov bx, [handle] mov cx, 0xFFFF ; length mov dx, 0 ; start int 21h ; close file mov ah, 3eh mov bx, [handle] int 21h ; exit mov ax,4c00h int 21h section .data filename db "cs.bin",0 section .bss handle resw 1
alloy4fun_models/trashltl/models/11/Jb3TRNHXrTdQ9HNeJ.als
Kaixi26/org.alloytools.alloy
0
4204
open main pred idJb3TRNHXrTdQ9HNeJ_prop12 { (some f:File | eventually (f in Trash implies always (f in Trash))) } pred __repair { idJb3TRNHXrTdQ9HNeJ_prop12 } check __repair { idJb3TRNHXrTdQ9HNeJ_prop12 <=> prop12o }
oeis/057/A057032.asm
neoneye/loda-programs
11
163507
; A057032: Let P(n) of a sequence s(1), s(2), s(3), ... be obtained by leaving s(1), ..., s(n-1) fixed and forward-cyclically permuting every n consecutive terms thereafter; apply P(2) to 1, 2, 3, ... to get PS(2), then apply P(3) to PS(2) to get PS(3), then apply P(4) to PS(3), etc. The limit of PS(n) as n -> oo is this sequence. ; 1,3,4,7,6,10,8,16,15,21,12,22,14,27,28,36,18,33,20,43,35,39,24,53,34,45,46,50,30,66,32,78,52,57,55,81,38,63,59,88,42,86,44,96,87,75,48,119,64,111,76,101,54,103,79,144,83,93,60,141,62,99,113,173,91,136,68,139,100,176,72,187,74,117,160,146,106,153,80,185,163,129,84,157,115,135,124,206,90,226,120,178,131,147,126,245,98,208,201,218 add $0,1 mov $2,$0 sub $0,1 lpb $0 mov $3,$2 dif $3,$0 cmp $3,$2 cmp $3,0 mul $3,$0 sub $0,1 add $2,$3 mov $1,$2 lpe add $1,1 mov $0,$1
src/y262/transform_x86.asm
rwillenbacher/y262
3
105019
<reponame>rwillenbacher/y262 %if 0 Copyright (c) 2016, <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: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. %endif %include "x86inc.asm" SECTION_RODATA ; fdct ALIGN 16 y262_fdct_tab1: dw 22724, 19265, 22724, 19265, 22724, 19265, 22724, 19265 dw 12872, 4520, 12872, 4520, 12872, 4520, 12872, 4520 dw 19265, -4520, 19265, -4520, 19265, -4520, 19265, -4520 dw -22724, -12872, -22724, -12872, -22724, -12872, -22724, -12872 dw 12872, -22724, 12872, -22724, 12872, -22724, 12872, -22724 dw 4520, 19265, 4520, 19265, 4520, 19265, 4520, 19265 dw 4520, -12872, 4520, -12872, 4520, -12872, 4520, -12872 dw 19265, -22724, 19265, -22724, 19265, -22724, 19265, -22724 dw 21406, 8867, 21406, 8867, 21406, 8867, 21406, 8867 dw -8867, -21406, -8867, -21406, -8867, -21406, -8867, -21406 dw 8867, -21406, 8867, -21406, 8867, -21406, 8867, -21406 dw 21406, -8867, 21406, -8867, 21406, -8867, 21406, -8867 dw 16383, 16383, 16383, 16383, 16383, 16383, 16383, 16383 dw 16383, 16383, 16383, 16383, 16383, 16383, 16383, 16383 dw 16383, -16383, 16383, -16383, 16383, -16383, 16383, -16383 dw -16383, 16383, -16383, 16383, -16383, 16383, -16383, 16383 ALIGN 16 y262_fdct_rnd1: dd 1024, 1024, 1024, 1024 ALIGN 16 y262_fdct_tab2: dw 16385, 16385, 22726, 19266, -8867, -21408, -22726, -12873 dw 16385, 16385, 12873, 4521, 21408, 8867, 19266, -4521 dw 16385, -16385, 12873, -22726, 21408, -8867, 19266, -22726 dw -16385, 16385, 4521, 19266, 8867, -21408, 4521, -12873 dw 16385, 22726, 21408, 19266, 16385, 12873, 8867, 4521 dw 16385, 19266, 8867, -4521, -16385, -22726, -21408, -12873 dw 16385, 12873, -8867, -22726, -16385, 4521, 21408, 19266 dw 16385, 4521, -21408, -12873, 16385, 19266, -8867, -22726 ALIGN16 y262_fdct_rnd2: dd 524288, 524288, 524288, 524288 ; idct ALIGN 16 y262_idct_tab1: dw 22724, 19265, 22724, 19265, 22724, 19265, 22724, 19265 dw 12872, 4520, 12872, 4520, 12872, 4520, 12872, 4520 dw 19265, -4520, 19265, -4520, 19265, -4520, 19265, -4520 dw -22724, -12872, -22724, -12872, -22724, -12872, -22724, -12872 dw 12872, -22724, 12872, -22724, 12872, -22724, 12872, -22724 dw 4520, 19265, 4520, 19265, 4520, 19265, 4520, 19265 dw 4520, -12872, 4520, -12872, 4520, -12872, 4520, -12872 dw 19265, -22724, 19265, -22724, 19265, -22724, 19265, -22724 dw 21406, 8867, 21406, 8867, 21406, 8867, 21406, 8867 dw 16383, 16383, 16383, 16383, 16383, 16383, 16383, 16383 dw 8867, -21406, 8867, -21406, 8867, -21406, 8867, -21406 dw 16383, -16383, 16383, -16383, 16383, -16383, 16383, -16383 ALIGN 16 y262_idct_rnd1: dd 1024, 1024, 1024, 1024 ALIGN 16 y262_idct_tab2: dw 16385, 21408, 16385, 8867, 16385, -8867, 16385, -21408 dw 16385, 8867, -16385, -21408, -16385, 21408, 16385, -8867 dw 22726, 19266, 19266, -4521, 12873, -22726, 4521, -12873 dw 12873, 4521, -22726, -12873, 4521, 19266, 19266, -22726 ALIGN 16 y262_idct_rnd2: dd 524288, 524288, 524288, 524288 ; quant ALIGN 16 minus_1 : dd 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff g_127 : dw 127, 127, 127, 127, 127, 127, 127, 127 g_n127 : dw -127, -127, -127, -127, -127, -127, -127, -127 g_2047 : dw 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047 g_m2048 : dw -2048, -2048, -2048, -2048, -2048, -2048, -2048, -2048 SECTION .text INIT_XMM ;void y262_fdct_sse2( short *block, short *dst ) cglobal y262_fdct_sse2, 2, 5, 8 lea r2, [ y262_fdct_tab1 ] movdqu m1, [ r0 ] movdqu m7, [ r0 + 112 ] movdqa m6, m1 psubsw m1, m7 paddsw m6, m7 movdqu [ r1 ], m6 movdqu m2, [ r0 + 16 ] movdqu m7, [ r0 + 96 ] movdqa m6, m2 psubsw m2, m7 paddsw m6, m7 movdqu m3, [ r0 + 32 ] movdqu [ r1 + 32 ], m6 movdqu m7, [ r0 + 80 ] movdqa m6, m3 psubsw m3, m7 paddsw m6, m7 movdqu m4, [ r0 + 48 ] movdqu m7, [ r0 + 64 ] movdqu [ r1 + 64 ], m6 movdqa m6, m4 psubsw m4, m7 paddsw m6, m7 movdqu [ r1 + 96 ], m6 movdqa m0, m1 punpcklwd m0, m2 punpckhwd m1, m2 movdqa m2, m3 punpcklwd m2, m4 punpckhwd m3, m4 movdqa m6, m0 movdqa m7, m1 pmaddwd m6, [ r2 ] pmaddwd m7, [ r2 ] movdqa m4, m2 movdqa m5, m3 pmaddwd m4, [ r2 + 16 ] pmaddwd m5, [ r2 + 16 ] paddd m6, m4 paddd m7, m5 paddd m6, [ y262_fdct_rnd1 ] paddd m7, [ y262_fdct_rnd1 ] psrad m6, 11 psrad m7, 11 packssdw m6, m7 movdqu [ r1 + 16 ], m6 add r2, 32 movdqa m6, m0 movdqa m7, m1 pmaddwd m6, [ r2 ] pmaddwd m7, [ r2 ] movdqa m4, m2 movdqa m5, m3 pmaddwd m4, [ r2 + 16 ] pmaddwd m5, [ r2 + 16 ] paddd m6, m4 paddd m7, m5 paddd m6, [ y262_fdct_rnd1 ] paddd m7, [ y262_fdct_rnd1 ] psrad m6, 11 psrad m7, 11 packssdw m6, m7 movdqu [ r1 + 48 ], m6 add r2, 32 movdqa m6, m0 movdqa m7, m1 pmaddwd m6, [ r2 ] pmaddwd m7, [ r2 ] movdqa m4, m2 movdqa m5, m3 pmaddwd m4, [ r2 + 16 ] pmaddwd m5, [ r2 + 16 ] paddd m6, m4 paddd m7, m5 paddd m6, [ y262_fdct_rnd1 ] paddd m7, [ y262_fdct_rnd1 ] psrad m6, 11 psrad m7, 11 packssdw m6, m7 movdqu [ r1 + 80 ], m6 add r2, 32 pmaddwd m0, [ r2 ] pmaddwd m1, [ r2 ] pmaddwd m2, [ r2 + 16 ] pmaddwd m3, [ r2 + 16 ] paddd m0, m2 paddd m1, m3 paddd m0, [ y262_fdct_rnd1 ] paddd m1, [ y262_fdct_rnd1 ] psrad m0, 11 psrad m1, 11 packssdw m0, m1 movdqu [ r1 + 112 ], m0 add r2, 32 movdqu m1, [ r1 ] movdqu m7, [ r1 + 96 ] movdqa m6, m1 psubsw m1, m7 paddsw m6, m7 movdqu [ r1 ], m6 movdqu m2, [ r1 + 32 ] movdqu m7, [ r1 + 64 ] movdqa m6, m2 psubsw m2, m7 paddsw m6, m7 movdqu [ r1 + 64 ], m6 movdqa m0, m1 punpcklwd m0, m2 punpckhwd m1, m2 movdqa m6, m0 movdqa m7, m1 pmaddwd m6, [ r2 ] pmaddwd m7, [ r2 ] paddd m6, [ y262_fdct_rnd1 ] paddd m7, [ y262_fdct_rnd1 ] psrad m6, 11 psrad m7, 11 packssdw m6, m7 movdqu [ r1 + 32 ], m6 add r2, 32 movdqa m6, m0 movdqa m7, m1 pmaddwd m6, [ r2 ] pmaddwd m7, [ r2 ] paddd m6, [ y262_fdct_rnd1 ] paddd m7, [ y262_fdct_rnd1 ] psrad m6, 11 psrad m7, 11 packssdw m6, m7 movdqu [ r1 + 96 ], m6 add r2, 32 movdqu m0, [ r1 ] movdqu m2, [ r1 + 64 ] movdqa m1, m0 punpcklwd m0, m2 punpckhwd m1, m2 movdqa m6, m0 movdqa m7, m1 pmaddwd m6, [ r2 ] pmaddwd m7, [ r2 ] paddd m6, [ y262_fdct_rnd1 ] paddd m7, [ y262_fdct_rnd1 ] psrad m6, 11 psrad m7, 11 packssdw m6, m7 movdqu [ r1 + 0 ], m6 add r2, 32 movdqa m6, m0 movdqa m7, m1 pmaddwd m6, [ r2 ] pmaddwd m7, [ r2 ] paddd m6, [ y262_fdct_rnd1 ] paddd m7, [ y262_fdct_rnd1 ] psrad m6, 11 psrad m7, 11 packssdw m6, m7 movdqu [ r1 + 64 ], m6 mov r3, 8 lea r2, [ y262_fdct_tab2 ] .y262_fdct_sse2_rowloop: movq m0, [ r1 ] movq m2, [ r1 + 8 ] movdqa m1, m0 pshuflw m2, m2, 0x1b psubsw m1, m2 paddsw m0, m2 punpckldq m0, m1 pshufd m1, m0, 0x4e movdqa m2, [ r2 ] movdqa m3, [ r2 + 16 ] movdqa m4, [ r2 + 32 ] movdqa m5, [ r2 + 48 ] pmaddwd m2, m0 pmaddwd m3, m1 pmaddwd m4, m0 pmaddwd m5, m1 paddd m2, m3 paddd m4, m5 paddd m2, [ y262_fdct_rnd2 ] paddd m4, [ y262_fdct_rnd2 ] psrad m2, 20 psrad m4, 20 packssdw m2, m4 movdqu [ r1 ], m2 add r1, 16 sub r3, 1 jnz .y262_fdct_sse2_rowloop RET INIT_XMM ; void y262_idct_sse2( int16_t *pi16_src, int16_t *pi_dst ) cglobal y262_idct_sse2, 2, 5, 8 lea r2, [ y262_idct_tab1 ] mov r3, 2 y262_idct_sse2_loop_v: movq m0, [ r0 + 16 ] movq m2, [ r0 + 48 ] movq m1, [ r0 + 80 ] movq m3, [ r0 + 112 ] punpcklwd m0, m2 punpcklwd m1, m3 movdqa m2, [ r2 ] movdqa m7, [ r2 + 16 ] pmaddwd m2, m0 pmaddwd m7, m1 paddd m2, m7 movdqa m3, [ r2 + 32 ] movdqa m7, [ r2 + 48 ] pmaddwd m3, m0 pmaddwd m7, m1 paddd m3, m7 movdqa m4, [ r2 + 64 ] movdqa m7, [ r2 + 80 ] pmaddwd m4, m0 pmaddwd m7, m1 paddd m4, m7 movdqa m5, [ r2 + 96 ] movdqa m7, [ r2 + 112 ] pmaddwd m5, m0 pmaddwd m7, m1 paddd m5, m7 movq m6, [ r0 + 32 ] movq m0, [ r0 + 96 ] punpcklwd m6, m0 pmaddwd m6, [ r2 + 128 ] movq m7, [ r0 + 0 ] movq m0, [ r0 + 64 ] punpcklwd m7, m0 pmaddwd m7, [ r2 + 144 ] movdqa m0, m6 paddd m0, m7 psubd m7, m6 movdqa m1, m2 paddd m1, m0 psubd m0, m2 paddd m0, [ y262_idct_rnd1 ] paddd m1, [ y262_idct_rnd1 ] psrad m1, 11 psrad m0, 11 packssdw m1, m1 packssdw m0, m0 movq [ r1 + 112 ], m0 movdqa m2, m5 paddd m2, m7 psubd m7, m5 paddd m2, [ y262_idct_rnd1 ] paddd m7, [ y262_idct_rnd1 ] psrad m2, 11 psrad m7, 11 packssdw m2, m2 movq [ r1 + 48 ], m2 packssdw m7, m7 movq m6, [ r0 + 32 ] movq m0, [ r0 + 96 ] punpcklwd m6, m0 pmaddwd m6, [ r2 + 160 ] movq m2, [ r0 + 0 ] movq m0, [ r0 + 64 ] movq [ r1 ], m1 movq [ r1 + 64 ], m7 punpcklwd m2, m0 pmaddwd m2, [ r2 + 176 ] movdqa m0, m6 paddd m0, m2 psubd m2, m6 movdqa m7, m3 paddd m7, m0 psubd m0, m3 paddd m7, [ y262_idct_rnd1 ] paddd m0, [ y262_idct_rnd1 ] psrad m7, 11 psrad m0, 11 packssdw m7, m7 packssdw m0, m0 movq [ r1 + 16 ], m7 movq [ r1 + 96 ], m0 movdqa m1, m4 paddd m1, m2 psubd m2, m4 paddd m1, [ y262_idct_rnd1 ] paddd m2, [ y262_idct_rnd1 ] psrad m1, 11 psrad m2, 11 packssdw m1, m1 movq [ r1 + 32 ], m1 packssdw m2, m2 movq [ r1 + 80 ], m2 add r0, 8 add r1, 8 sub r3, 1 jnz y262_idct_sse2_loop_v sub r1, 16 lea r2, [ y262_idct_tab2 ] mov r3, 8 .y262_idct_sse2_loop_h: movdqu m7, [ r1 ] pshuflw m0, m7, 0x88 punpckldq m0, m0 pshufhw m1, m7, 0x88 punpckhdq m1, m1 pshuflw m2, m7, 0xdd punpckldq m2, m2 pshufhw m3, m7, 0xdd punpckhdq m3, m3 pmaddwd m0, [ r2 ] pmaddwd m1, [ r2 + 16 ] pmaddwd m2, [ r2 + 32 ] pmaddwd m3, [ r2 + 48 ] paddd m0, m1 paddd m2, m3 movdqa m1, m0 paddd m0, m2 psubd m1, m2 pshufd m1, m1, 0x1b paddd m0, [ y262_idct_rnd2 ] paddd m1, [ y262_idct_rnd2 ] psrad m0, 20 psrad m1, 20 packssdw m0, m1 movdqu [ r1 ], m0 add r1, 16 sub r3, 1 jnz .y262_idct_sse2_loop_h RET ; int32_t y262_quant8x8_intra_fw_sse2( int16_t *pi_coeffs, int32_t i_stride, uint16_t *pui16_qmat, uint16_t *pui16_bias ) INIT_XMM cglobal y262_quant8x8_intra_fw_sse2, 4, 6, 5 %ifdef ARCH_X86_64 movsxd r1, r1d %endif pxor xmm3, xmm3 shl r1, 1 mov r5, r0 mov r4w, [ r5 ] %rep 8 movdqu xmm0, [ r0 ] movdqu xmm2, [ r2 ] movdqu xmm4, [ r3 ] pxor xmm1, xmm1 pcmpgtw xmm1, xmm0 pxor xmm0, xmm1 psubw xmm0, xmm1 paddusw xmm0, xmm4 pmulhuw xmm0, xmm2 pxor xmm0, xmm1 psubw xmm0, xmm1 pminsw xmm0, [ g_2047 ] pmaxsw xmm0, [ g_m2048 ] por xmm3, xmm0 movdqu [ r0 ], xmm0 add r0, r1 add r2, 16 add r3, 16 %endrep movdqa xmm0, [ minus_1 ] pxor xmm1, xmm1 pcmpeqb xmm3, xmm1 pxor xmm3, xmm0 mov [ r5 ], r4w pmovmskb eax, xmm3 RET ; int32_t y262_quant8x8_inter_fw_sse2( int16_t *pi_coeffs, int32_t i_stride, uint16_t *pui16_qmat ) INIT_XMM cglobal y262_quant8x8_inter_fw_sse2, 3, 3, 4 %ifdef ARCH_X86_64 movsxd r1, r1d %endif pxor xmm3, xmm3 shl r1, 1 %rep 8 movdqu xmm0, [ r0 ] movdqu xmm2, [ r2 ] pxor xmm1, xmm1 pcmpgtw xmm1, xmm0 pxor xmm0, xmm1 psubw xmm0, xmm1 pmulhuw xmm0, xmm2 pxor xmm0, xmm1 psubw xmm0, xmm1 pminsw xmm0, [ g_2047 ] pmaxsw xmm0, [ g_m2048 ] por xmm3, xmm0 movdqu [ r0 ], xmm0 add r0, r1 add r2, 16 %endrep movdqa xmm0, [ minus_1 ] pxor xmm1, xmm1 pcmpeqb xmm3, xmm1 pxor xmm3, xmm0 pmovmskb eax, xmm3 RET
Transynther/x86/_processed/US/_zr_/i7-7700_9_0x48_notsx.log_586_979.asm
ljhsiun2/medusa
9
171094
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r13 push %rax push %rcx push %rdi push %rsi lea addresses_A_ht+0x166e2, %rdi nop nop nop cmp $35453, %rax vmovups (%rdi), %ymm5 vextracti128 $1, %ymm5, %xmm5 vpextrq $0, %xmm5, %r13 nop nop nop nop dec %rdi lea addresses_D_ht+0x14f3a, %rsi lea addresses_A_ht+0x897a, %rdi nop nop nop nop sub %r11, %r11 mov $31, %rcx rep movsq nop nop nop nop dec %rsi lea addresses_WT_ht+0x1e27a, %r11 nop nop and %r10, %r10 mov $0x6162636465666768, %rax movq %rax, (%r11) cmp %rsi, %rsi lea addresses_D_ht+0x420a, %r13 nop nop cmp %r11, %r11 movl $0x61626364, (%r13) nop nop nop nop dec %rcx lea addresses_A_ht+0x1743a, %rsi lea addresses_D_ht+0x148ba, %rdi clflush (%rdi) nop sub $7428, %r11 mov $32, %rcx rep movsb nop xor $508, %rax lea addresses_WC_ht+0x10a7a, %r11 nop nop nop xor %r13, %r13 mov $0x6162636465666768, %rsi movq %rsi, %xmm7 vmovups %ymm7, (%r11) nop nop nop and %r13, %r13 lea addresses_WC_ht+0x11c7a, %rsi nop nop nop nop cmp $34012, %r13 vmovups (%rsi), %ymm2 vextracti128 $1, %ymm2, %xmm2 vpextrq $1, %xmm2, %rcx nop nop cmp %rax, %rax lea addresses_WC_ht+0x1be7a, %r13 nop nop and %r10, %r10 mov (%r13), %ax nop xor %rax, %rax pop %rsi pop %rdi pop %rcx pop %rax pop %r13 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r12 push %r14 push %r15 push %rbp // Faulty Load lea addresses_US+0xfe7a, %r12 nop nop nop sub $17652, %r14 movb (%r12), %r11b lea oracles, %r15 and $0xff, %r11 shlq $12, %r11 mov (%r15,%r11,1), %r11 pop %rbp pop %r15 pop %r14 pop %r12 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_US', 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_US', 'congruent': 0}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_A_ht', 'congruent': 2}} {'dst': {'same': False, 'congruent': 8, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_D_ht'}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_WT_ht', 'congruent': 10}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': True, 'size': 4, 'type': 'addresses_D_ht', 'congruent': 4}, 'OP': 'STOR'} {'dst': {'same': True, 'congruent': 4, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 4, 'type': 'addresses_A_ht'}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_WC_ht', 'congruent': 10}, 'OP': 'STOR'} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_WC_ht', 'congruent': 9}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_WC_ht', 'congruent': 11}} {'00': 586} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
simulation.asm
Zx55/MultiProcessSimulation
0
101986
; Multiprocess simulation assume cs:code data segment dw 0, 0 ; store original int 9 code db 0 ; flag shows which function to run ; 0 -> funcA ; 1 -> funcB ; 2 -> funcC dw 0 ; temporary buffer data ends code segment aStack: db 128 dup (0) bStack: db 128 dup (0) cStack: db 128 dup (0) ; snopshot structure: ; ES DI SI BP DX CX BX DS AX IP CS F SP aSnopshot: dw 0b800h, 0, 0, 0, 0, 0, 0, 0, 0, offset funcA, 0, 0, offset aStack + 128, 3 dup(0) bSnopshot: dw 0b800h, 0, 0, 0, 0, 0, 0, 0, 0, offset funcB, 0, 0, offset bStack + 128, 3 dup(0) cSnopshot: dw 0b800h, 0, 0, 0, 0, 0, 0, 0, 0, offset funcC, 0, 0, offset cStack + 128, 3 dup(0) start: mov ax, cs mov ds, ax mov ss, ax mov sp, offset aStack + 128 ; set stack of funcA mov dx, 0 ; set counter = 0 call init call funcA ; start with funcA ; Function A funcA: call delay inc dx mov ax, dx call num2char mov si, 5 * 160 + 40 * 2 call print jmp funcA ; Function B funcB: call delay inc dx mov ax, dx call num2char mov si, 6 * 160 + 40 * 2 call print jmp funcB ; Function C funcC: call delay inc dx mov ax, dx call num2char mov si, 7 * 160 + 40 * 2 call print jmp funcC ; Transform number to char ; Parameters: ; - (ax) = number ; Return: ; - (cl) = units ; - (ch) = tens num2char: push bx mov bl, 10 div bl mov cl, ah xor ah, ah div bl mov ch, ah pop bx ret ; Print numbers on the screen ; Parameter: ; - (es:si) = video memory ; - (cl) = units ; - (ch) = tens ; Return: ; - none print: add ch, '0' add cl, '0' mov byte ptr es:[si], ch mov byte ptr es:[si + 1], 21h mov byte ptr es:[si + 2], cl mov byte ptr es:[si + 3], 21h ret ; Delay ; Parameter: ; - none ; Return: ; - none delay: push ax push cx mov cx, 3 s1: mov ax, 0ffffh s2: dec ax jnz s2 dec cx jnz s1 pop cx pop ax ret ; Install the interruption code and initalize the program ; Parameter: ; - none ; Return: ; - none init: mov si, offset bSnopshot ; set address of funcB mov [si + 20], cs mov si, offset cSnopshot ; set address of funcA mov [si + 20], cs mov ax, data mov ds, ax mov ax, 0 mov es, ax cli ; mask the outer interruption mov ax, es:[9 * 4] ; store original int 9 code mov ds:[0], ax mov ax, es:[9 * 4 + 2] mov ds:[2], ax mov word ptr es:[9 * 4], offset int9 ; set interrupt vector mov es:[9 * 4 + 2], cs sti mov ax, 0b800h ; pointer to video memory mov es, ax ret ; Restore original int 9 code ; Parameters: ; - none ; Return: ; - none restore: mov ax, data mov ds, ax mov ax, 0 mov es, ax cli mov ax, ds:[0] mov es:[9 * 4], ax mov ax, ds:[2] mov es:[9 * 4 + 2], ax sti ret ; Switch the function according to keyboard input ; Parameter: ; - none ; Return: ; - none int9: cli push ax push ds mov ax, data mov ds, ax in al, 60h pushf call dword ptr ds:[0] cmp al, 1eh ; 'A' -> funcA je reponseA cmp al, 30h ; 'B' -> funcB je reponseB cmp al, 2eh ; 'C' -> funcC je reponseC cmp al, 10h ; 'Q' -> quit je reponseQ int9ret: pop ds pop ax sti iret reponseA: cmp byte ptr ds:[4], 0 je int9ret ; return if function doesn't change call saveAll ; save snopshot mov byte ptr ds:[4], 0 ; change function type call switch ; switch function reponseB: cmp byte ptr ds:[4], 1 je int9ret call saveAll mov byte ptr ds:[4], 1 call switch reponseC: cmp byte ptr ds:[4], 2 je int9ret call saveAll mov byte ptr ds:[4], 2 call switch reponseQ: sti call restore mov ax, 4c00h int 21h ; Save registers of origin function ; Parameters: ; - (ds:[4]) = function type to be store ; Return: ; - none saveAll: pop ds:[5] ; save ip push bx ; store snopshot in the stack push cx push dx push bp push si push di push es mov ax, cs mov es, ax mov cx, 12 cmp byte ptr ds:[4], 0 je saveA cmp byte ptr ds:[4], 1 je saveB cmp byte ptr ds:[4], 2 je saveC save: pop es:[bx] ; save snopshot add bx, 2 loop save mov es:[bx], sp ; save sp push ds:[5] ; restore save address ret saveA: mov bx, offset aSnopshot jmp save saveB: mov bx, offset bSnopshot jmp save saveC: mov bx, offset cSnopshot jmp save ; Restore registers of function to be switch ; Parameters: ; - (ds:[4]) = function type to be switch ; Return: ; - none switch: mov ax, cs mov es, ax cmp byte ptr ds:[4], 0 je switchA cmp byte ptr ds:[4], 1 je switchB cmp byte ptr ds:[4], 2 je switchC switchStack: mov ax, cs mov ss, ax ; restore stack mov sp, es:[bx + 24] push es:[bx + 20] ; push switch address push es:[bx + 18] mov cx, 9 switchReg: push es:[bx] ; get registers from snopshot add bx, 2 loop switchReg push es:[bx + 4] ; get flags from snopshot popf ; restore registers and flags pop ax pop ds pop bx pop cx pop dx pop bp pop si pop di pop es sti retf ; (cs:ip) point to function to be switch switchA: mov bx, offset aSnopshot jmp switchStack switchB: mov bx, offset bSnopshot jmp switchStack switchC: mov bx, offset cSnopshot jmp switchStack code ends end start
src/math.asm
BlockoS/up-18
3
97204
.zp _mulLo0 .ds 2 _mulLo1 .ds 2 _mulHi0 .ds 2 _mulHi1 .ds 2 .code ;;--------------------------------------------------------------------- ; name : div16 ; desc : Divide two 16 bits numbers ; in : _ax dividend ; _bx divisor ; out : _ax result (_ax / _bx) ; _cx remainder (_ax % _bx) ;;--------------------------------------------------------------------- div16: stz <_cl stz <_ch ldx #16 .loop: asl <_al ; dividend lb & hb*2, msb -> Carry rol <_ah rol <_cl ; remainder lb & hb * 2 + msb from carry rol <_ch lda <_cl sec sbc <_bl ; substract divisor to see if it fits in tay ; lb result -> Y, for we may need it later lda <_ch sbc <_bh bcc .skip ; if carry=0 then divisor didn't fit in yet sta <_ch ; else save substraction result as new remainder, sty <_cl inc <_al ; and INCrement result cause divisor fit in 1 times .skip: dex bne .loop rts ;;--------------------------------------------------------------------- ; name : divu8 ; desc : Divide two unsigned 8 bits numbers ; in : _al dividend ; _bl divisor ; out : _cl result (_al / _bl) ; _dl remainder (_al % _bl) divu8: lda <_al asl A sta <_cl cla ldy #8 .l1: rol A cmp <_bl bcc .l2 sbc <_bl .l2: rol <_cl dey bne .l1 sta <_dl rts ;;--------------------------------------------------------------------- ; name : math_init ; desc : Initialize internal parameters for mathematic operations. ; in : nothing ; out : nothing ;;--------------------------------------------------------------------- math_init: stz <_mulLo0 stz <_mulHi0 stz <_mulLo1 stz <_mulHi1 lda #high(mulTabLo0) sta <_mulLo1+1 inc A sta <_mulLo0+1 lda #high(mulTabHi0) sta <_mulHi1+1 inc A sta <_mulHi0+1 rts ;;--------------------------------------------------------------------- ; name : fastmul ; desc : Multiply two signed bytes. ; in : A first operand. ; Y second operand. ; out : A multiplication result (hi). ; X multiplication result (lo). ;;--------------------------------------------------------------------- fastmul: sta <_mulLo0 sta <_mulHi0 eor #$ff inc A sta <_mulLo1 sta <_mulHi1 sec lda [_mulLo0],Y sbc [_mulLo1],Y tax lda [_mulHi0],Y sbc [_mulHi1],Y rts align_org 256 ;;--------------------------------------------------------------------- ; Multiplication tables ;;--------------------------------------------------------------------- mulTabLo0: .db $00,$80,$01,$82,$04,$86,$09,$8c,$10,$94,$19,$9e,$24,$aa,$31,$b8 .db $40,$c8,$51,$da,$64,$ee,$79,$04,$90,$1c,$a9,$36,$c4,$52,$e1,$70 .db $00,$90,$21,$b2,$44,$d6,$69,$fc,$90,$24,$b9,$4e,$e4,$7a,$11,$a8 .db $40,$d8,$71,$0a,$a4,$3e,$d9,$74,$10,$ac,$49,$e6,$84,$22,$c1,$60 .db $00,$a0,$41,$e2,$84,$26,$c9,$6c,$10,$b4,$59,$fe,$a4,$4a,$f1,$98 .db $40,$e8,$91,$3a,$e4,$8e,$39,$e4,$90,$3c,$e9,$96,$44,$f2,$a1,$50 .db $00,$b0,$61,$12,$c4,$76,$29,$dc,$90,$44,$f9,$ae,$64,$1a,$d1,$88 .db $40,$f8,$b1,$6a,$24,$de,$99,$54,$10,$cc,$89,$46,$04,$c2,$81,$40 .db $00,$c0,$81,$42,$04,$c6,$89,$4c,$10,$d4,$99,$5e,$24,$ea,$b1,$78 .db $40,$08,$d1,$9a,$64,$2e,$f9,$c4,$90,$5c,$29,$f6,$c4,$92,$61,$30 .db $00,$d0,$a1,$72,$44,$16,$e9,$bc,$90,$64,$39,$0e,$e4,$ba,$91,$68 .db $40,$18,$f1,$ca,$a4,$7e,$59,$34,$10,$ec,$c9,$a6,$84,$62,$41,$20 .db $00,$e0,$c1,$a2,$84,$66,$49,$2c,$10,$f4,$d9,$be,$a4,$8a,$71,$58 .db $40,$28,$11,$fa,$e4,$ce,$b9,$a4,$90,$7c,$69,$56,$44,$32,$21,$10 .db $00,$f0,$e1,$d2,$c4,$b6,$a9,$9c,$90,$84,$79,$6e,$64,$5a,$51,$48 .db $40,$38,$31,$2a,$24,$1e,$19,$14,$10,$0c,$09,$06,$04,$02,$01,$00 mulTabLo1: .db $00,$00,$01,$02,$04,$06,$09,$0c,$10,$14,$19,$1e,$24,$2a,$31,$38 .db $40,$48,$51,$5a,$64,$6e,$79,$84,$90,$9c,$a9,$b6,$c4,$d2,$e1,$f0 .db $00,$10,$21,$32,$44,$56,$69,$7c,$90,$a4,$b9,$ce,$e4,$fa,$11,$28 .db $40,$58,$71,$8a,$a4,$be,$d9,$f4,$10,$2c,$49,$66,$84,$a2,$c1,$e0 .db $00,$20,$41,$62,$84,$a6,$c9,$ec,$10,$34,$59,$7e,$a4,$ca,$f1,$18 .db $40,$68,$91,$ba,$e4,$0e,$39,$64,$90,$bc,$e9,$16,$44,$72,$a1,$d0 .db $00,$30,$61,$92,$c4,$f6,$29,$5c,$90,$c4,$f9,$2e,$64,$9a,$d1,$08 .db $40,$78,$b1,$ea,$24,$5e,$99,$d4,$10,$4c,$89,$c6,$04,$42,$81,$c0 .db $00,$40,$81,$c2,$04,$46,$89,$cc,$10,$54,$99,$de,$24,$6a,$b1,$f8 .db $40,$88,$d1,$1a,$64,$ae,$f9,$44,$90,$dc,$29,$76,$c4,$12,$61,$b0 .db $00,$50,$a1,$f2,$44,$96,$e9,$3c,$90,$e4,$39,$8e,$e4,$3a,$91,$e8 .db $40,$98,$f1,$4a,$a4,$fe,$59,$b4,$10,$6c,$c9,$26,$84,$e2,$41,$a0 .db $00,$60,$c1,$22,$84,$e6,$49,$ac,$10,$74,$d9,$3e,$a4,$0a,$71,$d8 .db $40,$a8,$11,$7a,$e4,$4e,$b9,$24,$90,$fc,$69,$d6,$44,$b2,$21,$90 .db $00,$70,$e1,$52,$c4,$36,$a9,$1c,$90,$04,$79,$ee,$64,$da,$51,$c8 .db $40,$b8,$31,$aa,$24,$9e,$19,$94,$10,$8c,$09,$86,$04,$82,$01,$80 .db $00,$80,$01,$82,$04,$86,$09,$8c,$10,$94,$19,$9e,$24,$aa,$31,$b8 .db $40,$c8,$51,$da,$64,$ee,$79,$04,$90,$1c,$a9,$36,$c4,$52,$e1,$70 .db $00,$90,$21,$b2,$44,$d6,$69,$fc,$90,$24,$b9,$4e,$e4,$7a,$11,$a8 .db $40,$d8,$71,$0a,$a4,$3e,$d9,$74,$10,$ac,$49,$e6,$84,$22,$c1,$60 .db $00,$a0,$41,$e2,$84,$26,$c9,$6c,$10,$b4,$59,$fe,$a4,$4a,$f1,$98 .db $40,$e8,$91,$3a,$e4,$8e,$39,$e4,$90,$3c,$e9,$96,$44,$f2,$a1,$50 .db $00,$b0,$61,$12,$c4,$76,$29,$dc,$90,$44,$f9,$ae,$64,$1a,$d1,$88 .db $40,$f8,$b1,$6a,$24,$de,$99,$54,$10,$cc,$89,$46,$04,$c2,$81,$40 .db $00,$c0,$81,$42,$04,$c6,$89,$4c,$10,$d4,$99,$5e,$24,$ea,$b1,$78 .db $40,$08,$d1,$9a,$64,$2e,$f9,$c4,$90,$5c,$29,$f6,$c4,$92,$61,$30 .db $00,$d0,$a1,$72,$44,$16,$e9,$bc,$90,$64,$39,$0e,$e4,$ba,$91,$68 .db $40,$18,$f1,$ca,$a4,$7e,$59,$34,$10,$ec,$c9,$a6,$84,$62,$41,$20 .db $00,$e0,$c1,$a2,$84,$66,$49,$2c,$10,$f4,$d9,$be,$a4,$8a,$71,$58 .db $40,$28,$11,$fa,$e4,$ce,$b9,$a4,$90,$7c,$69,$56,$44,$32,$21,$10 .db $00,$f0,$e1,$d2,$c4,$b6,$a9,$9c,$90,$84,$79,$6e,$64,$5a,$51,$48 .db $40,$38,$31,$2a,$24,$1e,$19,$14,$10,$0c,$09,$06,$04,$02,$01,$00 mulTabHi0: .db $40,$3f,$3f,$3e,$3e,$3d,$3d,$3c,$3c,$3b,$3b,$3a,$3a,$39,$39,$38 .db $38,$37,$37,$36,$36,$35,$35,$35,$34,$34,$33,$33,$32,$32,$31,$31 .db $31,$30,$30,$2f,$2f,$2e,$2e,$2d,$2d,$2d,$2c,$2c,$2b,$2b,$2b,$2a .db $2a,$29,$29,$29,$28,$28,$27,$27,$27,$26,$26,$25,$25,$25,$24,$24 .db $24,$23,$23,$22,$22,$22,$21,$21,$21,$20,$20,$1f,$1f,$1f,$1e,$1e .db $1e,$1d,$1d,$1d,$1c,$1c,$1c,$1b,$1b,$1b,$1a,$1a,$1a,$19,$19,$19 .db $19,$18,$18,$18,$17,$17,$17,$16,$16,$16,$15,$15,$15,$15,$14,$14 .db $14,$13,$13,$13,$13,$12,$12,$12,$12,$11,$11,$11,$11,$10,$10,$10 .db $10,$0f,$0f,$0f,$0f,$0e,$0e,$0e,$0e,$0d,$0d,$0d,$0d,$0c,$0c,$0c .db $0c,$0c,$0b,$0b,$0b,$0b,$0a,$0a,$0a,$0a,$0a,$09,$09,$09,$09,$09 .db $09,$08,$08,$08,$08,$08,$07,$07,$07,$07,$07,$07,$06,$06,$06,$06 .db $06,$06,$05,$05,$05,$05,$05,$05,$05,$04,$04,$04,$04,$04,$04,$04 .db $04,$03,$03,$03,$03,$03,$03,$03,$03,$02,$02,$02,$02,$02,$02,$02 .db $02,$02,$02,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01 .db $01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 mulTabHi1: .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 .db $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$02,$02 .db $02,$02,$02,$02,$02,$02,$02,$02,$03,$03,$03,$03,$03,$03,$03,$03 .db $04,$04,$04,$04,$04,$04,$04,$04,$05,$05,$05,$05,$05,$05,$05,$06 .db $06,$06,$06,$06,$06,$07,$07,$07,$07,$07,$07,$08,$08,$08,$08,$08 .db $09,$09,$09,$09,$09,$09,$0a,$0a,$0a,$0a,$0a,$0b,$0b,$0b,$0b,$0c .db $0c,$0c,$0c,$0c,$0d,$0d,$0d,$0d,$0e,$0e,$0e,$0e,$0f,$0f,$0f,$0f .db $10,$10,$10,$10,$11,$11,$11,$11,$12,$12,$12,$12,$13,$13,$13,$13 .db $14,$14,$14,$15,$15,$15,$15,$16,$16,$16,$17,$17,$17,$18,$18,$18 .db $19,$19,$19,$19,$1a,$1a,$1a,$1b,$1b,$1b,$1c,$1c,$1c,$1d,$1d,$1d .db $1e,$1e,$1e,$1f,$1f,$1f,$20,$20,$21,$21,$21,$22,$22,$22,$23,$23 .db $24,$24,$24,$25,$25,$25,$26,$26,$27,$27,$27,$28,$28,$29,$29,$29 .db $2a,$2a,$2b,$2b,$2b,$2c,$2c,$2d,$2d,$2d,$2e,$2e,$2f,$2f,$30,$30 .db $31,$31,$31,$32,$32,$33,$33,$34,$34,$35,$35,$35,$36,$36,$37,$37 .db $38,$38,$39,$39,$3a,$3a,$3b,$3b,$3c,$3c,$3d,$3d,$3e,$3e,$3f,$3f .db $40,$40,$41,$41,$42,$42,$43,$43,$44,$44,$45,$45,$46,$46,$47,$47 .db $48,$48,$49,$49,$4a,$4a,$4b,$4c,$4c,$4d,$4d,$4e,$4e,$4f,$4f,$50 .db $51,$51,$52,$52,$53,$53,$54,$54,$55,$56,$56,$57,$57,$58,$59,$59 .db $5a,$5a,$5b,$5c,$5c,$5d,$5d,$5e,$5f,$5f,$60,$60,$61,$62,$62,$63 .db $64,$64,$65,$65,$66,$67,$67,$68,$69,$69,$6a,$6a,$6b,$6c,$6c,$6d .db $6e,$6e,$6f,$70,$70,$71,$72,$72,$73,$74,$74,$75,$76,$76,$77,$78 .db $79,$79,$7a,$7b,$7b,$7c,$7d,$7d,$7e,$7f,$7f,$80,$81,$82,$82,$83 .db $84,$84,$85,$86,$87,$87,$88,$89,$8a,$8a,$8b,$8c,$8d,$8d,$8e,$8f .db $90,$90,$91,$92,$93,$93,$94,$95,$96,$96,$97,$98,$99,$99,$9a,$9b .db $9c,$9d,$9d,$9e,$9f,$a0,$a0,$a1,$a2,$a3,$a4,$a4,$a5,$a6,$a7,$a8 .db $a9,$a9,$aa,$ab,$ac,$ad,$ad,$ae,$af,$b0,$b1,$b2,$b2,$b3,$b4,$b5 .db $b6,$b7,$b7,$b8,$b9,$ba,$bb,$bc,$bd,$bd,$be,$bf,$c0,$c1,$c2,$c3 .db $c4,$c4,$c5,$c6,$c7,$c8,$c9,$ca,$cb,$cb,$cc,$cd,$ce,$cf,$d0,$d1 .db $d2,$d3,$d4,$d4,$d5,$d6,$d7,$d8,$d9,$da,$db,$dc,$dd,$de,$df,$e0 .db $e1,$e1,$e2,$e3,$e4,$e5,$e6,$e7,$e8,$e9,$ea,$eb,$ec,$ed,$ee,$ef .db $f0,$f1,$f2,$f3,$f4,$f5,$f6,$f7,$f8,$f9,$fa,$fb,$fc,$fd,$fe,$ff ;;--------------------------------------------------------------------- ; Sine and cosine tables ;;--------------------------------------------------------------------- sinTable: .db 127, 126, 126, 126, 126, 126, 125, 125, 124, 123, 123, 122, 121, 120, 119, 118 .db 117, 116, 114, 113, 112, 110, 108, 107, 105, 103, 102, 100, 98, 96, 94, 91 .db 89, 87, 85, 82, 80, 78, 75, 73, 70, 67, 65, 62, 59, 57, 54, 51 .db 48, 45, 42, 39, 36, 33, 30, 27, 24, 21, 18, 15, 12, 9, 6, 3 cosTable: .db 0, -4, -7, -10, -13, -16, -19, -22, -25, -28, -31, -34, -37, -40, -43, -46 .db -49, -52, -55, -58, -60, -63, -66, -68, -71, -74, -76, -79, -81, -83, -86, -88 .db -90, -92, -95, -97, -99,-101,-103,-104,-106,-108,-109,-111,-113,-114,-115,-117 .db -118,-119,-120,-121,-122,-123,-124,-124,-125,-126,-126,-127,-127,-127,-127,-127 .db -127,-127,-127,-127,-127,-127,-126,-126,-125,-124,-124,-123,-122,-121,-120,-119 .db -118,-117,-115,-114,-113,-111,-109,-108,-106,-104,-103,-101, -99, -97, -95, -92 .db -90, -88, -86, -83, -81, -79, -76, -74, -71, -68, -66, -63, -60, -58, -55, -52 .db -49, -46, -43, -40, -37, -34, -31, -28, -25, -22, -19, -16, -13, -10, -7, -4 .db 0, 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45 .db 48, 51, 54, 57, 59, 62, 65, 67, 70, 73, 75, 78, 80, 82, 85, 87 .db 89, 91, 94, 96, 98, 100, 102, 103, 105, 107, 108, 110, 112, 113, 114, 116 .db 117, 118, 119, 120, 121, 122, 123, 123, 124, 125, 125, 126, 126, 126, 126, 126 .db 127, 126, 126, 126, 126, 126, 125, 125, 124, 123, 123, 122, 121, 120, 119, 118 .db 117, 116, 114, 113, 112, 110, 108, 107, 105, 103, 102, 100, 98, 96, 94, 91 .db 89, 87, 85, 82, 80, 78, 75, 73, 70, 67, 65, 62, 59, 57, 54, 51 .db 48, 45, 42, 39, 36, 33, 30, 27, 24, 21, 18, 15, 12, 9, 6, 3
programs/oeis/163/A163297.asm
neoneye/loda
22
86501
<gh_stars>10-100 ; A163297: a(n) = sum of divisors of n plus length of the binary expansion of n. ; 1,4,6,9,9,15,11,18,17,22,16,32,18,28,28,35,23,44,25,47,37,41,29,65,36,47,45,61,35,77,37,68,54,60,54,97,44,66,62,96,48,102,50,90,84,78,54,130,63,99,78,104,60,126,78,126,86,96,66,174,68,102,110,133,91,151,75,133,103,151,79,202,81,121,131,147,103,175,87,193,128,133,91,231,115,139,127,187,97,241,119,175,135,151,127,259,105,178,163,224 mov $2,$0 seq $0,203 ; a(n) = sigma(n), the sum of the divisors of n. Also called sigma_1(n). lpb $2 add $0,1 div $2,2 lpe
libsrc/target/vz/vz_midstr.asm
ahjelm/z88dk
640
81064
<filename>libsrc/target/vz/vz_midstr.asm ; CALLER LINKAGE FOR FUNCTION POINTERS SECTION code_clib PUBLIC vz_midstr PUBLIC _vz_midstr EXTERN asm_vz_midstr .vz_midstr ._vz_midstr pop af pop de pop hl push hl push de push af jp asm_vz_midstr
ffmpeg-3.2.5/libavfilter/x86/vf_pp7.asm
huyu0415/FFmpeg
3,645
12035
<gh_stars>1000+ ;***************************************************************************** ;* x86-optimized functions for pp7 filter ;* ;* Copyright (c) 2005 <NAME> <<EMAIL>> ;* ;* This file is part of FFmpeg. ;* ;* FFmpeg 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 2 of the License, or ;* (at your option) any later version. ;* ;* FFmpeg is distributed in the hope that it will be useful, ;* but WITHOUT ANY WARRANTY; without even the implied warranty of ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;* GNU General Public License for more details. ;* ;* You should have received a copy of the GNU General Public License along ;* with FFmpeg; if not, write to the Free Software Foundation, Inc., ;* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ;****************************************************************************** %include "libavutil/x86/x86util.asm" SECTION .text INIT_MMX mmx ;void ff_pp7_dctB_mmx(int16_t *dst, int16_t *src) cglobal pp7_dctB, 2, 2, 0, dst, src movq m0, [srcq] movq m1, [srcq+mmsize*1] paddw m0, [srcq+mmsize*6] paddw m1, [srcq+mmsize*5] movq m2, [srcq+mmsize*2] movq m3, [srcq+mmsize*3] paddw m2, [srcq+mmsize*4] paddw m3, m3 movq m4, m3 psubw m3, m0 paddw m4, m0 movq m0, m2 psubw m2, m1 paddw m0, m1 movq m1, m4 psubw m4, m0 paddw m1, m0 movq m0, m3 psubw m3, m2 psubw m3, m2 paddw m2, m0 paddw m2, m0 movq [dstq], m1 movq [dstq+mmsize*2], m4 movq [dstq+mmsize*1], m2 movq [dstq+mmsize*3], m3 RET
FC/reload_fcmd.asm
jedimatt42/tipicmd
5
92405
fg99: limi 0 li r0, fgmenu_seq ; this is the only non-relocatable instruction li r2, 20 ; sequence length: prefix (8) + sender (12) fgsend: clr @>6000 ; signal new byte li r1, >0038 ; >7000 >> 9 movb *r0+, r1 src r1, 7 ; >7000 + (byte << 1) clr *r1 ; send byte ; mov *r1, r3 ; in RAM mode, use these lines instead ; mov r3, *r1 ; to send a byte dec r2 jne fgsend clr @>6000 ; done ; wait for image to be loaded li r2, >100 ; larger images take more time to load prewait: src r0, 8 dec r2 jeq prewait fgwait: src r0, 8 ; burn at least 21 cycles li r0, >6000 ; check >6000->6200 li r2, >100 fgl1 mov *r0+, r1 jne fgdone dec r2 jne fgl1 jmp fgwait ; image has been loaded fgdone: blwp @>0000 fgmenu_seq: ; send this to reload byte >99 text 'OKFG99' byte >99 fg99_msg: ; file to load (8 chars, pad with \00) text "FCMDG" byte >00, >00, >00 data >0000 ; >0000 for GROM/mixed, >FFFF for ROM data >0000
oeis/271/A271999.asm
neoneye/loda-programs
11
99981
; A271999: Halogen sequence: a(n) = A018227(n)-1. ; Submitted by <NAME> ; 1,11,17,35,53,85,117,167,217,289,361,459,557,685,813,975,1137,1337,1537,1779,2021,2309,2597,2935,3273,3665,4057,4507,4957,5469,5981,6559,7137,7785,8433,9155,9877,10677,11477,12359,13241,14209,15177,16235,17293,18445,19597,20847,22097,23449,24801,26259,27717,29285,30853,32535,34217,36017,37817,39739,41661,43709,45757,47935,50113,52425,54737,57187,59637,62229,64821,67559,70297,73185,76073,79115,82157,85357,88557,91919,95281,98809,102337,106035,109733,113605,117477,121527,125577,129809,134041 add $0,2 lpb $0 add $2,$0 trn $0,2 add $3,$2 div $2,2 mul $2,2 max $2,3 lpe mov $0,$3 mul $0,2 sub $0,3
usr/usys.asm
AnvithShetty10/xv6_rpi3_port
1
178554
<reponame>AnvithShetty10/xv6_rpi3_port usys.o: file format elf32-littlearm Disassembly of section .text: 00000000 <fork>: 0: e52d4004 push {r4} ; (str r4, [sp, #-4]!) 4: e1a04003 mov r4, r3 8: e1a03002 mov r3, r2 c: e1a02001 mov r2, r1 10: e1a01000 mov r1, r0 14: e3a00001 mov r0, #1 18: ef000000 svc 0x00000000 1c: e49d4004 pop {r4} ; (ldr r4, [sp], #4) 20: e12fff1e bx lr 00000024 <exit>: 24: e52d4004 push {r4} ; (str r4, [sp, #-4]!) 28: e1a04003 mov r4, r3 2c: e1a03002 mov r3, r2 30: e1a02001 mov r2, r1 34: e1a01000 mov r1, r0 38: e3a00002 mov r0, #2 3c: ef000000 svc 0x00000000 40: e49d4004 pop {r4} ; (ldr r4, [sp], #4) 44: e12fff1e bx lr 00000048 <wait>: 48: e52d4004 push {r4} ; (str r4, [sp, #-4]!) 4c: e1a04003 mov r4, r3 50: e1a03002 mov r3, r2 54: e1a02001 mov r2, r1 58: e1a01000 mov r1, r0 5c: e3a00003 mov r0, #3 60: ef000000 svc 0x00000000 64: e49d4004 pop {r4} ; (ldr r4, [sp], #4) 68: e12fff1e bx lr 0000006c <pipe>: 6c: e52d4004 push {r4} ; (str r4, [sp, #-4]!) 70: e1a04003 mov r4, r3 74: e1a03002 mov r3, r2 78: e1a02001 mov r2, r1 7c: e1a01000 mov r1, r0 80: e3a00004 mov r0, #4 84: ef000000 svc 0x00000000 88: e49d4004 pop {r4} ; (ldr r4, [sp], #4) 8c: e12fff1e bx lr 00000090 <read>: 90: e52d4004 push {r4} ; (str r4, [sp, #-4]!) 94: e1a04003 mov r4, r3 98: e1a03002 mov r3, r2 9c: e1a02001 mov r2, r1 a0: e1a01000 mov r1, r0 a4: e3a00005 mov r0, #5 a8: ef000000 svc 0x00000000 ac: e49d4004 pop {r4} ; (ldr r4, [sp], #4) b0: e12fff1e bx lr 000000b4 <write>: b4: e52d4004 push {r4} ; (str r4, [sp, #-4]!) b8: e1a04003 mov r4, r3 bc: e1a03002 mov r3, r2 c0: e1a02001 mov r2, r1 c4: e1a01000 mov r1, r0 c8: e3a00010 mov r0, #16 cc: ef000000 svc 0x00000000 d0: e49d4004 pop {r4} ; (ldr r4, [sp], #4) d4: e12fff1e bx lr 000000d8 <close>: d8: e52d4004 push {r4} ; (str r4, [sp, #-4]!) dc: e1a04003 mov r4, r3 e0: e1a03002 mov r3, r2 e4: e1a02001 mov r2, r1 e8: e1a01000 mov r1, r0 ec: e3a00015 mov r0, #21 f0: ef000000 svc 0x00000000 f4: e49d4004 pop {r4} ; (ldr r4, [sp], #4) f8: e12fff1e bx lr 000000fc <kill>: fc: e52d4004 push {r4} ; (str r4, [sp, #-4]!) 100: e1a04003 mov r4, r3 104: e1a03002 mov r3, r2 108: e1a02001 mov r2, r1 10c: e1a01000 mov r1, r0 110: e3a00006 mov r0, #6 114: ef000000 svc 0x00000000 118: e49d4004 pop {r4} ; (ldr r4, [sp], #4) 11c: e12fff1e bx lr 00000120 <exec>: 120: e52d4004 push {r4} ; (str r4, [sp, #-4]!) 124: e1a04003 mov r4, r3 128: e1a03002 mov r3, r2 12c: e1a02001 mov r2, r1 130: e1a01000 mov r1, r0 134: e3a00007 mov r0, #7 138: ef000000 svc 0x00000000 13c: e49d4004 pop {r4} ; (ldr r4, [sp], #4) 140: e12fff1e bx lr 00000144 <open>: 144: e52d4004 push {r4} ; (str r4, [sp, #-4]!) 148: e1a04003 mov r4, r3 14c: e1a03002 mov r3, r2 150: e1a02001 mov r2, r1 154: e1a01000 mov r1, r0 158: e3a0000f mov r0, #15 15c: ef000000 svc 0x00000000 160: e49d4004 pop {r4} ; (ldr r4, [sp], #4) 164: e12fff1e bx lr 00000168 <mknod>: 168: e52d4004 push {r4} ; (str r4, [sp, #-4]!) 16c: e1a04003 mov r4, r3 170: e1a03002 mov r3, r2 174: e1a02001 mov r2, r1 178: e1a01000 mov r1, r0 17c: e3a00011 mov r0, #17 180: ef000000 svc 0x00000000 184: e49d4004 pop {r4} ; (ldr r4, [sp], #4) 188: e12fff1e bx lr 0000018c <unlink>: 18c: e52d4004 push {r4} ; (str r4, [sp, #-4]!) 190: e1a04003 mov r4, r3 194: e1a03002 mov r3, r2 198: e1a02001 mov r2, r1 19c: e1a01000 mov r1, r0 1a0: e3a00012 mov r0, #18 1a4: ef000000 svc 0x00000000 1a8: e49d4004 pop {r4} ; (ldr r4, [sp], #4) 1ac: e12fff1e bx lr 000001b0 <fstat>: 1b0: e52d4004 push {r4} ; (str r4, [sp, #-4]!) 1b4: e1a04003 mov r4, r3 1b8: e1a03002 mov r3, r2 1bc: e1a02001 mov r2, r1 1c0: e1a01000 mov r1, r0 1c4: e3a00008 mov r0, #8 1c8: ef000000 svc 0x00000000 1cc: e49d4004 pop {r4} ; (ldr r4, [sp], #4) 1d0: e12fff1e bx lr 000001d4 <link>: 1d4: e52d4004 push {r4} ; (str r4, [sp, #-4]!) 1d8: e1a04003 mov r4, r3 1dc: e1a03002 mov r3, r2 1e0: e1a02001 mov r2, r1 1e4: e1a01000 mov r1, r0 1e8: e3a00013 mov r0, #19 1ec: ef000000 svc 0x00000000 1f0: e49d4004 pop {r4} ; (ldr r4, [sp], #4) 1f4: e12fff1e bx lr 000001f8 <mkdir>: 1f8: e52d4004 push {r4} ; (str r4, [sp, #-4]!) 1fc: e1a04003 mov r4, r3 200: e1a03002 mov r3, r2 204: e1a02001 mov r2, r1 208: e1a01000 mov r1, r0 20c: e3a00014 mov r0, #20 210: ef000000 svc 0x00000000 214: e49d4004 pop {r4} ; (ldr r4, [sp], #4) 218: e12fff1e bx lr 0000021c <chdir>: 21c: e52d4004 push {r4} ; (str r4, [sp, #-4]!) 220: e1a04003 mov r4, r3 224: e1a03002 mov r3, r2 228: e1a02001 mov r2, r1 22c: e1a01000 mov r1, r0 230: e3a00009 mov r0, #9 234: ef000000 svc 0x00000000 238: e49d4004 pop {r4} ; (ldr r4, [sp], #4) 23c: e12fff1e bx lr 00000240 <dup>: 240: e52d4004 push {r4} ; (str r4, [sp, #-4]!) 244: e1a04003 mov r4, r3 248: e1a03002 mov r3, r2 24c: e1a02001 mov r2, r1 250: e1a01000 mov r1, r0 254: e3a0000a mov r0, #10 258: ef000000 svc 0x00000000 25c: e49d4004 pop {r4} ; (ldr r4, [sp], #4) 260: e12fff1e bx lr 00000264 <getpid>: 264: e52d4004 push {r4} ; (str r4, [sp, #-4]!) 268: e1a04003 mov r4, r3 26c: e1a03002 mov r3, r2 270: e1a02001 mov r2, r1 274: e1a01000 mov r1, r0 278: e3a0000b mov r0, #11 27c: ef000000 svc 0x00000000 280: e49d4004 pop {r4} ; (ldr r4, [sp], #4) 284: e12fff1e bx lr 00000288 <sbrk>: 288: e52d4004 push {r4} ; (str r4, [sp, #-4]!) 28c: e1a04003 mov r4, r3 290: e1a03002 mov r3, r2 294: e1a02001 mov r2, r1 298: e1a01000 mov r1, r0 29c: e3a0000c mov r0, #12 2a0: ef000000 svc 0x00000000 2a4: e49d4004 pop {r4} ; (ldr r4, [sp], #4) 2a8: e12fff1e bx lr 000002ac <sleep>: 2ac: e52d4004 push {r4} ; (str r4, [sp, #-4]!) 2b0: e1a04003 mov r4, r3 2b4: e1a03002 mov r3, r2 2b8: e1a02001 mov r2, r1 2bc: e1a01000 mov r1, r0 2c0: e3a0000d mov r0, #13 2c4: ef000000 svc 0x00000000 2c8: e49d4004 pop {r4} ; (ldr r4, [sp], #4) 2cc: e12fff1e bx lr 000002d0 <uptime>: 2d0: e52d4004 push {r4} ; (str r4, [sp, #-4]!) 2d4: e1a04003 mov r4, r3 2d8: e1a03002 mov r3, r2 2dc: e1a02001 mov r2, r1 2e0: e1a01000 mov r1, r0 2e4: e3a0000e mov r0, #14 2e8: ef000000 svc 0x00000000 2ec: e49d4004 pop {r4} ; (ldr r4, [sp], #4) 2f0: e12fff1e bx lr
libsrc/_DEVELOPMENT/alloc/malloc/c/sccz80/memalign_callee.asm
teknoplop/z88dk
0
175317
; void *memalign(size_t alignment, size_t size) INCLUDE "clib_cfg.asm" SECTION code_clib SECTION code_alloc_malloc ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IF __CLIB_OPT_MULTITHREAD & $01 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PUBLIC memalign_callee EXTERN aligned_alloc_callee defc memalign_callee = aligned_alloc_callee ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ELSE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PUBLIC memalign_callee EXTERN memalign_unlocked_callee defc memalign_callee = memalign_unlocked_callee ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ENDIF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/a/a83a02a.ada
best08618/asylo
7
29200
-- A83A02A.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 A LABEL IN A NESTED SUBPROGRAM OR PACKAGE CAN BE IDENTICAL -- TO A LABEL OUTSIDE SUCH CONSTRUCT. -- "INSIDE LABEL": INSIDE * PACKAGE _PACK A -- * FUNCTION INSIDE PACKAGE _PACKFUN B -- * PROCEDURE _PROC C -- * PROCEDURE INSIDE BLOCK _BLOCKPROC D -- "OUTSIDE LABEL": INSIDE * MAIN _MAIN 1 -- * BLOCK IN MAIN _BLOCK 2 -- * LOOP IN BLOCK IN MAIN _BLOCKLOOP 3 -- * LOOP IN MAIN _LOOP 4 -- CASES TESTED: A1 B2 A3 B4 1 2 3 4 -- D1 C2 C3 D4 -- D2 AB A X . X . -- B . X . X -- C . X X . -- D X . . X -- RM 02/09/80 WITH REPORT ; PROCEDURE A83A02A IS USE REPORT ; PROCEDURE PROC1 IS BEGIN << LAB_PROC_BLOCK >> NULL ; -- C2 C << LAB_PROC_BLOCKLOOP >> NULL ; -- C3 END PROC1 ; PACKAGE PACK1 IS FUNCTION F RETURN INTEGER ; END PACK1 ; PACKAGE BODY PACK1 IS FUNCTION F RETURN INTEGER IS BEGIN << LAB_PACKFUN_BLOCK >> NULL ; -- B2 B << LAB_PACKFUN_LOOP >> NULL ; -- B4 << LAB_PACKFUN_PACK >> NULL ; -- BA (AB) RETURN 7 ; END F ; BEGIN << LAB_PACK_MAIN >> NULL ; -- A1 A << LAB_PACK_BLOCKLOOP >> NULL ; -- A3 << LAB_PACKFUN_PACK >> NULL ; -- BA (AB) END PACK1 ; BEGIN TEST( "A83A02A" , "CHECK THAT A LABEL IN A NESTED SUBPROGRAM" & " OR PACKAGE CAN BE IDENTICAL TO A LABEL" & " OUTSIDE SUCH CONSTRUCT" ); << LAB_PACK_MAIN >> NULL ; -- A1 1 << LAB_BLOCKPROC_MAIN >> NULL ; -- D1 DECLARE -- PROCEDURE PROC2 IS BEGIN << LAB_BLOCKPROC_MAIN >> NULL ; -- D1 D << LAB_BLOCKPROC_LOOP >> NULL ; -- D4 << LAB_BLOCKPROC_BLOCK >> NULL ; -- D2 END PROC2 ; BEGIN << LAB_PACKFUN_BLOCK >> NULL ; -- B2 2 << LAB_PROC_BLOCK >> NULL ; -- C2 << LAB_BLOCKPROC_BLOCK >> NULL ; -- D2 FOR I IN 1..2 LOOP << LAB_PACK_BLOCKLOOP >> NULL ; -- A3 3 << LAB_PROC_BLOCKLOOP >> NULL ; -- C3 END LOOP; END ; FOR I IN 1..2 LOOP << LAB_PACKFUN_LOOP >> NULL ; -- B4 4 << LAB_BLOCKPROC_LOOP >> NULL ; -- D4 END LOOP; RESULT ; END A83A02A ;
src/main.adb
sebsgit/textproc
0
20607
<reponame>sebsgit/textproc<gh_stars>0 with MainTestSuite; procedure Main is begin MainTestSuite.runAll; end Main;
programs/oeis/138/A138322.asm
karttu/loda
0
101861
; A138322: a(n) = 5*a(n-1) + 10*a(n-2). ; 1,15,85,575,3725,24375,159125,1039375,6788125,44334375,289553125,1891109375,12351078125,80666484375,526843203125,3440880859375,22472836328125,146772990234375,958593314453125,6260696474609375 lpb $0,1 mov $2,$0 cal $2,180250 ; a(n) = 5*a(n-1) + 10*a(n-2), with a(1)=0 and a(2)=1. sub $0,1 mul $2,2 add $1,$2 lpe div $1,2 mul $1,14 add $1,1
src/curve25519_mult.ads
joffreyhuguet/curve25519-spark2014
4
17671
<gh_stars>1-10 with Big_Integers; use Big_Integers; with Types; use Types; with Conversion; use Conversion; package Curve25519_Mult with SPARK_Mode is function Multiply (X, Y : Integer_255) return Product_Integer with Pre => All_In_Range (X, Y, Min_Multiply, Max_Multiply), Post => +Multiply'Result = (+X) * (+Y); end Curve25519_Mult;
Task/Doubly-linked-list-Element-insertion/Ada/doubly-linked-list-element-insertion-2.ada
LaudateCorpus1/RosettaCodeData
1
22334
procedure Make_List is A, B, C : Link_Access; begin A := new Link; B := new Link; C := new Link; A.Data := 1; B.Data := 2; C.Data := 2; Insert(Anchor => A, New_Link => B); -- The list is (A, B) Insert(Anchor => A, New_Link => C); -- The list is (A, C, B) end Make_List;
tests/src/assert_ast.ads
TNO/Rejuvenation-Ada
1
27767
<gh_stars>1-10 with Libadalang.Common; use Libadalang.Common; package Assert_AST is procedure Assert_Equal_AST (Expected_String, Actual_String : String; Rule : Grammar_Rule; Message : String); end Assert_AST;
Source Codes/ASCII adjust.asm
kaazima/Emulator-8086
0
164955
<gh_stars>0 .MODEL small .STACK .DATA .CODE .STARTUP mov al,07h mov bl,05h add al,bl aaa ;ax=0102 mov al,35h mov bl,38h sub al,bl aas ;ax=0007 mov al,7h mov bl,4h mul bl aam ;ax=0208 mov ax,0102h aad ;ax=000C end
oeis/009/A009942.asm
neoneye/loda-programs
11
94341
<filename>oeis/009/A009942.asm ; A009942: Coordination sequence for Ni2In, Position Ni2. ; 1,14,44,104,176,278,398,542,704,896,1100,1334,1586,1862,2156,2480,2816,3182,3566,3974,4400,4856,5324,5822,6338,6878,7436,8024,8624,9254,9902,10574,11264,11984,12716,13478,14258,15062,15884,16736,17600,18494,19406,20342,21296,22280,23276,24302,25346,26414,27500,28616,29744,30902,32078,33278,34496,35744,37004,38294,39602,40934,42284,43664,45056,46478,47918,49382,50864,52376,53900,55454,57026,58622,60236,61880,63536,65222,66926,68654,70400,72176,73964,75782,77618,79478,81356,83264,85184,87134 mov $2,7 mov $5,$0 pow $0,2 mov $6,7 add $6,$0 mod $2,$6 add $2,$6 mod $2,6 mov $1,$2 mov $4,$5 mul $4,$5 mov $3,$4 mul $3,11 add $1,$3 mov $0,$1
libsrc/_DEVELOPMENT/math/float/math48/lm/z80/asm_exp2.asm
meesokim/z88dk
0
16014
SECTION code_fp_math48 PUBLIC asm_exp2 EXTERN am48_exp2 defc asm_exp2 = am48_exp2
src/c64/constants.asm
nondejus/iso64
19
92180
;; -*- mode: asm -*- ;; ;; This file is part of a Supersingular Isogeny Key Encapsulation (SIKE) over P434 for Commodore 64. ;; Copyright (c) 2020 <NAME> ;; See LICENSE for licensing information. ;; ;; Authors: ;; - <NAME> <<EMAIL>> ;; Constants and pseudo registers. ;; ;; We shove all the scratch space at the top of the userspace at $c000-$cfff. !cpu 6510 ; For 6502/6510 with undocumented opcodes !zone constants ; Namespacing ;; Number of words in a field element. ;; ;; 434 bits divided by 8 is 54.25, but we round up to 56 to get a 448-bit ;; element to match existing implementations for 32-bit and 64-bit ;; architectures. We wouldn't want Commodore 64s to be unable to talk to ;; "modern" CPUs. FE_WORDS = 56 ;; Various cryptographic masks for constant-time operations. !addr MASK = $cfff !addr MASK_HIGH = $cffe !addr MASK_LOW = $cffd !addr ADDER_REAL = $cffc !addr ADDER_FAKE = $cfeb ;; Pseudo registers for storing intermediate values during field element subtraction and addition. !addr FE_SUB_BORROW = $cffa !addr FE_ADD_CARRY = $cff9 !addr FE_ADD_TMP2 = $cff8 !addr FE_ADD_TMP1 = $cff7 ;; Pseudo registers for storing intermediate values during field element multiplication. !addr FE_MUL_RESULT = $cff0 ; 2 words !addr FE_MUL_CARRY = $cfee !addr FE_MUL_T = $cfed !addr FE_MUL_U = $cfec !addr FE_MUL_V = $cfeb !addr FE_MUL_TMP = $cfea ;; Pseudo registers for field element reduction. !addr FE_RDC_RESULT = $cfe9 ; 2 words !addr FE_RDC_CARRY = $cfe7 !addr FE_RDC_T = $cfe6 !addr FE_RDC_U = $cfe5 !addr FE_RDC_V = $cfe4 !addr FE_RDC_TMP = $cfe3 !addr FE_RDC_SKIP = $cfe2 ;; Pseudo registers for field element negation. !addr FE_NEG_TMP = $cfe1 ;; Pseudo registers for field element squaring. !addr FE_SQR_TMP = FE_NEG_TMP - (1 * FE_WORDS) ; Fuckin' fancy assembler parser passing. ;; Pseudo registers for GF(p^2) squaring. !addr FE2_SQR_TMP1 = FE_NEG_TMP - (2 * FE_WORDS) !addr FE2_SQR_TMP2 = FE_NEG_TMP - (3 * FE_WORDS) !addr FE2_SQR_TMP3 = FE_NEG_TMP - (4 * FE_WORDS) ;; Pseudo registers for GF(p^2) multiplication. !addr FE2_MUL_TMP1 = FE_NEG_TMP - (5 * FE_WORDS) !addr FE2_MUL_TMP2 = FE_NEG_TMP - (6 * FE_WORDS) !addr FE2_MUL_TMP3 = FE_NEG_TMP - (7 * FE_WORDS) !addr FE2_MUL_TMP4 = FE_NEG_TMP - (8 * FE_WORDS) !addr FE2_MUL_TMP5 = FE_NEG_TMP - (9 * FE_WORDS) ;; Pseudo registers for GF(p^2) element inversion. !addr FE2_INV_TMP1 = FE_NEG_TMP - (10 * FE_WORDS) !addr FE2_INV_TMP2 = FE_NEG_TMP - (11 * FE_WORDS) !addr FE2_INV_TMP3 = FE_NEG_TMP - (12 * FE_WORDS) ;; XXX should maybe double check these addresses to make sure we're not ;; crossing page boundaries !addr FE_ADD_A = FE_NEG_TMP - (13 * FE_WORDS) !addr FE_ADD_B = FE_NEG_TMP - (14 * FE_WORDS) !addr FE_ADD_C = FE_NEG_TMP - (15 * FE_WORDS) ;; For some reason for the following with the ACME Crossass assembler ;; in order to store for example $ABCDEF01 at a given location in the ;; binary we need to do: ;; ;; !le32 $EF01ABCD ;; ;; and swap each set of two words. I do not know why this is, and ;; frankly I do not care to find out. ;; P434_PRIME = 24439423661345221551909145011457493619085780243761596511325807336205221239331976725970216671828618445898719026692884939342314733567 !addr P434_PRIME = FE_NEG_TMP - (16 * FE_WORDS) LDA * ; Save program counter PHA ; Push it to the global stack * = P434_PRIME ; Change program couter to location of P434_PRIME ;; Write raw bytes to this offset in the program !le32 $FFFFFFFF, $FFFFFFFF, $FFFFFFFF, $FFFFFFFF, $FFFFFFFF, $FFFFFFFF, $767AFDC1, $FFFFE2FF, $5C787BC6, $AEA33158, $5FD66CFC, $205681C5, $341F0002, $73442717 PLA ; Pull the old program counter back out STA MASK ; Store it in a junk spot for now * = MASK ; Restore it ;; 2 * P434_PRIME !addr P434_PRIME_2 = FE_NEG_TMP - (17 * FE_WORDS) LDA * ; Save program counter PHA ; Push it to the global stack * = P434_PRIME_2 ; Change program couter to location of P434_PRIME_2 ;; Write raw bytes to this offset in the program !le32 $FFFFFFFF, $FFFFFFFE, $FFFFFFFF, $FFFFFFFF, $FFFFFFFF, $FFFFFFFF, $ECF5FB82, $FFFFC5FF, $B8F0F78C, $5D4762B1, $BFADD9F8, $40AC038A, $683E0004, $E6884E2E PLA ; Pull the old program counter back out STA MASK ; Store it in a junk spot for now * = MASK ; Restore it ;; P434_PRIME + 1 !addr P434_PRIME_PLUS_1 = FE_NEG_TMP - (18 * FE_WORDS) LDA * ; Save program counter PHA ; Push it to the global stack * = P434_PRIME_PLUS_1 ; Change program couter to location of P434_PRIME_PLUS_1 ;; Write raw bytes to this offset in the program !le32 $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $767AFDC1, $0000E300, $5C787BC6, $AEA33158, $5FD66CFC, $205681C5, $341F0002, $73442717 PLA ; Pull the old program counter back out STA MASK ; Store it in a junk spot for now * = MASK ; Restore it ;; Scratch space for chained inversion field element squarings. !addr FE_INV_TMP1 = FE_NEG_TMP - (19 * FE_WORDS) !addr FE_INV_TMP2 = FE_NEG_TMP - (20 * FE_WORDS) !addr FE_INV_TMP3 = FE_NEG_TMP - (21 * FE_WORDS) !addr FE_INV_TMP4 = FE_NEG_TMP - (22 * FE_WORDS) ;; Precomputed tables for field element inversions. !addr FE_INV_TABLE0 = FE_NEG_TMP - (23 * FE_WORDS) !addr FE_INV_TABLE1 = FE_NEG_TMP - (24 * FE_WORDS) !addr FE_INV_TABLE2 = FE_NEG_TMP - (25 * FE_WORDS) !addr FE_INV_TABLE3 = FE_NEG_TMP - (26 * FE_WORDS) !addr FE_INV_TABLE5 = FE_NEG_TMP - (27 * FE_WORDS) !addr FE_INV_TABLE6 = FE_NEG_TMP - (28 * FE_WORDS) !addr FE_INV_TABLE7 = FE_NEG_TMP - (29 * FE_WORDS) !addr FE_INV_TABLE9 = FE_NEG_TMP - (30 * FE_WORDS) !addr FE_INV_TABLE10 = FE_NEG_TMP - (31 * FE_WORDS) !addr FE_INV_TABLE12 = FE_NEG_TMP - (32 * FE_WORDS) !addr FE_INV_TABLE13 = FE_NEG_TMP - (33 * FE_WORDS) !addr FE_INV_TABLE14 = FE_NEG_TMP - (34 * FE_WORDS) !addr FE_INV_TABLE16 = FE_NEG_TMP - (35 * FE_WORDS) !addr FE_INV_TABLE19 = FE_NEG_TMP - (36 * FE_WORDS) !addr FE_INV_TABLE20 = FE_NEG_TMP - (37 * FE_WORDS) !addr FE_INV_TABLE21 = FE_NEG_TMP - (38 * FE_WORDS) !addr FE_INV_TABLE22 = FE_NEG_TMP - (39 * FE_WORDS) !addr FE_INV_TABLE23 = FE_NEG_TMP - (40 * FE_WORDS) !addr FE_INV_TABLE24 = FE_NEG_TMP - (41 * FE_WORDS) !addr FE_INV_TABLE25 = FE_NEG_TMP - (42 * FE_WORDS) !addr FE_INV_TABLE26 = FE_NEG_TMP - (43 * FE_WORDS) !addr FE_INV_TABLE28 = FE_NEG_TMP - (44 * FE_WORDS) !addr FE_INV_TABLE30 = FE_NEG_TMP - (45 * FE_WORDS) ;; Number of field elements for Alice's 2-isogenisation strategy. ALICE_ELEMENTS = 108 ;; Number of field elements for Bob's 3-isogenisation strategy BOB_ELEMENTS = 137 ;; Number of zero words in the P434 prime + 1. We exploit this structure for field element reduction. ZERO_WORDS = 24
tools-src/gnu/gcc/gcc/ada/prj-dect.adb
enfoTek/tomato.linksys.e2000.nvram-mod
80
19883
<filename>tools-src/gnu/gcc/gcc/ada/prj-dect.adb ------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- P R J . D E C T -- -- -- -- B o d y -- -- -- -- $Revision$ -- -- -- Copyright (C) 2001 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, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Errout; use Errout; with Prj.Strt; with Prj.Tree; use Prj.Tree; with Scans; use Scans; with Sinfo; use Sinfo; with Types; use Types; with Prj.Attr; use Prj.Attr; package body Prj.Dect is type Zone is (In_Project, In_Package, In_Case_Construction); procedure Parse_Attribute_Declaration (Attribute : out Project_Node_Id; First_Attribute : Attribute_Node_Id; Current_Project : Project_Node_Id; Current_Package : Project_Node_Id); -- Parse an attribute declaration. procedure Parse_Case_Construction (Case_Construction : out Project_Node_Id; First_Attribute : Attribute_Node_Id; Current_Project : Project_Node_Id; Current_Package : Project_Node_Id); -- Parse a case construction procedure Parse_Declarative_Items (Declarations : out Project_Node_Id; In_Zone : Zone; First_Attribute : Attribute_Node_Id; Current_Project : Project_Node_Id; Current_Package : Project_Node_Id); -- Parse declarative items. Depending on In_Zone, some declarative -- items may be forbiden. procedure Parse_Package_Declaration (Package_Declaration : out Project_Node_Id; Current_Project : Project_Node_Id); -- Parse a package declaration procedure Parse_String_Type_Declaration (String_Type : out Project_Node_Id; Current_Project : Project_Node_Id; First_Attribute : Attribute_Node_Id); -- type <name> is ( <literal_string> { , <literal_string> } ) ; procedure Parse_Variable_Declaration (Variable : out Project_Node_Id; First_Attribute : Attribute_Node_Id; Current_Project : Project_Node_Id; Current_Package : Project_Node_Id); -- Parse a variable assignment -- <variable_Name> := <expression>; OR -- <variable_Name> : <string_type_Name> := <string_expression>; ----------- -- Parse -- ----------- procedure Parse (Declarations : out Project_Node_Id; Current_Project : Project_Node_Id; Extends : Project_Node_Id) is First_Declarative_Item : Project_Node_Id := Empty_Node; begin Declarations := Default_Project_Node (Of_Kind => N_Project_Declaration); Set_Location_Of (Declarations, To => Token_Ptr); Set_Modified_Project_Of (Declarations, To => Extends); Parse_Declarative_Items (Declarations => First_Declarative_Item, In_Zone => In_Project, First_Attribute => Prj.Attr.Attribute_First, Current_Project => Current_Project, Current_Package => Empty_Node); Set_First_Declarative_Item_Of (Declarations, To => First_Declarative_Item); end Parse; --------------------------------- -- Parse_Attribute_Declaration -- --------------------------------- procedure Parse_Attribute_Declaration (Attribute : out Project_Node_Id; First_Attribute : Attribute_Node_Id; Current_Project : Project_Node_Id; Current_Package : Project_Node_Id) is Current_Attribute : Attribute_Node_Id := First_Attribute; begin Attribute := Default_Project_Node (Of_Kind => N_Attribute_Declaration); Set_Location_Of (Attribute, To => Token_Ptr); -- Scan past "for" Scan; Expect (Tok_Identifier, "identifier"); if Token = Tok_Identifier then Set_Name_Of (Attribute, To => Token_Name); Set_Location_Of (Attribute, To => Token_Ptr); if Attributes.Table (Current_Attribute).Kind_2 = Case_Insensitive_Associative_Array then Set_Case_Insensitive (Attribute, To => True); end if; while Current_Attribute /= Empty_Attribute and then Attributes.Table (Current_Attribute).Name /= Token_Name loop Current_Attribute := Attributes.Table (Current_Attribute).Next; end loop; if Current_Attribute = Empty_Attribute then Error_Msg ("undefined attribute", Token_Ptr); end if; Scan; end if; if Token = Tok_Left_Paren then if Current_Attribute /= Empty_Attribute and then Attributes.Table (Current_Attribute).Kind_2 = Single then Error_Msg ("this attribute cannot be an associative array", Location_Of (Attribute)); end if; Scan; Expect (Tok_String_Literal, "literal string"); if Token = Tok_String_Literal then Set_Associative_Array_Index_Of (Attribute, Strval (Token_Node)); Scan; end if; Expect (Tok_Right_Paren, ")"); if Token = Tok_Right_Paren then Scan; end if; else if Current_Attribute /= Empty_Attribute and then Attributes.Table (Current_Attribute).Kind_2 /= Single then Error_Msg ("this attribute need to be an associative array", Location_Of (Attribute)); end if; end if; if Current_Attribute /= Empty_Attribute then Set_Expression_Kind_Of (Attribute, To => Attributes.Table (Current_Attribute).Kind_1); end if; Expect (Tok_Use, "use"); if Token = Tok_Use then Scan; declare Expression_Location : constant Source_Ptr := Token_Ptr; Expression : Project_Node_Id := Empty_Node; begin Prj.Strt.Parse_Expression (Expression => Expression, Current_Project => Current_Project, Current_Package => Current_Package); Set_Expression_Of (Attribute, To => Expression); if Current_Attribute /= Empty_Attribute and then Expression /= Empty_Node and then Attributes.Table (Current_Attribute).Kind_1 /= Expression_Kind_Of (Expression) then Error_Msg ("wrong expression kind for the attribute", Expression_Location); end if; end; end if; end Parse_Attribute_Declaration; ----------------------------- -- Parse_Case_Construction -- ----------------------------- procedure Parse_Case_Construction (Case_Construction : out Project_Node_Id; First_Attribute : Attribute_Node_Id; Current_Project : Project_Node_Id; Current_Package : Project_Node_Id) is Current_Item : Project_Node_Id := Empty_Node; Next_Item : Project_Node_Id := Empty_Node; First_Case_Item : Boolean := True; Variable_Location : Source_Ptr := No_Location; String_Type : Project_Node_Id := Empty_Node; Case_Variable : Project_Node_Id := Empty_Node; First_Declarative_Item : Project_Node_Id := Empty_Node; First_Choice : Project_Node_Id := Empty_Node; begin Case_Construction := Default_Project_Node (Of_Kind => N_Case_Construction); Set_Location_Of (Case_Construction, To => Token_Ptr); -- Scan past "case" Scan; -- Get the switch variable Expect (Tok_Identifier, "identifier"); if Token = Tok_Identifier then Variable_Location := Token_Ptr; Prj.Strt.Parse_Variable_Reference (Variable => Case_Variable, Current_Project => Current_Project, Current_Package => Current_Package); Set_Case_Variable_Reference_Of (Case_Construction, To => Case_Variable); else if Token /= Tok_Is then Scan; end if; end if; if Case_Variable /= Empty_Node then String_Type := String_Type_Of (Case_Variable); if String_Type = Empty_Node then Error_Msg ("this variable is not typed", Variable_Location); end if; end if; Expect (Tok_Is, "is"); if Token = Tok_Is then -- Scan past "is" Scan; end if; Prj.Strt.Start_New_Case_Construction (String_Type); When_Loop : while Token = Tok_When loop if First_Case_Item then Current_Item := Default_Project_Node (Of_Kind => N_Case_Item); Set_First_Case_Item_Of (Case_Construction, To => Current_Item); First_Case_Item := False; else Next_Item := Default_Project_Node (Of_Kind => N_Case_Item); Set_Next_Case_Item (Current_Item, To => Next_Item); Current_Item := Next_Item; end if; Set_Location_Of (Current_Item, To => Token_Ptr); -- Scan past "when" Scan; if Token = Tok_Others then -- Scan past "others" Scan; Expect (Tok_Arrow, "=>"); -- Empty_Node in Field1 of a Case_Item indicates -- the "when others =>" branch. Set_First_Choice_Of (Current_Item, To => Empty_Node); Parse_Declarative_Items (Declarations => First_Declarative_Item, In_Zone => In_Case_Construction, First_Attribute => First_Attribute, Current_Project => Current_Project, Current_Package => Current_Package); -- "when others =>" must be the last branch, so save the -- Case_Item and exit Set_First_Declarative_Item_Of (Current_Item, To => First_Declarative_Item); exit When_Loop; else Prj.Strt.Parse_Choice_List (First_Choice => First_Choice); Set_First_Choice_Of (Current_Item, To => First_Choice); Expect (Tok_Arrow, "=>"); Parse_Declarative_Items (Declarations => First_Declarative_Item, In_Zone => In_Case_Construction, First_Attribute => First_Attribute, Current_Project => Current_Project, Current_Package => Current_Package); Set_First_Declarative_Item_Of (Current_Item, To => First_Declarative_Item); end if; end loop When_Loop; Prj.Strt.End_Case_Construction; Expect (Tok_End, "end case"); if Token = Tok_End then -- Scan past "end" Scan; Expect (Tok_Case, "case"); end if; -- Scan past "case" Scan; Expect (Tok_Semicolon, ";"); end Parse_Case_Construction; ----------------------------- -- Parse_Declarative_Items -- ----------------------------- procedure Parse_Declarative_Items (Declarations : out Project_Node_Id; In_Zone : Zone; First_Attribute : Attribute_Node_Id; Current_Project : Project_Node_Id; Current_Package : Project_Node_Id) is Current_Declarative_Item : Project_Node_Id := Empty_Node; Next_Declarative_Item : Project_Node_Id := Empty_Node; Current_Declaration : Project_Node_Id := Empty_Node; Item_Location : Source_Ptr := No_Location; begin Declarations := Empty_Node; loop -- We are always positioned at the token that precedes -- the first token of the declarative element. -- Scan past it Scan; Item_Location := Token_Ptr; case Token is when Tok_Identifier => if In_Zone = In_Case_Construction then Error_Msg ("a variable cannot be declared here", Token_Ptr); end if; Parse_Variable_Declaration (Current_Declaration, First_Attribute => First_Attribute, Current_Project => Current_Project, Current_Package => Current_Package); when Tok_For => Parse_Attribute_Declaration (Attribute => Current_Declaration, First_Attribute => First_Attribute, Current_Project => Current_Project, Current_Package => Current_Package); when Tok_Package => -- Package declaration if In_Zone /= In_Project then Error_Msg ("a package cannot be declared here", Token_Ptr); end if; Parse_Package_Declaration (Package_Declaration => Current_Declaration, Current_Project => Current_Project); when Tok_Type => -- Type String Declaration if In_Zone /= In_Project then Error_Msg ("a string type cannot be declared here", Token_Ptr); end if; Parse_String_Type_Declaration (String_Type => Current_Declaration, Current_Project => Current_Project, First_Attribute => First_Attribute); when Tok_Case => -- Case construction Parse_Case_Construction (Case_Construction => Current_Declaration, First_Attribute => First_Attribute, Current_Project => Current_Project, Current_Package => Current_Package); when others => exit; -- We are leaving Parse_Declarative_Items positionned -- at the first token after the list of declarative items. -- It could be "end" (for a project, a package declaration or -- a case construction) or "when" (for a case construction) end case; Expect (Tok_Semicolon, "; after declarative items"); if Current_Declarative_Item = Empty_Node then Current_Declarative_Item := Default_Project_Node (Of_Kind => N_Declarative_Item); Declarations := Current_Declarative_Item; else Next_Declarative_Item := Default_Project_Node (Of_Kind => N_Declarative_Item); Set_Next_Declarative_Item (Current_Declarative_Item, To => Next_Declarative_Item); Current_Declarative_Item := Next_Declarative_Item; end if; Set_Current_Item_Node (Current_Declarative_Item, To => Current_Declaration); Set_Location_Of (Current_Declarative_Item, To => Item_Location); end loop; end Parse_Declarative_Items; ------------------------------- -- Parse_Package_Declaration -- ------------------------------- procedure Parse_Package_Declaration (Package_Declaration : out Project_Node_Id; Current_Project : Project_Node_Id) is First_Attribute : Attribute_Node_Id := Empty_Attribute; Current_Package : Package_Node_Id := Empty_Package; First_Declarative_Item : Project_Node_Id := Empty_Node; begin Package_Declaration := Default_Project_Node (Of_Kind => N_Package_Declaration); Set_Location_Of (Package_Declaration, To => Token_Ptr); -- Scan past "package" Scan; Expect (Tok_Identifier, "identifier"); if Token = Tok_Identifier then Set_Name_Of (Package_Declaration, To => Token_Name); for Index in Package_Attributes.First .. Package_Attributes.Last loop if Token_Name = Package_Attributes.Table (Index).Name then First_Attribute := Package_Attributes.Table (Index).First_Attribute; Current_Package := Index; exit; end if; end loop; if Current_Package = Empty_Package then Error_Msg ("not an allowed package name", Token_Ptr); else Set_Package_Id_Of (Package_Declaration, To => Current_Package); declare Current : Project_Node_Id := First_Package_Of (Current_Project); begin while Current /= Empty_Node and then Name_Of (Current) /= Token_Name loop Current := Next_Package_In_Project (Current); end loop; if Current /= Empty_Node then Error_Msg ("package declared twice in the same project", Token_Ptr); else -- Add the package to the project list Set_Next_Package_In_Project (Package_Declaration, To => First_Package_Of (Current_Project)); Set_First_Package_Of (Current_Project, To => Package_Declaration); end if; end; end if; -- Scan past the package name Scan; end if; if Token = Tok_Renames then -- Scan past "renames" Scan; Expect (Tok_Identifier, "identifier"); if Token = Tok_Identifier then declare Project_Name : Name_Id := Token_Name; Clause : Project_Node_Id := First_With_Clause_Of (Current_Project); The_Project : Project_Node_Id := Empty_Node; begin while Clause /= Empty_Node loop The_Project := Project_Node_Of (Clause); exit when Name_Of (The_Project) = Project_Name; Clause := Next_With_Clause_Of (Clause); end loop; if Clause = Empty_Node then Error_Msg ("not an imported project", Token_Ptr); else Set_Project_Of_Renamed_Package_Of (Package_Declaration, To => The_Project); end if; end; Scan; Expect (Tok_Dot, "."); if Token = Tok_Dot then Scan; Expect (Tok_Identifier, "identifier"); if Token = Tok_Identifier then if Name_Of (Package_Declaration) /= Token_Name then Error_Msg ("not the same package name", Token_Ptr); elsif Project_Of_Renamed_Package_Of (Package_Declaration) /= Empty_Node then declare Current : Project_Node_Id := First_Package_Of (Project_Of_Renamed_Package_Of (Package_Declaration)); begin while Current /= Empty_Node and then Name_Of (Current) /= Token_Name loop Current := Next_Package_In_Project (Current); end loop; if Current = Empty_Node then Error_Msg ("not a package declared by the project", Token_Ptr); end if; end; end if; Scan; end if; end if; end if; Expect (Tok_Semicolon, ";"); elsif Token = Tok_Is then Parse_Declarative_Items (Declarations => First_Declarative_Item, In_Zone => In_Package, First_Attribute => First_Attribute, Current_Project => Current_Project, Current_Package => Package_Declaration); Set_First_Declarative_Item_Of (Package_Declaration, To => First_Declarative_Item); Expect (Tok_End, "end"); if Token = Tok_End then -- Scan past "end" Scan; end if; -- We should have the name of the package after "end" Expect (Tok_Identifier, "identifier"); if Token = Tok_Identifier and then Name_Of (Package_Declaration) /= No_Name and then Token_Name /= Name_Of (Package_Declaration) then Error_Msg_Name_1 := Name_Of (Package_Declaration); Error_Msg ("expected {", Token_Ptr); end if; if Token /= Tok_Semicolon then -- Scan past the package name Scan; end if; Expect (Tok_Semicolon, ";"); else Error_Msg ("expected ""is"" or ""renames""", Token_Ptr); end if; end Parse_Package_Declaration; ----------------------------------- -- Parse_String_Type_Declaration -- ----------------------------------- procedure Parse_String_Type_Declaration (String_Type : out Project_Node_Id; Current_Project : Project_Node_Id; First_Attribute : Attribute_Node_Id) is Current : Project_Node_Id := Empty_Node; First_String : Project_Node_Id := Empty_Node; begin String_Type := Default_Project_Node (Of_Kind => N_String_Type_Declaration); Set_Location_Of (String_Type, To => Token_Ptr); -- Scan past "type" Scan; Expect (Tok_Identifier, "identifier"); if Token = Tok_Identifier then Set_Name_Of (String_Type, To => Token_Name); Current := First_String_Type_Of (Current_Project); while Current /= Empty_Node and then Name_Of (Current) /= Token_Name loop Current := Next_String_Type (Current); end loop; if Current /= Empty_Node then Error_Msg ("duplicate string type name", Token_Ptr); else Current := First_Variable_Of (Current_Project); while Current /= Empty_Node and then Name_Of (Current) /= Token_Name loop Current := Next_Variable (Current); end loop; if Current /= Empty_Node then Error_Msg ("already a variable name", Token_Ptr); else Set_Next_String_Type (String_Type, To => First_String_Type_Of (Current_Project)); Set_First_String_Type_Of (Current_Project, To => String_Type); end if; end if; -- Scan past the name Scan; end if; Expect (Tok_Is, "is"); if Token = Tok_Is then Scan; end if; Expect (Tok_Left_Paren, "("); if Token = Tok_Left_Paren then Scan; end if; Prj.Strt.Parse_String_Type_List (First_String => First_String); Set_First_Literal_String (String_Type, To => First_String); Expect (Tok_Right_Paren, ")"); if Token = Tok_Right_Paren then Scan; end if; end Parse_String_Type_Declaration; -------------------------------- -- Parse_Variable_Declaration -- -------------------------------- procedure Parse_Variable_Declaration (Variable : out Project_Node_Id; First_Attribute : Attribute_Node_Id; Current_Project : Project_Node_Id; Current_Package : Project_Node_Id) is Expression_Location : Source_Ptr; String_Type_Name : Name_Id := No_Name; Project_String_Type_Name : Name_Id := No_Name; Type_Location : Source_Ptr := No_Location; Project_Location : Source_Ptr := No_Location; Expression : Project_Node_Id := Empty_Node; Variable_Name : constant Name_Id := Token_Name; begin Variable := Default_Project_Node (Of_Kind => N_Variable_Declaration); Set_Name_Of (Variable, To => Variable_Name); Set_Location_Of (Variable, To => Token_Ptr); -- Scan past the variable name Scan; if Token = Tok_Colon then -- Typed string variable declaration Scan; Set_Kind_Of (Variable, N_Typed_Variable_Declaration); Expect (Tok_Identifier, "identifier"); if Token = Tok_Identifier then String_Type_Name := Token_Name; Type_Location := Token_Ptr; Scan; if Token = Tok_Dot then Project_String_Type_Name := String_Type_Name; Project_Location := Type_Location; -- Scan past the dot Scan; Expect (Tok_Identifier, "identifier"); if Token = Tok_Identifier then String_Type_Name := Token_Name; Type_Location := Token_Ptr; Scan; else String_Type_Name := No_Name; end if; end if; if String_Type_Name /= No_Name then declare Current : Project_Node_Id := First_String_Type_Of (Current_Project); begin if Project_String_Type_Name /= No_Name then declare The_Project_Name_And_Node : constant Tree_Private_Part.Project_Name_And_Node := Tree_Private_Part.Projects_Htable.Get (Project_String_Type_Name); use Tree_Private_Part; begin if The_Project_Name_And_Node = Tree_Private_Part.No_Project_Name_And_Node then Error_Msg ("unknown project", Project_Location); Current := Empty_Node; else Current := First_String_Type_Of (The_Project_Name_And_Node.Node); end if; end; end if; while Current /= Empty_Node and then Name_Of (Current) /= String_Type_Name loop Current := Next_String_Type (Current); end loop; if Current = Empty_Node then Error_Msg ("unknown string type", Type_Location); else Set_String_Type_Of (Variable, To => Current); end if; end; end if; end if; end if; Expect (Tok_Colon_Equal, ":="); if Token = Tok_Colon_Equal then Scan; end if; -- Get the single string or string list value Expression_Location := Token_Ptr; Prj.Strt.Parse_Expression (Expression => Expression, Current_Project => Current_Project, Current_Package => Current_Package); Set_Expression_Of (Variable, To => Expression); if Expression /= Empty_Node then Set_Expression_Kind_Of (Variable, To => Expression_Kind_Of (Expression)); end if; declare The_Variable : Project_Node_Id := Empty_Node; begin if Current_Package /= Empty_Node then The_Variable := First_Variable_Of (Current_Package); elsif Current_Project /= Empty_Node then The_Variable := First_Variable_Of (Current_Project); end if; while The_Variable /= Empty_Node and then Name_Of (The_Variable) /= Variable_Name loop The_Variable := Next_Variable (The_Variable); end loop; if The_Variable = Empty_Node then if Current_Package /= Empty_Node then Set_Next_Variable (Variable, To => First_Variable_Of (Current_Package)); Set_First_Variable_Of (Current_Package, To => Variable); elsif Current_Project /= Empty_Node then Set_Next_Variable (Variable, To => First_Variable_Of (Current_Project)); Set_First_Variable_Of (Current_Project, To => Variable); end if; else if Expression_Kind_Of (Variable) /= Undefined then if Expression_Kind_Of (The_Variable) = Undefined then Set_Expression_Kind_Of (The_Variable, To => Expression_Kind_Of (Variable)); else if Expression_Kind_Of (The_Variable) /= Expression_Kind_Of (Variable) then Error_Msg ("wrong expression kind for the variable", Expression_Location); end if; end if; end if; end if; end; end Parse_Variable_Declaration; end Prj.Dect;
Logic/Predicate/Equiv.agda
Lolirofle/stuff-in-agda
6
9730
module Logic.Predicate.Equiv where import Lvl open import Logic open import Logic.Predicate open import Structure.Setoid open import Structure.Relator.Equivalence open import Structure.Relator.Properties open import Type private variable ℓ ℓₑ : Lvl.Level private variable Obj : Type{ℓ} private variable Pred : Obj → Stmt{ℓ} module _ ⦃ _ : Equiv{ℓₑ}(Obj) ⦄ where _≡∃_ : ∃{Obj = Obj}(Pred) → ∃{Obj = Obj}(Pred) → Stmt [∃]-intro x ≡∃ [∃]-intro y = x ≡ y instance [≡∃]-reflexivity : Reflexivity(_≡∃_ {Pred = Pred}) Reflexivity.proof [≡∃]-reflexivity = reflexivity(_≡_) instance [≡∃]-symmetry : Symmetry(_≡∃_ {Pred = Pred}) Symmetry.proof [≡∃]-symmetry = symmetry(_≡_) instance [≡∃]-transitivity : Transitivity(_≡∃_ {Pred = Pred}) Transitivity.proof [≡∃]-transitivity = transitivity(_≡_) instance [≡∃]-equivalence : Equivalence(_≡∃_ {Pred = Pred}) [≡∃]-equivalence = intro instance [≡∃]-equiv : Equiv{ℓₑ}(∃{Obj = Obj} Pred) [≡∃]-equiv = intro(_≡∃_) ⦃ [≡∃]-equivalence ⦄
alloy4fun_models/trainstlt/models/4/G6dcqMMEc4x7CLsm7.als
Kaixi26/org.alloytools.alloy
0
319
open main pred idG6dcqMMEc4x7CLsm7_prop5 { all t:Train | t.pos in Entry implies after t.pos in t.pos.prox } pred __repair { idG6dcqMMEc4x7CLsm7_prop5 } check __repair { idG6dcqMMEc4x7CLsm7_prop5 <=> prop5o }
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c3/c37003a.ada
best08618/asylo
7
5538
-- C37003A.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 MULTIPLE COMPONENT DECLARATIONS ARE TREATED AS A SERIES -- OF SINGLE COMNENT DECLARATIONS, I.E., THE COMPONENTS ALL HAVE THE -- SAME TYPE AND ANY EXPRESSION USED IN CONSTRAINTS OR INITIALIZATIONS -- IS EVALUATED ONCE FOR EACH COMPONENT. -- DAT 3/30/81 -- SPS 10/26/82 -- JWC 10/23/85 RENAMED FROM C37013A-AB.ADA. -- ADDED TEST TO ENSURE THAT ANY EXPRESSION USED -- IN A CONSTRAINT IS EVALUATED ONCE FOR EACH -- COMPONENT. -- JRK 11/15/85 ADDED INITIALIZATION EVALUATION CHECKS. WITH REPORT; USE REPORT; PROCEDURE C37003A IS X : INTEGER := 0; FUNCTION F RETURN INTEGER IS BEGIN X := X + 1; RETURN X; END F; PROCEDURE RESET IS BEGIN X := 0; END RESET; BEGIN TEST ("C37003A", "CHECK THAT MULTIPLE COMPONENT DECLARATIONS " & "ARE TREATED AS A SERIES OF SINGLE COMPONENT " & "DECLARATIONS"); DECLARE TYPE ARR IS ARRAY (INTEGER RANGE <>) OF INTEGER; TYPE REC1 IS RECORD A1, A2 : ARR (1 .. F) := (OTHERS => F); END RECORD; R1 : REC1 := (OTHERS => (OTHERS => 1)); Y : INTEGER := X; R1A : REC1; BEGIN IF R1.A1 = R1.A2 THEN -- TEST TO SEE IF THE COMPONENTS NULL; -- ARE OF THE SAME TYPE. END IF; IF Y /= 2 THEN FAILED ("CONSTRAINT EXPRESSION NOT EVALUATED TWICE " & "FOR ARRAYS"); END IF; IF X /= 5 THEN FAILED ("INITIALIZATION EXPRESSION NOT EVALUATED FOR " & "EACH ARRAY COMPONENT"); END IF; RESET; END; DECLARE TYPE REC2 IS RECORD I1, I2 : INTEGER RANGE 1 .. F := F * IDENT_INT(0) + 1; END RECORD; R2 : REC2 := (OTHERS => 1); Y : INTEGER := X; R2A : REC2; BEGIN IF R2.I1 = R2.I2 THEN -- TEST TO SEE IF THE COMPONENTS NULL; -- ARE OF THE SAME TYPE. END IF; IF Y /= 2 THEN FAILED ("CONSTRAINT EXPRESSION NOT EVALUATED TWICE " & "FOR SCALARS"); END IF; IF X /= 4 THEN FAILED ("INITIALIZATION EXPRESSION NOT EVALUATED FOR " & "EACH SCALAR COMPONENT"); END IF; RESET; END; DECLARE TYPE REC3X (DSC : INTEGER) IS RECORD NULL; END RECORD; TYPE REC3Y IS RECORD I : INTEGER; END RECORD; TYPE REC3 IS RECORD RX1, RX2 : REC3X (F); RY1, RY2 : REC3Y := (I => F); END RECORD; R3 : REC3 := ((DSC => 1), (DSC => 2), (I => 0), (I => 0)); Y : INTEGER := X; R3A : REC3; BEGIN IF R3.RX1 = R3.RX2 THEN -- TEST TO SEE IF THE COMPONENTS NULL; -- ARE OF THE SAME TYPE. END IF; IF Y /= 2 THEN FAILED ("CONSTRAINT EXPRESSION NOT EVALUATED TWICE " & "FOR RECORDS"); END IF; IF X /= 4 THEN FAILED ("INITIALIZATION EXPRESSION NOT EVALUATED " & "FOR EACH RECORD COMPONENT"); END IF; RESET; END; DECLARE TYPE REC4X (DSC : INTEGER) IS RECORD NULL; END RECORD; TYPE ACR IS ACCESS REC4X; TYPE ACI IS ACCESS INTEGER; TYPE REC4 IS RECORD AC1, AC2 : ACR (F); AC3, AC4 : ACI := NEW INTEGER'(F); END RECORD; R4 : REC4 := (NULL, NULL, NULL, NULL); Y : INTEGER := X; R4A : REC4; BEGIN IF R4.AC1 = R4.AC2 THEN -- TEST TO SEE IF THE COMPONENTS NULL; -- ARE OF THE SAME TYPE. END IF; IF Y /= 2 THEN FAILED ("CONSTRAINT EXPRESSION NOT EVALUATED TWICE " & "FOR ACCESS"); END IF; IF X /= 4 THEN FAILED ("INITIALIZATION EXPRESSION NOT EVALUATED " & "FOR EACH ACCESS COMPONENT"); END IF; END; RESULT; END C37003A;
libsrc/_DEVELOPMENT/font/fzx/fonts/ao/Aribeth/_ff_ao_Aribeth6.asm
jpoikela/z88dk
640
100388
SECTION rodata_font SECTION rodata_font_fzx PUBLIC _ff_ao_Aribeth6 _ff_ao_Aribeth6: BINARY "font/fzx/fonts/ao/Aribeth/Aribeth6.fzx"
iod/con2/ptr/sysspr.asm
olifink/smsqe
0
1849
<filename>iod/con2/ptr/sysspr.asm<gh_stars>0 ; System sprites code V1.00 1991 <NAME> ; 2003 <NAME> ; 2003 <NAME> ; ; 2004-04-02 1.01 xdef'd sp_error (wl) section driver xdef pt_ssref xdef pt_isspr xdef pt_sspr xdef sp_error xref gu_achpp include 'dev8_keys_con' include 'dev8_keys_err' include 'dev8_keys_sys' include 'dev8_keys_sysspr' ;+++ ; Convert references to a system sprite into a real address. ; ; A1 cr ptr to sprite / real ptr to sprite ; A3 c p ptr to console linkage block ;--- pt_ssref movem.l d0/a2,-(sp) moveq #0,d0 pt_stable move.l pt_sstb(a3),a2 ; pointer to sprite table cmp.w #sp.max,a1 ; is ptr small enough to be in table? bge.s pts_fspr ; no, go on add.l a1,a1 add.l a1,a1 ; get offset in table move.l 2(a2,a1.l),a1 ; thus absolute pointer to sprite move.l a1,d0 bne.s pts_exit lea sp_error,a1 bra.s pts_exit pts_fspr tst.l d0 ; already checked for system sprite? bne.s pts_exit ; yep tst.b (a1) ; mode 0 = system sprite bne.s pts_exit move.w (a1),d0 ; take number from definition move.l d0,a1 moveq #1,d0 ; second run bra.s pt_stable ; and try to locate sprite pts_exit movem.l (sp)+,d0/a2 rts ;+++ ; Init system sprite table ; ; A3 c p ptr to console linkage block ;--- pt_isspr move.l a0,-(sp) move.l #sp.max,d0 lsl.w #2,d0 ; long words addq.l #8,d0 ; plus header jsr gu_achpp ; allocate memory for it bne.s pis_rts move.w #sp.max,d0 move.w d0,(a0)+ ; save max number move.l a0,pt_sstb(a3) ; save pointer clr.w (a0)+ ; currently no sprite in table subq.w #1,d0 pis_loop clr.l (a0)+ dbf d0,pis_loop ; ensure table is clean moveq #0,d0 pis_rts movem.l (sp)+,a0 rts ;+++ ; CON vector $0C PV_SSPR ; ; Set system sprites/Get system sprite address ; ; Call parameters Return parameters ; ; D1.w sprite number / -ve D1 pres. / Max allowed | max current ; D2 D2 preserved ; D3 D3+ all preserved ; ; A0 A0 preserved ; A1 pointer to sprite / 0 A1 preserved / pointer to sprite ; A2 A2 preserved ; A3 pointer to CON linkage block A3 preserved ; A4 A4 preserved ; A5 not used by any routine ; A6 not used by any routine ; ; ; this gets or sets a system sprite or returns the max nbr of system sprites ; * if d1 is a negative nbr (-1 is suggested), then on return d1 contains: ; max nbr of space in table for sys sprites | highest nbr of current system sprite ; else: ; * if a1 = 0, then one gets the address of the system sprite the number ; of which is passed in D1. The address is returned in a1. ; This address MAY be 0, in which case the system sprite requested does ; not exist. This will only happen if somebody fiddled with the table ; contrary to recommendations ; * if a1 <> then it contains the address of a sprite that will be a system ; sprite, d1 contains the number of that sprite. This sprite is not ; " copied to a safe place", it is the responsibility of the calling ; job to make sure that the sprite doesn't just disappear ; ; Error returns: ; IPAR Illegal sprite number (set/get) ; ICHN Channel not open/ invalid channel ID (from general trap handler) ; NC not complete (from general trap handler) ; ITNF there are no system sprites ! ;--- ; the sprite table has the following format: ; ; -2 max nbr of sprites possible in table ; 0 nbr of sprites currently in table ; 2+ long word absolute pointers (i.e real addresses of sprites) ; ======== ; sprite nbr too big for table sspr_ipar moveq #err.ipar,d0 bra.s sspr_out ; no sprite table sspr_nf moveq #err.itnf,d0 bra.s sspr_out pt_sspr move.l a2,-(sp) move.l pt_sstb(a3),d0 ; pointer to sprite table beq.s sspr_nf ; ... but there is none move.l d0,a2 ; point to sprite table tst.w d1 ; do we want to get the nbr of sprites? bmi.s sspr_nbr ; ... yes move.w -2(a2),d0 ; max nbr of sprite cmp.w d0,d1 bgt.s sspr_ipar ; sprite wished exceeds max nbr move.l a1,d0 ; get/set? bne.s sspr_set ; set sprite sspr_get moveq #0,d0 move.w d1,d0 lsl.l #2,d0 ; long word pointers move.l 2(a2,d0.l),a1 ; absolute pointer to sprite sspr_ok moveq #0,d0 ; no error sspr_out move.l (sp)+,a2 rts sspr_set move.w (a2),d0 ; current highest nbr of system sprites cmp.w d1,d0 ; is sprite wished higher? bge.s sspr_no ; ...no move.w d1,(a2) ; new higest current sprite sspr_no moveq #0,d0 move.w d1,d0 lsl.l #2,d0 ; pointers are long words lea 2(a2,d0.l),a2 ; + nbr word move.l a1,(a2) ; put it in bra.s sspr_ok ; sspr_nbr move.l -2(a2),d1 ; max space | current highest nbr bra.s sspr_ok ; Sprite that is shown in case of an error sp_error dc.w $0100,$0000 ;form, time/adaption dc.w $0009,$0008 ;x size, y size dc.w $0000,$0000 ;x origin, y origin dc.l cp4_err-* ;pointer to colour pattern dc.l pm4_err-* ;pointer to pattern mask dc.l s8_err-* ;pointer to next definition cp4_err dc.w $00C1,$0080 dc.w $0063,$0000 dc.w $0036,$0000 dc.w $001C,$0000 dc.w $001C,$0000 dc.w $0036,$0000 dc.w $0063,$0000 dc.w $00C1,$0080 pm4_err dc.w $C1C1,$8080 dc.w $6363,$0000 dc.w $3636,$0000 dc.w $1C1C,$0000 dc.w $1C1C,$0000 dc.w $3636,$0000 dc.w $6363,$0000 dc.w $C1C1,$8080 s8_err dc.w $0101,$0000 ;form, time/adaption dc.w $000A,$000A ;x size, y size dc.w $0000,$0000 ;x origin, y origin dc.l cp8_err-* ;pointer to colour pattern dc.l pm8_err-* ;pointer to pattern mask dc.l 0 ;pointer to next definition cp8_err dc.w $0080,$0080 dc.w $0080,$0080 dc.w $0022,$0000 dc.w $0022,$0000 dc.w $0008,$0000 dc.w $0008,$0000 dc.w $0022,$0000 dc.w $0022,$0000 dc.w $0080,$0080 dc.w $0080,$0080 pm8_err dc.w $C0C0,$C0C0 dc.w $C0C0,$C0C0 dc.w $3333,$0000 dc.w $3333,$0000 dc.w $0C0C,$0000 dc.w $0C0C,$0000 dc.w $3333,$0000 dc.w $3333,$0000 dc.w $C0C0,$C0C0 dc.w $C0C0,$C0C0 end
terminal/lib1.asm
dsarlis/8086
1
1871
;********************************************************** ; PRINT_DEC ; INPUT: DX ; MODIFIED: AX ;********************************************************** INCLUDE MACROS.TXT PUBLIC PRINT_DEC PUBLIC PRINT_HEX PUBLIC SCAN_KEY PUBLIC CALCULATE STACK SEGMENT DB 80 DUP(?) STACK ENDS CODE_SEG SEGMENT ASSUME CS:CODE_SEG PRINT_DEC PROC FAR PUSH DX PUSH CX PUSH BX MOV CX,0 ;upologismos twn BCD psifiwn kai MOV AX,DX ;apothikeusi sti stoiba SHL DX,1 JNC ADDR1 PRINT '-' NEG AX ADDR1: MOV DX,0 MOV BX,10 DIV BX ;diairesi arithmou me 10 PUSH DX ;apothikeusi upoloipou sti stoiba INC CX ;metritis psifiwn++ CMP AX,0 ;elegxos an uparxei allo psifio JNZ ADDR1 ADDR5: POP DX ;anagnwsi apo tin stoiba ADD DX,30H ;upologismos ASCII kwdikou PRINT DL ;ektupwsi antistoixou psifiou stin othoni LOOP ADDR5 POP BX POP CX POP DX RET PRINT_DEC ENDP ;********************************************************** ; PRINT_HEX ; INPUT: DX ; MODIFIED: NONE ;********************************************************** PRINT_HEX PROC FAR PUSH DX ;apothikeusi kataxwritwn sti stoiba PUSH CX PUSH BX PUSH BP MOV BP,0 CMP DX,0 JNE LAB PRINT '0' JMP EX LAB: MOV BX,DX ;metafora arithmou ston BX SHL DX,1 JNC POSITIVE PRINT '-' NEG BX POSITIVE: MOV CX,4 ;metritis psifiwn ADDR2: ROL BX,1 ;4 aristeres peristrofes wste ta 4 epomena bit ROL BX,1 ;na erthoun stis 4 dexioteres theseis ROL BX,1 ROL BX,1 MOV DX,BX AND DX,000FH ;apomonwsi twn 4 LSB's CMP DL,00 JNE CONT CMP BP,0 JE NO_PRINT CONT: CMP DL,09 ;elegxos an einai psifio 0-9 JLE ADDR3 ;elegxos an einai gramma A-F ADD DL,37H ;metatropi se ASCII JMP ADDR4 ADDR3: ADD DL,30H ;metatropi se ASCII gia psifio ADDR4: PRINT DL ;ektupwsi hex psifiou MOV BP,1 NO_PRINT: LOOP ADDR2 EX: POP BP POP BX ;epanafora periexomenou kataxwritwn POP CX POP DX RET PRINT_HEX ENDP ;********************************************************** ; SCAN_KEYB ; INPUT: NONE ; MODIFIED: AX,DX ; OUTPUT: DX[NUM],AX[OPERATOR] ; ;********************************************************** SCAN_KEY PROC FAR PUSH SI MOV CX,4 ;metritis psifiwn arithmou MOV SI,0 IGNORE: READ ;anagnwsi pliktrologiou CMP AL,'Q' ;an einai 'Q' , termatismos JE ADDRR2 CMP AL,'+' ;elegxos an einai '+' JNE CHECK_MINUS ;an oxi elegxos an einai '-' CMP CX,4 ;an einai '+' JE IGNORE ;elegxoume an exei dothei pshfio JMP HEL ;an oxi to agnooume alliws teleiwse h eisagwgh tou prwtou arithmou CHECK_MINUS: CMP AL,'-' ;elegxos an einai '-' JNE CHECK_ENTER ;an oxi elegxos an einai enter CMP CX,4 ;an einai meion elegxos an exei dothei pshfio JE NEGAT ;an oxi pame na doume an einai to prwto meion wste na epitrepsoume arnhtikous arithmous HEL:CMP BP,0 JNE IGNORE PRINT AL JMP ADDRR2 NEGAT: CMP SI,0 ;an einai 0 tote einai to prwto meion kai to kratame JNE IGNORE ;alliws to agnooume giati exoume parei hdh ena meion PRINT AL MOV SI,1 ;allazoume th shmaia meta to prwto meion JMP IGNORE CHECK_ENTER: CMP AL,0DH ;elegxos gia enter JNE CHECK_NUM ;an oxi tote pame ston elegxo an einai pshfio CMP CX,4 ;an nai elegxoume an exei dothei toulaxiston ena pshfio alliws JE IGNORE ;to agnooume JMP ADDRR2 CHECK_NUM: CMP AL,30H ;elegxos an einai pshfio JL IGNORE CMP AL,39H JG IGNORE CMP CX,0 ;an exoun dothei 4 pshfia JE IGNORE ;agnooume ola ta ypoloipa PRINT AL ;to typwnoume sthn othoni SUB AL,30H AND AX,000FH PUSH AX ;kai to apothikeuoume ston DX MOV AX,DX MUL BX MOV DX,AX POP AX ADD DX,AX LOOP IGNORE JMP IGNORE ADDRR2: CMP SI,0 ;an dothike arnhtikos arithmos JE ADDRR3 NEG DX ;pairnoume to symplhrwma tou ws pros 2 ADDRR3: POP SI RET SCAN_KEY ENDP ;********************************************************** ; CALCULATE ; INPUT: AX,BX,DX ; MODIFIED: BX,DX ; OUTPUT: DX ; ;********************************************************** CALCULATE PROC FAR CMP AL,'+' ;elegxos an einai prosthesi JNE MINUS ;an oxi afairoume tous arithmous ADD BX,DX ;alliws tous prosthetoume JMP ADDRR1 MINUS: SUB BX,DX ADDRR1: MOV DX,BX ;to apotelesma ston DX RET CALCULATE ENDP CODE_SEG ENDS END
.tmp/disasm.asm
darenm/SpecNSpritePlayground
1
103615
L0456: equ 0456h L047A: equ 047Ah L049E: equ 049Eh L064A: equ 064Ah L1130: equ 1130h L1203: equ 1203h L13A1: equ 13A1h L152B: equ 152Bh L16CD: equ 16CDh L1A97: equ 1A97h L23ED: equ 23EDh L2683: equ 2683h L2942: equ 2942h L5800: equ 5800h L6074: equ 6074h L608D: equ 608Dh L60D0: equ 60D0h L6124: equ 6124h L612F: equ 612Fh org 0003h 0003 L0003: 0003 CD 24 00 CALL L0024 0006 CD 03 12 CALL L1203 0009 CD 74 11 CALL L1174 000C CD A1 13 CALL L13A1 000F CD 2B 15 CALL L152B 0012 CD CD 16 CALL L16CD 0015 CD 97 1A CALL L1A97 0018 CD ED 23 CALL L23ED 001B CD 83 26 CALL L2683 001E CD 42 29 CALL L2942 0021 C3 03 00 JP L0003 0024 L0024: 0024 F3 DI 0025 ED 91 52 0A NEXTREG REG_MMU2,0Ah 0029 CD 8D 60 CALL L608D 002C FB EI 002D 76 HALT 002E C5 PUSH BC 002F 01 3B 24 LD BC,243Bh 0032 3E 2F LD A,2Fh 0034 ED 79 OUT (C),A 0036 04 INC B 0037 ED 78 IN A,(C) 0039 ED 92 05 NEXTREG REG_PERIPHERAL_1,A 003C C1 POP BC 003D F3 DI 003E CD 74 60 CALL L6074 0041 01 3B 12 LD BC,123Bh 0044 3E 00 LD A,00h 0046 ED 79 OUT (C),A 0048 11 0D EC LD DE,EC0Dh 004B 3E 80 LD A,80h 004D 32 2F 61 LD (L612F),A 0050 CD 24 61 CALL L6124 0053 11 0C 17 LD DE,170Ch 0056 3E 80 LD A,80h 0058 32 2F 61 LD (L612F),A 005B CD 24 61 CALL L6124 005E 11 09 D8 LD DE,D809h 0061 3E 80 LD A,80h 0063 32 2F 61 LD (L612F),A 0066 CD 24 61 CALL L6124 0069 11 06 E7 LD DE,E706h 006C 3E 80 LD A,80h 006E 32 2F 61 LD (L612F),A 0071 CD 24 61 CALL L6124 0074 11 03 18 LD DE,1803h 0077 3E 80 LD A,80h 0079 32 2F 61 LD (L612F),A 007C CD 24 61 CALL L6124 007F 11 04 03 LD DE,0304h org 02FCh 02FC L02FC: 02FC CD 30 11 CALL L1130 02FF 21 00 D3 LD HL,D300h 0302 3E 32 LD A,32h 0304 CD 30 11 CALL L1130 0307 21 00 D4 LD HL,D400h 030A 3E 33 LD A,33h 030C CD 30 11 CALL L1130 030F 21 00 D5 LD HL,D500h 0312 3E 34 LD A,34h 0314 CD 30 11 CALL L1130 0317 21 00 D6 LD HL,D600h 031A 3E 35 LD A,35h 031C CD 30 11 CALL L1130 031F 21 00 D7 LD HL,D700h 0322 3E 36 LD A,36h 0324 CD 30 11 CALL L1130 0327 21 00 D8 LD HL,D800h 032A 3E 37 LD A,37h 032C CD 30 11 CALL L1130 032F 21 00 D9 LD HL,D900h 0332 3E 38 LD A,38h 0334 CD 30 11 CALL L1130 0337 21 00 DA LD HL,DA00h 033A 3E 39 LD A,39h 033C CD 30 11 CALL L1130 033F 21 00 DB LD HL,DB00h 0342 3E 3A LD A,3Ah 0344 CD 30 11 CALL L1130 0347 21 00 DC LD HL,DC00h 034A 3E 3B LD A,3Bh 034C CD 30 11 CALL L1130 034F 21 00 DD LD HL,DD00h 0352 3E 3C LD A,3Ch 0354 CD 30 11 CALL L1130 0357 21 00 DE LD HL,DE00h 035A 3E 3D LD A,3Dh 035C CD 30 11 CALL L1130 035F 21 00 00 LD HL,0000h org 03DCh 03DC L03DC: 03DC CD E2 03 CALL L03E2 03DF C3 DC 03 JP L03DC 03E2 L03E2: 03E2 3E 05 LD A,05h 03E4 3C INC A 03E5 FE 0C CP 0Ch 03E7 DA EB 03 JP C,L03EB 03EA AF XOR A 03EB L03EB: 03EB 32 E3 03 LD (L03E2+1),A 03EE E6 0E AND 0Eh 03F0 21 04 0F LD HL,0F04h 03F3 ED 31 ADD HL,A 03F5 ED 91 43 80 NEXTREG REG_PALETTE_CONTROL,RPC_DISABLE_AUTOINC 03F9 7E LD A,(HL) 03FA 23 INC HL 03FB ED 92 40 NEXTREG REG_PALETTE_INDEX,A 03FE 7E LD A,(HL) 03FF 23 INC HL 0400 ED 92 41 NEXTREG REG_PALETTE_VALUE_8,A 0403 46 LD B,(HL) 0404 23 INC HL 0405 7E LD A,(HL) 0406 32 32 04 LD (L0431+1),A 0409 32 56 04 LD (L0456),A 040C 32 7A 04 LD (L047A),A 040F 32 9E 04 LD (L049E),A 0412 78 LD A,B 0413 ED 92 40 NEXTREG REG_PALETTE_INDEX,A 0416 ED 91 41 FF NEXTREG REG_PALETTE_VALUE_8,FFh 041A F3 DI 041B ED 91 56 2E NEXTREG REG_MMU6,2Eh 041F 3A 00 58 LD A,(L5800) 0422 CB 77 BIT 6,A 0424 CA 29 04 JP Z,L0429 0427 C6 08 ADD A,08h 0429 L0429: 0429 E6 0F AND 0Fh 042B 21 48 C5 LD HL,C548h 042E ED 31 ADD HL,A 0430 7E LD A,(HL) 0431 L0431: 0431 FE 18 CP 18h 0433 C2 38 04 JP NZ,L0438 0436 3E FF LD A,FFh 0438 L0438: 0438 57 LD D,A 0439 1E 80 LD E,80h 043B 3E A0 LD A,A0h 043D 32 2F 61 LD (L612F),A 0440 CD 24 61 CALL L6124 org 058Fh 058F L058F: 058F CD D0 60 CALL L60D0 0592 3E 24 LD A,24h 0594 21 03 27 LD HL,2703h 0597 11 01 A4 LD DE,A401h 059A CD D0 60 CALL L60D0 059D 3E 25 LD A,25h 059F 21 2D C9 LD HL,C92Dh 05A2 11 00 A5 LD DE,A500h 05A5 CD D0 60 CALL L60D0 05A8 3E 26 LD A,26h 05AA 21 09 C3 LD HL,C309h 05AD 11 01 A6 LD DE,A601h 05B0 CD D0 60 CALL L60D0 05B3 C3 4A 06 JP L064A 05B6 FE defb FEh 05B7 10 defb 10h 05B8 C2 defb C2h 05B9 EA defb EAh 05BA 05 defb 05h 05BB 3E defb 3Eh 05BC 23 defb 23h 05BD 21 defb 21h 05BE 27 defb 27h 05BF 2E defb 2Eh 05C0 11 defb 11h 05C1 00 defb 00h 05C2 A3 defb A3h 05C3 CD defb CDh 05C4 D0 defb D0h 05C5 60 defb 60h 05C6 3E defb 3Eh 05C7 24 defb 24h 05C8 21 defb 21h 05C9 02 defb 02h 05CA 27 defb 27h 05CB 11 defb 11h 05CC 01 defb 01h 05CD A4 defb A4h 05CE CD defb CDh 05CF D0 defb D0h 05D0 60 defb 60h 05D1 3E defb 3Eh 05D2 25 defb 25h 05D3 21 defb 21h 05D4 2E defb 2Eh 05D5 C9 defb C9h 05D6 11 defb 11h 05D7 00 defb 00h 05D8 A5 defb A5h 05D9 CD defb CDh 05DA D0 defb D0h 05DB 60 defb 60h 05DC 3E defb 3Eh 05DD 26 defb 26h 05DE 21 defb 21h 05DF 09 defb 09h 05E0 C2 defb C2h 05E1 11 defb 11h 05E2 01 defb 01h 05E3 A6 defb A6h 05E4 CD defb CDh 05E5 D0 defb D0h 05E6 60 defb 60h 05E7 C3 defb C3h 05E8 4A defb 4Ah 05E9 06 defb 06h 05EA FE defb FEh 05EB 11 defb 11h 05EC C2 defb C2h 05ED 1E defb 1Eh 05EE 06 defb 06h 05EF 3E defb 3Eh 05F0 23 defb 23h 05F1 21 defb 21h 05F2 27 defb 27h org 0EF4h 0EF4 L0EF4: 0EF4 C5 defb C5h 0EF5 01 defb 01h 0EF6 3B defb 3Bh 0EF7 24 defb 24h 0EF8 3E defb 3Eh 0EF9 2F defb 2Fh 0EFA ED defb EDh 0EFB 79 defb 79h 0EFC 04 defb 04h 0EFD ED defb EDh 0EFE 78 defb 78h 0EFF ED defb EDh 0F00 92 defb 92h 0F01 05 defb 05h 0F02 C1 defb C1h 0F03 C9 defb C9h 0F04 09 defb 09h 0F05 D8 defb D8h 0F06 0A defb 0Ah 0F07 E8 defb E8h 0F08 06 defb 06h 0F09 E7 defb E7h 0F0A 03 defb 03h 0F0B 18 defb 18h 0F0C 04 defb 04h 0F0D 03 defb 03h 0F0E 05 defb 05h 0F0F C0 defb C0h 0F10 09 defb 09h 0F11 D8 defb D8h 0F12 E5 defb E5h 0F13 E6 defb E6h 0F14 07 defb 07h 0F15 21 defb 21h 0F16 40 defb 40h 0F17 C5 defb C5h 0F18 85 defb 85h 0F19 6F defb 6Fh 0F1A 8C defb 8Ch 0F1B 95 defb 95h 0F1C 67 defb 67h 0F1D 7E defb 7Eh 0F1E E1 defb E1h 0F1F 77 defb 77h 0F20 C9 defb C9h 0F21 2D defb 2Dh 0F22 11 defb 11h 0F23 60 defb 60h 0F24 57 defb 57h 0F25 60 defb 60h 0F26 56 defb 56h 0F27 60 defb 60h 0F28 55 defb 55h 0F29 60 defb 60h 0F2A 54 defb 54h 0F2B 60 defb 60h 0F2C 53 defb 53h 0F2D 60 defb 60h 0F2E 52 defb 52h 0F2F 60 defb 60h 0F30 51 defb 51h 0F31 60 defb 60h 0F32 50 defb 50h 0F33 40 defb 40h 0F34 57 defb 57h 0F35 40 defb 40h 0F36 56 defb 56h 0F37 40 defb 40h 0F38 55 defb 55h 0F39 40 defb 40h 0F3A 54 defb 54h 0F3B 40 defb 40h 0F3C 53 defb 53h 0F3D 40 defb 40h 0F3E 52 defb 52h 0F3F 40 defb 40h 0F40 51 defb 51h 0F41 40 defb 40h 0F42 50 defb 50h 0F43 20 defb 20h 0F44 57 defb 57h 0F45 20 defb 20h 0F46 56 defb 56h 0F47 20 defb 20h 0F48 55 defb 55h 0F49 20 defb 20h 0F4A 54 defb 54h 0F4B 20 defb 20h 0F4C 53 defb 53h 0F4D 20 defb 20h 0F4E 52 defb 52h 0F4F 20 defb 20h 0F50 51 defb 51h 0F51 20 defb 20h 0F52 50 defb 50h 0F53 00 defb 00h 0F54 57 defb 57h 0F55 00 defb 00h 0F56 56 defb 56h 0F57 00 defb 00h org 1174h 1174 L1174: 1174 CD 8D 60 CALL L608D 1177 CD 74 60 CALL L6074 117A FB EI 117B 76 HALT 117C C5 PUSH BC 117D 01 3B 24 LD BC,243Bh 1180 3E 2F LD A,2Fh 1182 ED 79 OUT (C),A 1184 04 INC B 1185 ED 78 IN A,(C) 1187 ED 92 05 NEXTREG REG_PERIPHERAL_1,A 118A C1 POP BC 118B 11 0C 00 LD DE,000Ch 118E 3E 80 LD A,80h 1190 32 2F 61 LD (L612F),A 1193 CD 24 61 CALL L6124 1196 11 0E 00 LD DE,000Eh 1199 3E 80 LD A,80h 119B 32 2F 61 LD (L612F),A 119E CD 24 61 CALL L6124 11A1 11 0A 00 LD DE,000Ah 11A4 3E 80 LD A,80h 11A6 32 2F 61 LD (L612F),A 11A9 CD 24 61 CALL L6124 11AC F3 DI 11AD ED 91 57 1E NEXTREG REG_MMU7,1Eh 11B1 21 00 E0 LD HL,E000h 11B4 11 00 40 LD DE,4000h 11B7 01 00 1B LD BC,1B00h 11BA ED B0 LDIR 11BC F3 DI 11BD ED 91 56 00 NEXTREG REG_MMU6,00h 11C1 ED 91 57 01 NEXTREG REG_MMU7,01h 11C5 FB EI 11C6 ED 91 15 17 NEXTREG REG_SPRITE_LAYER_SYSTEM,17h 11CA 76 HALT 11CB C5 PUSH BC 11CC 01 3B 24 LD BC,243Bh 11CF 3E 2F LD A,2Fh 11D1 ED 79 OUT (C),A 11D3 04 INC B 11D4 ED 78 IN A,(C) 11D6 ED 92 00 NEXTREG REG_MACHINE_ID,A org 403Bh 403B L403B: 403B FC defb FCh 403C 00 defb 00h 403D 7C defb 7Ch 403E 00 defb 00h 403F 00 defb 00h 4040 00 defb 00h 4041 00 defb 00h 4042 00 defb 00h 4043 FF defb FFh 4044 FF defb FFh 4045 FC defb FCh 4046 00 defb 00h 4047 FF defb FFh 4048 FF defb FFh 4049 FC defb FCh 404A 00 defb 00h 404B FF defb FFh 404C FF defb FFh 404D FC defb FCh 404E 00 defb 00h 404F FF defb FFh 4050 FF defb FFh 4051 FC defb FCh 4052 00 defb 00h 4053 FF defb FFh 4054 FF defb FFh 4055 FC defb FCh 4056 00 defb 00h 4057 FF defb FFh 4058 FF defb FFh 4059 FC defb FCh 405A 00 defb 00h 405B FF defb FFh 405C FF defb FFh 405D FC defb FCh 405E 00 defb 00h 405F 00 defb 00h 4060 7F defb 7Fh 4061 FF defb FFh 4062 FE defb FEh 4063 00 defb 00h 4064 00 defb 00h 4065 00 defb 00h 4066 00 defb 00h 4067 00 defb 00h 4068 00 defb 00h 4069 00 defb 00h 406A 00 defb 00h 406B 00 defb 00h 406C 00 defb 00h 406D 00 defb 00h 406E 00 defb 00h 406F 00 defb 00h 4070 00 defb 00h 4071 00 defb 00h 4072 00 defb 00h 4073 00 defb 00h 4074 00 defb 00h 4075 00 defb 00h 4076 00 defb 00h 4077 00 defb 00h 4078 00 defb 00h 4079 00 defb 00h 407A 00 defb 00h 407B 00 defb 00h 407C 00 defb 00h 407D 01 defb 01h 407E FF defb FFh 407F 80 defb 80h 4080 7C defb 7Ch 4081 00 defb 00h 4082 7E defb 7Eh 4083 00 defb 00h 4084 00 defb 00h 4085 00 defb 00h 4086 00 defb 00h 4087 00 defb 00h 4088 00 defb 00h 4089 00 defb 00h 408A 00 defb 00h 408B 00 defb 00h 408C 00 defb 00h 408D 00 defb 00h 408E 00 defb 00h 408F 00 defb 00h 4090 00 defb 00h 4091 00 defb 00h 4092 00 defb 00h 4093 00 defb 00h 4094 00 defb 00h 4095 00 defb 00h 4096 00 defb 00h 4097 00 defb 00h 4098 00 defb 00h 4099 00 defb 00h 409A 00 defb 00h 409B 00 defb 00h 409C 00 defb 00h 409D FC defb FCh 409E 00 defb 00h 409F 00 defb 00h org 52CAh 52CA L52CA: 52CA FC defb FCh 52CB FF defb FFh 52CC FF defb FFh 52CD 00 defb 00h 52CE FC defb FCh 52CF FF defb FFh 52D0 FF defb FFh 52D1 00 defb 00h 52D2 FC defb FCh 52D3 FF defb FFh 52D4 FF defb FFh 52D5 00 defb 00h 52D6 FC defb FCh 52D7 FF defb FFh 52D8 FF defb FFh 52D9 00 defb 00h 52DA FC defb FCh 52DB FF defb FFh 52DC FF defb FFh 52DD 00 defb 00h 52DE 00 defb 00h 52DF 00 defb 00h 52E0 00 defb 00h 52E1 00 defb 00h 52E2 3F defb 3Fh 52E3 FF defb FFh 52E4 FC defb FCh 52E5 00 defb 00h 52E6 3F defb 3Fh 52E7 FF defb FFh 52E8 FC defb FCh 52E9 00 defb 00h 52EA 3F defb 3Fh 52EB FF defb FFh 52EC FC defb FCh 52ED 00 defb 00h 52EE 3F defb 3Fh 52EF FF defb FFh 52F0 FC defb FCh 52F1 00 defb 00h 52F2 3F defb 3Fh 52F3 FF defb FFh 52F4 FC defb FCh 52F5 00 defb 00h 52F6 3F defb 3Fh 52F7 FF defb FFh 52F8 FC defb FCh 52F9 00 defb 00h 52FA 3F defb 3Fh 52FB FF defb FFh 52FC FC defb FCh 52FD 00 defb 00h 52FE 00 defb 00h 52FF 00 defb 00h 5300 1F defb 1Fh 5301 FF defb FFh 5302 F8 defb F8h 5303 00 defb 00h 5304 00 defb 00h 5305 00 defb 00h 5306 00 defb 00h 5307 00 defb 00h 5308 00 defb 00h 5309 00 defb 00h 530A 00 defb 00h 530B 00 defb 00h 530C 00 defb 00h 530D 00 defb 00h 530E 00 defb 00h 530F 00 defb 00h 5310 00 defb 00h 5311 00 defb 00h 5312 00 defb 00h 5313 00 defb 00h 5314 00 defb 00h 5315 00 defb 00h 5316 00 defb 00h 5317 00 defb 00h 5318 00 defb 00h 5319 00 defb 00h 531A 00 defb 00h 531B 00 defb 00h 531C 00 defb 00h 531D FC defb FCh 531E 00 defb 00h 531F 7F defb 7Fh 5320 00 defb 00h 5321 00 defb 00h 5322 00 defb 00h 5323 00 defb 00h 5324 00 defb 00h 5325 00 defb 00h 5326 00 defb 00h 5327 00 defb 00h 5328 00 defb 00h 5329 00 defb 00h 532A 00 defb 00h 532B 00 defb 00h 532C 00 defb 00h 532D 00 defb 00h org 8013h 8013 L8013: 8013 00 defb 00h 8014 00 defb 00h 8015 00 defb 00h 8016 00 defb 00h 8017 00 defb 00h 8018 00 defb 00h 8019 00 defb 00h 801A 00 defb 00h 801B 00 defb 00h 801C 00 defb 00h 801D 00 defb 00h 801E 00 defb 00h 801F 00 defb 00h 8020 00 defb 00h 8021 00 defb 00h 8022 00 defb 00h 8023 00 defb 00h 8024 00 defb 00h 8025 00 defb 00h 8026 00 defb 00h 8027 00 defb 00h 8028 00 defb 00h 8029 00 defb 00h 802A 00 defb 00h
programming-languages/ada/stdio.adb
robertwenquan/nyu-course-assignment
1
17087
<reponame>robertwenquan/nyu-course-assignment with Ada.Text_IO; use Ada.Text_IO; with Ada.Strings.Equal_Case_Insensitive; with Ada.Strings.Unbounded; with Ada.Strings.Unbounded.Text_IO; with Ada.Characters.Handling; use Ada.Characters.Handling; with Ada.Strings; use Ada.Strings; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; procedure stdio is package SU renames Ada.Strings.Unbounded; Str : SU.Unbounded_String; Cmd : SU.Unbounded_String; Arg : SU.Unbounded_String; SPACE_LOC : Integer; -- Function return value Ret : Integer; NUM_OF_NODES : Integer; type LinkNode is record Key : SU.Unbounded_String; Value : SU.Unbounded_String; Next : SU.Unbounded_String; end record; --type LinkList is array (Integer range <>) of LinkNode; type LinkList is array (1..12243) of LinkNode; --DataList : LinkList := ((1, SU.To_Unbounded_String("200"), 2), (2, SU.To_Unbounded_String("300"), 3), (3, SU.To_Unbounded_String("300"), 4)); DataList : LinkList; use Ada.Text_IO; Function eq(Left, Right : String) return Boolean renames Ada.Strings.Equal_Case_Insensitive; -- -- COUNT -- Function CMD_COUNT(List : in LinkList; StartKey : in SU.Unbounded_String; PrintFlag : Boolean) return Integer is i : Integer := 1; n : Integer := 0; next : SU.Unbounded_String; begin -- Find the start node i := 1; LOOP_FIND_START_NODE: while SU.To_String(List(i).Key) /= "" loop if SU.To_String(List(i).Key) = SU.To_String(StartKey) then exit LOOP_FIND_START_NODE; end if; i := i + 1; end loop LOOP_FIND_START_NODE; -- For starting node Not Found if SU.To_String(List(i).Key) = "" then if PrintFlag = True then Put_Line("ERR"); end if; return -1; end if; -- Count the items n := 1; next := List(i).Next; i := 1; LOOP_COUNT_NODES: while SU.To_String(List(i).Key) /= "" loop if SU.To_String(List(i).Key) = SU.To_String(next) then n := n + 1; next := List(i).Next; i := 1; else i := i + 1; end if; end loop LOOP_COUNT_NODES; if PrintFlag = True then Put_Line(Trim(Source => Integer'Image(n), Side => Both)); end if; return n; end CMD_COUNT; -- -- SUM -- Procedure CMD_SUM(List : in LinkList; StartKey : in SU.Unbounded_String; IsString : Boolean) is i : Integer := 1; n : Integer := 0; sum : Integer := 0; sum_str : String := ""; next : SU.Unbounded_String; begin -- Find the start node i := 1; LOOP_FIND_START_NODE: while SU.To_String(List(i).Key) /= "" loop if SU.To_String(List(i).Key) = SU.To_String(StartKey) then exit LOOP_FIND_START_NODE; end if; i := i + 1; end loop LOOP_FIND_START_NODE; -- For starting node Not Found if SU.To_String(List(i).Key) = "" then Put_Line("ERR"); return; end if; -- Count the items n := 1; --sum_str := ""; if IsString = False then sum := sum + Integer'Value(SU.To_String(List(i).Value)); else sum_str := "xx"; end if; next := List(i).Next; i := 1; LOOP_COUNT_NODES: while SU.To_String(List(i).Key) /= "" loop if SU.To_String(List(i).Key) = SU.To_String(next) then n := n + 1; if IsString = False then sum := sum + Integer'Value(SU.To_String(List(i).Value)); else sum_str := "xx xx"; end if; next := List(i).Next; i := 1; else i := i + 1; end if; end loop LOOP_COUNT_NODES; if IsString = False then Put_Line(Trim(Source => Integer'Image(sum), Side => Both)); else Put_Line(sum_str); end if; end CMD_SUM; -- -- UNUSED -- Procedure CMD_UNUSED(List : in LinkList; StartKey : in SU.Unbounded_String) is n_unused : Integer; n_count : Integer; begin n_count := CMD_COUNT(DataList, StartKey, False); if n_count = -1 then Put_Line("ERR"); return; end if; n_unused := NUM_OF_NODES - n_count; Put_Line(Trim(Source => Integer'Image(n_unused), Side => Both)); end CMD_UNUSED; -- -- LINKS -- Procedure CMD_LINKS(List : in LinkList; StartKey : in SU.Unbounded_String) is begin Put_Line("LINKS!!!"); end CMD_LINKS; begin -- -- Phase 1, get the input -- DataList(1) := (SU.To_Unbounded_String("1"), SU.To_Unbounded_String("100"), SU.To_Unbounded_String("2")); DataList(2) := (SU.To_Unbounded_String("2"), SU.To_Unbounded_String("200"), SU.To_Unbounded_String("3")); DataList(3) := (SU.To_Unbounded_String("3"), SU.To_Unbounded_String("300"), SU.To_Unbounded_String("4")); DataList(4) := (SU.To_Unbounded_String("4"), SU.To_Unbounded_String("400"), SU.To_Unbounded_String("")); NUM_OF_NODES := 4; -- -- Phase 2, processing the command -- loop SU.Text_IO.Get_Line(Str); Str := SU.To_Unbounded_String(Trim(Source => SU.To_String(Str), Side => Both)); -- Get the first space after the command SPACE_LOC := SU.Index(Str, " "); if (SPACE_LOC > 0) then Cmd := SU.To_Unbounded_String(SU.Slice(Str, 1, SPACE_LOC-1)); --SU.Text_IO.Put_Line(Cmd); else Cmd := Str; end if; --SU.Text_IO.Put_Line(Cmd); --FIXME: if here is with argument, how to handle it?? if (eq(SU.To_String(Cmd), "QUIT")) then exit; end if; -- get the parameter -- only 1 parameter is allowed for each command -- and it must be integer if (SPACE_LOC = 0) then Put_Line("ERR"); goto Continue; end if; -- At this point, there are at least one argument Arg := SU.To_Unbounded_String(Trim(Source => SU.Slice(Str, SPACE_LOC, SU.Length(Str)), Side => Both)); SPACE_LOC := SU.Index(Arg, " "); if (SPACE_LOC > 0) then Put_Line("ERR"); goto Continue; end if; -- At this point, there should be with only one argument -- FIXME: still need numeric check if (eq(SU.To_String(Cmd), "COUNT")) then Ret := CMD_COUNT(DataList, Arg, True); elsif (eq(SU.To_String(Cmd), "SUM")) then CMD_SUM(DataList, Arg, False); elsif (eq(SU.To_String(Cmd), "UNUSED")) then CMD_UNUSED(DataList, Arg); elsif (eq(SU.To_String(Cmd), "LINKS")) then CMD_LINKS(DataList, Arg); else Put_Line("ERR"); end if; <<Continue>> null; end loop; end stdio;
kernel.asm
hyunW3/OS-3-1
0
11041
<filename>kernel.asm kernel: file format elf32-i386 Disassembly of section .text: 80100000 <multiboot_header>: 80100000: 02 b0 ad 1b 00 00 add 0x1bad(%eax),%dh 80100006: 00 00 add %al,(%eax) 80100008: fe 4f 52 decb 0x52(%edi) 8010000b: e4 .byte 0xe4 8010000c <entry>: # Entering xv6 on boot processor, with paging off. .globl entry entry: # Turn on page size extension for 4Mbyte pages movl %cr4, %eax 8010000c: 0f 20 e0 mov %cr4,%eax orl $(CR4_PSE), %eax 8010000f: 83 c8 10 or $0x10,%eax movl %eax, %cr4 80100012: 0f 22 e0 mov %eax,%cr4 # Set page directory movl $(V2P_WO(entrypgdir)), %eax 80100015: b8 00 90 10 00 mov $0x109000,%eax movl %eax, %cr3 8010001a: 0f 22 d8 mov %eax,%cr3 # Turn on paging. movl %cr0, %eax 8010001d: 0f 20 c0 mov %cr0,%eax orl $(CR0_PG|CR0_WP), %eax 80100020: 0d 00 00 01 80 or $0x80010000,%eax movl %eax, %cr0 80100025: 0f 22 c0 mov %eax,%cr0 # Set up the stack pointer. movl $(stack + KSTACKSIZE), %esp 80100028: bc c0 b5 10 80 mov $0x8010b5c0,%esp # Jump to main(), and switch to executing at # high addresses. The indirect call is needed because # the assembler produces a PC-relative instruction # for a direct jump. mov $main, %eax 8010002d: b8 c0 2f 10 80 mov $0x80102fc0,%eax jmp *%eax 80100032: ff e0 jmp *%eax 80100034: 66 90 xchg %ax,%ax 80100036: 66 90 xchg %ax,%ax 80100038: 66 90 xchg %ax,%ax 8010003a: 66 90 xchg %ax,%ax 8010003c: 66 90 xchg %ax,%ax 8010003e: 66 90 xchg %ax,%ax 80100040 <binit>: struct buf head; } bcache; void binit(void) { 80100040: 55 push %ebp 80100041: 89 e5 mov %esp,%ebp 80100043: 53 push %ebx //PAGEBREAK! // Create linked list of buffers bcache.head.prev = &bcache.head; bcache.head.next = &bcache.head; for(b = bcache.buf; b < bcache.buf+NBUF; b++){ 80100044: bb f4 b5 10 80 mov $0x8010b5f4,%ebx { 80100049: 83 ec 0c sub $0xc,%esp initlock(&bcache.lock, "bcache"); 8010004c: 68 c0 70 10 80 push $0x801070c0 80100051: 68 c0 b5 10 80 push $0x8010b5c0 80100056: e8 e5 42 00 00 call 80104340 <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 70 10 80 push $0x801070c7 80100097: 50 push %eax 80100098: e8 73 41 00 00 call 80104210 <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 97 43 00 00 call 80104480 <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 d9 43 00 00 call 80104540 <release> acquiresleep(&b->lock); 80100167: 8d 43 0c lea 0xc(%ebx),%eax 8010016a: 89 04 24 mov %eax,(%esp) 8010016d: e8 de 40 00 00 call 80104250 <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 bd 20 00 00 call 80102240 <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 70 10 80 push $0x801070ce 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 3d 41 00 00 call 801042f0 <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 77 20 00 00 jmp 80102240 <iderw> panic("bwrite"); 801001c9: 83 ec 0c sub $0xc,%esp 801001cc: 68 df 70 10 80 push $0x801070df 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 fc 40 00 00 call 801042f0 <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 ac 40 00 00 call 801042b0 <releasesleep> acquire(&bcache.lock); 80100204: c7 04 24 c0 b5 10 80 movl $0x8010b5c0,(%esp) 8010020b: e8 70 42 00 00 call 80104480 <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 df 42 00 00 jmp 80104540 <release> panic("brelse"); 80100261: 83 ec 0c sub $0xc,%esp 80100264: 68 e6 70 10 80 push $0x801070e6 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 eb 14 00 00 call 80101770 <iunlock> target = n; acquire(&cons.lock); 80100285: c7 04 24 20 a5 10 80 movl $0x8010a520,(%esp) 8010028c: e8 ef 41 00 00 call 80104480 <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 f6 3b 00 00 call 80103ec0 <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 20 36 00 00 call 80103900 <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 4c 42 00 00 call 80104540 <release> ilock(ip); 801002f4: 89 3c 24 mov %edi,(%esp) 801002f7: e8 94 13 00 00 call 80101690 <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 ee 41 00 00 call 80104540 <release> ilock(ip); 80100352: 89 3c 24 mov %edi,(%esp) 80100355: e8 36 13 00 00 call 80101690 <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 a2 24 00 00 call 80102850 <lapicid> 801003ae: 83 ec 08 sub $0x8,%esp 801003b1: 50 push %eax 801003b2: 68 ed 70 10 80 push $0x801070ed 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 5f 7a 10 80 movl $0x80107a5f,(%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 83 3f 00 00 call 80104360 <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 71 10 80 push $0x80107101 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 58 00 00 call 80105cc0 <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 57 00 00 call 80105cc0 <uartputc> 801004f1: c7 04 24 20 00 00 00 movl $0x20,(%esp) 801004f8: e8 c3 57 00 00 call 80105cc0 <uartputc> 801004fd: c7 04 24 08 00 00 00 movl $0x8,(%esp) 80100504: e8 b7 57 00 00 call 80105cc0 <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 17 41 00 00 call 80104640 <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 4a 40 00 00 call 80104590 <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 71 10 80 push $0x80107105 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 71 10 80 movzbl -0x7fef8ed0(%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 5c 11 00 00 call 80101770 <iunlock> acquire(&cons.lock); 80100614: c7 04 24 20 a5 10 80 movl $0x8010a520,(%esp) 8010061b: e8 60 3e 00 00 call 80104480 <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 f4 3e 00 00 call 80104540 <release> ilock(ip); 8010064c: 58 pop %eax 8010064d: ff 75 08 pushl 0x8(%ebp) 80100650: e8 3b 10 00 00 call 80101690 <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 1c 3e 00 00 call 80104540 <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 71 10 80 mov $0x80107118,%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 8b 3c 00 00 call 80104480 <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 71 10 80 push $0x8010711f 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 58 3c 00 00 call 80104480 <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 b3 3c 00 00 call 80104540 <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 55 37 00 00 call 80104070 <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 b4 37 00 00 jmp 80104150 <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 71 10 80 push $0x80107128 801009cb: 68 20 a5 10 80 push $0x8010a520 801009d0: e8 6b 39 00 00 call 80104340 <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 f2 19 00 00 call 801023f0 <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 df 2e 00 00 call 80103900 <myproc> 80100a21: 89 85 f4 fe ff ff mov %eax,-0x10c(%ebp) begin_op(); 80100a27: e8 94 22 00 00 call 80102cc0 <begin_op> if((ip = namei(path)) == 0){ 80100a2c: 83 ec 0c sub $0xc,%esp 80100a2f: ff 75 08 pushl 0x8(%ebp) 80100a32: e8 b9 14 00 00 call 80101ef0 <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 43 0c 00 00 call 80101690 <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 12 0f 00 00 call 80101970 <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 b1 0e 00 00 call 80101920 <iunlockput> end_op(); 80100a6f: e8 bc 22 00 00 call 80102d30 <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 63 00 00 call 80106e10 <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 61 00 00 call 80106c30 <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 60 00 00 call 80106b70 <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 13 0e 00 00 call 80101970 <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 62 00 00 call 80106d90 <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 86 0d 00 00 call 80101920 <iunlockput> end_op(); 80100b9a: e8 91 21 00 00 call 80102d30 <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 60 00 00 call 80106c30 <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 61 00 00 call 80106d90 <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 58 21 00 00 call 80102d30 <end_op> cprintf("exec: fail\n"); 80100bd8: 83 ec 0c sub $0xc,%esp 80100bdb: 68 41 71 10 80 push $0x80107141 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 62 00 00 call 80106eb0 <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 72 3b 00 00 call 801047b0 <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 5f 3b 00 00 call 801047b0 <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 63 00 00 call 80107010 <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 63 00 00 call 80107010 <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 61 3a 00 00 call 80104770 <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 5c 00 00 call 801069e0 <switchuvm> freevm(oldpgdir); 80100d39: 89 3c 24 mov %edi,(%esp) 80100d3c: e8 4f 60 00 00 call 80106d90 <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 71 10 80 push $0x8010714d 80100d6b: 68 c0 ff 10 80 push $0x8010ffc0 80100d70: e8 cb 35 00 00 call 80104340 <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 ea 36 00 00 call 80104480 <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 7a 37 00 00 call 80104540 <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 61 37 00 00 call 80104540 <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 7c 36 00 00 call 80104480 <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 1f 37 00 00 call 80104540 <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 71 10 80 push $0x80107154 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 2a 36 00 00 call 80104480 <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 bf 36 00 00 jmp 80104540 <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 93 36 00 00 call 80104540 <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 9a 25 00 00 call 80103470 <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 db 1d 00 00 call 80102cc0 <begin_op> iput(ff.ip); 80100ee5: 83 ec 0c sub $0xc,%esp 80100ee8: ff 75 e0 pushl -0x20(%ebp) 80100eeb: e8 d0 08 00 00 call 801017c0 <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 31 1e 00 00 jmp 80102d30 <end_op> panic("fileclose"); 80100eff: 83 ec 0c sub $0xc,%esp 80100f02: 68 5c 71 10 80 push $0x8010715c 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 66 07 00 00 call 80101690 <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 09 0a 00 00 call 80101940 <stati> iunlock(f->ip); 80100f37: 59 pop %ecx 80100f38: ff 73 10 pushl 0x10(%ebx) 80100f3b: e8 30 08 00 00 call 80101770 <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 01 07 00 00 call 80101690 <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 d4 09 00 00 call 80101970 <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 bd 07 00 00 call 80101770 <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 4e 26 00 00 jmp 80103620 <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 71 10 80 push $0x80107166 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 27 07 00 00 call 80101770 <iunlock> end_op(); 80101049: e8 e2 1c 00 00 call 80102d30 <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 45 1c 00 00 call 80102cc0 <begin_op> ilock(f->ip); 8010107b: 83 ec 0c sub $0xc,%esp 8010107e: ff 76 10 pushl 0x10(%esi) 80101081: e8 0a 06 00 00 call 80101690 <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 d8 09 00 00 call 80101a70 <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 c3 06 00 00 call 80101770 <iunlock> end_op(); 801010ad: e8 7e 1c 00 00 call 80102d30 <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 1e 24 00 00 jmp 80103510 <pipewrite> panic("short filewrite"); 801010f2: 83 ec 0c sub $0xc,%esp 801010f5: 68 6f 71 10 80 push $0x8010716f 801010fa: e8 91 f2 ff ff call 80100390 <panic> panic("filewrite"); 801010ff: 83 ec 0c sub $0xc,%esp 80101102: 68 75 71 10 80 push $0x80107175 80101107: e8 84 f2 ff ff call 80100390 <panic> 8010110c: 66 90 xchg %ax,%ax 8010110e: 66 90 xchg %ax,%ax 80101110 <balloc>: // Blocks. // Allocate a zeroed disk block. static uint balloc(uint dev) { 80101110: 55 push %ebp 80101111: 89 e5 mov %esp,%ebp 80101113: 57 push %edi 80101114: 56 push %esi 80101115: 53 push %ebx 80101116: 83 ec 1c sub $0x1c,%esp int b, bi, m; struct buf *bp; bp = 0; for(b = 0; b < sb.size; b += BPB){ 80101119: 8b 0d c0 09 11 80 mov 0x801109c0,%ecx { 8010111f: 89 45 d8 mov %eax,-0x28(%ebp) for(b = 0; b < sb.size; b += BPB){ 80101122: 85 c9 test %ecx,%ecx 80101124: 0f 84 87 00 00 00 je 801011b1 <balloc+0xa1> 8010112a: c7 45 dc 00 00 00 00 movl $0x0,-0x24(%ebp) bp = bread(dev, BBLOCK(b, sb)); 80101131: 8b 75 dc mov -0x24(%ebp),%esi 80101134: 83 ec 08 sub $0x8,%esp 80101137: 89 f0 mov %esi,%eax 80101139: c1 f8 0c sar $0xc,%eax 8010113c: 03 05 d8 09 11 80 add 0x801109d8,%eax 80101142: 50 push %eax 80101143: ff 75 d8 pushl -0x28(%ebp) 80101146: e8 85 ef ff ff call 801000d0 <bread> 8010114b: 89 45 e4 mov %eax,-0x1c(%ebp) for(bi = 0; bi < BPB && b + bi < sb.size; bi++){ 8010114e: a1 c0 09 11 80 mov 0x801109c0,%eax 80101153: 83 c4 10 add $0x10,%esp 80101156: 89 45 e0 mov %eax,-0x20(%ebp) 80101159: 31 c0 xor %eax,%eax 8010115b: eb 2f jmp 8010118c <balloc+0x7c> 8010115d: 8d 76 00 lea 0x0(%esi),%esi m = 1 << (bi % 8); 80101160: 89 c1 mov %eax,%ecx if((bp->data[bi/8] & m) == 0){ // Is block free? 80101162: 8b 55 e4 mov -0x1c(%ebp),%edx m = 1 << (bi % 8); 80101165: bb 01 00 00 00 mov $0x1,%ebx 8010116a: 83 e1 07 and $0x7,%ecx 8010116d: d3 e3 shl %cl,%ebx if((bp->data[bi/8] & m) == 0){ // Is block free? 8010116f: 89 c1 mov %eax,%ecx 80101171: c1 f9 03 sar $0x3,%ecx 80101174: 0f b6 7c 0a 5c movzbl 0x5c(%edx,%ecx,1),%edi 80101179: 85 df test %ebx,%edi 8010117b: 89 fa mov %edi,%edx 8010117d: 74 41 je 801011c0 <balloc+0xb0> for(bi = 0; bi < BPB && b + bi < sb.size; bi++){ 8010117f: 83 c0 01 add $0x1,%eax 80101182: 83 c6 01 add $0x1,%esi 80101185: 3d 00 10 00 00 cmp $0x1000,%eax 8010118a: 74 05 je 80101191 <balloc+0x81> 8010118c: 39 75 e0 cmp %esi,-0x20(%ebp) 8010118f: 77 cf ja 80101160 <balloc+0x50> brelse(bp); bzero(dev, b + bi); return b + bi; } } brelse(bp); 80101191: 83 ec 0c sub $0xc,%esp 80101194: ff 75 e4 pushl -0x1c(%ebp) 80101197: e8 44 f0 ff ff call 801001e0 <brelse> for(b = 0; b < sb.size; b += BPB){ 8010119c: 81 45 dc 00 10 00 00 addl $0x1000,-0x24(%ebp) 801011a3: 83 c4 10 add $0x10,%esp 801011a6: 8b 45 dc mov -0x24(%ebp),%eax 801011a9: 39 05 c0 09 11 80 cmp %eax,0x801109c0 801011af: 77 80 ja 80101131 <balloc+0x21> } panic("balloc: out of blocks"); 801011b1: 83 ec 0c sub $0xc,%esp 801011b4: 68 7f 71 10 80 push $0x8010717f 801011b9: e8 d2 f1 ff ff call 80100390 <panic> 801011be: 66 90 xchg %ax,%ax bp->data[bi/8] |= m; // Mark block in use. 801011c0: 8b 7d e4 mov -0x1c(%ebp),%edi log_write(bp); 801011c3: 83 ec 0c sub $0xc,%esp bp->data[bi/8] |= m; // Mark block in use. 801011c6: 09 da or %ebx,%edx 801011c8: 88 54 0f 5c mov %dl,0x5c(%edi,%ecx,1) log_write(bp); 801011cc: 57 push %edi 801011cd: e8 be 1c 00 00 call 80102e90 <log_write> brelse(bp); 801011d2: 89 3c 24 mov %edi,(%esp) 801011d5: e8 06 f0 ff ff call 801001e0 <brelse> bp = bread(dev, bno); 801011da: 58 pop %eax 801011db: 5a pop %edx 801011dc: 56 push %esi 801011dd: ff 75 d8 pushl -0x28(%ebp) 801011e0: e8 eb ee ff ff call 801000d0 <bread> 801011e5: 89 c3 mov %eax,%ebx memset(bp->data, 0, BSIZE); 801011e7: 8d 40 5c lea 0x5c(%eax),%eax 801011ea: 83 c4 0c add $0xc,%esp 801011ed: 68 00 02 00 00 push $0x200 801011f2: 6a 00 push $0x0 801011f4: 50 push %eax 801011f5: e8 96 33 00 00 call 80104590 <memset> log_write(bp); 801011fa: 89 1c 24 mov %ebx,(%esp) 801011fd: e8 8e 1c 00 00 call 80102e90 <log_write> brelse(bp); 80101202: 89 1c 24 mov %ebx,(%esp) 80101205: e8 d6 ef ff ff call 801001e0 <brelse> } 8010120a: 8d 65 f4 lea -0xc(%ebp),%esp 8010120d: 89 f0 mov %esi,%eax 8010120f: 5b pop %ebx 80101210: 5e pop %esi 80101211: 5f pop %edi 80101212: 5d pop %ebp 80101213: c3 ret 80101214: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010121a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80101220 <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) { 80101220: 55 push %ebp 80101221: 89 e5 mov %esp,%ebp 80101223: 57 push %edi 80101224: 56 push %esi 80101225: 53 push %ebx 80101226: 89 c7 mov %eax,%edi struct inode *ip, *empty; acquire(&icache.lock); // Is the inode already cached? empty = 0; 80101228: 31 f6 xor %esi,%esi for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ 8010122a: bb 14 0a 11 80 mov $0x80110a14,%ebx { 8010122f: 83 ec 28 sub $0x28,%esp 80101232: 89 55 e4 mov %edx,-0x1c(%ebp) acquire(&icache.lock); 80101235: 68 e0 09 11 80 push $0x801109e0 8010123a: e8 41 32 00 00 call 80104480 <acquire> 8010123f: 83 c4 10 add $0x10,%esp for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ 80101242: 8b 55 e4 mov -0x1c(%ebp),%edx 80101245: eb 17 jmp 8010125e <iget+0x3e> 80101247: 89 f6 mov %esi,%esi 80101249: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101250: 81 c3 90 00 00 00 add $0x90,%ebx 80101256: 81 fb 34 26 11 80 cmp $0x80112634,%ebx 8010125c: 73 22 jae 80101280 <iget+0x60> if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){ 8010125e: 8b 4b 08 mov 0x8(%ebx),%ecx 80101261: 85 c9 test %ecx,%ecx 80101263: 7e 04 jle 80101269 <iget+0x49> 80101265: 39 3b cmp %edi,(%ebx) 80101267: 74 4f je 801012b8 <iget+0x98> ip->ref++; release(&icache.lock); return ip; } if(empty == 0 && ip->ref == 0) // Remember empty slot. 80101269: 85 f6 test %esi,%esi 8010126b: 75 e3 jne 80101250 <iget+0x30> 8010126d: 85 c9 test %ecx,%ecx 8010126f: 0f 44 f3 cmove %ebx,%esi for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ 80101272: 81 c3 90 00 00 00 add $0x90,%ebx 80101278: 81 fb 34 26 11 80 cmp $0x80112634,%ebx 8010127e: 72 de jb 8010125e <iget+0x3e> empty = ip; } // Recycle an inode cache entry. if(empty == 0) 80101280: 85 f6 test %esi,%esi 80101282: 74 5b je 801012df <iget+0xbf> ip = empty; ip->dev = dev; ip->inum = inum; ip->ref = 1; ip->valid = 0; release(&icache.lock); 80101284: 83 ec 0c sub $0xc,%esp ip->dev = dev; 80101287: 89 3e mov %edi,(%esi) ip->inum = inum; 80101289: 89 56 04 mov %edx,0x4(%esi) ip->ref = 1; 8010128c: c7 46 08 01 00 00 00 movl $0x1,0x8(%esi) ip->valid = 0; 80101293: c7 46 4c 00 00 00 00 movl $0x0,0x4c(%esi) release(&icache.lock); 8010129a: 68 e0 09 11 80 push $0x801109e0 8010129f: e8 9c 32 00 00 call 80104540 <release> return ip; 801012a4: 83 c4 10 add $0x10,%esp } 801012a7: 8d 65 f4 lea -0xc(%ebp),%esp 801012aa: 89 f0 mov %esi,%eax 801012ac: 5b pop %ebx 801012ad: 5e pop %esi 801012ae: 5f pop %edi 801012af: 5d pop %ebp 801012b0: c3 ret 801012b1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){ 801012b8: 39 53 04 cmp %edx,0x4(%ebx) 801012bb: 75 ac jne 80101269 <iget+0x49> release(&icache.lock); 801012bd: 83 ec 0c sub $0xc,%esp ip->ref++; 801012c0: 83 c1 01 add $0x1,%ecx return ip; 801012c3: 89 de mov %ebx,%esi release(&icache.lock); 801012c5: 68 e0 09 11 80 push $0x801109e0 ip->ref++; 801012ca: 89 4b 08 mov %ecx,0x8(%ebx) release(&icache.lock); 801012cd: e8 6e 32 00 00 call 80104540 <release> return ip; 801012d2: 83 c4 10 add $0x10,%esp } 801012d5: 8d 65 f4 lea -0xc(%ebp),%esp 801012d8: 89 f0 mov %esi,%eax 801012da: 5b pop %ebx 801012db: 5e pop %esi 801012dc: 5f pop %edi 801012dd: 5d pop %ebp 801012de: c3 ret panic("iget: no inodes"); 801012df: 83 ec 0c sub $0xc,%esp 801012e2: 68 95 71 10 80 push $0x80107195 801012e7: e8 a4 f0 ff ff call 80100390 <panic> 801012ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801012f0 <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) { 801012f0: 55 push %ebp 801012f1: 89 e5 mov %esp,%ebp 801012f3: 57 push %edi 801012f4: 56 push %esi 801012f5: 53 push %ebx 801012f6: 89 c6 mov %eax,%esi 801012f8: 83 ec 1c sub $0x1c,%esp uint addr, *a; struct buf *bp; if(bn < NDIRECT){ 801012fb: 83 fa 0b cmp $0xb,%edx 801012fe: 77 18 ja 80101318 <bmap+0x28> 80101300: 8d 3c 90 lea (%eax,%edx,4),%edi if((addr = ip->addrs[bn]) == 0) 80101303: 8b 5f 5c mov 0x5c(%edi),%ebx 80101306: 85 db test %ebx,%ebx 80101308: 74 76 je 80101380 <bmap+0x90> brelse(bp); return addr; } panic("bmap: out of range"); } 8010130a: 8d 65 f4 lea -0xc(%ebp),%esp 8010130d: 89 d8 mov %ebx,%eax 8010130f: 5b pop %ebx 80101310: 5e pop %esi 80101311: 5f pop %edi 80101312: 5d pop %ebp 80101313: c3 ret 80101314: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi bn -= NDIRECT; 80101318: 8d 5a f4 lea -0xc(%edx),%ebx if(bn < NINDIRECT){ 8010131b: 83 fb 7f cmp $0x7f,%ebx 8010131e: 0f 87 90 00 00 00 ja 801013b4 <bmap+0xc4> if((addr = ip->addrs[NDIRECT]) == 0) 80101324: 8b 90 8c 00 00 00 mov 0x8c(%eax),%edx 8010132a: 8b 00 mov (%eax),%eax 8010132c: 85 d2 test %edx,%edx 8010132e: 74 70 je 801013a0 <bmap+0xb0> bp = bread(ip->dev, addr); 80101330: 83 ec 08 sub $0x8,%esp 80101333: 52 push %edx 80101334: 50 push %eax 80101335: e8 96 ed ff ff call 801000d0 <bread> if((addr = a[bn]) == 0){ 8010133a: 8d 54 98 5c lea 0x5c(%eax,%ebx,4),%edx 8010133e: 83 c4 10 add $0x10,%esp bp = bread(ip->dev, addr); 80101341: 89 c7 mov %eax,%edi if((addr = a[bn]) == 0){ 80101343: 8b 1a mov (%edx),%ebx 80101345: 85 db test %ebx,%ebx 80101347: 75 1d jne 80101366 <bmap+0x76> a[bn] = addr = balloc(ip->dev); 80101349: 8b 06 mov (%esi),%eax 8010134b: 89 55 e4 mov %edx,-0x1c(%ebp) 8010134e: e8 bd fd ff ff call 80101110 <balloc> 80101353: 8b 55 e4 mov -0x1c(%ebp),%edx log_write(bp); 80101356: 83 ec 0c sub $0xc,%esp a[bn] = addr = balloc(ip->dev); 80101359: 89 c3 mov %eax,%ebx 8010135b: 89 02 mov %eax,(%edx) log_write(bp); 8010135d: 57 push %edi 8010135e: e8 2d 1b 00 00 call 80102e90 <log_write> 80101363: 83 c4 10 add $0x10,%esp brelse(bp); 80101366: 83 ec 0c sub $0xc,%esp 80101369: 57 push %edi 8010136a: e8 71 ee ff ff call 801001e0 <brelse> 8010136f: 83 c4 10 add $0x10,%esp } 80101372: 8d 65 f4 lea -0xc(%ebp),%esp 80101375: 89 d8 mov %ebx,%eax 80101377: 5b pop %ebx 80101378: 5e pop %esi 80101379: 5f pop %edi 8010137a: 5d pop %ebp 8010137b: c3 ret 8010137c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi ip->addrs[bn] = addr = balloc(ip->dev); 80101380: 8b 00 mov (%eax),%eax 80101382: e8 89 fd ff ff call 80101110 <balloc> 80101387: 89 47 5c mov %eax,0x5c(%edi) } 8010138a: 8d 65 f4 lea -0xc(%ebp),%esp ip->addrs[bn] = addr = balloc(ip->dev); 8010138d: 89 c3 mov %eax,%ebx } 8010138f: 89 d8 mov %ebx,%eax 80101391: 5b pop %ebx 80101392: 5e pop %esi 80101393: 5f pop %edi 80101394: 5d pop %ebp 80101395: c3 ret 80101396: 8d 76 00 lea 0x0(%esi),%esi 80101399: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi ip->addrs[NDIRECT] = addr = balloc(ip->dev); 801013a0: e8 6b fd ff ff call 80101110 <balloc> 801013a5: 89 c2 mov %eax,%edx 801013a7: 89 86 8c 00 00 00 mov %eax,0x8c(%esi) 801013ad: 8b 06 mov (%esi),%eax 801013af: e9 7c ff ff ff jmp 80101330 <bmap+0x40> panic("bmap: out of range"); 801013b4: 83 ec 0c sub $0xc,%esp 801013b7: 68 a5 71 10 80 push $0x801071a5 801013bc: e8 cf ef ff ff call 80100390 <panic> 801013c1: eb 0d jmp 801013d0 <readsb> 801013c3: 90 nop 801013c4: 90 nop 801013c5: 90 nop 801013c6: 90 nop 801013c7: 90 nop 801013c8: 90 nop 801013c9: 90 nop 801013ca: 90 nop 801013cb: 90 nop 801013cc: 90 nop 801013cd: 90 nop 801013ce: 90 nop 801013cf: 90 nop 801013d0 <readsb>: { 801013d0: 55 push %ebp 801013d1: 89 e5 mov %esp,%ebp 801013d3: 56 push %esi 801013d4: 53 push %ebx 801013d5: 8b 75 0c mov 0xc(%ebp),%esi bp = bread(dev, 1); 801013d8: 83 ec 08 sub $0x8,%esp 801013db: 6a 01 push $0x1 801013dd: ff 75 08 pushl 0x8(%ebp) 801013e0: e8 eb ec ff ff call 801000d0 <bread> 801013e5: 89 c3 mov %eax,%ebx memmove(sb, bp->data, sizeof(*sb)); 801013e7: 8d 40 5c lea 0x5c(%eax),%eax 801013ea: 83 c4 0c add $0xc,%esp 801013ed: 6a 1c push $0x1c 801013ef: 50 push %eax 801013f0: 56 push %esi 801013f1: e8 4a 32 00 00 call 80104640 <memmove> brelse(bp); 801013f6: 89 5d 08 mov %ebx,0x8(%ebp) 801013f9: 83 c4 10 add $0x10,%esp } 801013fc: 8d 65 f8 lea -0x8(%ebp),%esp 801013ff: 5b pop %ebx 80101400: 5e pop %esi 80101401: 5d pop %ebp brelse(bp); 80101402: e9 d9 ed ff ff jmp 801001e0 <brelse> 80101407: 89 f6 mov %esi,%esi 80101409: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101410 <bfree>: { 80101410: 55 push %ebp 80101411: 89 e5 mov %esp,%ebp 80101413: 56 push %esi 80101414: 53 push %ebx 80101415: 89 d3 mov %edx,%ebx 80101417: 89 c6 mov %eax,%esi readsb(dev, &sb); 80101419: 83 ec 08 sub $0x8,%esp 8010141c: 68 c0 09 11 80 push $0x801109c0 80101421: 50 push %eax 80101422: e8 a9 ff ff ff call 801013d0 <readsb> bp = bread(dev, BBLOCK(b, sb)); 80101427: 58 pop %eax 80101428: 5a pop %edx 80101429: 89 da mov %ebx,%edx 8010142b: c1 ea 0c shr $0xc,%edx 8010142e: 03 15 d8 09 11 80 add 0x801109d8,%edx 80101434: 52 push %edx 80101435: 56 push %esi 80101436: e8 95 ec ff ff call 801000d0 <bread> m = 1 << (bi % 8); 8010143b: 89 d9 mov %ebx,%ecx if((bp->data[bi/8] & m) == 0) 8010143d: c1 fb 03 sar $0x3,%ebx m = 1 << (bi % 8); 80101440: ba 01 00 00 00 mov $0x1,%edx 80101445: 83 e1 07 and $0x7,%ecx if((bp->data[bi/8] & m) == 0) 80101448: 81 e3 ff 01 00 00 and $0x1ff,%ebx 8010144e: 83 c4 10 add $0x10,%esp m = 1 << (bi % 8); 80101451: d3 e2 shl %cl,%edx if((bp->data[bi/8] & m) == 0) 80101453: 0f b6 4c 18 5c movzbl 0x5c(%eax,%ebx,1),%ecx 80101458: 85 d1 test %edx,%ecx 8010145a: 74 25 je 80101481 <bfree+0x71> bp->data[bi/8] &= ~m; 8010145c: f7 d2 not %edx 8010145e: 89 c6 mov %eax,%esi log_write(bp); 80101460: 83 ec 0c sub $0xc,%esp bp->data[bi/8] &= ~m; 80101463: 21 ca and %ecx,%edx 80101465: 88 54 1e 5c mov %dl,0x5c(%esi,%ebx,1) log_write(bp); 80101469: 56 push %esi 8010146a: e8 21 1a 00 00 call 80102e90 <log_write> brelse(bp); 8010146f: 89 34 24 mov %esi,(%esp) 80101472: e8 69 ed ff ff call 801001e0 <brelse> } 80101477: 83 c4 10 add $0x10,%esp 8010147a: 8d 65 f8 lea -0x8(%ebp),%esp 8010147d: 5b pop %ebx 8010147e: 5e pop %esi 8010147f: 5d pop %ebp 80101480: c3 ret panic("freeing free block"); 80101481: 83 ec 0c sub $0xc,%esp 80101484: 68 b8 71 10 80 push $0x801071b8 80101489: e8 02 ef ff ff call 80100390 <panic> 8010148e: 66 90 xchg %ax,%ax 80101490 <iinit>: { 80101490: 55 push %ebp 80101491: 89 e5 mov %esp,%ebp 80101493: 53 push %ebx 80101494: bb 20 0a 11 80 mov $0x80110a20,%ebx 80101499: 83 ec 0c sub $0xc,%esp initlock(&icache.lock, "icache"); 8010149c: 68 cb 71 10 80 push $0x801071cb 801014a1: 68 e0 09 11 80 push $0x801109e0 801014a6: e8 95 2e 00 00 call 80104340 <initlock> 801014ab: 83 c4 10 add $0x10,%esp 801014ae: 66 90 xchg %ax,%ax initsleeplock(&icache.inode[i].lock, "inode"); 801014b0: 83 ec 08 sub $0x8,%esp 801014b3: 68 d2 71 10 80 push $0x801071d2 801014b8: 53 push %ebx 801014b9: 81 c3 90 00 00 00 add $0x90,%ebx 801014bf: e8 4c 2d 00 00 call 80104210 <initsleeplock> for(i = 0; i < NINODE; i++) { 801014c4: 83 c4 10 add $0x10,%esp 801014c7: 81 fb 40 26 11 80 cmp $0x80112640,%ebx 801014cd: 75 e1 jne 801014b0 <iinit+0x20> readsb(dev, &sb); 801014cf: 83 ec 08 sub $0x8,%esp 801014d2: 68 c0 09 11 80 push $0x801109c0 801014d7: ff 75 08 pushl 0x8(%ebp) 801014da: e8 f1 fe ff ff call 801013d0 <readsb> cprintf("sb: size %d nblocks %d ninodes %d nlog %d logstart %d\ 801014df: ff 35 d8 09 11 80 pushl 0x801109d8 801014e5: ff 35 d4 09 11 80 pushl 0x801109d4 801014eb: ff 35 d0 09 11 80 pushl 0x801109d0 801014f1: ff 35 cc 09 11 80 pushl 0x801109cc 801014f7: ff 35 c8 09 11 80 pushl 0x801109c8 801014fd: ff 35 c4 09 11 80 pushl 0x801109c4 80101503: ff 35 c0 09 11 80 pushl 0x801109c0 80101509: 68 54 72 10 80 push $0x80107254 8010150e: e8 4d f1 ff ff call 80100660 <cprintf> } 80101513: 83 c4 30 add $0x30,%esp 80101516: 8b 5d fc mov -0x4(%ebp),%ebx 80101519: c9 leave 8010151a: c3 ret 8010151b: 90 nop 8010151c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101520 <ialloc>: { 80101520: 55 push %ebp 80101521: 89 e5 mov %esp,%ebp 80101523: 57 push %edi 80101524: 56 push %esi 80101525: 53 push %ebx 80101526: 83 ec 1c sub $0x1c,%esp for(inum = 1; inum < sb.ninodes; inum++){ 80101529: 83 3d c8 09 11 80 01 cmpl $0x1,0x801109c8 { 80101530: 8b 45 0c mov 0xc(%ebp),%eax 80101533: 8b 75 08 mov 0x8(%ebp),%esi 80101536: 89 45 e4 mov %eax,-0x1c(%ebp) for(inum = 1; inum < sb.ninodes; inum++){ 80101539: 0f 86 91 00 00 00 jbe 801015d0 <ialloc+0xb0> 8010153f: bb 01 00 00 00 mov $0x1,%ebx 80101544: eb 21 jmp 80101567 <ialloc+0x47> 80101546: 8d 76 00 lea 0x0(%esi),%esi 80101549: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi brelse(bp); 80101550: 83 ec 0c sub $0xc,%esp for(inum = 1; inum < sb.ninodes; inum++){ 80101553: 83 c3 01 add $0x1,%ebx brelse(bp); 80101556: 57 push %edi 80101557: e8 84 ec ff ff call 801001e0 <brelse> for(inum = 1; inum < sb.ninodes; inum++){ 8010155c: 83 c4 10 add $0x10,%esp 8010155f: 39 1d c8 09 11 80 cmp %ebx,0x801109c8 80101565: 76 69 jbe 801015d0 <ialloc+0xb0> bp = bread(dev, IBLOCK(inum, sb)); 80101567: 89 d8 mov %ebx,%eax 80101569: 83 ec 08 sub $0x8,%esp 8010156c: c1 e8 03 shr $0x3,%eax 8010156f: 03 05 d4 09 11 80 add 0x801109d4,%eax 80101575: 50 push %eax 80101576: 56 push %esi 80101577: e8 54 eb ff ff call 801000d0 <bread> 8010157c: 89 c7 mov %eax,%edi dip = (struct dinode*)bp->data + inum%IPB; 8010157e: 89 d8 mov %ebx,%eax if(dip->type == 0){ // a free inode 80101580: 83 c4 10 add $0x10,%esp dip = (struct dinode*)bp->data + inum%IPB; 80101583: 83 e0 07 and $0x7,%eax 80101586: c1 e0 06 shl $0x6,%eax 80101589: 8d 4c 07 5c lea 0x5c(%edi,%eax,1),%ecx if(dip->type == 0){ // a free inode 8010158d: 66 83 39 00 cmpw $0x0,(%ecx) 80101591: 75 bd jne 80101550 <ialloc+0x30> memset(dip, 0, sizeof(*dip)); 80101593: 83 ec 04 sub $0x4,%esp 80101596: 89 4d e0 mov %ecx,-0x20(%ebp) 80101599: 6a 40 push $0x40 8010159b: 6a 00 push $0x0 8010159d: 51 push %ecx 8010159e: e8 ed 2f 00 00 call 80104590 <memset> dip->type = type; 801015a3: 0f b7 45 e4 movzwl -0x1c(%ebp),%eax 801015a7: 8b 4d e0 mov -0x20(%ebp),%ecx 801015aa: 66 89 01 mov %ax,(%ecx) log_write(bp); // mark it allocated on the disk 801015ad: 89 3c 24 mov %edi,(%esp) 801015b0: e8 db 18 00 00 call 80102e90 <log_write> brelse(bp); 801015b5: 89 3c 24 mov %edi,(%esp) 801015b8: e8 23 ec ff ff call 801001e0 <brelse> return iget(dev, inum); 801015bd: 83 c4 10 add $0x10,%esp } 801015c0: 8d 65 f4 lea -0xc(%ebp),%esp return iget(dev, inum); 801015c3: 89 da mov %ebx,%edx 801015c5: 89 f0 mov %esi,%eax } 801015c7: 5b pop %ebx 801015c8: 5e pop %esi 801015c9: 5f pop %edi 801015ca: 5d pop %ebp return iget(dev, inum); 801015cb: e9 50 fc ff ff jmp 80101220 <iget> panic("ialloc: no inodes"); 801015d0: 83 ec 0c sub $0xc,%esp 801015d3: 68 d8 71 10 80 push $0x801071d8 801015d8: e8 b3 ed ff ff call 80100390 <panic> 801015dd: 8d 76 00 lea 0x0(%esi),%esi 801015e0 <iupdate>: { 801015e0: 55 push %ebp 801015e1: 89 e5 mov %esp,%ebp 801015e3: 56 push %esi 801015e4: 53 push %ebx 801015e5: 8b 5d 08 mov 0x8(%ebp),%ebx bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 801015e8: 83 ec 08 sub $0x8,%esp 801015eb: 8b 43 04 mov 0x4(%ebx),%eax memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 801015ee: 83 c3 5c add $0x5c,%ebx bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 801015f1: c1 e8 03 shr $0x3,%eax 801015f4: 03 05 d4 09 11 80 add 0x801109d4,%eax 801015fa: 50 push %eax 801015fb: ff 73 a4 pushl -0x5c(%ebx) 801015fe: e8 cd ea ff ff call 801000d0 <bread> 80101603: 89 c6 mov %eax,%esi dip = (struct dinode*)bp->data + ip->inum%IPB; 80101605: 8b 43 a8 mov -0x58(%ebx),%eax dip->type = ip->type; 80101608: 0f b7 53 f4 movzwl -0xc(%ebx),%edx memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 8010160c: 83 c4 0c add $0xc,%esp dip = (struct dinode*)bp->data + ip->inum%IPB; 8010160f: 83 e0 07 and $0x7,%eax 80101612: c1 e0 06 shl $0x6,%eax 80101615: 8d 44 06 5c lea 0x5c(%esi,%eax,1),%eax dip->type = ip->type; 80101619: 66 89 10 mov %dx,(%eax) dip->major = ip->major; 8010161c: 0f b7 53 f6 movzwl -0xa(%ebx),%edx memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 80101620: 83 c0 0c add $0xc,%eax dip->major = ip->major; 80101623: 66 89 50 f6 mov %dx,-0xa(%eax) dip->minor = ip->minor; 80101627: 0f b7 53 f8 movzwl -0x8(%ebx),%edx 8010162b: 66 89 50 f8 mov %dx,-0x8(%eax) dip->nlink = ip->nlink; 8010162f: 0f b7 53 fa movzwl -0x6(%ebx),%edx 80101633: 66 89 50 fa mov %dx,-0x6(%eax) dip->size = ip->size; 80101637: 8b 53 fc mov -0x4(%ebx),%edx 8010163a: 89 50 fc mov %edx,-0x4(%eax) memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 8010163d: 6a 34 push $0x34 8010163f: 53 push %ebx 80101640: 50 push %eax 80101641: e8 fa 2f 00 00 call 80104640 <memmove> log_write(bp); 80101646: 89 34 24 mov %esi,(%esp) 80101649: e8 42 18 00 00 call 80102e90 <log_write> brelse(bp); 8010164e: 89 75 08 mov %esi,0x8(%ebp) 80101651: 83 c4 10 add $0x10,%esp } 80101654: 8d 65 f8 lea -0x8(%ebp),%esp 80101657: 5b pop %ebx 80101658: 5e pop %esi 80101659: 5d pop %ebp brelse(bp); 8010165a: e9 81 eb ff ff jmp 801001e0 <brelse> 8010165f: 90 nop 80101660 <idup>: { 80101660: 55 push %ebp 80101661: 89 e5 mov %esp,%ebp 80101663: 53 push %ebx 80101664: 83 ec 10 sub $0x10,%esp 80101667: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&icache.lock); 8010166a: 68 e0 09 11 80 push $0x801109e0 8010166f: e8 0c 2e 00 00 call 80104480 <acquire> ip->ref++; 80101674: 83 43 08 01 addl $0x1,0x8(%ebx) release(&icache.lock); 80101678: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp) 8010167f: e8 bc 2e 00 00 call 80104540 <release> } 80101684: 89 d8 mov %ebx,%eax 80101686: 8b 5d fc mov -0x4(%ebp),%ebx 80101689: c9 leave 8010168a: c3 ret 8010168b: 90 nop 8010168c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101690 <ilock>: { 80101690: 55 push %ebp 80101691: 89 e5 mov %esp,%ebp 80101693: 56 push %esi 80101694: 53 push %ebx 80101695: 8b 5d 08 mov 0x8(%ebp),%ebx if(ip == 0 || ip->ref < 1) 80101698: 85 db test %ebx,%ebx 8010169a: 0f 84 b7 00 00 00 je 80101757 <ilock+0xc7> 801016a0: 8b 53 08 mov 0x8(%ebx),%edx 801016a3: 85 d2 test %edx,%edx 801016a5: 0f 8e ac 00 00 00 jle 80101757 <ilock+0xc7> acquiresleep(&ip->lock); 801016ab: 8d 43 0c lea 0xc(%ebx),%eax 801016ae: 83 ec 0c sub $0xc,%esp 801016b1: 50 push %eax 801016b2: e8 99 2b 00 00 call 80104250 <acquiresleep> if(ip->valid == 0){ 801016b7: 8b 43 4c mov 0x4c(%ebx),%eax 801016ba: 83 c4 10 add $0x10,%esp 801016bd: 85 c0 test %eax,%eax 801016bf: 74 0f je 801016d0 <ilock+0x40> } 801016c1: 8d 65 f8 lea -0x8(%ebp),%esp 801016c4: 5b pop %ebx 801016c5: 5e pop %esi 801016c6: 5d pop %ebp 801016c7: c3 ret 801016c8: 90 nop 801016c9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 801016d0: 8b 43 04 mov 0x4(%ebx),%eax 801016d3: 83 ec 08 sub $0x8,%esp 801016d6: c1 e8 03 shr $0x3,%eax 801016d9: 03 05 d4 09 11 80 add 0x801109d4,%eax 801016df: 50 push %eax 801016e0: ff 33 pushl (%ebx) 801016e2: e8 e9 e9 ff ff call 801000d0 <bread> 801016e7: 89 c6 mov %eax,%esi dip = (struct dinode*)bp->data + ip->inum%IPB; 801016e9: 8b 43 04 mov 0x4(%ebx),%eax memmove(ip->addrs, dip->addrs, sizeof(ip->addrs)); 801016ec: 83 c4 0c add $0xc,%esp dip = (struct dinode*)bp->data + ip->inum%IPB; 801016ef: 83 e0 07 and $0x7,%eax 801016f2: c1 e0 06 shl $0x6,%eax 801016f5: 8d 44 06 5c lea 0x5c(%esi,%eax,1),%eax ip->type = dip->type; 801016f9: 0f b7 10 movzwl (%eax),%edx memmove(ip->addrs, dip->addrs, sizeof(ip->addrs)); 801016fc: 83 c0 0c add $0xc,%eax ip->type = dip->type; 801016ff: 66 89 53 50 mov %dx,0x50(%ebx) ip->major = dip->major; 80101703: 0f b7 50 f6 movzwl -0xa(%eax),%edx 80101707: 66 89 53 52 mov %dx,0x52(%ebx) ip->minor = dip->minor; 8010170b: 0f b7 50 f8 movzwl -0x8(%eax),%edx 8010170f: 66 89 53 54 mov %dx,0x54(%ebx) ip->nlink = dip->nlink; 80101713: 0f b7 50 fa movzwl -0x6(%eax),%edx 80101717: 66 89 53 56 mov %dx,0x56(%ebx) ip->size = dip->size; 8010171b: 8b 50 fc mov -0x4(%eax),%edx 8010171e: 89 53 58 mov %edx,0x58(%ebx) memmove(ip->addrs, dip->addrs, sizeof(ip->addrs)); 80101721: 6a 34 push $0x34 80101723: 50 push %eax 80101724: 8d 43 5c lea 0x5c(%ebx),%eax 80101727: 50 push %eax 80101728: e8 13 2f 00 00 call 80104640 <memmove> brelse(bp); 8010172d: 89 34 24 mov %esi,(%esp) 80101730: e8 ab ea ff ff call 801001e0 <brelse> if(ip->type == 0) 80101735: 83 c4 10 add $0x10,%esp 80101738: 66 83 7b 50 00 cmpw $0x0,0x50(%ebx) ip->valid = 1; 8010173d: c7 43 4c 01 00 00 00 movl $0x1,0x4c(%ebx) if(ip->type == 0) 80101744: 0f 85 77 ff ff ff jne 801016c1 <ilock+0x31> panic("ilock: no type"); 8010174a: 83 ec 0c sub $0xc,%esp 8010174d: 68 f0 71 10 80 push $0x801071f0 80101752: e8 39 ec ff ff call 80100390 <panic> panic("ilock"); 80101757: 83 ec 0c sub $0xc,%esp 8010175a: 68 ea 71 10 80 push $0x801071ea 8010175f: e8 2c ec ff ff call 80100390 <panic> 80101764: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010176a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80101770 <iunlock>: { 80101770: 55 push %ebp 80101771: 89 e5 mov %esp,%ebp 80101773: 56 push %esi 80101774: 53 push %ebx 80101775: 8b 5d 08 mov 0x8(%ebp),%ebx if(ip == 0 || !holdingsleep(&ip->lock) || ip->ref < 1) 80101778: 85 db test %ebx,%ebx 8010177a: 74 28 je 801017a4 <iunlock+0x34> 8010177c: 8d 73 0c lea 0xc(%ebx),%esi 8010177f: 83 ec 0c sub $0xc,%esp 80101782: 56 push %esi 80101783: e8 68 2b 00 00 call 801042f0 <holdingsleep> 80101788: 83 c4 10 add $0x10,%esp 8010178b: 85 c0 test %eax,%eax 8010178d: 74 15 je 801017a4 <iunlock+0x34> 8010178f: 8b 43 08 mov 0x8(%ebx),%eax 80101792: 85 c0 test %eax,%eax 80101794: 7e 0e jle 801017a4 <iunlock+0x34> releasesleep(&ip->lock); 80101796: 89 75 08 mov %esi,0x8(%ebp) } 80101799: 8d 65 f8 lea -0x8(%ebp),%esp 8010179c: 5b pop %ebx 8010179d: 5e pop %esi 8010179e: 5d pop %ebp releasesleep(&ip->lock); 8010179f: e9 0c 2b 00 00 jmp 801042b0 <releasesleep> panic("iunlock"); 801017a4: 83 ec 0c sub $0xc,%esp 801017a7: 68 ff 71 10 80 push $0x801071ff 801017ac: e8 df eb ff ff call 80100390 <panic> 801017b1: eb 0d jmp 801017c0 <iput> 801017b3: 90 nop 801017b4: 90 nop 801017b5: 90 nop 801017b6: 90 nop 801017b7: 90 nop 801017b8: 90 nop 801017b9: 90 nop 801017ba: 90 nop 801017bb: 90 nop 801017bc: 90 nop 801017bd: 90 nop 801017be: 90 nop 801017bf: 90 nop 801017c0 <iput>: { 801017c0: 55 push %ebp 801017c1: 89 e5 mov %esp,%ebp 801017c3: 57 push %edi 801017c4: 56 push %esi 801017c5: 53 push %ebx 801017c6: 83 ec 28 sub $0x28,%esp 801017c9: 8b 5d 08 mov 0x8(%ebp),%ebx acquiresleep(&ip->lock); 801017cc: 8d 7b 0c lea 0xc(%ebx),%edi 801017cf: 57 push %edi 801017d0: e8 7b 2a 00 00 call 80104250 <acquiresleep> if(ip->valid && ip->nlink == 0){ 801017d5: 8b 53 4c mov 0x4c(%ebx),%edx 801017d8: 83 c4 10 add $0x10,%esp 801017db: 85 d2 test %edx,%edx 801017dd: 74 07 je 801017e6 <iput+0x26> 801017df: 66 83 7b 56 00 cmpw $0x0,0x56(%ebx) 801017e4: 74 32 je 80101818 <iput+0x58> releasesleep(&ip->lock); 801017e6: 83 ec 0c sub $0xc,%esp 801017e9: 57 push %edi 801017ea: e8 c1 2a 00 00 call 801042b0 <releasesleep> acquire(&icache.lock); 801017ef: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp) 801017f6: e8 85 2c 00 00 call 80104480 <acquire> ip->ref--; 801017fb: 83 6b 08 01 subl $0x1,0x8(%ebx) release(&icache.lock); 801017ff: 83 c4 10 add $0x10,%esp 80101802: c7 45 08 e0 09 11 80 movl $0x801109e0,0x8(%ebp) } 80101809: 8d 65 f4 lea -0xc(%ebp),%esp 8010180c: 5b pop %ebx 8010180d: 5e pop %esi 8010180e: 5f pop %edi 8010180f: 5d pop %ebp release(&icache.lock); 80101810: e9 2b 2d 00 00 jmp 80104540 <release> 80101815: 8d 76 00 lea 0x0(%esi),%esi acquire(&icache.lock); 80101818: 83 ec 0c sub $0xc,%esp 8010181b: 68 e0 09 11 80 push $0x801109e0 80101820: e8 5b 2c 00 00 call 80104480 <acquire> int r = ip->ref; 80101825: 8b 73 08 mov 0x8(%ebx),%esi release(&icache.lock); 80101828: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp) 8010182f: e8 0c 2d 00 00 call 80104540 <release> if(r == 1){ 80101834: 83 c4 10 add $0x10,%esp 80101837: 83 fe 01 cmp $0x1,%esi 8010183a: 75 aa jne 801017e6 <iput+0x26> 8010183c: 8d 8b 8c 00 00 00 lea 0x8c(%ebx),%ecx 80101842: 89 7d e4 mov %edi,-0x1c(%ebp) 80101845: 8d 73 5c lea 0x5c(%ebx),%esi 80101848: 89 cf mov %ecx,%edi 8010184a: eb 0b jmp 80101857 <iput+0x97> 8010184c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101850: 83 c6 04 add $0x4,%esi { int i, j; struct buf *bp; uint *a; for(i = 0; i < NDIRECT; i++){ 80101853: 39 fe cmp %edi,%esi 80101855: 74 19 je 80101870 <iput+0xb0> if(ip->addrs[i]){ 80101857: 8b 16 mov (%esi),%edx 80101859: 85 d2 test %edx,%edx 8010185b: 74 f3 je 80101850 <iput+0x90> bfree(ip->dev, ip->addrs[i]); 8010185d: 8b 03 mov (%ebx),%eax 8010185f: e8 ac fb ff ff call 80101410 <bfree> ip->addrs[i] = 0; 80101864: c7 06 00 00 00 00 movl $0x0,(%esi) 8010186a: eb e4 jmp 80101850 <iput+0x90> 8010186c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi } } if(ip->addrs[NDIRECT]){ 80101870: 8b 83 8c 00 00 00 mov 0x8c(%ebx),%eax 80101876: 8b 7d e4 mov -0x1c(%ebp),%edi 80101879: 85 c0 test %eax,%eax 8010187b: 75 33 jne 801018b0 <iput+0xf0> bfree(ip->dev, ip->addrs[NDIRECT]); ip->addrs[NDIRECT] = 0; } ip->size = 0; iupdate(ip); 8010187d: 83 ec 0c sub $0xc,%esp ip->size = 0; 80101880: c7 43 58 00 00 00 00 movl $0x0,0x58(%ebx) iupdate(ip); 80101887: 53 push %ebx 80101888: e8 53 fd ff ff call 801015e0 <iupdate> ip->type = 0; 8010188d: 31 c0 xor %eax,%eax 8010188f: 66 89 43 50 mov %ax,0x50(%ebx) iupdate(ip); 80101893: 89 1c 24 mov %ebx,(%esp) 80101896: e8 45 fd ff ff call 801015e0 <iupdate> ip->valid = 0; 8010189b: c7 43 4c 00 00 00 00 movl $0x0,0x4c(%ebx) 801018a2: 83 c4 10 add $0x10,%esp 801018a5: e9 3c ff ff ff jmp 801017e6 <iput+0x26> 801018aa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi bp = bread(ip->dev, ip->addrs[NDIRECT]); 801018b0: 83 ec 08 sub $0x8,%esp 801018b3: 50 push %eax 801018b4: ff 33 pushl (%ebx) 801018b6: e8 15 e8 ff ff call 801000d0 <bread> 801018bb: 8d 88 5c 02 00 00 lea 0x25c(%eax),%ecx 801018c1: 89 7d e0 mov %edi,-0x20(%ebp) 801018c4: 89 45 e4 mov %eax,-0x1c(%ebp) a = (uint*)bp->data; 801018c7: 8d 70 5c lea 0x5c(%eax),%esi 801018ca: 83 c4 10 add $0x10,%esp 801018cd: 89 cf mov %ecx,%edi 801018cf: eb 0e jmp 801018df <iput+0x11f> 801018d1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801018d8: 83 c6 04 add $0x4,%esi for(j = 0; j < NINDIRECT; j++){ 801018db: 39 fe cmp %edi,%esi 801018dd: 74 0f je 801018ee <iput+0x12e> if(a[j]) 801018df: 8b 16 mov (%esi),%edx 801018e1: 85 d2 test %edx,%edx 801018e3: 74 f3 je 801018d8 <iput+0x118> bfree(ip->dev, a[j]); 801018e5: 8b 03 mov (%ebx),%eax 801018e7: e8 24 fb ff ff call 80101410 <bfree> 801018ec: eb ea jmp 801018d8 <iput+0x118> brelse(bp); 801018ee: 83 ec 0c sub $0xc,%esp 801018f1: ff 75 e4 pushl -0x1c(%ebp) 801018f4: 8b 7d e0 mov -0x20(%ebp),%edi 801018f7: e8 e4 e8 ff ff call 801001e0 <brelse> bfree(ip->dev, ip->addrs[NDIRECT]); 801018fc: 8b 93 8c 00 00 00 mov 0x8c(%ebx),%edx 80101902: 8b 03 mov (%ebx),%eax 80101904: e8 07 fb ff ff call 80101410 <bfree> ip->addrs[NDIRECT] = 0; 80101909: c7 83 8c 00 00 00 00 movl $0x0,0x8c(%ebx) 80101910: 00 00 00 80101913: 83 c4 10 add $0x10,%esp 80101916: e9 62 ff ff ff jmp 8010187d <iput+0xbd> 8010191b: 90 nop 8010191c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101920 <iunlockput>: { 80101920: 55 push %ebp 80101921: 89 e5 mov %esp,%ebp 80101923: 53 push %ebx 80101924: 83 ec 10 sub $0x10,%esp 80101927: 8b 5d 08 mov 0x8(%ebp),%ebx iunlock(ip); 8010192a: 53 push %ebx 8010192b: e8 40 fe ff ff call 80101770 <iunlock> iput(ip); 80101930: 89 5d 08 mov %ebx,0x8(%ebp) 80101933: 83 c4 10 add $0x10,%esp } 80101936: 8b 5d fc mov -0x4(%ebp),%ebx 80101939: c9 leave iput(ip); 8010193a: e9 81 fe ff ff jmp 801017c0 <iput> 8010193f: 90 nop 80101940 <stati>: // Copy stat information from inode. // Caller must hold ip->lock. void stati(struct inode *ip, struct stat *st) { 80101940: 55 push %ebp 80101941: 89 e5 mov %esp,%ebp 80101943: 8b 55 08 mov 0x8(%ebp),%edx 80101946: 8b 45 0c mov 0xc(%ebp),%eax st->dev = ip->dev; 80101949: 8b 0a mov (%edx),%ecx 8010194b: 89 48 04 mov %ecx,0x4(%eax) st->ino = ip->inum; 8010194e: 8b 4a 04 mov 0x4(%edx),%ecx 80101951: 89 48 08 mov %ecx,0x8(%eax) st->type = ip->type; 80101954: 0f b7 4a 50 movzwl 0x50(%edx),%ecx 80101958: 66 89 08 mov %cx,(%eax) st->nlink = ip->nlink; 8010195b: 0f b7 4a 56 movzwl 0x56(%edx),%ecx 8010195f: 66 89 48 0c mov %cx,0xc(%eax) st->size = ip->size; 80101963: 8b 52 58 mov 0x58(%edx),%edx 80101966: 89 50 10 mov %edx,0x10(%eax) } 80101969: 5d pop %ebp 8010196a: c3 ret 8010196b: 90 nop 8010196c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101970 <readi>: //PAGEBREAK! // Read data from inode. // Caller must hold ip->lock. int readi(struct inode *ip, char *dst, uint off, uint n) { 80101970: 55 push %ebp 80101971: 89 e5 mov %esp,%ebp 80101973: 57 push %edi 80101974: 56 push %esi 80101975: 53 push %ebx 80101976: 83 ec 1c sub $0x1c,%esp 80101979: 8b 45 08 mov 0x8(%ebp),%eax 8010197c: 8b 75 0c mov 0xc(%ebp),%esi 8010197f: 8b 7d 14 mov 0x14(%ebp),%edi uint tot, m; struct buf *bp; if(ip->type == T_DEV){ 80101982: 66 83 78 50 03 cmpw $0x3,0x50(%eax) { 80101987: 89 75 e0 mov %esi,-0x20(%ebp) 8010198a: 89 45 d8 mov %eax,-0x28(%ebp) 8010198d: 8b 75 10 mov 0x10(%ebp),%esi 80101990: 89 7d e4 mov %edi,-0x1c(%ebp) if(ip->type == T_DEV){ 80101993: 0f 84 a7 00 00 00 je 80101a40 <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) 80101999: 8b 45 d8 mov -0x28(%ebp),%eax 8010199c: 8b 40 58 mov 0x58(%eax),%eax 8010199f: 39 c6 cmp %eax,%esi 801019a1: 0f 87 ba 00 00 00 ja 80101a61 <readi+0xf1> 801019a7: 8b 7d e4 mov -0x1c(%ebp),%edi 801019aa: 89 f9 mov %edi,%ecx 801019ac: 01 f1 add %esi,%ecx 801019ae: 0f 82 ad 00 00 00 jb 80101a61 <readi+0xf1> return -1; if(off + n > ip->size) n = ip->size - off; 801019b4: 89 c2 mov %eax,%edx 801019b6: 29 f2 sub %esi,%edx 801019b8: 39 c8 cmp %ecx,%eax 801019ba: 0f 43 d7 cmovae %edi,%edx for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 801019bd: 31 ff xor %edi,%edi 801019bf: 85 d2 test %edx,%edx n = ip->size - off; 801019c1: 89 55 e4 mov %edx,-0x1c(%ebp) for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 801019c4: 74 6c je 80101a32 <readi+0xc2> 801019c6: 8d 76 00 lea 0x0(%esi),%esi 801019c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi bp = bread(ip->dev, bmap(ip, off/BSIZE)); 801019d0: 8b 5d d8 mov -0x28(%ebp),%ebx 801019d3: 89 f2 mov %esi,%edx 801019d5: c1 ea 09 shr $0x9,%edx 801019d8: 89 d8 mov %ebx,%eax 801019da: e8 11 f9 ff ff call 801012f0 <bmap> 801019df: 83 ec 08 sub $0x8,%esp 801019e2: 50 push %eax 801019e3: ff 33 pushl (%ebx) 801019e5: e8 e6 e6 ff ff call 801000d0 <bread> m = min(n - tot, BSIZE - off%BSIZE); 801019ea: 8b 5d e4 mov -0x1c(%ebp),%ebx bp = bread(ip->dev, bmap(ip, off/BSIZE)); 801019ed: 89 c2 mov %eax,%edx m = min(n - tot, BSIZE - off%BSIZE); 801019ef: 89 f0 mov %esi,%eax 801019f1: 25 ff 01 00 00 and $0x1ff,%eax 801019f6: b9 00 02 00 00 mov $0x200,%ecx 801019fb: 83 c4 0c add $0xc,%esp 801019fe: 29 c1 sub %eax,%ecx memmove(dst, bp->data + off%BSIZE, m); 80101a00: 8d 44 02 5c lea 0x5c(%edx,%eax,1),%eax 80101a04: 89 55 dc mov %edx,-0x24(%ebp) m = min(n - tot, BSIZE - off%BSIZE); 80101a07: 29 fb sub %edi,%ebx 80101a09: 39 d9 cmp %ebx,%ecx 80101a0b: 0f 46 d9 cmovbe %ecx,%ebx memmove(dst, bp->data + off%BSIZE, m); 80101a0e: 53 push %ebx 80101a0f: 50 push %eax for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 80101a10: 01 df add %ebx,%edi memmove(dst, bp->data + off%BSIZE, m); 80101a12: ff 75 e0 pushl -0x20(%ebp) for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 80101a15: 01 de add %ebx,%esi memmove(dst, bp->data + off%BSIZE, m); 80101a17: e8 24 2c 00 00 call 80104640 <memmove> brelse(bp); 80101a1c: 8b 55 dc mov -0x24(%ebp),%edx 80101a1f: 89 14 24 mov %edx,(%esp) 80101a22: e8 b9 e7 ff ff call 801001e0 <brelse> for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 80101a27: 01 5d e0 add %ebx,-0x20(%ebp) 80101a2a: 83 c4 10 add $0x10,%esp 80101a2d: 39 7d e4 cmp %edi,-0x1c(%ebp) 80101a30: 77 9e ja 801019d0 <readi+0x60> } return n; 80101a32: 8b 45 e4 mov -0x1c(%ebp),%eax } 80101a35: 8d 65 f4 lea -0xc(%ebp),%esp 80101a38: 5b pop %ebx 80101a39: 5e pop %esi 80101a3a: 5f pop %edi 80101a3b: 5d pop %ebp 80101a3c: c3 ret 80101a3d: 8d 76 00 lea 0x0(%esi),%esi if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read) 80101a40: 0f bf 40 52 movswl 0x52(%eax),%eax 80101a44: 66 83 f8 09 cmp $0x9,%ax 80101a48: 77 17 ja 80101a61 <readi+0xf1> 80101a4a: 8b 04 c5 60 09 11 80 mov -0x7feef6a0(,%eax,8),%eax 80101a51: 85 c0 test %eax,%eax 80101a53: 74 0c je 80101a61 <readi+0xf1> return devsw[ip->major].read(ip, dst, n); 80101a55: 89 7d 10 mov %edi,0x10(%ebp) } 80101a58: 8d 65 f4 lea -0xc(%ebp),%esp 80101a5b: 5b pop %ebx 80101a5c: 5e pop %esi 80101a5d: 5f pop %edi 80101a5e: 5d pop %ebp return devsw[ip->major].read(ip, dst, n); 80101a5f: ff e0 jmp *%eax return -1; 80101a61: b8 ff ff ff ff mov $0xffffffff,%eax 80101a66: eb cd jmp 80101a35 <readi+0xc5> 80101a68: 90 nop 80101a69: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80101a70 <writei>: // PAGEBREAK! // Write data to inode. // Caller must hold ip->lock. int writei(struct inode *ip, char *src, uint off, uint n) { 80101a70: 55 push %ebp 80101a71: 89 e5 mov %esp,%ebp 80101a73: 57 push %edi 80101a74: 56 push %esi 80101a75: 53 push %ebx 80101a76: 83 ec 1c sub $0x1c,%esp 80101a79: 8b 45 08 mov 0x8(%ebp),%eax 80101a7c: 8b 75 0c mov 0xc(%ebp),%esi 80101a7f: 8b 7d 14 mov 0x14(%ebp),%edi uint tot, m; struct buf *bp; if(ip->type == T_DEV){ 80101a82: 66 83 78 50 03 cmpw $0x3,0x50(%eax) { 80101a87: 89 75 dc mov %esi,-0x24(%ebp) 80101a8a: 89 45 d8 mov %eax,-0x28(%ebp) 80101a8d: 8b 75 10 mov 0x10(%ebp),%esi 80101a90: 89 7d e0 mov %edi,-0x20(%ebp) if(ip->type == T_DEV){ 80101a93: 0f 84 b7 00 00 00 je 80101b50 <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) 80101a99: 8b 45 d8 mov -0x28(%ebp),%eax 80101a9c: 39 70 58 cmp %esi,0x58(%eax) 80101a9f: 0f 82 eb 00 00 00 jb 80101b90 <writei+0x120> 80101aa5: 8b 7d e0 mov -0x20(%ebp),%edi 80101aa8: 31 d2 xor %edx,%edx 80101aaa: 89 f8 mov %edi,%eax 80101aac: 01 f0 add %esi,%eax 80101aae: 0f 92 c2 setb %dl return -1; if(off + n > MAXFILE*BSIZE) 80101ab1: 3d 00 18 01 00 cmp $0x11800,%eax 80101ab6: 0f 87 d4 00 00 00 ja 80101b90 <writei+0x120> 80101abc: 85 d2 test %edx,%edx 80101abe: 0f 85 cc 00 00 00 jne 80101b90 <writei+0x120> return -1; for(tot=0; tot<n; tot+=m, off+=m, src+=m){ 80101ac4: 85 ff test %edi,%edi 80101ac6: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp) 80101acd: 74 72 je 80101b41 <writei+0xd1> 80101acf: 90 nop bp = bread(ip->dev, bmap(ip, off/BSIZE)); 80101ad0: 8b 7d d8 mov -0x28(%ebp),%edi 80101ad3: 89 f2 mov %esi,%edx 80101ad5: c1 ea 09 shr $0x9,%edx 80101ad8: 89 f8 mov %edi,%eax 80101ada: e8 11 f8 ff ff call 801012f0 <bmap> 80101adf: 83 ec 08 sub $0x8,%esp 80101ae2: 50 push %eax 80101ae3: ff 37 pushl (%edi) 80101ae5: e8 e6 e5 ff ff call 801000d0 <bread> m = min(n - tot, BSIZE - off%BSIZE); 80101aea: 8b 5d e0 mov -0x20(%ebp),%ebx 80101aed: 2b 5d e4 sub -0x1c(%ebp),%ebx bp = bread(ip->dev, bmap(ip, off/BSIZE)); 80101af0: 89 c7 mov %eax,%edi m = min(n - tot, BSIZE - off%BSIZE); 80101af2: 89 f0 mov %esi,%eax 80101af4: b9 00 02 00 00 mov $0x200,%ecx 80101af9: 83 c4 0c add $0xc,%esp 80101afc: 25 ff 01 00 00 and $0x1ff,%eax 80101b01: 29 c1 sub %eax,%ecx memmove(bp->data + off%BSIZE, src, m); 80101b03: 8d 44 07 5c lea 0x5c(%edi,%eax,1),%eax m = min(n - tot, BSIZE - off%BSIZE); 80101b07: 39 d9 cmp %ebx,%ecx 80101b09: 0f 46 d9 cmovbe %ecx,%ebx memmove(bp->data + off%BSIZE, src, m); 80101b0c: 53 push %ebx 80101b0d: ff 75 dc pushl -0x24(%ebp) for(tot=0; tot<n; tot+=m, off+=m, src+=m){ 80101b10: 01 de add %ebx,%esi memmove(bp->data + off%BSIZE, src, m); 80101b12: 50 push %eax 80101b13: e8 28 2b 00 00 call 80104640 <memmove> log_write(bp); 80101b18: 89 3c 24 mov %edi,(%esp) 80101b1b: e8 70 13 00 00 call 80102e90 <log_write> brelse(bp); 80101b20: 89 3c 24 mov %edi,(%esp) 80101b23: e8 b8 e6 ff ff call 801001e0 <brelse> for(tot=0; tot<n; tot+=m, off+=m, src+=m){ 80101b28: 01 5d e4 add %ebx,-0x1c(%ebp) 80101b2b: 01 5d dc add %ebx,-0x24(%ebp) 80101b2e: 83 c4 10 add $0x10,%esp 80101b31: 8b 45 e4 mov -0x1c(%ebp),%eax 80101b34: 39 45 e0 cmp %eax,-0x20(%ebp) 80101b37: 77 97 ja 80101ad0 <writei+0x60> } if(n > 0 && off > ip->size){ 80101b39: 8b 45 d8 mov -0x28(%ebp),%eax 80101b3c: 3b 70 58 cmp 0x58(%eax),%esi 80101b3f: 77 37 ja 80101b78 <writei+0x108> ip->size = off; iupdate(ip); } return n; 80101b41: 8b 45 e0 mov -0x20(%ebp),%eax } 80101b44: 8d 65 f4 lea -0xc(%ebp),%esp 80101b47: 5b pop %ebx 80101b48: 5e pop %esi 80101b49: 5f pop %edi 80101b4a: 5d pop %ebp 80101b4b: c3 ret 80101b4c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write) 80101b50: 0f bf 40 52 movswl 0x52(%eax),%eax 80101b54: 66 83 f8 09 cmp $0x9,%ax 80101b58: 77 36 ja 80101b90 <writei+0x120> 80101b5a: 8b 04 c5 64 09 11 80 mov -0x7feef69c(,%eax,8),%eax 80101b61: 85 c0 test %eax,%eax 80101b63: 74 2b je 80101b90 <writei+0x120> return devsw[ip->major].write(ip, src, n); 80101b65: 89 7d 10 mov %edi,0x10(%ebp) } 80101b68: 8d 65 f4 lea -0xc(%ebp),%esp 80101b6b: 5b pop %ebx 80101b6c: 5e pop %esi 80101b6d: 5f pop %edi 80101b6e: 5d pop %ebp return devsw[ip->major].write(ip, src, n); 80101b6f: ff e0 jmp *%eax 80101b71: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi ip->size = off; 80101b78: 8b 45 d8 mov -0x28(%ebp),%eax iupdate(ip); 80101b7b: 83 ec 0c sub $0xc,%esp ip->size = off; 80101b7e: 89 70 58 mov %esi,0x58(%eax) iupdate(ip); 80101b81: 50 push %eax 80101b82: e8 59 fa ff ff call 801015e0 <iupdate> 80101b87: 83 c4 10 add $0x10,%esp 80101b8a: eb b5 jmp 80101b41 <writei+0xd1> 80101b8c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80101b90: b8 ff ff ff ff mov $0xffffffff,%eax 80101b95: eb ad jmp 80101b44 <writei+0xd4> 80101b97: 89 f6 mov %esi,%esi 80101b99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101ba0 <namecmp>: //PAGEBREAK! // Directories int namecmp(const char *s, const char *t) { 80101ba0: 55 push %ebp 80101ba1: 89 e5 mov %esp,%ebp 80101ba3: 83 ec 0c sub $0xc,%esp return strncmp(s, t, DIRSIZ); 80101ba6: 6a 0e push $0xe 80101ba8: ff 75 0c pushl 0xc(%ebp) 80101bab: ff 75 08 pushl 0x8(%ebp) 80101bae: e8 fd 2a 00 00 call 801046b0 <strncmp> } 80101bb3: c9 leave 80101bb4: c3 ret 80101bb5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101bb9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101bc0 <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) { 80101bc0: 55 push %ebp 80101bc1: 89 e5 mov %esp,%ebp 80101bc3: 57 push %edi 80101bc4: 56 push %esi 80101bc5: 53 push %ebx 80101bc6: 83 ec 1c sub $0x1c,%esp 80101bc9: 8b 5d 08 mov 0x8(%ebp),%ebx uint off, inum; struct dirent de; if(dp->type != T_DIR) 80101bcc: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80101bd1: 0f 85 85 00 00 00 jne 80101c5c <dirlookup+0x9c> panic("dirlookup not DIR"); for(off = 0; off < dp->size; off += sizeof(de)){ 80101bd7: 8b 53 58 mov 0x58(%ebx),%edx 80101bda: 31 ff xor %edi,%edi 80101bdc: 8d 75 d8 lea -0x28(%ebp),%esi 80101bdf: 85 d2 test %edx,%edx 80101be1: 74 3e je 80101c21 <dirlookup+0x61> 80101be3: 90 nop 80101be4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80101be8: 6a 10 push $0x10 80101bea: 57 push %edi 80101beb: 56 push %esi 80101bec: 53 push %ebx 80101bed: e8 7e fd ff ff call 80101970 <readi> 80101bf2: 83 c4 10 add $0x10,%esp 80101bf5: 83 f8 10 cmp $0x10,%eax 80101bf8: 75 55 jne 80101c4f <dirlookup+0x8f> panic("dirlookup read"); if(de.inum == 0) 80101bfa: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp) 80101bff: 74 18 je 80101c19 <dirlookup+0x59> return strncmp(s, t, DIRSIZ); 80101c01: 8d 45 da lea -0x26(%ebp),%eax 80101c04: 83 ec 04 sub $0x4,%esp 80101c07: 6a 0e push $0xe 80101c09: 50 push %eax 80101c0a: ff 75 0c pushl 0xc(%ebp) 80101c0d: e8 9e 2a 00 00 call 801046b0 <strncmp> continue; if(namecmp(name, de.name) == 0){ 80101c12: 83 c4 10 add $0x10,%esp 80101c15: 85 c0 test %eax,%eax 80101c17: 74 17 je 80101c30 <dirlookup+0x70> for(off = 0; off < dp->size; off += sizeof(de)){ 80101c19: 83 c7 10 add $0x10,%edi 80101c1c: 3b 7b 58 cmp 0x58(%ebx),%edi 80101c1f: 72 c7 jb 80101be8 <dirlookup+0x28> return iget(dp->dev, inum); } } return 0; } 80101c21: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 80101c24: 31 c0 xor %eax,%eax } 80101c26: 5b pop %ebx 80101c27: 5e pop %esi 80101c28: 5f pop %edi 80101c29: 5d pop %ebp 80101c2a: c3 ret 80101c2b: 90 nop 80101c2c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(poff) 80101c30: 8b 45 10 mov 0x10(%ebp),%eax 80101c33: 85 c0 test %eax,%eax 80101c35: 74 05 je 80101c3c <dirlookup+0x7c> *poff = off; 80101c37: 8b 45 10 mov 0x10(%ebp),%eax 80101c3a: 89 38 mov %edi,(%eax) inum = de.inum; 80101c3c: 0f b7 55 d8 movzwl -0x28(%ebp),%edx return iget(dp->dev, inum); 80101c40: 8b 03 mov (%ebx),%eax 80101c42: e8 d9 f5 ff ff call 80101220 <iget> } 80101c47: 8d 65 f4 lea -0xc(%ebp),%esp 80101c4a: 5b pop %ebx 80101c4b: 5e pop %esi 80101c4c: 5f pop %edi 80101c4d: 5d pop %ebp 80101c4e: c3 ret panic("dirlookup read"); 80101c4f: 83 ec 0c sub $0xc,%esp 80101c52: 68 19 72 10 80 push $0x80107219 80101c57: e8 34 e7 ff ff call 80100390 <panic> panic("dirlookup not DIR"); 80101c5c: 83 ec 0c sub $0xc,%esp 80101c5f: 68 07 72 10 80 push $0x80107207 80101c64: e8 27 e7 ff ff call 80100390 <panic> 80101c69: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80101c70 <namex>: // If parent != 0, return the inode for the parent and copy the final // path element into name, which must have room for DIRSIZ bytes. // Must be called inside a transaction since it calls iput(). static struct inode* namex(char *path, int nameiparent, char *name) { 80101c70: 55 push %ebp 80101c71: 89 e5 mov %esp,%ebp 80101c73: 57 push %edi 80101c74: 56 push %esi 80101c75: 53 push %ebx 80101c76: 89 cf mov %ecx,%edi 80101c78: 89 c3 mov %eax,%ebx 80101c7a: 83 ec 1c sub $0x1c,%esp struct inode *ip, *next; if(*path == '/') 80101c7d: 80 38 2f cmpb $0x2f,(%eax) { 80101c80: 89 55 e0 mov %edx,-0x20(%ebp) if(*path == '/') 80101c83: 0f 84 67 01 00 00 je 80101df0 <namex+0x180> ip = iget(ROOTDEV, ROOTINO); else ip = idup(myproc()->cwd); 80101c89: e8 72 1c 00 00 call 80103900 <myproc> acquire(&icache.lock); 80101c8e: 83 ec 0c sub $0xc,%esp ip = idup(myproc()->cwd); 80101c91: 8b 70 68 mov 0x68(%eax),%esi acquire(&icache.lock); 80101c94: 68 e0 09 11 80 push $0x801109e0 80101c99: e8 e2 27 00 00 call 80104480 <acquire> ip->ref++; 80101c9e: 83 46 08 01 addl $0x1,0x8(%esi) release(&icache.lock); 80101ca2: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp) 80101ca9: e8 92 28 00 00 call 80104540 <release> 80101cae: 83 c4 10 add $0x10,%esp 80101cb1: eb 08 jmp 80101cbb <namex+0x4b> 80101cb3: 90 nop 80101cb4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi path++; 80101cb8: 83 c3 01 add $0x1,%ebx while(*path == '/') 80101cbb: 0f b6 03 movzbl (%ebx),%eax 80101cbe: 3c 2f cmp $0x2f,%al 80101cc0: 74 f6 je 80101cb8 <namex+0x48> if(*path == 0) 80101cc2: 84 c0 test %al,%al 80101cc4: 0f 84 ee 00 00 00 je 80101db8 <namex+0x148> while(*path != '/' && *path != 0) 80101cca: 0f b6 03 movzbl (%ebx),%eax 80101ccd: 3c 2f cmp $0x2f,%al 80101ccf: 0f 84 b3 00 00 00 je 80101d88 <namex+0x118> 80101cd5: 84 c0 test %al,%al 80101cd7: 89 da mov %ebx,%edx 80101cd9: 75 09 jne 80101ce4 <namex+0x74> 80101cdb: e9 a8 00 00 00 jmp 80101d88 <namex+0x118> 80101ce0: 84 c0 test %al,%al 80101ce2: 74 0a je 80101cee <namex+0x7e> path++; 80101ce4: 83 c2 01 add $0x1,%edx while(*path != '/' && *path != 0) 80101ce7: 0f b6 02 movzbl (%edx),%eax 80101cea: 3c 2f cmp $0x2f,%al 80101cec: 75 f2 jne 80101ce0 <namex+0x70> 80101cee: 89 d1 mov %edx,%ecx 80101cf0: 29 d9 sub %ebx,%ecx if(len >= DIRSIZ) 80101cf2: 83 f9 0d cmp $0xd,%ecx 80101cf5: 0f 8e 91 00 00 00 jle 80101d8c <namex+0x11c> memmove(name, s, DIRSIZ); 80101cfb: 83 ec 04 sub $0x4,%esp 80101cfe: 89 55 e4 mov %edx,-0x1c(%ebp) 80101d01: 6a 0e push $0xe 80101d03: 53 push %ebx 80101d04: 57 push %edi 80101d05: e8 36 29 00 00 call 80104640 <memmove> path++; 80101d0a: 8b 55 e4 mov -0x1c(%ebp),%edx memmove(name, s, DIRSIZ); 80101d0d: 83 c4 10 add $0x10,%esp path++; 80101d10: 89 d3 mov %edx,%ebx while(*path == '/') 80101d12: 80 3a 2f cmpb $0x2f,(%edx) 80101d15: 75 11 jne 80101d28 <namex+0xb8> 80101d17: 89 f6 mov %esi,%esi 80101d19: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi path++; 80101d20: 83 c3 01 add $0x1,%ebx while(*path == '/') 80101d23: 80 3b 2f cmpb $0x2f,(%ebx) 80101d26: 74 f8 je 80101d20 <namex+0xb0> while((path = skipelem(path, name)) != 0){ ilock(ip); 80101d28: 83 ec 0c sub $0xc,%esp 80101d2b: 56 push %esi 80101d2c: e8 5f f9 ff ff call 80101690 <ilock> if(ip->type != T_DIR){ 80101d31: 83 c4 10 add $0x10,%esp 80101d34: 66 83 7e 50 01 cmpw $0x1,0x50(%esi) 80101d39: 0f 85 91 00 00 00 jne 80101dd0 <namex+0x160> iunlockput(ip); return 0; } if(nameiparent && *path == '\0'){ 80101d3f: 8b 55 e0 mov -0x20(%ebp),%edx 80101d42: 85 d2 test %edx,%edx 80101d44: 74 09 je 80101d4f <namex+0xdf> 80101d46: 80 3b 00 cmpb $0x0,(%ebx) 80101d49: 0f 84 b7 00 00 00 je 80101e06 <namex+0x196> // Stop one level early. iunlock(ip); return ip; } if((next = dirlookup(ip, name, 0)) == 0){ 80101d4f: 83 ec 04 sub $0x4,%esp 80101d52: 6a 00 push $0x0 80101d54: 57 push %edi 80101d55: 56 push %esi 80101d56: e8 65 fe ff ff call 80101bc0 <dirlookup> 80101d5b: 83 c4 10 add $0x10,%esp 80101d5e: 85 c0 test %eax,%eax 80101d60: 74 6e je 80101dd0 <namex+0x160> iunlock(ip); 80101d62: 83 ec 0c sub $0xc,%esp 80101d65: 89 45 e4 mov %eax,-0x1c(%ebp) 80101d68: 56 push %esi 80101d69: e8 02 fa ff ff call 80101770 <iunlock> iput(ip); 80101d6e: 89 34 24 mov %esi,(%esp) 80101d71: e8 4a fa ff ff call 801017c0 <iput> 80101d76: 8b 45 e4 mov -0x1c(%ebp),%eax 80101d79: 83 c4 10 add $0x10,%esp 80101d7c: 89 c6 mov %eax,%esi 80101d7e: e9 38 ff ff ff jmp 80101cbb <namex+0x4b> 80101d83: 90 nop 80101d84: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi while(*path != '/' && *path != 0) 80101d88: 89 da mov %ebx,%edx 80101d8a: 31 c9 xor %ecx,%ecx memmove(name, s, len); 80101d8c: 83 ec 04 sub $0x4,%esp 80101d8f: 89 55 dc mov %edx,-0x24(%ebp) 80101d92: 89 4d e4 mov %ecx,-0x1c(%ebp) 80101d95: 51 push %ecx 80101d96: 53 push %ebx 80101d97: 57 push %edi 80101d98: e8 a3 28 00 00 call 80104640 <memmove> name[len] = 0; 80101d9d: 8b 4d e4 mov -0x1c(%ebp),%ecx 80101da0: 8b 55 dc mov -0x24(%ebp),%edx 80101da3: 83 c4 10 add $0x10,%esp 80101da6: c6 04 0f 00 movb $0x0,(%edi,%ecx,1) 80101daa: 89 d3 mov %edx,%ebx 80101dac: e9 61 ff ff ff jmp 80101d12 <namex+0xa2> 80101db1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return 0; } iunlockput(ip); ip = next; } if(nameiparent){ 80101db8: 8b 45 e0 mov -0x20(%ebp),%eax 80101dbb: 85 c0 test %eax,%eax 80101dbd: 75 5d jne 80101e1c <namex+0x1ac> iput(ip); return 0; } return ip; } 80101dbf: 8d 65 f4 lea -0xc(%ebp),%esp 80101dc2: 89 f0 mov %esi,%eax 80101dc4: 5b pop %ebx 80101dc5: 5e pop %esi 80101dc6: 5f pop %edi 80101dc7: 5d pop %ebp 80101dc8: c3 ret 80101dc9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi iunlock(ip); 80101dd0: 83 ec 0c sub $0xc,%esp 80101dd3: 56 push %esi 80101dd4: e8 97 f9 ff ff call 80101770 <iunlock> iput(ip); 80101dd9: 89 34 24 mov %esi,(%esp) return 0; 80101ddc: 31 f6 xor %esi,%esi iput(ip); 80101dde: e8 dd f9 ff ff call 801017c0 <iput> return 0; 80101de3: 83 c4 10 add $0x10,%esp } 80101de6: 8d 65 f4 lea -0xc(%ebp),%esp 80101de9: 89 f0 mov %esi,%eax 80101deb: 5b pop %ebx 80101dec: 5e pop %esi 80101ded: 5f pop %edi 80101dee: 5d pop %ebp 80101def: c3 ret ip = iget(ROOTDEV, ROOTINO); 80101df0: ba 01 00 00 00 mov $0x1,%edx 80101df5: b8 01 00 00 00 mov $0x1,%eax 80101dfa: e8 21 f4 ff ff call 80101220 <iget> 80101dff: 89 c6 mov %eax,%esi 80101e01: e9 b5 fe ff ff jmp 80101cbb <namex+0x4b> iunlock(ip); 80101e06: 83 ec 0c sub $0xc,%esp 80101e09: 56 push %esi 80101e0a: e8 61 f9 ff ff call 80101770 <iunlock> return ip; 80101e0f: 83 c4 10 add $0x10,%esp } 80101e12: 8d 65 f4 lea -0xc(%ebp),%esp 80101e15: 89 f0 mov %esi,%eax 80101e17: 5b pop %ebx 80101e18: 5e pop %esi 80101e19: 5f pop %edi 80101e1a: 5d pop %ebp 80101e1b: c3 ret iput(ip); 80101e1c: 83 ec 0c sub $0xc,%esp 80101e1f: 56 push %esi return 0; 80101e20: 31 f6 xor %esi,%esi iput(ip); 80101e22: e8 99 f9 ff ff call 801017c0 <iput> return 0; 80101e27: 83 c4 10 add $0x10,%esp 80101e2a: eb 93 jmp 80101dbf <namex+0x14f> 80101e2c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101e30 <dirlink>: { 80101e30: 55 push %ebp 80101e31: 89 e5 mov %esp,%ebp 80101e33: 57 push %edi 80101e34: 56 push %esi 80101e35: 53 push %ebx 80101e36: 83 ec 20 sub $0x20,%esp 80101e39: 8b 5d 08 mov 0x8(%ebp),%ebx if((ip = dirlookup(dp, name, 0)) != 0){ 80101e3c: 6a 00 push $0x0 80101e3e: ff 75 0c pushl 0xc(%ebp) 80101e41: 53 push %ebx 80101e42: e8 79 fd ff ff call 80101bc0 <dirlookup> 80101e47: 83 c4 10 add $0x10,%esp 80101e4a: 85 c0 test %eax,%eax 80101e4c: 75 67 jne 80101eb5 <dirlink+0x85> for(off = 0; off < dp->size; off += sizeof(de)){ 80101e4e: 8b 7b 58 mov 0x58(%ebx),%edi 80101e51: 8d 75 d8 lea -0x28(%ebp),%esi 80101e54: 85 ff test %edi,%edi 80101e56: 74 29 je 80101e81 <dirlink+0x51> 80101e58: 31 ff xor %edi,%edi 80101e5a: 8d 75 d8 lea -0x28(%ebp),%esi 80101e5d: eb 09 jmp 80101e68 <dirlink+0x38> 80101e5f: 90 nop 80101e60: 83 c7 10 add $0x10,%edi 80101e63: 3b 7b 58 cmp 0x58(%ebx),%edi 80101e66: 73 19 jae 80101e81 <dirlink+0x51> if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80101e68: 6a 10 push $0x10 80101e6a: 57 push %edi 80101e6b: 56 push %esi 80101e6c: 53 push %ebx 80101e6d: e8 fe fa ff ff call 80101970 <readi> 80101e72: 83 c4 10 add $0x10,%esp 80101e75: 83 f8 10 cmp $0x10,%eax 80101e78: 75 4e jne 80101ec8 <dirlink+0x98> if(de.inum == 0) 80101e7a: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp) 80101e7f: 75 df jne 80101e60 <dirlink+0x30> strncpy(de.name, name, DIRSIZ); 80101e81: 8d 45 da lea -0x26(%ebp),%eax 80101e84: 83 ec 04 sub $0x4,%esp 80101e87: 6a 0e push $0xe 80101e89: ff 75 0c pushl 0xc(%ebp) 80101e8c: 50 push %eax 80101e8d: e8 7e 28 00 00 call 80104710 <strncpy> de.inum = inum; 80101e92: 8b 45 10 mov 0x10(%ebp),%eax if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80101e95: 6a 10 push $0x10 80101e97: 57 push %edi 80101e98: 56 push %esi 80101e99: 53 push %ebx de.inum = inum; 80101e9a: 66 89 45 d8 mov %ax,-0x28(%ebp) if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80101e9e: e8 cd fb ff ff call 80101a70 <writei> 80101ea3: 83 c4 20 add $0x20,%esp 80101ea6: 83 f8 10 cmp $0x10,%eax 80101ea9: 75 2a jne 80101ed5 <dirlink+0xa5> return 0; 80101eab: 31 c0 xor %eax,%eax } 80101ead: 8d 65 f4 lea -0xc(%ebp),%esp 80101eb0: 5b pop %ebx 80101eb1: 5e pop %esi 80101eb2: 5f pop %edi 80101eb3: 5d pop %ebp 80101eb4: c3 ret iput(ip); 80101eb5: 83 ec 0c sub $0xc,%esp 80101eb8: 50 push %eax 80101eb9: e8 02 f9 ff ff call 801017c0 <iput> return -1; 80101ebe: 83 c4 10 add $0x10,%esp 80101ec1: b8 ff ff ff ff mov $0xffffffff,%eax 80101ec6: eb e5 jmp 80101ead <dirlink+0x7d> panic("dirlink read"); 80101ec8: 83 ec 0c sub $0xc,%esp 80101ecb: 68 28 72 10 80 push $0x80107228 80101ed0: e8 bb e4 ff ff call 80100390 <panic> panic("dirlink"); 80101ed5: 83 ec 0c sub $0xc,%esp 80101ed8: 68 46 78 10 80 push $0x80107846 80101edd: e8 ae e4 ff ff call 80100390 <panic> 80101ee2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80101ee9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101ef0 <namei>: struct inode* namei(char *path) { 80101ef0: 55 push %ebp char name[DIRSIZ]; return namex(path, 0, name); 80101ef1: 31 d2 xor %edx,%edx { 80101ef3: 89 e5 mov %esp,%ebp 80101ef5: 83 ec 18 sub $0x18,%esp return namex(path, 0, name); 80101ef8: 8b 45 08 mov 0x8(%ebp),%eax 80101efb: 8d 4d ea lea -0x16(%ebp),%ecx 80101efe: e8 6d fd ff ff call 80101c70 <namex> } 80101f03: c9 leave 80101f04: c3 ret 80101f05: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101f09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101f10 <nameiparent>: struct inode* nameiparent(char *path, char *name) { 80101f10: 55 push %ebp return namex(path, 1, name); 80101f11: ba 01 00 00 00 mov $0x1,%edx { 80101f16: 89 e5 mov %esp,%ebp return namex(path, 1, name); 80101f18: 8b 4d 0c mov 0xc(%ebp),%ecx 80101f1b: 8b 45 08 mov 0x8(%ebp),%eax } 80101f1e: 5d pop %ebp return namex(path, 1, name); 80101f1f: e9 4c fd ff ff jmp 80101c70 <namex> 80101f24: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80101f2a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80101f30 <swapread>: #define SWAPBASE 500 #define SWAPMAX (100000 - SWAPBASE) void swapread(char* ptr, int blkno) { 80101f30: 55 push %ebp 80101f31: 89 e5 mov %esp,%ebp 80101f33: 57 push %edi 80101f34: 56 push %esi 80101f35: 53 push %ebx 80101f36: 83 ec 1c sub $0x1c,%esp 80101f39: 8b 7d 0c mov 0xc(%ebp),%edi struct buf* bp; int i; if ( blkno < 0 || blkno >= SWAPMAX ) 80101f3c: 81 ff ab 84 01 00 cmp $0x184ab,%edi 80101f42: 77 5c ja 80101fa0 <swapread+0x70> 80101f44: 8d 87 fc 01 00 00 lea 0x1fc(%edi),%eax 80101f4a: 8b 75 08 mov 0x8(%ebp),%esi 80101f4d: 8d 9f f4 01 00 00 lea 0x1f4(%edi),%ebx 80101f53: 89 45 e4 mov %eax,-0x1c(%ebp) 80101f56: 8d 76 00 lea 0x0(%esi),%esi 80101f59: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi panic("swapread: blkno exceed range"); for ( i=0; i < 8; ++i ) { bp = bread(0, blkno + SWAPBASE + i); 80101f60: 83 ec 08 sub $0x8,%esp 80101f63: 53 push %ebx 80101f64: 6a 00 push $0x0 80101f66: 83 c3 01 add $0x1,%ebx 80101f69: e8 62 e1 ff ff call 801000d0 <bread> 80101f6e: 89 c7 mov %eax,%edi memmove(ptr + i * BSIZE, bp->data, BSIZE); 80101f70: 8d 40 5c lea 0x5c(%eax),%eax 80101f73: 83 c4 0c add $0xc,%esp 80101f76: 68 00 02 00 00 push $0x200 80101f7b: 50 push %eax 80101f7c: 56 push %esi 80101f7d: 81 c6 00 02 00 00 add $0x200,%esi 80101f83: e8 b8 26 00 00 call 80104640 <memmove> brelse(bp); 80101f88: 89 3c 24 mov %edi,(%esp) 80101f8b: e8 50 e2 ff ff call 801001e0 <brelse> for ( i=0; i < 8; ++i ) { 80101f90: 83 c4 10 add $0x10,%esp 80101f93: 3b 5d e4 cmp -0x1c(%ebp),%ebx 80101f96: 75 c8 jne 80101f60 <swapread+0x30> } } 80101f98: 8d 65 f4 lea -0xc(%ebp),%esp 80101f9b: 5b pop %ebx 80101f9c: 5e pop %esi 80101f9d: 5f pop %edi 80101f9e: 5d pop %ebp 80101f9f: c3 ret panic("swapread: blkno exceed range"); 80101fa0: 83 ec 0c sub $0xc,%esp 80101fa3: 68 35 72 10 80 push $0x80107235 80101fa8: e8 e3 e3 ff ff call 80100390 <panic> 80101fad: 8d 76 00 lea 0x0(%esi),%esi 80101fb0 <swapwrite>: void swapwrite(char* ptr, int blkno) { 80101fb0: 55 push %ebp 80101fb1: 89 e5 mov %esp,%ebp 80101fb3: 57 push %edi 80101fb4: 56 push %esi 80101fb5: 53 push %ebx 80101fb6: 83 ec 1c sub $0x1c,%esp 80101fb9: 8b 7d 0c mov 0xc(%ebp),%edi struct buf* bp; int i; if ( blkno < 0 || blkno >= SWAPMAX ) 80101fbc: 81 ff ab 84 01 00 cmp $0x184ab,%edi 80101fc2: 77 64 ja 80102028 <swapwrite+0x78> 80101fc4: 8d 87 fc 01 00 00 lea 0x1fc(%edi),%eax 80101fca: 8b 75 08 mov 0x8(%ebp),%esi 80101fcd: 8d 9f f4 01 00 00 lea 0x1f4(%edi),%ebx 80101fd3: 89 45 e4 mov %eax,-0x1c(%ebp) 80101fd6: 8d 76 00 lea 0x0(%esi),%esi 80101fd9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi panic("swapread: blkno exceed range"); for ( i=0; i < 8; ++i ) { bp = bread(0, blkno + SWAPBASE + i); 80101fe0: 83 ec 08 sub $0x8,%esp 80101fe3: 53 push %ebx 80101fe4: 6a 00 push $0x0 80101fe6: 83 c3 01 add $0x1,%ebx 80101fe9: e8 e2 e0 ff ff call 801000d0 <bread> 80101fee: 89 c7 mov %eax,%edi memmove(bp->data, ptr + i * BSIZE, BSIZE); 80101ff0: 8d 40 5c lea 0x5c(%eax),%eax 80101ff3: 83 c4 0c add $0xc,%esp 80101ff6: 68 00 02 00 00 push $0x200 80101ffb: 56 push %esi 80101ffc: 81 c6 00 02 00 00 add $0x200,%esi 80102002: 50 push %eax 80102003: e8 38 26 00 00 call 80104640 <memmove> bwrite(bp); 80102008: 89 3c 24 mov %edi,(%esp) 8010200b: e8 90 e1 ff ff call 801001a0 <bwrite> brelse(bp); 80102010: 89 3c 24 mov %edi,(%esp) 80102013: e8 c8 e1 ff ff call 801001e0 <brelse> for ( i=0; i < 8; ++i ) { 80102018: 83 c4 10 add $0x10,%esp 8010201b: 3b 5d e4 cmp -0x1c(%ebp),%ebx 8010201e: 75 c0 jne 80101fe0 <swapwrite+0x30> } } 80102020: 8d 65 f4 lea -0xc(%ebp),%esp 80102023: 5b pop %ebx 80102024: 5e pop %esi 80102025: 5f pop %edi 80102026: 5d pop %ebp 80102027: c3 ret panic("swapread: blkno exceed range"); 80102028: 83 ec 0c sub $0xc,%esp 8010202b: 68 35 72 10 80 push $0x80107235 80102030: e8 5b e3 ff ff call 80100390 <panic> 80102035: 66 90 xchg %ax,%ax 80102037: 66 90 xchg %ax,%ax 80102039: 66 90 xchg %ax,%ax 8010203b: 66 90 xchg %ax,%ax 8010203d: 66 90 xchg %ax,%ax 8010203f: 90 nop 80102040 <idestart>: } // Start the request for b. Caller must hold idelock. static void idestart(struct buf *b) { 80102040: 55 push %ebp 80102041: 89 e5 mov %esp,%ebp 80102043: 57 push %edi 80102044: 56 push %esi 80102045: 53 push %ebx 80102046: 83 ec 0c sub $0xc,%esp if(b == 0) 80102049: 85 c0 test %eax,%eax 8010204b: 0f 84 b4 00 00 00 je 80102105 <idestart+0xc5> panic("idestart"); if(b->blockno >= FSSIZE) 80102051: 8b 58 08 mov 0x8(%eax),%ebx 80102054: 89 c6 mov %eax,%esi 80102056: 81 fb e7 03 00 00 cmp $0x3e7,%ebx 8010205c: 0f 87 96 00 00 00 ja 801020f8 <idestart+0xb8> asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102062: b9 f7 01 00 00 mov $0x1f7,%ecx 80102067: 89 f6 mov %esi,%esi 80102069: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102070: 89 ca mov %ecx,%edx 80102072: ec in (%dx),%al while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY) 80102073: 83 e0 c0 and $0xffffffc0,%eax 80102076: 3c 40 cmp $0x40,%al 80102078: 75 f6 jne 80102070 <idestart+0x30> asm volatile("out %0,%1" : : "a" (data), "d" (port)); 8010207a: 31 ff xor %edi,%edi 8010207c: ba f6 03 00 00 mov $0x3f6,%edx 80102081: 89 f8 mov %edi,%eax 80102083: ee out %al,(%dx) 80102084: b8 01 00 00 00 mov $0x1,%eax 80102089: ba f2 01 00 00 mov $0x1f2,%edx 8010208e: ee out %al,(%dx) 8010208f: ba f3 01 00 00 mov $0x1f3,%edx 80102094: 89 d8 mov %ebx,%eax 80102096: 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); 80102097: 89 d8 mov %ebx,%eax 80102099: ba f4 01 00 00 mov $0x1f4,%edx 8010209e: c1 f8 08 sar $0x8,%eax 801020a1: ee out %al,(%dx) 801020a2: ba f5 01 00 00 mov $0x1f5,%edx 801020a7: 89 f8 mov %edi,%eax 801020a9: ee out %al,(%dx) outb(0x1f5, (sector >> 16) & 0xff); outb(0x1f6, 0xe0 | ((b->dev&1)<<4) | ((sector>>24)&0x0f)); 801020aa: 0f b6 46 04 movzbl 0x4(%esi),%eax 801020ae: ba f6 01 00 00 mov $0x1f6,%edx 801020b3: c1 e0 04 shl $0x4,%eax 801020b6: 83 e0 10 and $0x10,%eax 801020b9: 83 c8 e0 or $0xffffffe0,%eax 801020bc: ee out %al,(%dx) if(b->flags & B_DIRTY){ 801020bd: f6 06 04 testb $0x4,(%esi) 801020c0: 75 16 jne 801020d8 <idestart+0x98> 801020c2: b8 20 00 00 00 mov $0x20,%eax 801020c7: 89 ca mov %ecx,%edx 801020c9: ee out %al,(%dx) outb(0x1f7, write_cmd); outsl(0x1f0, b->data, BSIZE/4); } else { outb(0x1f7, read_cmd); } } 801020ca: 8d 65 f4 lea -0xc(%ebp),%esp 801020cd: 5b pop %ebx 801020ce: 5e pop %esi 801020cf: 5f pop %edi 801020d0: 5d pop %ebp 801020d1: c3 ret 801020d2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801020d8: b8 30 00 00 00 mov $0x30,%eax 801020dd: 89 ca mov %ecx,%edx 801020df: ee out %al,(%dx) asm volatile("cld; rep outsl" : 801020e0: b9 80 00 00 00 mov $0x80,%ecx outsl(0x1f0, b->data, BSIZE/4); 801020e5: 83 c6 5c add $0x5c,%esi 801020e8: ba f0 01 00 00 mov $0x1f0,%edx 801020ed: fc cld 801020ee: f3 6f rep outsl %ds:(%esi),(%dx) } 801020f0: 8d 65 f4 lea -0xc(%ebp),%esp 801020f3: 5b pop %ebx 801020f4: 5e pop %esi 801020f5: 5f pop %edi 801020f6: 5d pop %ebp 801020f7: c3 ret panic("incorrect blockno"); 801020f8: 83 ec 0c sub $0xc,%esp 801020fb: 68 b0 72 10 80 push $0x801072b0 80102100: e8 8b e2 ff ff call 80100390 <panic> panic("idestart"); 80102105: 83 ec 0c sub $0xc,%esp 80102108: 68 a7 72 10 80 push $0x801072a7 8010210d: e8 7e e2 ff ff call 80100390 <panic> 80102112: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80102119: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102120 <ideinit>: { 80102120: 55 push %ebp 80102121: 89 e5 mov %esp,%ebp 80102123: 83 ec 10 sub $0x10,%esp initlock(&idelock, "ide"); 80102126: 68 c2 72 10 80 push $0x801072c2 8010212b: 68 80 a5 10 80 push $0x8010a580 80102130: e8 0b 22 00 00 call 80104340 <initlock> ioapicenable(IRQ_IDE, ncpu - 1); 80102135: 58 pop %eax 80102136: a1 00 2d 11 80 mov 0x80112d00,%eax 8010213b: 5a pop %edx 8010213c: 83 e8 01 sub $0x1,%eax 8010213f: 50 push %eax 80102140: 6a 0e push $0xe 80102142: e8 a9 02 00 00 call 801023f0 <ioapicenable> 80102147: 83 c4 10 add $0x10,%esp asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010214a: ba f7 01 00 00 mov $0x1f7,%edx 8010214f: 90 nop 80102150: ec in (%dx),%al while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY) 80102151: 83 e0 c0 and $0xffffffc0,%eax 80102154: 3c 40 cmp $0x40,%al 80102156: 75 f8 jne 80102150 <ideinit+0x30> asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102158: b8 f0 ff ff ff mov $0xfffffff0,%eax 8010215d: ba f6 01 00 00 mov $0x1f6,%edx 80102162: ee out %al,(%dx) 80102163: b9 e8 03 00 00 mov $0x3e8,%ecx asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102168: ba f7 01 00 00 mov $0x1f7,%edx 8010216d: eb 06 jmp 80102175 <ideinit+0x55> 8010216f: 90 nop for(i=0; i<1000; i++){ 80102170: 83 e9 01 sub $0x1,%ecx 80102173: 74 0f je 80102184 <ideinit+0x64> 80102175: ec in (%dx),%al if(inb(0x1f7) != 0){ 80102176: 84 c0 test %al,%al 80102178: 74 f6 je 80102170 <ideinit+0x50> havedisk1 = 1; 8010217a: c7 05 60 a5 10 80 01 movl $0x1,0x8010a560 80102181: 00 00 00 asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102184: b8 e0 ff ff ff mov $0xffffffe0,%eax 80102189: ba f6 01 00 00 mov $0x1f6,%edx 8010218e: ee out %al,(%dx) } 8010218f: c9 leave 80102190: c3 ret 80102191: eb 0d jmp 801021a0 <ideintr> 80102193: 90 nop 80102194: 90 nop 80102195: 90 nop 80102196: 90 nop 80102197: 90 nop 80102198: 90 nop 80102199: 90 nop 8010219a: 90 nop 8010219b: 90 nop 8010219c: 90 nop 8010219d: 90 nop 8010219e: 90 nop 8010219f: 90 nop 801021a0 <ideintr>: // Interrupt handler. void ideintr(void) { 801021a0: 55 push %ebp 801021a1: 89 e5 mov %esp,%ebp 801021a3: 57 push %edi 801021a4: 56 push %esi 801021a5: 53 push %ebx 801021a6: 83 ec 18 sub $0x18,%esp struct buf *b; // First queued buffer is the active request. acquire(&idelock); 801021a9: 68 80 a5 10 80 push $0x8010a580 801021ae: e8 cd 22 00 00 call 80104480 <acquire> if((b = idequeue) == 0){ 801021b3: 8b 1d 64 a5 10 80 mov 0x8010a564,%ebx 801021b9: 83 c4 10 add $0x10,%esp 801021bc: 85 db test %ebx,%ebx 801021be: 74 67 je 80102227 <ideintr+0x87> release(&idelock); return; } idequeue = b->qnext; 801021c0: 8b 43 58 mov 0x58(%ebx),%eax 801021c3: a3 64 a5 10 80 mov %eax,0x8010a564 // Read data if needed. if(!(b->flags & B_DIRTY) && idewait(1) >= 0) 801021c8: 8b 3b mov (%ebx),%edi 801021ca: f7 c7 04 00 00 00 test $0x4,%edi 801021d0: 75 31 jne 80102203 <ideintr+0x63> asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801021d2: ba f7 01 00 00 mov $0x1f7,%edx 801021d7: 89 f6 mov %esi,%esi 801021d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801021e0: ec in (%dx),%al while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY) 801021e1: 89 c6 mov %eax,%esi 801021e3: 83 e6 c0 and $0xffffffc0,%esi 801021e6: 89 f1 mov %esi,%ecx 801021e8: 80 f9 40 cmp $0x40,%cl 801021eb: 75 f3 jne 801021e0 <ideintr+0x40> if(checkerr && (r & (IDE_DF|IDE_ERR)) != 0) 801021ed: a8 21 test $0x21,%al 801021ef: 75 12 jne 80102203 <ideintr+0x63> insl(0x1f0, b->data, BSIZE/4); 801021f1: 8d 7b 5c lea 0x5c(%ebx),%edi asm volatile("cld; rep insl" : 801021f4: b9 80 00 00 00 mov $0x80,%ecx 801021f9: ba f0 01 00 00 mov $0x1f0,%edx 801021fe: fc cld 801021ff: f3 6d rep insl (%dx),%es:(%edi) 80102201: 8b 3b mov (%ebx),%edi // Wake process waiting for this buf. b->flags |= B_VALID; b->flags &= ~B_DIRTY; 80102203: 83 e7 fb and $0xfffffffb,%edi wakeup(b); 80102206: 83 ec 0c sub $0xc,%esp b->flags &= ~B_DIRTY; 80102209: 89 f9 mov %edi,%ecx 8010220b: 83 c9 02 or $0x2,%ecx 8010220e: 89 0b mov %ecx,(%ebx) wakeup(b); 80102210: 53 push %ebx 80102211: e8 5a 1e 00 00 call 80104070 <wakeup> // Start disk on next buf in queue. if(idequeue != 0) 80102216: a1 64 a5 10 80 mov 0x8010a564,%eax 8010221b: 83 c4 10 add $0x10,%esp 8010221e: 85 c0 test %eax,%eax 80102220: 74 05 je 80102227 <ideintr+0x87> idestart(idequeue); 80102222: e8 19 fe ff ff call 80102040 <idestart> release(&idelock); 80102227: 83 ec 0c sub $0xc,%esp 8010222a: 68 80 a5 10 80 push $0x8010a580 8010222f: e8 0c 23 00 00 call 80104540 <release> release(&idelock); } 80102234: 8d 65 f4 lea -0xc(%ebp),%esp 80102237: 5b pop %ebx 80102238: 5e pop %esi 80102239: 5f pop %edi 8010223a: 5d pop %ebp 8010223b: c3 ret 8010223c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102240 <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) { 80102240: 55 push %ebp 80102241: 89 e5 mov %esp,%ebp 80102243: 53 push %ebx 80102244: 83 ec 10 sub $0x10,%esp 80102247: 8b 5d 08 mov 0x8(%ebp),%ebx struct buf **pp; if(!holdingsleep(&b->lock)) 8010224a: 8d 43 0c lea 0xc(%ebx),%eax 8010224d: 50 push %eax 8010224e: e8 9d 20 00 00 call 801042f0 <holdingsleep> 80102253: 83 c4 10 add $0x10,%esp 80102256: 85 c0 test %eax,%eax 80102258: 0f 84 c6 00 00 00 je 80102324 <iderw+0xe4> panic("iderw: buf not locked"); if((b->flags & (B_VALID|B_DIRTY)) == B_VALID) 8010225e: 8b 03 mov (%ebx),%eax 80102260: 83 e0 06 and $0x6,%eax 80102263: 83 f8 02 cmp $0x2,%eax 80102266: 0f 84 ab 00 00 00 je 80102317 <iderw+0xd7> panic("iderw: nothing to do"); if(b->dev != 0 && !havedisk1) 8010226c: 8b 53 04 mov 0x4(%ebx),%edx 8010226f: 85 d2 test %edx,%edx 80102271: 74 0d je 80102280 <iderw+0x40> 80102273: a1 60 a5 10 80 mov 0x8010a560,%eax 80102278: 85 c0 test %eax,%eax 8010227a: 0f 84 b1 00 00 00 je 80102331 <iderw+0xf1> panic("iderw: ide disk 1 not present"); acquire(&idelock); //DOC:acquire-lock 80102280: 83 ec 0c sub $0xc,%esp 80102283: 68 80 a5 10 80 push $0x8010a580 80102288: e8 f3 21 00 00 call 80104480 <acquire> // Append b to idequeue. b->qnext = 0; for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue 8010228d: 8b 15 64 a5 10 80 mov 0x8010a564,%edx 80102293: 83 c4 10 add $0x10,%esp b->qnext = 0; 80102296: c7 43 58 00 00 00 00 movl $0x0,0x58(%ebx) for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue 8010229d: 85 d2 test %edx,%edx 8010229f: 75 09 jne 801022aa <iderw+0x6a> 801022a1: eb 6d jmp 80102310 <iderw+0xd0> 801022a3: 90 nop 801022a4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801022a8: 89 c2 mov %eax,%edx 801022aa: 8b 42 58 mov 0x58(%edx),%eax 801022ad: 85 c0 test %eax,%eax 801022af: 75 f7 jne 801022a8 <iderw+0x68> 801022b1: 83 c2 58 add $0x58,%edx ; *pp = b; 801022b4: 89 1a mov %ebx,(%edx) // Start disk if necessary. if(idequeue == b) 801022b6: 39 1d 64 a5 10 80 cmp %ebx,0x8010a564 801022bc: 74 42 je 80102300 <iderw+0xc0> idestart(b); // Wait for request to finish. while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){ 801022be: 8b 03 mov (%ebx),%eax 801022c0: 83 e0 06 and $0x6,%eax 801022c3: 83 f8 02 cmp $0x2,%eax 801022c6: 74 23 je 801022eb <iderw+0xab> 801022c8: 90 nop 801022c9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi sleep(b, &idelock); 801022d0: 83 ec 08 sub $0x8,%esp 801022d3: 68 80 a5 10 80 push $0x8010a580 801022d8: 53 push %ebx 801022d9: e8 e2 1b 00 00 call 80103ec0 <sleep> while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){ 801022de: 8b 03 mov (%ebx),%eax 801022e0: 83 c4 10 add $0x10,%esp 801022e3: 83 e0 06 and $0x6,%eax 801022e6: 83 f8 02 cmp $0x2,%eax 801022e9: 75 e5 jne 801022d0 <iderw+0x90> } release(&idelock); 801022eb: c7 45 08 80 a5 10 80 movl $0x8010a580,0x8(%ebp) } 801022f2: 8b 5d fc mov -0x4(%ebp),%ebx 801022f5: c9 leave release(&idelock); 801022f6: e9 45 22 00 00 jmp 80104540 <release> 801022fb: 90 nop 801022fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi idestart(b); 80102300: 89 d8 mov %ebx,%eax 80102302: e8 39 fd ff ff call 80102040 <idestart> 80102307: eb b5 jmp 801022be <iderw+0x7e> 80102309: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue 80102310: ba 64 a5 10 80 mov $0x8010a564,%edx 80102315: eb 9d jmp 801022b4 <iderw+0x74> panic("iderw: nothing to do"); 80102317: 83 ec 0c sub $0xc,%esp 8010231a: 68 dc 72 10 80 push $0x801072dc 8010231f: e8 6c e0 ff ff call 80100390 <panic> panic("iderw: buf not locked"); 80102324: 83 ec 0c sub $0xc,%esp 80102327: 68 c6 72 10 80 push $0x801072c6 8010232c: e8 5f e0 ff ff call 80100390 <panic> panic("iderw: ide disk 1 not present"); 80102331: 83 ec 0c sub $0xc,%esp 80102334: 68 f1 72 10 80 push $0x801072f1 80102339: e8 52 e0 ff ff call 80100390 <panic> 8010233e: 66 90 xchg %ax,%ax 80102340 <ioapicinit>: ioapic->data = data; } void ioapicinit(void) { 80102340: 55 push %ebp int i, id, maxintr; ioapic = (volatile struct ioapic*)IOAPIC; 80102341: c7 05 34 26 11 80 00 movl $0xfec00000,0x80112634 80102348: 00 c0 fe { 8010234b: 89 e5 mov %esp,%ebp 8010234d: 56 push %esi 8010234e: 53 push %ebx ioapic->reg = reg; 8010234f: c7 05 00 00 c0 fe 01 movl $0x1,0xfec00000 80102356: 00 00 00 return ioapic->data; 80102359: a1 34 26 11 80 mov 0x80112634,%eax 8010235e: 8b 58 10 mov 0x10(%eax),%ebx ioapic->reg = reg; 80102361: c7 00 00 00 00 00 movl $0x0,(%eax) return ioapic->data; 80102367: 8b 0d 34 26 11 80 mov 0x80112634,%ecx maxintr = (ioapicread(REG_VER) >> 16) & 0xFF; id = ioapicread(REG_ID) >> 24; if(id != ioapicid) 8010236d: 0f b6 15 60 27 11 80 movzbl 0x80112760,%edx maxintr = (ioapicread(REG_VER) >> 16) & 0xFF; 80102374: c1 eb 10 shr $0x10,%ebx return ioapic->data; 80102377: 8b 41 10 mov 0x10(%ecx),%eax maxintr = (ioapicread(REG_VER) >> 16) & 0xFF; 8010237a: 0f b6 db movzbl %bl,%ebx id = ioapicread(REG_ID) >> 24; 8010237d: c1 e8 18 shr $0x18,%eax if(id != ioapicid) 80102380: 39 c2 cmp %eax,%edx 80102382: 74 16 je 8010239a <ioapicinit+0x5a> cprintf("ioapicinit: id isn't equal to ioapicid; not a MP\n"); 80102384: 83 ec 0c sub $0xc,%esp 80102387: 68 10 73 10 80 push $0x80107310 8010238c: e8 cf e2 ff ff call 80100660 <cprintf> 80102391: 8b 0d 34 26 11 80 mov 0x80112634,%ecx 80102397: 83 c4 10 add $0x10,%esp 8010239a: 83 c3 21 add $0x21,%ebx { 8010239d: ba 10 00 00 00 mov $0x10,%edx 801023a2: b8 20 00 00 00 mov $0x20,%eax 801023a7: 89 f6 mov %esi,%esi 801023a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi ioapic->reg = reg; 801023b0: 89 11 mov %edx,(%ecx) ioapic->data = data; 801023b2: 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)); 801023b8: 89 c6 mov %eax,%esi 801023ba: 81 ce 00 00 01 00 or $0x10000,%esi 801023c0: 83 c0 01 add $0x1,%eax ioapic->data = data; 801023c3: 89 71 10 mov %esi,0x10(%ecx) 801023c6: 8d 72 01 lea 0x1(%edx),%esi 801023c9: 83 c2 02 add $0x2,%edx for(i = 0; i <= maxintr; i++){ 801023cc: 39 d8 cmp %ebx,%eax ioapic->reg = reg; 801023ce: 89 31 mov %esi,(%ecx) ioapic->data = data; 801023d0: 8b 0d 34 26 11 80 mov 0x80112634,%ecx 801023d6: c7 41 10 00 00 00 00 movl $0x0,0x10(%ecx) for(i = 0; i <= maxintr; i++){ 801023dd: 75 d1 jne 801023b0 <ioapicinit+0x70> ioapicwrite(REG_TABLE+2*i+1, 0); } } 801023df: 8d 65 f8 lea -0x8(%ebp),%esp 801023e2: 5b pop %ebx 801023e3: 5e pop %esi 801023e4: 5d pop %ebp 801023e5: c3 ret 801023e6: 8d 76 00 lea 0x0(%esi),%esi 801023e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801023f0 <ioapicenable>: void ioapicenable(int irq, int cpunum) { 801023f0: 55 push %ebp ioapic->reg = reg; 801023f1: 8b 0d 34 26 11 80 mov 0x80112634,%ecx { 801023f7: 89 e5 mov %esp,%ebp 801023f9: 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); 801023fc: 8d 50 20 lea 0x20(%eax),%edx 801023ff: 8d 44 00 10 lea 0x10(%eax,%eax,1),%eax ioapic->reg = reg; 80102403: 89 01 mov %eax,(%ecx) ioapic->data = data; 80102405: 8b 0d 34 26 11 80 mov 0x80112634,%ecx ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24); 8010240b: 83 c0 01 add $0x1,%eax ioapic->data = data; 8010240e: 89 51 10 mov %edx,0x10(%ecx) ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24); 80102411: 8b 55 0c mov 0xc(%ebp),%edx ioapic->reg = reg; 80102414: 89 01 mov %eax,(%ecx) ioapic->data = data; 80102416: a1 34 26 11 80 mov 0x80112634,%eax ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24); 8010241b: c1 e2 18 shl $0x18,%edx ioapic->data = data; 8010241e: 89 50 10 mov %edx,0x10(%eax) } 80102421: 5d pop %ebp 80102422: c3 ret 80102423: 66 90 xchg %ax,%ax 80102425: 66 90 xchg %ax,%ax 80102427: 66 90 xchg %ax,%ax 80102429: 66 90 xchg %ax,%ax 8010242b: 66 90 xchg %ax,%ax 8010242d: 66 90 xchg %ax,%ax 8010242f: 90 nop 80102430 <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) { 80102430: 55 push %ebp 80102431: 89 e5 mov %esp,%ebp 80102433: 53 push %ebx 80102434: 83 ec 04 sub $0x4,%esp 80102437: 8b 5d 08 mov 0x8(%ebp),%ebx struct run *r; if((uint)v % PGSIZE || v < end || V2P(v) >= PHYSTOP) 8010243a: f7 c3 ff 0f 00 00 test $0xfff,%ebx 80102440: 75 70 jne 801024b2 <kfree+0x82> 80102442: 81 fb a8 54 11 80 cmp $0x801154a8,%ebx 80102448: 72 68 jb 801024b2 <kfree+0x82> 8010244a: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax 80102450: 3d ff ff ff 0d cmp $0xdffffff,%eax 80102455: 77 5b ja 801024b2 <kfree+0x82> panic("kfree"); // Fill with junk to catch dangling refs. memset(v, 1, PGSIZE); 80102457: 83 ec 04 sub $0x4,%esp 8010245a: 68 00 10 00 00 push $0x1000 8010245f: 6a 01 push $0x1 80102461: 53 push %ebx 80102462: e8 29 21 00 00 call 80104590 <memset> if(kmem.use_lock) 80102467: 8b 15 74 26 11 80 mov 0x80112674,%edx 8010246d: 83 c4 10 add $0x10,%esp 80102470: 85 d2 test %edx,%edx 80102472: 75 2c jne 801024a0 <kfree+0x70> acquire(&kmem.lock); r = (struct run*)v; r->next = kmem.freelist; 80102474: a1 78 26 11 80 mov 0x80112678,%eax 80102479: 89 03 mov %eax,(%ebx) kmem.freelist = r; if(kmem.use_lock) 8010247b: a1 74 26 11 80 mov 0x80112674,%eax kmem.freelist = r; 80102480: 89 1d 78 26 11 80 mov %ebx,0x80112678 if(kmem.use_lock) 80102486: 85 c0 test %eax,%eax 80102488: 75 06 jne 80102490 <kfree+0x60> release(&kmem.lock); } 8010248a: 8b 5d fc mov -0x4(%ebp),%ebx 8010248d: c9 leave 8010248e: c3 ret 8010248f: 90 nop release(&kmem.lock); 80102490: c7 45 08 40 26 11 80 movl $0x80112640,0x8(%ebp) } 80102497: 8b 5d fc mov -0x4(%ebp),%ebx 8010249a: c9 leave release(&kmem.lock); 8010249b: e9 a0 20 00 00 jmp 80104540 <release> acquire(&kmem.lock); 801024a0: 83 ec 0c sub $0xc,%esp 801024a3: 68 40 26 11 80 push $0x80112640 801024a8: e8 d3 1f 00 00 call 80104480 <acquire> 801024ad: 83 c4 10 add $0x10,%esp 801024b0: eb c2 jmp 80102474 <kfree+0x44> panic("kfree"); 801024b2: 83 ec 0c sub $0xc,%esp 801024b5: 68 42 73 10 80 push $0x80107342 801024ba: e8 d1 de ff ff call 80100390 <panic> 801024bf: 90 nop 801024c0 <freerange>: { 801024c0: 55 push %ebp 801024c1: 89 e5 mov %esp,%ebp 801024c3: 56 push %esi 801024c4: 53 push %ebx p = (char*)PGROUNDUP((uint)vstart); 801024c5: 8b 45 08 mov 0x8(%ebp),%eax { 801024c8: 8b 75 0c mov 0xc(%ebp),%esi p = (char*)PGROUNDUP((uint)vstart); 801024cb: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 801024d1: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 801024d7: 81 c3 00 10 00 00 add $0x1000,%ebx 801024dd: 39 de cmp %ebx,%esi 801024df: 72 23 jb 80102504 <freerange+0x44> 801024e1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi kfree(p); 801024e8: 8d 83 00 f0 ff ff lea -0x1000(%ebx),%eax 801024ee: 83 ec 0c sub $0xc,%esp for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 801024f1: 81 c3 00 10 00 00 add $0x1000,%ebx kfree(p); 801024f7: 50 push %eax 801024f8: e8 33 ff ff ff call 80102430 <kfree> for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 801024fd: 83 c4 10 add $0x10,%esp 80102500: 39 f3 cmp %esi,%ebx 80102502: 76 e4 jbe 801024e8 <freerange+0x28> } 80102504: 8d 65 f8 lea -0x8(%ebp),%esp 80102507: 5b pop %ebx 80102508: 5e pop %esi 80102509: 5d pop %ebp 8010250a: c3 ret 8010250b: 90 nop 8010250c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102510 <kinit1>: { 80102510: 55 push %ebp 80102511: 89 e5 mov %esp,%ebp 80102513: 56 push %esi 80102514: 53 push %ebx 80102515: 8b 75 0c mov 0xc(%ebp),%esi initlock(&kmem.lock, "kmem"); 80102518: 83 ec 08 sub $0x8,%esp 8010251b: 68 48 73 10 80 push $0x80107348 80102520: 68 40 26 11 80 push $0x80112640 80102525: e8 16 1e 00 00 call 80104340 <initlock> p = (char*)PGROUNDUP((uint)vstart); 8010252a: 8b 45 08 mov 0x8(%ebp),%eax for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 8010252d: 83 c4 10 add $0x10,%esp kmem.use_lock = 0; 80102530: c7 05 74 26 11 80 00 movl $0x0,0x80112674 80102537: 00 00 00 p = (char*)PGROUNDUP((uint)vstart); 8010253a: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 80102540: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102546: 81 c3 00 10 00 00 add $0x1000,%ebx 8010254c: 39 de cmp %ebx,%esi 8010254e: 72 1c jb 8010256c <kinit1+0x5c> kfree(p); 80102550: 8d 83 00 f0 ff ff lea -0x1000(%ebx),%eax 80102556: 83 ec 0c sub $0xc,%esp for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102559: 81 c3 00 10 00 00 add $0x1000,%ebx kfree(p); 8010255f: 50 push %eax 80102560: e8 cb fe ff ff call 80102430 <kfree> for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102565: 83 c4 10 add $0x10,%esp 80102568: 39 de cmp %ebx,%esi 8010256a: 73 e4 jae 80102550 <kinit1+0x40> } 8010256c: 8d 65 f8 lea -0x8(%ebp),%esp 8010256f: 5b pop %ebx 80102570: 5e pop %esi 80102571: 5d pop %ebp 80102572: c3 ret 80102573: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80102579: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102580 <kinit2>: { 80102580: 55 push %ebp 80102581: 89 e5 mov %esp,%ebp 80102583: 56 push %esi 80102584: 53 push %ebx p = (char*)PGROUNDUP((uint)vstart); 80102585: 8b 45 08 mov 0x8(%ebp),%eax { 80102588: 8b 75 0c mov 0xc(%ebp),%esi p = (char*)PGROUNDUP((uint)vstart); 8010258b: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 80102591: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102597: 81 c3 00 10 00 00 add $0x1000,%ebx 8010259d: 39 de cmp %ebx,%esi 8010259f: 72 23 jb 801025c4 <kinit2+0x44> 801025a1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi kfree(p); 801025a8: 8d 83 00 f0 ff ff lea -0x1000(%ebx),%eax 801025ae: 83 ec 0c sub $0xc,%esp for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 801025b1: 81 c3 00 10 00 00 add $0x1000,%ebx kfree(p); 801025b7: 50 push %eax 801025b8: e8 73 fe ff ff call 80102430 <kfree> for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 801025bd: 83 c4 10 add $0x10,%esp 801025c0: 39 de cmp %ebx,%esi 801025c2: 73 e4 jae 801025a8 <kinit2+0x28> kmem.use_lock = 1; 801025c4: c7 05 74 26 11 80 01 movl $0x1,0x80112674 801025cb: 00 00 00 } 801025ce: 8d 65 f8 lea -0x8(%ebp),%esp 801025d1: 5b pop %ebx 801025d2: 5e pop %esi 801025d3: 5d pop %ebp 801025d4: c3 ret 801025d5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801025d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801025e0 <kalloc>: char* kalloc(void) { struct run *r; if(kmem.use_lock) 801025e0: a1 74 26 11 80 mov 0x80112674,%eax 801025e5: 85 c0 test %eax,%eax 801025e7: 75 1f jne 80102608 <kalloc+0x28> acquire(&kmem.lock); r = kmem.freelist; 801025e9: a1 78 26 11 80 mov 0x80112678,%eax if(r) 801025ee: 85 c0 test %eax,%eax 801025f0: 74 0e je 80102600 <kalloc+0x20> kmem.freelist = r->next; 801025f2: 8b 10 mov (%eax),%edx 801025f4: 89 15 78 26 11 80 mov %edx,0x80112678 801025fa: c3 ret 801025fb: 90 nop 801025fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(kmem.use_lock) release(&kmem.lock); return (char*)r; } 80102600: f3 c3 repz ret 80102602: 8d b6 00 00 00 00 lea 0x0(%esi),%esi { 80102608: 55 push %ebp 80102609: 89 e5 mov %esp,%ebp 8010260b: 83 ec 24 sub $0x24,%esp acquire(&kmem.lock); 8010260e: 68 40 26 11 80 push $0x80112640 80102613: e8 68 1e 00 00 call 80104480 <acquire> r = kmem.freelist; 80102618: a1 78 26 11 80 mov 0x80112678,%eax if(r) 8010261d: 83 c4 10 add $0x10,%esp 80102620: 8b 15 74 26 11 80 mov 0x80112674,%edx 80102626: 85 c0 test %eax,%eax 80102628: 74 08 je 80102632 <kalloc+0x52> kmem.freelist = r->next; 8010262a: 8b 08 mov (%eax),%ecx 8010262c: 89 0d 78 26 11 80 mov %ecx,0x80112678 if(kmem.use_lock) 80102632: 85 d2 test %edx,%edx 80102634: 74 16 je 8010264c <kalloc+0x6c> release(&kmem.lock); 80102636: 83 ec 0c sub $0xc,%esp 80102639: 89 45 f4 mov %eax,-0xc(%ebp) 8010263c: 68 40 26 11 80 push $0x80112640 80102641: e8 fa 1e 00 00 call 80104540 <release> return (char*)r; 80102646: 8b 45 f4 mov -0xc(%ebp),%eax release(&kmem.lock); 80102649: 83 c4 10 add $0x10,%esp } 8010264c: c9 leave 8010264d: c3 ret 8010264e: 66 90 xchg %ax,%ax 80102650 <kbdgetc>: asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102650: ba 64 00 00 00 mov $0x64,%edx 80102655: ec in (%dx),%al normalmap, shiftmap, ctlmap, ctlmap }; uint st, data, c; st = inb(KBSTATP); if((st & KBS_DIB) == 0) 80102656: a8 01 test $0x1,%al 80102658: 0f 84 c2 00 00 00 je 80102720 <kbdgetc+0xd0> 8010265e: ba 60 00 00 00 mov $0x60,%edx 80102663: ec in (%dx),%al return -1; data = inb(KBDATAP); 80102664: 0f b6 d0 movzbl %al,%edx 80102667: 8b 0d b4 a5 10 80 mov 0x8010a5b4,%ecx if(data == 0xE0){ 8010266d: 81 fa e0 00 00 00 cmp $0xe0,%edx 80102673: 0f 84 7f 00 00 00 je 801026f8 <kbdgetc+0xa8> { 80102679: 55 push %ebp 8010267a: 89 e5 mov %esp,%ebp 8010267c: 53 push %ebx 8010267d: 89 cb mov %ecx,%ebx 8010267f: 83 e3 40 and $0x40,%ebx shift |= E0ESC; return 0; } else if(data & 0x80){ 80102682: 84 c0 test %al,%al 80102684: 78 4a js 801026d0 <kbdgetc+0x80> // Key released data = (shift & E0ESC ? data : data & 0x7F); shift &= ~(shiftcode[data] | E0ESC); return 0; } else if(shift & E0ESC){ 80102686: 85 db test %ebx,%ebx 80102688: 74 09 je 80102693 <kbdgetc+0x43> // Last character was an E0 escape; or with 0x80 data |= 0x80; 8010268a: 83 c8 80 or $0xffffff80,%eax shift &= ~E0ESC; 8010268d: 83 e1 bf and $0xffffffbf,%ecx data |= 0x80; 80102690: 0f b6 d0 movzbl %al,%edx } shift |= shiftcode[data]; 80102693: 0f b6 82 80 74 10 80 movzbl -0x7fef8b80(%edx),%eax 8010269a: 09 c1 or %eax,%ecx shift ^= togglecode[data]; 8010269c: 0f b6 82 80 73 10 80 movzbl -0x7fef8c80(%edx),%eax 801026a3: 31 c1 xor %eax,%ecx c = charcode[shift & (CTL | SHIFT)][data]; 801026a5: 89 c8 mov %ecx,%eax shift ^= togglecode[data]; 801026a7: 89 0d b4 a5 10 80 mov %ecx,0x8010a5b4 c = charcode[shift & (CTL | SHIFT)][data]; 801026ad: 83 e0 03 and $0x3,%eax if(shift & CAPSLOCK){ 801026b0: 83 e1 08 and $0x8,%ecx c = charcode[shift & (CTL | SHIFT)][data]; 801026b3: 8b 04 85 60 73 10 80 mov -0x7fef8ca0(,%eax,4),%eax 801026ba: 0f b6 04 10 movzbl (%eax,%edx,1),%eax if(shift & CAPSLOCK){ 801026be: 74 31 je 801026f1 <kbdgetc+0xa1> if('a' <= c && c <= 'z') 801026c0: 8d 50 9f lea -0x61(%eax),%edx 801026c3: 83 fa 19 cmp $0x19,%edx 801026c6: 77 40 ja 80102708 <kbdgetc+0xb8> c += 'A' - 'a'; 801026c8: 83 e8 20 sub $0x20,%eax else if('A' <= c && c <= 'Z') c += 'a' - 'A'; } return c; } 801026cb: 5b pop %ebx 801026cc: 5d pop %ebp 801026cd: c3 ret 801026ce: 66 90 xchg %ax,%ax data = (shift & E0ESC ? data : data & 0x7F); 801026d0: 83 e0 7f and $0x7f,%eax 801026d3: 85 db test %ebx,%ebx 801026d5: 0f 44 d0 cmove %eax,%edx shift &= ~(shiftcode[data] | E0ESC); 801026d8: 0f b6 82 80 74 10 80 movzbl -0x7fef8b80(%edx),%eax 801026df: 83 c8 40 or $0x40,%eax 801026e2: 0f b6 c0 movzbl %al,%eax 801026e5: f7 d0 not %eax 801026e7: 21 c1 and %eax,%ecx return 0; 801026e9: 31 c0 xor %eax,%eax shift &= ~(shiftcode[data] | E0ESC); 801026eb: 89 0d b4 a5 10 80 mov %ecx,0x8010a5b4 } 801026f1: 5b pop %ebx 801026f2: 5d pop %ebp 801026f3: c3 ret 801026f4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi shift |= E0ESC; 801026f8: 83 c9 40 or $0x40,%ecx return 0; 801026fb: 31 c0 xor %eax,%eax shift |= E0ESC; 801026fd: 89 0d b4 a5 10 80 mov %ecx,0x8010a5b4 return 0; 80102703: c3 ret 80102704: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi else if('A' <= c && c <= 'Z') 80102708: 8d 48 bf lea -0x41(%eax),%ecx c += 'a' - 'A'; 8010270b: 8d 50 20 lea 0x20(%eax),%edx } 8010270e: 5b pop %ebx c += 'a' - 'A'; 8010270f: 83 f9 1a cmp $0x1a,%ecx 80102712: 0f 42 c2 cmovb %edx,%eax } 80102715: 5d pop %ebp 80102716: c3 ret 80102717: 89 f6 mov %esi,%esi 80102719: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi return -1; 80102720: b8 ff ff ff ff mov $0xffffffff,%eax } 80102725: c3 ret 80102726: 8d 76 00 lea 0x0(%esi),%esi 80102729: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102730 <kbdintr>: void kbdintr(void) { 80102730: 55 push %ebp 80102731: 89 e5 mov %esp,%ebp 80102733: 83 ec 14 sub $0x14,%esp consoleintr(kbdgetc); 80102736: 68 50 26 10 80 push $0x80102650 8010273b: e8 d0 e0 ff ff call 80100810 <consoleintr> } 80102740: 83 c4 10 add $0x10,%esp 80102743: c9 leave 80102744: c3 ret 80102745: 66 90 xchg %ax,%ax 80102747: 66 90 xchg %ax,%ax 80102749: 66 90 xchg %ax,%ax 8010274b: 66 90 xchg %ax,%ax 8010274d: 66 90 xchg %ax,%ax 8010274f: 90 nop 80102750 <lapicinit>: } void lapicinit(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: 0f 84 c8 00 00 00 je 80102828 <lapicinit+0xd8> lapic[index] = value; 80102760: c7 80 f0 00 00 00 3f movl $0x13f,0xf0(%eax) 80102767: 01 00 00 lapic[ID]; // wait for write to finish, by reading 8010276a: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 8010276d: c7 80 e0 03 00 00 0b movl $0xb,0x3e0(%eax) 80102774: 00 00 00 lapic[ID]; // wait for write to finish, by reading 80102777: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 8010277a: c7 80 20 03 00 00 20 movl $0x20020,0x320(%eax) 80102781: 00 02 00 lapic[ID]; // wait for write to finish, by reading 80102784: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 80102787: c7 80 80 03 00 00 80 movl $0x989680,0x380(%eax) 8010278e: 96 98 00 lapic[ID]; // wait for write to finish, by reading 80102791: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 80102794: c7 80 50 03 00 00 00 movl $0x10000,0x350(%eax) 8010279b: 00 01 00 lapic[ID]; // wait for write to finish, by reading 8010279e: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801027a1: c7 80 60 03 00 00 00 movl $0x10000,0x360(%eax) 801027a8: 00 01 00 lapic[ID]; // wait for write to finish, by reading 801027ab: 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) 801027ae: 8b 50 30 mov 0x30(%eax),%edx 801027b1: c1 ea 10 shr $0x10,%edx 801027b4: 80 fa 03 cmp $0x3,%dl 801027b7: 77 77 ja 80102830 <lapicinit+0xe0> lapic[index] = value; 801027b9: c7 80 70 03 00 00 33 movl $0x33,0x370(%eax) 801027c0: 00 00 00 lapic[ID]; // wait for write to finish, by reading 801027c3: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801027c6: c7 80 80 02 00 00 00 movl $0x0,0x280(%eax) 801027cd: 00 00 00 lapic[ID]; // wait for write to finish, by reading 801027d0: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801027d3: c7 80 80 02 00 00 00 movl $0x0,0x280(%eax) 801027da: 00 00 00 lapic[ID]; // wait for write to finish, by reading 801027dd: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801027e0: c7 80 b0 00 00 00 00 movl $0x0,0xb0(%eax) 801027e7: 00 00 00 lapic[ID]; // wait for write to finish, by reading 801027ea: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801027ed: c7 80 10 03 00 00 00 movl $0x0,0x310(%eax) 801027f4: 00 00 00 lapic[ID]; // wait for write to finish, by reading 801027f7: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801027fa: c7 80 00 03 00 00 00 movl $0x88500,0x300(%eax) 80102801: 85 08 00 lapic[ID]; // wait for write to finish, by reading 80102804: 8b 50 20 mov 0x20(%eax),%edx 80102807: 89 f6 mov %esi,%esi 80102809: 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) 80102810: 8b 90 00 03 00 00 mov 0x300(%eax),%edx 80102816: 80 e6 10 and $0x10,%dh 80102819: 75 f5 jne 80102810 <lapicinit+0xc0> lapic[index] = value; 8010281b: c7 80 80 00 00 00 00 movl $0x0,0x80(%eax) 80102822: 00 00 00 lapic[ID]; // wait for write to finish, by reading 80102825: 8b 40 20 mov 0x20(%eax),%eax ; // Enable interrupts on the APIC (but not on the processor). lapicw(TPR, 0); } 80102828: 5d pop %ebp 80102829: c3 ret 8010282a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi lapic[index] = value; 80102830: c7 80 40 03 00 00 00 movl $0x10000,0x340(%eax) 80102837: 00 01 00 lapic[ID]; // wait for write to finish, by reading 8010283a: 8b 50 20 mov 0x20(%eax),%edx 8010283d: e9 77 ff ff ff jmp 801027b9 <lapicinit+0x69> 80102842: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80102849: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102850 <lapicid>: int lapicid(void) { if (!lapic) 80102850: 8b 15 7c 26 11 80 mov 0x8011267c,%edx { 80102856: 55 push %ebp 80102857: 31 c0 xor %eax,%eax 80102859: 89 e5 mov %esp,%ebp if (!lapic) 8010285b: 85 d2 test %edx,%edx 8010285d: 74 06 je 80102865 <lapicid+0x15> return 0; return lapic[ID] >> 24; 8010285f: 8b 42 20 mov 0x20(%edx),%eax 80102862: c1 e8 18 shr $0x18,%eax } 80102865: 5d pop %ebp 80102866: c3 ret 80102867: 89 f6 mov %esi,%esi 80102869: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102870 <lapiceoi>: // Acknowledge interrupt. void lapiceoi(void) { if(lapic) 80102870: a1 7c 26 11 80 mov 0x8011267c,%eax { 80102875: 55 push %ebp 80102876: 89 e5 mov %esp,%ebp if(lapic) 80102878: 85 c0 test %eax,%eax 8010287a: 74 0d je 80102889 <lapiceoi+0x19> lapic[index] = value; 8010287c: c7 80 b0 00 00 00 00 movl $0x0,0xb0(%eax) 80102883: 00 00 00 lapic[ID]; // wait for write to finish, by reading 80102886: 8b 40 20 mov 0x20(%eax),%eax lapicw(EOI, 0); } 80102889: 5d pop %ebp 8010288a: c3 ret 8010288b: 90 nop 8010288c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102890 <microdelay>: // Spin for a given number of microseconds. // On real hardware would want to tune this dynamically. void microdelay(int us) { 80102890: 55 push %ebp 80102891: 89 e5 mov %esp,%ebp } 80102893: 5d pop %ebp 80102894: c3 ret 80102895: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102899: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801028a0 <lapicstartap>: // Start additional processor running entry code at addr. // See Appendix B of MultiProcessor Specification. void lapicstartap(uchar apicid, uint addr) { 801028a0: 55 push %ebp asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801028a1: b8 0f 00 00 00 mov $0xf,%eax 801028a6: ba 70 00 00 00 mov $0x70,%edx 801028ab: 89 e5 mov %esp,%ebp 801028ad: 53 push %ebx 801028ae: 8b 4d 0c mov 0xc(%ebp),%ecx 801028b1: 8b 5d 08 mov 0x8(%ebp),%ebx 801028b4: ee out %al,(%dx) 801028b5: b8 0a 00 00 00 mov $0xa,%eax 801028ba: ba 71 00 00 00 mov $0x71,%edx 801028bf: 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; 801028c0: 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); 801028c2: c1 e3 18 shl $0x18,%ebx wrv[0] = 0; 801028c5: 66 a3 67 04 00 80 mov %ax,0x80000467 wrv[1] = addr >> 4; 801028cb: 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)); 801028cd: c1 e9 0c shr $0xc,%ecx wrv[1] = addr >> 4; 801028d0: c1 e8 04 shr $0x4,%eax lapicw(ICRHI, apicid<<24); 801028d3: 89 da mov %ebx,%edx lapicw(ICRLO, STARTUP | (addr>>12)); 801028d5: 80 cd 06 or $0x6,%ch wrv[1] = addr >> 4; 801028d8: 66 a3 69 04 00 80 mov %ax,0x80000469 lapic[index] = value; 801028de: a1 7c 26 11 80 mov 0x8011267c,%eax 801028e3: 89 98 10 03 00 00 mov %ebx,0x310(%eax) lapic[ID]; // wait for write to finish, by reading 801028e9: 8b 58 20 mov 0x20(%eax),%ebx lapic[index] = value; 801028ec: c7 80 00 03 00 00 00 movl $0xc500,0x300(%eax) 801028f3: c5 00 00 lapic[ID]; // wait for write to finish, by reading 801028f6: 8b 58 20 mov 0x20(%eax),%ebx lapic[index] = value; 801028f9: c7 80 00 03 00 00 00 movl $0x8500,0x300(%eax) 80102900: 85 00 00 lapic[ID]; // wait for write to finish, by reading 80102903: 8b 58 20 mov 0x20(%eax),%ebx lapic[index] = value; 80102906: 89 90 10 03 00 00 mov %edx,0x310(%eax) lapic[ID]; // wait for write to finish, by reading 8010290c: 8b 58 20 mov 0x20(%eax),%ebx lapic[index] = value; 8010290f: 89 88 00 03 00 00 mov %ecx,0x300(%eax) lapic[ID]; // wait for write to finish, by reading 80102915: 8b 58 20 mov 0x20(%eax),%ebx lapic[index] = value; 80102918: 89 90 10 03 00 00 mov %edx,0x310(%eax) lapic[ID]; // wait for write to finish, by reading 8010291e: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 80102921: 89 88 00 03 00 00 mov %ecx,0x300(%eax) lapic[ID]; // wait for write to finish, by reading 80102927: 8b 40 20 mov 0x20(%eax),%eax microdelay(200); } } 8010292a: 5b pop %ebx 8010292b: 5d pop %ebp 8010292c: c3 ret 8010292d: 8d 76 00 lea 0x0(%esi),%esi 80102930 <cmostime>: } // qemu seems to use 24-hour GWT and the values are BCD encoded void cmostime(struct rtcdate *r) { 80102930: 55 push %ebp 80102931: b8 0b 00 00 00 mov $0xb,%eax 80102936: ba 70 00 00 00 mov $0x70,%edx 8010293b: 89 e5 mov %esp,%ebp 8010293d: 57 push %edi 8010293e: 56 push %esi 8010293f: 53 push %ebx 80102940: 83 ec 4c sub $0x4c,%esp 80102943: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102944: ba 71 00 00 00 mov $0x71,%edx 80102949: ec in (%dx),%al 8010294a: 83 e0 04 and $0x4,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 8010294d: bb 70 00 00 00 mov $0x70,%ebx 80102952: 88 45 b3 mov %al,-0x4d(%ebp) 80102955: 8d 76 00 lea 0x0(%esi),%esi 80102958: 31 c0 xor %eax,%eax 8010295a: 89 da mov %ebx,%edx 8010295c: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010295d: b9 71 00 00 00 mov $0x71,%ecx 80102962: 89 ca mov %ecx,%edx 80102964: ec in (%dx),%al 80102965: 88 45 b7 mov %al,-0x49(%ebp) asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102968: 89 da mov %ebx,%edx 8010296a: b8 02 00 00 00 mov $0x2,%eax 8010296f: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102970: 89 ca mov %ecx,%edx 80102972: ec in (%dx),%al 80102973: 88 45 b6 mov %al,-0x4a(%ebp) asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102976: 89 da mov %ebx,%edx 80102978: b8 04 00 00 00 mov $0x4,%eax 8010297d: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010297e: 89 ca mov %ecx,%edx 80102980: ec in (%dx),%al 80102981: 88 45 b5 mov %al,-0x4b(%ebp) asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102984: 89 da mov %ebx,%edx 80102986: b8 07 00 00 00 mov $0x7,%eax 8010298b: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010298c: 89 ca mov %ecx,%edx 8010298e: ec in (%dx),%al 8010298f: 88 45 b4 mov %al,-0x4c(%ebp) asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102992: 89 da mov %ebx,%edx 80102994: b8 08 00 00 00 mov $0x8,%eax 80102999: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010299a: 89 ca mov %ecx,%edx 8010299c: ec in (%dx),%al 8010299d: 89 c7 mov %eax,%edi asm volatile("out %0,%1" : : "a" (data), "d" (port)); 8010299f: 89 da mov %ebx,%edx 801029a1: b8 09 00 00 00 mov $0x9,%eax 801029a6: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801029a7: 89 ca mov %ecx,%edx 801029a9: ec in (%dx),%al 801029aa: 89 c6 mov %eax,%esi asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801029ac: 89 da mov %ebx,%edx 801029ae: b8 0a 00 00 00 mov $0xa,%eax 801029b3: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801029b4: 89 ca mov %ecx,%edx 801029b6: 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) 801029b7: 84 c0 test %al,%al 801029b9: 78 9d js 80102958 <cmostime+0x28> return inb(CMOS_RETURN); 801029bb: 0f b6 45 b7 movzbl -0x49(%ebp),%eax 801029bf: 89 fa mov %edi,%edx 801029c1: 0f b6 fa movzbl %dl,%edi 801029c4: 89 f2 mov %esi,%edx 801029c6: 0f b6 f2 movzbl %dl,%esi 801029c9: 89 7d c8 mov %edi,-0x38(%ebp) asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801029cc: 89 da mov %ebx,%edx 801029ce: 89 75 cc mov %esi,-0x34(%ebp) 801029d1: 89 45 b8 mov %eax,-0x48(%ebp) 801029d4: 0f b6 45 b6 movzbl -0x4a(%ebp),%eax 801029d8: 89 45 bc mov %eax,-0x44(%ebp) 801029db: 0f b6 45 b5 movzbl -0x4b(%ebp),%eax 801029df: 89 45 c0 mov %eax,-0x40(%ebp) 801029e2: 0f b6 45 b4 movzbl -0x4c(%ebp),%eax 801029e6: 89 45 c4 mov %eax,-0x3c(%ebp) 801029e9: 31 c0 xor %eax,%eax 801029eb: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801029ec: 89 ca mov %ecx,%edx 801029ee: ec in (%dx),%al 801029ef: 0f b6 c0 movzbl %al,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801029f2: 89 da mov %ebx,%edx 801029f4: 89 45 d0 mov %eax,-0x30(%ebp) 801029f7: b8 02 00 00 00 mov $0x2,%eax 801029fc: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801029fd: 89 ca mov %ecx,%edx 801029ff: ec in (%dx),%al 80102a00: 0f b6 c0 movzbl %al,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102a03: 89 da mov %ebx,%edx 80102a05: 89 45 d4 mov %eax,-0x2c(%ebp) 80102a08: b8 04 00 00 00 mov $0x4,%eax 80102a0d: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102a0e: 89 ca mov %ecx,%edx 80102a10: ec in (%dx),%al 80102a11: 0f b6 c0 movzbl %al,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102a14: 89 da mov %ebx,%edx 80102a16: 89 45 d8 mov %eax,-0x28(%ebp) 80102a19: b8 07 00 00 00 mov $0x7,%eax 80102a1e: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102a1f: 89 ca mov %ecx,%edx 80102a21: ec in (%dx),%al 80102a22: 0f b6 c0 movzbl %al,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102a25: 89 da mov %ebx,%edx 80102a27: 89 45 dc mov %eax,-0x24(%ebp) 80102a2a: b8 08 00 00 00 mov $0x8,%eax 80102a2f: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102a30: 89 ca mov %ecx,%edx 80102a32: ec in (%dx),%al 80102a33: 0f b6 c0 movzbl %al,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102a36: 89 da mov %ebx,%edx 80102a38: 89 45 e0 mov %eax,-0x20(%ebp) 80102a3b: b8 09 00 00 00 mov $0x9,%eax 80102a40: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102a41: 89 ca mov %ecx,%edx 80102a43: ec in (%dx),%al 80102a44: 0f b6 c0 movzbl %al,%eax continue; fill_rtcdate(&t2); if(memcmp(&t1, &t2, sizeof(t1)) == 0) 80102a47: 83 ec 04 sub $0x4,%esp return inb(CMOS_RETURN); 80102a4a: 89 45 e4 mov %eax,-0x1c(%ebp) if(memcmp(&t1, &t2, sizeof(t1)) == 0) 80102a4d: 8d 45 d0 lea -0x30(%ebp),%eax 80102a50: 6a 18 push $0x18 80102a52: 50 push %eax 80102a53: 8d 45 b8 lea -0x48(%ebp),%eax 80102a56: 50 push %eax 80102a57: e8 84 1b 00 00 call 801045e0 <memcmp> 80102a5c: 83 c4 10 add $0x10,%esp 80102a5f: 85 c0 test %eax,%eax 80102a61: 0f 85 f1 fe ff ff jne 80102958 <cmostime+0x28> break; } // convert if(bcd) { 80102a67: 80 7d b3 00 cmpb $0x0,-0x4d(%ebp) 80102a6b: 75 78 jne 80102ae5 <cmostime+0x1b5> #define CONV(x) (t1.x = ((t1.x >> 4) * 10) + (t1.x & 0xf)) CONV(second); 80102a6d: 8b 45 b8 mov -0x48(%ebp),%eax 80102a70: 89 c2 mov %eax,%edx 80102a72: 83 e0 0f and $0xf,%eax 80102a75: c1 ea 04 shr $0x4,%edx 80102a78: 8d 14 92 lea (%edx,%edx,4),%edx 80102a7b: 8d 04 50 lea (%eax,%edx,2),%eax 80102a7e: 89 45 b8 mov %eax,-0x48(%ebp) CONV(minute); 80102a81: 8b 45 bc mov -0x44(%ebp),%eax 80102a84: 89 c2 mov %eax,%edx 80102a86: 83 e0 0f and $0xf,%eax 80102a89: c1 ea 04 shr $0x4,%edx 80102a8c: 8d 14 92 lea (%edx,%edx,4),%edx 80102a8f: 8d 04 50 lea (%eax,%edx,2),%eax 80102a92: 89 45 bc mov %eax,-0x44(%ebp) CONV(hour ); 80102a95: 8b 45 c0 mov -0x40(%ebp),%eax 80102a98: 89 c2 mov %eax,%edx 80102a9a: 83 e0 0f and $0xf,%eax 80102a9d: c1 ea 04 shr $0x4,%edx 80102aa0: 8d 14 92 lea (%edx,%edx,4),%edx 80102aa3: 8d 04 50 lea (%eax,%edx,2),%eax 80102aa6: 89 45 c0 mov %eax,-0x40(%ebp) CONV(day ); 80102aa9: 8b 45 c4 mov -0x3c(%ebp),%eax 80102aac: 89 c2 mov %eax,%edx 80102aae: 83 e0 0f and $0xf,%eax 80102ab1: c1 ea 04 shr $0x4,%edx 80102ab4: 8d 14 92 lea (%edx,%edx,4),%edx 80102ab7: 8d 04 50 lea (%eax,%edx,2),%eax 80102aba: 89 45 c4 mov %eax,-0x3c(%ebp) CONV(month ); 80102abd: 8b 45 c8 mov -0x38(%ebp),%eax 80102ac0: 89 c2 mov %eax,%edx 80102ac2: 83 e0 0f and $0xf,%eax 80102ac5: c1 ea 04 shr $0x4,%edx 80102ac8: 8d 14 92 lea (%edx,%edx,4),%edx 80102acb: 8d 04 50 lea (%eax,%edx,2),%eax 80102ace: 89 45 c8 mov %eax,-0x38(%ebp) CONV(year ); 80102ad1: 8b 45 cc mov -0x34(%ebp),%eax 80102ad4: 89 c2 mov %eax,%edx 80102ad6: 83 e0 0f and $0xf,%eax 80102ad9: c1 ea 04 shr $0x4,%edx 80102adc: 8d 14 92 lea (%edx,%edx,4),%edx 80102adf: 8d 04 50 lea (%eax,%edx,2),%eax 80102ae2: 89 45 cc mov %eax,-0x34(%ebp) #undef CONV } *r = t1; 80102ae5: 8b 75 08 mov 0x8(%ebp),%esi 80102ae8: 8b 45 b8 mov -0x48(%ebp),%eax 80102aeb: 89 06 mov %eax,(%esi) 80102aed: 8b 45 bc mov -0x44(%ebp),%eax 80102af0: 89 46 04 mov %eax,0x4(%esi) 80102af3: 8b 45 c0 mov -0x40(%ebp),%eax 80102af6: 89 46 08 mov %eax,0x8(%esi) 80102af9: 8b 45 c4 mov -0x3c(%ebp),%eax 80102afc: 89 46 0c mov %eax,0xc(%esi) 80102aff: 8b 45 c8 mov -0x38(%ebp),%eax 80102b02: 89 46 10 mov %eax,0x10(%esi) 80102b05: 8b 45 cc mov -0x34(%ebp),%eax 80102b08: 89 46 14 mov %eax,0x14(%esi) r->year += 2000; 80102b0b: 81 46 14 d0 07 00 00 addl $0x7d0,0x14(%esi) } 80102b12: 8d 65 f4 lea -0xc(%ebp),%esp 80102b15: 5b pop %ebx 80102b16: 5e pop %esi 80102b17: 5f pop %edi 80102b18: 5d pop %ebp 80102b19: c3 ret 80102b1a: 66 90 xchg %ax,%ax 80102b1c: 66 90 xchg %ax,%ax 80102b1e: 66 90 xchg %ax,%ax 80102b20 <install_trans>: static void install_trans(void) { int tail; for (tail = 0; tail < log.lh.n; tail++) { 80102b20: 8b 0d c8 26 11 80 mov 0x801126c8,%ecx 80102b26: 85 c9 test %ecx,%ecx 80102b28: 0f 8e 8a 00 00 00 jle 80102bb8 <install_trans+0x98> { 80102b2e: 55 push %ebp 80102b2f: 89 e5 mov %esp,%ebp 80102b31: 57 push %edi 80102b32: 56 push %esi 80102b33: 53 push %ebx for (tail = 0; tail < log.lh.n; tail++) { 80102b34: 31 db xor %ebx,%ebx { 80102b36: 83 ec 0c sub $0xc,%esp 80102b39: 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 80102b40: a1 b4 26 11 80 mov 0x801126b4,%eax 80102b45: 83 ec 08 sub $0x8,%esp 80102b48: 01 d8 add %ebx,%eax 80102b4a: 83 c0 01 add $0x1,%eax 80102b4d: 50 push %eax 80102b4e: ff 35 c4 26 11 80 pushl 0x801126c4 80102b54: e8 77 d5 ff ff call 801000d0 <bread> 80102b59: 89 c7 mov %eax,%edi struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst 80102b5b: 58 pop %eax 80102b5c: 5a pop %edx 80102b5d: ff 34 9d cc 26 11 80 pushl -0x7feed934(,%ebx,4) 80102b64: ff 35 c4 26 11 80 pushl 0x801126c4 for (tail = 0; tail < log.lh.n; tail++) { 80102b6a: 83 c3 01 add $0x1,%ebx struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst 80102b6d: e8 5e d5 ff ff call 801000d0 <bread> 80102b72: 89 c6 mov %eax,%esi memmove(dbuf->data, lbuf->data, BSIZE); // copy block to dst 80102b74: 8d 47 5c lea 0x5c(%edi),%eax 80102b77: 83 c4 0c add $0xc,%esp 80102b7a: 68 00 02 00 00 push $0x200 80102b7f: 50 push %eax 80102b80: 8d 46 5c lea 0x5c(%esi),%eax 80102b83: 50 push %eax 80102b84: e8 b7 1a 00 00 call 80104640 <memmove> bwrite(dbuf); // write dst to disk 80102b89: 89 34 24 mov %esi,(%esp) 80102b8c: e8 0f d6 ff ff call 801001a0 <bwrite> brelse(lbuf); 80102b91: 89 3c 24 mov %edi,(%esp) 80102b94: e8 47 d6 ff ff call 801001e0 <brelse> brelse(dbuf); 80102b99: 89 34 24 mov %esi,(%esp) 80102b9c: e8 3f d6 ff ff call 801001e0 <brelse> for (tail = 0; tail < log.lh.n; tail++) { 80102ba1: 83 c4 10 add $0x10,%esp 80102ba4: 39 1d c8 26 11 80 cmp %ebx,0x801126c8 80102baa: 7f 94 jg 80102b40 <install_trans+0x20> } } 80102bac: 8d 65 f4 lea -0xc(%ebp),%esp 80102baf: 5b pop %ebx 80102bb0: 5e pop %esi 80102bb1: 5f pop %edi 80102bb2: 5d pop %ebp 80102bb3: c3 ret 80102bb4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102bb8: f3 c3 repz ret 80102bba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80102bc0 <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) { 80102bc0: 55 push %ebp 80102bc1: 89 e5 mov %esp,%ebp 80102bc3: 56 push %esi 80102bc4: 53 push %ebx struct buf *buf = bread(log.dev, log.start); 80102bc5: 83 ec 08 sub $0x8,%esp 80102bc8: ff 35 b4 26 11 80 pushl 0x801126b4 80102bce: ff 35 c4 26 11 80 pushl 0x801126c4 80102bd4: e8 f7 d4 ff ff call 801000d0 <bread> struct logheader *hb = (struct logheader *) (buf->data); int i; hb->n = log.lh.n; 80102bd9: 8b 1d c8 26 11 80 mov 0x801126c8,%ebx for (i = 0; i < log.lh.n; i++) { 80102bdf: 83 c4 10 add $0x10,%esp struct buf *buf = bread(log.dev, log.start); 80102be2: 89 c6 mov %eax,%esi for (i = 0; i < log.lh.n; i++) { 80102be4: 85 db test %ebx,%ebx hb->n = log.lh.n; 80102be6: 89 58 5c mov %ebx,0x5c(%eax) for (i = 0; i < log.lh.n; i++) { 80102be9: 7e 16 jle 80102c01 <write_head+0x41> 80102beb: c1 e3 02 shl $0x2,%ebx 80102bee: 31 d2 xor %edx,%edx hb->block[i] = log.lh.block[i]; 80102bf0: 8b 8a cc 26 11 80 mov -0x7feed934(%edx),%ecx 80102bf6: 89 4c 16 60 mov %ecx,0x60(%esi,%edx,1) 80102bfa: 83 c2 04 add $0x4,%edx for (i = 0; i < log.lh.n; i++) { 80102bfd: 39 da cmp %ebx,%edx 80102bff: 75 ef jne 80102bf0 <write_head+0x30> } bwrite(buf); 80102c01: 83 ec 0c sub $0xc,%esp 80102c04: 56 push %esi 80102c05: e8 96 d5 ff ff call 801001a0 <bwrite> brelse(buf); 80102c0a: 89 34 24 mov %esi,(%esp) 80102c0d: e8 ce d5 ff ff call 801001e0 <brelse> } 80102c12: 83 c4 10 add $0x10,%esp 80102c15: 8d 65 f8 lea -0x8(%ebp),%esp 80102c18: 5b pop %ebx 80102c19: 5e pop %esi 80102c1a: 5d pop %ebp 80102c1b: c3 ret 80102c1c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102c20 <initlog>: { 80102c20: 55 push %ebp 80102c21: 89 e5 mov %esp,%ebp 80102c23: 53 push %ebx 80102c24: 83 ec 2c sub $0x2c,%esp 80102c27: 8b 5d 08 mov 0x8(%ebp),%ebx initlock(&log.lock, "log"); 80102c2a: 68 80 75 10 80 push $0x80107580 80102c2f: 68 80 26 11 80 push $0x80112680 80102c34: e8 07 17 00 00 call 80104340 <initlock> readsb(dev, &sb); 80102c39: 58 pop %eax 80102c3a: 8d 45 dc lea -0x24(%ebp),%eax 80102c3d: 5a pop %edx 80102c3e: 50 push %eax 80102c3f: 53 push %ebx 80102c40: e8 8b e7 ff ff call 801013d0 <readsb> log.size = sb.nlog; 80102c45: 8b 55 e8 mov -0x18(%ebp),%edx log.start = sb.logstart; 80102c48: 8b 45 ec mov -0x14(%ebp),%eax struct buf *buf = bread(log.dev, log.start); 80102c4b: 59 pop %ecx log.dev = dev; 80102c4c: 89 1d c4 26 11 80 mov %ebx,0x801126c4 log.size = sb.nlog; 80102c52: 89 15 b8 26 11 80 mov %edx,0x801126b8 log.start = sb.logstart; 80102c58: a3 b4 26 11 80 mov %eax,0x801126b4 struct buf *buf = bread(log.dev, log.start); 80102c5d: 5a pop %edx 80102c5e: 50 push %eax 80102c5f: 53 push %ebx 80102c60: e8 6b d4 ff ff call 801000d0 <bread> log.lh.n = lh->n; 80102c65: 8b 58 5c mov 0x5c(%eax),%ebx for (i = 0; i < log.lh.n; i++) { 80102c68: 83 c4 10 add $0x10,%esp 80102c6b: 85 db test %ebx,%ebx log.lh.n = lh->n; 80102c6d: 89 1d c8 26 11 80 mov %ebx,0x801126c8 for (i = 0; i < log.lh.n; i++) { 80102c73: 7e 1c jle 80102c91 <initlog+0x71> 80102c75: c1 e3 02 shl $0x2,%ebx 80102c78: 31 d2 xor %edx,%edx 80102c7a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi log.lh.block[i] = lh->block[i]; 80102c80: 8b 4c 10 60 mov 0x60(%eax,%edx,1),%ecx 80102c84: 83 c2 04 add $0x4,%edx 80102c87: 89 8a c8 26 11 80 mov %ecx,-0x7feed938(%edx) for (i = 0; i < log.lh.n; i++) { 80102c8d: 39 d3 cmp %edx,%ebx 80102c8f: 75 ef jne 80102c80 <initlog+0x60> brelse(buf); 80102c91: 83 ec 0c sub $0xc,%esp 80102c94: 50 push %eax 80102c95: e8 46 d5 ff ff call 801001e0 <brelse> static void recover_from_log(void) { read_head(); install_trans(); // if committed, copy from log to disk 80102c9a: e8 81 fe ff ff call 80102b20 <install_trans> log.lh.n = 0; 80102c9f: c7 05 c8 26 11 80 00 movl $0x0,0x801126c8 80102ca6: 00 00 00 write_head(); // clear the log 80102ca9: e8 12 ff ff ff call 80102bc0 <write_head> } 80102cae: 83 c4 10 add $0x10,%esp 80102cb1: 8b 5d fc mov -0x4(%ebp),%ebx 80102cb4: c9 leave 80102cb5: c3 ret 80102cb6: 8d 76 00 lea 0x0(%esi),%esi 80102cb9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102cc0 <begin_op>: } // called at the start of each FS system call. void begin_op(void) { 80102cc0: 55 push %ebp 80102cc1: 89 e5 mov %esp,%ebp 80102cc3: 83 ec 14 sub $0x14,%esp acquire(&log.lock); 80102cc6: 68 80 26 11 80 push $0x80112680 80102ccb: e8 b0 17 00 00 call 80104480 <acquire> 80102cd0: 83 c4 10 add $0x10,%esp 80102cd3: eb 18 jmp 80102ced <begin_op+0x2d> 80102cd5: 8d 76 00 lea 0x0(%esi),%esi while(1){ if(log.committing){ sleep(&log, &log.lock); 80102cd8: 83 ec 08 sub $0x8,%esp 80102cdb: 68 80 26 11 80 push $0x80112680 80102ce0: 68 80 26 11 80 push $0x80112680 80102ce5: e8 d6 11 00 00 call 80103ec0 <sleep> 80102cea: 83 c4 10 add $0x10,%esp if(log.committing){ 80102ced: a1 c0 26 11 80 mov 0x801126c0,%eax 80102cf2: 85 c0 test %eax,%eax 80102cf4: 75 e2 jne 80102cd8 <begin_op+0x18> } else if(log.lh.n + (log.outstanding+1)*MAXOPBLOCKS > LOGSIZE){ 80102cf6: a1 bc 26 11 80 mov 0x801126bc,%eax 80102cfb: 8b 15 c8 26 11 80 mov 0x801126c8,%edx 80102d01: 83 c0 01 add $0x1,%eax 80102d04: 8d 0c 80 lea (%eax,%eax,4),%ecx 80102d07: 8d 14 4a lea (%edx,%ecx,2),%edx 80102d0a: 83 fa 1e cmp $0x1e,%edx 80102d0d: 7f c9 jg 80102cd8 <begin_op+0x18> // this op might exhaust log space; wait for commit. sleep(&log, &log.lock); } else { log.outstanding += 1; release(&log.lock); 80102d0f: 83 ec 0c sub $0xc,%esp log.outstanding += 1; 80102d12: a3 bc 26 11 80 mov %eax,0x801126bc release(&log.lock); 80102d17: 68 80 26 11 80 push $0x80112680 80102d1c: e8 1f 18 00 00 call 80104540 <release> break; } } } 80102d21: 83 c4 10 add $0x10,%esp 80102d24: c9 leave 80102d25: c3 ret 80102d26: 8d 76 00 lea 0x0(%esi),%esi 80102d29: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102d30 <end_op>: // called at the end of each FS system call. // commits if this was the last outstanding operation. void end_op(void) { 80102d30: 55 push %ebp 80102d31: 89 e5 mov %esp,%ebp 80102d33: 57 push %edi 80102d34: 56 push %esi 80102d35: 53 push %ebx 80102d36: 83 ec 18 sub $0x18,%esp int do_commit = 0; acquire(&log.lock); 80102d39: 68 80 26 11 80 push $0x80112680 80102d3e: e8 3d 17 00 00 call 80104480 <acquire> log.outstanding -= 1; 80102d43: a1 bc 26 11 80 mov 0x801126bc,%eax if(log.committing) 80102d48: 8b 35 c0 26 11 80 mov 0x801126c0,%esi 80102d4e: 83 c4 10 add $0x10,%esp log.outstanding -= 1; 80102d51: 8d 58 ff lea -0x1(%eax),%ebx if(log.committing) 80102d54: 85 f6 test %esi,%esi log.outstanding -= 1; 80102d56: 89 1d bc 26 11 80 mov %ebx,0x801126bc if(log.committing) 80102d5c: 0f 85 1a 01 00 00 jne 80102e7c <end_op+0x14c> panic("log.committing"); if(log.outstanding == 0){ 80102d62: 85 db test %ebx,%ebx 80102d64: 0f 85 ee 00 00 00 jne 80102e58 <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); 80102d6a: 83 ec 0c sub $0xc,%esp log.committing = 1; 80102d6d: c7 05 c0 26 11 80 01 movl $0x1,0x801126c0 80102d74: 00 00 00 release(&log.lock); 80102d77: 68 80 26 11 80 push $0x80112680 80102d7c: e8 bf 17 00 00 call 80104540 <release> } static void commit() { if (log.lh.n > 0) { 80102d81: 8b 0d c8 26 11 80 mov 0x801126c8,%ecx 80102d87: 83 c4 10 add $0x10,%esp 80102d8a: 85 c9 test %ecx,%ecx 80102d8c: 0f 8e 85 00 00 00 jle 80102e17 <end_op+0xe7> struct buf *to = bread(log.dev, log.start+tail+1); // log block 80102d92: a1 b4 26 11 80 mov 0x801126b4,%eax 80102d97: 83 ec 08 sub $0x8,%esp 80102d9a: 01 d8 add %ebx,%eax 80102d9c: 83 c0 01 add $0x1,%eax 80102d9f: 50 push %eax 80102da0: ff 35 c4 26 11 80 pushl 0x801126c4 80102da6: e8 25 d3 ff ff call 801000d0 <bread> 80102dab: 89 c6 mov %eax,%esi struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block 80102dad: 58 pop %eax 80102dae: 5a pop %edx 80102daf: ff 34 9d cc 26 11 80 pushl -0x7feed934(,%ebx,4) 80102db6: ff 35 c4 26 11 80 pushl 0x801126c4 for (tail = 0; tail < log.lh.n; tail++) { 80102dbc: 83 c3 01 add $0x1,%ebx struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block 80102dbf: e8 0c d3 ff ff call 801000d0 <bread> 80102dc4: 89 c7 mov %eax,%edi memmove(to->data, from->data, BSIZE); 80102dc6: 8d 40 5c lea 0x5c(%eax),%eax 80102dc9: 83 c4 0c add $0xc,%esp 80102dcc: 68 00 02 00 00 push $0x200 80102dd1: 50 push %eax 80102dd2: 8d 46 5c lea 0x5c(%esi),%eax 80102dd5: 50 push %eax 80102dd6: e8 65 18 00 00 call 80104640 <memmove> bwrite(to); // write the log 80102ddb: 89 34 24 mov %esi,(%esp) 80102dde: e8 bd d3 ff ff call 801001a0 <bwrite> brelse(from); 80102de3: 89 3c 24 mov %edi,(%esp) 80102de6: e8 f5 d3 ff ff call 801001e0 <brelse> brelse(to); 80102deb: 89 34 24 mov %esi,(%esp) 80102dee: e8 ed d3 ff ff call 801001e0 <brelse> for (tail = 0; tail < log.lh.n; tail++) { 80102df3: 83 c4 10 add $0x10,%esp 80102df6: 3b 1d c8 26 11 80 cmp 0x801126c8,%ebx 80102dfc: 7c 94 jl 80102d92 <end_op+0x62> write_log(); // Write modified blocks from cache to log write_head(); // Write header to disk -- the real commit 80102dfe: e8 bd fd ff ff call 80102bc0 <write_head> install_trans(); // Now install writes to home locations 80102e03: e8 18 fd ff ff call 80102b20 <install_trans> log.lh.n = 0; 80102e08: c7 05 c8 26 11 80 00 movl $0x0,0x801126c8 80102e0f: 00 00 00 write_head(); // Erase the transaction from the log 80102e12: e8 a9 fd ff ff call 80102bc0 <write_head> acquire(&log.lock); 80102e17: 83 ec 0c sub $0xc,%esp 80102e1a: 68 80 26 11 80 push $0x80112680 80102e1f: e8 5c 16 00 00 call 80104480 <acquire> wakeup(&log); 80102e24: c7 04 24 80 26 11 80 movl $0x80112680,(%esp) log.committing = 0; 80102e2b: c7 05 c0 26 11 80 00 movl $0x0,0x801126c0 80102e32: 00 00 00 wakeup(&log); 80102e35: e8 36 12 00 00 call 80104070 <wakeup> release(&log.lock); 80102e3a: c7 04 24 80 26 11 80 movl $0x80112680,(%esp) 80102e41: e8 fa 16 00 00 call 80104540 <release> 80102e46: 83 c4 10 add $0x10,%esp } 80102e49: 8d 65 f4 lea -0xc(%ebp),%esp 80102e4c: 5b pop %ebx 80102e4d: 5e pop %esi 80102e4e: 5f pop %edi 80102e4f: 5d pop %ebp 80102e50: c3 ret 80102e51: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi wakeup(&log); 80102e58: 83 ec 0c sub $0xc,%esp 80102e5b: 68 80 26 11 80 push $0x80112680 80102e60: e8 0b 12 00 00 call 80104070 <wakeup> release(&log.lock); 80102e65: c7 04 24 80 26 11 80 movl $0x80112680,(%esp) 80102e6c: e8 cf 16 00 00 call 80104540 <release> 80102e71: 83 c4 10 add $0x10,%esp } 80102e74: 8d 65 f4 lea -0xc(%ebp),%esp 80102e77: 5b pop %ebx 80102e78: 5e pop %esi 80102e79: 5f pop %edi 80102e7a: 5d pop %ebp 80102e7b: c3 ret panic("log.committing"); 80102e7c: 83 ec 0c sub $0xc,%esp 80102e7f: 68 84 75 10 80 push $0x80107584 80102e84: e8 07 d5 ff ff call 80100390 <panic> 80102e89: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80102e90 <log_write>: // modify bp->data[] // log_write(bp) // brelse(bp) void log_write(struct buf *b) { 80102e90: 55 push %ebp 80102e91: 89 e5 mov %esp,%ebp 80102e93: 53 push %ebx 80102e94: 83 ec 04 sub $0x4,%esp int i; if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1) 80102e97: 8b 15 c8 26 11 80 mov 0x801126c8,%edx { 80102e9d: 8b 5d 08 mov 0x8(%ebp),%ebx if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1) 80102ea0: 83 fa 1d cmp $0x1d,%edx 80102ea3: 0f 8f 9d 00 00 00 jg 80102f46 <log_write+0xb6> 80102ea9: a1 b8 26 11 80 mov 0x801126b8,%eax 80102eae: 83 e8 01 sub $0x1,%eax 80102eb1: 39 c2 cmp %eax,%edx 80102eb3: 0f 8d 8d 00 00 00 jge 80102f46 <log_write+0xb6> panic("too big a transaction"); if (log.outstanding < 1) 80102eb9: a1 bc 26 11 80 mov 0x801126bc,%eax 80102ebe: 85 c0 test %eax,%eax 80102ec0: 0f 8e 8d 00 00 00 jle 80102f53 <log_write+0xc3> panic("log_write outside of trans"); acquire(&log.lock); 80102ec6: 83 ec 0c sub $0xc,%esp 80102ec9: 68 80 26 11 80 push $0x80112680 80102ece: e8 ad 15 00 00 call 80104480 <acquire> for (i = 0; i < log.lh.n; i++) { 80102ed3: 8b 0d c8 26 11 80 mov 0x801126c8,%ecx 80102ed9: 83 c4 10 add $0x10,%esp 80102edc: 83 f9 00 cmp $0x0,%ecx 80102edf: 7e 57 jle 80102f38 <log_write+0xa8> if (log.lh.block[i] == b->blockno) // log absorbtion 80102ee1: 8b 53 08 mov 0x8(%ebx),%edx for (i = 0; i < log.lh.n; i++) { 80102ee4: 31 c0 xor %eax,%eax if (log.lh.block[i] == b->blockno) // log absorbtion 80102ee6: 3b 15 cc 26 11 80 cmp 0x801126cc,%edx 80102eec: 75 0b jne 80102ef9 <log_write+0x69> 80102eee: eb 38 jmp 80102f28 <log_write+0x98> 80102ef0: 39 14 85 cc 26 11 80 cmp %edx,-0x7feed934(,%eax,4) 80102ef7: 74 2f je 80102f28 <log_write+0x98> for (i = 0; i < log.lh.n; i++) { 80102ef9: 83 c0 01 add $0x1,%eax 80102efc: 39 c1 cmp %eax,%ecx 80102efe: 75 f0 jne 80102ef0 <log_write+0x60> break; } log.lh.block[i] = b->blockno; 80102f00: 89 14 85 cc 26 11 80 mov %edx,-0x7feed934(,%eax,4) if (i == log.lh.n) log.lh.n++; 80102f07: 83 c0 01 add $0x1,%eax 80102f0a: a3 c8 26 11 80 mov %eax,0x801126c8 b->flags |= B_DIRTY; // prevent eviction 80102f0f: 83 0b 04 orl $0x4,(%ebx) release(&log.lock); 80102f12: c7 45 08 80 26 11 80 movl $0x80112680,0x8(%ebp) } 80102f19: 8b 5d fc mov -0x4(%ebp),%ebx 80102f1c: c9 leave release(&log.lock); 80102f1d: e9 1e 16 00 00 jmp 80104540 <release> 80102f22: 8d b6 00 00 00 00 lea 0x0(%esi),%esi log.lh.block[i] = b->blockno; 80102f28: 89 14 85 cc 26 11 80 mov %edx,-0x7feed934(,%eax,4) 80102f2f: eb de jmp 80102f0f <log_write+0x7f> 80102f31: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80102f38: 8b 43 08 mov 0x8(%ebx),%eax 80102f3b: a3 cc 26 11 80 mov %eax,0x801126cc if (i == log.lh.n) 80102f40: 75 cd jne 80102f0f <log_write+0x7f> 80102f42: 31 c0 xor %eax,%eax 80102f44: eb c1 jmp 80102f07 <log_write+0x77> panic("too big a transaction"); 80102f46: 83 ec 0c sub $0xc,%esp 80102f49: 68 93 75 10 80 push $0x80107593 80102f4e: e8 3d d4 ff ff call 80100390 <panic> panic("log_write outside of trans"); 80102f53: 83 ec 0c sub $0xc,%esp 80102f56: 68 a9 75 10 80 push $0x801075a9 80102f5b: e8 30 d4 ff ff call 80100390 <panic> 80102f60 <mpmain>: } // Common CPU setup code. static void mpmain(void) { 80102f60: 55 push %ebp 80102f61: 89 e5 mov %esp,%ebp 80102f63: 53 push %ebx 80102f64: 83 ec 04 sub $0x4,%esp cprintf("cpu%d: starting %d\n", cpuid(), cpuid()); 80102f67: e8 74 09 00 00 call 801038e0 <cpuid> 80102f6c: 89 c3 mov %eax,%ebx 80102f6e: e8 6d 09 00 00 call 801038e0 <cpuid> 80102f73: 83 ec 04 sub $0x4,%esp 80102f76: 53 push %ebx 80102f77: 50 push %eax 80102f78: 68 c4 75 10 80 push $0x801075c4 80102f7d: e8 de d6 ff ff call 80100660 <cprintf> idtinit(); // load idt register 80102f82: e8 49 29 00 00 call 801058d0 <idtinit> xchg(&(mycpu()->started), 1); // tell startothers() we're up 80102f87: e8 d4 08 00 00 call 80103860 <mycpu> 80102f8c: 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" : 80102f8e: b8 01 00 00 00 mov $0x1,%eax 80102f93: f0 87 82 a0 00 00 00 lock xchg %eax,0xa0(%edx) scheduler(); // start running processes 80102f9a: e8 41 0c 00 00 call 80103be0 <scheduler> 80102f9f: 90 nop 80102fa0 <mpenter>: { 80102fa0: 55 push %ebp 80102fa1: 89 e5 mov %esp,%ebp 80102fa3: 83 ec 08 sub $0x8,%esp switchkvm(); 80102fa6: e8 15 3a 00 00 call 801069c0 <switchkvm> seginit(); 80102fab: e8 80 39 00 00 call 80106930 <seginit> lapicinit(); 80102fb0: e8 9b f7 ff ff call 80102750 <lapicinit> mpmain(); 80102fb5: e8 a6 ff ff ff call 80102f60 <mpmain> 80102fba: 66 90 xchg %ax,%ax 80102fbc: 66 90 xchg %ax,%ax 80102fbe: 66 90 xchg %ax,%ax 80102fc0 <main>: { 80102fc0: 8d 4c 24 04 lea 0x4(%esp),%ecx 80102fc4: 83 e4 f0 and $0xfffffff0,%esp 80102fc7: ff 71 fc pushl -0x4(%ecx) 80102fca: 55 push %ebp 80102fcb: 89 e5 mov %esp,%ebp 80102fcd: 53 push %ebx 80102fce: 51 push %ecx kinit1(end, P2V(4*1024*1024)); // phys page allocator 80102fcf: 83 ec 08 sub $0x8,%esp 80102fd2: 68 00 00 40 80 push $0x80400000 80102fd7: 68 a8 54 11 80 push $0x801154a8 80102fdc: e8 2f f5 ff ff call 80102510 <kinit1> kvmalloc(); // kernel page table 80102fe1: e8 aa 3e 00 00 call 80106e90 <kvmalloc> mpinit(); // detect other processors 80102fe6: e8 75 01 00 00 call 80103160 <mpinit> lapicinit(); // interrupt controller 80102feb: e8 60 f7 ff ff call 80102750 <lapicinit> seginit(); // segment descriptors 80102ff0: e8 3b 39 00 00 call 80106930 <seginit> picinit(); // disable pic 80102ff5: e8 46 03 00 00 call 80103340 <picinit> ioapicinit(); // another interrupt controller 80102ffa: e8 41 f3 ff ff call 80102340 <ioapicinit> consoleinit(); // console hardware 80102fff: e8 bc d9 ff ff call 801009c0 <consoleinit> uartinit(); // serial port 80103004: e8 f7 2b 00 00 call 80105c00 <uartinit> pinit(); // process table 80103009: e8 32 08 00 00 call 80103840 <pinit> tvinit(); // trap vectors 8010300e: e8 3d 28 00 00 call 80105850 <tvinit> binit(); // buffer cache 80103013: e8 28 d0 ff ff call 80100040 <binit> fileinit(); // file table 80103018: e8 43 dd ff ff call 80100d60 <fileinit> ideinit(); // disk 8010301d: e8 fe f0 ff ff call 80102120 <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); 80103022: 83 c4 0c add $0xc,%esp 80103025: 68 8a 00 00 00 push $0x8a 8010302a: 68 8c a4 10 80 push $0x8010a48c 8010302f: 68 00 70 00 80 push $0x80007000 80103034: e8 07 16 00 00 call 80104640 <memmove> for(c = cpus; c < cpus+ncpu; c++){ 80103039: 69 05 00 2d 11 80 b0 imul $0xb0,0x80112d00,%eax 80103040: 00 00 00 80103043: 83 c4 10 add $0x10,%esp 80103046: 05 80 27 11 80 add $0x80112780,%eax 8010304b: 3d 80 27 11 80 cmp $0x80112780,%eax 80103050: 76 71 jbe 801030c3 <main+0x103> 80103052: bb 80 27 11 80 mov $0x80112780,%ebx 80103057: 89 f6 mov %esi,%esi 80103059: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi if(c == mycpu()) // We've started already. 80103060: e8 fb 07 00 00 call 80103860 <mycpu> 80103065: 39 d8 cmp %ebx,%eax 80103067: 74 41 je 801030aa <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(); 80103069: e8 72 f5 ff ff call 801025e0 <kalloc> *(void**)(code-4) = stack + KSTACKSIZE; 8010306e: 05 00 10 00 00 add $0x1000,%eax *(void(**)(void))(code-8) = mpenter; 80103073: c7 05 f8 6f 00 80 a0 movl $0x80102fa0,0x80006ff8 8010307a: 2f 10 80 *(int**)(code-12) = (void *) V2P(entrypgdir); 8010307d: c7 05 f4 6f 00 80 00 movl $0x109000,0x80006ff4 80103084: 90 10 00 *(void**)(code-4) = stack + KSTACKSIZE; 80103087: a3 fc 6f 00 80 mov %eax,0x80006ffc lapicstartap(c->apicid, V2P(code)); 8010308c: 0f b6 03 movzbl (%ebx),%eax 8010308f: 83 ec 08 sub $0x8,%esp 80103092: 68 00 70 00 00 push $0x7000 80103097: 50 push %eax 80103098: e8 03 f8 ff ff call 801028a0 <lapicstartap> 8010309d: 83 c4 10 add $0x10,%esp // wait for cpu to finish mpmain() while(c->started == 0) 801030a0: 8b 83 a0 00 00 00 mov 0xa0(%ebx),%eax 801030a6: 85 c0 test %eax,%eax 801030a8: 74 f6 je 801030a0 <main+0xe0> for(c = cpus; c < cpus+ncpu; c++){ 801030aa: 69 05 00 2d 11 80 b0 imul $0xb0,0x80112d00,%eax 801030b1: 00 00 00 801030b4: 81 c3 b0 00 00 00 add $0xb0,%ebx 801030ba: 05 80 27 11 80 add $0x80112780,%eax 801030bf: 39 c3 cmp %eax,%ebx 801030c1: 72 9d jb 80103060 <main+0xa0> kinit2(P2V(4*1024*1024), P2V(PHYSTOP)); // must come after startothers() 801030c3: 83 ec 08 sub $0x8,%esp 801030c6: 68 00 00 00 8e push $0x8e000000 801030cb: 68 00 00 40 80 push $0x80400000 801030d0: e8 ab f4 ff ff call 80102580 <kinit2> userinit(); // first user process 801030d5: e8 56 08 00 00 call 80103930 <userinit> mpmain(); // finish this processor's setup 801030da: e8 81 fe ff ff call 80102f60 <mpmain> 801030df: 90 nop 801030e0 <mpsearch1>: } // Look for an MP structure in the len bytes at addr. static struct mp* mpsearch1(uint a, int len) { 801030e0: 55 push %ebp 801030e1: 89 e5 mov %esp,%ebp 801030e3: 57 push %edi 801030e4: 56 push %esi uchar *e, *p, *addr; addr = P2V(a); 801030e5: 8d b0 00 00 00 80 lea -0x80000000(%eax),%esi { 801030eb: 53 push %ebx e = addr+len; 801030ec: 8d 1c 16 lea (%esi,%edx,1),%ebx { 801030ef: 83 ec 0c sub $0xc,%esp for(p = addr; p < e; p += sizeof(struct mp)) 801030f2: 39 de cmp %ebx,%esi 801030f4: 72 10 jb 80103106 <mpsearch1+0x26> 801030f6: eb 50 jmp 80103148 <mpsearch1+0x68> 801030f8: 90 nop 801030f9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103100: 39 fb cmp %edi,%ebx 80103102: 89 fe mov %edi,%esi 80103104: 76 42 jbe 80103148 <mpsearch1+0x68> if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0) 80103106: 83 ec 04 sub $0x4,%esp 80103109: 8d 7e 10 lea 0x10(%esi),%edi 8010310c: 6a 04 push $0x4 8010310e: 68 d8 75 10 80 push $0x801075d8 80103113: 56 push %esi 80103114: e8 c7 14 00 00 call 801045e0 <memcmp> 80103119: 83 c4 10 add $0x10,%esp 8010311c: 85 c0 test %eax,%eax 8010311e: 75 e0 jne 80103100 <mpsearch1+0x20> 80103120: 89 f1 mov %esi,%ecx 80103122: 8d b6 00 00 00 00 lea 0x0(%esi),%esi sum += addr[i]; 80103128: 0f b6 11 movzbl (%ecx),%edx 8010312b: 83 c1 01 add $0x1,%ecx 8010312e: 01 d0 add %edx,%eax for(i=0; i<len; i++) 80103130: 39 f9 cmp %edi,%ecx 80103132: 75 f4 jne 80103128 <mpsearch1+0x48> if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0) 80103134: 84 c0 test %al,%al 80103136: 75 c8 jne 80103100 <mpsearch1+0x20> return (struct mp*)p; return 0; } 80103138: 8d 65 f4 lea -0xc(%ebp),%esp 8010313b: 89 f0 mov %esi,%eax 8010313d: 5b pop %ebx 8010313e: 5e pop %esi 8010313f: 5f pop %edi 80103140: 5d pop %ebp 80103141: c3 ret 80103142: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80103148: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 8010314b: 31 f6 xor %esi,%esi } 8010314d: 89 f0 mov %esi,%eax 8010314f: 5b pop %ebx 80103150: 5e pop %esi 80103151: 5f pop %edi 80103152: 5d pop %ebp 80103153: c3 ret 80103154: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010315a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80103160 <mpinit>: return conf; } void mpinit(void) { 80103160: 55 push %ebp 80103161: 89 e5 mov %esp,%ebp 80103163: 57 push %edi 80103164: 56 push %esi 80103165: 53 push %ebx 80103166: 83 ec 1c sub $0x1c,%esp if((p = ((bda[0x0F]<<8)| bda[0x0E]) << 4)){ 80103169: 0f b6 05 0f 04 00 80 movzbl 0x8000040f,%eax 80103170: 0f b6 15 0e 04 00 80 movzbl 0x8000040e,%edx 80103177: c1 e0 08 shl $0x8,%eax 8010317a: 09 d0 or %edx,%eax 8010317c: c1 e0 04 shl $0x4,%eax 8010317f: 85 c0 test %eax,%eax 80103181: 75 1b jne 8010319e <mpinit+0x3e> p = ((bda[0x14]<<8)|bda[0x13])*1024; 80103183: 0f b6 05 14 04 00 80 movzbl 0x80000414,%eax 8010318a: 0f b6 15 13 04 00 80 movzbl 0x80000413,%edx 80103191: c1 e0 08 shl $0x8,%eax 80103194: 09 d0 or %edx,%eax 80103196: c1 e0 0a shl $0xa,%eax if((mp = mpsearch1(p-1024, 1024))) 80103199: 2d 00 04 00 00 sub $0x400,%eax if((mp = mpsearch1(p, 1024))) 8010319e: ba 00 04 00 00 mov $0x400,%edx 801031a3: e8 38 ff ff ff call 801030e0 <mpsearch1> 801031a8: 85 c0 test %eax,%eax 801031aa: 89 45 e4 mov %eax,-0x1c(%ebp) 801031ad: 0f 84 3d 01 00 00 je 801032f0 <mpinit+0x190> if((mp = mpsearch()) == 0 || mp->physaddr == 0) 801031b3: 8b 45 e4 mov -0x1c(%ebp),%eax 801031b6: 8b 58 04 mov 0x4(%eax),%ebx 801031b9: 85 db test %ebx,%ebx 801031bb: 0f 84 4f 01 00 00 je 80103310 <mpinit+0x1b0> conf = (struct mpconf*) P2V((uint) mp->physaddr); 801031c1: 8d b3 00 00 00 80 lea -0x80000000(%ebx),%esi if(memcmp(conf, "PCMP", 4) != 0) 801031c7: 83 ec 04 sub $0x4,%esp 801031ca: 6a 04 push $0x4 801031cc: 68 f5 75 10 80 push $0x801075f5 801031d1: 56 push %esi 801031d2: e8 09 14 00 00 call 801045e0 <memcmp> 801031d7: 83 c4 10 add $0x10,%esp 801031da: 85 c0 test %eax,%eax 801031dc: 0f 85 2e 01 00 00 jne 80103310 <mpinit+0x1b0> if(conf->version != 1 && conf->version != 4) 801031e2: 0f b6 83 06 00 00 80 movzbl -0x7ffffffa(%ebx),%eax 801031e9: 3c 01 cmp $0x1,%al 801031eb: 0f 95 c2 setne %dl 801031ee: 3c 04 cmp $0x4,%al 801031f0: 0f 95 c0 setne %al 801031f3: 20 c2 and %al,%dl 801031f5: 0f 85 15 01 00 00 jne 80103310 <mpinit+0x1b0> if(sum((uchar*)conf, conf->length) != 0) 801031fb: 0f b7 bb 04 00 00 80 movzwl -0x7ffffffc(%ebx),%edi for(i=0; i<len; i++) 80103202: 66 85 ff test %di,%di 80103205: 74 1a je 80103221 <mpinit+0xc1> 80103207: 89 f0 mov %esi,%eax 80103209: 01 f7 add %esi,%edi sum = 0; 8010320b: 31 d2 xor %edx,%edx 8010320d: 8d 76 00 lea 0x0(%esi),%esi sum += addr[i]; 80103210: 0f b6 08 movzbl (%eax),%ecx 80103213: 83 c0 01 add $0x1,%eax 80103216: 01 ca add %ecx,%edx for(i=0; i<len; i++) 80103218: 39 c7 cmp %eax,%edi 8010321a: 75 f4 jne 80103210 <mpinit+0xb0> 8010321c: 84 d2 test %dl,%dl 8010321e: 0f 95 c2 setne %dl struct mp *mp; struct mpconf *conf; struct mpproc *proc; struct mpioapic *ioapic; if((conf = mpconfig(&mp)) == 0) 80103221: 85 f6 test %esi,%esi 80103223: 0f 84 e7 00 00 00 je 80103310 <mpinit+0x1b0> 80103229: 84 d2 test %dl,%dl 8010322b: 0f 85 df 00 00 00 jne 80103310 <mpinit+0x1b0> panic("Expect to run on an SMP"); ismp = 1; lapic = (uint*)conf->lapicaddr; 80103231: 8b 83 24 00 00 80 mov -0x7fffffdc(%ebx),%eax 80103237: a3 7c 26 11 80 mov %eax,0x8011267c for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){ 8010323c: 0f b7 93 04 00 00 80 movzwl -0x7ffffffc(%ebx),%edx 80103243: 8d 83 2c 00 00 80 lea -0x7fffffd4(%ebx),%eax ismp = 1; 80103249: bb 01 00 00 00 mov $0x1,%ebx for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){ 8010324e: 01 d6 add %edx,%esi 80103250: 39 c6 cmp %eax,%esi 80103252: 76 23 jbe 80103277 <mpinit+0x117> switch(*p){ 80103254: 0f b6 10 movzbl (%eax),%edx 80103257: 80 fa 04 cmp $0x4,%dl 8010325a: 0f 87 ca 00 00 00 ja 8010332a <mpinit+0x1ca> 80103260: ff 24 95 1c 76 10 80 jmp *-0x7fef89e4(,%edx,4) 80103267: 89 f6 mov %esi,%esi 80103269: 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; 80103270: 83 c0 08 add $0x8,%eax for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){ 80103273: 39 c6 cmp %eax,%esi 80103275: 77 dd ja 80103254 <mpinit+0xf4> default: ismp = 0; break; } } if(!ismp) 80103277: 85 db test %ebx,%ebx 80103279: 0f 84 9e 00 00 00 je 8010331d <mpinit+0x1bd> panic("Didn't find a suitable machine"); if(mp->imcrp){ 8010327f: 8b 45 e4 mov -0x1c(%ebp),%eax 80103282: 80 78 0c 00 cmpb $0x0,0xc(%eax) 80103286: 74 15 je 8010329d <mpinit+0x13d> asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80103288: b8 70 00 00 00 mov $0x70,%eax 8010328d: ba 22 00 00 00 mov $0x22,%edx 80103292: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80103293: ba 23 00 00 00 mov $0x23,%edx 80103298: 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. 80103299: 83 c8 01 or $0x1,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 8010329c: ee out %al,(%dx) } } 8010329d: 8d 65 f4 lea -0xc(%ebp),%esp 801032a0: 5b pop %ebx 801032a1: 5e pop %esi 801032a2: 5f pop %edi 801032a3: 5d pop %ebp 801032a4: c3 ret 801032a5: 8d 76 00 lea 0x0(%esi),%esi if(ncpu < NCPU) { 801032a8: 8b 0d 00 2d 11 80 mov 0x80112d00,%ecx 801032ae: 83 f9 07 cmp $0x7,%ecx 801032b1: 7f 19 jg 801032cc <mpinit+0x16c> cpus[ncpu].apicid = proc->apicid; // apicid may differ from ncpu 801032b3: 0f b6 50 01 movzbl 0x1(%eax),%edx 801032b7: 69 f9 b0 00 00 00 imul $0xb0,%ecx,%edi ncpu++; 801032bd: 83 c1 01 add $0x1,%ecx 801032c0: 89 0d 00 2d 11 80 mov %ecx,0x80112d00 cpus[ncpu].apicid = proc->apicid; // apicid may differ from ncpu 801032c6: 88 97 80 27 11 80 mov %dl,-0x7feed880(%edi) p += sizeof(struct mpproc); 801032cc: 83 c0 14 add $0x14,%eax continue; 801032cf: e9 7c ff ff ff jmp 80103250 <mpinit+0xf0> 801032d4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi ioapicid = ioapic->apicno; 801032d8: 0f b6 50 01 movzbl 0x1(%eax),%edx p += sizeof(struct mpioapic); 801032dc: 83 c0 08 add $0x8,%eax ioapicid = ioapic->apicno; 801032df: 88 15 60 27 11 80 mov %dl,0x80112760 continue; 801032e5: e9 66 ff ff ff jmp 80103250 <mpinit+0xf0> 801032ea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return mpsearch1(0xF0000, 0x10000); 801032f0: ba 00 00 01 00 mov $0x10000,%edx 801032f5: b8 00 00 0f 00 mov $0xf0000,%eax 801032fa: e8 e1 fd ff ff call 801030e0 <mpsearch1> if((mp = mpsearch()) == 0 || mp->physaddr == 0) 801032ff: 85 c0 test %eax,%eax return mpsearch1(0xF0000, 0x10000); 80103301: 89 45 e4 mov %eax,-0x1c(%ebp) if((mp = mpsearch()) == 0 || mp->physaddr == 0) 80103304: 0f 85 a9 fe ff ff jne 801031b3 <mpinit+0x53> 8010330a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi panic("Expect to run on an SMP"); 80103310: 83 ec 0c sub $0xc,%esp 80103313: 68 dd 75 10 80 push $0x801075dd 80103318: e8 73 d0 ff ff call 80100390 <panic> panic("Didn't find a suitable machine"); 8010331d: 83 ec 0c sub $0xc,%esp 80103320: 68 fc 75 10 80 push $0x801075fc 80103325: e8 66 d0 ff ff call 80100390 <panic> ismp = 0; 8010332a: 31 db xor %ebx,%ebx 8010332c: e9 26 ff ff ff jmp 80103257 <mpinit+0xf7> 80103331: 66 90 xchg %ax,%ax 80103333: 66 90 xchg %ax,%ax 80103335: 66 90 xchg %ax,%ax 80103337: 66 90 xchg %ax,%ax 80103339: 66 90 xchg %ax,%ax 8010333b: 66 90 xchg %ax,%ax 8010333d: 66 90 xchg %ax,%ax 8010333f: 90 nop 80103340 <picinit>: #define IO_PIC2 0xA0 // Slave (IRQs 8-15) // Don't use the 8259A interrupt controllers. Xv6 assumes SMP hardware. void picinit(void) { 80103340: 55 push %ebp 80103341: b8 ff ff ff ff mov $0xffffffff,%eax 80103346: ba 21 00 00 00 mov $0x21,%edx 8010334b: 89 e5 mov %esp,%ebp 8010334d: ee out %al,(%dx) 8010334e: ba a1 00 00 00 mov $0xa1,%edx 80103353: ee out %al,(%dx) // mask all interrupts outb(IO_PIC1+1, 0xFF); outb(IO_PIC2+1, 0xFF); } 80103354: 5d pop %ebp 80103355: c3 ret 80103356: 66 90 xchg %ax,%ax 80103358: 66 90 xchg %ax,%ax 8010335a: 66 90 xchg %ax,%ax 8010335c: 66 90 xchg %ax,%ax 8010335e: 66 90 xchg %ax,%ax 80103360 <pipealloc>: int writeopen; // write fd is still open }; int pipealloc(struct file **f0, struct file **f1) { 80103360: 55 push %ebp 80103361: 89 e5 mov %esp,%ebp 80103363: 57 push %edi 80103364: 56 push %esi 80103365: 53 push %ebx 80103366: 83 ec 0c sub $0xc,%esp 80103369: 8b 5d 08 mov 0x8(%ebp),%ebx 8010336c: 8b 75 0c mov 0xc(%ebp),%esi struct pipe *p; p = 0; *f0 = *f1 = 0; 8010336f: c7 06 00 00 00 00 movl $0x0,(%esi) 80103375: c7 03 00 00 00 00 movl $0x0,(%ebx) if((*f0 = filealloc()) == 0 || (*f1 = filealloc()) == 0) 8010337b: e8 00 da ff ff call 80100d80 <filealloc> 80103380: 85 c0 test %eax,%eax 80103382: 89 03 mov %eax,(%ebx) 80103384: 74 22 je 801033a8 <pipealloc+0x48> 80103386: e8 f5 d9 ff ff call 80100d80 <filealloc> 8010338b: 85 c0 test %eax,%eax 8010338d: 89 06 mov %eax,(%esi) 8010338f: 74 3f je 801033d0 <pipealloc+0x70> goto bad; if((p = (struct pipe*)kalloc()) == 0) 80103391: e8 4a f2 ff ff call 801025e0 <kalloc> 80103396: 85 c0 test %eax,%eax 80103398: 89 c7 mov %eax,%edi 8010339a: 75 54 jne 801033f0 <pipealloc+0x90> //PAGEBREAK: 20 bad: if(p) kfree((char*)p); if(*f0) 8010339c: 8b 03 mov (%ebx),%eax 8010339e: 85 c0 test %eax,%eax 801033a0: 75 34 jne 801033d6 <pipealloc+0x76> 801033a2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi fileclose(*f0); if(*f1) 801033a8: 8b 06 mov (%esi),%eax 801033aa: 85 c0 test %eax,%eax 801033ac: 74 0c je 801033ba <pipealloc+0x5a> fileclose(*f1); 801033ae: 83 ec 0c sub $0xc,%esp 801033b1: 50 push %eax 801033b2: e8 89 da ff ff call 80100e40 <fileclose> 801033b7: 83 c4 10 add $0x10,%esp return -1; } 801033ba: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 801033bd: b8 ff ff ff ff mov $0xffffffff,%eax } 801033c2: 5b pop %ebx 801033c3: 5e pop %esi 801033c4: 5f pop %edi 801033c5: 5d pop %ebp 801033c6: c3 ret 801033c7: 89 f6 mov %esi,%esi 801033c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi if(*f0) 801033d0: 8b 03 mov (%ebx),%eax 801033d2: 85 c0 test %eax,%eax 801033d4: 74 e4 je 801033ba <pipealloc+0x5a> fileclose(*f0); 801033d6: 83 ec 0c sub $0xc,%esp 801033d9: 50 push %eax 801033da: e8 61 da ff ff call 80100e40 <fileclose> if(*f1) 801033df: 8b 06 mov (%esi),%eax fileclose(*f0); 801033e1: 83 c4 10 add $0x10,%esp if(*f1) 801033e4: 85 c0 test %eax,%eax 801033e6: 75 c6 jne 801033ae <pipealloc+0x4e> 801033e8: eb d0 jmp 801033ba <pipealloc+0x5a> 801033ea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi initlock(&p->lock, "pipe"); 801033f0: 83 ec 08 sub $0x8,%esp p->readopen = 1; 801033f3: c7 80 3c 02 00 00 01 movl $0x1,0x23c(%eax) 801033fa: 00 00 00 p->writeopen = 1; 801033fd: c7 80 40 02 00 00 01 movl $0x1,0x240(%eax) 80103404: 00 00 00 p->nwrite = 0; 80103407: c7 80 38 02 00 00 00 movl $0x0,0x238(%eax) 8010340e: 00 00 00 p->nread = 0; 80103411: c7 80 34 02 00 00 00 movl $0x0,0x234(%eax) 80103418: 00 00 00 initlock(&p->lock, "pipe"); 8010341b: 68 30 76 10 80 push $0x80107630 80103420: 50 push %eax 80103421: e8 1a 0f 00 00 call 80104340 <initlock> (*f0)->type = FD_PIPE; 80103426: 8b 03 mov (%ebx),%eax return 0; 80103428: 83 c4 10 add $0x10,%esp (*f0)->type = FD_PIPE; 8010342b: c7 00 01 00 00 00 movl $0x1,(%eax) (*f0)->readable = 1; 80103431: 8b 03 mov (%ebx),%eax 80103433: c6 40 08 01 movb $0x1,0x8(%eax) (*f0)->writable = 0; 80103437: 8b 03 mov (%ebx),%eax 80103439: c6 40 09 00 movb $0x0,0x9(%eax) (*f0)->pipe = p; 8010343d: 8b 03 mov (%ebx),%eax 8010343f: 89 78 0c mov %edi,0xc(%eax) (*f1)->type = FD_PIPE; 80103442: 8b 06 mov (%esi),%eax 80103444: c7 00 01 00 00 00 movl $0x1,(%eax) (*f1)->readable = 0; 8010344a: 8b 06 mov (%esi),%eax 8010344c: c6 40 08 00 movb $0x0,0x8(%eax) (*f1)->writable = 1; 80103450: 8b 06 mov (%esi),%eax 80103452: c6 40 09 01 movb $0x1,0x9(%eax) (*f1)->pipe = p; 80103456: 8b 06 mov (%esi),%eax 80103458: 89 78 0c mov %edi,0xc(%eax) } 8010345b: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 8010345e: 31 c0 xor %eax,%eax } 80103460: 5b pop %ebx 80103461: 5e pop %esi 80103462: 5f pop %edi 80103463: 5d pop %ebp 80103464: c3 ret 80103465: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103469: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103470 <pipeclose>: void pipeclose(struct pipe *p, int writable) { 80103470: 55 push %ebp 80103471: 89 e5 mov %esp,%ebp 80103473: 56 push %esi 80103474: 53 push %ebx 80103475: 8b 5d 08 mov 0x8(%ebp),%ebx 80103478: 8b 75 0c mov 0xc(%ebp),%esi acquire(&p->lock); 8010347b: 83 ec 0c sub $0xc,%esp 8010347e: 53 push %ebx 8010347f: e8 fc 0f 00 00 call 80104480 <acquire> if(writable){ 80103484: 83 c4 10 add $0x10,%esp 80103487: 85 f6 test %esi,%esi 80103489: 74 45 je 801034d0 <pipeclose+0x60> p->writeopen = 0; wakeup(&p->nread); 8010348b: 8d 83 34 02 00 00 lea 0x234(%ebx),%eax 80103491: 83 ec 0c sub $0xc,%esp p->writeopen = 0; 80103494: c7 83 40 02 00 00 00 movl $0x0,0x240(%ebx) 8010349b: 00 00 00 wakeup(&p->nread); 8010349e: 50 push %eax 8010349f: e8 cc 0b 00 00 call 80104070 <wakeup> 801034a4: 83 c4 10 add $0x10,%esp } else { p->readopen = 0; wakeup(&p->nwrite); } if(p->readopen == 0 && p->writeopen == 0){ 801034a7: 8b 93 3c 02 00 00 mov 0x23c(%ebx),%edx 801034ad: 85 d2 test %edx,%edx 801034af: 75 0a jne 801034bb <pipeclose+0x4b> 801034b1: 8b 83 40 02 00 00 mov 0x240(%ebx),%eax 801034b7: 85 c0 test %eax,%eax 801034b9: 74 35 je 801034f0 <pipeclose+0x80> release(&p->lock); kfree((char*)p); } else release(&p->lock); 801034bb: 89 5d 08 mov %ebx,0x8(%ebp) } 801034be: 8d 65 f8 lea -0x8(%ebp),%esp 801034c1: 5b pop %ebx 801034c2: 5e pop %esi 801034c3: 5d pop %ebp release(&p->lock); 801034c4: e9 77 10 00 00 jmp 80104540 <release> 801034c9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi wakeup(&p->nwrite); 801034d0: 8d 83 38 02 00 00 lea 0x238(%ebx),%eax 801034d6: 83 ec 0c sub $0xc,%esp p->readopen = 0; 801034d9: c7 83 3c 02 00 00 00 movl $0x0,0x23c(%ebx) 801034e0: 00 00 00 wakeup(&p->nwrite); 801034e3: 50 push %eax 801034e4: e8 87 0b 00 00 call 80104070 <wakeup> 801034e9: 83 c4 10 add $0x10,%esp 801034ec: eb b9 jmp 801034a7 <pipeclose+0x37> 801034ee: 66 90 xchg %ax,%ax release(&p->lock); 801034f0: 83 ec 0c sub $0xc,%esp 801034f3: 53 push %ebx 801034f4: e8 47 10 00 00 call 80104540 <release> kfree((char*)p); 801034f9: 89 5d 08 mov %ebx,0x8(%ebp) 801034fc: 83 c4 10 add $0x10,%esp } 801034ff: 8d 65 f8 lea -0x8(%ebp),%esp 80103502: 5b pop %ebx 80103503: 5e pop %esi 80103504: 5d pop %ebp kfree((char*)p); 80103505: e9 26 ef ff ff jmp 80102430 <kfree> 8010350a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80103510 <pipewrite>: //PAGEBREAK: 40 int pipewrite(struct pipe *p, char *addr, int n) { 80103510: 55 push %ebp 80103511: 89 e5 mov %esp,%ebp 80103513: 57 push %edi 80103514: 56 push %esi 80103515: 53 push %ebx 80103516: 83 ec 28 sub $0x28,%esp 80103519: 8b 5d 08 mov 0x8(%ebp),%ebx int i; acquire(&p->lock); 8010351c: 53 push %ebx 8010351d: e8 5e 0f 00 00 call 80104480 <acquire> for(i = 0; i < n; i++){ 80103522: 8b 45 10 mov 0x10(%ebp),%eax 80103525: 83 c4 10 add $0x10,%esp 80103528: 85 c0 test %eax,%eax 8010352a: 0f 8e c9 00 00 00 jle 801035f9 <pipewrite+0xe9> 80103530: 8b 4d 0c mov 0xc(%ebp),%ecx 80103533: 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); 80103539: 8d bb 34 02 00 00 lea 0x234(%ebx),%edi 8010353f: 89 4d e4 mov %ecx,-0x1c(%ebp) 80103542: 03 4d 10 add 0x10(%ebp),%ecx 80103545: 89 4d e0 mov %ecx,-0x20(%ebp) while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full 80103548: 8b 8b 34 02 00 00 mov 0x234(%ebx),%ecx 8010354e: 8d 91 00 02 00 00 lea 0x200(%ecx),%edx 80103554: 39 d0 cmp %edx,%eax 80103556: 75 71 jne 801035c9 <pipewrite+0xb9> if(p->readopen == 0 || myproc()->killed){ 80103558: 8b 83 3c 02 00 00 mov 0x23c(%ebx),%eax 8010355e: 85 c0 test %eax,%eax 80103560: 74 4e je 801035b0 <pipewrite+0xa0> sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep 80103562: 8d b3 38 02 00 00 lea 0x238(%ebx),%esi 80103568: eb 3a jmp 801035a4 <pipewrite+0x94> 8010356a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi wakeup(&p->nread); 80103570: 83 ec 0c sub $0xc,%esp 80103573: 57 push %edi 80103574: e8 f7 0a 00 00 call 80104070 <wakeup> sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep 80103579: 5a pop %edx 8010357a: 59 pop %ecx 8010357b: 53 push %ebx 8010357c: 56 push %esi 8010357d: e8 3e 09 00 00 call 80103ec0 <sleep> while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full 80103582: 8b 83 34 02 00 00 mov 0x234(%ebx),%eax 80103588: 8b 93 38 02 00 00 mov 0x238(%ebx),%edx 8010358e: 83 c4 10 add $0x10,%esp 80103591: 05 00 02 00 00 add $0x200,%eax 80103596: 39 c2 cmp %eax,%edx 80103598: 75 36 jne 801035d0 <pipewrite+0xc0> if(p->readopen == 0 || myproc()->killed){ 8010359a: 8b 83 3c 02 00 00 mov 0x23c(%ebx),%eax 801035a0: 85 c0 test %eax,%eax 801035a2: 74 0c je 801035b0 <pipewrite+0xa0> 801035a4: e8 57 03 00 00 call 80103900 <myproc> 801035a9: 8b 40 24 mov 0x24(%eax),%eax 801035ac: 85 c0 test %eax,%eax 801035ae: 74 c0 je 80103570 <pipewrite+0x60> release(&p->lock); 801035b0: 83 ec 0c sub $0xc,%esp 801035b3: 53 push %ebx 801035b4: e8 87 0f 00 00 call 80104540 <release> return -1; 801035b9: 83 c4 10 add $0x10,%esp 801035bc: 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; } 801035c1: 8d 65 f4 lea -0xc(%ebp),%esp 801035c4: 5b pop %ebx 801035c5: 5e pop %esi 801035c6: 5f pop %edi 801035c7: 5d pop %ebp 801035c8: c3 ret while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full 801035c9: 89 c2 mov %eax,%edx 801035cb: 90 nop 801035cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi p->data[p->nwrite++ % PIPESIZE] = addr[i]; 801035d0: 8b 75 e4 mov -0x1c(%ebp),%esi 801035d3: 8d 42 01 lea 0x1(%edx),%eax 801035d6: 81 e2 ff 01 00 00 and $0x1ff,%edx 801035dc: 89 83 38 02 00 00 mov %eax,0x238(%ebx) 801035e2: 83 c6 01 add $0x1,%esi 801035e5: 0f b6 4e ff movzbl -0x1(%esi),%ecx for(i = 0; i < n; i++){ 801035e9: 3b 75 e0 cmp -0x20(%ebp),%esi 801035ec: 89 75 e4 mov %esi,-0x1c(%ebp) p->data[p->nwrite++ % PIPESIZE] = addr[i]; 801035ef: 88 4c 13 34 mov %cl,0x34(%ebx,%edx,1) for(i = 0; i < n; i++){ 801035f3: 0f 85 4f ff ff ff jne 80103548 <pipewrite+0x38> wakeup(&p->nread); //DOC: pipewrite-wakeup1 801035f9: 8d 83 34 02 00 00 lea 0x234(%ebx),%eax 801035ff: 83 ec 0c sub $0xc,%esp 80103602: 50 push %eax 80103603: e8 68 0a 00 00 call 80104070 <wakeup> release(&p->lock); 80103608: 89 1c 24 mov %ebx,(%esp) 8010360b: e8 30 0f 00 00 call 80104540 <release> return n; 80103610: 83 c4 10 add $0x10,%esp 80103613: 8b 45 10 mov 0x10(%ebp),%eax 80103616: eb a9 jmp 801035c1 <pipewrite+0xb1> 80103618: 90 nop 80103619: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103620 <piperead>: int piperead(struct pipe *p, char *addr, int n) { 80103620: 55 push %ebp 80103621: 89 e5 mov %esp,%ebp 80103623: 57 push %edi 80103624: 56 push %esi 80103625: 53 push %ebx 80103626: 83 ec 18 sub $0x18,%esp 80103629: 8b 75 08 mov 0x8(%ebp),%esi 8010362c: 8b 7d 0c mov 0xc(%ebp),%edi int i; acquire(&p->lock); 8010362f: 56 push %esi 80103630: e8 4b 0e 00 00 call 80104480 <acquire> while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty 80103635: 83 c4 10 add $0x10,%esp 80103638: 8b 8e 34 02 00 00 mov 0x234(%esi),%ecx 8010363e: 3b 8e 38 02 00 00 cmp 0x238(%esi),%ecx 80103644: 75 6a jne 801036b0 <piperead+0x90> 80103646: 8b 9e 40 02 00 00 mov 0x240(%esi),%ebx 8010364c: 85 db test %ebx,%ebx 8010364e: 0f 84 c4 00 00 00 je 80103718 <piperead+0xf8> if(myproc()->killed){ release(&p->lock); return -1; } sleep(&p->nread, &p->lock); //DOC: piperead-sleep 80103654: 8d 9e 34 02 00 00 lea 0x234(%esi),%ebx 8010365a: eb 2d jmp 80103689 <piperead+0x69> 8010365c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103660: 83 ec 08 sub $0x8,%esp 80103663: 56 push %esi 80103664: 53 push %ebx 80103665: e8 56 08 00 00 call 80103ec0 <sleep> while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty 8010366a: 83 c4 10 add $0x10,%esp 8010366d: 8b 8e 34 02 00 00 mov 0x234(%esi),%ecx 80103673: 3b 8e 38 02 00 00 cmp 0x238(%esi),%ecx 80103679: 75 35 jne 801036b0 <piperead+0x90> 8010367b: 8b 96 40 02 00 00 mov 0x240(%esi),%edx 80103681: 85 d2 test %edx,%edx 80103683: 0f 84 8f 00 00 00 je 80103718 <piperead+0xf8> if(myproc()->killed){ 80103689: e8 72 02 00 00 call 80103900 <myproc> 8010368e: 8b 48 24 mov 0x24(%eax),%ecx 80103691: 85 c9 test %ecx,%ecx 80103693: 74 cb je 80103660 <piperead+0x40> release(&p->lock); 80103695: 83 ec 0c sub $0xc,%esp return -1; 80103698: bb ff ff ff ff mov $0xffffffff,%ebx release(&p->lock); 8010369d: 56 push %esi 8010369e: e8 9d 0e 00 00 call 80104540 <release> return -1; 801036a3: 83 c4 10 add $0x10,%esp addr[i] = p->data[p->nread++ % PIPESIZE]; } wakeup(&p->nwrite); //DOC: piperead-wakeup release(&p->lock); return i; } 801036a6: 8d 65 f4 lea -0xc(%ebp),%esp 801036a9: 89 d8 mov %ebx,%eax 801036ab: 5b pop %ebx 801036ac: 5e pop %esi 801036ad: 5f pop %edi 801036ae: 5d pop %ebp 801036af: c3 ret for(i = 0; i < n; i++){ //DOC: piperead-copy 801036b0: 8b 45 10 mov 0x10(%ebp),%eax 801036b3: 85 c0 test %eax,%eax 801036b5: 7e 61 jle 80103718 <piperead+0xf8> if(p->nread == p->nwrite) 801036b7: 31 db xor %ebx,%ebx 801036b9: eb 13 jmp 801036ce <piperead+0xae> 801036bb: 90 nop 801036bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801036c0: 8b 8e 34 02 00 00 mov 0x234(%esi),%ecx 801036c6: 3b 8e 38 02 00 00 cmp 0x238(%esi),%ecx 801036cc: 74 1f je 801036ed <piperead+0xcd> addr[i] = p->data[p->nread++ % PIPESIZE]; 801036ce: 8d 41 01 lea 0x1(%ecx),%eax 801036d1: 81 e1 ff 01 00 00 and $0x1ff,%ecx 801036d7: 89 86 34 02 00 00 mov %eax,0x234(%esi) 801036dd: 0f b6 44 0e 34 movzbl 0x34(%esi,%ecx,1),%eax 801036e2: 88 04 1f mov %al,(%edi,%ebx,1) for(i = 0; i < n; i++){ //DOC: piperead-copy 801036e5: 83 c3 01 add $0x1,%ebx 801036e8: 39 5d 10 cmp %ebx,0x10(%ebp) 801036eb: 75 d3 jne 801036c0 <piperead+0xa0> wakeup(&p->nwrite); //DOC: piperead-wakeup 801036ed: 8d 86 38 02 00 00 lea 0x238(%esi),%eax 801036f3: 83 ec 0c sub $0xc,%esp 801036f6: 50 push %eax 801036f7: e8 74 09 00 00 call 80104070 <wakeup> release(&p->lock); 801036fc: 89 34 24 mov %esi,(%esp) 801036ff: e8 3c 0e 00 00 call 80104540 <release> return i; 80103704: 83 c4 10 add $0x10,%esp } 80103707: 8d 65 f4 lea -0xc(%ebp),%esp 8010370a: 89 d8 mov %ebx,%eax 8010370c: 5b pop %ebx 8010370d: 5e pop %esi 8010370e: 5f pop %edi 8010370f: 5d pop %ebp 80103710: c3 ret 80103711: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103718: 31 db xor %ebx,%ebx 8010371a: eb d1 jmp 801036ed <piperead+0xcd> 8010371c: 66 90 xchg %ax,%ax 8010371e: 66 90 xchg %ax,%ax 80103720 <allocproc>: // If found, change state to EMBRYO and initialize // state required to run in the kernel. // Otherwise return 0. static struct proc* allocproc(void) { 80103720: 55 push %ebp 80103721: 89 e5 mov %esp,%ebp 80103723: 53 push %ebx struct proc *p; char *sp; acquire(&ptable.lock); for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103724: bb 54 2d 11 80 mov $0x80112d54,%ebx { 80103729: 83 ec 10 sub $0x10,%esp acquire(&ptable.lock); 8010372c: 68 20 2d 11 80 push $0x80112d20 80103731: e8 4a 0d 00 00 call 80104480 <acquire> 80103736: 83 c4 10 add $0x10,%esp 80103739: eb 10 jmp 8010374b <allocproc+0x2b> 8010373b: 90 nop 8010373c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103740: 83 c3 7c add $0x7c,%ebx 80103743: 81 fb 54 4c 11 80 cmp $0x80114c54,%ebx 80103749: 73 75 jae 801037c0 <allocproc+0xa0> if(p->state == UNUSED) 8010374b: 8b 43 0c mov 0xc(%ebx),%eax 8010374e: 85 c0 test %eax,%eax 80103750: 75 ee jne 80103740 <allocproc+0x20> release(&ptable.lock); return 0; found: p->state = EMBRYO; p->pid = nextpid++; 80103752: a1 04 a0 10 80 mov 0x8010a004,%eax release(&ptable.lock); 80103757: 83 ec 0c sub $0xc,%esp p->state = EMBRYO; 8010375a: c7 43 0c 01 00 00 00 movl $0x1,0xc(%ebx) p->pid = nextpid++; 80103761: 8d 50 01 lea 0x1(%eax),%edx 80103764: 89 43 10 mov %eax,0x10(%ebx) release(&ptable.lock); 80103767: 68 20 2d 11 80 push $0x80112d20 p->pid = nextpid++; 8010376c: 89 15 04 a0 10 80 mov %edx,0x8010a004 release(&ptable.lock); 80103772: e8 c9 0d 00 00 call 80104540 <release> // Allocate kernel stack. if((p->kstack = kalloc()) == 0){ 80103777: e8 64 ee ff ff call 801025e0 <kalloc> 8010377c: 83 c4 10 add $0x10,%esp 8010377f: 85 c0 test %eax,%eax 80103781: 89 43 08 mov %eax,0x8(%ebx) 80103784: 74 53 je 801037d9 <allocproc+0xb9> return 0; } sp = p->kstack + KSTACKSIZE; // Leave room for trap frame. sp -= sizeof *p->tf; 80103786: 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); 8010378c: 83 ec 04 sub $0x4,%esp sp -= sizeof *p->context; 8010378f: 05 9c 0f 00 00 add $0xf9c,%eax sp -= sizeof *p->tf; 80103794: 89 53 18 mov %edx,0x18(%ebx) *(uint*)sp = (uint)trapret; 80103797: c7 40 14 42 58 10 80 movl $0x80105842,0x14(%eax) p->context = (struct context*)sp; 8010379e: 89 43 1c mov %eax,0x1c(%ebx) memset(p->context, 0, sizeof *p->context); 801037a1: 6a 14 push $0x14 801037a3: 6a 00 push $0x0 801037a5: 50 push %eax 801037a6: e8 e5 0d 00 00 call 80104590 <memset> p->context->eip = (uint)forkret; 801037ab: 8b 43 1c mov 0x1c(%ebx),%eax return p; 801037ae: 83 c4 10 add $0x10,%esp p->context->eip = (uint)forkret; 801037b1: c7 40 10 f0 37 10 80 movl $0x801037f0,0x10(%eax) } 801037b8: 89 d8 mov %ebx,%eax 801037ba: 8b 5d fc mov -0x4(%ebp),%ebx 801037bd: c9 leave 801037be: c3 ret 801037bf: 90 nop release(&ptable.lock); 801037c0: 83 ec 0c sub $0xc,%esp return 0; 801037c3: 31 db xor %ebx,%ebx release(&ptable.lock); 801037c5: 68 20 2d 11 80 push $0x80112d20 801037ca: e8 71 0d 00 00 call 80104540 <release> } 801037cf: 89 d8 mov %ebx,%eax return 0; 801037d1: 83 c4 10 add $0x10,%esp } 801037d4: 8b 5d fc mov -0x4(%ebp),%ebx 801037d7: c9 leave 801037d8: c3 ret p->state = UNUSED; 801037d9: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) return 0; 801037e0: 31 db xor %ebx,%ebx 801037e2: eb d4 jmp 801037b8 <allocproc+0x98> 801037e4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801037ea: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 801037f0 <forkret>: // A fork child's very first scheduling by scheduler() // will swtch here. "Return" to user space. void forkret(void) { 801037f0: 55 push %ebp 801037f1: 89 e5 mov %esp,%ebp 801037f3: 83 ec 14 sub $0x14,%esp static int first = 1; // Still holding ptable.lock from scheduler. release(&ptable.lock); 801037f6: 68 20 2d 11 80 push $0x80112d20 801037fb: e8 40 0d 00 00 call 80104540 <release> if (first) { 80103800: a1 00 a0 10 80 mov 0x8010a000,%eax 80103805: 83 c4 10 add $0x10,%esp 80103808: 85 c0 test %eax,%eax 8010380a: 75 04 jne 80103810 <forkret+0x20> iinit(ROOTDEV); initlog(ROOTDEV); } // Return to "caller", actually trapret (see allocproc). } 8010380c: c9 leave 8010380d: c3 ret 8010380e: 66 90 xchg %ax,%ax iinit(ROOTDEV); 80103810: 83 ec 0c sub $0xc,%esp first = 0; 80103813: c7 05 00 a0 10 80 00 movl $0x0,0x8010a000 8010381a: 00 00 00 iinit(ROOTDEV); 8010381d: 6a 01 push $0x1 8010381f: e8 6c dc ff ff call 80101490 <iinit> initlog(ROOTDEV); 80103824: c7 04 24 01 00 00 00 movl $0x1,(%esp) 8010382b: e8 f0 f3 ff ff call 80102c20 <initlog> 80103830: 83 c4 10 add $0x10,%esp } 80103833: c9 leave 80103834: c3 ret 80103835: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103839: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103840 <pinit>: { 80103840: 55 push %ebp 80103841: 89 e5 mov %esp,%ebp 80103843: 83 ec 10 sub $0x10,%esp initlock(&ptable.lock, "ptable"); 80103846: 68 35 76 10 80 push $0x80107635 8010384b: 68 20 2d 11 80 push $0x80112d20 80103850: e8 eb 0a 00 00 call 80104340 <initlock> } 80103855: 83 c4 10 add $0x10,%esp 80103858: c9 leave 80103859: c3 ret 8010385a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80103860 <mycpu>: { 80103860: 55 push %ebp 80103861: 89 e5 mov %esp,%ebp 80103863: 56 push %esi 80103864: 53 push %ebx asm volatile("pushfl; popl %0" : "=r" (eflags)); 80103865: 9c pushf 80103866: 58 pop %eax if(readeflags()&FL_IF) 80103867: f6 c4 02 test $0x2,%ah 8010386a: 75 5e jne 801038ca <mycpu+0x6a> apicid = lapicid(); 8010386c: e8 df ef ff ff call 80102850 <lapicid> for (i = 0; i < ncpu; ++i) { 80103871: 8b 35 00 2d 11 80 mov 0x80112d00,%esi 80103877: 85 f6 test %esi,%esi 80103879: 7e 42 jle 801038bd <mycpu+0x5d> if (cpus[i].apicid == apicid) 8010387b: 0f b6 15 80 27 11 80 movzbl 0x80112780,%edx 80103882: 39 d0 cmp %edx,%eax 80103884: 74 30 je 801038b6 <mycpu+0x56> 80103886: b9 30 28 11 80 mov $0x80112830,%ecx for (i = 0; i < ncpu; ++i) { 8010388b: 31 d2 xor %edx,%edx 8010388d: 8d 76 00 lea 0x0(%esi),%esi 80103890: 83 c2 01 add $0x1,%edx 80103893: 39 f2 cmp %esi,%edx 80103895: 74 26 je 801038bd <mycpu+0x5d> if (cpus[i].apicid == apicid) 80103897: 0f b6 19 movzbl (%ecx),%ebx 8010389a: 81 c1 b0 00 00 00 add $0xb0,%ecx 801038a0: 39 c3 cmp %eax,%ebx 801038a2: 75 ec jne 80103890 <mycpu+0x30> 801038a4: 69 c2 b0 00 00 00 imul $0xb0,%edx,%eax 801038aa: 05 80 27 11 80 add $0x80112780,%eax } 801038af: 8d 65 f8 lea -0x8(%ebp),%esp 801038b2: 5b pop %ebx 801038b3: 5e pop %esi 801038b4: 5d pop %ebp 801038b5: c3 ret if (cpus[i].apicid == apicid) 801038b6: b8 80 27 11 80 mov $0x80112780,%eax return &cpus[i]; 801038bb: eb f2 jmp 801038af <mycpu+0x4f> panic("unknown apicid\n"); 801038bd: 83 ec 0c sub $0xc,%esp 801038c0: 68 3c 76 10 80 push $0x8010763c 801038c5: e8 c6 ca ff ff call 80100390 <panic> panic("mycpu called with interrupts enabled\n"); 801038ca: 83 ec 0c sub $0xc,%esp 801038cd: 68 20 77 10 80 push $0x80107720 801038d2: e8 b9 ca ff ff call 80100390 <panic> 801038d7: 89 f6 mov %esi,%esi 801038d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801038e0 <cpuid>: cpuid() { 801038e0: 55 push %ebp 801038e1: 89 e5 mov %esp,%ebp 801038e3: 83 ec 08 sub $0x8,%esp return mycpu()-cpus; 801038e6: e8 75 ff ff ff call 80103860 <mycpu> 801038eb: 2d 80 27 11 80 sub $0x80112780,%eax } 801038f0: c9 leave return mycpu()-cpus; 801038f1: c1 f8 04 sar $0x4,%eax 801038f4: 69 c0 a3 8b 2e ba imul $0xba2e8ba3,%eax,%eax } 801038fa: c3 ret 801038fb: 90 nop 801038fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103900 <myproc>: myproc(void) { 80103900: 55 push %ebp 80103901: 89 e5 mov %esp,%ebp 80103903: 53 push %ebx 80103904: 83 ec 04 sub $0x4,%esp pushcli(); 80103907: e8 a4 0a 00 00 call 801043b0 <pushcli> c = mycpu(); 8010390c: e8 4f ff ff ff call 80103860 <mycpu> p = c->proc; 80103911: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103917: e8 d4 0a 00 00 call 801043f0 <popcli> } 8010391c: 83 c4 04 add $0x4,%esp 8010391f: 89 d8 mov %ebx,%eax 80103921: 5b pop %ebx 80103922: 5d pop %ebp 80103923: c3 ret 80103924: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010392a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80103930 <userinit>: { 80103930: 55 push %ebp 80103931: 89 e5 mov %esp,%ebp 80103933: 53 push %ebx 80103934: 83 ec 04 sub $0x4,%esp p = allocproc(); 80103937: e8 e4 fd ff ff call 80103720 <allocproc> 8010393c: 89 c3 mov %eax,%ebx initproc = p; 8010393e: a3 b8 a5 10 80 mov %eax,0x8010a5b8 if((p->pgdir = setupkvm()) == 0) 80103943: e8 c8 34 00 00 call 80106e10 <setupkvm> 80103948: 85 c0 test %eax,%eax 8010394a: 89 43 04 mov %eax,0x4(%ebx) 8010394d: 0f 84 d6 00 00 00 je 80103a29 <userinit+0xf9> cprintf("%p %p\n", _binary_initcode_start, _binary_initcode_size); 80103953: 83 ec 04 sub $0x4,%esp 80103956: 68 2c 00 00 00 push $0x2c 8010395b: 68 60 a4 10 80 push $0x8010a460 80103960: 68 65 76 10 80 push $0x80107665 80103965: e8 f6 cc ff ff call 80100660 <cprintf> inituvm(p->pgdir, _binary_initcode_start, (int)_binary_initcode_size); 8010396a: 83 c4 0c add $0xc,%esp 8010396d: 68 2c 00 00 00 push $0x2c 80103972: 68 60 a4 10 80 push $0x8010a460 80103977: ff 73 04 pushl 0x4(%ebx) 8010397a: e8 71 31 00 00 call 80106af0 <inituvm> memset(p->tf, 0, sizeof(*p->tf)); 8010397f: 83 c4 0c add $0xc,%esp p->sz = PGSIZE; 80103982: c7 03 00 10 00 00 movl $0x1000,(%ebx) memset(p->tf, 0, sizeof(*p->tf)); 80103988: 6a 4c push $0x4c 8010398a: 6a 00 push $0x0 8010398c: ff 73 18 pushl 0x18(%ebx) 8010398f: e8 fc 0b 00 00 call 80104590 <memset> p->tf->cs = (SEG_UCODE << 3) | DPL_USER; 80103994: 8b 43 18 mov 0x18(%ebx),%eax 80103997: ba 1b 00 00 00 mov $0x1b,%edx p->tf->ds = (SEG_UDATA << 3) | DPL_USER; 8010399c: b9 23 00 00 00 mov $0x23,%ecx safestrcpy(p->name, "initcode", sizeof(p->name)); 801039a1: 83 c4 0c add $0xc,%esp p->tf->cs = (SEG_UCODE << 3) | DPL_USER; 801039a4: 66 89 50 3c mov %dx,0x3c(%eax) p->tf->ds = (SEG_UDATA << 3) | DPL_USER; 801039a8: 8b 43 18 mov 0x18(%ebx),%eax 801039ab: 66 89 48 2c mov %cx,0x2c(%eax) p->tf->es = p->tf->ds; 801039af: 8b 43 18 mov 0x18(%ebx),%eax 801039b2: 0f b7 50 2c movzwl 0x2c(%eax),%edx 801039b6: 66 89 50 28 mov %dx,0x28(%eax) p->tf->ss = p->tf->ds; 801039ba: 8b 43 18 mov 0x18(%ebx),%eax 801039bd: 0f b7 50 2c movzwl 0x2c(%eax),%edx 801039c1: 66 89 50 48 mov %dx,0x48(%eax) p->tf->eflags = FL_IF; 801039c5: 8b 43 18 mov 0x18(%ebx),%eax 801039c8: c7 40 40 00 02 00 00 movl $0x200,0x40(%eax) p->tf->esp = PGSIZE; 801039cf: 8b 43 18 mov 0x18(%ebx),%eax 801039d2: c7 40 44 00 10 00 00 movl $0x1000,0x44(%eax) p->tf->eip = 0; // beginning of initcode.S 801039d9: 8b 43 18 mov 0x18(%ebx),%eax 801039dc: c7 40 38 00 00 00 00 movl $0x0,0x38(%eax) safestrcpy(p->name, "initcode", sizeof(p->name)); 801039e3: 8d 43 6c lea 0x6c(%ebx),%eax 801039e6: 6a 10 push $0x10 801039e8: 68 6c 76 10 80 push $0x8010766c 801039ed: 50 push %eax 801039ee: e8 7d 0d 00 00 call 80104770 <safestrcpy> p->cwd = namei("/"); 801039f3: c7 04 24 75 76 10 80 movl $0x80107675,(%esp) 801039fa: e8 f1 e4 ff ff call 80101ef0 <namei> 801039ff: 89 43 68 mov %eax,0x68(%ebx) acquire(&ptable.lock); 80103a02: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103a09: e8 72 0a 00 00 call 80104480 <acquire> p->state = RUNNABLE; 80103a0e: c7 43 0c 03 00 00 00 movl $0x3,0xc(%ebx) release(&ptable.lock); 80103a15: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103a1c: e8 1f 0b 00 00 call 80104540 <release> } 80103a21: 83 c4 10 add $0x10,%esp 80103a24: 8b 5d fc mov -0x4(%ebp),%ebx 80103a27: c9 leave 80103a28: c3 ret panic("userinit: out of memory?"); 80103a29: 83 ec 0c sub $0xc,%esp 80103a2c: 68 4c 76 10 80 push $0x8010764c 80103a31: e8 5a c9 ff ff call 80100390 <panic> 80103a36: 8d 76 00 lea 0x0(%esi),%esi 80103a39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103a40 <growproc>: { 80103a40: 55 push %ebp 80103a41: 89 e5 mov %esp,%ebp 80103a43: 56 push %esi 80103a44: 53 push %ebx 80103a45: 8b 75 08 mov 0x8(%ebp),%esi pushcli(); 80103a48: e8 63 09 00 00 call 801043b0 <pushcli> c = mycpu(); 80103a4d: e8 0e fe ff ff call 80103860 <mycpu> p = c->proc; 80103a52: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103a58: e8 93 09 00 00 call 801043f0 <popcli> if(n > 0){ 80103a5d: 83 fe 00 cmp $0x0,%esi sz = curproc->sz; 80103a60: 8b 03 mov (%ebx),%eax if(n > 0){ 80103a62: 7f 1c jg 80103a80 <growproc+0x40> } else if(n < 0){ 80103a64: 75 3a jne 80103aa0 <growproc+0x60> switchuvm(curproc); 80103a66: 83 ec 0c sub $0xc,%esp curproc->sz = sz; 80103a69: 89 03 mov %eax,(%ebx) switchuvm(curproc); 80103a6b: 53 push %ebx 80103a6c: e8 6f 2f 00 00 call 801069e0 <switchuvm> return 0; 80103a71: 83 c4 10 add $0x10,%esp 80103a74: 31 c0 xor %eax,%eax } 80103a76: 8d 65 f8 lea -0x8(%ebp),%esp 80103a79: 5b pop %ebx 80103a7a: 5e pop %esi 80103a7b: 5d pop %ebp 80103a7c: c3 ret 80103a7d: 8d 76 00 lea 0x0(%esi),%esi if((sz = allocuvm(curproc->pgdir, sz, sz + n)) == 0) 80103a80: 83 ec 04 sub $0x4,%esp 80103a83: 01 c6 add %eax,%esi 80103a85: 56 push %esi 80103a86: 50 push %eax 80103a87: ff 73 04 pushl 0x4(%ebx) 80103a8a: e8 a1 31 00 00 call 80106c30 <allocuvm> 80103a8f: 83 c4 10 add $0x10,%esp 80103a92: 85 c0 test %eax,%eax 80103a94: 75 d0 jne 80103a66 <growproc+0x26> return -1; 80103a96: b8 ff ff ff ff mov $0xffffffff,%eax 80103a9b: eb d9 jmp 80103a76 <growproc+0x36> 80103a9d: 8d 76 00 lea 0x0(%esi),%esi if((sz = deallocuvm(curproc->pgdir, sz, sz + n)) == 0) 80103aa0: 83 ec 04 sub $0x4,%esp 80103aa3: 01 c6 add %eax,%esi 80103aa5: 56 push %esi 80103aa6: 50 push %eax 80103aa7: ff 73 04 pushl 0x4(%ebx) 80103aaa: e8 b1 32 00 00 call 80106d60 <deallocuvm> 80103aaf: 83 c4 10 add $0x10,%esp 80103ab2: 85 c0 test %eax,%eax 80103ab4: 75 b0 jne 80103a66 <growproc+0x26> 80103ab6: eb de jmp 80103a96 <growproc+0x56> 80103ab8: 90 nop 80103ab9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103ac0 <fork>: { 80103ac0: 55 push %ebp 80103ac1: 89 e5 mov %esp,%ebp 80103ac3: 57 push %edi 80103ac4: 56 push %esi 80103ac5: 53 push %ebx 80103ac6: 83 ec 1c sub $0x1c,%esp pushcli(); 80103ac9: e8 e2 08 00 00 call 801043b0 <pushcli> c = mycpu(); 80103ace: e8 8d fd ff ff call 80103860 <mycpu> p = c->proc; 80103ad3: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103ad9: e8 12 09 00 00 call 801043f0 <popcli> if((np = allocproc()) == 0){ 80103ade: e8 3d fc ff ff call 80103720 <allocproc> 80103ae3: 85 c0 test %eax,%eax 80103ae5: 89 45 e4 mov %eax,-0x1c(%ebp) 80103ae8: 0f 84 b7 00 00 00 je 80103ba5 <fork+0xe5> if((np->pgdir = copyuvm(curproc->pgdir, curproc->sz)) == 0){ 80103aee: 83 ec 08 sub $0x8,%esp 80103af1: ff 33 pushl (%ebx) 80103af3: ff 73 04 pushl 0x4(%ebx) 80103af6: 89 c7 mov %eax,%edi 80103af8: e8 e3 33 00 00 call 80106ee0 <copyuvm> 80103afd: 83 c4 10 add $0x10,%esp 80103b00: 85 c0 test %eax,%eax 80103b02: 89 47 04 mov %eax,0x4(%edi) 80103b05: 0f 84 a1 00 00 00 je 80103bac <fork+0xec> np->sz = curproc->sz; 80103b0b: 8b 03 mov (%ebx),%eax 80103b0d: 8b 4d e4 mov -0x1c(%ebp),%ecx 80103b10: 89 01 mov %eax,(%ecx) np->parent = curproc; 80103b12: 89 59 14 mov %ebx,0x14(%ecx) 80103b15: 89 c8 mov %ecx,%eax *np->tf = *curproc->tf; 80103b17: 8b 79 18 mov 0x18(%ecx),%edi 80103b1a: 8b 73 18 mov 0x18(%ebx),%esi 80103b1d: b9 13 00 00 00 mov $0x13,%ecx 80103b22: f3 a5 rep movsl %ds:(%esi),%es:(%edi) for(i = 0; i < NOFILE; i++) 80103b24: 31 f6 xor %esi,%esi np->tf->eax = 0; 80103b26: 8b 40 18 mov 0x18(%eax),%eax 80103b29: c7 40 1c 00 00 00 00 movl $0x0,0x1c(%eax) if(curproc->ofile[i]) 80103b30: 8b 44 b3 28 mov 0x28(%ebx,%esi,4),%eax 80103b34: 85 c0 test %eax,%eax 80103b36: 74 13 je 80103b4b <fork+0x8b> np->ofile[i] = filedup(curproc->ofile[i]); 80103b38: 83 ec 0c sub $0xc,%esp 80103b3b: 50 push %eax 80103b3c: e8 af d2 ff ff call 80100df0 <filedup> 80103b41: 8b 55 e4 mov -0x1c(%ebp),%edx 80103b44: 83 c4 10 add $0x10,%esp 80103b47: 89 44 b2 28 mov %eax,0x28(%edx,%esi,4) for(i = 0; i < NOFILE; i++) 80103b4b: 83 c6 01 add $0x1,%esi 80103b4e: 83 fe 10 cmp $0x10,%esi 80103b51: 75 dd jne 80103b30 <fork+0x70> np->cwd = idup(curproc->cwd); 80103b53: 83 ec 0c sub $0xc,%esp 80103b56: ff 73 68 pushl 0x68(%ebx) safestrcpy(np->name, curproc->name, sizeof(curproc->name)); 80103b59: 83 c3 6c add $0x6c,%ebx np->cwd = idup(curproc->cwd); 80103b5c: e8 ff da ff ff call 80101660 <idup> 80103b61: 8b 7d e4 mov -0x1c(%ebp),%edi safestrcpy(np->name, curproc->name, sizeof(curproc->name)); 80103b64: 83 c4 0c add $0xc,%esp np->cwd = idup(curproc->cwd); 80103b67: 89 47 68 mov %eax,0x68(%edi) safestrcpy(np->name, curproc->name, sizeof(curproc->name)); 80103b6a: 8d 47 6c lea 0x6c(%edi),%eax 80103b6d: 6a 10 push $0x10 80103b6f: 53 push %ebx 80103b70: 50 push %eax 80103b71: e8 fa 0b 00 00 call 80104770 <safestrcpy> pid = np->pid; 80103b76: 8b 5f 10 mov 0x10(%edi),%ebx acquire(&ptable.lock); 80103b79: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103b80: e8 fb 08 00 00 call 80104480 <acquire> np->state = RUNNABLE; 80103b85: c7 47 0c 03 00 00 00 movl $0x3,0xc(%edi) release(&ptable.lock); 80103b8c: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103b93: e8 a8 09 00 00 call 80104540 <release> return pid; 80103b98: 83 c4 10 add $0x10,%esp } 80103b9b: 8d 65 f4 lea -0xc(%ebp),%esp 80103b9e: 89 d8 mov %ebx,%eax 80103ba0: 5b pop %ebx 80103ba1: 5e pop %esi 80103ba2: 5f pop %edi 80103ba3: 5d pop %ebp 80103ba4: c3 ret return -1; 80103ba5: bb ff ff ff ff mov $0xffffffff,%ebx 80103baa: eb ef jmp 80103b9b <fork+0xdb> kfree(np->kstack); 80103bac: 8b 5d e4 mov -0x1c(%ebp),%ebx 80103baf: 83 ec 0c sub $0xc,%esp 80103bb2: ff 73 08 pushl 0x8(%ebx) 80103bb5: e8 76 e8 ff ff call 80102430 <kfree> np->kstack = 0; 80103bba: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) np->state = UNUSED; 80103bc1: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) return -1; 80103bc8: 83 c4 10 add $0x10,%esp 80103bcb: bb ff ff ff ff mov $0xffffffff,%ebx 80103bd0: eb c9 jmp 80103b9b <fork+0xdb> 80103bd2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103bd9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103be0 <scheduler>: { 80103be0: 55 push %ebp 80103be1: 89 e5 mov %esp,%ebp 80103be3: 57 push %edi 80103be4: 56 push %esi 80103be5: 53 push %ebx 80103be6: 83 ec 0c sub $0xc,%esp struct cpu *c = mycpu(); 80103be9: e8 72 fc ff ff call 80103860 <mycpu> 80103bee: 8d 78 04 lea 0x4(%eax),%edi 80103bf1: 89 c6 mov %eax,%esi c->proc = 0; 80103bf3: c7 80 ac 00 00 00 00 movl $0x0,0xac(%eax) 80103bfa: 00 00 00 80103bfd: 8d 76 00 lea 0x0(%esi),%esi asm volatile("sti"); 80103c00: fb sti acquire(&ptable.lock); 80103c01: 83 ec 0c sub $0xc,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103c04: bb 54 2d 11 80 mov $0x80112d54,%ebx acquire(&ptable.lock); 80103c09: 68 20 2d 11 80 push $0x80112d20 80103c0e: e8 6d 08 00 00 call 80104480 <acquire> 80103c13: 83 c4 10 add $0x10,%esp 80103c16: 8d 76 00 lea 0x0(%esi),%esi 80103c19: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi if(p->state != RUNNABLE) 80103c20: 83 7b 0c 03 cmpl $0x3,0xc(%ebx) 80103c24: 75 33 jne 80103c59 <scheduler+0x79> switchuvm(p); 80103c26: 83 ec 0c sub $0xc,%esp c->proc = p; 80103c29: 89 9e ac 00 00 00 mov %ebx,0xac(%esi) switchuvm(p); 80103c2f: 53 push %ebx 80103c30: e8 ab 2d 00 00 call 801069e0 <switchuvm> swtch(&(c->scheduler), p->context); 80103c35: 58 pop %eax 80103c36: 5a pop %edx 80103c37: ff 73 1c pushl 0x1c(%ebx) 80103c3a: 57 push %edi p->state = RUNNING; 80103c3b: c7 43 0c 04 00 00 00 movl $0x4,0xc(%ebx) swtch(&(c->scheduler), p->context); 80103c42: e8 84 0b 00 00 call 801047cb <swtch> switchkvm(); 80103c47: e8 74 2d 00 00 call 801069c0 <switchkvm> c->proc = 0; 80103c4c: c7 86 ac 00 00 00 00 movl $0x0,0xac(%esi) 80103c53: 00 00 00 80103c56: 83 c4 10 add $0x10,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103c59: 83 c3 7c add $0x7c,%ebx 80103c5c: 81 fb 54 4c 11 80 cmp $0x80114c54,%ebx 80103c62: 72 bc jb 80103c20 <scheduler+0x40> release(&ptable.lock); 80103c64: 83 ec 0c sub $0xc,%esp 80103c67: 68 20 2d 11 80 push $0x80112d20 80103c6c: e8 cf 08 00 00 call 80104540 <release> sti(); 80103c71: 83 c4 10 add $0x10,%esp 80103c74: eb 8a jmp 80103c00 <scheduler+0x20> 80103c76: 8d 76 00 lea 0x0(%esi),%esi 80103c79: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103c80 <sched>: { 80103c80: 55 push %ebp 80103c81: 89 e5 mov %esp,%ebp 80103c83: 56 push %esi 80103c84: 53 push %ebx pushcli(); 80103c85: e8 26 07 00 00 call 801043b0 <pushcli> c = mycpu(); 80103c8a: e8 d1 fb ff ff call 80103860 <mycpu> p = c->proc; 80103c8f: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103c95: e8 56 07 00 00 call 801043f0 <popcli> if(!holding(&ptable.lock)) 80103c9a: 83 ec 0c sub $0xc,%esp 80103c9d: 68 20 2d 11 80 push $0x80112d20 80103ca2: e8 a9 07 00 00 call 80104450 <holding> 80103ca7: 83 c4 10 add $0x10,%esp 80103caa: 85 c0 test %eax,%eax 80103cac: 74 4f je 80103cfd <sched+0x7d> if(mycpu()->ncli != 1) 80103cae: e8 ad fb ff ff call 80103860 <mycpu> 80103cb3: 83 b8 a4 00 00 00 01 cmpl $0x1,0xa4(%eax) 80103cba: 75 68 jne 80103d24 <sched+0xa4> if(p->state == RUNNING) 80103cbc: 83 7b 0c 04 cmpl $0x4,0xc(%ebx) 80103cc0: 74 55 je 80103d17 <sched+0x97> asm volatile("pushfl; popl %0" : "=r" (eflags)); 80103cc2: 9c pushf 80103cc3: 58 pop %eax if(readeflags()&FL_IF) 80103cc4: f6 c4 02 test $0x2,%ah 80103cc7: 75 41 jne 80103d0a <sched+0x8a> intena = mycpu()->intena; 80103cc9: e8 92 fb ff ff call 80103860 <mycpu> swtch(&p->context, mycpu()->scheduler); 80103cce: 83 c3 1c add $0x1c,%ebx intena = mycpu()->intena; 80103cd1: 8b b0 a8 00 00 00 mov 0xa8(%eax),%esi swtch(&p->context, mycpu()->scheduler); 80103cd7: e8 84 fb ff ff call 80103860 <mycpu> 80103cdc: 83 ec 08 sub $0x8,%esp 80103cdf: ff 70 04 pushl 0x4(%eax) 80103ce2: 53 push %ebx 80103ce3: e8 e3 0a 00 00 call 801047cb <swtch> mycpu()->intena = intena; 80103ce8: e8 73 fb ff ff call 80103860 <mycpu> } 80103ced: 83 c4 10 add $0x10,%esp mycpu()->intena = intena; 80103cf0: 89 b0 a8 00 00 00 mov %esi,0xa8(%eax) } 80103cf6: 8d 65 f8 lea -0x8(%ebp),%esp 80103cf9: 5b pop %ebx 80103cfa: 5e pop %esi 80103cfb: 5d pop %ebp 80103cfc: c3 ret panic("sched ptable.lock"); 80103cfd: 83 ec 0c sub $0xc,%esp 80103d00: 68 77 76 10 80 push $0x80107677 80103d05: e8 86 c6 ff ff call 80100390 <panic> panic("sched interruptible"); 80103d0a: 83 ec 0c sub $0xc,%esp 80103d0d: 68 a3 76 10 80 push $0x801076a3 80103d12: e8 79 c6 ff ff call 80100390 <panic> panic("sched running"); 80103d17: 83 ec 0c sub $0xc,%esp 80103d1a: 68 95 76 10 80 push $0x80107695 80103d1f: e8 6c c6 ff ff call 80100390 <panic> panic("sched locks"); 80103d24: 83 ec 0c sub $0xc,%esp 80103d27: 68 89 76 10 80 push $0x80107689 80103d2c: e8 5f c6 ff ff call 80100390 <panic> 80103d31: eb 0d jmp 80103d40 <exit> 80103d33: 90 nop 80103d34: 90 nop 80103d35: 90 nop 80103d36: 90 nop 80103d37: 90 nop 80103d38: 90 nop 80103d39: 90 nop 80103d3a: 90 nop 80103d3b: 90 nop 80103d3c: 90 nop 80103d3d: 90 nop 80103d3e: 90 nop 80103d3f: 90 nop 80103d40 <exit>: { 80103d40: 55 push %ebp 80103d41: 89 e5 mov %esp,%ebp 80103d43: 57 push %edi 80103d44: 56 push %esi 80103d45: 53 push %ebx 80103d46: 83 ec 0c sub $0xc,%esp pushcli(); 80103d49: e8 62 06 00 00 call 801043b0 <pushcli> c = mycpu(); 80103d4e: e8 0d fb ff ff call 80103860 <mycpu> p = c->proc; 80103d53: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi popcli(); 80103d59: e8 92 06 00 00 call 801043f0 <popcli> if(curproc == initproc) 80103d5e: 39 35 b8 a5 10 80 cmp %esi,0x8010a5b8 80103d64: 8d 5e 28 lea 0x28(%esi),%ebx 80103d67: 8d 7e 68 lea 0x68(%esi),%edi 80103d6a: 0f 84 e7 00 00 00 je 80103e57 <exit+0x117> if(curproc->ofile[fd]){ 80103d70: 8b 03 mov (%ebx),%eax 80103d72: 85 c0 test %eax,%eax 80103d74: 74 12 je 80103d88 <exit+0x48> fileclose(curproc->ofile[fd]); 80103d76: 83 ec 0c sub $0xc,%esp 80103d79: 50 push %eax 80103d7a: e8 c1 d0 ff ff call 80100e40 <fileclose> curproc->ofile[fd] = 0; 80103d7f: c7 03 00 00 00 00 movl $0x0,(%ebx) 80103d85: 83 c4 10 add $0x10,%esp 80103d88: 83 c3 04 add $0x4,%ebx for(fd = 0; fd < NOFILE; fd++){ 80103d8b: 39 fb cmp %edi,%ebx 80103d8d: 75 e1 jne 80103d70 <exit+0x30> begin_op(); 80103d8f: e8 2c ef ff ff call 80102cc0 <begin_op> iput(curproc->cwd); 80103d94: 83 ec 0c sub $0xc,%esp 80103d97: ff 76 68 pushl 0x68(%esi) 80103d9a: e8 21 da ff ff call 801017c0 <iput> end_op(); 80103d9f: e8 8c ef ff ff call 80102d30 <end_op> curproc->cwd = 0; 80103da4: c7 46 68 00 00 00 00 movl $0x0,0x68(%esi) acquire(&ptable.lock); 80103dab: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103db2: e8 c9 06 00 00 call 80104480 <acquire> wakeup1(curproc->parent); 80103db7: 8b 56 14 mov 0x14(%esi),%edx 80103dba: 83 c4 10 add $0x10,%esp static void wakeup1(void *chan) { struct proc *p; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103dbd: b8 54 2d 11 80 mov $0x80112d54,%eax 80103dc2: eb 0e jmp 80103dd2 <exit+0x92> 80103dc4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103dc8: 83 c0 7c add $0x7c,%eax 80103dcb: 3d 54 4c 11 80 cmp $0x80114c54,%eax 80103dd0: 73 1c jae 80103dee <exit+0xae> if(p->state == SLEEPING && p->chan == chan) 80103dd2: 83 78 0c 02 cmpl $0x2,0xc(%eax) 80103dd6: 75 f0 jne 80103dc8 <exit+0x88> 80103dd8: 3b 50 20 cmp 0x20(%eax),%edx 80103ddb: 75 eb jne 80103dc8 <exit+0x88> p->state = RUNNABLE; 80103ddd: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103de4: 83 c0 7c add $0x7c,%eax 80103de7: 3d 54 4c 11 80 cmp $0x80114c54,%eax 80103dec: 72 e4 jb 80103dd2 <exit+0x92> p->parent = initproc; 80103dee: 8b 0d b8 a5 10 80 mov 0x8010a5b8,%ecx for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103df4: ba 54 2d 11 80 mov $0x80112d54,%edx 80103df9: eb 10 jmp 80103e0b <exit+0xcb> 80103dfb: 90 nop 80103dfc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103e00: 83 c2 7c add $0x7c,%edx 80103e03: 81 fa 54 4c 11 80 cmp $0x80114c54,%edx 80103e09: 73 33 jae 80103e3e <exit+0xfe> if(p->parent == curproc){ 80103e0b: 39 72 14 cmp %esi,0x14(%edx) 80103e0e: 75 f0 jne 80103e00 <exit+0xc0> if(p->state == ZOMBIE) 80103e10: 83 7a 0c 05 cmpl $0x5,0xc(%edx) p->parent = initproc; 80103e14: 89 4a 14 mov %ecx,0x14(%edx) if(p->state == ZOMBIE) 80103e17: 75 e7 jne 80103e00 <exit+0xc0> for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103e19: b8 54 2d 11 80 mov $0x80112d54,%eax 80103e1e: eb 0a jmp 80103e2a <exit+0xea> 80103e20: 83 c0 7c add $0x7c,%eax 80103e23: 3d 54 4c 11 80 cmp $0x80114c54,%eax 80103e28: 73 d6 jae 80103e00 <exit+0xc0> if(p->state == SLEEPING && p->chan == chan) 80103e2a: 83 78 0c 02 cmpl $0x2,0xc(%eax) 80103e2e: 75 f0 jne 80103e20 <exit+0xe0> 80103e30: 3b 48 20 cmp 0x20(%eax),%ecx 80103e33: 75 eb jne 80103e20 <exit+0xe0> p->state = RUNNABLE; 80103e35: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) 80103e3c: eb e2 jmp 80103e20 <exit+0xe0> curproc->state = ZOMBIE; 80103e3e: c7 46 0c 05 00 00 00 movl $0x5,0xc(%esi) sched(); 80103e45: e8 36 fe ff ff call 80103c80 <sched> panic("zombie exit"); 80103e4a: 83 ec 0c sub $0xc,%esp 80103e4d: 68 c4 76 10 80 push $0x801076c4 80103e52: e8 39 c5 ff ff call 80100390 <panic> panic("init exiting"); 80103e57: 83 ec 0c sub $0xc,%esp 80103e5a: 68 b7 76 10 80 push $0x801076b7 80103e5f: e8 2c c5 ff ff call 80100390 <panic> 80103e64: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80103e6a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80103e70 <yield>: { 80103e70: 55 push %ebp 80103e71: 89 e5 mov %esp,%ebp 80103e73: 53 push %ebx 80103e74: 83 ec 10 sub $0x10,%esp acquire(&ptable.lock); //DOC: yieldlock 80103e77: 68 20 2d 11 80 push $0x80112d20 80103e7c: e8 ff 05 00 00 call 80104480 <acquire> pushcli(); 80103e81: e8 2a 05 00 00 call 801043b0 <pushcli> c = mycpu(); 80103e86: e8 d5 f9 ff ff call 80103860 <mycpu> p = c->proc; 80103e8b: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103e91: e8 5a 05 00 00 call 801043f0 <popcli> myproc()->state = RUNNABLE; 80103e96: c7 43 0c 03 00 00 00 movl $0x3,0xc(%ebx) sched(); 80103e9d: e8 de fd ff ff call 80103c80 <sched> release(&ptable.lock); 80103ea2: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103ea9: e8 92 06 00 00 call 80104540 <release> } 80103eae: 83 c4 10 add $0x10,%esp 80103eb1: 8b 5d fc mov -0x4(%ebp),%ebx 80103eb4: c9 leave 80103eb5: c3 ret 80103eb6: 8d 76 00 lea 0x0(%esi),%esi 80103eb9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103ec0 <sleep>: { 80103ec0: 55 push %ebp 80103ec1: 89 e5 mov %esp,%ebp 80103ec3: 57 push %edi 80103ec4: 56 push %esi 80103ec5: 53 push %ebx 80103ec6: 83 ec 0c sub $0xc,%esp 80103ec9: 8b 7d 08 mov 0x8(%ebp),%edi 80103ecc: 8b 75 0c mov 0xc(%ebp),%esi pushcli(); 80103ecf: e8 dc 04 00 00 call 801043b0 <pushcli> c = mycpu(); 80103ed4: e8 87 f9 ff ff call 80103860 <mycpu> p = c->proc; 80103ed9: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103edf: e8 0c 05 00 00 call 801043f0 <popcli> if(p == 0) 80103ee4: 85 db test %ebx,%ebx 80103ee6: 0f 84 87 00 00 00 je 80103f73 <sleep+0xb3> if(lk == 0) 80103eec: 85 f6 test %esi,%esi 80103eee: 74 76 je 80103f66 <sleep+0xa6> if(lk != &ptable.lock){ //DOC: sleeplock0 80103ef0: 81 fe 20 2d 11 80 cmp $0x80112d20,%esi 80103ef6: 74 50 je 80103f48 <sleep+0x88> acquire(&ptable.lock); //DOC: sleeplock1 80103ef8: 83 ec 0c sub $0xc,%esp 80103efb: 68 20 2d 11 80 push $0x80112d20 80103f00: e8 7b 05 00 00 call 80104480 <acquire> release(lk); 80103f05: 89 34 24 mov %esi,(%esp) 80103f08: e8 33 06 00 00 call 80104540 <release> p->chan = chan; 80103f0d: 89 7b 20 mov %edi,0x20(%ebx) p->state = SLEEPING; 80103f10: c7 43 0c 02 00 00 00 movl $0x2,0xc(%ebx) sched(); 80103f17: e8 64 fd ff ff call 80103c80 <sched> p->chan = 0; 80103f1c: c7 43 20 00 00 00 00 movl $0x0,0x20(%ebx) release(&ptable.lock); 80103f23: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103f2a: e8 11 06 00 00 call 80104540 <release> acquire(lk); 80103f2f: 89 75 08 mov %esi,0x8(%ebp) 80103f32: 83 c4 10 add $0x10,%esp } 80103f35: 8d 65 f4 lea -0xc(%ebp),%esp 80103f38: 5b pop %ebx 80103f39: 5e pop %esi 80103f3a: 5f pop %edi 80103f3b: 5d pop %ebp acquire(lk); 80103f3c: e9 3f 05 00 00 jmp 80104480 <acquire> 80103f41: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi p->chan = chan; 80103f48: 89 7b 20 mov %edi,0x20(%ebx) p->state = SLEEPING; 80103f4b: c7 43 0c 02 00 00 00 movl $0x2,0xc(%ebx) sched(); 80103f52: e8 29 fd ff ff call 80103c80 <sched> p->chan = 0; 80103f57: c7 43 20 00 00 00 00 movl $0x0,0x20(%ebx) } 80103f5e: 8d 65 f4 lea -0xc(%ebp),%esp 80103f61: 5b pop %ebx 80103f62: 5e pop %esi 80103f63: 5f pop %edi 80103f64: 5d pop %ebp 80103f65: c3 ret panic("sleep without lk"); 80103f66: 83 ec 0c sub $0xc,%esp 80103f69: 68 d6 76 10 80 push $0x801076d6 80103f6e: e8 1d c4 ff ff call 80100390 <panic> panic("sleep"); 80103f73: 83 ec 0c sub $0xc,%esp 80103f76: 68 d0 76 10 80 push $0x801076d0 80103f7b: e8 10 c4 ff ff call 80100390 <panic> 80103f80 <wait>: { 80103f80: 55 push %ebp 80103f81: 89 e5 mov %esp,%ebp 80103f83: 56 push %esi 80103f84: 53 push %ebx pushcli(); 80103f85: e8 26 04 00 00 call 801043b0 <pushcli> c = mycpu(); 80103f8a: e8 d1 f8 ff ff call 80103860 <mycpu> p = c->proc; 80103f8f: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi popcli(); 80103f95: e8 56 04 00 00 call 801043f0 <popcli> acquire(&ptable.lock); 80103f9a: 83 ec 0c sub $0xc,%esp 80103f9d: 68 20 2d 11 80 push $0x80112d20 80103fa2: e8 d9 04 00 00 call 80104480 <acquire> 80103fa7: 83 c4 10 add $0x10,%esp havekids = 0; 80103faa: 31 c0 xor %eax,%eax for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103fac: bb 54 2d 11 80 mov $0x80112d54,%ebx 80103fb1: eb 10 jmp 80103fc3 <wait+0x43> 80103fb3: 90 nop 80103fb4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103fb8: 83 c3 7c add $0x7c,%ebx 80103fbb: 81 fb 54 4c 11 80 cmp $0x80114c54,%ebx 80103fc1: 73 1b jae 80103fde <wait+0x5e> if(p->parent != curproc) 80103fc3: 39 73 14 cmp %esi,0x14(%ebx) 80103fc6: 75 f0 jne 80103fb8 <wait+0x38> if(p->state == ZOMBIE){ 80103fc8: 83 7b 0c 05 cmpl $0x5,0xc(%ebx) 80103fcc: 74 32 je 80104000 <wait+0x80> for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103fce: 83 c3 7c add $0x7c,%ebx havekids = 1; 80103fd1: b8 01 00 00 00 mov $0x1,%eax for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103fd6: 81 fb 54 4c 11 80 cmp $0x80114c54,%ebx 80103fdc: 72 e5 jb 80103fc3 <wait+0x43> if(!havekids || curproc->killed){ 80103fde: 85 c0 test %eax,%eax 80103fe0: 74 74 je 80104056 <wait+0xd6> 80103fe2: 8b 46 24 mov 0x24(%esi),%eax 80103fe5: 85 c0 test %eax,%eax 80103fe7: 75 6d jne 80104056 <wait+0xd6> sleep(curproc, &ptable.lock); //DOC: wait-sleep 80103fe9: 83 ec 08 sub $0x8,%esp 80103fec: 68 20 2d 11 80 push $0x80112d20 80103ff1: 56 push %esi 80103ff2: e8 c9 fe ff ff call 80103ec0 <sleep> havekids = 0; 80103ff7: 83 c4 10 add $0x10,%esp 80103ffa: eb ae jmp 80103faa <wait+0x2a> 80103ffc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi kfree(p->kstack); 80104000: 83 ec 0c sub $0xc,%esp 80104003: ff 73 08 pushl 0x8(%ebx) pid = p->pid; 80104006: 8b 73 10 mov 0x10(%ebx),%esi kfree(p->kstack); 80104009: e8 22 e4 ff ff call 80102430 <kfree> freevm(p->pgdir); 8010400e: 5a pop %edx 8010400f: ff 73 04 pushl 0x4(%ebx) p->kstack = 0; 80104012: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) freevm(p->pgdir); 80104019: e8 72 2d 00 00 call 80106d90 <freevm> release(&ptable.lock); 8010401e: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) p->pid = 0; 80104025: c7 43 10 00 00 00 00 movl $0x0,0x10(%ebx) p->parent = 0; 8010402c: c7 43 14 00 00 00 00 movl $0x0,0x14(%ebx) p->name[0] = 0; 80104033: c6 43 6c 00 movb $0x0,0x6c(%ebx) p->killed = 0; 80104037: c7 43 24 00 00 00 00 movl $0x0,0x24(%ebx) p->state = UNUSED; 8010403e: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) release(&ptable.lock); 80104045: e8 f6 04 00 00 call 80104540 <release> return pid; 8010404a: 83 c4 10 add $0x10,%esp } 8010404d: 8d 65 f8 lea -0x8(%ebp),%esp 80104050: 89 f0 mov %esi,%eax 80104052: 5b pop %ebx 80104053: 5e pop %esi 80104054: 5d pop %ebp 80104055: c3 ret release(&ptable.lock); 80104056: 83 ec 0c sub $0xc,%esp return -1; 80104059: be ff ff ff ff mov $0xffffffff,%esi release(&ptable.lock); 8010405e: 68 20 2d 11 80 push $0x80112d20 80104063: e8 d8 04 00 00 call 80104540 <release> return -1; 80104068: 83 c4 10 add $0x10,%esp 8010406b: eb e0 jmp 8010404d <wait+0xcd> 8010406d: 8d 76 00 lea 0x0(%esi),%esi 80104070 <wakeup>: } // Wake up all processes sleeping on chan. void wakeup(void *chan) { 80104070: 55 push %ebp 80104071: 89 e5 mov %esp,%ebp 80104073: 53 push %ebx 80104074: 83 ec 10 sub $0x10,%esp 80104077: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&ptable.lock); 8010407a: 68 20 2d 11 80 push $0x80112d20 8010407f: e8 fc 03 00 00 call 80104480 <acquire> 80104084: 83 c4 10 add $0x10,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80104087: b8 54 2d 11 80 mov $0x80112d54,%eax 8010408c: eb 0c jmp 8010409a <wakeup+0x2a> 8010408e: 66 90 xchg %ax,%ax 80104090: 83 c0 7c add $0x7c,%eax 80104093: 3d 54 4c 11 80 cmp $0x80114c54,%eax 80104098: 73 1c jae 801040b6 <wakeup+0x46> if(p->state == SLEEPING && p->chan == chan) 8010409a: 83 78 0c 02 cmpl $0x2,0xc(%eax) 8010409e: 75 f0 jne 80104090 <wakeup+0x20> 801040a0: 3b 58 20 cmp 0x20(%eax),%ebx 801040a3: 75 eb jne 80104090 <wakeup+0x20> p->state = RUNNABLE; 801040a5: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 801040ac: 83 c0 7c add $0x7c,%eax 801040af: 3d 54 4c 11 80 cmp $0x80114c54,%eax 801040b4: 72 e4 jb 8010409a <wakeup+0x2a> wakeup1(chan); release(&ptable.lock); 801040b6: c7 45 08 20 2d 11 80 movl $0x80112d20,0x8(%ebp) } 801040bd: 8b 5d fc mov -0x4(%ebp),%ebx 801040c0: c9 leave release(&ptable.lock); 801040c1: e9 7a 04 00 00 jmp 80104540 <release> 801040c6: 8d 76 00 lea 0x0(%esi),%esi 801040c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801040d0 <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) { 801040d0: 55 push %ebp 801040d1: 89 e5 mov %esp,%ebp 801040d3: 53 push %ebx 801040d4: 83 ec 10 sub $0x10,%esp 801040d7: 8b 5d 08 mov 0x8(%ebp),%ebx struct proc *p; acquire(&ptable.lock); 801040da: 68 20 2d 11 80 push $0x80112d20 801040df: e8 9c 03 00 00 call 80104480 <acquire> 801040e4: 83 c4 10 add $0x10,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 801040e7: b8 54 2d 11 80 mov $0x80112d54,%eax 801040ec: eb 0c jmp 801040fa <kill+0x2a> 801040ee: 66 90 xchg %ax,%ax 801040f0: 83 c0 7c add $0x7c,%eax 801040f3: 3d 54 4c 11 80 cmp $0x80114c54,%eax 801040f8: 73 36 jae 80104130 <kill+0x60> if(p->pid == pid){ 801040fa: 39 58 10 cmp %ebx,0x10(%eax) 801040fd: 75 f1 jne 801040f0 <kill+0x20> p->killed = 1; // Wake process from sleep if necessary. if(p->state == SLEEPING) 801040ff: 83 78 0c 02 cmpl $0x2,0xc(%eax) p->killed = 1; 80104103: c7 40 24 01 00 00 00 movl $0x1,0x24(%eax) if(p->state == SLEEPING) 8010410a: 75 07 jne 80104113 <kill+0x43> p->state = RUNNABLE; 8010410c: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) release(&ptable.lock); 80104113: 83 ec 0c sub $0xc,%esp 80104116: 68 20 2d 11 80 push $0x80112d20 8010411b: e8 20 04 00 00 call 80104540 <release> return 0; 80104120: 83 c4 10 add $0x10,%esp 80104123: 31 c0 xor %eax,%eax } } release(&ptable.lock); return -1; } 80104125: 8b 5d fc mov -0x4(%ebp),%ebx 80104128: c9 leave 80104129: c3 ret 8010412a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi release(&ptable.lock); 80104130: 83 ec 0c sub $0xc,%esp 80104133: 68 20 2d 11 80 push $0x80112d20 80104138: e8 03 04 00 00 call 80104540 <release> return -1; 8010413d: 83 c4 10 add $0x10,%esp 80104140: b8 ff ff ff ff mov $0xffffffff,%eax } 80104145: 8b 5d fc mov -0x4(%ebp),%ebx 80104148: c9 leave 80104149: c3 ret 8010414a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104150 <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) { 80104150: 55 push %ebp 80104151: 89 e5 mov %esp,%ebp 80104153: 57 push %edi 80104154: 56 push %esi 80104155: 53 push %ebx 80104156: 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++){ 80104159: bb 54 2d 11 80 mov $0x80112d54,%ebx { 8010415e: 83 ec 3c sub $0x3c,%esp 80104161: eb 24 jmp 80104187 <procdump+0x37> 80104163: 90 nop 80104164: 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"); 80104168: 83 ec 0c sub $0xc,%esp 8010416b: 68 5f 7a 10 80 push $0x80107a5f 80104170: e8 eb c4 ff ff call 80100660 <cprintf> 80104175: 83 c4 10 add $0x10,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80104178: 83 c3 7c add $0x7c,%ebx 8010417b: 81 fb 54 4c 11 80 cmp $0x80114c54,%ebx 80104181: 0f 83 81 00 00 00 jae 80104208 <procdump+0xb8> if(p->state == UNUSED) 80104187: 8b 43 0c mov 0xc(%ebx),%eax 8010418a: 85 c0 test %eax,%eax 8010418c: 74 ea je 80104178 <procdump+0x28> if(p->state >= 0 && p->state < NELEM(states) && states[p->state]) 8010418e: 83 f8 05 cmp $0x5,%eax state = "???"; 80104191: ba e7 76 10 80 mov $0x801076e7,%edx if(p->state >= 0 && p->state < NELEM(states) && states[p->state]) 80104196: 77 11 ja 801041a9 <procdump+0x59> 80104198: 8b 14 85 48 77 10 80 mov -0x7fef88b8(,%eax,4),%edx state = "???"; 8010419f: b8 e7 76 10 80 mov $0x801076e7,%eax 801041a4: 85 d2 test %edx,%edx 801041a6: 0f 44 d0 cmove %eax,%edx cprintf("%d %s %s", p->pid, state, p->name); 801041a9: 8d 43 6c lea 0x6c(%ebx),%eax 801041ac: 50 push %eax 801041ad: 52 push %edx 801041ae: ff 73 10 pushl 0x10(%ebx) 801041b1: 68 eb 76 10 80 push $0x801076eb 801041b6: e8 a5 c4 ff ff call 80100660 <cprintf> if(p->state == SLEEPING){ 801041bb: 83 c4 10 add $0x10,%esp 801041be: 83 7b 0c 02 cmpl $0x2,0xc(%ebx) 801041c2: 75 a4 jne 80104168 <procdump+0x18> getcallerpcs((uint*)p->context->ebp+2, pc); 801041c4: 8d 45 c0 lea -0x40(%ebp),%eax 801041c7: 83 ec 08 sub $0x8,%esp 801041ca: 8d 7d c0 lea -0x40(%ebp),%edi 801041cd: 50 push %eax 801041ce: 8b 43 1c mov 0x1c(%ebx),%eax 801041d1: 8b 40 0c mov 0xc(%eax),%eax 801041d4: 83 c0 08 add $0x8,%eax 801041d7: 50 push %eax 801041d8: e8 83 01 00 00 call 80104360 <getcallerpcs> 801041dd: 83 c4 10 add $0x10,%esp for(i=0; i<10 && pc[i] != 0; i++) 801041e0: 8b 17 mov (%edi),%edx 801041e2: 85 d2 test %edx,%edx 801041e4: 74 82 je 80104168 <procdump+0x18> cprintf(" %p", pc[i]); 801041e6: 83 ec 08 sub $0x8,%esp 801041e9: 83 c7 04 add $0x4,%edi 801041ec: 52 push %edx 801041ed: 68 01 71 10 80 push $0x80107101 801041f2: e8 69 c4 ff ff call 80100660 <cprintf> for(i=0; i<10 && pc[i] != 0; i++) 801041f7: 83 c4 10 add $0x10,%esp 801041fa: 39 fe cmp %edi,%esi 801041fc: 75 e2 jne 801041e0 <procdump+0x90> 801041fe: e9 65 ff ff ff jmp 80104168 <procdump+0x18> 80104203: 90 nop 80104204: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi } } 80104208: 8d 65 f4 lea -0xc(%ebp),%esp 8010420b: 5b pop %ebx 8010420c: 5e pop %esi 8010420d: 5f pop %edi 8010420e: 5d pop %ebp 8010420f: c3 ret 80104210 <initsleeplock>: #include "spinlock.h" #include "sleeplock.h" void initsleeplock(struct sleeplock *lk, char *name) { 80104210: 55 push %ebp 80104211: 89 e5 mov %esp,%ebp 80104213: 53 push %ebx 80104214: 83 ec 0c sub $0xc,%esp 80104217: 8b 5d 08 mov 0x8(%ebp),%ebx initlock(&lk->lk, "sleep lock"); 8010421a: 68 60 77 10 80 push $0x80107760 8010421f: 8d 43 04 lea 0x4(%ebx),%eax 80104222: 50 push %eax 80104223: e8 18 01 00 00 call 80104340 <initlock> lk->name = name; 80104228: 8b 45 0c mov 0xc(%ebp),%eax lk->locked = 0; 8010422b: c7 03 00 00 00 00 movl $0x0,(%ebx) lk->pid = 0; } 80104231: 83 c4 10 add $0x10,%esp lk->pid = 0; 80104234: c7 43 3c 00 00 00 00 movl $0x0,0x3c(%ebx) lk->name = name; 8010423b: 89 43 38 mov %eax,0x38(%ebx) } 8010423e: 8b 5d fc mov -0x4(%ebp),%ebx 80104241: c9 leave 80104242: c3 ret 80104243: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104249: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104250 <acquiresleep>: void acquiresleep(struct sleeplock *lk) { 80104250: 55 push %ebp 80104251: 89 e5 mov %esp,%ebp 80104253: 56 push %esi 80104254: 53 push %ebx 80104255: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&lk->lk); 80104258: 83 ec 0c sub $0xc,%esp 8010425b: 8d 73 04 lea 0x4(%ebx),%esi 8010425e: 56 push %esi 8010425f: e8 1c 02 00 00 call 80104480 <acquire> while (lk->locked) { 80104264: 8b 13 mov (%ebx),%edx 80104266: 83 c4 10 add $0x10,%esp 80104269: 85 d2 test %edx,%edx 8010426b: 74 16 je 80104283 <acquiresleep+0x33> 8010426d: 8d 76 00 lea 0x0(%esi),%esi sleep(lk, &lk->lk); 80104270: 83 ec 08 sub $0x8,%esp 80104273: 56 push %esi 80104274: 53 push %ebx 80104275: e8 46 fc ff ff call 80103ec0 <sleep> while (lk->locked) { 8010427a: 8b 03 mov (%ebx),%eax 8010427c: 83 c4 10 add $0x10,%esp 8010427f: 85 c0 test %eax,%eax 80104281: 75 ed jne 80104270 <acquiresleep+0x20> } lk->locked = 1; 80104283: c7 03 01 00 00 00 movl $0x1,(%ebx) lk->pid = myproc()->pid; 80104289: e8 72 f6 ff ff call 80103900 <myproc> 8010428e: 8b 40 10 mov 0x10(%eax),%eax 80104291: 89 43 3c mov %eax,0x3c(%ebx) release(&lk->lk); 80104294: 89 75 08 mov %esi,0x8(%ebp) } 80104297: 8d 65 f8 lea -0x8(%ebp),%esp 8010429a: 5b pop %ebx 8010429b: 5e pop %esi 8010429c: 5d pop %ebp release(&lk->lk); 8010429d: e9 9e 02 00 00 jmp 80104540 <release> 801042a2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801042a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801042b0 <releasesleep>: void releasesleep(struct sleeplock *lk) { 801042b0: 55 push %ebp 801042b1: 89 e5 mov %esp,%ebp 801042b3: 56 push %esi 801042b4: 53 push %ebx 801042b5: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&lk->lk); 801042b8: 83 ec 0c sub $0xc,%esp 801042bb: 8d 73 04 lea 0x4(%ebx),%esi 801042be: 56 push %esi 801042bf: e8 bc 01 00 00 call 80104480 <acquire> lk->locked = 0; 801042c4: c7 03 00 00 00 00 movl $0x0,(%ebx) lk->pid = 0; 801042ca: c7 43 3c 00 00 00 00 movl $0x0,0x3c(%ebx) wakeup(lk); 801042d1: 89 1c 24 mov %ebx,(%esp) 801042d4: e8 97 fd ff ff call 80104070 <wakeup> release(&lk->lk); 801042d9: 89 75 08 mov %esi,0x8(%ebp) 801042dc: 83 c4 10 add $0x10,%esp } 801042df: 8d 65 f8 lea -0x8(%ebp),%esp 801042e2: 5b pop %ebx 801042e3: 5e pop %esi 801042e4: 5d pop %ebp release(&lk->lk); 801042e5: e9 56 02 00 00 jmp 80104540 <release> 801042ea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801042f0 <holdingsleep>: int holdingsleep(struct sleeplock *lk) { 801042f0: 55 push %ebp 801042f1: 89 e5 mov %esp,%ebp 801042f3: 57 push %edi 801042f4: 56 push %esi 801042f5: 53 push %ebx 801042f6: 31 ff xor %edi,%edi 801042f8: 83 ec 18 sub $0x18,%esp 801042fb: 8b 5d 08 mov 0x8(%ebp),%ebx int r; acquire(&lk->lk); 801042fe: 8d 73 04 lea 0x4(%ebx),%esi 80104301: 56 push %esi 80104302: e8 79 01 00 00 call 80104480 <acquire> r = lk->locked && (lk->pid == myproc()->pid); 80104307: 8b 03 mov (%ebx),%eax 80104309: 83 c4 10 add $0x10,%esp 8010430c: 85 c0 test %eax,%eax 8010430e: 74 13 je 80104323 <holdingsleep+0x33> 80104310: 8b 5b 3c mov 0x3c(%ebx),%ebx 80104313: e8 e8 f5 ff ff call 80103900 <myproc> 80104318: 39 58 10 cmp %ebx,0x10(%eax) 8010431b: 0f 94 c0 sete %al 8010431e: 0f b6 c0 movzbl %al,%eax 80104321: 89 c7 mov %eax,%edi release(&lk->lk); 80104323: 83 ec 0c sub $0xc,%esp 80104326: 56 push %esi 80104327: e8 14 02 00 00 call 80104540 <release> return r; } 8010432c: 8d 65 f4 lea -0xc(%ebp),%esp 8010432f: 89 f8 mov %edi,%eax 80104331: 5b pop %ebx 80104332: 5e pop %esi 80104333: 5f pop %edi 80104334: 5d pop %ebp 80104335: c3 ret 80104336: 66 90 xchg %ax,%ax 80104338: 66 90 xchg %ax,%ax 8010433a: 66 90 xchg %ax,%ax 8010433c: 66 90 xchg %ax,%ax 8010433e: 66 90 xchg %ax,%ax 80104340 <initlock>: #include "proc.h" #include "spinlock.h" void initlock(struct spinlock *lk, char *name) { 80104340: 55 push %ebp 80104341: 89 e5 mov %esp,%ebp 80104343: 8b 45 08 mov 0x8(%ebp),%eax lk->name = name; 80104346: 8b 55 0c mov 0xc(%ebp),%edx lk->locked = 0; 80104349: c7 00 00 00 00 00 movl $0x0,(%eax) lk->name = name; 8010434f: 89 50 04 mov %edx,0x4(%eax) lk->cpu = 0; 80104352: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax) } 80104359: 5d pop %ebp 8010435a: c3 ret 8010435b: 90 nop 8010435c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104360 <getcallerpcs>: } // Record the current call stack in pcs[] by following the %ebp chain. void getcallerpcs(void *v, uint pcs[]) { 80104360: 55 push %ebp uint *ebp; int i; ebp = (uint*)v - 2; for(i = 0; i < 10; i++){ 80104361: 31 d2 xor %edx,%edx { 80104363: 89 e5 mov %esp,%ebp 80104365: 53 push %ebx ebp = (uint*)v - 2; 80104366: 8b 45 08 mov 0x8(%ebp),%eax { 80104369: 8b 4d 0c mov 0xc(%ebp),%ecx ebp = (uint*)v - 2; 8010436c: 83 e8 08 sub $0x8,%eax 8010436f: 90 nop if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff) 80104370: 8d 98 00 00 00 80 lea -0x80000000(%eax),%ebx 80104376: 81 fb fe ff ff 7f cmp $0x7ffffffe,%ebx 8010437c: 77 1a ja 80104398 <getcallerpcs+0x38> break; pcs[i] = ebp[1]; // saved %eip 8010437e: 8b 58 04 mov 0x4(%eax),%ebx 80104381: 89 1c 91 mov %ebx,(%ecx,%edx,4) for(i = 0; i < 10; i++){ 80104384: 83 c2 01 add $0x1,%edx ebp = (uint*)ebp[0]; // saved %ebp 80104387: 8b 00 mov (%eax),%eax for(i = 0; i < 10; i++){ 80104389: 83 fa 0a cmp $0xa,%edx 8010438c: 75 e2 jne 80104370 <getcallerpcs+0x10> } for(; i < 10; i++) pcs[i] = 0; } 8010438e: 5b pop %ebx 8010438f: 5d pop %ebp 80104390: c3 ret 80104391: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104398: 8d 04 91 lea (%ecx,%edx,4),%eax 8010439b: 83 c1 28 add $0x28,%ecx 8010439e: 66 90 xchg %ax,%ax pcs[i] = 0; 801043a0: c7 00 00 00 00 00 movl $0x0,(%eax) 801043a6: 83 c0 04 add $0x4,%eax for(; i < 10; i++) 801043a9: 39 c1 cmp %eax,%ecx 801043ab: 75 f3 jne 801043a0 <getcallerpcs+0x40> } 801043ad: 5b pop %ebx 801043ae: 5d pop %ebp 801043af: c3 ret 801043b0 <pushcli>: // it takes two popcli to undo two pushcli. Also, if interrupts // are off, then pushcli, popcli leaves them off. void pushcli(void) { 801043b0: 55 push %ebp 801043b1: 89 e5 mov %esp,%ebp 801043b3: 53 push %ebx 801043b4: 83 ec 04 sub $0x4,%esp 801043b7: 9c pushf 801043b8: 5b pop %ebx asm volatile("cli"); 801043b9: fa cli int eflags; eflags = readeflags(); cli(); if(mycpu()->ncli == 0) 801043ba: e8 a1 f4 ff ff call 80103860 <mycpu> 801043bf: 8b 80 a4 00 00 00 mov 0xa4(%eax),%eax 801043c5: 85 c0 test %eax,%eax 801043c7: 75 11 jne 801043da <pushcli+0x2a> mycpu()->intena = eflags & FL_IF; 801043c9: 81 e3 00 02 00 00 and $0x200,%ebx 801043cf: e8 8c f4 ff ff call 80103860 <mycpu> 801043d4: 89 98 a8 00 00 00 mov %ebx,0xa8(%eax) mycpu()->ncli += 1; 801043da: e8 81 f4 ff ff call 80103860 <mycpu> 801043df: 83 80 a4 00 00 00 01 addl $0x1,0xa4(%eax) } 801043e6: 83 c4 04 add $0x4,%esp 801043e9: 5b pop %ebx 801043ea: 5d pop %ebp 801043eb: c3 ret 801043ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801043f0 <popcli>: void popcli(void) { 801043f0: 55 push %ebp 801043f1: 89 e5 mov %esp,%ebp 801043f3: 83 ec 08 sub $0x8,%esp asm volatile("pushfl; popl %0" : "=r" (eflags)); 801043f6: 9c pushf 801043f7: 58 pop %eax if(readeflags()&FL_IF) 801043f8: f6 c4 02 test $0x2,%ah 801043fb: 75 35 jne 80104432 <popcli+0x42> panic("popcli - interruptible"); if(--mycpu()->ncli < 0) 801043fd: e8 5e f4 ff ff call 80103860 <mycpu> 80104402: 83 a8 a4 00 00 00 01 subl $0x1,0xa4(%eax) 80104409: 78 34 js 8010443f <popcli+0x4f> panic("popcli"); if(mycpu()->ncli == 0 && mycpu()->intena) 8010440b: e8 50 f4 ff ff call 80103860 <mycpu> 80104410: 8b 90 a4 00 00 00 mov 0xa4(%eax),%edx 80104416: 85 d2 test %edx,%edx 80104418: 74 06 je 80104420 <popcli+0x30> sti(); } 8010441a: c9 leave 8010441b: c3 ret 8010441c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(mycpu()->ncli == 0 && mycpu()->intena) 80104420: e8 3b f4 ff ff call 80103860 <mycpu> 80104425: 8b 80 a8 00 00 00 mov 0xa8(%eax),%eax 8010442b: 85 c0 test %eax,%eax 8010442d: 74 eb je 8010441a <popcli+0x2a> asm volatile("sti"); 8010442f: fb sti } 80104430: c9 leave 80104431: c3 ret panic("popcli - interruptible"); 80104432: 83 ec 0c sub $0xc,%esp 80104435: 68 6b 77 10 80 push $0x8010776b 8010443a: e8 51 bf ff ff call 80100390 <panic> panic("popcli"); 8010443f: 83 ec 0c sub $0xc,%esp 80104442: 68 82 77 10 80 push $0x80107782 80104447: e8 44 bf ff ff call 80100390 <panic> 8010444c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104450 <holding>: { 80104450: 55 push %ebp 80104451: 89 e5 mov %esp,%ebp 80104453: 56 push %esi 80104454: 53 push %ebx 80104455: 8b 75 08 mov 0x8(%ebp),%esi 80104458: 31 db xor %ebx,%ebx pushcli(); 8010445a: e8 51 ff ff ff call 801043b0 <pushcli> r = lock->locked && lock->cpu == mycpu(); 8010445f: 8b 06 mov (%esi),%eax 80104461: 85 c0 test %eax,%eax 80104463: 74 10 je 80104475 <holding+0x25> 80104465: 8b 5e 08 mov 0x8(%esi),%ebx 80104468: e8 f3 f3 ff ff call 80103860 <mycpu> 8010446d: 39 c3 cmp %eax,%ebx 8010446f: 0f 94 c3 sete %bl 80104472: 0f b6 db movzbl %bl,%ebx popcli(); 80104475: e8 76 ff ff ff call 801043f0 <popcli> } 8010447a: 89 d8 mov %ebx,%eax 8010447c: 5b pop %ebx 8010447d: 5e pop %esi 8010447e: 5d pop %ebp 8010447f: c3 ret 80104480 <acquire>: { 80104480: 55 push %ebp 80104481: 89 e5 mov %esp,%ebp 80104483: 56 push %esi 80104484: 53 push %ebx pushcli(); // disable interrupts to avoid deadlock. 80104485: e8 26 ff ff ff call 801043b0 <pushcli> if(holding(lk)) 8010448a: 8b 5d 08 mov 0x8(%ebp),%ebx 8010448d: 83 ec 0c sub $0xc,%esp 80104490: 53 push %ebx 80104491: e8 ba ff ff ff call 80104450 <holding> 80104496: 83 c4 10 add $0x10,%esp 80104499: 85 c0 test %eax,%eax 8010449b: 0f 85 83 00 00 00 jne 80104524 <acquire+0xa4> 801044a1: 89 c6 mov %eax,%esi asm volatile("lock; xchgl %0, %1" : 801044a3: ba 01 00 00 00 mov $0x1,%edx 801044a8: eb 09 jmp 801044b3 <acquire+0x33> 801044aa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801044b0: 8b 5d 08 mov 0x8(%ebp),%ebx 801044b3: 89 d0 mov %edx,%eax 801044b5: f0 87 03 lock xchg %eax,(%ebx) while(xchg(&lk->locked, 1) != 0) 801044b8: 85 c0 test %eax,%eax 801044ba: 75 f4 jne 801044b0 <acquire+0x30> __sync_synchronize(); 801044bc: f0 83 0c 24 00 lock orl $0x0,(%esp) lk->cpu = mycpu(); 801044c1: 8b 5d 08 mov 0x8(%ebp),%ebx 801044c4: e8 97 f3 ff ff call 80103860 <mycpu> getcallerpcs(&lk, lk->pcs); 801044c9: 8d 53 0c lea 0xc(%ebx),%edx lk->cpu = mycpu(); 801044cc: 89 43 08 mov %eax,0x8(%ebx) ebp = (uint*)v - 2; 801044cf: 89 e8 mov %ebp,%eax 801044d1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff) 801044d8: 8d 88 00 00 00 80 lea -0x80000000(%eax),%ecx 801044de: 81 f9 fe ff ff 7f cmp $0x7ffffffe,%ecx 801044e4: 77 1a ja 80104500 <acquire+0x80> pcs[i] = ebp[1]; // saved %eip 801044e6: 8b 48 04 mov 0x4(%eax),%ecx 801044e9: 89 0c b2 mov %ecx,(%edx,%esi,4) for(i = 0; i < 10; i++){ 801044ec: 83 c6 01 add $0x1,%esi ebp = (uint*)ebp[0]; // saved %ebp 801044ef: 8b 00 mov (%eax),%eax for(i = 0; i < 10; i++){ 801044f1: 83 fe 0a cmp $0xa,%esi 801044f4: 75 e2 jne 801044d8 <acquire+0x58> } 801044f6: 8d 65 f8 lea -0x8(%ebp),%esp 801044f9: 5b pop %ebx 801044fa: 5e pop %esi 801044fb: 5d pop %ebp 801044fc: c3 ret 801044fd: 8d 76 00 lea 0x0(%esi),%esi 80104500: 8d 04 b2 lea (%edx,%esi,4),%eax 80104503: 83 c2 28 add $0x28,%edx 80104506: 8d 76 00 lea 0x0(%esi),%esi 80104509: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi pcs[i] = 0; 80104510: c7 00 00 00 00 00 movl $0x0,(%eax) 80104516: 83 c0 04 add $0x4,%eax for(; i < 10; i++) 80104519: 39 d0 cmp %edx,%eax 8010451b: 75 f3 jne 80104510 <acquire+0x90> } 8010451d: 8d 65 f8 lea -0x8(%ebp),%esp 80104520: 5b pop %ebx 80104521: 5e pop %esi 80104522: 5d pop %ebp 80104523: c3 ret panic("acquire"); 80104524: 83 ec 0c sub $0xc,%esp 80104527: 68 89 77 10 80 push $0x80107789 8010452c: e8 5f be ff ff call 80100390 <panic> 80104531: eb 0d jmp 80104540 <release> 80104533: 90 nop 80104534: 90 nop 80104535: 90 nop 80104536: 90 nop 80104537: 90 nop 80104538: 90 nop 80104539: 90 nop 8010453a: 90 nop 8010453b: 90 nop 8010453c: 90 nop 8010453d: 90 nop 8010453e: 90 nop 8010453f: 90 nop 80104540 <release>: { 80104540: 55 push %ebp 80104541: 89 e5 mov %esp,%ebp 80104543: 53 push %ebx 80104544: 83 ec 10 sub $0x10,%esp 80104547: 8b 5d 08 mov 0x8(%ebp),%ebx if(!holding(lk)) 8010454a: 53 push %ebx 8010454b: e8 00 ff ff ff call 80104450 <holding> 80104550: 83 c4 10 add $0x10,%esp 80104553: 85 c0 test %eax,%eax 80104555: 74 22 je 80104579 <release+0x39> lk->pcs[0] = 0; 80104557: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) lk->cpu = 0; 8010455e: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) __sync_synchronize(); 80104565: f0 83 0c 24 00 lock orl $0x0,(%esp) asm volatile("movl $0, %0" : "+m" (lk->locked) : ); 8010456a: c7 03 00 00 00 00 movl $0x0,(%ebx) } 80104570: 8b 5d fc mov -0x4(%ebp),%ebx 80104573: c9 leave popcli(); 80104574: e9 77 fe ff ff jmp 801043f0 <popcli> panic("release"); 80104579: 83 ec 0c sub $0xc,%esp 8010457c: 68 91 77 10 80 push $0x80107791 80104581: e8 0a be ff ff call 80100390 <panic> 80104586: 66 90 xchg %ax,%ax 80104588: 66 90 xchg %ax,%ax 8010458a: 66 90 xchg %ax,%ax 8010458c: 66 90 xchg %ax,%ax 8010458e: 66 90 xchg %ax,%ax 80104590 <memset>: #include "types.h" #include "x86.h" void* memset(void *dst, int c, uint n) { 80104590: 55 push %ebp 80104591: 89 e5 mov %esp,%ebp 80104593: 57 push %edi 80104594: 53 push %ebx 80104595: 8b 55 08 mov 0x8(%ebp),%edx 80104598: 8b 4d 10 mov 0x10(%ebp),%ecx if ((int)dst%4 == 0 && n%4 == 0){ 8010459b: f6 c2 03 test $0x3,%dl 8010459e: 75 05 jne 801045a5 <memset+0x15> 801045a0: f6 c1 03 test $0x3,%cl 801045a3: 74 13 je 801045b8 <memset+0x28> asm volatile("cld; rep stosb" : 801045a5: 89 d7 mov %edx,%edi 801045a7: 8b 45 0c mov 0xc(%ebp),%eax 801045aa: fc cld 801045ab: 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; } 801045ad: 5b pop %ebx 801045ae: 89 d0 mov %edx,%eax 801045b0: 5f pop %edi 801045b1: 5d pop %ebp 801045b2: c3 ret 801045b3: 90 nop 801045b4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi c &= 0xFF; 801045b8: 0f b6 7d 0c movzbl 0xc(%ebp),%edi stosl(dst, (c<<24)|(c<<16)|(c<<8)|c, n/4); 801045bc: c1 e9 02 shr $0x2,%ecx 801045bf: 89 f8 mov %edi,%eax 801045c1: 89 fb mov %edi,%ebx 801045c3: c1 e0 18 shl $0x18,%eax 801045c6: c1 e3 10 shl $0x10,%ebx 801045c9: 09 d8 or %ebx,%eax 801045cb: 09 f8 or %edi,%eax 801045cd: c1 e7 08 shl $0x8,%edi 801045d0: 09 f8 or %edi,%eax asm volatile("cld; rep stosl" : 801045d2: 89 d7 mov %edx,%edi 801045d4: fc cld 801045d5: f3 ab rep stos %eax,%es:(%edi) } 801045d7: 5b pop %ebx 801045d8: 89 d0 mov %edx,%eax 801045da: 5f pop %edi 801045db: 5d pop %ebp 801045dc: c3 ret 801045dd: 8d 76 00 lea 0x0(%esi),%esi 801045e0 <memcmp>: int memcmp(const void *v1, const void *v2, uint n) { 801045e0: 55 push %ebp 801045e1: 89 e5 mov %esp,%ebp 801045e3: 57 push %edi 801045e4: 56 push %esi 801045e5: 53 push %ebx 801045e6: 8b 5d 10 mov 0x10(%ebp),%ebx 801045e9: 8b 75 08 mov 0x8(%ebp),%esi 801045ec: 8b 7d 0c mov 0xc(%ebp),%edi const uchar *s1, *s2; s1 = v1; s2 = v2; while(n-- > 0){ 801045ef: 85 db test %ebx,%ebx 801045f1: 74 29 je 8010461c <memcmp+0x3c> if(*s1 != *s2) 801045f3: 0f b6 16 movzbl (%esi),%edx 801045f6: 0f b6 0f movzbl (%edi),%ecx 801045f9: 38 d1 cmp %dl,%cl 801045fb: 75 2b jne 80104628 <memcmp+0x48> 801045fd: b8 01 00 00 00 mov $0x1,%eax 80104602: eb 14 jmp 80104618 <memcmp+0x38> 80104604: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104608: 0f b6 14 06 movzbl (%esi,%eax,1),%edx 8010460c: 83 c0 01 add $0x1,%eax 8010460f: 0f b6 4c 07 ff movzbl -0x1(%edi,%eax,1),%ecx 80104614: 38 ca cmp %cl,%dl 80104616: 75 10 jne 80104628 <memcmp+0x48> while(n-- > 0){ 80104618: 39 d8 cmp %ebx,%eax 8010461a: 75 ec jne 80104608 <memcmp+0x28> return *s1 - *s2; s1++, s2++; } return 0; } 8010461c: 5b pop %ebx return 0; 8010461d: 31 c0 xor %eax,%eax } 8010461f: 5e pop %esi 80104620: 5f pop %edi 80104621: 5d pop %ebp 80104622: c3 ret 80104623: 90 nop 80104624: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return *s1 - *s2; 80104628: 0f b6 c2 movzbl %dl,%eax } 8010462b: 5b pop %ebx return *s1 - *s2; 8010462c: 29 c8 sub %ecx,%eax } 8010462e: 5e pop %esi 8010462f: 5f pop %edi 80104630: 5d pop %ebp 80104631: c3 ret 80104632: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104639: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104640 <memmove>: void* memmove(void *dst, const void *src, uint n) { 80104640: 55 push %ebp 80104641: 89 e5 mov %esp,%ebp 80104643: 56 push %esi 80104644: 53 push %ebx 80104645: 8b 45 08 mov 0x8(%ebp),%eax 80104648: 8b 5d 0c mov 0xc(%ebp),%ebx 8010464b: 8b 75 10 mov 0x10(%ebp),%esi const char *s; char *d; s = src; d = dst; if(s < d && s + n > d){ 8010464e: 39 c3 cmp %eax,%ebx 80104650: 73 26 jae 80104678 <memmove+0x38> 80104652: 8d 0c 33 lea (%ebx,%esi,1),%ecx 80104655: 39 c8 cmp %ecx,%eax 80104657: 73 1f jae 80104678 <memmove+0x38> s += n; d += n; while(n-- > 0) 80104659: 85 f6 test %esi,%esi 8010465b: 8d 56 ff lea -0x1(%esi),%edx 8010465e: 74 0f je 8010466f <memmove+0x2f> *--d = *--s; 80104660: 0f b6 0c 13 movzbl (%ebx,%edx,1),%ecx 80104664: 88 0c 10 mov %cl,(%eax,%edx,1) while(n-- > 0) 80104667: 83 ea 01 sub $0x1,%edx 8010466a: 83 fa ff cmp $0xffffffff,%edx 8010466d: 75 f1 jne 80104660 <memmove+0x20> } else while(n-- > 0) *d++ = *s++; return dst; } 8010466f: 5b pop %ebx 80104670: 5e pop %esi 80104671: 5d pop %ebp 80104672: c3 ret 80104673: 90 nop 80104674: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi while(n-- > 0) 80104678: 31 d2 xor %edx,%edx 8010467a: 85 f6 test %esi,%esi 8010467c: 74 f1 je 8010466f <memmove+0x2f> 8010467e: 66 90 xchg %ax,%ax *d++ = *s++; 80104680: 0f b6 0c 13 movzbl (%ebx,%edx,1),%ecx 80104684: 88 0c 10 mov %cl,(%eax,%edx,1) 80104687: 83 c2 01 add $0x1,%edx while(n-- > 0) 8010468a: 39 d6 cmp %edx,%esi 8010468c: 75 f2 jne 80104680 <memmove+0x40> } 8010468e: 5b pop %ebx 8010468f: 5e pop %esi 80104690: 5d pop %ebp 80104691: c3 ret 80104692: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104699: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801046a0 <memcpy>: // memcpy exists to placate GCC. Use memmove. void* memcpy(void *dst, const void *src, uint n) { 801046a0: 55 push %ebp 801046a1: 89 e5 mov %esp,%ebp return memmove(dst, src, n); } 801046a3: 5d pop %ebp return memmove(dst, src, n); 801046a4: eb 9a jmp 80104640 <memmove> 801046a6: 8d 76 00 lea 0x0(%esi),%esi 801046a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801046b0 <strncmp>: int strncmp(const char *p, const char *q, uint n) { 801046b0: 55 push %ebp 801046b1: 89 e5 mov %esp,%ebp 801046b3: 57 push %edi 801046b4: 56 push %esi 801046b5: 8b 7d 10 mov 0x10(%ebp),%edi 801046b8: 53 push %ebx 801046b9: 8b 4d 08 mov 0x8(%ebp),%ecx 801046bc: 8b 75 0c mov 0xc(%ebp),%esi while(n > 0 && *p && *p == *q) 801046bf: 85 ff test %edi,%edi 801046c1: 74 2f je 801046f2 <strncmp+0x42> 801046c3: 0f b6 01 movzbl (%ecx),%eax 801046c6: 0f b6 1e movzbl (%esi),%ebx 801046c9: 84 c0 test %al,%al 801046cb: 74 37 je 80104704 <strncmp+0x54> 801046cd: 38 c3 cmp %al,%bl 801046cf: 75 33 jne 80104704 <strncmp+0x54> 801046d1: 01 f7 add %esi,%edi 801046d3: eb 13 jmp 801046e8 <strncmp+0x38> 801046d5: 8d 76 00 lea 0x0(%esi),%esi 801046d8: 0f b6 01 movzbl (%ecx),%eax 801046db: 84 c0 test %al,%al 801046dd: 74 21 je 80104700 <strncmp+0x50> 801046df: 0f b6 1a movzbl (%edx),%ebx 801046e2: 89 d6 mov %edx,%esi 801046e4: 38 d8 cmp %bl,%al 801046e6: 75 1c jne 80104704 <strncmp+0x54> n--, p++, q++; 801046e8: 8d 56 01 lea 0x1(%esi),%edx 801046eb: 83 c1 01 add $0x1,%ecx while(n > 0 && *p && *p == *q) 801046ee: 39 fa cmp %edi,%edx 801046f0: 75 e6 jne 801046d8 <strncmp+0x28> if(n == 0) return 0; return (uchar)*p - (uchar)*q; } 801046f2: 5b pop %ebx return 0; 801046f3: 31 c0 xor %eax,%eax } 801046f5: 5e pop %esi 801046f6: 5f pop %edi 801046f7: 5d pop %ebp 801046f8: c3 ret 801046f9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104700: 0f b6 5e 01 movzbl 0x1(%esi),%ebx return (uchar)*p - (uchar)*q; 80104704: 29 d8 sub %ebx,%eax } 80104706: 5b pop %ebx 80104707: 5e pop %esi 80104708: 5f pop %edi 80104709: 5d pop %ebp 8010470a: c3 ret 8010470b: 90 nop 8010470c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104710 <strncpy>: char* strncpy(char *s, const char *t, int n) { 80104710: 55 push %ebp 80104711: 89 e5 mov %esp,%ebp 80104713: 56 push %esi 80104714: 53 push %ebx 80104715: 8b 45 08 mov 0x8(%ebp),%eax 80104718: 8b 5d 0c mov 0xc(%ebp),%ebx 8010471b: 8b 4d 10 mov 0x10(%ebp),%ecx char *os; os = s; while(n-- > 0 && (*s++ = *t++) != 0) 8010471e: 89 c2 mov %eax,%edx 80104720: eb 19 jmp 8010473b <strncpy+0x2b> 80104722: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104728: 83 c3 01 add $0x1,%ebx 8010472b: 0f b6 4b ff movzbl -0x1(%ebx),%ecx 8010472f: 83 c2 01 add $0x1,%edx 80104732: 84 c9 test %cl,%cl 80104734: 88 4a ff mov %cl,-0x1(%edx) 80104737: 74 09 je 80104742 <strncpy+0x32> 80104739: 89 f1 mov %esi,%ecx 8010473b: 85 c9 test %ecx,%ecx 8010473d: 8d 71 ff lea -0x1(%ecx),%esi 80104740: 7f e6 jg 80104728 <strncpy+0x18> ; while(n-- > 0) 80104742: 31 c9 xor %ecx,%ecx 80104744: 85 f6 test %esi,%esi 80104746: 7e 17 jle 8010475f <strncpy+0x4f> 80104748: 90 nop 80104749: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi *s++ = 0; 80104750: c6 04 0a 00 movb $0x0,(%edx,%ecx,1) 80104754: 89 f3 mov %esi,%ebx 80104756: 83 c1 01 add $0x1,%ecx 80104759: 29 cb sub %ecx,%ebx while(n-- > 0) 8010475b: 85 db test %ebx,%ebx 8010475d: 7f f1 jg 80104750 <strncpy+0x40> return os; } 8010475f: 5b pop %ebx 80104760: 5e pop %esi 80104761: 5d pop %ebp 80104762: c3 ret 80104763: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104769: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104770 <safestrcpy>: // Like strncpy but guaranteed to NUL-terminate. char* safestrcpy(char *s, const char *t, int n) { 80104770: 55 push %ebp 80104771: 89 e5 mov %esp,%ebp 80104773: 56 push %esi 80104774: 53 push %ebx 80104775: 8b 4d 10 mov 0x10(%ebp),%ecx 80104778: 8b 45 08 mov 0x8(%ebp),%eax 8010477b: 8b 55 0c mov 0xc(%ebp),%edx char *os; os = s; if(n <= 0) 8010477e: 85 c9 test %ecx,%ecx 80104780: 7e 26 jle 801047a8 <safestrcpy+0x38> 80104782: 8d 74 0a ff lea -0x1(%edx,%ecx,1),%esi 80104786: 89 c1 mov %eax,%ecx 80104788: eb 17 jmp 801047a1 <safestrcpy+0x31> 8010478a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return os; while(--n > 0 && (*s++ = *t++) != 0) 80104790: 83 c2 01 add $0x1,%edx 80104793: 0f b6 5a ff movzbl -0x1(%edx),%ebx 80104797: 83 c1 01 add $0x1,%ecx 8010479a: 84 db test %bl,%bl 8010479c: 88 59 ff mov %bl,-0x1(%ecx) 8010479f: 74 04 je 801047a5 <safestrcpy+0x35> 801047a1: 39 f2 cmp %esi,%edx 801047a3: 75 eb jne 80104790 <safestrcpy+0x20> ; *s = 0; 801047a5: c6 01 00 movb $0x0,(%ecx) return os; } 801047a8: 5b pop %ebx 801047a9: 5e pop %esi 801047aa: 5d pop %ebp 801047ab: c3 ret 801047ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801047b0 <strlen>: int strlen(const char *s) { 801047b0: 55 push %ebp int n; for(n = 0; s[n]; n++) 801047b1: 31 c0 xor %eax,%eax { 801047b3: 89 e5 mov %esp,%ebp 801047b5: 8b 55 08 mov 0x8(%ebp),%edx for(n = 0; s[n]; n++) 801047b8: 80 3a 00 cmpb $0x0,(%edx) 801047bb: 74 0c je 801047c9 <strlen+0x19> 801047bd: 8d 76 00 lea 0x0(%esi),%esi 801047c0: 83 c0 01 add $0x1,%eax 801047c3: 80 3c 02 00 cmpb $0x0,(%edx,%eax,1) 801047c7: 75 f7 jne 801047c0 <strlen+0x10> ; return n; } 801047c9: 5d pop %ebp 801047ca: c3 ret 801047cb <swtch>: # a struct context, and save its address in *old. # Switch stacks to new and pop previously-saved registers. .globl swtch swtch: movl 4(%esp), %eax 801047cb: 8b 44 24 04 mov 0x4(%esp),%eax movl 8(%esp), %edx 801047cf: 8b 54 24 08 mov 0x8(%esp),%edx # Save old callee-saved registers pushl %ebp 801047d3: 55 push %ebp pushl %ebx 801047d4: 53 push %ebx pushl %esi 801047d5: 56 push %esi pushl %edi 801047d6: 57 push %edi # Switch stacks movl %esp, (%eax) 801047d7: 89 20 mov %esp,(%eax) movl %edx, %esp 801047d9: 89 d4 mov %edx,%esp # Load new callee-saved registers popl %edi 801047db: 5f pop %edi popl %esi 801047dc: 5e pop %esi popl %ebx 801047dd: 5b pop %ebx popl %ebp 801047de: 5d pop %ebp ret 801047df: c3 ret 801047e0 <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) { 801047e0: 55 push %ebp 801047e1: 89 e5 mov %esp,%ebp 801047e3: 53 push %ebx 801047e4: 83 ec 04 sub $0x4,%esp 801047e7: 8b 5d 08 mov 0x8(%ebp),%ebx struct proc *curproc = myproc(); 801047ea: e8 11 f1 ff ff call 80103900 <myproc> if(addr >= curproc->sz || addr+4 > curproc->sz) 801047ef: 8b 00 mov (%eax),%eax 801047f1: 39 d8 cmp %ebx,%eax 801047f3: 76 1b jbe 80104810 <fetchint+0x30> 801047f5: 8d 53 04 lea 0x4(%ebx),%edx 801047f8: 39 d0 cmp %edx,%eax 801047fa: 72 14 jb 80104810 <fetchint+0x30> return -1; *ip = *(int*)(addr); 801047fc: 8b 45 0c mov 0xc(%ebp),%eax 801047ff: 8b 13 mov (%ebx),%edx 80104801: 89 10 mov %edx,(%eax) return 0; 80104803: 31 c0 xor %eax,%eax } 80104805: 83 c4 04 add $0x4,%esp 80104808: 5b pop %ebx 80104809: 5d pop %ebp 8010480a: c3 ret 8010480b: 90 nop 8010480c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80104810: b8 ff ff ff ff mov $0xffffffff,%eax 80104815: eb ee jmp 80104805 <fetchint+0x25> 80104817: 89 f6 mov %esi,%esi 80104819: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104820 <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) { 80104820: 55 push %ebp 80104821: 89 e5 mov %esp,%ebp 80104823: 53 push %ebx 80104824: 83 ec 04 sub $0x4,%esp 80104827: 8b 5d 08 mov 0x8(%ebp),%ebx char *s, *ep; struct proc *curproc = myproc(); 8010482a: e8 d1 f0 ff ff call 80103900 <myproc> if(addr >= curproc->sz) 8010482f: 39 18 cmp %ebx,(%eax) 80104831: 76 29 jbe 8010485c <fetchstr+0x3c> return -1; *pp = (char*)addr; 80104833: 8b 4d 0c mov 0xc(%ebp),%ecx 80104836: 89 da mov %ebx,%edx 80104838: 89 19 mov %ebx,(%ecx) ep = (char*)curproc->sz; 8010483a: 8b 00 mov (%eax),%eax for(s = *pp; s < ep; s++){ 8010483c: 39 c3 cmp %eax,%ebx 8010483e: 73 1c jae 8010485c <fetchstr+0x3c> if(*s == 0) 80104840: 80 3b 00 cmpb $0x0,(%ebx) 80104843: 75 10 jne 80104855 <fetchstr+0x35> 80104845: eb 39 jmp 80104880 <fetchstr+0x60> 80104847: 89 f6 mov %esi,%esi 80104849: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104850: 80 3a 00 cmpb $0x0,(%edx) 80104853: 74 1b je 80104870 <fetchstr+0x50> for(s = *pp; s < ep; s++){ 80104855: 83 c2 01 add $0x1,%edx 80104858: 39 d0 cmp %edx,%eax 8010485a: 77 f4 ja 80104850 <fetchstr+0x30> return -1; 8010485c: b8 ff ff ff ff mov $0xffffffff,%eax return s - *pp; } return -1; } 80104861: 83 c4 04 add $0x4,%esp 80104864: 5b pop %ebx 80104865: 5d pop %ebp 80104866: c3 ret 80104867: 89 f6 mov %esi,%esi 80104869: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104870: 83 c4 04 add $0x4,%esp 80104873: 89 d0 mov %edx,%eax 80104875: 29 d8 sub %ebx,%eax 80104877: 5b pop %ebx 80104878: 5d pop %ebp 80104879: c3 ret 8010487a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(*s == 0) 80104880: 31 c0 xor %eax,%eax return s - *pp; 80104882: eb dd jmp 80104861 <fetchstr+0x41> 80104884: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010488a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80104890 <argint>: // Fetch the nth 32-bit system call argument. int argint(int n, int *ip) { 80104890: 55 push %ebp 80104891: 89 e5 mov %esp,%ebp 80104893: 56 push %esi 80104894: 53 push %ebx return fetchint((myproc()->tf->esp) + 4 + 4*n, ip); 80104895: e8 66 f0 ff ff call 80103900 <myproc> 8010489a: 8b 40 18 mov 0x18(%eax),%eax 8010489d: 8b 55 08 mov 0x8(%ebp),%edx 801048a0: 8b 40 44 mov 0x44(%eax),%eax 801048a3: 8d 1c 90 lea (%eax,%edx,4),%ebx struct proc *curproc = myproc(); 801048a6: e8 55 f0 ff ff call 80103900 <myproc> if(addr >= curproc->sz || addr+4 > curproc->sz) 801048ab: 8b 00 mov (%eax),%eax return fetchint((myproc()->tf->esp) + 4 + 4*n, ip); 801048ad: 8d 73 04 lea 0x4(%ebx),%esi if(addr >= curproc->sz || addr+4 > curproc->sz) 801048b0: 39 c6 cmp %eax,%esi 801048b2: 73 1c jae 801048d0 <argint+0x40> 801048b4: 8d 53 08 lea 0x8(%ebx),%edx 801048b7: 39 d0 cmp %edx,%eax 801048b9: 72 15 jb 801048d0 <argint+0x40> *ip = *(int*)(addr); 801048bb: 8b 45 0c mov 0xc(%ebp),%eax 801048be: 8b 53 04 mov 0x4(%ebx),%edx 801048c1: 89 10 mov %edx,(%eax) return 0; 801048c3: 31 c0 xor %eax,%eax } 801048c5: 5b pop %ebx 801048c6: 5e pop %esi 801048c7: 5d pop %ebp 801048c8: c3 ret 801048c9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 801048d0: b8 ff ff ff ff mov $0xffffffff,%eax return fetchint((myproc()->tf->esp) + 4 + 4*n, ip); 801048d5: eb ee jmp 801048c5 <argint+0x35> 801048d7: 89 f6 mov %esi,%esi 801048d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801048e0 <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) { 801048e0: 55 push %ebp 801048e1: 89 e5 mov %esp,%ebp 801048e3: 56 push %esi 801048e4: 53 push %ebx 801048e5: 83 ec 10 sub $0x10,%esp 801048e8: 8b 5d 10 mov 0x10(%ebp),%ebx int i; struct proc *curproc = myproc(); 801048eb: e8 10 f0 ff ff call 80103900 <myproc> 801048f0: 89 c6 mov %eax,%esi if(argint(n, &i) < 0) 801048f2: 8d 45 f4 lea -0xc(%ebp),%eax 801048f5: 83 ec 08 sub $0x8,%esp 801048f8: 50 push %eax 801048f9: ff 75 08 pushl 0x8(%ebp) 801048fc: e8 8f ff ff ff call 80104890 <argint> return -1; if(size < 0 || (uint)i >= curproc->sz || (uint)i+size > curproc->sz) 80104901: 83 c4 10 add $0x10,%esp 80104904: 85 c0 test %eax,%eax 80104906: 78 28 js 80104930 <argptr+0x50> 80104908: 85 db test %ebx,%ebx 8010490a: 78 24 js 80104930 <argptr+0x50> 8010490c: 8b 16 mov (%esi),%edx 8010490e: 8b 45 f4 mov -0xc(%ebp),%eax 80104911: 39 c2 cmp %eax,%edx 80104913: 76 1b jbe 80104930 <argptr+0x50> 80104915: 01 c3 add %eax,%ebx 80104917: 39 da cmp %ebx,%edx 80104919: 72 15 jb 80104930 <argptr+0x50> return -1; *pp = (char*)i; 8010491b: 8b 55 0c mov 0xc(%ebp),%edx 8010491e: 89 02 mov %eax,(%edx) return 0; 80104920: 31 c0 xor %eax,%eax } 80104922: 8d 65 f8 lea -0x8(%ebp),%esp 80104925: 5b pop %ebx 80104926: 5e pop %esi 80104927: 5d pop %ebp 80104928: c3 ret 80104929: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80104930: b8 ff ff ff ff mov $0xffffffff,%eax 80104935: eb eb jmp 80104922 <argptr+0x42> 80104937: 89 f6 mov %esi,%esi 80104939: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104940 <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) { 80104940: 55 push %ebp 80104941: 89 e5 mov %esp,%ebp 80104943: 83 ec 20 sub $0x20,%esp int addr; if(argint(n, &addr) < 0) 80104946: 8d 45 f4 lea -0xc(%ebp),%eax 80104949: 50 push %eax 8010494a: ff 75 08 pushl 0x8(%ebp) 8010494d: e8 3e ff ff ff call 80104890 <argint> 80104952: 83 c4 10 add $0x10,%esp 80104955: 85 c0 test %eax,%eax 80104957: 78 17 js 80104970 <argstr+0x30> return -1; return fetchstr(addr, pp); 80104959: 83 ec 08 sub $0x8,%esp 8010495c: ff 75 0c pushl 0xc(%ebp) 8010495f: ff 75 f4 pushl -0xc(%ebp) 80104962: e8 b9 fe ff ff call 80104820 <fetchstr> 80104967: 83 c4 10 add $0x10,%esp } 8010496a: c9 leave 8010496b: c3 ret 8010496c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80104970: b8 ff ff ff ff mov $0xffffffff,%eax } 80104975: c9 leave 80104976: c3 ret 80104977: 89 f6 mov %esi,%esi 80104979: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104980 <syscall>: [SYS_swapwrite] sys_swapwrite, }; void syscall(void) { 80104980: 55 push %ebp 80104981: 89 e5 mov %esp,%ebp 80104983: 53 push %ebx 80104984: 83 ec 04 sub $0x4,%esp int num; struct proc *curproc = myproc(); 80104987: e8 74 ef ff ff call 80103900 <myproc> 8010498c: 89 c3 mov %eax,%ebx num = curproc->tf->eax; 8010498e: 8b 40 18 mov 0x18(%eax),%eax 80104991: 8b 40 1c mov 0x1c(%eax),%eax if(num > 0 && num < NELEM(syscalls) && syscalls[num]) { 80104994: 8d 50 ff lea -0x1(%eax),%edx 80104997: 83 fa 16 cmp $0x16,%edx 8010499a: 77 1c ja 801049b8 <syscall+0x38> 8010499c: 8b 14 85 c0 77 10 80 mov -0x7fef8840(,%eax,4),%edx 801049a3: 85 d2 test %edx,%edx 801049a5: 74 11 je 801049b8 <syscall+0x38> curproc->tf->eax = syscalls[num](); 801049a7: ff d2 call *%edx 801049a9: 8b 53 18 mov 0x18(%ebx),%edx 801049ac: 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; } } 801049af: 8b 5d fc mov -0x4(%ebp),%ebx 801049b2: c9 leave 801049b3: c3 ret 801049b4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi cprintf("%d %s: unknown sys call %d\n", 801049b8: 50 push %eax curproc->pid, curproc->name, num); 801049b9: 8d 43 6c lea 0x6c(%ebx),%eax cprintf("%d %s: unknown sys call %d\n", 801049bc: 50 push %eax 801049bd: ff 73 10 pushl 0x10(%ebx) 801049c0: 68 99 77 10 80 push $0x80107799 801049c5: e8 96 bc ff ff call 80100660 <cprintf> curproc->tf->eax = -1; 801049ca: 8b 43 18 mov 0x18(%ebx),%eax 801049cd: 83 c4 10 add $0x10,%esp 801049d0: c7 40 1c ff ff ff ff movl $0xffffffff,0x1c(%eax) } 801049d7: 8b 5d fc mov -0x4(%ebp),%ebx 801049da: c9 leave 801049db: c3 ret 801049dc: 66 90 xchg %ax,%ax 801049de: 66 90 xchg %ax,%ax 801049e0 <create>: return -1; } static struct inode* create(char *path, short type, short major, short minor) { 801049e0: 55 push %ebp 801049e1: 89 e5 mov %esp,%ebp 801049e3: 57 push %edi 801049e4: 56 push %esi 801049e5: 53 push %ebx uint off; struct inode *ip, *dp; char name[DIRSIZ]; if((dp = nameiparent(path, name)) == 0) 801049e6: 8d 75 da lea -0x26(%ebp),%esi { 801049e9: 83 ec 44 sub $0x44,%esp 801049ec: 89 4d c0 mov %ecx,-0x40(%ebp) 801049ef: 8b 4d 08 mov 0x8(%ebp),%ecx if((dp = nameiparent(path, name)) == 0) 801049f2: 56 push %esi 801049f3: 50 push %eax { 801049f4: 89 55 c4 mov %edx,-0x3c(%ebp) 801049f7: 89 4d bc mov %ecx,-0x44(%ebp) if((dp = nameiparent(path, name)) == 0) 801049fa: e8 11 d5 ff ff call 80101f10 <nameiparent> 801049ff: 83 c4 10 add $0x10,%esp 80104a02: 85 c0 test %eax,%eax 80104a04: 0f 84 46 01 00 00 je 80104b50 <create+0x170> return 0; ilock(dp); 80104a0a: 83 ec 0c sub $0xc,%esp 80104a0d: 89 c3 mov %eax,%ebx 80104a0f: 50 push %eax 80104a10: e8 7b cc ff ff call 80101690 <ilock> if((ip = dirlookup(dp, name, &off)) != 0){ 80104a15: 8d 45 d4 lea -0x2c(%ebp),%eax 80104a18: 83 c4 0c add $0xc,%esp 80104a1b: 50 push %eax 80104a1c: 56 push %esi 80104a1d: 53 push %ebx 80104a1e: e8 9d d1 ff ff call 80101bc0 <dirlookup> 80104a23: 83 c4 10 add $0x10,%esp 80104a26: 85 c0 test %eax,%eax 80104a28: 89 c7 mov %eax,%edi 80104a2a: 74 34 je 80104a60 <create+0x80> iunlockput(dp); 80104a2c: 83 ec 0c sub $0xc,%esp 80104a2f: 53 push %ebx 80104a30: e8 eb ce ff ff call 80101920 <iunlockput> ilock(ip); 80104a35: 89 3c 24 mov %edi,(%esp) 80104a38: e8 53 cc ff ff call 80101690 <ilock> if(type == T_FILE && ip->type == T_FILE) 80104a3d: 83 c4 10 add $0x10,%esp 80104a40: 66 83 7d c4 02 cmpw $0x2,-0x3c(%ebp) 80104a45: 0f 85 95 00 00 00 jne 80104ae0 <create+0x100> 80104a4b: 66 83 7f 50 02 cmpw $0x2,0x50(%edi) 80104a50: 0f 85 8a 00 00 00 jne 80104ae0 <create+0x100> panic("create: dirlink"); iunlockput(dp); return ip; } 80104a56: 8d 65 f4 lea -0xc(%ebp),%esp 80104a59: 89 f8 mov %edi,%eax 80104a5b: 5b pop %ebx 80104a5c: 5e pop %esi 80104a5d: 5f pop %edi 80104a5e: 5d pop %ebp 80104a5f: c3 ret if((ip = ialloc(dp->dev, type)) == 0) 80104a60: 0f bf 45 c4 movswl -0x3c(%ebp),%eax 80104a64: 83 ec 08 sub $0x8,%esp 80104a67: 50 push %eax 80104a68: ff 33 pushl (%ebx) 80104a6a: e8 b1 ca ff ff call 80101520 <ialloc> 80104a6f: 83 c4 10 add $0x10,%esp 80104a72: 85 c0 test %eax,%eax 80104a74: 89 c7 mov %eax,%edi 80104a76: 0f 84 e8 00 00 00 je 80104b64 <create+0x184> ilock(ip); 80104a7c: 83 ec 0c sub $0xc,%esp 80104a7f: 50 push %eax 80104a80: e8 0b cc ff ff call 80101690 <ilock> ip->major = major; 80104a85: 0f b7 45 c0 movzwl -0x40(%ebp),%eax 80104a89: 66 89 47 52 mov %ax,0x52(%edi) ip->minor = minor; 80104a8d: 0f b7 45 bc movzwl -0x44(%ebp),%eax 80104a91: 66 89 47 54 mov %ax,0x54(%edi) ip->nlink = 1; 80104a95: b8 01 00 00 00 mov $0x1,%eax 80104a9a: 66 89 47 56 mov %ax,0x56(%edi) iupdate(ip); 80104a9e: 89 3c 24 mov %edi,(%esp) 80104aa1: e8 3a cb ff ff call 801015e0 <iupdate> if(type == T_DIR){ // Create . and .. entries. 80104aa6: 83 c4 10 add $0x10,%esp 80104aa9: 66 83 7d c4 01 cmpw $0x1,-0x3c(%ebp) 80104aae: 74 50 je 80104b00 <create+0x120> if(dirlink(dp, name, ip->inum) < 0) 80104ab0: 83 ec 04 sub $0x4,%esp 80104ab3: ff 77 04 pushl 0x4(%edi) 80104ab6: 56 push %esi 80104ab7: 53 push %ebx 80104ab8: e8 73 d3 ff ff call 80101e30 <dirlink> 80104abd: 83 c4 10 add $0x10,%esp 80104ac0: 85 c0 test %eax,%eax 80104ac2: 0f 88 8f 00 00 00 js 80104b57 <create+0x177> iunlockput(dp); 80104ac8: 83 ec 0c sub $0xc,%esp 80104acb: 53 push %ebx 80104acc: e8 4f ce ff ff call 80101920 <iunlockput> return ip; 80104ad1: 83 c4 10 add $0x10,%esp } 80104ad4: 8d 65 f4 lea -0xc(%ebp),%esp 80104ad7: 89 f8 mov %edi,%eax 80104ad9: 5b pop %ebx 80104ada: 5e pop %esi 80104adb: 5f pop %edi 80104adc: 5d pop %ebp 80104add: c3 ret 80104ade: 66 90 xchg %ax,%ax iunlockput(ip); 80104ae0: 83 ec 0c sub $0xc,%esp 80104ae3: 57 push %edi return 0; 80104ae4: 31 ff xor %edi,%edi iunlockput(ip); 80104ae6: e8 35 ce ff ff call 80101920 <iunlockput> return 0; 80104aeb: 83 c4 10 add $0x10,%esp } 80104aee: 8d 65 f4 lea -0xc(%ebp),%esp 80104af1: 89 f8 mov %edi,%eax 80104af3: 5b pop %ebx 80104af4: 5e pop %esi 80104af5: 5f pop %edi 80104af6: 5d pop %ebp 80104af7: c3 ret 80104af8: 90 nop 80104af9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi dp->nlink++; // for ".." 80104b00: 66 83 43 56 01 addw $0x1,0x56(%ebx) iupdate(dp); 80104b05: 83 ec 0c sub $0xc,%esp 80104b08: 53 push %ebx 80104b09: e8 d2 ca ff ff call 801015e0 <iupdate> if(dirlink(ip, ".", ip->inum) < 0 || dirlink(ip, "..", dp->inum) < 0) 80104b0e: 83 c4 0c add $0xc,%esp 80104b11: ff 77 04 pushl 0x4(%edi) 80104b14: 68 3c 78 10 80 push $0x8010783c 80104b19: 57 push %edi 80104b1a: e8 11 d3 ff ff call 80101e30 <dirlink> 80104b1f: 83 c4 10 add $0x10,%esp 80104b22: 85 c0 test %eax,%eax 80104b24: 78 1c js 80104b42 <create+0x162> 80104b26: 83 ec 04 sub $0x4,%esp 80104b29: ff 73 04 pushl 0x4(%ebx) 80104b2c: 68 3b 78 10 80 push $0x8010783b 80104b31: 57 push %edi 80104b32: e8 f9 d2 ff ff call 80101e30 <dirlink> 80104b37: 83 c4 10 add $0x10,%esp 80104b3a: 85 c0 test %eax,%eax 80104b3c: 0f 89 6e ff ff ff jns 80104ab0 <create+0xd0> panic("create dots"); 80104b42: 83 ec 0c sub $0xc,%esp 80104b45: 68 2f 78 10 80 push $0x8010782f 80104b4a: e8 41 b8 ff ff call 80100390 <panic> 80104b4f: 90 nop return 0; 80104b50: 31 ff xor %edi,%edi 80104b52: e9 ff fe ff ff jmp 80104a56 <create+0x76> panic("create: dirlink"); 80104b57: 83 ec 0c sub $0xc,%esp 80104b5a: 68 3e 78 10 80 push $0x8010783e 80104b5f: e8 2c b8 ff ff call 80100390 <panic> panic("create: ialloc"); 80104b64: 83 ec 0c sub $0xc,%esp 80104b67: 68 20 78 10 80 push $0x80107820 80104b6c: e8 1f b8 ff ff call 80100390 <panic> 80104b71: eb 0d jmp 80104b80 <argfd.constprop.0> 80104b73: 90 nop 80104b74: 90 nop 80104b75: 90 nop 80104b76: 90 nop 80104b77: 90 nop 80104b78: 90 nop 80104b79: 90 nop 80104b7a: 90 nop 80104b7b: 90 nop 80104b7c: 90 nop 80104b7d: 90 nop 80104b7e: 90 nop 80104b7f: 90 nop 80104b80 <argfd.constprop.0>: argfd(int n, int *pfd, struct file **pf) 80104b80: 55 push %ebp 80104b81: 89 e5 mov %esp,%ebp 80104b83: 56 push %esi 80104b84: 53 push %ebx 80104b85: 89 c3 mov %eax,%ebx if(argint(n, &fd) < 0) 80104b87: 8d 45 f4 lea -0xc(%ebp),%eax argfd(int n, int *pfd, struct file **pf) 80104b8a: 89 d6 mov %edx,%esi 80104b8c: 83 ec 18 sub $0x18,%esp if(argint(n, &fd) < 0) 80104b8f: 50 push %eax 80104b90: 6a 00 push $0x0 80104b92: e8 f9 fc ff ff call 80104890 <argint> 80104b97: 83 c4 10 add $0x10,%esp 80104b9a: 85 c0 test %eax,%eax 80104b9c: 78 2a js 80104bc8 <argfd.constprop.0+0x48> if(fd < 0 || fd >= NOFILE || (f=myproc()->ofile[fd]) == 0) 80104b9e: 83 7d f4 0f cmpl $0xf,-0xc(%ebp) 80104ba2: 77 24 ja 80104bc8 <argfd.constprop.0+0x48> 80104ba4: e8 57 ed ff ff call 80103900 <myproc> 80104ba9: 8b 55 f4 mov -0xc(%ebp),%edx 80104bac: 8b 44 90 28 mov 0x28(%eax,%edx,4),%eax 80104bb0: 85 c0 test %eax,%eax 80104bb2: 74 14 je 80104bc8 <argfd.constprop.0+0x48> if(pfd) 80104bb4: 85 db test %ebx,%ebx 80104bb6: 74 02 je 80104bba <argfd.constprop.0+0x3a> *pfd = fd; 80104bb8: 89 13 mov %edx,(%ebx) *pf = f; 80104bba: 89 06 mov %eax,(%esi) return 0; 80104bbc: 31 c0 xor %eax,%eax } 80104bbe: 8d 65 f8 lea -0x8(%ebp),%esp 80104bc1: 5b pop %ebx 80104bc2: 5e pop %esi 80104bc3: 5d pop %ebp 80104bc4: c3 ret 80104bc5: 8d 76 00 lea 0x0(%esi),%esi return -1; 80104bc8: b8 ff ff ff ff mov $0xffffffff,%eax 80104bcd: eb ef jmp 80104bbe <argfd.constprop.0+0x3e> 80104bcf: 90 nop 80104bd0 <sys_dup>: { 80104bd0: 55 push %ebp if(argfd(0, 0, &f) < 0) 80104bd1: 31 c0 xor %eax,%eax { 80104bd3: 89 e5 mov %esp,%ebp 80104bd5: 56 push %esi 80104bd6: 53 push %ebx if(argfd(0, 0, &f) < 0) 80104bd7: 8d 55 f4 lea -0xc(%ebp),%edx { 80104bda: 83 ec 10 sub $0x10,%esp if(argfd(0, 0, &f) < 0) 80104bdd: e8 9e ff ff ff call 80104b80 <argfd.constprop.0> 80104be2: 85 c0 test %eax,%eax 80104be4: 78 42 js 80104c28 <sys_dup+0x58> if((fd=fdalloc(f)) < 0) 80104be6: 8b 75 f4 mov -0xc(%ebp),%esi for(fd = 0; fd < NOFILE; fd++){ 80104be9: 31 db xor %ebx,%ebx struct proc *curproc = myproc(); 80104beb: e8 10 ed ff ff call 80103900 <myproc> 80104bf0: eb 0e jmp 80104c00 <sys_dup+0x30> 80104bf2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi for(fd = 0; fd < NOFILE; fd++){ 80104bf8: 83 c3 01 add $0x1,%ebx 80104bfb: 83 fb 10 cmp $0x10,%ebx 80104bfe: 74 28 je 80104c28 <sys_dup+0x58> if(curproc->ofile[fd] == 0){ 80104c00: 8b 54 98 28 mov 0x28(%eax,%ebx,4),%edx 80104c04: 85 d2 test %edx,%edx 80104c06: 75 f0 jne 80104bf8 <sys_dup+0x28> curproc->ofile[fd] = f; 80104c08: 89 74 98 28 mov %esi,0x28(%eax,%ebx,4) filedup(f); 80104c0c: 83 ec 0c sub $0xc,%esp 80104c0f: ff 75 f4 pushl -0xc(%ebp) 80104c12: e8 d9 c1 ff ff call 80100df0 <filedup> return fd; 80104c17: 83 c4 10 add $0x10,%esp } 80104c1a: 8d 65 f8 lea -0x8(%ebp),%esp 80104c1d: 89 d8 mov %ebx,%eax 80104c1f: 5b pop %ebx 80104c20: 5e pop %esi 80104c21: 5d pop %ebp 80104c22: c3 ret 80104c23: 90 nop 80104c24: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104c28: 8d 65 f8 lea -0x8(%ebp),%esp return -1; 80104c2b: bb ff ff ff ff mov $0xffffffff,%ebx } 80104c30: 89 d8 mov %ebx,%eax 80104c32: 5b pop %ebx 80104c33: 5e pop %esi 80104c34: 5d pop %ebp 80104c35: c3 ret 80104c36: 8d 76 00 lea 0x0(%esi),%esi 80104c39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104c40 <sys_read>: { 80104c40: 55 push %ebp if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) 80104c41: 31 c0 xor %eax,%eax { 80104c43: 89 e5 mov %esp,%ebp 80104c45: 83 ec 18 sub $0x18,%esp if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) 80104c48: 8d 55 ec lea -0x14(%ebp),%edx 80104c4b: e8 30 ff ff ff call 80104b80 <argfd.constprop.0> 80104c50: 85 c0 test %eax,%eax 80104c52: 78 4c js 80104ca0 <sys_read+0x60> 80104c54: 8d 45 f0 lea -0x10(%ebp),%eax 80104c57: 83 ec 08 sub $0x8,%esp 80104c5a: 50 push %eax 80104c5b: 6a 02 push $0x2 80104c5d: e8 2e fc ff ff call 80104890 <argint> 80104c62: 83 c4 10 add $0x10,%esp 80104c65: 85 c0 test %eax,%eax 80104c67: 78 37 js 80104ca0 <sys_read+0x60> 80104c69: 8d 45 f4 lea -0xc(%ebp),%eax 80104c6c: 83 ec 04 sub $0x4,%esp 80104c6f: ff 75 f0 pushl -0x10(%ebp) 80104c72: 50 push %eax 80104c73: 6a 01 push $0x1 80104c75: e8 66 fc ff ff call 801048e0 <argptr> 80104c7a: 83 c4 10 add $0x10,%esp 80104c7d: 85 c0 test %eax,%eax 80104c7f: 78 1f js 80104ca0 <sys_read+0x60> return fileread(f, p, n); 80104c81: 83 ec 04 sub $0x4,%esp 80104c84: ff 75 f0 pushl -0x10(%ebp) 80104c87: ff 75 f4 pushl -0xc(%ebp) 80104c8a: ff 75 ec pushl -0x14(%ebp) 80104c8d: e8 ce c2 ff ff call 80100f60 <fileread> 80104c92: 83 c4 10 add $0x10,%esp } 80104c95: c9 leave 80104c96: c3 ret 80104c97: 89 f6 mov %esi,%esi 80104c99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi return -1; 80104ca0: b8 ff ff ff ff mov $0xffffffff,%eax } 80104ca5: c9 leave 80104ca6: c3 ret 80104ca7: 89 f6 mov %esi,%esi 80104ca9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104cb0 <sys_write>: { 80104cb0: 55 push %ebp if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) 80104cb1: 31 c0 xor %eax,%eax { 80104cb3: 89 e5 mov %esp,%ebp 80104cb5: 83 ec 18 sub $0x18,%esp if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) 80104cb8: 8d 55 ec lea -0x14(%ebp),%edx 80104cbb: e8 c0 fe ff ff call 80104b80 <argfd.constprop.0> 80104cc0: 85 c0 test %eax,%eax 80104cc2: 78 4c js 80104d10 <sys_write+0x60> 80104cc4: 8d 45 f0 lea -0x10(%ebp),%eax 80104cc7: 83 ec 08 sub $0x8,%esp 80104cca: 50 push %eax 80104ccb: 6a 02 push $0x2 80104ccd: e8 be fb ff ff call 80104890 <argint> 80104cd2: 83 c4 10 add $0x10,%esp 80104cd5: 85 c0 test %eax,%eax 80104cd7: 78 37 js 80104d10 <sys_write+0x60> 80104cd9: 8d 45 f4 lea -0xc(%ebp),%eax 80104cdc: 83 ec 04 sub $0x4,%esp 80104cdf: ff 75 f0 pushl -0x10(%ebp) 80104ce2: 50 push %eax 80104ce3: 6a 01 push $0x1 80104ce5: e8 f6 fb ff ff call 801048e0 <argptr> 80104cea: 83 c4 10 add $0x10,%esp 80104ced: 85 c0 test %eax,%eax 80104cef: 78 1f js 80104d10 <sys_write+0x60> return filewrite(f, p, n); 80104cf1: 83 ec 04 sub $0x4,%esp 80104cf4: ff 75 f0 pushl -0x10(%ebp) 80104cf7: ff 75 f4 pushl -0xc(%ebp) 80104cfa: ff 75 ec pushl -0x14(%ebp) 80104cfd: e8 ee c2 ff ff call 80100ff0 <filewrite> 80104d02: 83 c4 10 add $0x10,%esp } 80104d05: c9 leave 80104d06: c3 ret 80104d07: 89 f6 mov %esi,%esi 80104d09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi return -1; 80104d10: b8 ff ff ff ff mov $0xffffffff,%eax } 80104d15: c9 leave 80104d16: c3 ret 80104d17: 89 f6 mov %esi,%esi 80104d19: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104d20 <sys_close>: { 80104d20: 55 push %ebp 80104d21: 89 e5 mov %esp,%ebp 80104d23: 83 ec 18 sub $0x18,%esp if(argfd(0, &fd, &f) < 0) 80104d26: 8d 55 f4 lea -0xc(%ebp),%edx 80104d29: 8d 45 f0 lea -0x10(%ebp),%eax 80104d2c: e8 4f fe ff ff call 80104b80 <argfd.constprop.0> 80104d31: 85 c0 test %eax,%eax 80104d33: 78 2b js 80104d60 <sys_close+0x40> myproc()->ofile[fd] = 0; 80104d35: e8 c6 eb ff ff call 80103900 <myproc> 80104d3a: 8b 55 f0 mov -0x10(%ebp),%edx fileclose(f); 80104d3d: 83 ec 0c sub $0xc,%esp myproc()->ofile[fd] = 0; 80104d40: c7 44 90 28 00 00 00 movl $0x0,0x28(%eax,%edx,4) 80104d47: 00 fileclose(f); 80104d48: ff 75 f4 pushl -0xc(%ebp) 80104d4b: e8 f0 c0 ff ff call 80100e40 <fileclose> return 0; 80104d50: 83 c4 10 add $0x10,%esp 80104d53: 31 c0 xor %eax,%eax } 80104d55: c9 leave 80104d56: c3 ret 80104d57: 89 f6 mov %esi,%esi 80104d59: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi return -1; 80104d60: b8 ff ff ff ff mov $0xffffffff,%eax } 80104d65: c9 leave 80104d66: c3 ret 80104d67: 89 f6 mov %esi,%esi 80104d69: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104d70 <sys_fstat>: { 80104d70: 55 push %ebp if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0) 80104d71: 31 c0 xor %eax,%eax { 80104d73: 89 e5 mov %esp,%ebp 80104d75: 83 ec 18 sub $0x18,%esp if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0) 80104d78: 8d 55 f0 lea -0x10(%ebp),%edx 80104d7b: e8 00 fe ff ff call 80104b80 <argfd.constprop.0> 80104d80: 85 c0 test %eax,%eax 80104d82: 78 2c js 80104db0 <sys_fstat+0x40> 80104d84: 8d 45 f4 lea -0xc(%ebp),%eax 80104d87: 83 ec 04 sub $0x4,%esp 80104d8a: 6a 14 push $0x14 80104d8c: 50 push %eax 80104d8d: 6a 01 push $0x1 80104d8f: e8 4c fb ff ff call 801048e0 <argptr> 80104d94: 83 c4 10 add $0x10,%esp 80104d97: 85 c0 test %eax,%eax 80104d99: 78 15 js 80104db0 <sys_fstat+0x40> return filestat(f, st); 80104d9b: 83 ec 08 sub $0x8,%esp 80104d9e: ff 75 f4 pushl -0xc(%ebp) 80104da1: ff 75 f0 pushl -0x10(%ebp) 80104da4: e8 67 c1 ff ff call 80100f10 <filestat> 80104da9: 83 c4 10 add $0x10,%esp } 80104dac: c9 leave 80104dad: c3 ret 80104dae: 66 90 xchg %ax,%ax return -1; 80104db0: b8 ff ff ff ff mov $0xffffffff,%eax } 80104db5: c9 leave 80104db6: c3 ret 80104db7: 89 f6 mov %esi,%esi 80104db9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104dc0 <sys_link>: { 80104dc0: 55 push %ebp 80104dc1: 89 e5 mov %esp,%ebp 80104dc3: 57 push %edi 80104dc4: 56 push %esi 80104dc5: 53 push %ebx if(argstr(0, &old) < 0 || argstr(1, &new) < 0) 80104dc6: 8d 45 d4 lea -0x2c(%ebp),%eax { 80104dc9: 83 ec 34 sub $0x34,%esp if(argstr(0, &old) < 0 || argstr(1, &new) < 0) 80104dcc: 50 push %eax 80104dcd: 6a 00 push $0x0 80104dcf: e8 6c fb ff ff call 80104940 <argstr> 80104dd4: 83 c4 10 add $0x10,%esp 80104dd7: 85 c0 test %eax,%eax 80104dd9: 0f 88 fb 00 00 00 js 80104eda <sys_link+0x11a> 80104ddf: 8d 45 d0 lea -0x30(%ebp),%eax 80104de2: 83 ec 08 sub $0x8,%esp 80104de5: 50 push %eax 80104de6: 6a 01 push $0x1 80104de8: e8 53 fb ff ff call 80104940 <argstr> 80104ded: 83 c4 10 add $0x10,%esp 80104df0: 85 c0 test %eax,%eax 80104df2: 0f 88 e2 00 00 00 js 80104eda <sys_link+0x11a> begin_op(); 80104df8: e8 c3 de ff ff call 80102cc0 <begin_op> if((ip = namei(old)) == 0){ 80104dfd: 83 ec 0c sub $0xc,%esp 80104e00: ff 75 d4 pushl -0x2c(%ebp) 80104e03: e8 e8 d0 ff ff call 80101ef0 <namei> 80104e08: 83 c4 10 add $0x10,%esp 80104e0b: 85 c0 test %eax,%eax 80104e0d: 89 c3 mov %eax,%ebx 80104e0f: 0f 84 ea 00 00 00 je 80104eff <sys_link+0x13f> ilock(ip); 80104e15: 83 ec 0c sub $0xc,%esp 80104e18: 50 push %eax 80104e19: e8 72 c8 ff ff call 80101690 <ilock> if(ip->type == T_DIR){ 80104e1e: 83 c4 10 add $0x10,%esp 80104e21: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80104e26: 0f 84 bb 00 00 00 je 80104ee7 <sys_link+0x127> ip->nlink++; 80104e2c: 66 83 43 56 01 addw $0x1,0x56(%ebx) iupdate(ip); 80104e31: 83 ec 0c sub $0xc,%esp if((dp = nameiparent(new, name)) == 0) 80104e34: 8d 7d da lea -0x26(%ebp),%edi iupdate(ip); 80104e37: 53 push %ebx 80104e38: e8 a3 c7 ff ff call 801015e0 <iupdate> iunlock(ip); 80104e3d: 89 1c 24 mov %ebx,(%esp) 80104e40: e8 2b c9 ff ff call 80101770 <iunlock> if((dp = nameiparent(new, name)) == 0) 80104e45: 58 pop %eax 80104e46: 5a pop %edx 80104e47: 57 push %edi 80104e48: ff 75 d0 pushl -0x30(%ebp) 80104e4b: e8 c0 d0 ff ff call 80101f10 <nameiparent> 80104e50: 83 c4 10 add $0x10,%esp 80104e53: 85 c0 test %eax,%eax 80104e55: 89 c6 mov %eax,%esi 80104e57: 74 5b je 80104eb4 <sys_link+0xf4> ilock(dp); 80104e59: 83 ec 0c sub $0xc,%esp 80104e5c: 50 push %eax 80104e5d: e8 2e c8 ff ff call 80101690 <ilock> if(dp->dev != ip->dev || dirlink(dp, name, ip->inum) < 0){ 80104e62: 83 c4 10 add $0x10,%esp 80104e65: 8b 03 mov (%ebx),%eax 80104e67: 39 06 cmp %eax,(%esi) 80104e69: 75 3d jne 80104ea8 <sys_link+0xe8> 80104e6b: 83 ec 04 sub $0x4,%esp 80104e6e: ff 73 04 pushl 0x4(%ebx) 80104e71: 57 push %edi 80104e72: 56 push %esi 80104e73: e8 b8 cf ff ff call 80101e30 <dirlink> 80104e78: 83 c4 10 add $0x10,%esp 80104e7b: 85 c0 test %eax,%eax 80104e7d: 78 29 js 80104ea8 <sys_link+0xe8> iunlockput(dp); 80104e7f: 83 ec 0c sub $0xc,%esp 80104e82: 56 push %esi 80104e83: e8 98 ca ff ff call 80101920 <iunlockput> iput(ip); 80104e88: 89 1c 24 mov %ebx,(%esp) 80104e8b: e8 30 c9 ff ff call 801017c0 <iput> end_op(); 80104e90: e8 9b de ff ff call 80102d30 <end_op> return 0; 80104e95: 83 c4 10 add $0x10,%esp 80104e98: 31 c0 xor %eax,%eax } 80104e9a: 8d 65 f4 lea -0xc(%ebp),%esp 80104e9d: 5b pop %ebx 80104e9e: 5e pop %esi 80104e9f: 5f pop %edi 80104ea0: 5d pop %ebp 80104ea1: c3 ret 80104ea2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi iunlockput(dp); 80104ea8: 83 ec 0c sub $0xc,%esp 80104eab: 56 push %esi 80104eac: e8 6f ca ff ff call 80101920 <iunlockput> goto bad; 80104eb1: 83 c4 10 add $0x10,%esp ilock(ip); 80104eb4: 83 ec 0c sub $0xc,%esp 80104eb7: 53 push %ebx 80104eb8: e8 d3 c7 ff ff call 80101690 <ilock> ip->nlink--; 80104ebd: 66 83 6b 56 01 subw $0x1,0x56(%ebx) iupdate(ip); 80104ec2: 89 1c 24 mov %ebx,(%esp) 80104ec5: e8 16 c7 ff ff call 801015e0 <iupdate> iunlockput(ip); 80104eca: 89 1c 24 mov %ebx,(%esp) 80104ecd: e8 4e ca ff ff call 80101920 <iunlockput> end_op(); 80104ed2: e8 59 de ff ff call 80102d30 <end_op> return -1; 80104ed7: 83 c4 10 add $0x10,%esp } 80104eda: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 80104edd: b8 ff ff ff ff mov $0xffffffff,%eax } 80104ee2: 5b pop %ebx 80104ee3: 5e pop %esi 80104ee4: 5f pop %edi 80104ee5: 5d pop %ebp 80104ee6: c3 ret iunlockput(ip); 80104ee7: 83 ec 0c sub $0xc,%esp 80104eea: 53 push %ebx 80104eeb: e8 30 ca ff ff call 80101920 <iunlockput> end_op(); 80104ef0: e8 3b de ff ff call 80102d30 <end_op> return -1; 80104ef5: 83 c4 10 add $0x10,%esp 80104ef8: b8 ff ff ff ff mov $0xffffffff,%eax 80104efd: eb 9b jmp 80104e9a <sys_link+0xda> end_op(); 80104eff: e8 2c de ff ff call 80102d30 <end_op> return -1; 80104f04: b8 ff ff ff ff mov $0xffffffff,%eax 80104f09: eb 8f jmp 80104e9a <sys_link+0xda> 80104f0b: 90 nop 80104f0c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104f10 <sys_unlink>: { 80104f10: 55 push %ebp 80104f11: 89 e5 mov %esp,%ebp 80104f13: 57 push %edi 80104f14: 56 push %esi 80104f15: 53 push %ebx if(argstr(0, &path) < 0) 80104f16: 8d 45 c0 lea -0x40(%ebp),%eax { 80104f19: 83 ec 44 sub $0x44,%esp if(argstr(0, &path) < 0) 80104f1c: 50 push %eax 80104f1d: 6a 00 push $0x0 80104f1f: e8 1c fa ff ff call 80104940 <argstr> 80104f24: 83 c4 10 add $0x10,%esp 80104f27: 85 c0 test %eax,%eax 80104f29: 0f 88 77 01 00 00 js 801050a6 <sys_unlink+0x196> if((dp = nameiparent(path, name)) == 0){ 80104f2f: 8d 5d ca lea -0x36(%ebp),%ebx begin_op(); 80104f32: e8 89 dd ff ff call 80102cc0 <begin_op> if((dp = nameiparent(path, name)) == 0){ 80104f37: 83 ec 08 sub $0x8,%esp 80104f3a: 53 push %ebx 80104f3b: ff 75 c0 pushl -0x40(%ebp) 80104f3e: e8 cd cf ff ff call 80101f10 <nameiparent> 80104f43: 83 c4 10 add $0x10,%esp 80104f46: 85 c0 test %eax,%eax 80104f48: 89 c6 mov %eax,%esi 80104f4a: 0f 84 60 01 00 00 je 801050b0 <sys_unlink+0x1a0> ilock(dp); 80104f50: 83 ec 0c sub $0xc,%esp 80104f53: 50 push %eax 80104f54: e8 37 c7 ff ff call 80101690 <ilock> if(namecmp(name, ".") == 0 || namecmp(name, "..") == 0) 80104f59: 58 pop %eax 80104f5a: 5a pop %edx 80104f5b: 68 3c 78 10 80 push $0x8010783c 80104f60: 53 push %ebx 80104f61: e8 3a cc ff ff call 80101ba0 <namecmp> 80104f66: 83 c4 10 add $0x10,%esp 80104f69: 85 c0 test %eax,%eax 80104f6b: 0f 84 03 01 00 00 je 80105074 <sys_unlink+0x164> 80104f71: 83 ec 08 sub $0x8,%esp 80104f74: 68 3b 78 10 80 push $0x8010783b 80104f79: 53 push %ebx 80104f7a: e8 21 cc ff ff call 80101ba0 <namecmp> 80104f7f: 83 c4 10 add $0x10,%esp 80104f82: 85 c0 test %eax,%eax 80104f84: 0f 84 ea 00 00 00 je 80105074 <sys_unlink+0x164> if((ip = dirlookup(dp, name, &off)) == 0) 80104f8a: 8d 45 c4 lea -0x3c(%ebp),%eax 80104f8d: 83 ec 04 sub $0x4,%esp 80104f90: 50 push %eax 80104f91: 53 push %ebx 80104f92: 56 push %esi 80104f93: e8 28 cc ff ff call 80101bc0 <dirlookup> 80104f98: 83 c4 10 add $0x10,%esp 80104f9b: 85 c0 test %eax,%eax 80104f9d: 89 c3 mov %eax,%ebx 80104f9f: 0f 84 cf 00 00 00 je 80105074 <sys_unlink+0x164> ilock(ip); 80104fa5: 83 ec 0c sub $0xc,%esp 80104fa8: 50 push %eax 80104fa9: e8 e2 c6 ff ff call 80101690 <ilock> if(ip->nlink < 1) 80104fae: 83 c4 10 add $0x10,%esp 80104fb1: 66 83 7b 56 00 cmpw $0x0,0x56(%ebx) 80104fb6: 0f 8e 10 01 00 00 jle 801050cc <sys_unlink+0x1bc> if(ip->type == T_DIR && !isdirempty(ip)){ 80104fbc: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80104fc1: 74 6d je 80105030 <sys_unlink+0x120> memset(&de, 0, sizeof(de)); 80104fc3: 8d 45 d8 lea -0x28(%ebp),%eax 80104fc6: 83 ec 04 sub $0x4,%esp 80104fc9: 6a 10 push $0x10 80104fcb: 6a 00 push $0x0 80104fcd: 50 push %eax 80104fce: e8 bd f5 ff ff call 80104590 <memset> if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80104fd3: 8d 45 d8 lea -0x28(%ebp),%eax 80104fd6: 6a 10 push $0x10 80104fd8: ff 75 c4 pushl -0x3c(%ebp) 80104fdb: 50 push %eax 80104fdc: 56 push %esi 80104fdd: e8 8e ca ff ff call 80101a70 <writei> 80104fe2: 83 c4 20 add $0x20,%esp 80104fe5: 83 f8 10 cmp $0x10,%eax 80104fe8: 0f 85 eb 00 00 00 jne 801050d9 <sys_unlink+0x1c9> if(ip->type == T_DIR){ 80104fee: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80104ff3: 0f 84 97 00 00 00 je 80105090 <sys_unlink+0x180> iunlockput(dp); 80104ff9: 83 ec 0c sub $0xc,%esp 80104ffc: 56 push %esi 80104ffd: e8 1e c9 ff ff call 80101920 <iunlockput> ip->nlink--; 80105002: 66 83 6b 56 01 subw $0x1,0x56(%ebx) iupdate(ip); 80105007: 89 1c 24 mov %ebx,(%esp) 8010500a: e8 d1 c5 ff ff call 801015e0 <iupdate> iunlockput(ip); 8010500f: 89 1c 24 mov %ebx,(%esp) 80105012: e8 09 c9 ff ff call 80101920 <iunlockput> end_op(); 80105017: e8 14 dd ff ff call 80102d30 <end_op> return 0; 8010501c: 83 c4 10 add $0x10,%esp 8010501f: 31 c0 xor %eax,%eax } 80105021: 8d 65 f4 lea -0xc(%ebp),%esp 80105024: 5b pop %ebx 80105025: 5e pop %esi 80105026: 5f pop %edi 80105027: 5d pop %ebp 80105028: c3 ret 80105029: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi for(off=2*sizeof(de); off<dp->size; off+=sizeof(de)){ 80105030: 83 7b 58 20 cmpl $0x20,0x58(%ebx) 80105034: 76 8d jbe 80104fc3 <sys_unlink+0xb3> 80105036: bf 20 00 00 00 mov $0x20,%edi 8010503b: eb 0f jmp 8010504c <sys_unlink+0x13c> 8010503d: 8d 76 00 lea 0x0(%esi),%esi 80105040: 83 c7 10 add $0x10,%edi 80105043: 3b 7b 58 cmp 0x58(%ebx),%edi 80105046: 0f 83 77 ff ff ff jae 80104fc3 <sys_unlink+0xb3> if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 8010504c: 8d 45 d8 lea -0x28(%ebp),%eax 8010504f: 6a 10 push $0x10 80105051: 57 push %edi 80105052: 50 push %eax 80105053: 53 push %ebx 80105054: e8 17 c9 ff ff call 80101970 <readi> 80105059: 83 c4 10 add $0x10,%esp 8010505c: 83 f8 10 cmp $0x10,%eax 8010505f: 75 5e jne 801050bf <sys_unlink+0x1af> if(de.inum != 0) 80105061: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp) 80105066: 74 d8 je 80105040 <sys_unlink+0x130> iunlockput(ip); 80105068: 83 ec 0c sub $0xc,%esp 8010506b: 53 push %ebx 8010506c: e8 af c8 ff ff call 80101920 <iunlockput> goto bad; 80105071: 83 c4 10 add $0x10,%esp iunlockput(dp); 80105074: 83 ec 0c sub $0xc,%esp 80105077: 56 push %esi 80105078: e8 a3 c8 ff ff call 80101920 <iunlockput> end_op(); 8010507d: e8 ae dc ff ff call 80102d30 <end_op> return -1; 80105082: 83 c4 10 add $0x10,%esp 80105085: b8 ff ff ff ff mov $0xffffffff,%eax 8010508a: eb 95 jmp 80105021 <sys_unlink+0x111> 8010508c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi dp->nlink--; 80105090: 66 83 6e 56 01 subw $0x1,0x56(%esi) iupdate(dp); 80105095: 83 ec 0c sub $0xc,%esp 80105098: 56 push %esi 80105099: e8 42 c5 ff ff call 801015e0 <iupdate> 8010509e: 83 c4 10 add $0x10,%esp 801050a1: e9 53 ff ff ff jmp 80104ff9 <sys_unlink+0xe9> return -1; 801050a6: b8 ff ff ff ff mov $0xffffffff,%eax 801050ab: e9 71 ff ff ff jmp 80105021 <sys_unlink+0x111> end_op(); 801050b0: e8 7b dc ff ff call 80102d30 <end_op> return -1; 801050b5: b8 ff ff ff ff mov $0xffffffff,%eax 801050ba: e9 62 ff ff ff jmp 80105021 <sys_unlink+0x111> panic("isdirempty: readi"); 801050bf: 83 ec 0c sub $0xc,%esp 801050c2: 68 60 78 10 80 push $0x80107860 801050c7: e8 c4 b2 ff ff call 80100390 <panic> panic("unlink: nlink < 1"); 801050cc: 83 ec 0c sub $0xc,%esp 801050cf: 68 4e 78 10 80 push $0x8010784e 801050d4: e8 b7 b2 ff ff call 80100390 <panic> panic("unlink: writei"); 801050d9: 83 ec 0c sub $0xc,%esp 801050dc: 68 72 78 10 80 push $0x80107872 801050e1: e8 aa b2 ff ff call 80100390 <panic> 801050e6: 8d 76 00 lea 0x0(%esi),%esi 801050e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801050f0 <sys_open>: int sys_open(void) { 801050f0: 55 push %ebp 801050f1: 89 e5 mov %esp,%ebp 801050f3: 57 push %edi 801050f4: 56 push %esi 801050f5: 53 push %ebx char *path; int fd, omode; struct file *f; struct inode *ip; if(argstr(0, &path) < 0 || argint(1, &omode) < 0) 801050f6: 8d 45 e0 lea -0x20(%ebp),%eax { 801050f9: 83 ec 24 sub $0x24,%esp if(argstr(0, &path) < 0 || argint(1, &omode) < 0) 801050fc: 50 push %eax 801050fd: 6a 00 push $0x0 801050ff: e8 3c f8 ff ff call 80104940 <argstr> 80105104: 83 c4 10 add $0x10,%esp 80105107: 85 c0 test %eax,%eax 80105109: 0f 88 1d 01 00 00 js 8010522c <sys_open+0x13c> 8010510f: 8d 45 e4 lea -0x1c(%ebp),%eax 80105112: 83 ec 08 sub $0x8,%esp 80105115: 50 push %eax 80105116: 6a 01 push $0x1 80105118: e8 73 f7 ff ff call 80104890 <argint> 8010511d: 83 c4 10 add $0x10,%esp 80105120: 85 c0 test %eax,%eax 80105122: 0f 88 04 01 00 00 js 8010522c <sys_open+0x13c> return -1; begin_op(); 80105128: e8 93 db ff ff call 80102cc0 <begin_op> if(omode & O_CREATE){ 8010512d: f6 45 e5 02 testb $0x2,-0x1b(%ebp) 80105131: 0f 85 a9 00 00 00 jne 801051e0 <sys_open+0xf0> if(ip == 0){ end_op(); return -1; } } else { if((ip = namei(path)) == 0){ 80105137: 83 ec 0c sub $0xc,%esp 8010513a: ff 75 e0 pushl -0x20(%ebp) 8010513d: e8 ae cd ff ff call 80101ef0 <namei> 80105142: 83 c4 10 add $0x10,%esp 80105145: 85 c0 test %eax,%eax 80105147: 89 c6 mov %eax,%esi 80105149: 0f 84 b2 00 00 00 je 80105201 <sys_open+0x111> end_op(); return -1; } ilock(ip); 8010514f: 83 ec 0c sub $0xc,%esp 80105152: 50 push %eax 80105153: e8 38 c5 ff ff call 80101690 <ilock> if(ip->type == T_DIR && omode != O_RDONLY){ 80105158: 83 c4 10 add $0x10,%esp 8010515b: 66 83 7e 50 01 cmpw $0x1,0x50(%esi) 80105160: 0f 84 aa 00 00 00 je 80105210 <sys_open+0x120> end_op(); return -1; } } if((f = filealloc()) == 0 || (fd = fdalloc(f)) < 0){ 80105166: e8 15 bc ff ff call 80100d80 <filealloc> 8010516b: 85 c0 test %eax,%eax 8010516d: 89 c7 mov %eax,%edi 8010516f: 0f 84 a6 00 00 00 je 8010521b <sys_open+0x12b> struct proc *curproc = myproc(); 80105175: e8 86 e7 ff ff call 80103900 <myproc> for(fd = 0; fd < NOFILE; fd++){ 8010517a: 31 db xor %ebx,%ebx 8010517c: eb 0e jmp 8010518c <sys_open+0x9c> 8010517e: 66 90 xchg %ax,%ax 80105180: 83 c3 01 add $0x1,%ebx 80105183: 83 fb 10 cmp $0x10,%ebx 80105186: 0f 84 ac 00 00 00 je 80105238 <sys_open+0x148> if(curproc->ofile[fd] == 0){ 8010518c: 8b 54 98 28 mov 0x28(%eax,%ebx,4),%edx 80105190: 85 d2 test %edx,%edx 80105192: 75 ec jne 80105180 <sys_open+0x90> fileclose(f); iunlockput(ip); end_op(); return -1; } iunlock(ip); 80105194: 83 ec 0c sub $0xc,%esp curproc->ofile[fd] = f; 80105197: 89 7c 98 28 mov %edi,0x28(%eax,%ebx,4) iunlock(ip); 8010519b: 56 push %esi 8010519c: e8 cf c5 ff ff call 80101770 <iunlock> end_op(); 801051a1: e8 8a db ff ff call 80102d30 <end_op> f->type = FD_INODE; 801051a6: c7 07 02 00 00 00 movl $0x2,(%edi) f->ip = ip; f->off = 0; f->readable = !(omode & O_WRONLY); 801051ac: 8b 55 e4 mov -0x1c(%ebp),%edx f->writable = (omode & O_WRONLY) || (omode & O_RDWR); 801051af: 83 c4 10 add $0x10,%esp f->ip = ip; 801051b2: 89 77 10 mov %esi,0x10(%edi) f->off = 0; 801051b5: c7 47 14 00 00 00 00 movl $0x0,0x14(%edi) f->readable = !(omode & O_WRONLY); 801051bc: 89 d0 mov %edx,%eax 801051be: f7 d0 not %eax 801051c0: 83 e0 01 and $0x1,%eax f->writable = (omode & O_WRONLY) || (omode & O_RDWR); 801051c3: 83 e2 03 and $0x3,%edx f->readable = !(omode & O_WRONLY); 801051c6: 88 47 08 mov %al,0x8(%edi) f->writable = (omode & O_WRONLY) || (omode & O_RDWR); 801051c9: 0f 95 47 09 setne 0x9(%edi) return fd; } 801051cd: 8d 65 f4 lea -0xc(%ebp),%esp 801051d0: 89 d8 mov %ebx,%eax 801051d2: 5b pop %ebx 801051d3: 5e pop %esi 801051d4: 5f pop %edi 801051d5: 5d pop %ebp 801051d6: c3 ret 801051d7: 89 f6 mov %esi,%esi 801051d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi ip = create(path, T_FILE, 0, 0); 801051e0: 83 ec 0c sub $0xc,%esp 801051e3: 8b 45 e0 mov -0x20(%ebp),%eax 801051e6: 31 c9 xor %ecx,%ecx 801051e8: 6a 00 push $0x0 801051ea: ba 02 00 00 00 mov $0x2,%edx 801051ef: e8 ec f7 ff ff call 801049e0 <create> if(ip == 0){ 801051f4: 83 c4 10 add $0x10,%esp 801051f7: 85 c0 test %eax,%eax ip = create(path, T_FILE, 0, 0); 801051f9: 89 c6 mov %eax,%esi if(ip == 0){ 801051fb: 0f 85 65 ff ff ff jne 80105166 <sys_open+0x76> end_op(); 80105201: e8 2a db ff ff call 80102d30 <end_op> return -1; 80105206: bb ff ff ff ff mov $0xffffffff,%ebx 8010520b: eb c0 jmp 801051cd <sys_open+0xdd> 8010520d: 8d 76 00 lea 0x0(%esi),%esi if(ip->type == T_DIR && omode != O_RDONLY){ 80105210: 8b 4d e4 mov -0x1c(%ebp),%ecx 80105213: 85 c9 test %ecx,%ecx 80105215: 0f 84 4b ff ff ff je 80105166 <sys_open+0x76> iunlockput(ip); 8010521b: 83 ec 0c sub $0xc,%esp 8010521e: 56 push %esi 8010521f: e8 fc c6 ff ff call 80101920 <iunlockput> end_op(); 80105224: e8 07 db ff ff call 80102d30 <end_op> return -1; 80105229: 83 c4 10 add $0x10,%esp 8010522c: bb ff ff ff ff mov $0xffffffff,%ebx 80105231: eb 9a jmp 801051cd <sys_open+0xdd> 80105233: 90 nop 80105234: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi fileclose(f); 80105238: 83 ec 0c sub $0xc,%esp 8010523b: 57 push %edi 8010523c: e8 ff bb ff ff call 80100e40 <fileclose> 80105241: 83 c4 10 add $0x10,%esp 80105244: eb d5 jmp 8010521b <sys_open+0x12b> 80105246: 8d 76 00 lea 0x0(%esi),%esi 80105249: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105250 <sys_mkdir>: int sys_mkdir(void) { 80105250: 55 push %ebp 80105251: 89 e5 mov %esp,%ebp 80105253: 83 ec 18 sub $0x18,%esp char *path; struct inode *ip; begin_op(); 80105256: e8 65 da ff ff call 80102cc0 <begin_op> if(argstr(0, &path) < 0 || (ip = create(path, T_DIR, 0, 0)) == 0){ 8010525b: 8d 45 f4 lea -0xc(%ebp),%eax 8010525e: 83 ec 08 sub $0x8,%esp 80105261: 50 push %eax 80105262: 6a 00 push $0x0 80105264: e8 d7 f6 ff ff call 80104940 <argstr> 80105269: 83 c4 10 add $0x10,%esp 8010526c: 85 c0 test %eax,%eax 8010526e: 78 30 js 801052a0 <sys_mkdir+0x50> 80105270: 83 ec 0c sub $0xc,%esp 80105273: 8b 45 f4 mov -0xc(%ebp),%eax 80105276: 31 c9 xor %ecx,%ecx 80105278: 6a 00 push $0x0 8010527a: ba 01 00 00 00 mov $0x1,%edx 8010527f: e8 5c f7 ff ff call 801049e0 <create> 80105284: 83 c4 10 add $0x10,%esp 80105287: 85 c0 test %eax,%eax 80105289: 74 15 je 801052a0 <sys_mkdir+0x50> end_op(); return -1; } iunlockput(ip); 8010528b: 83 ec 0c sub $0xc,%esp 8010528e: 50 push %eax 8010528f: e8 8c c6 ff ff call 80101920 <iunlockput> end_op(); 80105294: e8 97 da ff ff call 80102d30 <end_op> return 0; 80105299: 83 c4 10 add $0x10,%esp 8010529c: 31 c0 xor %eax,%eax } 8010529e: c9 leave 8010529f: c3 ret end_op(); 801052a0: e8 8b da ff ff call 80102d30 <end_op> return -1; 801052a5: b8 ff ff ff ff mov $0xffffffff,%eax } 801052aa: c9 leave 801052ab: c3 ret 801052ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801052b0 <sys_mknod>: int sys_mknod(void) { 801052b0: 55 push %ebp 801052b1: 89 e5 mov %esp,%ebp 801052b3: 83 ec 18 sub $0x18,%esp struct inode *ip; char *path; int major, minor; begin_op(); 801052b6: e8 05 da ff ff call 80102cc0 <begin_op> if((argstr(0, &path)) < 0 || 801052bb: 8d 45 ec lea -0x14(%ebp),%eax 801052be: 83 ec 08 sub $0x8,%esp 801052c1: 50 push %eax 801052c2: 6a 00 push $0x0 801052c4: e8 77 f6 ff ff call 80104940 <argstr> 801052c9: 83 c4 10 add $0x10,%esp 801052cc: 85 c0 test %eax,%eax 801052ce: 78 60 js 80105330 <sys_mknod+0x80> argint(1, &major) < 0 || 801052d0: 8d 45 f0 lea -0x10(%ebp),%eax 801052d3: 83 ec 08 sub $0x8,%esp 801052d6: 50 push %eax 801052d7: 6a 01 push $0x1 801052d9: e8 b2 f5 ff ff call 80104890 <argint> if((argstr(0, &path)) < 0 || 801052de: 83 c4 10 add $0x10,%esp 801052e1: 85 c0 test %eax,%eax 801052e3: 78 4b js 80105330 <sys_mknod+0x80> argint(2, &minor) < 0 || 801052e5: 8d 45 f4 lea -0xc(%ebp),%eax 801052e8: 83 ec 08 sub $0x8,%esp 801052eb: 50 push %eax 801052ec: 6a 02 push $0x2 801052ee: e8 9d f5 ff ff call 80104890 <argint> argint(1, &major) < 0 || 801052f3: 83 c4 10 add $0x10,%esp 801052f6: 85 c0 test %eax,%eax 801052f8: 78 36 js 80105330 <sys_mknod+0x80> (ip = create(path, T_DEV, major, minor)) == 0){ 801052fa: 0f bf 45 f4 movswl -0xc(%ebp),%eax argint(2, &minor) < 0 || 801052fe: 83 ec 0c sub $0xc,%esp (ip = create(path, T_DEV, major, minor)) == 0){ 80105301: 0f bf 4d f0 movswl -0x10(%ebp),%ecx argint(2, &minor) < 0 || 80105305: ba 03 00 00 00 mov $0x3,%edx 8010530a: 50 push %eax 8010530b: 8b 45 ec mov -0x14(%ebp),%eax 8010530e: e8 cd f6 ff ff call 801049e0 <create> 80105313: 83 c4 10 add $0x10,%esp 80105316: 85 c0 test %eax,%eax 80105318: 74 16 je 80105330 <sys_mknod+0x80> end_op(); return -1; } iunlockput(ip); 8010531a: 83 ec 0c sub $0xc,%esp 8010531d: 50 push %eax 8010531e: e8 fd c5 ff ff call 80101920 <iunlockput> end_op(); 80105323: e8 08 da ff ff call 80102d30 <end_op> return 0; 80105328: 83 c4 10 add $0x10,%esp 8010532b: 31 c0 xor %eax,%eax } 8010532d: c9 leave 8010532e: c3 ret 8010532f: 90 nop end_op(); 80105330: e8 fb d9 ff ff call 80102d30 <end_op> return -1; 80105335: b8 ff ff ff ff mov $0xffffffff,%eax } 8010533a: c9 leave 8010533b: c3 ret 8010533c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105340 <sys_chdir>: int sys_chdir(void) { 80105340: 55 push %ebp 80105341: 89 e5 mov %esp,%ebp 80105343: 56 push %esi 80105344: 53 push %ebx 80105345: 83 ec 10 sub $0x10,%esp char *path; struct inode *ip; struct proc *curproc = myproc(); 80105348: e8 b3 e5 ff ff call 80103900 <myproc> 8010534d: 89 c6 mov %eax,%esi begin_op(); 8010534f: e8 6c d9 ff ff call 80102cc0 <begin_op> if(argstr(0, &path) < 0 || (ip = namei(path)) == 0){ 80105354: 8d 45 f4 lea -0xc(%ebp),%eax 80105357: 83 ec 08 sub $0x8,%esp 8010535a: 50 push %eax 8010535b: 6a 00 push $0x0 8010535d: e8 de f5 ff ff call 80104940 <argstr> 80105362: 83 c4 10 add $0x10,%esp 80105365: 85 c0 test %eax,%eax 80105367: 78 77 js 801053e0 <sys_chdir+0xa0> 80105369: 83 ec 0c sub $0xc,%esp 8010536c: ff 75 f4 pushl -0xc(%ebp) 8010536f: e8 7c cb ff ff call 80101ef0 <namei> 80105374: 83 c4 10 add $0x10,%esp 80105377: 85 c0 test %eax,%eax 80105379: 89 c3 mov %eax,%ebx 8010537b: 74 63 je 801053e0 <sys_chdir+0xa0> end_op(); return -1; } ilock(ip); 8010537d: 83 ec 0c sub $0xc,%esp 80105380: 50 push %eax 80105381: e8 0a c3 ff ff call 80101690 <ilock> if(ip->type != T_DIR){ 80105386: 83 c4 10 add $0x10,%esp 80105389: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 8010538e: 75 30 jne 801053c0 <sys_chdir+0x80> iunlockput(ip); end_op(); return -1; } iunlock(ip); 80105390: 83 ec 0c sub $0xc,%esp 80105393: 53 push %ebx 80105394: e8 d7 c3 ff ff call 80101770 <iunlock> iput(curproc->cwd); 80105399: 58 pop %eax 8010539a: ff 76 68 pushl 0x68(%esi) 8010539d: e8 1e c4 ff ff call 801017c0 <iput> end_op(); 801053a2: e8 89 d9 ff ff call 80102d30 <end_op> curproc->cwd = ip; 801053a7: 89 5e 68 mov %ebx,0x68(%esi) return 0; 801053aa: 83 c4 10 add $0x10,%esp 801053ad: 31 c0 xor %eax,%eax } 801053af: 8d 65 f8 lea -0x8(%ebp),%esp 801053b2: 5b pop %ebx 801053b3: 5e pop %esi 801053b4: 5d pop %ebp 801053b5: c3 ret 801053b6: 8d 76 00 lea 0x0(%esi),%esi 801053b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi iunlockput(ip); 801053c0: 83 ec 0c sub $0xc,%esp 801053c3: 53 push %ebx 801053c4: e8 57 c5 ff ff call 80101920 <iunlockput> end_op(); 801053c9: e8 62 d9 ff ff call 80102d30 <end_op> return -1; 801053ce: 83 c4 10 add $0x10,%esp 801053d1: b8 ff ff ff ff mov $0xffffffff,%eax 801053d6: eb d7 jmp 801053af <sys_chdir+0x6f> 801053d8: 90 nop 801053d9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi end_op(); 801053e0: e8 4b d9 ff ff call 80102d30 <end_op> return -1; 801053e5: b8 ff ff ff ff mov $0xffffffff,%eax 801053ea: eb c3 jmp 801053af <sys_chdir+0x6f> 801053ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801053f0 <sys_exec>: int sys_exec(void) { 801053f0: 55 push %ebp 801053f1: 89 e5 mov %esp,%ebp 801053f3: 57 push %edi 801053f4: 56 push %esi 801053f5: 53 push %ebx char *path, *argv[MAXARG]; int i; uint uargv, uarg; if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){ 801053f6: 8d 85 5c ff ff ff lea -0xa4(%ebp),%eax { 801053fc: 81 ec a4 00 00 00 sub $0xa4,%esp if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){ 80105402: 50 push %eax 80105403: 6a 00 push $0x0 80105405: e8 36 f5 ff ff call 80104940 <argstr> 8010540a: 83 c4 10 add $0x10,%esp 8010540d: 85 c0 test %eax,%eax 8010540f: 0f 88 87 00 00 00 js 8010549c <sys_exec+0xac> 80105415: 8d 85 60 ff ff ff lea -0xa0(%ebp),%eax 8010541b: 83 ec 08 sub $0x8,%esp 8010541e: 50 push %eax 8010541f: 6a 01 push $0x1 80105421: e8 6a f4 ff ff call 80104890 <argint> 80105426: 83 c4 10 add $0x10,%esp 80105429: 85 c0 test %eax,%eax 8010542b: 78 6f js 8010549c <sys_exec+0xac> return -1; } memset(argv, 0, sizeof(argv)); 8010542d: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax 80105433: 83 ec 04 sub $0x4,%esp for(i=0;; i++){ 80105436: 31 db xor %ebx,%ebx memset(argv, 0, sizeof(argv)); 80105438: 68 80 00 00 00 push $0x80 8010543d: 6a 00 push $0x0 8010543f: 8d bd 64 ff ff ff lea -0x9c(%ebp),%edi 80105445: 50 push %eax 80105446: e8 45 f1 ff ff call 80104590 <memset> 8010544b: 83 c4 10 add $0x10,%esp 8010544e: eb 2c jmp 8010547c <sys_exec+0x8c> if(i >= NELEM(argv)) return -1; if(fetchint(uargv+4*i, (int*)&uarg) < 0) return -1; if(uarg == 0){ 80105450: 8b 85 64 ff ff ff mov -0x9c(%ebp),%eax 80105456: 85 c0 test %eax,%eax 80105458: 74 56 je 801054b0 <sys_exec+0xc0> argv[i] = 0; break; } if(fetchstr(uarg, &argv[i]) < 0) 8010545a: 8d 8d 68 ff ff ff lea -0x98(%ebp),%ecx 80105460: 83 ec 08 sub $0x8,%esp 80105463: 8d 14 31 lea (%ecx,%esi,1),%edx 80105466: 52 push %edx 80105467: 50 push %eax 80105468: e8 b3 f3 ff ff call 80104820 <fetchstr> 8010546d: 83 c4 10 add $0x10,%esp 80105470: 85 c0 test %eax,%eax 80105472: 78 28 js 8010549c <sys_exec+0xac> for(i=0;; i++){ 80105474: 83 c3 01 add $0x1,%ebx if(i >= NELEM(argv)) 80105477: 83 fb 20 cmp $0x20,%ebx 8010547a: 74 20 je 8010549c <sys_exec+0xac> if(fetchint(uargv+4*i, (int*)&uarg) < 0) 8010547c: 8b 85 60 ff ff ff mov -0xa0(%ebp),%eax 80105482: 8d 34 9d 00 00 00 00 lea 0x0(,%ebx,4),%esi 80105489: 83 ec 08 sub $0x8,%esp 8010548c: 57 push %edi 8010548d: 01 f0 add %esi,%eax 8010548f: 50 push %eax 80105490: e8 4b f3 ff ff call 801047e0 <fetchint> 80105495: 83 c4 10 add $0x10,%esp 80105498: 85 c0 test %eax,%eax 8010549a: 79 b4 jns 80105450 <sys_exec+0x60> return -1; } return exec(path, argv); } 8010549c: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 8010549f: b8 ff ff ff ff mov $0xffffffff,%eax } 801054a4: 5b pop %ebx 801054a5: 5e pop %esi 801054a6: 5f pop %edi 801054a7: 5d pop %ebp 801054a8: c3 ret 801054a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return exec(path, argv); 801054b0: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax 801054b6: 83 ec 08 sub $0x8,%esp argv[i] = 0; 801054b9: c7 84 9d 68 ff ff ff movl $0x0,-0x98(%ebp,%ebx,4) 801054c0: 00 00 00 00 return exec(path, argv); 801054c4: 50 push %eax 801054c5: ff b5 5c ff ff ff pushl -0xa4(%ebp) 801054cb: e8 40 b5 ff ff call 80100a10 <exec> 801054d0: 83 c4 10 add $0x10,%esp } 801054d3: 8d 65 f4 lea -0xc(%ebp),%esp 801054d6: 5b pop %ebx 801054d7: 5e pop %esi 801054d8: 5f pop %edi 801054d9: 5d pop %ebp 801054da: c3 ret 801054db: 90 nop 801054dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801054e0 <sys_pipe>: int sys_pipe(void) { 801054e0: 55 push %ebp 801054e1: 89 e5 mov %esp,%ebp 801054e3: 57 push %edi 801054e4: 56 push %esi 801054e5: 53 push %ebx int *fd; struct file *rf, *wf; int fd0, fd1; if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0) 801054e6: 8d 45 dc lea -0x24(%ebp),%eax { 801054e9: 83 ec 20 sub $0x20,%esp if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0) 801054ec: 6a 08 push $0x8 801054ee: 50 push %eax 801054ef: 6a 00 push $0x0 801054f1: e8 ea f3 ff ff call 801048e0 <argptr> 801054f6: 83 c4 10 add $0x10,%esp 801054f9: 85 c0 test %eax,%eax 801054fb: 0f 88 ae 00 00 00 js 801055af <sys_pipe+0xcf> return -1; if(pipealloc(&rf, &wf) < 0) 80105501: 8d 45 e4 lea -0x1c(%ebp),%eax 80105504: 83 ec 08 sub $0x8,%esp 80105507: 50 push %eax 80105508: 8d 45 e0 lea -0x20(%ebp),%eax 8010550b: 50 push %eax 8010550c: e8 4f de ff ff call 80103360 <pipealloc> 80105511: 83 c4 10 add $0x10,%esp 80105514: 85 c0 test %eax,%eax 80105516: 0f 88 93 00 00 00 js 801055af <sys_pipe+0xcf> return -1; fd0 = -1; if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){ 8010551c: 8b 7d e0 mov -0x20(%ebp),%edi for(fd = 0; fd < NOFILE; fd++){ 8010551f: 31 db xor %ebx,%ebx struct proc *curproc = myproc(); 80105521: e8 da e3 ff ff call 80103900 <myproc> 80105526: eb 10 jmp 80105538 <sys_pipe+0x58> 80105528: 90 nop 80105529: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi for(fd = 0; fd < NOFILE; fd++){ 80105530: 83 c3 01 add $0x1,%ebx 80105533: 83 fb 10 cmp $0x10,%ebx 80105536: 74 60 je 80105598 <sys_pipe+0xb8> if(curproc->ofile[fd] == 0){ 80105538: 8b 74 98 28 mov 0x28(%eax,%ebx,4),%esi 8010553c: 85 f6 test %esi,%esi 8010553e: 75 f0 jne 80105530 <sys_pipe+0x50> curproc->ofile[fd] = f; 80105540: 8d 73 08 lea 0x8(%ebx),%esi 80105543: 89 7c b0 08 mov %edi,0x8(%eax,%esi,4) if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){ 80105547: 8b 7d e4 mov -0x1c(%ebp),%edi struct proc *curproc = myproc(); 8010554a: e8 b1 e3 ff ff call 80103900 <myproc> for(fd = 0; fd < NOFILE; fd++){ 8010554f: 31 d2 xor %edx,%edx 80105551: eb 0d jmp 80105560 <sys_pipe+0x80> 80105553: 90 nop 80105554: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105558: 83 c2 01 add $0x1,%edx 8010555b: 83 fa 10 cmp $0x10,%edx 8010555e: 74 28 je 80105588 <sys_pipe+0xa8> if(curproc->ofile[fd] == 0){ 80105560: 8b 4c 90 28 mov 0x28(%eax,%edx,4),%ecx 80105564: 85 c9 test %ecx,%ecx 80105566: 75 f0 jne 80105558 <sys_pipe+0x78> curproc->ofile[fd] = f; 80105568: 89 7c 90 28 mov %edi,0x28(%eax,%edx,4) myproc()->ofile[fd0] = 0; fileclose(rf); fileclose(wf); return -1; } fd[0] = fd0; 8010556c: 8b 45 dc mov -0x24(%ebp),%eax 8010556f: 89 18 mov %ebx,(%eax) fd[1] = fd1; 80105571: 8b 45 dc mov -0x24(%ebp),%eax 80105574: 89 50 04 mov %edx,0x4(%eax) return 0; 80105577: 31 c0 xor %eax,%eax } 80105579: 8d 65 f4 lea -0xc(%ebp),%esp 8010557c: 5b pop %ebx 8010557d: 5e pop %esi 8010557e: 5f pop %edi 8010557f: 5d pop %ebp 80105580: c3 ret 80105581: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi myproc()->ofile[fd0] = 0; 80105588: e8 73 e3 ff ff call 80103900 <myproc> 8010558d: c7 44 b0 08 00 00 00 movl $0x0,0x8(%eax,%esi,4) 80105594: 00 80105595: 8d 76 00 lea 0x0(%esi),%esi fileclose(rf); 80105598: 83 ec 0c sub $0xc,%esp 8010559b: ff 75 e0 pushl -0x20(%ebp) 8010559e: e8 9d b8 ff ff call 80100e40 <fileclose> fileclose(wf); 801055a3: 58 pop %eax 801055a4: ff 75 e4 pushl -0x1c(%ebp) 801055a7: e8 94 b8 ff ff call 80100e40 <fileclose> return -1; 801055ac: 83 c4 10 add $0x10,%esp 801055af: b8 ff ff ff ff mov $0xffffffff,%eax 801055b4: eb c3 jmp 80105579 <sys_pipe+0x99> 801055b6: 8d 76 00 lea 0x0(%esi),%esi 801055b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801055c0 <sys_swapread>: int sys_swapread(void) { 801055c0: 55 push %ebp 801055c1: 89 e5 mov %esp,%ebp 801055c3: 83 ec 1c sub $0x1c,%esp char* ptr; int blkno; if(argptr(0, &ptr, PGSIZE) < 0 || argint(1, &blkno) < 0 ) 801055c6: 8d 45 f0 lea -0x10(%ebp),%eax 801055c9: 68 00 10 00 00 push $0x1000 801055ce: 50 push %eax 801055cf: 6a 00 push $0x0 801055d1: e8 0a f3 ff ff call 801048e0 <argptr> 801055d6: 83 c4 10 add $0x10,%esp 801055d9: 85 c0 test %eax,%eax 801055db: 78 33 js 80105610 <sys_swapread+0x50> 801055dd: 8d 45 f4 lea -0xc(%ebp),%eax 801055e0: 83 ec 08 sub $0x8,%esp 801055e3: 50 push %eax 801055e4: 6a 01 push $0x1 801055e6: e8 a5 f2 ff ff call 80104890 <argint> 801055eb: 83 c4 10 add $0x10,%esp 801055ee: 85 c0 test %eax,%eax 801055f0: 78 1e js 80105610 <sys_swapread+0x50> return -1; swapread(ptr, blkno); 801055f2: 83 ec 08 sub $0x8,%esp 801055f5: ff 75 f4 pushl -0xc(%ebp) 801055f8: ff 75 f0 pushl -0x10(%ebp) 801055fb: e8 30 c9 ff ff call 80101f30 <swapread> return 0; 80105600: 83 c4 10 add $0x10,%esp 80105603: 31 c0 xor %eax,%eax } 80105605: c9 leave 80105606: c3 ret 80105607: 89 f6 mov %esi,%esi 80105609: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi return -1; 80105610: b8 ff ff ff ff mov $0xffffffff,%eax } 80105615: c9 leave 80105616: c3 ret 80105617: 89 f6 mov %esi,%esi 80105619: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105620 <sys_swapwrite>: int sys_swapwrite(void) { 80105620: 55 push %ebp 80105621: 89 e5 mov %esp,%ebp 80105623: 83 ec 1c sub $0x1c,%esp char* ptr; int blkno; if(argptr(0, &ptr, PGSIZE) < 0 || argint(1, &blkno) < 0 ) 80105626: 8d 45 f0 lea -0x10(%ebp),%eax 80105629: 68 00 10 00 00 push $0x1000 8010562e: 50 push %eax 8010562f: 6a 00 push $0x0 80105631: e8 aa f2 ff ff call 801048e0 <argptr> 80105636: 83 c4 10 add $0x10,%esp 80105639: 85 c0 test %eax,%eax 8010563b: 78 33 js 80105670 <sys_swapwrite+0x50> 8010563d: 8d 45 f4 lea -0xc(%ebp),%eax 80105640: 83 ec 08 sub $0x8,%esp 80105643: 50 push %eax 80105644: 6a 01 push $0x1 80105646: e8 45 f2 ff ff call 80104890 <argint> 8010564b: 83 c4 10 add $0x10,%esp 8010564e: 85 c0 test %eax,%eax 80105650: 78 1e js 80105670 <sys_swapwrite+0x50> return -1; swapwrite(ptr, blkno); 80105652: 83 ec 08 sub $0x8,%esp 80105655: ff 75 f4 pushl -0xc(%ebp) 80105658: ff 75 f0 pushl -0x10(%ebp) 8010565b: e8 50 c9 ff ff call 80101fb0 <swapwrite> return 0; 80105660: 83 c4 10 add $0x10,%esp 80105663: 31 c0 xor %eax,%eax } 80105665: c9 leave 80105666: c3 ret 80105667: 89 f6 mov %esi,%esi 80105669: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi return -1; 80105670: b8 ff ff ff ff mov $0xffffffff,%eax } 80105675: c9 leave 80105676: c3 ret 80105677: 66 90 xchg %ax,%ax 80105679: 66 90 xchg %ax,%ax 8010567b: 66 90 xchg %ax,%ax 8010567d: 66 90 xchg %ax,%ax 8010567f: 90 nop 80105680 <sys_fork>: #include "mmu.h" #include "proc.h" int sys_fork(void) { 80105680: 55 push %ebp 80105681: 89 e5 mov %esp,%ebp return fork(); } 80105683: 5d pop %ebp return fork(); 80105684: e9 37 e4 ff ff jmp 80103ac0 <fork> 80105689: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105690 <sys_exit>: int sys_exit(void) { 80105690: 55 push %ebp 80105691: 89 e5 mov %esp,%ebp 80105693: 83 ec 08 sub $0x8,%esp exit(); 80105696: e8 a5 e6 ff ff call 80103d40 <exit> return 0; // not reached } 8010569b: 31 c0 xor %eax,%eax 8010569d: c9 leave 8010569e: c3 ret 8010569f: 90 nop 801056a0 <sys_wait>: int sys_wait(void) { 801056a0: 55 push %ebp 801056a1: 89 e5 mov %esp,%ebp return wait(); } 801056a3: 5d pop %ebp return wait(); 801056a4: e9 d7 e8 ff ff jmp 80103f80 <wait> 801056a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801056b0 <sys_kill>: int sys_kill(void) { 801056b0: 55 push %ebp 801056b1: 89 e5 mov %esp,%ebp 801056b3: 83 ec 20 sub $0x20,%esp int pid; if(argint(0, &pid) < 0) 801056b6: 8d 45 f4 lea -0xc(%ebp),%eax 801056b9: 50 push %eax 801056ba: 6a 00 push $0x0 801056bc: e8 cf f1 ff ff call 80104890 <argint> 801056c1: 83 c4 10 add $0x10,%esp 801056c4: 85 c0 test %eax,%eax 801056c6: 78 18 js 801056e0 <sys_kill+0x30> return -1; return kill(pid); 801056c8: 83 ec 0c sub $0xc,%esp 801056cb: ff 75 f4 pushl -0xc(%ebp) 801056ce: e8 fd e9 ff ff call 801040d0 <kill> 801056d3: 83 c4 10 add $0x10,%esp } 801056d6: c9 leave 801056d7: c3 ret 801056d8: 90 nop 801056d9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 801056e0: b8 ff ff ff ff mov $0xffffffff,%eax } 801056e5: c9 leave 801056e6: c3 ret 801056e7: 89 f6 mov %esi,%esi 801056e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801056f0 <sys_getpid>: int sys_getpid(void) { 801056f0: 55 push %ebp 801056f1: 89 e5 mov %esp,%ebp 801056f3: 83 ec 08 sub $0x8,%esp return myproc()->pid; 801056f6: e8 05 e2 ff ff call 80103900 <myproc> 801056fb: 8b 40 10 mov 0x10(%eax),%eax } 801056fe: c9 leave 801056ff: c3 ret 80105700 <sys_sbrk>: int sys_sbrk(void) { 80105700: 55 push %ebp 80105701: 89 e5 mov %esp,%ebp 80105703: 53 push %ebx int addr; int n; if(argint(0, &n) < 0) 80105704: 8d 45 f4 lea -0xc(%ebp),%eax { 80105707: 83 ec 1c sub $0x1c,%esp if(argint(0, &n) < 0) 8010570a: 50 push %eax 8010570b: 6a 00 push $0x0 8010570d: e8 7e f1 ff ff call 80104890 <argint> 80105712: 83 c4 10 add $0x10,%esp 80105715: 85 c0 test %eax,%eax 80105717: 78 27 js 80105740 <sys_sbrk+0x40> return -1; addr = myproc()->sz; 80105719: e8 e2 e1 ff ff call 80103900 <myproc> if(growproc(n) < 0) 8010571e: 83 ec 0c sub $0xc,%esp addr = myproc()->sz; 80105721: 8b 18 mov (%eax),%ebx if(growproc(n) < 0) 80105723: ff 75 f4 pushl -0xc(%ebp) 80105726: e8 15 e3 ff ff call 80103a40 <growproc> 8010572b: 83 c4 10 add $0x10,%esp 8010572e: 85 c0 test %eax,%eax 80105730: 78 0e js 80105740 <sys_sbrk+0x40> return -1; return addr; } 80105732: 89 d8 mov %ebx,%eax 80105734: 8b 5d fc mov -0x4(%ebp),%ebx 80105737: c9 leave 80105738: c3 ret 80105739: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80105740: bb ff ff ff ff mov $0xffffffff,%ebx 80105745: eb eb jmp 80105732 <sys_sbrk+0x32> 80105747: 89 f6 mov %esi,%esi 80105749: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105750 <sys_sleep>: int sys_sleep(void) { 80105750: 55 push %ebp 80105751: 89 e5 mov %esp,%ebp 80105753: 53 push %ebx int n; uint ticks0; if(argint(0, &n) < 0) 80105754: 8d 45 f4 lea -0xc(%ebp),%eax { 80105757: 83 ec 1c sub $0x1c,%esp if(argint(0, &n) < 0) 8010575a: 50 push %eax 8010575b: 6a 00 push $0x0 8010575d: e8 2e f1 ff ff call 80104890 <argint> 80105762: 83 c4 10 add $0x10,%esp 80105765: 85 c0 test %eax,%eax 80105767: 0f 88 8a 00 00 00 js 801057f7 <sys_sleep+0xa7> return -1; acquire(&tickslock); 8010576d: 83 ec 0c sub $0xc,%esp 80105770: 68 60 4c 11 80 push $0x80114c60 80105775: e8 06 ed ff ff call 80104480 <acquire> ticks0 = ticks; while(ticks - ticks0 < n){ 8010577a: 8b 55 f4 mov -0xc(%ebp),%edx 8010577d: 83 c4 10 add $0x10,%esp ticks0 = ticks; 80105780: 8b 1d a0 54 11 80 mov 0x801154a0,%ebx while(ticks - ticks0 < n){ 80105786: 85 d2 test %edx,%edx 80105788: 75 27 jne 801057b1 <sys_sleep+0x61> 8010578a: eb 54 jmp 801057e0 <sys_sleep+0x90> 8010578c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(myproc()->killed){ release(&tickslock); return -1; } sleep(&ticks, &tickslock); 80105790: 83 ec 08 sub $0x8,%esp 80105793: 68 60 4c 11 80 push $0x80114c60 80105798: 68 a0 54 11 80 push $0x801154a0 8010579d: e8 1e e7 ff ff call 80103ec0 <sleep> while(ticks - ticks0 < n){ 801057a2: a1 a0 54 11 80 mov 0x801154a0,%eax 801057a7: 83 c4 10 add $0x10,%esp 801057aa: 29 d8 sub %ebx,%eax 801057ac: 3b 45 f4 cmp -0xc(%ebp),%eax 801057af: 73 2f jae 801057e0 <sys_sleep+0x90> if(myproc()->killed){ 801057b1: e8 4a e1 ff ff call 80103900 <myproc> 801057b6: 8b 40 24 mov 0x24(%eax),%eax 801057b9: 85 c0 test %eax,%eax 801057bb: 74 d3 je 80105790 <sys_sleep+0x40> release(&tickslock); 801057bd: 83 ec 0c sub $0xc,%esp 801057c0: 68 60 4c 11 80 push $0x80114c60 801057c5: e8 76 ed ff ff call 80104540 <release> return -1; 801057ca: 83 c4 10 add $0x10,%esp 801057cd: b8 ff ff ff ff mov $0xffffffff,%eax } release(&tickslock); return 0; } 801057d2: 8b 5d fc mov -0x4(%ebp),%ebx 801057d5: c9 leave 801057d6: c3 ret 801057d7: 89 f6 mov %esi,%esi 801057d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi release(&tickslock); 801057e0: 83 ec 0c sub $0xc,%esp 801057e3: 68 60 4c 11 80 push $0x80114c60 801057e8: e8 53 ed ff ff call 80104540 <release> return 0; 801057ed: 83 c4 10 add $0x10,%esp 801057f0: 31 c0 xor %eax,%eax } 801057f2: 8b 5d fc mov -0x4(%ebp),%ebx 801057f5: c9 leave 801057f6: c3 ret return -1; 801057f7: b8 ff ff ff ff mov $0xffffffff,%eax 801057fc: eb f4 jmp 801057f2 <sys_sleep+0xa2> 801057fe: 66 90 xchg %ax,%ax 80105800 <sys_uptime>: // return how many clock tick interrupts have occurred // since start. int sys_uptime(void) { 80105800: 55 push %ebp 80105801: 89 e5 mov %esp,%ebp 80105803: 53 push %ebx 80105804: 83 ec 10 sub $0x10,%esp uint xticks; acquire(&tickslock); 80105807: 68 60 4c 11 80 push $0x80114c60 8010580c: e8 6f ec ff ff call 80104480 <acquire> xticks = ticks; 80105811: 8b 1d a0 54 11 80 mov 0x801154a0,%ebx release(&tickslock); 80105817: c7 04 24 60 4c 11 80 movl $0x80114c60,(%esp) 8010581e: e8 1d ed ff ff call 80104540 <release> return xticks; } 80105823: 89 d8 mov %ebx,%eax 80105825: 8b 5d fc mov -0x4(%ebp),%ebx 80105828: c9 leave 80105829: c3 ret 8010582a <alltraps>: # vectors.S sends all traps here. .globl alltraps alltraps: # Build trap frame. pushl %ds 8010582a: 1e push %ds pushl %es 8010582b: 06 push %es pushl %fs 8010582c: 0f a0 push %fs pushl %gs 8010582e: 0f a8 push %gs pushal 80105830: 60 pusha # Set up data segments. movw $(SEG_KDATA<<3), %ax 80105831: 66 b8 10 00 mov $0x10,%ax movw %ax, %ds 80105835: 8e d8 mov %eax,%ds movw %ax, %es 80105837: 8e c0 mov %eax,%es # Call trap(tf), where tf=%esp pushl %esp 80105839: 54 push %esp call trap 8010583a: e8 c1 00 00 00 call 80105900 <trap> addl $4, %esp 8010583f: 83 c4 04 add $0x4,%esp 80105842 <trapret>: # Return falls through to trapret... .globl trapret trapret: popal 80105842: 61 popa popl %gs 80105843: 0f a9 pop %gs popl %fs 80105845: 0f a1 pop %fs popl %es 80105847: 07 pop %es popl %ds 80105848: 1f pop %ds addl $0x8, %esp # trapno and errcode 80105849: 83 c4 08 add $0x8,%esp iret 8010584c: cf iret 8010584d: 66 90 xchg %ax,%ax 8010584f: 90 nop 80105850 <tvinit>: struct spinlock tickslock; uint ticks; void tvinit(void) { 80105850: 55 push %ebp int i; for(i = 0; i < 256; i++) 80105851: 31 c0 xor %eax,%eax { 80105853: 89 e5 mov %esp,%ebp 80105855: 83 ec 08 sub $0x8,%esp 80105858: 90 nop 80105859: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi SETGATE(idt[i], 0, SEG_KCODE<<3, vectors[i], 0); 80105860: 8b 14 85 08 a0 10 80 mov -0x7fef5ff8(,%eax,4),%edx 80105867: c7 04 c5 a2 4c 11 80 movl $0x8e000008,-0x7feeb35e(,%eax,8) 8010586e: 08 00 00 8e 80105872: 66 89 14 c5 a0 4c 11 mov %dx,-0x7feeb360(,%eax,8) 80105879: 80 8010587a: c1 ea 10 shr $0x10,%edx 8010587d: 66 89 14 c5 a6 4c 11 mov %dx,-0x7feeb35a(,%eax,8) 80105884: 80 for(i = 0; i < 256; i++) 80105885: 83 c0 01 add $0x1,%eax 80105888: 3d 00 01 00 00 cmp $0x100,%eax 8010588d: 75 d1 jne 80105860 <tvinit+0x10> SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER); 8010588f: a1 08 a1 10 80 mov 0x8010a108,%eax initlock(&tickslock, "time"); 80105894: 83 ec 08 sub $0x8,%esp SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER); 80105897: c7 05 a2 4e 11 80 08 movl $0xef000008,0x80114ea2 8010589e: 00 00 ef initlock(&tickslock, "time"); 801058a1: 68 81 78 10 80 push $0x80107881 801058a6: 68 60 4c 11 80 push $0x80114c60 SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER); 801058ab: 66 a3 a0 4e 11 80 mov %ax,0x80114ea0 801058b1: c1 e8 10 shr $0x10,%eax 801058b4: 66 a3 a6 4e 11 80 mov %ax,0x80114ea6 initlock(&tickslock, "time"); 801058ba: e8 81 ea ff ff call 80104340 <initlock> } 801058bf: 83 c4 10 add $0x10,%esp 801058c2: c9 leave 801058c3: c3 ret 801058c4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801058ca: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 801058d0 <idtinit>: void idtinit(void) { 801058d0: 55 push %ebp pd[0] = size-1; 801058d1: b8 ff 07 00 00 mov $0x7ff,%eax 801058d6: 89 e5 mov %esp,%ebp 801058d8: 83 ec 10 sub $0x10,%esp 801058db: 66 89 45 fa mov %ax,-0x6(%ebp) pd[1] = (uint)p; 801058df: b8 a0 4c 11 80 mov $0x80114ca0,%eax 801058e4: 66 89 45 fc mov %ax,-0x4(%ebp) pd[2] = (uint)p >> 16; 801058e8: c1 e8 10 shr $0x10,%eax 801058eb: 66 89 45 fe mov %ax,-0x2(%ebp) asm volatile("lidt (%0)" : : "r" (pd)); 801058ef: 8d 45 fa lea -0x6(%ebp),%eax 801058f2: 0f 01 18 lidtl (%eax) lidt(idt, sizeof(idt)); } 801058f5: c9 leave 801058f6: c3 ret 801058f7: 89 f6 mov %esi,%esi 801058f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105900 <trap>: //PAGEBREAK: 41 void trap(struct trapframe *tf) { 80105900: 55 push %ebp 80105901: 89 e5 mov %esp,%ebp 80105903: 57 push %edi 80105904: 56 push %esi 80105905: 53 push %ebx 80105906: 83 ec 1c sub $0x1c,%esp 80105909: 8b 7d 08 mov 0x8(%ebp),%edi if(tf->trapno == T_SYSCALL){ 8010590c: 8b 47 30 mov 0x30(%edi),%eax 8010590f: 83 f8 40 cmp $0x40,%eax 80105912: 0f 84 f0 00 00 00 je 80105a08 <trap+0x108> if(myproc()->killed) exit(); return; } switch(tf->trapno){ 80105918: 83 e8 20 sub $0x20,%eax 8010591b: 83 f8 1f cmp $0x1f,%eax 8010591e: 77 10 ja 80105930 <trap+0x30> 80105920: ff 24 85 28 79 10 80 jmp *-0x7fef86d8(,%eax,4) 80105927: 89 f6 mov %esi,%esi 80105929: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi lapiceoi(); break; //PAGEBREAK: 13 default: if(myproc() == 0 || (tf->cs&3) == 0){ 80105930: e8 cb df ff ff call 80103900 <myproc> 80105935: 85 c0 test %eax,%eax 80105937: 8b 5f 38 mov 0x38(%edi),%ebx 8010593a: 0f 84 14 02 00 00 je 80105b54 <trap+0x254> 80105940: f6 47 3c 03 testb $0x3,0x3c(%edi) 80105944: 0f 84 0a 02 00 00 je 80105b54 <trap+0x254> static inline uint rcr2(void) { uint val; asm volatile("movl %%cr2,%0" : "=r" (val)); 8010594a: 0f 20 d1 mov %cr2,%ecx 8010594d: 89 4d d8 mov %ecx,-0x28(%ebp) cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n", tf->trapno, cpuid(), tf->eip, rcr2()); panic("trap"); } // In user space, assume process misbehaved. cprintf("pid %d %s: trap %d err %d on cpu %d " 80105950: e8 8b df ff ff call 801038e0 <cpuid> 80105955: 89 45 dc mov %eax,-0x24(%ebp) 80105958: 8b 47 34 mov 0x34(%edi),%eax 8010595b: 8b 77 30 mov 0x30(%edi),%esi 8010595e: 89 45 e4 mov %eax,-0x1c(%ebp) "eip 0x%x addr 0x%x--kill proc\n", myproc()->pid, myproc()->name, tf->trapno, 80105961: e8 9a df ff ff call 80103900 <myproc> 80105966: 89 45 e0 mov %eax,-0x20(%ebp) 80105969: e8 92 df ff ff call 80103900 <myproc> cprintf("pid %d %s: trap %d err %d on cpu %d " 8010596e: 8b 4d d8 mov -0x28(%ebp),%ecx 80105971: 8b 55 dc mov -0x24(%ebp),%edx 80105974: 51 push %ecx 80105975: 53 push %ebx 80105976: 52 push %edx myproc()->pid, myproc()->name, tf->trapno, 80105977: 8b 55 e0 mov -0x20(%ebp),%edx cprintf("pid %d %s: trap %d err %d on cpu %d " 8010597a: ff 75 e4 pushl -0x1c(%ebp) 8010597d: 56 push %esi myproc()->pid, myproc()->name, tf->trapno, 8010597e: 83 c2 6c add $0x6c,%edx cprintf("pid %d %s: trap %d err %d on cpu %d " 80105981: 52 push %edx 80105982: ff 70 10 pushl 0x10(%eax) 80105985: 68 e4 78 10 80 push $0x801078e4 8010598a: e8 d1 ac ff ff call 80100660 <cprintf> tf->err, cpuid(), tf->eip, rcr2()); myproc()->killed = 1; 8010598f: 83 c4 20 add $0x20,%esp 80105992: e8 69 df ff ff call 80103900 <myproc> 80105997: c7 40 24 01 00 00 00 movl $0x1,0x24(%eax) } // Force process exit if it has been killed and is in user space. // (If it is still executing in the kernel, let it keep running // until it gets to the regular system call return.) if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER) 8010599e: e8 5d df ff ff call 80103900 <myproc> 801059a3: 85 c0 test %eax,%eax 801059a5: 74 1d je 801059c4 <trap+0xc4> 801059a7: e8 54 df ff ff call 80103900 <myproc> 801059ac: 8b 50 24 mov 0x24(%eax),%edx 801059af: 85 d2 test %edx,%edx 801059b1: 74 11 je 801059c4 <trap+0xc4> 801059b3: 0f b7 47 3c movzwl 0x3c(%edi),%eax 801059b7: 83 e0 03 and $0x3,%eax 801059ba: 66 83 f8 03 cmp $0x3,%ax 801059be: 0f 84 4c 01 00 00 je 80105b10 <trap+0x210> exit(); // Force process to give up CPU on clock tick. // If interrupts were on while locks held, would need to check nlock. if(myproc() && myproc()->state == RUNNING && 801059c4: e8 37 df ff ff call 80103900 <myproc> 801059c9: 85 c0 test %eax,%eax 801059cb: 74 0b je 801059d8 <trap+0xd8> 801059cd: e8 2e df ff ff call 80103900 <myproc> 801059d2: 83 78 0c 04 cmpl $0x4,0xc(%eax) 801059d6: 74 68 je 80105a40 <trap+0x140> tf->trapno == T_IRQ0+IRQ_TIMER) yield(); // Check if the process has been killed since we yielded if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER) 801059d8: e8 23 df ff ff call 80103900 <myproc> 801059dd: 85 c0 test %eax,%eax 801059df: 74 19 je 801059fa <trap+0xfa> 801059e1: e8 1a df ff ff call 80103900 <myproc> 801059e6: 8b 40 24 mov 0x24(%eax),%eax 801059e9: 85 c0 test %eax,%eax 801059eb: 74 0d je 801059fa <trap+0xfa> 801059ed: 0f b7 47 3c movzwl 0x3c(%edi),%eax 801059f1: 83 e0 03 and $0x3,%eax 801059f4: 66 83 f8 03 cmp $0x3,%ax 801059f8: 74 37 je 80105a31 <trap+0x131> exit(); } 801059fa: 8d 65 f4 lea -0xc(%ebp),%esp 801059fd: 5b pop %ebx 801059fe: 5e pop %esi 801059ff: 5f pop %edi 80105a00: 5d pop %ebp 80105a01: c3 ret 80105a02: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(myproc()->killed) 80105a08: e8 f3 de ff ff call 80103900 <myproc> 80105a0d: 8b 58 24 mov 0x24(%eax),%ebx 80105a10: 85 db test %ebx,%ebx 80105a12: 0f 85 e8 00 00 00 jne 80105b00 <trap+0x200> myproc()->tf = tf; 80105a18: e8 e3 de ff ff call 80103900 <myproc> 80105a1d: 89 78 18 mov %edi,0x18(%eax) syscall(); 80105a20: e8 5b ef ff ff call 80104980 <syscall> if(myproc()->killed) 80105a25: e8 d6 de ff ff call 80103900 <myproc> 80105a2a: 8b 48 24 mov 0x24(%eax),%ecx 80105a2d: 85 c9 test %ecx,%ecx 80105a2f: 74 c9 je 801059fa <trap+0xfa> } 80105a31: 8d 65 f4 lea -0xc(%ebp),%esp 80105a34: 5b pop %ebx 80105a35: 5e pop %esi 80105a36: 5f pop %edi 80105a37: 5d pop %ebp exit(); 80105a38: e9 03 e3 ff ff jmp 80103d40 <exit> 80105a3d: 8d 76 00 lea 0x0(%esi),%esi if(myproc() && myproc()->state == RUNNING && 80105a40: 83 7f 30 20 cmpl $0x20,0x30(%edi) 80105a44: 75 92 jne 801059d8 <trap+0xd8> yield(); 80105a46: e8 25 e4 ff ff call 80103e70 <yield> 80105a4b: eb 8b jmp 801059d8 <trap+0xd8> 80105a4d: 8d 76 00 lea 0x0(%esi),%esi if(cpuid() == 0){ 80105a50: e8 8b de ff ff call 801038e0 <cpuid> 80105a55: 85 c0 test %eax,%eax 80105a57: 0f 84 c3 00 00 00 je 80105b20 <trap+0x220> lapiceoi(); 80105a5d: e8 0e ce ff ff call 80102870 <lapiceoi> if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER) 80105a62: e8 99 de ff ff call 80103900 <myproc> 80105a67: 85 c0 test %eax,%eax 80105a69: 0f 85 38 ff ff ff jne 801059a7 <trap+0xa7> 80105a6f: e9 50 ff ff ff jmp 801059c4 <trap+0xc4> 80105a74: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi kbdintr(); 80105a78: e8 b3 cc ff ff call 80102730 <kbdintr> lapiceoi(); 80105a7d: e8 ee cd ff ff call 80102870 <lapiceoi> if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER) 80105a82: e8 79 de ff ff call 80103900 <myproc> 80105a87: 85 c0 test %eax,%eax 80105a89: 0f 85 18 ff ff ff jne 801059a7 <trap+0xa7> 80105a8f: e9 30 ff ff ff jmp 801059c4 <trap+0xc4> 80105a94: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi uartintr(); 80105a98: e8 53 02 00 00 call 80105cf0 <uartintr> lapiceoi(); 80105a9d: e8 ce cd ff ff call 80102870 <lapiceoi> if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER) 80105aa2: e8 59 de ff ff call 80103900 <myproc> 80105aa7: 85 c0 test %eax,%eax 80105aa9: 0f 85 f8 fe ff ff jne 801059a7 <trap+0xa7> 80105aaf: e9 10 ff ff ff jmp 801059c4 <trap+0xc4> 80105ab4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi cprintf("cpu%d: spurious interrupt at %x:%x\n", 80105ab8: 0f b7 5f 3c movzwl 0x3c(%edi),%ebx 80105abc: 8b 77 38 mov 0x38(%edi),%esi 80105abf: e8 1c de ff ff call 801038e0 <cpuid> 80105ac4: 56 push %esi 80105ac5: 53 push %ebx 80105ac6: 50 push %eax 80105ac7: 68 8c 78 10 80 push $0x8010788c 80105acc: e8 8f ab ff ff call 80100660 <cprintf> lapiceoi(); 80105ad1: e8 9a cd ff ff call 80102870 <lapiceoi> break; 80105ad6: 83 c4 10 add $0x10,%esp if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER) 80105ad9: e8 22 de ff ff call 80103900 <myproc> 80105ade: 85 c0 test %eax,%eax 80105ae0: 0f 85 c1 fe ff ff jne 801059a7 <trap+0xa7> 80105ae6: e9 d9 fe ff ff jmp 801059c4 <trap+0xc4> 80105aeb: 90 nop 80105aec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi ideintr(); 80105af0: e8 ab c6 ff ff call 801021a0 <ideintr> 80105af5: e9 63 ff ff ff jmp 80105a5d <trap+0x15d> 80105afa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi exit(); 80105b00: e8 3b e2 ff ff call 80103d40 <exit> 80105b05: e9 0e ff ff ff jmp 80105a18 <trap+0x118> 80105b0a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi exit(); 80105b10: e8 2b e2 ff ff call 80103d40 <exit> 80105b15: e9 aa fe ff ff jmp 801059c4 <trap+0xc4> 80105b1a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi acquire(&tickslock); 80105b20: 83 ec 0c sub $0xc,%esp 80105b23: 68 60 4c 11 80 push $0x80114c60 80105b28: e8 53 e9 ff ff call 80104480 <acquire> wakeup(&ticks); 80105b2d: c7 04 24 a0 54 11 80 movl $0x801154a0,(%esp) ticks++; 80105b34: 83 05 a0 54 11 80 01 addl $0x1,0x801154a0 wakeup(&ticks); 80105b3b: e8 30 e5 ff ff call 80104070 <wakeup> release(&tickslock); 80105b40: c7 04 24 60 4c 11 80 movl $0x80114c60,(%esp) 80105b47: e8 f4 e9 ff ff call 80104540 <release> 80105b4c: 83 c4 10 add $0x10,%esp 80105b4f: e9 09 ff ff ff jmp 80105a5d <trap+0x15d> 80105b54: 0f 20 d6 mov %cr2,%esi cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n", 80105b57: e8 84 dd ff ff call 801038e0 <cpuid> 80105b5c: 83 ec 0c sub $0xc,%esp 80105b5f: 56 push %esi 80105b60: 53 push %ebx 80105b61: 50 push %eax 80105b62: ff 77 30 pushl 0x30(%edi) 80105b65: 68 b0 78 10 80 push $0x801078b0 80105b6a: e8 f1 aa ff ff call 80100660 <cprintf> panic("trap"); 80105b6f: 83 c4 14 add $0x14,%esp 80105b72: 68 86 78 10 80 push $0x80107886 80105b77: e8 14 a8 ff ff call 80100390 <panic> 80105b7c: 66 90 xchg %ax,%ax 80105b7e: 66 90 xchg %ax,%ax 80105b80 <uartgetc>: } static int uartgetc(void) { if(!uart) 80105b80: a1 bc a5 10 80 mov 0x8010a5bc,%eax { 80105b85: 55 push %ebp 80105b86: 89 e5 mov %esp,%ebp if(!uart) 80105b88: 85 c0 test %eax,%eax 80105b8a: 74 1c je 80105ba8 <uartgetc+0x28> asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80105b8c: ba fd 03 00 00 mov $0x3fd,%edx 80105b91: ec in (%dx),%al return -1; if(!(inb(COM1+5) & 0x01)) 80105b92: a8 01 test $0x1,%al 80105b94: 74 12 je 80105ba8 <uartgetc+0x28> 80105b96: ba f8 03 00 00 mov $0x3f8,%edx 80105b9b: ec in (%dx),%al return -1; return inb(COM1+0); 80105b9c: 0f b6 c0 movzbl %al,%eax } 80105b9f: 5d pop %ebp 80105ba0: c3 ret 80105ba1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80105ba8: b8 ff ff ff ff mov $0xffffffff,%eax } 80105bad: 5d pop %ebp 80105bae: c3 ret 80105baf: 90 nop 80105bb0 <uartputc.part.0>: uartputc(int c) 80105bb0: 55 push %ebp 80105bb1: 89 e5 mov %esp,%ebp 80105bb3: 57 push %edi 80105bb4: 56 push %esi 80105bb5: 53 push %ebx 80105bb6: 89 c7 mov %eax,%edi 80105bb8: bb 80 00 00 00 mov $0x80,%ebx 80105bbd: be fd 03 00 00 mov $0x3fd,%esi 80105bc2: 83 ec 0c sub $0xc,%esp 80105bc5: eb 1b jmp 80105be2 <uartputc.part.0+0x32> 80105bc7: 89 f6 mov %esi,%esi 80105bc9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi microdelay(10); 80105bd0: 83 ec 0c sub $0xc,%esp 80105bd3: 6a 0a push $0xa 80105bd5: e8 b6 cc ff ff call 80102890 <microdelay> for(i = 0; i < 128 && !(inb(COM1+5) & 0x20); i++) 80105bda: 83 c4 10 add $0x10,%esp 80105bdd: 83 eb 01 sub $0x1,%ebx 80105be0: 74 07 je 80105be9 <uartputc.part.0+0x39> 80105be2: 89 f2 mov %esi,%edx 80105be4: ec in (%dx),%al 80105be5: a8 20 test $0x20,%al 80105be7: 74 e7 je 80105bd0 <uartputc.part.0+0x20> asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80105be9: ba f8 03 00 00 mov $0x3f8,%edx 80105bee: 89 f8 mov %edi,%eax 80105bf0: ee out %al,(%dx) } 80105bf1: 8d 65 f4 lea -0xc(%ebp),%esp 80105bf4: 5b pop %ebx 80105bf5: 5e pop %esi 80105bf6: 5f pop %edi 80105bf7: 5d pop %ebp 80105bf8: c3 ret 80105bf9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105c00 <uartinit>: { 80105c00: 55 push %ebp 80105c01: 31 c9 xor %ecx,%ecx 80105c03: 89 c8 mov %ecx,%eax 80105c05: 89 e5 mov %esp,%ebp 80105c07: 57 push %edi 80105c08: 56 push %esi 80105c09: 53 push %ebx 80105c0a: bb fa 03 00 00 mov $0x3fa,%ebx 80105c0f: 89 da mov %ebx,%edx 80105c11: 83 ec 0c sub $0xc,%esp 80105c14: ee out %al,(%dx) 80105c15: bf fb 03 00 00 mov $0x3fb,%edi 80105c1a: b8 80 ff ff ff mov $0xffffff80,%eax 80105c1f: 89 fa mov %edi,%edx 80105c21: ee out %al,(%dx) 80105c22: b8 0c 00 00 00 mov $0xc,%eax 80105c27: ba f8 03 00 00 mov $0x3f8,%edx 80105c2c: ee out %al,(%dx) 80105c2d: be f9 03 00 00 mov $0x3f9,%esi 80105c32: 89 c8 mov %ecx,%eax 80105c34: 89 f2 mov %esi,%edx 80105c36: ee out %al,(%dx) 80105c37: b8 03 00 00 00 mov $0x3,%eax 80105c3c: 89 fa mov %edi,%edx 80105c3e: ee out %al,(%dx) 80105c3f: ba fc 03 00 00 mov $0x3fc,%edx 80105c44: 89 c8 mov %ecx,%eax 80105c46: ee out %al,(%dx) 80105c47: b8 01 00 00 00 mov $0x1,%eax 80105c4c: 89 f2 mov %esi,%edx 80105c4e: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80105c4f: ba fd 03 00 00 mov $0x3fd,%edx 80105c54: ec in (%dx),%al if(inb(COM1+5) == 0xFF) 80105c55: 3c ff cmp $0xff,%al 80105c57: 74 5a je 80105cb3 <uartinit+0xb3> uart = 1; 80105c59: c7 05 bc a5 10 80 01 movl $0x1,0x8010a5bc 80105c60: 00 00 00 80105c63: 89 da mov %ebx,%edx 80105c65: ec in (%dx),%al 80105c66: ba f8 03 00 00 mov $0x3f8,%edx 80105c6b: ec in (%dx),%al ioapicenable(IRQ_COM1, 0); 80105c6c: 83 ec 08 sub $0x8,%esp for(p="xv6...\n"; *p; p++) 80105c6f: bb a8 79 10 80 mov $0x801079a8,%ebx ioapicenable(IRQ_COM1, 0); 80105c74: 6a 00 push $0x0 80105c76: 6a 04 push $0x4 80105c78: e8 73 c7 ff ff call 801023f0 <ioapicenable> 80105c7d: 83 c4 10 add $0x10,%esp for(p="xv6...\n"; *p; p++) 80105c80: b8 78 00 00 00 mov $0x78,%eax 80105c85: eb 13 jmp 80105c9a <uartinit+0x9a> 80105c87: 89 f6 mov %esi,%esi 80105c89: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105c90: 83 c3 01 add $0x1,%ebx 80105c93: 0f be 03 movsbl (%ebx),%eax 80105c96: 84 c0 test %al,%al 80105c98: 74 19 je 80105cb3 <uartinit+0xb3> if(!uart) 80105c9a: 8b 15 bc a5 10 80 mov 0x8010a5bc,%edx 80105ca0: 85 d2 test %edx,%edx 80105ca2: 74 ec je 80105c90 <uartinit+0x90> for(p="xv6...\n"; *p; p++) 80105ca4: 83 c3 01 add $0x1,%ebx 80105ca7: e8 04 ff ff ff call 80105bb0 <uartputc.part.0> 80105cac: 0f be 03 movsbl (%ebx),%eax 80105caf: 84 c0 test %al,%al 80105cb1: 75 e7 jne 80105c9a <uartinit+0x9a> } 80105cb3: 8d 65 f4 lea -0xc(%ebp),%esp 80105cb6: 5b pop %ebx 80105cb7: 5e pop %esi 80105cb8: 5f pop %edi 80105cb9: 5d pop %ebp 80105cba: c3 ret 80105cbb: 90 nop 80105cbc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105cc0 <uartputc>: if(!uart) 80105cc0: 8b 15 bc a5 10 80 mov 0x8010a5bc,%edx { 80105cc6: 55 push %ebp 80105cc7: 89 e5 mov %esp,%ebp if(!uart) 80105cc9: 85 d2 test %edx,%edx { 80105ccb: 8b 45 08 mov 0x8(%ebp),%eax if(!uart) 80105cce: 74 10 je 80105ce0 <uartputc+0x20> } 80105cd0: 5d pop %ebp 80105cd1: e9 da fe ff ff jmp 80105bb0 <uartputc.part.0> 80105cd6: 8d 76 00 lea 0x0(%esi),%esi 80105cd9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105ce0: 5d pop %ebp 80105ce1: c3 ret 80105ce2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105ce9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105cf0 <uartintr>: void uartintr(void) { 80105cf0: 55 push %ebp 80105cf1: 89 e5 mov %esp,%ebp 80105cf3: 83 ec 14 sub $0x14,%esp consoleintr(uartgetc); 80105cf6: 68 80 5b 10 80 push $0x80105b80 80105cfb: e8 10 ab ff ff call 80100810 <consoleintr> } 80105d00: 83 c4 10 add $0x10,%esp 80105d03: c9 leave 80105d04: c3 ret 80105d05 <vector0>: # generated by vectors.pl - do not edit # handlers .globl alltraps .globl vector0 vector0: pushl $0 80105d05: 6a 00 push $0x0 pushl $0 80105d07: 6a 00 push $0x0 jmp alltraps 80105d09: e9 1c fb ff ff jmp 8010582a <alltraps> 80105d0e <vector1>: .globl vector1 vector1: pushl $0 80105d0e: 6a 00 push $0x0 pushl $1 80105d10: 6a 01 push $0x1 jmp alltraps 80105d12: e9 13 fb ff ff jmp 8010582a <alltraps> 80105d17 <vector2>: .globl vector2 vector2: pushl $0 80105d17: 6a 00 push $0x0 pushl $2 80105d19: 6a 02 push $0x2 jmp alltraps 80105d1b: e9 0a fb ff ff jmp 8010582a <alltraps> 80105d20 <vector3>: .globl vector3 vector3: pushl $0 80105d20: 6a 00 push $0x0 pushl $3 80105d22: 6a 03 push $0x3 jmp alltraps 80105d24: e9 01 fb ff ff jmp 8010582a <alltraps> 80105d29 <vector4>: .globl vector4 vector4: pushl $0 80105d29: 6a 00 push $0x0 pushl $4 80105d2b: 6a 04 push $0x4 jmp alltraps 80105d2d: e9 f8 fa ff ff jmp 8010582a <alltraps> 80105d32 <vector5>: .globl vector5 vector5: pushl $0 80105d32: 6a 00 push $0x0 pushl $5 80105d34: 6a 05 push $0x5 jmp alltraps 80105d36: e9 ef fa ff ff jmp 8010582a <alltraps> 80105d3b <vector6>: .globl vector6 vector6: pushl $0 80105d3b: 6a 00 push $0x0 pushl $6 80105d3d: 6a 06 push $0x6 jmp alltraps 80105d3f: e9 e6 fa ff ff jmp 8010582a <alltraps> 80105d44 <vector7>: .globl vector7 vector7: pushl $0 80105d44: 6a 00 push $0x0 pushl $7 80105d46: 6a 07 push $0x7 jmp alltraps 80105d48: e9 dd fa ff ff jmp 8010582a <alltraps> 80105d4d <vector8>: .globl vector8 vector8: pushl $8 80105d4d: 6a 08 push $0x8 jmp alltraps 80105d4f: e9 d6 fa ff ff jmp 8010582a <alltraps> 80105d54 <vector9>: .globl vector9 vector9: pushl $0 80105d54: 6a 00 push $0x0 pushl $9 80105d56: 6a 09 push $0x9 jmp alltraps 80105d58: e9 cd fa ff ff jmp 8010582a <alltraps> 80105d5d <vector10>: .globl vector10 vector10: pushl $10 80105d5d: 6a 0a push $0xa jmp alltraps 80105d5f: e9 c6 fa ff ff jmp 8010582a <alltraps> 80105d64 <vector11>: .globl vector11 vector11: pushl $11 80105d64: 6a 0b push $0xb jmp alltraps 80105d66: e9 bf fa ff ff jmp 8010582a <alltraps> 80105d6b <vector12>: .globl vector12 vector12: pushl $12 80105d6b: 6a 0c push $0xc jmp alltraps 80105d6d: e9 b8 fa ff ff jmp 8010582a <alltraps> 80105d72 <vector13>: .globl vector13 vector13: pushl $13 80105d72: 6a 0d push $0xd jmp alltraps 80105d74: e9 b1 fa ff ff jmp 8010582a <alltraps> 80105d79 <vector14>: .globl vector14 vector14: pushl $14 80105d79: 6a 0e push $0xe jmp alltraps 80105d7b: e9 aa fa ff ff jmp 8010582a <alltraps> 80105d80 <vector15>: .globl vector15 vector15: pushl $0 80105d80: 6a 00 push $0x0 pushl $15 80105d82: 6a 0f push $0xf jmp alltraps 80105d84: e9 a1 fa ff ff jmp 8010582a <alltraps> 80105d89 <vector16>: .globl vector16 vector16: pushl $0 80105d89: 6a 00 push $0x0 pushl $16 80105d8b: 6a 10 push $0x10 jmp alltraps 80105d8d: e9 98 fa ff ff jmp 8010582a <alltraps> 80105d92 <vector17>: .globl vector17 vector17: pushl $17 80105d92: 6a 11 push $0x11 jmp alltraps 80105d94: e9 91 fa ff ff jmp 8010582a <alltraps> 80105d99 <vector18>: .globl vector18 vector18: pushl $0 80105d99: 6a 00 push $0x0 pushl $18 80105d9b: 6a 12 push $0x12 jmp alltraps 80105d9d: e9 88 fa ff ff jmp 8010582a <alltraps> 80105da2 <vector19>: .globl vector19 vector19: pushl $0 80105da2: 6a 00 push $0x0 pushl $19 80105da4: 6a 13 push $0x13 jmp alltraps 80105da6: e9 7f fa ff ff jmp 8010582a <alltraps> 80105dab <vector20>: .globl vector20 vector20: pushl $0 80105dab: 6a 00 push $0x0 pushl $20 80105dad: 6a 14 push $0x14 jmp alltraps 80105daf: e9 76 fa ff ff jmp 8010582a <alltraps> 80105db4 <vector21>: .globl vector21 vector21: pushl $0 80105db4: 6a 00 push $0x0 pushl $21 80105db6: 6a 15 push $0x15 jmp alltraps 80105db8: e9 6d fa ff ff jmp 8010582a <alltraps> 80105dbd <vector22>: .globl vector22 vector22: pushl $0 80105dbd: 6a 00 push $0x0 pushl $22 80105dbf: 6a 16 push $0x16 jmp alltraps 80105dc1: e9 64 fa ff ff jmp 8010582a <alltraps> 80105dc6 <vector23>: .globl vector23 vector23: pushl $0 80105dc6: 6a 00 push $0x0 pushl $23 80105dc8: 6a 17 push $0x17 jmp alltraps 80105dca: e9 5b fa ff ff jmp 8010582a <alltraps> 80105dcf <vector24>: .globl vector24 vector24: pushl $0 80105dcf: 6a 00 push $0x0 pushl $24 80105dd1: 6a 18 push $0x18 jmp alltraps 80105dd3: e9 52 fa ff ff jmp 8010582a <alltraps> 80105dd8 <vector25>: .globl vector25 vector25: pushl $0 80105dd8: 6a 00 push $0x0 pushl $25 80105dda: 6a 19 push $0x19 jmp alltraps 80105ddc: e9 49 fa ff ff jmp 8010582a <alltraps> 80105de1 <vector26>: .globl vector26 vector26: pushl $0 80105de1: 6a 00 push $0x0 pushl $26 80105de3: 6a 1a push $0x1a jmp alltraps 80105de5: e9 40 fa ff ff jmp 8010582a <alltraps> 80105dea <vector27>: .globl vector27 vector27: pushl $0 80105dea: 6a 00 push $0x0 pushl $27 80105dec: 6a 1b push $0x1b jmp alltraps 80105dee: e9 37 fa ff ff jmp 8010582a <alltraps> 80105df3 <vector28>: .globl vector28 vector28: pushl $0 80105df3: 6a 00 push $0x0 pushl $28 80105df5: 6a 1c push $0x1c jmp alltraps 80105df7: e9 2e fa ff ff jmp 8010582a <alltraps> 80105dfc <vector29>: .globl vector29 vector29: pushl $0 80105dfc: 6a 00 push $0x0 pushl $29 80105dfe: 6a 1d push $0x1d jmp alltraps 80105e00: e9 25 fa ff ff jmp 8010582a <alltraps> 80105e05 <vector30>: .globl vector30 vector30: pushl $0 80105e05: 6a 00 push $0x0 pushl $30 80105e07: 6a 1e push $0x1e jmp alltraps 80105e09: e9 1c fa ff ff jmp 8010582a <alltraps> 80105e0e <vector31>: .globl vector31 vector31: pushl $0 80105e0e: 6a 00 push $0x0 pushl $31 80105e10: 6a 1f push $0x1f jmp alltraps 80105e12: e9 13 fa ff ff jmp 8010582a <alltraps> 80105e17 <vector32>: .globl vector32 vector32: pushl $0 80105e17: 6a 00 push $0x0 pushl $32 80105e19: 6a 20 push $0x20 jmp alltraps 80105e1b: e9 0a fa ff ff jmp 8010582a <alltraps> 80105e20 <vector33>: .globl vector33 vector33: pushl $0 80105e20: 6a 00 push $0x0 pushl $33 80105e22: 6a 21 push $0x21 jmp alltraps 80105e24: e9 01 fa ff ff jmp 8010582a <alltraps> 80105e29 <vector34>: .globl vector34 vector34: pushl $0 80105e29: 6a 00 push $0x0 pushl $34 80105e2b: 6a 22 push $0x22 jmp alltraps 80105e2d: e9 f8 f9 ff ff jmp 8010582a <alltraps> 80105e32 <vector35>: .globl vector35 vector35: pushl $0 80105e32: 6a 00 push $0x0 pushl $35 80105e34: 6a 23 push $0x23 jmp alltraps 80105e36: e9 ef f9 ff ff jmp 8010582a <alltraps> 80105e3b <vector36>: .globl vector36 vector36: pushl $0 80105e3b: 6a 00 push $0x0 pushl $36 80105e3d: 6a 24 push $0x24 jmp alltraps 80105e3f: e9 e6 f9 ff ff jmp 8010582a <alltraps> 80105e44 <vector37>: .globl vector37 vector37: pushl $0 80105e44: 6a 00 push $0x0 pushl $37 80105e46: 6a 25 push $0x25 jmp alltraps 80105e48: e9 dd f9 ff ff jmp 8010582a <alltraps> 80105e4d <vector38>: .globl vector38 vector38: pushl $0 80105e4d: 6a 00 push $0x0 pushl $38 80105e4f: 6a 26 push $0x26 jmp alltraps 80105e51: e9 d4 f9 ff ff jmp 8010582a <alltraps> 80105e56 <vector39>: .globl vector39 vector39: pushl $0 80105e56: 6a 00 push $0x0 pushl $39 80105e58: 6a 27 push $0x27 jmp alltraps 80105e5a: e9 cb f9 ff ff jmp 8010582a <alltraps> 80105e5f <vector40>: .globl vector40 vector40: pushl $0 80105e5f: 6a 00 push $0x0 pushl $40 80105e61: 6a 28 push $0x28 jmp alltraps 80105e63: e9 c2 f9 ff ff jmp 8010582a <alltraps> 80105e68 <vector41>: .globl vector41 vector41: pushl $0 80105e68: 6a 00 push $0x0 pushl $41 80105e6a: 6a 29 push $0x29 jmp alltraps 80105e6c: e9 b9 f9 ff ff jmp 8010582a <alltraps> 80105e71 <vector42>: .globl vector42 vector42: pushl $0 80105e71: 6a 00 push $0x0 pushl $42 80105e73: 6a 2a push $0x2a jmp alltraps 80105e75: e9 b0 f9 ff ff jmp 8010582a <alltraps> 80105e7a <vector43>: .globl vector43 vector43: pushl $0 80105e7a: 6a 00 push $0x0 pushl $43 80105e7c: 6a 2b push $0x2b jmp alltraps 80105e7e: e9 a7 f9 ff ff jmp 8010582a <alltraps> 80105e83 <vector44>: .globl vector44 vector44: pushl $0 80105e83: 6a 00 push $0x0 pushl $44 80105e85: 6a 2c push $0x2c jmp alltraps 80105e87: e9 9e f9 ff ff jmp 8010582a <alltraps> 80105e8c <vector45>: .globl vector45 vector45: pushl $0 80105e8c: 6a 00 push $0x0 pushl $45 80105e8e: 6a 2d push $0x2d jmp alltraps 80105e90: e9 95 f9 ff ff jmp 8010582a <alltraps> 80105e95 <vector46>: .globl vector46 vector46: pushl $0 80105e95: 6a 00 push $0x0 pushl $46 80105e97: 6a 2e push $0x2e jmp alltraps 80105e99: e9 8c f9 ff ff jmp 8010582a <alltraps> 80105e9e <vector47>: .globl vector47 vector47: pushl $0 80105e9e: 6a 00 push $0x0 pushl $47 80105ea0: 6a 2f push $0x2f jmp alltraps 80105ea2: e9 83 f9 ff ff jmp 8010582a <alltraps> 80105ea7 <vector48>: .globl vector48 vector48: pushl $0 80105ea7: 6a 00 push $0x0 pushl $48 80105ea9: 6a 30 push $0x30 jmp alltraps 80105eab: e9 7a f9 ff ff jmp 8010582a <alltraps> 80105eb0 <vector49>: .globl vector49 vector49: pushl $0 80105eb0: 6a 00 push $0x0 pushl $49 80105eb2: 6a 31 push $0x31 jmp alltraps 80105eb4: e9 71 f9 ff ff jmp 8010582a <alltraps> 80105eb9 <vector50>: .globl vector50 vector50: pushl $0 80105eb9: 6a 00 push $0x0 pushl $50 80105ebb: 6a 32 push $0x32 jmp alltraps 80105ebd: e9 68 f9 ff ff jmp 8010582a <alltraps> 80105ec2 <vector51>: .globl vector51 vector51: pushl $0 80105ec2: 6a 00 push $0x0 pushl $51 80105ec4: 6a 33 push $0x33 jmp alltraps 80105ec6: e9 5f f9 ff ff jmp 8010582a <alltraps> 80105ecb <vector52>: .globl vector52 vector52: pushl $0 80105ecb: 6a 00 push $0x0 pushl $52 80105ecd: 6a 34 push $0x34 jmp alltraps 80105ecf: e9 56 f9 ff ff jmp 8010582a <alltraps> 80105ed4 <vector53>: .globl vector53 vector53: pushl $0 80105ed4: 6a 00 push $0x0 pushl $53 80105ed6: 6a 35 push $0x35 jmp alltraps 80105ed8: e9 4d f9 ff ff jmp 8010582a <alltraps> 80105edd <vector54>: .globl vector54 vector54: pushl $0 80105edd: 6a 00 push $0x0 pushl $54 80105edf: 6a 36 push $0x36 jmp alltraps 80105ee1: e9 44 f9 ff ff jmp 8010582a <alltraps> 80105ee6 <vector55>: .globl vector55 vector55: pushl $0 80105ee6: 6a 00 push $0x0 pushl $55 80105ee8: 6a 37 push $0x37 jmp alltraps 80105eea: e9 3b f9 ff ff jmp 8010582a <alltraps> 80105eef <vector56>: .globl vector56 vector56: pushl $0 80105eef: 6a 00 push $0x0 pushl $56 80105ef1: 6a 38 push $0x38 jmp alltraps 80105ef3: e9 32 f9 ff ff jmp 8010582a <alltraps> 80105ef8 <vector57>: .globl vector57 vector57: pushl $0 80105ef8: 6a 00 push $0x0 pushl $57 80105efa: 6a 39 push $0x39 jmp alltraps 80105efc: e9 29 f9 ff ff jmp 8010582a <alltraps> 80105f01 <vector58>: .globl vector58 vector58: pushl $0 80105f01: 6a 00 push $0x0 pushl $58 80105f03: 6a 3a push $0x3a jmp alltraps 80105f05: e9 20 f9 ff ff jmp 8010582a <alltraps> 80105f0a <vector59>: .globl vector59 vector59: pushl $0 80105f0a: 6a 00 push $0x0 pushl $59 80105f0c: 6a 3b push $0x3b jmp alltraps 80105f0e: e9 17 f9 ff ff jmp 8010582a <alltraps> 80105f13 <vector60>: .globl vector60 vector60: pushl $0 80105f13: 6a 00 push $0x0 pushl $60 80105f15: 6a 3c push $0x3c jmp alltraps 80105f17: e9 0e f9 ff ff jmp 8010582a <alltraps> 80105f1c <vector61>: .globl vector61 vector61: pushl $0 80105f1c: 6a 00 push $0x0 pushl $61 80105f1e: 6a 3d push $0x3d jmp alltraps 80105f20: e9 05 f9 ff ff jmp 8010582a <alltraps> 80105f25 <vector62>: .globl vector62 vector62: pushl $0 80105f25: 6a 00 push $0x0 pushl $62 80105f27: 6a 3e push $0x3e jmp alltraps 80105f29: e9 fc f8 ff ff jmp 8010582a <alltraps> 80105f2e <vector63>: .globl vector63 vector63: pushl $0 80105f2e: 6a 00 push $0x0 pushl $63 80105f30: 6a 3f push $0x3f jmp alltraps 80105f32: e9 f3 f8 ff ff jmp 8010582a <alltraps> 80105f37 <vector64>: .globl vector64 vector64: pushl $0 80105f37: 6a 00 push $0x0 pushl $64 80105f39: 6a 40 push $0x40 jmp alltraps 80105f3b: e9 ea f8 ff ff jmp 8010582a <alltraps> 80105f40 <vector65>: .globl vector65 vector65: pushl $0 80105f40: 6a 00 push $0x0 pushl $65 80105f42: 6a 41 push $0x41 jmp alltraps 80105f44: e9 e1 f8 ff ff jmp 8010582a <alltraps> 80105f49 <vector66>: .globl vector66 vector66: pushl $0 80105f49: 6a 00 push $0x0 pushl $66 80105f4b: 6a 42 push $0x42 jmp alltraps 80105f4d: e9 d8 f8 ff ff jmp 8010582a <alltraps> 80105f52 <vector67>: .globl vector67 vector67: pushl $0 80105f52: 6a 00 push $0x0 pushl $67 80105f54: 6a 43 push $0x43 jmp alltraps 80105f56: e9 cf f8 ff ff jmp 8010582a <alltraps> 80105f5b <vector68>: .globl vector68 vector68: pushl $0 80105f5b: 6a 00 push $0x0 pushl $68 80105f5d: 6a 44 push $0x44 jmp alltraps 80105f5f: e9 c6 f8 ff ff jmp 8010582a <alltraps> 80105f64 <vector69>: .globl vector69 vector69: pushl $0 80105f64: 6a 00 push $0x0 pushl $69 80105f66: 6a 45 push $0x45 jmp alltraps 80105f68: e9 bd f8 ff ff jmp 8010582a <alltraps> 80105f6d <vector70>: .globl vector70 vector70: pushl $0 80105f6d: 6a 00 push $0x0 pushl $70 80105f6f: 6a 46 push $0x46 jmp alltraps 80105f71: e9 b4 f8 ff ff jmp 8010582a <alltraps> 80105f76 <vector71>: .globl vector71 vector71: pushl $0 80105f76: 6a 00 push $0x0 pushl $71 80105f78: 6a 47 push $0x47 jmp alltraps 80105f7a: e9 ab f8 ff ff jmp 8010582a <alltraps> 80105f7f <vector72>: .globl vector72 vector72: pushl $0 80105f7f: 6a 00 push $0x0 pushl $72 80105f81: 6a 48 push $0x48 jmp alltraps 80105f83: e9 a2 f8 ff ff jmp 8010582a <alltraps> 80105f88 <vector73>: .globl vector73 vector73: pushl $0 80105f88: 6a 00 push $0x0 pushl $73 80105f8a: 6a 49 push $0x49 jmp alltraps 80105f8c: e9 99 f8 ff ff jmp 8010582a <alltraps> 80105f91 <vector74>: .globl vector74 vector74: pushl $0 80105f91: 6a 00 push $0x0 pushl $74 80105f93: 6a 4a push $0x4a jmp alltraps 80105f95: e9 90 f8 ff ff jmp 8010582a <alltraps> 80105f9a <vector75>: .globl vector75 vector75: pushl $0 80105f9a: 6a 00 push $0x0 pushl $75 80105f9c: 6a 4b push $0x4b jmp alltraps 80105f9e: e9 87 f8 ff ff jmp 8010582a <alltraps> 80105fa3 <vector76>: .globl vector76 vector76: pushl $0 80105fa3: 6a 00 push $0x0 pushl $76 80105fa5: 6a 4c push $0x4c jmp alltraps 80105fa7: e9 7e f8 ff ff jmp 8010582a <alltraps> 80105fac <vector77>: .globl vector77 vector77: pushl $0 80105fac: 6a 00 push $0x0 pushl $77 80105fae: 6a 4d push $0x4d jmp alltraps 80105fb0: e9 75 f8 ff ff jmp 8010582a <alltraps> 80105fb5 <vector78>: .globl vector78 vector78: pushl $0 80105fb5: 6a 00 push $0x0 pushl $78 80105fb7: 6a 4e push $0x4e jmp alltraps 80105fb9: e9 6c f8 ff ff jmp 8010582a <alltraps> 80105fbe <vector79>: .globl vector79 vector79: pushl $0 80105fbe: 6a 00 push $0x0 pushl $79 80105fc0: 6a 4f push $0x4f jmp alltraps 80105fc2: e9 63 f8 ff ff jmp 8010582a <alltraps> 80105fc7 <vector80>: .globl vector80 vector80: pushl $0 80105fc7: 6a 00 push $0x0 pushl $80 80105fc9: 6a 50 push $0x50 jmp alltraps 80105fcb: e9 5a f8 ff ff jmp 8010582a <alltraps> 80105fd0 <vector81>: .globl vector81 vector81: pushl $0 80105fd0: 6a 00 push $0x0 pushl $81 80105fd2: 6a 51 push $0x51 jmp alltraps 80105fd4: e9 51 f8 ff ff jmp 8010582a <alltraps> 80105fd9 <vector82>: .globl vector82 vector82: pushl $0 80105fd9: 6a 00 push $0x0 pushl $82 80105fdb: 6a 52 push $0x52 jmp alltraps 80105fdd: e9 48 f8 ff ff jmp 8010582a <alltraps> 80105fe2 <vector83>: .globl vector83 vector83: pushl $0 80105fe2: 6a 00 push $0x0 pushl $83 80105fe4: 6a 53 push $0x53 jmp alltraps 80105fe6: e9 3f f8 ff ff jmp 8010582a <alltraps> 80105feb <vector84>: .globl vector84 vector84: pushl $0 80105feb: 6a 00 push $0x0 pushl $84 80105fed: 6a 54 push $0x54 jmp alltraps 80105fef: e9 36 f8 ff ff jmp 8010582a <alltraps> 80105ff4 <vector85>: .globl vector85 vector85: pushl $0 80105ff4: 6a 00 push $0x0 pushl $85 80105ff6: 6a 55 push $0x55 jmp alltraps 80105ff8: e9 2d f8 ff ff jmp 8010582a <alltraps> 80105ffd <vector86>: .globl vector86 vector86: pushl $0 80105ffd: 6a 00 push $0x0 pushl $86 80105fff: 6a 56 push $0x56 jmp alltraps 80106001: e9 24 f8 ff ff jmp 8010582a <alltraps> 80106006 <vector87>: .globl vector87 vector87: pushl $0 80106006: 6a 00 push $0x0 pushl $87 80106008: 6a 57 push $0x57 jmp alltraps 8010600a: e9 1b f8 ff ff jmp 8010582a <alltraps> 8010600f <vector88>: .globl vector88 vector88: pushl $0 8010600f: 6a 00 push $0x0 pushl $88 80106011: 6a 58 push $0x58 jmp alltraps 80106013: e9 12 f8 ff ff jmp 8010582a <alltraps> 80106018 <vector89>: .globl vector89 vector89: pushl $0 80106018: 6a 00 push $0x0 pushl $89 8010601a: 6a 59 push $0x59 jmp alltraps 8010601c: e9 09 f8 ff ff jmp 8010582a <alltraps> 80106021 <vector90>: .globl vector90 vector90: pushl $0 80106021: 6a 00 push $0x0 pushl $90 80106023: 6a 5a push $0x5a jmp alltraps 80106025: e9 00 f8 ff ff jmp 8010582a <alltraps> 8010602a <vector91>: .globl vector91 vector91: pushl $0 8010602a: 6a 00 push $0x0 pushl $91 8010602c: 6a 5b push $0x5b jmp alltraps 8010602e: e9 f7 f7 ff ff jmp 8010582a <alltraps> 80106033 <vector92>: .globl vector92 vector92: pushl $0 80106033: 6a 00 push $0x0 pushl $92 80106035: 6a 5c push $0x5c jmp alltraps 80106037: e9 ee f7 ff ff jmp 8010582a <alltraps> 8010603c <vector93>: .globl vector93 vector93: pushl $0 8010603c: 6a 00 push $0x0 pushl $93 8010603e: 6a 5d push $0x5d jmp alltraps 80106040: e9 e5 f7 ff ff jmp 8010582a <alltraps> 80106045 <vector94>: .globl vector94 vector94: pushl $0 80106045: 6a 00 push $0x0 pushl $94 80106047: 6a 5e push $0x5e jmp alltraps 80106049: e9 dc f7 ff ff jmp 8010582a <alltraps> 8010604e <vector95>: .globl vector95 vector95: pushl $0 8010604e: 6a 00 push $0x0 pushl $95 80106050: 6a 5f push $0x5f jmp alltraps 80106052: e9 d3 f7 ff ff jmp 8010582a <alltraps> 80106057 <vector96>: .globl vector96 vector96: pushl $0 80106057: 6a 00 push $0x0 pushl $96 80106059: 6a 60 push $0x60 jmp alltraps 8010605b: e9 ca f7 ff ff jmp 8010582a <alltraps> 80106060 <vector97>: .globl vector97 vector97: pushl $0 80106060: 6a 00 push $0x0 pushl $97 80106062: 6a 61 push $0x61 jmp alltraps 80106064: e9 c1 f7 ff ff jmp 8010582a <alltraps> 80106069 <vector98>: .globl vector98 vector98: pushl $0 80106069: 6a 00 push $0x0 pushl $98 8010606b: 6a 62 push $0x62 jmp alltraps 8010606d: e9 b8 f7 ff ff jmp 8010582a <alltraps> 80106072 <vector99>: .globl vector99 vector99: pushl $0 80106072: 6a 00 push $0x0 pushl $99 80106074: 6a 63 push $0x63 jmp alltraps 80106076: e9 af f7 ff ff jmp 8010582a <alltraps> 8010607b <vector100>: .globl vector100 vector100: pushl $0 8010607b: 6a 00 push $0x0 pushl $100 8010607d: 6a 64 push $0x64 jmp alltraps 8010607f: e9 a6 f7 ff ff jmp 8010582a <alltraps> 80106084 <vector101>: .globl vector101 vector101: pushl $0 80106084: 6a 00 push $0x0 pushl $101 80106086: 6a 65 push $0x65 jmp alltraps 80106088: e9 9d f7 ff ff jmp 8010582a <alltraps> 8010608d <vector102>: .globl vector102 vector102: pushl $0 8010608d: 6a 00 push $0x0 pushl $102 8010608f: 6a 66 push $0x66 jmp alltraps 80106091: e9 94 f7 ff ff jmp 8010582a <alltraps> 80106096 <vector103>: .globl vector103 vector103: pushl $0 80106096: 6a 00 push $0x0 pushl $103 80106098: 6a 67 push $0x67 jmp alltraps 8010609a: e9 8b f7 ff ff jmp 8010582a <alltraps> 8010609f <vector104>: .globl vector104 vector104: pushl $0 8010609f: 6a 00 push $0x0 pushl $104 801060a1: 6a 68 push $0x68 jmp alltraps 801060a3: e9 82 f7 ff ff jmp 8010582a <alltraps> 801060a8 <vector105>: .globl vector105 vector105: pushl $0 801060a8: 6a 00 push $0x0 pushl $105 801060aa: 6a 69 push $0x69 jmp alltraps 801060ac: e9 79 f7 ff ff jmp 8010582a <alltraps> 801060b1 <vector106>: .globl vector106 vector106: pushl $0 801060b1: 6a 00 push $0x0 pushl $106 801060b3: 6a 6a push $0x6a jmp alltraps 801060b5: e9 70 f7 ff ff jmp 8010582a <alltraps> 801060ba <vector107>: .globl vector107 vector107: pushl $0 801060ba: 6a 00 push $0x0 pushl $107 801060bc: 6a 6b push $0x6b jmp alltraps 801060be: e9 67 f7 ff ff jmp 8010582a <alltraps> 801060c3 <vector108>: .globl vector108 vector108: pushl $0 801060c3: 6a 00 push $0x0 pushl $108 801060c5: 6a 6c push $0x6c jmp alltraps 801060c7: e9 5e f7 ff ff jmp 8010582a <alltraps> 801060cc <vector109>: .globl vector109 vector109: pushl $0 801060cc: 6a 00 push $0x0 pushl $109 801060ce: 6a 6d push $0x6d jmp alltraps 801060d0: e9 55 f7 ff ff jmp 8010582a <alltraps> 801060d5 <vector110>: .globl vector110 vector110: pushl $0 801060d5: 6a 00 push $0x0 pushl $110 801060d7: 6a 6e push $0x6e jmp alltraps 801060d9: e9 4c f7 ff ff jmp 8010582a <alltraps> 801060de <vector111>: .globl vector111 vector111: pushl $0 801060de: 6a 00 push $0x0 pushl $111 801060e0: 6a 6f push $0x6f jmp alltraps 801060e2: e9 43 f7 ff ff jmp 8010582a <alltraps> 801060e7 <vector112>: .globl vector112 vector112: pushl $0 801060e7: 6a 00 push $0x0 pushl $112 801060e9: 6a 70 push $0x70 jmp alltraps 801060eb: e9 3a f7 ff ff jmp 8010582a <alltraps> 801060f0 <vector113>: .globl vector113 vector113: pushl $0 801060f0: 6a 00 push $0x0 pushl $113 801060f2: 6a 71 push $0x71 jmp alltraps 801060f4: e9 31 f7 ff ff jmp 8010582a <alltraps> 801060f9 <vector114>: .globl vector114 vector114: pushl $0 801060f9: 6a 00 push $0x0 pushl $114 801060fb: 6a 72 push $0x72 jmp alltraps 801060fd: e9 28 f7 ff ff jmp 8010582a <alltraps> 80106102 <vector115>: .globl vector115 vector115: pushl $0 80106102: 6a 00 push $0x0 pushl $115 80106104: 6a 73 push $0x73 jmp alltraps 80106106: e9 1f f7 ff ff jmp 8010582a <alltraps> 8010610b <vector116>: .globl vector116 vector116: pushl $0 8010610b: 6a 00 push $0x0 pushl $116 8010610d: 6a 74 push $0x74 jmp alltraps 8010610f: e9 16 f7 ff ff jmp 8010582a <alltraps> 80106114 <vector117>: .globl vector117 vector117: pushl $0 80106114: 6a 00 push $0x0 pushl $117 80106116: 6a 75 push $0x75 jmp alltraps 80106118: e9 0d f7 ff ff jmp 8010582a <alltraps> 8010611d <vector118>: .globl vector118 vector118: pushl $0 8010611d: 6a 00 push $0x0 pushl $118 8010611f: 6a 76 push $0x76 jmp alltraps 80106121: e9 04 f7 ff ff jmp 8010582a <alltraps> 80106126 <vector119>: .globl vector119 vector119: pushl $0 80106126: 6a 00 push $0x0 pushl $119 80106128: 6a 77 push $0x77 jmp alltraps 8010612a: e9 fb f6 ff ff jmp 8010582a <alltraps> 8010612f <vector120>: .globl vector120 vector120: pushl $0 8010612f: 6a 00 push $0x0 pushl $120 80106131: 6a 78 push $0x78 jmp alltraps 80106133: e9 f2 f6 ff ff jmp 8010582a <alltraps> 80106138 <vector121>: .globl vector121 vector121: pushl $0 80106138: 6a 00 push $0x0 pushl $121 8010613a: 6a 79 push $0x79 jmp alltraps 8010613c: e9 e9 f6 ff ff jmp 8010582a <alltraps> 80106141 <vector122>: .globl vector122 vector122: pushl $0 80106141: 6a 00 push $0x0 pushl $122 80106143: 6a 7a push $0x7a jmp alltraps 80106145: e9 e0 f6 ff ff jmp 8010582a <alltraps> 8010614a <vector123>: .globl vector123 vector123: pushl $0 8010614a: 6a 00 push $0x0 pushl $123 8010614c: 6a 7b push $0x7b jmp alltraps 8010614e: e9 d7 f6 ff ff jmp 8010582a <alltraps> 80106153 <vector124>: .globl vector124 vector124: pushl $0 80106153: 6a 00 push $0x0 pushl $124 80106155: 6a 7c push $0x7c jmp alltraps 80106157: e9 ce f6 ff ff jmp 8010582a <alltraps> 8010615c <vector125>: .globl vector125 vector125: pushl $0 8010615c: 6a 00 push $0x0 pushl $125 8010615e: 6a 7d push $0x7d jmp alltraps 80106160: e9 c5 f6 ff ff jmp 8010582a <alltraps> 80106165 <vector126>: .globl vector126 vector126: pushl $0 80106165: 6a 00 push $0x0 pushl $126 80106167: 6a 7e push $0x7e jmp alltraps 80106169: e9 bc f6 ff ff jmp 8010582a <alltraps> 8010616e <vector127>: .globl vector127 vector127: pushl $0 8010616e: 6a 00 push $0x0 pushl $127 80106170: 6a 7f push $0x7f jmp alltraps 80106172: e9 b3 f6 ff ff jmp 8010582a <alltraps> 80106177 <vector128>: .globl vector128 vector128: pushl $0 80106177: 6a 00 push $0x0 pushl $128 80106179: 68 80 00 00 00 push $0x80 jmp alltraps 8010617e: e9 a7 f6 ff ff jmp 8010582a <alltraps> 80106183 <vector129>: .globl vector129 vector129: pushl $0 80106183: 6a 00 push $0x0 pushl $129 80106185: 68 81 00 00 00 push $0x81 jmp alltraps 8010618a: e9 9b f6 ff ff jmp 8010582a <alltraps> 8010618f <vector130>: .globl vector130 vector130: pushl $0 8010618f: 6a 00 push $0x0 pushl $130 80106191: 68 82 00 00 00 push $0x82 jmp alltraps 80106196: e9 8f f6 ff ff jmp 8010582a <alltraps> 8010619b <vector131>: .globl vector131 vector131: pushl $0 8010619b: 6a 00 push $0x0 pushl $131 8010619d: 68 83 00 00 00 push $0x83 jmp alltraps 801061a2: e9 83 f6 ff ff jmp 8010582a <alltraps> 801061a7 <vector132>: .globl vector132 vector132: pushl $0 801061a7: 6a 00 push $0x0 pushl $132 801061a9: 68 84 00 00 00 push $0x84 jmp alltraps 801061ae: e9 77 f6 ff ff jmp 8010582a <alltraps> 801061b3 <vector133>: .globl vector133 vector133: pushl $0 801061b3: 6a 00 push $0x0 pushl $133 801061b5: 68 85 00 00 00 push $0x85 jmp alltraps 801061ba: e9 6b f6 ff ff jmp 8010582a <alltraps> 801061bf <vector134>: .globl vector134 vector134: pushl $0 801061bf: 6a 00 push $0x0 pushl $134 801061c1: 68 86 00 00 00 push $0x86 jmp alltraps 801061c6: e9 5f f6 ff ff jmp 8010582a <alltraps> 801061cb <vector135>: .globl vector135 vector135: pushl $0 801061cb: 6a 00 push $0x0 pushl $135 801061cd: 68 87 00 00 00 push $0x87 jmp alltraps 801061d2: e9 53 f6 ff ff jmp 8010582a <alltraps> 801061d7 <vector136>: .globl vector136 vector136: pushl $0 801061d7: 6a 00 push $0x0 pushl $136 801061d9: 68 88 00 00 00 push $0x88 jmp alltraps 801061de: e9 47 f6 ff ff jmp 8010582a <alltraps> 801061e3 <vector137>: .globl vector137 vector137: pushl $0 801061e3: 6a 00 push $0x0 pushl $137 801061e5: 68 89 00 00 00 push $0x89 jmp alltraps 801061ea: e9 3b f6 ff ff jmp 8010582a <alltraps> 801061ef <vector138>: .globl vector138 vector138: pushl $0 801061ef: 6a 00 push $0x0 pushl $138 801061f1: 68 8a 00 00 00 push $0x8a jmp alltraps 801061f6: e9 2f f6 ff ff jmp 8010582a <alltraps> 801061fb <vector139>: .globl vector139 vector139: pushl $0 801061fb: 6a 00 push $0x0 pushl $139 801061fd: 68 8b 00 00 00 push $0x8b jmp alltraps 80106202: e9 23 f6 ff ff jmp 8010582a <alltraps> 80106207 <vector140>: .globl vector140 vector140: pushl $0 80106207: 6a 00 push $0x0 pushl $140 80106209: 68 8c 00 00 00 push $0x8c jmp alltraps 8010620e: e9 17 f6 ff ff jmp 8010582a <alltraps> 80106213 <vector141>: .globl vector141 vector141: pushl $0 80106213: 6a 00 push $0x0 pushl $141 80106215: 68 8d 00 00 00 push $0x8d jmp alltraps 8010621a: e9 0b f6 ff ff jmp 8010582a <alltraps> 8010621f <vector142>: .globl vector142 vector142: pushl $0 8010621f: 6a 00 push $0x0 pushl $142 80106221: 68 8e 00 00 00 push $0x8e jmp alltraps 80106226: e9 ff f5 ff ff jmp 8010582a <alltraps> 8010622b <vector143>: .globl vector143 vector143: pushl $0 8010622b: 6a 00 push $0x0 pushl $143 8010622d: 68 8f 00 00 00 push $0x8f jmp alltraps 80106232: e9 f3 f5 ff ff jmp 8010582a <alltraps> 80106237 <vector144>: .globl vector144 vector144: pushl $0 80106237: 6a 00 push $0x0 pushl $144 80106239: 68 90 00 00 00 push $0x90 jmp alltraps 8010623e: e9 e7 f5 ff ff jmp 8010582a <alltraps> 80106243 <vector145>: .globl vector145 vector145: pushl $0 80106243: 6a 00 push $0x0 pushl $145 80106245: 68 91 00 00 00 push $0x91 jmp alltraps 8010624a: e9 db f5 ff ff jmp 8010582a <alltraps> 8010624f <vector146>: .globl vector146 vector146: pushl $0 8010624f: 6a 00 push $0x0 pushl $146 80106251: 68 92 00 00 00 push $0x92 jmp alltraps 80106256: e9 cf f5 ff ff jmp 8010582a <alltraps> 8010625b <vector147>: .globl vector147 vector147: pushl $0 8010625b: 6a 00 push $0x0 pushl $147 8010625d: 68 93 00 00 00 push $0x93 jmp alltraps 80106262: e9 c3 f5 ff ff jmp 8010582a <alltraps> 80106267 <vector148>: .globl vector148 vector148: pushl $0 80106267: 6a 00 push $0x0 pushl $148 80106269: 68 94 00 00 00 push $0x94 jmp alltraps 8010626e: e9 b7 f5 ff ff jmp 8010582a <alltraps> 80106273 <vector149>: .globl vector149 vector149: pushl $0 80106273: 6a 00 push $0x0 pushl $149 80106275: 68 95 00 00 00 push $0x95 jmp alltraps 8010627a: e9 ab f5 ff ff jmp 8010582a <alltraps> 8010627f <vector150>: .globl vector150 vector150: pushl $0 8010627f: 6a 00 push $0x0 pushl $150 80106281: 68 96 00 00 00 push $0x96 jmp alltraps 80106286: e9 9f f5 ff ff jmp 8010582a <alltraps> 8010628b <vector151>: .globl vector151 vector151: pushl $0 8010628b: 6a 00 push $0x0 pushl $151 8010628d: 68 97 00 00 00 push $0x97 jmp alltraps 80106292: e9 93 f5 ff ff jmp 8010582a <alltraps> 80106297 <vector152>: .globl vector152 vector152: pushl $0 80106297: 6a 00 push $0x0 pushl $152 80106299: 68 98 00 00 00 push $0x98 jmp alltraps 8010629e: e9 87 f5 ff ff jmp 8010582a <alltraps> 801062a3 <vector153>: .globl vector153 vector153: pushl $0 801062a3: 6a 00 push $0x0 pushl $153 801062a5: 68 99 00 00 00 push $0x99 jmp alltraps 801062aa: e9 7b f5 ff ff jmp 8010582a <alltraps> 801062af <vector154>: .globl vector154 vector154: pushl $0 801062af: 6a 00 push $0x0 pushl $154 801062b1: 68 9a 00 00 00 push $0x9a jmp alltraps 801062b6: e9 6f f5 ff ff jmp 8010582a <alltraps> 801062bb <vector155>: .globl vector155 vector155: pushl $0 801062bb: 6a 00 push $0x0 pushl $155 801062bd: 68 9b 00 00 00 push $0x9b jmp alltraps 801062c2: e9 63 f5 ff ff jmp 8010582a <alltraps> 801062c7 <vector156>: .globl vector156 vector156: pushl $0 801062c7: 6a 00 push $0x0 pushl $156 801062c9: 68 9c 00 00 00 push $0x9c jmp alltraps 801062ce: e9 57 f5 ff ff jmp 8010582a <alltraps> 801062d3 <vector157>: .globl vector157 vector157: pushl $0 801062d3: 6a 00 push $0x0 pushl $157 801062d5: 68 9d 00 00 00 push $0x9d jmp alltraps 801062da: e9 4b f5 ff ff jmp 8010582a <alltraps> 801062df <vector158>: .globl vector158 vector158: pushl $0 801062df: 6a 00 push $0x0 pushl $158 801062e1: 68 9e 00 00 00 push $0x9e jmp alltraps 801062e6: e9 3f f5 ff ff jmp 8010582a <alltraps> 801062eb <vector159>: .globl vector159 vector159: pushl $0 801062eb: 6a 00 push $0x0 pushl $159 801062ed: 68 9f 00 00 00 push $0x9f jmp alltraps 801062f2: e9 33 f5 ff ff jmp 8010582a <alltraps> 801062f7 <vector160>: .globl vector160 vector160: pushl $0 801062f7: 6a 00 push $0x0 pushl $160 801062f9: 68 a0 00 00 00 push $0xa0 jmp alltraps 801062fe: e9 27 f5 ff ff jmp 8010582a <alltraps> 80106303 <vector161>: .globl vector161 vector161: pushl $0 80106303: 6a 00 push $0x0 pushl $161 80106305: 68 a1 00 00 00 push $0xa1 jmp alltraps 8010630a: e9 1b f5 ff ff jmp 8010582a <alltraps> 8010630f <vector162>: .globl vector162 vector162: pushl $0 8010630f: 6a 00 push $0x0 pushl $162 80106311: 68 a2 00 00 00 push $0xa2 jmp alltraps 80106316: e9 0f f5 ff ff jmp 8010582a <alltraps> 8010631b <vector163>: .globl vector163 vector163: pushl $0 8010631b: 6a 00 push $0x0 pushl $163 8010631d: 68 a3 00 00 00 push $0xa3 jmp alltraps 80106322: e9 03 f5 ff ff jmp 8010582a <alltraps> 80106327 <vector164>: .globl vector164 vector164: pushl $0 80106327: 6a 00 push $0x0 pushl $164 80106329: 68 a4 00 00 00 push $0xa4 jmp alltraps 8010632e: e9 f7 f4 ff ff jmp 8010582a <alltraps> 80106333 <vector165>: .globl vector165 vector165: pushl $0 80106333: 6a 00 push $0x0 pushl $165 80106335: 68 a5 00 00 00 push $0xa5 jmp alltraps 8010633a: e9 eb f4 ff ff jmp 8010582a <alltraps> 8010633f <vector166>: .globl vector166 vector166: pushl $0 8010633f: 6a 00 push $0x0 pushl $166 80106341: 68 a6 00 00 00 push $0xa6 jmp alltraps 80106346: e9 df f4 ff ff jmp 8010582a <alltraps> 8010634b <vector167>: .globl vector167 vector167: pushl $0 8010634b: 6a 00 push $0x0 pushl $167 8010634d: 68 a7 00 00 00 push $0xa7 jmp alltraps 80106352: e9 d3 f4 ff ff jmp 8010582a <alltraps> 80106357 <vector168>: .globl vector168 vector168: pushl $0 80106357: 6a 00 push $0x0 pushl $168 80106359: 68 a8 00 00 00 push $0xa8 jmp alltraps 8010635e: e9 c7 f4 ff ff jmp 8010582a <alltraps> 80106363 <vector169>: .globl vector169 vector169: pushl $0 80106363: 6a 00 push $0x0 pushl $169 80106365: 68 a9 00 00 00 push $0xa9 jmp alltraps 8010636a: e9 bb f4 ff ff jmp 8010582a <alltraps> 8010636f <vector170>: .globl vector170 vector170: pushl $0 8010636f: 6a 00 push $0x0 pushl $170 80106371: 68 aa 00 00 00 push $0xaa jmp alltraps 80106376: e9 af f4 ff ff jmp 8010582a <alltraps> 8010637b <vector171>: .globl vector171 vector171: pushl $0 8010637b: 6a 00 push $0x0 pushl $171 8010637d: 68 ab 00 00 00 push $0xab jmp alltraps 80106382: e9 a3 f4 ff ff jmp 8010582a <alltraps> 80106387 <vector172>: .globl vector172 vector172: pushl $0 80106387: 6a 00 push $0x0 pushl $172 80106389: 68 ac 00 00 00 push $0xac jmp alltraps 8010638e: e9 97 f4 ff ff jmp 8010582a <alltraps> 80106393 <vector173>: .globl vector173 vector173: pushl $0 80106393: 6a 00 push $0x0 pushl $173 80106395: 68 ad 00 00 00 push $0xad jmp alltraps 8010639a: e9 8b f4 ff ff jmp 8010582a <alltraps> 8010639f <vector174>: .globl vector174 vector174: pushl $0 8010639f: 6a 00 push $0x0 pushl $174 801063a1: 68 ae 00 00 00 push $0xae jmp alltraps 801063a6: e9 7f f4 ff ff jmp 8010582a <alltraps> 801063ab <vector175>: .globl vector175 vector175: pushl $0 801063ab: 6a 00 push $0x0 pushl $175 801063ad: 68 af 00 00 00 push $0xaf jmp alltraps 801063b2: e9 73 f4 ff ff jmp 8010582a <alltraps> 801063b7 <vector176>: .globl vector176 vector176: pushl $0 801063b7: 6a 00 push $0x0 pushl $176 801063b9: 68 b0 00 00 00 push $0xb0 jmp alltraps 801063be: e9 67 f4 ff ff jmp 8010582a <alltraps> 801063c3 <vector177>: .globl vector177 vector177: pushl $0 801063c3: 6a 00 push $0x0 pushl $177 801063c5: 68 b1 00 00 00 push $0xb1 jmp alltraps 801063ca: e9 5b f4 ff ff jmp 8010582a <alltraps> 801063cf <vector178>: .globl vector178 vector178: pushl $0 801063cf: 6a 00 push $0x0 pushl $178 801063d1: 68 b2 00 00 00 push $0xb2 jmp alltraps 801063d6: e9 4f f4 ff ff jmp 8010582a <alltraps> 801063db <vector179>: .globl vector179 vector179: pushl $0 801063db: 6a 00 push $0x0 pushl $179 801063dd: 68 b3 00 00 00 push $0xb3 jmp alltraps 801063e2: e9 43 f4 ff ff jmp 8010582a <alltraps> 801063e7 <vector180>: .globl vector180 vector180: pushl $0 801063e7: 6a 00 push $0x0 pushl $180 801063e9: 68 b4 00 00 00 push $0xb4 jmp alltraps 801063ee: e9 37 f4 ff ff jmp 8010582a <alltraps> 801063f3 <vector181>: .globl vector181 vector181: pushl $0 801063f3: 6a 00 push $0x0 pushl $181 801063f5: 68 b5 00 00 00 push $0xb5 jmp alltraps 801063fa: e9 2b f4 ff ff jmp 8010582a <alltraps> 801063ff <vector182>: .globl vector182 vector182: pushl $0 801063ff: 6a 00 push $0x0 pushl $182 80106401: 68 b6 00 00 00 push $0xb6 jmp alltraps 80106406: e9 1f f4 ff ff jmp 8010582a <alltraps> 8010640b <vector183>: .globl vector183 vector183: pushl $0 8010640b: 6a 00 push $0x0 pushl $183 8010640d: 68 b7 00 00 00 push $0xb7 jmp alltraps 80106412: e9 13 f4 ff ff jmp 8010582a <alltraps> 80106417 <vector184>: .globl vector184 vector184: pushl $0 80106417: 6a 00 push $0x0 pushl $184 80106419: 68 b8 00 00 00 push $0xb8 jmp alltraps 8010641e: e9 07 f4 ff ff jmp 8010582a <alltraps> 80106423 <vector185>: .globl vector185 vector185: pushl $0 80106423: 6a 00 push $0x0 pushl $185 80106425: 68 b9 00 00 00 push $0xb9 jmp alltraps 8010642a: e9 fb f3 ff ff jmp 8010582a <alltraps> 8010642f <vector186>: .globl vector186 vector186: pushl $0 8010642f: 6a 00 push $0x0 pushl $186 80106431: 68 ba 00 00 00 push $0xba jmp alltraps 80106436: e9 ef f3 ff ff jmp 8010582a <alltraps> 8010643b <vector187>: .globl vector187 vector187: pushl $0 8010643b: 6a 00 push $0x0 pushl $187 8010643d: 68 bb 00 00 00 push $0xbb jmp alltraps 80106442: e9 e3 f3 ff ff jmp 8010582a <alltraps> 80106447 <vector188>: .globl vector188 vector188: pushl $0 80106447: 6a 00 push $0x0 pushl $188 80106449: 68 bc 00 00 00 push $0xbc jmp alltraps 8010644e: e9 d7 f3 ff ff jmp 8010582a <alltraps> 80106453 <vector189>: .globl vector189 vector189: pushl $0 80106453: 6a 00 push $0x0 pushl $189 80106455: 68 bd 00 00 00 push $0xbd jmp alltraps 8010645a: e9 cb f3 ff ff jmp 8010582a <alltraps> 8010645f <vector190>: .globl vector190 vector190: pushl $0 8010645f: 6a 00 push $0x0 pushl $190 80106461: 68 be 00 00 00 push $0xbe jmp alltraps 80106466: e9 bf f3 ff ff jmp 8010582a <alltraps> 8010646b <vector191>: .globl vector191 vector191: pushl $0 8010646b: 6a 00 push $0x0 pushl $191 8010646d: 68 bf 00 00 00 push $0xbf jmp alltraps 80106472: e9 b3 f3 ff ff jmp 8010582a <alltraps> 80106477 <vector192>: .globl vector192 vector192: pushl $0 80106477: 6a 00 push $0x0 pushl $192 80106479: 68 c0 00 00 00 push $0xc0 jmp alltraps 8010647e: e9 a7 f3 ff ff jmp 8010582a <alltraps> 80106483 <vector193>: .globl vector193 vector193: pushl $0 80106483: 6a 00 push $0x0 pushl $193 80106485: 68 c1 00 00 00 push $0xc1 jmp alltraps 8010648a: e9 9b f3 ff ff jmp 8010582a <alltraps> 8010648f <vector194>: .globl vector194 vector194: pushl $0 8010648f: 6a 00 push $0x0 pushl $194 80106491: 68 c2 00 00 00 push $0xc2 jmp alltraps 80106496: e9 8f f3 ff ff jmp 8010582a <alltraps> 8010649b <vector195>: .globl vector195 vector195: pushl $0 8010649b: 6a 00 push $0x0 pushl $195 8010649d: 68 c3 00 00 00 push $0xc3 jmp alltraps 801064a2: e9 83 f3 ff ff jmp 8010582a <alltraps> 801064a7 <vector196>: .globl vector196 vector196: pushl $0 801064a7: 6a 00 push $0x0 pushl $196 801064a9: 68 c4 00 00 00 push $0xc4 jmp alltraps 801064ae: e9 77 f3 ff ff jmp 8010582a <alltraps> 801064b3 <vector197>: .globl vector197 vector197: pushl $0 801064b3: 6a 00 push $0x0 pushl $197 801064b5: 68 c5 00 00 00 push $0xc5 jmp alltraps 801064ba: e9 6b f3 ff ff jmp 8010582a <alltraps> 801064bf <vector198>: .globl vector198 vector198: pushl $0 801064bf: 6a 00 push $0x0 pushl $198 801064c1: 68 c6 00 00 00 push $0xc6 jmp alltraps 801064c6: e9 5f f3 ff ff jmp 8010582a <alltraps> 801064cb <vector199>: .globl vector199 vector199: pushl $0 801064cb: 6a 00 push $0x0 pushl $199 801064cd: 68 c7 00 00 00 push $0xc7 jmp alltraps 801064d2: e9 53 f3 ff ff jmp 8010582a <alltraps> 801064d7 <vector200>: .globl vector200 vector200: pushl $0 801064d7: 6a 00 push $0x0 pushl $200 801064d9: 68 c8 00 00 00 push $0xc8 jmp alltraps 801064de: e9 47 f3 ff ff jmp 8010582a <alltraps> 801064e3 <vector201>: .globl vector201 vector201: pushl $0 801064e3: 6a 00 push $0x0 pushl $201 801064e5: 68 c9 00 00 00 push $0xc9 jmp alltraps 801064ea: e9 3b f3 ff ff jmp 8010582a <alltraps> 801064ef <vector202>: .globl vector202 vector202: pushl $0 801064ef: 6a 00 push $0x0 pushl $202 801064f1: 68 ca 00 00 00 push $0xca jmp alltraps 801064f6: e9 2f f3 ff ff jmp 8010582a <alltraps> 801064fb <vector203>: .globl vector203 vector203: pushl $0 801064fb: 6a 00 push $0x0 pushl $203 801064fd: 68 cb 00 00 00 push $0xcb jmp alltraps 80106502: e9 23 f3 ff ff jmp 8010582a <alltraps> 80106507 <vector204>: .globl vector204 vector204: pushl $0 80106507: 6a 00 push $0x0 pushl $204 80106509: 68 cc 00 00 00 push $0xcc jmp alltraps 8010650e: e9 17 f3 ff ff jmp 8010582a <alltraps> 80106513 <vector205>: .globl vector205 vector205: pushl $0 80106513: 6a 00 push $0x0 pushl $205 80106515: 68 cd 00 00 00 push $0xcd jmp alltraps 8010651a: e9 0b f3 ff ff jmp 8010582a <alltraps> 8010651f <vector206>: .globl vector206 vector206: pushl $0 8010651f: 6a 00 push $0x0 pushl $206 80106521: 68 ce 00 00 00 push $0xce jmp alltraps 80106526: e9 ff f2 ff ff jmp 8010582a <alltraps> 8010652b <vector207>: .globl vector207 vector207: pushl $0 8010652b: 6a 00 push $0x0 pushl $207 8010652d: 68 cf 00 00 00 push $0xcf jmp alltraps 80106532: e9 f3 f2 ff ff jmp 8010582a <alltraps> 80106537 <vector208>: .globl vector208 vector208: pushl $0 80106537: 6a 00 push $0x0 pushl $208 80106539: 68 d0 00 00 00 push $0xd0 jmp alltraps 8010653e: e9 e7 f2 ff ff jmp 8010582a <alltraps> 80106543 <vector209>: .globl vector209 vector209: pushl $0 80106543: 6a 00 push $0x0 pushl $209 80106545: 68 d1 00 00 00 push $0xd1 jmp alltraps 8010654a: e9 db f2 ff ff jmp 8010582a <alltraps> 8010654f <vector210>: .globl vector210 vector210: pushl $0 8010654f: 6a 00 push $0x0 pushl $210 80106551: 68 d2 00 00 00 push $0xd2 jmp alltraps 80106556: e9 cf f2 ff ff jmp 8010582a <alltraps> 8010655b <vector211>: .globl vector211 vector211: pushl $0 8010655b: 6a 00 push $0x0 pushl $211 8010655d: 68 d3 00 00 00 push $0xd3 jmp alltraps 80106562: e9 c3 f2 ff ff jmp 8010582a <alltraps> 80106567 <vector212>: .globl vector212 vector212: pushl $0 80106567: 6a 00 push $0x0 pushl $212 80106569: 68 d4 00 00 00 push $0xd4 jmp alltraps 8010656e: e9 b7 f2 ff ff jmp 8010582a <alltraps> 80106573 <vector213>: .globl vector213 vector213: pushl $0 80106573: 6a 00 push $0x0 pushl $213 80106575: 68 d5 00 00 00 push $0xd5 jmp alltraps 8010657a: e9 ab f2 ff ff jmp 8010582a <alltraps> 8010657f <vector214>: .globl vector214 vector214: pushl $0 8010657f: 6a 00 push $0x0 pushl $214 80106581: 68 d6 00 00 00 push $0xd6 jmp alltraps 80106586: e9 9f f2 ff ff jmp 8010582a <alltraps> 8010658b <vector215>: .globl vector215 vector215: pushl $0 8010658b: 6a 00 push $0x0 pushl $215 8010658d: 68 d7 00 00 00 push $0xd7 jmp alltraps 80106592: e9 93 f2 ff ff jmp 8010582a <alltraps> 80106597 <vector216>: .globl vector216 vector216: pushl $0 80106597: 6a 00 push $0x0 pushl $216 80106599: 68 d8 00 00 00 push $0xd8 jmp alltraps 8010659e: e9 87 f2 ff ff jmp 8010582a <alltraps> 801065a3 <vector217>: .globl vector217 vector217: pushl $0 801065a3: 6a 00 push $0x0 pushl $217 801065a5: 68 d9 00 00 00 push $0xd9 jmp alltraps 801065aa: e9 7b f2 ff ff jmp 8010582a <alltraps> 801065af <vector218>: .globl vector218 vector218: pushl $0 801065af: 6a 00 push $0x0 pushl $218 801065b1: 68 da 00 00 00 push $0xda jmp alltraps 801065b6: e9 6f f2 ff ff jmp 8010582a <alltraps> 801065bb <vector219>: .globl vector219 vector219: pushl $0 801065bb: 6a 00 push $0x0 pushl $219 801065bd: 68 db 00 00 00 push $0xdb jmp alltraps 801065c2: e9 63 f2 ff ff jmp 8010582a <alltraps> 801065c7 <vector220>: .globl vector220 vector220: pushl $0 801065c7: 6a 00 push $0x0 pushl $220 801065c9: 68 dc 00 00 00 push $0xdc jmp alltraps 801065ce: e9 57 f2 ff ff jmp 8010582a <alltraps> 801065d3 <vector221>: .globl vector221 vector221: pushl $0 801065d3: 6a 00 push $0x0 pushl $221 801065d5: 68 dd 00 00 00 push $0xdd jmp alltraps 801065da: e9 4b f2 ff ff jmp 8010582a <alltraps> 801065df <vector222>: .globl vector222 vector222: pushl $0 801065df: 6a 00 push $0x0 pushl $222 801065e1: 68 de 00 00 00 push $0xde jmp alltraps 801065e6: e9 3f f2 ff ff jmp 8010582a <alltraps> 801065eb <vector223>: .globl vector223 vector223: pushl $0 801065eb: 6a 00 push $0x0 pushl $223 801065ed: 68 df 00 00 00 push $0xdf jmp alltraps 801065f2: e9 33 f2 ff ff jmp 8010582a <alltraps> 801065f7 <vector224>: .globl vector224 vector224: pushl $0 801065f7: 6a 00 push $0x0 pushl $224 801065f9: 68 e0 00 00 00 push $0xe0 jmp alltraps 801065fe: e9 27 f2 ff ff jmp 8010582a <alltraps> 80106603 <vector225>: .globl vector225 vector225: pushl $0 80106603: 6a 00 push $0x0 pushl $225 80106605: 68 e1 00 00 00 push $0xe1 jmp alltraps 8010660a: e9 1b f2 ff ff jmp 8010582a <alltraps> 8010660f <vector226>: .globl vector226 vector226: pushl $0 8010660f: 6a 00 push $0x0 pushl $226 80106611: 68 e2 00 00 00 push $0xe2 jmp alltraps 80106616: e9 0f f2 ff ff jmp 8010582a <alltraps> 8010661b <vector227>: .globl vector227 vector227: pushl $0 8010661b: 6a 00 push $0x0 pushl $227 8010661d: 68 e3 00 00 00 push $0xe3 jmp alltraps 80106622: e9 03 f2 ff ff jmp 8010582a <alltraps> 80106627 <vector228>: .globl vector228 vector228: pushl $0 80106627: 6a 00 push $0x0 pushl $228 80106629: 68 e4 00 00 00 push $0xe4 jmp alltraps 8010662e: e9 f7 f1 ff ff jmp 8010582a <alltraps> 80106633 <vector229>: .globl vector229 vector229: pushl $0 80106633: 6a 00 push $0x0 pushl $229 80106635: 68 e5 00 00 00 push $0xe5 jmp alltraps 8010663a: e9 eb f1 ff ff jmp 8010582a <alltraps> 8010663f <vector230>: .globl vector230 vector230: pushl $0 8010663f: 6a 00 push $0x0 pushl $230 80106641: 68 e6 00 00 00 push $0xe6 jmp alltraps 80106646: e9 df f1 ff ff jmp 8010582a <alltraps> 8010664b <vector231>: .globl vector231 vector231: pushl $0 8010664b: 6a 00 push $0x0 pushl $231 8010664d: 68 e7 00 00 00 push $0xe7 jmp alltraps 80106652: e9 d3 f1 ff ff jmp 8010582a <alltraps> 80106657 <vector232>: .globl vector232 vector232: pushl $0 80106657: 6a 00 push $0x0 pushl $232 80106659: 68 e8 00 00 00 push $0xe8 jmp alltraps 8010665e: e9 c7 f1 ff ff jmp 8010582a <alltraps> 80106663 <vector233>: .globl vector233 vector233: pushl $0 80106663: 6a 00 push $0x0 pushl $233 80106665: 68 e9 00 00 00 push $0xe9 jmp alltraps 8010666a: e9 bb f1 ff ff jmp 8010582a <alltraps> 8010666f <vector234>: .globl vector234 vector234: pushl $0 8010666f: 6a 00 push $0x0 pushl $234 80106671: 68 ea 00 00 00 push $0xea jmp alltraps 80106676: e9 af f1 ff ff jmp 8010582a <alltraps> 8010667b <vector235>: .globl vector235 vector235: pushl $0 8010667b: 6a 00 push $0x0 pushl $235 8010667d: 68 eb 00 00 00 push $0xeb jmp alltraps 80106682: e9 a3 f1 ff ff jmp 8010582a <alltraps> 80106687 <vector236>: .globl vector236 vector236: pushl $0 80106687: 6a 00 push $0x0 pushl $236 80106689: 68 ec 00 00 00 push $0xec jmp alltraps 8010668e: e9 97 f1 ff ff jmp 8010582a <alltraps> 80106693 <vector237>: .globl vector237 vector237: pushl $0 80106693: 6a 00 push $0x0 pushl $237 80106695: 68 ed 00 00 00 push $0xed jmp alltraps 8010669a: e9 8b f1 ff ff jmp 8010582a <alltraps> 8010669f <vector238>: .globl vector238 vector238: pushl $0 8010669f: 6a 00 push $0x0 pushl $238 801066a1: 68 ee 00 00 00 push $0xee jmp alltraps 801066a6: e9 7f f1 ff ff jmp 8010582a <alltraps> 801066ab <vector239>: .globl vector239 vector239: pushl $0 801066ab: 6a 00 push $0x0 pushl $239 801066ad: 68 ef 00 00 00 push $0xef jmp alltraps 801066b2: e9 73 f1 ff ff jmp 8010582a <alltraps> 801066b7 <vector240>: .globl vector240 vector240: pushl $0 801066b7: 6a 00 push $0x0 pushl $240 801066b9: 68 f0 00 00 00 push $0xf0 jmp alltraps 801066be: e9 67 f1 ff ff jmp 8010582a <alltraps> 801066c3 <vector241>: .globl vector241 vector241: pushl $0 801066c3: 6a 00 push $0x0 pushl $241 801066c5: 68 f1 00 00 00 push $0xf1 jmp alltraps 801066ca: e9 5b f1 ff ff jmp 8010582a <alltraps> 801066cf <vector242>: .globl vector242 vector242: pushl $0 801066cf: 6a 00 push $0x0 pushl $242 801066d1: 68 f2 00 00 00 push $0xf2 jmp alltraps 801066d6: e9 4f f1 ff ff jmp 8010582a <alltraps> 801066db <vector243>: .globl vector243 vector243: pushl $0 801066db: 6a 00 push $0x0 pushl $243 801066dd: 68 f3 00 00 00 push $0xf3 jmp alltraps 801066e2: e9 43 f1 ff ff jmp 8010582a <alltraps> 801066e7 <vector244>: .globl vector244 vector244: pushl $0 801066e7: 6a 00 push $0x0 pushl $244 801066e9: 68 f4 00 00 00 push $0xf4 jmp alltraps 801066ee: e9 37 f1 ff ff jmp 8010582a <alltraps> 801066f3 <vector245>: .globl vector245 vector245: pushl $0 801066f3: 6a 00 push $0x0 pushl $245 801066f5: 68 f5 00 00 00 push $0xf5 jmp alltraps 801066fa: e9 2b f1 ff ff jmp 8010582a <alltraps> 801066ff <vector246>: .globl vector246 vector246: pushl $0 801066ff: 6a 00 push $0x0 pushl $246 80106701: 68 f6 00 00 00 push $0xf6 jmp alltraps 80106706: e9 1f f1 ff ff jmp 8010582a <alltraps> 8010670b <vector247>: .globl vector247 vector247: pushl $0 8010670b: 6a 00 push $0x0 pushl $247 8010670d: 68 f7 00 00 00 push $0xf7 jmp alltraps 80106712: e9 13 f1 ff ff jmp 8010582a <alltraps> 80106717 <vector248>: .globl vector248 vector248: pushl $0 80106717: 6a 00 push $0x0 pushl $248 80106719: 68 f8 00 00 00 push $0xf8 jmp alltraps 8010671e: e9 07 f1 ff ff jmp 8010582a <alltraps> 80106723 <vector249>: .globl vector249 vector249: pushl $0 80106723: 6a 00 push $0x0 pushl $249 80106725: 68 f9 00 00 00 push $0xf9 jmp alltraps 8010672a: e9 fb f0 ff ff jmp 8010582a <alltraps> 8010672f <vector250>: .globl vector250 vector250: pushl $0 8010672f: 6a 00 push $0x0 pushl $250 80106731: 68 fa 00 00 00 push $0xfa jmp alltraps 80106736: e9 ef f0 ff ff jmp 8010582a <alltraps> 8010673b <vector251>: .globl vector251 vector251: pushl $0 8010673b: 6a 00 push $0x0 pushl $251 8010673d: 68 fb 00 00 00 push $0xfb jmp alltraps 80106742: e9 e3 f0 ff ff jmp 8010582a <alltraps> 80106747 <vector252>: .globl vector252 vector252: pushl $0 80106747: 6a 00 push $0x0 pushl $252 80106749: 68 fc 00 00 00 push $0xfc jmp alltraps 8010674e: e9 d7 f0 ff ff jmp 8010582a <alltraps> 80106753 <vector253>: .globl vector253 vector253: pushl $0 80106753: 6a 00 push $0x0 pushl $253 80106755: 68 fd 00 00 00 push $0xfd jmp alltraps 8010675a: e9 cb f0 ff ff jmp 8010582a <alltraps> 8010675f <vector254>: .globl vector254 vector254: pushl $0 8010675f: 6a 00 push $0x0 pushl $254 80106761: 68 fe 00 00 00 push $0xfe jmp alltraps 80106766: e9 bf f0 ff ff jmp 8010582a <alltraps> 8010676b <vector255>: .globl vector255 vector255: pushl $0 8010676b: 6a 00 push $0x0 pushl $255 8010676d: 68 ff 00 00 00 push $0xff jmp alltraps 80106772: e9 b3 f0 ff ff jmp 8010582a <alltraps> 80106777: 66 90 xchg %ax,%ax 80106779: 66 90 xchg %ax,%ax 8010677b: 66 90 xchg %ax,%ax 8010677d: 66 90 xchg %ax,%ax 8010677f: 90 nop 80106780 <walkpgdir>: // Return the address of the PTE in page table pgdir // that corresponds to virtual address va. If alloc!=0, // create any required page table pages. static pte_t * walkpgdir(pde_t *pgdir, const void *va, int alloc) { 80106780: 55 push %ebp 80106781: 89 e5 mov %esp,%ebp 80106783: 57 push %edi 80106784: 56 push %esi 80106785: 53 push %ebx pde_t *pde; pte_t *pgtab; pde = &pgdir[PDX(va)]; 80106786: 89 d3 mov %edx,%ebx { 80106788: 89 d7 mov %edx,%edi pde = &pgdir[PDX(va)]; 8010678a: c1 eb 16 shr $0x16,%ebx 8010678d: 8d 34 98 lea (%eax,%ebx,4),%esi { 80106790: 83 ec 0c sub $0xc,%esp if(*pde & PTE_P){ 80106793: 8b 06 mov (%esi),%eax 80106795: a8 01 test $0x1,%al 80106797: 74 27 je 801067c0 <walkpgdir+0x40> pgtab = (pte_t*)P2V(PTE_ADDR(*pde)); 80106799: 25 00 f0 ff ff and $0xfffff000,%eax 8010679e: 8d 98 00 00 00 80 lea -0x80000000(%eax),%ebx // The permissions here are overly generous, but they can // be further restricted by the permissions in the page table // entries, if necessary. *pde = V2P(pgtab) | PTE_P | PTE_W | PTE_U; } return &pgtab[PTX(va)]; 801067a4: c1 ef 0a shr $0xa,%edi } 801067a7: 8d 65 f4 lea -0xc(%ebp),%esp return &pgtab[PTX(va)]; 801067aa: 89 fa mov %edi,%edx 801067ac: 81 e2 fc 0f 00 00 and $0xffc,%edx 801067b2: 8d 04 13 lea (%ebx,%edx,1),%eax } 801067b5: 5b pop %ebx 801067b6: 5e pop %esi 801067b7: 5f pop %edi 801067b8: 5d pop %ebp 801067b9: c3 ret 801067ba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(!alloc || (pgtab = (pte_t*)kalloc()) == 0) 801067c0: 85 c9 test %ecx,%ecx 801067c2: 74 2c je 801067f0 <walkpgdir+0x70> 801067c4: e8 17 be ff ff call 801025e0 <kalloc> 801067c9: 85 c0 test %eax,%eax 801067cb: 89 c3 mov %eax,%ebx 801067cd: 74 21 je 801067f0 <walkpgdir+0x70> memset(pgtab, 0, PGSIZE); 801067cf: 83 ec 04 sub $0x4,%esp 801067d2: 68 00 10 00 00 push $0x1000 801067d7: 6a 00 push $0x0 801067d9: 50 push %eax 801067da: e8 b1 dd ff ff call 80104590 <memset> *pde = V2P(pgtab) | PTE_P | PTE_W | PTE_U; 801067df: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax 801067e5: 83 c4 10 add $0x10,%esp 801067e8: 83 c8 07 or $0x7,%eax 801067eb: 89 06 mov %eax,(%esi) 801067ed: eb b5 jmp 801067a4 <walkpgdir+0x24> 801067ef: 90 nop } 801067f0: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 801067f3: 31 c0 xor %eax,%eax } 801067f5: 5b pop %ebx 801067f6: 5e pop %esi 801067f7: 5f pop %edi 801067f8: 5d pop %ebp 801067f9: c3 ret 801067fa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106800 <mappages>: // Create PTEs for virtual addresses starting at va that refer to // physical addresses starting at pa. va and size might not // be page-aligned. static int mappages(pde_t *pgdir, void *va, uint size, uint pa, int perm) { 80106800: 55 push %ebp 80106801: 89 e5 mov %esp,%ebp 80106803: 57 push %edi 80106804: 56 push %esi 80106805: 53 push %ebx char *a, *last; pte_t *pte; a = (char*)PGROUNDDOWN((uint)va); 80106806: 89 d3 mov %edx,%ebx 80106808: 81 e3 00 f0 ff ff and $0xfffff000,%ebx { 8010680e: 83 ec 1c sub $0x1c,%esp 80106811: 89 45 e4 mov %eax,-0x1c(%ebp) last = (char*)PGROUNDDOWN(((uint)va) + size - 1); 80106814: 8d 44 0a ff lea -0x1(%edx,%ecx,1),%eax 80106818: 8b 7d 08 mov 0x8(%ebp),%edi 8010681b: 25 00 f0 ff ff and $0xfffff000,%eax 80106820: 89 45 e0 mov %eax,-0x20(%ebp) for(;;){ if((pte = walkpgdir(pgdir, a, 1)) == 0) return -1; if(*pte & PTE_P) panic("remap"); *pte = pa | perm | PTE_P; 80106823: 8b 45 0c mov 0xc(%ebp),%eax 80106826: 29 df sub %ebx,%edi 80106828: 83 c8 01 or $0x1,%eax 8010682b: 89 45 dc mov %eax,-0x24(%ebp) 8010682e: eb 15 jmp 80106845 <mappages+0x45> if(*pte & PTE_P) 80106830: f6 00 01 testb $0x1,(%eax) 80106833: 75 45 jne 8010687a <mappages+0x7a> *pte = pa | perm | PTE_P; 80106835: 0b 75 dc or -0x24(%ebp),%esi if(a == last) 80106838: 3b 5d e0 cmp -0x20(%ebp),%ebx *pte = pa | perm | PTE_P; 8010683b: 89 30 mov %esi,(%eax) if(a == last) 8010683d: 74 31 je 80106870 <mappages+0x70> break; a += PGSIZE; 8010683f: 81 c3 00 10 00 00 add $0x1000,%ebx if((pte = walkpgdir(pgdir, a, 1)) == 0) 80106845: 8b 45 e4 mov -0x1c(%ebp),%eax 80106848: b9 01 00 00 00 mov $0x1,%ecx 8010684d: 89 da mov %ebx,%edx 8010684f: 8d 34 3b lea (%ebx,%edi,1),%esi 80106852: e8 29 ff ff ff call 80106780 <walkpgdir> 80106857: 85 c0 test %eax,%eax 80106859: 75 d5 jne 80106830 <mappages+0x30> pa += PGSIZE; } return 0; } 8010685b: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 8010685e: b8 ff ff ff ff mov $0xffffffff,%eax } 80106863: 5b pop %ebx 80106864: 5e pop %esi 80106865: 5f pop %edi 80106866: 5d pop %ebp 80106867: c3 ret 80106868: 90 nop 80106869: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106870: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 80106873: 31 c0 xor %eax,%eax } 80106875: 5b pop %ebx 80106876: 5e pop %esi 80106877: 5f pop %edi 80106878: 5d pop %ebp 80106879: c3 ret panic("remap"); 8010687a: 83 ec 0c sub $0xc,%esp 8010687d: 68 b0 79 10 80 push $0x801079b0 80106882: e8 09 9b ff ff call 80100390 <panic> 80106887: 89 f6 mov %esi,%esi 80106889: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106890 <deallocuvm.part.0>: // Deallocate user pages to bring the process size from oldsz to // newsz. oldsz and newsz need not be page-aligned, nor does newsz // need to be less than oldsz. oldsz can be larger than the actual // process size. Returns the new process size. int deallocuvm(pde_t *pgdir, uint oldsz, uint newsz) 80106890: 55 push %ebp 80106891: 89 e5 mov %esp,%ebp 80106893: 57 push %edi 80106894: 56 push %esi 80106895: 53 push %ebx uint a, pa; if(newsz >= oldsz) return oldsz; a = PGROUNDUP(newsz); 80106896: 8d 99 ff 0f 00 00 lea 0xfff(%ecx),%ebx deallocuvm(pde_t *pgdir, uint oldsz, uint newsz) 8010689c: 89 c7 mov %eax,%edi a = PGROUNDUP(newsz); 8010689e: 81 e3 00 f0 ff ff and $0xfffff000,%ebx deallocuvm(pde_t *pgdir, uint oldsz, uint newsz) 801068a4: 83 ec 1c sub $0x1c,%esp 801068a7: 89 4d e0 mov %ecx,-0x20(%ebp) for(; a < oldsz; a += PGSIZE){ 801068aa: 39 d3 cmp %edx,%ebx 801068ac: 73 66 jae 80106914 <deallocuvm.part.0+0x84> 801068ae: 89 d6 mov %edx,%esi 801068b0: eb 3d jmp 801068ef <deallocuvm.part.0+0x5f> 801068b2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi pte = walkpgdir(pgdir, (char*)a, 0); if(!pte) a = PGADDR(PDX(a) + 1, 0, 0) - PGSIZE; else if((*pte & PTE_P) != 0){ 801068b8: 8b 10 mov (%eax),%edx 801068ba: f6 c2 01 test $0x1,%dl 801068bd: 74 26 je 801068e5 <deallocuvm.part.0+0x55> pa = PTE_ADDR(*pte); if(pa == 0) 801068bf: 81 e2 00 f0 ff ff and $0xfffff000,%edx 801068c5: 74 58 je 8010691f <deallocuvm.part.0+0x8f> panic("kfree"); char *v = P2V(pa); kfree(v); 801068c7: 83 ec 0c sub $0xc,%esp char *v = P2V(pa); 801068ca: 81 c2 00 00 00 80 add $0x80000000,%edx 801068d0: 89 45 e4 mov %eax,-0x1c(%ebp) kfree(v); 801068d3: 52 push %edx 801068d4: e8 57 bb ff ff call 80102430 <kfree> *pte = 0; 801068d9: 8b 45 e4 mov -0x1c(%ebp),%eax 801068dc: 83 c4 10 add $0x10,%esp 801068df: c7 00 00 00 00 00 movl $0x0,(%eax) for(; a < oldsz; a += PGSIZE){ 801068e5: 81 c3 00 10 00 00 add $0x1000,%ebx 801068eb: 39 f3 cmp %esi,%ebx 801068ed: 73 25 jae 80106914 <deallocuvm.part.0+0x84> pte = walkpgdir(pgdir, (char*)a, 0); 801068ef: 31 c9 xor %ecx,%ecx 801068f1: 89 da mov %ebx,%edx 801068f3: 89 f8 mov %edi,%eax 801068f5: e8 86 fe ff ff call 80106780 <walkpgdir> if(!pte) 801068fa: 85 c0 test %eax,%eax 801068fc: 75 ba jne 801068b8 <deallocuvm.part.0+0x28> a = PGADDR(PDX(a) + 1, 0, 0) - PGSIZE; 801068fe: 81 e3 00 00 c0 ff and $0xffc00000,%ebx 80106904: 81 c3 00 f0 3f 00 add $0x3ff000,%ebx for(; a < oldsz; a += PGSIZE){ 8010690a: 81 c3 00 10 00 00 add $0x1000,%ebx 80106910: 39 f3 cmp %esi,%ebx 80106912: 72 db jb 801068ef <deallocuvm.part.0+0x5f> } } return newsz; } 80106914: 8b 45 e0 mov -0x20(%ebp),%eax 80106917: 8d 65 f4 lea -0xc(%ebp),%esp 8010691a: 5b pop %ebx 8010691b: 5e pop %esi 8010691c: 5f pop %edi 8010691d: 5d pop %ebp 8010691e: c3 ret panic("kfree"); 8010691f: 83 ec 0c sub $0xc,%esp 80106922: 68 42 73 10 80 push $0x80107342 80106927: e8 64 9a ff ff call 80100390 <panic> 8010692c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80106930 <seginit>: { 80106930: 55 push %ebp 80106931: 89 e5 mov %esp,%ebp 80106933: 83 ec 18 sub $0x18,%esp c = &cpus[cpuid()]; 80106936: e8 a5 cf ff ff call 801038e0 <cpuid> 8010693b: 69 c0 b0 00 00 00 imul $0xb0,%eax,%eax pd[0] = size-1; 80106941: ba 2f 00 00 00 mov $0x2f,%edx 80106946: 66 89 55 f2 mov %dx,-0xe(%ebp) c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0); 8010694a: c7 80 f8 27 11 80 ff movl $0xffff,-0x7feed808(%eax) 80106951: ff 00 00 80106954: c7 80 fc 27 11 80 00 movl $0xcf9a00,-0x7feed804(%eax) 8010695b: 9a cf 00 c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0); 8010695e: c7 80 00 28 11 80 ff movl $0xffff,-0x7feed800(%eax) 80106965: ff 00 00 80106968: c7 80 04 28 11 80 00 movl $0xcf9200,-0x7feed7fc(%eax) 8010696f: 92 cf 00 c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER); 80106972: c7 80 08 28 11 80 ff movl $0xffff,-0x7feed7f8(%eax) 80106979: ff 00 00 8010697c: c7 80 0c 28 11 80 00 movl $0xcffa00,-0x7feed7f4(%eax) 80106983: fa cf 00 c->gdt[SEG_UDATA] = SEG(STA_W, 0, 0xffffffff, DPL_USER); 80106986: c7 80 10 28 11 80 ff movl $0xffff,-0x7feed7f0(%eax) 8010698d: ff 00 00 80106990: c7 80 14 28 11 80 00 movl $0xcff200,-0x7feed7ec(%eax) 80106997: f2 cf 00 lgdt(c->gdt, sizeof(c->gdt)); 8010699a: 05 f0 27 11 80 add $0x801127f0,%eax pd[1] = (uint)p; 8010699f: 66 89 45 f4 mov %ax,-0xc(%ebp) pd[2] = (uint)p >> 16; 801069a3: c1 e8 10 shr $0x10,%eax 801069a6: 66 89 45 f6 mov %ax,-0xa(%ebp) asm volatile("lgdt (%0)" : : "r" (pd)); 801069aa: 8d 45 f2 lea -0xe(%ebp),%eax 801069ad: 0f 01 10 lgdtl (%eax) } 801069b0: c9 leave 801069b1: c3 ret 801069b2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801069b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801069c0 <switchkvm>: lcr3(V2P(kpgdir)); // switch to the kernel page table 801069c0: a1 a4 54 11 80 mov 0x801154a4,%eax { 801069c5: 55 push %ebp 801069c6: 89 e5 mov %esp,%ebp lcr3(V2P(kpgdir)); // switch to the kernel page table 801069c8: 05 00 00 00 80 add $0x80000000,%eax } static inline void lcr3(uint val) { asm volatile("movl %0,%%cr3" : : "r" (val)); 801069cd: 0f 22 d8 mov %eax,%cr3 } 801069d0: 5d pop %ebp 801069d1: c3 ret 801069d2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801069d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801069e0 <switchuvm>: { 801069e0: 55 push %ebp 801069e1: 89 e5 mov %esp,%ebp 801069e3: 57 push %edi 801069e4: 56 push %esi 801069e5: 53 push %ebx 801069e6: 83 ec 1c sub $0x1c,%esp 801069e9: 8b 5d 08 mov 0x8(%ebp),%ebx if(p == 0) 801069ec: 85 db test %ebx,%ebx 801069ee: 0f 84 cb 00 00 00 je 80106abf <switchuvm+0xdf> if(p->kstack == 0) 801069f4: 8b 43 08 mov 0x8(%ebx),%eax 801069f7: 85 c0 test %eax,%eax 801069f9: 0f 84 da 00 00 00 je 80106ad9 <switchuvm+0xf9> if(p->pgdir == 0) 801069ff: 8b 43 04 mov 0x4(%ebx),%eax 80106a02: 85 c0 test %eax,%eax 80106a04: 0f 84 c2 00 00 00 je 80106acc <switchuvm+0xec> pushcli(); 80106a0a: e8 a1 d9 ff ff call 801043b0 <pushcli> mycpu()->gdt[SEG_TSS] = SEG16(STS_T32A, &mycpu()->ts, 80106a0f: e8 4c ce ff ff call 80103860 <mycpu> 80106a14: 89 c6 mov %eax,%esi 80106a16: e8 45 ce ff ff call 80103860 <mycpu> 80106a1b: 89 c7 mov %eax,%edi 80106a1d: e8 3e ce ff ff call 80103860 <mycpu> 80106a22: 89 45 e4 mov %eax,-0x1c(%ebp) 80106a25: 83 c7 08 add $0x8,%edi 80106a28: e8 33 ce ff ff call 80103860 <mycpu> 80106a2d: 8b 4d e4 mov -0x1c(%ebp),%ecx 80106a30: 83 c0 08 add $0x8,%eax 80106a33: ba 67 00 00 00 mov $0x67,%edx 80106a38: c1 e8 18 shr $0x18,%eax 80106a3b: 66 89 96 98 00 00 00 mov %dx,0x98(%esi) 80106a42: 66 89 be 9a 00 00 00 mov %di,0x9a(%esi) 80106a49: 88 86 9f 00 00 00 mov %al,0x9f(%esi) mycpu()->ts.iomb = (ushort) 0xFFFF; 80106a4f: bf ff ff ff ff mov $0xffffffff,%edi mycpu()->gdt[SEG_TSS] = SEG16(STS_T32A, &mycpu()->ts, 80106a54: 83 c1 08 add $0x8,%ecx 80106a57: c1 e9 10 shr $0x10,%ecx 80106a5a: 88 8e 9c 00 00 00 mov %cl,0x9c(%esi) 80106a60: b9 99 40 00 00 mov $0x4099,%ecx 80106a65: 66 89 8e 9d 00 00 00 mov %cx,0x9d(%esi) mycpu()->ts.ss0 = SEG_KDATA << 3; 80106a6c: be 10 00 00 00 mov $0x10,%esi mycpu()->gdt[SEG_TSS].s = 0; 80106a71: e8 ea cd ff ff call 80103860 <mycpu> 80106a76: 80 a0 9d 00 00 00 ef andb $0xef,0x9d(%eax) mycpu()->ts.ss0 = SEG_KDATA << 3; 80106a7d: e8 de cd ff ff call 80103860 <mycpu> 80106a82: 66 89 70 10 mov %si,0x10(%eax) mycpu()->ts.esp0 = (uint)p->kstack + KSTACKSIZE; 80106a86: 8b 73 08 mov 0x8(%ebx),%esi 80106a89: e8 d2 cd ff ff call 80103860 <mycpu> 80106a8e: 81 c6 00 10 00 00 add $0x1000,%esi 80106a94: 89 70 0c mov %esi,0xc(%eax) mycpu()->ts.iomb = (ushort) 0xFFFF; 80106a97: e8 c4 cd ff ff call 80103860 <mycpu> 80106a9c: 66 89 78 6e mov %di,0x6e(%eax) asm volatile("ltr %0" : : "r" (sel)); 80106aa0: b8 28 00 00 00 mov $0x28,%eax 80106aa5: 0f 00 d8 ltr %ax lcr3(V2P(p->pgdir)); // switch to process's address space 80106aa8: 8b 43 04 mov 0x4(%ebx),%eax 80106aab: 05 00 00 00 80 add $0x80000000,%eax asm volatile("movl %0,%%cr3" : : "r" (val)); 80106ab0: 0f 22 d8 mov %eax,%cr3 } 80106ab3: 8d 65 f4 lea -0xc(%ebp),%esp 80106ab6: 5b pop %ebx 80106ab7: 5e pop %esi 80106ab8: 5f pop %edi 80106ab9: 5d pop %ebp popcli(); 80106aba: e9 31 d9 ff ff jmp 801043f0 <popcli> panic("switchuvm: no process"); 80106abf: 83 ec 0c sub $0xc,%esp 80106ac2: 68 b6 79 10 80 push $0x801079b6 80106ac7: e8 c4 98 ff ff call 80100390 <panic> panic("switchuvm: no pgdir"); 80106acc: 83 ec 0c sub $0xc,%esp 80106acf: 68 e1 79 10 80 push $0x801079e1 80106ad4: e8 b7 98 ff ff call 80100390 <panic> panic("switchuvm: no kstack"); 80106ad9: 83 ec 0c sub $0xc,%esp 80106adc: 68 cc 79 10 80 push $0x801079cc 80106ae1: e8 aa 98 ff ff call 80100390 <panic> 80106ae6: 8d 76 00 lea 0x0(%esi),%esi 80106ae9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106af0 <inituvm>: { 80106af0: 55 push %ebp 80106af1: 89 e5 mov %esp,%ebp 80106af3: 57 push %edi 80106af4: 56 push %esi 80106af5: 53 push %ebx 80106af6: 83 ec 1c sub $0x1c,%esp 80106af9: 8b 75 10 mov 0x10(%ebp),%esi 80106afc: 8b 45 08 mov 0x8(%ebp),%eax 80106aff: 8b 7d 0c mov 0xc(%ebp),%edi if(sz >= PGSIZE) 80106b02: 81 fe ff 0f 00 00 cmp $0xfff,%esi { 80106b08: 89 45 e4 mov %eax,-0x1c(%ebp) if(sz >= PGSIZE) 80106b0b: 77 49 ja 80106b56 <inituvm+0x66> mem = kalloc(); 80106b0d: e8 ce ba ff ff call 801025e0 <kalloc> memset(mem, 0, PGSIZE); 80106b12: 83 ec 04 sub $0x4,%esp mem = kalloc(); 80106b15: 89 c3 mov %eax,%ebx memset(mem, 0, PGSIZE); 80106b17: 68 00 10 00 00 push $0x1000 80106b1c: 6a 00 push $0x0 80106b1e: 50 push %eax 80106b1f: e8 6c da ff ff call 80104590 <memset> mappages(pgdir, 0, PGSIZE, V2P(mem), PTE_W|PTE_U); 80106b24: 58 pop %eax 80106b25: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax 80106b2b: b9 00 10 00 00 mov $0x1000,%ecx 80106b30: 5a pop %edx 80106b31: 6a 06 push $0x6 80106b33: 50 push %eax 80106b34: 31 d2 xor %edx,%edx 80106b36: 8b 45 e4 mov -0x1c(%ebp),%eax 80106b39: e8 c2 fc ff ff call 80106800 <mappages> memmove(mem, init, sz); 80106b3e: 89 75 10 mov %esi,0x10(%ebp) 80106b41: 89 7d 0c mov %edi,0xc(%ebp) 80106b44: 83 c4 10 add $0x10,%esp 80106b47: 89 5d 08 mov %ebx,0x8(%ebp) } 80106b4a: 8d 65 f4 lea -0xc(%ebp),%esp 80106b4d: 5b pop %ebx 80106b4e: 5e pop %esi 80106b4f: 5f pop %edi 80106b50: 5d pop %ebp memmove(mem, init, sz); 80106b51: e9 ea da ff ff jmp 80104640 <memmove> panic("inituvm: more than a page"); 80106b56: 83 ec 0c sub $0xc,%esp 80106b59: 68 f5 79 10 80 push $0x801079f5 80106b5e: e8 2d 98 ff ff call 80100390 <panic> 80106b63: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106b69: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106b70 <loaduvm>: { 80106b70: 55 push %ebp 80106b71: 89 e5 mov %esp,%ebp 80106b73: 57 push %edi 80106b74: 56 push %esi 80106b75: 53 push %ebx 80106b76: 83 ec 0c sub $0xc,%esp if((uint) addr % PGSIZE != 0) 80106b79: f7 45 0c ff 0f 00 00 testl $0xfff,0xc(%ebp) 80106b80: 0f 85 91 00 00 00 jne 80106c17 <loaduvm+0xa7> for(i = 0; i < sz; i += PGSIZE){ 80106b86: 8b 75 18 mov 0x18(%ebp),%esi 80106b89: 31 db xor %ebx,%ebx 80106b8b: 85 f6 test %esi,%esi 80106b8d: 75 1a jne 80106ba9 <loaduvm+0x39> 80106b8f: eb 6f jmp 80106c00 <loaduvm+0x90> 80106b91: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106b98: 81 c3 00 10 00 00 add $0x1000,%ebx 80106b9e: 81 ee 00 10 00 00 sub $0x1000,%esi 80106ba4: 39 5d 18 cmp %ebx,0x18(%ebp) 80106ba7: 76 57 jbe 80106c00 <loaduvm+0x90> if((pte = walkpgdir(pgdir, addr+i, 0)) == 0) 80106ba9: 8b 55 0c mov 0xc(%ebp),%edx 80106bac: 8b 45 08 mov 0x8(%ebp),%eax 80106baf: 31 c9 xor %ecx,%ecx 80106bb1: 01 da add %ebx,%edx 80106bb3: e8 c8 fb ff ff call 80106780 <walkpgdir> 80106bb8: 85 c0 test %eax,%eax 80106bba: 74 4e je 80106c0a <loaduvm+0x9a> pa = PTE_ADDR(*pte); 80106bbc: 8b 00 mov (%eax),%eax if(readi(ip, P2V(pa), offset+i, n) != n) 80106bbe: 8b 4d 14 mov 0x14(%ebp),%ecx if(sz - i < PGSIZE) 80106bc1: bf 00 10 00 00 mov $0x1000,%edi pa = PTE_ADDR(*pte); 80106bc6: 25 00 f0 ff ff and $0xfffff000,%eax if(sz - i < PGSIZE) 80106bcb: 81 fe ff 0f 00 00 cmp $0xfff,%esi 80106bd1: 0f 46 fe cmovbe %esi,%edi if(readi(ip, P2V(pa), offset+i, n) != n) 80106bd4: 01 d9 add %ebx,%ecx 80106bd6: 05 00 00 00 80 add $0x80000000,%eax 80106bdb: 57 push %edi 80106bdc: 51 push %ecx 80106bdd: 50 push %eax 80106bde: ff 75 10 pushl 0x10(%ebp) 80106be1: e8 8a ad ff ff call 80101970 <readi> 80106be6: 83 c4 10 add $0x10,%esp 80106be9: 39 f8 cmp %edi,%eax 80106beb: 74 ab je 80106b98 <loaduvm+0x28> } 80106bed: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 80106bf0: b8 ff ff ff ff mov $0xffffffff,%eax } 80106bf5: 5b pop %ebx 80106bf6: 5e pop %esi 80106bf7: 5f pop %edi 80106bf8: 5d pop %ebp 80106bf9: c3 ret 80106bfa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106c00: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 80106c03: 31 c0 xor %eax,%eax } 80106c05: 5b pop %ebx 80106c06: 5e pop %esi 80106c07: 5f pop %edi 80106c08: 5d pop %ebp 80106c09: c3 ret panic("loaduvm: address should exist"); 80106c0a: 83 ec 0c sub $0xc,%esp 80106c0d: 68 0f 7a 10 80 push $0x80107a0f 80106c12: e8 79 97 ff ff call 80100390 <panic> panic("loaduvm: addr must be page aligned"); 80106c17: 83 ec 0c sub $0xc,%esp 80106c1a: 68 b0 7a 10 80 push $0x80107ab0 80106c1f: e8 6c 97 ff ff call 80100390 <panic> 80106c24: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106c2a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80106c30 <allocuvm>: { 80106c30: 55 push %ebp 80106c31: 89 e5 mov %esp,%ebp 80106c33: 57 push %edi 80106c34: 56 push %esi 80106c35: 53 push %ebx 80106c36: 83 ec 1c sub $0x1c,%esp if(newsz >= KERNBASE) 80106c39: 8b 7d 10 mov 0x10(%ebp),%edi 80106c3c: 85 ff test %edi,%edi 80106c3e: 0f 88 8e 00 00 00 js 80106cd2 <allocuvm+0xa2> if(newsz < oldsz) 80106c44: 3b 7d 0c cmp 0xc(%ebp),%edi 80106c47: 0f 82 93 00 00 00 jb 80106ce0 <allocuvm+0xb0> a = PGROUNDUP(oldsz); 80106c4d: 8b 45 0c mov 0xc(%ebp),%eax 80106c50: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 80106c56: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for(; a < newsz; a += PGSIZE){ 80106c5c: 39 5d 10 cmp %ebx,0x10(%ebp) 80106c5f: 0f 86 7e 00 00 00 jbe 80106ce3 <allocuvm+0xb3> 80106c65: 89 7d e4 mov %edi,-0x1c(%ebp) 80106c68: 8b 7d 08 mov 0x8(%ebp),%edi 80106c6b: eb 42 jmp 80106caf <allocuvm+0x7f> 80106c6d: 8d 76 00 lea 0x0(%esi),%esi memset(mem, 0, PGSIZE); 80106c70: 83 ec 04 sub $0x4,%esp 80106c73: 68 00 10 00 00 push $0x1000 80106c78: 6a 00 push $0x0 80106c7a: 50 push %eax 80106c7b: e8 10 d9 ff ff call 80104590 <memset> if(mappages(pgdir, (char*)a, PGSIZE, V2P(mem), PTE_W|PTE_U) < 0){ 80106c80: 58 pop %eax 80106c81: 8d 86 00 00 00 80 lea -0x80000000(%esi),%eax 80106c87: b9 00 10 00 00 mov $0x1000,%ecx 80106c8c: 5a pop %edx 80106c8d: 6a 06 push $0x6 80106c8f: 50 push %eax 80106c90: 89 da mov %ebx,%edx 80106c92: 89 f8 mov %edi,%eax 80106c94: e8 67 fb ff ff call 80106800 <mappages> 80106c99: 83 c4 10 add $0x10,%esp 80106c9c: 85 c0 test %eax,%eax 80106c9e: 78 50 js 80106cf0 <allocuvm+0xc0> for(; a < newsz; a += PGSIZE){ 80106ca0: 81 c3 00 10 00 00 add $0x1000,%ebx 80106ca6: 39 5d 10 cmp %ebx,0x10(%ebp) 80106ca9: 0f 86 81 00 00 00 jbe 80106d30 <allocuvm+0x100> mem = kalloc(); 80106caf: e8 2c b9 ff ff call 801025e0 <kalloc> if(mem == 0){ 80106cb4: 85 c0 test %eax,%eax mem = kalloc(); 80106cb6: 89 c6 mov %eax,%esi if(mem == 0){ 80106cb8: 75 b6 jne 80106c70 <allocuvm+0x40> cprintf("allocuvm out of memory\n"); 80106cba: 83 ec 0c sub $0xc,%esp 80106cbd: 68 2d 7a 10 80 push $0x80107a2d 80106cc2: e8 99 99 ff ff call 80100660 <cprintf> if(newsz >= oldsz) 80106cc7: 83 c4 10 add $0x10,%esp 80106cca: 8b 45 0c mov 0xc(%ebp),%eax 80106ccd: 39 45 10 cmp %eax,0x10(%ebp) 80106cd0: 77 6e ja 80106d40 <allocuvm+0x110> } 80106cd2: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 80106cd5: 31 ff xor %edi,%edi } 80106cd7: 89 f8 mov %edi,%eax 80106cd9: 5b pop %ebx 80106cda: 5e pop %esi 80106cdb: 5f pop %edi 80106cdc: 5d pop %ebp 80106cdd: c3 ret 80106cde: 66 90 xchg %ax,%ax return oldsz; 80106ce0: 8b 7d 0c mov 0xc(%ebp),%edi } 80106ce3: 8d 65 f4 lea -0xc(%ebp),%esp 80106ce6: 89 f8 mov %edi,%eax 80106ce8: 5b pop %ebx 80106ce9: 5e pop %esi 80106cea: 5f pop %edi 80106ceb: 5d pop %ebp 80106cec: c3 ret 80106ced: 8d 76 00 lea 0x0(%esi),%esi cprintf("allocuvm out of memory (2)\n"); 80106cf0: 83 ec 0c sub $0xc,%esp 80106cf3: 68 45 7a 10 80 push $0x80107a45 80106cf8: e8 63 99 ff ff call 80100660 <cprintf> if(newsz >= oldsz) 80106cfd: 83 c4 10 add $0x10,%esp 80106d00: 8b 45 0c mov 0xc(%ebp),%eax 80106d03: 39 45 10 cmp %eax,0x10(%ebp) 80106d06: 76 0d jbe 80106d15 <allocuvm+0xe5> 80106d08: 89 c1 mov %eax,%ecx 80106d0a: 8b 55 10 mov 0x10(%ebp),%edx 80106d0d: 8b 45 08 mov 0x8(%ebp),%eax 80106d10: e8 7b fb ff ff call 80106890 <deallocuvm.part.0> kfree(mem); 80106d15: 83 ec 0c sub $0xc,%esp return 0; 80106d18: 31 ff xor %edi,%edi kfree(mem); 80106d1a: 56 push %esi 80106d1b: e8 10 b7 ff ff call 80102430 <kfree> return 0; 80106d20: 83 c4 10 add $0x10,%esp } 80106d23: 8d 65 f4 lea -0xc(%ebp),%esp 80106d26: 89 f8 mov %edi,%eax 80106d28: 5b pop %ebx 80106d29: 5e pop %esi 80106d2a: 5f pop %edi 80106d2b: 5d pop %ebp 80106d2c: c3 ret 80106d2d: 8d 76 00 lea 0x0(%esi),%esi 80106d30: 8b 7d e4 mov -0x1c(%ebp),%edi 80106d33: 8d 65 f4 lea -0xc(%ebp),%esp 80106d36: 5b pop %ebx 80106d37: 89 f8 mov %edi,%eax 80106d39: 5e pop %esi 80106d3a: 5f pop %edi 80106d3b: 5d pop %ebp 80106d3c: c3 ret 80106d3d: 8d 76 00 lea 0x0(%esi),%esi 80106d40: 89 c1 mov %eax,%ecx 80106d42: 8b 55 10 mov 0x10(%ebp),%edx 80106d45: 8b 45 08 mov 0x8(%ebp),%eax return 0; 80106d48: 31 ff xor %edi,%edi 80106d4a: e8 41 fb ff ff call 80106890 <deallocuvm.part.0> 80106d4f: eb 92 jmp 80106ce3 <allocuvm+0xb3> 80106d51: eb 0d jmp 80106d60 <deallocuvm> 80106d53: 90 nop 80106d54: 90 nop 80106d55: 90 nop 80106d56: 90 nop 80106d57: 90 nop 80106d58: 90 nop 80106d59: 90 nop 80106d5a: 90 nop 80106d5b: 90 nop 80106d5c: 90 nop 80106d5d: 90 nop 80106d5e: 90 nop 80106d5f: 90 nop 80106d60 <deallocuvm>: { 80106d60: 55 push %ebp 80106d61: 89 e5 mov %esp,%ebp 80106d63: 8b 55 0c mov 0xc(%ebp),%edx 80106d66: 8b 4d 10 mov 0x10(%ebp),%ecx 80106d69: 8b 45 08 mov 0x8(%ebp),%eax if(newsz >= oldsz) 80106d6c: 39 d1 cmp %edx,%ecx 80106d6e: 73 10 jae 80106d80 <deallocuvm+0x20> } 80106d70: 5d pop %ebp 80106d71: e9 1a fb ff ff jmp 80106890 <deallocuvm.part.0> 80106d76: 8d 76 00 lea 0x0(%esi),%esi 80106d79: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106d80: 89 d0 mov %edx,%eax 80106d82: 5d pop %ebp 80106d83: c3 ret 80106d84: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106d8a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80106d90 <freevm>: // Free a page table and all the physical memory pages // in the user part. void freevm(pde_t *pgdir) { 80106d90: 55 push %ebp 80106d91: 89 e5 mov %esp,%ebp 80106d93: 57 push %edi 80106d94: 56 push %esi 80106d95: 53 push %ebx 80106d96: 83 ec 0c sub $0xc,%esp 80106d99: 8b 75 08 mov 0x8(%ebp),%esi uint i; if(pgdir == 0) 80106d9c: 85 f6 test %esi,%esi 80106d9e: 74 59 je 80106df9 <freevm+0x69> 80106da0: 31 c9 xor %ecx,%ecx 80106da2: ba 00 00 00 80 mov $0x80000000,%edx 80106da7: 89 f0 mov %esi,%eax 80106da9: e8 e2 fa ff ff call 80106890 <deallocuvm.part.0> 80106dae: 89 f3 mov %esi,%ebx 80106db0: 8d be 00 10 00 00 lea 0x1000(%esi),%edi 80106db6: eb 0f jmp 80106dc7 <freevm+0x37> 80106db8: 90 nop 80106db9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106dc0: 83 c3 04 add $0x4,%ebx panic("freevm: no pgdir"); deallocuvm(pgdir, KERNBASE, 0); for(i = 0; i < NPDENTRIES; i++){ 80106dc3: 39 fb cmp %edi,%ebx 80106dc5: 74 23 je 80106dea <freevm+0x5a> if(pgdir[i] & PTE_P){ 80106dc7: 8b 03 mov (%ebx),%eax 80106dc9: a8 01 test $0x1,%al 80106dcb: 74 f3 je 80106dc0 <freevm+0x30> char * v = P2V(PTE_ADDR(pgdir[i])); 80106dcd: 25 00 f0 ff ff and $0xfffff000,%eax kfree(v); 80106dd2: 83 ec 0c sub $0xc,%esp 80106dd5: 83 c3 04 add $0x4,%ebx char * v = P2V(PTE_ADDR(pgdir[i])); 80106dd8: 05 00 00 00 80 add $0x80000000,%eax kfree(v); 80106ddd: 50 push %eax 80106dde: e8 4d b6 ff ff call 80102430 <kfree> 80106de3: 83 c4 10 add $0x10,%esp for(i = 0; i < NPDENTRIES; i++){ 80106de6: 39 fb cmp %edi,%ebx 80106de8: 75 dd jne 80106dc7 <freevm+0x37> } } kfree((char*)pgdir); 80106dea: 89 75 08 mov %esi,0x8(%ebp) } 80106ded: 8d 65 f4 lea -0xc(%ebp),%esp 80106df0: 5b pop %ebx 80106df1: 5e pop %esi 80106df2: 5f pop %edi 80106df3: 5d pop %ebp kfree((char*)pgdir); 80106df4: e9 37 b6 ff ff jmp 80102430 <kfree> panic("freevm: no pgdir"); 80106df9: 83 ec 0c sub $0xc,%esp 80106dfc: 68 61 7a 10 80 push $0x80107a61 80106e01: e8 8a 95 ff ff call 80100390 <panic> 80106e06: 8d 76 00 lea 0x0(%esi),%esi 80106e09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106e10 <setupkvm>: { 80106e10: 55 push %ebp 80106e11: 89 e5 mov %esp,%ebp 80106e13: 56 push %esi 80106e14: 53 push %ebx if((pgdir = (pde_t*)kalloc()) == 0) 80106e15: e8 c6 b7 ff ff call 801025e0 <kalloc> 80106e1a: 85 c0 test %eax,%eax 80106e1c: 89 c6 mov %eax,%esi 80106e1e: 74 42 je 80106e62 <setupkvm+0x52> memset(pgdir, 0, PGSIZE); 80106e20: 83 ec 04 sub $0x4,%esp for(k = kmap; k < &kmap[NELEM(kmap)]; k++) 80106e23: bb 20 a4 10 80 mov $0x8010a420,%ebx memset(pgdir, 0, PGSIZE); 80106e28: 68 00 10 00 00 push $0x1000 80106e2d: 6a 00 push $0x0 80106e2f: 50 push %eax 80106e30: e8 5b d7 ff ff call 80104590 <memset> 80106e35: 83 c4 10 add $0x10,%esp (uint)k->phys_start, k->perm) < 0) { 80106e38: 8b 43 04 mov 0x4(%ebx),%eax if(mappages(pgdir, k->virt, k->phys_end - k->phys_start, 80106e3b: 8b 4b 08 mov 0x8(%ebx),%ecx 80106e3e: 83 ec 08 sub $0x8,%esp 80106e41: 8b 13 mov (%ebx),%edx 80106e43: ff 73 0c pushl 0xc(%ebx) 80106e46: 50 push %eax 80106e47: 29 c1 sub %eax,%ecx 80106e49: 89 f0 mov %esi,%eax 80106e4b: e8 b0 f9 ff ff call 80106800 <mappages> 80106e50: 83 c4 10 add $0x10,%esp 80106e53: 85 c0 test %eax,%eax 80106e55: 78 19 js 80106e70 <setupkvm+0x60> for(k = kmap; k < &kmap[NELEM(kmap)]; k++) 80106e57: 83 c3 10 add $0x10,%ebx 80106e5a: 81 fb 60 a4 10 80 cmp $0x8010a460,%ebx 80106e60: 75 d6 jne 80106e38 <setupkvm+0x28> } 80106e62: 8d 65 f8 lea -0x8(%ebp),%esp 80106e65: 89 f0 mov %esi,%eax 80106e67: 5b pop %ebx 80106e68: 5e pop %esi 80106e69: 5d pop %ebp 80106e6a: c3 ret 80106e6b: 90 nop 80106e6c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi freevm(pgdir); 80106e70: 83 ec 0c sub $0xc,%esp 80106e73: 56 push %esi return 0; 80106e74: 31 f6 xor %esi,%esi freevm(pgdir); 80106e76: e8 15 ff ff ff call 80106d90 <freevm> return 0; 80106e7b: 83 c4 10 add $0x10,%esp } 80106e7e: 8d 65 f8 lea -0x8(%ebp),%esp 80106e81: 89 f0 mov %esi,%eax 80106e83: 5b pop %ebx 80106e84: 5e pop %esi 80106e85: 5d pop %ebp 80106e86: c3 ret 80106e87: 89 f6 mov %esi,%esi 80106e89: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106e90 <kvmalloc>: { 80106e90: 55 push %ebp 80106e91: 89 e5 mov %esp,%ebp 80106e93: 83 ec 08 sub $0x8,%esp kpgdir = setupkvm(); 80106e96: e8 75 ff ff ff call 80106e10 <setupkvm> 80106e9b: a3 a4 54 11 80 mov %eax,0x801154a4 lcr3(V2P(kpgdir)); // switch to the kernel page table 80106ea0: 05 00 00 00 80 add $0x80000000,%eax 80106ea5: 0f 22 d8 mov %eax,%cr3 } 80106ea8: c9 leave 80106ea9: c3 ret 80106eaa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106eb0 <clearpteu>: // Clear PTE_U on a page. Used to create an inaccessible // page beneath the user stack. void clearpteu(pde_t *pgdir, char *uva) { 80106eb0: 55 push %ebp pte_t *pte; pte = walkpgdir(pgdir, uva, 0); 80106eb1: 31 c9 xor %ecx,%ecx { 80106eb3: 89 e5 mov %esp,%ebp 80106eb5: 83 ec 08 sub $0x8,%esp pte = walkpgdir(pgdir, uva, 0); 80106eb8: 8b 55 0c mov 0xc(%ebp),%edx 80106ebb: 8b 45 08 mov 0x8(%ebp),%eax 80106ebe: e8 bd f8 ff ff call 80106780 <walkpgdir> if(pte == 0) 80106ec3: 85 c0 test %eax,%eax 80106ec5: 74 05 je 80106ecc <clearpteu+0x1c> panic("clearpteu"); *pte &= ~PTE_U; 80106ec7: 83 20 fb andl $0xfffffffb,(%eax) } 80106eca: c9 leave 80106ecb: c3 ret panic("clearpteu"); 80106ecc: 83 ec 0c sub $0xc,%esp 80106ecf: 68 72 7a 10 80 push $0x80107a72 80106ed4: e8 b7 94 ff ff call 80100390 <panic> 80106ed9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106ee0 <copyuvm>: // Given a parent process's page table, create a copy // of it for a child. pde_t* copyuvm(pde_t *pgdir, uint sz) { 80106ee0: 55 push %ebp 80106ee1: 89 e5 mov %esp,%ebp 80106ee3: 57 push %edi 80106ee4: 56 push %esi 80106ee5: 53 push %ebx 80106ee6: 83 ec 1c sub $0x1c,%esp pde_t *d; pte_t *pte; uint pa, i, flags; char *mem; if((d = setupkvm()) == 0) 80106ee9: e8 22 ff ff ff call 80106e10 <setupkvm> 80106eee: 85 c0 test %eax,%eax 80106ef0: 89 45 e0 mov %eax,-0x20(%ebp) 80106ef3: 0f 84 9f 00 00 00 je 80106f98 <copyuvm+0xb8> return 0; for(i = 0; i < sz; i += PGSIZE){ 80106ef9: 8b 4d 0c mov 0xc(%ebp),%ecx 80106efc: 85 c9 test %ecx,%ecx 80106efe: 0f 84 94 00 00 00 je 80106f98 <copyuvm+0xb8> 80106f04: 31 ff xor %edi,%edi 80106f06: eb 4a jmp 80106f52 <copyuvm+0x72> 80106f08: 90 nop 80106f09: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi panic("copyuvm: page not present"); pa = PTE_ADDR(*pte); flags = PTE_FLAGS(*pte); if((mem = kalloc()) == 0) goto bad; memmove(mem, (char*)P2V(pa), PGSIZE); 80106f10: 83 ec 04 sub $0x4,%esp 80106f13: 81 c3 00 00 00 80 add $0x80000000,%ebx 80106f19: 68 00 10 00 00 push $0x1000 80106f1e: 53 push %ebx 80106f1f: 50 push %eax 80106f20: e8 1b d7 ff ff call 80104640 <memmove> if(mappages(d, (void*)i, PGSIZE, V2P(mem), flags) < 0) { 80106f25: 58 pop %eax 80106f26: 8d 86 00 00 00 80 lea -0x80000000(%esi),%eax 80106f2c: b9 00 10 00 00 mov $0x1000,%ecx 80106f31: 5a pop %edx 80106f32: ff 75 e4 pushl -0x1c(%ebp) 80106f35: 50 push %eax 80106f36: 89 fa mov %edi,%edx 80106f38: 8b 45 e0 mov -0x20(%ebp),%eax 80106f3b: e8 c0 f8 ff ff call 80106800 <mappages> 80106f40: 83 c4 10 add $0x10,%esp 80106f43: 85 c0 test %eax,%eax 80106f45: 78 61 js 80106fa8 <copyuvm+0xc8> for(i = 0; i < sz; i += PGSIZE){ 80106f47: 81 c7 00 10 00 00 add $0x1000,%edi 80106f4d: 39 7d 0c cmp %edi,0xc(%ebp) 80106f50: 76 46 jbe 80106f98 <copyuvm+0xb8> if((pte = walkpgdir(pgdir, (void *) i, 0)) == 0) 80106f52: 8b 45 08 mov 0x8(%ebp),%eax 80106f55: 31 c9 xor %ecx,%ecx 80106f57: 89 fa mov %edi,%edx 80106f59: e8 22 f8 ff ff call 80106780 <walkpgdir> 80106f5e: 85 c0 test %eax,%eax 80106f60: 74 61 je 80106fc3 <copyuvm+0xe3> if(!(*pte & PTE_P)) 80106f62: 8b 00 mov (%eax),%eax 80106f64: a8 01 test $0x1,%al 80106f66: 74 4e je 80106fb6 <copyuvm+0xd6> pa = PTE_ADDR(*pte); 80106f68: 89 c3 mov %eax,%ebx flags = PTE_FLAGS(*pte); 80106f6a: 25 ff 0f 00 00 and $0xfff,%eax pa = PTE_ADDR(*pte); 80106f6f: 81 e3 00 f0 ff ff and $0xfffff000,%ebx flags = PTE_FLAGS(*pte); 80106f75: 89 45 e4 mov %eax,-0x1c(%ebp) if((mem = kalloc()) == 0) 80106f78: e8 63 b6 ff ff call 801025e0 <kalloc> 80106f7d: 85 c0 test %eax,%eax 80106f7f: 89 c6 mov %eax,%esi 80106f81: 75 8d jne 80106f10 <copyuvm+0x30> } } return d; bad: freevm(d); 80106f83: 83 ec 0c sub $0xc,%esp 80106f86: ff 75 e0 pushl -0x20(%ebp) 80106f89: e8 02 fe ff ff call 80106d90 <freevm> return 0; 80106f8e: 83 c4 10 add $0x10,%esp 80106f91: c7 45 e0 00 00 00 00 movl $0x0,-0x20(%ebp) } 80106f98: 8b 45 e0 mov -0x20(%ebp),%eax 80106f9b: 8d 65 f4 lea -0xc(%ebp),%esp 80106f9e: 5b pop %ebx 80106f9f: 5e pop %esi 80106fa0: 5f pop %edi 80106fa1: 5d pop %ebp 80106fa2: c3 ret 80106fa3: 90 nop 80106fa4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi kfree(mem); 80106fa8: 83 ec 0c sub $0xc,%esp 80106fab: 56 push %esi 80106fac: e8 7f b4 ff ff call 80102430 <kfree> goto bad; 80106fb1: 83 c4 10 add $0x10,%esp 80106fb4: eb cd jmp 80106f83 <copyuvm+0xa3> panic("copyuvm: page not present"); 80106fb6: 83 ec 0c sub $0xc,%esp 80106fb9: 68 96 7a 10 80 push $0x80107a96 80106fbe: e8 cd 93 ff ff call 80100390 <panic> panic("copyuvm: pte should exist"); 80106fc3: 83 ec 0c sub $0xc,%esp 80106fc6: 68 7c 7a 10 80 push $0x80107a7c 80106fcb: e8 c0 93 ff ff call 80100390 <panic> 80106fd0 <uva2ka>: //PAGEBREAK! // Map user virtual address to kernel address. char* uva2ka(pde_t *pgdir, char *uva) { 80106fd0: 55 push %ebp pte_t *pte; pte = walkpgdir(pgdir, uva, 0); 80106fd1: 31 c9 xor %ecx,%ecx { 80106fd3: 89 e5 mov %esp,%ebp 80106fd5: 83 ec 08 sub $0x8,%esp pte = walkpgdir(pgdir, uva, 0); 80106fd8: 8b 55 0c mov 0xc(%ebp),%edx 80106fdb: 8b 45 08 mov 0x8(%ebp),%eax 80106fde: e8 9d f7 ff ff call 80106780 <walkpgdir> if((*pte & PTE_P) == 0) 80106fe3: 8b 00 mov (%eax),%eax return 0; if((*pte & PTE_U) == 0) return 0; return (char*)P2V(PTE_ADDR(*pte)); } 80106fe5: c9 leave if((*pte & PTE_U) == 0) 80106fe6: 89 c2 mov %eax,%edx return (char*)P2V(PTE_ADDR(*pte)); 80106fe8: 25 00 f0 ff ff and $0xfffff000,%eax if((*pte & PTE_U) == 0) 80106fed: 83 e2 05 and $0x5,%edx return (char*)P2V(PTE_ADDR(*pte)); 80106ff0: 05 00 00 00 80 add $0x80000000,%eax 80106ff5: 83 fa 05 cmp $0x5,%edx 80106ff8: ba 00 00 00 00 mov $0x0,%edx 80106ffd: 0f 45 c2 cmovne %edx,%eax } 80107000: c3 ret 80107001: eb 0d jmp 80107010 <copyout> 80107003: 90 nop 80107004: 90 nop 80107005: 90 nop 80107006: 90 nop 80107007: 90 nop 80107008: 90 nop 80107009: 90 nop 8010700a: 90 nop 8010700b: 90 nop 8010700c: 90 nop 8010700d: 90 nop 8010700e: 90 nop 8010700f: 90 nop 80107010 <copyout>: // Copy len bytes from p to user address va in page table pgdir. // Most useful when pgdir is not the current page table. // uva2ka ensures this only works for PTE_U pages. int copyout(pde_t *pgdir, uint va, void *p, uint len) { 80107010: 55 push %ebp 80107011: 89 e5 mov %esp,%ebp 80107013: 57 push %edi 80107014: 56 push %esi 80107015: 53 push %ebx 80107016: 83 ec 1c sub $0x1c,%esp 80107019: 8b 5d 14 mov 0x14(%ebp),%ebx 8010701c: 8b 55 0c mov 0xc(%ebp),%edx 8010701f: 8b 7d 10 mov 0x10(%ebp),%edi char *buf, *pa0; uint n, va0; buf = (char*)p; while(len > 0){ 80107022: 85 db test %ebx,%ebx 80107024: 75 40 jne 80107066 <copyout+0x56> 80107026: eb 70 jmp 80107098 <copyout+0x88> 80107028: 90 nop 80107029: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi va0 = (uint)PGROUNDDOWN(va); pa0 = uva2ka(pgdir, (char*)va0); if(pa0 == 0) return -1; n = PGSIZE - (va - va0); 80107030: 8b 55 e4 mov -0x1c(%ebp),%edx 80107033: 89 f1 mov %esi,%ecx 80107035: 29 d1 sub %edx,%ecx 80107037: 81 c1 00 10 00 00 add $0x1000,%ecx 8010703d: 39 d9 cmp %ebx,%ecx 8010703f: 0f 47 cb cmova %ebx,%ecx if(n > len) n = len; memmove(pa0 + (va - va0), buf, n); 80107042: 29 f2 sub %esi,%edx 80107044: 83 ec 04 sub $0x4,%esp 80107047: 01 d0 add %edx,%eax 80107049: 51 push %ecx 8010704a: 57 push %edi 8010704b: 50 push %eax 8010704c: 89 4d e4 mov %ecx,-0x1c(%ebp) 8010704f: e8 ec d5 ff ff call 80104640 <memmove> len -= n; buf += n; 80107054: 8b 4d e4 mov -0x1c(%ebp),%ecx while(len > 0){ 80107057: 83 c4 10 add $0x10,%esp va = va0 + PGSIZE; 8010705a: 8d 96 00 10 00 00 lea 0x1000(%esi),%edx buf += n; 80107060: 01 cf add %ecx,%edi while(len > 0){ 80107062: 29 cb sub %ecx,%ebx 80107064: 74 32 je 80107098 <copyout+0x88> va0 = (uint)PGROUNDDOWN(va); 80107066: 89 d6 mov %edx,%esi pa0 = uva2ka(pgdir, (char*)va0); 80107068: 83 ec 08 sub $0x8,%esp va0 = (uint)PGROUNDDOWN(va); 8010706b: 89 55 e4 mov %edx,-0x1c(%ebp) 8010706e: 81 e6 00 f0 ff ff and $0xfffff000,%esi pa0 = uva2ka(pgdir, (char*)va0); 80107074: 56 push %esi 80107075: ff 75 08 pushl 0x8(%ebp) 80107078: e8 53 ff ff ff call 80106fd0 <uva2ka> if(pa0 == 0) 8010707d: 83 c4 10 add $0x10,%esp 80107080: 85 c0 test %eax,%eax 80107082: 75 ac jne 80107030 <copyout+0x20> } return 0; } 80107084: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 80107087: b8 ff ff ff ff mov $0xffffffff,%eax } 8010708c: 5b pop %ebx 8010708d: 5e pop %esi 8010708e: 5f pop %edi 8010708f: 5d pop %ebp 80107090: c3 ret 80107091: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80107098: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 8010709b: 31 c0 xor %eax,%eax } 8010709d: 5b pop %ebx 8010709e: 5e pop %esi 8010709f: 5f pop %edi 801070a0: 5d pop %ebp 801070a1: c3 ret
audio/sfx/cry0c_1.asm
AmateurPanda92/pokemon-rby-dx
9
93051
SFX_Cry0C_1_Ch4: dutycycle 204 squarenote 8, 15, 5, 1536 squarenote 2, 13, 2, 1592 squarenote 2, 12, 2, 1584 squarenote 2, 12, 2, 1576 squarenote 2, 11, 2, 1568 squarenote 2, 11, 2, 1552 squarenote 2, 10, 2, 1560 squarenote 2, 11, 2, 1552 squarenote 8, 12, 1, 1568 endchannel SFX_Cry0C_1_Ch5: dutycycle 68 squarenote 12, 12, 3, 1472 squarenote 3, 11, 1, 1529 squarenote 2, 10, 1, 1521 squarenote 2, 10, 1, 1513 squarenote 2, 9, 1, 1505 squarenote 2, 9, 1, 1497 squarenote 2, 8, 1, 1489 squarenote 2, 9, 1, 1497 squarenote 8, 9, 1, 1505 SFX_Cry0C_1_Ch7: endchannel